@veltdev/sdk-dev 6.0.50-beta.5 → 6.0.50-beta.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/{chunk-NLOIEIGJ.js → chunk-22I4DH53.js} +1 -1
  2. package/{chunk-CAALRIGT.js → chunk-2UZN24LU.js} +1 -1
  3. package/{chunk-DWIVBQK6.js → chunk-4F4E7EFW.js} +1 -1
  4. package/{chunk-PYM75BAB.js → chunk-5GGSP4VM.js} +1 -1
  5. package/{chunk-NHOP7QL6.js → chunk-6YADUX5R.js} +1 -1
  6. package/{chunk-L5TWUBGS.js → chunk-77YRJB6U.js} +1 -1
  7. package/{chunk-MDEE2FTT.js → chunk-7XUMHBJU.js} +1 -1
  8. package/{chunk-6KUMK2MP.js → chunk-A3NJZPJU.js} +1 -1
  9. package/{chunk-DQMDAUE5.js → chunk-AF2PV57S.js} +1 -1
  10. package/{chunk-NNDCHRQR.js → chunk-AZPZ6YNE.js} +1 -1
  11. package/{chunk-E6X3NCW4.js → chunk-DQRA6TYX.js} +1 -1
  12. package/{chunk-GUT6GN6S.js → chunk-IWNLZTY7.js} +1 -1
  13. package/{chunk-IOJLC3I5.js → chunk-JNWDY6EC.js} +1 -1
  14. package/{chunk-FEF5DRBZ.js → chunk-MQWR574P.js} +1 -1
  15. package/{chunk-JH5DWWPZ.js → chunk-NPHXJUYD.js} +1 -1
  16. package/{chunk-UC2WMP2Z.js → chunk-NTUJPDO3.js} +1 -1
  17. package/{chunk-YA442QAO.js → chunk-OC27IKXX.js} +1 -1
  18. package/{chunk-VIX5HTEY.js → chunk-PNGL2BK2.js} +1 -1
  19. package/{chunk-TBJGI7F4.js → chunk-RQ7JAEYC.js} +1 -1
  20. package/{chunk-XNJT33PO.js → chunk-RSU53L4Z.js} +1 -1
  21. package/{chunk-ABWKMQN7.js → chunk-S7GV42W6.js} +1 -1
  22. package/{chunk-ZEWKHCO3.js → chunk-TIAQKD26.js} +1 -1
  23. package/{chunk-Z6T6QN3X.js → chunk-TV5RRJEX.js} +1 -1
  24. package/{chunk-5L2DYVAE.js → chunk-U5WQDAMR.js} +1 -1
  25. package/{chunk-W22M7SHF.js → chunk-U65L5XOP.js} +1 -1
  26. package/{chunk-TBOWEVZE.js → chunk-V5JKL7XI.js} +1 -1
  27. package/{chunk-624HLSTM.js → chunk-VJ47SA66.js} +11 -11
  28. package/{chunk-KQ36Q2LX.js → chunk-WIO7FLS6.js} +1 -1
  29. package/{chunk-NKUCGHHW.js → chunk-XBR7WTYL.js} +1 -1
  30. package/{chunk-KDD2B3NB.js → chunk-Y2R3M2JH.js} +1 -1
  31. package/{chunk-NCUHLSF5.js → chunk-YOXKQAJM.js} +1 -1
  32. package/{chunk-REMSEUFR.js → chunk-ZB27UMZA.js} +1 -1
  33. package/{chunk-MV2ZDQ22.js → chunk-ZGDIZTBA.js} +1 -1
  34. package/chunk-ZHFA5BHC.js +6 -0
  35. package/{chunk-OVTJQL7H.js → chunk-ZJ2MICFG.js} +1 -1
  36. package/{chunk-4Q6YVCRX.js → chunk-ZZE4KN4N.js} +1 -1
  37. package/package.json +1 -1
  38. package/velt-activity-log.js +1 -1
  39. package/velt-area.js +1 -1
  40. package/velt-arrow.js +1 -1
  41. package/velt-comment.js +1 -1
  42. package/velt-crdt.js +1 -1
  43. package/velt-cursor.js +1 -1
  44. package/velt-huddle.js +1 -1
  45. package/velt-live-state-sync.js +1 -1
  46. package/velt-notification.js +1 -1
  47. package/velt-portable.js +1 -1
  48. package/velt-presence.js +1 -1
  49. package/velt-reaction.js +1 -1
  50. package/velt-recorder.js +1 -1
  51. package/velt-rewriter.js +1 -1
  52. package/velt-selection.js +1 -1
  53. package/velt-tag.js +1 -1
  54. package/velt-user-invite.js +1 -1
  55. package/velt-user-request.js +1 -1
  56. package/velt-video-player.js +1 -1
  57. package/velt-views.js +1 -1
  58. package/velt.js +5 -5
  59. package/chunk-AFPXALQ3.js +0 -6
@@ -1 +1 @@
1
- import{Fa as F}from"./chunk-AFPXALQ3.js";import{G as C,H as w}from"./chunk-XNJT33PO.js";import{E as h,G as d,He as $,Ii as D,Jk as U,K as v,M as l,Qj as k,V as n,_f as g,ba as A,di as I,ea as s,l as p,nf as M,pj as E,qj as R,r as u,rj as y,v as c,we as a,xe as m}from"./chunk-624HLSTM.js";var Z=(()=>{let o=class o{constructor(e,t,r,b,f,W,T,j){this.analyticsService=e,this.authService=t,this.contactService=r,this.databaseService=b,this.docService=f,this.configService=W,this.loggingService=T,this.commonDbService=j,this.documentIAM$=new p(null),this.workspaceIAM$=new p(null),this.roles$=new p([]),this.getDocumentIamSubscription=null,this.getOrganizationIamSubscription=null,this.getWorkspaceIamSubscription=null;try{this.authService.setIamService(this),this.getUser(),this.databaseService.getDb().pipe(h(i=>!!i),v(1)).subscribe(i=>{i&&(this.user&&this.getDocumentIam(),this.getDocumentPaths())},i=>{this.loggingService.catch("Error in CommentService getDb subscription: ",i)}),this.getRole$().pipe(v(1)).subscribe(i=>{this.authService?.getUser()&&!i&&this.analyticsService.trackEvent(D.Events.Iam.USER_ACCESS_DENIED)}),this.documentIAM$.subscribe(i=>{i?.accessType&&this.contactService.setDocumentAccessType(i.accessType)})}catch(i){this.loggingService.catch("Error in IamService constructor: ",i)}}clearCache(){this.loggingService.log("%c[WB] Calling FUNCTION: clearCache in IamService","color: green;");try{this.documentIAM$.next(null),this.workspaceIAM$.next(null),this.roles$.next([]),this.documentPaths=null}catch(e){this.loggingService.catch("Error in IamService clearCache: ",e)}}getUser(){try{this.authService.getUser$().pipe(h(e=>!!e)).subscribe(e=>{this.user=e,this.user?this.databaseService.getDbValue()&&this.getDocumentIam():(this.getDocumentIamSubscription?.unsubscribe(),this.getOrganizationIamSubscription?.unsubscribe(),this.getWorkspaceIamSubscription?.unsubscribe())},e=>{this.loggingService.catch("Error in IamService getUser$ subscription: ",e)})}catch(e){this.loggingService.catch("Error in IamService getUser: ",e)}}getDocumentPaths(){try{this.docService.getDocumentPaths$().pipe(h(e=>!!e)).subscribe(e=>{this.documentPaths=e,this.getDocumentIam(),this.getWorkspaceIam()},e=>{this.loggingService.catch("Error in IamService getDocumentPaths$ subscription: ",e)})}catch(e){this.loggingService.catch("Error in IamService getDocumentPaths: ",e)}}getDocumentIam(){try{this.getDocumentIamSubscription&&(this.getDocumentIamSubscription.unsubscribe(),this.getDocumentIamSubscription=null),this.user?this.getDocumentIamSubscription=this.docService.getDocumentIam$().subscribe(e=>{let t=e||new M;this.documentIAM$.next(t)},e=>{this.loggingService.catch("Error in IamService getDocumentIam$ subscription: ",e)}):this.documentIAM$.next(null)}catch(e){this.loggingService.catch("Error in IamService getDocumentIam: ",e)}}getWorkspaceIam(){try{this.getWorkspaceIamSubscription||(this.getWorkspaceIamSubscription=this.commonDbService.dbListener({feature:"workspaceIam",properties:{skipFirestore:!0}}).pipe(d(e=>u(null))).subscribe(e=>{this.workspaceIAM$.next(e?.data),this.roles$.next(e?.data?.roles||[])}))}catch(e){this.loggingService.catch("Error in IamService getWorkspaceIam: ",e)}}isUserAllowed$(){return this.getRole$().pipe(c(e=>!!e),l())}getDocumentIAM$(){return this.documentIAM$.asObservable()}getRoles$(){return this.roles$.asObservable().pipe(c(e=>e?.length?e:$.WorkspaceRoles))}getFeaturesAccessLevel$(){return this.documentIAM$.asObservable().pipe(c(e=>e?.features),n(e=>this.getRole$().pipe(c(t=>(t===a.ADMIN&&(e=e&&JSON.parse(JSON.stringify(e||{})),e?.all?.disabled&&(e.all.disabled=!1)),e)))))}hasRole(e){try{return e===this.getRole()}catch(t){return this.loggingService.catch("Error in IamService hasRole: ",t),!1}}hasRoleAny(e=[]){try{return e?.includes(this.getRole()||"")}catch(t){return this.loggingService.catch("Error in IamService hasRoleAny: ",t),!1}}hasRole$(e){try{return this.authService.getUser$().pipe(n(()=>this.documentIAM$.pipe(h(t=>!!t),n(()=>this.workspaceIAM$.pipe(c(()=>e===this.getRole()))))))}catch(t){return this.loggingService.catch("Error in IamService hasRole$: ",t),u(!1)}}getRole$(){try{return this.authService.getUser$().pipe(n(()=>this.configService.getSF$()),n(()=>this.configService.getSF()?this.contactService.isUserGlobalContact$():u(null)),n(()=>this.configService.getSF()?this.documentIAM$.pipe(h(e=>!!e),l(I)):u(null)),n(()=>this.workspaceIAM$.pipe(l(I))),c(()=>this.getRole()))}catch(e){return this.loggingService.catch("Error in IamService getRole$: ",e),u(null)}}getRole(){try{let e=this.configService.getSF();if(this.user?.isAdmin)return a.ADMIN;return a.COMMENTER;if(this.user)switch((this.documentIAM$.value?this.documentIAM$.value?.features?.all?.restricted:!1)?m.RESTRICTED:this.documentIAM$.value?this.documentIAM$.value?.documentAccessType||m.PUBLIC:null){case m.PUBLIC:r=this.getUserFromDocumentIAM(this.user?.email,this.user?.userId),r||(r=this.getUserFromWorkspaceIAM(this.user?.email,this.user?.userId)),t=r?.role?.name||a.COMMENTER;break;case m.RESTRICTED:r=this.getUserFromDocumentIAM(this.user?.email,this.user?.userId),r||(r=this.getUserFromWorkspaceIAM(this.user?.email,this.user?.userId)),t=r?.role?.name||null;break;default:break}}catch(e){this.loggingService.catch("Error in IamService getRole: ",e)}return null}isUserAdmin$(){return this.getRole$().pipe(c(e=>e===a.ADMIN),l())}isUserAdmin(){try{return this.getRole()===a.ADMIN}catch(e){return this.loggingService.catch("Error in IamService isUserAdmin: ",e),!1}}getUserFromDocumentIAM(e,t){try{if(e||t){let r;return e&&(r=this.documentIAM$.value?.users?.[g(e)]),!r&&t&&(r=this.documentIAM$.value?.users?.[g(t)]),r}else return}catch(r){this.loggingService.catch("Error in IamService getUserFromDocumentIAM: ",r)}}getUserFromWorkspaceIAM(e,t){try{if(e||t){let r;return e&&(r=this.workspaceIAM$.value?.users?.[g(e)]),!r&&t&&(r=this.workspaceIAM$.value?.users?.[g(t)]),r}else return}catch(r){this.loggingService.catch("Error in IamService getUserFromWorkspaceIAM: ",r)}}};o.\u0275fac=function(t){return new(t||o)(s(E),s(U),s(F),s(k),s(w),s(y),s(R),s(C))},o.\u0275prov=A({token:o,factory:o.\u0275fac,providedIn:"root"});let S=o;return S})();export{Z as a};
1
+ import{Fa as F}from"./chunk-ZHFA5BHC.js";import{G as C,H as w}from"./chunk-RSU53L4Z.js";import{E as h,G as d,He as $,Ii as D,Jk as U,K as v,M as l,Qj as k,V as n,_f as g,ba as A,di as I,ea as s,l as p,nf as M,pj as E,qj as R,r as u,rj as y,v as c,we as a,xe as m}from"./chunk-VJ47SA66.js";var Z=(()=>{let o=class o{constructor(e,t,r,b,f,W,T,j){this.analyticsService=e,this.authService=t,this.contactService=r,this.databaseService=b,this.docService=f,this.configService=W,this.loggingService=T,this.commonDbService=j,this.documentIAM$=new p(null),this.workspaceIAM$=new p(null),this.roles$=new p([]),this.getDocumentIamSubscription=null,this.getOrganizationIamSubscription=null,this.getWorkspaceIamSubscription=null;try{this.authService.setIamService(this),this.getUser(),this.databaseService.getDb().pipe(h(i=>!!i),v(1)).subscribe(i=>{i&&(this.user&&this.getDocumentIam(),this.getDocumentPaths())},i=>{this.loggingService.catch("Error in CommentService getDb subscription: ",i)}),this.getRole$().pipe(v(1)).subscribe(i=>{this.authService?.getUser()&&!i&&this.analyticsService.trackEvent(D.Events.Iam.USER_ACCESS_DENIED)}),this.documentIAM$.subscribe(i=>{i?.accessType&&this.contactService.setDocumentAccessType(i.accessType)})}catch(i){this.loggingService.catch("Error in IamService constructor: ",i)}}clearCache(){this.loggingService.log("%c[WB] Calling FUNCTION: clearCache in IamService","color: green;");try{this.documentIAM$.next(null),this.workspaceIAM$.next(null),this.roles$.next([]),this.documentPaths=null}catch(e){this.loggingService.catch("Error in IamService clearCache: ",e)}}getUser(){try{this.authService.getUser$().pipe(h(e=>!!e)).subscribe(e=>{this.user=e,this.user?this.databaseService.getDbValue()&&this.getDocumentIam():(this.getDocumentIamSubscription?.unsubscribe(),this.getOrganizationIamSubscription?.unsubscribe(),this.getWorkspaceIamSubscription?.unsubscribe())},e=>{this.loggingService.catch("Error in IamService getUser$ subscription: ",e)})}catch(e){this.loggingService.catch("Error in IamService getUser: ",e)}}getDocumentPaths(){try{this.docService.getDocumentPaths$().pipe(h(e=>!!e)).subscribe(e=>{this.documentPaths=e,this.getDocumentIam(),this.getWorkspaceIam()},e=>{this.loggingService.catch("Error in IamService getDocumentPaths$ subscription: ",e)})}catch(e){this.loggingService.catch("Error in IamService getDocumentPaths: ",e)}}getDocumentIam(){try{this.getDocumentIamSubscription&&(this.getDocumentIamSubscription.unsubscribe(),this.getDocumentIamSubscription=null),this.user?this.getDocumentIamSubscription=this.docService.getDocumentIam$().subscribe(e=>{let t=e||new M;this.documentIAM$.next(t)},e=>{this.loggingService.catch("Error in IamService getDocumentIam$ subscription: ",e)}):this.documentIAM$.next(null)}catch(e){this.loggingService.catch("Error in IamService getDocumentIam: ",e)}}getWorkspaceIam(){try{this.getWorkspaceIamSubscription||(this.getWorkspaceIamSubscription=this.commonDbService.dbListener({feature:"workspaceIam",properties:{skipFirestore:!0}}).pipe(d(e=>u(null))).subscribe(e=>{this.workspaceIAM$.next(e?.data),this.roles$.next(e?.data?.roles||[])}))}catch(e){this.loggingService.catch("Error in IamService getWorkspaceIam: ",e)}}isUserAllowed$(){return this.getRole$().pipe(c(e=>!!e),l())}getDocumentIAM$(){return this.documentIAM$.asObservable()}getRoles$(){return this.roles$.asObservable().pipe(c(e=>e?.length?e:$.WorkspaceRoles))}getFeaturesAccessLevel$(){return this.documentIAM$.asObservable().pipe(c(e=>e?.features),n(e=>this.getRole$().pipe(c(t=>(t===a.ADMIN&&(e=e&&JSON.parse(JSON.stringify(e||{})),e?.all?.disabled&&(e.all.disabled=!1)),e)))))}hasRole(e){try{return e===this.getRole()}catch(t){return this.loggingService.catch("Error in IamService hasRole: ",t),!1}}hasRoleAny(e=[]){try{return e?.includes(this.getRole()||"")}catch(t){return this.loggingService.catch("Error in IamService hasRoleAny: ",t),!1}}hasRole$(e){try{return this.authService.getUser$().pipe(n(()=>this.documentIAM$.pipe(h(t=>!!t),n(()=>this.workspaceIAM$.pipe(c(()=>e===this.getRole()))))))}catch(t){return this.loggingService.catch("Error in IamService hasRole$: ",t),u(!1)}}getRole$(){try{return this.authService.getUser$().pipe(n(()=>this.configService.getSF$()),n(()=>this.configService.getSF()?this.contactService.isUserGlobalContact$():u(null)),n(()=>this.configService.getSF()?this.documentIAM$.pipe(h(e=>!!e),l(I)):u(null)),n(()=>this.workspaceIAM$.pipe(l(I))),c(()=>this.getRole()))}catch(e){return this.loggingService.catch("Error in IamService getRole$: ",e),u(null)}}getRole(){try{let e=this.configService.getSF();if(this.user?.isAdmin)return a.ADMIN;return a.COMMENTER;if(this.user)switch((this.documentIAM$.value?this.documentIAM$.value?.features?.all?.restricted:!1)?m.RESTRICTED:this.documentIAM$.value?this.documentIAM$.value?.documentAccessType||m.PUBLIC:null){case m.PUBLIC:r=this.getUserFromDocumentIAM(this.user?.email,this.user?.userId),r||(r=this.getUserFromWorkspaceIAM(this.user?.email,this.user?.userId)),t=r?.role?.name||a.COMMENTER;break;case m.RESTRICTED:r=this.getUserFromDocumentIAM(this.user?.email,this.user?.userId),r||(r=this.getUserFromWorkspaceIAM(this.user?.email,this.user?.userId)),t=r?.role?.name||null;break;default:break}}catch(e){this.loggingService.catch("Error in IamService getRole: ",e)}return null}isUserAdmin$(){return this.getRole$().pipe(c(e=>e===a.ADMIN),l())}isUserAdmin(){try{return this.getRole()===a.ADMIN}catch(e){return this.loggingService.catch("Error in IamService isUserAdmin: ",e),!1}}getUserFromDocumentIAM(e,t){try{if(e||t){let r;return e&&(r=this.documentIAM$.value?.users?.[g(e)]),!r&&t&&(r=this.documentIAM$.value?.users?.[g(t)]),r}else return}catch(r){this.loggingService.catch("Error in IamService getUserFromDocumentIAM: ",r)}}getUserFromWorkspaceIAM(e,t){try{if(e||t){let r;return e&&(r=this.workspaceIAM$.value?.users?.[g(e)]),!r&&t&&(r=this.workspaceIAM$.value?.users?.[g(t)]),r}else return}catch(r){this.loggingService.catch("Error in IamService getUserFromWorkspaceIAM: ",r)}}};o.\u0275fac=function(t){return new(t||o)(s(E),s(U),s(F),s(k),s(w),s(y),s(R),s(C))},o.\u0275prov=A({token:o,factory:o.\u0275fac,providedIn:"root"});let S=o;return S})();export{Z as a};
@@ -0,0 +1,6 @@
1
+ import{G as ao,H as Bt,p as so}from"./chunk-RSU53L4Z.js";import{$a as xn,$c as Mt,$e as Xn,Aa as kn,Ac as jn,Ba as At,Bc as q,Cb as zn,D as Dt,Db as Bn,Dc as Pt,Dk as ro,E,Ee as D,F as Et,Fb as kt,Fc as Hn,G as Ot,Gb as Tt,Ha as Tn,Hb as xt,He as re,Ia as B,Ii as Ft,Ij as Se,J as wt,Ja as U,Jj as $e,Jk as zt,K as te,Ka as ne,Kj as Ie,Lb as Vn,Lj as st,M as X,Mb as it,Mf as Qn,Na as be,Nj as T,O as bn,Pa as oe,Qa as Fe,Qf as Ci,Qj as no,R as Sn,Ra as Y,S as In,Sg as eo,Ta as Ue,U as Ce,Ua as _i,Ud as Gn,V as v,Vd as Wn,Vj as Si,W as de,Wa as G,X as Dn,Xa as N,Y as Q,Ya as L,_ as En,_a as W,_c as H,_e as Kn,_f as w,_i as rt,a as m,aa as On,ab as Rt,ac as ze,ai as bi,b as k,ba as b,ca as F,da as A,db as Ne,dg as qn,di as ot,ea as P,ee as Yn,fa as u,fb as ue,fi as to,g as z,h as K,ha as Me,i as ye,j as vn,k as y,kk as Ii,l as I,n as yn,na as O,nk as oo,o as Cn,oa as M,ob as Pn,oj as Ut,pa as wn,pb as Mn,pj as io,q as bt,qj as J,r as _,ra as Le,rb as Ln,re as nt,rf as Zn,rj as Nt,s as St,sa as j,sb as Fn,tb as Un,tc as $n,ua as An,uc as yi,v as S,va as Rn,vc as Be,vg as Jn,w as tt,wa as ie,x as It,xa as he,xe as Lt,ya as R,yb as vi,za as mi,zb as Nn,zc as Ve}from"./chunk-VJ47SA66.js";function se(o,n=0){return co(o)?Number(o):arguments.length===2?n:0}function co(o){return!isNaN(parseFloat(o))&&!isNaN(Number(o))}function De(o){return o instanceof R?o.nativeElement:o}var Ir=new A("cdk-dir-doc",{providedIn:"root",factory:Dr});function Dr(){return u(M)}var Er=/^(ar|ckb|dv|he|iw|fa|nqo|ps|sd|ug|ur|yi|.*[-_](Adlm|Arab|Hebr|Nkoo|Rohg|Thaa))(?!.*[-_](Latn|Cyrl)($|-|_))($|-|_)/i;function lo(o){let n=o?.toLowerCase()||"";return n==="auto"&&typeof navigator<"u"&&navigator?.language?Er.test(navigator.language)?"rtl":"ltr":n==="rtl"?"rtl":"ltr"}var ae=(()=>{class o{get value(){return this.valueSignal()}valueSignal=j("ltr");change=new B;constructor(){let t=u(Ir,{optional:!0});if(t){let e=t.body?t.body.dir:null,i=t.documentElement?t.documentElement.dir:null;this.valueSignal.set(lo(e||i||"ltr"))}}ngOnDestroy(){this.change.complete()}static \u0275fac=function(e){return new(e||o)};static \u0275prov=b({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();var Z=(function(o){return o[o.NORMAL=0]="NORMAL",o[o.NEGATED=1]="NEGATED",o[o.INVERTED=2]="INVERTED",o})(Z||{}),Vt,Ee;function $t(){if(Ee==null){if(typeof document!="object"||!document||typeof Element!="function"||!Element)return Ee=!1,Ee;if(document.documentElement?.style&&"scrollBehavior"in document.documentElement.style)Ee=!0;else{let o=Element.prototype.scrollTo;o?Ee=!/\{\s*\[native code\]\s*\}/.test(o.toString()):Ee=!1}}return Ee}function je(){if(typeof document!="object"||!document)return Z.NORMAL;if(Vt==null){let o=document.createElement("div"),n=o.style;o.dir="rtl",n.width="1px",n.overflow="auto",n.visibility="hidden",n.pointerEvents="none",n.position="absolute";let t=document.createElement("div"),e=t.style;e.width="2px",e.height="1px",o.appendChild(t),document.body.appendChild(o),Vt=Z.NORMAL,o.scrollLeft===0&&(o.scrollLeft=1,Vt=o.scrollLeft===0?Z.NEGATED:Z.INVERTED),o.remove()}return Vt}var fe=(()=>{class o{static \u0275fac=function(e){return new(e||o)};static \u0275mod=N({type:o});static \u0275inj=F({})}return o})();var jt=class{};function ho(o){return o&&typeof o.connect=="function"&&!(o instanceof vn)}var Ht=class extends jt{_data;constructor(n){super(),this._data=n}connect(){return St(this._data)?this._data:_(this._data)}disconnect(){}},at=(function(o){return o[o.REPLACED=0]="REPLACED",o[o.INSERTED=1]="INSERTED",o[o.MOVED=2]="MOVED",o[o.REMOVED=3]="REMOVED",o})(at||{}),Di=new A("_ViewRepeater"),Gt=class{viewCacheSize=20;_viewCache=[];applyChanges(n,t,e,i,r){n.forEachOperation((s,a,c)=>{let l,d;if(s.previousIndex==null){let h=()=>e(s,a,c);l=this._insertView(h,c,t,i(s)),d=l?at.INSERTED:at.REPLACED}else c==null?(this._detachAndCacheView(a,t),d=at.REMOVED):(l=this._moveView(a,c,t,i(s)),d=at.MOVED);r&&r({context:l?.context,operation:d,record:s})})}detach(){for(let n of this._viewCache)n.destroy();this._viewCache=[]}_insertView(n,t,e,i){let r=this._insertViewFromCache(t,e);if(r){r.context.$implicit=i;return}let s=n();return e.createEmbeddedView(s.templateRef,s.context,s.index)}_detachAndCacheView(n,t){let e=t.detach(n);this._maybeCacheView(e,t)}_moveView(n,t,e,i){let r=e.get(n);return e.move(r,t),r.context.$implicit=i,r}_maybeCacheView(n,t){if(this._viewCache.length<this.viewCacheSize)this._viewCache.push(n);else{let e=t.indexOf(n);e===-1?n.destroy():t.remove(e)}}_insertViewFromCache(n,t){let e=this._viewCache.pop();return e&&t.insert(e,n),e||null}};var Or=["contentWrapper"],wr=["*"],po=new A("VIRTUAL_SCROLL_STRATEGY"),Ei=class{_scrolledIndexChange=new y;scrolledIndexChange=this._scrolledIndexChange.pipe(X());_viewport=null;_itemSize;_minBufferPx;_maxBufferPx;constructor(n,t,e){this._itemSize=n,this._minBufferPx=t,this._maxBufferPx=e}attach(n){this._viewport=n,this._updateTotalContentSize(),this._updateRenderedRange()}detach(){this._scrolledIndexChange.complete(),this._viewport=null}updateItemAndBufferSize(n,t,e){e<t,this._itemSize=n,this._minBufferPx=t,this._maxBufferPx=e,this._updateTotalContentSize(),this._updateRenderedRange()}onContentScrolled(){this._updateRenderedRange()}onDataLengthChanged(){this._updateTotalContentSize(),this._updateRenderedRange()}onContentRendered(){}onRenderedOffsetChanged(){}scrollToIndex(n,t){this._viewport&&this._viewport.scrollToOffset(n*this._itemSize,t)}_updateTotalContentSize(){this._viewport&&this._viewport.setTotalContentSize(this._viewport.getDataLength()*this._itemSize)}_updateRenderedRange(){if(!this._viewport)return;let n=this._viewport.getRenderedRange(),t={start:n.start,end:n.end},e=this._viewport.getViewportSize(),i=this._viewport.getDataLength(),r=this._viewport.measureScrollOffset(),s=this._itemSize>0?r/this._itemSize:0;if(t.end>i){let c=Math.ceil(e/this._itemSize),l=Math.max(0,Math.min(s,i-c));s!=l&&(s=l,r=l*this._itemSize,t.start=Math.floor(s)),t.end=Math.max(0,Math.min(i,t.start+c))}let a=r-t.start*this._itemSize;if(a<this._minBufferPx&&t.start!=0){let c=Math.ceil((this._maxBufferPx-a)/this._itemSize);t.start=Math.max(0,t.start-c),t.end=Math.min(i,Math.ceil(s+(e+this._minBufferPx)/this._itemSize))}else{let c=t.end*this._itemSize-(r+e);if(c<this._minBufferPx&&t.end!=i){let l=Math.ceil((this._maxBufferPx-c)/this._itemSize);l>0&&(t.end=Math.min(i,t.end+l),t.start=Math.max(0,Math.floor(s-this._minBufferPx/this._itemSize)))}}this._viewport.setRenderedRange(t),this._viewport.setRenderedContentOffset(Math.round(this._itemSize*t.start)),this._scrolledIndexChange.next(Math.floor(s))}};function Ar(o){return o._scrollStrategy}var Rr=(()=>{class o{get itemSize(){return this._itemSize}set itemSize(t){this._itemSize=se(t)}_itemSize=20;get minBufferPx(){return this._minBufferPx}set minBufferPx(t){this._minBufferPx=se(t)}_minBufferPx=100;get maxBufferPx(){return this._maxBufferPx}set maxBufferPx(t){this._maxBufferPx=se(t)}_maxBufferPx=200;_scrollStrategy=new Ei(this.itemSize,this.minBufferPx,this.maxBufferPx);ngOnChanges(){this._scrollStrategy.updateItemAndBufferSize(this.itemSize,this.minBufferPx,this.maxBufferPx)}static \u0275fac=function(e){return new(e||o)};static \u0275dir=L({type:o,selectors:[["cdk-virtual-scroll-viewport","itemSize",""]],inputs:{itemSize:"itemSize",minBufferPx:"minBufferPx",maxBufferPx:"maxBufferPx"},features:[ze([{provide:po,useFactory:Ar,deps:[On(()=>o)]}]),ie]})}return o})(),kr=20,ct=(()=>{class o{_ngZone=u(U);_platform=u(H);_renderer=u(oe).createRenderer(null,null);_cleanupGlobalListener;constructor(){}_scrolled=new y;_scrolledCount=0;scrollContainers=new Map;register(t){this.scrollContainers.has(t)||this.scrollContainers.set(t,t.elementScrolled().subscribe(()=>this._scrolled.next(t)))}deregister(t){let e=this.scrollContainers.get(t);e&&(e.unsubscribe(),this.scrollContainers.delete(t))}scrolled(t=kr){return this._platform.isBrowser?new ye(e=>{this._cleanupGlobalListener||(this._cleanupGlobalListener=this._ngZone.runOutsideAngular(()=>this._renderer.listen("document","scroll",()=>this._scrolled.next())));let i=t>0?this._scrolled.pipe(Et(t)).subscribe(e):this._scrolled.subscribe(e);return this._scrolledCount++,()=>{i.unsubscribe(),this._scrolledCount--,this._scrolledCount||(this._cleanupGlobalListener?.(),this._cleanupGlobalListener=void 0)}}):_()}ngOnDestroy(){this._cleanupGlobalListener?.(),this._cleanupGlobalListener=void 0,this.scrollContainers.forEach((t,e)=>this.deregister(e)),this._scrolled.complete()}ancestorScrolled(t,e){let i=this.getAncestorScrollContainers(t);return this.scrolled(e).pipe(E(r=>!r||i.indexOf(r)>-1))}getAncestorScrollContainers(t){let e=[];return this.scrollContainers.forEach((i,r)=>{this._scrollableContainsElement(r,t)&&e.push(r)}),e}_scrollableContainsElement(t,e){let i=De(e),r=t.getElementRef().nativeElement;do if(i==r)return!0;while(i=i.parentElement);return!1}static \u0275fac=function(e){return new(e||o)};static \u0275prov=b({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})(),lt=(()=>{class o{elementRef=u(R);scrollDispatcher=u(ct);ngZone=u(U);dir=u(ae,{optional:!0});_scrollElement=this.elementRef.nativeElement;_destroyed=new y;_renderer=u(Fe);_cleanupScroll;_elementScrolled=new y;constructor(){}ngOnInit(){this._cleanupScroll=this.ngZone.runOutsideAngular(()=>this._renderer.listen(this._scrollElement,"scroll",t=>this._elementScrolled.next(t))),this.scrollDispatcher.register(this)}ngOnDestroy(){this._cleanupScroll?.(),this._elementScrolled.complete(),this.scrollDispatcher.deregister(this),this._destroyed.next(),this._destroyed.complete()}elementScrolled(){return this._elementScrolled}getElementRef(){return this.elementRef}scrollTo(t){let e=this.elementRef.nativeElement,i=this.dir&&this.dir.value=="rtl";t.left==null&&(t.left=i?t.end:t.start),t.right==null&&(t.right=i?t.start:t.end),t.bottom!=null&&(t.top=e.scrollHeight-e.clientHeight-t.bottom),i&&je()!=Z.NORMAL?(t.left!=null&&(t.right=e.scrollWidth-e.clientWidth-t.left),je()==Z.INVERTED?t.left=t.right:je()==Z.NEGATED&&(t.left=t.right?-t.right:t.right)):t.right!=null&&(t.left=e.scrollWidth-e.clientWidth-t.right),this._applyScrollToOptions(t)}_applyScrollToOptions(t){let e=this.elementRef.nativeElement;$t()?e.scrollTo(t):(t.top!=null&&(e.scrollTop=t.top),t.left!=null&&(e.scrollLeft=t.left))}measureScrollOffset(t){let e="left",i="right",r=this.elementRef.nativeElement;if(t=="top")return r.scrollTop;if(t=="bottom")return r.scrollHeight-r.clientHeight-r.scrollTop;let s=this.dir&&this.dir.value=="rtl";return t=="start"?t=s?i:e:t=="end"&&(t=s?e:i),s&&je()==Z.INVERTED?t==e?r.scrollWidth-r.clientWidth-r.scrollLeft:r.scrollLeft:s&&je()==Z.NEGATED?t==e?r.scrollLeft+r.scrollWidth-r.clientWidth:-r.scrollLeft:t==e?r.scrollLeft:r.scrollWidth-r.clientWidth-r.scrollLeft}static \u0275fac=function(e){return new(e||o)};static \u0275dir=L({type:o,selectors:[["","cdk-scrollable",""],["","cdkScrollable",""]]})}return o})(),Tr=20,Oe=(()=>{class o{_platform=u(H);_listeners;_viewportSize;_change=new y;_document=u(M);constructor(){let t=u(U),e=u(oe).createRenderer(null,null);t.runOutsideAngular(()=>{if(this._platform.isBrowser){let i=r=>this._change.next(r);this._listeners=[e.listen("window","resize",i),e.listen("window","orientationchange",i)]}this.change().subscribe(()=>this._viewportSize=null)})}ngOnDestroy(){this._listeners?.forEach(t=>t()),this._change.complete()}getViewportSize(){this._viewportSize||this._updateViewportSize();let t={width:this._viewportSize.width,height:this._viewportSize.height};return this._platform.isBrowser||(this._viewportSize=null),t}getViewportRect(){let t=this.getViewportScrollPosition(),{width:e,height:i}=this.getViewportSize();return{top:t.top,left:t.left,bottom:t.top+i,right:t.left+e,height:i,width:e}}getViewportScrollPosition(){if(!this._platform.isBrowser)return{top:0,left:0};let t=this._document,e=this._getWindow(),i=t.documentElement,r=i.getBoundingClientRect(),s=-r.top||t.body.scrollTop||e.scrollY||i.scrollTop||0,a=-r.left||t.body.scrollLeft||e.scrollX||i.scrollLeft||0;return{top:s,left:a}}change(t=Tr){return t>0?this._change.pipe(Et(t)):this._change}_getWindow(){return this._document.defaultView||window}_updateViewportSize(){let t=this._getWindow();this._viewportSize=this._platform.isBrowser?{width:t.innerWidth,height:t.innerHeight}:{width:0,height:0}}static \u0275fac=function(e){return new(e||o)};static \u0275prov=b({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})(),uo=new A("VIRTUAL_SCROLLABLE"),xr=(()=>{class o extends lt{constructor(){super()}measureViewportSize(t){let e=this.elementRef.nativeElement;return t==="horizontal"?e.clientWidth:e.clientHeight}static \u0275fac=function(e){return new(e||o)};static \u0275dir=L({type:o,features:[W]})}return o})();function Pr(o,n){return o.start==n.start&&o.end==n.end}var Mr=typeof requestAnimationFrame<"u"?Cn:yn,go=(()=>{class o extends xr{elementRef=u(R);_changeDetectorRef=u(Ve);_scrollStrategy=u(po,{optional:!0});scrollable=u(uo,{optional:!0});_platform=u(H);_detachedSubject=new y;_renderedRangeSubject=new y;get orientation(){return this._orientation}set orientation(t){this._orientation!==t&&(this._orientation=t,this._calculateSpacerSize())}_orientation="vertical";appendOnly=!1;scrolledIndexChange=new ye(t=>this._scrollStrategy.scrolledIndexChange.subscribe(e=>Promise.resolve().then(()=>this.ngZone.run(()=>t.next(e)))));_contentWrapper;renderedRangeStream=this._renderedRangeSubject;_totalContentSize=0;_totalContentWidth=j("");_totalContentHeight=j("");_renderedContentTransform;_renderedRange={start:0,end:0};_dataLength=0;_viewportSize=0;_forOf;_renderedContentOffset=0;_renderedContentOffsetNeedsRewrite=!1;_changeDetectionNeeded=j(!1);_runAfterChangeDetection=[];_viewportChanges=K.EMPTY;_injector=u(O);_isDestroyed=!1;constructor(){super();let t=u(Oe);this._scrollStrategy,this._viewportChanges=t.change().subscribe(()=>{this.checkViewportSize()}),this.scrollable||(this.elementRef.nativeElement.classList.add("cdk-virtual-scrollable"),this.scrollable=this);let e=Be(()=>{this._changeDetectionNeeded()&&this._doChangeDetection()},{injector:u(Ne).injector});u(wn).onDestroy(()=>{e.destroy()})}ngOnInit(){this._platform.isBrowser&&(this.scrollable===this&&super.ngOnInit(),this.ngZone.runOutsideAngular(()=>Promise.resolve().then(()=>{this._measureViewportSize(),this._scrollStrategy.attach(this),this.scrollable.elementScrolled().pipe(Ce(null),Et(0,Mr),de(this._destroyed)).subscribe(()=>this._scrollStrategy.onContentScrolled()),this._markChangeDetectionNeeded()})))}ngOnDestroy(){this.detach(),this._scrollStrategy.detach(),this._renderedRangeSubject.complete(),this._detachedSubject.complete(),this._viewportChanges.unsubscribe(),this._isDestroyed=!0,super.ngOnDestroy()}attach(t){this._forOf,this.ngZone.runOutsideAngular(()=>{this._forOf=t,this._forOf.dataStream.pipe(de(this._detachedSubject)).subscribe(e=>{let i=e.length;i!==this._dataLength&&(this._dataLength=i,this._scrollStrategy.onDataLengthChanged()),this._doChangeDetection()})})}detach(){this._forOf=null,this._detachedSubject.next()}getDataLength(){return this._dataLength}getViewportSize(){return this._viewportSize}getRenderedRange(){return this._renderedRange}measureBoundingClientRectWithScrollOffset(t){return this.getElementRef().nativeElement.getBoundingClientRect()[t]}setTotalContentSize(t){this._totalContentSize!==t&&(this._totalContentSize=t,this._calculateSpacerSize(),this._markChangeDetectionNeeded())}setRenderedRange(t){Pr(this._renderedRange,t)||(this.appendOnly&&(t={start:0,end:Math.max(this._renderedRange.end,t.end)}),this._renderedRangeSubject.next(this._renderedRange=t),this._markChangeDetectionNeeded(()=>this._scrollStrategy.onContentRendered()))}getOffsetToRenderedContentStart(){return this._renderedContentOffsetNeedsRewrite?null:this._renderedContentOffset}setRenderedContentOffset(t,e="to-start"){t=this.appendOnly&&e==="to-start"?0:t;let i=this.dir&&this.dir.value=="rtl",r=this.orientation=="horizontal",s=r?"X":"Y",c=`translate${s}(${Number((r&&i?-1:1)*t)}px)`;this._renderedContentOffset=t,e==="to-end"&&(c+=` translate${s}(-100%)`,this._renderedContentOffsetNeedsRewrite=!0),this._renderedContentTransform!=c&&(this._renderedContentTransform=c,this._markChangeDetectionNeeded(()=>{this._renderedContentOffsetNeedsRewrite?(this._renderedContentOffset-=this.measureRenderedContentSize(),this._renderedContentOffsetNeedsRewrite=!1,this.setRenderedContentOffset(this._renderedContentOffset)):this._scrollStrategy.onRenderedOffsetChanged()}))}scrollToOffset(t,e="auto"){let i={behavior:e};this.orientation==="horizontal"?i.start=t:i.top=t,this.scrollable.scrollTo(i)}scrollToIndex(t,e="auto"){this._scrollStrategy.scrollToIndex(t,e)}measureScrollOffset(t){let e;return this.scrollable==this?e=i=>super.measureScrollOffset(i):e=i=>this.scrollable.measureScrollOffset(i),Math.max(0,e(t??(this.orientation==="horizontal"?"start":"top"))-this.measureViewportOffset())}measureViewportOffset(t){let e,i="left",r="right",s=this.dir?.value=="rtl";t=="start"?e=s?r:i:t=="end"?e=s?i:r:t?e=t:e=this.orientation==="horizontal"?"left":"top";let a=this.scrollable.measureBoundingClientRectWithScrollOffset(e);return this.elementRef.nativeElement.getBoundingClientRect()[e]-a}measureRenderedContentSize(){let t=this._contentWrapper.nativeElement;return this.orientation==="horizontal"?t.offsetWidth:t.offsetHeight}measureRangeSize(t){return this._forOf?this._forOf.measureRangeSize(t,this.orientation):0}checkViewportSize(){this._measureViewportSize(),this._scrollStrategy.onDataLengthChanged()}_measureViewportSize(){this._viewportSize=this.scrollable.measureViewportSize(this.orientation)}_markChangeDetectionNeeded(t){t&&this._runAfterChangeDetection.push(t),!$n(this._changeDetectionNeeded)&&this.ngZone.runOutsideAngular(()=>{Promise.resolve().then(()=>{this.ngZone.run(()=>{this._changeDetectionNeeded.set(!0)})})})}_doChangeDetection(){this._isDestroyed||this.ngZone.run(()=>{this._changeDetectorRef.markForCheck(),this._contentWrapper.nativeElement.style.transform=this._renderedContentTransform,ne(()=>{this._changeDetectionNeeded.set(!1);let t=this._runAfterChangeDetection;this._runAfterChangeDetection=[];for(let e of t)e()},{injector:this._injector})})}_calculateSpacerSize(){this._totalContentHeight.set(this.orientation==="horizontal"?"":`${this._totalContentSize}px`),this._totalContentWidth.set(this.orientation==="horizontal"?`${this._totalContentSize}px`:"")}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=G({type:o,selectors:[["cdk-virtual-scroll-viewport"]],viewQuery:function(e,i){if(e&1&&kt(Or,7),e&2){let r;Tt(r=xt())&&(i._contentWrapper=r.first)}},hostAttrs:[1,"cdk-virtual-scroll-viewport"],hostVars:4,hostBindings:function(e,i){e&2&&it("cdk-virtual-scroll-orientation-horizontal",i.orientation==="horizontal")("cdk-virtual-scroll-orientation-vertical",i.orientation!=="horizontal")},inputs:{orientation:"orientation",appendOnly:[2,"appendOnly","appendOnly",q]},outputs:{scrolledIndexChange:"scrolledIndexChange"},features:[ze([{provide:lt,useFactory:(t,e)=>t||e,deps:[[new Rn,new An(uo)],o]}]),W],ngContentSelectors:wr,decls:4,vars:4,consts:[["contentWrapper",""],[1,"cdk-virtual-scroll-content-wrapper"],[1,"cdk-virtual-scroll-spacer"]],template:function(e,i){e&1&&(zn(),Ln(0,"div",1,0),Bn(2),Fn(),Un(3,"div",2)),e&2&&(Tn(3),Vn("width",i._totalContentWidth())("height",i._totalContentHeight()))},styles:[`cdk-virtual-scroll-viewport{display:block;position:relative;transform:translateZ(0)}.cdk-virtual-scrollable{overflow:auto;will-change:scroll-position;contain:strict}.cdk-virtual-scroll-content-wrapper{position:absolute;top:0;left:0;contain:content}[dir=rtl] .cdk-virtual-scroll-content-wrapper{right:0;left:auto}.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper{min-height:100%}.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>dl:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>ol:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>table:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>ul:not([cdkVirtualFor]){padding-left:0;padding-right:0;margin-left:0;margin-right:0;border-left-width:0;border-right-width:0;outline:none}.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper{min-width:100%}.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>dl:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>ol:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>table:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>ul:not([cdkVirtualFor]){padding-top:0;padding-bottom:0;margin-top:0;margin-bottom:0;border-top-width:0;border-bottom-width:0;outline:none}.cdk-virtual-scroll-spacer{height:1px;transform-origin:0 0;flex:0 0 auto}[dir=rtl] .cdk-virtual-scroll-spacer{transform-origin:100% 0}
2
+ `],encapsulation:2,changeDetection:0})}return o})();function fo(o,n,t){let e=t;if(!e.getBoundingClientRect)return 0;let i=e.getBoundingClientRect();return o==="horizontal"?n==="start"?i.left:i.right:n==="start"?i.top:i.bottom}var Lr=(()=>{class o{_viewContainerRef=u(Ue);_template=u(be);_differs=u(jn);_viewRepeater=u(Di);_viewport=u(go,{skipSelf:!0});viewChange=new y;_dataSourceChanges=new y;get cdkVirtualForOf(){return this._cdkVirtualForOf}set cdkVirtualForOf(t){this._cdkVirtualForOf=t,ho(t)?this._dataSourceChanges.next(t):this._dataSourceChanges.next(new Ht(St(t)?t:Array.from(t||[])))}_cdkVirtualForOf;get cdkVirtualForTrackBy(){return this._cdkVirtualForTrackBy}set cdkVirtualForTrackBy(t){this._needsUpdate=!0,this._cdkVirtualForTrackBy=t?(e,i)=>t(e+(this._renderedRange?this._renderedRange.start:0),i):void 0}_cdkVirtualForTrackBy;set cdkVirtualForTemplate(t){t&&(this._needsUpdate=!0,this._template=t)}get cdkVirtualForTemplateCacheSize(){return this._viewRepeater.viewCacheSize}set cdkVirtualForTemplateCacheSize(t){this._viewRepeater.viewCacheSize=se(t)}dataStream=this._dataSourceChanges.pipe(Ce(null),bn(),v(([t,e])=>this._changeDataSource(t,e)),Sn(1));_differ=null;_data;_renderedItems;_renderedRange;_needsUpdate=!1;_destroyed=new y;constructor(){let t=u(U);this.dataStream.subscribe(e=>{this._data=e,this._onRenderedDataChange()}),this._viewport.renderedRangeStream.pipe(de(this._destroyed)).subscribe(e=>{this._renderedRange=e,this.viewChange.observers.length&&t.run(()=>this.viewChange.next(this._renderedRange)),this._onRenderedDataChange()}),this._viewport.attach(this)}measureRangeSize(t,e){if(t.start>=t.end)return 0;t.start<this._renderedRange.start||t.end>this._renderedRange.end;let i=t.start-this._renderedRange.start,r=t.end-t.start,s,a;for(let c=0;c<r;c++){let l=this._viewContainerRef.get(c+i);if(l&&l.rootNodes.length){s=a=l.rootNodes[0];break}}for(let c=r-1;c>-1;c--){let l=this._viewContainerRef.get(c+i);if(l&&l.rootNodes.length){a=l.rootNodes[l.rootNodes.length-1];break}}return s&&a?fo(e,"end",a)-fo(e,"start",s):0}ngDoCheck(){if(this._differ&&this._needsUpdate){let t=this._differ.diff(this._renderedItems);t?this._applyChanges(t):this._updateContext(),this._needsUpdate=!1}}ngOnDestroy(){this._viewport.detach(),this._dataSourceChanges.next(void 0),this._dataSourceChanges.complete(),this.viewChange.complete(),this._destroyed.next(),this._destroyed.complete(),this._viewRepeater.detach()}_onRenderedDataChange(){this._renderedRange&&(this._renderedItems=this._data.slice(this._renderedRange.start,this._renderedRange.end),this._differ||(this._differ=this._differs.find(this._renderedItems).create((t,e)=>this.cdkVirtualForTrackBy?this.cdkVirtualForTrackBy(t,e):e)),this._needsUpdate=!0)}_changeDataSource(t,e){return t&&t.disconnect(this),this._needsUpdate=!0,e?e.connect(this):_()}_updateContext(){let t=this._data.length,e=this._viewContainerRef.length;for(;e--;){let i=this._viewContainerRef.get(e);i.context.index=this._renderedRange.start+e,i.context.count=t,this._updateComputedContextProperties(i.context),i.detectChanges()}}_applyChanges(t){this._viewRepeater.applyChanges(t,this._viewContainerRef,(r,s,a)=>this._getEmbeddedViewArgs(r,a),r=>r.item),t.forEachIdentityChange(r=>{let s=this._viewContainerRef.get(r.currentIndex);s.context.$implicit=r.item});let e=this._data.length,i=this._viewContainerRef.length;for(;i--;){let r=this._viewContainerRef.get(i);r.context.index=this._renderedRange.start+i,r.context.count=e,this._updateComputedContextProperties(r.context)}}_updateComputedContextProperties(t){t.first=t.index===0,t.last=t.index===t.count-1,t.even=t.index%2===0,t.odd=!t.even}_getEmbeddedViewArgs(t,e){return{templateRef:this._template,context:{$implicit:t.item,cdkVirtualForOf:this._cdkVirtualForOf,index:-1,count:-1,first:!1,last:!1,odd:!1,even:!1},index:e}}static ngTemplateContextGuard(t,e){return!0}static \u0275fac=function(e){return new(e||o)};static \u0275dir=L({type:o,selectors:[["","cdkVirtualFor","","cdkVirtualForOf",""]],inputs:{cdkVirtualForOf:"cdkVirtualForOf",cdkVirtualForTrackBy:"cdkVirtualForTrackBy",cdkVirtualForTemplate:"cdkVirtualForTemplate",cdkVirtualForTemplateCacheSize:"cdkVirtualForTemplateCacheSize"},features:[ze([{provide:Di,useClass:Gt}])]})}return o})();var Oi=(()=>{class o{static \u0275fac=function(e){return new(e||o)};static \u0275mod=N({type:o});static \u0275inj=F({})}return o})(),wi=(()=>{class o{static \u0275fac=function(e){return new(e||o)};static \u0275mod=N({type:o});static \u0275inj=F({imports:[fe,Oi,fe,Oi]})}return o})();var dt=class{_attachedHost;attach(n){return this._attachedHost=n,n.attach(this)}detach(){let n=this._attachedHost;n!=null&&(this._attachedHost=null,n.detach())}get isAttached(){return this._attachedHost!=null}setAttachedHost(n){this._attachedHost=n}},He=class extends dt{component;viewContainerRef;injector;projectableNodes;constructor(n,t,e,i){super(),this.component=n,this.viewContainerRef=t,this.injector=e,this.projectableNodes=i}},we=class extends dt{templateRef;viewContainerRef;context;injector;constructor(n,t,e,i){super(),this.templateRef=n,this.viewContainerRef=t,this.context=e,this.injector=i}get origin(){return this.templateRef.elementRef}attach(n,t=this.context){return this.context=t,super.attach(n)}detach(){return this.context=void 0,super.detach()}},Ai=class extends dt{element;constructor(n){super(),this.element=n instanceof R?n.nativeElement:n}},Ge=class{_attachedPortal;_disposeFn;_isDisposed=!1;hasAttached(){return!!this._attachedPortal}attach(n){if(n instanceof He)return this._attachedPortal=n,this.attachComponentPortal(n);if(n instanceof we)return this._attachedPortal=n,this.attachTemplatePortal(n);if(this.attachDomPortal&&n instanceof Ai)return this._attachedPortal=n,this.attachDomPortal(n)}attachDomPortal=null;detach(){this._attachedPortal&&(this._attachedPortal.setAttachedHost(null),this._attachedPortal=null),this._invokeDisposeFn()}dispose(){this.hasAttached()&&this.detach(),this._invokeDisposeFn(),this._isDisposed=!0}setDisposeFn(n){this._disposeFn=n}_invokeDisposeFn(){this._disposeFn&&(this._disposeFn(),this._disposeFn=null)}},Wt=class extends Ge{outletElement;_appRef;_defaultInjector;constructor(n,t,e){super(),this.outletElement=n,this._appRef=t,this._defaultInjector=e}attachComponentPortal(n){let t;if(n.viewContainerRef){let e=n.injector||n.viewContainerRef.injector,i=e.get(_i,null,{optional:!0})||void 0;t=n.viewContainerRef.createComponent(n.component,{index:n.viewContainerRef.length,injector:e,ngModuleRef:i,projectableNodes:n.projectableNodes||void 0}),this.setDisposeFn(()=>t.destroy())}else{let e=this._appRef,i=n.injector||this._defaultInjector||O.NULL,r=i.get(Me,e.injector);t=Pt(n.component,{elementInjector:i,environmentInjector:r,projectableNodes:n.projectableNodes||void 0}),e.attachView(t.hostView),this.setDisposeFn(()=>{e.viewCount>0&&e.detachView(t.hostView),t.destroy()})}return this.outletElement.appendChild(this._getComponentRootNode(t)),this._attachedPortal=n,t}attachTemplatePortal(n){let t=n.viewContainerRef,e=t.createEmbeddedView(n.templateRef,n.context,{injector:n.injector});return e.rootNodes.forEach(i=>this.outletElement.appendChild(i)),e.detectChanges(),this.setDisposeFn(()=>{let i=t.indexOf(e);i!==-1&&t.remove(i)}),this._attachedPortal=n,e}attachDomPortal=n=>{let t=n.element;t.parentNode;let e=this.outletElement.ownerDocument.createComment("dom-portal");t.parentNode.insertBefore(e,t),this.outletElement.appendChild(t),this._attachedPortal=n,super.setDisposeFn(()=>{e.parentNode&&e.parentNode.replaceChild(t,e)})};dispose(){super.dispose(),this.outletElement.remove()}_getComponentRootNode(n){return n.hostView.rootNodes[0]}};var ht=(()=>{class o extends Ge{_moduleRef=u(_i,{optional:!0});_document=u(M);_viewContainerRef=u(Ue);_isInitialized=!1;_attachedRef;constructor(){super()}get portal(){return this._attachedPortal}set portal(t){this.hasAttached()&&!t&&!this._isInitialized||(this.hasAttached()&&super.detach(),t&&super.attach(t),this._attachedPortal=t||null)}attached=new B;get attachedRef(){return this._attachedRef}ngOnInit(){this._isInitialized=!0}ngOnDestroy(){super.dispose(),this._attachedRef=this._attachedPortal=null}attachComponentPortal(t){t.setAttachedHost(this);let e=t.viewContainerRef!=null?t.viewContainerRef:this._viewContainerRef,i=e.createComponent(t.component,{index:e.length,injector:t.injector||e.injector,projectableNodes:t.projectableNodes||void 0,ngModuleRef:this._moduleRef||void 0});return e!==this._viewContainerRef&&this._getRootNode().appendChild(i.hostView.rootNodes[0]),super.setDisposeFn(()=>i.destroy()),this._attachedPortal=t,this._attachedRef=i,this.attached.emit(i),i}attachTemplatePortal(t){t.setAttachedHost(this);let e=this._viewContainerRef.createEmbeddedView(t.templateRef,t.context,{injector:t.injector});return super.setDisposeFn(()=>this._viewContainerRef.clear()),this._attachedPortal=t,this._attachedRef=e,this.attached.emit(e),e}attachDomPortal=t=>{let e=t.element;e.parentNode;let i=this._document.createComment("dom-portal");t.setAttachedHost(this),e.parentNode.insertBefore(i,e),this._getRootNode().appendChild(e),this._attachedPortal=t,super.setDisposeFn(()=>{i.parentNode&&i.parentNode.replaceChild(e,i)})};_getRootNode(){let t=this._viewContainerRef.element.nativeElement;return t.nodeType===t.ELEMENT_NODE?t:t.parentNode}static \u0275fac=function(e){return new(e||o)};static \u0275dir=L({type:o,selectors:[["","cdkPortalOutlet",""]],inputs:{portal:[0,"cdkPortalOutlet","portal"]},outputs:{attached:"attached"},exportAs:["cdkPortalOutlet"],features:[W]})}return o})();var Ae=(()=>{class o{static \u0275fac=function(e){return new(e||o)};static \u0275mod=N({type:o});static \u0275inj=F({})}return o})();var Ri;function Ur(){if(Ri==null){let o=typeof document<"u"?document.head:null;Ri=!!(o&&(o.createShadowRoot||o.attachShadow))}return Ri}function mo(o){if(Ur()){let n=o.getRootNode?o.getRootNode():null;if(typeof ShadowRoot<"u"&&ShadowRoot&&n instanceof ShadowRoot)return n}return null}function Yt(){let o=typeof document<"u"&&document?document.activeElement:null;for(;o&&o.shadowRoot;){let n=o.shadowRoot.activeElement;if(n===o)break;o=n}return o}function ee(o){return o.composedPath?o.composedPath()[0]:o.target}function ki(){return typeof __karma__<"u"&&!!__karma__||typeof jasmine<"u"&&!!jasmine||typeof jest<"u"&&!!jest||typeof Mocha<"u"&&!!Mocha}var Kt=new WeakMap,We=(()=>{class o{_appRef;_injector=u(O);_environmentInjector=u(Me);load(t){let e=this._appRef=this._appRef||this._injector.get(Ne),i=Kt.get(e);i||(i={loaders:new Set,refs:[]},Kt.set(e,i),e.onDestroy(()=>{Kt.get(e)?.refs.forEach(r=>r.destroy()),Kt.delete(e)})),i.loaders.has(t)||(i.loaders.add(t),i.refs.push(Pt(t,{environmentInjector:this._environmentInjector})))}static \u0275fac=function(e){return new(e||o)};static \u0275prov=b({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();function x(o){return o==null?"":typeof o=="string"?o:`${o}px`}var Ti={},pe=(()=>{class o{_appId=u(kn);getId(t){return this._appId!=="ng"&&(t+=this._appId),Ti.hasOwnProperty(t)||(Ti[t]=0),`${t}${Ti[t]++}`}static \u0275fac=function(e){return new(e||o)};static \u0275prov=b({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();function ge(o,...n){return n.length?n.some(t=>o[t]):o.altKey||o.shiftKey||o.ctrlKey||o.metaKey}var _o=$t();function Ke(o){return new Xt(o.get(Oe),o.get(M))}var Xt=class{_viewportRuler;_previousHTMLStyles={top:"",left:""};_previousScrollPosition;_isEnabled=!1;_document;constructor(n,t){this._viewportRuler=n,this._document=t}attach(){}enable(){if(this._canBeEnabled()){let n=this._document.documentElement;this._previousScrollPosition=this._viewportRuler.getViewportScrollPosition(),this._previousHTMLStyles.left=n.style.left||"",this._previousHTMLStyles.top=n.style.top||"",n.style.left=x(-this._previousScrollPosition.left),n.style.top=x(-this._previousScrollPosition.top),n.classList.add("cdk-global-scrollblock"),this._isEnabled=!0}}disable(){if(this._isEnabled){let n=this._document.documentElement,t=this._document.body,e=n.style,i=t.style,r=e.scrollBehavior||"",s=i.scrollBehavior||"";this._isEnabled=!1,e.left=this._previousHTMLStyles.left,e.top=this._previousHTMLStyles.top,n.classList.remove("cdk-global-scrollblock"),_o&&(e.scrollBehavior=i.scrollBehavior="auto"),window.scroll(this._previousScrollPosition.left,this._previousScrollPosition.top),_o&&(e.scrollBehavior=r,i.scrollBehavior=s)}}_canBeEnabled(){if(this._document.documentElement.classList.contains("cdk-global-scrollblock")||this._isEnabled)return!1;let t=this._document.documentElement,e=this._viewportRuler.getViewportSize();return t.scrollHeight>e.height||t.scrollWidth>e.width}};function Do(o,n){return new Zt(o.get(ct),o.get(U),o.get(Oe),n)}var Zt=class{_scrollDispatcher;_ngZone;_viewportRuler;_config;_scrollSubscription=null;_overlayRef;_initialScrollPosition;constructor(n,t,e,i){this._scrollDispatcher=n,this._ngZone=t,this._viewportRuler=e,this._config=i}attach(n){this._overlayRef,this._overlayRef=n}enable(){if(this._scrollSubscription)return;let n=this._scrollDispatcher.scrolled(0).pipe(E(t=>!t||!this._overlayRef.overlayElement.contains(t.getElementRef().nativeElement)));this._config&&this._config.threshold&&this._config.threshold>1?(this._initialScrollPosition=this._viewportRuler.getViewportScrollPosition().top,this._scrollSubscription=n.subscribe(()=>{let t=this._viewportRuler.getViewportScrollPosition().top;Math.abs(t-this._initialScrollPosition)>this._config.threshold?this._detach():this._overlayRef.updatePosition()})):this._scrollSubscription=n.subscribe(this._detach)}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}_detach=()=>{this.disable(),this._overlayRef.hasAttached()&&this._ngZone.run(()=>this._overlayRef.detach())}};var ut=class{enable(){}disable(){}attach(){}};function xi(o,n){return n.some(t=>{let e=o.bottom<t.top,i=o.top>t.bottom,r=o.right<t.left,s=o.left>t.right;return e||i||r||s})}function vo(o,n){return n.some(t=>{let e=o.top<t.top,i=o.bottom>t.bottom,r=o.left<t.left,s=o.right>t.right;return e||i||r||s})}function ti(o,n){return new Qt(o.get(ct),o.get(Oe),o.get(U),n)}var Qt=class{_scrollDispatcher;_viewportRuler;_ngZone;_config;_scrollSubscription=null;_overlayRef;constructor(n,t,e,i){this._scrollDispatcher=n,this._viewportRuler=t,this._ngZone=e,this._config=i}attach(n){this._overlayRef,this._overlayRef=n}enable(){if(!this._scrollSubscription){let n=this._config?this._config.scrollThrottle:0;this._scrollSubscription=this._scrollDispatcher.scrolled(n).subscribe(()=>{if(this._overlayRef.updatePosition(),this._config&&this._config.autoClose){let t=this._overlayRef.overlayElement.getBoundingClientRect(),{width:e,height:i}=this._viewportRuler.getViewportSize();xi(t,[{width:e,height:i,bottom:i,right:e,top:0,left:0}])&&(this.disable(),this._ngZone.run(()=>this._overlayRef.detach()))}})}}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}},Eo=(()=>{class o{_injector=u(O);constructor(){}noop=()=>new ut;close=t=>Do(this._injector,t);block=()=>Ke(this._injector);reposition=t=>ti(this._injector,t);static \u0275fac=function(e){return new(e||o)};static \u0275prov=b({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})(),ke=class{positionStrategy;scrollStrategy=new ut;panelClass="";hasBackdrop=!1;backdropClass="cdk-overlay-dark-backdrop";disableAnimations;width;height;minWidth;minHeight;maxWidth;maxHeight;direction;disposeOnNavigation=!1;constructor(n){if(n){let t=Object.keys(n);for(let e of t)n[e]!==void 0&&(this[e]=n[e])}}},Pi=class{offsetX;offsetY;panelClass;originX;originY;overlayX;overlayY;constructor(n,t,e,i,r){this.offsetX=e,this.offsetY=i,this.panelClass=r,this.originX=n.originX,this.originY=n.originY,this.overlayX=t.overlayX,this.overlayY=t.overlayY}};var qt=class{connectionPair;scrollableViewProperties;constructor(n,t){this.connectionPair=n,this.scrollableViewProperties=t}};var Oo=(()=>{class o{_attachedOverlays=[];_document=u(M);_isAttached;constructor(){}ngOnDestroy(){this.detach()}add(t){this.remove(t),this._attachedOverlays.push(t)}remove(t){let e=this._attachedOverlays.indexOf(t);e>-1&&this._attachedOverlays.splice(e,1),this._attachedOverlays.length===0&&this.detach()}static \u0275fac=function(e){return new(e||o)};static \u0275prov=b({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})(),wo=(()=>{class o extends Oo{_ngZone=u(U);_renderer=u(oe).createRenderer(null,null);_cleanupKeydown;add(t){super.add(t),this._isAttached||(this._ngZone.runOutsideAngular(()=>{this._cleanupKeydown=this._renderer.listen("body","keydown",this._keydownListener)}),this._isAttached=!0)}detach(){this._isAttached&&(this._cleanupKeydown?.(),this._isAttached=!1)}_keydownListener=t=>{let e=this._attachedOverlays;for(let i=e.length-1;i>-1;i--)if(e[i]._keydownEvents.observers.length>0){this._ngZone.run(()=>e[i]._keydownEvents.next(t));break}};static \u0275fac=(()=>{let t;return function(i){return(t||(t=he(o)))(i||o)}})();static \u0275prov=b({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})(),Ao=(()=>{class o extends Oo{_platform=u(H);_ngZone=u(U);_renderer=u(oe).createRenderer(null,null);_cursorOriginalValue;_cursorStyleIsSet=!1;_pointerDownEventTarget;_cleanups;add(t){if(super.add(t),!this._isAttached){let e=this._document.body,i={capture:!0},r=this._renderer;this._cleanups=this._ngZone.runOutsideAngular(()=>[r.listen(e,"pointerdown",this._pointerDownListener,i),r.listen(e,"click",this._clickListener,i),r.listen(e,"auxclick",this._clickListener,i),r.listen(e,"contextmenu",this._clickListener,i)]),this._platform.IOS&&!this._cursorStyleIsSet&&(this._cursorOriginalValue=e.style.cursor,e.style.cursor="pointer",this._cursorStyleIsSet=!0),this._isAttached=!0}}detach(){this._isAttached&&(this._cleanups?.forEach(t=>t()),this._cleanups=void 0,this._platform.IOS&&this._cursorStyleIsSet&&(this._document.body.style.cursor=this._cursorOriginalValue,this._cursorStyleIsSet=!1),this._isAttached=!1)}_pointerDownListener=t=>{this._pointerDownEventTarget=ee(t)};_clickListener=t=>{let e=ee(t),i=t.type==="click"&&this._pointerDownEventTarget?this._pointerDownEventTarget:e;this._pointerDownEventTarget=null;let r=this._attachedOverlays.slice();for(let s=r.length-1;s>-1;s--){let a=r[s];if(a._outsidePointerEvents.observers.length<1||!a.hasAttached())continue;if(yo(a.overlayElement,e)||yo(a.overlayElement,i))break;let c=a._outsidePointerEvents;this._ngZone?this._ngZone.run(()=>c.next(t)):c.next(t)}};static \u0275fac=(()=>{let t;return function(i){return(t||(t=he(o)))(i||o)}})();static \u0275prov=b({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();function yo(o,n){let t=typeof ShadowRoot<"u"&&ShadowRoot,e=n;for(;e;){if(e===o)return!0;e=t&&e instanceof ShadowRoot?e.host:e.parentNode}return!1}var Ro=(()=>{class o{static \u0275fac=function(e){return new(e||o)};static \u0275cmp=G({type:o,selectors:[["ng-component"]],hostAttrs:["cdk-overlay-style-loader",""],decls:0,vars:0,template:function(e,i){},styles:[`.cdk-overlay-container,.cdk-global-overlay-wrapper{pointer-events:none;top:0;left:0;height:100%;width:100%}.cdk-overlay-container{position:fixed}@layer cdk-overlay{.cdk-overlay-container{z-index:1000}}.cdk-overlay-container:empty{display:none}.cdk-global-overlay-wrapper{display:flex;position:absolute}@layer cdk-overlay{.cdk-global-overlay-wrapper{z-index:1000}}.cdk-overlay-pane{position:absolute;pointer-events:auto;box-sizing:border-box;display:flex;max-width:100%;max-height:100%}@layer cdk-overlay{.cdk-overlay-pane{z-index:1000}}.cdk-overlay-backdrop{position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:auto;-webkit-tap-highlight-color:rgba(0,0,0,0);opacity:0;touch-action:manipulation}@layer cdk-overlay{.cdk-overlay-backdrop{z-index:1000;transition:opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}}@media(prefers-reduced-motion){.cdk-overlay-backdrop{transition-duration:1ms}}.cdk-overlay-backdrop-showing{opacity:1}@media(forced-colors: active){.cdk-overlay-backdrop-showing{opacity:.6}}@layer cdk-overlay{.cdk-overlay-dark-backdrop{background:rgba(0,0,0,.32)}}.cdk-overlay-transparent-backdrop{transition:visibility 1ms linear,opacity 1ms linear;visibility:hidden;opacity:1}.cdk-overlay-transparent-backdrop.cdk-overlay-backdrop-showing,.cdk-high-contrast-active .cdk-overlay-transparent-backdrop{opacity:0;visibility:visible}.cdk-overlay-backdrop-noop-animation{transition:none}.cdk-overlay-connected-position-bounding-box{position:absolute;display:flex;flex-direction:column;min-width:1px;min-height:1px}@layer cdk-overlay{.cdk-overlay-connected-position-bounding-box{z-index:1000}}.cdk-global-scrollblock{position:fixed;width:100%;overflow-y:scroll}
3
+ `],encapsulation:2,changeDetection:0})}return o})(),ii=(()=>{class o{_platform=u(H);_containerElement;_document=u(M);_styleLoader=u(We);constructor(){}ngOnDestroy(){this._containerElement?.remove()}getContainerElement(){return this._loadStyles(),this._containerElement||this._createContainer(),this._containerElement}_createContainer(){let t="cdk-overlay-container";if(this._platform.isBrowser||ki()){let i=this._document.querySelectorAll(`.${t}[platform="server"], .${t}[platform="test"]`);for(let r=0;r<i.length;r++)i[r].remove()}let e=this._document.createElement("div");e.classList.add(t),ki()?e.setAttribute("platform","test"):this._platform.isBrowser||e.setAttribute("platform","server"),this._document.body.appendChild(e),this._containerElement=e}_loadStyles(){this._styleLoader.load(Ro)}static \u0275fac=function(e){return new(e||o)};static \u0275prov=b({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})(),Mi=class{_renderer;_ngZone;element;_cleanupClick;_cleanupTransitionEnd;_fallbackTimeout;constructor(n,t,e,i){this._renderer=t,this._ngZone=e,this.element=n.createElement("div"),this.element.classList.add("cdk-overlay-backdrop"),this._cleanupClick=t.listen(this.element,"click",i)}detach(){this._ngZone.runOutsideAngular(()=>{let n=this.element;clearTimeout(this._fallbackTimeout),this._cleanupTransitionEnd?.(),this._cleanupTransitionEnd=this._renderer.listen(n,"transitionend",this.dispose),this._fallbackTimeout=setTimeout(this.dispose,500),n.style.pointerEvents="none",n.classList.remove("cdk-overlay-backdrop-showing")})}dispose=()=>{clearTimeout(this._fallbackTimeout),this._cleanupClick?.(),this._cleanupTransitionEnd?.(),this._cleanupClick=this._cleanupTransitionEnd=this._fallbackTimeout=void 0,this.element.remove()}},Ye=class{_portalOutlet;_host;_pane;_config;_ngZone;_keyboardDispatcher;_document;_location;_outsideClickDispatcher;_animationsDisabled;_injector;_renderer;_backdropClick=new y;_attachments=new y;_detachments=new y;_positionStrategy;_scrollStrategy;_locationChanges=K.EMPTY;_backdropRef=null;_detachContentMutationObserver;_detachContentAfterRenderRef;_previousHostParent;_keydownEvents=new y;_outsidePointerEvents=new y;_afterNextRenderRef;constructor(n,t,e,i,r,s,a,c,l,d=!1,h,p){this._portalOutlet=n,this._host=t,this._pane=e,this._config=i,this._ngZone=r,this._keyboardDispatcher=s,this._document=a,this._location=c,this._outsideClickDispatcher=l,this._animationsDisabled=d,this._injector=h,this._renderer=p,i.scrollStrategy&&(this._scrollStrategy=i.scrollStrategy,this._scrollStrategy.attach(this)),this._positionStrategy=i.positionStrategy}get overlayElement(){return this._pane}get backdropElement(){return this._backdropRef?.element||null}get hostElement(){return this._host}attach(n){!this._host.parentElement&&this._previousHostParent&&this._previousHostParent.appendChild(this._host);let t=this._portalOutlet.attach(n);return this._positionStrategy&&this._positionStrategy.attach(this),this._updateStackingOrder(),this._updateElementSize(),this._updateElementDirection(),this._scrollStrategy&&this._scrollStrategy.enable(),this._afterNextRenderRef?.destroy(),this._afterNextRenderRef=ne(()=>{this.hasAttached()&&this.updatePosition()},{injector:this._injector}),this._togglePointerEvents(!0),this._config.hasBackdrop&&this._attachBackdrop(),this._config.panelClass&&this._toggleClasses(this._pane,this._config.panelClass,!0),this._attachments.next(),this._completeDetachContent(),this._keyboardDispatcher.add(this),this._config.disposeOnNavigation&&(this._locationChanges=this._location.subscribe(()=>this.dispose())),this._outsideClickDispatcher.add(this),typeof t?.onDestroy=="function"&&t.onDestroy(()=>{this.hasAttached()&&this._ngZone.runOutsideAngular(()=>Promise.resolve().then(()=>this.detach()))}),t}detach(){if(!this.hasAttached())return;this.detachBackdrop(),this._togglePointerEvents(!1),this._positionStrategy&&this._positionStrategy.detach&&this._positionStrategy.detach(),this._scrollStrategy&&this._scrollStrategy.disable();let n=this._portalOutlet.detach();return this._detachments.next(),this._completeDetachContent(),this._keyboardDispatcher.remove(this),this._detachContentWhenEmpty(),this._locationChanges.unsubscribe(),this._outsideClickDispatcher.remove(this),n}dispose(){let n=this.hasAttached();this._positionStrategy&&this._positionStrategy.dispose(),this._disposeScrollStrategy(),this._backdropRef?.dispose(),this._locationChanges.unsubscribe(),this._keyboardDispatcher.remove(this),this._portalOutlet.dispose(),this._attachments.complete(),this._backdropClick.complete(),this._keydownEvents.complete(),this._outsidePointerEvents.complete(),this._outsideClickDispatcher.remove(this),this._host?.remove(),this._afterNextRenderRef?.destroy(),this._previousHostParent=this._pane=this._host=this._backdropRef=null,n&&this._detachments.next(),this._detachments.complete(),this._completeDetachContent()}hasAttached(){return this._portalOutlet.hasAttached()}backdropClick(){return this._backdropClick}attachments(){return this._attachments}detachments(){return this._detachments}keydownEvents(){return this._keydownEvents}outsidePointerEvents(){return this._outsidePointerEvents}getConfig(){return this._config}updatePosition(){this._positionStrategy&&this._positionStrategy.apply()}updatePositionStrategy(n){n!==this._positionStrategy&&(this._positionStrategy&&this._positionStrategy.dispose(),this._positionStrategy=n,this.hasAttached()&&(n.attach(this),this.updatePosition()))}updateSize(n){this._config=m(m({},this._config),n),this._updateElementSize()}setDirection(n){this._config=k(m({},this._config),{direction:n}),this._updateElementDirection()}addPanelClass(n){this._pane&&this._toggleClasses(this._pane,n,!0)}removePanelClass(n){this._pane&&this._toggleClasses(this._pane,n,!1)}getDirection(){let n=this._config.direction;return n?typeof n=="string"?n:n.value:"ltr"}updateScrollStrategy(n){n!==this._scrollStrategy&&(this._disposeScrollStrategy(),this._scrollStrategy=n,this.hasAttached()&&(n.attach(this),n.enable()))}_updateElementDirection(){this._host.setAttribute("dir",this.getDirection())}_updateElementSize(){if(!this._pane)return;let n=this._pane.style;n.width=x(this._config.width),n.height=x(this._config.height),n.minWidth=x(this._config.minWidth),n.minHeight=x(this._config.minHeight),n.maxWidth=x(this._config.maxWidth),n.maxHeight=x(this._config.maxHeight)}_togglePointerEvents(n){this._pane.style.pointerEvents=n?"":"none"}_attachBackdrop(){let n="cdk-overlay-backdrop-showing";this._backdropRef?.dispose(),this._backdropRef=new Mi(this._document,this._renderer,this._ngZone,t=>{this._backdropClick.next(t)}),this._animationsDisabled&&this._backdropRef.element.classList.add("cdk-overlay-backdrop-noop-animation"),this._config.backdropClass&&this._toggleClasses(this._backdropRef.element,this._config.backdropClass,!0),this._host.parentElement.insertBefore(this._backdropRef.element,this._host),!this._animationsDisabled&&typeof requestAnimationFrame<"u"?this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>this._backdropRef?.element.classList.add(n))}):this._backdropRef.element.classList.add(n)}_updateStackingOrder(){this._host.nextSibling&&this._host.parentNode.appendChild(this._host)}detachBackdrop(){this._animationsDisabled?(this._backdropRef?.dispose(),this._backdropRef=null):this._backdropRef?.detach()}_toggleClasses(n,t,e){let i=Mt(t||[]).filter(r=>!!r);i.length&&(e?n.classList.add(...i):n.classList.remove(...i))}_detachContentWhenEmpty(){let n=!1;try{this._detachContentAfterRenderRef=ne(()=>{n=!0,this._detachContent()},{injector:this._injector})}catch(t){if(n)throw t;this._detachContent()}globalThis.MutationObserver&&this._pane&&(this._detachContentMutationObserver||=new globalThis.MutationObserver(()=>{this._detachContent()}),this._detachContentMutationObserver.observe(this._pane,{childList:!0}))}_detachContent(){(!this._pane||!this._host||this._pane.children.length===0)&&(this._pane&&this._config.panelClass&&this._toggleClasses(this._pane,this._config.panelClass,!1),this._host&&this._host.parentElement&&(this._previousHostParent=this._host.parentElement,this._host.remove()),this._completeDetachContent())}_completeDetachContent(){this._detachContentAfterRenderRef?.destroy(),this._detachContentAfterRenderRef=void 0,this._detachContentMutationObserver?.disconnect()}_disposeScrollStrategy(){let n=this._scrollStrategy;n?.disable(),n?.detach?.()}},Co="cdk-overlay-connected-position-bounding-box",Nr=/([A-Za-z%]+)$/;function Ui(o,n){return new Jt(n,o.get(Oe),o.get(M),o.get(H),o.get(ii))}var Jt=class{_viewportRuler;_document;_platform;_overlayContainer;_overlayRef;_isInitialRender;_lastBoundingBoxSize={width:0,height:0};_isPushed=!1;_canPush=!0;_growAfterOpen=!1;_hasFlexibleDimensions=!0;_positionLocked=!1;_originRect;_overlayRect;_viewportRect;_containerRect;_viewportMargin=0;_scrollables=[];_preferredPositions=[];_origin;_pane;_isDisposed;_boundingBox;_lastPosition;_lastScrollVisibility;_positionChanges=new y;_resizeSubscription=K.EMPTY;_offsetX=0;_offsetY=0;_transformOriginSelector;_appliedPanelClasses=[];_previousPushAmount;positionChanges=this._positionChanges;get positions(){return this._preferredPositions}constructor(n,t,e,i,r){this._viewportRuler=t,this._document=e,this._platform=i,this._overlayContainer=r,this.setOrigin(n)}attach(n){this._overlayRef&&this._overlayRef,this._validatePositions(),n.hostElement.classList.add(Co),this._overlayRef=n,this._boundingBox=n.hostElement,this._pane=n.overlayElement,this._isDisposed=!1,this._isInitialRender=!0,this._lastPosition=null,this._resizeSubscription.unsubscribe(),this._resizeSubscription=this._viewportRuler.change().subscribe(()=>{this._isInitialRender=!0,this.apply()})}apply(){if(this._isDisposed||!this._platform.isBrowser)return;if(!this._isInitialRender&&this._positionLocked&&this._lastPosition){this.reapplyLastPosition();return}this._clearPanelClasses(),this._resetOverlayElementStyles(),this._resetBoundingBoxStyles(),this._viewportRect=this._getNarrowedViewportRect(),this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect(),this._containerRect=this._overlayContainer.getContainerElement().getBoundingClientRect();let n=this._originRect,t=this._overlayRect,e=this._viewportRect,i=this._containerRect,r=[],s;for(let a of this._preferredPositions){let c=this._getOriginPoint(n,i,a),l=this._getOverlayPoint(c,t,a),d=this._getOverlayFit(l,t,e,a);if(d.isCompletelyWithinViewport){this._isPushed=!1,this._applyPosition(a,c);return}if(this._canFitWithFlexibleDimensions(d,l,e)){r.push({position:a,origin:c,overlayRect:t,boundingBoxRect:this._calculateBoundingBoxRect(c,a)});continue}(!s||s.overlayFit.visibleArea<d.visibleArea)&&(s={overlayFit:d,overlayPoint:l,originPoint:c,position:a,overlayRect:t})}if(r.length){let a=null,c=-1;for(let l of r){let d=l.boundingBoxRect.width*l.boundingBoxRect.height*(l.position.weight||1);d>c&&(c=d,a=l)}this._isPushed=!1,this._applyPosition(a.position,a.origin);return}if(this._canPush){this._isPushed=!0,this._applyPosition(s.position,s.originPoint);return}this._applyPosition(s.position,s.originPoint)}detach(){this._clearPanelClasses(),this._lastPosition=null,this._previousPushAmount=null,this._resizeSubscription.unsubscribe()}dispose(){this._isDisposed||(this._boundingBox&&Re(this._boundingBox.style,{top:"",left:"",right:"",bottom:"",height:"",width:"",alignItems:"",justifyContent:""}),this._pane&&this._resetOverlayElementStyles(),this._overlayRef&&this._overlayRef.hostElement.classList.remove(Co),this.detach(),this._positionChanges.complete(),this._overlayRef=this._boundingBox=null,this._isDisposed=!0)}reapplyLastPosition(){if(this._isDisposed||!this._platform.isBrowser)return;let n=this._lastPosition;if(n){this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect(),this._viewportRect=this._getNarrowedViewportRect(),this._containerRect=this._overlayContainer.getContainerElement().getBoundingClientRect();let t=this._getOriginPoint(this._originRect,this._containerRect,n);this._applyPosition(n,t)}else this.apply()}withScrollableContainers(n){return this._scrollables=n,this}withPositions(n){return this._preferredPositions=n,n.indexOf(this._lastPosition)===-1&&(this._lastPosition=null),this._validatePositions(),this}withViewportMargin(n){return this._viewportMargin=n,this}withFlexibleDimensions(n=!0){return this._hasFlexibleDimensions=n,this}withGrowAfterOpen(n=!0){return this._growAfterOpen=n,this}withPush(n=!0){return this._canPush=n,this}withLockedPosition(n=!0){return this._positionLocked=n,this}setOrigin(n){return this._origin=n,this}withDefaultOffsetX(n){return this._offsetX=n,this}withDefaultOffsetY(n){return this._offsetY=n,this}withTransformOriginOn(n){return this._transformOriginSelector=n,this}_getOriginPoint(n,t,e){let i;if(e.originX=="center")i=n.left+n.width/2;else{let s=this._isRtl()?n.right:n.left,a=this._isRtl()?n.left:n.right;i=e.originX=="start"?s:a}t.left<0&&(i-=t.left);let r;return e.originY=="center"?r=n.top+n.height/2:r=e.originY=="top"?n.top:n.bottom,t.top<0&&(r-=t.top),{x:i,y:r}}_getOverlayPoint(n,t,e){let i;e.overlayX=="center"?i=-t.width/2:e.overlayX==="start"?i=this._isRtl()?-t.width:0:i=this._isRtl()?0:-t.width;let r;return e.overlayY=="center"?r=-t.height/2:r=e.overlayY=="top"?0:-t.height,{x:n.x+i,y:n.y+r}}_getOverlayFit(n,t,e,i){let r=So(t),{x:s,y:a}=n,c=this._getOffset(i,"x"),l=this._getOffset(i,"y");c&&(s+=c),l&&(a+=l);let d=0-s,h=s+r.width-e.width,p=0-a,f=a+r.height-e.height,g=this._subtractOverflows(r.width,d,h),C=this._subtractOverflows(r.height,p,f),$=g*C;return{visibleArea:$,isCompletelyWithinViewport:r.width*r.height===$,fitsInViewportVertically:C===r.height,fitsInViewportHorizontally:g==r.width}}_canFitWithFlexibleDimensions(n,t,e){if(this._hasFlexibleDimensions){let i=e.bottom-t.y,r=e.right-t.x,s=bo(this._overlayRef.getConfig().minHeight),a=bo(this._overlayRef.getConfig().minWidth),c=n.fitsInViewportVertically||s!=null&&s<=i,l=n.fitsInViewportHorizontally||a!=null&&a<=r;return c&&l}return!1}_pushOverlayOnScreen(n,t,e){if(this._previousPushAmount&&this._positionLocked)return{x:n.x+this._previousPushAmount.x,y:n.y+this._previousPushAmount.y};let i=So(t),r=this._viewportRect,s=Math.max(n.x+i.width-r.width,0),a=Math.max(n.y+i.height-r.height,0),c=Math.max(r.top-e.top-n.y,0),l=Math.max(r.left-e.left-n.x,0),d=0,h=0;return i.width<=r.width?d=l||-s:d=n.x<this._viewportMargin?r.left-e.left-n.x:0,i.height<=r.height?h=c||-a:h=n.y<this._viewportMargin?r.top-e.top-n.y:0,this._previousPushAmount={x:d,y:h},{x:n.x+d,y:n.y+h}}_applyPosition(n,t){if(this._setTransformOrigin(n),this._setOverlayElementStyles(t,n),this._setBoundingBoxStyles(t,n),n.panelClass&&this._addPanelClasses(n.panelClass),this._positionChanges.observers.length){let e=this._getScrollVisibility();if(n!==this._lastPosition||!this._lastScrollVisibility||!zr(this._lastScrollVisibility,e)){let i=new qt(n,e);this._positionChanges.next(i)}this._lastScrollVisibility=e}this._lastPosition=n,this._isInitialRender=!1}_setTransformOrigin(n){if(!this._transformOriginSelector)return;let t=this._boundingBox.querySelectorAll(this._transformOriginSelector),e,i=n.overlayY;n.overlayX==="center"?e="center":this._isRtl()?e=n.overlayX==="start"?"right":"left":e=n.overlayX==="start"?"left":"right";for(let r=0;r<t.length;r++)t[r].style.transformOrigin=`${e} ${i}`}_calculateBoundingBoxRect(n,t){let e=this._viewportRect,i=this._isRtl(),r,s,a;if(t.overlayY==="top")s=n.y,r=e.height-s+this._viewportMargin;else if(t.overlayY==="bottom")a=e.height-n.y+this._viewportMargin*2,r=e.height-a+this._viewportMargin;else{let f=Math.min(e.bottom-n.y+e.top,n.y),g=this._lastBoundingBoxSize.height;r=f*2,s=n.y-f,r>g&&!this._isInitialRender&&!this._growAfterOpen&&(s=n.y-g/2)}let c=t.overlayX==="start"&&!i||t.overlayX==="end"&&i,l=t.overlayX==="end"&&!i||t.overlayX==="start"&&i,d,h,p;if(l)p=e.width-n.x+this._viewportMargin*2,d=n.x-this._viewportMargin;else if(c)h=n.x,d=e.right-n.x;else{let f=Math.min(e.right-n.x+e.left,n.x),g=this._lastBoundingBoxSize.width;d=f*2,h=n.x-f,d>g&&!this._isInitialRender&&!this._growAfterOpen&&(h=n.x-g/2)}return{top:s,left:h,bottom:a,right:p,width:d,height:r}}_setBoundingBoxStyles(n,t){let e=this._calculateBoundingBoxRect(n,t);!this._isInitialRender&&!this._growAfterOpen&&(e.height=Math.min(e.height,this._lastBoundingBoxSize.height),e.width=Math.min(e.width,this._lastBoundingBoxSize.width));let i={};if(this._hasExactPosition())i.top=i.left="0",i.bottom=i.right=i.maxHeight=i.maxWidth="",i.width=i.height="100%";else{let r=this._overlayRef.getConfig().maxHeight,s=this._overlayRef.getConfig().maxWidth;i.height=x(e.height),i.top=x(e.top),i.bottom=x(e.bottom),i.width=x(e.width),i.left=x(e.left),i.right=x(e.right),t.overlayX==="center"?i.alignItems="center":i.alignItems=t.overlayX==="end"?"flex-end":"flex-start",t.overlayY==="center"?i.justifyContent="center":i.justifyContent=t.overlayY==="bottom"?"flex-end":"flex-start",r&&(i.maxHeight=x(r)),s&&(i.maxWidth=x(s))}this._lastBoundingBoxSize=e,Re(this._boundingBox.style,i)}_resetBoundingBoxStyles(){Re(this._boundingBox.style,{top:"0",left:"0",right:"0",bottom:"0",height:"",width:"",alignItems:"",justifyContent:""})}_resetOverlayElementStyles(){Re(this._pane.style,{top:"",left:"",bottom:"",right:"",position:"",transform:""})}_setOverlayElementStyles(n,t){let e={},i=this._hasExactPosition(),r=this._hasFlexibleDimensions,s=this._overlayRef.getConfig();if(i){let d=this._viewportRuler.getViewportScrollPosition();Re(e,this._getExactOverlayY(t,n,d)),Re(e,this._getExactOverlayX(t,n,d))}else e.position="static";let a="",c=this._getOffset(t,"x"),l=this._getOffset(t,"y");c&&(a+=`translateX(${c}px) `),l&&(a+=`translateY(${l}px)`),e.transform=a.trim(),s.maxHeight&&(i?e.maxHeight=x(s.maxHeight):r&&(e.maxHeight="")),s.maxWidth&&(i?e.maxWidth=x(s.maxWidth):r&&(e.maxWidth="")),Re(this._pane.style,e)}_getExactOverlayY(n,t,e){let i={top:"",bottom:""},r=this._getOverlayPoint(t,this._overlayRect,n);if(this._isPushed&&(r=this._pushOverlayOnScreen(r,this._overlayRect,e)),n.overlayY==="bottom"){let s=this._document.documentElement.clientHeight;i.bottom=`${s-(r.y+this._overlayRect.height)}px`}else i.top=x(r.y);return i}_getExactOverlayX(n,t,e){let i={left:"",right:""},r=this._getOverlayPoint(t,this._overlayRect,n);this._isPushed&&(r=this._pushOverlayOnScreen(r,this._overlayRect,e));let s;if(this._isRtl()?s=n.overlayX==="end"?"left":"right":s=n.overlayX==="end"?"right":"left",s==="right"){let a=this._document.documentElement.clientWidth;i.right=`${a-(r.x+this._overlayRect.width)}px`}else i.left=x(r.x);return i}_getScrollVisibility(){let n=this._getOriginRect(),t=this._pane.getBoundingClientRect(),e=this._scrollables.map(i=>i.getElementRef().nativeElement.getBoundingClientRect());return{isOriginClipped:vo(n,e),isOriginOutsideView:xi(n,e),isOverlayClipped:vo(t,e),isOverlayOutsideView:xi(t,e)}}_subtractOverflows(n,...t){return t.reduce((e,i)=>e-Math.max(i,0),n)}_getNarrowedViewportRect(){let n=this._document.documentElement.clientWidth,t=this._document.documentElement.clientHeight,e=this._viewportRuler.getViewportScrollPosition();return{top:e.top+this._viewportMargin,left:e.left+this._viewportMargin,right:e.left+n-this._viewportMargin,bottom:e.top+t-this._viewportMargin,width:n-2*this._viewportMargin,height:t-2*this._viewportMargin}}_isRtl(){return this._overlayRef.getDirection()==="rtl"}_hasExactPosition(){return!this._hasFlexibleDimensions||this._isPushed}_getOffset(n,t){return t==="x"?n.offsetX==null?this._offsetX:n.offsetX:n.offsetY==null?this._offsetY:n.offsetY}_validatePositions(){}_addPanelClasses(n){this._pane&&Mt(n).forEach(t=>{t!==""&&this._appliedPanelClasses.indexOf(t)===-1&&(this._appliedPanelClasses.push(t),this._pane.classList.add(t))})}_clearPanelClasses(){this._pane&&(this._appliedPanelClasses.forEach(n=>{this._pane.classList.remove(n)}),this._appliedPanelClasses=[])}_getOriginRect(){let n=this._origin;if(n instanceof R)return n.nativeElement.getBoundingClientRect();if(n instanceof Element)return n.getBoundingClientRect();let t=n.width||0,e=n.height||0;return{top:n.y,bottom:n.y+e,left:n.x,right:n.x+t,height:e,width:t}}};function Re(o,n){for(let t in n)n.hasOwnProperty(t)&&(o[t]=n[t]);return o}function bo(o){if(typeof o!="number"&&o!=null){let[n,t]=o.split(Nr);return!t||t==="px"?parseFloat(n):null}return o||null}function So(o){return{top:Math.floor(o.top),right:Math.floor(o.right),bottom:Math.floor(o.bottom),left:Math.floor(o.left),width:Math.floor(o.width),height:Math.floor(o.height)}}function zr(o,n){return o===n?!0:o.isOriginClipped===n.isOriginClipped&&o.isOriginOutsideView===n.isOriginOutsideView&&o.isOverlayClipped===n.isOverlayClipped&&o.isOverlayOutsideView===n.isOverlayOutsideView}var Io="cdk-global-overlay-wrapper";function Xe(o){return new ei}var ei=class{_overlayRef;_cssPosition="static";_topOffset="";_bottomOffset="";_alignItems="";_xPosition="";_xOffset="";_width="";_height="";_isDisposed=!1;attach(n){let t=n.getConfig();this._overlayRef=n,this._width&&!t.width&&n.updateSize({width:this._width}),this._height&&!t.height&&n.updateSize({height:this._height}),n.hostElement.classList.add(Io),this._isDisposed=!1}top(n=""){return this._bottomOffset="",this._topOffset=n,this._alignItems="flex-start",this}left(n=""){return this._xOffset=n,this._xPosition="left",this}bottom(n=""){return this._topOffset="",this._bottomOffset=n,this._alignItems="flex-end",this}right(n=""){return this._xOffset=n,this._xPosition="right",this}start(n=""){return this._xOffset=n,this._xPosition="start",this}end(n=""){return this._xOffset=n,this._xPosition="end",this}width(n=""){return this._overlayRef?this._overlayRef.updateSize({width:n}):this._width=n,this}height(n=""){return this._overlayRef?this._overlayRef.updateSize({height:n}):this._height=n,this}centerHorizontally(n=""){return this.left(n),this._xPosition="center",this}centerVertically(n=""){return this.top(n),this._alignItems="center",this}apply(){if(!this._overlayRef||!this._overlayRef.hasAttached())return;let n=this._overlayRef.overlayElement.style,t=this._overlayRef.hostElement.style,e=this._overlayRef.getConfig(),{width:i,height:r,maxWidth:s,maxHeight:a}=e,c=(i==="100%"||i==="100vw")&&(!s||s==="100%"||s==="100vw"),l=(r==="100%"||r==="100vh")&&(!a||a==="100%"||a==="100vh"),d=this._xPosition,h=this._xOffset,p=this._overlayRef.getConfig().direction==="rtl",f="",g="",C="";c?C="flex-start":d==="center"?(C="center",p?g=h:f=h):p?d==="left"||d==="end"?(C="flex-end",f=h):(d==="right"||d==="start")&&(C="flex-start",g=h):d==="left"||d==="start"?(C="flex-start",f=h):(d==="right"||d==="end")&&(C="flex-end",g=h),n.position=this._cssPosition,n.marginLeft=c?"0":f,n.marginTop=l?"0":this._topOffset,n.marginBottom=this._bottomOffset,n.marginRight=c?"0":g,t.justifyContent=C,t.alignItems=l?"flex-start":this._alignItems}dispose(){if(this._isDisposed||!this._overlayRef)return;let n=this._overlayRef.overlayElement.style,t=this._overlayRef.hostElement,e=t.style;t.classList.remove(Io),e.justifyContent=e.alignItems=n.marginTop=n.marginBottom=n.marginLeft=n.marginRight=n.position="",this._overlayRef=null,this._isDisposed=!0}},ko=(()=>{class o{_injector=u(O);constructor(){}global(){return Xe()}flexibleConnectedTo(t){return Ui(this._injector,t)}static \u0275fac=function(e){return new(e||o)};static \u0275prov=b({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();function ft(o,n){o.get(We).load(Ro);let t=o.get(ii),e=o.get(M),i=o.get(pe),r=o.get(Ne),s=o.get(ae),a=e.createElement("div"),c=e.createElement("div");c.id=i.getId("cdk-overlay-"),c.classList.add("cdk-overlay-pane"),a.appendChild(c),t.getContainerElement().appendChild(a);let l=new Wt(c,r,o),d=new ke(n),h=o.get(Fe,null,{optional:!0})||o.get(oe).createRenderer(null,null);return d.direction=d.direction||s.value,new Ye(l,a,c,d,o.get(U),o.get(wo),e,o.get(Hn),o.get(Ao),n?.disableAnimations??o.get(At,null,{optional:!0})==="NoopAnimations",o.get(Me),h)}var To=(()=>{class o{scrollStrategies=u(Eo);_positionBuilder=u(ko);_injector=u(O);constructor(){}create(t){return ft(this._injector,t)}position(){return this._positionBuilder}static \u0275fac=function(e){return new(e||o)};static \u0275prov=b({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})(),Br=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom"},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"}],xo=new A("cdk-connected-overlay-scroll-strategy",{providedIn:"root",factory:()=>{let o=u(O);return()=>ti(o)}}),Li=(()=>{class o{elementRef=u(R);constructor(){}static \u0275fac=function(e){return new(e||o)};static \u0275dir=L({type:o,selectors:[["","cdk-overlay-origin",""],["","overlay-origin",""],["","cdkOverlayOrigin",""]],exportAs:["cdkOverlayOrigin"]})}return o})(),Vr=(()=>{class o{_dir=u(ae,{optional:!0});_injector=u(O);_overlayRef;_templatePortal;_backdropSubscription=K.EMPTY;_attachSubscription=K.EMPTY;_detachSubscription=K.EMPTY;_positionSubscription=K.EMPTY;_offsetX;_offsetY;_position;_scrollStrategyFactory=u(xo);_disposeOnNavigation=!1;_ngZone=u(U);origin;positions;positionStrategy;get offsetX(){return this._offsetX}set offsetX(t){this._offsetX=t,this._position&&this._updatePositionStrategy(this._position)}get offsetY(){return this._offsetY}set offsetY(t){this._offsetY=t,this._position&&this._updatePositionStrategy(this._position)}width;height;minWidth;minHeight;backdropClass;panelClass;viewportMargin=0;scrollStrategy;open=!1;disableClose=!1;transformOriginSelector;hasBackdrop=!1;lockPosition=!1;flexibleDimensions=!1;growAfterOpen=!1;push=!1;get disposeOnNavigation(){return this._disposeOnNavigation}set disposeOnNavigation(t){this._disposeOnNavigation=t}backdropClick=new B;positionChange=new B;attach=new B;detach=new B;overlayKeydown=new B;overlayOutsideClick=new B;constructor(){let t=u(be),e=u(Ue);this._templatePortal=new we(t,e),this.scrollStrategy=this._scrollStrategyFactory()}get overlayRef(){return this._overlayRef}get dir(){return this._dir?this._dir.value:"ltr"}ngOnDestroy(){this._attachSubscription.unsubscribe(),this._detachSubscription.unsubscribe(),this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe(),this._overlayRef?.dispose()}ngOnChanges(t){this._position&&(this._updatePositionStrategy(this._position),this._overlayRef?.updateSize({width:this.width,minWidth:this.minWidth,height:this.height,minHeight:this.minHeight}),t.origin&&this.open&&this._position.apply()),t.open&&(this.open?this.attachOverlay():this.detachOverlay())}_createOverlay(){(!this.positions||!this.positions.length)&&(this.positions=Br);let t=this._overlayRef=ft(this._injector,this._buildConfig());this._attachSubscription=t.attachments().subscribe(()=>this.attach.emit()),this._detachSubscription=t.detachments().subscribe(()=>this.detach.emit()),t.keydownEvents().subscribe(e=>{this.overlayKeydown.next(e),e.keyCode===27&&!this.disableClose&&!ge(e)&&(e.preventDefault(),this.detachOverlay())}),this._overlayRef.outsidePointerEvents().subscribe(e=>{let i=this._getOriginElement(),r=ee(e);(!i||i!==r&&!i.contains(r))&&this.overlayOutsideClick.next(e)})}_buildConfig(){let t=this._position=this.positionStrategy||this._createPositionStrategy(),e=new ke({direction:this._dir||"ltr",positionStrategy:t,scrollStrategy:this.scrollStrategy,hasBackdrop:this.hasBackdrop,disposeOnNavigation:this.disposeOnNavigation});return(this.width||this.width===0)&&(e.width=this.width),(this.height||this.height===0)&&(e.height=this.height),(this.minWidth||this.minWidth===0)&&(e.minWidth=this.minWidth),(this.minHeight||this.minHeight===0)&&(e.minHeight=this.minHeight),this.backdropClass&&(e.backdropClass=this.backdropClass),this.panelClass&&(e.panelClass=this.panelClass),e}_updatePositionStrategy(t){let e=this.positions.map(i=>({originX:i.originX,originY:i.originY,overlayX:i.overlayX,overlayY:i.overlayY,offsetX:i.offsetX||this.offsetX,offsetY:i.offsetY||this.offsetY,panelClass:i.panelClass||void 0}));return t.setOrigin(this._getOrigin()).withPositions(e).withFlexibleDimensions(this.flexibleDimensions).withPush(this.push).withGrowAfterOpen(this.growAfterOpen).withViewportMargin(this.viewportMargin).withLockedPosition(this.lockPosition).withTransformOriginOn(this.transformOriginSelector)}_createPositionStrategy(){let t=Ui(this._injector,this._getOrigin());return this._updatePositionStrategy(t),t}_getOrigin(){return this.origin instanceof Li?this.origin.elementRef:this.origin}_getOriginElement(){return this.origin instanceof Li?this.origin.elementRef.nativeElement:this.origin instanceof R?this.origin.nativeElement:typeof Element<"u"&&this.origin instanceof Element?this.origin:null}attachOverlay(){this._overlayRef?this._overlayRef.getConfig().hasBackdrop=this.hasBackdrop:this._createOverlay(),this._overlayRef.hasAttached()||this._overlayRef.attach(this._templatePortal),this.hasBackdrop?this._backdropSubscription=this._overlayRef.backdropClick().subscribe(t=>{this.backdropClick.emit(t)}):this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe(),this.positionChange.observers.length>0&&(this._positionSubscription=this._position.positionChanges.pipe(Dn(()=>this.positionChange.observers.length>0)).subscribe(t=>{this._ngZone.run(()=>this.positionChange.emit(t)),this.positionChange.observers.length===0&&this._positionSubscription.unsubscribe()})),this.open=!0}detachOverlay(){this._overlayRef?.detach(),this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe(),this.open=!1}static \u0275fac=function(e){return new(e||o)};static \u0275dir=L({type:o,selectors:[["","cdk-connected-overlay",""],["","connected-overlay",""],["","cdkConnectedOverlay",""]],inputs:{origin:[0,"cdkConnectedOverlayOrigin","origin"],positions:[0,"cdkConnectedOverlayPositions","positions"],positionStrategy:[0,"cdkConnectedOverlayPositionStrategy","positionStrategy"],offsetX:[0,"cdkConnectedOverlayOffsetX","offsetX"],offsetY:[0,"cdkConnectedOverlayOffsetY","offsetY"],width:[0,"cdkConnectedOverlayWidth","width"],height:[0,"cdkConnectedOverlayHeight","height"],minWidth:[0,"cdkConnectedOverlayMinWidth","minWidth"],minHeight:[0,"cdkConnectedOverlayMinHeight","minHeight"],backdropClass:[0,"cdkConnectedOverlayBackdropClass","backdropClass"],panelClass:[0,"cdkConnectedOverlayPanelClass","panelClass"],viewportMargin:[0,"cdkConnectedOverlayViewportMargin","viewportMargin"],scrollStrategy:[0,"cdkConnectedOverlayScrollStrategy","scrollStrategy"],open:[0,"cdkConnectedOverlayOpen","open"],disableClose:[0,"cdkConnectedOverlayDisableClose","disableClose"],transformOriginSelector:[0,"cdkConnectedOverlayTransformOriginOn","transformOriginSelector"],hasBackdrop:[2,"cdkConnectedOverlayHasBackdrop","hasBackdrop",q],lockPosition:[2,"cdkConnectedOverlayLockPosition","lockPosition",q],flexibleDimensions:[2,"cdkConnectedOverlayFlexibleDimensions","flexibleDimensions",q],growAfterOpen:[2,"cdkConnectedOverlayGrowAfterOpen","growAfterOpen",q],push:[2,"cdkConnectedOverlayPush","push",q],disposeOnNavigation:[2,"cdkConnectedOverlayDisposeOnNavigation","disposeOnNavigation",q]},outputs:{backdropClick:"backdropClick",positionChange:"positionChange",attach:"attach",detach:"detach",overlayKeydown:"overlayKeydown",overlayOutsideClick:"overlayOutsideClick"},exportAs:["cdkConnectedOverlay"],features:[ie]})}return o})();function $r(o){let n=u(O);return()=>ti(n)}var jr={provide:xo,useFactory:$r},pt=(()=>{class o{static \u0275fac=function(e){return new(e||o)};static \u0275mod=N({type:o});static \u0275inj=F({providers:[To,jr],imports:[fe,Ae,wi,wi]})}return o})();var Hr=new Set(["annotation-id","class","style","id","slot","title","hidden","dark","role","tabindex","ng-reflect-annotation-id","ng-version","_nghost","_ngcontent"]),Ni="__veltContext";function Gr(o){let n={};try{if(!o?.attributes)return n;let t=o.attributes;for(let e=0;e<t.length;e++){let i=t[e].name.toLowerCase();Hr.has(i)||i.startsWith("_ng")||i.startsWith("ng-")||i.startsWith("data-")||i.startsWith("aria-")||i!=="velt-element"&&(n[i]=t[e].value)}}catch{}return n}function Wr(o,n){return m(m({},o||{}),n||{})}function Po(o){try{let n=o?.[Ni];return n&&typeof n=="object"?n:void 0}catch{return}}var zi=null,Bi=null,Vi,$i=!1;function Te(){zi=null,Bi=null,Vi=void 0,$i=!1}function Yr(o,n){try{if(!o){Te();return}zi=o,Bi=o.parentElement,Vi=n,$i=!0}catch{Te()}}function Oc(o){try{if(!o||!$i||zi!==o)return;if(Bi!==o.parentElement){Te();return}let n=Vi;return Te(),{payload:n}}catch{return}}function Mo(o){try{let n=o||null;for(;n;){let t=n.parentElement;if(!t){let i=n.getRootNode?.();if(i instanceof ShadowRoot&&i.host){n=i.host;continue}break}let e=Po(t);if(e)return{host:t,payload:e};n=t}}catch{}}function Kr(o){try{return o?!!o.annotationId||Object.keys(o.contextData||{}).length>0||o.data!==void 0||o.localUIState!==void 0||o.registry!==void 0:!1}catch{return!1}}function wc(o,n){try{if(!o)return;if(Te(),!Kr(n)){Xr(o,n.ownerRef);return}return o[Ni]=n,n}catch{return}}function Xr(o,n){try{if(!o)return;Te();let t=Po(o);if(t&&t.ownerRef!==n)return;o[Ni]=void 0}catch{}}function Ac(o){let{host:n,inherited:t,ownAnnotationId:e,ownData:i,registry:r,ownLocalUIState:s,ownerRef:a}=o,c=Gr(n),l=Wr(t?.contextData,c),d;try{d=n?.getAttribute?.("annotation-id")||void 0}catch{}return{annotationId:e||d||t?.annotationId,contextData:l,data:i??t?.data,registry:r??t?.registry,localUIState:s??t?.localUIState,ownerRef:a}}function Zr(o){try{let n=Mo(o);return Yr(o,n?.payload),n?.payload?.localUIState}catch{return}}function Rc(o){try{if(o.isRoot||o.fromExplicitInput)return!1;let n=Zr(o.host);if(!n||n===o.current)return!1;if(o.isOwner)try{o.current?.update?.(t=>m({},t))}catch{}return o.adopt(n),!0}catch{return!1}}function kc(o){try{return Mo(o)?.payload?.data}catch{return}}var ni="__veltRefreshContext",Ze=new Set;function Tc(o,n,t){try{if(!o||typeof t!="function")return;o[ni]={ownerRef:n,fn:t},Ze.add(o)}catch{}}function oi(o){try{let n=o?.[ni];return n&&typeof n.fn=="function"?n.fn:void 0}catch{return}}function xc(o,n){try{if(!o)return;let t=o[ni];if(t&&t.ownerRef!==n)return;o[ni]=void 0,Ze.delete(o)}catch{}}var Qr=64;function qr(o){let n=[];return Ze.forEach(t=>{if(!oi(t)){Ze.delete(t);return}o.contains(t)&&n.push(t)}),n.length>1&&n.sort((t,e)=>t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1),n}function Jr(o){let n=[];return oi(o)&&n.push(o),o.querySelectorAll("*").forEach(t=>{oi(t)&&n.push(t)}),n}function Lo(o){try{if(!o||o.nodeType!==Node.ELEMENT_NODE||(Te(),!Ze.size))return;let n=o;(Ze.size<=Qr?qr(n):Jr(n)).forEach(e=>{let i=oi(e);try{i?.()}catch{}})}catch{}}var Fo="__veltHandled",Uo="velt",Qe=new WeakSet,ri=0;function No(o){try{if(!o||Qe.has(o))return;Qe.add(o),ri++}catch{}}function si(o){try{if(!o||!Qe.has(o))return;Qe.delete(o),ri=Math.max(0,ri-1)}catch{}}function es(o){try{if(!o||ri===0)return!1;let n=typeof o.composedPath=="function"?o.composedPath():null;if(n){for(let e of n)if(Qe.has(e))return!0;return!1}let t=o.target;for(;t;){if(Qe.has(t))return!0;t=t.parentNode}return!1}catch{return!1}}function zo(o){try{if(!o||(o[Fo]=Uo,es(o)))return;o.stopPropagation()}catch{}}function Bo(o){try{return o?o[Fo]===Uo:!1}catch{return!1}}var ce=new WeakMap,Gi=new WeakSet,ts=new Set(["snippyly-user-request-tool","snippyly-sidebar-button","velt-sidebar-button","velt-comments-sidebar-button","snippyly-comment-tool","velt-comment-tool","snippyly-area-tool","velt-area-tool","snippyly-tags-tool","velt-tags-tool","velt-autocomplete-tool"]),is=new WeakSet;function Nc(o){try{return!!o}catch{return!1}}function $o(o){try{return!!o&&ts.has(o.tagName.toLowerCase())}catch{return!1}}function ns(o){try{return!!o&&o.nodeType===Node.ELEMENT_NODE}catch{return!1}}function zc(o){try{if(!o)return;if(Gi.has(o))return ce.get(o);if(Gi.add(o),$o(o)){is.add(o);return}let n=Array.from(o.childNodes).filter(ns);if(!n.length)return;let t={host:o,nodes:n,claimed:!1};return ce.set(o,t),t}catch{return}}function Bc(o){try{if(!o)return;!o.claimed&&o.nodes.some(t=>!!t.parentNode)&&ce.delete(o.host)}catch{}}var ji=null,gt=[];function os(){try{for(let o=gt.length-1;o>=0;o--){let n=gt[o];n.host.isConnected||(n.nodes.forEach(t=>{try{t.parentNode?.hasAttribute?.("data-velt-children-park")&&t.parentNode.removeChild(t)}catch{}}),gt.splice(o,1))}}catch{}}function rs(){try{if(ji?.isConnected)return ji;let o=document.createElement("div");return o.setAttribute("data-velt-children-park","true"),o.style.display="none",document.body.appendChild(o),ji=o,o}catch{return null}}function Vc(o){try{if(!o)return;let n=ce.get(o);if(!n||n.claimed||!n.nodes.some(i=>as(i,r=>r.startsWith("velt-")||r.startsWith("snippyly-"))))return;let e=rs();if(!e)return;os(),n.nodes.forEach(i=>{try{i.parentNode!==e&&e.appendChild(i)}catch{}}),gt.some(i=>i.host===o)||gt.push({host:o,nodes:n.nodes})}catch{}}function $c(o){try{if(!o)return;let n=ce.get(o);if(!n||n.claimed)return;console.warn(`[Velt] <${o.tagName.toLowerCase()}> is not rendering the markup you placed inside it. Either this primitive has no children slot, or its visibility condition is currently false \u2014 in which case your markup is being held and will render as soon as the condition becomes true. If it should render regardless, set default-condition="false".`)}catch{}}function jc(o){try{if(!o||Gi.has(o)||ce.has(o)||$o(o)||!Array.from(o.childNodes).some(t=>t.nodeType===Node.TEXT_NODE&&!!(t.textContent||"").trim()))return;console.warn(`[Velt] <${o.tagName.toLowerCase()}> was given plain text as its content, which is not supported. Wrap it in an element \u2014 for example <span>your text</span>.`)}catch{}}function Hc(o){try{if(!o)return!1;let n=ce.get(o);return!!n&&n.nodes.length>0}catch{return!1}}function Gc(o){try{let n=!!o.wireframeTemplate||!!o.hasCustomerChildren;return!n&&!!o.shadowDom||n&&!!o.isExplicitShadowDom}catch{return!1}}function Wc(o,n){try{if(!o)return;let t=ce.get(o);return!t||!t.nodes.length||t.claimed&&t.owner!==n?void 0:t}catch{return}}function ss(o,n,t){try{if(!o)return;let e=ce.get(o);if(!e)return;let i=n.toLowerCase(),r=e.nodes.findIndex(a=>a.tagName.toLowerCase()===i);if(r===-1)return;let[s]=e.nodes.splice(r,1);return e.nodes.length||(e.claimed=!0,e.owner=t),s}catch{return}}var Vo=class{constructor(n){this.triggerTagName=n}get isActive(){return!!this.element}take(n,t){try{return this.element&&si(this.element),this.element=ss(n,this.triggerTagName,t),!!this.element}catch{return!1}}place(n){try{return!this.element||!n?.parentNode?!1:(n.parentNode.insertBefore(this.element,n.nextSibling),No(this.element),Lo(this.element),!0)}catch{return!1}}release(n){try{this.element&&si(this.element),this.element&&n&&this.element.parentNode!==n&&n.appendChild(this.element),this.element=void 0}catch{}}},Hi="data-velt-hidden",ai=new WeakMap;function jo(o,n){try{if(o.getAttribute(Hi)==="true"===n)return;if(n)ai.has(o)||ai.set(o,o.style.display||""),o.setAttribute(Hi,"true"),o.style.display="none";else{o.removeAttribute(Hi);let e=ai.get(o);e?o.style.display=e:o.style.removeProperty("display"),ai.delete(o)}}catch{}}function Yc(o,n){try{return o?(o.claimed=!0,o.owner=n,jo(o.host,!1),o.nodes):[]}catch{return[]}}function Kc(o,n){try{if(!o||o.owner!==n)return;o.claimed=!1,o.owner=void 0,jo(o.host,!0),o.nodes.forEach(t=>{si(t);try{t.parentNode!==o.host&&o.host.appendChild(t)}catch{}})}catch{}}function as(o,n){try{if(n(o.tagName.toLowerCase()))return!0;let t=o.querySelectorAll("*");for(let e=0;e<t.length;e++)if(n(t[e].tagName.toLowerCase()))return!0;return!1}catch{return!1}}function Wi(o){return o.buttons===0||o.detail===0}function Yi(o){let n=o.touches&&o.touches[0]||o.changedTouches&&o.changedTouches[0];return!!n&&n.identifier===-1&&(n.radiusX==null||n.radiusX===1)&&(n.radiusY==null||n.radiusY===1)}var mt;function cs(){if(mt==null&&typeof window<"u")try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>mt=!0}))}finally{mt=mt||!1}return mt}function Ho(o){return cs()?o:!!o.capture}var Go=new A("cdk-input-modality-detector-options"),Wo={ignoreKeys:[18,17,224,91,16]},Yo=650,Ki={passive:!0,capture:!0},Ko=(()=>{class o{_platform=u(H);_listenerCleanups;modalityDetected;modalityChanged;get mostRecentModality(){return this._modality.value}_mostRecentTarget=null;_modality=new I(null);_options;_lastTouchMs=0;_onKeydown=t=>{this._options?.ignoreKeys?.some(e=>e===t.keyCode)||(this._modality.next("keyboard"),this._mostRecentTarget=ee(t))};_onMousedown=t=>{Date.now()-this._lastTouchMs<Yo||(this._modality.next(Wi(t)?"keyboard":"mouse"),this._mostRecentTarget=ee(t))};_onTouchstart=t=>{if(Yi(t)){this._modality.next("keyboard");return}this._lastTouchMs=Date.now(),this._modality.next("touch"),this._mostRecentTarget=ee(t)};constructor(){let t=u(U),e=u(M),i=u(Go,{optional:!0});if(this._options=m(m({},Wo),i),this.modalityDetected=this._modality.pipe(In(1)),this.modalityChanged=this.modalityDetected.pipe(X()),this._platform.isBrowser){let r=u(oe).createRenderer(null,null);this._listenerCleanups=t.runOutsideAngular(()=>[r.listen(e,"keydown",this._onKeydown,Ki),r.listen(e,"mousedown",this._onMousedown,Ki),r.listen(e,"touchstart",this._onTouchstart,Ki)])}}ngOnDestroy(){this._modality.complete(),this._listenerCleanups?.forEach(t=>t())}static \u0275fac=function(e){return new(e||o)};static \u0275prov=b({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})(),_t=(function(o){return o[o.IMMEDIATE=0]="IMMEDIATE",o[o.EVENTUAL=1]="EVENTUAL",o})(_t||{}),Xo=new A("cdk-focus-monitor-default-options"),ci=Ho({passive:!0,capture:!0}),Xi=(()=>{class o{_ngZone=u(U);_platform=u(H);_inputModalityDetector=u(Ko);_origin=null;_lastFocusOrigin;_windowFocused=!1;_windowFocusTimeoutId;_originTimeoutId;_originFromTouchInteraction=!1;_elementInfo=new Map;_monitoredElementCount=0;_rootNodeFocusListenerCount=new Map;_detectionMode;_windowFocusListener=()=>{this._windowFocused=!0,this._windowFocusTimeoutId=setTimeout(()=>this._windowFocused=!1)};_document=u(M);_stopInputModalityDetector=new y;constructor(){let t=u(Xo,{optional:!0});this._detectionMode=t?.detectionMode||_t.IMMEDIATE}_rootNodeFocusAndBlurListener=t=>{let e=ee(t);for(let i=e;i;i=i.parentElement)t.type==="focus"?this._onFocus(t,i):this._onBlur(t,i)};monitor(t,e=!1){let i=De(t);if(!this._platform.isBrowser||i.nodeType!==1)return _();let r=mo(i)||this._document,s=this._elementInfo.get(i);if(s)return e&&(s.checkChildren=!0),s.subject;let a={checkChildren:e,subject:new y,rootNode:r};return this._elementInfo.set(i,a),this._registerGlobalListeners(a),a.subject}stopMonitoring(t){let e=De(t),i=this._elementInfo.get(e);i&&(i.subject.complete(),this._setClasses(e),this._elementInfo.delete(e),this._removeGlobalListeners(i))}focusVia(t,e,i){let r=De(t),s=this._document.activeElement;r===s?this._getClosestElementsInfo(r).forEach(([a,c])=>this._originChanged(a,e,c)):(this._setOrigin(e),typeof r.focus=="function"&&r.focus(i))}ngOnDestroy(){this._elementInfo.forEach((t,e)=>this.stopMonitoring(e))}_getWindow(){return this._document.defaultView||window}_getFocusOrigin(t){return this._origin?this._originFromTouchInteraction?this._shouldBeAttributedToTouch(t)?"touch":"program":this._origin:this._windowFocused&&this._lastFocusOrigin?this._lastFocusOrigin:t&&this._isLastInteractionFromInputLabel(t)?"mouse":"program"}_shouldBeAttributedToTouch(t){return this._detectionMode===_t.EVENTUAL||!!t?.contains(this._inputModalityDetector._mostRecentTarget)}_setClasses(t,e){t.classList.toggle("cdk-focused",!!e),t.classList.toggle("cdk-touch-focused",e==="touch"),t.classList.toggle("cdk-keyboard-focused",e==="keyboard"),t.classList.toggle("cdk-mouse-focused",e==="mouse"),t.classList.toggle("cdk-program-focused",e==="program")}_setOrigin(t,e=!1){this._ngZone.runOutsideAngular(()=>{if(this._origin=t,this._originFromTouchInteraction=t==="touch"&&e,this._detectionMode===_t.IMMEDIATE){clearTimeout(this._originTimeoutId);let i=this._originFromTouchInteraction?Yo:1;this._originTimeoutId=setTimeout(()=>this._origin=null,i)}})}_onFocus(t,e){let i=this._elementInfo.get(e),r=ee(t);!i||!i.checkChildren&&e!==r||this._originChanged(e,this._getFocusOrigin(r),i)}_onBlur(t,e){let i=this._elementInfo.get(e);!i||i.checkChildren&&t.relatedTarget instanceof Node&&e.contains(t.relatedTarget)||(this._setClasses(e),this._emitOrigin(i,null))}_emitOrigin(t,e){t.subject.observers.length&&this._ngZone.run(()=>t.subject.next(e))}_registerGlobalListeners(t){if(!this._platform.isBrowser)return;let e=t.rootNode,i=this._rootNodeFocusListenerCount.get(e)||0;i||this._ngZone.runOutsideAngular(()=>{e.addEventListener("focus",this._rootNodeFocusAndBlurListener,ci),e.addEventListener("blur",this._rootNodeFocusAndBlurListener,ci)}),this._rootNodeFocusListenerCount.set(e,i+1),++this._monitoredElementCount===1&&(this._ngZone.runOutsideAngular(()=>{this._getWindow().addEventListener("focus",this._windowFocusListener)}),this._inputModalityDetector.modalityDetected.pipe(de(this._stopInputModalityDetector)).subscribe(r=>{this._setOrigin(r,!0)}))}_removeGlobalListeners(t){let e=t.rootNode;if(this._rootNodeFocusListenerCount.has(e)){let i=this._rootNodeFocusListenerCount.get(e);i>1?this._rootNodeFocusListenerCount.set(e,i-1):(e.removeEventListener("focus",this._rootNodeFocusAndBlurListener,ci),e.removeEventListener("blur",this._rootNodeFocusAndBlurListener,ci),this._rootNodeFocusListenerCount.delete(e))}--this._monitoredElementCount||(this._getWindow().removeEventListener("focus",this._windowFocusListener),this._stopInputModalityDetector.next(),clearTimeout(this._windowFocusTimeoutId),clearTimeout(this._originTimeoutId))}_originChanged(t,e,i){this._setClasses(t,e),this._emitOrigin(i,e),this._lastFocusOrigin=e}_getClosestElementsInfo(t){let e=[];return this._elementInfo.forEach((i,r)=>{(r===t||i.checkChildren&&r.contains(t))&&e.push([r,i])}),e}_isLastInteractionFromInputLabel(t){let{_mostRecentTarget:e,mostRecentModality:i}=this._inputModalityDetector;if(i!=="mouse"||!e||e===t||t.nodeName!=="INPUT"&&t.nodeName!=="TEXTAREA"||t.disabled)return!1;let r=t.labels;if(r){for(let s=0;s<r.length;s++)if(r[s].contains(e))return!0}return!1}static \u0275fac=function(e){return new(e||o)};static \u0275prov=b({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();var Zo=(()=>{class o{static \u0275fac=function(e){return new(e||o)};static \u0275cmp=G({type:o,selectors:[["ng-component"]],exportAs:["cdkVisuallyHidden"],decls:0,vars:0,template:function(e,i){},styles:[`.cdk-visually-hidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap;outline:0;-webkit-appearance:none;-moz-appearance:none;left:0}[dir=rtl] .cdk-visually-hidden{left:auto;right:0}
4
+ `],encapsulation:2,changeDetection:0})}return o})();var ls=(()=>{class o{create(t){return typeof MutationObserver>"u"?null:new MutationObserver(t)}static \u0275fac=function(e){return new(e||o)};static \u0275prov=b({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();var Qo=(()=>{class o{static \u0275fac=function(e){return new(e||o)};static \u0275mod=N({type:o});static \u0275inj=F({providers:[ls]})}return o})();var qi=(()=>{class o{_platform=u(H);constructor(){}isDisabled(t){return t.hasAttribute("disabled")}isVisible(t){return hs(t)&&getComputedStyle(t).visibility==="visible"}isTabbable(t){if(!this._platform.isBrowser)return!1;let e=ds(ys(t));if(e&&(qo(e)===-1||!this.isVisible(e)))return!1;let i=t.nodeName.toLowerCase(),r=qo(t);return t.hasAttribute("contenteditable")?r!==-1:i==="iframe"||i==="object"||this._platform.WEBKIT&&this._platform.IOS&&!_s(t)?!1:i==="audio"?t.hasAttribute("controls")?r!==-1:!1:i==="video"?r===-1?!1:r!==null?!0:this._platform.FIREFOX||t.hasAttribute("controls"):t.tabIndex>=0}isFocusable(t,e){return vs(t)&&!this.isDisabled(t)&&(e?.ignoreVisibility||this.isVisible(t))}static \u0275fac=function(e){return new(e||o)};static \u0275prov=b({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();function ds(o){try{return o.frameElement}catch{return null}}function hs(o){return!!(o.offsetWidth||o.offsetHeight||typeof o.getClientRects=="function"&&o.getClientRects().length)}function us(o){let n=o.nodeName.toLowerCase();return n==="input"||n==="select"||n==="button"||n==="textarea"}function fs(o){return gs(o)&&o.type=="hidden"}function ps(o){return ms(o)&&o.hasAttribute("href")}function gs(o){return o.nodeName.toLowerCase()=="input"}function ms(o){return o.nodeName.toLowerCase()=="a"}function tr(o){if(!o.hasAttribute("tabindex")||o.tabIndex===void 0)return!1;let n=o.getAttribute("tabindex");return!!(n&&!isNaN(parseInt(n,10)))}function qo(o){if(!tr(o))return null;let n=parseInt(o.getAttribute("tabindex")||"",10);return isNaN(n)?-1:n}function _s(o){let n=o.nodeName.toLowerCase(),t=n==="input"&&o.type;return t==="text"||t==="password"||n==="select"||n==="textarea"}function vs(o){return fs(o)?!1:us(o)||ps(o)||o.hasAttribute("contenteditable")||tr(o)}function ys(o){return o.ownerDocument&&o.ownerDocument.defaultView||window}var Qi=class{_element;_checker;_ngZone;_document;_injector;_startAnchor;_endAnchor;_hasAttached=!1;startAnchorListener=()=>this.focusLastTabbableElement();endAnchorListener=()=>this.focusFirstTabbableElement();get enabled(){return this._enabled}set enabled(n){this._enabled=n,this._startAnchor&&this._endAnchor&&(this._toggleAnchorTabIndex(n,this._startAnchor),this._toggleAnchorTabIndex(n,this._endAnchor))}_enabled=!0;constructor(n,t,e,i,r=!1,s){this._element=n,this._checker=t,this._ngZone=e,this._document=i,this._injector=s,r||this.attachAnchors()}destroy(){let n=this._startAnchor,t=this._endAnchor;n&&(n.removeEventListener("focus",this.startAnchorListener),n.remove()),t&&(t.removeEventListener("focus",this.endAnchorListener),t.remove()),this._startAnchor=this._endAnchor=null,this._hasAttached=!1}attachAnchors(){return this._hasAttached?!0:(this._ngZone.runOutsideAngular(()=>{this._startAnchor||(this._startAnchor=this._createAnchor(),this._startAnchor.addEventListener("focus",this.startAnchorListener)),this._endAnchor||(this._endAnchor=this._createAnchor(),this._endAnchor.addEventListener("focus",this.endAnchorListener))}),this._element.parentNode&&(this._element.parentNode.insertBefore(this._startAnchor,this._element),this._element.parentNode.insertBefore(this._endAnchor,this._element.nextSibling),this._hasAttached=!0),this._hasAttached)}focusInitialElementWhenReady(n){return new Promise(t=>{this._executeOnStable(()=>t(this.focusInitialElement(n)))})}focusFirstTabbableElementWhenReady(n){return new Promise(t=>{this._executeOnStable(()=>t(this.focusFirstTabbableElement(n)))})}focusLastTabbableElementWhenReady(n){return new Promise(t=>{this._executeOnStable(()=>t(this.focusLastTabbableElement(n)))})}_getRegionBoundary(n){let t=this._element.querySelectorAll(`[cdk-focus-region-${n}], [cdkFocusRegion${n}], [cdk-focus-${n}]`);return n=="start"?t.length?t[0]:this._getFirstTabbableElement(this._element):t.length?t[t.length-1]:this._getLastTabbableElement(this._element)}focusInitialElement(n){let t=this._element.querySelector("[cdk-focus-initial], [cdkFocusInitial]");if(t){if(!this._checker.isFocusable(t)){let e=this._getFirstTabbableElement(t);return e?.focus(n),!!e}return t.focus(n),!0}return this.focusFirstTabbableElement(n)}focusFirstTabbableElement(n){let t=this._getRegionBoundary("start");return t&&t.focus(n),!!t}focusLastTabbableElement(n){let t=this._getRegionBoundary("end");return t&&t.focus(n),!!t}hasAttached(){return this._hasAttached}_getFirstTabbableElement(n){if(this._checker.isFocusable(n)&&this._checker.isTabbable(n))return n;let t=n.children;for(let e=0;e<t.length;e++){let i=t[e].nodeType===this._document.ELEMENT_NODE?this._getFirstTabbableElement(t[e]):null;if(i)return i}return null}_getLastTabbableElement(n){if(this._checker.isFocusable(n)&&this._checker.isTabbable(n))return n;let t=n.children;for(let e=t.length-1;e>=0;e--){let i=t[e].nodeType===this._document.ELEMENT_NODE?this._getLastTabbableElement(t[e]):null;if(i)return i}return null}_createAnchor(){let n=this._document.createElement("div");return this._toggleAnchorTabIndex(this._enabled,n),n.classList.add("cdk-visually-hidden"),n.classList.add("cdk-focus-trap-anchor"),n.setAttribute("aria-hidden","true"),n}_toggleAnchorTabIndex(n,t){n?t.setAttribute("tabindex","0"):t.removeAttribute("tabindex")}toggleAnchors(n){this._startAnchor&&this._endAnchor&&(this._toggleAnchorTabIndex(n,this._startAnchor),this._toggleAnchorTabIndex(n,this._endAnchor))}_executeOnStable(n){this._injector?ne(n,{injector:this._injector}):setTimeout(n)}},Ji=(()=>{class o{_checker=u(qi);_ngZone=u(U);_document=u(M);_injector=u(O);constructor(){u(We).load(Zo)}create(t,e=!1){return new Qi(t,this._checker,this._ngZone,this._document,e,this._injector)}static \u0275fac=function(e){return new(e||o)};static \u0275prov=b({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();var me=(function(o){return o[o.NONE=0]="NONE",o[o.BLACK_ON_WHITE=1]="BLACK_ON_WHITE",o[o.WHITE_ON_BLACK=2]="WHITE_ON_BLACK",o})(me||{}),Jo="cdk-high-contrast-black-on-white",er="cdk-high-contrast-white-on-black",Zi="cdk-high-contrast-active",li=(()=>{class o{_platform=u(H);_hasCheckedHighContrastMode;_document=u(M);_breakpointSubscription;constructor(){this._breakpointSubscription=u(Wn).observe("(forced-colors: active)").subscribe(()=>{this._hasCheckedHighContrastMode&&(this._hasCheckedHighContrastMode=!1,this._applyBodyHighContrastModeCssClasses())})}getHighContrastMode(){if(!this._platform.isBrowser)return me.NONE;let t=this._document.createElement("div");t.style.backgroundColor="rgb(1,2,3)",t.style.position="absolute",this._document.body.appendChild(t);let e=this._document.defaultView||window,i=e&&e.getComputedStyle?e.getComputedStyle(t):null,r=(i&&i.backgroundColor||"").replace(/ /g,"");switch(t.remove(),r){case"rgb(0,0,0)":case"rgb(45,50,54)":case"rgb(32,32,32)":return me.WHITE_ON_BLACK;case"rgb(255,255,255)":case"rgb(255,250,239)":return me.BLACK_ON_WHITE}return me.NONE}ngOnDestroy(){this._breakpointSubscription.unsubscribe()}_applyBodyHighContrastModeCssClasses(){if(!this._hasCheckedHighContrastMode&&this._platform.isBrowser&&this._document.body){let t=this._document.body.classList;t.remove(Zi,Jo,er),this._hasCheckedHighContrastMode=!0;let e=this.getHighContrastMode();e===me.BLACK_ON_WHITE?t.add(Zi,Jo):e===me.WHITE_ON_BLACK&&t.add(Zi,er)}}static \u0275fac=function(e){return new(e||o)};static \u0275prov=b({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})(),en=(()=>{class o{constructor(){u(li)._applyBodyHighContrastModeCssClasses()}static \u0275fac=function(e){return new(e||o)};static \u0275mod=N({type:o});static \u0275inj=F({imports:[Qo]})}return o})();function Cs(o,n){}var _e=class{viewContainerRef;injector;id;role="dialog";panelClass="";hasBackdrop=!0;backdropClass="";disableClose=!1;closePredicate;width="";height="";minWidth;minHeight;maxWidth;maxHeight;positionStrategy;data=null;direction;ariaDescribedBy=null;ariaLabelledBy=null;ariaLabel=null;ariaModal=!1;autoFocus="first-tabbable";restoreFocus=!0;scrollStrategy;closeOnNavigation=!0;closeOnDestroy=!0;closeOnOverlayDetachments=!0;disableAnimations=!1;providers;container;templateContext};var nn=(()=>{class o extends Ge{_elementRef=u(R);_focusTrapFactory=u(Ji);_config;_interactivityChecker=u(qi);_ngZone=u(U);_focusMonitor=u(Xi);_renderer=u(Fe);_changeDetectorRef=u(Ve);_injector=u(O);_platform=u(H);_document=u(M);_portalOutlet;_focusTrapped=new y;_focusTrap=null;_elementFocusedBeforeDialogWasOpened=null;_closeInteractionType=null;_ariaLabelledByQueue=[];_isDestroyed=!1;constructor(){super(),this._config=u(_e,{optional:!0})||new _e,this._config.ariaLabelledBy&&this._ariaLabelledByQueue.push(this._config.ariaLabelledBy)}_addAriaLabelledBy(t){this._ariaLabelledByQueue.push(t),this._changeDetectorRef.markForCheck()}_removeAriaLabelledBy(t){let e=this._ariaLabelledByQueue.indexOf(t);e>-1&&(this._ariaLabelledByQueue.splice(e,1),this._changeDetectorRef.markForCheck())}_contentAttached(){this._initializeFocusTrap(),this._captureInitialFocus()}_captureInitialFocus(){this._trapFocus()}ngOnDestroy(){this._focusTrapped.complete(),this._isDestroyed=!0,this._restoreFocus()}attachComponentPortal(t){this._portalOutlet.hasAttached();let e=this._portalOutlet.attachComponentPortal(t);return this._contentAttached(),e}attachTemplatePortal(t){this._portalOutlet.hasAttached();let e=this._portalOutlet.attachTemplatePortal(t);return this._contentAttached(),e}attachDomPortal=t=>{this._portalOutlet.hasAttached();let e=this._portalOutlet.attachDomPortal(t);return this._contentAttached(),e};_recaptureFocus(){this._containsFocus()||this._trapFocus()}_forceFocus(t,e){this._interactivityChecker.isFocusable(t)||(t.tabIndex=-1,this._ngZone.runOutsideAngular(()=>{let i=()=>{r(),s(),t.removeAttribute("tabindex")},r=this._renderer.listen(t,"blur",i),s=this._renderer.listen(t,"mousedown",i)})),t.focus(e)}_focusByCssSelector(t,e){let i=this._elementRef.nativeElement.querySelector(t);i&&this._forceFocus(i,e)}_trapFocus(t){this._isDestroyed||ne(()=>{let e=this._elementRef.nativeElement;switch(this._config.autoFocus){case!1:case"dialog":this._containsFocus()||e.focus(t);break;case!0:case"first-tabbable":this._focusTrap?.focusInitialElement(t)||this._focusDialogContainer(t);break;case"first-heading":this._focusByCssSelector('h1, h2, h3, h4, h5, h6, [role="heading"]',t);break;default:this._focusByCssSelector(this._config.autoFocus,t);break}this._focusTrapped.next()},{injector:this._injector})}_restoreFocus(){let t=this._config.restoreFocus,e=null;if(typeof t=="string"?e=this._document.querySelector(t):typeof t=="boolean"?e=t?this._elementFocusedBeforeDialogWasOpened:null:t&&(e=t),this._config.restoreFocus&&e&&typeof e.focus=="function"){let i=Yt(),r=this._elementRef.nativeElement;(!i||i===this._document.body||i===r||r.contains(i))&&(this._focusMonitor?(this._focusMonitor.focusVia(e,this._closeInteractionType),this._closeInteractionType=null):e.focus())}this._focusTrap&&this._focusTrap.destroy()}_focusDialogContainer(t){this._elementRef.nativeElement.focus?.(t)}_containsFocus(){let t=this._elementRef.nativeElement,e=Yt();return t===e||t.contains(e)}_initializeFocusTrap(){this._platform.isBrowser&&(this._focusTrap=this._focusTrapFactory.create(this._elementRef.nativeElement),this._document&&(this._elementFocusedBeforeDialogWasOpened=Yt()))}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=G({type:o,selectors:[["cdk-dialog-container"]],viewQuery:function(e,i){if(e&1&&kt(ht,7),e&2){let r;Tt(r=xt())&&(i._portalOutlet=r.first)}},hostAttrs:["tabindex","-1",1,"cdk-dialog-container"],hostVars:6,hostBindings:function(e,i){e&2&&ue("id",i._config.id||null)("role",i._config.role)("aria-modal",i._config.ariaModal)("aria-labelledby",i._config.ariaLabel?null:i._ariaLabelledByQueue[0])("aria-label",i._config.ariaLabel)("aria-describedby",i._config.ariaDescribedBy||null)},features:[W],decls:1,vars:0,consts:[["cdkPortalOutlet",""]],template:function(e,i){e&1&&Rt(0,Cs,0,0,"ng-template",0)},dependencies:[ht],styles:[`.cdk-dialog-container{display:block;width:100%;height:100%;min-height:inherit;max-height:inherit}
5
+ `],encapsulation:2})}return o})(),vt=class{overlayRef;config;componentInstance;componentRef;containerInstance;disableClose;closed=new y;backdropClick;keydownEvents;outsidePointerEvents;id;_detachSubscription;constructor(n,t){this.overlayRef=n,this.config=t,this.disableClose=t.disableClose,this.backdropClick=n.backdropClick(),this.keydownEvents=n.keydownEvents(),this.outsidePointerEvents=n.outsidePointerEvents(),this.id=t.id,this.keydownEvents.subscribe(e=>{e.keyCode===27&&!this.disableClose&&!ge(e)&&(e.preventDefault(),this.close(void 0,{focusOrigin:"keyboard"}))}),this.backdropClick.subscribe(()=>{!this.disableClose&&this._canClose()?this.close(void 0,{focusOrigin:"mouse"}):this.containerInstance._recaptureFocus?.()}),this._detachSubscription=n.detachments().subscribe(()=>{t.closeOnOverlayDetachments!==!1&&this.close()})}close(n,t){if(this._canClose(n)){let e=this.closed;this.containerInstance._closeInteractionType=t?.focusOrigin||"program",this._detachSubscription.unsubscribe(),this.overlayRef.dispose(),e.next(n),e.complete(),this.componentInstance=this.containerInstance=null}}updatePosition(){return this.overlayRef.updatePosition(),this}updateSize(n="",t=""){return this.overlayRef.updateSize({width:n,height:t}),this}addPanelClass(n){return this.overlayRef.addPanelClass(n),this}removePanelClass(n){return this.overlayRef.removePanelClass(n),this}_canClose(n){let t=this.config;return!!this.containerInstance&&(!t.closePredicate||t.closePredicate(n,t,this.componentInstance))}},bs=new A("DialogScrollStrategy",{providedIn:"root",factory:()=>{let o=u(O);return()=>Ke(o)}}),Ss=new A("DialogData"),Is=new A("DefaultDialogConfig");function Ds(o){let n=j(o),t=new B;return{valueSignal:n,get value(){return n()},change:t,ngOnDestroy(){t.complete()}}}var on=(()=>{class o{_injector=u(O);_defaultOptions=u(Is,{optional:!0});_parentDialog=u(o,{optional:!0,skipSelf:!0});_overlayContainer=u(ii);_idGenerator=u(pe);_openDialogsAtThisLevel=[];_afterAllClosedAtThisLevel=new y;_afterOpenedAtThisLevel=new y;_ariaHiddenElements=new Map;_scrollStrategy=u(bs);get openDialogs(){return this._parentDialog?this._parentDialog.openDialogs:this._openDialogsAtThisLevel}get afterOpened(){return this._parentDialog?this._parentDialog.afterOpened:this._afterOpenedAtThisLevel}afterAllClosed=It(()=>this.openDialogs.length?this._getAfterAllClosed():this._getAfterAllClosed().pipe(Ce(void 0)));constructor(){}open(t,e){let i=this._defaultOptions||new _e;e=m(m({},i),e),e.id=e.id||this._idGenerator.getId("cdk-dialog-"),e.id&&this.getDialogById(e.id);let r=this._getOverlayConfig(e),s=ft(this._injector,r),a=new vt(s,e),c=this._attachContainer(s,a,e);if(a.containerInstance=c,!this.openDialogs.length){let l=this._overlayContainer.getContainerElement();c._focusTrapped?c._focusTrapped.pipe(te(1)).subscribe(()=>{this._hideNonDialogContentFromAssistiveTechnology(l)}):this._hideNonDialogContentFromAssistiveTechnology(l)}return this._attachDialogContent(t,a,c,e),this.openDialogs.push(a),a.closed.subscribe(()=>this._removeOpenDialog(a,!0)),this.afterOpened.next(a),a}closeAll(){tn(this.openDialogs,t=>t.close())}getDialogById(t){return this.openDialogs.find(e=>e.id===t)}ngOnDestroy(){tn(this._openDialogsAtThisLevel,t=>{t.config.closeOnDestroy===!1&&this._removeOpenDialog(t,!1)}),tn(this._openDialogsAtThisLevel,t=>t.close()),this._afterAllClosedAtThisLevel.complete(),this._afterOpenedAtThisLevel.complete(),this._openDialogsAtThisLevel=[]}_getOverlayConfig(t){let e=new ke({positionStrategy:t.positionStrategy||Xe().centerHorizontally().centerVertically(),scrollStrategy:t.scrollStrategy||this._scrollStrategy(),panelClass:t.panelClass,hasBackdrop:t.hasBackdrop,direction:t.direction,minWidth:t.minWidth,minHeight:t.minHeight,maxWidth:t.maxWidth,maxHeight:t.maxHeight,width:t.width,height:t.height,disposeOnNavigation:t.closeOnNavigation,disableAnimations:t.disableAnimations});return t.backdropClass&&(e.backdropClass=t.backdropClass),e}_attachContainer(t,e,i){let r=i.injector||i.viewContainerRef?.injector,s=[{provide:_e,useValue:i},{provide:vt,useValue:e},{provide:Ye,useValue:t}],a;i.container?typeof i.container=="function"?a=i.container:(a=i.container.type,s.push(...i.container.providers(i))):a=nn;let c=new He(a,i.viewContainerRef,O.create({parent:r||this._injector,providers:s}));return t.attach(c).instance}_attachDialogContent(t,e,i,r){if(t instanceof be){let s=this._createInjector(r,e,i,void 0),a={$implicit:r.data,dialogRef:e};r.templateContext&&(a=m(m({},a),typeof r.templateContext=="function"?r.templateContext():r.templateContext)),i.attachTemplatePortal(new we(t,null,a,s))}else{let s=this._createInjector(r,e,i,this._injector),a=i.attachComponentPortal(new He(t,r.viewContainerRef,s));e.componentRef=a,e.componentInstance=a.instance}}_createInjector(t,e,i,r){let s=t.injector||t.viewContainerRef?.injector,a=[{provide:Ss,useValue:t.data},{provide:vt,useValue:e}];return t.providers&&(typeof t.providers=="function"?a.push(...t.providers(e,t,i)):a.push(...t.providers)),t.direction&&(!s||!s.get(ae,null,{optional:!0}))&&a.push({provide:ae,useValue:Ds(t.direction)}),O.create({parent:s||r,providers:a})}_removeOpenDialog(t,e){let i=this.openDialogs.indexOf(t);i>-1&&(this.openDialogs.splice(i,1),this.openDialogs.length||(this._ariaHiddenElements.forEach((r,s)=>{r?s.setAttribute("aria-hidden",r):s.removeAttribute("aria-hidden")}),this._ariaHiddenElements.clear(),e&&this._getAfterAllClosed().next()))}_hideNonDialogContentFromAssistiveTechnology(t){if(t.parentElement){let e=t.parentElement.children;for(let i=e.length-1;i>-1;i--){let r=e[i];r!==t&&r.nodeName!=="SCRIPT"&&r.nodeName!=="STYLE"&&!r.hasAttribute("aria-live")&&(this._ariaHiddenElements.set(r,r.getAttribute("aria-hidden")),r.setAttribute("aria-hidden","true"))}}}_getAfterAllClosed(){let t=this._parentDialog;return t?t._getAfterAllClosed():this._afterAllClosedAtThisLevel}static \u0275fac=function(e){return new(e||o)};static \u0275prov=b({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();function tn(o,n){let t=o.length;for(;t--;)n(o[t])}var ir=(()=>{class o{static \u0275fac=function(e){return new(e||o)};static \u0275mod=N({type:o});static \u0275inj=F({providers:[on],imports:[pt,Ae,en,Ae]})}return o})();var Es=new A("MATERIAL_ANIMATIONS");var nr=null;function Os(){return u(Es,{optional:!0})?.animationsDisabled||u(At,{optional:!0})==="NoopAnimations"?"di-disabled":(nr??=u(Gn).matchMedia("(prefers-reduced-motion)").matches,nr?"reduced-motion":"enabled")}function rn(){return Os()!=="enabled"}var ws=200,di=class{_letterKeyStream=new y;_items=[];_selectedItemIndex=-1;_pressedLetters=[];_skipPredicateFn;_selectedItem=new y;selectedItem=this._selectedItem;constructor(n,t){let e=typeof t?.debounceInterval=="number"?t.debounceInterval:ws;t?.skipPredicate&&(this._skipPredicateFn=t.skipPredicate),this.setItems(n),this._setupKeyHandler(e)}destroy(){this._pressedLetters=[],this._letterKeyStream.complete(),this._selectedItem.complete()}setCurrentSelectedItemIndex(n){this._selectedItemIndex=n}setItems(n){this._items=n}handleKey(n){let t=n.keyCode;n.key&&n.key.length===1?this._letterKeyStream.next(n.key.toLocaleUpperCase()):(t>=65&&t<=90||t>=48&&t<=57)&&this._letterKeyStream.next(String.fromCharCode(t))}isTyping(){return this._pressedLetters.length>0}reset(){this._pressedLetters=[]}_setupKeyHandler(n){this._letterKeyStream.pipe(Q(t=>this._pressedLetters.push(t)),wt(n),E(()=>this._pressedLetters.length>0),S(()=>this._pressedLetters.join("").toLocaleUpperCase())).subscribe(t=>{for(let e=1;e<this._items.length+1;e++){let i=(this._selectedItemIndex+e)%this._items.length,r=this._items[i];if(!this._skipPredicateFn?.(r)&&r.getLabel?.().toLocaleUpperCase().trim().indexOf(t)===0){this._selectedItem.next(r);break}}this._pressedLetters=[]})}};var qe=class{_items;_activeItemIndex=j(-1);_activeItem=j(null);_wrap=!1;_typeaheadSubscription=K.EMPTY;_itemChangesSubscription;_vertical=!0;_horizontal;_allowedModifierKeys=[];_homeAndEnd=!1;_pageUpAndDown={enabled:!1,delta:10};_effectRef;_typeahead;_skipPredicateFn=n=>n.disabled;constructor(n,t){this._items=n,n instanceof mi?this._itemChangesSubscription=n.changes.subscribe(e=>this._itemsChanged(e.toArray())):Le(n)&&(this._effectRef=Be(()=>this._itemsChanged(n()),{injector:t}))}tabOut=new y;change=new y;skipPredicate(n){return this._skipPredicateFn=n,this}withWrap(n=!0){return this._wrap=n,this}withVerticalOrientation(n=!0){return this._vertical=n,this}withHorizontalOrientation(n){return this._horizontal=n,this}withAllowedModifierKeys(n){return this._allowedModifierKeys=n,this}withTypeAhead(n=200){this._typeaheadSubscription.unsubscribe();let t=this._getItemsArray();return this._typeahead=new di(t,{debounceInterval:typeof n=="number"?n:void 0,skipPredicate:e=>this._skipPredicateFn(e)}),this._typeaheadSubscription=this._typeahead.selectedItem.subscribe(e=>{this.setActiveItem(e)}),this}cancelTypeahead(){return this._typeahead?.reset(),this}withHomeAndEnd(n=!0){return this._homeAndEnd=n,this}withPageUpDown(n=!0,t=10){return this._pageUpAndDown={enabled:n,delta:t},this}setActiveItem(n){let t=this._activeItem();this.updateActiveItem(n),this._activeItem()!==t&&this.change.next(this._activeItemIndex())}onKeydown(n){let t=n.keyCode,i=["altKey","ctrlKey","metaKey","shiftKey"].every(r=>!n[r]||this._allowedModifierKeys.indexOf(r)>-1);switch(t){case 9:this.tabOut.next();return;case 40:if(this._vertical&&i){this.setNextItemActive();break}else return;case 38:if(this._vertical&&i){this.setPreviousItemActive();break}else return;case 39:if(this._horizontal&&i){this._horizontal==="rtl"?this.setPreviousItemActive():this.setNextItemActive();break}else return;case 37:if(this._horizontal&&i){this._horizontal==="rtl"?this.setNextItemActive():this.setPreviousItemActive();break}else return;case 36:if(this._homeAndEnd&&i){this.setFirstItemActive();break}else return;case 35:if(this._homeAndEnd&&i){this.setLastItemActive();break}else return;case 33:if(this._pageUpAndDown.enabled&&i){let r=this._activeItemIndex()-this._pageUpAndDown.delta;this._setActiveItemByIndex(r>0?r:0,1);break}else return;case 34:if(this._pageUpAndDown.enabled&&i){let r=this._activeItemIndex()+this._pageUpAndDown.delta,s=this._getItemsArray().length;this._setActiveItemByIndex(r<s?r:s-1,-1);break}else return;default:(i||ge(n,"shiftKey"))&&this._typeahead?.handleKey(n);return}this._typeahead?.reset(),n.preventDefault()}get activeItemIndex(){return this._activeItemIndex()}get activeItem(){return this._activeItem()}isTyping(){return!!this._typeahead&&this._typeahead.isTyping()}setFirstItemActive(){this._setActiveItemByIndex(0,1)}setLastItemActive(){this._setActiveItemByIndex(this._getItemsArray().length-1,-1)}setNextItemActive(){this._activeItemIndex()<0?this.setFirstItemActive():this._setActiveItemByDelta(1)}setPreviousItemActive(){this._activeItemIndex()<0&&this._wrap?this.setLastItemActive():this._setActiveItemByDelta(-1)}updateActiveItem(n){let t=this._getItemsArray(),e=typeof n=="number"?n:t.indexOf(n),i=t[e];this._activeItem.set(i??null),this._activeItemIndex.set(e),this._typeahead?.setCurrentSelectedItemIndex(e)}destroy(){this._typeaheadSubscription.unsubscribe(),this._itemChangesSubscription?.unsubscribe(),this._effectRef?.destroy(),this._typeahead?.destroy(),this.tabOut.complete(),this.change.complete()}_setActiveItemByDelta(n){this._wrap?this._setActiveInWrapMode(n):this._setActiveInDefaultMode(n)}_setActiveInWrapMode(n){let t=this._getItemsArray();for(let e=1;e<=t.length;e++){let i=(this._activeItemIndex()+n*e+t.length)%t.length,r=t[i];if(!this._skipPredicateFn(r)){this.setActiveItem(i);return}}}_setActiveInDefaultMode(n){this._setActiveItemByIndex(this._activeItemIndex()+n,n)}_setActiveItemByIndex(n,t){let e=this._getItemsArray();if(e[n]){for(;this._skipPredicateFn(e[n]);)if(n+=t,!e[n])return;this.setActiveItem(n)}}_getItemsArray(){return Le(this._items)?this._items():this._items instanceof mi?this._items.toArray():this._items}_itemsChanged(n){this._typeahead?.setItems(n);let t=this._activeItem();if(t){let e=n.indexOf(t);e>-1&&e!==this._activeItemIndex()&&(this._activeItemIndex.set(e),this._typeahead?.setCurrentSelectedItemIndex(e))}}};var sn=class extends qe{setActiveItem(n){this.activeItem&&this.activeItem.setInactiveStyles(),super.setActiveItem(n),this.activeItem&&this.activeItem.setActiveStyles()}};var an=class extends qe{_origin="program";setFocusOrigin(n){return this._origin=n,this}setActiveItem(n){super.setActiveItem(n),this.activeItem&&this.activeItem.focus(this._origin)}};var or=" ";function Fd(o,n,t){let e=rr(o,n);t=t.trim(),!e.some(i=>i.trim()===t)&&(e.push(t),o.setAttribute(n,e.join(or)))}function Ud(o,n,t){let e=rr(o,n);t=t.trim();let i=e.filter(r=>r!==t);i.length?o.setAttribute(n,i.join(or)):o.removeAttribute(n)}function rr(o,n){return o.getAttribute(n)?.match(/\S+/g)??[]}var cn=(()=>{class o{constructor(){u(li)._applyBodyHighContrastModeCssClasses()}static \u0275fac=function(e){return new(e||o)};static \u0275mod=N({type:o});static \u0275inj=F({imports:[fe,fe]})}return o})();function As(o,n){}var Ct=class{viewContainerRef;injector;id;role="dialog";panelClass="";hasBackdrop=!0;backdropClass="";disableClose=!1;closePredicate;width="";height="";minWidth;minHeight;maxWidth;maxHeight;position;data=null;direction;ariaDescribedBy=null;ariaLabelledBy=null;ariaLabel=null;ariaModal=!1;autoFocus="first-tabbable";restoreFocus=!0;delayFocusTrap=!0;scrollStrategy;closeOnNavigation=!0;enterAnimationDuration;exitAnimationDuration},ln="mdc-dialog--open",sr="mdc-dialog--opening",ar="mdc-dialog--closing",Rs=150,ks=75,dr=(()=>{class o extends nn{_animationStateChanged=new B;_animationsEnabled=!rn();_actionSectionCount=0;_hostElement=this._elementRef.nativeElement;_enterAnimationDuration=this._animationsEnabled?lr(this._config.enterAnimationDuration)??Rs:0;_exitAnimationDuration=this._animationsEnabled?lr(this._config.exitAnimationDuration)??ks:0;_animationTimer=null;_contentAttached(){super._contentAttached(),this._startOpenAnimation()}_startOpenAnimation(){this._animationStateChanged.emit({state:"opening",totalTime:this._enterAnimationDuration}),this._animationsEnabled?(this._hostElement.style.setProperty(cr,`${this._enterAnimationDuration}ms`),this._requestAnimationFrame(()=>this._hostElement.classList.add(sr,ln)),this._waitForAnimationToComplete(this._enterAnimationDuration,this._finishDialogOpen)):(this._hostElement.classList.add(ln),Promise.resolve().then(()=>this._finishDialogOpen()))}_startExitAnimation(){this._animationStateChanged.emit({state:"closing",totalTime:this._exitAnimationDuration}),this._hostElement.classList.remove(ln),this._animationsEnabled?(this._hostElement.style.setProperty(cr,`${this._exitAnimationDuration}ms`),this._requestAnimationFrame(()=>this._hostElement.classList.add(ar)),this._waitForAnimationToComplete(this._exitAnimationDuration,this._finishDialogClose)):Promise.resolve().then(()=>this._finishDialogClose())}_updateActionSectionCount(t){this._actionSectionCount+=t,this._changeDetectorRef.markForCheck()}_finishDialogOpen=()=>{this._clearAnimationClasses(),this._openAnimationDone(this._enterAnimationDuration)};_finishDialogClose=()=>{this._clearAnimationClasses(),this._animationStateChanged.emit({state:"closed",totalTime:this._exitAnimationDuration})};_clearAnimationClasses(){this._hostElement.classList.remove(sr,ar)}_waitForAnimationToComplete(t,e){this._animationTimer!==null&&clearTimeout(this._animationTimer),this._animationTimer=setTimeout(e,t)}_requestAnimationFrame(t){this._ngZone.runOutsideAngular(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(t):t()})}_captureInitialFocus(){this._config.delayFocusTrap||this._trapFocus()}_openAnimationDone(t){this._config.delayFocusTrap&&this._trapFocus(),this._animationStateChanged.next({state:"opened",totalTime:t})}ngOnDestroy(){super.ngOnDestroy(),this._animationTimer!==null&&clearTimeout(this._animationTimer)}attachComponentPortal(t){let e=super.attachComponentPortal(t);return e.location.nativeElement.classList.add("mat-mdc-dialog-component-host"),e}static \u0275fac=(()=>{let t;return function(i){return(t||(t=he(o)))(i||o)}})();static \u0275cmp=G({type:o,selectors:[["mat-dialog-container"]],hostAttrs:["tabindex","-1",1,"mat-mdc-dialog-container","mdc-dialog"],hostVars:10,hostBindings:function(e,i){e&2&&(vi("id",i._config.id),ue("aria-modal",i._config.ariaModal)("role",i._config.role)("aria-labelledby",i._config.ariaLabel?null:i._ariaLabelledByQueue[0])("aria-label",i._config.ariaLabel)("aria-describedby",i._config.ariaDescribedBy||null),it("_mat-animation-noopable",!i._animationsEnabled)("mat-mdc-dialog-container-with-actions",i._actionSectionCount>0))},features:[W],decls:3,vars:0,consts:[[1,"mat-mdc-dialog-inner-container","mdc-dialog__container"],[1,"mat-mdc-dialog-surface","mdc-dialog__surface"],["cdkPortalOutlet",""]],template:function(e,i){e&1&&(Pn(0,"div",0)(1,"div",1),Rt(2,As,0,0,"ng-template",2),Mn()())},dependencies:[ht],styles:[`.mat-mdc-dialog-container{width:100%;height:100%;display:block;box-sizing:border-box;max-height:inherit;min-height:inherit;min-width:inherit;max-width:inherit;outline:0}.cdk-overlay-pane.mat-mdc-dialog-panel{max-width:var(--mat-dialog-container-max-width, 560px);min-width:var(--mat-dialog-container-min-width, 280px)}@media(max-width: 599px){.cdk-overlay-pane.mat-mdc-dialog-panel{max-width:var(--mat-dialog-container-small-max-width, calc(100vw - 32px))}}.mat-mdc-dialog-inner-container{display:flex;flex-direction:row;align-items:center;justify-content:space-around;box-sizing:border-box;height:100%;opacity:0;transition:opacity linear var(--mat-dialog-transition-duration, 0ms);max-height:inherit;min-height:inherit;min-width:inherit;max-width:inherit}.mdc-dialog--closing .mat-mdc-dialog-inner-container{transition:opacity 75ms linear;transform:none}.mdc-dialog--open .mat-mdc-dialog-inner-container{opacity:1}._mat-animation-noopable .mat-mdc-dialog-inner-container{transition:none}.mat-mdc-dialog-surface{display:flex;flex-direction:column;flex-grow:0;flex-shrink:0;box-sizing:border-box;width:100%;height:100%;position:relative;overflow-y:auto;outline:0;transform:scale(0.8);transition:transform var(--mat-dialog-transition-duration, 0ms) cubic-bezier(0, 0, 0.2, 1);max-height:inherit;min-height:inherit;min-width:inherit;max-width:inherit;box-shadow:var(--mat-dialog-container-elevation-shadow, none);border-radius:var(--mat-dialog-container-shape, var(--mat-sys-corner-extra-large, 4px));background-color:var(--mat-dialog-container-color, var(--mat-sys-surface, white))}[dir=rtl] .mat-mdc-dialog-surface{text-align:right}.mdc-dialog--open .mat-mdc-dialog-surface,.mdc-dialog--closing .mat-mdc-dialog-surface{transform:none}._mat-animation-noopable .mat-mdc-dialog-surface{transition:none}.mat-mdc-dialog-surface::before{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;border:2px solid rgba(0,0,0,0);border-radius:inherit;content:"";pointer-events:none}.mat-mdc-dialog-title{display:block;position:relative;flex-shrink:0;box-sizing:border-box;margin:0 0 1px;padding:var(--mat-dialog-headline-padding, 6px 24px 13px)}.mat-mdc-dialog-title::before{display:inline-block;width:0;height:40px;content:"";vertical-align:0}[dir=rtl] .mat-mdc-dialog-title{text-align:right}.mat-mdc-dialog-container .mat-mdc-dialog-title{color:var(--mat-dialog-subhead-color, var(--mat-sys-on-surface, rgba(0, 0, 0, 0.87)));font-family:var(--mat-dialog-subhead-font, var(--mat-sys-headline-small-font, inherit));line-height:var(--mat-dialog-subhead-line-height, var(--mat-sys-headline-small-line-height, 1.5rem));font-size:var(--mat-dialog-subhead-size, var(--mat-sys-headline-small-size, 1rem));font-weight:var(--mat-dialog-subhead-weight, var(--mat-sys-headline-small-weight, 400));letter-spacing:var(--mat-dialog-subhead-tracking, var(--mat-sys-headline-small-tracking, 0.03125em))}.mat-mdc-dialog-content{display:block;flex-grow:1;box-sizing:border-box;margin:0;overflow:auto;max-height:65vh}.mat-mdc-dialog-content>:first-child{margin-top:0}.mat-mdc-dialog-content>:last-child{margin-bottom:0}.mat-mdc-dialog-container .mat-mdc-dialog-content{color:var(--mat-dialog-supporting-text-color, var(--mat-sys-on-surface-variant, rgba(0, 0, 0, 0.6)));font-family:var(--mat-dialog-supporting-text-font, var(--mat-sys-body-medium-font, inherit));line-height:var(--mat-dialog-supporting-text-line-height, var(--mat-sys-body-medium-line-height, 1.5rem));font-size:var(--mat-dialog-supporting-text-size, var(--mat-sys-body-medium-size, 1rem));font-weight:var(--mat-dialog-supporting-text-weight, var(--mat-sys-body-medium-weight, 400));letter-spacing:var(--mat-dialog-supporting-text-tracking, var(--mat-sys-body-medium-tracking, 0.03125em))}.mat-mdc-dialog-container .mat-mdc-dialog-content{padding:var(--mat-dialog-content-padding, 20px 24px)}.mat-mdc-dialog-container-with-actions .mat-mdc-dialog-content{padding:var(--mat-dialog-with-actions-content-padding, 20px 24px 0)}.mat-mdc-dialog-container .mat-mdc-dialog-title+.mat-mdc-dialog-content{padding-top:0}.mat-mdc-dialog-actions{display:flex;position:relative;flex-shrink:0;flex-wrap:wrap;align-items:center;box-sizing:border-box;min-height:52px;margin:0;border-top:1px solid rgba(0,0,0,0);padding:var(--mat-dialog-actions-padding, 16px 24px);justify-content:var(--mat-dialog-actions-alignment, flex-end)}@media(forced-colors: active){.mat-mdc-dialog-actions{border-top-color:CanvasText}}.mat-mdc-dialog-actions.mat-mdc-dialog-actions-align-start,.mat-mdc-dialog-actions[align=start]{justify-content:start}.mat-mdc-dialog-actions.mat-mdc-dialog-actions-align-center,.mat-mdc-dialog-actions[align=center]{justify-content:center}.mat-mdc-dialog-actions.mat-mdc-dialog-actions-align-end,.mat-mdc-dialog-actions[align=end]{justify-content:flex-end}.mat-mdc-dialog-actions .mat-button-base+.mat-button-base,.mat-mdc-dialog-actions .mat-mdc-button-base+.mat-mdc-button-base{margin-left:8px}[dir=rtl] .mat-mdc-dialog-actions .mat-button-base+.mat-button-base,[dir=rtl] .mat-mdc-dialog-actions .mat-mdc-button-base+.mat-mdc-button-base{margin-left:0;margin-right:8px}.mat-mdc-dialog-component-host{display:contents}
6
+ `],encapsulation:2})}return o})(),cr="--mat-dialog-transition-duration";function lr(o){return o==null?null:typeof o=="number"?o:o.endsWith("ms")?se(o.substring(0,o.length-2)):o.endsWith("s")?se(o.substring(0,o.length-1))*1e3:o==="0"?0:null}var yt=(function(o){return o[o.OPEN=0]="OPEN",o[o.CLOSING=1]="CLOSING",o[o.CLOSED=2]="CLOSED",o})(yt||{}),Je=class{_ref;_config;_containerInstance;componentInstance;componentRef;disableClose;id;_afterOpened=new y;_beforeClosed=new y;_result;_closeFallbackTimeout;_state=yt.OPEN;_closeInteractionType;constructor(n,t,e){this._ref=n,this._config=t,this._containerInstance=e,this.disableClose=t.disableClose,this.id=n.id,n.addPanelClass("mat-mdc-dialog-panel"),e._animationStateChanged.pipe(E(i=>i.state==="opened"),te(1)).subscribe(()=>{this._afterOpened.next(),this._afterOpened.complete()}),e._animationStateChanged.pipe(E(i=>i.state==="closed"),te(1)).subscribe(()=>{clearTimeout(this._closeFallbackTimeout),this._finishDialogClose()}),n.overlayRef.detachments().subscribe(()=>{this._beforeClosed.next(this._result),this._beforeClosed.complete(),this._finishDialogClose()}),Dt(this.backdropClick(),this.keydownEvents().pipe(E(i=>i.keyCode===27&&!this.disableClose&&!ge(i)))).subscribe(i=>{this.disableClose||(i.preventDefault(),dn(this,i.type==="keydown"?"keyboard":"mouse"))})}close(n){let t=this._config.closePredicate;t&&!t(n,this._config,this.componentInstance)||(this._result=n,this._containerInstance._animationStateChanged.pipe(E(e=>e.state==="closing"),te(1)).subscribe(e=>{this._beforeClosed.next(n),this._beforeClosed.complete(),this._ref.overlayRef.detachBackdrop(),this._closeFallbackTimeout=setTimeout(()=>this._finishDialogClose(),e.totalTime+100)}),this._state=yt.CLOSING,this._containerInstance._startExitAnimation())}afterOpened(){return this._afterOpened}afterClosed(){return this._ref.closed}beforeClosed(){return this._beforeClosed}backdropClick(){return this._ref.backdropClick}keydownEvents(){return this._ref.keydownEvents}updatePosition(n){let t=this._ref.config.positionStrategy;return n&&(n.left||n.right)?n.left?t.left(n.left):t.right(n.right):t.centerHorizontally(),n&&(n.top||n.bottom)?n.top?t.top(n.top):t.bottom(n.bottom):t.centerVertically(),this._ref.updatePosition(),this}updateSize(n="",t=""){return this._ref.updateSize(n,t),this}addPanelClass(n){return this._ref.addPanelClass(n),this}removePanelClass(n){return this._ref.removePanelClass(n),this}getState(){return this._state}_finishDialogClose(){this._state=yt.CLOSED,this._ref.close(this._result,{focusOrigin:this._closeInteractionType}),this.componentInstance=null}};function dn(o,n,t){return o._closeInteractionType=n,o.close(t)}var hr=new A("MatMdcDialogData"),ur=new A("mat-mdc-dialog-default-options"),fr=new A("mat-mdc-dialog-scroll-strategy",{providedIn:"root",factory:()=>{let o=u(O);return()=>Ke(o)}}),hi=(()=>{class o{_defaultOptions=u(ur,{optional:!0});_scrollStrategy=u(fr);_parentDialog=u(o,{optional:!0,skipSelf:!0});_idGenerator=u(pe);_injector=u(O);_dialog=u(on);_animationsDisabled=rn();_openDialogsAtThisLevel=[];_afterAllClosedAtThisLevel=new y;_afterOpenedAtThisLevel=new y;dialogConfigClass=Ct;_dialogRefConstructor;_dialogContainerType;_dialogDataToken;get openDialogs(){return this._parentDialog?this._parentDialog.openDialogs:this._openDialogsAtThisLevel}get afterOpened(){return this._parentDialog?this._parentDialog.afterOpened:this._afterOpenedAtThisLevel}_getAfterAllClosed(){let t=this._parentDialog;return t?t._getAfterAllClosed():this._afterAllClosedAtThisLevel}afterAllClosed=It(()=>this.openDialogs.length?this._getAfterAllClosed():this._getAfterAllClosed().pipe(Ce(void 0)));constructor(){this._dialogRefConstructor=Je,this._dialogContainerType=dr,this._dialogDataToken=hr}open(t,e){let i;e=m(m({},this._defaultOptions||new Ct),e),e.id=e.id||this._idGenerator.getId("mat-mdc-dialog-"),e.scrollStrategy=e.scrollStrategy||this._scrollStrategy();let r=this._dialog.open(t,k(m({},e),{positionStrategy:Xe(this._injector).centerHorizontally().centerVertically(),disableClose:!0,closePredicate:void 0,closeOnDestroy:!1,closeOnOverlayDetachments:!1,disableAnimations:this._animationsDisabled||e.enterAnimationDuration?.toLocaleString()==="0"||e.exitAnimationDuration?.toString()==="0",container:{type:this._dialogContainerType,providers:()=>[{provide:this.dialogConfigClass,useValue:e},{provide:_e,useValue:e}]},templateContext:()=>({dialogRef:i}),providers:(s,a,c)=>(i=new this._dialogRefConstructor(s,e,c),i.updatePosition(e?.position),[{provide:this._dialogContainerType,useValue:c},{provide:this._dialogDataToken,useValue:a.data},{provide:this._dialogRefConstructor,useValue:i}])}));return i.componentRef=r.componentRef,i.componentInstance=r.componentInstance,this.openDialogs.push(i),this.afterOpened.next(i),i.afterClosed().subscribe(()=>{let s=this.openDialogs.indexOf(i);s>-1&&(this.openDialogs.splice(s,1),this.openDialogs.length||this._getAfterAllClosed().next())}),i}closeAll(){this._closeDialogs(this.openDialogs)}getDialogById(t){return this.openDialogs.find(e=>e.id===t)}ngOnDestroy(){this._closeDialogs(this._openDialogsAtThisLevel),this._afterAllClosedAtThisLevel.complete(),this._afterOpenedAtThisLevel.complete()}_closeDialogs(t){let e=t.length;for(;e--;)t[e].close()}static \u0275fac=function(e){return new(e||o)};static \u0275prov=b({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})(),Ts=(()=>{class o{dialogRef=u(Je,{optional:!0});_elementRef=u(R);_dialog=u(hi);ariaLabel;type="button";dialogResult;_matDialogClose;constructor(){}ngOnInit(){this.dialogRef||(this.dialogRef=gr(this._elementRef,this._dialog.openDialogs))}ngOnChanges(t){let e=t._matDialogClose||t._matDialogCloseResult;e&&(this.dialogResult=e.currentValue)}_onButtonClick(t){dn(this.dialogRef,t.screenX===0&&t.screenY===0?"keyboard":"mouse",this.dialogResult)}static \u0275fac=function(e){return new(e||o)};static \u0275dir=L({type:o,selectors:[["","mat-dialog-close",""],["","matDialogClose",""]],hostVars:2,hostBindings:function(e,i){e&1&&Nn("click",function(s){return i._onButtonClick(s)}),e&2&&ue("aria-label",i.ariaLabel||null)("type",i.type)},inputs:{ariaLabel:[0,"aria-label","ariaLabel"],type:"type",dialogResult:[0,"mat-dialog-close","dialogResult"],_matDialogClose:[0,"matDialogClose","_matDialogClose"]},exportAs:["matDialogClose"],features:[ie]})}return o})(),pr=(()=>{class o{_dialogRef=u(Je,{optional:!0});_elementRef=u(R);_dialog=u(hi);constructor(){}ngOnInit(){this._dialogRef||(this._dialogRef=gr(this._elementRef,this._dialog.openDialogs)),this._dialogRef&&Promise.resolve().then(()=>{this._onAdd()})}ngOnDestroy(){this._dialogRef?._containerInstance&&Promise.resolve().then(()=>{this._onRemove()})}static \u0275fac=function(e){return new(e||o)};static \u0275dir=L({type:o})}return o})(),xs=(()=>{class o extends pr{id=u(pe).getId("mat-mdc-dialog-title-");_onAdd(){this._dialogRef._containerInstance?._addAriaLabelledBy?.(this.id)}_onRemove(){this._dialogRef?._containerInstance?._removeAriaLabelledBy?.(this.id)}static \u0275fac=(()=>{let t;return function(i){return(t||(t=he(o)))(i||o)}})();static \u0275dir=L({type:o,selectors:[["","mat-dialog-title",""],["","matDialogTitle",""]],hostAttrs:[1,"mat-mdc-dialog-title","mdc-dialog__title"],hostVars:1,hostBindings:function(e,i){e&2&&vi("id",i.id)},inputs:{id:"id"},exportAs:["matDialogTitle"],features:[W]})}return o})(),Ps=(()=>{class o{static \u0275fac=function(e){return new(e||o)};static \u0275dir=L({type:o,selectors:[["","mat-dialog-content",""],["mat-dialog-content"],["","matDialogContent",""]],hostAttrs:[1,"mat-mdc-dialog-content","mdc-dialog__content"],features:[xn([lt])]})}return o})(),Ms=(()=>{class o extends pr{align;_onAdd(){this._dialogRef._containerInstance?._updateActionSectionCount?.(1)}_onRemove(){this._dialogRef._containerInstance?._updateActionSectionCount?.(-1)}static \u0275fac=(()=>{let t;return function(i){return(t||(t=he(o)))(i||o)}})();static \u0275dir=L({type:o,selectors:[["","mat-dialog-actions",""],["mat-dialog-actions"],["","matDialogActions",""]],hostAttrs:[1,"mat-mdc-dialog-actions","mdc-dialog__actions"],hostVars:6,hostBindings:function(e,i){e&2&&it("mat-mdc-dialog-actions-align-start",i.align==="start")("mat-mdc-dialog-actions-align-center",i.align==="center")("mat-mdc-dialog-actions-align-end",i.align==="end")},inputs:{align:"align"},features:[W]})}return o})();function gr(o,n){let t=o.nativeElement.parentElement;for(;t&&!t.classList.contains("mat-mdc-dialog-container");)t=t.parentElement;return t?n.find(e=>e.id===t.id):null}var Ls=(()=>{class o{static \u0275fac=function(e){return new(e||o)};static \u0275mod=N({type:o});static \u0275inj=F({providers:[hi],imports:[ir,pt,Ae,cn,cn]})}return o})();var mr=10,hn=20;function Bs(o,n,t){let e=Object.entries(o??{}).filter(([,s])=>!!s&&typeof s=="object"),i=([s,a])=>typeof a?.id=="string"&&a.id?a.id:s;e.sort((s,a)=>{let c=i(s),l=i(a);return c<l?-1:c>l?1:0});let r={};if(e.slice(0,Math.max(0,n)).forEach(([s,a])=>{r[s]=a}),t&&!Object.values(r).some(s=>s?.user?.userId===t)){let s=e.find(([,a])=>a?.user?.userId===t);s&&(r[s[0]]=s[1])}return r}function un(o,n){let t=[...o??[]],e=new Map;t.forEach((r,s)=>{r?.userId&&e.set(r.userId,s)});let i=new Map;return(n??[]).forEach(r=>{let s=r?.userId;if(!s)return;let a=e.get(s);a===void 0?(e.set(s,t.length),t.push(r),i.set(s,r)):ot(t[a],r)||(t[a]=r,i.set(s,r))}),{contacts:t,changed:Array.from(i.values())}}function Vs(o){return!!o&&typeof o=="object"&&!!o.user&&typeof o.user=="object"&&!!o.user.userId}var Ph=(()=>{let n=class n{constructor(e,i,r,s,a,c,l,d,h,p){this.analyticsService=e,this.authService=i,this.configService=r,this.coreActionsService=s,this.databaseService=a,this.docService=c,this.loggingService=l,this.commonDbService=d,this.usersService=h,this.serviceBook=p,this.db=null,this.internalUserContacts$=new I([]),this.userGlobalContact$=new I(!1),this.userGroupContact$=new I(null),this.users$=new I([]),this.userPersonalContacts=[],this.userGroupContacts=[],this.userGlobalContacts=[],this.users=[],this.documentPaths=null,this.userAccessFields$=new I({}),this.userOrganizationContacts$=new I([]),this.userFolderContacts$=new I([]),this.userDocumentContacts$=new I([]),this.userOrganizationGroups$=new I([]),this.onContactSelectedSubject$=new y,this.documentAccessType=null,this.atHereEnabled$=new I(!1),this.atHereLabel$=new I("here"),this.atHereDescription$=new I(null),this.contactListScopeForOrganizationUsers$=new I([D.ALL]),this.customUserContacts$=new I(null),this.customUserContactsConfig$=new I({merge:!1}),this.orgList$=new I([]),this.currentOrganizationUserIAM$=new I(null),this.userContacts$=new I([]),this.userSnippylyIdContacts$=new I(null),this.usersByOrganizationId$=new I({}),this.temporaryUserIds$=new I([]),this.usersByOrganizationIdAndDocumentId$=new I({}),this.usersByOrganizationIdAndFolderId$=new I({}),this.userById$=new I({}),this.documentContactCount$=new I(null),this.documentContactCountGeneration=0,this.searchUsersSubject$=new y,this.searchUsersDebounceTime=300,this.pendingSearchPromises=new Map,this.reportedRowsWithoutUserId=new Set,this.authService.setContactService(this),this.usersService.setContactService(this),this.authService.getUser$().pipe(v(f=>this.docService.getDocumentPaths$().pipe(Q(g=>{this.documentPaths=g}),S(()=>f)))).subscribe(f=>z(this,null,function*(){if(this.user=f,f&&this.documentPaths)if(!f?.organizationId)this.getLoggedInUsers$().subscribe(),this.getUserContactsFromDb$(),yield this.migrateLoggedInUserFromEmailToUserIdPath(f),this.setLoggedInUser(f),yield this.moveGlobalContactUserFromEmailToUserIdPath(f),this.updateUserInGlobalContactsIfAvailable(f),f?.groupId&&(yield this.migrateGroupContactsFromEmailToUserIdPath(f?.groupId)),this.checkToSetLoggedInUserInGroupContacts();else{let g=this.userPermissionService?.getCurrentUserPermissions(),C=this.documentPaths.folderId,$=!0;C&&g?.[f?.userId]?.folders?.[C]?.errorCode===Ci.PERMISSION_DENIED&&($=!1),this.getOrganizationContactsFromDb$(),$&&this.getFolderContactsFromDb$(),this.getDocumentContactsFromDb$(),this.getOrganizationGroupsFromDb$(),this.getTemporaryUsers()}else this.getUserContactSubscription?.unsubscribe(),this.getUserContactSubscription=void 0,this.getLoggedInUsersSubscription?.unsubscribe(),this.getLoggedInUsersSubscription=void 0,this.getOrganizationContactsSubscription?.unsubscribe(),this.getOrganizationContactsSubscription=void 0,this.getFolderContactsSubscription?.unsubscribe(),this.getFolderContactsSubscription=void 0,this.getDocumentContactsSubscription?.unsubscribe(),this.getDocumentContactsSubscription=void 0,this.getOrganizationGroupsSubscription?.unsubscribe(),this.getOrganizationGroupsSubscription=void 0}),f=>{this.loggingService.catch("Error in ContactService constructor getUser$: ",f)}),this.databaseService.getDb().pipe(E(f=>!!f),te(1)).subscribe(f=>{f&&(this.db=f)},f=>{this.loggingService.catch("Error in ContactService constructor getDb: ",f)}),this.getOrganizationGroups$().subscribe(f=>{this.authService.setOrganizationUserGroups(f)}),tt([this.getInternalUserContacts$(),this.getCustomUserContacts$(),this.getCustomUserContactsConfig$()]).subscribe(([f,g,C])=>{g?C?.merge?this.userContacts$.next([...f||[],...g||[]]):this.userContacts$.next(g||[]):this.userContacts$.next(f||[])}),this.getUserContacts$().subscribe(f=>{try{f?.forEach(g=>{let C=g?.userSnippylyId||eo(this.configService.getApiKey(),g.userId);C&&this.userSnippylyIdContacts$.next(k(m({},this.userSnippylyIdContacts$.value),{[C]:g}))})}catch{}})}setUserPermissionService(e){try{this.userPermissionService=e}catch(i){this.loggingService.catch("Error in ContactService setUserPermissionService: ",i)}}clearCache(){this.loggingService.log("%c[WB] Calling FUNCTION: clearCache in ContactService","color: green;");try{this.documentPaths=null,this.usersByOrganizationId$.next({}),this.temporaryUserIds$.next([]),this.usersByOrganizationIdAndFolderId$.next({}),this.usersByOrganizationIdAndDocumentId$.next({}),this.userById$.next({}),this.userOrganizationContacts$.next([]),this.userFolderContacts$.next([]),this.userDocumentContacts$.next([]),this.userOrganizationGroups$.next([]),this.userContacts$.next([]),this.userSnippylyIdContacts$.next(null),this.userGlobalContact$.next(!1),this.userGroupContact$.next(null),this.users$.next([]),this.userPersonalContacts=[],this.userGroupContacts=[],this.userGlobalContacts=[],this.users=[],this.currentOrganizationUserIAM$.next(null)}catch(e){this.loggingService.catch("Error in ContactService clearCache: ",e)}}setDocumentAccessType(e){try{this.documentAccessType=e}catch(i){this.loggingService.catch("Error in ContactService setDocumentAccessType: ",i)}}checkIfUserGlobalContact(e){return z(this,null,function*(){try{if(e?.userId&&this.documentPaths?.globalContacts){let i=yield this.commonDbService?.getData({feature:"globalContacts",properties:{documentId:this.documentPaths?.documentId??"",organizationId:this.documentPaths?.organizationId??"",userId:w(e?.userId),skipFirestore:!0}});if(Object.keys(i??{}).length>0)return!0}if(e?.email&&this.documentPaths?.globalContacts){let i=yield this.commonDbService?.getData({feature:"globalContacts",properties:{documentId:this.documentPaths?.documentId??"",organizationId:this.documentPaths?.organizationId??"",userId:w(e?.email),skipFirestore:!0}});if(Object.keys(i??{}).length>0)return!0}return!1}catch(i){return this.loggingService.catch("Error in ContactService isUserGlobalContact: ",i),!1}})}setLoggedInUser(e){try{e?.userId&&this.documentPaths?.logins&&(this.commonDbService.updateData({feature:"logins",properties:{documentId:this.documentPaths?.documentId??"",organizationId:this.documentPaths?.organizationId??"",userId:w(e?.userId),skipFirestore:!0},data:JSON.parse(JSON.stringify(k(m({},e),{contacts:void 0})))}),this.setLoggedInUserPrivateContacts(e,e?.contacts))}catch(i){this.loggingService.catch("Error in ContactService setLoggedInUser: ",i)}}migrateLoggedInUserFromEmailToUserIdPath(e){return z(this,null,function*(){try{if(e?.email&&this.documentPaths?.logins){let i=yield this.commonDbService?.getData({feature:"logins",properties:{documentId:this.documentPaths?.documentId??"",organizationId:this.documentPaths?.organizationId??"",userId:w(e?.email),skipFirestore:!0}});if(Object.keys(i??{}).length>0){let r=i;if(r){if(r?.contacts){let s={};Object.keys(r?.contacts??{})?.forEach(a=>{let c=r.contacts[a];if(c?.userId){let l=w(c?.userId);s[l]=c}}),r.contacts=s}yield this.commonDbService.updateData({feature:"logins",properties:{documentId:this.documentPaths?.documentId??"",organizationId:this.documentPaths?.organizationId??"",userId:w(e?.userId),skipFirestore:!0},data:JSON.parse(JSON.stringify(r))}),yield this.commonDbService.deleteData({feature:"logins",properties:{documentId:this.documentPaths?.documentId??"",organizationId:this.documentPaths?.organizationId??"",userId:w(e?.email),skipFirestore:!0}})}}}}catch(i){this.loggingService.catch("Error in ContactService migrateLoggedInUserFromEmailToUserIdPath: ",i)}})}addGlobalContact(e){try{e?.userId&&this.documentPaths?.globalContacts&&this.commonDbService.updateData({feature:"globalContacts",properties:{documentId:this.documentPaths?.documentId??"",organizationId:this.documentPaths?.organizationId??"",userId:w(e?.userId),skipFirestore:!0},data:JSON.parse(JSON.stringify(e))})}catch(i){this.loggingService.catch("Error in ContactService addGlobalContact: ",i)}}getUserAccessFields(){return JSON.parse(JSON.stringify(this.userAccessFields$.value))}getUserAccessFieldsByUserId(e){return this.getUserAccessFields()?.[e]}setUserAccessFields(e){try{let i=this.getUserAccessFields();this.keepRowsWithUserId(e,"setUserAccessFields").forEach(s=>{i[s.user.userId]=s.accessFields||[]});let r=this.authService.getUser()?.userId;if(r&&i?.[r]?.length){let s=this.userPermissionService?.getCurrentUserPermissions();s&&(s[r]||(s[r]={}),s[r].context={accessFields:i[r]},this.userPermissionService?.setCurrentUserPermissions(s))}this.userAccessFields$.next(JSON.parse(JSON.stringify(i)))}catch(i){this.loggingService.catch("Error in ContactService setUserAccessFields: ",i)}}updateUserInGlobalContactsIfAvailable(e){return z(this,null,function*(){try{if(e?.userId&&this.documentPaths?.globalContacts&&(yield this.checkIfUserGlobalContact(e))){let r=new Zn;r.userId=e?.userId,r.userSnippylyId=e?.userSnippylyId,r.email=e?.email,r.name=e?.name,r.photoUrl=e?.photoUrl,this.commonDbService.updateData({feature:"globalContacts",properties:{documentId:this.documentPaths?.documentId??"",organizationId:this.documentPaths?.organizationId??"",userId:w(e?.userId),skipFirestore:!0},data:JSON.parse(JSON.stringify(r))})}}catch(i){this.loggingService.catch("Error in ContactService updateUserInGlobalContactsIfAvailable: ",i)}})}moveGlobalContactUserFromEmailToUserIdPath(e){return z(this,null,function*(){try{if(e?.email&&e?.userId&&this.documentPaths?.globalContacts){let i=yield this.commonDbService?.getData({feature:"globalContacts",properties:{documentId:this.documentPaths?.documentId??"",organizationId:this.documentPaths?.organizationId??"",userId:w(e?.email),skipFirestore:!0}});if(Object.keys(i??{}).length>0){let r=i;r&&(yield this.commonDbService.updateData({feature:"globalContacts",properties:{documentId:this.documentPaths?.documentId??"",organizationId:this.documentPaths?.organizationId??"",userId:w(e?.userId),skipFirestore:!0},data:JSON.parse(JSON.stringify(r))}),yield this.commonDbService.deleteData({feature:"globalContacts",properties:{documentId:this.documentPaths?.documentId??"",organizationId:this.documentPaths?.organizationId??"",userId:w(e?.email),skipFirestore:!0}}))}}}catch(i){this.loggingService.catch("Error in ContactService removeUserFromGlobalContactsByEmail: ",i)}})}setLoggedInUserPrivateContacts(e,i){try{if(e?.userId&&this.documentPaths?.logins){let r,s=i?.filter(c=>c?.visibility!=="group"),a=!1;this.authService.getUserOptions()&&(a=!!this.authService.getUserOptions()?.replaceContacts||!!this.authService.getUserOptions()?.replacePrivateContacts),s?.length?(r={},s?.forEach(c=>{if(c?.userId){let l=w(c?.userId);r[l]=c}}),a?this.commonDbService.setData({feature:"allLoginContacts",properties:{documentId:this.documentPaths?.documentId??"",organizationId:this.documentPaths?.organizationId??"",userId:w(e?.userId),skipFirestore:!0},data:JSON.parse(JSON.stringify(r))}):this.commonDbService.updateData({feature:"allLoginContacts",properties:{documentId:this.documentPaths?.documentId??"",organizationId:this.documentPaths?.organizationId??"",userId:w(e?.userId),skipFirestore:!0},data:JSON.parse(JSON.stringify(r))})):a&&this.commonDbService.deleteData({feature:"allLoginContacts",properties:{documentId:this.documentPaths?.documentId??"",organizationId:this.documentPaths?.organizationId??"",userId:w(e?.userId),skipFirestore:!0}})}}catch(r){this.loggingService.catch("Error in ContactService setLoggedInUserPrivateContacts: ",r)}}migrateGroupContactsFromEmailToUserIdPath(e){return z(this,null,function*(){try{if(this.documentPaths?.groupContacts&&e){let i=yield this.commonDbService?.getData({feature:"groupContacts",properties:{documentId:this.documentPaths?.documentId??"",organizationId:this.documentPaths?.organizationId??"",groupId:e,skipFirestore:!0}});i&&Object.keys(i??{}).forEach(r=>z(this,null,function*(){let s=i[r];s?.email&&s?.userId&&w(s?.email)===r&&(yield this.commonDbService.deleteData({feature:"groupContactsUser",properties:{documentId:this.documentPaths?.documentId??"",organizationId:this.documentPaths?.organizationId??"",groupId:e,userId:r,skipFirestore:!0}}),yield this.commonDbService.updateData({feature:"groupContactsUser",properties:{documentId:this.documentPaths?.documentId??"",organizationId:this.documentPaths?.organizationId??"",groupId:e,userId:w(s?.userId),skipFirestore:!0},data:JSON.parse(JSON.stringify(s))}))}))}}catch(i){this.loggingService.catch("Error in ContactService migrateGroupContacts: ",i)}})}checkToSetLoggedInUserInGroupContacts(){return z(this,null,function*(){try{this.user?.groupId&&this.user?.userId&&((yield this.checkIfUserGlobalContact(this.user))||this.docService.getDocumentIam$().pipe(te(1)).subscribe(i=>z(this,null,function*(){if(this.user?.groupId&&this.user?.userId){let r=!1,s=this.docService.getDocumentAccessType(i);if(!s||s===Lt.PUBLIC)r=!0;else if(s===Lt.RESTRICTED){let a=w(this.user?.userId);if(i?.users?.[a]&&(r=!0),this.user?.email){let c=w(this.user?.email);i?.users?.[c]&&(r=!0)}}if(r){let a=new Qn;a.email=this.user.email,a.visibility="group",a.name=this.user.name,a.photoUrl=this.user.photoUrl,a.userId=this.user.userId,(this.authService.getUserOptions()?.replaceContacts||this.authService.getUserOptions()?.replaceGroupContacts)&&(yield this.removeGroupContacts(this.user?.groupId)),this.setLoggedInUserGroupContacts(this.user?.groupId,[a]),this.user?.contacts&&this.user?.groupId&&this.setLoggedInUserGroupContacts(this.user?.groupId,this.user?.contacts)}}})))}catch(e){this.loggingService.catch("Error in ContactService checkToSetLoggedInUserInGroupContacts: ",e)}})}setLoggedInUserGroupContacts(e,i){try{let r=i?.filter(s=>s?.visibility==="group");r?.length&&r.forEach(s=>z(this,null,function*(){if(s?.userId&&e&&this.documentPaths?.groupContacts){if(this.configService?.getSF()&&(yield this.checkIfUserGlobalContact(s)))return;yield this.commonDbService.updateData({feature:"groupContactsUser",properties:{documentId:this.documentPaths?.documentId??"",organizationId:this.documentPaths?.organizationId??"",groupId:e,userId:w(s?.userId),skipFirestore:!0},data:JSON.parse(JSON.stringify(s))}),s?.email&&(yield this.commonDbService.deleteData({feature:"groupContactsUser",properties:{documentId:this.documentPaths?.documentId??"",organizationId:this.documentPaths?.organizationId??"",groupId:e,userId:w(s?.email),skipFirestore:!0}}))}}))}catch(r){this.loggingService.catch("Error in ContactService setLoggedInUserGroupContacts: ",r)}}removeGroupContacts(e){return z(this,null,function*(){try{if(this.documentPaths?.groupContacts&&e)return this.commonDbService.deleteData({feature:"groupContacts",properties:{documentId:this.documentPaths?.documentId??"",organizationId:this.documentPaths?.organizationId??"",groupId:e,skipFirestore:!0}})}catch(i){this.loggingService.catch("Error in ContactService removeGroupContacts: ",i)}})}mergeUserContacts(){try{let e=[];this.userPersonalContacts&&e.push(...this.userPersonalContacts),this.userGroupContacts&&e.push(...this.userGroupContacts),this.userGlobalContacts&&e.push(...this.userGlobalContacts);let i={};e.forEach(r=>{r?.userId?(!r?.email||!i[r.email])&&(i[r.userId]=r):r?.email&&(!r?.userId||!i[r.userId])&&(i[r.email]=r)}),e=Object.values(i??{}),this.internalUserContacts$.next(e)}catch(e){this.loggingService.catch("Error in ContactService mergeUserContacts: ",e)}}getInternalUserContacts(){return this.internalUserContacts$.value}getInternalUserContacts$(){return this.internalUserContacts$.asObservable()}getUserContacts$(e){try{let{organizationId:i,documentId:r,veltFolderId:s}=e||{};return i&&r?tt([this.usersByOrganizationId$,this.usersByOrganizationIdAndFolderId$,this.usersByOrganizationIdAndDocumentId$,this.userById$,this.customUserContacts$,this.customUserContactsConfig$,this.getContactListScopeForOrganizationUsers$(),this.temporaryUserIds$]).pipe(S(([a,c,l,d,h,p,f,g])=>{let C={},$=!1;p&&!p?.merge&&($=!0);let ve=xe=>f.some(Pe=>xe.includes(Pe)),et=ve([D.ALL,D.ORGANIZATION])?Object.keys(a?.[i]||{}):[],br=s?ve([D.ALL,D.FOLDER])?Object.keys(c?.[i]?.[s]||{}):[]:[],Sr=ve([D.ALL,D.DOCUMENT])?Object.keys(l?.[i]?.[r]||{}):[];if([...et,...br||[],...Sr,...g].forEach(xe=>{let Pe=d?.[xe];Pe&&(C[xe]=Pe)}),h){let{merge:xe,options:Pe}=p||{},{organizationId:pn,documentId:gn,folderId:mn}=Pe||{},_n=mn?qn(mn):void 0;(!pn||pn===i)&&(!gn||gn===r)&&(!_n||_n===s)&&(xe||(C={}),h.forEach(gi=>{gi?.userId&&(C[gi.userId]=gi)}))}return Object.values(C??{})})):this.userContacts$.asObservable().pipe(S(a=>a))}catch(i){return this.loggingService.catch("Error in ContactService getUserContacts$ metadata: ",i),_([])}}getUserContactsBySnippylyId$(){return this.userSnippylyIdContacts$.asObservable()}getUserBySnippylyId(e){return this.userSnippylyIdContacts$.value?.[e]}getAtHereLabel(){return this.atHereLabel$.asObservable()}getAtHereDescription(){return this.atHereDescription$.asObservable()}getUserContactsFromDb$(){this.getUserContactSubscription||(this.getUserContactSubscription=this.authService.getUser$().pipe(E(e=>!!e),v(e=>this.docService.getDocumentPaths$().pipe(E(i=>!!i),Q(i=>{this.documentPaths=i}),S(()=>e))),v(e=>{if(this.userGroupContacts=[],this.userPersonalContacts=[],!e)return _();if(!this.documentPaths)return _();let i=[];return i.push(this.commonDbService.dbListener({feature:"allGlobalContacts",properties:{documentId:this.documentPaths?.documentId,organizationId:this.documentPaths?.organizationId,skipFirestore:!0}}).pipe(S(r=>r?.data),Q(r=>{r?(this.userGlobalContacts=Object.values(r??{}),this.userGlobalContacts?.find(s=>s.userId===this.user?.userId)?this.userGlobalContact$.next(!0):this.userGlobalContact$.next(!1)):(this.userGlobalContacts=[],this.userGlobalContact$.next(!1))}))),i.push(this.commonDbService.dbListener({feature:"groupContacts",properties:{documentId:this.documentPaths?.documentId,organizationId:this.documentPaths?.organizationId,skipFirestore:!0,groupId:e?.groupId}}).pipe(S(r=>r?.data),Q(r=>{r?(this.userGroupContacts=Object.values(r??{}),this.userGroupContacts?.find(s=>s?.userId===this.user?.userId)?this.userGroupContact$.next(!0):this.userGroupContact$.next(!1)):(this.userGroupContacts=[],this.userGroupContact$.next(!1))}))),i.push(this.commonDbService.dbListener({feature:"allLoginContacts",properties:{documentId:this.documentPaths?.documentId,organizationId:this.documentPaths?.organizationId,skipFirestore:!0,userId:w(e?.userId)}}).pipe(S(r=>r?.data),Q(r=>{r?this.userPersonalContacts=Object.values(r??{}):this.userPersonalContacts=[]}))),Dt(...i).pipe(de(this.authService.getUser$().pipe(E(r=>!r))))})).subscribe(()=>{this.mergeUserContacts()},e=>{this.loggingService.catch("Error in ContactService getUserContacts$ subscription: ",e)}))}addUserContact(e){try{this.user?.organizationId||this.user?.groupId&&(e.visibility="group",this.setLoggedInUserGroupContacts(this.user?.groupId,[e]))}catch(i){this.loggingService.catch("Error in ContactService addUserContact: ",i)}}isUserGlobalContact$(){return this.userGlobalContact$.asObservable().pipe(X(ot))}isUserGlobalContact(){return this.userGlobalContact$.value}isUserGroupContact$(){return this.userGroupContact$.asObservable()}isUserGroupContact(){return this.userGroupContact$.value}getLoggedInUsers$(){return this.getLoggedInUsersSubscription||(this.getLoggedInUsersSubscription=this.authService.getUser$().pipe(v(e=>e?this.documentPaths?e?.userId&&this.documentPaths?.logins?this.commonDbService.dbListener({feature:"allLogins",properties:{documentId:this.documentPaths?.documentId,organizationId:this.documentPaths?.organizationId,skipFirestore:!0}}).pipe(S(i=>i?.data),Q(i=>{i?this.users=Object.values(i??{}):this.users=[]})):(this.users=[],_()):_():_())).subscribe(()=>{this.users$.next(this.users)},e=>{this.loggingService.catch("Error in ContactService getLoggedInUsers$ subscription: ",e)})),this.users$.asObservable()}getUsersMap$(){return this.authService.getUser$().pipe(v(e=>e?.organizationId?this.userById$.pipe(S(i=>{let r={};return Object.values(i||{}).forEach(s=>{s?.userSnippylyId&&(r[s?.userSnippylyId]=s)}),r})):this.users$.pipe(S(i=>{let r={};return i.forEach(s=>{r[s.userSnippylyId]=s}),r}))))}getUserByEmail$(e){return this.users$.pipe(S(i=>i.find(r=>r.email===e)))}getUserByEmail(e){return this.users?.find(i=>i.email===e)}getContactByEmail(e){return this.getInternalUserContacts().find(i=>i.email===e)}getUserByUserId$(e){return this.users$.pipe(S(i=>i.find(r=>r.userId===e)))}getUserGroupContacts(){return this.userGroupContacts}getTemporaryUsers(){try{let e=this.authService.getUser();this.docService.getOrganizationConfig$().pipe(E(i=>!!i),S(i=>i?.organizationId)).subscribe(i=>z(this,null,function*(){if(i&&e){let r=((yield this.commonDbService?.queryData({feature:"allPermissionsUsers",properties:{organizationId:i,useCollectionGroup:!1,isCollection:!0,firestoreQuery:[T("expiresAt",">",new Date().getTime())]}}))??[]).filter(s=>s?.userId!==e?.userId);if(r?.length){let s=r.map(d=>d?.userId),a=Jn(),c=Xn.GET_TEMPORARY_USERS;this.coreActionsService.triggerAction(Yn.USER_RESOLVER,{event:Ft.Events.Resolver.USER_RESOLUTION_REQUEST_FORMED,timestamp:new Date().getTime(),uniqueId:a,moduleName:c,methodName:Kn.GET_TEMPORARY_USERS,source:"internal",payload:{userIds:s}});let l=yield this.usersService.resolveUsers({userIds:s,uniqueId:a,moduleName:c});if(l){let d={};Object.entries(l).forEach(([p,f])=>{d[p]=f}),this.userById$.next(m(m({},this.userById$.value),d));let h=new Set([...this.temporaryUserIds$.value,...Object.keys(d)]);this.temporaryUserIds$.next(Array.from(h))}}}}))}catch(e){this.loggingService.catch("Error in ContactService getTemporaryUsers: ",e)}}searchUsers(e){return z(this,null,function*(){try{if(!e||typeof e!="string"||!e.trim())return[];let i=e.trim();return this.searchUsersDebounced$||(this.searchUsersDebounced$=this.searchUsersSubject$.pipe(wt(this.searchUsersDebounceTime),X(),v(r=>bt(this.performSearch(r)).pipe(S(s=>({searchText:r,results:s})),Ot(s=>(this.loggingService.catch("Error in ContactService performSearch: ",s),_({searchText:r,results:[]})))))),this.searchUsersDebounced$.subscribe({next:({searchText:r,results:s})=>{Array.from(this.pendingSearchPromises.keys()).forEach(l=>{if(l!==r){let d=this.pendingSearchPromises.get(l);d&&(d.forEach(({resolve:h})=>h([])),this.pendingSearchPromises.delete(l))}});let c=this.pendingSearchPromises.get(r);c&&(c.forEach(({resolve:l})=>l(s)),this.pendingSearchPromises.delete(r))},error:r=>{this.pendingSearchPromises.forEach(s=>{s.forEach(({reject:a})=>a(r))}),this.pendingSearchPromises.clear()}})),new Promise((r,s)=>{this.pendingSearchPromises.has(i)||this.pendingSearchPromises.set(i,[]),this.pendingSearchPromises.get(i).push({resolve:r,reject:s}),this.searchUsersSubject$.next(i)})}catch(i){return this.loggingService.catch("Error in ContactService searchUsers: ",i),[]}})}performSearch(e){return z(this,null,function*(){try{let i=this.docService.getOrganizationConfig()?.organizationId;if(!i)return[];let r=this.documentPaths?.veltFolderId,s=this.docService.getDocumentIds().map(g=>g?.documentId),a=e.toLowerCase().trim(),c=a+"\uF8FF";if(this.commonDbService.portableCapabilityState(oo)==="announced"){let g=yield this.searchPortableOrganizationUsers(e);return g?this.applySearchResults(g):[]}let l=[],d=s?.filter(g=>!!g)||[],h=d.length>0,p=!!r;if(h){let g=[],C=hn;for(let $=0;$<d.length;$+=C)g.push(d.slice($,$+C));g.forEach($=>{let ve=[T("documentIds","array-contains-any",$),T("viewerDocumentIds","array-contains-any",$)],et=[T("organizationIds","array-contains-any",[i]),T("viewerOrganizationIds","array-contains-any",[i]),...ve];p&&et.push(T("folderIds","array-contains-any",[r]),T("viewerFolderIds","array-contains-any",[r])),l.push(this.commonDbService.queryData({feature:"allDocumentUsers",properties:{organizationId:i,isCollection:!0,useCollectionGroup:!1,useQuery:!0,firestoreQuery:[Se(Ie(...et),T("user.name_lowercase",">=",a),T("user.name_lowercase","<",c)),$e(10)]}}).catch(()=>[])),l.push(this.commonDbService.queryData({feature:"allDocumentUsers",properties:{organizationId:i,isCollection:!0,useCollectionGroup:!1,useQuery:!0,firestoreQuery:[Se(Ie(...et),T("user.email_lowercase",">=",a),T("user.email_lowercase","<",c)),$e(10)]}}).catch(()=>[]))})}let f=yield Promise.all(l);return this.applySearchResults(f)}catch(i){return this.loggingService.catch("Error in ContactService performSearch: ",i),[]}})}searchPortableOrganizationUsers(e){return z(this,null,function*(){let i=this.authService.getUser()?.userId,r=this.docService.getOrganizationConfig()?.clientOrganizationId,s=this.documentPaths?.folderId,a=(this.docService.getDocumentIds()??[]).map(h=>h?.clientDocumentId).filter(h=>!!h);if(!r||!a.length)return[];let c=[];for(let h=0;h<a.length;h+=hn)c.push(a.slice(h,h+hn));let l=this.portableSearchScope(),d=yield Promise.all(c.map(h=>z(this,null,function*(){let p=yield this.commonDbService.searchPortableOrganizationUsers(k(m({organizationId:r,documentIds:h},s?{folderId:s}:{}),{searchText:e}));if(!p?.ok)return this.loggingService.log(`[WB] Tier B searchOrganizationUsers answered ${p?.code??"no result"}; that batch is read as no users, as hosted's query failure is.`),[[],[]];let f=p.data;return[Array.isArray(f?.byName)?f.byName:[],Array.isArray(f?.byEmail)?f.byEmail:[]]})));return this.authService.getUser()?.userId!==i||this.portableSearchScope()!==l?null:d.flat()})}portableSearchScope(){let e=(this.docService.getDocumentIds()??[]).map(i=>i?.clientDocumentId??"");return JSON.stringify([this.docService.getOrganizationConfig()?.clientOrganizationId??null,this.documentPaths?.folderId??null,e])}applySearchResults(e){try{let i=[];e.forEach(a=>{a&&Array.isArray(a)?a.forEach(c=>{c&&c.user&&c.user.userId&&i.push(c)}):a&&typeof a=="object"&&Object.values(a).forEach(l=>{l&&l.user&&l.user.userId&&i.push(l)})});let r=new Map;i.forEach(a=>{let c=a.user?.userId;c&&!r.has(c)&&r.set(c,a)});let s=Array.from(r.values());return this.setResolvedUsers(s,!0),s}catch(i){return this.loggingService.catch("Error in ContactService performSearch: ",i),[]}}setResolvedUsers(e,i=!1){try{let r=this.keepRowsWithUserId(e,"setResolvedUsers");if(r?.length){let s=[],a=[],c=[],l=this.docService.getOrganizationConfig()?.organizationId,d=this.documentPaths?.veltFolderId,h=this.docService.getDocumentIds().map(g=>g?.documentId);r.forEach(g=>{this.userById$.value[g?.user?.userId]||(l&&g?.organizationIds?.includes(l)&&!s.find(C=>C?.user?.userId===g?.user?.userId)&&s.push(g),d&&g?.folderIds?.includes(d)&&!a.find(C=>C?.user?.userId===g?.user?.userId)&&a.push(g),h?.some(C=>g?.documentIds?.includes(C))&&!c.find(C=>C?.user?.userId===g?.user?.userId)&&c.push(g))}),s?.length&&this.setUserOrganizationContacts(s,l,i),a?.length&&this.setUserFolderContacts(a,i),c?.length&&this.setUserDocumentContacts(c,i);let f=[...s,...a,...c].filter((g,C,$)=>C===$.findIndex(ve=>ve.user.userId===g.user.userId));f?.length&&(this.setUserAccessFields(f),this.mergeOrganizationAndDocumentContacts())}}catch(r){this.loggingService.catch("Error in ContactService setResolvedUsers: ",r)}}paginatedContactList$(){return this.serviceBook.observe(rt).pipe(X(),v(e=>{try{return e?e.getPaginatedContactList$().pipe(Ot(()=>_(re.PAGINATED_CONTACT_LIST_DEFAULT))):_(re.PAGINATED_CONTACT_LIST_DEFAULT)}catch(i){return this.loggingService.catch("Error in ContactService paginatedContactList$: ",i),_(re.PAGINATED_CONTACT_LIST_DEFAULT)}}),X())}organizationUsersSource$(e,i,r){return r?Si(this.commonDbService,Ii,{feature:"allOrganizationUsers",properties:{organizationId:e,isCollection:!0}}).pipe(S(s=>i&&s?.data?k(m({},s),{data:Bs(s.data,mr,this.authService.getUser()?.userId)}):s)):this.commonDbService.dbListener({feature:"allOrganizationUsers",properties:{organizationId:e,isCollection:!0,useQuery:!0,firestoreQuery:[Se(Ie(T("organizationIds","array-contains-any",[e]),T("viewerOrganizationIds","array-contains-any",[e]))),st("id"),...i?[$e(mr)]:[]]}})}organizationGroupsSource$(e){return this.commonDbService?.isPortableSession?.()===!0?Si(this.commonDbService,Ii,{feature:"allOrganizationGroups",properties:{organizationId:e,isCollection:!0}}):this.commonDbService.dbListener({feature:"allOrganizationGroups",properties:{organizationId:e,isCollection:!0}})}getOrganizationContactsFromDb$(){try{this.getOrganizationContactsSubscription||(this.getOrganizationContactsSubscription=this.authService.getUser$().pipe(v(e=>e?.organizationId?_(e).pipe(v(i=>this.docService.getOrganizationConfig$().pipe(E(r=>!!r),S(()=>i))),v(i=>this.usersService.getResolveOrganizationUsers$().pipe(E(r=>r),S(()=>i))),v(i=>{let r=this.docService.getOrganizationConfig()?.organizationId;if(this.setUserOrganizationContacts([],r),!i)return _();if(!r)return _();let s=this.commonDbService?.isPortableSession?.()===!0;return this.paginatedContactList$().pipe(v(a=>this.organizationUsersSource$(r,a,s).pipe(S(c=>c?.data),v(c=>{let l=Object.values(c??{});return a&&!s&&l.length>0&&!l.find(d=>d?.user?.userId===this.authService.getUser()?.userId)?bt(this.commonDbService.queryData({feature:"allOrganizationUsers",properties:{organizationId:r,isCollection:!0,useQuery:!0,firestoreQuery:[Se(Ie(T("organizationIds","array-contains-any",[r]),T("viewerOrganizationIds","array-contains-any",[r])),T("user.userId","==",this.authService.getUser()?.userId))]}})).pipe(S(d=>{if(d&&d.length>0){let h=d[0],p=h?.user?.userId||h?.id;if(p&&c){let f=w(p);return k(m({},c),{[f]:h})}}return c})):_(c)}),S(c=>{if(c){typeof c=="object"&&(c?.undefined&&delete c.undefined,c?.null&&delete c.null);let l=Object.values(c??{});this.setUserAccessFields(l),this.setUserOrganizationContacts(l,r)}else this.setUserOrganizationContacts([],r)}))))}),v(()=>this.getContactListScopeForOrganizationUsers$())):(this.setUserOrganizationContacts([]),_()))).subscribe(()=>{this.mergeOrganizationAndDocumentContacts()},e=>{this.loggingService.catch("Error in ContactService getOrganizationContactsFromDb$ subscription: ",e)}))}catch{}}getFolderContactsFromDb$(){try{this.getFolderContactsSubscription||(this.getFolderContactsSubscription=this.authService.getUser$().pipe(v(e=>e?_(e).pipe(v(i=>this.docService.getOrganizationConfig$().pipe(E(r=>!!r),S(()=>i))),v(i=>this.usersService.getResolveFolderUsers$().pipe(E(r=>r),S(()=>i))),v(i=>{let r=this.docService.getOrganizationConfig()?.organizationId;if(this.setUserFolderContacts([]),!i)return _();if(!this.commonDbService.shouldUseFirestore())return _();if(!this.documentPaths?.veltFolderId)return _();let s=_([]);return s=this.paginatedContactList$().pipe(v(a=>this.commonDbService.dbListener({feature:"allFolderUsers",properties:{organizationId:r,folderId:this.documentPaths?.veltFolderId,isCollection:!0,useQuery:!0,firestoreQuery:[Se(Ie(T("folderIds","array-contains-any",[this.documentPaths?.veltFolderId]),T("viewerFolderIds","array-contains-any",[this.documentPaths?.veltFolderId]))),st("id"),...a?[$e(10)]:[]]}}).pipe(S(c=>c?.data)))),s.pipe(S(a=>{if(a){typeof a=="object"&&(a?.undefined&&delete a.undefined,a?.null&&delete a.null);let c=Object.values(a??{});this.setUserAccessFields(c),this.setUserFolderContacts(c)}else this.setUserFolderContacts([])}))}),v(()=>this.getContactListScopeForOrganizationUsers$())):(this.setUserFolderContacts([]),_()))).subscribe(()=>{this.mergeOrganizationAndDocumentContacts()},e=>{this.loggingService.catch("Error in ContactService getFolderContactsFromDb$ subscription: ",e)}))}catch{}}getDocumentContactsFromDb$(){try{this.getDocumentContactsSubscription||(this.getDocumentContactsSubscription=this.authService.getUser$().pipe(v(e=>e?_(e).pipe(v(i=>this.docService.getDocumentPaths$().pipe(E(r=>!!r),Q(r=>{this.documentPaths=r}),S(()=>i))),v(i=>this.usersService.getResolveDocumentUsers$().pipe(E(r=>r),S(()=>i))),v(i=>(this.setUserDocumentContacts([]),this.resetDocumentContactCount(),i?this.documentPaths?this.docService.getDocumentIds$().pipe(v(r=>{let s=r?.length>0?r.map(h=>h.documentId):[this.documentPaths?.documentId??""];if(s.some(h=>!h)||!this.documentPaths)return _();let a=_([]),c={isCollection:!0,useQuery:!0};this.commonDbService.shouldUseFirestore()||(c.documentId=s?.length?s[0]:void 0,c.organizationId=this.documentPaths?.organizationId);let l=[];for(let h=0;h<s.length;h+=re.LISTENER_BATCH_SIZE)l.push(s.slice(h,h+re.LISTENER_BATCH_SIZE));let d=h=>Se(Ie(T("documentIds","array-contains-any",h),T("viewerDocumentIds","array-contains-any",h)));return a=this.paginatedContactList$().pipe(v(h=>(this.refreshDocumentContactCount(h,l,c,d),tt(l.map(p=>this.commonDbService.dbListener({feature:"allDocumentUsers",properties:k(m({},c),{firestoreQuery:[d(p),st("id"),...h?[$e(10)]:[]]})}).pipe(En()))).pipe(S(p=>to(p)?.data))))),a.pipe(S(h=>{if(h){typeof h=="object"&&(h?.undefined&&delete h.undefined,h?.null&&delete h.null);let p=Object.values(h??{});this.setUserAccessFields(p),this.setUserDocumentContacts(p)}else this.setUserDocumentContacts([])}))})):_():_())),v(()=>this.getContactListScopeForOrganizationUsers$())):(this.setUserDocumentContacts([]),_()))).subscribe(()=>{this.mergeOrganizationAndDocumentContacts()},e=>{this.loggingService.catch("Error in ContactService getDocumentContactsFromDb$ subscription: ",e)}))}catch{}}keepRowsWithUserId(e,i){let r=Array.isArray(e)?e:[],s=r.filter(Vs);return s.length!==r.length&&!this.reportedRowsWithoutUserId.has(i)&&(this.reportedRowsWithoutUserId.add(i),this.loggingService.catch(`ContactService ${i}: skipped ${r.length-s.length} directory row(s) with no user.userId; the other contacts were kept.`)),s}setUserOrganizationContacts(e,i,r=!0){try{let s=this.keepRowsWithUserId(e,"setUserOrganizationContacts"),a=s.find(d=>d.user.userId===this.user?.userId);a&&this.setCurrentOrganizationUserIAM(a);let{contacts:c,changed:l}=un(this.userOrganizationContacts$.value,s.map(d=>d.user));if(this.userOrganizationContacts$.next(c),r&&this.usersService.setUserByIds(l),i){let d={};d[i]={};let h={};s.forEach(f=>{d[i][f.user.userId]=f,h[f.user.userId]=f.user}),this.userById$.next(m(m({},this.userById$.value),h));let p=this.usersByOrganizationId$.value?.[i];p&&(d[i]=m(m({},p),d[i])),this.usersByOrganizationId$.next(k(m({},this.usersByOrganizationId$.value),{[i]:d[i]}))}else this.usersByOrganizationId$.next({})}catch(s){this.loggingService.catch("Error in ContactService setUserOrganizationContacts: ",s)}}getUserOrganizationContacts$(){return this.getContactListScopeForOrganizationUsers$().pipe(v(()=>this.checkContactListScopeForOrganizationUsers([D.ALL,D.ORGANIZATION])?this.userOrganizationContacts$.asObservable():_([])))}getUserOrganizationContacts(){return this.checkContactListScopeForOrganizationUsers([D.ALL,D.ORGANIZATION])?this.userOrganizationContacts$.value:[]}setUserFolderContacts(e,i=!0){try{let r=this.keepRowsWithUserId(e,"setUserFolderContacts"),{contacts:s,changed:a}=un(this.userFolderContacts$.value,r.map(h=>h.user));this.userFolderContacts$.next(s),i&&this.usersService.setUserByIds(a);let c=this.usersByOrganizationIdAndFolderId$.value||{},l=m({},c),d={};r?.forEach(h=>{let{organizationId:p}=h?.metadata||{};p&&(l[p]||(l[p]={}),h.folderIds?.forEach(f=>{l[p][f]||(l[p][f]={}),l[p][f]=k(m({},l[p][f]),{[h.user.userId]:h}),d[h.user.userId]=h.user}))}),this.userById$.next(m(m({},this.userById$.value),d)),this.usersByOrganizationIdAndFolderId$.next(l)}catch(r){this.loggingService.catch("Error in ContactService updateUserFolderContacts: ",r)}}getUserFolderContacts$(){return this.getContactListScopeForOrganizationUsers$().pipe(v(()=>this.checkContactListScopeForOrganizationUsers([D.ALL,D.FOLDER])?this.userFolderContacts$.asObservable():_([])))}getUserFolderContacts(){return this.checkContactListScopeForOrganizationUsers([D.ALL,D.FOLDER])?this.userFolderContacts$.value:[]}setUserDocumentContacts(e,i=!0){try{let r=this.keepRowsWithUserId(e,"setUserDocumentContacts"),{contacts:s,changed:a}=un(this.userDocumentContacts$.value,r.map(h=>h.user));this.userDocumentContacts$.next(s),i&&this.usersService.setUserByIds(a);let c=this.usersByOrganizationIdAndDocumentId$.value||{},l=m({},c),d={};r?.forEach(h=>{let{organizationId:p}=h?.metadata||{};p&&(l[p]||(l[p]={}),h.documentIds?.forEach(f=>{l[p][f]||(l[p][f]={}),l[p][f]=k(m({},l[p][f]),{[h.user.userId]:h}),d[h.user.userId]=h.user}))}),this.userById$.next(m(m({},this.userById$.value),d)),this.usersByOrganizationIdAndDocumentId$.next(l)}catch(r){this.loggingService.catch("Error in ContactService updateUserDocumentContacts: ",r)}}getDocumentContactCount$(){return this.documentContactCount$.asObservable()}resetDocumentContactCount(){this.documentContactCountGeneration++,this.documentContactCount$?.next(null)}refreshDocumentContactCount(e,i,r,s){try{if(this.resetDocumentContactCount(),!e||!i.length||!this.commonDbService.shouldUseFirestore())return;let a=this.documentContactCountGeneration;Promise.all(i.map(c=>this.commonDbService.queryData({feature:"allDocumentUsers",properties:k(m({},r),{getCount:!0,firestoreQuery:[s(c),st("id")]})}))).then(c=>{if(a!==this.documentContactCountGeneration)return;let l=c.every(d=>typeof d=="number"&&Number.isFinite(d)&&d>=0);this.documentContactCount$?.next(l?Math.max(...c):null)}).catch(c=>{this.loggingService.catch("Error in ContactService refreshDocumentContactCount: ",c)})}catch(a){this.loggingService.catch("Error in ContactService refreshDocumentContactCount: ",a)}}getUserDocumentContacts$(){return this.getContactListScopeForOrganizationUsers$().pipe(v(()=>this.checkContactListScopeForOrganizationUsers([D.ALL,D.DOCUMENT])?this.userDocumentContacts$.asObservable():_([])))}getUserDocumentContacts(){return this.checkContactListScopeForOrganizationUsers([D.ALL,D.DOCUMENT])?this.userDocumentContacts$.value:[]}setCurrentOrganizationUserIAM(e){try{this.currentOrganizationUserIAM$.next(JSON.parse(JSON.stringify(e)))}catch(i){this.loggingService.catch("Error in ContactService setCurrentOrganizationUserIAM: ",i)}}getCurrentOrganizationUserIAM$(){return this.currentOrganizationUserIAM$.asObservable().pipe(X(ot))}getCurrentOrganizationUserIAM(){return this.currentOrganizationUserIAM$.value}mergeOrganizationAndDocumentContacts(){try{this.mergeContactsDebounceTimer&&clearTimeout(this.mergeContactsDebounceTimer),this.mergeContactsDebounceTimer=setTimeout(()=>{this.executeMergeContacts()},200)}catch(e){this.loggingService.catch("Error in ContactService mergeOrganizationAndDocumentContacts: ",e)}}executeMergeContacts(){try{let e=this.getContactListScopeForOrganizationUsers(),i=[];e.includes(D.ALL)?i=[...this.getUserOrganizationContacts(),...this.getUserFolderContacts(),...this.getUserDocumentContacts()]:e.includes(D.ORGANIZATION)?i=[...this.getUserOrganizationContacts()]:e.includes(D.FOLDER)?i=[...this.getUserFolderContacts()]:e.includes(D.DOCUMENT)&&(i=[...this.getUserDocumentContacts()]);let r=[...new Map(i.filter(s=>s?.userId).map(s=>[s.userId,s])).values()];this.internalUserContacts$.next(r)}catch(e){this.loggingService.catch("Error in ContactService mergeOrganizationAndDocumentContacts: ",e)}}getOrganizationGroupsFromDb$(){try{this.getOrganizationGroupsSubscription||(this.getOrganizationGroupsSubscription=this.authService.getUser$().pipe(v(e=>e?.organizationId?_(e).pipe(v(i=>this.docService.getOrganizationConfig$().pipe(E(r=>!!r),S(()=>i))),v(i=>{if(this.setUserOrganizationGroups([]),!i)return _();let r=this.docService.getOrganizationConfig(),s=r?.organizationId,a=r?.clientOrganizationId??"";if(!s)return _();let c=i.userId??"";return bt(this.userPermissionService?.getUserPermissionsFromCacheOrFetch({organizationId:a})??Promise.resolve({})).pipe(v(l=>c&&a&&l?.[c]?.organization?.[a]?.errorCode===Ci.PERMISSION_DENIED?_():this.organizationGroupsSource$(s).pipe(S(d=>d?.data),S(d=>{d?(typeof d=="object"&&(d?.undefined&&delete d.undefined,d?.null&&delete d.null),this.setUserOrganizationGroups(Object.values(d??{}))):this.setUserOrganizationGroups([])}))))})):(this.setUserOrganizationGroups([]),_()))).subscribe(()=>{},e=>{this.loggingService.catch("Error in ContactService getOrganizationGroupsFromDb$ subscription: ",e)}))}catch{}}setUserOrganizationGroups(e){try{this.userOrganizationGroups$.next(e)}catch(i){this.loggingService.catch("Error in ContactService setUserOrganizationGroups: ",i)}}onContactSelected(e){try{if(e?.userId){let i=!!this.getUserDocumentContacts().find(s=>s.userId===e.userId),r=!!this.getUserOrganizationContacts().find(s=>s.userId===e.userId);switch(this.documentAccessType){case Lt.RESTRICTED:if(!i){let s={contact:e,isOrganizationContact:r,isDocumentContact:i,documentAccessType:this.documentAccessType};this.onContactSelectedSubject$.next(s)}break}}else{let i={contact:e,isOrganizationContact:!1,isDocumentContact:!1,documentAccessType:this.documentAccessType};this.onContactSelectedSubject$.next(i)}}catch(i){this.loggingService.catch("Error in ContactService onContactSelected: ",i)}}onContactSelected$(){return this.onContactSelectedSubject$.asObservable()}getOrganizationGroups$(){return this.getContactListScopeForOrganizationUsers$().pipe(v(()=>this.checkContactListScopeForOrganizationUsers([D.ALL,D.ORGANIZATION_USER_GROUP])?this.userOrganizationGroups$.asObservable():_([])))}enableAtHere(){try{if(this.analyticsService.setFeatureConfig({feature:nt.COMMENT,config:{atHereEnabled:!0}}),this.atHereEnabled$.value===!0)return;this.atHereEnabled$.next(!0)}catch(e){this.loggingService.catch("Error in ContactService enableAtHere: ",e)}}setAtHereLabel(e){try{this.analyticsService.setFeatureConfig({feature:nt.COMMENT,config:{atHereLabel:e}}),e&&this.atHereLabel$.next(e)}catch(i){this.loggingService.catch("Error in ContactService setAtHereLabel: ",i)}}setAtHereDescription(e){try{this.analyticsService.setFeatureConfig({feature:nt.COMMENT,config:{atHereDescription:e}}),e&&this.atHereDescription$.next(e)}catch(i){this.loggingService.catch("Error in ContactService setAtHereDescription: ",i)}}disableAtHere(){try{if(this.analyticsService.setFeatureConfig({feature:nt.COMMENT,config:{atHereEnabled:!1}}),this.atHereEnabled$.value===!1)return;this.atHereEnabled$.next(!1)}catch(e){this.loggingService.catch("Error in ContactService disableAtHere: ",e)}}getAtHereEnabled$(){return this.getContactListScopeForOrganizationUsers$().pipe(v(()=>this.checkContactListScopeForOrganizationUsers([D.ALL,D.DOCUMENT])?this.atHereEnabled$.asObservable():_(!1)))}getAtHereEnabled(){return this.checkContactListScopeForOrganizationUsers([D.ALL,D.DOCUMENT])?this.atHereEnabled$.value:!1}updateContactListScopeForOrganizationUsers(e){try{this.contactListScopeForOrganizationUsers$.next(e)}catch(i){this.loggingService.catch("Error in ContactService updateContactListScopeForOrganizationUsers: ",i)}}getContactListScopeForOrganizationUsers$(){return this.contactListScopeForOrganizationUsers$.asObservable()}getContactListScopeForOrganizationUsers(){return this.contactListScopeForOrganizationUsers$.value}checkContactListScopeForOrganizationUsers(e){return this.getContactListScopeForOrganizationUsers().some(i=>e.includes(i))}updateContactList(e,i){return z(this,null,function*(){try{this.analyticsService.trackEvent(Ft.Events.Contact.UPDATE_CONTACT_LIST_TRIGGERED,{contactsCount:e?.length,config:i}),this.usersService.setContactListUsers(e),this.customUserContacts$.next(e),this.customUserContactsConfig$.next(i)}catch(r){this.loggingService.catch("Error in CommentService updateContactList: ",r)}})}updateOrgList(e){try{let i=e?.orgList??[];this.analyticsService.trackEvent(Ft.Events.Contact.UPDATE_ORG_LIST_TRIGGERED,{orgCount:i?.length}),this.orgList$.next(i)}catch(i){this.loggingService.catch("Error in ContactService updateOrgList: ",i)}}getOrgList$(){return this.orgList$.asObservable()}getOrgList(){return this.orgList$.value}convert(e){try{if(e?.options){let{documentId:i,organizationId:r}=this.docService.getServerId(e?.options);e.options=k(m({},e?.options),{documentId:i,organizationId:r})}return this}catch(i){return this.loggingService.catch("Error in ContactService convert: ",i),this}}getContactList$(){try{return this.authService.getUser$().pipe(v(e=>e?tt([this.userOrganizationContacts$.asObservable(),this.userFolderContacts$.asObservable(),this.userDocumentContacts$.asObservable(),this.userOrganizationGroups$.asObservable(),this.customUserContacts$.asObservable()]).pipe(S(([i,r,s,a,c])=>{let l={};l.organizationUsers=i?.map(h=>this.convertToClientUser(h)),l.folderUsers=r?.map(h=>this.convertToClientUser(h)),l.documentUsers=s?.map(h=>this.convertToClientUser(h)),l.updatedContactList=c?.map(h=>this.convertToClientUser(h));let d=[];return a?.forEach(h=>{let p=this.convertToClientUserGroup(h,l.organizationUsers||[]);p&&d.push(p)}),l.userGroups=d,l}),X(ot)):_(null)),Ot(e=>(this.loggingService.catch("Error in ContactService getContactList$: ",e),_(null))))}catch(e){return this.loggingService.catch("Error in ContactService getContactList$: ",e),_(null)}}convertToClientUserGroup(e,i){try{let r={groupId:e?.metadata?.clientGroupId,groupName:e?.metadata?.groupName,users:[]},s={};return i?.forEach(a=>{if(a?.userId){let c=w(a.userId);s[c]=a}}),Object.keys(e?.users??{}).forEach(a=>{s[a]&&r.users?.push(s[a])}),r}catch(r){return this.loggingService.catch("Error in ContactService convertToClientUserGroup: ",r),null}}convertToClientUser(e){try{return e&&(e=JSON.parse(JSON.stringify(e)),e?.clientGroupId&&(e.groupId=e.clientGroupId,delete e.clientGroupId),e?.clientOrganizationId&&(e.organizationId=e.clientOrganizationId,delete e.clientOrganizationId),e?.userSnippylyId&&delete e.userSnippylyId),e}catch(i){return this.loggingService.catch("Error in ContactService convertToClientUser: ",i),e}}getCustomUserContacts(){return this.customUserContacts$.value}getCustomUserContacts$(){return this.customUserContacts$.asObservable()}getCustomUserContactsConfig(){return this.customUserContactsConfig$.value}getCustomUserContactsConfig$(){return this.customUserContactsConfig$.asObservable()}};n.\u0275fac=function(i){return new(i||n)(P(io),P(zt),P(Nt),P(ro),P(no),P(Bt),P(J),P(ao),P(so),P(Ut))},n.\u0275prov=b({token:n,factory:n.\u0275fac,providedIn:"root"});let o=n;return o})();var fn=new Set,$s=50,fi=new Map,js=500,_r=!1;function $h(){try{if(_r)return;_r=!0,console.warn("[Velt] disableSafeEval() is deprecated and has no effect. Wireframe conditions (velt-if, velt-class) are always evaluated by the built-in safe evaluator; eval() is no longer used.")}catch{}}var le={user:"componentConfigSignal.appState.user",isUserAdmin:"componentConfigSignal.appState.isUserAdmin",isKnownUser:"componentConfigSignal.appState.isKnownUser",repliesUniqueUsers:"componentConfigSignal.appState.repliesUniqueUsers",annotation:"componentConfigSignal.data.annotation",annotations:"componentConfigSignal.data.annotations",allAnnotations:"componentConfigSignal.data.allAnnotations",ghostComment:"componentConfigSignal.data.ghostComment",selectedFiles:"parentLocalUIState.selectedFiles",invalidSelectedFiles:"parentLocalUIState.invalidSelectedFiles",selectedAttachments:"parentLocalUIState.selectedAttachments",editComment:"parentLocalUIState.editComment",editCommentIndex:"parentLocalUIState.editCommentIndex",assignTo:"componentConfigSignal.data.assignTo",selectedUserContacts:"componentConfigSignal.data.selectedUserContacts",agentName:"componentConfigSignal.data.annotation.agent.agentName",agentAvatar:"componentConfigSignal.data.annotation.agent.avatar",agentResultTitle:"componentConfigSignal.data.annotation.agent.result.title",localRecordedData:"parentLocalUIState.localRecordedData",customList:"componentConfigSignal.data.customList",toOrganizationUserGroup:"componentConfigSignal.data.toOrganizationUserGroup",taggedUserContacts:"componentConfigSignal.data.taggedUserContacts",taggedGroups:"componentConfigSignal.data.taggedGroups",attachmentsToDelete:"parentLocalUIState.attachmentsToDelete",customChipData:"componentConfigSignal.data.customChipData",selectedCustomChipSet:"componentConfigSignal.data.selectedCustomChipSet",currentDialogView:"componentConfigSignal.data.currentDialogView",sidebarMode:"parentLocalUIState.sidebarMode",inboxMode:"parentLocalUIState.inboxMode",dialogMode:"parentLocalUIState.dialogMode",inlineCommentMode:"parentLocalUIState.inlineCommentMode",inlineCommentSectionMode:"parentLocalUIState.inlineCommentSectionMode",focusedThreadMode:"parentLocalUIState.focusedThreadMode",isFocusedThreadEnabled:"parentLocalUIState.isFocusedThreadEnabled",pageModeComposer:"parentLocalUIState.pageModeComposer",darkMode:"parentLocalUIState.darkMode",variant:"parentLocalUIState.variant",disabled:"parentLocalUIState.disabled",commentPinSelected:"parentLocalUIState.commentPinSelected",fullExpanded:"parentLocalUIState.fullExpanded",commentDialogSelected:"parentLocalUIState.commentDialogSelected",readOnly:"parentLocalUIState.readOnly",dialogShadowDOM:"parentLocalUIState.dialogShadowDOM",locationVersion:"parentLocalUIState.locationVersion",composerPosition:"parentLocalUIState.composerPosition",dialogOpenedInSidebar:"parentLocalUIState.dialogOpenedInSidebar",expandOnSelection:"parentLocalUIState.expandOnSelection",selectedVisibility:"parentLocalUIState.selectedVisibility",selectedVisibilityUsers:"parentLocalUIState.selectedVisibilityUsers",containerComponentId:"componentConfigSignal.uiState.containerComponentId",isPrivateComment:"componentConfigSignal.uiState.isPrivateComment",assignToMenuOpened:"parentLocalUIState.assignToMenuOpened",showGhostCommentMessage:"componentConfigSignal.uiState.showGhostCommentMessage",showReplies:"componentConfigSignal.uiState.showReplies",collapsedComments:"componentConfigSignal.uiState.collapsedComments",collapsedRepliesPreview:"componentConfigSignal.uiState.collapsedRepliesPreview",showAllComments:"componentConfigSignal.uiState.showAllComments",composerContent:"parentLocalUIState.composerContent",composerContentHTML:"parentLocalUIState.composerContentHTML",composerInOpenState:"parentLocalUIState.composerInOpenState",composerMode:"componentConfigSignal.uiState.composerMode",multiThreadAnnotationId:"componentConfigSignal.uiState.multiThreadAnnotationId",maxReplyAvatars:"componentConfigSignal.uiState.maxReplyAvatars",showSuggestionModeActions:"componentConfigSignal.uiState.showSuggestionModeActions",uploadingAttachments:"componentConfigSignal.uiState.uploadingAttachments",playVideoInFullScreen:"componentConfigSignal.uiState.playVideoInFullScreen",commentDialogUniqueId:"componentConfigSignal.uiState.commentDialogUniqueId",recorderInitConfig:"componentConfigSignal.uiState.recorderInitConfig",isInputFocused:"componentConfigSignal.uiState.isInputFocused",showCommentButtons:"componentConfigSignal.uiState.showCommentButtons",isAutocompleteDropdownOpen:"componentConfigSignal.uiState.isAutocompleteDropdownOpen",bottomSheetMode:"componentConfigSignal.uiState.bottomSheetMode",commentComposerMode:"componentConfigSignal.uiState.commentComposerMode",shouldScrollToBottom:"componentConfigSignal.uiState.shouldScrollToBottom",deviceType:"componentConfigSignal.uiState.deviceType",showReplyComposer:"componentConfigSignal.uiState.showReplyComposer",reactionToolOpenIndex:"parentLocalUIState.reactionToolOpenIndex",openDropdownIndexValue:"parentLocalUIState.openDropdownIndexValue",hasReactionsByCommentId:"componentConfigSignal.uiState.hasReactionsByCommentId",newComment:"parentLocalUIState.composerContent",newCommentHTML:"parentLocalUIState.composerContentHTML",canResolveAnnotation:"componentConfigSignal.featureState.canResolveAnnotation",canUnresolveAnnotation:"componentConfigSignal.featureState.canUnresolveAnnotation",dialogSelectedByKnownUser:"componentConfigSignal.featureState.dialogSelectedByKnownUser",resolveStatusAccessAdminOnly:"componentConfigSignal.featureState.resolveStatusAccessAdminOnly",enableResolve:"componentConfigSignal.featureState.enableResolve",isPlanExpired:"componentConfigSignal.featureState.isPlanExpired",moderatorMode:"componentConfigSignal.featureState.moderatorMode",enableAutoCategorize:"componentConfigSignal.featureState.enableAutoCategorize",suggestionMode:"componentConfigSignal.featureState.suggestionMode",commentAcceptedStatus:"componentConfigSignal.featureState.commentAcceptedStatus",commentRejectedStatus:"componentConfigSignal.featureState.commentRejectedStatus",enableSignInButton:"componentConfigSignal.featureState.enableSignInButton",enableUpgradeButton:"componentConfigSignal.featureState.enableUpgradeButton",enableGhostCommentsMessage:"componentConfigSignal.featureState.enableGhostCommentsMessage",replyAvatars:"componentConfigSignal.featureState.replyAvatars",userMentions:"componentConfigSignal.featureState.userMentions",recordingSummaryEnabled:"componentConfigSignal.featureState.recordingSummaryEnabled",enableAttachment:"componentConfigSignal.featureState.enableAttachment",allowedFileTypes:"componentConfigSignal.featureState.allowedFileTypes",allowedRecordings:"componentConfigSignal.featureState.allowedRecordings",screenSharingSupported:"componentConfigSignal.featureState.screenSharingSupported",enterKeyToSubmit:"componentConfigSignal.featureState.enterKeyToSubmit",deleteOnBackspace:"componentConfigSignal.featureState.deleteOnBackspace",showScreenSizeInfo:"componentConfigSignal.uiState.showScreenSizeInfo",enableReactions:"componentConfigSignal.featureState.enableReactions",isInsidePdfViewer:"componentConfigSignal.featureState.isInsidePdfViewer",sidebarButtonOnCommentDialogVisible:"componentConfigSignal.uiState.sidebarButtonOnCommentDialogVisible",enableStatus:"componentConfigSignal.featureState.enableStatus",customStatusesShown:"componentConfigSignal.featureState.customStatusesShown",statusOptions:"componentConfigSignal.featureState.statusOptions",enablePriority:"componentConfigSignal.featureState.enablePriority",visibilityOptions:"componentConfigSignal.featureState.visibilityOptions",priorityOptions:"componentConfigSignal.featureState.priorityOptions",enableAssignment:"componentConfigSignal.featureState.enableAssignment",enableNotifications:"componentConfigSignal.featureState.enableNotifications",enableEdit:"componentConfigSignal.featureState.enableEdit",enableDelete:"componentConfigSignal.featureState.enableDelete",enablePrivateMode:"componentConfigSignal.featureState.enablePrivateMode",deleteThreadWithFirstComment:"componentConfigSignal.featureState.deleteThreadWithFirstComment",seenByUsers:"componentConfigSignal.featureState.seenByUsers",allowAssignment:"componentConfigSignal.featureState.enableAssignment",allowToggleNotification:"componentConfigSignal.featureState.enableNotifications",allowEdit:"componentConfigSignal.featureState.enableEdit",allowChangeCommentAccessMode:"componentConfigSignal.featureState.enablePrivateMode",notificationEnabled:"notificationEnabled",mainCommentId:"componentConfigSignal.data.annotation.comments.0.commentId",commentObj:"commentObj",commentIndex:"commentIndex",userContact:"selectorItem.contact",comment:"commentObj",commentAnnotation:"componentConfigSignal.data.annotation",commentAnnotations:"componentConfigSignal.data.annotations",context:"parentLocalUIState.context",focusedAnnotation:"focusedAnnotation",notification:"notification",unreadNotificationsForYou:"componentConfigSignal.data.unreadNotificationsForYou",notificationsPanelVisible:"componentConfigSignal.uiState.notificationsPanelVisible",notificationsForYouInSession:"componentConfigSignal.data.notificationsForYouInSession",notificationsInSession:"componentConfigSignal.data.notificationsInSession",notificationsByUserMap:"componentConfigSignal.data.notificationsByUserMap",notificationsByDocumentId:"componentConfigSignal.data.notificationsByDocumentId",notificationsByDate:"componentConfigSignal.data.notificationsByDate",currentDocumentName:"componentConfigSignal.data.currentDocumentName",settingsConfig:"componentConfigSignal.data.settingsConfig",settingsSelectedOption:"componentConfigSignal.data.settingsSelectedOption",selectedTab:"componentConfigSignal.uiState.selectedTab",tabConfig:"componentConfigSignal.uiState.tabConfig",TABS:"componentConfigSignal.uiState.TABS",tabPage:"componentConfigSignal.uiState.tabPage",pageSize:"componentConfigSignal.uiState.pageSize",panelOpenMode:"componentConfigSignal.uiState.panelOpenMode",settingsOpen:"componentConfigSignal.uiState.settingsOpen",settingsAccordionExpanded:"componentConfigSignal.uiState.settingsAccordionExpanded",settingsMutedAll:"componentConfigSignal.uiState.settingsMutedAll",settingsItemRecentlyClosed:"componentConfigSignal.uiState.settingsItemRecentlyClosed",settingsLayout:"componentConfigSignal.uiState.settingsLayout",tabCount:"componentConfigSignal.uiState.tabCount",usersExpanded:"componentConfigSignal.uiState.usersExpanded",documentExpanded:"componentConfigSignal.uiState.documentExpanded",shadowDom:"componentConfigSignal.uiState.shadowDom",settingsEnabled:"componentConfigSignal.featureState.settingsEnabled",selectedMinimalFilterDropdownOption:"selectedMinimalFilterDropdownOption",appliedFiltersCount:"appliedFiltersCount",filteredCommentAnnotationsCount:"filteredCommentAnnotationsCount",unreadCommentAnnotationCount:"unreadCommentAnnotationCount",isEnabled:"componentConfigSignal.featureState.isEnabled",allActivities:"componentConfigSignal.data.allActivities",filteredActivities:"componentConfigSignal.data.filteredActivities",groupedActivities:"componentConfigSignal.data.groupedActivities",virtualScrollItems:"componentConfigSignal.data.virtualScrollItems",activeFilter:"componentConfigSignal.data.activeFilter",availableFilters:"componentConfigSignal.data.availableFilters",isOpen:"componentConfigSignal.uiState.isOpen",expandedGroups:"componentConfigSignal.uiState.expandedGroups",defaultVisibleCount:"componentConfigSignal.uiState.defaultVisibleCount",filterDropdownOpen:"componentConfigSignal.uiState.filterDropdownOpen",activity:"activityRecord",activityRecord:"activityRecord",dateGroup:"dateGroup",filter:"filterOption",filterOption:"filterOption",isActive:"isActive",isExpanded:"isExpanded",remainingCount:"remainingCount",showAdder:"componentConfigSignal.uiState.showAdder",commentToolEnabled:"componentConfigSignal.uiState.commentToolEnabled",isUserAllowed:"componentConfigSignal.uiState.isUserAllowed",enableTextComments:"componentConfigSignal.uiState.enableTextComments",rewriterEnabled:"componentConfigSignal.uiState.rewriterEnabled",rewriterDefaultUIEnabled:"componentConfigSignal.uiState.rewriterDefaultUIEnabled",selectedWordsCount:"componentConfigSignal.data.selectedWordsCount",selectedCharactersCount:"componentConfigSignal.data.selectedCharactersCount",allowedElementIds:"componentConfigSignal.data.allowedElementIds",contextId:"componentConfigSignal.data.contextId",position:"componentConfigSignal.data.position",MIN_ALLOWED_WORDS_COUNT:"componentConfigSignal.uiState.MIN_ALLOWED_WORDS_COUNT",MIN_ALLOWED_CHARACTERS_COUNT:"componentConfigSignal.uiState.MIN_ALLOWED_CHARACTERS_COUNT",MAX_ALLOWED_CHARACTERS_COUNT:"componentConfigSignal.uiState.MAX_ALLOWED_CHARACTERS_COUNT",filteredAnnotations:"componentConfigSignal.data.filteredAnnotations",multiThreadCommentAnnotation:"componentConfigSignal.data.multiThreadCommentAnnotation",nonDraftCommentsCount:"componentConfigSignal.data.nonDraftCommentsCount",commentPinType:"componentConfigSignal.uiState.commentPinType",hideMultiThreadAnnotationComposer:"componentConfigSignal.uiState.hideMultiThreadAnnotationComposer",dialogVariant:"componentConfigSignal.uiState.dialogVariant",minimalFilter:"componentConfigSignal.uiState.minimalFilter",minimalFilterDropdownOpen:"componentConfigSignal.uiState.minimalFilterDropdownOpen",minimalActionsDropdownOpen:"componentConfigSignal.uiState.minimalActionsDropdownOpen",noCommentsFoundForAppliedFilters:"componentConfigSignal.uiState.noCommentsFoundForAppliedFilters",noCommentsFound:"componentConfigSignal.uiState.noCommentsFound",isSelected:"isSelected",composerCommentAnnotation:"componentConfigSignal.data.composerCommentAnnotation",statuses:"componentConfigSignal.data.statuses",skeletonLoading:"componentConfigSignal.uiState.skeletonLoading",filterState:"componentConfigSignal.uiState.filterState",sortState:"componentConfigSignal.uiState.sortState",isResolvedCommentsOnDomFilterSelected:"componentConfigSignal.uiState.isResolvedCommentsOnDomFilterSelected",resolvedCommentsOnDom:"componentConfigSignal.uiState.resolvedCommentsOnDom",selectedAnnotationsMap:"componentConfigSignal.uiState.selectedAnnotationsMap",selectedAnnotationsLocationMap:"componentConfigSignal.uiState.selectedAnnotationsLocationMap",composerVariant:"parentLocalUIState.composerVariant",multiThread:"parentLocalUIState.multiThread",commentPlaceholder:"parentLocalUIState.commentPlaceholder",replyPlaceholder:"parentLocalUIState.replyPlaceholder",composerPlaceholder:"parentLocalUIState.composerPlaceholder",editPlaceholder:"parentLocalUIState.editPlaceholder",editCommentPlaceholder:"parentLocalUIState.editCommentPlaceholder",editReplyPlaceholder:"parentLocalUIState.editReplyPlaceholder",targetElementId:"parentLocalUIState.targetElementId",folderId:"parentLocalUIState.folderId",veltFolderId:"parentLocalUIState.veltFolderId",clientDocumentId:"parentLocalUIState.clientDocumentId",documentId:"parentLocalUIState.documentId",locationId:"parentLocalUIState.locationId",contextOptions:"parentLocalUIState.contextOptions",messageTruncation:"parentLocalUIState.messageTruncation",messageTruncationLines:"parentLocalUIState.messageTruncationLines",unresolvedAnnotationsCount:"componentConfigSignal.data.unresolvedAnnotationsCount",unreadCount:"componentConfigSignal.data.unreadCount",commentBubbleTargetPinHover:"parentLocalUIState.commentBubbleTargetPinHover",openDialog:"parentLocalUIState.openDialog",showAvatar:"parentLocalUIState.showAvatar",commentCountType:"parentLocalUIState.commentCountType"},Hs=["user","annotation","annotations","allAnnotations","userContact","comment","commentAnnotation","commentAnnotations","recorderInitConfig","ghostComment","editComment","assignTo","customChipData","currentDialogView","context","focusedAnnotation","notification","selectedMinimalFilterDropdownOption","unreadNotificationsForYou","notificationsForYouInSession","notificationsInSession","notificationsByUserMap","notificationsByDocumentId","notificationsByDate","settingsConfig","settingsSelectedOption","settingsAccordionExpanded","tabConfig","tabPage","TABS","allActivities","filteredActivities","groupedActivities","virtualScrollItems","availableFilters","expandedGroups","activity","activityRecord","dateGroup","filter","filterOption","position","allowedElementIds","filteredAnnotations","multiThreadCommentAnnotation","composerCommentAnnotation","statuses","filterState","sortState","selectedAnnotationsMap","selectedAnnotationsLocationMap","contextOptions"],pi=(()=>{let n=class n{constructor(e,i,r,s,a){this.authService=e,this.serviceBook=i,this.loggingService=r,this.injector=s,this.docService=a,this.subscriptions=[],this.commonData$=new I({}),this.evaluateConditionTriggered=new B,this.conditionRegex=/\{(.*?)\}/g,this.extractedProps={},this.condition="",this.dataComponentConfigSignal=j({});try{this.subscriptions.push(this.authService.getUser$().subscribe(c=>{this.commonData$.next(k(m({},this.commonData$.value),{user:c}))})),this.subscriptions.push(this.serviceBook.observe(rt).pipe(E(Boolean),v(c=>c.getUnreadCommentAnnotationCountOnCurrentDocument$())).subscribe(c=>{this.commonData$.next(k(m({},this.commonData$.value),{unreadCommentAnnotationCount:c?.count||0}))})),this.subscriptions.push(this.serviceBook.observe(rt).pipe(E(Boolean),v(c=>c.getUnreadCommentCountOnCurrentDocument$())).subscribe(c=>{this.commonData$.next(k(m({},this.commonData$.value),{unreadCommentCount:c?.count||0}))})),this.subscriptions.push(this.docService.getUIState$().subscribe(c=>{this.commonData$.next(m(m({},this.commonData$.value),c))})),this.subscriptions.push(this.getCommonData().subscribe(c=>{this.dataComponentConfigSignal.update(l=>(l=m(m({},l),c),l)),this.executeConditionalClasses()})),this.subscriptions.push(this.evaluateConditionTriggered.subscribe(c=>{this.extractedProps=c.extractedProps,this.evaluateCondition(c.className,c.elementRef,c.condition)}))}catch(c){this.loggingService.catch("Error in DynamicDataService constructor: ",c)}}ngOnDestroy(){try{this.subscriptions.forEach(e=>e.unsubscribe())}catch(e){this.loggingService.catch("Error in DynamicDataService ngOnDestroy: ",e)}}getCommonData(){return this.commonData$.asObservable()}getModifiedPathBasedOnCondition(e,i){try{return Object.keys(i).forEach(r=>{i[r].path=this.modifyPathBasedOnCondition(r,e)}),i}catch(r){this.loggingService.catch("Error in DynamicDataService getModifiedPathBasedOnCondition: ",r)}}getComputedValues(e,i,r,s,a,c){try{Object.keys(r).forEach(l=>{let d;if(Le(e)?d=yi(()=>bi(e(),r[l].path)):d=yi(()=>bi(e,r[l].path)),Le(d()))Be(()=>{try{let h=d()();r[l].value=h,this.evaluateConditionTriggered.emit({extractedProps:r,className:s,elementRef:a,condition:c})}catch{}},{injector:this.injector});else{let h=d();r[l].value=h,this.evaluateConditionTriggered.emit({extractedProps:r,className:s,elementRef:a,condition:c})}})}catch(l){this.loggingService.catch("Error in DynamicDataService getComputedValues: ",l)}}modifyPathBasedOnCondition(e,i){try{let r=e.match(/^([^\.\[]+)/),s=r?r[1]:e,a=e.slice(s.length);if(le[e])return le[e];if(["commentDialogOptionsDropdownConfigSignal","commentDialogStatusDropdownConfigSignal"].includes(s)&&a.startsWith(".")){let l=a.slice(1),d=l.match(/^([^\.\[]+)/),h=d?d[1]:l,p=l.slice(h.length);return le[h]?le[h]+p:"componentConfigSignal."+l}if(s&&i&&typeof i=="function"){let l=i();if(l&&s in l){let h=e.match(/\[(.*?)\]/);if(h&&h[1]){let p=h[1];if(p.includes(".")){let f=p.split(".")[0];if(le[f]){let g=p.replace(f,le[f]);return e.replace(`[${p}]`,`[${g}]`)}return f&&l&&f in l?e:e.replace(`[${p}]`,`[componentConfigSignal.${p}]`)}}return e}let d=l?.componentConfigSignal;if(d&&typeof d=="function"){let h=d();if(h&&s in h)return"componentConfigSignal."+e}}return le[s]?Hs.includes(s)?le[s]+a:le[s]:"componentConfigSignal."+e}catch(r){return this.loggingService.catch("Error in DynamicDataService modifyPathBasedOnCondition: ",r),e}}applyConditionalClasses(e,i){try{this.elementRef=e,this.data=i}catch(r){this.loggingService.catch("Error in DynamicDataService applyConditionalClasses: ",r)}}executeConditionalClasses(){try{let e=this.getHostElementAttributes(this.elementRef),r=[...Object.keys(e).filter(s=>s.startsWith("velt-class-")).map(s=>({name:s,value:e[s]}))];if(e["velt-class"]){let s=e["velt-class"],a=/'([^']+)':\s*([^,]+)(?:,|$)/g,c=[],l=0,d=100,h;for(;(h=a.exec(s))!==null;){if(l++>d){this.loggingService.catch("Too many class definitions detected.");break}if(h.length<3)continue;let[,p,f]=h;!p||!f||p.split(" ").forEach(g=>{g.trim()&&c.push({name:`velt-class-${g.trim()}`,value:f.trim()})})}r=[...r,...c]}this.data&&typeof this.data=="object"&&Object.keys(this.data).forEach(s=>{this.updateDataComponentConfigSignal(s,this.data[s])}),r.forEach(s=>{let a=s.name.replace("velt-class-","");this.condition=s.value,this.condition&&(this.extractProps(),this.extractedProps=this.getModifiedPathBasedOnCondition(this.dataComponentConfigSignal,this.extractedProps),this.getComputedValues(this.dataComponentConfigSignal,this.evaluateCondition,this.extractedProps,a,this.elementRef,s.value))})}catch(e){this.loggingService.catch("Error in DynamicDataService applyConditionalClasses: ",e)}}updateDataComponentConfigSignal(e,i){try{e==="dataComponentConfigSignal"?this.dataComponentConfigSignal.set(i):this.dataComponentConfigSignal.update(r=>k(m({},r),{[e]:i}))}catch(r){this.loggingService.catch("Error in DataComponent updateDataComponentConfigSignal: ",r)}}extractProps(){try{this.extractedProps={},this.conditionRegex.lastIndex=0;let e;for(;(e=this.conditionRegex.exec(this.condition))!==null;){let i=e[1];this.extractedProps[i]={value:null,path:null,isDynamicPath:this.hasDynamicParts(i)}}}catch(e){this.loggingService.catch("Error in DynamicDataService extractProps: ",e)}}hasDynamicParts(e){try{let i=/\[[^\]'"]*[^\]'"]\]/.test(e),r=/\[[^[\]]*[\.\[][^[\]]*\]/.test(e);return i||r}catch(i){return this.loggingService.catch("Error checking for dynamic path: ",i),!1}}evaluateCondition(e,i,r){try{if(r){let s=this.extractedProps,a=this.evaluateConditionTemplate(r,s);return e&&i&&(a?this.setHostElementClasses(i,e):this.removeHostElementClasses(i,e)),a}return!1}catch(s){return this.loggingService.catch("Error in IfComponent evaluateCondition: ",s),!1}}evaluateConditionTemplate(e,i){try{if(!e)return!1;let r=this.getConditionSkeleton(e);r.unsupported&&this.reportUnsupportedCondition(e);let s=[];for(let a of r.parts)if("slot"in a)s.push(this.toConditionValueToken(i?.[a.slot]));else if("template"in a){let c=a.template.map(l=>typeof l=="string"?l:this.toConditionValueText(i?.[l.slot])).join("");s.push({type:"string",value:c})}else s.push(...a.tokens);return this.evaluateTokens(s)}catch(r){return this.loggingService.catch("Error in DynamicDataService evaluateConditionTemplate: ",r),!1}}safeEval(e){try{let i=this.tokenize((e||"").trim());return this.evaluateTokens(i)}catch(i){return this.loggingService.catch("safeEval error",i),!1}}getConditionSkeleton(e){let i=fi.get(e);if(i)return i;let r={unsupported:!1},s=[],a="",c=()=>{a&&(s.push({tokens:this.tokenize(a,r)}),a="")},l=0;for(;l<e.length;){let h=e[l];if(h==="{"&&e.indexOf("}",l+1)!==-1){let p=e.indexOf("}",l+1);c(),s.push({slot:e.slice(l+1,p)}),l=p+1;continue}if(h==='"'||h==="'"){c();let p=[],f="",g=!1;for(l++;l<e.length&&e[l]!==h;)if(e[l]==="\\"&&l+1<e.length)f+=e[l+1],l+=2;else if(e[l]==="{"&&e.indexOf("}",l+1)!==-1){let C=e.indexOf("}",l+1);p.push(f),f="",p.push({slot:e.slice(l+1,C)}),g=!0,l=C+1}else f+=e[l],l++;l++,p.push(f),g?s.push({template:p}):s.push({tokens:[{type:"string",value:p.join("")}]});continue}a+=h,l++}c();let d={parts:s,unsupported:r.unsupported};return fi.size>=js&&fi.clear(),fi.set(e,d),d}toConditionValueText(e){try{if(!e||e.value===void 0)return"false";let i=e.value;return i===null?"null":typeof i=="function"?"false":typeof i=="object"?"true":String(i)}catch(i){return this.loggingService.catch("Error in DynamicDataService toConditionValueText: ",i),"false"}}toConditionValueToken(e){try{if(!e||e.value===void 0)return{type:"boolean",value:!1};let i=e.value;return typeof i=="string"?{type:"string",value:i}:typeof i=="number"?{type:"number",value:i}:typeof i=="boolean"?{type:"boolean",value:i}:i===null?{type:"null",value:null}:typeof i=="object"?{type:"boolean",value:!0}:typeof i=="function"?{type:"boolean",value:!1}:{type:"string",value:String(i)}}catch(i){return this.loggingService.catch("Error in DynamicDataService toConditionValueToken: ",i),{type:"boolean",value:!1}}}reportUnsupportedCondition(e){try{if(fn.has(e)||fn.size>=$s)return;fn.add(e),console.warn("[Velt] A wireframe condition uses syntax that is not supported, so it may not give the answer you expect (for example arithmetic, negative numbers, property access or method calls, typeof, unquoted words). Supported: {placeholders}, quoted strings, numbers, true, false, null, undefined, ===, !==, ==, !=, <, >, <=, >=, &&, ||, !, parentheses. Condition: "+e)}catch(i){this.loggingService.catch("Error in DynamicDataService reportUnsupportedCondition: ",i)}}tokenize(e,i){try{if(!e||e.trim()==="")return[];let r=[],s=0;for(;s<e.length;){let a=e[s];if(/\s/.test(a)){s++;continue}if(a==='"'||a==="'"){let c=a,l="";for(s++;s<e.length;)if(e[s]==="\\"&&s+1<e.length)l+=e[s+1],s+=2;else if(e[s]===c){s++;break}else l+=e[s],s++;r.push({type:"string",value:l});continue}if(a==="("){r.push({type:"lparen",value:"("}),s++;continue}if(a===")"){r.push({type:"rparen",value:")"}),s++;continue}if(s<e.length-2&&e.substring(s,s+3)==="==="){r.push({type:"operator",value:"===",precedence:4}),s+=3;continue}if(s<e.length-2&&e.substring(s,s+3)==="!=="){r.push({type:"operator",value:"!==",precedence:4}),s+=3;continue}if(s<e.length-1&&e.substring(s,s+2)==="&&"){r.push({type:"operator",value:"&&",precedence:2}),s+=2;continue}if(s<e.length-1&&e.substring(s,s+2)==="||"){r.push({type:"operator",value:"||",precedence:1}),s+=2;continue}if(s<e.length-1&&e.substring(s,s+2)==="<="){r.push({type:"operator",value:"<=",precedence:4}),s+=2;continue}if(s<e.length-1&&e.substring(s,s+2)===">="){r.push({type:"operator",value:">=",precedence:4}),s+=2;continue}if(s<e.length-1&&e.substring(s,s+2)==="=="){r.push({type:"operator",value:"==",precedence:4}),s+=2;continue}if(s<e.length-1&&e.substring(s,s+2)==="!="){r.push({type:"operator",value:"!=",precedence:4}),s+=2;continue}if(a==="!"){r.push({type:"unary",value:"!",precedence:5}),s++;continue}if(a==="<"){r.push({type:"operator",value:"<",precedence:4}),s++;continue}if(a===">"){r.push({type:"operator",value:">",precedence:4}),s++;continue}if(/[a-zA-Z0-9._]/.test(a)){let c="";for(;s<e.length&&/[a-zA-Z0-9._]/.test(e[s]);)c+=e[s],s++;/^-?\d+(\.\d+)?$/.test(c)?r.push({type:"number",value:parseFloat(c)}):c==="true"||c==="false"?r.push({type:"boolean",value:c==="true"}):c==="null"?r.push({type:"null",value:null}):c==="undefined"?r.push({type:"undefined",value:void 0}):(i&&(i.unsupported=!0),r.push({type:"identifier",value:c}));continue}i&&(i.unsupported=!0),s++}return r}catch(r){return this.loggingService.catch("tokenize error",r),[]}}evaluateTokens(e){try{if(!e||e.length===0)return!1;let i=this.infixToPostfix(e);return this.evaluatePostfix(i)}catch(i){return this.loggingService.catch("evaluateTokens error",i),!1}}infixToPostfix(e){try{let i=[],r=[];for(let s of e)if(s.type==="string"||s.type==="number"||s.type==="boolean"||s.type==="null"||s.type==="undefined"||s.type==="identifier")i.push(s);else if(s.type==="unary")r.push(s);else if(s.type==="operator"){for(;r.length>0;){let a=r[r.length-1];if(a.type==="lparen"||a.precedence!==void 0&&a.precedence<s.precedence)break;i.push(r.pop())}r.push(s)}else if(s.type==="lparen")r.push(s);else if(s.type==="rparen"){for(;r.length>0&&r[r.length-1].type!=="lparen";)i.push(r.pop());r.length>0&&r.pop()}for(;r.length>0;){let s=r.pop();s.type!=="lparen"&&s.type!=="rparen"&&i.push(s)}return i}catch(i){return this.loggingService.catch("infixToPostfix error",i),[]}}evaluatePostfix(e){try{let i=[];for(let r of e)if(r.type==="string"||r.type==="number"||r.type==="boolean"||r.type==="null"||r.type==="undefined"||r.type==="identifier")i.push(r.value);else if(r.type==="unary"){if(i.length>=1){let s=i.pop();r.value==="!"&&i.push(!this.isTruthy(s))}}else if(r.type==="operator"&&i.length>=2){let s=i.pop(),a=i.pop();r.value==="&&"?i.push(this.isTruthy(a)&&this.isTruthy(s)):r.value==="||"?i.push(this.isTruthy(a)||this.isTruthy(s)):i.push(this.compare(a,s,r.value))}return i.length===1?this.isTruthy(i[0]):!1}catch(i){return this.loggingService.catch("evaluatePostfix error",i),!1}}parseValue(e){try{let i=e.trim();return i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'")?i.substring(1,i.length-1):/^-?\d+(\.\d+)?$/.test(i)?parseFloat(i):i==="true"?!0:i==="false"?!1:i==="null"?null:i==="undefined"?void 0:i}catch(i){return this.loggingService.catch("parseValue error",i),e}}compare(e,i,r){try{switch(r){case"===":return e===i;case"!==":return e!==i;case"==":return e==i;case"!=":return e!=i;case"<":return e<i;case">":return e>i;case"<=":return e<=i;case">=":return e>=i;default:return!1}}catch(s){return this.loggingService.catch("compare error",s),!1}}isTruthy(e){try{return e==null||e===""||e==="false"?!1:e==="true"?!0:typeof e=="number"?e!==0&&!Number.isNaN(e):!!e}catch(i){return this.loggingService.catch("isTruthy error",i),!1}}getHostElementAttributes(e){try{let i=e,r={};for(let s of i.attributes)r[s.name]=s.value;return r}catch{return{}}}setHostElementClasses(e,i){try{e.classList.add(i)}catch{}}removeHostElementClasses(e,i){try{e.classList.remove(i)}catch{}}};n.\u0275fac=function(i){return new(i||n)(P(zt),P(Ut),P(J),P(O),P(Bt))},n.\u0275prov=b({token:n,factory:n.\u0275fac,providedIn:"root"});let o=n;return o})();var yr=(()=>{let n=class n{constructor(e,i){this.loggingService=e,this.configService=i,this.darkMode$=new I(!1)}setDarkMode(e){try{let i=document.documentElement;if(!i)return;e?i.setAttribute(re.ATTRIBUTES.VELT_THEME,"dark"):i.removeAttribute(re.ATTRIBUTES.VELT_THEME),this.darkMode$.next(e)}catch(i){this.loggingService.catch("Error in theme service setDarkMode: ",i)}}getDarkMode$(){return this.darkMode$.asObservable()}updateListenerOnConfigChange(){try{this.configService.getConfig$().subscribe(e=>{if(e&&e.usePrefersColorScheme){this.enablePrefersColorScheme();return}this.disablePrefersColorScheme()})}catch(e){this.loggingService.catch("Error in theme service updateListenerOnConfigChange: ",e)}}enablePrefersColorScheme(){try{if(this.disablePrefersColorScheme(),!window.matchMedia)return;this.darkModeQuery=window.matchMedia("(prefers-color-scheme: dark)"),this.setDarkMode(this.darkModeQuery.matches),this.darkModeQueryListener=e=>{this.setDarkMode(e.matches)},this.darkModeQuery.addEventListener("change",this.darkModeQueryListener)}catch(e){this.loggingService.catch("Error in theme service enablePrefersColorScheme: ",e)}}disablePrefersColorScheme(){try{this.darkModeQuery&&this.darkModeQueryListener&&this.darkModeQuery.removeEventListener("change",this.darkModeQueryListener)}catch(e){this.loggingService.catch("Error in theme service disablePrefersColorScheme: ",e)}}};n.\u0275fac=function(i){return new(i||n)(P(J),P(Nt))},n.\u0275prov=b({token:n,factory:n.\u0275fac,providedIn:"root"});let o=n;return o})();var Cr=(()=>{let n=class n{set veltIf(e){try{e&&this.setIfCondition(e)}catch(i){this._loggingService.catch("Error in BaseComponent set veltIf:",i)}}veltStop(e){zo(e)}veltHandled(e){return Bo(e)}constructor(e,i,r){this._elementRef=e,this._dynamicDataService=i,this._loggingService=r,this.componentConfigSignal=j({}),this.veltElement=!0,this.conditionSignal=j(null)}initializeComponentConfigSignal(e){try{this.componentConfigSignal.set(e)}catch(i){this._loggingService.catch("Error in BaseComponent initializeComponentConfigSignal:",i)}}ngOnInit(){try{this._dynamicDataService.applyConditionalClasses(this._elementRef?.nativeElement,{componentConfigSignal:this.componentConfigSignal})}catch(e){this._loggingService.catch("Error in BaseComponent ngOnInit:",e)}}ngOnDestroy(){}setIfCondition(e){try{this.conditionSignal.set(e)}catch(i){this._loggingService.catch("Error in BaseComponent setIfCondition:",i)}}};n.\u0275fac=function(i){return new(i||n)(Y(R),Y(pi),Y(J))},n.\u0275cmp=G({type:n,selectors:[["app-base"]],hostVars:1,hostBindings:function(i,r){i&2&&ue("data-velt-element",r.veltElement)},inputs:{componentConfigSignal:"componentConfigSignal",template:"template",wireframe:"wireframe",veltIf:"veltIf"},standalone:!1,decls:0,vars:0,template:function(i,r){},encapsulation:2});let o=n;return o})();var nu=(()=>{let n=class n extends Cr{onDarkModeChange(){return this.darkModeSubject$.asObservable()}constructor(e,i,r,s,a,c,l){super(e,c,l),this._elementRef=e,this._themeService=i,this._changeDetector=r,this._featureService=s,this._componentDarkModeObservable=a,this._componentDarkMode=null,this._globalDarkMode=!1,this._featureDarkMode=!1,this._themeSubscriptions=[],this._darkMode=!1,this.darkMode=!1,this.darkModeSubject$=new I(!1);try{if(this._themeSubscriptions.push(this._themeService.getDarkMode$().subscribe(d=>{this._globalDarkMode=d,this.setDarkMode()})),this._featureService){let d=this._featureService;typeof d.getCommentContainerDarkMode=="function"?this._themeSubscriptions.push(d.getCommentContainerDarkMode().subscribe(h=>{this._featureDarkMode=h,this.setDarkMode()})):typeof d.getDarkMode$=="function"&&this._themeSubscriptions.push(d.getDarkMode$().subscribe(h=>{h!==null&&(this._featureDarkMode=h),this.setDarkMode()}))}this._componentDarkModeObservable&&this._componentDarkModeObservable instanceof ye&&this._themeSubscriptions.push(this._componentDarkModeObservable.subscribe(d=>{this._componentDarkMode=d,this.setDarkMode()}))}catch{}}ngOnInit(){super.ngOnInit()}ngOnChanges(e){try{if(e._darkMode){let i=e._darkMode.currentValue;typeof i=="string"&&(i=i==="true"),this._componentDarkMode=i,this.setDarkMode()}}catch{}}setComponentDarkMode(e){try{this._componentDarkMode=e,this.setDarkMode()}catch{}}setDarkMode(){try{this._componentDarkMode===null?this._featureDarkMode?this.darkMode=!0:this.darkMode=!!this._globalDarkMode:this.darkMode=!!this._componentDarkMode,this.darkMode?this._elementRef.nativeElement.hasAttribute("dark")||this._elementRef.nativeElement.setAttribute("dark",""):this._elementRef.nativeElement.hasAttribute("dark")&&this._elementRef.nativeElement.removeAttribute("dark"),this.darkModeSubject$.next(this.darkMode),this._changeDetector&&this._changeDetector.markForCheck()}catch{}}ngOnDestroy(){try{super.ngOnDestroy(),this._themeSubscriptions.forEach(e=>{e.unsubscribe()})}catch{}}};n.\u0275fac=function(i){return new(i||n)(Y(R),Y(yr),Y(Ve),Y("FeatureService",8),Y(ye),Y(pi),Y(J))},n.\u0275cmp=G({type:n,selectors:[["app-themed"]],inputs:{_darkMode:[0,"darkMode","_darkMode"]},standalone:!1,features:[W,ie],decls:0,vars:0,template:function(i,r){},encapsulation:2,changeDetection:0});let o=n;return o})();export{mo as a,Yt as b,ee as c,Wi as d,Yi as e,se as f,De as g,We as h,ae as i,po as j,Rr as k,Oe as l,go as m,Lr as n,Oi as o,wi as p,pe as q,He as r,we as s,Wt as t,ht as u,Ae as v,ge as w,Ke as x,ti as y,ke as z,Pi as A,Ui as B,Xe as C,ko as D,ft as E,To as F,Li as G,Vr as H,pt as I,Gr as J,Wr as K,Oc as L,Mo as M,wc as N,Xr as O,Ac as P,Zr as Q,Rc as R,kc as S,Tc as T,xc as U,Lo as V,No as W,zo as X,Bo as Y,Nc as Z,zc as _,Bc as $,Vc as aa,$c as ba,jc as ca,Hc as da,Gc as ea,Wc as fa,Vo as ga,Yc as ha,Kc as ia,as as ja,Ho as ka,Xi as la,Zo as ma,en as na,sn as oa,an as pa,Fd as qa,Ud as ra,rn as sa,cn as ta,nn as ua,on as va,ir as wa,Je as xa,hr as ya,hi as za,Ts as Aa,xs as Ba,Ps as Ca,Ms as Da,Ls as Ea,Ph as Fa,$h as Ga,pi as Ha,yr as Ia,Cr as Ja,nu as Ka};