@veltdev/sdk
Version:
Velt is an SDK to add collaborative features to your product within minutes. Example: Comments like Figma, Frame.io, Google docs or sheets, Recording like Loom, Huddles like Slack and much more.
1 lines • 78.1 kB
JavaScript
import{A as U,B as T,y as Pt}from"./chunk-3J52NZMN.js";import{a as xt}from"./chunk-4ACOV475.js";import{b as Me,c as ke,d as Ne}from"./chunk-WTYACTR5.js";import{a as Dt}from"./chunk-6E3N35RF.js";import{a as At}from"./chunk-KEM6PWSD.js";import{a as st}from"./chunk-UJRDSNTY.js";import{da as h,ea as Et,fa as R,ga as Ot}from"./chunk-KU45CEXD.js";import{$ as Se,Ab as ye,Bb as be,Bh as Ae,Ca as Qe,Ch as De,Dh as Ct,E as H,Ed as ct,Ee as y,Fa as l,Fc as ot,G as je,Ga as Ve,Gc as A,Gh as K,Ib as nt,Ii as It,J as He,Jb as $,Kb as Z,L as Ge,Le as mt,M as ze,Md as lt,Nb as Ie,Nd as ut,Nf as dt,Of as pt,Pa as m,Pb as xe,Pc as at,Pf as gt,Sg as vt,T as I,Ta as Ze,Tg as ht,Ua as O,Ug as ft,Va as et,W as ce,We as Pe,X as Je,Ya as D,_a as u,_b as N,a as g,aa as Ye,b as f,bc as C,bi as G,ca as L,cc as x,ci as Ue,db as P,di as v,ec as F,ei as St,g as ae,ha as qe,ia as Ke,ja as $e,kc as Ee,l as se,lb as a,lc as Oe,li as Te,mb as _,mi as we,nb as b,ob as k,oe as q,p as ie,pc as it,qa as _e,r as B,sb as d,tb as p,ti as _t,ua as Xe,v as j,vb as tt,vh as oe,wa as E,xb as rt,yi as yt,zb as c,zi as bt}from"./chunk-GR3NESUB.js";var ee=(()=>{let i=class i{constructor(e,t,o,s,S,M,re,ne,Le,$t,Vt){this.analyticsService=e,this.configService=t,this.docService=o,this.afAuth=s,this.iamService=S,this.domService=M,this.databaseService=re,this.authService=ne,this.loggingService=Le,this.commonDbService=$t,this.serviceBook=Vt,this.cursorUser$=new se(new Pe),this.documentPaths=null,this.inactivityTime=120*1e3,this.allowedElementIds$=new se([]),this.cursorTagAvailable$=new se(!1),this.cursorTagAvailable=!1,this.cursorUsers$=new se([]),this.loggingService.log("%c[WB] Creating CLASS: CursorService","color: blue;");try{this.serviceBook.set(Ae,this),this.checkCursorTagAvailable(),this.databaseService.getDb().pipe(H(W=>!!W),I(W=>this.cursorTagAvailable$.pipe(H(Y=>!!Y),He(1),j(()=>W))),He(1)).subscribe(W=>{W&&this.cursorTagAvailable&&(this.getPresenceUser(),this.getDocumentPaths(),this.getLocation(),this.updateOnDatabaseDisconnect().subscribe(()=>{},Y=>{this.loggingService.catch("Error in CursorService constructor updateOnDatabaseDisconnect: ",Y)}),this.addMouseMoveListener(),this.addScreenSizeChangeListener(),this.updateOnAllowedFeatureListChange())},W=>{this.loggingService.catch("Error in CursorService constructor getDb: ",W)}),this.cursorUsers$.pipe(ze()).subscribe(([W,Y])=>{sessionStorage.getItem(y.SESSION_STORAGE.VELT_CURSOR_MULTIPLE_USERS_DETECTED)||Y?.length>1&&W.length!==Y.length&&(this.analyticsService.trackEvent(oe.Events.Cursor.CURSOR_MULTIPLE_USERS_DETECTED,{totalUsers:Y.length,cursorSnippylyUserIds:Y.map(Be=>Be.userSnippylyId),cursorClientUserIds:Y.map(Be=>Be.userId)}),sessionStorage.setItem(y.SESSION_STORAGE.VELT_CURSOR_MULTIPLE_USERS_DETECTED,"true"))}),this.authService.addPreSignOutFuction("cursor-signout",this.signOutUser.bind(this))}catch(W){this.loggingService.catch("Error in CursorService constructor: ",W)}}checkCursorTagAvailable(){this.loggingService.log("%c[WB] Calling FUNCTION: checkCursorTagAvailable","color: green;");try{this.cursorTagAvailable=!!document.querySelector(y.TAGS.VELT_CURSOR)||!!document.querySelector(y.TAGS.SNIPPYLY_CURSOR),this.cursorTagAvailable$.next(this.cursorTagAvailable)}catch(e){this.loggingService.catch("Error in CursorService checkCursorTagAvailable: ",e)}}addScreenSizeChangeListener(){this.loggingService.log("%c[WB] Calling FUNCTION: addScreenSizeChangeListener","color: green;");try{this.docService.getDocumentPaths$().pipe(H(e=>!!e),I(e=>this.domService.getCurrentWindowSize$("CursorService addScreenSizeChangeListener").pipe(H(t=>!!t)))).subscribe(e=>{this.setCurrentCursorUserScreenSize(e)},e=>{this.loggingService.catch("Error in addScreenSizeChangeListener getCurrentWindowSize: ",e)})}catch(e){this.loggingService.catch("Error in CursorService addScreenSizeChangeListener: ",e)}}addMouseMoveListener(){this.loggingService.log("%c[WB] Calling FUNCTION: addMouseMoveListener","color: green;");try{this.domService.onWindowPointerMove$().pipe(Je(50)).subscribe(e=>{e&&this.setCurrentCursorUserPosition(e.pageX,e.pageY,this.domService.getTargetElementForCursorPosition(e,!0,!1,!1,void 0,!1))},e=>{this.loggingService.catch("Error in addMouseMoveListener getCurrentMousePosition: ",e)})}catch(e){this.loggingService.catch("Error in CursorService addMouseMoveListener: ",e)}}getDocumentPaths(){this.loggingService.log("%c[WB] Calling FUNCTION: getDocumentPaths","color: green;");try{this.docService.getDocumentPaths$().pipe(ce(e=>{this.documentPaths=e}),ze(),ce(([e,t])=>{e&&this.updateUserStatusOnDocumentChange(y.PRESENCE_STATUS_OFFLINE,e),t&&this.updateUserStatusOnDocumentChange(y.PRESENCE_STATUS_ONLINE,t)})).subscribe(()=>{},e=>{this.loggingService.catch("Error in getDocumentPaths subscription: ",e)})}catch(e){this.loggingService.catch("Error in CursorService getDocumentPaths: ",e)}}getLocation(){try{this.docService.getLocation$().pipe(ce(e=>{this.updateUserOnLocationChange(e)})).subscribe(()=>{},e=>{this.loggingService.catch("Error in getLocation subscription: ",e)})}catch(e){this.loggingService.catch("Error in CursorService getLocation: ",e)}}getCursorUser(){return this.loggingService.log("%c[WB] Calling FUNCTION: getCursorUser","color: green;"),this.cursorUser$.asObservable()}getPresenceUser(){this.loggingService.log("%c[WB] Calling FUNCTION: getPresenceUser","color: green;"),this.serviceBook.observe(Ct).pipe(H(e=>!!e),I(e=>e.getPresenceUser()),H(e=>!!e),je(e=>B(e.code))).subscribe(e=>{this.setCursorUser(e)},e=>{this.loggingService.catch("Error in getPresenceUser: ",e)})}getLiveCursorsOnCurrentDocument(){return this.loggingService.log("%c[WB] Calling FUNCTION: getLiveCursorsOnCurrentDocument","color: green;"),this.authService.getAuthState$().pipe(H(e=>!!e),I(e=>this.isFeatureAllowed({firebaseUser:e,users:[],filteredUsers:[]})),I(e=>e.featureAllowed?this.iamService.isUserAllowed$().pipe(j(t=>(e.featureAllowed=t,e))):B(e)),I(e=>e.featureAllowed?this.authService.isPlanExpired$().pipe(j(t=>(e.featureAllowed=!t,e))):B(e)),I(e=>!e.featureAllowed||e?.user?.isAnonymous?B([]):B(e).pipe(I(t=>this.docService.getDocumentPaths$().pipe(j(o=>(this.documentPaths=o,t.documentPaths=o,t)))),I(t=>this.getDataFromDocumentId().pipe(j(o=>(t.users=o||[],g({},t))))),j(t=>(t.filteredUsers=this.filterOnlineUsers(t.users,t.firebaseUser),t)),I(t=>t?.filteredUsers?.length?this.domService.getCurrentWindowSize$("CursorService getLiveCursorsOnCurrentDocument").pipe(j(()=>t)):B(t)),j(t=>(t?.filteredUsers?.forEach(o=>{this.calculateCursorUserPosition(o)}),t)),I(t=>t?.filteredUsers?B(t?.filteredUsers||[]):B([])))))}isFeatureAllowed(e){return this.configService.getConfig$().pipe(H(t=>!!t),j(t=>f(g({},e),{config:t})),I(t=>this.authService.getUser$().pipe(j(o=>f(g({},t),{user:o})))),I(t=>dt(t.config,t.user,q.CURSOR)?B(f(g({},t),{featureAllowed:!0})):(this.loggingService.warn("Cursor feature is not allowed."),B(f(g({},t),{featureAllowed:!1})))),Ge((t,o)=>t?.featureAllowed===o?.featureAllowed))}getDataFromDocumentId(e){return this.databaseService.getDb().pipe(H(t=>!!t),I(t=>{if(this.configService?.getApiKey()&&this.documentPaths?.cursor){let o=new Date(Date.now()-864e5).getTime();return this.commonDbService.dbListener({feature:"allCursors",properties:{documentId:e??this.documentPaths?.documentId,organizationId:this.documentPaths?.organizationId,skipFirestore:!0,useQuery:!0,rtdbQuery:[lt("timestamp"),ut(o)]}}).pipe(je(s=>(this.loggingService.catch("Error in CursorService getDataFromDocumentId: ",s),B(null))),j(s=>s?.data),j(s=>{let S=[];return s&&(S=Object.values(s).filter(M=>typeof M=="object")),S}))}else return B([])}))}calculateCursorUserPosition(e){try{if(e?.targetElement){let t=this.domService.getXPath(e.targetElement?.xpath);if(t){let o=t.iterateNext();if(o&&this.isElementInsideAllowedElements(o)){let s=o.getBoundingClientRect();s&&s.width&&s.height&&(e.position={top:s.top+s.height*e.targetElement.topPercentage/100,left:s.left+s.width*e.targetElement.leftPercentage/100})}}}}catch(t){this.loggingService.catch("Error in calculateCursorUserPosition:",t)}}filterOnlineUsers(e,t){try{let s=e.slice().filter(M=>{let re=gt(M.timestamp);return M.userSnippylyId&&M.onlineStatus===y.PRESENCE_STATUS_ONLINE&&re<this.inactivityTime});this.cursorUsers$.next(s),s=s.filter(M=>M?.userSnippylyId!==t?.uid);let S=this.docService.getLocation();return S&&S.locationId?s=s.filter(M=>M.locationId===S.locationId):s=s.filter(M=>!M.locationId),s}catch(o){return this.loggingService.catch("Error in filterOnlineUsers:",o),[]}}setCursorUser(e){this.loggingService.log("%c[WB] Calling FUNCTION: setCursorUser","color: green;");try{let t=this.cursorUser$.value;t.userId=e?.userId,t.name=e?.name,t.email=e?.email,t.photoUrl=e?.photoUrl,t.comment="",this.authService.isFeatureAllowed(q.PRESENCE)&&(t.onlineStatus=e?.onlineStatus),t.userSnippylyId=e?.userSnippylyId,t.color=e?.color,t.textColor=e?.textColor,t.initial=e?.initial,t.timestamp=this.timestamp,t.type=e?.type,t.isReadOnly=e?.isReadOnly,t.isAnonymous=e?.isAnonymous;let o=this.domService.getCurrentWindowSizeValue();t.screenWidth=o?.screenWidth,t.screenHeight=o?.screenHeight,t.screenScrollHeight=o?.screenScrollHeight,this.updateCurrentCursorUser(t)}catch(t){this.loggingService.catch("Error in setCursorUser:",t)}}setCurrentCursorUserPosition(e,t,o){try{let s=this.cursorUser$.value;s?.onlineStatus===y.PRESENCE_STATUS_ONLINE&&(s.positionX=e,s.positionY=t,o?s.targetElement=o:s.targetElement=null,this.updateCurrentCursorUser(s))}catch(s){this.loggingService.catch("Error in setCurrentCursorUserPosition:",s)}}setCurrentCursorUserScreenSize(e){try{if(e.screenWidth!==0&&e.screenHeight!==0){let t=this.cursorUser$.value;t?.onlineStatus===y.PRESENCE_STATUS_ONLINE&&(t.screenWidth=e.screenWidth,t.screenHeight=e.screenHeight,t.screenScrollHeight=e.screenScrollHeight,this.updateCurrentCursorUser(t))}}catch(t){this.loggingService.catch("Error in setCurrentCursorUserScreenSize:",t)}}updateCurrentCursorUser(e){return ae(this,null,function*(){try{if(this.documentPaths&&e&&e.userId&&this.authService.isFeatureAllowed(q.CURSOR)){if(!e.isAnonymous){e.pageInfo=new mt;let t=JSON.parse(JSON.stringify(e));this.commonDbService.updateData({feature:"cursor",properties:{documentId:this.documentPaths?.documentId??"",organizationId:this.documentPaths?.organizationId??"",id:e.userSnippylyId,skipFirestore:!0},data:JSON.parse(JSON.stringify(f(g({},t),{timestamp:this.timestamp})))})}this.cursorUser$.next(e)}}catch(t){this.loggingService.catch("Error in updateCurrentCursorUser:",t)}})}updateUserStatusOnDocumentChange(e,t){return ae(this,null,function*(){this.loggingService.log("%c[WB] Calling FUNCTION: updateUserStatusOnDocumentChange","color: green;");try{let o=this.cursorUser$.value;if(o.onlineStatus=e,t&&o&&o.userId&&!o.isAnonymous&&this.authService.isFeatureAllowed(q.CURSOR)){let s=JSON.parse(JSON.stringify(o));this.commonDbService.updateData({feature:"cursor",properties:{documentId:t?.documentId??"",organizationId:t?.organizationId??"",id:o.userSnippylyId,skipFirestore:!0},data:JSON.parse(JSON.stringify(f(g({},s),{timestamp:this.timestamp})))})}}catch(o){this.loggingService.catch("Error in updateUserStatusOnDocumentChange:",o)}})}updateUserOnLocationChange(e){return ae(this,null,function*(){this.loggingService.log("%c[WB] Calling FUNCTION: updateUserOnLocationChange","color: green;");try{let t=this.cursorUser$.value;if(t.location=e?e.location:null,t.locationId=e?e?.locationId:null,this.documentPaths&&t&&t.userId&&!t.isAnonymous&&this.authService.isFeatureAllowed(q.CURSOR)){let o=JSON.parse(JSON.stringify(t));this.commonDbService.updateData({feature:"cursor",properties:{documentId:this.documentPaths?.documentId??"",organizationId:this.documentPaths?.organizationId??"",id:t.userSnippylyId,skipFirestore:!0},data:JSON.parse(JSON.stringify(f(g({},o),{timestamp:this.timestamp})))})}}catch(t){this.loggingService.catch("Error in updateUserOnLocationChange:",t)}})}updateOnAllowedFeatureListChange(){try{this.configService.getConfig$().subscribe(e=>{if(e&&e.featureAllowList?.length){let t=this.cursorUser$.value,o=!1;if(e.featureAllowList.includes(q.CURSOR)?t?.onlineStatus!==y.PRESENCE_STATUS_ONLINE&&(t.onlineStatus=y.PRESENCE_STATUS_ONLINE,o=!0):t?.onlineStatus!==y.PRESENCE_STATUS_OFFLINE&&(t.onlineStatus=y.PRESENCE_STATUS_OFFLINE,o=!0),o&&this.documentPaths&&t&&t.userId&&!t.isAnonymous){let s=JSON.parse(JSON.stringify(t));this.commonDbService.updateData({feature:"cursor",properties:{documentId:this.documentPaths?.documentId??"",organizationId:this.documentPaths?.organizationId??"",id:t.userSnippylyId,skipFirestore:!0},data:JSON.parse(JSON.stringify(f(g({},s),{timestamp:this.timestamp})))})}}})}catch(e){this.loggingService.catch("Error in updateOnAllowedFeatureListChange:",e)}}updateOnDatabaseDisconnect(){return this.loggingService.log("%c[WB] Calling FUNCTION: updateOnDatabaseDisconnect","color: green;"),this.authService.getAuthState$().pipe(H(e=>!!e),I(e=>this.docService.getDocumentPaths$().pipe(j(t=>e))),ce(e=>ae(this,null,function*(){try{if(this.documentPaths&&e){let t=yield this.authService.getIdTokenResultForUser(e,!0).catch(s=>null);if(!t)return;let{user:o}=t.claims;if(!o?.isAnonymous&&this.documentPaths?.cursor){let s=`${this.documentPaths.cursor}/${e.uid}`;this.commonDbService.setupOnDisconnect(s,{onlineStatus:y.PRESENCE_STATUS_OFFLINE,comment:"",timestamp:this.timestamp}).catch(S=>{this.loggingService.catch("Error in updateOnDatabaseDisconnect:",S)})}}}catch(t){this.loggingService.catch("Error in updateOnDatabaseDisconnect:",t)}})))}signOutUser(e){return new Promise((t,o)=>{try{this.documentPaths&&e?this.commonDbService.getData({feature:"cursor",properties:{documentId:this.documentPaths?.documentId,organizationId:this.documentPaths?.organizationId,id:e.uid,skipFirestore:!0}}).then(s=>{s&&this.commonDbService.updateData({feature:"cursor",properties:{documentId:this.documentPaths?.documentId??"",organizationId:this.documentPaths?.organizationId??"",id:e.uid,skipFirestore:!0},callback:()=>{t(null)},data:JSON.parse(JSON.stringify(f(g({},s?.data??{}),{timestamp:this.timestamp,onlineStatus:y.PRESENCE_STATUS_OFFLINE})))}),t(null)}).catch(s=>{this.loggingService.catch("Error in signOutUser subscription: ",s),o(s)}):t(null)}catch(s){this.loggingService.catch("Error in signOutUser:",s),o(s)}})}setInactivityTime(e){this.inactivityTime=e,this.analyticsService.trackEvent(oe.Events.Cursor.CURSOR_SET_CUSTOM_INACTIVITY_TIMER,{inactivityTime:this.inactivityTime})}setAllowedElementIds(e){this.allowedElementIds$.next(e||[])}getAllowedElementIds(){return this.allowedElementIds$.asObservable()}isElementInsideAllowedElements(e){try{return this.domService.isElementInsideListedElementIds(e,this.allowedElementIds$.value)}catch(t){return this.loggingService.catch("Error in CursorService isElementInsideAllowedElements: ",t),!1}}get timestamp(){return this.commonDbService.getServerTimestamp()}};i.\u0275fac=function(t){return new(t||i)(L(Ue),L(St),L(yt),L(ct),L(At),L(Te),L(_t),L(we),L(v),L(It),L(G))},i.\u0275prov=Se({token:i,factory:i.\u0275fac,providedIn:"root"});let r=i;return r})();var w=class{constructor(){this.showDefault=!1,this.showAvatar=!1,this.showAudio=!1,this.showVideo=!1,this.selfCursorPointer=!1,this.onImageLoadError=()=>{},this.getGainAnimationBorderStyle=()=>{},this.getTextColor=()=>{}}};var qt=["*"],Ut=r=>({componentConfigSignal:r}),Kt=(r,i)=>({condition:r,data:i}),Xt=(r,i,n,e)=>({template:r,context:i,componentName:"velt-cursor-pointer-arrow-wireframe",setIfCondition:n,componentElementRef:e});function Qt(r,i){r&1&&(d(0),be(1),p())}function Zt(r,i){if(r&1&&(d(0),u(1,Qt,2,0,"ng-container",2),p()),r&2){let n=c(2);l(),a("veltDynamicTemplate",F(3,Xt,n.template,C(1,Ut,n.componentConfigSignal),n.setIfCondition.bind(n),n.elementRef))}}function er(r,i){if(r&1&&(d(0),u(1,Zt,2,8,"ng-container",1),p()),r&2){let n=c();l(),a("veltIf",x(3,Kt,n.conditionSignal(),C(1,Ut,n.componentConfigSignal)))}}var le=(()=>{let i=class i extends R{constructor(e,t,o){super(t,o,e),this.loggingService=e,this.elementRef=t,this.dynamicDataService=o,this.componentId="velt-cursor-pointer-arrow",super.initializeComponentConfigSignal(new w)}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in CursorPointerArrowComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in CursorPointerArrowComponent ngOnDestroy:",e)}}setupA11yAttributes(){try{let e=this.elementRef.nativeElement;e.setAttribute("data-testid",this.componentId+"-container"),e.setAttribute("role","img"),e.setAttribute("aria-label","Directional cursor arrow"),e.setAttribute("aria-describedby","Cursor pointer with directional arrow indicator")}catch(e){this.loggingService.catch("Error in CursorPointerArrowComponent setupA11yAttributes:",e)}}};i.\u0275fac=function(t){return new(t||i)(m(v),m(E),m(h))},i.\u0275cmp=O({type:i,selectors:[["velt-cursor-pointer-arrow-internal"]],standalone:!1,features:[N([h]),D],ngContentSelectors:qt,decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],[4,"veltDynamicTemplate"]],template:function(t,o){t&1&&(ye(),u(0,er,2,6,"ng-container",0)),t&2&&a("ngIf",o.componentConfigSignal())},dependencies:[A,T,U],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{display:flex}[_nghost-%COMP%]:empty{display:none}"],changeDetection:0});let r=i;return r})();var Tt=r=>({componentConfigSignal:r}),rr=(r,i)=>({condition:r,data:i}),nr=(r,i,n,e)=>({template:r,context:i,componentName:"velt-cursor-pointer-audio-huddle-audio-wireframe",setIfCondition:n,componentElementRef:e});function ir(r,i){if(r&1&&(d(0),k(1,"audio",3),p()),r&2){let n=c(2).ngIf;l(),a("srcObject",n.stream)("volume",n.selfCursorPointer?0:1)}}function or(r,i){if(r&1&&(d(0),u(1,ir,2,2,"ng-container",2),p()),r&2){let n=c(2);l(),a("veltDynamicTemplate",F(3,nr,n.template,C(1,Tt,n.componentConfigSignal),n.setIfCondition.bind(n),n.elementRef))}}function ar(r,i){if(r&1&&(d(0),u(1,or,2,8,"ng-container",1),p()),r&2){let n=c();l(),a("veltIf",x(3,rr,n.conditionSignal(),C(1,Tt,n.componentConfigSignal)))}}var ue=(()=>{let i=class i extends R{constructor(e,t,o){super(t,o,e),this.loggingService=e,this.elementRef=t,this.dynamicDataService=o,this.componentId="velt-cursor-pointer-audio-huddle-audio",super.initializeComponentConfigSignal(new w)}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in CursorPointerAudioHuddleAudioComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in CursorPointerAudioHuddleAudioComponent ngOnDestroy:",e)}}setupA11yAttributes(){try{let e=this.elementRef.nativeElement;e.setAttribute("data-testid",this.componentId+"-container"),e.setAttribute("role","img"),e.setAttribute("aria-label","Audio huddle cursor pointer"),e.setAttribute("aria-describedby","User cursor with audio huddle controls"),e.setAttribute("aria-live","polite")}catch(e){this.loggingService.catch("Error in CursorPointerAudioHuddleAudioComponent setupA11yAttributes:",e)}}};i.\u0275fac=function(t){return new(t||i)(m(v),m(E),m(h))},i.\u0275cmp=O({type:i,selectors:[["velt-cursor-pointer-audio-huddle-audio-internal"]],standalone:!1,features:[N([h]),D],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],[4,"veltDynamicTemplate"],["playsinline","","autoplay","true",3,"srcObject","volume"]],template:function(t,o){t&1&&u(0,ar,2,6,"ng-container",0),t&2&&a("ngIf",o.componentConfigSignal())},dependencies:[A,T,U],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{display:flex}[_nghost-%COMP%]:empty{display:none}"],changeDetection:0});let r=i;return r})();var wt=(r,i)=>({componentConfigSignal:r,user:i}),cr=(r,i)=>({condition:r,data:i}),lr=(r,i,n,e)=>({template:r,context:i,componentName:"velt-cursor-pointer-audio-huddle-avatar-wireframe",setIfCondition:n,componentElementRef:e});function ur(r,i){if(r&1&&(d(0),k(1,"snippyly-user-avatar",3),p()),r&2){let n=c(2).ngIf;l(),a("user",n.cursorUser)}}function mr(r,i){if(r&1&&(d(0),u(1,ur,2,1,"ng-container",2),p()),r&2){let n=c().ngIf,e=c();l(),a("veltDynamicTemplate",F(4,lr,e.template,x(1,wt,e.componentConfigSignal,n.cursorUser),e.setIfCondition.bind(e),e.elementRef))}}function dr(r,i){if(r&1&&(d(0),u(1,mr,2,9,"ng-container",1),p()),r&2){let n=i.ngIf,e=c();l(),a("veltIf",x(4,cr,e.conditionSignal(),x(1,wt,e.componentConfigSignal,n.cursorUser)))}}var me=(()=>{let i=class i extends R{constructor(e,t,o){super(t,o,e),this.loggingService=e,this.elementRef=t,this.dynamicDataService=o,this.componentId="velt-cursor-pointer-audio-huddle-avatar",super.initializeComponentConfigSignal(new w)}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in CursorPointerAudioHuddleAvatarComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in CursorPointerAudioHuddleAvatarComponent ngOnDestroy:",e)}}setupA11yAttributes(){try{let e=this.elementRef.nativeElement;e.setAttribute("data-testid",this.componentId+"-container"),e.setAttribute("role","img"),e.setAttribute("aria-label","Audio huddle avatar cursor pointer"),e.setAttribute("aria-describedby","User avatar in audio huddle at cursor location"),e.setAttribute("aria-live","polite")}catch(e){this.loggingService.catch("Error in CursorPointerAudioHuddleAvatarComponent setupA11yAttributes:",e)}}};i.\u0275fac=function(t){return new(t||i)(m(v),m(E),m(h))},i.\u0275cmp=O({type:i,selectors:[["velt-cursor-pointer-audio-huddle-avatar-internal"]],standalone:!1,features:[N([h]),D],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],[4,"veltDynamicTemplate"],[3,"user"]],template:function(t,o){t&1&&u(0,dr,2,7,"ng-container",0),t&2&&a("ngIf",o.componentConfigSignal())},dependencies:[A,T,U,Ne],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{display:flex}[_nghost-%COMP%]:empty{display:none}snippyly-user-avatar[_ngcontent-%COMP%]{position:absolute;--legacy-velt-avatar-size: var(--legacy-velt-cursor-video-size)}snippyly-user-avatar[_ngcontent-%COMP%] .s-user-avatar-container[_ngcontent-%COMP%]{width:calc((var(--legacy-velt-cursor-video-size) + 0px) * var(--velt-base-rem-unit));height:calc((var(--legacy-velt-cursor-video-size) + 0px) * var(--velt-base-rem-unit));border-radius:0;max-width:100%;max-height:100%}snippyly-user-avatar[_ngcontent-%COMP%] .s-user-avatar-container[_ngcontent-%COMP%] .s-user-avatar-initial[_ngcontent-%COMP%]:after{font-size:var(--velt-font-size-2xl)}"],changeDetection:0});let r=i;return r})();var Mt=r=>({componentConfigSignal:r}),gr=(r,i)=>({condition:r,data:i}),vr=(r,i,n,e)=>({template:r,context:i,componentName:"velt-cursor-pointer-audio-huddle-wireframe",setIfCondition:n,componentElementRef:e});function hr(r,i){if(r&1&&(d(0),_(1,"div",6),k(2,"velt-cursor-pointer-audio-huddle-avatar-internal",7)(3,"velt-cursor-pointer-audio-huddle-audio-internal",7),b(),p()),r&2){let n=c(4);l(2),a("componentConfigSignal",n.componentConfigSignal),l(),a("componentConfigSignal",n.componentConfigSignal)}}function fr(r,i){if(r&1&&(_(0,"div",3)(1,"div",4),u(2,hr,4,2,"ng-container",5),b()()),r&2){let n=c(2).ngIf,e=c();P("data-testid",e.componentId+"-spacing"),l(),$("background",n.cursorUser==null?null:n.cursorUser.color)("border",n.gainVolume&&n.lightenedColor?n.getGainAnimationBorderStyle():""),P("data-testid",e.componentId),l(),a("veltDynamicTemplate",F(9,vr,e.template,C(7,Mt,e.componentConfigSignal),e.setIfCondition.bind(e),e.elementRef))}}function Cr(r,i){if(r&1&&(d(0),u(1,fr,3,14,"ng-template",2),p()),r&2){let n=c().ngIf;l(),a("ngIf",n.showAudio)}}function Sr(r,i){if(r&1&&(d(0),u(1,Cr,2,1,"ng-container",1),p()),r&2){let n=c();l(),a("veltIf",x(3,gr,n.conditionSignal(),C(1,Mt,n.componentConfigSignal)))}}var de=(()=>{let i=class i extends R{constructor(e,t,o){super(t,o,e),this.loggingService=e,this.elementRef=t,this.dynamicDataService=o,this.componentId="velt-cursor-pointer-audio-huddle",super.initializeComponentConfigSignal(new w)}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in CursorPointerAudioHuddleComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in CursorPointerAudioHuddleComponent ngOnDestroy:",e)}}setupA11yAttributes(){try{let e=this.elementRef.nativeElement;e.setAttribute("data-testid",this.componentId+"-container"),e.setAttribute("role","img"),e.setAttribute("aria-label","Audio call cursor pointer"),e.setAttribute("aria-describedby","User cursor with audio call indicator"),e.setAttribute("aria-live","polite")}catch(e){this.loggingService.catch("Error in CursorPointerAudioHuddleComponent setupA11yAttributes:",e)}}};i.\u0275fac=function(t){return new(t||i)(m(v),m(E),m(h))},i.\u0275cmp=O({type:i,selectors:[["velt-cursor-pointer-audio-huddle-internal"]],standalone:!1,features:[N([h]),D],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],[3,"ngIf"],[1,"velt-cursor-pointer-audio-huddle-spacing","s-cursor-video-spacing"],[1,"velt-cursor-pointer-audio-huddle-container","s-cursor-video-container"],[4,"veltDynamicTemplate"],[1,"velt-cursor-pointer-audio-huddle-block","s-cursor-video-block"],[3,"componentConfigSignal"]],template:function(t,o){t&1&&u(0,Sr,2,6,"ng-container",0),t&2&&a("ngIf",o.componentConfigSignal())},dependencies:[A,T,U,ue,me],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{display:flex}[_nghost-%COMP%]:empty{display:none}.velt-cursor-pointer-audio-huddle-spacing[_ngcontent-%COMP%]{width:calc((var(--legacy-velt-cursor-video-size) + 16px) * var(--velt-base-rem-unit));height:calc((var(--legacy-velt-cursor-video-size) + 16px) * var(--velt-base-rem-unit));display:flex;justify-content:center;align-items:center;position:absolute;top:calc((.4rem + 0px) * var(--velt-base-rem-unit));left:calc((.4rem + 0px) * var(--velt-base-rem-unit));background:transparent}.velt-cursor-pointer-audio-huddle-container[_ngcontent-%COMP%]{width:calc((var(--legacy-velt-cursor-video-size) + 0px) * var(--velt-base-rem-unit));height:calc((var(--legacy-velt-cursor-video-size) + 0px) * var(--velt-base-rem-unit));box-sizing:content-box;padding:var(--velt-spacing-2xs);border-radius:var(--velt-border-radius-full);box-shadow:0 1px 4px #10101036}.velt-cursor-pointer-audio-huddle-container[_ngcontent-%COMP%] .velt-cursor-pointer-audio-huddle-block[_ngcontent-%COMP%]{position:relative;width:100%;height:100%}"],changeDetection:0});let r=i;return r})();var kt=r=>({componentConfigSignal:r}),yr=(r,i)=>({condition:r,data:i}),br=(r,i,n,e)=>({template:r,context:i,componentName:"velt-cursor-pointer-avatar-wireframe",setIfCondition:n,componentElementRef:e});function Ir(r,i){if(r&1){let n=tt();d(0),_(1,"img",5),rt("error",function(){qe(n);let t=c(3).ngIf;return Ke(t.onImageLoadError())}),b(),p()}if(r&2){let n=c(3).ngIf;l(),a("src",n.cursorUser==null?null:n.cursorUser.photoUrl,Qe)}}function xr(r,i){if(r&1&&(_(0,"div",3),u(1,Ir,2,1,"ng-container",4),b()),r&2){let n=c(2).ngIf,e=c();$("background-color",n.cursorUser==null?null:n.cursorUser.color),Z("user-presence-text-container-comment-border",n.cursorUser==null?null:n.cursorUser.comment)("velt-cursor-pointer-avatar-container-comment-border",n.cursorUser==null?null:n.cursorUser.comment),P("data-testid",e.componentId),l(),a("veltDynamicTemplate",F(10,br,e.template,C(8,kt,e.componentConfigSignal),e.setIfCondition.bind(e),e.elementRef))}}function Er(r,i){if(r&1&&(d(0),u(1,xr,2,15,"ng-template",2),p()),r&2){let n=c().ngIf;l(),a("ngIf",n.showAvatar)}}function Or(r,i){if(r&1&&(d(0),u(1,Er,2,1,"ng-container",1),p()),r&2){let n=c();l(),a("veltIf",x(3,yr,n.conditionSignal(),C(1,kt,n.componentConfigSignal)))}}var pe=(()=>{let i=class i extends R{constructor(e,t,o){super(t,o,e),this.loggingService=e,this.elementRef=t,this.dynamicDataService=o,this.componentId="velt-cursor-pointer-avatar",super.initializeComponentConfigSignal(new w)}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in CursorPointerAvatarComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in CursorPointerAvatarComponent ngOnDestroy:",e)}}setupA11yAttributes(){try{let e=this.elementRef.nativeElement;e.setAttribute("data-testid",this.componentId+"-container"),e.setAttribute("role","img"),e.setAttribute("aria-label","User avatar cursor pointer"),e.setAttribute("aria-describedby","Shows user profile picture at cursor location")}catch(e){this.loggingService.catch("Error in CursorPointerAvatarComponent setupA11yAttributes:",e)}}};i.\u0275fac=function(t){return new(t||i)(m(v),m(E),m(h))},i.\u0275cmp=O({type:i,selectors:[["velt-cursor-pointer-avatar-internal"]],standalone:!1,features:[N([h]),D],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],[3,"ngIf"],[1,"velt-cursor-pointer-avatar-container","user-avatar-container"],[4,"veltDynamicTemplate"],[3,"error","src"]],template:function(t,o){t&1&&u(0,Or,2,6,"ng-container",0),t&2&&a("ngIf",o.componentConfigSignal())},dependencies:[A,T,U],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{display:flex}[_nghost-%COMP%]:empty{display:none}.velt-cursor-pointer-avatar-container[_ngcontent-%COMP%]{width:calc((var(--legacy-velt-cursor-avatar-size) + 0px) * var(--velt-base-rem-unit));height:calc((var(--legacy-velt-cursor-avatar-size) + 0px) * var(--velt-base-rem-unit));box-shadow:0 1px 4px #10101036;transform:translate(calc((1.2rem + 0px) * var(--velt-base-rem-unit))) translateY(calc((-.7rem + 0px) * var(--velt-base-rem-unit)));padding:calc((.08rem + 0px) * var(--velt-base-rem-unit));border-radius:var(--velt-border-radius-full)}.velt-cursor-pointer-avatar-container[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:100%;height:100%;border-radius:100%}.velt-cursor-pointer-avatar-container-comment-border[_ngcontent-%COMP%]{border-bottom-left-radius:var(--velt-border-radius-xl);border-bottom-right-radius:var(--velt-border-radius-xl);border-top-right-radius:var(--velt-border-radius-xl);margin-top:calc(var(--velt-spacing-sm) * -1)}"],changeDetection:0});let r=i;return r})();var Nt=r=>({componentConfigSignal:r}),Dr=(r,i)=>({condition:r,data:i}),Ur=(r,i,n,e)=>({template:r,context:i,componentName:"velt-cursor-pointer-default-comment-wireframe",setIfCondition:n,componentElementRef:e});function Tr(r,i){if(r&1&&(d(0),Ie(1),Ee(2,"translate"),p()),r&2){let n=c(3).ngIf;l(),xe(" ",Oe(2,1,n.cursorUser==null?null:n.cursorUser.comment)," ")}}function wr(r,i){if(r&1&&(_(0,"p",3),u(1,Tr,3,3,"ng-container",4),b()),r&2){let n=c(3);P("data-testid",n.componentId),l(),a("veltDynamicTemplate",F(4,Ur,n.template,C(2,Nt,n.componentConfigSignal),n.setIfCondition.bind(n),n.elementRef))}}function Mr(r,i){if(r&1&&(d(0),u(1,wr,2,9,"p",2),p()),r&2){let n=c().ngIf;l(),a("ngIf",n.cursorUser==null?null:n.cursorUser.comment)}}function kr(r,i){if(r&1&&(d(0),u(1,Mr,2,1,"ng-container",1),p()),r&2){let n=c();l(),a("veltIf",x(3,Dr,n.conditionSignal(),C(1,Nt,n.componentConfigSignal)))}}var ge=(()=>{let i=class i extends R{constructor(e,t,o){super(t,o,e),this.loggingService=e,this.elementRef=t,this.dynamicDataService=o,this.componentId="velt-cursor-pointer-default-comment",super.initializeComponentConfigSignal(new w)}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in CursorPointerDefaultCommentComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in CursorPointerDefaultCommentComponent ngOnDestroy:",e)}}setupA11yAttributes(){try{let e=this.elementRef.nativeElement;e.setAttribute("data-testid",this.componentId+"-container"),e.setAttribute("role","img"),e.setAttribute("aria-label","Cursor pointer with comment indicator"),e.setAttribute("aria-describedby","Shows comment activity at cursor location")}catch(e){this.loggingService.catch("Error in CursorPointerDefaultCommentComponent setupA11yAttributes:",e)}}};i.\u0275fac=function(t){return new(t||i)(m(v),m(E),m(h))},i.\u0275cmp=O({type:i,selectors:[["velt-cursor-pointer-default-comment-internal"]],standalone:!1,features:[N([h]),D],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],["class","velt-cursor-pointer-default-comment-container user-presence-comment",4,"ngIf"],[1,"velt-cursor-pointer-default-comment-container","user-presence-comment"],[4,"veltDynamicTemplate"]],template:function(t,o){t&1&&u(0,kr,2,6,"ng-container",0),t&2&&a("ngIf",o.componentConfigSignal())},dependencies:[A,T,U,Me],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{display:flex}[_nghost-%COMP%]:empty{display:none}"],changeDetection:0});let r=i;return r})();var Ft=r=>({componentConfigSignal:r}),Fr=(r,i)=>({condition:r,data:i}),Rr=(r,i,n,e)=>({template:r,context:i,componentName:"velt-cursor-pointer-default-name-wireframe",setIfCondition:n,componentElementRef:e});function Lr(r,i){if(r&1&&(d(0),Ie(1),Ee(2,"translate"),p()),r&2){let n,e=c(3).ngIf;l(),xe(" ",Oe(2,1,(e.cursorUser==null?null:e.cursorUser.name)||(!(e.cursorUser==null||e.cursorUser.email==null||(n=e.cursorUser.email.split("@"))==null)&&n.length?e.cursorUser==null||e.cursorUser.email==null?null:e.cursorUser.email.split("@")[0]:e.cursorUser==null?null:e.cursorUser.email))," ")}}function Br(r,i){if(r&1&&(_(0,"p",3),u(1,Lr,3,3,"ng-container",4),b()),r&2){let n=c(2).ngIf,e=c();$("color",n.getTextColor(n.cursorUser==null?null:n.cursorUser.color)),P("data-testid",e.componentId),l(),a("veltDynamicTemplate",F(6,Rr,e.template,C(4,Ft,e.componentConfigSignal),e.setIfCondition.bind(e),e.elementRef))}}function jr(r,i){if(r&1&&(d(0),u(1,Br,2,11,"p",2),p()),r&2){let n=c().ngIf;l(),a("ngIf",(n.cursorUser==null?null:n.cursorUser.name)||(n.cursorUser==null?null:n.cursorUser.email))}}function Hr(r,i){if(r&1&&(d(0),u(1,jr,2,1,"ng-container",1),p()),r&2){let n=c();l(),a("veltIf",x(3,Fr,n.conditionSignal(),C(1,Ft,n.componentConfigSignal)))}}var ve=(()=>{let i=class i extends R{constructor(e,t,o){super(t,o,e),this.loggingService=e,this.elementRef=t,this.dynamicDataService=o,this.componentId="velt-cursor-pointer-default-name",super.initializeComponentConfigSignal(new w)}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in CursorPointerDefaultNameComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in CursorPointerDefaultNameComponent ngOnDestroy:",e)}}setupA11yAttributes(){try{let e=this.elementRef.nativeElement;e.setAttribute("data-testid",this.componentId+"-container"),e.setAttribute("role","img"),e.setAttribute("aria-label","Cursor pointer with user name"),e.setAttribute("aria-describedby","Shows user name next to cursor location")}catch(e){this.loggingService.catch("Error in CursorPointerDefaultNameComponent setupA11yAttributes:",e)}}};i.\u0275fac=function(t){return new(t||i)(m(v),m(E),m(h))},i.\u0275cmp=O({type:i,selectors:[["velt-cursor-pointer-default-name-internal"]],standalone:!1,features:[N([h]),D],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],["class","velt-cursor-pointer-default-name-container user-presence-name",3,"color",4,"ngIf"],[1,"velt-cursor-pointer-default-name-container","user-presence-name"],[4,"veltDynamicTemplate"]],template:function(t,o){t&1&&u(0,Hr,2,6,"ng-container",0),t&2&&a("ngIf",o.componentConfigSignal())},dependencies:[A,T,U,Me],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{display:flex}[_nghost-%COMP%]:empty{display:none}.velt-cursor-pointer-default-name-container[_ngcontent-%COMP%]{margin:0;font-size:var(--velt-font-size-xs);color:#fff}"],changeDetection:0});let r=i;return r})();var Rt=r=>({componentConfigSignal:r}),$r=(r,i)=>({condition:r,data:i}),Vr=(r,i,n,e)=>({template:r,context:i,componentName:"velt-cursor-pointer-default-wireframe",setIfCondition:n,componentElementRef:e});function Wr(r,i){if(r&1&&(d(0),k(1,"velt-cursor-pointer-default-name-internal",7)(2,"velt-cursor-pointer-default-comment-internal",7),p()),r&2){let n=c(5);l(),a("componentConfigSignal",n.componentConfigSignal),l(),a("componentConfigSignal",n.componentConfigSignal)}}function Gr(r,i){if(r&1&&(_(0,"div",5),u(1,Wr,3,2,"ng-container",6),b()),r&2){let n=c(3).ngIf,e=c();$("background-color",n.cursorUser==null?null:n.cursorUser.color),Z("user-presence-text-container-comment-border",n.cursorUser==null?null:n.cursorUser.comment)("velt-cursor-pointer-default-container-comment-border",n.cursorUser==null?null:n.cursorUser.comment),P("data-testid",e.componentId),l(),a("veltDynamicTemplate",F(10,Vr,e.template,C(8,Rt,e.componentConfigSignal),e.setIfCondition.bind(e),e.elementRef))}}function Jr(r,i){r&1&&(_(0,"div",8),k(1,"velt-skeleton-loader-internal",9),b())}function Yr(r,i){if(r&1&&u(0,Gr,2,15,"div",4)(1,Jr,2,0,"ng-template",null,0,it),r&2){let n=nt(2),e=c(2).ngIf;a("ngIf",(e.cursorUser==null?null:e.cursorUser.name)||(e.cursorUser==null?null:e.cursorUser.email)||(e.cursorUser==null?null:e.cursorUser.comment))("ngIfElse",n)}}function qr(r,i){if(r&1&&(d(0),u(1,Yr,3,2,"ng-template",3),p()),r&2){let n=c().ngIf;l(),a("ngIf",n.showDefault)}}function Kr(r,i){if(r&1&&(d(0),u(1,qr,2,1,"ng-container",2),p()),r&2){let n=c();l(),a("veltIf",x(3,$r,n.conditionSignal(),C(1,Rt,n.componentConfigSignal)))}}var he=(()=>{let i=class i extends R{constructor(e,t,o){super(t,o,e),this.loggingService=e,this.elementRef=t,this.dynamicDataService=o,this.componentId="velt-cursor-pointer-default",super.initializeComponentConfigSignal(new w)}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in CursorPointerDefaultComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in CursorPointerDefaultComponent ngOnDestroy:",e)}}setupA11yAttributes(){try{let e=this.elementRef.nativeElement;e.setAttribute("data-testid",this.componentId+"-container"),e.setAttribute("role","img"),e.setAttribute("aria-label","Default cursor pointer"),e.setAttribute("aria-describedby","User cursor location indicator")}catch(e){this.loggingService.catch("Error in CursorPointerDefaultComponent setupA11yAttributes:",e)}}};i.\u0275fac=function(t){return new(t||i)(m(v),m(E),m(h))},i.\u0275cmp=O({type:i,selectors:[["velt-cursor-pointer-default-internal"]],standalone:!1,features:[N([h]),D],decls:1,vars:1,consts:[["loadingTemplateRef",""],[4,"ngIf"],[4,"veltIf"],[3,"ngIf"],["class","velt-cursor-pointer-default-container user-presence-text-container",3,"backgroundColor","user-presence-text-container-comment-border","velt-cursor-pointer-default-container-comment-border",4,"ngIf","ngIfElse"],[1,"velt-cursor-pointer-default-container","user-presence-text-container"],[4,"veltDynamicTemplate"],[3,"componentConfigSignal"],[1,"velt-cursor-pointer-default-container-loading","user-presence-text-container-loading"],["height","24px","width","80px","borderRadius","24px"]],template:function(t,o){t&1&&u(0,Kr,2,6,"ng-container",1),t&2&&a("ngIf",o.componentConfigSignal())},dependencies:[A,T,U,ke,ge,ve],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{display:flex;transform:translate(calc((1.2rem + 0px) * var(--velt-base-rem-unit))) translateY(calc((-.7rem + 0px) * var(--velt-base-rem-unit)))}[_nghost-%COMP%]:empty{display:none}.velt-cursor-pointer-default-container[_ngcontent-%COMP%]{padding:var(--velt-spacing-sm);box-shadow:0 1px 4px #10101036;border-radius:var(--velt-border-radius-md);filter:brightness(110%) saturate(110%)}.velt-cursor-pointer-default-container-comment-border[_ngcontent-%COMP%]{border-bottom-left-radius:var(--velt-border-radius-xl);border-bottom-right-radius:var(--velt-border-radius-xl);border-top-right-radius:var(--velt-border-radius-xl);margin-top:calc(var(--velt-spacing-sm) * -1)}.velt-cursor-pointer-default-container-loading[_ngcontent-%COMP%]{transform:translate(calc((1.2rem + 0px) * var(--velt-base-rem-unit))) translateY(calc((-.7rem + 0px) * var(--velt-base-rem-unit)))}"],changeDetection:0});let r=i;return r})();var Lt=r=>({componentConfigSignal:r}),Qr=(r,i)=>({condition:r,data:i}),Zr=(r,i,n,e)=>({template:r,context:i,componentName:"velt-cursor-pointer-video-huddle-wireframe",setIfCondition:n,componentElementRef:e});function en(r,i){if(r&1&&(d(0),_(1,"div",6),k(2,"video",7),b(),p()),r&2){let n=c(3).ngIf;l(2),Z("flip",n.selfCursorPointer),a("srcObject",n.stream)("volume",n.selfCursorPointer?0:1)}}function tn(r,i){if(r&1&&(_(0,"div",3)(1,"div",4),u(2,en,3,4,"ng-container",5),b()()),r&2){let n=c(2).ngIf,e=c();P("data-testid",e.componentId+"-spacing"),l(),$("background",n.cursorUser==null?null:n.cursorUser.color)("border",n.gainVolume&&n.lightenedColor?n.getGainAnimationBorderStyle():""),P("data-testid",e.componentId),l(),a("veltDynamicTemplate",F(9,Zr,e.template,C(7,Lt,e.componentConfigSignal),e.setIfCondition.bind(e),e.elementRef))}}function rn(r,i){if(r&1&&(d(0),u(1,tn,3,14,"ng-template",2),p()),r&2){let n=c().ngIf;l(),a("ngIf",n.showVideo)}}function nn(r,i){if(r&1&&(d(0),u(1,rn,2,1,"ng-container",1),p()),r&2){let n=c();l(),a("veltIf",x(3,Qr,n.conditionSignal(),C(1,Lt,n.componentConfigSignal)))}}var fe=(()=>{let i=class i extends R{constructor(e,t,o){super(t,o,e),this.loggingService=e,this.elementRef=t,this.dynamicDataService=o,this.componentId="velt-cursor-pointer-video-huddle",super.initializeComponentConfigSignal(new w)}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in CursorPointerVideoHuddleComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in CursorPointerVideoHuddleComponent ngOnDestroy:",e)}}setupA11yAttributes(){try{let e=this.elementRef.nativeElement;e.setAttribute("data-testid",this.componentId+"-container"),e.setAttribute("role","img"),e.setAttribute("aria-label","Video call cursor pointer"),e.setAttribute("aria-describedby","User cursor with video call indicator"),e.setAttribute("aria-live","polite")}catch(e){this.loggingService.catch("Error in CursorPointerVideoHuddleComponent setupA11yAttributes:",e)}}};i.\u0275fac=function(t){return new(t||i)(m(v),m(E),m(h))},i.\u0275cmp=O({type:i,selectors:[["velt-cursor-pointer-video-huddle-internal"]],standalone:!1,features:[N([h]),D],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],[3,"ngIf"],[1,"velt-cursor-pointer-video-huddle-spacing","s-cursor-video-spacing"],[1,"velt-cursor-pointer-video-huddle-container","s-cursor-video-container"],[4,"veltDynamicTemplate"],[1,"velt-cursor-pointer-video-huddle-block","s-cursor-video-block"],["playsinline","","autoplay","true",3,"srcObject","volume"]],template:function(t,o){t&1&&u(0,nn,2,6,"ng-container",0),t&2&&a("ngIf",o.componentConfigSignal())},dependencies:[A,T,U],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{display:flex}[_nghost-%COMP%]:empty{display:none}.velt-cursor-pointer-video-huddle-spacing[_ngcontent-%COMP%]{width:calc((var(--legacy-velt-cursor-video-size) + 16px) * var(--velt-base-rem-unit));height:calc((var(--legacy-velt-cursor-video-size) + 16px) * var(--velt-base-rem-unit));display:flex;justify-content:center;align-items:center;position:absolute;top:calc((.4rem + 0px) * var(--velt-base-rem-unit));left:calc((.4rem + 0px) * var(--velt-base-rem-unit));background:transparent}.velt-cursor-pointer-video-huddle-container[_ngcontent-%COMP%]{width:calc((var(--legacy-velt-cursor-video-size) + 0px) * var(--velt-base-rem-unit));height:calc((var(--legacy-velt-cursor-video-size) + 0px) * var(--velt-base-rem-unit));box-sizing:content-box;padding:var(--velt-spacing-2xs);border-radius:var(--velt-border-radius-full);box-shadow:0 1px 4px #10101036}.velt-cursor-pointer-video-huddle-container[_ngcontent-%COMP%] .velt-cursor-pointer-video-huddle-block[_ngcontent-%COMP%]{position:relative;width:100%;height:100%}.velt-cursor-pointer-video-huddle-container[_ngcontent-%COMP%] video[_ngcontent-%COMP%]{width:100%;height:100%;border-radius:var(--velt-border-radius-full);object-fit:cover}"],changeDetection:0});let r=i;return r})();var an=["*"],Bt=r=>({componentConfigSignal:r}),sn=(r,i)=>({condition:r,data:i}),cn=(r,i)=>({template:r,context:i,componentName:"velt-cursor-pointer-wireframe"});function ln(r,i){if(r&1&&(d(0),_(1,"velt-cursor-pointer-arrow-internal",5),be(2),b(),k(3,"velt-cursor-pointer-default-internal",5)(4,"velt-cursor-pointer-avatar-internal",5)(5,"velt-cursor-pointer-audio-huddle-internal",5)(6,"velt-cursor-pointer-video-huddle-internal",5),p()),r&2){let n=c(4);l(),a("componentConfigSignal",n.componentConfigSignal),l(2),a("componentConfigSignal",n.componentConfigSignal),l(),a("componentConfigSignal",n.componentConfigSignal),l(),a("componentConfigSignal",n.componentConfigSignal),l(),a("componentConfigSignal",n.componentConfigSignal)}}function un(r,i){if(r&1&&(_(0,"div",3),u(1,ln,7,5,"ng-container",4),b()),r&2){let n=c(2).ngIf,e=c();$("top",n.cursorUser==null||n.cursorUser.position==null?null:n.cursorUser.position.top,"px")("left",n.cursorUser==null||n.cursorUser.position==null?null:n.cursorUser.position.left,"px"),Z("no-transition",n.selfCursorPointer),l(),a("veltDynamicTemplate",x(9,cn,n.template,C(7,Bt,e.componentConfigSignal)))}}function mn(r,i){if(r&1&&(d(0),u(1,un,2,12,"div",2),p()),r&2){let n=c().ngIf;l(),a("ngIf",n.cursorUser==null?null:n.cursorUser.position)}}function dn(r,i){if(r&1&&(d(0),u(1,mn,2,1,"ng-container",1),p()),r&2){let n=c();l(),a("veltIf",x(3,sn,n.conditionSignal(),C(1,Bt,n.componentConfigSignal)))}}var Ce=(()=>{let i=class i extends Ot{set cursorUser(e){this.componentConfigSignal.update(t=>(t=f(g({},t),{cursorUser:e}),t)),e?.color&&this.componentConfigSignal.update(t=>(t=f(g({},t),{lightenedColor:ht(e?.color,80)}),t))}get stream(){return this._stream}set stream(e){this._stream=e,e&&this.startGainAnimation(e),this.serviceBook.get(K)?.updateHuddleCursorAvailableByAttendeeId(this.componentConfigSignal().cursorUser?.userSnippylyId,!!this.stream),this.updatePointerStates()}constructor(e,t,o,s,S){super(o,s),this.serviceBook=e,this.loggingService=t,this.elementRef=o,this.themeService=s,this.wireframeService=S,this.selfCursorPointer=!1,this.avatarMode=!1,this.showInitial=!1,this.veltElement=!0,this.componentConfigSignal=_e({template:this.template,variant:this.variant,selfCursorPointer:this.selfCursorPointer||!1,showDefault:!1,showAvatar:!1,showAudio:!1,showVideo:!1,gainVolume:void 0,lightenedColor:void 0,onImageLoadError:this.onImageLoadError.bind(this),getGainAnimationBorderStyle:this.getGainAnimationBorderStyle.bind(this),getTextColor:this.getTextColor.bind(this)}),this.subscriptions=[],this.componentId="velt-cursor-pointer"}ngOnInit(){try{let e="velt-cursor-pointer-wireframe";this.setupA11yAttributes(),this.updatePointerStates(),this.variant&&(e+=`---${this.variant}`),this.subscriptions.push(this.wireframeService.getWireframe$(e).subscribe(t=>{if(t){let o=document.createElement(t.tagName);o.innerHTML=t.innerHTML,this.componentConfigSignal.update(s=>f(g({},s),{template:o}))}}))}catch(e){this.loggingService.catch("Error in CursorPointerComponent ngOnInit: ",e)}}setupA11yAttributes(){try{let e=this.elementRef.nativeElement;e.setAttribute("data-testid",this.componentId+"-container"),e.setAttribute("role","img"),e.setAttribute("aria-label","Live cursor pointer indicator"),e.setAttribute("aria-live","polite"),e.setAttribute("aria-atomic","true")}catch(e){this.loggingService.catch("Error in CursorPointerComponent setupA11yAttributes:",e)}}ngAfterViewIni