@veltdev/sdk-dev 6.0.0-beta.10 → 6.0.0-beta.11

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 (80) hide show
  1. package/app/client/snippyly.model.d.ts +2 -3
  2. package/app/models/data/selection.model.d.ts +10 -8
  3. package/app/models/data/user-resolver.data.model.d.ts +11 -9
  4. package/app/models/data/user.data.model.d.ts +21 -18
  5. package/app/models/element/activity-element.model.d.ts +0 -1
  6. package/app/models/element/area-element.model.d.ts +0 -1
  7. package/app/models/element/arrow-element.model.d.ts +1 -2
  8. package/app/models/element/autocomplete-element.model.d.ts +0 -1
  9. package/app/models/element/comment-element.model.d.ts +77 -76
  10. package/app/models/element/contact-element.model.d.ts +1 -2
  11. package/app/models/element/crdt-element.model.d.ts +1 -1
  12. package/app/models/element/cursor-element.model.d.ts +1 -2
  13. package/app/models/element/huddle-element.model.d.ts +1 -2
  14. package/app/models/element/live-state-sync-element.model.d.ts +1 -1
  15. package/app/models/element/notification-element.model.d.ts +1 -1
  16. package/app/models/element/presence-element.model.d.ts +2 -3
  17. package/app/models/element/reaction-element.model.d.ts +1 -1
  18. package/app/models/element/recorder-element.model.d.ts +1 -2
  19. package/app/models/element/rewriter-element.model.d.ts +0 -1
  20. package/app/models/element/selection-element.model.d.ts +1 -1
  21. package/app/models/element/suggestion-element.model.d.ts +0 -1
  22. package/app/models/element/tag-element.model.d.ts +7 -8
  23. package/app/models/element/views-element.model.d.ts +1 -1
  24. package/app/utils/enums.d.ts +91 -82
  25. package/{chunk-SYNPZ2XP.js → chunk-45AFLSTN.js} +1 -1
  26. package/{chunk-PFQD3ZHE.js → chunk-4AUKSZTD.js} +1 -1
  27. package/{chunk-YTPDG6FY.js → chunk-4FFPMABU.js} +25 -25
  28. package/{chunk-5WUV64V6.js → chunk-4NYJX2TA.js} +1 -1
  29. package/{chunk-D5GNGKKF.js → chunk-6CQP35TI.js} +1 -1
  30. package/{chunk-5Y3GWVF6.js → chunk-6RE7E4UI.js} +1 -1
  31. package/{chunk-MTS7WSOI.js → chunk-7BJOXXKB.js} +1 -1
  32. package/{chunk-TO3QMX6L.js → chunk-7DJ6FAQU.js} +1 -1
  33. package/{chunk-LHFXU553.js → chunk-AE3HAZZP.js} +1 -1
  34. package/{chunk-OPFSWVO4.js → chunk-B7JEFRI6.js} +1 -1
  35. package/{chunk-4ZCY365X.js → chunk-BVOAAUMF.js} +1 -1
  36. package/{chunk-X7A6MBGM.js → chunk-BYPLI57L.js} +1 -1
  37. package/{chunk-TMURKDBH.js → chunk-DC4XY76Y.js} +1 -1
  38. package/{chunk-K2RBYFUJ.js → chunk-DNV5AXVR.js} +1 -1
  39. package/{chunk-TV5S4EJP.js → chunk-EHFD7BDQ.js} +1 -1
  40. package/{chunk-QMH32YWC.js → chunk-HXLFHQKR.js} +1 -1
  41. package/{chunk-DVSWAW3V.js → chunk-IYGDKLQF.js} +1 -1
  42. package/{chunk-PLHC4BWM.js → chunk-JDRVES6B.js} +1 -1
  43. package/{chunk-S6JEPTGO.js → chunk-JSM7AZPO.js} +1 -1
  44. package/{chunk-JBQSOLQ4.js → chunk-K6LMPDA2.js} +1 -1
  45. package/{chunk-M3Z3OPKG.js → chunk-KYM4A3Y5.js} +1 -1
  46. package/{chunk-PRJU4HJ5.js → chunk-MX3IHG3M.js} +1 -1
  47. package/{chunk-B53CSXPI.js → chunk-NFB2QFWZ.js} +1 -1
  48. package/{chunk-3NQO7KT2.js → chunk-PKSCPPL3.js} +1 -1
  49. package/{chunk-FGJMQQP7.js → chunk-POOMHZRV.js} +1 -1
  50. package/{chunk-S7XRWLIA.js → chunk-RA6SFDHP.js} +1 -1
  51. package/{chunk-LE6ADPBN.js → chunk-RMNTICFD.js} +1 -1
  52. package/{chunk-3BBCVKQ5.js → chunk-TRRDAYZ3.js} +1 -1
  53. package/{chunk-QJJZ7GBM.js → chunk-TTTPO3O7.js} +1 -1
  54. package/{chunk-NRZ34IWA.js → chunk-XBIYBLRP.js} +1 -1
  55. package/{chunk-4ICELJP6.js → chunk-YWIE7OOR.js} +1 -1
  56. package/{chunk-DNCQDV54.js → chunk-ZINOKO4N.js} +1 -1
  57. package/{chunk-AHFE2P66.js → chunk-ZJBVC654.js} +1 -1
  58. package/package.json +1 -1
  59. package/types.d.ts +22 -22
  60. package/velt-activity-log.js +1 -1
  61. package/velt-area.js +1 -1
  62. package/velt-arrow.js +1 -1
  63. package/velt-comment.js +1 -1
  64. package/velt-crdt.js +1 -1
  65. package/velt-cursor.js +1 -1
  66. package/velt-huddle.js +1 -1
  67. package/velt-live-state-sync.js +1 -1
  68. package/velt-notification.js +1 -1
  69. package/velt-presence.js +1 -1
  70. package/velt-reaction.js +1 -1
  71. package/velt-recorder.js +1 -1
  72. package/velt-rewriter.js +1 -1
  73. package/velt-selection.js +1 -1
  74. package/velt-tag.js +1 -1
  75. package/velt-user-invite.js +1 -1
  76. package/velt-user-request.js +1 -1
  77. package/velt-video-player.js +1 -1
  78. package/velt-views.js +1 -1
  79. package/velt.d.ts +2 -3
  80. package/velt.js +3 -3
@@ -1 +1 @@
1
- import{a as m}from"./chunk-AHFE2P66.js";import{Pa as c,Xa as f}from"./chunk-YTPDG6FY.js";var l=(()=>{let t=class t{constructor(r){this.translateService=r}transform(r,...i){try{let n=(new Date().getTime()-new Date(r).getTime())/1e3;if(n<1)return this.translateService.translate("now");let s={y:31536e3,mo:2592e3,w:604800,d:86400,h:3600,m:60,s:1};for(let a in s){let o=Math.floor(n/s[a]);if(o>0)return`${o}${this.translateService.translate(a)}`}return r}catch{return r}}};t.\u0275fac=function(i){return new(i||t)(c(m,16))},t.\u0275pipe=f({name:"timeAgo",type:t,pure:!0});let e=t;return e})();export{l as a};
1
+ import{a as m}from"./chunk-ZJBVC654.js";import{Pa as c,Xa as f}from"./chunk-4FFPMABU.js";var l=(()=>{let t=class t{constructor(r){this.translateService=r}transform(r,...i){try{let n=(new Date().getTime()-new Date(r).getTime())/1e3;if(n<1)return this.translateService.translate("now");let s={y:31536e3,mo:2592e3,w:604800,d:86400,h:3600,m:60,s:1};for(let a in s){let o=Math.floor(n/s[a]);if(o>0)return`${o}${this.translateService.translate(a)}`}return r}catch{return r}}};t.\u0275fac=function(i){return new(i||t)(c(m,16))},t.\u0275pipe=f({name:"timeAgo",type:t,pure:!0});let e=t;return e})();export{l as a};
@@ -1,4 +1,4 @@
1
- import{$ as y,Ab as vn,Bb as yn,Bc as At,Bi as T,Ci as Un,D as Ct,Db as Et,Dc as In,De as tt,E as D,Eb as Ot,F as bt,Fa as dn,Fb as wt,G as ai,Ga as B,Ha as U,Hf as Rn,Hi as Lt,I as St,Ia as re,Ii as Nn,J as ne,Jb as Cn,Je as Tt,Kb as et,Kf as ui,L as oe,La as be,M as Ji,Na as ae,Oa as Fe,P as en,Pa as Z,Q as tn,Qe as S,Qf as O,Qi as zn,Ra as Le,S as Ce,Sa as li,T as v,Te as je,Tf as Tn,U as he,Ua as W,V as nn,Va as N,W as J,Wa as F,Xc as H,Y as on,Ya as Y,Yc as kt,Za as hn,Zh as it,_ as sn,_a as Dt,_b as Ne,a as p,aa as L,ag as Mn,b as z,ba as A,bb as Ue,ca as R,da as h,db as fe,fa as xe,fe as Dn,g as $,ge as En,h as Q,hf as wn,i as ye,if as An,j as Zi,je as Rt,k as _,l as b,la as E,ma as P,mb as un,n as Qi,na as rn,nb as fn,nf as kn,ni as xt,o as qi,oi as Fn,pa as Pe,pb as pn,pi as te,q as _t,qa as V,qb as gn,qe as On,qi as $e,r as g,rb as mn,rc as bn,s as vt,sa as an,sc as hi,si as Ln,ta as cn,tc as ze,ua as se,uh as fi,v as C,va as ue,vi as Pt,w as Je,wa as k,wb as di,wg as xn,wi as Se,x as yt,xa as ci,xb as _n,xc as Be,xh as Mt,xi as Ve,ya as ln,yc as Sn,yi as Ie,za as It,zc as ee,zh as Pn,zi as Ft}from"./chunk-YTPDG6FY.js";function ce(o,i=0){return Bn(o)?Number(o):arguments.length===2?i:0}function Bn(o){return!isNaN(parseFloat(o))&&!isNaN(Number(o))}function De(o){return o instanceof k?o.nativeElement:o}var jo=new A("cdk-dir-doc",{providedIn:"root",factory:$o});function $o(){return h(P)}var Vo=/^(ar|ckb|dv|he|iw|fa|nqo|ps|sd|ug|ur|yi|.*[-_](Adlm|Arab|Hebr|Nkoo|Rohg|Thaa))(?!.*[-_](Latn|Cyrl)($|-|_))($|-|_)/i;function jn(o){let i=o?.toLowerCase()||"";return i==="auto"&&typeof navigator<"u"&&navigator?.language?Vo.test(navigator.language)?"rtl":"ltr":i==="rtl"?"rtl":"ltr"}var le=(()=>{class o{get value(){return this.valueSignal()}valueSignal=V("ltr");change=new B;constructor(){let e=h(jo,{optional:!0});if(e){let t=e.body?e.body.dir:null,n=e.documentElement?e.documentElement.dir:null;this.valueSignal.set(jn(t||n||"ltr"))}}ngOnDestroy(){this.change.complete()}static \u0275fac=function(t){return new(t||o)};static \u0275prov=y({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();var q=(function(o){return o[o.NORMAL=0]="NORMAL",o[o.NEGATED=1]="NEGATED",o[o.INVERTED=2]="INVERTED",o})(q||{}),Ut,Ee;function Nt(){if(Ee==null){if(typeof document!="object"||!document||typeof Element!="function"||!Element)return Ee=!1,Ee;if(document.documentElement?.style&&"scrollBehavior"in document.documentElement.style)Ee=!0;else{let o=Element.prototype.scrollTo;o?Ee=!/\{\s*\[native code\]\s*\}/.test(o.toString()):Ee=!1}}return Ee}function He(){if(typeof document!="object"||!document)return q.NORMAL;if(Ut==null){let o=document.createElement("div"),i=o.style;o.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",o.appendChild(e),document.body.appendChild(o),Ut=q.NORMAL,o.scrollLeft===0&&(o.scrollLeft=1,Ut=o.scrollLeft===0?q.NEGATED:q.INVERTED),o.remove()}return Ut}var pe=(()=>{class o{static \u0275fac=function(t){return new(t||o)};static \u0275mod=N({type:o});static \u0275inj=L({})}return o})();var zt=class{};function $n(o){return o&&typeof o.connect=="function"&&!(o instanceof Zi)}var Bt=class extends zt{_data;constructor(i){super(),this._data=i}connect(){return vt(this._data)?this._data:g(this._data)}disconnect(){}},nt=(function(o){return o[o.REPLACED=0]="REPLACED",o[o.INSERTED=1]="INSERTED",o[o.MOVED=2]="MOVED",o[o.REMOVED=3]="REMOVED",o})(nt||{}),pi=new A("_ViewRepeater"),jt=class{viewCacheSize=20;_viewCache=[];applyChanges(i,e,t,n,s){i.forEachOperation((r,a,c)=>{let d,l;if(r.previousIndex==null){let u=()=>t(r,a,c);d=this._insertView(u,c,e,n(r)),l=d?nt.INSERTED:nt.REPLACED}else c==null?(this._detachAndCacheView(a,e),l=nt.REMOVED):(d=this._moveView(a,c,e,n(r)),l=nt.MOVED);s&&s({context:d?.context,operation:l,record:r})})}detach(){for(let i of this._viewCache)i.destroy();this._viewCache=[]}_insertView(i,e,t,n){let s=this._insertViewFromCache(e,t);if(s){s.context.$implicit=n;return}let r=i();return t.createEmbeddedView(r.templateRef,r.context,r.index)}_detachAndCacheView(i,e){let t=e.detach(i);this._maybeCacheView(t,e)}_moveView(i,e,t,n){let s=t.get(i);return t.move(s,e),s.context.$implicit=n,s}_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 Ho=["contentWrapper"],Go=["*"],Gn=new A("VIRTUAL_SCROLL_STRATEGY"),gi=class{_scrolledIndexChange=new _;scrolledIndexChange=this._scrolledIndexChange.pipe(oe());_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(),n=this._viewport.getDataLength(),s=this._viewport.measureScrollOffset(),r=this._itemSize>0?s/this._itemSize:0;if(e.end>n){let c=Math.ceil(t/this._itemSize),d=Math.max(0,Math.min(r,n-c));r!=d&&(r=d,s=d*this._itemSize,e.start=Math.floor(r)),e.end=Math.max(0,Math.min(n,e.start+c))}let a=s-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(n,Math.ceil(r+(t+this._minBufferPx)/this._itemSize))}else{let c=e.end*this._itemSize-(s+t);if(c<this._minBufferPx&&e.end!=n){let d=Math.ceil((this._maxBufferPx-c)/this._itemSize);d>0&&(e.end=Math.min(n,e.end+d),e.start=Math.max(0,Math.floor(r-this._minBufferPx/this._itemSize)))}}this._viewport.setRenderedRange(e),this._viewport.setRenderedContentOffset(Math.round(this._itemSize*e.start)),this._scrolledIndexChange.next(Math.floor(r))}};function Wo(o){return o._scrollStrategy}var Yo=(()=>{class o{get itemSize(){return this._itemSize}set itemSize(e){this._itemSize=ce(e)}_itemSize=20;get minBufferPx(){return this._minBufferPx}set minBufferPx(e){this._minBufferPx=ce(e)}_minBufferPx=100;get maxBufferPx(){return this._maxBufferPx}set maxBufferPx(e){this._maxBufferPx=ce(e)}_maxBufferPx=200;_scrollStrategy=new gi(this.itemSize,this.minBufferPx,this.maxBufferPx);ngOnChanges(){this._scrollStrategy.updateItemAndBufferSize(this.itemSize,this.minBufferPx,this.maxBufferPx)}static \u0275fac=function(t){return new(t||o)};static \u0275dir=F({type:o,selectors:[["cdk-virtual-scroll-viewport","itemSize",""]],inputs:{itemSize:"itemSize",minBufferPx:"minBufferPx",maxBufferPx:"maxBufferPx"},features:[Ne([{provide:Gn,useFactory:Wo,deps:[sn(()=>o)]}]),se]})}return o})(),Ko=20,ot=(()=>{class o{_ngZone=h(U);_platform=h(H);_renderer=h(ae).createRenderer(null,null);_cleanupGlobalListener;constructor(){}_scrolled=new _;_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=Ko){return this._platform.isBrowser?new ye(t=>{this._cleanupGlobalListener||(this._cleanupGlobalListener=this._ngZone.runOutsideAngular(()=>this._renderer.listen("document","scroll",()=>this._scrolled.next())));let n=e>0?this._scrolled.pipe(bt(e)).subscribe(t):this._scrolled.subscribe(t);return this._scrolledCount++,()=>{n.unsubscribe(),this._scrolledCount--,this._scrolledCount||(this._cleanupGlobalListener?.(),this._cleanupGlobalListener=void 0)}}):g()}ngOnDestroy(){this._cleanupGlobalListener?.(),this._cleanupGlobalListener=void 0,this.scrollContainers.forEach((e,t)=>this.deregister(t)),this._scrolled.complete()}ancestorScrolled(e,t){let n=this.getAncestorScrollContainers(e);return this.scrolled(t).pipe(D(s=>!s||n.indexOf(s)>-1))}getAncestorScrollContainers(e){let t=[];return this.scrollContainers.forEach((n,s)=>{this._scrollableContainsElement(s,e)&&t.push(s)}),t}_scrollableContainsElement(e,t){let n=De(t),s=e.getElementRef().nativeElement;do if(n==s)return!0;while(n=n.parentElement);return!1}static \u0275fac=function(t){return new(t||o)};static \u0275prov=y({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})(),st=(()=>{class o{elementRef=h(k);scrollDispatcher=h(ot);ngZone=h(U);dir=h(le,{optional:!0});_scrollElement=this.elementRef.nativeElement;_destroyed=new _;_renderer=h(Fe);_cleanupScroll;_elementScrolled=new _;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,n=this.dir&&this.dir.value=="rtl";e.left==null&&(e.left=n?e.end:e.start),e.right==null&&(e.right=n?e.start:e.end),e.bottom!=null&&(e.top=t.scrollHeight-t.clientHeight-e.bottom),n&&He()!=q.NORMAL?(e.left!=null&&(e.right=t.scrollWidth-t.clientWidth-e.left),He()==q.INVERTED?e.left=e.right:He()==q.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;Nt()?t.scrollTo(e):(e.top!=null&&(t.scrollTop=e.top),e.left!=null&&(t.scrollLeft=e.left))}measureScrollOffset(e){let t="left",n="right",s=this.elementRef.nativeElement;if(e=="top")return s.scrollTop;if(e=="bottom")return s.scrollHeight-s.clientHeight-s.scrollTop;let r=this.dir&&this.dir.value=="rtl";return e=="start"?e=r?n:t:e=="end"&&(e=r?t:n),r&&He()==q.INVERTED?e==t?s.scrollWidth-s.clientWidth-s.scrollLeft:s.scrollLeft:r&&He()==q.NEGATED?e==t?s.scrollLeft+s.scrollWidth-s.clientWidth:-s.scrollLeft:e==t?s.scrollLeft:s.scrollWidth-s.clientWidth-s.scrollLeft}static \u0275fac=function(t){return new(t||o)};static \u0275dir=F({type:o,selectors:[["","cdk-scrollable",""],["","cdkScrollable",""]]})}return o})(),Xo=20,Oe=(()=>{class o{_platform=h(H);_listeners;_viewportSize;_change=new _;_document=h(P);constructor(){let e=h(U),t=h(ae).createRenderer(null,null);e.runOutsideAngular(()=>{if(this._platform.isBrowser){let n=s=>this._change.next(s);this._listeners=[t.listen("window","resize",n),t.listen("window","orientationchange",n)]}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:n}=this.getViewportSize();return{top:e.top,left:e.left,bottom:e.top+n,right:e.left+t,height:n,width:t}}getViewportScrollPosition(){if(!this._platform.isBrowser)return{top:0,left:0};let e=this._document,t=this._getWindow(),n=e.documentElement,s=n.getBoundingClientRect(),r=-s.top||e.body.scrollTop||t.scrollY||n.scrollTop||0,a=-s.left||e.body.scrollLeft||t.scrollX||n.scrollLeft||0;return{top:r,left:a}}change(e=Xo){return e>0?this._change.pipe(bt(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||o)};static \u0275prov=y({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})(),Vn=new A("VIRTUAL_SCROLLABLE"),Zo=(()=>{class o extends st{constructor(){super()}measureViewportSize(e){let t=this.elementRef.nativeElement;return e==="horizontal"?t.clientWidth:t.clientHeight}static \u0275fac=function(t){return new(t||o)};static \u0275dir=F({type:o,features:[Y]})}return o})();function Qo(o,i){return o.start==i.start&&o.end==i.end}var qo=typeof requestAnimationFrame<"u"?qi:Qi,Wn=(()=>{class o extends Zo{elementRef=h(k);_changeDetectorRef=h(Be);_scrollStrategy=h(Gn,{optional:!0});scrollable=h(Vn,{optional:!0});_platform=h(H);_detachedSubject=new _;_renderedRangeSubject=new _;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=V("");_totalContentHeight=V("");_renderedContentTransform;_renderedRange={start:0,end:0};_dataLength=0;_viewportSize=0;_forOf;_renderedContentOffset=0;_renderedContentOffsetNeedsRewrite=!1;_changeDetectionNeeded=V(!1);_runAfterChangeDetection=[];_viewportChanges=Q.EMPTY;_injector=h(E);_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=ze(()=>{this._changeDetectionNeeded()&&this._doChangeDetection()},{injector:h(Ue).injector});h(rn).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),bt(0,qo),he(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(he(this._detachedSubject)).subscribe(t=>{let n=t.length;n!==this._dataLength&&(this._dataLength=n,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){Qo(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 n=this.dir&&this.dir.value=="rtl",s=this.orientation=="horizontal",r=s?"X":"Y",c=`translate${r}(${Number((s&&n?-1:1)*e)}px)`;this._renderedContentOffset=e,t==="to-end"&&(c+=` translate${r}(-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 n={behavior:t};this.orientation==="horizontal"?n.start=e:n.top=e,this.scrollable.scrollTo(n)}scrollToIndex(e,t="auto"){this._scrollStrategy.scrollToIndex(e,t)}measureScrollOffset(e){let t;return this.scrollable==this?t=n=>super.measureScrollOffset(n):t=n=>this.scrollable.measureScrollOffset(n),Math.max(0,t(e??(this.orientation==="horizontal"?"start":"top"))-this.measureViewportOffset())}measureViewportOffset(e){let t,n="left",s="right",r=this.dir?.value=="rtl";e=="start"?t=r?s:n:e=="end"?t=r?n:s: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,re(()=>{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||o)};static \u0275cmp=W({type:o,selectors:[["cdk-virtual-scroll-viewport"]],viewQuery:function(t,n){if(t&1&&Et(Ho,7),t&2){let s;Ot(s=wt())&&(n._contentWrapper=s.first)}},hostAttrs:[1,"cdk-virtual-scroll-viewport"],hostVars:4,hostBindings:function(t,n){t&2&&et("cdk-virtual-scroll-orientation-horizontal",n.orientation==="horizontal")("cdk-virtual-scroll-orientation-vertical",n.orientation!=="horizontal")},inputs:{orientation:"orientation",appendOnly:[2,"appendOnly","appendOnly",ee]},outputs:{scrolledIndexChange:"scrolledIndexChange"},features:[Ne([{provide:st,useFactory:(e,t)=>e||t,deps:[[new cn,new an(Vn)],o]}]),Y],ngContentSelectors:Go,decls:4,vars:4,consts:[["contentWrapper",""],[1,"cdk-virtual-scroll-content-wrapper"],[1,"cdk-virtual-scroll-spacer"]],template:function(t,n){t&1&&(vn(),pn(0,"div",1,0),yn(2),gn(),mn(3,"div",2)),t&2&&(dn(3),Cn("width",n._totalContentWidth())("height",n._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}
1
+ import{$ as y,Ab as vn,Bb as yn,Bc as At,Bi as T,Ci as Un,D as Ct,Db as Et,Dc as In,De as tt,E as D,Eb as Ot,F as bt,Fa as dn,Fb as wt,G as ai,Ga as B,Ha as U,Hf as Rn,Hi as Lt,I as St,Ia as re,Ii as Nn,J as ne,Jb as Cn,Je as Tt,Kb as et,Kf as ui,L as oe,La as be,M as Ji,Na as ae,Oa as Fe,P as en,Pa as Z,Q as tn,Qe as S,Qf as O,Qi as zn,Ra as Le,S as Ce,Sa as li,T as v,Te as je,Tf as Tn,U as he,Ua as W,V as nn,Va as N,W as J,Wa as F,Xc as H,Y as on,Ya as Y,Yc as kt,Za as hn,Zh as it,_ as sn,_a as Dt,_b as Ne,a as p,aa as L,ag as Mn,b as z,ba as A,bb as Ue,ca as R,da as h,db as fe,fa as xe,fe as Dn,g as $,ge as En,h as Q,hf as wn,i as ye,if as An,j as Zi,je as Rt,k as _,l as b,la as E,ma as P,mb as un,n as Qi,na as rn,nb as fn,nf as kn,ni as xt,o as qi,oi as Fn,pa as Pe,pb as pn,pi as te,q as _t,qa as V,qb as gn,qe as On,qi as $e,r as g,rb as mn,rc as bn,s as vt,sa as an,sc as hi,si as Ln,ta as cn,tc as ze,ua as se,uh as fi,v as C,va as ue,vi as Pt,w as Je,wa as k,wb as di,wg as xn,wi as Se,x as yt,xa as ci,xb as _n,xc as Be,xh as Mt,xi as Ve,ya as ln,yc as Sn,yi as Ie,za as It,zc as ee,zh as Pn,zi as Ft}from"./chunk-4FFPMABU.js";function ce(o,i=0){return Bn(o)?Number(o):arguments.length===2?i:0}function Bn(o){return!isNaN(parseFloat(o))&&!isNaN(Number(o))}function De(o){return o instanceof k?o.nativeElement:o}var jo=new A("cdk-dir-doc",{providedIn:"root",factory:$o});function $o(){return h(P)}var Vo=/^(ar|ckb|dv|he|iw|fa|nqo|ps|sd|ug|ur|yi|.*[-_](Adlm|Arab|Hebr|Nkoo|Rohg|Thaa))(?!.*[-_](Latn|Cyrl)($|-|_))($|-|_)/i;function jn(o){let i=o?.toLowerCase()||"";return i==="auto"&&typeof navigator<"u"&&navigator?.language?Vo.test(navigator.language)?"rtl":"ltr":i==="rtl"?"rtl":"ltr"}var le=(()=>{class o{get value(){return this.valueSignal()}valueSignal=V("ltr");change=new B;constructor(){let e=h(jo,{optional:!0});if(e){let t=e.body?e.body.dir:null,n=e.documentElement?e.documentElement.dir:null;this.valueSignal.set(jn(t||n||"ltr"))}}ngOnDestroy(){this.change.complete()}static \u0275fac=function(t){return new(t||o)};static \u0275prov=y({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();var q=(function(o){return o[o.NORMAL=0]="NORMAL",o[o.NEGATED=1]="NEGATED",o[o.INVERTED=2]="INVERTED",o})(q||{}),Ut,Ee;function Nt(){if(Ee==null){if(typeof document!="object"||!document||typeof Element!="function"||!Element)return Ee=!1,Ee;if(document.documentElement?.style&&"scrollBehavior"in document.documentElement.style)Ee=!0;else{let o=Element.prototype.scrollTo;o?Ee=!/\{\s*\[native code\]\s*\}/.test(o.toString()):Ee=!1}}return Ee}function He(){if(typeof document!="object"||!document)return q.NORMAL;if(Ut==null){let o=document.createElement("div"),i=o.style;o.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",o.appendChild(e),document.body.appendChild(o),Ut=q.NORMAL,o.scrollLeft===0&&(o.scrollLeft=1,Ut=o.scrollLeft===0?q.NEGATED:q.INVERTED),o.remove()}return Ut}var pe=(()=>{class o{static \u0275fac=function(t){return new(t||o)};static \u0275mod=N({type:o});static \u0275inj=L({})}return o})();var zt=class{};function $n(o){return o&&typeof o.connect=="function"&&!(o instanceof Zi)}var Bt=class extends zt{_data;constructor(i){super(),this._data=i}connect(){return vt(this._data)?this._data:g(this._data)}disconnect(){}},nt=(function(o){return o[o.REPLACED=0]="REPLACED",o[o.INSERTED=1]="INSERTED",o[o.MOVED=2]="MOVED",o[o.REMOVED=3]="REMOVED",o})(nt||{}),pi=new A("_ViewRepeater"),jt=class{viewCacheSize=20;_viewCache=[];applyChanges(i,e,t,n,s){i.forEachOperation((r,a,c)=>{let d,l;if(r.previousIndex==null){let u=()=>t(r,a,c);d=this._insertView(u,c,e,n(r)),l=d?nt.INSERTED:nt.REPLACED}else c==null?(this._detachAndCacheView(a,e),l=nt.REMOVED):(d=this._moveView(a,c,e,n(r)),l=nt.MOVED);s&&s({context:d?.context,operation:l,record:r})})}detach(){for(let i of this._viewCache)i.destroy();this._viewCache=[]}_insertView(i,e,t,n){let s=this._insertViewFromCache(e,t);if(s){s.context.$implicit=n;return}let r=i();return t.createEmbeddedView(r.templateRef,r.context,r.index)}_detachAndCacheView(i,e){let t=e.detach(i);this._maybeCacheView(t,e)}_moveView(i,e,t,n){let s=t.get(i);return t.move(s,e),s.context.$implicit=n,s}_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 Ho=["contentWrapper"],Go=["*"],Gn=new A("VIRTUAL_SCROLL_STRATEGY"),gi=class{_scrolledIndexChange=new _;scrolledIndexChange=this._scrolledIndexChange.pipe(oe());_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(),n=this._viewport.getDataLength(),s=this._viewport.measureScrollOffset(),r=this._itemSize>0?s/this._itemSize:0;if(e.end>n){let c=Math.ceil(t/this._itemSize),d=Math.max(0,Math.min(r,n-c));r!=d&&(r=d,s=d*this._itemSize,e.start=Math.floor(r)),e.end=Math.max(0,Math.min(n,e.start+c))}let a=s-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(n,Math.ceil(r+(t+this._minBufferPx)/this._itemSize))}else{let c=e.end*this._itemSize-(s+t);if(c<this._minBufferPx&&e.end!=n){let d=Math.ceil((this._maxBufferPx-c)/this._itemSize);d>0&&(e.end=Math.min(n,e.end+d),e.start=Math.max(0,Math.floor(r-this._minBufferPx/this._itemSize)))}}this._viewport.setRenderedRange(e),this._viewport.setRenderedContentOffset(Math.round(this._itemSize*e.start)),this._scrolledIndexChange.next(Math.floor(r))}};function Wo(o){return o._scrollStrategy}var Yo=(()=>{class o{get itemSize(){return this._itemSize}set itemSize(e){this._itemSize=ce(e)}_itemSize=20;get minBufferPx(){return this._minBufferPx}set minBufferPx(e){this._minBufferPx=ce(e)}_minBufferPx=100;get maxBufferPx(){return this._maxBufferPx}set maxBufferPx(e){this._maxBufferPx=ce(e)}_maxBufferPx=200;_scrollStrategy=new gi(this.itemSize,this.minBufferPx,this.maxBufferPx);ngOnChanges(){this._scrollStrategy.updateItemAndBufferSize(this.itemSize,this.minBufferPx,this.maxBufferPx)}static \u0275fac=function(t){return new(t||o)};static \u0275dir=F({type:o,selectors:[["cdk-virtual-scroll-viewport","itemSize",""]],inputs:{itemSize:"itemSize",minBufferPx:"minBufferPx",maxBufferPx:"maxBufferPx"},features:[Ne([{provide:Gn,useFactory:Wo,deps:[sn(()=>o)]}]),se]})}return o})(),Ko=20,ot=(()=>{class o{_ngZone=h(U);_platform=h(H);_renderer=h(ae).createRenderer(null,null);_cleanupGlobalListener;constructor(){}_scrolled=new _;_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=Ko){return this._platform.isBrowser?new ye(t=>{this._cleanupGlobalListener||(this._cleanupGlobalListener=this._ngZone.runOutsideAngular(()=>this._renderer.listen("document","scroll",()=>this._scrolled.next())));let n=e>0?this._scrolled.pipe(bt(e)).subscribe(t):this._scrolled.subscribe(t);return this._scrolledCount++,()=>{n.unsubscribe(),this._scrolledCount--,this._scrolledCount||(this._cleanupGlobalListener?.(),this._cleanupGlobalListener=void 0)}}):g()}ngOnDestroy(){this._cleanupGlobalListener?.(),this._cleanupGlobalListener=void 0,this.scrollContainers.forEach((e,t)=>this.deregister(t)),this._scrolled.complete()}ancestorScrolled(e,t){let n=this.getAncestorScrollContainers(e);return this.scrolled(t).pipe(D(s=>!s||n.indexOf(s)>-1))}getAncestorScrollContainers(e){let t=[];return this.scrollContainers.forEach((n,s)=>{this._scrollableContainsElement(s,e)&&t.push(s)}),t}_scrollableContainsElement(e,t){let n=De(t),s=e.getElementRef().nativeElement;do if(n==s)return!0;while(n=n.parentElement);return!1}static \u0275fac=function(t){return new(t||o)};static \u0275prov=y({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})(),st=(()=>{class o{elementRef=h(k);scrollDispatcher=h(ot);ngZone=h(U);dir=h(le,{optional:!0});_scrollElement=this.elementRef.nativeElement;_destroyed=new _;_renderer=h(Fe);_cleanupScroll;_elementScrolled=new _;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,n=this.dir&&this.dir.value=="rtl";e.left==null&&(e.left=n?e.end:e.start),e.right==null&&(e.right=n?e.start:e.end),e.bottom!=null&&(e.top=t.scrollHeight-t.clientHeight-e.bottom),n&&He()!=q.NORMAL?(e.left!=null&&(e.right=t.scrollWidth-t.clientWidth-e.left),He()==q.INVERTED?e.left=e.right:He()==q.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;Nt()?t.scrollTo(e):(e.top!=null&&(t.scrollTop=e.top),e.left!=null&&(t.scrollLeft=e.left))}measureScrollOffset(e){let t="left",n="right",s=this.elementRef.nativeElement;if(e=="top")return s.scrollTop;if(e=="bottom")return s.scrollHeight-s.clientHeight-s.scrollTop;let r=this.dir&&this.dir.value=="rtl";return e=="start"?e=r?n:t:e=="end"&&(e=r?t:n),r&&He()==q.INVERTED?e==t?s.scrollWidth-s.clientWidth-s.scrollLeft:s.scrollLeft:r&&He()==q.NEGATED?e==t?s.scrollLeft+s.scrollWidth-s.clientWidth:-s.scrollLeft:e==t?s.scrollLeft:s.scrollWidth-s.clientWidth-s.scrollLeft}static \u0275fac=function(t){return new(t||o)};static \u0275dir=F({type:o,selectors:[["","cdk-scrollable",""],["","cdkScrollable",""]]})}return o})(),Xo=20,Oe=(()=>{class o{_platform=h(H);_listeners;_viewportSize;_change=new _;_document=h(P);constructor(){let e=h(U),t=h(ae).createRenderer(null,null);e.runOutsideAngular(()=>{if(this._platform.isBrowser){let n=s=>this._change.next(s);this._listeners=[t.listen("window","resize",n),t.listen("window","orientationchange",n)]}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:n}=this.getViewportSize();return{top:e.top,left:e.left,bottom:e.top+n,right:e.left+t,height:n,width:t}}getViewportScrollPosition(){if(!this._platform.isBrowser)return{top:0,left:0};let e=this._document,t=this._getWindow(),n=e.documentElement,s=n.getBoundingClientRect(),r=-s.top||e.body.scrollTop||t.scrollY||n.scrollTop||0,a=-s.left||e.body.scrollLeft||t.scrollX||n.scrollLeft||0;return{top:r,left:a}}change(e=Xo){return e>0?this._change.pipe(bt(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||o)};static \u0275prov=y({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})(),Vn=new A("VIRTUAL_SCROLLABLE"),Zo=(()=>{class o extends st{constructor(){super()}measureViewportSize(e){let t=this.elementRef.nativeElement;return e==="horizontal"?t.clientWidth:t.clientHeight}static \u0275fac=function(t){return new(t||o)};static \u0275dir=F({type:o,features:[Y]})}return o})();function Qo(o,i){return o.start==i.start&&o.end==i.end}var qo=typeof requestAnimationFrame<"u"?qi:Qi,Wn=(()=>{class o extends Zo{elementRef=h(k);_changeDetectorRef=h(Be);_scrollStrategy=h(Gn,{optional:!0});scrollable=h(Vn,{optional:!0});_platform=h(H);_detachedSubject=new _;_renderedRangeSubject=new _;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=V("");_totalContentHeight=V("");_renderedContentTransform;_renderedRange={start:0,end:0};_dataLength=0;_viewportSize=0;_forOf;_renderedContentOffset=0;_renderedContentOffsetNeedsRewrite=!1;_changeDetectionNeeded=V(!1);_runAfterChangeDetection=[];_viewportChanges=Q.EMPTY;_injector=h(E);_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=ze(()=>{this._changeDetectionNeeded()&&this._doChangeDetection()},{injector:h(Ue).injector});h(rn).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),bt(0,qo),he(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(he(this._detachedSubject)).subscribe(t=>{let n=t.length;n!==this._dataLength&&(this._dataLength=n,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){Qo(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 n=this.dir&&this.dir.value=="rtl",s=this.orientation=="horizontal",r=s?"X":"Y",c=`translate${r}(${Number((s&&n?-1:1)*e)}px)`;this._renderedContentOffset=e,t==="to-end"&&(c+=` translate${r}(-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 n={behavior:t};this.orientation==="horizontal"?n.start=e:n.top=e,this.scrollable.scrollTo(n)}scrollToIndex(e,t="auto"){this._scrollStrategy.scrollToIndex(e,t)}measureScrollOffset(e){let t;return this.scrollable==this?t=n=>super.measureScrollOffset(n):t=n=>this.scrollable.measureScrollOffset(n),Math.max(0,t(e??(this.orientation==="horizontal"?"start":"top"))-this.measureViewportOffset())}measureViewportOffset(e){let t,n="left",s="right",r=this.dir?.value=="rtl";e=="start"?t=r?s:n:e=="end"?t=r?n:s: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,re(()=>{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||o)};static \u0275cmp=W({type:o,selectors:[["cdk-virtual-scroll-viewport"]],viewQuery:function(t,n){if(t&1&&Et(Ho,7),t&2){let s;Ot(s=wt())&&(n._contentWrapper=s.first)}},hostAttrs:[1,"cdk-virtual-scroll-viewport"],hostVars:4,hostBindings:function(t,n){t&2&&et("cdk-virtual-scroll-orientation-horizontal",n.orientation==="horizontal")("cdk-virtual-scroll-orientation-vertical",n.orientation!=="horizontal")},inputs:{orientation:"orientation",appendOnly:[2,"appendOnly","appendOnly",ee]},outputs:{scrolledIndexChange:"scrolledIndexChange"},features:[Ne([{provide:st,useFactory:(e,t)=>e||t,deps:[[new cn,new an(Vn)],o]}]),Y],ngContentSelectors:Go,decls:4,vars:4,consts:[["contentWrapper",""],[1,"cdk-virtual-scroll-content-wrapper"],[1,"cdk-virtual-scroll-spacer"]],template:function(t,n){t&1&&(vn(),pn(0,"div",1,0),yn(2),gn(),mn(3,"div",2)),t&2&&(dn(3),Cn("width",n._totalContentWidth())("height",n._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
2
  `],encapsulation:2,changeDetection:0})}return o})();function Hn(o,i,e){let t=e;if(!t.getBoundingClientRect)return 0;let n=t.getBoundingClientRect();return o==="horizontal"?i==="start"?n.left:n.right:i==="start"?n.top:n.bottom}var Jo=(()=>{class o{_viewContainerRef=h(Le);_template=h(be);_differs=h(Sn);_viewRepeater=h(pi);_viewport=h(Wn,{skipSelf:!0});viewChange=new _;_dataSourceChanges=new _;get cdkVirtualForOf(){return this._cdkVirtualForOf}set cdkVirtualForOf(e){this._cdkVirtualForOf=e,$n(e)?this._dataSourceChanges.next(e):this._dataSourceChanges.next(new Bt(vt(e)?e:Array.from(e||[])))}_cdkVirtualForOf;get cdkVirtualForTrackBy(){return this._cdkVirtualForTrackBy}set cdkVirtualForTrackBy(e){this._needsUpdate=!0,this._cdkVirtualForTrackBy=e?(t,n)=>e(t+(this._renderedRange?this._renderedRange.start:0),n):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=ce(e)}dataStream=this._dataSourceChanges.pipe(Ce(null),Ji(),v(([e,t])=>this._changeDataSource(e,t)),en(1));_differ=null;_data;_renderedItems;_renderedRange;_needsUpdate=!1;_destroyed=new _;constructor(){let e=h(U);this.dataStream.subscribe(t=>{this._data=t,this._onRenderedDataChange()}),this._viewport.renderedRangeStream.pipe(he(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 n=e.start-this._renderedRange.start,s=e.end-e.start,r,a;for(let c=0;c<s;c++){let d=this._viewContainerRef.get(c+n);if(d&&d.rootNodes.length){r=a=d.rootNodes[0];break}}for(let c=s-1;c>-1;c--){let d=this._viewContainerRef.get(c+n);if(d&&d.rootNodes.length){a=d.rootNodes[d.rootNodes.length-1];break}}return r&&a?Hn(t,"end",a)-Hn(t,"start",r):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):g()}_updateContext(){let e=this._data.length,t=this._viewContainerRef.length;for(;t--;){let n=this._viewContainerRef.get(t);n.context.index=this._renderedRange.start+t,n.context.count=e,this._updateComputedContextProperties(n.context),n.detectChanges()}}_applyChanges(e){this._viewRepeater.applyChanges(e,this._viewContainerRef,(s,r,a)=>this._getEmbeddedViewArgs(s,a),s=>s.item),e.forEachIdentityChange(s=>{let r=this._viewContainerRef.get(s.currentIndex);r.context.$implicit=s.item});let t=this._data.length,n=this._viewContainerRef.length;for(;n--;){let s=this._viewContainerRef.get(n);s.context.index=this._renderedRange.start+n,s.context.count=t,this._updateComputedContextProperties(s.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||o)};static \u0275dir=F({type:o,selectors:[["","cdkVirtualFor","","cdkVirtualForOf",""]],inputs:{cdkVirtualForOf:"cdkVirtualForOf",cdkVirtualForTrackBy:"cdkVirtualForTrackBy",cdkVirtualForTemplate:"cdkVirtualForTemplate",cdkVirtualForTemplateCacheSize:"cdkVirtualForTemplateCacheSize"},features:[Ne([{provide:pi,useClass:jt}])]})}return o})();var mi=(()=>{class o{static \u0275fac=function(t){return new(t||o)};static \u0275mod=N({type:o});static \u0275inj=L({})}return o})(),_i=(()=>{class o{static \u0275fac=function(t){return new(t||o)};static \u0275mod=N({type:o});static \u0275inj=L({imports:[pe,mi,pe,mi]})}return o})();var rt=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 rt{component;viewContainerRef;injector;projectableNodes;constructor(i,e,t,n){super(),this.component=i,this.viewContainerRef=e,this.injector=t,this.projectableNodes=n}},we=class extends rt{templateRef;viewContainerRef;context;injector;constructor(i,e,t,n){super(),this.templateRef=i,this.viewContainerRef=e,this.context=t,this.injector=n}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()}},vi=class extends rt{element;constructor(i){super(),this.element=i instanceof k?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 vi)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)}},$t=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,n=t.get(li,null,{optional:!0})||void 0;e=i.viewContainerRef.createComponent(i.component,{index:i.viewContainerRef.length,injector:t,ngModuleRef:n,projectableNodes:i.projectableNodes||void 0}),this.setDisposeFn(()=>e.destroy())}else{let t=this._appRef,n=i.injector||this._defaultInjector||E.NULL,s=n.get(xe,t.injector);e=At(i.component,{elementInjector:n,environmentInjector:s,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(n=>this.outletElement.appendChild(n)),t.detectChanges(),this.setDisposeFn(()=>{let n=e.indexOf(t);n!==-1&&e.remove(n)}),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 at=(()=>{class o extends We{_moduleRef=h(li,{optional:!0});_document=h(P);_viewContainerRef=h(Le);_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,n=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(n.hostView.rootNodes[0]),super.setDisposeFn(()=>n.destroy()),this._attachedPortal=e,this._attachedRef=n,this.attached.emit(n),n}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 n=this._document.createComment("dom-portal");e.setAttachedHost(this),t.parentNode.insertBefore(n,t),this._getRootNode().appendChild(t),this._attachedPortal=e,super.setDisposeFn(()=>{n.parentNode&&n.parentNode.replaceChild(t,n)})};_getRootNode(){let e=this._viewContainerRef.element.nativeElement;return e.nodeType===e.ELEMENT_NODE?e:e.parentNode}static \u0275fac=function(t){return new(t||o)};static \u0275dir=F({type:o,selectors:[["","cdkPortalOutlet",""]],inputs:{portal:[0,"cdkPortalOutlet","portal"]},outputs:{attached:"attached"},exportAs:["cdkPortalOutlet"],features:[Y]})}return o})();var Ae=(()=>{class o{static \u0275fac=function(t){return new(t||o)};static \u0275mod=N({type:o});static \u0275inj=L({})}return o})();var yi;function ts(){if(yi==null){let o=typeof document<"u"?document.head:null;yi=!!(o&&(o.createShadowRoot||o.attachShadow))}return yi}function Yn(o){if(ts()){let i=o.getRootNode?o.getRootNode():null;if(typeof ShadowRoot<"u"&&ShadowRoot&&i instanceof ShadowRoot)return i}return null}function Vt(){let o=typeof document<"u"&&document?document.activeElement:null;for(;o&&o.shadowRoot;){let i=o.shadowRoot.activeElement;if(i===o)break;o=i}return o}function ie(o){return o.composedPath?o.composedPath()[0]:o.target}function Ci(){return typeof __karma__<"u"&&!!__karma__||typeof jasmine<"u"&&!!jasmine||typeof jest<"u"&&!!jest||typeof Mocha<"u"&&!!Mocha}var Ht=new WeakMap,Ye=(()=>{class o{_appRef;_injector=h(E);_environmentInjector=h(xe);load(e){let t=this._appRef=this._appRef||this._injector.get(Ue),n=Ht.get(t);n||(n={loaders:new Set,refs:[]},Ht.set(t,n),t.onDestroy(()=>{Ht.get(t)?.refs.forEach(s=>s.destroy()),Ht.delete(t)})),n.loaders.has(e)||(n.loaders.add(e),n.refs.push(At(e,{environmentInjector:this._environmentInjector})))}static \u0275fac=function(t){return new(t||o)};static \u0275prov=y({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();function M(o){return o==null?"":typeof o=="string"?o:`${o}px`}var bi={},ge=(()=>{class o{_appId=h(ln);getId(e){return this._appId!=="ng"&&(e+=this._appId),bi.hasOwnProperty(e)||(bi[e]=0),`${e}${bi[e]++}`}static \u0275fac=function(t){return new(t||o)};static \u0275prov=y({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();function me(o,...i){return i.length?i.some(e=>o[e]):o.altKey||o.shiftKey||o.ctrlKey||o.metaKey}var Kn=Nt();function Xe(o){return new Gt(o.get(Oe),o.get(P))}var Gt=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=M(-this._previousScrollPosition.left),i.style.top=M(-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,n=e.style,s=t.scrollBehavior||"",r=n.scrollBehavior||"";this._isEnabled=!1,t.left=this._previousHTMLStyles.left,t.top=this._previousHTMLStyles.top,i.classList.remove("cdk-global-scrollblock"),Kn&&(t.scrollBehavior=n.scrollBehavior="auto"),window.scroll(this._previousScrollPosition.left,this._previousScrollPosition.top),Kn&&(t.scrollBehavior=s,n.scrollBehavior=r)}}_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 to(o,i){return new Wt(o.get(ot),o.get(U),o.get(Oe),i)}var Wt=class{_scrollDispatcher;_ngZone;_viewportRuler;_config;_scrollSubscription=null;_overlayRef;_initialScrollPosition;constructor(i,e,t,n){this._scrollDispatcher=i,this._ngZone=e,this._viewportRuler=t,this._config=n}attach(i){this._overlayRef,this._overlayRef=i}enable(){if(this._scrollSubscription)return;let i=this._scrollDispatcher.scrolled(0).pipe(D(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 ct=class{enable(){}disable(){}attach(){}};function Si(o,i){return i.some(e=>{let t=o.bottom<e.top,n=o.top>e.bottom,s=o.right<e.left,r=o.left>e.right;return t||n||s||r})}function Xn(o,i){return i.some(e=>{let t=o.top<e.top,n=o.bottom>e.bottom,s=o.left<e.left,r=o.right>e.right;return t||n||s||r})}function Qt(o,i){return new Yt(o.get(ot),o.get(Oe),o.get(U),i)}var Yt=class{_scrollDispatcher;_viewportRuler;_ngZone;_config;_scrollSubscription=null;_overlayRef;constructor(i,e,t,n){this._scrollDispatcher=i,this._viewportRuler=e,this._ngZone=t,this._config=n}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:n}=this._viewportRuler.getViewportSize();Si(e,[{width:t,height:n,bottom:n,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 o{_injector=h(E);constructor(){}noop=()=>new ct;close=e=>to(this._injector,e);block=()=>Xe(this._injector);reposition=e=>Qt(this._injector,e);static \u0275fac=function(t){return new(t||o)};static \u0275prov=y({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})(),Re=class{positionStrategy;scrollStrategy=new ct;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])}}},Ii=class{offsetX;offsetY;panelClass;originX;originY;overlayX;overlayY;constructor(i,e,t,n,s){this.offsetX=t,this.offsetY=n,this.panelClass=s,this.originX=i.originX,this.originY=i.originY,this.overlayX=e.overlayX,this.overlayY=e.overlayY}};var Kt=class{connectionPair;scrollableViewProperties;constructor(i,e){this.connectionPair=i,this.scrollableViewProperties=e}};var no=(()=>{class o{_attachedOverlays=[];_document=h(P);_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||o)};static \u0275prov=y({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})(),oo=(()=>{class o extends no{_ngZone=h(U);_renderer=h(ae).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 n=t.length-1;n>-1;n--)if(t[n]._keydownEvents.observers.length>0){this._ngZone.run(()=>t[n]._keydownEvents.next(e));break}};static \u0275fac=(()=>{let e;return function(n){return(e||(e=ue(o)))(n||o)}})();static \u0275prov=y({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})(),so=(()=>{class o extends no{_platform=h(H);_ngZone=h(U);_renderer=h(ae).createRenderer(null,null);_cursorOriginalValue;_cursorStyleIsSet=!1;_pointerDownEventTarget;_cleanups;add(e){if(super.add(e),!this._isAttached){let t=this._document.body,n={capture:!0},s=this._renderer;this._cleanups=this._ngZone.runOutsideAngular(()=>[s.listen(t,"pointerdown",this._pointerDownListener,n),s.listen(t,"click",this._clickListener,n),s.listen(t,"auxclick",this._clickListener,n),s.listen(t,"contextmenu",this._clickListener,n)]),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=ie(e)};_clickListener=e=>{let t=ie(e),n=e.type==="click"&&this._pointerDownEventTarget?this._pointerDownEventTarget:t;this._pointerDownEventTarget=null;let s=this._attachedOverlays.slice();for(let r=s.length-1;r>-1;r--){let a=s[r];if(a._outsidePointerEvents.observers.length<1||!a.hasAttached())continue;if(Zn(a.overlayElement,t)||Zn(a.overlayElement,n))break;let c=a._outsidePointerEvents;this._ngZone?this._ngZone.run(()=>c.next(e)):c.next(e)}};static \u0275fac=(()=>{let e;return function(n){return(e||(e=ue(o)))(n||o)}})();static \u0275prov=y({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();function Zn(o,i){let e=typeof ShadowRoot<"u"&&ShadowRoot,t=i;for(;t;){if(t===o)return!0;t=e&&t instanceof ShadowRoot?t.host:t.parentNode}return!1}var ro=(()=>{class o{static \u0275fac=function(t){return new(t||o)};static \u0275cmp=W({type:o,selectors:[["ng-component"]],hostAttrs:["cdk-overlay-style-loader",""],decls:0,vars:0,template:function(t,n){},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
3
  `],encapsulation:2,changeDetection:0})}return o})(),qt=(()=>{class o{_platform=h(H);_containerElement;_document=h(P);_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||Ci()){let n=this._document.querySelectorAll(`.${e}[platform="server"], .${e}[platform="test"]`);for(let s=0;s<n.length;s++)n[s].remove()}let t=this._document.createElement("div");t.classList.add(e),Ci()?t.setAttribute("platform","test"):this._platform.isBrowser||t.setAttribute("platform","server"),this._document.body.appendChild(t),this._containerElement=t}_loadStyles(){this._styleLoader.load(ro)}static \u0275fac=function(t){return new(t||o)};static \u0275prov=y({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})(),Di=class{_renderer;_ngZone;element;_cleanupClick;_cleanupTransitionEnd;_fallbackTimeout;constructor(i,e,t,n){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",n)}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 _;_attachments=new _;_detachments=new _;_positionStrategy;_scrollStrategy;_locationChanges=Q.EMPTY;_backdropRef=null;_detachContentMutationObserver;_detachContentAfterRenderRef;_previousHostParent;_keydownEvents=new _;_outsidePointerEvents=new _;_afterNextRenderRef;constructor(i,e,t,n,s,r,a,c,d,l=!1,u,w){this._portalOutlet=i,this._host=e,this._pane=t,this._config=n,this._ngZone=s,this._keyboardDispatcher=r,this._document=a,this._location=c,this._outsideClickDispatcher=d,this._animationsDisabled=l,this._injector=u,this._renderer=w,n.scrollStrategy&&(this._scrollStrategy=n.scrollStrategy,this._scrollStrategy.attach(this)),this._positionStrategy=n.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=re(()=>{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=p(p({},this._config),i),this._updateElementSize()}setDirection(i){this._config=z(p({},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=M(this._config.width),i.height=M(this._config.height),i.minWidth=M(this._config.minWidth),i.minHeight=M(this._config.minHeight),i.maxWidth=M(this._config.maxWidth),i.maxHeight=M(this._config.maxHeight)}_togglePointerEvents(i){this._pane.style.pointerEvents=i?"":"none"}_attachBackdrop(){let i="cdk-overlay-backdrop-showing";this._backdropRef?.dispose(),this._backdropRef=new Di(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 n=kt(e||[]).filter(s=>!!s);n.length&&(t?i.classList.add(...n):i.classList.remove(...n))}_detachContentWhenEmpty(){let i=!1;try{this._detachContentAfterRenderRef=re(()=>{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?.()}},Qn="cdk-overlay-connected-position-bounding-box",is=/([A-Za-z%]+)$/;function wi(o,i){return new Xt(i,o.get(Oe),o.get(P),o.get(H),o.get(qt))}var Xt=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 _;_resizeSubscription=Q.EMPTY;_offsetX=0;_offsetY=0;_transformOriginSelector;_appliedPanelClasses=[];_previousPushAmount;positionChanges=this._positionChanges;get positions(){return this._preferredPositions}constructor(i,e,t,n,s){this._viewportRuler=e,this._document=t,this._platform=n,this._overlayContainer=s,this.setOrigin(i)}attach(i){this._overlayRef&&this._overlayRef,this._validatePositions(),i.hostElement.classList.add(Qn),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,n=this._containerRect,s=[],r;for(let a of this._preferredPositions){let c=this._getOriginPoint(i,n,a),d=this._getOverlayPoint(c,e,a),l=this._getOverlayFit(d,e,t,a);if(l.isCompletelyWithinViewport){this._isPushed=!1,this._applyPosition(a,c);return}if(this._canFitWithFlexibleDimensions(l,d,t)){s.push({position:a,origin:c,overlayRect:e,boundingBoxRect:this._calculateBoundingBoxRect(c,a)});continue}(!r||r.overlayFit.visibleArea<l.visibleArea)&&(r={overlayFit:l,overlayPoint:d,originPoint:c,position:a,overlayRect:e})}if(s.length){let a=null,c=-1;for(let d of s){let l=d.boundingBoxRect.width*d.boundingBoxRect.height*(d.position.weight||1);l>c&&(c=l,a=d)}this._isPushed=!1,this._applyPosition(a.position,a.origin);return}if(this._canPush){this._isPushed=!0,this._applyPosition(r.position,r.originPoint);return}this._applyPosition(r.position,r.originPoint)}detach(){this._clearPanelClasses(),this._lastPosition=null,this._previousPushAmount=null,this._resizeSubscription.unsubscribe()}dispose(){this._isDisposed||(this._boundingBox&&ke(this._boundingBox.style,{top:"",left:"",right:"",bottom:"",height:"",width:"",alignItems:"",justifyContent:""}),this._pane&&this._resetOverlayElementStyles(),this._overlayRef&&this._overlayRef.hostElement.classList.remove(Qn),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 n;if(t.originX=="center")n=i.left+i.width/2;else{let r=this._isRtl()?i.right:i.left,a=this._isRtl()?i.left:i.right;n=t.originX=="start"?r:a}e.left<0&&(n-=e.left);let s;return t.originY=="center"?s=i.top+i.height/2:s=t.originY=="top"?i.top:i.bottom,e.top<0&&(s-=e.top),{x:n,y:s}}_getOverlayPoint(i,e,t){let n;t.overlayX=="center"?n=-e.width/2:t.overlayX==="start"?n=this._isRtl()?-e.width:0:n=this._isRtl()?0:-e.width;let s;return t.overlayY=="center"?s=-e.height/2:s=t.overlayY=="top"?0:-e.height,{x:i.x+n,y:i.y+s}}_getOverlayFit(i,e,t,n){let s=Jn(e),{x:r,y:a}=i,c=this._getOffset(n,"x"),d=this._getOffset(n,"y");c&&(r+=c),d&&(a+=d);let l=0-r,u=r+s.width-t.width,w=0-a,f=a+s.height-t.height,m=this._subtractOverflows(s.width,l,u),I=this._subtractOverflows(s.height,w,f),K=m*I;return{visibleArea:K,isCompletelyWithinViewport:s.width*s.height===K,fitsInViewportVertically:I===s.height,fitsInViewportHorizontally:m==s.width}}_canFitWithFlexibleDimensions(i,e,t){if(this._hasFlexibleDimensions){let n=t.bottom-e.y,s=t.right-e.x,r=qn(this._overlayRef.getConfig().minHeight),a=qn(this._overlayRef.getConfig().minWidth),c=i.fitsInViewportVertically||r!=null&&r<=n,d=i.fitsInViewportHorizontally||a!=null&&a<=s;return c&&d}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 n=Jn(e),s=this._viewportRect,r=Math.max(i.x+n.width-s.width,0),a=Math.max(i.y+n.height-s.height,0),c=Math.max(s.top-t.top-i.y,0),d=Math.max(s.left-t.left-i.x,0),l=0,u=0;return n.width<=s.width?l=d||-r:l=i.x<this._viewportMargin?s.left-t.left-i.x:0,n.height<=s.height?u=c||-a:u=i.y<this._viewportMargin?s.top-t.top-i.y:0,this._previousPushAmount={x:l,y:u},{x:i.x+l,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||!ns(this._lastScrollVisibility,t)){let n=new Kt(i,t);this._positionChanges.next(n)}this._lastScrollVisibility=t}this._lastPosition=i,this._isInitialRender=!1}_setTransformOrigin(i){if(!this._transformOriginSelector)return;let e=this._boundingBox.querySelectorAll(this._transformOriginSelector),t,n=i.overlayY;i.overlayX==="center"?t="center":this._isRtl()?t=i.overlayX==="start"?"right":"left":t=i.overlayX==="start"?"left":"right";for(let s=0;s<e.length;s++)e[s].style.transformOrigin=`${t} ${n}`}_calculateBoundingBoxRect(i,e){let t=this._viewportRect,n=this._isRtl(),s,r,a;if(e.overlayY==="top")r=i.y,s=t.height-r+this._viewportMargin;else if(e.overlayY==="bottom")a=t.height-i.y+this._viewportMargin*2,s=t.height-a+this._viewportMargin;else{let f=Math.min(t.bottom-i.y+t.top,i.y),m=this._lastBoundingBoxSize.height;s=f*2,r=i.y-f,s>m&&!this._isInitialRender&&!this._growAfterOpen&&(r=i.y-m/2)}let c=e.overlayX==="start"&&!n||e.overlayX==="end"&&n,d=e.overlayX==="end"&&!n||e.overlayX==="start"&&n,l,u,w;if(d)w=t.width-i.x+this._viewportMargin*2,l=i.x-this._viewportMargin;else if(c)u=i.x,l=t.right-i.x;else{let f=Math.min(t.right-i.x+t.left,i.x),m=this._lastBoundingBoxSize.width;l=f*2,u=i.x-f,l>m&&!this._isInitialRender&&!this._growAfterOpen&&(u=i.x-m/2)}return{top:r,left:u,bottom:a,right:w,width:l,height:s}}_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 n={};if(this._hasExactPosition())n.top=n.left="0",n.bottom=n.right=n.maxHeight=n.maxWidth="",n.width=n.height="100%";else{let s=this._overlayRef.getConfig().maxHeight,r=this._overlayRef.getConfig().maxWidth;n.height=M(t.height),n.top=M(t.top),n.bottom=M(t.bottom),n.width=M(t.width),n.left=M(t.left),n.right=M(t.right),e.overlayX==="center"?n.alignItems="center":n.alignItems=e.overlayX==="end"?"flex-end":"flex-start",e.overlayY==="center"?n.justifyContent="center":n.justifyContent=e.overlayY==="bottom"?"flex-end":"flex-start",s&&(n.maxHeight=M(s)),r&&(n.maxWidth=M(r))}this._lastBoundingBoxSize=t,ke(this._boundingBox.style,n)}_resetBoundingBoxStyles(){ke(this._boundingBox.style,{top:"0",left:"0",right:"0",bottom:"0",height:"",width:"",alignItems:"",justifyContent:""})}_resetOverlayElementStyles(){ke(this._pane.style,{top:"",left:"",bottom:"",right:"",position:"",transform:""})}_setOverlayElementStyles(i,e){let t={},n=this._hasExactPosition(),s=this._hasFlexibleDimensions,r=this._overlayRef.getConfig();if(n){let l=this._viewportRuler.getViewportScrollPosition();ke(t,this._getExactOverlayY(e,i,l)),ke(t,this._getExactOverlayX(e,i,l))}else t.position="static";let a="",c=this._getOffset(e,"x"),d=this._getOffset(e,"y");c&&(a+=`translateX(${c}px) `),d&&(a+=`translateY(${d}px)`),t.transform=a.trim(),r.maxHeight&&(n?t.maxHeight=M(r.maxHeight):s&&(t.maxHeight="")),r.maxWidth&&(n?t.maxWidth=M(r.maxWidth):s&&(t.maxWidth="")),ke(this._pane.style,t)}_getExactOverlayY(i,e,t){let n={top:"",bottom:""},s=this._getOverlayPoint(e,this._overlayRect,i);if(this._isPushed&&(s=this._pushOverlayOnScreen(s,this._overlayRect,t)),i.overlayY==="bottom"){let r=this._document.documentElement.clientHeight;n.bottom=`${r-(s.y+this._overlayRect.height)}px`}else n.top=M(s.y);return n}_getExactOverlayX(i,e,t){let n={left:"",right:""},s=this._getOverlayPoint(e,this._overlayRect,i);this._isPushed&&(s=this._pushOverlayOnScreen(s,this._overlayRect,t));let r;if(this._isRtl()?r=i.overlayX==="end"?"left":"right":r=i.overlayX==="end"?"right":"left",r==="right"){let a=this._document.documentElement.clientWidth;n.right=`${a-(s.x+this._overlayRect.width)}px`}else n.left=M(s.x);return n}_getScrollVisibility(){let i=this._getOriginRect(),e=this._pane.getBoundingClientRect(),t=this._scrollables.map(n=>n.getElementRef().nativeElement.getBoundingClientRect());return{isOriginClipped:Xn(i,t),isOriginOutsideView:Si(i,t),isOverlayClipped:Xn(e,t),isOverlayOutsideView:Si(e,t)}}_subtractOverflows(i,...e){return e.reduce((t,n)=>t-Math.max(n,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&&kt(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 k)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 ke(o,i){for(let e in i)i.hasOwnProperty(e)&&(o[e]=i[e]);return o}function qn(o){if(typeof o!="number"&&o!=null){let[i,e]=o.split(is);return!e||e==="px"?parseFloat(i):null}return o||null}function Jn(o){return{top:Math.floor(o.top),right:Math.floor(o.right),bottom:Math.floor(o.bottom),left:Math.floor(o.left),width:Math.floor(o.width),height:Math.floor(o.height)}}function ns(o,i){return o===i?!0:o.isOriginClipped===i.isOriginClipped&&o.isOriginOutsideView===i.isOriginOutsideView&&o.isOverlayClipped===i.isOverlayClipped&&o.isOverlayOutsideView===i.isOverlayOutsideView}var eo="cdk-global-overlay-wrapper";function Ze(o){return new Zt}var Zt=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(eo),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:n,height:s,maxWidth:r,maxHeight:a}=t,c=(n==="100%"||n==="100vw")&&(!r||r==="100%"||r==="100vw"),d=(s==="100%"||s==="100vh")&&(!a||a==="100%"||a==="100vh"),l=this._xPosition,u=this._xOffset,w=this._overlayRef.getConfig().direction==="rtl",f="",m="",I="";c?I="flex-start":l==="center"?(I="center",w?m=u:f=u):w?l==="left"||l==="end"?(I="flex-end",f=u):(l==="right"||l==="start")&&(I="flex-start",m=u):l==="left"||l==="start"?(I="flex-start",f=u):(l==="right"||l==="end")&&(I="flex-end",m=u),i.position=this._cssPosition,i.marginLeft=c?"0":f,i.marginTop=d?"0":this._topOffset,i.marginBottom=this._bottomOffset,i.marginRight=c?"0":m,e.justifyContent=I,e.alignItems=d?"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(eo),t.justifyContent=t.alignItems=i.marginTop=i.marginBottom=i.marginLeft=i.marginRight=i.position="",this._overlayRef=null,this._isDisposed=!0}},ao=(()=>{class o{_injector=h(E);constructor(){}global(){return Ze()}flexibleConnectedTo(e){return wi(this._injector,e)}static \u0275fac=function(t){return new(t||o)};static \u0275prov=y({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();function lt(o,i){o.get(Ye).load(ro);let e=o.get(qt),t=o.get(P),n=o.get(ge),s=o.get(Ue),r=o.get(le),a=t.createElement("div"),c=t.createElement("div");c.id=n.getId("cdk-overlay-"),c.classList.add("cdk-overlay-pane"),a.appendChild(c),e.getContainerElement().appendChild(a);let d=new $t(c,s,o),l=new Re(i),u=o.get(Fe,null,{optional:!0})||o.get(ae).createRenderer(null,null);return l.direction=l.direction||r.value,new Ke(d,a,c,l,o.get(U),o.get(oo),t,o.get(In),o.get(so),i?.disableAnimations??o.get(It,null,{optional:!0})==="NoopAnimations",o.get(xe),u)}var co=(()=>{class o{scrollStrategies=h(io);_positionBuilder=h(ao);_injector=h(E);constructor(){}create(e){return lt(this._injector,e)}position(){return this._positionBuilder}static \u0275fac=function(t){return new(t||o)};static \u0275prov=y({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})(),os=[{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"}],lo=new A("cdk-connected-overlay-scroll-strategy",{providedIn:"root",factory:()=>{let o=h(E);return()=>Qt(o)}}),Ei=(()=>{class o{elementRef=h(k);constructor(){}static \u0275fac=function(t){return new(t||o)};static \u0275dir=F({type:o,selectors:[["","cdk-overlay-origin",""],["","overlay-origin",""],["","cdkOverlayOrigin",""]],exportAs:["cdkOverlayOrigin"]})}return o})(),ss=(()=>{class o{_dir=h(le,{optional:!0});_injector=h(E);_overlayRef;_templatePortal;_backdropSubscription=Q.EMPTY;_attachSubscription=Q.EMPTY;_detachSubscription=Q.EMPTY;_positionSubscription=Q.EMPTY;_offsetX;_offsetY;_position;_scrollStrategyFactory=h(lo);_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(Le);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=os);let e=this._overlayRef=lt(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&&!me(t)&&(t.preventDefault(),this.detachOverlay())}),this._overlayRef.outsidePointerEvents().subscribe(t=>{let n=this._getOriginElement(),s=ie(t);(!n||n!==s&&!n.contains(s))&&this.overlayOutsideClick.next(t)})}_buildConfig(){let e=this._position=this.positionStrategy||this._createPositionStrategy(),t=new Re({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(n=>({originX:n.originX,originY:n.originY,overlayX:n.overlayX,overlayY:n.overlayY,offsetX:n.offsetX||this.offsetX,offsetY:n.offsetY||this.offsetY,panelClass:n.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=wi(this._injector,this._getOrigin());return this._updatePositionStrategy(e),e}_getOrigin(){return this.origin instanceof Ei?this.origin.elementRef:this.origin}_getOriginElement(){return this.origin instanceof Ei?this.origin.elementRef.nativeElement:this.origin instanceof k?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(nn(()=>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||o)};static \u0275dir=F({type:o,selectors:[["","cdk-connected-overlay",""],["","connected-overlay",""],["","cdkConnectedOverlay",""]],inputs:{origin:[0,"cdkConnectedOverlayOrigin","origin"],positions:[0,"cdkConnectedOverlayPositions","positions"],positionStrategy:[0,"cdkConnectedOverlayPositionStrategy","positionStrategy"],offsetX:[0,"cdkConnectedOverlayOffsetX","offsetX"],offsetY:[0,"cdkConnectedOverlayOffsetY","offsetY"],width:[0,"cdkConnectedOverlayWidth","width"],height:[0,"cdkConnectedOverlayHeight","height"],minWidth:[0,"cdkConnectedOverlayMinWidth","minWidth"],minHeight:[0,"cdkConnectedOverlayMinHeight","minHeight"],backdropClass:[0,"cdkConnectedOverlayBackdropClass","backdropClass"],panelClass:[0,"cdkConnectedOverlayPanelClass","panelClass"],viewportMargin:[0,"cdkConnectedOverlayViewportMargin","viewportMargin"],scrollStrategy:[0,"cdkConnectedOverlayScrollStrategy","scrollStrategy"],open:[0,"cdkConnectedOverlayOpen","open"],disableClose:[0,"cdkConnectedOverlayDisableClose","disableClose"],transformOriginSelector:[0,"cdkConnectedOverlayTransformOriginOn","transformOriginSelector"],hasBackdrop:[2,"cdkConnectedOverlayHasBackdrop","hasBackdrop",ee],lockPosition:[2,"cdkConnectedOverlayLockPosition","lockPosition",ee],flexibleDimensions:[2,"cdkConnectedOverlayFlexibleDimensions","flexibleDimensions",ee],growAfterOpen:[2,"cdkConnectedOverlayGrowAfterOpen","growAfterOpen",ee],push:[2,"cdkConnectedOverlayPush","push",ee],disposeOnNavigation:[2,"cdkConnectedOverlayDisposeOnNavigation","disposeOnNavigation",ee]},outputs:{backdropClick:"backdropClick",positionChange:"positionChange",attach:"attach",detach:"detach",overlayKeydown:"overlayKeydown",overlayOutsideClick:"overlayOutsideClick"},exportAs:["cdkConnectedOverlay"],features:[se]})}return o})();function rs(o){let i=h(E);return()=>Qt(i)}var as={provide:lo,useFactory:rs},dt=(()=>{class o{static \u0275fac=function(t){return new(t||o)};static \u0275mod=N({type:o});static \u0275inj=L({providers:[co,as],imports:[pe,Ae,_i,_i]})}return o})();function Ai(o){return o.buttons===0||o.detail===0}function ki(o){let i=o.touches&&o.touches[0]||o.changedTouches&&o.changedTouches[0];return!!i&&i.identifier===-1&&(i.radiusX==null||i.radiusX===1)&&(i.radiusY==null||i.radiusY===1)}var ht;function cs(){if(ht==null&&typeof window<"u")try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>ht=!0}))}finally{ht=ht||!1}return ht}function ho(o){return cs()?o:!!o.capture}var uo=new A("cdk-input-modality-detector-options"),fo={ignoreKeys:[18,17,224,91,16]},po=650,Ri={passive:!0,capture:!0},go=(()=>{class o{_platform=h(H);_listenerCleanups;modalityDetected;modalityChanged;get mostRecentModality(){return this._modality.value}_mostRecentTarget=null;_modality=new b(null);_options;_lastTouchMs=0;_onKeydown=e=>{this._options?.ignoreKeys?.some(t=>t===e.keyCode)||(this._modality.next("keyboard"),this._mostRecentTarget=ie(e))};_onMousedown=e=>{Date.now()-this._lastTouchMs<po||(this._modality.next(Ai(e)?"keyboard":"mouse"),this._mostRecentTarget=ie(e))};_onTouchstart=e=>{if(ki(e)){this._modality.next("keyboard");return}this._lastTouchMs=Date.now(),this._modality.next("touch"),this._mostRecentTarget=ie(e)};constructor(){let e=h(U),t=h(P),n=h(uo,{optional:!0});if(this._options=p(p({},fo),n),this.modalityDetected=this._modality.pipe(tn(1)),this.modalityChanged=this.modalityDetected.pipe(oe()),this._platform.isBrowser){let s=h(ae).createRenderer(null,null);this._listenerCleanups=e.runOutsideAngular(()=>[s.listen(t,"keydown",this._onKeydown,Ri),s.listen(t,"mousedown",this._onMousedown,Ri),s.listen(t,"touchstart",this._onTouchstart,Ri)])}}ngOnDestroy(){this._modality.complete(),this._listenerCleanups?.forEach(e=>e())}static \u0275fac=function(t){return new(t||o)};static \u0275prov=y({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})(),ut=(function(o){return o[o.IMMEDIATE=0]="IMMEDIATE",o[o.EVENTUAL=1]="EVENTUAL",o})(ut||{}),mo=new A("cdk-focus-monitor-default-options"),Jt=ho({passive:!0,capture:!0}),Ti=(()=>{class o{_ngZone=h(U);_platform=h(H);_inputModalityDetector=h(go);_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(P);_stopInputModalityDetector=new _;constructor(){let e=h(mo,{optional:!0});this._detectionMode=e?.detectionMode||ut.IMMEDIATE}_rootNodeFocusAndBlurListener=e=>{let t=ie(e);for(let n=t;n;n=n.parentElement)e.type==="focus"?this._onFocus(e,n):this._onBlur(e,n)};monitor(e,t=!1){let n=De(e);if(!this._platform.isBrowser||n.nodeType!==1)return g();let s=Yn(n)||this._document,r=this._elementInfo.get(n);if(r)return t&&(r.checkChildren=!0),r.subject;let a={checkChildren:t,subject:new _,rootNode:s};return this._elementInfo.set(n,a),this._registerGlobalListeners(a),a.subject}stopMonitoring(e){let t=De(e),n=this._elementInfo.get(t);n&&(n.subject.complete(),this._setClasses(t),this._elementInfo.delete(t),this._removeGlobalListeners(n))}focusVia(e,t,n){let s=De(e),r=this._document.activeElement;s===r?this._getClosestElementsInfo(s).forEach(([a,c])=>this._originChanged(a,t,c)):(this._setOrigin(t),typeof s.focus=="function"&&s.focus(n))}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===ut.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===ut.IMMEDIATE){clearTimeout(this._originTimeoutId);let n=this._originFromTouchInteraction?po:1;this._originTimeoutId=setTimeout(()=>this._origin=null,n)}})}_onFocus(e,t){let n=this._elementInfo.get(t),s=ie(e);!n||!n.checkChildren&&t!==s||this._originChanged(t,this._getFocusOrigin(s),n)}_onBlur(e,t){let n=this._elementInfo.get(t);!n||n.checkChildren&&e.relatedTarget instanceof Node&&t.contains(e.relatedTarget)||(this._setClasses(t),this._emitOrigin(n,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,n=this._rootNodeFocusListenerCount.get(t)||0;n||this._ngZone.runOutsideAngular(()=>{t.addEventListener("focus",this._rootNodeFocusAndBlurListener,Jt),t.addEventListener("blur",this._rootNodeFocusAndBlurListener,Jt)}),this._rootNodeFocusListenerCount.set(t,n+1),++this._monitoredElementCount===1&&(this._ngZone.runOutsideAngular(()=>{this._getWindow().addEventListener("focus",this._windowFocusListener)}),this._inputModalityDetector.modalityDetected.pipe(he(this._stopInputModalityDetector)).subscribe(s=>{this._setOrigin(s,!0)}))}_removeGlobalListeners(e){let t=e.rootNode;if(this._rootNodeFocusListenerCount.has(t)){let n=this._rootNodeFocusListenerCount.get(t);n>1?this._rootNodeFocusListenerCount.set(t,n-1):(t.removeEventListener("focus",this._rootNodeFocusAndBlurListener,Jt),t.removeEventListener("blur",this._rootNodeFocusAndBlurListener,Jt),this._rootNodeFocusListenerCount.delete(t))}--this._monitoredElementCount||(this._getWindow().removeEventListener("focus",this._windowFocusListener),this._stopInputModalityDetector.next(),clearTimeout(this._windowFocusTimeoutId),clearTimeout(this._originTimeoutId))}_originChanged(e,t,n){this._setClasses(e,t),this._emitOrigin(n,t),this._lastFocusOrigin=t}_getClosestElementsInfo(e){let t=[];return this._elementInfo.forEach((n,s)=>{(s===e||n.checkChildren&&s.contains(e))&&t.push([s,n])}),t}_isLastInteractionFromInputLabel(e){let{_mostRecentTarget:t,mostRecentModality:n}=this._inputModalityDetector;if(n!=="mouse"||!t||t===e||e.nodeName!=="INPUT"&&e.nodeName!=="TEXTAREA"||e.disabled)return!1;let s=e.labels;if(s){for(let r=0;r<s.length;r++)if(s[r].contains(t))return!0}return!1}static \u0275fac=function(t){return new(t||o)};static \u0275prov=y({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();var _o=(()=>{class o{static \u0275fac=function(t){return new(t||o)};static \u0275cmp=W({type:o,selectors:[["ng-component"]],exportAs:["cdkVisuallyHidden"],decls:0,vars:0,template:function(t,n){},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
4
  `],encapsulation:2,changeDetection:0})}return o})();var ls=(()=>{class o{create(e){return typeof MutationObserver>"u"?null:new MutationObserver(e)}static \u0275fac=function(t){return new(t||o)};static \u0275prov=y({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();var vo=(()=>{class o{static \u0275fac=function(t){return new(t||o)};static \u0275mod=N({type:o});static \u0275inj=L({providers:[ls]})}return o})();var Pi=(()=>{class o{_platform=h(H);constructor(){}isDisabled(e){return e.hasAttribute("disabled")}isVisible(e){return hs(e)&&getComputedStyle(e).visibility==="visible"}isTabbable(e){if(!this._platform.isBrowser)return!1;let t=ds(ys(e));if(t&&(yo(t)===-1||!this.isVisible(t)))return!1;let n=e.nodeName.toLowerCase(),s=yo(e);return e.hasAttribute("contenteditable")?s!==-1:n==="iframe"||n==="object"||this._platform.WEBKIT&&this._platform.IOS&&!_s(e)?!1:n==="audio"?e.hasAttribute("controls")?s!==-1:!1:n==="video"?s===-1?!1:s!==null?!0:this._platform.FIREFOX||e.hasAttribute("controls"):e.tabIndex>=0}isFocusable(e,t){return vs(e)&&!this.isDisabled(e)&&(t?.ignoreVisibility||this.isVisible(e))}static \u0275fac=function(t){return new(t||o)};static \u0275prov=y({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();function ds(o){try{return o.frameElement}catch{return null}}function hs(o){return!!(o.offsetWidth||o.offsetHeight||typeof o.getClientRects=="function"&&o.getClientRects().length)}function us(o){let i=o.nodeName.toLowerCase();return i==="input"||i==="select"||i==="button"||i==="textarea"}function fs(o){return gs(o)&&o.type=="hidden"}function ps(o){return ms(o)&&o.hasAttribute("href")}function gs(o){return o.nodeName.toLowerCase()=="input"}function ms(o){return o.nodeName.toLowerCase()=="a"}function So(o){if(!o.hasAttribute("tabindex")||o.tabIndex===void 0)return!1;let i=o.getAttribute("tabindex");return!!(i&&!isNaN(parseInt(i,10)))}function yo(o){if(!So(o))return null;let i=parseInt(o.getAttribute("tabindex")||"",10);return isNaN(i)?-1:i}function _s(o){let i=o.nodeName.toLowerCase(),e=i==="input"&&o.type;return e==="text"||e==="password"||i==="select"||i==="textarea"}function vs(o){return fs(o)?!1:us(o)||ps(o)||o.hasAttribute("contenteditable")||So(o)}function ys(o){return o.ownerDocument&&o.ownerDocument.defaultView||window}var xi=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,n,s=!1,r){this._element=i,this._checker=e,this._ngZone=t,this._document=n,this._injector=r,s||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 n=e[t].nodeType===this._document.ELEMENT_NODE?this._getFirstTabbableElement(e[t]):null;if(n)return n}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 n=e[t].nodeType===this._document.ELEMENT_NODE?this._getLastTabbableElement(e[t]):null;if(n)return n}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?re(i,{injector:this._injector}):setTimeout(i)}},Fi=(()=>{class o{_checker=h(Pi);_ngZone=h(U);_document=h(P);_injector=h(E);constructor(){h(Ye).load(_o)}create(e,t=!1){return new xi(e,this._checker,this._ngZone,this._document,t,this._injector)}static \u0275fac=function(t){return new(t||o)};static \u0275prov=y({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();var _e=(function(o){return o[o.NONE=0]="NONE",o[o.BLACK_ON_WHITE=1]="BLACK_ON_WHITE",o[o.WHITE_ON_BLACK=2]="WHITE_ON_BLACK",o})(_e||{}),Co="cdk-high-contrast-black-on-white",bo="cdk-high-contrast-white-on-black",Mi="cdk-high-contrast-active",ei=(()=>{class o{_platform=h(H);_hasCheckedHighContrastMode;_document=h(P);_breakpointSubscription;constructor(){this._breakpointSubscription=h(En).observe("(forced-colors: active)").subscribe(()=>{this._hasCheckedHighContrastMode&&(this._hasCheckedHighContrastMode=!1,this._applyBodyHighContrastModeCssClasses())})}getHighContrastMode(){if(!this._platform.isBrowser)return _e.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,n=t&&t.getComputedStyle?t.getComputedStyle(e):null,s=(n&&n.backgroundColor||"").replace(/ /g,"");switch(e.remove(),s){case"rgb(0,0,0)":case"rgb(45,50,54)":case"rgb(32,32,32)":return _e.WHITE_ON_BLACK;case"rgb(255,255,255)":case"rgb(255,250,239)":return _e.BLACK_ON_WHITE}return _e.NONE}ngOnDestroy(){this._breakpointSubscription.unsubscribe()}_applyBodyHighContrastModeCssClasses(){if(!this._hasCheckedHighContrastMode&&this._platform.isBrowser&&this._document.body){let e=this._document.body.classList;e.remove(Mi,Co,bo),this._hasCheckedHighContrastMode=!0;let t=this.getHighContrastMode();t===_e.BLACK_ON_WHITE?e.add(Mi,Co):t===_e.WHITE_ON_BLACK&&e.add(Mi,bo)}}static \u0275fac=function(t){return new(t||o)};static \u0275prov=y({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})(),Li=(()=>{class o{constructor(){h(ei)._applyBodyHighContrastModeCssClasses()}static \u0275fac=function(t){return new(t||o)};static \u0275mod=N({type:o});static \u0275inj=L({imports:[vo]})}return o})();function Cs(o,i){}var ve=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 Ni=(()=>{class o extends We{_elementRef=h(k);_focusTrapFactory=h(Fi);_config;_interactivityChecker=h(Pi);_ngZone=h(U);_focusMonitor=h(Ti);_renderer=h(Fe);_changeDetectorRef=h(Be);_injector=h(E);_platform=h(H);_document=h(P);_portalOutlet;_focusTrapped=new _;_focusTrap=null;_elementFocusedBeforeDialogWasOpened=null;_closeInteractionType=null;_ariaLabelledByQueue=[];_isDestroyed=!1;constructor(){super(),this._config=h(ve,{optional:!0})||new ve,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 n=()=>{s(),r(),e.removeAttribute("tabindex")},s=this._renderer.listen(e,"blur",n),r=this._renderer.listen(e,"mousedown",n)})),e.focus(t)}_focusByCssSelector(e,t){let n=this._elementRef.nativeElement.querySelector(e);n&&this._forceFocus(n,t)}_trapFocus(e){this._isDestroyed||re(()=>{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 n=Vt(),s=this._elementRef.nativeElement;(!n||n===this._document.body||n===s||s.contains(n))&&(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=Vt();return e===t||e.contains(t)}_initializeFocusTrap(){this._platform.isBrowser&&(this._focusTrap=this._focusTrapFactory.create(this._elementRef.nativeElement),this._document&&(this._elementFocusedBeforeDialogWasOpened=Vt()))}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=W({type:o,selectors:[["cdk-dialog-container"]],viewQuery:function(t,n){if(t&1&&Et(at,7),t&2){let s;Ot(s=wt())&&(n._portalOutlet=s.first)}},hostAttrs:["tabindex","-1",1,"cdk-dialog-container"],hostVars:6,hostBindings:function(t,n){t&2&&fe("id",n._config.id||null)("role",n._config.role)("aria-modal",n._config.ariaModal)("aria-labelledby",n._config.ariaLabel?null:n._ariaLabelledByQueue[0])("aria-label",n._config.ariaLabel)("aria-describedby",n._config.ariaDescribedBy||null)},features:[Y],decls:1,vars:0,consts:[["cdkPortalOutlet",""]],template:function(t,n){t&1&&Dt(0,Cs,0,0,"ng-template",0)},dependencies:[at],styles:[`.cdk-dialog-container{display:block;width:100%;height:100%;min-height:inherit;max-height:inherit}
@@ -1,4 +1,4 @@
1
- import{b as G}from"./chunk-S6JEPTGO.js";import{$ as O,C as w,Ci as _,E as g,Hi as x,L as S,M as P,Pd as W,Pi as Q,Qf as D,Qi as Y,Rd as y,S as j,Sd as U,T as H,Ud as $,W as E,Wd as C,_d as A,ca as u,g as k,l as z,p as B,pi as M,qi as N,r as h,ui as R,v as b,vi as K,w as F,xh as L}from"./chunk-YTPDG6FY.js";var he=(()=>{let m=class m{constructor(e,t,r,s,o,c,n,i,d){this.authService=e,this.commonDbService=t,this.databaseService=r,this.docService=s,this.domService=o,this.loggingService=c,this.metadataService=n,this.commonDbUtils=i,this.configService=d,this.HEARTBEAT_DURATION=5*1e3,this.heartbeatEnabled$=new z(!1),this.subscriptions=[],this.heartbeatCreatedTimestamps=new Map,this.initializedHeartbeatIds=new Set;try{this.loggingService.log("%c[WB] Creating CLASS: HeartbeatService","color: blue;"),this.heartbeatEnabled$.pipe(S()).subscribe(a=>{a?this.setupHeartbeat():this.teardownHeartbeat()}),this.docService.addPreDocumentIdChangeFunction("heartbeat-service",a=>a?.documentId?this.removeDocumentHeartbeat(a):Promise.resolve())}catch(a){this.loggingService.catch("Error in HeartbeatService constructor: ",a)}}setupWebWorker(e){try{let t=`
1
+ import{b as G}from"./chunk-JSM7AZPO.js";import{$ as O,C as w,Ci as _,E as g,Hi as x,L as S,M as P,Pd as W,Pi as Q,Qf as D,Qi as Y,Rd as y,S as j,Sd as U,T as H,Ud as $,W as E,Wd as C,_d as A,ca as u,g as k,l as z,p as B,pi as M,qi as N,r as h,ui as R,v as b,vi as K,w as F,xh as L}from"./chunk-4FFPMABU.js";var he=(()=>{let m=class m{constructor(e,t,r,s,o,c,n,i,d){this.authService=e,this.commonDbService=t,this.databaseService=r,this.docService=s,this.domService=o,this.loggingService=c,this.metadataService=n,this.commonDbUtils=i,this.configService=d,this.HEARTBEAT_DURATION=5*1e3,this.heartbeatEnabled$=new z(!1),this.subscriptions=[],this.heartbeatCreatedTimestamps=new Map,this.initializedHeartbeatIds=new Set;try{this.loggingService.log("%c[WB] Creating CLASS: HeartbeatService","color: blue;"),this.heartbeatEnabled$.pipe(S()).subscribe(a=>{a?this.setupHeartbeat():this.teardownHeartbeat()}),this.docService.addPreDocumentIdChangeFunction("heartbeat-service",a=>a?.documentId?this.removeDocumentHeartbeat(a):Promise.resolve())}catch(a){this.loggingService.catch("Error in HeartbeatService constructor: ",a)}}setupWebWorker(e){try{let t=`
2
2
  let intervalId;
3
3
  self.addEventListener('message', (event) => {
4
4
  if (event.data === 'start') {
@@ -1 +1 @@
1
- import{ca as F}from"./chunk-TMURKDBH.js";import{$ as A,Ci as U,E as h,G as d,Hi as C,Ie as a,J as v,Je as m,L as l,Qf as g,Qi as w,T as n,Te as M,ca as s,je as $,l as p,lf as D,oi as E,pi as R,qi as y,r as u,v as c,vi as k,xh as I}from"./chunk-YTPDG6FY.js";var Z=(()=>{let o=class o{constructor(e,t,r,b,f,W,T,j){this.analyticsService=e,this.authService=t,this.contactService=r,this.databaseService=b,this.docService=f,this.configService=W,this.loggingService=T,this.commonDbService=j,this.documentIAM$=new p(null),this.workspaceIAM$=new p(null),this.roles$=new p([]),this.getDocumentIamSubscription=null,this.getOrganizationIamSubscription=null,this.getWorkspaceIamSubscription=null;try{this.authService.setIamService(this),this.databaseService.getDb().pipe(h(i=>!!i),v(1)).subscribe(i=>{i&&(this.getUser(),this.getDocumentPaths())},i=>{this.loggingService.catch("Error in CommentService getDb subscription: ",i)}),this.getRole$().pipe(v(1)).subscribe(i=>{this.authService?.getUser()&&!i&&this.analyticsService.trackEvent($.Events.Iam.USER_ACCESS_DENIED)}),this.documentIAM$.subscribe(i=>{i?.accessType&&this.contactService.setDocumentAccessType(i.accessType)})}catch(i){this.loggingService.catch("Error in IamService constructor: ",i)}}clearCache(){this.loggingService.log("%c[WB] Calling FUNCTION: clearCache in IamService","color: green;");try{this.documentIAM$.next(null),this.workspaceIAM$.next(null),this.roles$.next([]),this.documentPaths=null}catch(e){this.loggingService.catch("Error in IamService clearCache: ",e)}}getUser(){try{this.authService.getUser$().pipe(h(e=>!!e)).subscribe(e=>{this.user=e,this.user?this.getDocumentIam():(this.getDocumentIamSubscription?.unsubscribe(),this.getOrganizationIamSubscription?.unsubscribe(),this.getWorkspaceIamSubscription?.unsubscribe())},e=>{this.loggingService.catch("Error in IamService getUser$ subscription: ",e)})}catch(e){this.loggingService.catch("Error in IamService getUser: ",e)}}getDocumentPaths(){try{this.docService.getDocumentPaths$().pipe(h(e=>!!e)).subscribe(e=>{this.documentPaths=e,this.getDocumentIam(),this.getWorkspaceIam()},e=>{this.loggingService.catch("Error in IamService getDocumentPaths$ subscription: ",e)})}catch(e){this.loggingService.catch("Error in IamService getDocumentPaths: ",e)}}getDocumentIam(){try{this.getDocumentIamSubscription&&(this.getDocumentIamSubscription.unsubscribe(),this.getDocumentIamSubscription=null),this.user?this.getDocumentIamSubscription=this.docService.getDocumentIam$().subscribe(e=>{let t=e||new D;this.documentIAM$.next(t)},e=>{this.loggingService.catch("Error in IamService getDocumentIam$ subscription: ",e)}):this.documentIAM$.next(null)}catch(e){this.loggingService.catch("Error in IamService getDocumentIam: ",e)}}getWorkspaceIam(){try{this.getWorkspaceIamSubscription||(this.getWorkspaceIamSubscription=this.commonDbService.dbListener({feature:"workspaceIam",properties:{skipFirestore:!0}}).pipe(d(e=>u(null))).subscribe(e=>{this.workspaceIAM$.next(e?.data),this.roles$.next(e?.data?.roles||[])}))}catch(e){this.loggingService.catch("Error in IamService getWorkspaceIam: ",e)}}isUserAllowed$(){return this.getRole$().pipe(c(e=>!!e),l())}getDocumentIAM$(){return this.documentIAM$.asObservable()}getRoles$(){return this.roles$.asObservable().pipe(c(e=>e?.length?e:M.WorkspaceRoles))}getFeaturesAccessLevel$(){return this.documentIAM$.asObservable().pipe(c(e=>e?.features),n(e=>this.getRole$().pipe(c(t=>(t===a.ADMIN&&(e=e&&JSON.parse(JSON.stringify(e||{})),e?.all?.disabled&&(e.all.disabled=!1)),e)))))}hasRole(e){try{return e===this.getRole()}catch(t){return this.loggingService.catch("Error in IamService hasRole: ",t),!1}}hasRoleAny(e=[]){try{return e?.includes(this.getRole()||"")}catch(t){return this.loggingService.catch("Error in IamService hasRoleAny: ",t),!1}}hasRole$(e){try{return this.authService.getUser$().pipe(n(()=>this.documentIAM$.pipe(h(t=>!!t),n(()=>this.workspaceIAM$.pipe(c(()=>e===this.getRole()))))))}catch(t){return this.loggingService.catch("Error in IamService hasRole$: ",t),u(!1)}}getRole$(){try{return this.authService.getUser$().pipe(n(()=>this.configService.getSF$()),n(()=>this.configService.getSF()?this.contactService.isUserGlobalContact$():u(null)),n(()=>this.configService.getSF()?this.documentIAM$.pipe(h(e=>!!e),l(I)):u(null)),n(()=>this.workspaceIAM$.pipe(l(I))),c(()=>this.getRole()))}catch(e){return this.loggingService.catch("Error in IamService getRole$: ",e),u(null)}}getRole(){try{let e=this.configService.getSF();if(this.user?.isAdmin)return a.ADMIN;return a.COMMENTER;if(this.user)switch((this.documentIAM$.value?this.documentIAM$.value?.features?.all?.restricted:!1)?m.RESTRICTED:this.documentIAM$.value?this.documentIAM$.value?.documentAccessType||m.PUBLIC:null){case m.PUBLIC:r=this.getUserFromDocumentIAM(this.user?.email,this.user?.userId),r||(r=this.getUserFromWorkspaceIAM(this.user?.email,this.user?.userId)),t=r?.role?.name||a.COMMENTER;break;case m.RESTRICTED:r=this.getUserFromDocumentIAM(this.user?.email,this.user?.userId),r||(r=this.getUserFromWorkspaceIAM(this.user?.email,this.user?.userId)),t=r?.role?.name||null;break;default:break}}catch(e){this.loggingService.catch("Error in IamService getRole: ",e)}return null}isUserAdmin$(){return this.getRole$().pipe(c(e=>e===a.ADMIN),l())}isUserAdmin(){try{return this.getRole()===a.ADMIN}catch(e){return this.loggingService.catch("Error in IamService isUserAdmin: ",e),!1}}getUserFromDocumentIAM(e,t){try{if(e||t){let r;return e&&(r=this.documentIAM$.value?.users?.[g(e)]),!r&&t&&(r=this.documentIAM$.value?.users?.[g(t)]),r}else return}catch(r){this.loggingService.catch("Error in IamService getUserFromDocumentIAM: ",r)}}getUserFromWorkspaceIAM(e,t){try{if(e||t){let r;return e&&(r=this.workspaceIAM$.value?.users?.[g(e)]),!r&&t&&(r=this.workspaceIAM$.value?.users?.[g(t)]),r}else return}catch(r){this.loggingService.catch("Error in IamService getUserFromWorkspaceIAM: ",r)}}};o.\u0275fac=function(t){return new(t||o)(s(E),s(k),s(F),s(U),s(C),s(y),s(R),s(w))},o.\u0275prov=A({token:o,factory:o.\u0275fac,providedIn:"root"});let S=o;return S})();export{Z as a};
1
+ import{ca as F}from"./chunk-DC4XY76Y.js";import{$ as A,Ci as U,E as h,G as d,Hi as C,Ie as a,J as v,Je as m,L as l,Qf as g,Qi as w,T as n,Te as M,ca as s,je as $,l as p,lf as D,oi as E,pi as R,qi as y,r as u,v as c,vi as k,xh as I}from"./chunk-4FFPMABU.js";var Z=(()=>{let o=class o{constructor(e,t,r,b,f,W,T,j){this.analyticsService=e,this.authService=t,this.contactService=r,this.databaseService=b,this.docService=f,this.configService=W,this.loggingService=T,this.commonDbService=j,this.documentIAM$=new p(null),this.workspaceIAM$=new p(null),this.roles$=new p([]),this.getDocumentIamSubscription=null,this.getOrganizationIamSubscription=null,this.getWorkspaceIamSubscription=null;try{this.authService.setIamService(this),this.databaseService.getDb().pipe(h(i=>!!i),v(1)).subscribe(i=>{i&&(this.getUser(),this.getDocumentPaths())},i=>{this.loggingService.catch("Error in CommentService getDb subscription: ",i)}),this.getRole$().pipe(v(1)).subscribe(i=>{this.authService?.getUser()&&!i&&this.analyticsService.trackEvent($.Events.Iam.USER_ACCESS_DENIED)}),this.documentIAM$.subscribe(i=>{i?.accessType&&this.contactService.setDocumentAccessType(i.accessType)})}catch(i){this.loggingService.catch("Error in IamService constructor: ",i)}}clearCache(){this.loggingService.log("%c[WB] Calling FUNCTION: clearCache in IamService","color: green;");try{this.documentIAM$.next(null),this.workspaceIAM$.next(null),this.roles$.next([]),this.documentPaths=null}catch(e){this.loggingService.catch("Error in IamService clearCache: ",e)}}getUser(){try{this.authService.getUser$().pipe(h(e=>!!e)).subscribe(e=>{this.user=e,this.user?this.getDocumentIam():(this.getDocumentIamSubscription?.unsubscribe(),this.getOrganizationIamSubscription?.unsubscribe(),this.getWorkspaceIamSubscription?.unsubscribe())},e=>{this.loggingService.catch("Error in IamService getUser$ subscription: ",e)})}catch(e){this.loggingService.catch("Error in IamService getUser: ",e)}}getDocumentPaths(){try{this.docService.getDocumentPaths$().pipe(h(e=>!!e)).subscribe(e=>{this.documentPaths=e,this.getDocumentIam(),this.getWorkspaceIam()},e=>{this.loggingService.catch("Error in IamService getDocumentPaths$ subscription: ",e)})}catch(e){this.loggingService.catch("Error in IamService getDocumentPaths: ",e)}}getDocumentIam(){try{this.getDocumentIamSubscription&&(this.getDocumentIamSubscription.unsubscribe(),this.getDocumentIamSubscription=null),this.user?this.getDocumentIamSubscription=this.docService.getDocumentIam$().subscribe(e=>{let t=e||new D;this.documentIAM$.next(t)},e=>{this.loggingService.catch("Error in IamService getDocumentIam$ subscription: ",e)}):this.documentIAM$.next(null)}catch(e){this.loggingService.catch("Error in IamService getDocumentIam: ",e)}}getWorkspaceIam(){try{this.getWorkspaceIamSubscription||(this.getWorkspaceIamSubscription=this.commonDbService.dbListener({feature:"workspaceIam",properties:{skipFirestore:!0}}).pipe(d(e=>u(null))).subscribe(e=>{this.workspaceIAM$.next(e?.data),this.roles$.next(e?.data?.roles||[])}))}catch(e){this.loggingService.catch("Error in IamService getWorkspaceIam: ",e)}}isUserAllowed$(){return this.getRole$().pipe(c(e=>!!e),l())}getDocumentIAM$(){return this.documentIAM$.asObservable()}getRoles$(){return this.roles$.asObservable().pipe(c(e=>e?.length?e:M.WorkspaceRoles))}getFeaturesAccessLevel$(){return this.documentIAM$.asObservable().pipe(c(e=>e?.features),n(e=>this.getRole$().pipe(c(t=>(t===a.ADMIN&&(e=e&&JSON.parse(JSON.stringify(e||{})),e?.all?.disabled&&(e.all.disabled=!1)),e)))))}hasRole(e){try{return e===this.getRole()}catch(t){return this.loggingService.catch("Error in IamService hasRole: ",t),!1}}hasRoleAny(e=[]){try{return e?.includes(this.getRole()||"")}catch(t){return this.loggingService.catch("Error in IamService hasRoleAny: ",t),!1}}hasRole$(e){try{return this.authService.getUser$().pipe(n(()=>this.documentIAM$.pipe(h(t=>!!t),n(()=>this.workspaceIAM$.pipe(c(()=>e===this.getRole()))))))}catch(t){return this.loggingService.catch("Error in IamService hasRole$: ",t),u(!1)}}getRole$(){try{return this.authService.getUser$().pipe(n(()=>this.configService.getSF$()),n(()=>this.configService.getSF()?this.contactService.isUserGlobalContact$():u(null)),n(()=>this.configService.getSF()?this.documentIAM$.pipe(h(e=>!!e),l(I)):u(null)),n(()=>this.workspaceIAM$.pipe(l(I))),c(()=>this.getRole()))}catch(e){return this.loggingService.catch("Error in IamService getRole$: ",e),u(null)}}getRole(){try{let e=this.configService.getSF();if(this.user?.isAdmin)return a.ADMIN;return a.COMMENTER;if(this.user)switch((this.documentIAM$.value?this.documentIAM$.value?.features?.all?.restricted:!1)?m.RESTRICTED:this.documentIAM$.value?this.documentIAM$.value?.documentAccessType||m.PUBLIC:null){case m.PUBLIC:r=this.getUserFromDocumentIAM(this.user?.email,this.user?.userId),r||(r=this.getUserFromWorkspaceIAM(this.user?.email,this.user?.userId)),t=r?.role?.name||a.COMMENTER;break;case m.RESTRICTED:r=this.getUserFromDocumentIAM(this.user?.email,this.user?.userId),r||(r=this.getUserFromWorkspaceIAM(this.user?.email,this.user?.userId)),t=r?.role?.name||null;break;default:break}}catch(e){this.loggingService.catch("Error in IamService getRole: ",e)}return null}isUserAdmin$(){return this.getRole$().pipe(c(e=>e===a.ADMIN),l())}isUserAdmin(){try{return this.getRole()===a.ADMIN}catch(e){return this.loggingService.catch("Error in IamService isUserAdmin: ",e),!1}}getUserFromDocumentIAM(e,t){try{if(e||t){let r;return e&&(r=this.documentIAM$.value?.users?.[g(e)]),!r&&t&&(r=this.documentIAM$.value?.users?.[g(t)]),r}else return}catch(r){this.loggingService.catch("Error in IamService getUserFromDocumentIAM: ",r)}}getUserFromWorkspaceIAM(e,t){try{if(e||t){let r;return e&&(r=this.workspaceIAM$.value?.users?.[g(e)]),!r&&t&&(r=this.workspaceIAM$.value?.users?.[g(t)]),r}else return}catch(r){this.loggingService.catch("Error in IamService getUserFromWorkspaceIAM: ",r)}}};o.\u0275fac=function(t){return new(t||o)(s(E),s(k),s(F),s(U),s(C),s(y),s(R),s(w))},o.\u0275prov=A({token:o,factory:o.\u0275fac,providedIn:"root"});let S=o;return S})();export{Z as a};
@@ -1,4 +1,4 @@
1
- import{$c as Ee,Ed as $e,Ha as ke,Zc as ye,_c as ne,ad as Ue,ba as Re,bd as Ae,cd as Oe,dd as C,ea as Te,ed as Se,fd as Ie,g as K,gd as Pe,hd as Ne,id as Ce,jd as xe,kd as H,la as we,pd as ve,qd as De,rd as Le,sd as Be,ta as $,td as x,ud as Me,vd as Fe,zd as qe}from"./chunk-YTPDG6FY.js";var Ke="firebasestorage.googleapis.com",Ze="storageBucket",Tt=120*1e3,wt=600*1e3,kt=1e3;var d=class t extends Oe{constructor(e,n,s=0){super(se(e),`Firebase Storage: ${n} (${se(e)})`),this.status_=s,this.customData={serverResponse:null},this._baseMessage=this.message,Object.setPrototypeOf(this,t.prototype)}get status(){return this.status_}set status(e){this.status_=e}_codeEquals(e){return se(e)===this.code}get serverResponse(){return this.customData.serverResponse}set serverResponse(e){this.customData.serverResponse=e,this.customData.serverResponse?this.message=`${this._baseMessage}
1
+ import{$c as Ee,Ed as $e,Ha as ke,Zc as ye,_c as ne,ad as Ue,ba as Re,bd as Ae,cd as Oe,dd as C,ea as Te,ed as Se,fd as Ie,g as K,gd as Pe,hd as Ne,id as Ce,jd as xe,kd as H,la as we,pd as ve,qd as De,rd as Le,sd as Be,ta as $,td as x,ud as Me,vd as Fe,zd as qe}from"./chunk-4FFPMABU.js";var Ke="firebasestorage.googleapis.com",Ze="storageBucket",Tt=120*1e3,wt=600*1e3,kt=1e3;var d=class t extends Oe{constructor(e,n,s=0){super(se(e),`Firebase Storage: ${n} (${se(e)})`),this.status_=s,this.customData={serverResponse:null},this._baseMessage=this.message,Object.setPrototypeOf(this,t.prototype)}get status(){return this.status_}set status(e){this.status_=e}_codeEquals(e){return se(e)===this.code}get serverResponse(){return this.customData.serverResponse}set serverResponse(e){this.customData.serverResponse=e,this.customData.serverResponse?this.message=`${this._baseMessage}
2
2
  ${this.customData.serverResponse}`:this.message=this._baseMessage}},h=(function(t){return t.UNKNOWN="unknown",t.OBJECT_NOT_FOUND="object-not-found",t.BUCKET_NOT_FOUND="bucket-not-found",t.PROJECT_NOT_FOUND="project-not-found",t.QUOTA_EXCEEDED="quota-exceeded",t.UNAUTHENTICATED="unauthenticated",t.UNAUTHORIZED="unauthorized",t.UNAUTHORIZED_APP="unauthorized-app",t.RETRY_LIMIT_EXCEEDED="retry-limit-exceeded",t.INVALID_CHECKSUM="invalid-checksum",t.CANCELED="canceled",t.INVALID_EVENT_NAME="invalid-event-name",t.INVALID_URL="invalid-url",t.INVALID_DEFAULT_BUCKET="invalid-default-bucket",t.NO_DEFAULT_BUCKET="no-default-bucket",t.CANNOT_SLICE_BLOB="cannot-slice-blob",t.SERVER_FILE_WRONG_SIZE="server-file-wrong-size",t.NO_DOWNLOAD_URL="no-download-url",t.INVALID_ARGUMENT="invalid-argument",t.INVALID_ARGUMENT_COUNT="invalid-argument-count",t.APP_DELETED="app-deleted",t.INVALID_ROOT_OPERATION="invalid-root-operation",t.INVALID_FORMAT="invalid-format",t.INTERNAL_ERROR="internal-error",t.UNSUPPORTED_ENVIRONMENT="unsupported-environment",t})(h||{});function se(t){return"storage/"+t}function de(){let t="An unknown error occurred, please check the error payload for server response.";return new d(h.UNKNOWN,t)}function yt(t){return new d(h.OBJECT_NOT_FOUND,"Object '"+t+"' does not exist.")}function Et(t){return new d(h.QUOTA_EXCEEDED,"Quota for bucket '"+t+"' exceeded, please view quota on https://firebase.google.com/pricing/.")}function Ut(){let t="User is not authenticated, please authenticate using Firebase Authentication and try again.";return new d(h.UNAUTHENTICATED,t)}function At(){return new d(h.UNAUTHORIZED_APP,"This app does not have permission to access Firebase Storage on this project.")}function Ot(t){return new d(h.UNAUTHORIZED,"User does not have permission to access '"+t+"'.")}function Ye(){return new d(h.RETRY_LIMIT_EXCEEDED,"Max retry time for operation exceeded, please try again.")}function Je(){return new d(h.CANCELED,"User canceled the upload/download.")}function St(t){return new d(h.INVALID_URL,"Invalid URL '"+t+"'.")}function It(t){return new d(h.INVALID_DEFAULT_BUCKET,"Invalid default bucket '"+t+"'.")}function Pt(){return new d(h.NO_DEFAULT_BUCKET,"No default bucket found. Did you set the '"+Ze+"' property when initializing the app?")}function Qe(){return new d(h.CANNOT_SLICE_BLOB,"Cannot slice blob for upload. Please retry the upload.")}function Nt(){return new d(h.SERVER_FILE_WRONG_SIZE,"Server recorded incorrect upload file size, please retry the upload.")}function Ct(){return new d(h.NO_DOWNLOAD_URL,"The given file does not have any download URLs.")}function xt(t){return new d(h.UNSUPPORTED_ENVIRONMENT,`${t} is missing. Make sure to install the required polyfills. See https://firebase.google.com/docs/web/environments-js-sdk#polyfills for more information.`)}function oe(t){return new d(h.INVALID_ARGUMENT,t)}function et(){return new d(h.APP_DELETED,"The Firebase app was deleted.")}function vt(t){return new d(h.INVALID_ROOT_OPERATION,"The operation '"+t+"' cannot be performed on a root reference, create a non-root reference using child, such as .child('file.png').")}function z(t,e){return new d(h.INVALID_FORMAT,"String does not match format '"+t+"': "+e)}function j(t){throw new d(h.INTERNAL_ERROR,"Internal error: "+t)}var y=class t{constructor(e,n){this.bucket=e,this.path_=n}get path(){return this.path_}get isRoot(){return this.path.length===0}fullServerUrl(){let e=encodeURIComponent;return"/b/"+e(this.bucket)+"/o/"+e(this.path)}bucketOnlyServerUrl(){return"/b/"+encodeURIComponent(this.bucket)+"/o"}static makeFromBucketSpec(e,n){let s;try{s=t.makeFromUrl(e,n)}catch{return new t(e,"")}if(s.path==="")return s;throw It(e)}static makeFromUrl(e,n){let s=null,r="([A-Za-z0-9.\\-_]+)";function o(b){b.path.charAt(b.path.length-1)==="/"&&(b.path_=b.path_.slice(0,-1))}let i="(/(.*))?$",u=new RegExp("^gs://"+r+i,"i"),a={bucket:1,path:3};function c(b){b.path_=decodeURIComponent(b.path)}let l="v[A-Za-z0-9_]+",f=n.replace(/[.]/g,"\\."),p="(/([^?#]*).*)?$",m=new RegExp(`^https?://${f}/${l}/b/${r}/o${p}`,"i"),g={bucket:1,path:3},w=n===Ke?"(?:storage.googleapis.com|storage.cloud.google.com)":n,_="([^?#]*)",U=new RegExp(`^https?://${w}/${r}/${_}`,"i"),T=[{regex:u,indices:a,postModify:o},{regex:m,indices:g,postModify:c},{regex:U,indices:{bucket:1,path:2},postModify:c}];for(let b=0;b<T.length;b++){let P=T[b],N=P.regex.exec(e);if(N){let ee=N[P.indices.bucket],q=N[P.indices.path];q||(q=""),s=new t(ee,q),P.postModify(s);break}}if(s==null)throw St(e);return s}},ie=class{constructor(e){this.promise_=Promise.reject(e)}getPromise(){return this.promise_}cancel(e=!1){}};function Dt(t,e,n){let s=1,r=null,o=null,i=!1,u=0;function a(){return u===2}let c=!1;function l(..._){c||(c=!0,e.apply(null,_))}function f(_){r=setTimeout(()=>{r=null,t(m,a())},_)}function p(){o&&clearTimeout(o)}function m(_,...U){if(c){p();return}if(_){p(),l.call(null,_,...U);return}if(a()||i){p(),l.call(null,_,...U);return}s<64&&(s*=2);let T;u===1?(u=2,T=0):T=(s+Math.random())*1e3,f(T)}let g=!1;function w(_){g||(g=!0,p(),!c&&(r!==null?(_||(u=2),clearTimeout(r),f(0)):_||(u=1)))}return f(0),o=setTimeout(()=>{i=!0,w(!0)},n),w}function Lt(t){t(!1)}function Bt(t){return t!==void 0}function Mt(t){return typeof t=="function"}function Ft(t){return typeof t=="object"&&!Array.isArray(t)}function Q(t){return typeof t=="string"||t instanceof String}function He(t){return fe()&&t instanceof Blob}function fe(){return typeof Blob<"u"}function je(t,e,n,s){if(s<e)throw oe(`Invalid value for '${t}'. Expected ${e} or greater.`);if(s>n)throw oe(`Invalid value for '${t}'. Expected ${n} or less.`)}function F(t,e,n){let s=e;return n==null&&(s=`https://${e}`),`${n}://${s}/v0${t}`}function tt(t){let e=encodeURIComponent,n="?";for(let s in t)if(t.hasOwnProperty(s)){let r=e(s)+"="+e(t[s]);n=n+r+"&"}return n=n.slice(0,-1),n}var L=(function(t){return t[t.NO_ERROR=0]="NO_ERROR",t[t.NETWORK_ERROR=1]="NETWORK_ERROR",t[t.ABORT=2]="ABORT",t})(L||{});function nt(t,e){let n=t>=500&&t<600,r=[408,429].indexOf(t)!==-1,o=e.indexOf(t)!==-1;return n||r||o}var ae=class{constructor(e,n,s,r,o,i,u,a,c,l,f,p=!0,m=!1){this.url_=e,this.method_=n,this.headers_=s,this.body_=r,this.successCodes_=o,this.additionalRetryCodes_=i,this.callback_=u,this.errorCallback_=a,this.timeout_=c,this.progressCallback_=l,this.connectionFactory_=f,this.retry=p,this.isUsingEmulator=m,this.pendingConnection_=null,this.backoffId_=null,this.canceled_=!1,this.appDelete_=!1,this.promise_=new Promise((g,w)=>{this.resolve_=g,this.reject_=w,this.start_()})}start_(){let e=(s,r)=>{if(r){s(!1,new D(!1,null,!0));return}let o=this.connectionFactory_();this.pendingConnection_=o;let i=u=>{let a=u.loaded,c=u.lengthComputable?u.total:-1;this.progressCallback_!==null&&this.progressCallback_(a,c)};this.progressCallback_!==null&&o.addUploadProgressListener(i),o.send(this.url_,this.method_,this.isUsingEmulator,this.body_,this.headers_).then(()=>{this.progressCallback_!==null&&o.removeUploadProgressListener(i),this.pendingConnection_=null;let u=o.getErrorCode()===L.NO_ERROR,a=o.getStatus();if(!u||nt(a,this.additionalRetryCodes_)&&this.retry){let l=o.getErrorCode()===L.ABORT;s(!1,new D(!1,null,l));return}let c=this.successCodes_.indexOf(a)!==-1;s(!0,new D(c,o))})},n=(s,r)=>{let o=this.resolve_,i=this.reject_,u=r.connection;if(r.wasSuccessCode)try{let a=this.callback_(u,u.getResponse());Bt(a)?o(a):o()}catch(a){i(a)}else if(u!==null){let a=de();a.serverResponse=u.getErrorText(),this.errorCallback_?i(this.errorCallback_(u,a)):i(a)}else if(r.canceled){let a=this.appDelete_?et():Je();i(a)}else{let a=Ye();i(a)}};this.canceled_?n(!1,new D(!1,null,!0)):this.backoffId_=Dt(e,n,this.timeout_)}getPromise(){return this.promise_}cancel(e){this.canceled_=!0,this.appDelete_=e||!1,this.backoffId_!==null&&Lt(this.backoffId_),this.pendingConnection_!==null&&this.pendingConnection_.abort()}},D=class{constructor(e,n,s){this.wasSuccessCode=e,this.connection=n,this.canceled=!!s}};function qt(t,e){e!==null&&e.length>0&&(t.Authorization="Firebase "+e)}function $t(t,e){t["X-Firebase-Storage-Version"]="webjs/"+(e??"AppManager")}function Ht(t,e){e&&(t["X-Firebase-GMPID"]=e)}function jt(t,e){e!==null&&(t["X-Firebase-AppCheck"]=e)}function zt(t,e,n,s,r,o,i=!0,u=!1){let a=tt(t.urlParams),c=t.url+a,l=Object.assign({},t.headers);return Ht(l,e),qt(l,n),$t(l,o),jt(l,s),new ae(c,t.method,l,t.body,t.successCodes,t.additionalRetryCodes,t.handler,t.errorHandler,t.timeout,t.progressCallback,r,i,u)}function Gt(){return typeof BlobBuilder<"u"?BlobBuilder:typeof WebKitBlobBuilder<"u"?WebKitBlobBuilder:void 0}function Wt(...t){let e=Gt();if(e!==void 0){let n=new e;for(let s=0;s<t.length;s++)n.append(t[s]);return n.getBlob()}else{if(fe())return new Blob(t);throw new d(h.UNSUPPORTED_ENVIRONMENT,"This browser doesn't seem to support creating Blobs")}}function Vt(t,e,n){return t.webkitSlice?t.webkitSlice(e,n):t.mozSlice?t.mozSlice(e,n):t.slice?t.slice(e,n):null}function Xt(t){if(typeof atob>"u")throw xt("base-64");return atob(t)}var E={RAW:"raw",BASE64:"base64",BASE64URL:"base64url",DATA_URL:"data_url"},G=class{constructor(e,n){this.data=e,this.contentType=n||null}};function Kt(t,e){switch(t){case E.RAW:return new G(st(e));case E.BASE64:case E.BASE64URL:return new G(rt(t,e));case E.DATA_URL:return new G(Yt(e),Jt(e))}throw de()}function st(t){let e=[];for(let n=0;n<t.length;n++){let s=t.charCodeAt(n);if(s<=127)e.push(s);else if(s<=2047)e.push(192|s>>6,128|s&63);else if((s&64512)===55296)if(!(n<t.length-1&&(t.charCodeAt(n+1)&64512)===56320))e.push(239,191,189);else{let o=s,i=t.charCodeAt(++n);s=65536|(o&1023)<<10|i&1023,e.push(240|s>>18,128|s>>12&63,128|s>>6&63,128|s&63)}else(s&64512)===56320?e.push(239,191,189):e.push(224|s>>12,128|s>>6&63,128|s&63)}return new Uint8Array(e)}function Zt(t){let e;try{e=decodeURIComponent(t)}catch{throw z(E.DATA_URL,"Malformed data URL.")}return st(e)}function rt(t,e){switch(t){case E.BASE64:{let r=e.indexOf("-")!==-1,o=e.indexOf("_")!==-1;if(r||o)throw z(t,"Invalid character '"+(r?"-":"_")+"' found: is it base64url encoded?");break}case E.BASE64URL:{let r=e.indexOf("+")!==-1,o=e.indexOf("/")!==-1;if(r||o)throw z(t,"Invalid character '"+(r?"+":"/")+"' found: is it base64 encoded?");e=e.replace(/-/g,"+").replace(/_/g,"/");break}}let n;try{n=Xt(e)}catch(r){throw r.message.includes("polyfill")?r:z(t,"Invalid character found")}let s=new Uint8Array(n.length);for(let r=0;r<n.length;r++)s[r]=n.charCodeAt(r);return s}var Y=class{constructor(e){this.base64=!1,this.contentType=null;let n=e.match(/^data:([^,]+)?,/);if(n===null)throw z(E.DATA_URL,"Must be formatted 'data:[<mediatype>][;base64],<data>");let s=n[1]||null;s!=null&&(this.base64=Qt(s,";base64"),this.contentType=this.base64?s.substring(0,s.length-7):s),this.rest=e.substring(e.indexOf(",")+1)}};function Yt(t){let e=new Y(t);return e.base64?rt(E.BASE64,e.rest):Zt(e.rest)}function Jt(t){return new Y(t).contentType}function Qt(t,e){return t.length>=e.length?t.substring(t.length-e.length)===e:!1}var J=class t{constructor(e,n){let s=0,r="";He(e)?(this.data_=e,s=e.size,r=e.type):e instanceof ArrayBuffer?(n?this.data_=new Uint8Array(e):(this.data_=new Uint8Array(e.byteLength),this.data_.set(new Uint8Array(e))),s=this.data_.length):e instanceof Uint8Array&&(n?this.data_=e:(this.data_=new Uint8Array(e.length),this.data_.set(e)),s=e.length),this.size_=s,this.type_=r}size(){return this.size_}type(){return this.type_}slice(e,n){if(He(this.data_)){let s=this.data_,r=Vt(s,e,n);return r===null?null:new t(r)}else{let s=new Uint8Array(this.data_.buffer,e,n-e);return new t(s,!0)}}static getBlob(...e){if(fe()){let n=e.map(s=>s instanceof t?s.data_:s);return new t(Wt.apply(null,n))}else{let n=e.map(i=>Q(i)?Kt(E.RAW,i).data:i.data_),s=0;n.forEach(i=>{s+=i.byteLength});let r=new Uint8Array(s),o=0;return n.forEach(i=>{for(let u=0;u<i.length;u++)r[o++]=i[u]}),new t(r,!0)}}uploadData(){return this.data_}};function ot(t){let e;try{e=JSON.parse(t)}catch{return null}return Ft(e)?e:null}function en(t){if(t.length===0)return null;let e=t.lastIndexOf("/");return e===-1?"":t.slice(0,e)}function tn(t,e){let n=e.split("/").filter(s=>s.length>0).join("/");return t.length===0?n:t+"/"+n}function it(t){let e=t.lastIndexOf("/",t.length-2);return e===-1?t:t.slice(e+1)}function nn(t,e){return e}var R=class{constructor(e,n,s,r){this.server=e,this.local=n||e,this.writable=!!s,this.xform=r||nn}},Z=null;function sn(t){return!Q(t)||t.length<2?t:it(t)}function at(){if(Z)return Z;let t=[];t.push(new R("bucket")),t.push(new R("generation")),t.push(new R("metageneration")),t.push(new R("name","fullPath",!0));function e(o,i){return sn(i)}let n=new R("name");n.xform=e,t.push(n);function s(o,i){return i!==void 0?Number(i):i}let r=new R("size");return r.xform=s,t.push(r),t.push(new R("timeCreated")),t.push(new R("updated")),t.push(new R("md5Hash",null,!0)),t.push(new R("cacheControl",null,!0)),t.push(new R("contentDisposition",null,!0)),t.push(new R("contentEncoding",null,!0)),t.push(new R("contentLanguage",null,!0)),t.push(new R("contentType",null,!0)),t.push(new R("metadata","customMetadata",!0)),Z=t,Z}function rn(t,e){function n(){let s=t.bucket,r=t.fullPath,o=new y(s,r);return e._makeStorageReference(o)}Object.defineProperty(t,"ref",{get:n})}function on(t,e,n){let s={};s.type="file";let r=n.length;for(let o=0;o<r;o++){let i=n[o];s[i.local]=i.xform(s,e[i.server])}return rn(s,t),s}function ut(t,e,n){let s=ot(e);return s===null?null:on(t,s,n)}function an(t,e,n,s){let r=ot(e);if(r===null||!Q(r.downloadTokens))return null;let o=r.downloadTokens;if(o.length===0)return null;let i=encodeURIComponent;return o.split(",").map(c=>{let l=t.bucket,f=t.fullPath,p="/b/"+i(l)+"/o/"+i(f),m=F(p,n,s),g=tt({alt:"media",token:c});return m+g})[0]}function ct(t,e){let n={},s=e.length;for(let r=0;r<s;r++){let o=e[r];o.writable&&(n[o.server]=t[o.local])}return JSON.stringify(n)}var S=class{constructor(e,n,s,r){this.url=e,this.method=n,this.handler=s,this.timeout=r,this.urlParams={},this.headers={},this.body=null,this.errorHandler=null,this.progressCallback=null,this.successCodes=[200],this.additionalRetryCodes=[]}};function O(t){if(!t)throw de()}function _e(t,e){function n(s,r){let o=ut(t,r,e);return O(o!==null),o}return n}function un(t,e){function n(s,r){let o=ut(t,r,e);return O(o!==null),an(o,r,t.host,t._protocol)}return n}function V(t){function e(n,s){let r;return n.getStatus()===401?n.getErrorText().includes("Firebase App Check token is invalid")?r=At():r=Ut():n.getStatus()===402?r=Et(t.bucket):n.getStatus()===403?r=Ot(t.path):r=s,r.status=n.getStatus(),r.serverResponse=s.serverResponse,r}return e}function pe(t){let e=V(t);function n(s,r){let o=e(s,r);return s.getStatus()===404&&(o=yt(t.path)),o.serverResponse=r.serverResponse,o}return n}function cn(t,e,n){let s=e.fullServerUrl(),r=F(s,t.host,t._protocol),o="GET",i=t.maxOperationRetryTime,u=new S(r,o,_e(t,n),i);return u.errorHandler=pe(e),u}function ln(t,e,n){let s=e.fullServerUrl(),r=F(s,t.host,t._protocol),o="GET",i=t.maxOperationRetryTime,u=new S(r,o,un(t,n),i);return u.errorHandler=pe(e),u}function hn(t,e){let n=e.fullServerUrl(),s=F(n,t.host,t._protocol),r="DELETE",o=t.maxOperationRetryTime;function i(a,c){}let u=new S(s,r,i,o);return u.successCodes=[200,204],u.errorHandler=pe(e),u}function dn(t,e){return t&&t.contentType||e&&e.type()||"application/octet-stream"}function lt(t,e,n){let s=Object.assign({},n);return s.fullPath=t.path,s.size=e.size(),s.contentType||(s.contentType=dn(null,e)),s}function fn(t,e,n,s,r){let o=e.bucketOnlyServerUrl(),i={"X-Goog-Upload-Protocol":"multipart"};function u(){let T="";for(let b=0;b<2;b++)T=T+Math.random().toString().slice(2);return T}let a=u();i["Content-Type"]="multipart/related; boundary="+a;let c=lt(e,s,r),l=ct(c,n),f="--"+a+`\r
3
3
  Content-Type: application/json; charset=utf-8\r
4
4
  \r
@@ -1 +1 @@
1
- import{b as f,c as S,d as y,e as g,f as E}from"./chunk-QMH32YWC.js";import{$ as k,Fi as N,Te as C,Ue as I,Xe as v,ag as b,ca as h,g as u,je as w,jf as x,le as A,pi as L,qe as T,qi as O,si as D,ti as P,vi as _}from"./chunk-YTPDG6FY.js";var z=l=>{try{let s={USE_PROFILES:{svg:!0,svgFilters:!0},FORBID_ATTR:["onerror","onload","onclick","onmouseover","onmouseout","onmouseenter","onmouseleave","onmousemove","onmousedown","onmouseup","onwheel","onscroll","onkeydown","onkeyup","onkeypress","onfocus","onblur","onchange","onsubmit","on*"],FORBID_TAGS:["script","style","iframe","object","embed","form"]};return P.sanitize(l,s)}catch(s){return v.catch("Error in File utils sanitizeSvg: ",s),""}},M=l=>{try{return l.name.split(".").slice(0,-1).join(".")}catch(s){v.catch("Error in File utils getFileName: ",s);return}},R=l=>{try{return/(?:\.([^.]+))?$/.exec(l?.name)[1]}catch(s){v.catch("Error in File utils getFileExtension: ",s);return}},U=(l,s)=>{try{let d=l.slice(0,-1,l.type);return new File([d],s+"."+R(l),{type:l.type})}catch(d){v.catch("Error in File utils updateFile: ",d);return}};var F={mp4:"video/mp4",mov:"video/quicktime",avi:"video/x-msvideo",wmv:"video/x-ms-wmv",flv:"video/x-flv",mp3:"audio/mpeg",wav:"audio/wav",ogg:"audio/ogg",webm:"video/webm",mkv:"video/x-matroska",m4v:"video/x-m4v",m4a:"audio/x-m4a",aac:"audio/aac","3gp":"video/3gpp","3g2":"video/3gpp2",jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",gif:"image/gif",bmp:"image/bmp",svg:"image/svg+xml",webp:"image/webp",pdf:"application/pdf",doc:"application/msword",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",xls:"application/vnd.ms-excel",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",ppt:"application/vnd.ms-powerpoint",pptx:"application/vnd.openxmlformats-officedocument.presentationml.presentation",odt:"application/vnd.oasis.opendocument.text",ods:"application/vnd.oasis.opendocument.spreadsheet",zip:"application/zip",rar:"application/x-rar-compressed",txt:"text/plain",rtf:"application/rtf",html:"text/html",htm:"text/html",csv:"text/csv",ics:"text/calendar",vcf:"text/x-vcard",js:"application/javascript",css:"text/css",json:"application/json",xml:"application/xml",swf:"application/x-shockwave-flash"};var ie=(()=>{let s=class s{constructor(t,e,o,i,c){this.authService=t,this.configService=e,this.coreActionsService=o,this.loggingService=i,this.attachmentResolverService=c,this.storage=y();try{this.configService.getApiKey$().subscribe(r=>{this.apiKey=r}),this.authService.getFirebaseConfig$().subscribe(r=>{if(r&&r.firebaseOptions?.storageBucket){this.storage=y(void 0,r?.firebaseOptions?.storageBucket);let a=this.configService.getProxyConfig();a?.storageHost&&(this.storage.host=a.storageHost)}},r=>{this.loggingService.catch("Error in StorageService constructor: ",r)})}catch(r){this.loggingService.catch("Error in StorageService constructor:",r)}}createAttachment({path:t,file:e}){try{let o=new I;o.name=e.name;let i=U(e,`${o.attachmentId}_${M(e)}`),c=`${this.apiKey}/${t}/${i?.name}`;return o.bucketPath=c,o.size=e.size,o.type=R(e),o?.type&&(o.mimeType=F[o?.type]),o}catch(o){return this.loggingService.catch("Error in StorageService createAttachment: ",o),null}}sanitizeSvgFile(t){return u(this,null,function*(){if(t.type===F.svg)try{let e=yield t.text(),o=z(e);return new File([o],t.name,{type:t.type})}catch(e){return this.loggingService.catch("Error in StorageService sanitizeSvgFile: ",e),t}return t})}uploadAttachmentToStorage(c){return u(this,arguments,function*({attachment:t,file:e,resolve:o,reject:i}){try{let r=g(this.storage,t.bucketPath),a=E(r,e,{cacheControl:"public,max-age=3600"});a.on("state_changed",n=>{let m=n.bytesTransferred/n.totalBytes*100},n=>{i(n)},()=>{S(a.snapshot.ref).then(n=>{t.url=n,o(t)})})}catch(r){this.loggingService.catch("Error in StorageService uploadAttachmentToStorage: ",r),i(r)}})}uploadToResolver(a){return u(this,arguments,function*({file:t,attachment:e,metadata:o,resolve:i,reject:c,scope:r}){try{o.attachmentId=e.attachmentId;let n={attachmentId:e.attachmentId,name:e.name,file:t,metadata:o,mimeType:e.mimeType},m=b();this.coreActionsService.triggerAction(T.ATTACHMENT_RESOLVER,{event:w.Events.Resolver.ATTACHMENT_SAVE_REQUEST_FORMED,timestamp:new Date().getTime(),uniqueId:m,methodName:x.UPLOAD_TO_RESOLVER,source:"internal",payload:{attachment:n,eventType:A.ATTACHMENT_ADD}});let p=yield this.attachmentResolverService.saveAttachment({attachment:n,eventType:A.ATTACHMENT_ADD},m,r);p&&p.data?.url?(e.url=p.data?.url,i(e)):c(new Error("Failed to upload attachment to resolver"))}catch(n){this.loggingService.catch("Error in StorageService uploadToResolver: ",n),c(n)}})}uploadFile({path:t,file:e,useAttachmentResolver:o,metadata:i,attachmentScope:c}){return new Promise((r,a)=>u(this,null,function*(){try{if(!this.apiKey)throw new Error("API key not configured");let n=yield this.sanitizeSvgFile(e),m=this.createAttachment({path:t,file:n});if(!m)throw new Error("Attachment not created");o?this.uploadToResolver({file:n,attachment:m,metadata:i,resolve:r,reject:a,scope:c}):this.uploadAttachmentToStorage({attachment:m,file:n,resolve:r,reject:a})}catch(n){this.loggingService.catch("Error in StorageService uploadFile:",n),a(n)}}))}uploadChunk(t,e,o,i){return new Promise((c,r)=>{try{if(i?.useAttachmentResolver){let a=this.createAttachment({path:t,file:e});if(!a){r(new Error("Attachment not created for chunk upload"));return}this.uploadToResolver({file:e,attachment:a,metadata:i.metadata,resolve:n=>c(n.url),reject:r,scope:i.attachmentScope});return}if(this.apiKey){let a=`${this.apiKey}/${t}/${e.name}`,n=g(this.storage,a),m=E(n,e,{cacheControl:"public,max-age=3600"});m.on("state_changed",p=>{let $=p.bytesTransferred/p.totalBytes*100},p=>{r(p)},()=>{S(m.snapshot.ref).then(p=>{c(p)}).catch(p=>{this.loggingService.catch(`[uploadChunk] Error getting download URL for chunk ${o}:`,p),r(p)})})}else{let a=new Error("API key not available");this.loggingService.catch("[uploadChunk] API key not available",a),r(a)}}catch(a){this.loggingService.catch(`[uploadChunk] Error in StorageService uploadChunk for chunk ${o}: `,a),r(a)}})}downloadAttachment(t){try{if(t.url){let e=new XMLHttpRequest;e.responseType="blob",e.onload=()=>{let o=e.response,i=document.createElement("a"),c=window.URL.createObjectURL(o);i.setAttribute("type","hidden"),i.setAttribute(C.ATTRIBUTES.VELT_DOWNLOAD_BUTTON,"true"),i.classList.add("snippyly-overlay-panel"),i.href=c,t?.name&&(i.download=t?.name),document.body.appendChild(i);let r=new MouseEvent("click",{view:window,bubbles:!0,cancelable:!1});i.dispatchEvent(r),window.URL.revokeObjectURL(c),i.remove()},e.onerror=()=>{window.open(t.url,"_blank")},e.open("GET",t.url),e.send()}}catch(e){this.loggingService.catch("Error in StorageService downloadAttachment: ",e)}}deleteAttachment({attachment:t,metadata:e,useAttachmentResolver:o,attachmentScope:i}){return new Promise((c,r)=>{if(o){let a=b();this.coreActionsService.triggerAction(T.ATTACHMENT_RESOLVER,{event:w.Events.Resolver.ATTACHMENT_DELETE_REQUEST_FORMED,timestamp:new Date().getTime(),uniqueId:a,methodName:x.DELETE_ATTACHMENT,source:"internal",payload:{attachmentId:t.attachmentId,metadata:e}}),this.attachmentResolverService.deleteAttachment({attachmentId:t.attachmentId,metadata:e},a,i).then(()=>{c(null)}).catch(n=>{r(n)})}else{let a=g(this.storage,t.bucketPath);f(a).then(()=>{c(null)}).catch(n=>{c(null)})}})}deleteFileFromPath(t){return new Promise((e,o)=>{let i=g(this.storage,t);f(i).then(()=>{e(null)}).catch(c=>{o(c)})})}};s.\u0275fac=function(e){return new(e||s)(h(_),h(O),h(D),h(L),h(N))},s.\u0275prov=k({token:s,factory:s.\u0275fac,providedIn:"root"});let l=s;return l})();export{ie as a};
1
+ import{b as f,c as S,d as y,e as g,f as E}from"./chunk-HXLFHQKR.js";import{$ as k,Fi as N,Te as C,Ue as I,Xe as v,ag as b,ca as h,g as u,je as w,jf as x,le as A,pi as L,qe as T,qi as O,si as D,ti as P,vi as _}from"./chunk-4FFPMABU.js";var z=l=>{try{let s={USE_PROFILES:{svg:!0,svgFilters:!0},FORBID_ATTR:["onerror","onload","onclick","onmouseover","onmouseout","onmouseenter","onmouseleave","onmousemove","onmousedown","onmouseup","onwheel","onscroll","onkeydown","onkeyup","onkeypress","onfocus","onblur","onchange","onsubmit","on*"],FORBID_TAGS:["script","style","iframe","object","embed","form"]};return P.sanitize(l,s)}catch(s){return v.catch("Error in File utils sanitizeSvg: ",s),""}},M=l=>{try{return l.name.split(".").slice(0,-1).join(".")}catch(s){v.catch("Error in File utils getFileName: ",s);return}},R=l=>{try{return/(?:\.([^.]+))?$/.exec(l?.name)[1]}catch(s){v.catch("Error in File utils getFileExtension: ",s);return}},U=(l,s)=>{try{let d=l.slice(0,-1,l.type);return new File([d],s+"."+R(l),{type:l.type})}catch(d){v.catch("Error in File utils updateFile: ",d);return}};var F={mp4:"video/mp4",mov:"video/quicktime",avi:"video/x-msvideo",wmv:"video/x-ms-wmv",flv:"video/x-flv",mp3:"audio/mpeg",wav:"audio/wav",ogg:"audio/ogg",webm:"video/webm",mkv:"video/x-matroska",m4v:"video/x-m4v",m4a:"audio/x-m4a",aac:"audio/aac","3gp":"video/3gpp","3g2":"video/3gpp2",jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",gif:"image/gif",bmp:"image/bmp",svg:"image/svg+xml",webp:"image/webp",pdf:"application/pdf",doc:"application/msword",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",xls:"application/vnd.ms-excel",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",ppt:"application/vnd.ms-powerpoint",pptx:"application/vnd.openxmlformats-officedocument.presentationml.presentation",odt:"application/vnd.oasis.opendocument.text",ods:"application/vnd.oasis.opendocument.spreadsheet",zip:"application/zip",rar:"application/x-rar-compressed",txt:"text/plain",rtf:"application/rtf",html:"text/html",htm:"text/html",csv:"text/csv",ics:"text/calendar",vcf:"text/x-vcard",js:"application/javascript",css:"text/css",json:"application/json",xml:"application/xml",swf:"application/x-shockwave-flash"};var ie=(()=>{let s=class s{constructor(t,e,o,i,c){this.authService=t,this.configService=e,this.coreActionsService=o,this.loggingService=i,this.attachmentResolverService=c,this.storage=y();try{this.configService.getApiKey$().subscribe(r=>{this.apiKey=r}),this.authService.getFirebaseConfig$().subscribe(r=>{if(r&&r.firebaseOptions?.storageBucket){this.storage=y(void 0,r?.firebaseOptions?.storageBucket);let a=this.configService.getProxyConfig();a?.storageHost&&(this.storage.host=a.storageHost)}},r=>{this.loggingService.catch("Error in StorageService constructor: ",r)})}catch(r){this.loggingService.catch("Error in StorageService constructor:",r)}}createAttachment({path:t,file:e}){try{let o=new I;o.name=e.name;let i=U(e,`${o.attachmentId}_${M(e)}`),c=`${this.apiKey}/${t}/${i?.name}`;return o.bucketPath=c,o.size=e.size,o.type=R(e),o?.type&&(o.mimeType=F[o?.type]),o}catch(o){return this.loggingService.catch("Error in StorageService createAttachment: ",o),null}}sanitizeSvgFile(t){return u(this,null,function*(){if(t.type===F.svg)try{let e=yield t.text(),o=z(e);return new File([o],t.name,{type:t.type})}catch(e){return this.loggingService.catch("Error in StorageService sanitizeSvgFile: ",e),t}return t})}uploadAttachmentToStorage(c){return u(this,arguments,function*({attachment:t,file:e,resolve:o,reject:i}){try{let r=g(this.storage,t.bucketPath),a=E(r,e,{cacheControl:"public,max-age=3600"});a.on("state_changed",n=>{let m=n.bytesTransferred/n.totalBytes*100},n=>{i(n)},()=>{S(a.snapshot.ref).then(n=>{t.url=n,o(t)})})}catch(r){this.loggingService.catch("Error in StorageService uploadAttachmentToStorage: ",r),i(r)}})}uploadToResolver(a){return u(this,arguments,function*({file:t,attachment:e,metadata:o,resolve:i,reject:c,scope:r}){try{o.attachmentId=e.attachmentId;let n={attachmentId:e.attachmentId,name:e.name,file:t,metadata:o,mimeType:e.mimeType},m=b();this.coreActionsService.triggerAction(T.ATTACHMENT_RESOLVER,{event:w.Events.Resolver.ATTACHMENT_SAVE_REQUEST_FORMED,timestamp:new Date().getTime(),uniqueId:m,methodName:x.UPLOAD_TO_RESOLVER,source:"internal",payload:{attachment:n,eventType:A.ATTACHMENT_ADD}});let p=yield this.attachmentResolverService.saveAttachment({attachment:n,eventType:A.ATTACHMENT_ADD},m,r);p&&p.data?.url?(e.url=p.data?.url,i(e)):c(new Error("Failed to upload attachment to resolver"))}catch(n){this.loggingService.catch("Error in StorageService uploadToResolver: ",n),c(n)}})}uploadFile({path:t,file:e,useAttachmentResolver:o,metadata:i,attachmentScope:c}){return new Promise((r,a)=>u(this,null,function*(){try{if(!this.apiKey)throw new Error("API key not configured");let n=yield this.sanitizeSvgFile(e),m=this.createAttachment({path:t,file:n});if(!m)throw new Error("Attachment not created");o?this.uploadToResolver({file:n,attachment:m,metadata:i,resolve:r,reject:a,scope:c}):this.uploadAttachmentToStorage({attachment:m,file:n,resolve:r,reject:a})}catch(n){this.loggingService.catch("Error in StorageService uploadFile:",n),a(n)}}))}uploadChunk(t,e,o,i){return new Promise((c,r)=>{try{if(i?.useAttachmentResolver){let a=this.createAttachment({path:t,file:e});if(!a){r(new Error("Attachment not created for chunk upload"));return}this.uploadToResolver({file:e,attachment:a,metadata:i.metadata,resolve:n=>c(n.url),reject:r,scope:i.attachmentScope});return}if(this.apiKey){let a=`${this.apiKey}/${t}/${e.name}`,n=g(this.storage,a),m=E(n,e,{cacheControl:"public,max-age=3600"});m.on("state_changed",p=>{let $=p.bytesTransferred/p.totalBytes*100},p=>{r(p)},()=>{S(m.snapshot.ref).then(p=>{c(p)}).catch(p=>{this.loggingService.catch(`[uploadChunk] Error getting download URL for chunk ${o}:`,p),r(p)})})}else{let a=new Error("API key not available");this.loggingService.catch("[uploadChunk] API key not available",a),r(a)}}catch(a){this.loggingService.catch(`[uploadChunk] Error in StorageService uploadChunk for chunk ${o}: `,a),r(a)}})}downloadAttachment(t){try{if(t.url){let e=new XMLHttpRequest;e.responseType="blob",e.onload=()=>{let o=e.response,i=document.createElement("a"),c=window.URL.createObjectURL(o);i.setAttribute("type","hidden"),i.setAttribute(C.ATTRIBUTES.VELT_DOWNLOAD_BUTTON,"true"),i.classList.add("snippyly-overlay-panel"),i.href=c,t?.name&&(i.download=t?.name),document.body.appendChild(i);let r=new MouseEvent("click",{view:window,bubbles:!0,cancelable:!1});i.dispatchEvent(r),window.URL.revokeObjectURL(c),i.remove()},e.onerror=()=>{window.open(t.url,"_blank")},e.open("GET",t.url),e.send()}}catch(e){this.loggingService.catch("Error in StorageService downloadAttachment: ",e)}}deleteAttachment({attachment:t,metadata:e,useAttachmentResolver:o,attachmentScope:i}){return new Promise((c,r)=>{if(o){let a=b();this.coreActionsService.triggerAction(T.ATTACHMENT_RESOLVER,{event:w.Events.Resolver.ATTACHMENT_DELETE_REQUEST_FORMED,timestamp:new Date().getTime(),uniqueId:a,methodName:x.DELETE_ATTACHMENT,source:"internal",payload:{attachmentId:t.attachmentId,metadata:e}}),this.attachmentResolverService.deleteAttachment({attachmentId:t.attachmentId,metadata:e},a,i).then(()=>{c(null)}).catch(n=>{r(n)})}else{let a=g(this.storage,t.bucketPath);f(a).then(()=>{c(null)}).catch(n=>{c(null)})}})}deleteFileFromPath(t){return new Promise((e,o)=>{let i=g(this.storage,t);f(i).then(()=>{e(null)}).catch(c=>{o(c)})})}};s.\u0275fac=function(e){return new(e||s)(h(_),h(O),h(D),h(L),h(N))},s.\u0275prov=k({token:s,factory:s.\u0275fac,providedIn:"root"});let l=s;return l})();export{ie as a};
@@ -1 +1 @@
1
- import{f as B,j as X}from"./chunk-TMURKDBH.js";import{$ as p,L as C,Qi as te,T as j,Te as m,Va as W,Wa as J,Zh as N,_ as U,_b as K,a as R,aa as $,b as _,ca as u,cg as y,ef as Q,g as k,gf as Z,i as f,k as D,nd as Y,ni as ee,og as w,pe as l,pi as E,qa as H,r as F,ua as q,v as G,xh as V}from"./chunk-YTPDG6FY.js";var L=class{_totalWeight=0;_averageItemSize;_defaultItemSize;constructor(i=50){this._defaultItemSize=i,this._averageItemSize=i}getAverageItemSize(){return this._averageItemSize}addSample(i,a){let e=this._totalWeight+i.end-i.start;if(e){let t=(a+this._averageItemSize*this._totalWeight)/e;t&&(this._averageItemSize=t,this._totalWeight=e)}}reset(){this._averageItemSize=this._defaultItemSize,this._totalWeight=0}},z=class{scrolledIndexChange=new f(()=>{});_viewport=null;_minBufferPx;_maxBufferPx;_averager;_lastScrollOffset;_lastRenderedContentSize;_lastRenderedContentOffset;_removalFailures=0;constructor(i,a,e=new L){this._minBufferPx=i,this._maxBufferPx=a,this._averager=e}attach(i){this._averager.reset(),this._viewport=i,this._renderContentForCurrentOffset()}detach(){this._viewport=null}onContentScrolled(){this._viewport&&this._updateRenderedContentAfterScroll()}onDataLengthChanged(){this._viewport&&(this._renderContentForCurrentOffset(),this._checkRenderedContentSize())}onContentRendered(){this._viewport&&this._checkRenderedContentSize()}onRenderedOffsetChanged(){this._viewport&&this._checkRenderedContentOffset()}scrollToIndex(){}updateBufferSize(i,a){if(a<i)throw Error("CDK virtual scroll: maxBufferPx must be greater than or equal to minBufferPx");this._minBufferPx=i,this._maxBufferPx=a}_updateRenderedContentAfterScroll(){let i=this._viewport,a=i.measureScrollOffset(),e=a-this._lastScrollOffset,t=Math.abs(e),r=i.getRenderedRange(),n=0;if(e<0){let c=r.start*this._averager.getAverageItemSize()-this._lastRenderedContentOffset;n=Math.round(c*Math.max(0,Math.min(1,t/(a+t)))),e=e-n,t=Math.abs(e)}let s=this._lastScrollOffset-this._lastRenderedContentOffset,S=this._lastRenderedContentOffset+this._lastRenderedContentSize-(this._lastScrollOffset+i.getViewportSize()),h=t+this._minBufferPx-(e<0?s:S);if(h>0)if(t>=i.getViewportSize())this._renderContentForCurrentOffset();else{let v=Math.max(0,Math.ceil((h-this._minBufferPx+this._maxBufferPx)/this._averager.getAverageItemSize())),c=(e<0?S:s)-this._minBufferPx+t,T=Math.floor(c/this._averager.getAverageItemSize()/(this._removalFailures+1)),b=Math.min(r.end-r.start,Math.max(0,T)),g=this._expandRange(r,e<0?v:0,e>0?v:0);e<0?g.end=Math.max(g.start+1,g.end-b):g.start=Math.min(g.end-1,g.start+b);let d,M;if(e<0){let A=i.measureRangeSize({start:g.end,end:r.end});A<=c?(d=this._lastRenderedContentOffset+this._lastRenderedContentSize-A,this._removalFailures=0):(g.end=r.end,d=this._lastRenderedContentOffset+this._lastRenderedContentSize,this._removalFailures++),M="to-end"}else{let A=i.measureRangeSize({start:r.start,end:g.start});A<=c?(d=this._lastRenderedContentOffset+A,this._removalFailures=0):(g.start=r.start,d=this._lastRenderedContentOffset,this._removalFailures++),M="to-start"}i.setRenderedRange(g),i.setRenderedContentOffset(d+n,M)}else n&&i.setRenderedContentOffset(this._lastRenderedContentOffset+n);this._lastScrollOffset=a}_checkRenderedContentSize(){let i=this._viewport;this._lastRenderedContentSize=i.measureRenderedContentSize(),this._averager.addSample(i.getRenderedRange(),this._lastRenderedContentSize),this._updateTotalContentSize(this._lastRenderedContentSize)}_checkRenderedContentOffset(){let i=this._viewport;this._lastRenderedContentOffset=i.getOffsetToRenderedContentStart()}_renderContentForCurrentOffset(){let i=this._viewport,a=i.measureScrollOffset();this._lastScrollOffset=a,this._removalFailures=0;let e=this._averager.getAverageItemSize(),t=Math.min(i.getDataLength()-1,Math.floor(a/e)),r=Math.ceil(this._maxBufferPx/e),n=this._expandRange(this._getVisibleRangeForIndex(t),r,r);i.setRenderedRange(n),i.setRenderedContentOffset(e*n.start)}_getVisibleRangeForIndex(i){let a=this._viewport,e={start:i,end:i+Math.ceil(a.getViewportSize()/this._averager.getAverageItemSize())},t=e.end-a.getDataLength();return t>0&&(e.start=Math.max(0,e.start-t)),e}_expandRange(i,a,e){let t=this._viewport,r=Math.max(0,i.start-a),n=Math.min(t.getDataLength(),i.end+e);return{start:r,end:n}}_updateTotalContentSize(i){let a=this._viewport,e=a.getRenderedRange(),t=i+(a.getDataLength()-(e.end-e.start))*this._averager.getAverageItemSize();a.setTotalContentSize(t)}};function se(o){return o._scrollStrategy}var Se=(()=>{class o{get minBufferPx(){return this._minBufferPx}set minBufferPx(a){this._minBufferPx=B(a)}_minBufferPx=100;get maxBufferPx(){return this._maxBufferPx}set maxBufferPx(a){this._maxBufferPx=B(a)}_maxBufferPx=200;_scrollStrategy=new z(this.minBufferPx,this.maxBufferPx);ngOnChanges(){this._scrollStrategy.updateBufferSize(this.minBufferPx,this.maxBufferPx)}static \u0275fac=function(e){return new(e||o)};static \u0275dir=J({type:o,selectors:[["cdk-virtual-scroll-viewport","autosize",""]],inputs:{minBufferPx:"minBufferPx",maxBufferPx:"maxBufferPx"},features:[K([{provide:X,useFactory:se,deps:[U(()=>o)]}]),q]})}return o})(),fe=(()=>{class o{static \u0275fac=function(e){return new(e||o)};static \u0275mod=W({type:o});static \u0275inj=$({})}return o})();var O=(()=>{let i=class i{constructor(e){this.loggingService=e,this.enabledSignal=H(!1),this.onTargetEditStart=null,this.onTargetEditCommit=null;try{this.enabled$=Y(this.enabledSignal).pipe(C())}catch(t){this.loggingService.catch("Error in SuggestionModeService constructor: ",t),this.enabled$=new f}}enable(e){try{this.onTargetEditStart=e?.onTargetEditStart??null,this.onTargetEditCommit=e?.onTargetEditCommit??null,this.enabledSignal.set(!0)}catch(t){this.loggingService.catch("Error in SuggestionModeService enable: ",t)}}disable(){try{this.onTargetEditStart=null,this.onTargetEditCommit=null,this.enabledSignal.set(!1)}catch(e){this.loggingService.catch("Error in SuggestionModeService disable: ",e)}}isEnabled(){try{return this.enabledSignal()}catch(e){return this.loggingService.catch("Error in SuggestionModeService isEnabled: ",e),!1}}getOnTargetEditStart(){try{return this.onTargetEditStart}catch(e){return this.loggingService.catch("Error in SuggestionModeService getOnTargetEditStart: ",e),null}}getOnTargetEditCommit(){try{return this.onTargetEditCommit}catch(e){return this.loggingService.catch("Error in SuggestionModeService getOnTargetEditCommit: ",e),null}}};i.\u0275fac=function(t){return new(t||i)(u(E))},i.\u0275prov=p({token:i,factory:i.\u0275fac,providedIn:"root"});let o=i;return o})();var x=(()=>{let i=class i{constructor(e){this.loggingService=e,this.snapshots=new Map}captureFromGetter(e,t){try{if(!e||typeof t!="function")return!1;let r;try{r=t()}catch(n){return y()&&this.loggingService.catch(`[velt] Suggestion target "${e}" getter threw: `,n),!1}return this.captureValue(e,r)}catch(r){return this.loggingService.catch("Error in SuggestionSnapshotService captureFromGetter: ",r),!1}}captureValue(e,t){try{if(!e)return!1;let r;try{r=structuredClone(t)}catch(n){return y()&&this.loggingService.catch(`[velt] Suggestion target "${e}" snapshot failed (value not cloneable). Cause: structuredClone rejected the value (cyclic refs, DOM nodes, or functions are common culprits). Fix: ensure your getter returns plain JSON-serializable data.`,n),!1}return this.snapshots.set(e,r),!0}catch(r){return this.loggingService.catch("Error in SuggestionSnapshotService captureValue: ",r),!1}}getSnapshot(e){try{return this.snapshots.has(e)?this.snapshots.get(e):void 0}catch(t){this.loggingService.catch("Error in SuggestionSnapshotService getSnapshot: ",t);return}}hasSnapshot(e){try{return this.snapshots.has(e)}catch(t){return this.loggingService.catch("Error in SuggestionSnapshotService hasSnapshot: ",t),!1}}clearSnapshot(e){try{this.snapshots.delete(e)}catch(t){this.loggingService.catch("Error in SuggestionSnapshotService clearSnapshot: ",t)}}clearAllSnapshots(){try{this.snapshots.clear()}catch(e){this.loggingService.catch("Error in SuggestionSnapshotService clearAllSnapshots: ",e)}}};i.\u0275fac=function(t){return new(t||i)(u(E))},i.\u0275prov=p({token:i,factory:i.\u0275fac,providedIn:"root"});let o=i;return o})();var ne=(()=>{let i=class i{constructor(e,t,r){this.loggingService=e,this.modeService=t,this.snapshotService=r,this.registry=new Map,this.warnedUnstableIds=new Set,this.actionsService=null}registerTarget(e,t){try{if(!e||typeof t!="function")return;this.warnIfUnstableId(e);let r=this.registry.get(e)??{};r.getter=t,this.registry.set(e,r)}catch(r){this.loggingService.catch("Error in SuggestionTargetRegistryService registerTarget: ",r)}}unregisterTarget(e){try{let t=this.registry.get(e);if(!t)return;delete t.getter,t.node||this.registry.delete(e)}catch(t){this.loggingService.catch("Error in SuggestionTargetRegistryService unregisterTarget: ",t)}}getGetter(e){try{return this.registry.get(e)?.getter}catch(t){this.loggingService.catch("Error in SuggestionTargetRegistryService getGetter: ",t);return}}setActionsService(e){try{this.actionsService=e}catch(t){this.loggingService.catch("Error in SuggestionTargetRegistryService setActionsService: ",t)}}getNode(e){try{if(!e)return;let t=this.registry.get(e)?.node;if(t&&t.isConnected)return t;let r=this.queryAll(e);if(r.length===0)return;r.length>1&&this.warnDuplicateId(e,r.length);let n=r[0],s=this.registry.get(e)??{};return s.node=n,this.registry.set(e,s),n}catch(t){this.loggingService.catch("Error in SuggestionTargetRegistryService getNode: ",t);return}}getFallbackValue(e){try{let t=this.getNode(e);if(!t)return{hasValue:!1};let r=t.textContent??"";return r.length>0?{hasValue:!0,value:r}:{hasValue:!1}}catch(t){return this.loggingService.catch("Error in SuggestionTargetRegistryService getFallbackValue: ",t),{hasValue:!1}}}isRegistered(e){try{return this.registry.get(e)?.getter?!0:!!this.getNode(e)}catch(t){return this.loggingService.catch("Error in SuggestionTargetRegistryService isRegistered: ",t),!1}}countTaggedElements(e){try{let t=e??this.rootEl??document.body;return t?t.querySelectorAll(`[${m.ATTRIBUTES.VELT_SUGGESTION_TARGET}]`).length:0}catch(t){return this.loggingService.catch("Error in SuggestionTargetRegistryService countTaggedElements: ",t),0}}startObserving(e=document.body){try{if(this.observer)return;this.rootEl=e,this.scanAndRefresh(e),this.observer=new MutationObserver(()=>{try{this.scanAndRefresh(this.rootEl??document.body)}catch(t){this.loggingService.catch("Error in SuggestionTargetRegistryService observer callback: ",t)}}),this.observer.observe(e,{subtree:!0,childList:!0,attributes:!0,attributeFilter:[m.ATTRIBUTES.VELT_SUGGESTION_TARGET]}),this.installDelegatedListeners(e)}catch(t){this.loggingService.catch("Error in SuggestionTargetRegistryService startObserving: ",t)}}stopObserving(){try{this.observer?.disconnect(),this.observer=void 0,this.rootEl&&this.removeDelegatedListeners(this.rootEl),this.rootEl=void 0}catch(e){this.loggingService.catch("Error in SuggestionTargetRegistryService stopObserving: ",e)}}clear(){try{this.registry.clear(),this.warnedUnstableIds.clear()}catch(e){this.loggingService.catch("Error in SuggestionTargetRegistryService clear: ",e)}}installDelegatedListeners(e){try{this.boundFocusIn=t=>this.handleFocusIn(t),this.boundChange=t=>this.handleChange(t),this.boundFocusOut=t=>this.handleFocusOut(t),e.addEventListener("focusin",this.boundFocusIn,!0),e.addEventListener("change",this.boundChange,!0),e.addEventListener("focusout",this.boundFocusOut,!0)}catch(t){this.loggingService.catch("Error in SuggestionTargetRegistryService installDelegatedListeners: ",t)}}removeDelegatedListeners(e){try{this.boundFocusIn&&e.removeEventListener("focusin",this.boundFocusIn,!0),this.boundChange&&e.removeEventListener("change",this.boundChange,!0),this.boundFocusOut&&e.removeEventListener("focusout",this.boundFocusOut,!0),this.boundFocusIn=void 0,this.boundChange=void 0,this.boundFocusOut=void 0}catch(t){this.loggingService.catch("Error in SuggestionTargetRegistryService removeDelegatedListeners: ",t)}}handleFocusIn(e){try{if(!this.modeService.isEnabled())return;let t=this.findTaggedAncestor(e.target);if(!t)return;this.captureSnapshotForTarget(t.targetId,t.element);let r=this.snapshotService.getSnapshot(t.targetId),n={targetId:t.targetId,oldValue:r,newValue:r,element:t.element},s=this.modeService.getOnTargetEditStart();if(s)try{s(n)}catch(S){this.loggingService.catch("Error in SuggestionTargetRegistryService onTargetEditStart customer callback threw: ",S)}this.actionsService?.triggerAction(l.TARGET_EDIT_START,{details:n,timestamp:Date.now()})}catch(t){this.loggingService.catch("Error in SuggestionTargetRegistryService handleFocusIn: ",t)}}handleChange(e){try{if(!this.modeService.isEnabled())return;let t=this.findTaggedAncestor(e.target);if(!t||!this.isAtomicCommitTarget(e.target))return;this.processCommit(t.targetId,t.element)}catch(t){this.loggingService.catch("Error in SuggestionTargetRegistryService handleChange: ",t)}}handleFocusOut(e){try{if(!this.modeService.isEnabled())return;let t=this.findTaggedAncestor(e.target);if(!t||this.isAtomicCommitTarget(e.target))return;this.processCommit(t.targetId,t.element)}catch(t){this.loggingService.catch("Error in SuggestionTargetRegistryService handleFocusOut: ",t)}}isAtomicCommitTarget(e){try{if(e instanceof HTMLSelectElement)return!0;if(e instanceof HTMLInputElement){let t=(e.type||"").toLowerCase();return t==="checkbox"||t==="radio"}return!1}catch(t){return this.loggingService.catch("Error in SuggestionTargetRegistryService isAtomicCommitTarget: ",t),!1}}processCommit(e,t){try{let r=this.snapshotService.getSnapshot(e),n=this.readElementValue(e,t);if(w(r,n))return;let s={targetId:e,oldValue:r,newValue:n,element:t},S=this.modeService.getOnTargetEditCommit(),h=!1;if(S){let c=null;try{c=S(s)}catch(T){this.loggingService.catch("Error in SuggestionTargetRegistryService onTargetEditCommit customer callback threw: ",T)}c&&(h=!0,this.invokeAutoCommit({targetId:e,newValue:n,summary:c.summary,metadata:c.metadata}))}let v=c=>k(this,null,function*(){return h?null:this.invokeAutoCommit({targetId:e,newValue:n,summary:c?.summary,metadata:c?.metadata})});this.actionsService?.triggerAction(l.TARGET_EDIT_COMMIT,{details:s,commitSuggestion:v,timestamp:Date.now()})}catch(r){this.loggingService.catch("Error in SuggestionTargetRegistryService processCommit: ",r)}}invokeAutoCommit(e){try{return this.actionsService?this.actionsService.commitSuggestion(e).catch(t=>(y()&&this.loggingService.catch(`[velt] auto-commit for "${e.targetId}" rejected: `,t),null)):(y()&&this.loggingService.log("[velt] auto-commit skipped: actions service not wired. SuggestionActionsService constructor should call registry.setActionsService(this)."),Promise.resolve(null))}catch(t){return this.loggingService.catch("Error in SuggestionTargetRegistryService invokeAutoCommit: ",t),Promise.resolve(null)}}captureSnapshotForTarget(e,t){try{let r=this.registry.get(e);if(r?.getter){this.snapshotService.captureFromGetter(e,r.getter);return}let n=this.readElementValue(e,t);this.snapshotService.captureValue(e,n)}catch(r){this.loggingService.catch("Error in SuggestionTargetRegistryService captureSnapshotForTarget: ",r)}}readElementValue(e,t){try{let r=this.registry.get(e);if(r?.getter)try{return r.getter()}catch{return}if(t instanceof HTMLInputElement){let n=(t.type||"").toLowerCase();return n==="checkbox"||n==="radio"?t.checked:n==="number"||n==="range"?Number.isNaN(t.valueAsNumber)?t.value:t.valueAsNumber:t.value}return t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement?t.value:(t instanceof HTMLElement&&t.isContentEditable,t.textContent??"")}catch(r){this.loggingService.catch("Error in SuggestionTargetRegistryService readElementValue: ",r);return}}findTaggedAncestor(e){try{if(!(e instanceof Element))return null;let t=e.closest(`[${m.ATTRIBUTES.VELT_SUGGESTION_TARGET}]`);if(!t)return null;let r=t.getAttribute(m.ATTRIBUTES.VELT_SUGGESTION_TARGET);return r?{element:t,targetId:r}:null}catch(t){return this.loggingService.catch("Error in SuggestionTargetRegistryService findTaggedAncestor: ",t),null}}queryAll(e){try{let t=window.CSS?.escape?window.CSS.escape(e):e.replace(/"/g,'\\"');return Array.from(document.querySelectorAll(`[${m.ATTRIBUTES.VELT_SUGGESTION_TARGET}="${t}"]`))}catch{return[]}}scanAndRefresh(e){try{e.querySelectorAll(`[${m.ATTRIBUTES.VELT_SUGGESTION_TARGET}]`).forEach(r=>{let n=r.getAttribute(m.ATTRIBUTES.VELT_SUGGESTION_TARGET);if(!n)return;let s=this.registry.get(n)??{};(!s.node||!s.node.isConnected)&&(s.node=r,this.registry.set(n,s))})}catch(t){this.loggingService.catch("Error in SuggestionTargetRegistryService scanAndRefresh: ",t)}}warnIfUnstableId(e){try{if(!y()||this.warnedUnstableIds.has(e))return;let t=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/i.test(e),r=/\d{10,}/.test(e);(t||r)&&(this.warnedUnstableIds.add(e),this.loggingService.catch(`[velt] Target id "${e}" appears unstable. Cause: contains a UUID or timestamp shape \u2014 these typically change across re-renders. Fix: use a stable customer-owned id (the same one you use in your state). Docs: velt.dev/docs/suggestions/target-ids`,new Error("UNSTABLE_TARGET_ID")))}catch(t){this.loggingService.catch("Error in SuggestionTargetRegistryService warnIfUnstableId: ",t)}}warnDuplicateId(e,t){try{if(!y())return;this.loggingService.catch(`[velt] Duplicate target id "${e}" \u2014 ${t} elements share this id. Cause: the same ${m.ATTRIBUTES.VELT_SUGGESTION_TARGET} appears on multiple DOM nodes. Fix: ensure each suggestable element has a unique id. Velt is using the first registered element. Docs: velt.dev/docs/suggestions/target-ids`,new Error("DUPLICATE_TARGET_ID"))}catch(r){this.loggingService.catch("Error in SuggestionTargetRegistryService warnDuplicateId: ",r)}}};i.\u0275fac=function(t){return new(t||i)(u(E),u(O),u(x))},i.\u0275prov=p({token:i,factory:i.\u0275fac,providedIn:"root"});let o=i;return o})();var Be=(()=>{let i=class i{constructor(e,t,r,n,s,S){this.loggingService=e,this.modeService=t,this.snapshotService=r,this.targetRegistry=n,this.serviceBook=s,this.commonDbService=S,this.actionSubjects=new Map,this.observingActive=!1,this.commentService=null;try{this.targetRegistry.setActionsService(this),this.serviceBook.observe(N).subscribe(h=>{this.commentService=h})}catch(h){this.loggingService.catch("Error in SuggestionActionsService constructor: ",h)}}enableSuggestionMode(e){try{this.modeService.enable(e),this.startObservingIfNeeded(),this.warnIfNoTaggedElements()}catch(t){this.loggingService.catch("Error in SuggestionActionsService enableSuggestionMode: ",t)}}disableSuggestionMode(){try{this.modeService.disable(),this.stopObservingIfNeeded()}catch(e){this.loggingService.catch("Error in SuggestionActionsService disableSuggestionMode: ",e)}}isSuggestionModeEnabled(){try{return this.modeService.isEnabled()}catch(e){return this.loggingService.catch("Error in SuggestionActionsService isSuggestionModeEnabled: ",e),!1}}isSuggestionModeEnabled$(){try{return this.modeService.enabled$}catch(e){return this.loggingService.catch("Error in SuggestionActionsService isSuggestionModeEnabled$: ",e),new f}}registerTarget(e){try{if(!e?.targetId||typeof e?.getter!="function")return;this.targetRegistry.registerTarget(e.targetId,e.getter)}catch(t){this.loggingService.catch("Error in SuggestionActionsService registerTarget: ",t)}}unregisterTarget(e){try{this.targetRegistry.unregisterTarget(e)}catch(t){this.loggingService.catch("Error in SuggestionActionsService unregisterTarget: ",t)}}startSuggestion(e){try{let t=this.targetRegistry.getGetter(e);if(t){this.snapshotService.captureFromGetter(e,t);return}let r=this.targetRegistry.getFallbackValue(e);r.hasValue?this.snapshotService.captureValue(e,r.value):this.loggingService.warn(`[velt] startSuggestion: target "${e}" not registered. Cause: no getter via registerTarget() and no textContent fallback. Fix: tag the element with data-velt-suggestion-target and register a getter via registerTarget(). Docs: velt.dev/docs/suggestions/targets`)}catch(t){this.loggingService.catch("Error in SuggestionActionsService startSuggestion: ",t)}}commitSuggestion(e){return new Promise((t,r)=>{try{if(!e?.targetId){r(new Error("INVALID_CONFIG"));return}if(!this.modeService.isEnabled()){this.loggingService.warn("[velt] commitSuggestion called while suggestion mode is disabled. Cause: enableSuggestionMode() has not been called (or disableSuggestionMode() was called). Fix: call enableSuggestionMode() before commit, or branch on isSuggestionModeEnabled() in your onSave handler. Docs: velt.dev/docs/suggestions/mode"),r(new Error("MODE_NOT_SUGGESTING"));return}if(!this.targetRegistry.isRegistered(e.targetId)){this.loggingService.warn(`[velt] commitSuggestion: target "${e.targetId}" not registered. Cause: no element has data-velt-suggestion-target="${e.targetId}" and no registerTarget() call provided a getter. Fix: tag the element or register a getter at app boot. Docs: velt.dev/docs/suggestions/targets`),r(new Error("TARGET_NOT_REGISTERED"));return}if(!this.snapshotService.hasSnapshot(e.targetId)){let g=this.targetRegistry.getGetter(e.targetId);if(g){if(!this.snapshotService.captureFromGetter(e.targetId,g)){r(new Error("SNAPSHOT_FAILED"));return}}else{let d=this.targetRegistry.getFallbackValue(e.targetId);if(d.hasValue)this.snapshotService.captureValue(e.targetId,d.value);else{this.loggingService.warn(`[velt] commitSuggestion: target "${e.targetId}" requires registerTarget() for complex values. Cause: complex objects need a getter so the SDK can deep-clone the snapshot. Fix: call velt.getSuggestionElement().registerTarget("${e.targetId}", () => yourState.${e.targetId}) at app boot. Docs: velt.dev/docs/suggestions/getter`),r(new Error("NO_GETTER_FOR_COMPLEX"));return}}}let h=this.snapshotService.getSnapshot(e.targetId),v=e.newValue;if(w(h,v)){this.loggingService.warn(`[velt] commitSuggestion: no change detected for target "${e.targetId}". Cause: oldValue and newValue are deeply equal. Fix: only call commitSuggestion when the customer actually changed the value. Docs: velt.dev/docs/suggestions/edge-cases`),r(new Error("NO_CHANGE_TO_SUGGEST"));return}let c=new Q;c.type="suggestion",c.suggestion={status:"pending",targetId:e.targetId,targetType:"custom",oldValue:h,newValue:v,summary:e.summary??null,driftDetected:!1,rejectReason:null,resolvedBy:null,resolvedAt:null},c.metadata=e.metadata??{};let T=e.summary??`[${e.targetId}] changed`,b=new Z;if(b.commentText=T,b.commentHtml=`<p>${this.escapeHtml(T)}</p>`,c.comments=[b],!this.commentService){this.loggingService.catch('SuggestionActionsService.commitSuggestion: comment chunk not loaded \u2014 call Snippyly.preloadComment() first or include "comment" in featureAllowList.',new Error("comment chunk unavailable")),r(new Error("comment chunk not loaded"));return}this.commentService.addComment(void 0,void 0,void 0,void 0,!1,[],void 0,void 0,void 0,void 0,void 0,void 0,void 0,g=>{try{this.snapshotService.clearSnapshot(e.targetId),this.projectAndTrigger(l.SUGGESTION_CREATED,g.annotation),t({id:g.annotation.annotationId})}catch(d){this.loggingService.catch("Error in SuggestionActionsService commitSuggestion callback: ",d),r(d)}},void 0,void 0,c,void 0,void 0,!0,void 0,void 0,"internal",void 0)}catch(n){this.loggingService.catch("Error in SuggestionActionsService commitSuggestion: ",n),r(n)}})}getSuggestions(e){try{let t=this.commentService?.getCommentAnnotationsOnCurrentOrganizationAndDocument()??[],r=[];for(let n of t){if(n.type!=="suggestion"||!n.suggestion)continue;let s=this.projectAnnotationToSuggestion(n);s&&this.matchesFilter(s,e)&&r.push(s)}return r}catch(t){return this.loggingService.catch("Error in SuggestionActionsService getSuggestions: ",t),[]}}getSuggestions$(e){try{return this.serviceBook.observe(N).pipe(j(t=>t?t.getCommentAnnotationsOnCurrentOrganizationAndDocument$():F([]))).pipe(G(t=>{let r=[];for(let n of t??[]){if(n.type!=="suggestion"||!n.suggestion)continue;let s=this.projectAnnotationToSuggestion(n);s&&this.matchesFilter(s,e)&&r.push(s)}return r}),C(V))}catch(t){return this.loggingService.catch("Error in SuggestionActionsService getSuggestions$: ",t),new f}}getPendingSuggestion(e){try{if(!e)return null;let t=this.getSuggestions({targetId:e,status:"pending"});return t.length===0?null:t.sort((r,n)=>(n.createdAt??0)-(r.createdAt??0))[0]}catch(t){return this.loggingService.catch("Error in SuggestionActionsService getPendingSuggestion: ",t),null}}getPendingSuggestion$(e){try{return e?this.getSuggestions$({targetId:e,status:"pending"}).pipe(G(t=>t.length===0?null:t.sort((r,n)=>(n.createdAt??0)-(r.createdAt??0))[0]),C(V)):new f}catch(t){return this.loggingService.catch("Error in SuggestionActionsService getPendingSuggestion$: ",t),new f}}triggerAction(e,t){try{this.actionSubjects.has(e)||this.actionSubjects.set(e,new D),this.actionSubjects.get(e)?.next(t)}catch(r){this.loggingService.catch("Error in SuggestionActionsService triggerAction: ",r)}}onAction(e){try{return this.actionSubjects.has(e)||this.actionSubjects.set(e,new D),this.actionSubjects.get(e)?.asObservable()}catch(t){return this.loggingService.catch("Error in SuggestionActionsService onAction: ",t),F(null)}}projectAndTrigger(e,t){try{if(!t||t.type!=="suggestion"||!t.suggestion)return;let r=this.projectAnnotationToSuggestion(t);if(!r)return;let n=this.timestamp;switch(e){case l.SUGGESTION_CREATED:{let s={suggestion:r,timestamp:n};this.triggerAction(l.SUGGESTION_CREATED,s);break}case l.SUGGESTION_APPROVED:{let s={suggestion:r,timestamp:n};this.triggerAction(l.SUGGESTION_APPROVED,s);break}case l.SUGGESTION_REJECTED:{let s={suggestion:r,timestamp:n};this.triggerAction(l.SUGGESTION_REJECTED,s);break}case l.SUGGESTION_STALE:{let s={suggestion:r,timestamp:n};this.triggerAction(l.SUGGESTION_STALE,s);break}}}catch(r){this.loggingService.catch("Error in SuggestionActionsService projectAndTrigger: ",r)}}projectAnnotationToSuggestion(e){try{let t=e.suggestion;if(!t)return;let r={annotationId:e.annotationId,targetId:t.targetId,targetType:t.targetType,oldValue:t.oldValue,newValue:t.newValue,summary:t.summary,metadata:e.metadata??{},driftDetected:!!t.driftDetected,createdBy:e.from,createdAt:e.createdAt??0};switch(t.status){case"pending":return _(R({},r),{status:"pending",rejectReason:null,resolvedBy:null,resolvedAt:null});case"accepted":case"apply_failed":return _(R({},r),{status:t.status,rejectReason:null,resolvedBy:t.resolvedBy,resolvedAt:t.resolvedAt??this.timestamp});case"rejected":return _(R({},r),{status:"rejected",rejectReason:t.rejectReason??null,resolvedBy:t.resolvedBy,resolvedAt:t.resolvedAt??this.timestamp});case"stale":return _(R({},r),{status:"stale",rejectReason:null,resolvedBy:t.resolvedBy,resolvedAt:t.resolvedAt});default:return}}catch(t){this.loggingService.catch("Error in SuggestionActionsService projectAnnotationToSuggestion: ",t);return}}startObservingIfNeeded(){try{if(this.observingActive)return;this.observingActive=!0,this.targetRegistry.startObserving()}catch(e){this.loggingService.catch("Error in SuggestionActionsService startObservingIfNeeded: ",e)}}stopObservingIfNeeded(){try{if(!this.observingActive)return;this.observingActive=!1,this.targetRegistry.stopObserving()}catch(e){this.loggingService.catch("Error in SuggestionActionsService stopObservingIfNeeded: ",e)}}warnIfNoTaggedElements(){try{this.targetRegistry.countTaggedElements()===0&&this.loggingService.warn('[velt] No suggestable elements found on this page. Cause: no DOM elements have a data-velt-suggestion-target attribute. Fix: tag at least one element with data-velt-suggestion-target="your.id" before enabling suggestion mode. Docs: velt.dev/docs/suggestions/getting-started')}catch(e){this.loggingService.catch("Error in SuggestionActionsService warnIfNoTaggedElements: ",e)}}get timestamp(){return this.commonDbService.getServerTimestamp()}matchesFilter(e,t){try{return t?!(t.targetId&&e.targetId!==t.targetId||t.status&&!(Array.isArray(t.status)?t.status:[t.status]).includes(e.status)):!0}catch(r){return this.loggingService.catch("Error in SuggestionActionsService matchesFilter: ",r),!1}}escapeHtml(e){try{return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}catch(t){return this.loggingService.catch("Error in SuggestionActionsService escapeHtml: ",t),""}}};i.\u0275fac=function(t){return new(t||i)(u(E),u(O),u(x),u(ne),u(ee),u(te))},i.\u0275prov=p({token:i,factory:i.\u0275fac,providedIn:"root"});let o=i;return o})();export{Se as a,fe as b,ne as c,Be as d};
1
+ import{f as B,j as X}from"./chunk-DC4XY76Y.js";import{$ as p,L as C,Qi as te,T as j,Te as m,Va as W,Wa as J,Zh as N,_ as U,_b as K,a as R,aa as $,b as _,ca as u,cg as y,ef as Q,g as k,gf as Z,i as f,k as D,nd as Y,ni as ee,og as w,pe as l,pi as E,qa as H,r as F,ua as q,v as G,xh as V}from"./chunk-4FFPMABU.js";var L=class{_totalWeight=0;_averageItemSize;_defaultItemSize;constructor(i=50){this._defaultItemSize=i,this._averageItemSize=i}getAverageItemSize(){return this._averageItemSize}addSample(i,a){let e=this._totalWeight+i.end-i.start;if(e){let t=(a+this._averageItemSize*this._totalWeight)/e;t&&(this._averageItemSize=t,this._totalWeight=e)}}reset(){this._averageItemSize=this._defaultItemSize,this._totalWeight=0}},z=class{scrolledIndexChange=new f(()=>{});_viewport=null;_minBufferPx;_maxBufferPx;_averager;_lastScrollOffset;_lastRenderedContentSize;_lastRenderedContentOffset;_removalFailures=0;constructor(i,a,e=new L){this._minBufferPx=i,this._maxBufferPx=a,this._averager=e}attach(i){this._averager.reset(),this._viewport=i,this._renderContentForCurrentOffset()}detach(){this._viewport=null}onContentScrolled(){this._viewport&&this._updateRenderedContentAfterScroll()}onDataLengthChanged(){this._viewport&&(this._renderContentForCurrentOffset(),this._checkRenderedContentSize())}onContentRendered(){this._viewport&&this._checkRenderedContentSize()}onRenderedOffsetChanged(){this._viewport&&this._checkRenderedContentOffset()}scrollToIndex(){}updateBufferSize(i,a){if(a<i)throw Error("CDK virtual scroll: maxBufferPx must be greater than or equal to minBufferPx");this._minBufferPx=i,this._maxBufferPx=a}_updateRenderedContentAfterScroll(){let i=this._viewport,a=i.measureScrollOffset(),e=a-this._lastScrollOffset,t=Math.abs(e),r=i.getRenderedRange(),n=0;if(e<0){let c=r.start*this._averager.getAverageItemSize()-this._lastRenderedContentOffset;n=Math.round(c*Math.max(0,Math.min(1,t/(a+t)))),e=e-n,t=Math.abs(e)}let s=this._lastScrollOffset-this._lastRenderedContentOffset,S=this._lastRenderedContentOffset+this._lastRenderedContentSize-(this._lastScrollOffset+i.getViewportSize()),h=t+this._minBufferPx-(e<0?s:S);if(h>0)if(t>=i.getViewportSize())this._renderContentForCurrentOffset();else{let v=Math.max(0,Math.ceil((h-this._minBufferPx+this._maxBufferPx)/this._averager.getAverageItemSize())),c=(e<0?S:s)-this._minBufferPx+t,T=Math.floor(c/this._averager.getAverageItemSize()/(this._removalFailures+1)),b=Math.min(r.end-r.start,Math.max(0,T)),g=this._expandRange(r,e<0?v:0,e>0?v:0);e<0?g.end=Math.max(g.start+1,g.end-b):g.start=Math.min(g.end-1,g.start+b);let d,M;if(e<0){let A=i.measureRangeSize({start:g.end,end:r.end});A<=c?(d=this._lastRenderedContentOffset+this._lastRenderedContentSize-A,this._removalFailures=0):(g.end=r.end,d=this._lastRenderedContentOffset+this._lastRenderedContentSize,this._removalFailures++),M="to-end"}else{let A=i.measureRangeSize({start:r.start,end:g.start});A<=c?(d=this._lastRenderedContentOffset+A,this._removalFailures=0):(g.start=r.start,d=this._lastRenderedContentOffset,this._removalFailures++),M="to-start"}i.setRenderedRange(g),i.setRenderedContentOffset(d+n,M)}else n&&i.setRenderedContentOffset(this._lastRenderedContentOffset+n);this._lastScrollOffset=a}_checkRenderedContentSize(){let i=this._viewport;this._lastRenderedContentSize=i.measureRenderedContentSize(),this._averager.addSample(i.getRenderedRange(),this._lastRenderedContentSize),this._updateTotalContentSize(this._lastRenderedContentSize)}_checkRenderedContentOffset(){let i=this._viewport;this._lastRenderedContentOffset=i.getOffsetToRenderedContentStart()}_renderContentForCurrentOffset(){let i=this._viewport,a=i.measureScrollOffset();this._lastScrollOffset=a,this._removalFailures=0;let e=this._averager.getAverageItemSize(),t=Math.min(i.getDataLength()-1,Math.floor(a/e)),r=Math.ceil(this._maxBufferPx/e),n=this._expandRange(this._getVisibleRangeForIndex(t),r,r);i.setRenderedRange(n),i.setRenderedContentOffset(e*n.start)}_getVisibleRangeForIndex(i){let a=this._viewport,e={start:i,end:i+Math.ceil(a.getViewportSize()/this._averager.getAverageItemSize())},t=e.end-a.getDataLength();return t>0&&(e.start=Math.max(0,e.start-t)),e}_expandRange(i,a,e){let t=this._viewport,r=Math.max(0,i.start-a),n=Math.min(t.getDataLength(),i.end+e);return{start:r,end:n}}_updateTotalContentSize(i){let a=this._viewport,e=a.getRenderedRange(),t=i+(a.getDataLength()-(e.end-e.start))*this._averager.getAverageItemSize();a.setTotalContentSize(t)}};function se(o){return o._scrollStrategy}var Se=(()=>{class o{get minBufferPx(){return this._minBufferPx}set minBufferPx(a){this._minBufferPx=B(a)}_minBufferPx=100;get maxBufferPx(){return this._maxBufferPx}set maxBufferPx(a){this._maxBufferPx=B(a)}_maxBufferPx=200;_scrollStrategy=new z(this.minBufferPx,this.maxBufferPx);ngOnChanges(){this._scrollStrategy.updateBufferSize(this.minBufferPx,this.maxBufferPx)}static \u0275fac=function(e){return new(e||o)};static \u0275dir=J({type:o,selectors:[["cdk-virtual-scroll-viewport","autosize",""]],inputs:{minBufferPx:"minBufferPx",maxBufferPx:"maxBufferPx"},features:[K([{provide:X,useFactory:se,deps:[U(()=>o)]}]),q]})}return o})(),fe=(()=>{class o{static \u0275fac=function(e){return new(e||o)};static \u0275mod=W({type:o});static \u0275inj=$({})}return o})();var O=(()=>{let i=class i{constructor(e){this.loggingService=e,this.enabledSignal=H(!1),this.onTargetEditStart=null,this.onTargetEditCommit=null;try{this.enabled$=Y(this.enabledSignal).pipe(C())}catch(t){this.loggingService.catch("Error in SuggestionModeService constructor: ",t),this.enabled$=new f}}enable(e){try{this.onTargetEditStart=e?.onTargetEditStart??null,this.onTargetEditCommit=e?.onTargetEditCommit??null,this.enabledSignal.set(!0)}catch(t){this.loggingService.catch("Error in SuggestionModeService enable: ",t)}}disable(){try{this.onTargetEditStart=null,this.onTargetEditCommit=null,this.enabledSignal.set(!1)}catch(e){this.loggingService.catch("Error in SuggestionModeService disable: ",e)}}isEnabled(){try{return this.enabledSignal()}catch(e){return this.loggingService.catch("Error in SuggestionModeService isEnabled: ",e),!1}}getOnTargetEditStart(){try{return this.onTargetEditStart}catch(e){return this.loggingService.catch("Error in SuggestionModeService getOnTargetEditStart: ",e),null}}getOnTargetEditCommit(){try{return this.onTargetEditCommit}catch(e){return this.loggingService.catch("Error in SuggestionModeService getOnTargetEditCommit: ",e),null}}};i.\u0275fac=function(t){return new(t||i)(u(E))},i.\u0275prov=p({token:i,factory:i.\u0275fac,providedIn:"root"});let o=i;return o})();var x=(()=>{let i=class i{constructor(e){this.loggingService=e,this.snapshots=new Map}captureFromGetter(e,t){try{if(!e||typeof t!="function")return!1;let r;try{r=t()}catch(n){return y()&&this.loggingService.catch(`[velt] Suggestion target "${e}" getter threw: `,n),!1}return this.captureValue(e,r)}catch(r){return this.loggingService.catch("Error in SuggestionSnapshotService captureFromGetter: ",r),!1}}captureValue(e,t){try{if(!e)return!1;let r;try{r=structuredClone(t)}catch(n){return y()&&this.loggingService.catch(`[velt] Suggestion target "${e}" snapshot failed (value not cloneable). Cause: structuredClone rejected the value (cyclic refs, DOM nodes, or functions are common culprits). Fix: ensure your getter returns plain JSON-serializable data.`,n),!1}return this.snapshots.set(e,r),!0}catch(r){return this.loggingService.catch("Error in SuggestionSnapshotService captureValue: ",r),!1}}getSnapshot(e){try{return this.snapshots.has(e)?this.snapshots.get(e):void 0}catch(t){this.loggingService.catch("Error in SuggestionSnapshotService getSnapshot: ",t);return}}hasSnapshot(e){try{return this.snapshots.has(e)}catch(t){return this.loggingService.catch("Error in SuggestionSnapshotService hasSnapshot: ",t),!1}}clearSnapshot(e){try{this.snapshots.delete(e)}catch(t){this.loggingService.catch("Error in SuggestionSnapshotService clearSnapshot: ",t)}}clearAllSnapshots(){try{this.snapshots.clear()}catch(e){this.loggingService.catch("Error in SuggestionSnapshotService clearAllSnapshots: ",e)}}};i.\u0275fac=function(t){return new(t||i)(u(E))},i.\u0275prov=p({token:i,factory:i.\u0275fac,providedIn:"root"});let o=i;return o})();var ne=(()=>{let i=class i{constructor(e,t,r){this.loggingService=e,this.modeService=t,this.snapshotService=r,this.registry=new Map,this.warnedUnstableIds=new Set,this.actionsService=null}registerTarget(e,t){try{if(!e||typeof t!="function")return;this.warnIfUnstableId(e);let r=this.registry.get(e)??{};r.getter=t,this.registry.set(e,r)}catch(r){this.loggingService.catch("Error in SuggestionTargetRegistryService registerTarget: ",r)}}unregisterTarget(e){try{let t=this.registry.get(e);if(!t)return;delete t.getter,t.node||this.registry.delete(e)}catch(t){this.loggingService.catch("Error in SuggestionTargetRegistryService unregisterTarget: ",t)}}getGetter(e){try{return this.registry.get(e)?.getter}catch(t){this.loggingService.catch("Error in SuggestionTargetRegistryService getGetter: ",t);return}}setActionsService(e){try{this.actionsService=e}catch(t){this.loggingService.catch("Error in SuggestionTargetRegistryService setActionsService: ",t)}}getNode(e){try{if(!e)return;let t=this.registry.get(e)?.node;if(t&&t.isConnected)return t;let r=this.queryAll(e);if(r.length===0)return;r.length>1&&this.warnDuplicateId(e,r.length);let n=r[0],s=this.registry.get(e)??{};return s.node=n,this.registry.set(e,s),n}catch(t){this.loggingService.catch("Error in SuggestionTargetRegistryService getNode: ",t);return}}getFallbackValue(e){try{let t=this.getNode(e);if(!t)return{hasValue:!1};let r=t.textContent??"";return r.length>0?{hasValue:!0,value:r}:{hasValue:!1}}catch(t){return this.loggingService.catch("Error in SuggestionTargetRegistryService getFallbackValue: ",t),{hasValue:!1}}}isRegistered(e){try{return this.registry.get(e)?.getter?!0:!!this.getNode(e)}catch(t){return this.loggingService.catch("Error in SuggestionTargetRegistryService isRegistered: ",t),!1}}countTaggedElements(e){try{let t=e??this.rootEl??document.body;return t?t.querySelectorAll(`[${m.ATTRIBUTES.VELT_SUGGESTION_TARGET}]`).length:0}catch(t){return this.loggingService.catch("Error in SuggestionTargetRegistryService countTaggedElements: ",t),0}}startObserving(e=document.body){try{if(this.observer)return;this.rootEl=e,this.scanAndRefresh(e),this.observer=new MutationObserver(()=>{try{this.scanAndRefresh(this.rootEl??document.body)}catch(t){this.loggingService.catch("Error in SuggestionTargetRegistryService observer callback: ",t)}}),this.observer.observe(e,{subtree:!0,childList:!0,attributes:!0,attributeFilter:[m.ATTRIBUTES.VELT_SUGGESTION_TARGET]}),this.installDelegatedListeners(e)}catch(t){this.loggingService.catch("Error in SuggestionTargetRegistryService startObserving: ",t)}}stopObserving(){try{this.observer?.disconnect(),this.observer=void 0,this.rootEl&&this.removeDelegatedListeners(this.rootEl),this.rootEl=void 0}catch(e){this.loggingService.catch("Error in SuggestionTargetRegistryService stopObserving: ",e)}}clear(){try{this.registry.clear(),this.warnedUnstableIds.clear()}catch(e){this.loggingService.catch("Error in SuggestionTargetRegistryService clear: ",e)}}installDelegatedListeners(e){try{this.boundFocusIn=t=>this.handleFocusIn(t),this.boundChange=t=>this.handleChange(t),this.boundFocusOut=t=>this.handleFocusOut(t),e.addEventListener("focusin",this.boundFocusIn,!0),e.addEventListener("change",this.boundChange,!0),e.addEventListener("focusout",this.boundFocusOut,!0)}catch(t){this.loggingService.catch("Error in SuggestionTargetRegistryService installDelegatedListeners: ",t)}}removeDelegatedListeners(e){try{this.boundFocusIn&&e.removeEventListener("focusin",this.boundFocusIn,!0),this.boundChange&&e.removeEventListener("change",this.boundChange,!0),this.boundFocusOut&&e.removeEventListener("focusout",this.boundFocusOut,!0),this.boundFocusIn=void 0,this.boundChange=void 0,this.boundFocusOut=void 0}catch(t){this.loggingService.catch("Error in SuggestionTargetRegistryService removeDelegatedListeners: ",t)}}handleFocusIn(e){try{if(!this.modeService.isEnabled())return;let t=this.findTaggedAncestor(e.target);if(!t)return;this.captureSnapshotForTarget(t.targetId,t.element);let r=this.snapshotService.getSnapshot(t.targetId),n={targetId:t.targetId,oldValue:r,newValue:r,element:t.element},s=this.modeService.getOnTargetEditStart();if(s)try{s(n)}catch(S){this.loggingService.catch("Error in SuggestionTargetRegistryService onTargetEditStart customer callback threw: ",S)}this.actionsService?.triggerAction(l.TARGET_EDIT_START,{details:n,timestamp:Date.now()})}catch(t){this.loggingService.catch("Error in SuggestionTargetRegistryService handleFocusIn: ",t)}}handleChange(e){try{if(!this.modeService.isEnabled())return;let t=this.findTaggedAncestor(e.target);if(!t||!this.isAtomicCommitTarget(e.target))return;this.processCommit(t.targetId,t.element)}catch(t){this.loggingService.catch("Error in SuggestionTargetRegistryService handleChange: ",t)}}handleFocusOut(e){try{if(!this.modeService.isEnabled())return;let t=this.findTaggedAncestor(e.target);if(!t||this.isAtomicCommitTarget(e.target))return;this.processCommit(t.targetId,t.element)}catch(t){this.loggingService.catch("Error in SuggestionTargetRegistryService handleFocusOut: ",t)}}isAtomicCommitTarget(e){try{if(e instanceof HTMLSelectElement)return!0;if(e instanceof HTMLInputElement){let t=(e.type||"").toLowerCase();return t==="checkbox"||t==="radio"}return!1}catch(t){return this.loggingService.catch("Error in SuggestionTargetRegistryService isAtomicCommitTarget: ",t),!1}}processCommit(e,t){try{let r=this.snapshotService.getSnapshot(e),n=this.readElementValue(e,t);if(w(r,n))return;let s={targetId:e,oldValue:r,newValue:n,element:t},S=this.modeService.getOnTargetEditCommit(),h=!1;if(S){let c=null;try{c=S(s)}catch(T){this.loggingService.catch("Error in SuggestionTargetRegistryService onTargetEditCommit customer callback threw: ",T)}c&&(h=!0,this.invokeAutoCommit({targetId:e,newValue:n,summary:c.summary,metadata:c.metadata}))}let v=c=>k(this,null,function*(){return h?null:this.invokeAutoCommit({targetId:e,newValue:n,summary:c?.summary,metadata:c?.metadata})});this.actionsService?.triggerAction(l.TARGET_EDIT_COMMIT,{details:s,commitSuggestion:v,timestamp:Date.now()})}catch(r){this.loggingService.catch("Error in SuggestionTargetRegistryService processCommit: ",r)}}invokeAutoCommit(e){try{return this.actionsService?this.actionsService.commitSuggestion(e).catch(t=>(y()&&this.loggingService.catch(`[velt] auto-commit for "${e.targetId}" rejected: `,t),null)):(y()&&this.loggingService.log("[velt] auto-commit skipped: actions service not wired. SuggestionActionsService constructor should call registry.setActionsService(this)."),Promise.resolve(null))}catch(t){return this.loggingService.catch("Error in SuggestionTargetRegistryService invokeAutoCommit: ",t),Promise.resolve(null)}}captureSnapshotForTarget(e,t){try{let r=this.registry.get(e);if(r?.getter){this.snapshotService.captureFromGetter(e,r.getter);return}let n=this.readElementValue(e,t);this.snapshotService.captureValue(e,n)}catch(r){this.loggingService.catch("Error in SuggestionTargetRegistryService captureSnapshotForTarget: ",r)}}readElementValue(e,t){try{let r=this.registry.get(e);if(r?.getter)try{return r.getter()}catch{return}if(t instanceof HTMLInputElement){let n=(t.type||"").toLowerCase();return n==="checkbox"||n==="radio"?t.checked:n==="number"||n==="range"?Number.isNaN(t.valueAsNumber)?t.value:t.valueAsNumber:t.value}return t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement?t.value:(t instanceof HTMLElement&&t.isContentEditable,t.textContent??"")}catch(r){this.loggingService.catch("Error in SuggestionTargetRegistryService readElementValue: ",r);return}}findTaggedAncestor(e){try{if(!(e instanceof Element))return null;let t=e.closest(`[${m.ATTRIBUTES.VELT_SUGGESTION_TARGET}]`);if(!t)return null;let r=t.getAttribute(m.ATTRIBUTES.VELT_SUGGESTION_TARGET);return r?{element:t,targetId:r}:null}catch(t){return this.loggingService.catch("Error in SuggestionTargetRegistryService findTaggedAncestor: ",t),null}}queryAll(e){try{let t=window.CSS?.escape?window.CSS.escape(e):e.replace(/"/g,'\\"');return Array.from(document.querySelectorAll(`[${m.ATTRIBUTES.VELT_SUGGESTION_TARGET}="${t}"]`))}catch{return[]}}scanAndRefresh(e){try{e.querySelectorAll(`[${m.ATTRIBUTES.VELT_SUGGESTION_TARGET}]`).forEach(r=>{let n=r.getAttribute(m.ATTRIBUTES.VELT_SUGGESTION_TARGET);if(!n)return;let s=this.registry.get(n)??{};(!s.node||!s.node.isConnected)&&(s.node=r,this.registry.set(n,s))})}catch(t){this.loggingService.catch("Error in SuggestionTargetRegistryService scanAndRefresh: ",t)}}warnIfUnstableId(e){try{if(!y()||this.warnedUnstableIds.has(e))return;let t=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/i.test(e),r=/\d{10,}/.test(e);(t||r)&&(this.warnedUnstableIds.add(e),this.loggingService.catch(`[velt] Target id "${e}" appears unstable. Cause: contains a UUID or timestamp shape \u2014 these typically change across re-renders. Fix: use a stable customer-owned id (the same one you use in your state). Docs: velt.dev/docs/suggestions/target-ids`,new Error("UNSTABLE_TARGET_ID")))}catch(t){this.loggingService.catch("Error in SuggestionTargetRegistryService warnIfUnstableId: ",t)}}warnDuplicateId(e,t){try{if(!y())return;this.loggingService.catch(`[velt] Duplicate target id "${e}" \u2014 ${t} elements share this id. Cause: the same ${m.ATTRIBUTES.VELT_SUGGESTION_TARGET} appears on multiple DOM nodes. Fix: ensure each suggestable element has a unique id. Velt is using the first registered element. Docs: velt.dev/docs/suggestions/target-ids`,new Error("DUPLICATE_TARGET_ID"))}catch(r){this.loggingService.catch("Error in SuggestionTargetRegistryService warnDuplicateId: ",r)}}};i.\u0275fac=function(t){return new(t||i)(u(E),u(O),u(x))},i.\u0275prov=p({token:i,factory:i.\u0275fac,providedIn:"root"});let o=i;return o})();var Be=(()=>{let i=class i{constructor(e,t,r,n,s,S){this.loggingService=e,this.modeService=t,this.snapshotService=r,this.targetRegistry=n,this.serviceBook=s,this.commonDbService=S,this.actionSubjects=new Map,this.observingActive=!1,this.commentService=null;try{this.targetRegistry.setActionsService(this),this.serviceBook.observe(N).subscribe(h=>{this.commentService=h})}catch(h){this.loggingService.catch("Error in SuggestionActionsService constructor: ",h)}}enableSuggestionMode(e){try{this.modeService.enable(e),this.startObservingIfNeeded(),this.warnIfNoTaggedElements()}catch(t){this.loggingService.catch("Error in SuggestionActionsService enableSuggestionMode: ",t)}}disableSuggestionMode(){try{this.modeService.disable(),this.stopObservingIfNeeded()}catch(e){this.loggingService.catch("Error in SuggestionActionsService disableSuggestionMode: ",e)}}isSuggestionModeEnabled(){try{return this.modeService.isEnabled()}catch(e){return this.loggingService.catch("Error in SuggestionActionsService isSuggestionModeEnabled: ",e),!1}}isSuggestionModeEnabled$(){try{return this.modeService.enabled$}catch(e){return this.loggingService.catch("Error in SuggestionActionsService isSuggestionModeEnabled$: ",e),new f}}registerTarget(e){try{if(!e?.targetId||typeof e?.getter!="function")return;this.targetRegistry.registerTarget(e.targetId,e.getter)}catch(t){this.loggingService.catch("Error in SuggestionActionsService registerTarget: ",t)}}unregisterTarget(e){try{this.targetRegistry.unregisterTarget(e)}catch(t){this.loggingService.catch("Error in SuggestionActionsService unregisterTarget: ",t)}}startSuggestion(e){try{let t=this.targetRegistry.getGetter(e);if(t){this.snapshotService.captureFromGetter(e,t);return}let r=this.targetRegistry.getFallbackValue(e);r.hasValue?this.snapshotService.captureValue(e,r.value):this.loggingService.warn(`[velt] startSuggestion: target "${e}" not registered. Cause: no getter via registerTarget() and no textContent fallback. Fix: tag the element with data-velt-suggestion-target and register a getter via registerTarget(). Docs: velt.dev/docs/suggestions/targets`)}catch(t){this.loggingService.catch("Error in SuggestionActionsService startSuggestion: ",t)}}commitSuggestion(e){return new Promise((t,r)=>{try{if(!e?.targetId){r(new Error("INVALID_CONFIG"));return}if(!this.modeService.isEnabled()){this.loggingService.warn("[velt] commitSuggestion called while suggestion mode is disabled. Cause: enableSuggestionMode() has not been called (or disableSuggestionMode() was called). Fix: call enableSuggestionMode() before commit, or branch on isSuggestionModeEnabled() in your onSave handler. Docs: velt.dev/docs/suggestions/mode"),r(new Error("MODE_NOT_SUGGESTING"));return}if(!this.targetRegistry.isRegistered(e.targetId)){this.loggingService.warn(`[velt] commitSuggestion: target "${e.targetId}" not registered. Cause: no element has data-velt-suggestion-target="${e.targetId}" and no registerTarget() call provided a getter. Fix: tag the element or register a getter at app boot. Docs: velt.dev/docs/suggestions/targets`),r(new Error("TARGET_NOT_REGISTERED"));return}if(!this.snapshotService.hasSnapshot(e.targetId)){let g=this.targetRegistry.getGetter(e.targetId);if(g){if(!this.snapshotService.captureFromGetter(e.targetId,g)){r(new Error("SNAPSHOT_FAILED"));return}}else{let d=this.targetRegistry.getFallbackValue(e.targetId);if(d.hasValue)this.snapshotService.captureValue(e.targetId,d.value);else{this.loggingService.warn(`[velt] commitSuggestion: target "${e.targetId}" requires registerTarget() for complex values. Cause: complex objects need a getter so the SDK can deep-clone the snapshot. Fix: call velt.getSuggestionElement().registerTarget("${e.targetId}", () => yourState.${e.targetId}) at app boot. Docs: velt.dev/docs/suggestions/getter`),r(new Error("NO_GETTER_FOR_COMPLEX"));return}}}let h=this.snapshotService.getSnapshot(e.targetId),v=e.newValue;if(w(h,v)){this.loggingService.warn(`[velt] commitSuggestion: no change detected for target "${e.targetId}". Cause: oldValue and newValue are deeply equal. Fix: only call commitSuggestion when the customer actually changed the value. Docs: velt.dev/docs/suggestions/edge-cases`),r(new Error("NO_CHANGE_TO_SUGGEST"));return}let c=new Q;c.type="suggestion",c.suggestion={status:"pending",targetId:e.targetId,targetType:"custom",oldValue:h,newValue:v,summary:e.summary??null,driftDetected:!1,rejectReason:null,resolvedBy:null,resolvedAt:null},c.metadata=e.metadata??{};let T=e.summary??`[${e.targetId}] changed`,b=new Z;if(b.commentText=T,b.commentHtml=`<p>${this.escapeHtml(T)}</p>`,c.comments=[b],!this.commentService){this.loggingService.catch('SuggestionActionsService.commitSuggestion: comment chunk not loaded \u2014 call Snippyly.preloadComment() first or include "comment" in featureAllowList.',new Error("comment chunk unavailable")),r(new Error("comment chunk not loaded"));return}this.commentService.addComment(void 0,void 0,void 0,void 0,!1,[],void 0,void 0,void 0,void 0,void 0,void 0,void 0,g=>{try{this.snapshotService.clearSnapshot(e.targetId),this.projectAndTrigger(l.SUGGESTION_CREATED,g.annotation),t({id:g.annotation.annotationId})}catch(d){this.loggingService.catch("Error in SuggestionActionsService commitSuggestion callback: ",d),r(d)}},void 0,void 0,c,void 0,void 0,!0,void 0,void 0,"internal",void 0)}catch(n){this.loggingService.catch("Error in SuggestionActionsService commitSuggestion: ",n),r(n)}})}getSuggestions(e){try{let t=this.commentService?.getCommentAnnotationsOnCurrentOrganizationAndDocument()??[],r=[];for(let n of t){if(n.type!=="suggestion"||!n.suggestion)continue;let s=this.projectAnnotationToSuggestion(n);s&&this.matchesFilter(s,e)&&r.push(s)}return r}catch(t){return this.loggingService.catch("Error in SuggestionActionsService getSuggestions: ",t),[]}}getSuggestions$(e){try{return this.serviceBook.observe(N).pipe(j(t=>t?t.getCommentAnnotationsOnCurrentOrganizationAndDocument$():F([]))).pipe(G(t=>{let r=[];for(let n of t??[]){if(n.type!=="suggestion"||!n.suggestion)continue;let s=this.projectAnnotationToSuggestion(n);s&&this.matchesFilter(s,e)&&r.push(s)}return r}),C(V))}catch(t){return this.loggingService.catch("Error in SuggestionActionsService getSuggestions$: ",t),new f}}getPendingSuggestion(e){try{if(!e)return null;let t=this.getSuggestions({targetId:e,status:"pending"});return t.length===0?null:t.sort((r,n)=>(n.createdAt??0)-(r.createdAt??0))[0]}catch(t){return this.loggingService.catch("Error in SuggestionActionsService getPendingSuggestion: ",t),null}}getPendingSuggestion$(e){try{return e?this.getSuggestions$({targetId:e,status:"pending"}).pipe(G(t=>t.length===0?null:t.sort((r,n)=>(n.createdAt??0)-(r.createdAt??0))[0]),C(V)):new f}catch(t){return this.loggingService.catch("Error in SuggestionActionsService getPendingSuggestion$: ",t),new f}}triggerAction(e,t){try{this.actionSubjects.has(e)||this.actionSubjects.set(e,new D),this.actionSubjects.get(e)?.next(t)}catch(r){this.loggingService.catch("Error in SuggestionActionsService triggerAction: ",r)}}onAction(e){try{return this.actionSubjects.has(e)||this.actionSubjects.set(e,new D),this.actionSubjects.get(e)?.asObservable()}catch(t){return this.loggingService.catch("Error in SuggestionActionsService onAction: ",t),F(null)}}projectAndTrigger(e,t){try{if(!t||t.type!=="suggestion"||!t.suggestion)return;let r=this.projectAnnotationToSuggestion(t);if(!r)return;let n=this.timestamp;switch(e){case l.SUGGESTION_CREATED:{let s={suggestion:r,timestamp:n};this.triggerAction(l.SUGGESTION_CREATED,s);break}case l.SUGGESTION_APPROVED:{let s={suggestion:r,timestamp:n};this.triggerAction(l.SUGGESTION_APPROVED,s);break}case l.SUGGESTION_REJECTED:{let s={suggestion:r,timestamp:n};this.triggerAction(l.SUGGESTION_REJECTED,s);break}case l.SUGGESTION_STALE:{let s={suggestion:r,timestamp:n};this.triggerAction(l.SUGGESTION_STALE,s);break}}}catch(r){this.loggingService.catch("Error in SuggestionActionsService projectAndTrigger: ",r)}}projectAnnotationToSuggestion(e){try{let t=e.suggestion;if(!t)return;let r={annotationId:e.annotationId,targetId:t.targetId,targetType:t.targetType,oldValue:t.oldValue,newValue:t.newValue,summary:t.summary,metadata:e.metadata??{},driftDetected:!!t.driftDetected,createdBy:e.from,createdAt:e.createdAt??0};switch(t.status){case"pending":return _(R({},r),{status:"pending",rejectReason:null,resolvedBy:null,resolvedAt:null});case"accepted":case"apply_failed":return _(R({},r),{status:t.status,rejectReason:null,resolvedBy:t.resolvedBy,resolvedAt:t.resolvedAt??this.timestamp});case"rejected":return _(R({},r),{status:"rejected",rejectReason:t.rejectReason??null,resolvedBy:t.resolvedBy,resolvedAt:t.resolvedAt??this.timestamp});case"stale":return _(R({},r),{status:"stale",rejectReason:null,resolvedBy:t.resolvedBy,resolvedAt:t.resolvedAt});default:return}}catch(t){this.loggingService.catch("Error in SuggestionActionsService projectAnnotationToSuggestion: ",t);return}}startObservingIfNeeded(){try{if(this.observingActive)return;this.observingActive=!0,this.targetRegistry.startObserving()}catch(e){this.loggingService.catch("Error in SuggestionActionsService startObservingIfNeeded: ",e)}}stopObservingIfNeeded(){try{if(!this.observingActive)return;this.observingActive=!1,this.targetRegistry.stopObserving()}catch(e){this.loggingService.catch("Error in SuggestionActionsService stopObservingIfNeeded: ",e)}}warnIfNoTaggedElements(){try{this.targetRegistry.countTaggedElements()===0&&this.loggingService.warn('[velt] No suggestable elements found on this page. Cause: no DOM elements have a data-velt-suggestion-target attribute. Fix: tag at least one element with data-velt-suggestion-target="your.id" before enabling suggestion mode. Docs: velt.dev/docs/suggestions/getting-started')}catch(e){this.loggingService.catch("Error in SuggestionActionsService warnIfNoTaggedElements: ",e)}}get timestamp(){return this.commonDbService.getServerTimestamp()}matchesFilter(e,t){try{return t?!(t.targetId&&e.targetId!==t.targetId||t.status&&!(Array.isArray(t.status)?t.status:[t.status]).includes(e.status)):!0}catch(r){return this.loggingService.catch("Error in SuggestionActionsService matchesFilter: ",r),!1}}escapeHtml(e){try{return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}catch(t){return this.loggingService.catch("Error in SuggestionActionsService escapeHtml: ",t),""}}};i.\u0275fac=function(t){return new(t||i)(u(E),u(O),u(x),u(ne),u(ee),u(te))},i.\u0275prov=p({token:i,factory:i.\u0275fac,providedIn:"root"});let o=i;return o})();export{Se as a,fe as b,ne as c,Be as d};