@veltdev/sdk-staging 6.0.36 → 6.0.38

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 (60) hide show
  1. package/chunk-2BTM4CFE.js +1 -0
  2. package/{chunk-K7FVY4KN.js → chunk-2QEJSDDK.js} +1 -1
  3. package/{chunk-4GZINSJB.js → chunk-3C3NVOFE.js} +1 -1
  4. package/{chunk-XFGIV7R7.js → chunk-3INUN5X4.js} +1 -1
  5. package/chunk-3WXPNBX5.js +6 -0
  6. package/{chunk-ENKKDM6C.js → chunk-5VC7CCBD.js} +1 -1
  7. package/{chunk-CFURN7DG.js → chunk-5VEPPJ7L.js} +1 -1
  8. package/{chunk-WFVUCWNJ.js → chunk-5YQBTUDX.js} +1 -1
  9. package/{chunk-3AXVWFWQ.js → chunk-6GGZZ4AU.js} +1 -1
  10. package/{chunk-NX5SHREB.js → chunk-7GOPVFGG.js} +1 -1
  11. package/{chunk-XQXBBGCT.js → chunk-A67RL2PN.js} +1 -1
  12. package/{chunk-NHKDUTEY.js → chunk-BGHA3HPN.js} +1 -1
  13. package/{chunk-YGZDTBCO.js → chunk-CGUTLGPR.js} +1 -1
  14. package/{chunk-GSIBDB7Y.js → chunk-CRZUWE4H.js} +1 -1
  15. package/{chunk-YFONDDLR.js → chunk-EUGFBHET.js} +1 -1
  16. package/{chunk-SPPCMWKD.js → chunk-FABIYF77.js} +1 -1
  17. package/{chunk-YBUWC65O.js → chunk-FQKWEEFD.js} +1 -1
  18. package/{chunk-5OVPOQXM.js → chunk-J63WRUBY.js} +1 -1
  19. package/{chunk-FPLYS2CV.js → chunk-KDR7F33G.js} +1 -1
  20. package/{chunk-VI5OSZIQ.js → chunk-KSHKS6KZ.js} +1 -1
  21. package/{chunk-W7JRUP3U.js → chunk-KXR5HWPR.js} +1 -1
  22. package/{chunk-YUBQ7BXI.js → chunk-LURMWRN2.js} +1 -1
  23. package/{chunk-ZJPFBKE2.js → chunk-LYWPFYXA.js} +1 -1
  24. package/{chunk-UW7EL7NW.js → chunk-MU4JCWH6.js} +1 -1
  25. package/{chunk-6456EREF.js → chunk-MYDCS2BE.js} +1 -1
  26. package/{chunk-HJVIKKUT.js → chunk-OPZBNZVO.js} +1 -1
  27. package/{chunk-VGGU4K4I.js → chunk-PHUEJCYV.js} +1 -1
  28. package/{chunk-XM5YSR4I.js → chunk-QTMY2244.js} +1 -1
  29. package/{chunk-74M4LLJN.js → chunk-RNFB3ETM.js} +1 -1
  30. package/{chunk-W3PIDHPP.js → chunk-UM4DCTY2.js} +1 -1
  31. package/{chunk-OB5UEYMT.js → chunk-UW6RLILR.js} +1 -1
  32. package/{chunk-E4ZYSIOW.js → chunk-VHPIMIJS.js} +1 -1
  33. package/{chunk-C3KNUFAS.js → chunk-WHDXUE5R.js} +1 -1
  34. package/{chunk-JU4BFBOY.js → chunk-X7MTAUNM.js} +1 -1
  35. package/{chunk-H6I5XVHO.js → chunk-XCL6Y7ID.js} +1 -1
  36. package/{chunk-7CAYUDV6.js → chunk-XUBWZTRK.js} +24 -24
  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 +6 -6
  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 +2 -2
  59. package/chunk-5K23BJBD.js +0 -1
  60. package/chunk-WAIRKNL2.js +0 -6
@@ -0,0 +1,6 @@
1
+ import{D as ro,E as Bt,p as oo}from"./chunk-UM4DCTY2.js";import{$a as kn,$c as Lt,$e as Yn,Aa as An,Ac as $n,Ba as Rt,Bc as q,Bj as Se,Bk as zt,Cb as Un,Cj as je,D as Et,Db as Nn,Dc as Mt,Dj as Ie,E,Ee as D,Ej as at,F as Ot,Fb as Tt,Fc as Vn,G as wt,Gb as xt,Gj as x,Ha as Rn,Hb as Pt,He as re,Ia as B,Ii as Ut,J as At,Ja as U,Jj as to,K as te,Ka as ne,Lb as zn,M as X,Mb as nt,Mf as Xn,Na as be,O as yn,Oj as bi,Pa as oe,Qa as Fe,Qf as yi,R as Cn,Ra as Y,S as bn,Sg as qn,Ta as Ue,U as Ce,Ua as mi,Ud as jn,V as v,Vd as Hn,W as de,Wa as G,X as Sn,Xa as N,Y as Q,Ya as L,_ as In,_a as W,_c as H,_e as Wn,_f as w,_i as st,a as m,aa as Dn,ab as kt,ac as ze,ai as Ci,b as k,ba as b,ca as F,da as A,db as Ne,dg as Zn,di as rt,dk as Si,ea as T,ee as Gn,fa as h,fb as ue,fi as Jn,g as z,gk as io,h as K,ha as Me,i as ye,j as mn,k as y,l as I,n as _n,na as O,o as vn,oa as M,ob as Tn,oj as Nt,pa as En,pb as xn,pj as eo,q as St,qj as J,r as _,ra as Le,rb as Pn,re as ot,rf as Kn,rj as Ve,s as It,sa as j,sb as Mn,tb as Ln,tc as Bn,ua as On,uc as vi,v as S,va as wn,vc as Be,vg as Qn,w as it,wa as ie,wk as no,x as Dt,xa as he,xe as Ft,ya as R,yb as _i,za as gi,zb as Fn,zc as $e}from"./chunk-XUBWZTRK.js";function se(n,i=0){return so(n)?Number(n):arguments.length===2?i:0}function so(n){return!isNaN(parseFloat(n))&&!isNaN(Number(n))}function De(n){return n instanceof R?n.nativeElement:n}var br=new A("cdk-dir-doc",{providedIn:"root",factory:Sr});function Sr(){return h(M)}var Ir=/^(ar|ckb|dv|he|iw|fa|nqo|ps|sd|ug|ur|yi|.*[-_](Adlm|Arab|Hebr|Nkoo|Rohg|Thaa))(?!.*[-_](Latn|Cyrl)($|-|_))($|-|_)/i;function ao(n){let i=n?.toLowerCase()||"";return i==="auto"&&typeof navigator<"u"&&navigator?.language?Ir.test(navigator.language)?"rtl":"ltr":i==="rtl"?"rtl":"ltr"}var ae=(()=>{class n{get value(){return this.valueSignal()}valueSignal=j("ltr");change=new B;constructor(){let e=h(br,{optional:!0});if(e){let t=e.body?e.body.dir:null,o=e.documentElement?e.documentElement.dir:null;this.valueSignal.set(ao(t||o||"ltr"))}}ngOnDestroy(){this.change.complete()}static \u0275fac=function(t){return new(t||n)};static \u0275prov=b({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var Z=(function(n){return n[n.NORMAL=0]="NORMAL",n[n.NEGATED=1]="NEGATED",n[n.INVERTED=2]="INVERTED",n})(Z||{}),$t,Ee;function Vt(){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 n=Element.prototype.scrollTo;n?Ee=!/\{\s*\[native code\]\s*\}/.test(n.toString()):Ee=!1}}return Ee}function He(){if(typeof document!="object"||!document)return Z.NORMAL;if($t==null){let n=document.createElement("div"),i=n.style;n.dir="rtl",i.width="1px",i.overflow="auto",i.visibility="hidden",i.pointerEvents="none",i.position="absolute";let e=document.createElement("div"),t=e.style;t.width="2px",t.height="1px",n.appendChild(e),document.body.appendChild(n),$t=Z.NORMAL,n.scrollLeft===0&&(n.scrollLeft=1,$t=n.scrollLeft===0?Z.NEGATED:Z.INVERTED),n.remove()}return $t}var fe=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=N({type:n});static \u0275inj=F({})}return n})();var jt=class{};function co(n){return n&&typeof n.connect=="function"&&!(n instanceof mn)}var Ht=class extends jt{_data;constructor(i){super(),this._data=i}connect(){return It(this._data)?this._data:_(this._data)}disconnect(){}},ct=(function(n){return n[n.REPLACED=0]="REPLACED",n[n.INSERTED=1]="INSERTED",n[n.MOVED=2]="MOVED",n[n.REMOVED=3]="REMOVED",n})(ct||{}),Ii=new A("_ViewRepeater"),Gt=class{viewCacheSize=20;_viewCache=[];applyChanges(i,e,t,o,r){i.forEachOperation((s,a,c)=>{let l,d;if(s.previousIndex==null){let u=()=>t(s,a,c);l=this._insertView(u,c,e,o(s)),d=l?ct.INSERTED:ct.REPLACED}else c==null?(this._detachAndCacheView(a,e),d=ct.REMOVED):(l=this._moveView(a,c,e,o(s)),d=ct.MOVED);r&&r({context:l?.context,operation:d,record:s})})}detach(){for(let i of this._viewCache)i.destroy();this._viewCache=[]}_insertView(i,e,t,o){let r=this._insertViewFromCache(e,t);if(r){r.context.$implicit=o;return}let s=i();return t.createEmbeddedView(s.templateRef,s.context,s.index)}_detachAndCacheView(i,e){let t=e.detach(i);this._maybeCacheView(t,e)}_moveView(i,e,t,o){let r=t.get(i);return t.move(r,e),r.context.$implicit=o,r}_maybeCacheView(i,e){if(this._viewCache.length<this.viewCacheSize)this._viewCache.push(i);else{let t=e.indexOf(i);t===-1?i.destroy():e.remove(t)}}_insertViewFromCache(i,e){let t=this._viewCache.pop();return t&&e.insert(t,i),t||null}};var Dr=["contentWrapper"],Er=["*"],uo=new A("VIRTUAL_SCROLL_STRATEGY"),Di=class{_scrolledIndexChange=new y;scrolledIndexChange=this._scrolledIndexChange.pipe(X());_viewport=null;_itemSize;_minBufferPx;_maxBufferPx;constructor(i,e,t){this._itemSize=i,this._minBufferPx=e,this._maxBufferPx=t}attach(i){this._viewport=i,this._updateTotalContentSize(),this._updateRenderedRange()}detach(){this._scrolledIndexChange.complete(),this._viewport=null}updateItemAndBufferSize(i,e,t){t<e,this._itemSize=i,this._minBufferPx=e,this._maxBufferPx=t,this._updateTotalContentSize(),this._updateRenderedRange()}onContentScrolled(){this._updateRenderedRange()}onDataLengthChanged(){this._updateTotalContentSize(),this._updateRenderedRange()}onContentRendered(){}onRenderedOffsetChanged(){}scrollToIndex(i,e){this._viewport&&this._viewport.scrollToOffset(i*this._itemSize,e)}_updateTotalContentSize(){this._viewport&&this._viewport.setTotalContentSize(this._viewport.getDataLength()*this._itemSize)}_updateRenderedRange(){if(!this._viewport)return;let i=this._viewport.getRenderedRange(),e={start:i.start,end:i.end},t=this._viewport.getViewportSize(),o=this._viewport.getDataLength(),r=this._viewport.measureScrollOffset(),s=this._itemSize>0?r/this._itemSize:0;if(e.end>o){let c=Math.ceil(t/this._itemSize),l=Math.max(0,Math.min(s,o-c));s!=l&&(s=l,r=l*this._itemSize,e.start=Math.floor(s)),e.end=Math.max(0,Math.min(o,e.start+c))}let a=r-e.start*this._itemSize;if(a<this._minBufferPx&&e.start!=0){let c=Math.ceil((this._maxBufferPx-a)/this._itemSize);e.start=Math.max(0,e.start-c),e.end=Math.min(o,Math.ceil(s+(t+this._minBufferPx)/this._itemSize))}else{let c=e.end*this._itemSize-(r+t);if(c<this._minBufferPx&&e.end!=o){let l=Math.ceil((this._maxBufferPx-c)/this._itemSize);l>0&&(e.end=Math.min(o,e.end+l),e.start=Math.max(0,Math.floor(s-this._minBufferPx/this._itemSize)))}}this._viewport.setRenderedRange(e),this._viewport.setRenderedContentOffset(Math.round(this._itemSize*e.start)),this._scrolledIndexChange.next(Math.floor(s))}};function Or(n){return n._scrollStrategy}var wr=(()=>{class n{get itemSize(){return this._itemSize}set itemSize(e){this._itemSize=se(e)}_itemSize=20;get minBufferPx(){return this._minBufferPx}set minBufferPx(e){this._minBufferPx=se(e)}_minBufferPx=100;get maxBufferPx(){return this._maxBufferPx}set maxBufferPx(e){this._maxBufferPx=se(e)}_maxBufferPx=200;_scrollStrategy=new Di(this.itemSize,this.minBufferPx,this.maxBufferPx);ngOnChanges(){this._scrollStrategy.updateItemAndBufferSize(this.itemSize,this.minBufferPx,this.maxBufferPx)}static \u0275fac=function(t){return new(t||n)};static \u0275dir=L({type:n,selectors:[["cdk-virtual-scroll-viewport","itemSize",""]],inputs:{itemSize:"itemSize",minBufferPx:"minBufferPx",maxBufferPx:"maxBufferPx"},features:[ze([{provide:uo,useFactory:Or,deps:[Dn(()=>n)]}]),ie]})}return n})(),Ar=20,lt=(()=>{class n{_ngZone=h(U);_platform=h(H);_renderer=h(oe).createRenderer(null,null);_cleanupGlobalListener;constructor(){}_scrolled=new y;_scrolledCount=0;scrollContainers=new Map;register(e){this.scrollContainers.has(e)||this.scrollContainers.set(e,e.elementScrolled().subscribe(()=>this._scrolled.next(e)))}deregister(e){let t=this.scrollContainers.get(e);t&&(t.unsubscribe(),this.scrollContainers.delete(e))}scrolled(e=Ar){return this._platform.isBrowser?new ye(t=>{this._cleanupGlobalListener||(this._cleanupGlobalListener=this._ngZone.runOutsideAngular(()=>this._renderer.listen("document","scroll",()=>this._scrolled.next())));let o=e>0?this._scrolled.pipe(Ot(e)).subscribe(t):this._scrolled.subscribe(t);return this._scrolledCount++,()=>{o.unsubscribe(),this._scrolledCount--,this._scrolledCount||(this._cleanupGlobalListener?.(),this._cleanupGlobalListener=void 0)}}):_()}ngOnDestroy(){this._cleanupGlobalListener?.(),this._cleanupGlobalListener=void 0,this.scrollContainers.forEach((e,t)=>this.deregister(t)),this._scrolled.complete()}ancestorScrolled(e,t){let o=this.getAncestorScrollContainers(e);return this.scrolled(t).pipe(E(r=>!r||o.indexOf(r)>-1))}getAncestorScrollContainers(e){let t=[];return this.scrollContainers.forEach((o,r)=>{this._scrollableContainsElement(r,e)&&t.push(r)}),t}_scrollableContainsElement(e,t){let o=De(t),r=e.getElementRef().nativeElement;do if(o==r)return!0;while(o=o.parentElement);return!1}static \u0275fac=function(t){return new(t||n)};static \u0275prov=b({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),dt=(()=>{class n{elementRef=h(R);scrollDispatcher=h(lt);ngZone=h(U);dir=h(ae,{optional:!0});_scrollElement=this.elementRef.nativeElement;_destroyed=new y;_renderer=h(Fe);_cleanupScroll;_elementScrolled=new y;constructor(){}ngOnInit(){this._cleanupScroll=this.ngZone.runOutsideAngular(()=>this._renderer.listen(this._scrollElement,"scroll",e=>this._elementScrolled.next(e))),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(e){let t=this.elementRef.nativeElement,o=this.dir&&this.dir.value=="rtl";e.left==null&&(e.left=o?e.end:e.start),e.right==null&&(e.right=o?e.start:e.end),e.bottom!=null&&(e.top=t.scrollHeight-t.clientHeight-e.bottom),o&&He()!=Z.NORMAL?(e.left!=null&&(e.right=t.scrollWidth-t.clientWidth-e.left),He()==Z.INVERTED?e.left=e.right:He()==Z.NEGATED&&(e.left=e.right?-e.right:e.right)):e.right!=null&&(e.left=t.scrollWidth-t.clientWidth-e.right),this._applyScrollToOptions(e)}_applyScrollToOptions(e){let t=this.elementRef.nativeElement;Vt()?t.scrollTo(e):(e.top!=null&&(t.scrollTop=e.top),e.left!=null&&(t.scrollLeft=e.left))}measureScrollOffset(e){let t="left",o="right",r=this.elementRef.nativeElement;if(e=="top")return r.scrollTop;if(e=="bottom")return r.scrollHeight-r.clientHeight-r.scrollTop;let s=this.dir&&this.dir.value=="rtl";return e=="start"?e=s?o:t:e=="end"&&(e=s?t:o),s&&He()==Z.INVERTED?e==t?r.scrollWidth-r.clientWidth-r.scrollLeft:r.scrollLeft:s&&He()==Z.NEGATED?e==t?r.scrollLeft+r.scrollWidth-r.clientWidth:-r.scrollLeft:e==t?r.scrollLeft:r.scrollWidth-r.clientWidth-r.scrollLeft}static \u0275fac=function(t){return new(t||n)};static \u0275dir=L({type:n,selectors:[["","cdk-scrollable",""],["","cdkScrollable",""]]})}return n})(),Rr=20,Oe=(()=>{class n{_platform=h(H);_listeners;_viewportSize;_change=new y;_document=h(M);constructor(){let e=h(U),t=h(oe).createRenderer(null,null);e.runOutsideAngular(()=>{if(this._platform.isBrowser){let o=r=>this._change.next(r);this._listeners=[t.listen("window","resize",o),t.listen("window","orientationchange",o)]}this.change().subscribe(()=>this._viewportSize=null)})}ngOnDestroy(){this._listeners?.forEach(e=>e()),this._change.complete()}getViewportSize(){this._viewportSize||this._updateViewportSize();let e={width:this._viewportSize.width,height:this._viewportSize.height};return this._platform.isBrowser||(this._viewportSize=null),e}getViewportRect(){let e=this.getViewportScrollPosition(),{width:t,height:o}=this.getViewportSize();return{top:e.top,left:e.left,bottom:e.top+o,right:e.left+t,height:o,width:t}}getViewportScrollPosition(){if(!this._platform.isBrowser)return{top:0,left:0};let e=this._document,t=this._getWindow(),o=e.documentElement,r=o.getBoundingClientRect(),s=-r.top||e.body.scrollTop||t.scrollY||o.scrollTop||0,a=-r.left||e.body.scrollLeft||t.scrollX||o.scrollLeft||0;return{top:s,left:a}}change(e=Rr){return e>0?this._change.pipe(Ot(e)):this._change}_getWindow(){return this._document.defaultView||window}_updateViewportSize(){let e=this._getWindow();this._viewportSize=this._platform.isBrowser?{width:e.innerWidth,height:e.innerHeight}:{width:0,height:0}}static \u0275fac=function(t){return new(t||n)};static \u0275prov=b({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),lo=new A("VIRTUAL_SCROLLABLE"),kr=(()=>{class n extends dt{constructor(){super()}measureViewportSize(e){let t=this.elementRef.nativeElement;return e==="horizontal"?t.clientWidth:t.clientHeight}static \u0275fac=function(t){return new(t||n)};static \u0275dir=L({type:n,features:[W]})}return n})();function Tr(n,i){return n.start==i.start&&n.end==i.end}var xr=typeof requestAnimationFrame<"u"?vn:_n,fo=(()=>{class n extends kr{elementRef=h(R);_changeDetectorRef=h($e);_scrollStrategy=h(uo,{optional:!0});scrollable=h(lo,{optional:!0});_platform=h(H);_detachedSubject=new y;_renderedRangeSubject=new y;get orientation(){return this._orientation}set orientation(e){this._orientation!==e&&(this._orientation=e,this._calculateSpacerSize())}_orientation="vertical";appendOnly=!1;scrolledIndexChange=new ye(e=>this._scrollStrategy.scrolledIndexChange.subscribe(t=>Promise.resolve().then(()=>this.ngZone.run(()=>e.next(t)))));_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=h(O);_isDestroyed=!1;constructor(){super();let e=h(Oe);this._scrollStrategy,this._viewportChanges=e.change().subscribe(()=>{this.checkViewportSize()}),this.scrollable||(this.elementRef.nativeElement.classList.add("cdk-virtual-scrollable"),this.scrollable=this);let t=Be(()=>{this._changeDetectionNeeded()&&this._doChangeDetection()},{injector:h(Ne).injector});h(En).onDestroy(()=>{t.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),Ot(0,xr),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(e){this._forOf,this.ngZone.runOutsideAngular(()=>{this._forOf=e,this._forOf.dataStream.pipe(de(this._detachedSubject)).subscribe(t=>{let o=t.length;o!==this._dataLength&&(this._dataLength=o,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(e){return this.getElementRef().nativeElement.getBoundingClientRect()[e]}setTotalContentSize(e){this._totalContentSize!==e&&(this._totalContentSize=e,this._calculateSpacerSize(),this._markChangeDetectionNeeded())}setRenderedRange(e){Tr(this._renderedRange,e)||(this.appendOnly&&(e={start:0,end:Math.max(this._renderedRange.end,e.end)}),this._renderedRangeSubject.next(this._renderedRange=e),this._markChangeDetectionNeeded(()=>this._scrollStrategy.onContentRendered()))}getOffsetToRenderedContentStart(){return this._renderedContentOffsetNeedsRewrite?null:this._renderedContentOffset}setRenderedContentOffset(e,t="to-start"){e=this.appendOnly&&t==="to-start"?0:e;let o=this.dir&&this.dir.value=="rtl",r=this.orientation=="horizontal",s=r?"X":"Y",c=`translate${s}(${Number((r&&o?-1:1)*e)}px)`;this._renderedContentOffset=e,t==="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(e,t="auto"){let o={behavior:t};this.orientation==="horizontal"?o.start=e:o.top=e,this.scrollable.scrollTo(o)}scrollToIndex(e,t="auto"){this._scrollStrategy.scrollToIndex(e,t)}measureScrollOffset(e){let t;return this.scrollable==this?t=o=>super.measureScrollOffset(o):t=o=>this.scrollable.measureScrollOffset(o),Math.max(0,t(e??(this.orientation==="horizontal"?"start":"top"))-this.measureViewportOffset())}measureViewportOffset(e){let t,o="left",r="right",s=this.dir?.value=="rtl";e=="start"?t=s?r:o:e=="end"?t=s?o:r:e?t=e:t=this.orientation==="horizontal"?"left":"top";let a=this.scrollable.measureBoundingClientRectWithScrollOffset(t);return this.elementRef.nativeElement.getBoundingClientRect()[t]-a}measureRenderedContentSize(){let e=this._contentWrapper.nativeElement;return this.orientation==="horizontal"?e.offsetWidth:e.offsetHeight}measureRangeSize(e){return this._forOf?this._forOf.measureRangeSize(e,this.orientation):0}checkViewportSize(){this._measureViewportSize(),this._scrollStrategy.onDataLengthChanged()}_measureViewportSize(){this._viewportSize=this.scrollable.measureViewportSize(this.orientation)}_markChangeDetectionNeeded(e){e&&this._runAfterChangeDetection.push(e),!Bn(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 e=this._runAfterChangeDetection;this._runAfterChangeDetection=[];for(let t of e)t()},{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(t){return new(t||n)};static \u0275cmp=G({type:n,selectors:[["cdk-virtual-scroll-viewport"]],viewQuery:function(t,o){if(t&1&&Tt(Dr,7),t&2){let r;xt(r=Pt())&&(o._contentWrapper=r.first)}},hostAttrs:[1,"cdk-virtual-scroll-viewport"],hostVars:4,hostBindings:function(t,o){t&2&&nt("cdk-virtual-scroll-orientation-horizontal",o.orientation==="horizontal")("cdk-virtual-scroll-orientation-vertical",o.orientation!=="horizontal")},inputs:{orientation:"orientation",appendOnly:[2,"appendOnly","appendOnly",q]},outputs:{scrolledIndexChange:"scrolledIndexChange"},features:[ze([{provide:dt,useFactory:(e,t)=>e||t,deps:[[new wn,new On(lo)],n]}]),W],ngContentSelectors:Er,decls:4,vars:4,consts:[["contentWrapper",""],[1,"cdk-virtual-scroll-content-wrapper"],[1,"cdk-virtual-scroll-spacer"]],template:function(t,o){t&1&&(Un(),Pn(0,"div",1,0),Nn(2),Mn(),Ln(3,"div",2)),t&2&&(Rn(3),zn("width",o._totalContentWidth())("height",o._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 n})();function ho(n,i,e){let t=e;if(!t.getBoundingClientRect)return 0;let o=t.getBoundingClientRect();return n==="horizontal"?i==="start"?o.left:o.right:i==="start"?o.top:o.bottom}var Pr=(()=>{class n{_viewContainerRef=h(Ue);_template=h(be);_differs=h($n);_viewRepeater=h(Ii);_viewport=h(fo,{skipSelf:!0});viewChange=new y;_dataSourceChanges=new y;get cdkVirtualForOf(){return this._cdkVirtualForOf}set cdkVirtualForOf(e){this._cdkVirtualForOf=e,co(e)?this._dataSourceChanges.next(e):this._dataSourceChanges.next(new Ht(It(e)?e:Array.from(e||[])))}_cdkVirtualForOf;get cdkVirtualForTrackBy(){return this._cdkVirtualForTrackBy}set cdkVirtualForTrackBy(e){this._needsUpdate=!0,this._cdkVirtualForTrackBy=e?(t,o)=>e(t+(this._renderedRange?this._renderedRange.start:0),o):void 0}_cdkVirtualForTrackBy;set cdkVirtualForTemplate(e){e&&(this._needsUpdate=!0,this._template=e)}get cdkVirtualForTemplateCacheSize(){return this._viewRepeater.viewCacheSize}set cdkVirtualForTemplateCacheSize(e){this._viewRepeater.viewCacheSize=se(e)}dataStream=this._dataSourceChanges.pipe(Ce(null),yn(),v(([e,t])=>this._changeDataSource(e,t)),Cn(1));_differ=null;_data;_renderedItems;_renderedRange;_needsUpdate=!1;_destroyed=new y;constructor(){let e=h(U);this.dataStream.subscribe(t=>{this._data=t,this._onRenderedDataChange()}),this._viewport.renderedRangeStream.pipe(de(this._destroyed)).subscribe(t=>{this._renderedRange=t,this.viewChange.observers.length&&e.run(()=>this.viewChange.next(this._renderedRange)),this._onRenderedDataChange()}),this._viewport.attach(this)}measureRangeSize(e,t){if(e.start>=e.end)return 0;e.start<this._renderedRange.start||e.end>this._renderedRange.end;let o=e.start-this._renderedRange.start,r=e.end-e.start,s,a;for(let c=0;c<r;c++){let l=this._viewContainerRef.get(c+o);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+o);if(l&&l.rootNodes.length){a=l.rootNodes[l.rootNodes.length-1];break}}return s&&a?ho(t,"end",a)-ho(t,"start",s):0}ngDoCheck(){if(this._differ&&this._needsUpdate){let e=this._differ.diff(this._renderedItems);e?this._applyChanges(e):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((e,t)=>this.cdkVirtualForTrackBy?this.cdkVirtualForTrackBy(e,t):t)),this._needsUpdate=!0)}_changeDataSource(e,t){return e&&e.disconnect(this),this._needsUpdate=!0,t?t.connect(this):_()}_updateContext(){let e=this._data.length,t=this._viewContainerRef.length;for(;t--;){let o=this._viewContainerRef.get(t);o.context.index=this._renderedRange.start+t,o.context.count=e,this._updateComputedContextProperties(o.context),o.detectChanges()}}_applyChanges(e){this._viewRepeater.applyChanges(e,this._viewContainerRef,(r,s,a)=>this._getEmbeddedViewArgs(r,a),r=>r.item),e.forEachIdentityChange(r=>{let s=this._viewContainerRef.get(r.currentIndex);s.context.$implicit=r.item});let t=this._data.length,o=this._viewContainerRef.length;for(;o--;){let r=this._viewContainerRef.get(o);r.context.index=this._renderedRange.start+o,r.context.count=t,this._updateComputedContextProperties(r.context)}}_updateComputedContextProperties(e){e.first=e.index===0,e.last=e.index===e.count-1,e.even=e.index%2===0,e.odd=!e.even}_getEmbeddedViewArgs(e,t){return{templateRef:this._template,context:{$implicit:e.item,cdkVirtualForOf:this._cdkVirtualForOf,index:-1,count:-1,first:!1,last:!1,odd:!1,even:!1},index:t}}static ngTemplateContextGuard(e,t){return!0}static \u0275fac=function(t){return new(t||n)};static \u0275dir=L({type:n,selectors:[["","cdkVirtualFor","","cdkVirtualForOf",""]],inputs:{cdkVirtualForOf:"cdkVirtualForOf",cdkVirtualForTrackBy:"cdkVirtualForTrackBy",cdkVirtualForTemplate:"cdkVirtualForTemplate",cdkVirtualForTemplateCacheSize:"cdkVirtualForTemplateCacheSize"},features:[ze([{provide:Ii,useClass:Gt}])]})}return n})();var Ei=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=N({type:n});static \u0275inj=F({})}return n})(),Oi=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=N({type:n});static \u0275inj=F({imports:[fe,Ei,fe,Ei]})}return n})();var ht=class{_attachedHost;attach(i){return this._attachedHost=i,i.attach(this)}detach(){let i=this._attachedHost;i!=null&&(this._attachedHost=null,i.detach())}get isAttached(){return this._attachedHost!=null}setAttachedHost(i){this._attachedHost=i}},Ge=class extends ht{component;viewContainerRef;injector;projectableNodes;constructor(i,e,t,o){super(),this.component=i,this.viewContainerRef=e,this.injector=t,this.projectableNodes=o}},we=class extends ht{templateRef;viewContainerRef;context;injector;constructor(i,e,t,o){super(),this.templateRef=i,this.viewContainerRef=e,this.context=t,this.injector=o}get origin(){return this.templateRef.elementRef}attach(i,e=this.context){return this.context=e,super.attach(i)}detach(){return this.context=void 0,super.detach()}},wi=class extends ht{element;constructor(i){super(),this.element=i instanceof R?i.nativeElement:i}},We=class{_attachedPortal;_disposeFn;_isDisposed=!1;hasAttached(){return!!this._attachedPortal}attach(i){if(i instanceof Ge)return this._attachedPortal=i,this.attachComponentPortal(i);if(i instanceof we)return this._attachedPortal=i,this.attachTemplatePortal(i);if(this.attachDomPortal&&i instanceof wi)return this._attachedPortal=i,this.attachDomPortal(i)}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(i){this._disposeFn=i}_invokeDisposeFn(){this._disposeFn&&(this._disposeFn(),this._disposeFn=null)}},Wt=class extends We{outletElement;_appRef;_defaultInjector;constructor(i,e,t){super(),this.outletElement=i,this._appRef=e,this._defaultInjector=t}attachComponentPortal(i){let e;if(i.viewContainerRef){let t=i.injector||i.viewContainerRef.injector,o=t.get(mi,null,{optional:!0})||void 0;e=i.viewContainerRef.createComponent(i.component,{index:i.viewContainerRef.length,injector:t,ngModuleRef:o,projectableNodes:i.projectableNodes||void 0}),this.setDisposeFn(()=>e.destroy())}else{let t=this._appRef,o=i.injector||this._defaultInjector||O.NULL,r=o.get(Me,t.injector);e=Mt(i.component,{elementInjector:o,environmentInjector:r,projectableNodes:i.projectableNodes||void 0}),t.attachView(e.hostView),this.setDisposeFn(()=>{t.viewCount>0&&t.detachView(e.hostView),e.destroy()})}return this.outletElement.appendChild(this._getComponentRootNode(e)),this._attachedPortal=i,e}attachTemplatePortal(i){let e=i.viewContainerRef,t=e.createEmbeddedView(i.templateRef,i.context,{injector:i.injector});return t.rootNodes.forEach(o=>this.outletElement.appendChild(o)),t.detectChanges(),this.setDisposeFn(()=>{let o=e.indexOf(t);o!==-1&&e.remove(o)}),this._attachedPortal=i,t}attachDomPortal=i=>{let e=i.element;e.parentNode;let t=this.outletElement.ownerDocument.createComment("dom-portal");e.parentNode.insertBefore(t,e),this.outletElement.appendChild(e),this._attachedPortal=i,super.setDisposeFn(()=>{t.parentNode&&t.parentNode.replaceChild(e,t)})};dispose(){super.dispose(),this.outletElement.remove()}_getComponentRootNode(i){return i.hostView.rootNodes[0]}};var ut=(()=>{class n extends We{_moduleRef=h(mi,{optional:!0});_document=h(M);_viewContainerRef=h(Ue);_isInitialized=!1;_attachedRef;constructor(){super()}get portal(){return this._attachedPortal}set portal(e){this.hasAttached()&&!e&&!this._isInitialized||(this.hasAttached()&&super.detach(),e&&super.attach(e),this._attachedPortal=e||null)}attached=new B;get attachedRef(){return this._attachedRef}ngOnInit(){this._isInitialized=!0}ngOnDestroy(){super.dispose(),this._attachedRef=this._attachedPortal=null}attachComponentPortal(e){e.setAttachedHost(this);let t=e.viewContainerRef!=null?e.viewContainerRef:this._viewContainerRef,o=t.createComponent(e.component,{index:t.length,injector:e.injector||t.injector,projectableNodes:e.projectableNodes||void 0,ngModuleRef:this._moduleRef||void 0});return t!==this._viewContainerRef&&this._getRootNode().appendChild(o.hostView.rootNodes[0]),super.setDisposeFn(()=>o.destroy()),this._attachedPortal=e,this._attachedRef=o,this.attached.emit(o),o}attachTemplatePortal(e){e.setAttachedHost(this);let t=this._viewContainerRef.createEmbeddedView(e.templateRef,e.context,{injector:e.injector});return super.setDisposeFn(()=>this._viewContainerRef.clear()),this._attachedPortal=e,this._attachedRef=t,this.attached.emit(t),t}attachDomPortal=e=>{let t=e.element;t.parentNode;let o=this._document.createComment("dom-portal");e.setAttachedHost(this),t.parentNode.insertBefore(o,t),this._getRootNode().appendChild(t),this._attachedPortal=e,super.setDisposeFn(()=>{o.parentNode&&o.parentNode.replaceChild(t,o)})};_getRootNode(){let e=this._viewContainerRef.element.nativeElement;return e.nodeType===e.ELEMENT_NODE?e:e.parentNode}static \u0275fac=function(t){return new(t||n)};static \u0275dir=L({type:n,selectors:[["","cdkPortalOutlet",""]],inputs:{portal:[0,"cdkPortalOutlet","portal"]},outputs:{attached:"attached"},exportAs:["cdkPortalOutlet"],features:[W]})}return n})();var Ae=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=N({type:n});static \u0275inj=F({})}return n})();var Ai;function Lr(){if(Ai==null){let n=typeof document<"u"?document.head:null;Ai=!!(n&&(n.createShadowRoot||n.attachShadow))}return Ai}function po(n){if(Lr()){let i=n.getRootNode?n.getRootNode():null;if(typeof ShadowRoot<"u"&&ShadowRoot&&i instanceof ShadowRoot)return i}return null}function Yt(){let n=typeof document<"u"&&document?document.activeElement:null;for(;n&&n.shadowRoot;){let i=n.shadowRoot.activeElement;if(i===n)break;n=i}return n}function ee(n){return n.composedPath?n.composedPath()[0]:n.target}function Ri(){return typeof __karma__<"u"&&!!__karma__||typeof jasmine<"u"&&!!jasmine||typeof jest<"u"&&!!jest||typeof Mocha<"u"&&!!Mocha}var Kt=new WeakMap,Ye=(()=>{class n{_appRef;_injector=h(O);_environmentInjector=h(Me);load(e){let t=this._appRef=this._appRef||this._injector.get(Ne),o=Kt.get(t);o||(o={loaders:new Set,refs:[]},Kt.set(t,o),t.onDestroy(()=>{Kt.get(t)?.refs.forEach(r=>r.destroy()),Kt.delete(t)})),o.loaders.has(e)||(o.loaders.add(e),o.refs.push(Mt(e,{environmentInjector:this._environmentInjector})))}static \u0275fac=function(t){return new(t||n)};static \u0275prov=b({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function P(n){return n==null?"":typeof n=="string"?n:`${n}px`}var ki={},pe=(()=>{class n{_appId=h(An);getId(e){return this._appId!=="ng"&&(e+=this._appId),ki.hasOwnProperty(e)||(ki[e]=0),`${e}${ki[e]++}`}static \u0275fac=function(t){return new(t||n)};static \u0275prov=b({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function ge(n,...i){return i.length?i.some(e=>n[e]):n.altKey||n.shiftKey||n.ctrlKey||n.metaKey}var go=Vt();function Xe(n){return new Xt(n.get(Oe),n.get(M))}var Xt=class{_viewportRuler;_previousHTMLStyles={top:"",left:""};_previousScrollPosition;_isEnabled=!1;_document;constructor(i,e){this._viewportRuler=i,this._document=e}attach(){}enable(){if(this._canBeEnabled()){let i=this._document.documentElement;this._previousScrollPosition=this._viewportRuler.getViewportScrollPosition(),this._previousHTMLStyles.left=i.style.left||"",this._previousHTMLStyles.top=i.style.top||"",i.style.left=P(-this._previousScrollPosition.left),i.style.top=P(-this._previousScrollPosition.top),i.classList.add("cdk-global-scrollblock"),this._isEnabled=!0}}disable(){if(this._isEnabled){let i=this._document.documentElement,e=this._document.body,t=i.style,o=e.style,r=t.scrollBehavior||"",s=o.scrollBehavior||"";this._isEnabled=!1,t.left=this._previousHTMLStyles.left,t.top=this._previousHTMLStyles.top,i.classList.remove("cdk-global-scrollblock"),go&&(t.scrollBehavior=o.scrollBehavior="auto"),window.scroll(this._previousScrollPosition.left,this._previousScrollPosition.top),go&&(t.scrollBehavior=r,o.scrollBehavior=s)}}_canBeEnabled(){if(this._document.documentElement.classList.contains("cdk-global-scrollblock")||this._isEnabled)return!1;let e=this._document.documentElement,t=this._viewportRuler.getViewportSize();return e.scrollHeight>t.height||e.scrollWidth>t.width}};function So(n,i){return new Zt(n.get(lt),n.get(U),n.get(Oe),i)}var Zt=class{_scrollDispatcher;_ngZone;_viewportRuler;_config;_scrollSubscription=null;_overlayRef;_initialScrollPosition;constructor(i,e,t,o){this._scrollDispatcher=i,this._ngZone=e,this._viewportRuler=t,this._config=o}attach(i){this._overlayRef,this._overlayRef=i}enable(){if(this._scrollSubscription)return;let i=this._scrollDispatcher.scrolled(0).pipe(E(e=>!e||!this._overlayRef.overlayElement.contains(e.getElementRef().nativeElement)));this._config&&this._config.threshold&&this._config.threshold>1?(this._initialScrollPosition=this._viewportRuler.getViewportScrollPosition().top,this._scrollSubscription=i.subscribe(()=>{let e=this._viewportRuler.getViewportScrollPosition().top;Math.abs(e-this._initialScrollPosition)>this._config.threshold?this._detach():this._overlayRef.updatePosition()})):this._scrollSubscription=i.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 ft=class{enable(){}disable(){}attach(){}};function Ti(n,i){return i.some(e=>{let t=n.bottom<e.top,o=n.top>e.bottom,r=n.right<e.left,s=n.left>e.right;return t||o||r||s})}function mo(n,i){return i.some(e=>{let t=n.top<e.top,o=n.bottom>e.bottom,r=n.left<e.left,s=n.right>e.right;return t||o||r||s})}function ti(n,i){return new Qt(n.get(lt),n.get(Oe),n.get(U),i)}var Qt=class{_scrollDispatcher;_viewportRuler;_ngZone;_config;_scrollSubscription=null;_overlayRef;constructor(i,e,t,o){this._scrollDispatcher=i,this._viewportRuler=e,this._ngZone=t,this._config=o}attach(i){this._overlayRef,this._overlayRef=i}enable(){if(!this._scrollSubscription){let i=this._config?this._config.scrollThrottle:0;this._scrollSubscription=this._scrollDispatcher.scrolled(i).subscribe(()=>{if(this._overlayRef.updatePosition(),this._config&&this._config.autoClose){let e=this._overlayRef.overlayElement.getBoundingClientRect(),{width:t,height:o}=this._viewportRuler.getViewportSize();Ti(e,[{width:t,height:o,bottom:o,right:t,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}},Io=(()=>{class n{_injector=h(O);constructor(){}noop=()=>new ft;close=e=>So(this._injector,e);block=()=>Xe(this._injector);reposition=e=>ti(this._injector,e);static \u0275fac=function(t){return new(t||n)};static \u0275prov=b({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),ke=class{positionStrategy;scrollStrategy=new ft;panelClass="";hasBackdrop=!1;backdropClass="cdk-overlay-dark-backdrop";disableAnimations;width;height;minWidth;minHeight;maxWidth;maxHeight;direction;disposeOnNavigation=!1;constructor(i){if(i){let e=Object.keys(i);for(let t of e)i[t]!==void 0&&(this[t]=i[t])}}},xi=class{offsetX;offsetY;panelClass;originX;originY;overlayX;overlayY;constructor(i,e,t,o,r){this.offsetX=t,this.offsetY=o,this.panelClass=r,this.originX=i.originX,this.originY=i.originY,this.overlayX=e.overlayX,this.overlayY=e.overlayY}};var qt=class{connectionPair;scrollableViewProperties;constructor(i,e){this.connectionPair=i,this.scrollableViewProperties=e}};var Do=(()=>{class n{_attachedOverlays=[];_document=h(M);_isAttached;constructor(){}ngOnDestroy(){this.detach()}add(e){this.remove(e),this._attachedOverlays.push(e)}remove(e){let t=this._attachedOverlays.indexOf(e);t>-1&&this._attachedOverlays.splice(t,1),this._attachedOverlays.length===0&&this.detach()}static \u0275fac=function(t){return new(t||n)};static \u0275prov=b({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),Eo=(()=>{class n extends Do{_ngZone=h(U);_renderer=h(oe).createRenderer(null,null);_cleanupKeydown;add(e){super.add(e),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=e=>{let t=this._attachedOverlays;for(let o=t.length-1;o>-1;o--)if(t[o]._keydownEvents.observers.length>0){this._ngZone.run(()=>t[o]._keydownEvents.next(e));break}};static \u0275fac=(()=>{let e;return function(o){return(e||(e=he(n)))(o||n)}})();static \u0275prov=b({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),Oo=(()=>{class n extends Do{_platform=h(H);_ngZone=h(U);_renderer=h(oe).createRenderer(null,null);_cursorOriginalValue;_cursorStyleIsSet=!1;_pointerDownEventTarget;_cleanups;add(e){if(super.add(e),!this._isAttached){let t=this._document.body,o={capture:!0},r=this._renderer;this._cleanups=this._ngZone.runOutsideAngular(()=>[r.listen(t,"pointerdown",this._pointerDownListener,o),r.listen(t,"click",this._clickListener,o),r.listen(t,"auxclick",this._clickListener,o),r.listen(t,"contextmenu",this._clickListener,o)]),this._platform.IOS&&!this._cursorStyleIsSet&&(this._cursorOriginalValue=t.style.cursor,t.style.cursor="pointer",this._cursorStyleIsSet=!0),this._isAttached=!0}}detach(){this._isAttached&&(this._cleanups?.forEach(e=>e()),this._cleanups=void 0,this._platform.IOS&&this._cursorStyleIsSet&&(this._document.body.style.cursor=this._cursorOriginalValue,this._cursorStyleIsSet=!1),this._isAttached=!1)}_pointerDownListener=e=>{this._pointerDownEventTarget=ee(e)};_clickListener=e=>{let t=ee(e),o=e.type==="click"&&this._pointerDownEventTarget?this._pointerDownEventTarget:t;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(_o(a.overlayElement,t)||_o(a.overlayElement,o))break;let c=a._outsidePointerEvents;this._ngZone?this._ngZone.run(()=>c.next(e)):c.next(e)}};static \u0275fac=(()=>{let e;return function(o){return(e||(e=he(n)))(o||n)}})();static \u0275prov=b({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function _o(n,i){let e=typeof ShadowRoot<"u"&&ShadowRoot,t=i;for(;t;){if(t===n)return!0;t=e&&t instanceof ShadowRoot?t.host:t.parentNode}return!1}var wo=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275cmp=G({type:n,selectors:[["ng-component"]],hostAttrs:["cdk-overlay-style-loader",""],decls:0,vars:0,template:function(t,o){},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 n})(),ii=(()=>{class n{_platform=h(H);_containerElement;_document=h(M);_styleLoader=h(Ye);constructor(){}ngOnDestroy(){this._containerElement?.remove()}getContainerElement(){return this._loadStyles(),this._containerElement||this._createContainer(),this._containerElement}_createContainer(){let e="cdk-overlay-container";if(this._platform.isBrowser||Ri()){let o=this._document.querySelectorAll(`.${e}[platform="server"], .${e}[platform="test"]`);for(let r=0;r<o.length;r++)o[r].remove()}let t=this._document.createElement("div");t.classList.add(e),Ri()?t.setAttribute("platform","test"):this._platform.isBrowser||t.setAttribute("platform","server"),this._document.body.appendChild(t),this._containerElement=t}_loadStyles(){this._styleLoader.load(wo)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=b({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),Pi=class{_renderer;_ngZone;element;_cleanupClick;_cleanupTransitionEnd;_fallbackTimeout;constructor(i,e,t,o){this._renderer=e,this._ngZone=t,this.element=i.createElement("div"),this.element.classList.add("cdk-overlay-backdrop"),this._cleanupClick=e.listen(this.element,"click",o)}detach(){this._ngZone.runOutsideAngular(()=>{let i=this.element;clearTimeout(this._fallbackTimeout),this._cleanupTransitionEnd?.(),this._cleanupTransitionEnd=this._renderer.listen(i,"transitionend",this.dispose),this._fallbackTimeout=setTimeout(this.dispose,500),i.style.pointerEvents="none",i.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()}},Ke=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(i,e,t,o,r,s,a,c,l,d=!1,u,p){this._portalOutlet=i,this._host=e,this._pane=t,this._config=o,this._ngZone=r,this._keyboardDispatcher=s,this._document=a,this._location=c,this._outsideClickDispatcher=l,this._animationsDisabled=d,this._injector=u,this._renderer=p,o.scrollStrategy&&(this._scrollStrategy=o.scrollStrategy,this._scrollStrategy.attach(this)),this._positionStrategy=o.positionStrategy}get overlayElement(){return this._pane}get backdropElement(){return this._backdropRef?.element||null}get hostElement(){return this._host}attach(i){!this._host.parentElement&&this._previousHostParent&&this._previousHostParent.appendChild(this._host);let e=this._portalOutlet.attach(i);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 e?.onDestroy=="function"&&e.onDestroy(()=>{this.hasAttached()&&this._ngZone.runOutsideAngular(()=>Promise.resolve().then(()=>this.detach()))}),e}detach(){if(!this.hasAttached())return;this.detachBackdrop(),this._togglePointerEvents(!1),this._positionStrategy&&this._positionStrategy.detach&&this._positionStrategy.detach(),this._scrollStrategy&&this._scrollStrategy.disable();let i=this._portalOutlet.detach();return this._detachments.next(),this._completeDetachContent(),this._keyboardDispatcher.remove(this),this._detachContentWhenEmpty(),this._locationChanges.unsubscribe(),this._outsideClickDispatcher.remove(this),i}dispose(){let i=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,i&&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(i){i!==this._positionStrategy&&(this._positionStrategy&&this._positionStrategy.dispose(),this._positionStrategy=i,this.hasAttached()&&(i.attach(this),this.updatePosition()))}updateSize(i){this._config=m(m({},this._config),i),this._updateElementSize()}setDirection(i){this._config=k(m({},this._config),{direction:i}),this._updateElementDirection()}addPanelClass(i){this._pane&&this._toggleClasses(this._pane,i,!0)}removePanelClass(i){this._pane&&this._toggleClasses(this._pane,i,!1)}getDirection(){let i=this._config.direction;return i?typeof i=="string"?i:i.value:"ltr"}updateScrollStrategy(i){i!==this._scrollStrategy&&(this._disposeScrollStrategy(),this._scrollStrategy=i,this.hasAttached()&&(i.attach(this),i.enable()))}_updateElementDirection(){this._host.setAttribute("dir",this.getDirection())}_updateElementSize(){if(!this._pane)return;let i=this._pane.style;i.width=P(this._config.width),i.height=P(this._config.height),i.minWidth=P(this._config.minWidth),i.minHeight=P(this._config.minHeight),i.maxWidth=P(this._config.maxWidth),i.maxHeight=P(this._config.maxHeight)}_togglePointerEvents(i){this._pane.style.pointerEvents=i?"":"none"}_attachBackdrop(){let i="cdk-overlay-backdrop-showing";this._backdropRef?.dispose(),this._backdropRef=new Pi(this._document,this._renderer,this._ngZone,e=>{this._backdropClick.next(e)}),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(i))}):this._backdropRef.element.classList.add(i)}_updateStackingOrder(){this._host.nextSibling&&this._host.parentNode.appendChild(this._host)}detachBackdrop(){this._animationsDisabled?(this._backdropRef?.dispose(),this._backdropRef=null):this._backdropRef?.detach()}_toggleClasses(i,e,t){let o=Lt(e||[]).filter(r=>!!r);o.length&&(t?i.classList.add(...o):i.classList.remove(...o))}_detachContentWhenEmpty(){let i=!1;try{this._detachContentAfterRenderRef=ne(()=>{i=!0,this._detachContent()},{injector:this._injector})}catch(e){if(i)throw e;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 i=this._scrollStrategy;i?.disable(),i?.detach?.()}},vo="cdk-overlay-connected-position-bounding-box",Fr=/([A-Za-z%]+)$/;function Fi(n,i){return new Jt(i,n.get(Oe),n.get(M),n.get(H),n.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(i,e,t,o,r){this._viewportRuler=e,this._document=t,this._platform=o,this._overlayContainer=r,this.setOrigin(i)}attach(i){this._overlayRef&&this._overlayRef,this._validatePositions(),i.hostElement.classList.add(vo),this._overlayRef=i,this._boundingBox=i.hostElement,this._pane=i.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 i=this._originRect,e=this._overlayRect,t=this._viewportRect,o=this._containerRect,r=[],s;for(let a of this._preferredPositions){let c=this._getOriginPoint(i,o,a),l=this._getOverlayPoint(c,e,a),d=this._getOverlayFit(l,e,t,a);if(d.isCompletelyWithinViewport){this._isPushed=!1,this._applyPosition(a,c);return}if(this._canFitWithFlexibleDimensions(d,l,t)){r.push({position:a,origin:c,overlayRect:e,boundingBoxRect:this._calculateBoundingBoxRect(c,a)});continue}(!s||s.overlayFit.visibleArea<d.visibleArea)&&(s={overlayFit:d,overlayPoint:l,originPoint:c,position:a,overlayRect:e})}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(vo),this.detach(),this._positionChanges.complete(),this._overlayRef=this._boundingBox=null,this._isDisposed=!0)}reapplyLastPosition(){if(this._isDisposed||!this._platform.isBrowser)return;let i=this._lastPosition;if(i){this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect(),this._viewportRect=this._getNarrowedViewportRect(),this._containerRect=this._overlayContainer.getContainerElement().getBoundingClientRect();let e=this._getOriginPoint(this._originRect,this._containerRect,i);this._applyPosition(i,e)}else this.apply()}withScrollableContainers(i){return this._scrollables=i,this}withPositions(i){return this._preferredPositions=i,i.indexOf(this._lastPosition)===-1&&(this._lastPosition=null),this._validatePositions(),this}withViewportMargin(i){return this._viewportMargin=i,this}withFlexibleDimensions(i=!0){return this._hasFlexibleDimensions=i,this}withGrowAfterOpen(i=!0){return this._growAfterOpen=i,this}withPush(i=!0){return this._canPush=i,this}withLockedPosition(i=!0){return this._positionLocked=i,this}setOrigin(i){return this._origin=i,this}withDefaultOffsetX(i){return this._offsetX=i,this}withDefaultOffsetY(i){return this._offsetY=i,this}withTransformOriginOn(i){return this._transformOriginSelector=i,this}_getOriginPoint(i,e,t){let o;if(t.originX=="center")o=i.left+i.width/2;else{let s=this._isRtl()?i.right:i.left,a=this._isRtl()?i.left:i.right;o=t.originX=="start"?s:a}e.left<0&&(o-=e.left);let r;return t.originY=="center"?r=i.top+i.height/2:r=t.originY=="top"?i.top:i.bottom,e.top<0&&(r-=e.top),{x:o,y:r}}_getOverlayPoint(i,e,t){let o;t.overlayX=="center"?o=-e.width/2:t.overlayX==="start"?o=this._isRtl()?-e.width:0:o=this._isRtl()?0:-e.width;let r;return t.overlayY=="center"?r=-e.height/2:r=t.overlayY=="top"?0:-e.height,{x:i.x+o,y:i.y+r}}_getOverlayFit(i,e,t,o){let r=Co(e),{x:s,y:a}=i,c=this._getOffset(o,"x"),l=this._getOffset(o,"y");c&&(s+=c),l&&(a+=l);let d=0-s,u=s+r.width-t.width,p=0-a,f=a+r.height-t.height,g=this._subtractOverflows(r.width,d,u),C=this._subtractOverflows(r.height,p,f),V=g*C;return{visibleArea:V,isCompletelyWithinViewport:r.width*r.height===V,fitsInViewportVertically:C===r.height,fitsInViewportHorizontally:g==r.width}}_canFitWithFlexibleDimensions(i,e,t){if(this._hasFlexibleDimensions){let o=t.bottom-e.y,r=t.right-e.x,s=yo(this._overlayRef.getConfig().minHeight),a=yo(this._overlayRef.getConfig().minWidth),c=i.fitsInViewportVertically||s!=null&&s<=o,l=i.fitsInViewportHorizontally||a!=null&&a<=r;return c&&l}return!1}_pushOverlayOnScreen(i,e,t){if(this._previousPushAmount&&this._positionLocked)return{x:i.x+this._previousPushAmount.x,y:i.y+this._previousPushAmount.y};let o=Co(e),r=this._viewportRect,s=Math.max(i.x+o.width-r.width,0),a=Math.max(i.y+o.height-r.height,0),c=Math.max(r.top-t.top-i.y,0),l=Math.max(r.left-t.left-i.x,0),d=0,u=0;return o.width<=r.width?d=l||-s:d=i.x<this._viewportMargin?r.left-t.left-i.x:0,o.height<=r.height?u=c||-a:u=i.y<this._viewportMargin?r.top-t.top-i.y:0,this._previousPushAmount={x:d,y:u},{x:i.x+d,y:i.y+u}}_applyPosition(i,e){if(this._setTransformOrigin(i),this._setOverlayElementStyles(e,i),this._setBoundingBoxStyles(e,i),i.panelClass&&this._addPanelClasses(i.panelClass),this._positionChanges.observers.length){let t=this._getScrollVisibility();if(i!==this._lastPosition||!this._lastScrollVisibility||!Ur(this._lastScrollVisibility,t)){let o=new qt(i,t);this._positionChanges.next(o)}this._lastScrollVisibility=t}this._lastPosition=i,this._isInitialRender=!1}_setTransformOrigin(i){if(!this._transformOriginSelector)return;let e=this._boundingBox.querySelectorAll(this._transformOriginSelector),t,o=i.overlayY;i.overlayX==="center"?t="center":this._isRtl()?t=i.overlayX==="start"?"right":"left":t=i.overlayX==="start"?"left":"right";for(let r=0;r<e.length;r++)e[r].style.transformOrigin=`${t} ${o}`}_calculateBoundingBoxRect(i,e){let t=this._viewportRect,o=this._isRtl(),r,s,a;if(e.overlayY==="top")s=i.y,r=t.height-s+this._viewportMargin;else if(e.overlayY==="bottom")a=t.height-i.y+this._viewportMargin*2,r=t.height-a+this._viewportMargin;else{let f=Math.min(t.bottom-i.y+t.top,i.y),g=this._lastBoundingBoxSize.height;r=f*2,s=i.y-f,r>g&&!this._isInitialRender&&!this._growAfterOpen&&(s=i.y-g/2)}let c=e.overlayX==="start"&&!o||e.overlayX==="end"&&o,l=e.overlayX==="end"&&!o||e.overlayX==="start"&&o,d,u,p;if(l)p=t.width-i.x+this._viewportMargin*2,d=i.x-this._viewportMargin;else if(c)u=i.x,d=t.right-i.x;else{let f=Math.min(t.right-i.x+t.left,i.x),g=this._lastBoundingBoxSize.width;d=f*2,u=i.x-f,d>g&&!this._isInitialRender&&!this._growAfterOpen&&(u=i.x-g/2)}return{top:s,left:u,bottom:a,right:p,width:d,height:r}}_setBoundingBoxStyles(i,e){let t=this._calculateBoundingBoxRect(i,e);!this._isInitialRender&&!this._growAfterOpen&&(t.height=Math.min(t.height,this._lastBoundingBoxSize.height),t.width=Math.min(t.width,this._lastBoundingBoxSize.width));let o={};if(this._hasExactPosition())o.top=o.left="0",o.bottom=o.right=o.maxHeight=o.maxWidth="",o.width=o.height="100%";else{let r=this._overlayRef.getConfig().maxHeight,s=this._overlayRef.getConfig().maxWidth;o.height=P(t.height),o.top=P(t.top),o.bottom=P(t.bottom),o.width=P(t.width),o.left=P(t.left),o.right=P(t.right),e.overlayX==="center"?o.alignItems="center":o.alignItems=e.overlayX==="end"?"flex-end":"flex-start",e.overlayY==="center"?o.justifyContent="center":o.justifyContent=e.overlayY==="bottom"?"flex-end":"flex-start",r&&(o.maxHeight=P(r)),s&&(o.maxWidth=P(s))}this._lastBoundingBoxSize=t,Re(this._boundingBox.style,o)}_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(i,e){let t={},o=this._hasExactPosition(),r=this._hasFlexibleDimensions,s=this._overlayRef.getConfig();if(o){let d=this._viewportRuler.getViewportScrollPosition();Re(t,this._getExactOverlayY(e,i,d)),Re(t,this._getExactOverlayX(e,i,d))}else t.position="static";let a="",c=this._getOffset(e,"x"),l=this._getOffset(e,"y");c&&(a+=`translateX(${c}px) `),l&&(a+=`translateY(${l}px)`),t.transform=a.trim(),s.maxHeight&&(o?t.maxHeight=P(s.maxHeight):r&&(t.maxHeight="")),s.maxWidth&&(o?t.maxWidth=P(s.maxWidth):r&&(t.maxWidth="")),Re(this._pane.style,t)}_getExactOverlayY(i,e,t){let o={top:"",bottom:""},r=this._getOverlayPoint(e,this._overlayRect,i);if(this._isPushed&&(r=this._pushOverlayOnScreen(r,this._overlayRect,t)),i.overlayY==="bottom"){let s=this._document.documentElement.clientHeight;o.bottom=`${s-(r.y+this._overlayRect.height)}px`}else o.top=P(r.y);return o}_getExactOverlayX(i,e,t){let o={left:"",right:""},r=this._getOverlayPoint(e,this._overlayRect,i);this._isPushed&&(r=this._pushOverlayOnScreen(r,this._overlayRect,t));let s;if(this._isRtl()?s=i.overlayX==="end"?"left":"right":s=i.overlayX==="end"?"right":"left",s==="right"){let a=this._document.documentElement.clientWidth;o.right=`${a-(r.x+this._overlayRect.width)}px`}else o.left=P(r.x);return o}_getScrollVisibility(){let i=this._getOriginRect(),e=this._pane.getBoundingClientRect(),t=this._scrollables.map(o=>o.getElementRef().nativeElement.getBoundingClientRect());return{isOriginClipped:mo(i,t),isOriginOutsideView:Ti(i,t),isOverlayClipped:mo(e,t),isOverlayOutsideView:Ti(e,t)}}_subtractOverflows(i,...e){return e.reduce((t,o)=>t-Math.max(o,0),i)}_getNarrowedViewportRect(){let i=this._document.documentElement.clientWidth,e=this._document.documentElement.clientHeight,t=this._viewportRuler.getViewportScrollPosition();return{top:t.top+this._viewportMargin,left:t.left+this._viewportMargin,right:t.left+i-this._viewportMargin,bottom:t.top+e-this._viewportMargin,width:i-2*this._viewportMargin,height:e-2*this._viewportMargin}}_isRtl(){return this._overlayRef.getDirection()==="rtl"}_hasExactPosition(){return!this._hasFlexibleDimensions||this._isPushed}_getOffset(i,e){return e==="x"?i.offsetX==null?this._offsetX:i.offsetX:i.offsetY==null?this._offsetY:i.offsetY}_validatePositions(){}_addPanelClasses(i){this._pane&&Lt(i).forEach(e=>{e!==""&&this._appliedPanelClasses.indexOf(e)===-1&&(this._appliedPanelClasses.push(e),this._pane.classList.add(e))})}_clearPanelClasses(){this._pane&&(this._appliedPanelClasses.forEach(i=>{this._pane.classList.remove(i)}),this._appliedPanelClasses=[])}_getOriginRect(){let i=this._origin;if(i instanceof R)return i.nativeElement.getBoundingClientRect();if(i instanceof Element)return i.getBoundingClientRect();let e=i.width||0,t=i.height||0;return{top:i.y,bottom:i.y+t,left:i.x,right:i.x+e,height:t,width:e}}};function Re(n,i){for(let e in i)i.hasOwnProperty(e)&&(n[e]=i[e]);return n}function yo(n){if(typeof n!="number"&&n!=null){let[i,e]=n.split(Fr);return!e||e==="px"?parseFloat(i):null}return n||null}function Co(n){return{top:Math.floor(n.top),right:Math.floor(n.right),bottom:Math.floor(n.bottom),left:Math.floor(n.left),width:Math.floor(n.width),height:Math.floor(n.height)}}function Ur(n,i){return n===i?!0:n.isOriginClipped===i.isOriginClipped&&n.isOriginOutsideView===i.isOriginOutsideView&&n.isOverlayClipped===i.isOverlayClipped&&n.isOverlayOutsideView===i.isOverlayOutsideView}var bo="cdk-global-overlay-wrapper";function Ze(n){return new ei}var ei=class{_overlayRef;_cssPosition="static";_topOffset="";_bottomOffset="";_alignItems="";_xPosition="";_xOffset="";_width="";_height="";_isDisposed=!1;attach(i){let e=i.getConfig();this._overlayRef=i,this._width&&!e.width&&i.updateSize({width:this._width}),this._height&&!e.height&&i.updateSize({height:this._height}),i.hostElement.classList.add(bo),this._isDisposed=!1}top(i=""){return this._bottomOffset="",this._topOffset=i,this._alignItems="flex-start",this}left(i=""){return this._xOffset=i,this._xPosition="left",this}bottom(i=""){return this._topOffset="",this._bottomOffset=i,this._alignItems="flex-end",this}right(i=""){return this._xOffset=i,this._xPosition="right",this}start(i=""){return this._xOffset=i,this._xPosition="start",this}end(i=""){return this._xOffset=i,this._xPosition="end",this}width(i=""){return this._overlayRef?this._overlayRef.updateSize({width:i}):this._width=i,this}height(i=""){return this._overlayRef?this._overlayRef.updateSize({height:i}):this._height=i,this}centerHorizontally(i=""){return this.left(i),this._xPosition="center",this}centerVertically(i=""){return this.top(i),this._alignItems="center",this}apply(){if(!this._overlayRef||!this._overlayRef.hasAttached())return;let i=this._overlayRef.overlayElement.style,e=this._overlayRef.hostElement.style,t=this._overlayRef.getConfig(),{width:o,height:r,maxWidth:s,maxHeight:a}=t,c=(o==="100%"||o==="100vw")&&(!s||s==="100%"||s==="100vw"),l=(r==="100%"||r==="100vh")&&(!a||a==="100%"||a==="100vh"),d=this._xPosition,u=this._xOffset,p=this._overlayRef.getConfig().direction==="rtl",f="",g="",C="";c?C="flex-start":d==="center"?(C="center",p?g=u:f=u):p?d==="left"||d==="end"?(C="flex-end",f=u):(d==="right"||d==="start")&&(C="flex-start",g=u):d==="left"||d==="start"?(C="flex-start",f=u):(d==="right"||d==="end")&&(C="flex-end",g=u),i.position=this._cssPosition,i.marginLeft=c?"0":f,i.marginTop=l?"0":this._topOffset,i.marginBottom=this._bottomOffset,i.marginRight=c?"0":g,e.justifyContent=C,e.alignItems=l?"flex-start":this._alignItems}dispose(){if(this._isDisposed||!this._overlayRef)return;let i=this._overlayRef.overlayElement.style,e=this._overlayRef.hostElement,t=e.style;e.classList.remove(bo),t.justifyContent=t.alignItems=i.marginTop=i.marginBottom=i.marginLeft=i.marginRight=i.position="",this._overlayRef=null,this._isDisposed=!0}},Ao=(()=>{class n{_injector=h(O);constructor(){}global(){return Ze()}flexibleConnectedTo(e){return Fi(this._injector,e)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=b({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function pt(n,i){n.get(Ye).load(wo);let e=n.get(ii),t=n.get(M),o=n.get(pe),r=n.get(Ne),s=n.get(ae),a=t.createElement("div"),c=t.createElement("div");c.id=o.getId("cdk-overlay-"),c.classList.add("cdk-overlay-pane"),a.appendChild(c),e.getContainerElement().appendChild(a);let l=new Wt(c,r,n),d=new ke(i),u=n.get(Fe,null,{optional:!0})||n.get(oe).createRenderer(null,null);return d.direction=d.direction||s.value,new Ke(l,a,c,d,n.get(U),n.get(Eo),t,n.get(Vn),n.get(Oo),i?.disableAnimations??n.get(Rt,null,{optional:!0})==="NoopAnimations",n.get(Me),u)}var Ro=(()=>{class n{scrollStrategies=h(Io);_positionBuilder=h(Ao);_injector=h(O);constructor(){}create(e){return pt(this._injector,e)}position(){return this._positionBuilder}static \u0275fac=function(t){return new(t||n)};static \u0275prov=b({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),Nr=[{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"}],ko=new A("cdk-connected-overlay-scroll-strategy",{providedIn:"root",factory:()=>{let n=h(O);return()=>ti(n)}}),Mi=(()=>{class n{elementRef=h(R);constructor(){}static \u0275fac=function(t){return new(t||n)};static \u0275dir=L({type:n,selectors:[["","cdk-overlay-origin",""],["","overlay-origin",""],["","cdkOverlayOrigin",""]],exportAs:["cdkOverlayOrigin"]})}return n})(),zr=(()=>{class n{_dir=h(ae,{optional:!0});_injector=h(O);_overlayRef;_templatePortal;_backdropSubscription=K.EMPTY;_attachSubscription=K.EMPTY;_detachSubscription=K.EMPTY;_positionSubscription=K.EMPTY;_offsetX;_offsetY;_position;_scrollStrategyFactory=h(ko);_disposeOnNavigation=!1;_ngZone=h(U);origin;positions;positionStrategy;get offsetX(){return this._offsetX}set offsetX(e){this._offsetX=e,this._position&&this._updatePositionStrategy(this._position)}get offsetY(){return this._offsetY}set offsetY(e){this._offsetY=e,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(e){this._disposeOnNavigation=e}backdropClick=new B;positionChange=new B;attach=new B;detach=new B;overlayKeydown=new B;overlayOutsideClick=new B;constructor(){let e=h(be),t=h(Ue);this._templatePortal=new we(e,t),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(e){this._position&&(this._updatePositionStrategy(this._position),this._overlayRef?.updateSize({width:this.width,minWidth:this.minWidth,height:this.height,minHeight:this.minHeight}),e.origin&&this.open&&this._position.apply()),e.open&&(this.open?this.attachOverlay():this.detachOverlay())}_createOverlay(){(!this.positions||!this.positions.length)&&(this.positions=Nr);let e=this._overlayRef=pt(this._injector,this._buildConfig());this._attachSubscription=e.attachments().subscribe(()=>this.attach.emit()),this._detachSubscription=e.detachments().subscribe(()=>this.detach.emit()),e.keydownEvents().subscribe(t=>{this.overlayKeydown.next(t),t.keyCode===27&&!this.disableClose&&!ge(t)&&(t.preventDefault(),this.detachOverlay())}),this._overlayRef.outsidePointerEvents().subscribe(t=>{let o=this._getOriginElement(),r=ee(t);(!o||o!==r&&!o.contains(r))&&this.overlayOutsideClick.next(t)})}_buildConfig(){let e=this._position=this.positionStrategy||this._createPositionStrategy(),t=new ke({direction:this._dir||"ltr",positionStrategy:e,scrollStrategy:this.scrollStrategy,hasBackdrop:this.hasBackdrop,disposeOnNavigation:this.disposeOnNavigation});return(this.width||this.width===0)&&(t.width=this.width),(this.height||this.height===0)&&(t.height=this.height),(this.minWidth||this.minWidth===0)&&(t.minWidth=this.minWidth),(this.minHeight||this.minHeight===0)&&(t.minHeight=this.minHeight),this.backdropClass&&(t.backdropClass=this.backdropClass),this.panelClass&&(t.panelClass=this.panelClass),t}_updatePositionStrategy(e){let t=this.positions.map(o=>({originX:o.originX,originY:o.originY,overlayX:o.overlayX,overlayY:o.overlayY,offsetX:o.offsetX||this.offsetX,offsetY:o.offsetY||this.offsetY,panelClass:o.panelClass||void 0}));return e.setOrigin(this._getOrigin()).withPositions(t).withFlexibleDimensions(this.flexibleDimensions).withPush(this.push).withGrowAfterOpen(this.growAfterOpen).withViewportMargin(this.viewportMargin).withLockedPosition(this.lockPosition).withTransformOriginOn(this.transformOriginSelector)}_createPositionStrategy(){let e=Fi(this._injector,this._getOrigin());return this._updatePositionStrategy(e),e}_getOrigin(){return this.origin instanceof Mi?this.origin.elementRef:this.origin}_getOriginElement(){return this.origin instanceof Mi?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(e=>{this.backdropClick.emit(e)}):this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe(),this.positionChange.observers.length>0&&(this._positionSubscription=this._position.positionChanges.pipe(Sn(()=>this.positionChange.observers.length>0)).subscribe(e=>{this._ngZone.run(()=>this.positionChange.emit(e)),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(t){return new(t||n)};static \u0275dir=L({type:n,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 n})();function Br(n){let i=h(O);return()=>ti(i)}var $r={provide:ko,useFactory:Br},gt=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=N({type:n});static \u0275inj=F({providers:[Ro,$r],imports:[fe,Ae,Oi,Oi]})}return n})();var Vr=new Set(["annotation-id","class","style","id","slot","title","hidden","dark","role","tabindex","ng-reflect-annotation-id","ng-version","_nghost","_ngcontent"]),Ui="__veltContext";function jr(n){let i={};try{if(!n?.attributes)return i;let e=n.attributes;for(let t=0;t<e.length;t++){let o=e[t].name.toLowerCase();Vr.has(o)||o.startsWith("_ng")||o.startsWith("ng-")||o.startsWith("data-")||o.startsWith("aria-")||o!=="velt-element"&&(i[o]=e[t].value)}}catch{}return i}function Hr(n,i){return m(m({},n||{}),i||{})}function To(n){try{let i=n?.[Ui];return i&&typeof i=="object"?i:void 0}catch{return}}var Ni=null,zi=null,Bi,$i=!1;function Te(){Ni=null,zi=null,Bi=void 0,$i=!1}function Gr(n,i){try{if(!n){Te();return}Ni=n,zi=n.parentElement,Bi=i,$i=!0}catch{Te()}}function bc(n){try{if(!n||!$i||Ni!==n)return;if(zi!==n.parentElement){Te();return}let i=Bi;return Te(),{payload:i}}catch{return}}function xo(n){try{let i=n||null;for(;i;){let e=i.parentElement;if(!e){let o=i.getRootNode?.();if(o instanceof ShadowRoot&&o.host){i=o.host;continue}break}let t=To(e);if(t)return{host:e,payload:t};i=e}}catch{}}function Wr(n){try{return n?!!n.annotationId||Object.keys(n.contextData||{}).length>0||n.data!==void 0||n.localUIState!==void 0||n.registry!==void 0:!1}catch{return!1}}function Sc(n,i){try{if(!n)return;if(Te(),!Wr(i)){Yr(n,i.ownerRef);return}return n[Ui]=i,i}catch{return}}function Yr(n,i){try{if(!n)return;Te();let e=To(n);if(e&&e.ownerRef!==i)return;n[Ui]=void 0}catch{}}function Ic(n){let{host:i,inherited:e,ownAnnotationId:t,ownData:o,registry:r,ownLocalUIState:s,ownerRef:a}=n,c=jr(i),l=Hr(e?.contextData,c),d;try{d=i?.getAttribute?.("annotation-id")||void 0}catch{}return{annotationId:t||d||e?.annotationId,contextData:l,data:o??e?.data,registry:r??e?.registry,localUIState:s??e?.localUIState,ownerRef:a}}function Kr(n){try{let i=xo(n);return Gr(n,i?.payload),i?.payload?.localUIState}catch{return}}function Dc(n){try{if(n.isRoot||n.fromExplicitInput)return!1;let i=Kr(n.host);if(!i||i===n.current)return!1;if(n.isOwner)try{n.current?.update?.(e=>m({},e))}catch{}return n.adopt(i),!0}catch{return!1}}function Ec(n){try{return xo(n)?.payload?.data}catch{return}}var ni="__veltRefreshContext",Qe=new Set;function Oc(n,i,e){try{if(!n||typeof e!="function")return;n[ni]={ownerRef:i,fn:e},Qe.add(n)}catch{}}function oi(n){try{let i=n?.[ni];return i&&typeof i.fn=="function"?i.fn:void 0}catch{return}}function wc(n,i){try{if(!n)return;let e=n[ni];if(e&&e.ownerRef!==i)return;n[ni]=void 0,Qe.delete(n)}catch{}}var Xr=64;function Zr(n){let i=[];return Qe.forEach(e=>{if(!oi(e)){Qe.delete(e);return}n.contains(e)&&i.push(e)}),i.length>1&&i.sort((e,t)=>e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1),i}function Qr(n){let i=[];return oi(n)&&i.push(n),n.querySelectorAll("*").forEach(e=>{oi(e)&&i.push(e)}),i}function Po(n){try{if(!n||n.nodeType!==Node.ELEMENT_NODE||(Te(),!Qe.size))return;let i=n;(Qe.size<=Xr?Zr(i):Qr(i)).forEach(t=>{let o=oi(t);try{o?.()}catch{}})}catch{}}var Mo="__veltHandled",Lo="velt",qe=new WeakSet,ri=0;function Fo(n){try{if(!n||qe.has(n))return;qe.add(n),ri++}catch{}}function si(n){try{if(!n||!qe.has(n))return;qe.delete(n),ri=Math.max(0,ri-1)}catch{}}function qr(n){try{if(!n||ri===0)return!1;let i=typeof n.composedPath=="function"?n.composedPath():null;if(i){for(let t of i)if(qe.has(t))return!0;return!1}let e=n.target;for(;e;){if(qe.has(e))return!0;e=e.parentNode}return!1}catch{return!1}}function Uo(n){try{if(!n||(n[Mo]=Lo,qr(n)))return;n.stopPropagation()}catch{}}function No(n){try{return n?n[Mo]===Lo:!1}catch{return!1}}var ce=new WeakMap,Hi=new WeakSet,Jr=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"]),es=new WeakSet;function Pc(n){try{return!!n}catch{return!1}}function Bo(n){try{return!!n&&Jr.has(n.tagName.toLowerCase())}catch{return!1}}function ts(n){try{return!!n&&n.nodeType===Node.ELEMENT_NODE}catch{return!1}}function Mc(n){try{if(!n)return;if(Hi.has(n))return ce.get(n);if(Hi.add(n),Bo(n)){es.add(n);return}let i=Array.from(n.childNodes).filter(ts);if(!i.length)return;let e={host:n,nodes:i,claimed:!1};return ce.set(n,e),e}catch{return}}function Lc(n){try{if(!n)return;!n.claimed&&n.nodes.some(e=>!!e.parentNode)&&ce.delete(n.host)}catch{}}var Vi=null,mt=[];function is(){try{for(let n=mt.length-1;n>=0;n--){let i=mt[n];i.host.isConnected||(i.nodes.forEach(e=>{try{e.parentNode?.hasAttribute?.("data-velt-children-park")&&e.parentNode.removeChild(e)}catch{}}),mt.splice(n,1))}}catch{}}function ns(){try{if(Vi?.isConnected)return Vi;let n=document.createElement("div");return n.setAttribute("data-velt-children-park","true"),n.style.display="none",document.body.appendChild(n),Vi=n,n}catch{return null}}function Fc(n){try{if(!n)return;let i=ce.get(n);if(!i||i.claimed||!i.nodes.some(o=>rs(o,r=>r.startsWith("velt-")||r.startsWith("snippyly-"))))return;let t=ns();if(!t)return;is(),i.nodes.forEach(o=>{try{o.parentNode!==t&&t.appendChild(o)}catch{}}),mt.some(o=>o.host===n)||mt.push({host:n,nodes:i.nodes})}catch{}}function Uc(n){try{if(!n)return;let i=ce.get(n);if(!i||i.claimed)return;console.warn(`[Velt] <${n.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 Nc(n){try{if(!n||Hi.has(n)||ce.has(n)||Bo(n)||!Array.from(n.childNodes).some(e=>e.nodeType===Node.TEXT_NODE&&!!(e.textContent||"").trim()))return;console.warn(`[Velt] <${n.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 zc(n){try{if(!n)return!1;let i=ce.get(n);return!!i&&i.nodes.length>0}catch{return!1}}function Bc(n){try{let i=!!n.wireframeTemplate||!!n.hasCustomerChildren;return!i&&!!n.shadowDom||i&&!!n.isExplicitShadowDom}catch{return!1}}function $c(n,i){try{if(!n)return;let e=ce.get(n);return!e||!e.nodes.length||e.claimed&&e.owner!==i?void 0:e}catch{return}}function os(n,i,e){try{if(!n)return;let t=ce.get(n);if(!t)return;let o=i.toLowerCase(),r=t.nodes.findIndex(a=>a.tagName.toLowerCase()===o);if(r===-1)return;let[s]=t.nodes.splice(r,1);return t.nodes.length||(t.claimed=!0,t.owner=e),s}catch{return}}var zo=class{constructor(i){this.triggerTagName=i}get isActive(){return!!this.element}take(i,e){try{return this.element&&si(this.element),this.element=os(i,this.triggerTagName,e),!!this.element}catch{return!1}}place(i){try{return!this.element||!i?.parentNode?!1:(i.parentNode.insertBefore(this.element,i.nextSibling),Fo(this.element),Po(this.element),!0)}catch{return!1}}release(i){try{this.element&&si(this.element),this.element&&i&&this.element.parentNode!==i&&i.appendChild(this.element),this.element=void 0}catch{}}},ji="data-velt-hidden",ai=new WeakMap;function $o(n,i){try{if(n.getAttribute(ji)==="true"===i)return;if(i)ai.has(n)||ai.set(n,n.style.display||""),n.setAttribute(ji,"true"),n.style.display="none";else{n.removeAttribute(ji);let t=ai.get(n);t?n.style.display=t:n.style.removeProperty("display"),ai.delete(n)}}catch{}}function Vc(n,i){try{return n?(n.claimed=!0,n.owner=i,$o(n.host,!1),n.nodes):[]}catch{return[]}}function jc(n,i){try{if(!n||n.owner!==i)return;n.claimed=!1,n.owner=void 0,$o(n.host,!0),n.nodes.forEach(e=>{si(e);try{e.parentNode!==n.host&&n.host.appendChild(e)}catch{}})}catch{}}function rs(n,i){try{if(i(n.tagName.toLowerCase()))return!0;let e=n.querySelectorAll("*");for(let t=0;t<e.length;t++)if(i(e[t].tagName.toLowerCase()))return!0;return!1}catch{return!1}}function Gi(n){return n.buttons===0||n.detail===0}function Wi(n){let i=n.touches&&n.touches[0]||n.changedTouches&&n.changedTouches[0];return!!i&&i.identifier===-1&&(i.radiusX==null||i.radiusX===1)&&(i.radiusY==null||i.radiusY===1)}var _t;function ss(){if(_t==null&&typeof window<"u")try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>_t=!0}))}finally{_t=_t||!1}return _t}function Vo(n){return ss()?n:!!n.capture}var jo=new A("cdk-input-modality-detector-options"),Ho={ignoreKeys:[18,17,224,91,16]},Go=650,Yi={passive:!0,capture:!0},Wo=(()=>{class n{_platform=h(H);_listenerCleanups;modalityDetected;modalityChanged;get mostRecentModality(){return this._modality.value}_mostRecentTarget=null;_modality=new I(null);_options;_lastTouchMs=0;_onKeydown=e=>{this._options?.ignoreKeys?.some(t=>t===e.keyCode)||(this._modality.next("keyboard"),this._mostRecentTarget=ee(e))};_onMousedown=e=>{Date.now()-this._lastTouchMs<Go||(this._modality.next(Gi(e)?"keyboard":"mouse"),this._mostRecentTarget=ee(e))};_onTouchstart=e=>{if(Wi(e)){this._modality.next("keyboard");return}this._lastTouchMs=Date.now(),this._modality.next("touch"),this._mostRecentTarget=ee(e)};constructor(){let e=h(U),t=h(M),o=h(jo,{optional:!0});if(this._options=m(m({},Ho),o),this.modalityDetected=this._modality.pipe(bn(1)),this.modalityChanged=this.modalityDetected.pipe(X()),this._platform.isBrowser){let r=h(oe).createRenderer(null,null);this._listenerCleanups=e.runOutsideAngular(()=>[r.listen(t,"keydown",this._onKeydown,Yi),r.listen(t,"mousedown",this._onMousedown,Yi),r.listen(t,"touchstart",this._onTouchstart,Yi)])}}ngOnDestroy(){this._modality.complete(),this._listenerCleanups?.forEach(e=>e())}static \u0275fac=function(t){return new(t||n)};static \u0275prov=b({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),vt=(function(n){return n[n.IMMEDIATE=0]="IMMEDIATE",n[n.EVENTUAL=1]="EVENTUAL",n})(vt||{}),Yo=new A("cdk-focus-monitor-default-options"),ci=Vo({passive:!0,capture:!0}),Ki=(()=>{class n{_ngZone=h(U);_platform=h(H);_inputModalityDetector=h(Wo);_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=h(M);_stopInputModalityDetector=new y;constructor(){let e=h(Yo,{optional:!0});this._detectionMode=e?.detectionMode||vt.IMMEDIATE}_rootNodeFocusAndBlurListener=e=>{let t=ee(e);for(let o=t;o;o=o.parentElement)e.type==="focus"?this._onFocus(e,o):this._onBlur(e,o)};monitor(e,t=!1){let o=De(e);if(!this._platform.isBrowser||o.nodeType!==1)return _();let r=po(o)||this._document,s=this._elementInfo.get(o);if(s)return t&&(s.checkChildren=!0),s.subject;let a={checkChildren:t,subject:new y,rootNode:r};return this._elementInfo.set(o,a),this._registerGlobalListeners(a),a.subject}stopMonitoring(e){let t=De(e),o=this._elementInfo.get(t);o&&(o.subject.complete(),this._setClasses(t),this._elementInfo.delete(t),this._removeGlobalListeners(o))}focusVia(e,t,o){let r=De(e),s=this._document.activeElement;r===s?this._getClosestElementsInfo(r).forEach(([a,c])=>this._originChanged(a,t,c)):(this._setOrigin(t),typeof r.focus=="function"&&r.focus(o))}ngOnDestroy(){this._elementInfo.forEach((e,t)=>this.stopMonitoring(t))}_getWindow(){return this._document.defaultView||window}_getFocusOrigin(e){return this._origin?this._originFromTouchInteraction?this._shouldBeAttributedToTouch(e)?"touch":"program":this._origin:this._windowFocused&&this._lastFocusOrigin?this._lastFocusOrigin:e&&this._isLastInteractionFromInputLabel(e)?"mouse":"program"}_shouldBeAttributedToTouch(e){return this._detectionMode===vt.EVENTUAL||!!e?.contains(this._inputModalityDetector._mostRecentTarget)}_setClasses(e,t){e.classList.toggle("cdk-focused",!!t),e.classList.toggle("cdk-touch-focused",t==="touch"),e.classList.toggle("cdk-keyboard-focused",t==="keyboard"),e.classList.toggle("cdk-mouse-focused",t==="mouse"),e.classList.toggle("cdk-program-focused",t==="program")}_setOrigin(e,t=!1){this._ngZone.runOutsideAngular(()=>{if(this._origin=e,this._originFromTouchInteraction=e==="touch"&&t,this._detectionMode===vt.IMMEDIATE){clearTimeout(this._originTimeoutId);let o=this._originFromTouchInteraction?Go:1;this._originTimeoutId=setTimeout(()=>this._origin=null,o)}})}_onFocus(e,t){let o=this._elementInfo.get(t),r=ee(e);!o||!o.checkChildren&&t!==r||this._originChanged(t,this._getFocusOrigin(r),o)}_onBlur(e,t){let o=this._elementInfo.get(t);!o||o.checkChildren&&e.relatedTarget instanceof Node&&t.contains(e.relatedTarget)||(this._setClasses(t),this._emitOrigin(o,null))}_emitOrigin(e,t){e.subject.observers.length&&this._ngZone.run(()=>e.subject.next(t))}_registerGlobalListeners(e){if(!this._platform.isBrowser)return;let t=e.rootNode,o=this._rootNodeFocusListenerCount.get(t)||0;o||this._ngZone.runOutsideAngular(()=>{t.addEventListener("focus",this._rootNodeFocusAndBlurListener,ci),t.addEventListener("blur",this._rootNodeFocusAndBlurListener,ci)}),this._rootNodeFocusListenerCount.set(t,o+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(e){let t=e.rootNode;if(this._rootNodeFocusListenerCount.has(t)){let o=this._rootNodeFocusListenerCount.get(t);o>1?this._rootNodeFocusListenerCount.set(t,o-1):(t.removeEventListener("focus",this._rootNodeFocusAndBlurListener,ci),t.removeEventListener("blur",this._rootNodeFocusAndBlurListener,ci),this._rootNodeFocusListenerCount.delete(t))}--this._monitoredElementCount||(this._getWindow().removeEventListener("focus",this._windowFocusListener),this._stopInputModalityDetector.next(),clearTimeout(this._windowFocusTimeoutId),clearTimeout(this._originTimeoutId))}_originChanged(e,t,o){this._setClasses(e,t),this._emitOrigin(o,t),this._lastFocusOrigin=t}_getClosestElementsInfo(e){let t=[];return this._elementInfo.forEach((o,r)=>{(r===e||o.checkChildren&&r.contains(e))&&t.push([r,o])}),t}_isLastInteractionFromInputLabel(e){let{_mostRecentTarget:t,mostRecentModality:o}=this._inputModalityDetector;if(o!=="mouse"||!t||t===e||e.nodeName!=="INPUT"&&e.nodeName!=="TEXTAREA"||e.disabled)return!1;let r=e.labels;if(r){for(let s=0;s<r.length;s++)if(r[s].contains(t))return!0}return!1}static \u0275fac=function(t){return new(t||n)};static \u0275prov=b({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var Ko=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275cmp=G({type:n,selectors:[["ng-component"]],exportAs:["cdkVisuallyHidden"],decls:0,vars:0,template:function(t,o){},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 n})();var as=(()=>{class n{create(e){return typeof MutationObserver>"u"?null:new MutationObserver(e)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=b({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var Xo=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=N({type:n});static \u0275inj=F({providers:[as]})}return n})();var Qi=(()=>{class n{_platform=h(H);constructor(){}isDisabled(e){return e.hasAttribute("disabled")}isVisible(e){return ls(e)&&getComputedStyle(e).visibility==="visible"}isTabbable(e){if(!this._platform.isBrowser)return!1;let t=cs(_s(e));if(t&&(Zo(t)===-1||!this.isVisible(t)))return!1;let o=e.nodeName.toLowerCase(),r=Zo(e);return e.hasAttribute("contenteditable")?r!==-1:o==="iframe"||o==="object"||this._platform.WEBKIT&&this._platform.IOS&&!gs(e)?!1:o==="audio"?e.hasAttribute("controls")?r!==-1:!1:o==="video"?r===-1?!1:r!==null?!0:this._platform.FIREFOX||e.hasAttribute("controls"):e.tabIndex>=0}isFocusable(e,t){return ms(e)&&!this.isDisabled(e)&&(t?.ignoreVisibility||this.isVisible(e))}static \u0275fac=function(t){return new(t||n)};static \u0275prov=b({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function cs(n){try{return n.frameElement}catch{return null}}function ls(n){return!!(n.offsetWidth||n.offsetHeight||typeof n.getClientRects=="function"&&n.getClientRects().length)}function ds(n){let i=n.nodeName.toLowerCase();return i==="input"||i==="select"||i==="button"||i==="textarea"}function hs(n){return fs(n)&&n.type=="hidden"}function us(n){return ps(n)&&n.hasAttribute("href")}function fs(n){return n.nodeName.toLowerCase()=="input"}function ps(n){return n.nodeName.toLowerCase()=="a"}function Jo(n){if(!n.hasAttribute("tabindex")||n.tabIndex===void 0)return!1;let i=n.getAttribute("tabindex");return!!(i&&!isNaN(parseInt(i,10)))}function Zo(n){if(!Jo(n))return null;let i=parseInt(n.getAttribute("tabindex")||"",10);return isNaN(i)?-1:i}function gs(n){let i=n.nodeName.toLowerCase(),e=i==="input"&&n.type;return e==="text"||e==="password"||i==="select"||i==="textarea"}function ms(n){return hs(n)?!1:ds(n)||us(n)||n.hasAttribute("contenteditable")||Jo(n)}function _s(n){return n.ownerDocument&&n.ownerDocument.defaultView||window}var Zi=class{_element;_checker;_ngZone;_document;_injector;_startAnchor;_endAnchor;_hasAttached=!1;startAnchorListener=()=>this.focusLastTabbableElement();endAnchorListener=()=>this.focusFirstTabbableElement();get enabled(){return this._enabled}set enabled(i){this._enabled=i,this._startAnchor&&this._endAnchor&&(this._toggleAnchorTabIndex(i,this._startAnchor),this._toggleAnchorTabIndex(i,this._endAnchor))}_enabled=!0;constructor(i,e,t,o,r=!1,s){this._element=i,this._checker=e,this._ngZone=t,this._document=o,this._injector=s,r||this.attachAnchors()}destroy(){let i=this._startAnchor,e=this._endAnchor;i&&(i.removeEventListener("focus",this.startAnchorListener),i.remove()),e&&(e.removeEventListener("focus",this.endAnchorListener),e.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(i){return new Promise(e=>{this._executeOnStable(()=>e(this.focusInitialElement(i)))})}focusFirstTabbableElementWhenReady(i){return new Promise(e=>{this._executeOnStable(()=>e(this.focusFirstTabbableElement(i)))})}focusLastTabbableElementWhenReady(i){return new Promise(e=>{this._executeOnStable(()=>e(this.focusLastTabbableElement(i)))})}_getRegionBoundary(i){let e=this._element.querySelectorAll(`[cdk-focus-region-${i}], [cdkFocusRegion${i}], [cdk-focus-${i}]`);return i=="start"?e.length?e[0]:this._getFirstTabbableElement(this._element):e.length?e[e.length-1]:this._getLastTabbableElement(this._element)}focusInitialElement(i){let e=this._element.querySelector("[cdk-focus-initial], [cdkFocusInitial]");if(e){if(!this._checker.isFocusable(e)){let t=this._getFirstTabbableElement(e);return t?.focus(i),!!t}return e.focus(i),!0}return this.focusFirstTabbableElement(i)}focusFirstTabbableElement(i){let e=this._getRegionBoundary("start");return e&&e.focus(i),!!e}focusLastTabbableElement(i){let e=this._getRegionBoundary("end");return e&&e.focus(i),!!e}hasAttached(){return this._hasAttached}_getFirstTabbableElement(i){if(this._checker.isFocusable(i)&&this._checker.isTabbable(i))return i;let e=i.children;for(let t=0;t<e.length;t++){let o=e[t].nodeType===this._document.ELEMENT_NODE?this._getFirstTabbableElement(e[t]):null;if(o)return o}return null}_getLastTabbableElement(i){if(this._checker.isFocusable(i)&&this._checker.isTabbable(i))return i;let e=i.children;for(let t=e.length-1;t>=0;t--){let o=e[t].nodeType===this._document.ELEMENT_NODE?this._getLastTabbableElement(e[t]):null;if(o)return o}return null}_createAnchor(){let i=this._document.createElement("div");return this._toggleAnchorTabIndex(this._enabled,i),i.classList.add("cdk-visually-hidden"),i.classList.add("cdk-focus-trap-anchor"),i.setAttribute("aria-hidden","true"),i}_toggleAnchorTabIndex(i,e){i?e.setAttribute("tabindex","0"):e.removeAttribute("tabindex")}toggleAnchors(i){this._startAnchor&&this._endAnchor&&(this._toggleAnchorTabIndex(i,this._startAnchor),this._toggleAnchorTabIndex(i,this._endAnchor))}_executeOnStable(i){this._injector?ne(i,{injector:this._injector}):setTimeout(i)}},qi=(()=>{class n{_checker=h(Qi);_ngZone=h(U);_document=h(M);_injector=h(O);constructor(){h(Ye).load(Ko)}create(e,t=!1){return new Zi(e,this._checker,this._ngZone,this._document,t,this._injector)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=b({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var me=(function(n){return n[n.NONE=0]="NONE",n[n.BLACK_ON_WHITE=1]="BLACK_ON_WHITE",n[n.WHITE_ON_BLACK=2]="WHITE_ON_BLACK",n})(me||{}),Qo="cdk-high-contrast-black-on-white",qo="cdk-high-contrast-white-on-black",Xi="cdk-high-contrast-active",li=(()=>{class n{_platform=h(H);_hasCheckedHighContrastMode;_document=h(M);_breakpointSubscription;constructor(){this._breakpointSubscription=h(Hn).observe("(forced-colors: active)").subscribe(()=>{this._hasCheckedHighContrastMode&&(this._hasCheckedHighContrastMode=!1,this._applyBodyHighContrastModeCssClasses())})}getHighContrastMode(){if(!this._platform.isBrowser)return me.NONE;let e=this._document.createElement("div");e.style.backgroundColor="rgb(1,2,3)",e.style.position="absolute",this._document.body.appendChild(e);let t=this._document.defaultView||window,o=t&&t.getComputedStyle?t.getComputedStyle(e):null,r=(o&&o.backgroundColor||"").replace(/ /g,"");switch(e.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 e=this._document.body.classList;e.remove(Xi,Qo,qo),this._hasCheckedHighContrastMode=!0;let t=this.getHighContrastMode();t===me.BLACK_ON_WHITE?e.add(Xi,Qo):t===me.WHITE_ON_BLACK&&e.add(Xi,qo)}}static \u0275fac=function(t){return new(t||n)};static \u0275prov=b({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),Ji=(()=>{class n{constructor(){h(li)._applyBodyHighContrastModeCssClasses()}static \u0275fac=function(t){return new(t||n)};static \u0275mod=N({type:n});static \u0275inj=F({imports:[Xo]})}return n})();function vs(n,i){}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 tn=(()=>{class n extends We{_elementRef=h(R);_focusTrapFactory=h(qi);_config;_interactivityChecker=h(Qi);_ngZone=h(U);_focusMonitor=h(Ki);_renderer=h(Fe);_changeDetectorRef=h($e);_injector=h(O);_platform=h(H);_document=h(M);_portalOutlet;_focusTrapped=new y;_focusTrap=null;_elementFocusedBeforeDialogWasOpened=null;_closeInteractionType=null;_ariaLabelledByQueue=[];_isDestroyed=!1;constructor(){super(),this._config=h(_e,{optional:!0})||new _e,this._config.ariaLabelledBy&&this._ariaLabelledByQueue.push(this._config.ariaLabelledBy)}_addAriaLabelledBy(e){this._ariaLabelledByQueue.push(e),this._changeDetectorRef.markForCheck()}_removeAriaLabelledBy(e){let t=this._ariaLabelledByQueue.indexOf(e);t>-1&&(this._ariaLabelledByQueue.splice(t,1),this._changeDetectorRef.markForCheck())}_contentAttached(){this._initializeFocusTrap(),this._captureInitialFocus()}_captureInitialFocus(){this._trapFocus()}ngOnDestroy(){this._focusTrapped.complete(),this._isDestroyed=!0,this._restoreFocus()}attachComponentPortal(e){this._portalOutlet.hasAttached();let t=this._portalOutlet.attachComponentPortal(e);return this._contentAttached(),t}attachTemplatePortal(e){this._portalOutlet.hasAttached();let t=this._portalOutlet.attachTemplatePortal(e);return this._contentAttached(),t}attachDomPortal=e=>{this._portalOutlet.hasAttached();let t=this._portalOutlet.attachDomPortal(e);return this._contentAttached(),t};_recaptureFocus(){this._containsFocus()||this._trapFocus()}_forceFocus(e,t){this._interactivityChecker.isFocusable(e)||(e.tabIndex=-1,this._ngZone.runOutsideAngular(()=>{let o=()=>{r(),s(),e.removeAttribute("tabindex")},r=this._renderer.listen(e,"blur",o),s=this._renderer.listen(e,"mousedown",o)})),e.focus(t)}_focusByCssSelector(e,t){let o=this._elementRef.nativeElement.querySelector(e);o&&this._forceFocus(o,t)}_trapFocus(e){this._isDestroyed||ne(()=>{let t=this._elementRef.nativeElement;switch(this._config.autoFocus){case!1:case"dialog":this._containsFocus()||t.focus(e);break;case!0:case"first-tabbable":this._focusTrap?.focusInitialElement(e)||this._focusDialogContainer(e);break;case"first-heading":this._focusByCssSelector('h1, h2, h3, h4, h5, h6, [role="heading"]',e);break;default:this._focusByCssSelector(this._config.autoFocus,e);break}this._focusTrapped.next()},{injector:this._injector})}_restoreFocus(){let e=this._config.restoreFocus,t=null;if(typeof e=="string"?t=this._document.querySelector(e):typeof e=="boolean"?t=e?this._elementFocusedBeforeDialogWasOpened:null:e&&(t=e),this._config.restoreFocus&&t&&typeof t.focus=="function"){let o=Yt(),r=this._elementRef.nativeElement;(!o||o===this._document.body||o===r||r.contains(o))&&(this._focusMonitor?(this._focusMonitor.focusVia(t,this._closeInteractionType),this._closeInteractionType=null):t.focus())}this._focusTrap&&this._focusTrap.destroy()}_focusDialogContainer(e){this._elementRef.nativeElement.focus?.(e)}_containsFocus(){let e=this._elementRef.nativeElement,t=Yt();return e===t||e.contains(t)}_initializeFocusTrap(){this._platform.isBrowser&&(this._focusTrap=this._focusTrapFactory.create(this._elementRef.nativeElement),this._document&&(this._elementFocusedBeforeDialogWasOpened=Yt()))}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=G({type:n,selectors:[["cdk-dialog-container"]],viewQuery:function(t,o){if(t&1&&Tt(ut,7),t&2){let r;xt(r=Pt())&&(o._portalOutlet=r.first)}},hostAttrs:["tabindex","-1",1,"cdk-dialog-container"],hostVars:6,hostBindings:function(t,o){t&2&&ue("id",o._config.id||null)("role",o._config.role)("aria-modal",o._config.ariaModal)("aria-labelledby",o._config.ariaLabel?null:o._ariaLabelledByQueue[0])("aria-label",o._config.ariaLabel)("aria-describedby",o._config.ariaDescribedBy||null)},features:[W],decls:1,vars:0,consts:[["cdkPortalOutlet",""]],template:function(t,o){t&1&&kt(0,vs,0,0,"ng-template",0)},dependencies:[ut],styles:[`.cdk-dialog-container{display:block;width:100%;height:100%;min-height:inherit;max-height:inherit}
5
+ `],encapsulation:2})}return n})(),yt=class{overlayRef;config;componentInstance;componentRef;containerInstance;disableClose;closed=new y;backdropClick;keydownEvents;outsidePointerEvents;id;_detachSubscription;constructor(i,e){this.overlayRef=i,this.config=e,this.disableClose=e.disableClose,this.backdropClick=i.backdropClick(),this.keydownEvents=i.keydownEvents(),this.outsidePointerEvents=i.outsidePointerEvents(),this.id=e.id,this.keydownEvents.subscribe(t=>{t.keyCode===27&&!this.disableClose&&!ge(t)&&(t.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=i.detachments().subscribe(()=>{e.closeOnOverlayDetachments!==!1&&this.close()})}close(i,e){if(this._canClose(i)){let t=this.closed;this.containerInstance._closeInteractionType=e?.focusOrigin||"program",this._detachSubscription.unsubscribe(),this.overlayRef.dispose(),t.next(i),t.complete(),this.componentInstance=this.containerInstance=null}}updatePosition(){return this.overlayRef.updatePosition(),this}updateSize(i="",e=""){return this.overlayRef.updateSize({width:i,height:e}),this}addPanelClass(i){return this.overlayRef.addPanelClass(i),this}removePanelClass(i){return this.overlayRef.removePanelClass(i),this}_canClose(i){let e=this.config;return!!this.containerInstance&&(!e.closePredicate||e.closePredicate(i,e,this.componentInstance))}},ys=new A("DialogScrollStrategy",{providedIn:"root",factory:()=>{let n=h(O);return()=>Xe(n)}}),Cs=new A("DialogData"),bs=new A("DefaultDialogConfig");function Ss(n){let i=j(n),e=new B;return{valueSignal:i,get value(){return i()},change:e,ngOnDestroy(){e.complete()}}}var nn=(()=>{class n{_injector=h(O);_defaultOptions=h(bs,{optional:!0});_parentDialog=h(n,{optional:!0,skipSelf:!0});_overlayContainer=h(ii);_idGenerator=h(pe);_openDialogsAtThisLevel=[];_afterAllClosedAtThisLevel=new y;_afterOpenedAtThisLevel=new y;_ariaHiddenElements=new Map;_scrollStrategy=h(ys);get openDialogs(){return this._parentDialog?this._parentDialog.openDialogs:this._openDialogsAtThisLevel}get afterOpened(){return this._parentDialog?this._parentDialog.afterOpened:this._afterOpenedAtThisLevel}afterAllClosed=Dt(()=>this.openDialogs.length?this._getAfterAllClosed():this._getAfterAllClosed().pipe(Ce(void 0)));constructor(){}open(e,t){let o=this._defaultOptions||new _e;t=m(m({},o),t),t.id=t.id||this._idGenerator.getId("cdk-dialog-"),t.id&&this.getDialogById(t.id);let r=this._getOverlayConfig(t),s=pt(this._injector,r),a=new yt(s,t),c=this._attachContainer(s,a,t);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(e,a,c,t),this.openDialogs.push(a),a.closed.subscribe(()=>this._removeOpenDialog(a,!0)),this.afterOpened.next(a),a}closeAll(){en(this.openDialogs,e=>e.close())}getDialogById(e){return this.openDialogs.find(t=>t.id===e)}ngOnDestroy(){en(this._openDialogsAtThisLevel,e=>{e.config.closeOnDestroy===!1&&this._removeOpenDialog(e,!1)}),en(this._openDialogsAtThisLevel,e=>e.close()),this._afterAllClosedAtThisLevel.complete(),this._afterOpenedAtThisLevel.complete(),this._openDialogsAtThisLevel=[]}_getOverlayConfig(e){let t=new ke({positionStrategy:e.positionStrategy||Ze().centerHorizontally().centerVertically(),scrollStrategy:e.scrollStrategy||this._scrollStrategy(),panelClass:e.panelClass,hasBackdrop:e.hasBackdrop,direction:e.direction,minWidth:e.minWidth,minHeight:e.minHeight,maxWidth:e.maxWidth,maxHeight:e.maxHeight,width:e.width,height:e.height,disposeOnNavigation:e.closeOnNavigation,disableAnimations:e.disableAnimations});return e.backdropClass&&(t.backdropClass=e.backdropClass),t}_attachContainer(e,t,o){let r=o.injector||o.viewContainerRef?.injector,s=[{provide:_e,useValue:o},{provide:yt,useValue:t},{provide:Ke,useValue:e}],a;o.container?typeof o.container=="function"?a=o.container:(a=o.container.type,s.push(...o.container.providers(o))):a=tn;let c=new Ge(a,o.viewContainerRef,O.create({parent:r||this._injector,providers:s}));return e.attach(c).instance}_attachDialogContent(e,t,o,r){if(e instanceof be){let s=this._createInjector(r,t,o,void 0),a={$implicit:r.data,dialogRef:t};r.templateContext&&(a=m(m({},a),typeof r.templateContext=="function"?r.templateContext():r.templateContext)),o.attachTemplatePortal(new we(e,null,a,s))}else{let s=this._createInjector(r,t,o,this._injector),a=o.attachComponentPortal(new Ge(e,r.viewContainerRef,s));t.componentRef=a,t.componentInstance=a.instance}}_createInjector(e,t,o,r){let s=e.injector||e.viewContainerRef?.injector,a=[{provide:Cs,useValue:e.data},{provide:yt,useValue:t}];return e.providers&&(typeof e.providers=="function"?a.push(...e.providers(t,e,o)):a.push(...e.providers)),e.direction&&(!s||!s.get(ae,null,{optional:!0}))&&a.push({provide:ae,useValue:Ss(e.direction)}),O.create({parent:s||r,providers:a})}_removeOpenDialog(e,t){let o=this.openDialogs.indexOf(e);o>-1&&(this.openDialogs.splice(o,1),this.openDialogs.length||(this._ariaHiddenElements.forEach((r,s)=>{r?s.setAttribute("aria-hidden",r):s.removeAttribute("aria-hidden")}),this._ariaHiddenElements.clear(),t&&this._getAfterAllClosed().next()))}_hideNonDialogContentFromAssistiveTechnology(e){if(e.parentElement){let t=e.parentElement.children;for(let o=t.length-1;o>-1;o--){let r=t[o];r!==e&&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 e=this._parentDialog;return e?e._getAfterAllClosed():this._afterAllClosedAtThisLevel}static \u0275fac=function(t){return new(t||n)};static \u0275prov=b({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function en(n,i){let e=n.length;for(;e--;)i(n[e])}var er=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=N({type:n});static \u0275inj=F({providers:[nn],imports:[gt,Ae,Ji,Ae]})}return n})();var Is=new A("MATERIAL_ANIMATIONS");var tr=null;function Ds(){return h(Is,{optional:!0})?.animationsDisabled||h(Rt,{optional:!0})==="NoopAnimations"?"di-disabled":(tr??=h(jn).matchMedia("(prefers-reduced-motion)").matches,tr?"reduced-motion":"enabled")}function on(){return Ds()!=="enabled"}var Es=200,di=class{_letterKeyStream=new y;_items=[];_selectedItemIndex=-1;_pressedLetters=[];_skipPredicateFn;_selectedItem=new y;selectedItem=this._selectedItem;constructor(i,e){let t=typeof e?.debounceInterval=="number"?e.debounceInterval:Es;e?.skipPredicate&&(this._skipPredicateFn=e.skipPredicate),this.setItems(i),this._setupKeyHandler(t)}destroy(){this._pressedLetters=[],this._letterKeyStream.complete(),this._selectedItem.complete()}setCurrentSelectedItemIndex(i){this._selectedItemIndex=i}setItems(i){this._items=i}handleKey(i){let e=i.keyCode;i.key&&i.key.length===1?this._letterKeyStream.next(i.key.toLocaleUpperCase()):(e>=65&&e<=90||e>=48&&e<=57)&&this._letterKeyStream.next(String.fromCharCode(e))}isTyping(){return this._pressedLetters.length>0}reset(){this._pressedLetters=[]}_setupKeyHandler(i){this._letterKeyStream.pipe(Q(e=>this._pressedLetters.push(e)),At(i),E(()=>this._pressedLetters.length>0),S(()=>this._pressedLetters.join("").toLocaleUpperCase())).subscribe(e=>{for(let t=1;t<this._items.length+1;t++){let o=(this._selectedItemIndex+t)%this._items.length,r=this._items[o];if(!this._skipPredicateFn?.(r)&&r.getLabel?.().toLocaleUpperCase().trim().indexOf(e)===0){this._selectedItem.next(r);break}}this._pressedLetters=[]})}};var Je=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=i=>i.disabled;constructor(i,e){this._items=i,i instanceof gi?this._itemChangesSubscription=i.changes.subscribe(t=>this._itemsChanged(t.toArray())):Le(i)&&(this._effectRef=Be(()=>this._itemsChanged(i()),{injector:e}))}tabOut=new y;change=new y;skipPredicate(i){return this._skipPredicateFn=i,this}withWrap(i=!0){return this._wrap=i,this}withVerticalOrientation(i=!0){return this._vertical=i,this}withHorizontalOrientation(i){return this._horizontal=i,this}withAllowedModifierKeys(i){return this._allowedModifierKeys=i,this}withTypeAhead(i=200){this._typeaheadSubscription.unsubscribe();let e=this._getItemsArray();return this._typeahead=new di(e,{debounceInterval:typeof i=="number"?i:void 0,skipPredicate:t=>this._skipPredicateFn(t)}),this._typeaheadSubscription=this._typeahead.selectedItem.subscribe(t=>{this.setActiveItem(t)}),this}cancelTypeahead(){return this._typeahead?.reset(),this}withHomeAndEnd(i=!0){return this._homeAndEnd=i,this}withPageUpDown(i=!0,e=10){return this._pageUpAndDown={enabled:i,delta:e},this}setActiveItem(i){let e=this._activeItem();this.updateActiveItem(i),this._activeItem()!==e&&this.change.next(this._activeItemIndex())}onKeydown(i){let e=i.keyCode,o=["altKey","ctrlKey","metaKey","shiftKey"].every(r=>!i[r]||this._allowedModifierKeys.indexOf(r)>-1);switch(e){case 9:this.tabOut.next();return;case 40:if(this._vertical&&o){this.setNextItemActive();break}else return;case 38:if(this._vertical&&o){this.setPreviousItemActive();break}else return;case 39:if(this._horizontal&&o){this._horizontal==="rtl"?this.setPreviousItemActive():this.setNextItemActive();break}else return;case 37:if(this._horizontal&&o){this._horizontal==="rtl"?this.setNextItemActive():this.setPreviousItemActive();break}else return;case 36:if(this._homeAndEnd&&o){this.setFirstItemActive();break}else return;case 35:if(this._homeAndEnd&&o){this.setLastItemActive();break}else return;case 33:if(this._pageUpAndDown.enabled&&o){let r=this._activeItemIndex()-this._pageUpAndDown.delta;this._setActiveItemByIndex(r>0?r:0,1);break}else return;case 34:if(this._pageUpAndDown.enabled&&o){let r=this._activeItemIndex()+this._pageUpAndDown.delta,s=this._getItemsArray().length;this._setActiveItemByIndex(r<s?r:s-1,-1);break}else return;default:(o||ge(i,"shiftKey"))&&this._typeahead?.handleKey(i);return}this._typeahead?.reset(),i.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(i){let e=this._getItemsArray(),t=typeof i=="number"?i:e.indexOf(i),o=e[t];this._activeItem.set(o??null),this._activeItemIndex.set(t),this._typeahead?.setCurrentSelectedItemIndex(t)}destroy(){this._typeaheadSubscription.unsubscribe(),this._itemChangesSubscription?.unsubscribe(),this._effectRef?.destroy(),this._typeahead?.destroy(),this.tabOut.complete(),this.change.complete()}_setActiveItemByDelta(i){this._wrap?this._setActiveInWrapMode(i):this._setActiveInDefaultMode(i)}_setActiveInWrapMode(i){let e=this._getItemsArray();for(let t=1;t<=e.length;t++){let o=(this._activeItemIndex()+i*t+e.length)%e.length,r=e[o];if(!this._skipPredicateFn(r)){this.setActiveItem(o);return}}}_setActiveInDefaultMode(i){this._setActiveItemByIndex(this._activeItemIndex()+i,i)}_setActiveItemByIndex(i,e){let t=this._getItemsArray();if(t[i]){for(;this._skipPredicateFn(t[i]);)if(i+=e,!t[i])return;this.setActiveItem(i)}}_getItemsArray(){return Le(this._items)?this._items():this._items instanceof gi?this._items.toArray():this._items}_itemsChanged(i){this._typeahead?.setItems(i);let e=this._activeItem();if(e){let t=i.indexOf(e);t>-1&&t!==this._activeItemIndex()&&(this._activeItemIndex.set(t),this._typeahead?.setCurrentSelectedItemIndex(t))}}};var rn=class extends Je{setActiveItem(i){this.activeItem&&this.activeItem.setInactiveStyles(),super.setActiveItem(i),this.activeItem&&this.activeItem.setActiveStyles()}};var sn=class extends Je{_origin="program";setFocusOrigin(i){return this._origin=i,this}setActiveItem(i){super.setActiveItem(i),this.activeItem&&this.activeItem.focus(this._origin)}};var ir=" ";function Td(n,i,e){let t=nr(n,i);e=e.trim(),!t.some(o=>o.trim()===e)&&(t.push(e),n.setAttribute(i,t.join(ir)))}function xd(n,i,e){let t=nr(n,i);e=e.trim();let o=t.filter(r=>r!==e);o.length?n.setAttribute(i,o.join(ir)):n.removeAttribute(i)}function nr(n,i){return n.getAttribute(i)?.match(/\S+/g)??[]}var an=(()=>{class n{constructor(){h(li)._applyBodyHighContrastModeCssClasses()}static \u0275fac=function(t){return new(t||n)};static \u0275mod=N({type:n});static \u0275inj=F({imports:[fe,fe]})}return n})();function Os(n,i){}var bt=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},cn="mdc-dialog--open",or="mdc-dialog--opening",rr="mdc-dialog--closing",ws=150,As=75,cr=(()=>{class n extends tn{_animationStateChanged=new B;_animationsEnabled=!on();_actionSectionCount=0;_hostElement=this._elementRef.nativeElement;_enterAnimationDuration=this._animationsEnabled?ar(this._config.enterAnimationDuration)??ws:0;_exitAnimationDuration=this._animationsEnabled?ar(this._config.exitAnimationDuration)??As:0;_animationTimer=null;_contentAttached(){super._contentAttached(),this._startOpenAnimation()}_startOpenAnimation(){this._animationStateChanged.emit({state:"opening",totalTime:this._enterAnimationDuration}),this._animationsEnabled?(this._hostElement.style.setProperty(sr,`${this._enterAnimationDuration}ms`),this._requestAnimationFrame(()=>this._hostElement.classList.add(or,cn)),this._waitForAnimationToComplete(this._enterAnimationDuration,this._finishDialogOpen)):(this._hostElement.classList.add(cn),Promise.resolve().then(()=>this._finishDialogOpen()))}_startExitAnimation(){this._animationStateChanged.emit({state:"closing",totalTime:this._exitAnimationDuration}),this._hostElement.classList.remove(cn),this._animationsEnabled?(this._hostElement.style.setProperty(sr,`${this._exitAnimationDuration}ms`),this._requestAnimationFrame(()=>this._hostElement.classList.add(rr)),this._waitForAnimationToComplete(this._exitAnimationDuration,this._finishDialogClose)):Promise.resolve().then(()=>this._finishDialogClose())}_updateActionSectionCount(e){this._actionSectionCount+=e,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(or,rr)}_waitForAnimationToComplete(e,t){this._animationTimer!==null&&clearTimeout(this._animationTimer),this._animationTimer=setTimeout(t,e)}_requestAnimationFrame(e){this._ngZone.runOutsideAngular(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(e):e()})}_captureInitialFocus(){this._config.delayFocusTrap||this._trapFocus()}_openAnimationDone(e){this._config.delayFocusTrap&&this._trapFocus(),this._animationStateChanged.next({state:"opened",totalTime:e})}ngOnDestroy(){super.ngOnDestroy(),this._animationTimer!==null&&clearTimeout(this._animationTimer)}attachComponentPortal(e){let t=super.attachComponentPortal(e);return t.location.nativeElement.classList.add("mat-mdc-dialog-component-host"),t}static \u0275fac=(()=>{let e;return function(o){return(e||(e=he(n)))(o||n)}})();static \u0275cmp=G({type:n,selectors:[["mat-dialog-container"]],hostAttrs:["tabindex","-1",1,"mat-mdc-dialog-container","mdc-dialog"],hostVars:10,hostBindings:function(t,o){t&2&&(_i("id",o._config.id),ue("aria-modal",o._config.ariaModal)("role",o._config.role)("aria-labelledby",o._config.ariaLabel?null:o._ariaLabelledByQueue[0])("aria-label",o._config.ariaLabel)("aria-describedby",o._config.ariaDescribedBy||null),nt("_mat-animation-noopable",!o._animationsEnabled)("mat-mdc-dialog-container-with-actions",o._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(t,o){t&1&&(Tn(0,"div",0)(1,"div",1),kt(2,Os,0,0,"ng-template",2),xn()())},dependencies:[ut],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 n})(),sr="--mat-dialog-transition-duration";function ar(n){return n==null?null:typeof n=="number"?n:n.endsWith("ms")?se(n.substring(0,n.length-2)):n.endsWith("s")?se(n.substring(0,n.length-1))*1e3:n==="0"?0:null}var Ct=(function(n){return n[n.OPEN=0]="OPEN",n[n.CLOSING=1]="CLOSING",n[n.CLOSED=2]="CLOSED",n})(Ct||{}),et=class{_ref;_config;_containerInstance;componentInstance;componentRef;disableClose;id;_afterOpened=new y;_beforeClosed=new y;_result;_closeFallbackTimeout;_state=Ct.OPEN;_closeInteractionType;constructor(i,e,t){this._ref=i,this._config=e,this._containerInstance=t,this.disableClose=e.disableClose,this.id=i.id,i.addPanelClass("mat-mdc-dialog-panel"),t._animationStateChanged.pipe(E(o=>o.state==="opened"),te(1)).subscribe(()=>{this._afterOpened.next(),this._afterOpened.complete()}),t._animationStateChanged.pipe(E(o=>o.state==="closed"),te(1)).subscribe(()=>{clearTimeout(this._closeFallbackTimeout),this._finishDialogClose()}),i.overlayRef.detachments().subscribe(()=>{this._beforeClosed.next(this._result),this._beforeClosed.complete(),this._finishDialogClose()}),Et(this.backdropClick(),this.keydownEvents().pipe(E(o=>o.keyCode===27&&!this.disableClose&&!ge(o)))).subscribe(o=>{this.disableClose||(o.preventDefault(),ln(this,o.type==="keydown"?"keyboard":"mouse"))})}close(i){let e=this._config.closePredicate;e&&!e(i,this._config,this.componentInstance)||(this._result=i,this._containerInstance._animationStateChanged.pipe(E(t=>t.state==="closing"),te(1)).subscribe(t=>{this._beforeClosed.next(i),this._beforeClosed.complete(),this._ref.overlayRef.detachBackdrop(),this._closeFallbackTimeout=setTimeout(()=>this._finishDialogClose(),t.totalTime+100)}),this._state=Ct.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(i){let e=this._ref.config.positionStrategy;return i&&(i.left||i.right)?i.left?e.left(i.left):e.right(i.right):e.centerHorizontally(),i&&(i.top||i.bottom)?i.top?e.top(i.top):e.bottom(i.bottom):e.centerVertically(),this._ref.updatePosition(),this}updateSize(i="",e=""){return this._ref.updateSize(i,e),this}addPanelClass(i){return this._ref.addPanelClass(i),this}removePanelClass(i){return this._ref.removePanelClass(i),this}getState(){return this._state}_finishDialogClose(){this._state=Ct.CLOSED,this._ref.close(this._result,{focusOrigin:this._closeInteractionType}),this.componentInstance=null}};function ln(n,i,e){return n._closeInteractionType=i,n.close(e)}var lr=new A("MatMdcDialogData"),dr=new A("mat-mdc-dialog-default-options"),hr=new A("mat-mdc-dialog-scroll-strategy",{providedIn:"root",factory:()=>{let n=h(O);return()=>Xe(n)}}),hi=(()=>{class n{_defaultOptions=h(dr,{optional:!0});_scrollStrategy=h(hr);_parentDialog=h(n,{optional:!0,skipSelf:!0});_idGenerator=h(pe);_injector=h(O);_dialog=h(nn);_animationsDisabled=on();_openDialogsAtThisLevel=[];_afterAllClosedAtThisLevel=new y;_afterOpenedAtThisLevel=new y;dialogConfigClass=bt;_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 e=this._parentDialog;return e?e._getAfterAllClosed():this._afterAllClosedAtThisLevel}afterAllClosed=Dt(()=>this.openDialogs.length?this._getAfterAllClosed():this._getAfterAllClosed().pipe(Ce(void 0)));constructor(){this._dialogRefConstructor=et,this._dialogContainerType=cr,this._dialogDataToken=lr}open(e,t){let o;t=m(m({},this._defaultOptions||new bt),t),t.id=t.id||this._idGenerator.getId("mat-mdc-dialog-"),t.scrollStrategy=t.scrollStrategy||this._scrollStrategy();let r=this._dialog.open(e,k(m({},t),{positionStrategy:Ze(this._injector).centerHorizontally().centerVertically(),disableClose:!0,closePredicate:void 0,closeOnDestroy:!1,closeOnOverlayDetachments:!1,disableAnimations:this._animationsDisabled||t.enterAnimationDuration?.toLocaleString()==="0"||t.exitAnimationDuration?.toString()==="0",container:{type:this._dialogContainerType,providers:()=>[{provide:this.dialogConfigClass,useValue:t},{provide:_e,useValue:t}]},templateContext:()=>({dialogRef:o}),providers:(s,a,c)=>(o=new this._dialogRefConstructor(s,t,c),o.updatePosition(t?.position),[{provide:this._dialogContainerType,useValue:c},{provide:this._dialogDataToken,useValue:a.data},{provide:this._dialogRefConstructor,useValue:o}])}));return o.componentRef=r.componentRef,o.componentInstance=r.componentInstance,this.openDialogs.push(o),this.afterOpened.next(o),o.afterClosed().subscribe(()=>{let s=this.openDialogs.indexOf(o);s>-1&&(this.openDialogs.splice(s,1),this.openDialogs.length||this._getAfterAllClosed().next())}),o}closeAll(){this._closeDialogs(this.openDialogs)}getDialogById(e){return this.openDialogs.find(t=>t.id===e)}ngOnDestroy(){this._closeDialogs(this._openDialogsAtThisLevel),this._afterAllClosedAtThisLevel.complete(),this._afterOpenedAtThisLevel.complete()}_closeDialogs(e){let t=e.length;for(;t--;)e[t].close()}static \u0275fac=function(t){return new(t||n)};static \u0275prov=b({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),Rs=(()=>{class n{dialogRef=h(et,{optional:!0});_elementRef=h(R);_dialog=h(hi);ariaLabel;type="button";dialogResult;_matDialogClose;constructor(){}ngOnInit(){this.dialogRef||(this.dialogRef=fr(this._elementRef,this._dialog.openDialogs))}ngOnChanges(e){let t=e._matDialogClose||e._matDialogCloseResult;t&&(this.dialogResult=t.currentValue)}_onButtonClick(e){ln(this.dialogRef,e.screenX===0&&e.screenY===0?"keyboard":"mouse",this.dialogResult)}static \u0275fac=function(t){return new(t||n)};static \u0275dir=L({type:n,selectors:[["","mat-dialog-close",""],["","matDialogClose",""]],hostVars:2,hostBindings:function(t,o){t&1&&Fn("click",function(s){return o._onButtonClick(s)}),t&2&&ue("aria-label",o.ariaLabel||null)("type",o.type)},inputs:{ariaLabel:[0,"aria-label","ariaLabel"],type:"type",dialogResult:[0,"mat-dialog-close","dialogResult"],_matDialogClose:[0,"matDialogClose","_matDialogClose"]},exportAs:["matDialogClose"],features:[ie]})}return n})(),ur=(()=>{class n{_dialogRef=h(et,{optional:!0});_elementRef=h(R);_dialog=h(hi);constructor(){}ngOnInit(){this._dialogRef||(this._dialogRef=fr(this._elementRef,this._dialog.openDialogs)),this._dialogRef&&Promise.resolve().then(()=>{this._onAdd()})}ngOnDestroy(){this._dialogRef?._containerInstance&&Promise.resolve().then(()=>{this._onRemove()})}static \u0275fac=function(t){return new(t||n)};static \u0275dir=L({type:n})}return n})(),ks=(()=>{class n extends ur{id=h(pe).getId("mat-mdc-dialog-title-");_onAdd(){this._dialogRef._containerInstance?._addAriaLabelledBy?.(this.id)}_onRemove(){this._dialogRef?._containerInstance?._removeAriaLabelledBy?.(this.id)}static \u0275fac=(()=>{let e;return function(o){return(e||(e=he(n)))(o||n)}})();static \u0275dir=L({type:n,selectors:[["","mat-dialog-title",""],["","matDialogTitle",""]],hostAttrs:[1,"mat-mdc-dialog-title","mdc-dialog__title"],hostVars:1,hostBindings:function(t,o){t&2&&_i("id",o.id)},inputs:{id:"id"},exportAs:["matDialogTitle"],features:[W]})}return n})(),Ts=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275dir=L({type:n,selectors:[["","mat-dialog-content",""],["mat-dialog-content"],["","matDialogContent",""]],hostAttrs:[1,"mat-mdc-dialog-content","mdc-dialog__content"],features:[kn([dt])]})}return n})(),xs=(()=>{class n extends ur{align;_onAdd(){this._dialogRef._containerInstance?._updateActionSectionCount?.(1)}_onRemove(){this._dialogRef._containerInstance?._updateActionSectionCount?.(-1)}static \u0275fac=(()=>{let e;return function(o){return(e||(e=he(n)))(o||n)}})();static \u0275dir=L({type:n,selectors:[["","mat-dialog-actions",""],["mat-dialog-actions"],["","matDialogActions",""]],hostAttrs:[1,"mat-mdc-dialog-actions","mdc-dialog__actions"],hostVars:6,hostBindings:function(t,o){t&2&&nt("mat-mdc-dialog-actions-align-start",o.align==="start")("mat-mdc-dialog-actions-align-center",o.align==="center")("mat-mdc-dialog-actions-align-end",o.align==="end")},inputs:{align:"align"},features:[W]})}return n})();function fr(n,i){let e=n.nativeElement.parentElement;for(;e&&!e.classList.contains("mat-mdc-dialog-container");)e=e.parentElement;return e?i.find(t=>t.id===e.id):null}var Ps=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=N({type:n});static \u0275inj=F({providers:[hi],imports:[er,gt,Ae,an,an]})}return n})();var pr=10,dn=20;function Us(n,i,e){let t=Object.entries(n??{}).filter(([,s])=>!!s&&typeof s=="object"),o=([s,a])=>typeof a?.id=="string"&&a.id?a.id:s;t.sort((s,a)=>{let c=o(s),l=o(a);return c<l?-1:c>l?1:0});let r={};if(t.slice(0,Math.max(0,i)).forEach(([s,a])=>{r[s]=a}),e&&!Object.values(r).some(s=>s?.user?.userId===e)){let s=t.find(([,a])=>a?.user?.userId===e);s&&(r[s[0]]=s[1])}return r}function hn(n,i){let e=[...n??[]],t=new Map;e.forEach((r,s)=>{r?.userId&&t.set(r.userId,s)});let o=new Map;return(i??[]).forEach(r=>{let s=r?.userId;if(!s)return;let a=t.get(s);a===void 0?(t.set(s,e.length),e.push(r),o.set(s,r)):rt(e[a],r)||(e[a]=r,o.set(s,r))}),{contacts:e,changed:Array.from(o.values())}}function Ns(n){return!!n&&typeof n=="object"&&!!n.user&&typeof n.user=="object"&&!!n.user.userId}var Ah=(()=>{let i=class i{constructor(t,o,r,s,a,c,l,d,u,p){this.analyticsService=t,this.authService=o,this.configService=r,this.coreActionsService=s,this.databaseService=a,this.docService=c,this.loggingService=l,this.commonDbService=d,this.usersService=u,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,V=!0;C&&g?.[f?.userId]?.folders?.[C]?.errorCode===yi.PERMISSION_DENIED&&(V=!1),this.getOrganizationContactsFromDb$(),V&&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)}),it([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||qn(this.configService.getApiKey(),g.userId);C&&this.userSnippylyIdContacts$.next(k(m({},this.userSnippylyIdContacts$.value),{[C]:g}))})}catch{}})}setUserPermissionService(t){try{this.userPermissionService=t}catch(o){this.loggingService.catch("Error in ContactService setUserPermissionService: ",o)}}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(t){this.loggingService.catch("Error in ContactService clearCache: ",t)}}setDocumentAccessType(t){try{this.documentAccessType=t}catch(o){this.loggingService.catch("Error in ContactService setDocumentAccessType: ",o)}}checkIfUserGlobalContact(t){return z(this,null,function*(){try{if(t?.userId&&this.documentPaths?.globalContacts){let o=yield this.commonDbService?.getData({feature:"globalContacts",properties:{documentId:this.documentPaths?.documentId??"",organizationId:this.documentPaths?.organizationId??"",userId:w(t?.userId),skipFirestore:!0}});if(Object.keys(o??{}).length>0)return!0}if(t?.email&&this.documentPaths?.globalContacts){let o=yield this.commonDbService?.getData({feature:"globalContacts",properties:{documentId:this.documentPaths?.documentId??"",organizationId:this.documentPaths?.organizationId??"",userId:w(t?.email),skipFirestore:!0}});if(Object.keys(o??{}).length>0)return!0}return!1}catch(o){return this.loggingService.catch("Error in ContactService isUserGlobalContact: ",o),!1}})}setLoggedInUser(t){try{t?.userId&&this.documentPaths?.logins&&(this.commonDbService.updateData({feature:"logins",properties:{documentId:this.documentPaths?.documentId??"",organizationId:this.documentPaths?.organizationId??"",userId:w(t?.userId),skipFirestore:!0},data:JSON.parse(JSON.stringify(k(m({},t),{contacts:void 0})))}),this.setLoggedInUserPrivateContacts(t,t?.contacts))}catch(o){this.loggingService.catch("Error in ContactService setLoggedInUser: ",o)}}migrateLoggedInUserFromEmailToUserIdPath(t){return z(this,null,function*(){try{if(t?.email&&this.documentPaths?.logins){let o=yield this.commonDbService?.getData({feature:"logins",properties:{documentId:this.documentPaths?.documentId??"",organizationId:this.documentPaths?.organizationId??"",userId:w(t?.email),skipFirestore:!0}});if(Object.keys(o??{}).length>0){let r=o;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(t?.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(t?.email),skipFirestore:!0}})}}}}catch(o){this.loggingService.catch("Error in ContactService migrateLoggedInUserFromEmailToUserIdPath: ",o)}})}addGlobalContact(t){try{t?.userId&&this.documentPaths?.globalContacts&&this.commonDbService.updateData({feature:"globalContacts",properties:{documentId:this.documentPaths?.documentId??"",organizationId:this.documentPaths?.organizationId??"",userId:w(t?.userId),skipFirestore:!0},data:JSON.parse(JSON.stringify(t))})}catch(o){this.loggingService.catch("Error in ContactService addGlobalContact: ",o)}}getUserAccessFields(){return JSON.parse(JSON.stringify(this.userAccessFields$.value))}getUserAccessFieldsByUserId(t){return this.getUserAccessFields()?.[t]}setUserAccessFields(t){try{let o=this.getUserAccessFields();this.keepRowsWithUserId(t,"setUserAccessFields").forEach(s=>{o[s.user.userId]=s.accessFields||[]});let r=this.authService.getUser()?.userId;if(r&&o?.[r]?.length){let s=this.userPermissionService?.getCurrentUserPermissions();s&&(s[r]||(s[r]={}),s[r].context={accessFields:o[r]},this.userPermissionService?.setCurrentUserPermissions(s))}this.userAccessFields$.next(JSON.parse(JSON.stringify(o)))}catch(o){this.loggingService.catch("Error in ContactService setUserAccessFields: ",o)}}updateUserInGlobalContactsIfAvailable(t){return z(this,null,function*(){try{if(t?.userId&&this.documentPaths?.globalContacts&&(yield this.checkIfUserGlobalContact(t))){let r=new Kn;r.userId=t?.userId,r.userSnippylyId=t?.userSnippylyId,r.email=t?.email,r.name=t?.name,r.photoUrl=t?.photoUrl,this.commonDbService.updateData({feature:"globalContacts",properties:{documentId:this.documentPaths?.documentId??"",organizationId:this.documentPaths?.organizationId??"",userId:w(t?.userId),skipFirestore:!0},data:JSON.parse(JSON.stringify(r))})}}catch(o){this.loggingService.catch("Error in ContactService updateUserInGlobalContactsIfAvailable: ",o)}})}moveGlobalContactUserFromEmailToUserIdPath(t){return z(this,null,function*(){try{if(t?.email&&t?.userId&&this.documentPaths?.globalContacts){let o=yield this.commonDbService?.getData({feature:"globalContacts",properties:{documentId:this.documentPaths?.documentId??"",organizationId:this.documentPaths?.organizationId??"",userId:w(t?.email),skipFirestore:!0}});if(Object.keys(o??{}).length>0){let r=o;r&&(yield this.commonDbService.updateData({feature:"globalContacts",properties:{documentId:this.documentPaths?.documentId??"",organizationId:this.documentPaths?.organizationId??"",userId:w(t?.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(t?.email),skipFirestore:!0}}))}}}catch(o){this.loggingService.catch("Error in ContactService removeUserFromGlobalContactsByEmail: ",o)}})}setLoggedInUserPrivateContacts(t,o){try{if(t?.userId&&this.documentPaths?.logins){let r,s=o?.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(t?.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(t?.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(t?.userId),skipFirestore:!0}})}}catch(r){this.loggingService.catch("Error in ContactService setLoggedInUserPrivateContacts: ",r)}}migrateGroupContactsFromEmailToUserIdPath(t){return z(this,null,function*(){try{if(this.documentPaths?.groupContacts&&t){let o=yield this.commonDbService?.getData({feature:"groupContacts",properties:{documentId:this.documentPaths?.documentId??"",organizationId:this.documentPaths?.organizationId??"",groupId:t,skipFirestore:!0}});o&&Object.keys(o??{}).forEach(r=>z(this,null,function*(){let s=o[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:t,userId:r,skipFirestore:!0}}),yield this.commonDbService.updateData({feature:"groupContactsUser",properties:{documentId:this.documentPaths?.documentId??"",organizationId:this.documentPaths?.organizationId??"",groupId:t,userId:w(s?.userId),skipFirestore:!0},data:JSON.parse(JSON.stringify(s))}))}))}}catch(o){this.loggingService.catch("Error in ContactService migrateGroupContacts: ",o)}})}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(o=>z(this,null,function*(){if(this.user?.groupId&&this.user?.userId){let r=!1,s=this.docService.getDocumentAccessType(o);if(!s||s===Ft.PUBLIC)r=!0;else if(s===Ft.RESTRICTED){let a=w(this.user?.userId);if(o?.users?.[a]&&(r=!0),this.user?.email){let c=w(this.user?.email);o?.users?.[c]&&(r=!0)}}if(r){let a=new Xn;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(t){this.loggingService.catch("Error in ContactService checkToSetLoggedInUserInGroupContacts: ",t)}})}setLoggedInUserGroupContacts(t,o){try{let r=o?.filter(s=>s?.visibility==="group");r?.length&&r.forEach(s=>z(this,null,function*(){if(s?.userId&&t&&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:t,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:t,userId:w(s?.email),skipFirestore:!0}}))}}))}catch(r){this.loggingService.catch("Error in ContactService setLoggedInUserGroupContacts: ",r)}}removeGroupContacts(t){return z(this,null,function*(){try{if(this.documentPaths?.groupContacts&&t)return this.commonDbService.deleteData({feature:"groupContacts",properties:{documentId:this.documentPaths?.documentId??"",organizationId:this.documentPaths?.organizationId??"",groupId:t,skipFirestore:!0}})}catch(o){this.loggingService.catch("Error in ContactService removeGroupContacts: ",o)}})}mergeUserContacts(){try{let t=[];this.userPersonalContacts&&t.push(...this.userPersonalContacts),this.userGroupContacts&&t.push(...this.userGroupContacts),this.userGlobalContacts&&t.push(...this.userGlobalContacts);let o={};t.forEach(r=>{r?.userId?(!r?.email||!o[r.email])&&(o[r.userId]=r):r?.email&&(!r?.userId||!o[r.userId])&&(o[r.email]=r)}),t=Object.values(o??{}),this.internalUserContacts$.next(t)}catch(t){this.loggingService.catch("Error in ContactService mergeUserContacts: ",t)}}getInternalUserContacts(){return this.internalUserContacts$.value}getInternalUserContacts$(){return this.internalUserContacts$.asObservable()}getUserContacts$(t){try{let{organizationId:o,documentId:r,veltFolderId:s}=t||{};return o&&r?it([this.usersByOrganizationId$,this.usersByOrganizationIdAndFolderId$,this.usersByOrganizationIdAndDocumentId$,this.userById$,this.customUserContacts$,this.customUserContactsConfig$,this.getContactListScopeForOrganizationUsers$(),this.temporaryUserIds$]).pipe(S(([a,c,l,d,u,p,f,g])=>{let C={},V=!1;p&&!p?.merge&&(V=!0);let ve=xe=>f.some(Pe=>xe.includes(Pe)),tt=ve([D.ALL,D.ORGANIZATION])?Object.keys(a?.[o]||{}):[],yr=s?ve([D.ALL,D.FOLDER])?Object.keys(c?.[o]?.[s]||{}):[]:[],Cr=ve([D.ALL,D.DOCUMENT])?Object.keys(l?.[o]?.[r]||{}):[];if([...tt,...yr||[],...Cr,...g].forEach(xe=>{let Pe=d?.[xe];Pe&&(C[xe]=Pe)}),u){let{merge:xe,options:Pe}=p||{},{organizationId:un,documentId:fn,folderId:pn}=Pe||{},gn=pn?Zn(pn):void 0;(!un||un===o)&&(!fn||fn===r)&&(!gn||gn===s)&&(xe||(C={}),u.forEach(pi=>{pi?.userId&&(C[pi.userId]=pi)}))}return Object.values(C??{})})):this.userContacts$.asObservable().pipe(S(a=>a))}catch(o){return this.loggingService.catch("Error in ContactService getUserContacts$ metadata: ",o),_([])}}getUserContactsBySnippylyId$(){return this.userSnippylyIdContacts$.asObservable()}getUserBySnippylyId(t){return this.userSnippylyIdContacts$.value?.[t]}getAtHereLabel(){return this.atHereLabel$.asObservable()}getAtHereDescription(){return this.atHereDescription$.asObservable()}getUserContactsFromDb$(){this.getUserContactSubscription||(this.getUserContactSubscription=this.authService.getUser$().pipe(E(t=>!!t),v(t=>this.docService.getDocumentPaths$().pipe(E(o=>!!o),Q(o=>{this.documentPaths=o}),S(()=>t))),v(t=>{if(this.userGroupContacts=[],this.userPersonalContacts=[],!t)return _();if(!this.documentPaths)return _();let o=[];return o.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))}))),o.push(this.commonDbService.dbListener({feature:"groupContacts",properties:{documentId:this.documentPaths?.documentId,organizationId:this.documentPaths?.organizationId,skipFirestore:!0,groupId:t?.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))}))),o.push(this.commonDbService.dbListener({feature:"allLoginContacts",properties:{documentId:this.documentPaths?.documentId,organizationId:this.documentPaths?.organizationId,skipFirestore:!0,userId:w(t?.userId)}}).pipe(S(r=>r?.data),Q(r=>{r?this.userPersonalContacts=Object.values(r??{}):this.userPersonalContacts=[]}))),Et(...o).pipe(de(this.authService.getUser$().pipe(E(r=>!r))))})).subscribe(()=>{this.mergeUserContacts()},t=>{this.loggingService.catch("Error in ContactService getUserContacts$ subscription: ",t)}))}addUserContact(t){try{this.user?.organizationId||this.user?.groupId&&(t.visibility="group",this.setLoggedInUserGroupContacts(this.user?.groupId,[t]))}catch(o){this.loggingService.catch("Error in ContactService addUserContact: ",o)}}isUserGlobalContact$(){return this.userGlobalContact$.asObservable().pipe(X(rt))}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(t=>t?this.documentPaths?t?.userId&&this.documentPaths?.logins?this.commonDbService.dbListener({feature:"allLogins",properties:{documentId:this.documentPaths?.documentId,organizationId:this.documentPaths?.organizationId,skipFirestore:!0}}).pipe(S(o=>o?.data),Q(o=>{o?this.users=Object.values(o??{}):this.users=[]})):(this.users=[],_()):_():_())).subscribe(()=>{this.users$.next(this.users)},t=>{this.loggingService.catch("Error in ContactService getLoggedInUsers$ subscription: ",t)})),this.users$.asObservable()}getUsersMap$(){return this.authService.getUser$().pipe(v(t=>t?.organizationId?this.userById$.pipe(S(o=>{let r={};return Object.values(o||{}).forEach(s=>{s?.userSnippylyId&&(r[s?.userSnippylyId]=s)}),r})):this.users$.pipe(S(o=>{let r={};return o.forEach(s=>{r[s.userSnippylyId]=s}),r}))))}getUserByEmail$(t){return this.users$.pipe(S(o=>o.find(r=>r.email===t)))}getUserByEmail(t){return this.users?.find(o=>o.email===t)}getContactByEmail(t){return this.getInternalUserContacts().find(o=>o.email===t)}getUserByUserId$(t){return this.users$.pipe(S(o=>o.find(r=>r.userId===t)))}getUserGroupContacts(){return this.userGroupContacts}getTemporaryUsers(){try{let t=this.authService.getUser();this.docService.getOrganizationConfig$().pipe(E(o=>!!o),S(o=>o?.organizationId)).subscribe(o=>z(this,null,function*(){if(o&&t){let r=((yield this.commonDbService?.queryData({feature:"allPermissionsUsers",properties:{organizationId:o,useCollectionGroup:!1,isCollection:!0,firestoreQuery:[x("expiresAt",">",new Date().getTime())]}}))??[]).filter(s=>s?.userId!==t?.userId);if(r?.length){let s=r.map(d=>d?.userId),a=Qn(),c=Yn.GET_TEMPORARY_USERS;this.coreActionsService.triggerAction(Gn.USER_RESOLVER,{event:Ut.Events.Resolver.USER_RESOLUTION_REQUEST_FORMED,timestamp:new Date().getTime(),uniqueId:a,moduleName:c,methodName:Wn.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 u=new Set([...this.temporaryUserIds$.value,...Object.keys(d)]);this.temporaryUserIds$.next(Array.from(u))}}}}))}catch(t){this.loggingService.catch("Error in ContactService getTemporaryUsers: ",t)}}searchUsers(t){return z(this,null,function*(){try{if(!t||typeof t!="string"||!t.trim())return[];let o=t.trim();return this.searchUsersDebounced$||(this.searchUsersDebounced$=this.searchUsersSubject$.pipe(At(this.searchUsersDebounceTime),X(),v(r=>St(this.performSearch(r)).pipe(S(s=>({searchText:r,results:s})),wt(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:u})=>u([])),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(o)||this.pendingSearchPromises.set(o,[]),this.pendingSearchPromises.get(o).push({resolve:r,reject:s}),this.searchUsersSubject$.next(o)})}catch(o){return this.loggingService.catch("Error in ContactService searchUsers: ",o),[]}})}performSearch(t){return z(this,null,function*(){try{let o=this.docService.getOrganizationConfig()?.organizationId;if(!o)return[];let r=this.documentPaths?.veltFolderId,s=this.docService.getDocumentIds().map(g=>g?.documentId),a=t.toLowerCase().trim(),c=a+"\uF8FF";if(this.commonDbService.portableCapabilityState(io)==="announced"){let g=yield this.searchPortableOrganizationUsers(t);return g?this.applySearchResults(g):[]}let l=[],d=s?.filter(g=>!!g)||[],u=d.length>0,p=!!r;if(u){let g=[],C=dn;for(let V=0;V<d.length;V+=C)g.push(d.slice(V,V+C));g.forEach(V=>{let ve=[x("documentIds","array-contains-any",V),x("viewerDocumentIds","array-contains-any",V)],tt=[x("organizationIds","array-contains-any",[o]),x("viewerOrganizationIds","array-contains-any",[o]),...ve];p&&tt.push(x("folderIds","array-contains-any",[r]),x("viewerFolderIds","array-contains-any",[r])),l.push(this.commonDbService.queryData({feature:"allDocumentUsers",properties:{organizationId:o,isCollection:!0,useCollectionGroup:!1,useQuery:!0,firestoreQuery:[Se(Ie(...tt),x("user.name_lowercase",">=",a),x("user.name_lowercase","<",c)),je(10)]}}).catch(()=>[])),l.push(this.commonDbService.queryData({feature:"allDocumentUsers",properties:{organizationId:o,isCollection:!0,useCollectionGroup:!1,useQuery:!0,firestoreQuery:[Se(Ie(...tt),x("user.email_lowercase",">=",a),x("user.email_lowercase","<",c)),je(10)]}}).catch(()=>[]))})}let f=yield Promise.all(l);return this.applySearchResults(f)}catch(o){return this.loggingService.catch("Error in ContactService performSearch: ",o),[]}})}searchPortableOrganizationUsers(t){return z(this,null,function*(){let o=this.authService.getUser()?.userId,r=this.docService.getOrganizationConfig()?.clientOrganizationId,s=this.documentPaths?.folderId,a=(this.docService.getDocumentIds()??[]).map(u=>u?.clientDocumentId).filter(u=>!!u);if(!r||!a.length)return[];let c=[];for(let u=0;u<a.length;u+=dn)c.push(a.slice(u,u+dn));let l=this.portableSearchScope(),d=yield Promise.all(c.map(u=>z(this,null,function*(){let p=yield this.commonDbService.searchPortableOrganizationUsers(k(m({organizationId:r,documentIds:u},s?{folderId:s}:{}),{searchText:t}));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!==o||this.portableSearchScope()!==l?null:d.flat()})}portableSearchScope(){let t=(this.docService.getDocumentIds()??[]).map(o=>o?.clientDocumentId??"");return JSON.stringify([this.docService.getOrganizationConfig()?.clientOrganizationId??null,this.documentPaths?.folderId??null,t])}applySearchResults(t){try{let o=[];t.forEach(a=>{a&&Array.isArray(a)?a.forEach(c=>{c&&c.user&&c.user.userId&&o.push(c)}):a&&typeof a=="object"&&Object.values(a).forEach(l=>{l&&l.user&&l.user.userId&&o.push(l)})});let r=new Map;o.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(o){return this.loggingService.catch("Error in ContactService performSearch: ",o),[]}}setResolvedUsers(t,o=!1){try{let r=this.keepRowsWithUserId(t,"setResolvedUsers");if(r?.length){let s=[],a=[],c=[],l=this.docService.getOrganizationConfig()?.organizationId,d=this.documentPaths?.veltFolderId,u=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),u?.some(C=>g?.documentIds?.includes(C))&&!c.find(C=>C?.user?.userId===g?.user?.userId)&&c.push(g))}),s?.length&&this.setUserOrganizationContacts(s,l,o),a?.length&&this.setUserFolderContacts(a,o),c?.length&&this.setUserDocumentContacts(c,o);let f=[...s,...a,...c].filter((g,C,V)=>C===V.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(st).pipe(X(),v(t=>{try{return t?t.getPaginatedContactList$().pipe(wt(()=>_(re.PAGINATED_CONTACT_LIST_DEFAULT))):_(re.PAGINATED_CONTACT_LIST_DEFAULT)}catch(o){return this.loggingService.catch("Error in ContactService paginatedContactList$: ",o),_(re.PAGINATED_CONTACT_LIST_DEFAULT)}}),X())}organizationUsersSource$(t,o,r){return r?bi(this.commonDbService,Si,{feature:"allOrganizationUsers",properties:{organizationId:t,isCollection:!0}}).pipe(S(s=>o&&s?.data?k(m({},s),{data:Us(s.data,pr,this.authService.getUser()?.userId)}):s)):this.commonDbService.dbListener({feature:"allOrganizationUsers",properties:{organizationId:t,isCollection:!0,useQuery:!0,firestoreQuery:[Se(Ie(x("organizationIds","array-contains-any",[t]),x("viewerOrganizationIds","array-contains-any",[t]))),at("id"),...o?[je(pr)]:[]]}})}organizationGroupsSource$(t){return this.commonDbService?.isPortableSession?.()===!0?bi(this.commonDbService,Si,{feature:"allOrganizationGroups",properties:{organizationId:t,isCollection:!0}}):this.commonDbService.dbListener({feature:"allOrganizationGroups",properties:{organizationId:t,isCollection:!0}})}getOrganizationContactsFromDb$(){try{this.getOrganizationContactsSubscription||(this.getOrganizationContactsSubscription=this.authService.getUser$().pipe(v(t=>t?.organizationId?_(t).pipe(v(o=>this.docService.getOrganizationConfig$().pipe(E(r=>!!r),S(()=>o))),v(o=>this.usersService.getResolveOrganizationUsers$().pipe(E(r=>r),S(()=>o))),v(o=>{let r=this.docService.getOrganizationConfig()?.organizationId;if(this.setUserOrganizationContacts([],r),!o)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)?St(this.commonDbService.queryData({feature:"allOrganizationUsers",properties:{organizationId:r,isCollection:!0,useQuery:!0,firestoreQuery:[Se(Ie(x("organizationIds","array-contains-any",[r]),x("viewerOrganizationIds","array-contains-any",[r])),x("user.userId","==",this.authService.getUser()?.userId))]}})).pipe(S(d=>{if(d&&d.length>0){let u=d[0],p=u?.user?.userId||u?.id;if(p&&c){let f=w(p);return k(m({},c),{[f]:u})}}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()},t=>{this.loggingService.catch("Error in ContactService getOrganizationContactsFromDb$ subscription: ",t)}))}catch{}}getFolderContactsFromDb$(){try{this.getFolderContactsSubscription||(this.getFolderContactsSubscription=this.authService.getUser$().pipe(v(t=>t?_(t).pipe(v(o=>this.docService.getOrganizationConfig$().pipe(E(r=>!!r),S(()=>o))),v(o=>this.usersService.getResolveFolderUsers$().pipe(E(r=>r),S(()=>o))),v(o=>{let r=this.docService.getOrganizationConfig()?.organizationId;if(this.setUserFolderContacts([]),!o)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(x("folderIds","array-contains-any",[this.documentPaths?.veltFolderId]),x("viewerFolderIds","array-contains-any",[this.documentPaths?.veltFolderId]))),at("id"),...a?[je(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()},t=>{this.loggingService.catch("Error in ContactService getFolderContactsFromDb$ subscription: ",t)}))}catch{}}getDocumentContactsFromDb$(){try{this.getDocumentContactsSubscription||(this.getDocumentContactsSubscription=this.authService.getUser$().pipe(v(t=>t?_(t).pipe(v(o=>this.docService.getDocumentPaths$().pipe(E(r=>!!r),Q(r=>{this.documentPaths=r}),S(()=>o))),v(o=>this.usersService.getResolveDocumentUsers$().pipe(E(r=>r),S(()=>o))),v(o=>(this.setUserDocumentContacts([]),this.resetDocumentContactCount(),o?this.documentPaths?this.docService.getDocumentIds$().pipe(v(r=>{let s=r?.length>0?r.map(u=>u.documentId):[this.documentPaths?.documentId??""];if(s.some(u=>!u)||!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 u=0;u<s.length;u+=re.LISTENER_BATCH_SIZE)l.push(s.slice(u,u+re.LISTENER_BATCH_SIZE));let d=u=>Se(Ie(x("documentIds","array-contains-any",u),x("viewerDocumentIds","array-contains-any",u)));return a=this.paginatedContactList$().pipe(v(u=>(this.refreshDocumentContactCount(u,l,c,d),it(l.map(p=>this.commonDbService.dbListener({feature:"allDocumentUsers",properties:k(m({},c),{firestoreQuery:[d(p),at("id"),...u?[je(10)]:[]]})}).pipe(In()))).pipe(S(p=>Jn(p)?.data))))),a.pipe(S(u=>{if(u){typeof u=="object"&&(u?.undefined&&delete u.undefined,u?.null&&delete u.null);let p=Object.values(u??{});this.setUserAccessFields(p),this.setUserDocumentContacts(p)}else this.setUserDocumentContacts([])}))})):_():_())),v(()=>this.getContactListScopeForOrganizationUsers$())):(this.setUserDocumentContacts([]),_()))).subscribe(()=>{this.mergeOrganizationAndDocumentContacts()},t=>{this.loggingService.catch("Error in ContactService getDocumentContactsFromDb$ subscription: ",t)}))}catch{}}keepRowsWithUserId(t,o){let r=Array.isArray(t)?t:[],s=r.filter(Ns);return s.length!==r.length&&!this.reportedRowsWithoutUserId.has(o)&&(this.reportedRowsWithoutUserId.add(o),this.loggingService.catch(`ContactService ${o}: skipped ${r.length-s.length} directory row(s) with no user.userId; the other contacts were kept.`)),s}setUserOrganizationContacts(t,o,r=!0){try{let s=this.keepRowsWithUserId(t,"setUserOrganizationContacts"),a=s.find(d=>d.user.userId===this.user?.userId);a&&this.setCurrentOrganizationUserIAM(a);let{contacts:c,changed:l}=hn(this.userOrganizationContacts$.value,s.map(d=>d.user));if(this.userOrganizationContacts$.next(c),r&&this.usersService.setUserByIds(l),o){let d={};d[o]={};let u={};s.forEach(f=>{d[o][f.user.userId]=f,u[f.user.userId]=f.user}),this.userById$.next(m(m({},this.userById$.value),u));let p=this.usersByOrganizationId$.value?.[o];p&&(d[o]=m(m({},p),d[o])),this.usersByOrganizationId$.next(k(m({},this.usersByOrganizationId$.value),{[o]:d[o]}))}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(t,o=!0){try{let r=this.keepRowsWithUserId(t,"setUserFolderContacts"),{contacts:s,changed:a}=hn(this.userFolderContacts$.value,r.map(u=>u.user));this.userFolderContacts$.next(s),o&&this.usersService.setUserByIds(a);let c=this.usersByOrganizationIdAndFolderId$.value||{},l=m({},c),d={};r?.forEach(u=>{let{organizationId:p}=u?.metadata||{};p&&(l[p]||(l[p]={}),u.folderIds?.forEach(f=>{l[p][f]||(l[p][f]={}),l[p][f]=k(m({},l[p][f]),{[u.user.userId]:u}),d[u.user.userId]=u.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(t,o=!0){try{let r=this.keepRowsWithUserId(t,"setUserDocumentContacts"),{contacts:s,changed:a}=hn(this.userDocumentContacts$.value,r.map(u=>u.user));this.userDocumentContacts$.next(s),o&&this.usersService.setUserByIds(a);let c=this.usersByOrganizationIdAndDocumentId$.value||{},l=m({},c),d={};r?.forEach(u=>{let{organizationId:p}=u?.metadata||{};p&&(l[p]||(l[p]={}),u.documentIds?.forEach(f=>{l[p][f]||(l[p][f]={}),l[p][f]=k(m({},l[p][f]),{[u.user.userId]:u}),d[u.user.userId]=u.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(t,o,r,s){try{if(this.resetDocumentContactCount(),!t||!o.length||!this.commonDbService.shouldUseFirestore())return;let a=this.documentContactCountGeneration;Promise.all(o.map(c=>this.commonDbService.queryData({feature:"allDocumentUsers",properties:k(m({},r),{getCount:!0,firestoreQuery:[s(c),at("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(t){try{this.currentOrganizationUserIAM$.next(JSON.parse(JSON.stringify(t)))}catch(o){this.loggingService.catch("Error in ContactService setCurrentOrganizationUserIAM: ",o)}}getCurrentOrganizationUserIAM$(){return this.currentOrganizationUserIAM$.asObservable().pipe(X(rt))}getCurrentOrganizationUserIAM(){return this.currentOrganizationUserIAM$.value}mergeOrganizationAndDocumentContacts(){try{this.mergeContactsDebounceTimer&&clearTimeout(this.mergeContactsDebounceTimer),this.mergeContactsDebounceTimer=setTimeout(()=>{this.executeMergeContacts()},200)}catch(t){this.loggingService.catch("Error in ContactService mergeOrganizationAndDocumentContacts: ",t)}}executeMergeContacts(){try{let t=this.getContactListScopeForOrganizationUsers(),o=[];t.includes(D.ALL)?o=[...this.getUserOrganizationContacts(),...this.getUserFolderContacts(),...this.getUserDocumentContacts()]:t.includes(D.ORGANIZATION)?o=[...this.getUserOrganizationContacts()]:t.includes(D.FOLDER)?o=[...this.getUserFolderContacts()]:t.includes(D.DOCUMENT)&&(o=[...this.getUserDocumentContacts()]);let r=[...new Map(o.filter(s=>s?.userId).map(s=>[s.userId,s])).values()];this.internalUserContacts$.next(r)}catch(t){this.loggingService.catch("Error in ContactService mergeOrganizationAndDocumentContacts: ",t)}}getOrganizationGroupsFromDb$(){try{this.getOrganizationGroupsSubscription||(this.getOrganizationGroupsSubscription=this.authService.getUser$().pipe(v(t=>t?.organizationId?_(t).pipe(v(o=>this.docService.getOrganizationConfig$().pipe(E(r=>!!r),S(()=>o))),v(o=>{if(this.setUserOrganizationGroups([]),!o)return _();let r=this.docService.getOrganizationConfig(),s=r?.organizationId,a=r?.clientOrganizationId??"";if(!s)return _();let c=o.userId??"";return St(this.userPermissionService?.getUserPermissionsFromCacheOrFetch({organizationId:a})??Promise.resolve({})).pipe(v(l=>c&&a&&l?.[c]?.organization?.[a]?.errorCode===yi.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(()=>{},t=>{this.loggingService.catch("Error in ContactService getOrganizationGroupsFromDb$ subscription: ",t)}))}catch{}}setUserOrganizationGroups(t){try{this.userOrganizationGroups$.next(t)}catch(o){this.loggingService.catch("Error in ContactService setUserOrganizationGroups: ",o)}}onContactSelected(t){try{if(t?.userId){let o=!!this.getUserDocumentContacts().find(s=>s.userId===t.userId),r=!!this.getUserOrganizationContacts().find(s=>s.userId===t.userId);switch(this.documentAccessType){case Ft.RESTRICTED:if(!o){let s={contact:t,isOrganizationContact:r,isDocumentContact:o,documentAccessType:this.documentAccessType};this.onContactSelectedSubject$.next(s)}break}}else{let o={contact:t,isOrganizationContact:!1,isDocumentContact:!1,documentAccessType:this.documentAccessType};this.onContactSelectedSubject$.next(o)}}catch(o){this.loggingService.catch("Error in ContactService onContactSelected: ",o)}}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:ot.COMMENT,config:{atHereEnabled:!0}}),this.atHereEnabled$.value===!0)return;this.atHereEnabled$.next(!0)}catch(t){this.loggingService.catch("Error in ContactService enableAtHere: ",t)}}setAtHereLabel(t){try{this.analyticsService.setFeatureConfig({feature:ot.COMMENT,config:{atHereLabel:t}}),t&&this.atHereLabel$.next(t)}catch(o){this.loggingService.catch("Error in ContactService setAtHereLabel: ",o)}}setAtHereDescription(t){try{this.analyticsService.setFeatureConfig({feature:ot.COMMENT,config:{atHereDescription:t}}),t&&this.atHereDescription$.next(t)}catch(o){this.loggingService.catch("Error in ContactService setAtHereDescription: ",o)}}disableAtHere(){try{if(this.analyticsService.setFeatureConfig({feature:ot.COMMENT,config:{atHereEnabled:!1}}),this.atHereEnabled$.value===!1)return;this.atHereEnabled$.next(!1)}catch(t){this.loggingService.catch("Error in ContactService disableAtHere: ",t)}}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(t){try{this.contactListScopeForOrganizationUsers$.next(t)}catch(o){this.loggingService.catch("Error in ContactService updateContactListScopeForOrganizationUsers: ",o)}}getContactListScopeForOrganizationUsers$(){return this.contactListScopeForOrganizationUsers$.asObservable()}getContactListScopeForOrganizationUsers(){return this.contactListScopeForOrganizationUsers$.value}checkContactListScopeForOrganizationUsers(t){return this.getContactListScopeForOrganizationUsers().some(o=>t.includes(o))}updateContactList(t,o){return z(this,null,function*(){try{this.analyticsService.trackEvent(Ut.Events.Contact.UPDATE_CONTACT_LIST_TRIGGERED,{contactsCount:t?.length,config:o}),this.usersService.setContactListUsers(t),this.customUserContacts$.next(t),this.customUserContactsConfig$.next(o)}catch(r){this.loggingService.catch("Error in CommentService updateContactList: ",r)}})}updateOrgList(t){try{let o=t?.orgList??[];this.analyticsService.trackEvent(Ut.Events.Contact.UPDATE_ORG_LIST_TRIGGERED,{orgCount:o?.length}),this.orgList$.next(o)}catch(o){this.loggingService.catch("Error in ContactService updateOrgList: ",o)}}getOrgList$(){return this.orgList$.asObservable()}getOrgList(){return this.orgList$.value}convert(t){try{if(t?.options){let{documentId:o,organizationId:r}=this.docService.getServerId(t?.options);t.options=k(m({},t?.options),{documentId:o,organizationId:r})}return this}catch(o){return this.loggingService.catch("Error in ContactService convert: ",o),this}}getContactList$(){try{return this.authService.getUser$().pipe(v(t=>t?it([this.userOrganizationContacts$.asObservable(),this.userFolderContacts$.asObservable(),this.userDocumentContacts$.asObservable(),this.userOrganizationGroups$.asObservable(),this.customUserContacts$.asObservable()]).pipe(S(([o,r,s,a,c])=>{let l={};l.organizationUsers=o?.map(u=>this.convertToClientUser(u)),l.folderUsers=r?.map(u=>this.convertToClientUser(u)),l.documentUsers=s?.map(u=>this.convertToClientUser(u)),l.updatedContactList=c?.map(u=>this.convertToClientUser(u));let d=[];return a?.forEach(u=>{let p=this.convertToClientUserGroup(u,l.organizationUsers||[]);p&&d.push(p)}),l.userGroups=d,l}),X(rt)):_(null)),wt(t=>(this.loggingService.catch("Error in ContactService getContactList$: ",t),_(null))))}catch(t){return this.loggingService.catch("Error in ContactService getContactList$: ",t),_(null)}}convertToClientUserGroup(t,o){try{let r={groupId:t?.metadata?.clientGroupId,groupName:t?.metadata?.groupName,users:[]},s={};return o?.forEach(a=>{if(a?.userId){let c=w(a.userId);s[c]=a}}),Object.keys(t?.users??{}).forEach(a=>{s[a]&&r.users?.push(s[a])}),r}catch(r){return this.loggingService.catch("Error in ContactService convertToClientUserGroup: ",r),null}}convertToClientUser(t){try{return t&&(t=JSON.parse(JSON.stringify(t)),t?.clientGroupId&&(t.groupId=t.clientGroupId,delete t.clientGroupId),t?.clientOrganizationId&&(t.organizationId=t.clientOrganizationId,delete t.clientOrganizationId),t?.userSnippylyId&&delete t.userSnippylyId),t}catch(o){return this.loggingService.catch("Error in ContactService convertToClientUser: ",o),t}}getCustomUserContacts(){return this.customUserContacts$.value}getCustomUserContacts$(){return this.customUserContacts$.asObservable()}getCustomUserContactsConfig(){return this.customUserContactsConfig$.value}getCustomUserContactsConfig$(){return this.customUserContactsConfig$.asObservable()}};i.\u0275fac=function(o){return new(o||i)(T(eo),T(zt),T(Ve),T(no),T(to),T(Bt),T(J),T(ro),T(oo),T(Nt))},i.\u0275prov=b({token:i,factory:i.\u0275fac,providedIn:"root"});let n=i;return n})();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"},zs=["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"],fi=(()=>{let _DynamicDataService=class _DynamicDataService{constructor(n,i,e,t,o,r){this.authService=n,this.serviceBook=i,this.loggingService=e,this.injector=t,this.docService=o,this.configService=r,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(s=>{this.commonData$.next(k(m({},this.commonData$.value),{user:s}))})),this.subscriptions.push(this.serviceBook.observe(st).pipe(E(Boolean),v(s=>s.getUnreadCommentAnnotationCountOnCurrentDocument$())).subscribe(s=>{this.commonData$.next(k(m({},this.commonData$.value),{unreadCommentAnnotationCount:s?.count||0}))})),this.subscriptions.push(this.serviceBook.observe(st).pipe(E(Boolean),v(s=>s.getUnreadCommentCountOnCurrentDocument$())).subscribe(s=>{this.commonData$.next(k(m({},this.commonData$.value),{unreadCommentCount:s?.count||0}))})),this.subscriptions.push(this.docService.getUIState$().subscribe(s=>{this.commonData$.next(m(m({},this.commonData$.value),s))})),this.subscriptions.push(this.getCommonData().subscribe(s=>{this.dataComponentConfigSignal.update(a=>(a=m(m({},a),s),a)),this.executeConditionalClasses()})),this.subscriptions.push(this.evaluateConditionTriggered.subscribe(s=>{this.extractedProps=s.extractedProps,this.evaluateCondition(s.className,s.elementRef,s.condition)}))}catch(s){this.loggingService.catch("Error in DynamicDataService constructor: ",s)}}ngOnDestroy(){try{this.subscriptions.forEach(n=>n.unsubscribe())}catch(n){this.loggingService.catch("Error in DynamicDataService ngOnDestroy: ",n)}}getCommonData(){return this.commonData$.asObservable()}getModifiedPathBasedOnCondition(n,i){try{return Object.keys(i).forEach(e=>{i[e].path=this.modifyPathBasedOnCondition(e,n)}),i}catch(e){this.loggingService.catch("Error in DynamicDataService getModifiedPathBasedOnCondition: ",e)}}getComputedValues(n,i,e,t,o,r){try{Object.keys(e).forEach(s=>{let a;if(Le(n)?a=vi(()=>Ci(n(),e[s].path)):a=vi(()=>Ci(n,e[s].path)),Le(a()))Be(()=>{try{let c=a()();e[s].value=c,this.evaluateConditionTriggered.emit({extractedProps:e,className:t,elementRef:o,condition:r})}catch{}},{injector:this.injector});else{let c=a();e[s].value=c,this.evaluateConditionTriggered.emit({extractedProps:e,className:t,elementRef:o,condition:r})}})}catch(s){this.loggingService.catch("Error in DynamicDataService getComputedValues: ",s)}}modifyPathBasedOnCondition(n,i){try{let e=n.match(/^([^\.\[]+)/),t=e?e[1]:n,o=n.slice(t.length);if(le[n])return le[n];if(["commentDialogOptionsDropdownConfigSignal","commentDialogStatusDropdownConfigSignal"].includes(t)&&o.startsWith(".")){let s=o.slice(1),a=s.match(/^([^\.\[]+)/),c=a?a[1]:s,l=s.slice(c.length);return le[c]?le[c]+l:"componentConfigSignal."+s}if(t&&i&&typeof i=="function"){let s=i();if(s&&t in s){let c=n.match(/\[(.*?)\]/);if(c&&c[1]){let l=c[1];if(l.includes(".")){let d=l.split(".")[0];if(le[d]){let u=l.replace(d,le[d]);return n.replace(`[${l}]`,`[${u}]`)}return d&&s&&d in s?n:n.replace(`[${l}]`,`[componentConfigSignal.${l}]`)}}return n}let a=s?.componentConfigSignal;if(a&&typeof a=="function"){let c=a();if(c&&t in c)return"componentConfigSignal."+n}}return le[t]?zs.includes(t)?le[t]+o:le[t]:"componentConfigSignal."+n}catch(e){return this.loggingService.catch("Error in DynamicDataService modifyPathBasedOnCondition: ",e),n}}applyConditionalClasses(n,i){try{this.elementRef=n,this.data=i}catch(e){this.loggingService.catch("Error in DynamicDataService applyConditionalClasses: ",e)}}executeConditionalClasses(){try{let n=this.getHostElementAttributes(this.elementRef),e=[...Object.keys(n).filter(t=>t.startsWith("velt-class-")).map(t=>({name:t,value:n[t]}))];if(n["velt-class"]){let t=n["velt-class"],o=/'([^']+)':\s*([^,]+)(?:,|$)/g,r=[],s=0,a=100,c;for(;(c=o.exec(t))!==null;){if(s++>a){this.loggingService.catch("Too many class definitions detected.");break}if(c.length<3)continue;let[,l,d]=c;!l||!d||l.split(" ").forEach(u=>{u.trim()&&r.push({name:`velt-class-${u.trim()}`,value:d.trim()})})}e=[...e,...r]}this.data&&typeof this.data=="object"&&Object.keys(this.data).forEach(t=>{this.updateDataComponentConfigSignal(t,this.data[t])}),e.forEach(t=>{let o=t.name.replace("velt-class-","");this.condition=t.value,this.condition&&(this.extractProps(),this.extractedProps=this.getModifiedPathBasedOnCondition(this.dataComponentConfigSignal,this.extractedProps),this.getComputedValues(this.dataComponentConfigSignal,this.evaluateCondition,this.extractedProps,o,this.elementRef,t.value))})}catch(n){this.loggingService.catch("Error in DynamicDataService applyConditionalClasses: ",n)}}updateDataComponentConfigSignal(n,i){try{n==="dataComponentConfigSignal"?this.dataComponentConfigSignal.set(i):this.dataComponentConfigSignal.update(e=>k(m({},e),{[n]:i}))}catch(e){this.loggingService.catch("Error in DataComponent updateDataComponentConfigSignal: ",e)}}extractProps(){try{this.extractedProps={},this.conditionRegex.lastIndex=0;let n;for(;(n=this.conditionRegex.exec(this.condition))!==null;){let i=n[1];this.extractedProps[i]={value:null,path:null,isDynamicPath:this.hasDynamicParts(i)}}}catch(n){this.loggingService.catch("Error in DynamicDataService extractProps: ",n)}}hasDynamicParts(n){try{let i=/\[[^\]'"]*[^\]'"]\]/.test(n),e=/\[[^[\]]*[\.\[][^[\]]*\]/.test(n);return i||e}catch(i){return this.loggingService.catch("Error checking for dynamic path: ",i),!1}}evaluateCondition(n,i,e){try{if(e){let t=this.extractedProps,o=e.replace(this.conditionRegex,(a,c)=>{let l=t[c];if(l&&l.value!==void 0){let d=l.value;return typeof d=="string"?`'${d}'`:typeof d=="boolean"||typeof d=="number"?String(d):d===null?"null":typeof d=="object"?d?"true":"false":String(d)}return"false"}),r=this.sanitizeCondition(o),s=this.safeEval(r);return n&&i&&(s?this.setHostElementClasses(i,n):this.removeHostElementClasses(i,n)),s}return!1}catch(t){return this.loggingService.catch("Error in IfComponent evaluateCondition: ",t),!1}}sanitizeCondition(n){try{return n.replace(/[^a-zA-Z0-9\s\+\-\*\/\%\(\)\!\=\<\>\|\&\.\[\]\{\},'"]/g,"")}catch(i){return this.loggingService.catch("Error in IfComponent sanitizeCondition: ",i),""}}safeEval(expression){try{if(this.configService.getSafeEval()){let n=this.tokenize(expression.trim());return this.evaluateTokens(n)}else return eval(expression)}catch(n){return this.loggingService.catch("safeEval error",n),!1}}tokenize(n){try{if(!n||n.trim()==="")return[];let i=[],e=0;for(;e<n.length;){let t=n[e];if(/\s/.test(t)){e++;continue}if(t==='"'||t==="'"){let o=t,r="";for(e++;e<n.length;)if(n[e]==="\\"&&e+1<n.length)r+=n[e+1],e+=2;else if(n[e]===o){e++;break}else r+=n[e],e++;i.push({type:"string",value:r});continue}if(t==="("){i.push({type:"lparen",value:"("}),e++;continue}if(t===")"){i.push({type:"rparen",value:")"}),e++;continue}if(e<n.length-2&&n.substring(e,e+3)==="==="){i.push({type:"operator",value:"===",precedence:4}),e+=3;continue}if(e<n.length-2&&n.substring(e,e+3)==="!=="){i.push({type:"operator",value:"!==",precedence:4}),e+=3;continue}if(e<n.length-1&&n.substring(e,e+2)==="&&"){i.push({type:"operator",value:"&&",precedence:2}),e+=2;continue}if(e<n.length-1&&n.substring(e,e+2)==="||"){i.push({type:"operator",value:"||",precedence:1}),e+=2;continue}if(e<n.length-1&&n.substring(e,e+2)==="<="){i.push({type:"operator",value:"<=",precedence:4}),e+=2;continue}if(e<n.length-1&&n.substring(e,e+2)===">="){i.push({type:"operator",value:">=",precedence:4}),e+=2;continue}if(e<n.length-1&&n.substring(e,e+2)==="=="){i.push({type:"operator",value:"==",precedence:4}),e+=2;continue}if(e<n.length-1&&n.substring(e,e+2)==="!="){i.push({type:"operator",value:"!=",precedence:4}),e+=2;continue}if(t==="!"){i.push({type:"unary",value:"!",precedence:5}),e++;continue}if(t==="<"){i.push({type:"operator",value:"<",precedence:4}),e++;continue}if(t===">"){i.push({type:"operator",value:">",precedence:4}),e++;continue}if(/[a-zA-Z0-9._]/.test(t)){let o="";for(;e<n.length&&/[a-zA-Z0-9._]/.test(n[e]);)o+=n[e],e++;/^-?\d+(\.\d+)?$/.test(o)?i.push({type:"number",value:parseFloat(o)}):o==="true"||o==="false"?i.push({type:"boolean",value:o==="true"}):o==="null"?i.push({type:"null",value:null}):o==="undefined"?i.push({type:"undefined",value:void 0}):i.push({type:"identifier",value:o});continue}e++}return i}catch(i){return this.loggingService.catch("tokenize error",i),[]}}evaluateTokens(n){try{if(!n||n.length===0)return!1;let i=this.infixToPostfix(n);return this.evaluatePostfix(i)}catch(i){return this.loggingService.catch("evaluateTokens error",i),!1}}infixToPostfix(n){try{let i=[],e=[];for(let t of n)if(t.type==="string"||t.type==="number"||t.type==="boolean"||t.type==="null"||t.type==="undefined"||t.type==="identifier")i.push(t);else if(t.type==="unary")e.push(t);else if(t.type==="operator"){for(;e.length>0;){let o=e[e.length-1];if(o.type==="lparen"||o.precedence!==void 0&&o.precedence<t.precedence)break;i.push(e.pop())}e.push(t)}else if(t.type==="lparen")e.push(t);else if(t.type==="rparen"){for(;e.length>0&&e[e.length-1].type!=="lparen";)i.push(e.pop());e.length>0&&e.pop()}for(;e.length>0;){let t=e.pop();t.type!=="lparen"&&t.type!=="rparen"&&i.push(t)}return i}catch(i){return this.loggingService.catch("infixToPostfix error",i),[]}}evaluatePostfix(n){try{let i=[];for(let e of n)if(e.type==="string"||e.type==="number"||e.type==="boolean"||e.type==="null"||e.type==="undefined"||e.type==="identifier")i.push(e.value);else if(e.type==="unary"){if(i.length>=1){let t=i.pop();e.value==="!"&&i.push(!this.isTruthy(t))}}else if(e.type==="operator"&&i.length>=2){let t=i.pop(),o=i.pop();e.value==="&&"?i.push(this.isTruthy(o)&&this.isTruthy(t)):e.value==="||"?i.push(this.isTruthy(o)||this.isTruthy(t)):i.push(this.compare(o,t,e.value))}return i.length===1?this.isTruthy(i[0]):!1}catch(i){return this.loggingService.catch("evaluatePostfix error",i),!1}}parseValue(n){try{let i=n.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),n}}compare(n,i,e){try{switch(e){case"===":return n===i;case"!==":return n!==i;case"==":return n==i;case"!=":return n!=i;case"<":return n<i;case">":return n>i;case"<=":return n<=i;case">=":return n>=i;default:return!1}}catch(t){return this.loggingService.catch("compare error",t),!1}}isTruthy(n){try{return n==null||n===""||n==="false"?!1:n==="true"?!0:typeof n=="number"?n!==0:!!n}catch(i){return this.loggingService.catch("isTruthy error",i),!1}}getHostElementAttributes(n){try{let i=n,e={};for(let t of i.attributes)e[t.name]=t.value;return e}catch{return{}}}setHostElementClasses(n,i){try{n.classList.add(i)}catch{}}removeHostElementClasses(n,i){try{n.classList.remove(i)}catch{}}};_DynamicDataService.\u0275fac=function(i){return new(i||_DynamicDataService)(T(zt),T(Nt),T(J),T(O),T(Bt),T(Ve))},_DynamicDataService.\u0275prov=b({token:_DynamicDataService,factory:_DynamicDataService.\u0275fac,providedIn:"root"});let DynamicDataService=_DynamicDataService;return DynamicDataService})();var _r=(()=>{let i=class i{constructor(t,o){this.loggingService=t,this.configService=o,this.darkMode$=new I(!1)}setDarkMode(t){try{let o=document.documentElement;if(!o)return;t?o.setAttribute(re.ATTRIBUTES.VELT_THEME,"dark"):o.removeAttribute(re.ATTRIBUTES.VELT_THEME),this.darkMode$.next(t)}catch(o){this.loggingService.catch("Error in theme service setDarkMode: ",o)}}getDarkMode$(){return this.darkMode$.asObservable()}updateListenerOnConfigChange(){try{this.configService.getConfig$().subscribe(t=>{if(t&&t.usePrefersColorScheme){this.enablePrefersColorScheme();return}this.disablePrefersColorScheme()})}catch(t){this.loggingService.catch("Error in theme service updateListenerOnConfigChange: ",t)}}enablePrefersColorScheme(){try{if(this.disablePrefersColorScheme(),!window.matchMedia)return;this.darkModeQuery=window.matchMedia("(prefers-color-scheme: dark)"),this.setDarkMode(this.darkModeQuery.matches),this.darkModeQueryListener=t=>{this.setDarkMode(t.matches)},this.darkModeQuery.addEventListener("change",this.darkModeQueryListener)}catch(t){this.loggingService.catch("Error in theme service enablePrefersColorScheme: ",t)}}disablePrefersColorScheme(){try{this.darkModeQuery&&this.darkModeQueryListener&&this.darkModeQuery.removeEventListener("change",this.darkModeQueryListener)}catch(t){this.loggingService.catch("Error in theme service disablePrefersColorScheme: ",t)}}};i.\u0275fac=function(o){return new(o||i)(T(J),T(Ve))},i.\u0275prov=b({token:i,factory:i.\u0275fac,providedIn:"root"});let n=i;return n})();var vr=(()=>{let i=class i{set veltIf(t){try{t&&this.setIfCondition(t)}catch(o){this._loggingService.catch("Error in BaseComponent set veltIf:",o)}}veltStop(t){Uo(t)}veltHandled(t){return No(t)}constructor(t,o,r){this._elementRef=t,this._dynamicDataService=o,this._loggingService=r,this.componentConfigSignal=j({}),this.veltElement=!0,this.conditionSignal=j(null)}initializeComponentConfigSignal(t){try{this.componentConfigSignal.set(t)}catch(o){this._loggingService.catch("Error in BaseComponent initializeComponentConfigSignal:",o)}}ngOnInit(){try{this._dynamicDataService.applyConditionalClasses(this._elementRef?.nativeElement,{componentConfigSignal:this.componentConfigSignal})}catch(t){this._loggingService.catch("Error in BaseComponent ngOnInit:",t)}}ngOnDestroy(){}setIfCondition(t){try{this.conditionSignal.set(t)}catch(o){this._loggingService.catch("Error in BaseComponent setIfCondition:",o)}}};i.\u0275fac=function(o){return new(o||i)(Y(R),Y(fi),Y(J))},i.\u0275cmp=G({type:i,selectors:[["app-base"]],hostVars:1,hostBindings:function(o,r){o&2&&ue("data-velt-element",r.veltElement)},inputs:{componentConfigSignal:"componentConfigSignal",template:"template",wireframe:"wireframe",veltIf:"veltIf"},standalone:!1,decls:0,vars:0,template:function(o,r){},encapsulation:2});let n=i;return n})();var Qh=(()=>{let i=class i extends vr{onDarkModeChange(){return this.darkModeSubject$.asObservable()}constructor(t,o,r,s,a,c,l){super(t,c,l),this._elementRef=t,this._themeService=o,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(u=>{this._featureDarkMode=u,this.setDarkMode()})):typeof d.getDarkMode$=="function"&&this._themeSubscriptions.push(d.getDarkMode$().subscribe(u=>{u!==null&&(this._featureDarkMode=u),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(t){try{if(t._darkMode){let o=t._darkMode.currentValue;typeof o=="string"&&(o=o==="true"),this._componentDarkMode=o,this.setDarkMode()}}catch{}}setComponentDarkMode(t){try{this._componentDarkMode=t,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(t=>{t.unsubscribe()})}catch{}}};i.\u0275fac=function(o){return new(o||i)(Y(R),Y(_r),Y($e),Y("FeatureService",8),Y(ye),Y(fi),Y(J))},i.\u0275cmp=G({type:i,selectors:[["app-themed"]],inputs:{_darkMode:[0,"darkMode","_darkMode"]},standalone:!1,features:[W,ie],decls:0,vars:0,template:function(o,r){},encapsulation:2,changeDetection:0});let n=i;return n})();export{po as a,Yt as b,ee as c,Gi as d,Wi as e,se as f,De as g,Ye as h,ae as i,uo as j,wr as k,Oe as l,fo as m,Pr as n,Ei as o,Oi as p,pe as q,Ge as r,we as s,Wt as t,ut as u,Ae as v,ge as w,Xe as x,ti as y,ke as z,xi as A,Fi as B,Ze as C,Ao as D,pt as E,Ro as F,Mi as G,zr as H,gt as I,jr as J,Hr as K,bc as L,xo as M,Sc as N,Yr as O,Ic as P,Kr as Q,Dc as R,Ec as S,Oc as T,wc as U,Po as V,Fo as W,Uo as X,No as Y,Pc as Z,Mc as _,Lc as $,Fc as aa,Uc as ba,Nc as ca,zc as da,Bc as ea,$c as fa,zo as ga,Vc as ha,jc as ia,rs as ja,Vo as ka,Ki as la,Ko as ma,Ji as na,rn as oa,sn as pa,Td as qa,xd as ra,on as sa,an as ta,tn as ua,nn as va,er as wa,et as xa,lr as ya,hi as za,Rs as Aa,ks as Ba,Ts as Ca,xs as Da,Ps as Ea,Ah as Fa,fi as Ga,_r as Ha,vr as Ia,Qh as Ja};
@@ -1,2 +1,2 @@
1
- import{Cb as a,Db as h,Ra as o,Wa as c,fb as m,qj as g,ya as s,zk as l}from"./chunk-7CAYUDV6.js";var d=["*"],C=(()=>{let i=class i{constructor(t,e,n){this.elementRef=t,this.domService=e,this.loggingService=n,this.veltElement=!0}ngAfterViewInit(){try{this.customCssSubscription=this.domService.subscribeInjectCustomCss(this.elementRef)}catch(t){this.loggingService.catch("Error in ShadowDomComponent ngAfterViewInit: ",t)}}ngOnDestroy(){try{this.customCssSubscription?.unsubscribe()}catch(t){this.loggingService.catch("Error in ShadowDomComponent ngOnDestroy: ",t)}}};i.\u0275fac=function(e){return new(e||i)(o(s),o(l),o(g))},i.\u0275cmp=c({type:i,selectors:[["velt-shadow-dom-internal"]],hostVars:1,hostBindings:function(e,n){e&2&&m("data-velt-element",n.veltElement)},ngContentSelectors:d,decls:1,vars:0,template:function(e,n){e&1&&(a(),h(0))},styles:[`:host{width:100%}
1
+ import{Ak as l,Cb as a,Db as h,Ra as o,Wa as c,fb as m,qj as g,ya as s}from"./chunk-XUBWZTRK.js";var d=["*"],C=(()=>{let i=class i{constructor(t,e,n){this.elementRef=t,this.domService=e,this.loggingService=n,this.veltElement=!0}ngAfterViewInit(){try{this.customCssSubscription=this.domService.subscribeInjectCustomCss(this.elementRef)}catch(t){this.loggingService.catch("Error in ShadowDomComponent ngAfterViewInit: ",t)}}ngOnDestroy(){try{this.customCssSubscription?.unsubscribe()}catch(t){this.loggingService.catch("Error in ShadowDomComponent ngOnDestroy: ",t)}}};i.\u0275fac=function(e){return new(e||i)(o(s),o(l),o(g))},i.\u0275cmp=c({type:i,selectors:[["velt-shadow-dom-internal"]],hostVars:1,hostBindings:function(e,n){e&2&&m("data-velt-element",n.veltElement)},ngContentSelectors:d,decls:1,vars:0,template:function(e,n){e&1&&(a(),h(0))},styles:[`:host{width:100%}
2
2
  `],encapsulation:3,changeDetection:0});let r=i;return r})();export{C as a};