UNPKG

@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 130 kB
import{j as an,l as Se,m as rt,t as ln}from"./chunk-BACKCNIG.js";import"./chunk-JFNRCHYR.js";import{x as on}from"./chunk-U4YN7DB7.js";import{a as dn}from"./chunk-ZATQYC4Y.js";import{a as Ie}from"./chunk-3HGEDPEP.js";import{a as rn}from"./chunk-JDLRIKAZ.js";import{A,B as U,y as nn}from"./chunk-3J52NZMN.js";import{a as ce}from"./chunk-4ACOV475.js";import{b as z,c as at,d as cn}from"./chunk-WTYACTR5.js";import{a as mn}from"./chunk-6E3N35RF.js";import{a as sn}from"./chunk-KEM6PWSD.js";import{a as Wt}from"./chunk-UJRDSNTY.js";import{A as Nt,G as Bt,H as Ut,I as Lt,da as _,ea as ge,fa as W,ga as ue}from"./chunk-KU45CEXD.js";import{$ as kt,$f as Xt,Aa as Ee,Bf as ut,Cg as nt,Db as vt,E as _e,Eb as pt,Ed as zt,Ee as re,Fa as s,Fb as gt,Fc as we,G as yt,Ga as he,Gc as j,Hc as Mt,Ib as X,Ic as jt,Ii as tn,J as De,Jc as At,Kb as fe,L as mt,Lc as ve,Nb as Ue,Nf as Ht,Nh as Kt,Ob as Ot,Pa as v,Pb as tt,Pc as Ft,Rf as Yt,T as Y,Ta as Et,Ua as w,Va as Dt,Vh as Qt,Y as dt,Ya as P,_a as d,_b as M,a as R,aa as Rt,ac as wt,b as N,bc as y,bi as ot,ca as ae,cc as E,ci as Zt,db as k,di as I,ei as qt,fc as B,fh as be,g as Te,ha as J,hh as ht,ia as K,ja as Tt,jg as Gt,jh as Jt,kc as T,l as et,lb as l,lc as D,lh as ft,li as xe,mb as b,mc as Le,mi as Pe,nb as x,ni as _t,ob as F,oe as Vt,pc as oe,qa as Oe,r as V,sb as p,sc as Pt,sf as $t,si as pe,tb as g,ti as en,ua as Ce,ub as de,v as L,vb as Z,vh as it,w as st,wa as O,xb as q,yi as Me,zb as a}from"./chunk-GR3NESUB.js";var le=(()=>{let o=class o{constructor(e,n,r,c,u,S,h,f,m,C,$,H,Dn){this.afAuth=e,this.analyticsService=n,this.authService=r,this.configService=c,this.databaseService=u,this.commonDbService=S,this.docService=h,this.domService=f,this.emojiService=m,this.iamService=C,this.loggingService=$,this.userPermissionService=H,this.serviceBook=Dn,this.documentPaths=null,this.reactionAnnotationById$=new et({}),this.customReactions$=new et({}),this.commentService=null,this.darkMode$=new et(null),this.loggingService.log("%c[WB] Creating CLASS: ReactionService","color: blue;"),this.serviceBook.observe(Kt).subscribe(Re=>{this.commentService=Re}),this.databaseService.getDb().pipe(_e(Re=>!!Re),De(1)).subscribe(Re=>{Re&&this.getAllReactionAnnotations(void 0,void 0,!0).subscribe()},Re=>{this.loggingService.catch("Error in ReactionService getDb subscription: ",Re)})}setCommentService(e){this.loggingService.log("%c[WB] Calling FUNCTION: setCommentService","color: green;");try{this.commentService=e}catch(n){this.loggingService.catch("Error in ReactionService setCommentService: ",n)}}clearCache(){this.loggingService.log("%c[WB] Calling FUNCTION: clearCache in ReactionService","color: green;");try{this.reactionAnnotationById$.next({}),this.customReactions$.next({}),this.documentPaths=null}catch(e){this.loggingService.catch("Error in ReactionService clearCache: ",e)}}getAllReactionAnnotations(e,n,r,c,u){this.loggingService.log("%c[WB] Calling FUNCTION: getAllReactionAnnotations","color: green;");let S,h;try{if(e&&(h=`${ut(e)}`),n&&typeof n=="object"){let f=Yt(n);S=ut(JSON.stringify(f))}}catch(f){this.loggingService.catch("Error in ReactionService getAllReactionAnnotations: ",f)}return this.authService.getAuthState$().pipe(_e(f=>!!f),Y(f=>this.isFeatureAllowed({firebaseUser:f,annotations:[],filteredAnnotations:[]})),Y(f=>f.featureAllowed?this.iamService.isUserAllowed$().pipe(L(m=>(f.featureAllowed=m,f))):V(f)),Y(f=>f.featureAllowed?V(f).pipe(Y(m=>this.docService.getDocumentPaths$().pipe(L(C=>(this.documentPaths=C,m.documentPaths=C,m)))),Y(m=>h?this.getDataFromDocumentIds([h]).pipe(L(C=>(m.annotations=C||[],R({},m)))):this.docService.getDocumentIds$().pipe(Y(C=>{let $=C?.length>0?C.map(H=>H.documentId):[this.documentPaths?.documentId??""];return this.getDataFromDocumentIds($).pipe(L(H=>(m.annotations=H||[],R({},m))))}))),Y(m=>this.docService.getLocation$().pipe(L(C=>(m.location=C,m)))),Y(m=>this.docService.getLocations$().pipe(L(C=>(m.customLocations=C,m)))),L(m=>{if(m.filteredAnnotations=[],h&&!S)return m.filteredAnnotations=m.annotations?.slice(),m;{let C=[];return S?C.push(S):(C.push(m?.location?.locationId),C.push(...Object.values(m?.customLocations||[]).map($=>$.locationId))),m.filteredAnnotations=this.filterAnnotationsByLocationIds(m?.annotations,C),m}}),Y(m=>r?V(m):m?.annotations?.length?this.domService.onWindowResize$().pipe(L(()=>m)):V(m)),Y(m=>r?V(m):V(m)),L(m=>m),Y(m=>m?.filteredAnnotations?V(m?.filteredAnnotations||[]):V([]))):V([])),mt(Jt))}isFeatureAllowed(e){return this.configService.getConfig$().pipe(_e(n=>!!n),L(n=>N(R({},e),{config:n})),Y(n=>this.authService.getUser$().pipe(L(r=>N(R({},n),{user:r})))),Y(n=>Ht(n.config,n.user,Vt.REACTION)?V(N(R({},n),{featureAllowed:!0})):(this.loggingService.warn("Reaction feature is not allowed."),V(N(R({},n),{featureAllowed:!1})))),mt((n,r)=>n?.featureAllowed===r?.featureAllowed))}getDataFromDocumentIds(e,n){return this.getDataFromDocuments({documentIds:e,filters:n})}getDataFromDocuments(e){if(this.configService?.getApiKey()){let{documentIds:n,filters:r}=e;if(n?.some(h=>!h)||!this.documentPaths)return V([]);let c=this.docService.getDocumentPaths()?.veltFolderId,u=V([]),S={useCollectionGroup:!0,isCollection:!0,useQuery:!0};if(this.commonDbService.shouldUseFirestore()||(S.documentId=n?.length?n[0]:void 0,S.organizationId=this.documentPaths?.organizationId),this.userPermissionService?.getIsContextEnabled()){let h=[re.DEFAULT_VELT_CONTEXT,...this.docService.getProcessedDocContext()],f=[];for(let m=0;m<(h?.length??0);m+=re.LISTENER_CONTEXT_BATCH_SIZE)f.push(h?.slice(m,m+re.LISTENER_CONTEXT_BATCH_SIZE)??[]);u=st(f.map(m=>this.commonDbService.dbListener({feature:"allReactions",properties:N(R({},S),{firestoreQuery:[_t(pe("metadata.apiKey","==",this.configService?.getApiKey()),pe("metadata.documentId","in",n),pe("metadata.organizationId","==",this.documentPaths?.organizationId),...c?[pe("metadata.veltFolderId","==",c)]:[],...m?.length?[pe("context.accessFields","array-contains-any",m)]:[])]})}).pipe(dt()))).pipe(L(m=>ft(m)))}else{let h=[];for(let f=0;f<(n?.length??0);f+=re.LISTENER_BATCH_SIZE)h.push(n?.slice(f,f+re.LISTENER_BATCH_SIZE)??[]);u=st(h.map(f=>this.commonDbService.dbListener({feature:"allReactions",properties:N(R({},S),{firestoreQuery:[_t(pe("metadata.apiKey","==",this.configService?.getApiKey()),pe("metadata.documentId","in",f),pe("metadata.organizationId","==",this.documentPaths?.organizationId),...c?[pe("metadata.veltFolderId","==",c)]:[])]})}).pipe(dt()))).pipe(L(f=>ft(f)))}return u.pipe(L(h=>({data:h?.data,operation:h?.operation})),L(({data:h,operation:f})=>{let m=[];return h&&(m=Object.values(h??{}).filter(C=>typeof C=="object")),m?.forEach(C=>{this.sanitizeReactionAnnotation(C)}),{data:m,operation:f}}),L(({data:h,operation:f})=>{if(!n)return{data:h,documentMap:{},operation:f};let m=h.reduce((C,$)=>{let H=$.metadata?.documentId;return H&&(C[H]||(C[H]=[]),C[H].push($)),C},{});return{data:h,documentMap:m,operation:f}}),L(({data:h,documentMap:f,operation:m})=>{if(!r)if(m?.type==="removed"){if(m?.ids?.length){let C=this.reactionAnnotationById$.value;m?.ids?.forEach($=>{delete C?.[$]}),this.reactionAnnotationById$.next(C)}}else Object.entries(f??{}).forEach(([C,$])=>{this.setReactionAnnotationsByOrganizationIdAndDocumentId({organizationId:this.documentPaths?.organizationId,documentId:C,annotations:$})});return h}),yt(h=>(this.loggingService.catch("Error in ReactionService getDataFromDocumentId: ",h),V([]))))}else return V([])}setReactionAnnotationsByOrganizationIdAndDocumentId({organizationId:e,documentId:n,annotations:r,queryHash:c}){try{if(n){e||(e=re.NO_ORGANIZATION_ID),c||(c=re.DEFAULT_QUERY_HASH);let u={};r?.forEach(h=>{h?.annotationId&&(u[h?.annotationId]=h)});let S=R(R({},this.reactionAnnotationById$.value),u);this.reactionAnnotationById$.next(S)}}catch(u){this.loggingService.catch("Error in ReactionService setReactionAnnotationsByOrganizationIdAndDocumentId:",u)}}getReactionAnnotationsByOrganizationIdAndDocumentId({organizationId:e,documentId:n}){try{let r={};return Object.values(this.reactionAnnotationById$.value??{}).forEach(c=>{c?.metadata?.documentId==n&&c?.metadata?.organizationId==e&&(r[c?.annotationId]=c)}),Object.values(r)}catch(r){return this.loggingService.catch("Error in ReactionService getReactionAnnotationsByOrganizationIdAndDocumentId:",r),[]}}getLocations$(){return this.docService.getLocation$().pipe(Y(e=>this.docService.getLocations$().pipe(L(n=>({location:e,locations:n})))),L(e=>{let n=[];return n.push(e?.location?.locationId),n.push(...Object.values(e.locations||[]).map(r=>r.locationId)),n||[]}))}filterAnnotationsByLocationIds(e,n){try{return e.filter(r=>n.includes(r.locationId))}catch(r){return this.loggingService.catch("Error in ReactionService filterAnnotationsByLocations:",r),[]}}getAnnotationById(e,n){try{let r=this.reactionAnnotationById$.value?.[e];if(r){let{documentId:c,organizationId:u}=n||{};if(c&&r.metadata?.documentId!==c||u&&r.metadata?.organizationId!==u)return}return r}catch(r){this.loggingService.catch("Error in ReactionService getAnnotationById: ",r);return}}getBaseMetadataFromReactionAnnotationId(e){try{let n=this.reactionAnnotationById$.value?.[e];return n?n.metadata:void 0}catch(n){this.loggingService.catch("Error in ReactionService getBaseMetadataFromReactionAnnotationId: ",n);return}}getReactionAnnotationByAnnotationId(e,n){try{return this.reactionAnnotationById$.pipe(L(()=>this.getAnnotationById(e,n)),Y(r=>r?V(r):V(r)))}catch(r){return this.loggingService.catch("Error in ReactionService getReactionAnnotationByAnnotationId: ",r),V(void 0)}}getReactionAnnotationsBySectionId(e){try{return this.reactionAnnotationById$.pipe(Y(n=>this.docService.getDocumentPaths$().pipe(L(r=>({documentPaths:r,sectionId:e,reactionAnnotationsMap:n})))),Y(n=>{let r=nt(e,["id","data-id"]);if(r){let c=this.docService.getAdditionLocationFromElement(r);if(c){let u=this.docService.genarateLocationId(c);return this.docService.getLocations$().pipe(L(S=>{let f=Object.values(S||{}).find(m=>m.locationId===u||c?.id&&m.location.id===c.id);return N(R({},n),{additionalLocation:f,locationOnElement:!!c})}))}}return V(N(R({},n),{additionalLocation:null,element:r}))}),Y(n=>n?.locationOnElement?V(n):this.docService.getLocation$().pipe(L(r=>N(R({},n),{location:r})))),L(({documentPaths:n,location:r,additionalLocation:c,locationOnElement:u,element:S})=>{let h=null,f=this.docService.getAdditionalDocumentIdFromElement(S),m=f?this.docService.generateDocumentId(f):n?.documentId,C=n?.organizationId;if(m){let $=this.getReactionAnnotationsByOrganizationIdAndDocumentId({organizationId:C,documentId:m});if($){h=[];for(let H of $)H?.targetElementId===e&&(u?c&&ht({location:c?.location,locationId:c?.locationId},{location:H.location,locationId:H.locationId})&&h.push(H):r?ht({location:r?.location,locationId:r?.locationId},{location:H.location,locationId:H.locationId})&&h.push(H):H?.locationId||h.push(H))}}return h}))}catch(n){return this.loggingService.catch("Error in ReactionService getReactionAnnotationsBySectionId: ",n),V(null)}}addOrUpdateReaction(e,n,r,c,u,S,h,f){return Te(this,null,function*(){try{let m=n?.map(C=>this.getAnnotationById(C)).find(C=>C?.icon===e);if(m){if(!h||h==="delete")return yield this.updateUserInReaction(m)}else if(!h||h==="add")return yield this.addReaction(void 0,e,r,c,u,S,f)}catch(m){this.loggingService.catch("Error in ReactionService addOrUpdateReaction: ",m)}})}addReaction(e,n,r,c,u,S,h){return Te(this,null,function*(){this.loggingService.log("%c[WB] Calling FUNCTION: addReaction","color: green;");try{let f=this.authService.getUser();if(f)if(f.isReadOnly||f.isAnonymous)this.loggingService.catch("Anonymous/Readonly users cannot add reactions.");else{let m=new $t;if(m.from=f,m.lastUpdated=this.timestamp,m.reactions=[],m.reactions.push({from:f,lastUpdated:this.timestamp}),c&&(m.targetElementId=c),u){m.commentAnnotationId=u;let C=this.commentService?.getAnnotationById(u);if(C?.context?.access&&C?.context?.accessFields){if(!this.userPermissionService?.hasUserContextAccess({userId:f.userId,accessFields:C.context.accessFields})){this.loggingService.catch("User does not have context access to add reaction annotation.",void 0,void 0,!0);return}m.context={access:C.context.access,accessFields:C.context.accessFields}}}if(this.setLocationToReactionAnnotation(m),m.pageInfo=Gt(),m.pageInfo&&(m.pageInfo.screenWidth=this.domService.getCurrentWindowSizeValue()?.screenWidth),n)if(m.icon=n,S)m.iconUrl=S?.url,m.iconEmoji=S?.emoji;else{let C=this.customReactions$.value;if(C){let $=C[n];$?.url&&(m.iconUrl=$?.url),$?.emoji&&(m.iconEmoji=$?.emoji)}}return r&&(m.location={},m.location=R({},r),m.locationId=this.docService.genarateLocationId(m.location)),yield this.saveReactionToDb(m)}}catch(f){this.loggingService.catch("Error in ReactionService addReaction: ",f)}})}setLocationToReactionAnnotation(e){try{let n=this.docService.getLocation();n?(e.locationId=n.locationId,e.location=n.location):(delete e.locationId,delete e.location);try{let r;e.targetElement?.xpath?r=this.domService.getElementFromXPath(e.targetElement.xpath):e.targetElementId&&(r=nt(e.targetElementId,["id","data-id"]));let c=this.docService.getAdditionLocationFromElement(r);if(c){let u=this.docService.addLocation({location:c,source:"internal"});u?.[0]&&(e.locationId=u[0].locationId,e.location=u[0].location)}}catch{}}catch(n){this.loggingService.catch("Error in ReactionService setLocationToReactionAnnotation:",n)}}getElementForReactionAnnotation(e){try{let n;return e.targetElementId&&(n=nt(e.targetElementId,["id","data-id"])),n}catch(n){return this.loggingService.catch("Error in ReactionService getElementForReactionAnnotation: ",n),null}}saveReactionToDb(e){return Te(this,null,function*(){this.loggingService.log("%c[WB] Calling FUNCTION: saveReactionToDb","color: green;");try{if(this.authService.getUser()){let n=yield this.docService.getDocumentPaths$().pipe(_e(c=>!!c),De(1)).toPromise();if(!n)throw new Error("Document paths not found.");if(this.documentPaths=n,this.loggingService.log(this.documentPaths),!(yield this.databaseService.getDb().pipe(_e(c=>!!c),De(1)).toPromise()))throw new Error("Database not found.");if(this.documentPaths?.reaction){if(e.annotationId=this.commonDbService.generateDocumentId(),e.pageInfo,!e?.metadata?.documentId){e?.metadata||(e.metadata={});let f=this.getElementForReactionAnnotation(e),m=this.docService.getBaseMetadata("reaction",{commentAnnotationId:e.commentAnnotationId,element:f});e.metadata=R(R({},e?.metadata),m)}let c=JSON.parse(JSON.stringify(e));c.position=null;let{documentId:u,organizationId:S}=this.getDocumentIdAndOrganizationIdFromReactionAnnotation(e),h=e.commentAnnotationId?void 0:{annotationData:c,actionType:"add",notificationSource:"reaction"};return yield this.commonDbService.setData({feature:"reaction",properties:{id:e.annotationId,documentId:u,organizationId:S},data:c,extraData:h}),c}else return}}catch(n){this.loggingService.catch("Error in ReactionService saveReactionToDb: ",n)}})}getDocumentIdAndOrganizationIdFromReactionAnnotation(e){try{return{documentId:e?.metadata?.documentId,organizationId:e?.metadata?.organizationId}}catch(n){return this.loggingService.catch("Error in ReactionService getDocumentIdAndOrganizationIdFromReactionAnnotation: ",n),{}}}updateUserInReaction(e){return Te(this,null,function*(){try{let n=this.authService.getUser();if(n)return e?.reactions||(e.reactions=[]),e?.reactions?.find(c=>c?.from?.userId===n?.userId)?e.reactions=e?.reactions?.filter(c=>c?.from?.userId!==n?.userId):e.reactions.push({from:n,lastUpdated:this.timestamp}),e.reactions.length?yield this.updateReaction(e):yield this.deleteReactionPinAnnotation(e?.annotationId),e}catch(n){this.loggingService.catch("Error in ReactionService updateUserInReaction: ",n)}})}removeUserFromReaction(e){this.loggingService.log("%c[WB] Calling FUNCTION: removeUserFromReaction","color: green;");try{let n=this.authService.getUser();n&&(e?.reactions||(e.reactions=[]),e.reactions=e?.reactions?.filter(r=>r?.from?.userId!==n?.userId),this.updateReaction(e))}catch(n){this.loggingService.catch("Error in ReactionService removeUserFromReaction: ",n)}}updateReaction(e,n,r){return Te(this,null,function*(){this.loggingService.log("%c[WB] Calling FUNCTION: updateReaction","color: green;");try{if(this.authService.getUser()){if(e?.targetElement?.xpath){let h=this.domService.getXPath(e.targetElement.xpath);if(h){let f=h.iterateNext();f&&(Xt(f)||(e.targetElement=null))}}let c=JSON.parse(JSON.stringify(e));if(c.position=null,c.lastUpdated=this.timestamp,!c?.metadata?.documentId){c?.metadata||(c.metadata={});let h=this.docService.getBaseMetadata("reaction",{commentAnnotationId:e.commentAnnotationId});c.metadata=R(R({},c?.metadata),h)}let{documentId:u,organizationId:S}=c?.metadata||{};return r?yield this.commonDbService.updateData({feature:"reaction",properties:{id:e.annotationId,documentId:u,organizationId:S},data:JSON.parse(JSON.stringify(c))}):yield this.commonDbService.setData({feature:"reaction",properties:{id:e.annotationId,documentId:u,organizationId:S},data:JSON.parse(JSON.stringify(c))}),c}}catch(c){this.loggingService.catch("Error in ReactionService updateReaction: ",c)}})}deleteReactionPinAnnotation(e,n){return Te(this,null,function*(){try{let r=this.getAnnotationById(e),{documentId:c,organizationId:u}=this.getDocumentIdAndOrganizationIdFromReactionAnnotation(r),S=r&&!r.commentAnnotationId?{annotationData:r,actionType:"delete",notificationSource:"reaction"}:void 0;yield this.commonDbService.deleteData({feature:"reaction",properties:{id:e,documentId:c,organizationId:u},extraData:S})}catch(r){this.loggingService.catch("Error in ReactionService deleteReactionPinAnnotation: ",r)}})}setCustomReactions(e){try{this.loggingService.log("%c[WB] Calling FUNCTION: setCustomReactions","color: green;"),this.customReactions$.next(e),this.emojiService.setEmojiList(e)}catch(n){this.loggingService.catch("Error in ReactionService setCustomReactions: ",n)}}enableDarkMode(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enableDarkMode","color: green;"),this.darkMode$.value===!0)return;this.darkMode$.next(!0)}catch(e){this.loggingService.catch("Error in ReactionService enableDarkMode: ",e)}}disableDarkMode(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disableDarkMode","color: green;"),this.darkMode$.value===!1)return;this.darkMode$.next(!1)}catch(e){this.loggingService.catch("Error in ReactionService disableDarkMode: ",e)}}getDarkMode(){return this.darkMode$.value}getDarkMode$(){return this.darkMode$.asObservable()}sanitizeReactionAnnotation(e){try{e&&(e.iconUrl&&(e.iconUrl=this.domService.sanitizeHtml(e.iconUrl)),e.iconEmoji&&(e.iconEmoji=this.domService.sanitizeHtml(e.iconEmoji)),e.icon&&(e.icon=this.domService.sanitizeHtml(e.icon)))}catch(n){this.loggingService.catch("Error in ReactionService sanitizeReactionAnnotation: ",n)}}get timestamp(){return this.commonDbService.getServerTimestamp()}getReactionAnnotationForClient(e){try{let n=["isReactionResolverUsed","pageInfo","from","involvedUserIds","position"],r=JSON.parse(JSON.stringify(e)),c={};return Object.keys(r).forEach(u=>{n.includes(u)||(u==="reactions"?c.fromUsers=r[u]:c[u]=r[u])}),c}catch(n){return this.loggingService.catch("Error in ReactionService getReactionAnnotationForClient: ",n),e}}};o.\u0275fac=function(n){return new(n||o)(ae(zt),ae(Zt),ae(Pe),ae(qt),ae(en),ae(tn),ae(Me),ae(xe),ae(Se),ae(sn),ae(I),ae(dn),ae(ot))},o.\u0275prov=kt({token:o,factory:o.\u0275fac,providedIn:"root"});let t=o;return t})();var ye=class{constructor(){this.annotations=[],this.skeletonLoading=!0,this.darkMode=!1}};var ee=class{constructor(){this.type="comment",this.disableTooltip=!1,this.isReactionSelectedByCurrentUser=!1,this.tooltipVisible=!1,this.shadowDom=!1}};var gn=t=>({componentConfigSignal:t}),wn=(t,o)=>({condition:t,data:o}),Pn=(t,o,i,e,n)=>({template:t,context:o,componentName:"velt-reaction-pin-emoji-wireframe",variant:i,setIfCondition:e,componentElementRef:n});function Mn(t,o){if(t&1&&(p(0),F(1,"div",3),T(2,"emoji"),T(3,"translate"),g()),t&2){let i=a(3).ngIf,e=a();s(),l("innerHTML",Le(2,3,i==null||i.annotation==null?null:i.annotation.icon,i==null?null:i.annotation),Ee),k("data-testid",e.componentId)("aria-label",D(3,6,"Reaction with")+" "+((i==null||i.annotation==null?null:i.annotation.icon)||"emoji"))}}function jn(t,o){if(t&1&&(p(0),d(1,Mn,4,8,"ng-container",0),g()),t&2){let i=a(2).ngIf;s(),l("ngIf",i==null?null:i.annotation)}}function An(t,o){if(t&1&&(p(0),d(1,jn,2,1,"ng-container",2),g()),t&2){let i=a().ngIf,e=a();s(),l("veltDynamicTemplate",B(3,Pn,e.template,y(1,gn,e.componentConfigSignal),i==null?null:i.variant,e.setIfCondition.bind(e),e.elementRef))}}function Fn(t,o){if(t&1&&(p(0),d(1,An,2,9,"ng-container",1),g()),t&2){let i=a();s(),l("veltIf",E(3,wn,i.conditionSignal(),y(1,gn,i.componentConfigSignal)))}}var We=(()=>{let o=class o extends W{constructor(e,n,r){super(e,r,n),this.elementRef=e,this.loggingService=n,this.dynamicDataService=r,this.componentId="velt-reaction-pin-emoji",super.initializeComponentConfigSignal(new ee)}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in ReactionPinEmojiComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in ReactionPinEmojiComponent ngOnDestroy:",e)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in ReactionPinEmojiComponent setupA11yAttributes:",e)}}};o.\u0275fac=function(n){return new(n||o)(v(O),v(I),v(_))},o.\u0275cmp=w({type:o,selectors:[["velt-reaction-pin-emoji-internal"]],standalone:!1,features:[M([_]),P],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],[4,"veltDynamicTemplate"],["role","img",1,"velt-reaction-pin--emoji",3,"innerHTML"]],template:function(n,r){n&1&&d(0,Fn,2,6,"ng-container",0),n&2&&l("ngIf",r.componentConfigSignal())},dependencies:[j,A,U,rt,z],styles:["[_nghost-%COMP%]{display:inline-flex}[_nghost-%COMP%]:empty{display:none}"],changeDetection:0});let t=o;return t})();var un=t=>({componentConfigSignal:t}),Bn=(t,o)=>({condition:t,data:o}),Un=(t,o,i,e,n)=>({template:t,context:o,componentName:"velt-reaction-pin-count-wireframe",variant:i,setIfCondition:e,componentElementRef:n});function Ln(t,o){if(t&1&&(b(0,"div",4),T(1,"translate"),Ue(2),x()),t&2){let i=a(3).ngIf,e=a();k("data-testid",e.componentId)("aria-label",D(1,3,"Reaction count")+" "+((i==null||i.annotation==null||i.annotation.reactions==null?null:i.annotation.reactions.length)||0)),s(2),tt(" ",i==null||i.annotation==null||i.annotation.reactions==null?null:i.annotation.reactions.length," ")}}function Wn(t,o){if(t&1&&(p(0),d(1,Ln,3,5,"div",3),g()),t&2){let i=a(2).ngIf;s(),l("ngIf",i==null||i.annotation==null||i.annotation.reactions==null?null:i.annotation.reactions.length)}}function zn(t,o){if(t&1&&(p(0),d(1,Wn,2,1,"ng-container",2),g()),t&2){let i=a().ngIf,e=a();s(),l("veltDynamicTemplate",B(3,Un,e.template,y(1,un,e.componentConfigSignal),i==null?null:i.variant,e.setIfCondition.bind(e),e.elementRef))}}function Vn(t,o){if(t&1&&(p(0),d(1,zn,2,9,"ng-container",1),g()),t&2){let i=a();s(),l("veltIf",E(3,Bn,i.conditionSignal(),y(1,un,i.componentConfigSignal)))}}var ze=(()=>{let o=class o extends W{constructor(e,n,r){super(e,r,n),this.elementRef=e,this.loggingService=n,this.dynamicDataService=r,this.componentId="velt-reaction-pin-count",super.initializeComponentConfigSignal(new ee)}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in ReactionPinCountComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in ReactionPinCountComponent ngOnDestroy:",e)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in ReactionPinCountComponent setupA11yAttributes:",e)}}};o.\u0275fac=function(n){return new(n||o)(v(O),v(I),v(_))},o.\u0275cmp=w({type:o,selectors:[["velt-reaction-pin-count-internal"]],standalone:!1,features:[M([_]),P],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],[4,"veltDynamicTemplate"],["class","velt-reaction-pin--count","role","status",4,"ngIf"],["role","status",1,"velt-reaction-pin--count"]],template:function(n,r){n&1&&d(0,Vn,2,6,"ng-container",0),n&2&&l("ngIf",r.componentConfigSignal())},dependencies:[j,A,U,z],styles:["[_nghost-%COMP%]{display:inline-flex}[_nghost-%COMP%]:empty{display:none}"],changeDetection:0});let t=o;return t})();var hn=t=>({componentConfigSignal:t}),Hn=(t,o)=>({condition:t,data:o}),Yn=(t,o,i,e,n)=>({template:t,context:o,componentName:"velt-reaction-pin-tooltip-user-avatar-wireframe",variant:i,setIfCondition:e,componentElementRef:n});function Xn(t,o){if(t&1&&(p(0),F(1,"snippyly-user-avatar",3),T(2,"translate"),T(3,"translate"),g()),t&2){let i=a(4);s(),l("size",24)("user",i.reaction==null?null:i.reaction.from),k("data-testid",i.componentId+"-avatar")("aria-label",D(2,4,"Avatar for")+" "+D(3,6,(i.reaction==null||i.reaction.from==null?null:i.reaction.from.name)||(i.reaction==null||i.reaction.from==null?null:i.reaction.from.email)||"user"))}}function Gn(t,o){if(t&1&&(p(0),d(1,Xn,4,8,"ng-container",0),g()),t&2){let i=a(3);s(),l("ngIf",i.reaction)}}function Jn(t,o){if(t&1&&(p(0),d(1,Gn,2,1,"ng-container",2),g()),t&2){let i=a().ngIf,e=a();s(),l("veltDynamicTemplate",B(3,Yn,e.template,y(1,hn,e.componentConfigSignal),i==null?null:i.variant,e.setIfCondition.bind(e),e.elementRef))}}function Kn(t,o){if(t&1&&(p(0),d(1,Jn,2,9,"ng-container",1),g()),t&2){let i=a();s(),l("veltIf",E(3,Hn,i.conditionSignal(),y(1,hn,i.componentConfigSignal)))}}var Ve=(()=>{let o=class o extends W{constructor(e,n,r){super(e,r,n),this.elementRef=e,this.loggingService=n,this.dynamicDataService=r,this.componentId="velt-reaction-pin-tooltip-avatar",super.initializeComponentConfigSignal(new ee)}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in ReactionPinTooltipUserAvatarComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in ReactionPinTooltipUserAvatarComponent ngOnDestroy:",e)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in ReactionPinTooltipUserAvatarComponent setupA11yAttributes:",e)}}};o.\u0275fac=function(n){return new(n||o)(v(O),v(I),v(_))},o.\u0275cmp=w({type:o,selectors:[["velt-reaction-pin-tooltip-user-avatar-internal"]],inputs:{reaction:"reaction"},standalone:!1,features:[M([_]),P],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],[4,"veltDynamicTemplate"],[1,"velt-reaction-pin-tooltip-user-avatar",3,"size","user"]],template:function(n,r){n&1&&d(0,Kn,2,6,"ng-container",0),n&2&&l("ngIf",r.componentConfigSignal())},dependencies:[j,A,U,cn,z],styles:["[_nghost-%COMP%]:empty{display:none}snippyly-user-avatar[_ngcontent-%COMP%]{display:flex}"],changeDetection:0});let t=o;return t})();var fn=t=>({componentConfigSignal:t}),qn=(t,o)=>({condition:t,data:o}),ei=(t,o,i,e,n)=>({template:t,context:o,componentName:"velt-reaction-pin-tooltip-user-name-wireframe",variant:i,setIfCondition:e,componentElementRef:n});function ti(t,o){if(t&1&&(b(0,"span",7),Ue(1),T(2,"translate"),x()),t&2){let i=a(6);k("data-testid",i.componentId+"-suffix"),s(),tt("(",D(2,2,"You"),")")}}function ni(t,o){if(t&1&&(p(0),b(1,"span",5),Ue(2),T(3,"translate"),x(),d(4,ti,3,4,"span",6),g()),t&2){let i=a(4).ngIf,e=a();s(),k("data-testid",e.componentId+"-name"),s(),Ot(D(3,3,(e.reaction==null||e.reaction.from==null?null:e.reaction.from.name)||(e.reaction==null||e.reaction.from==null?null:e.reaction.from.email))),s(2),l("ngIf",(e.reaction==null||e.reaction.from==null?null:e.reaction.from.userId)===(i==null||i.user==null?null:i.user.userId))}}function ii(t,o){if(t&1&&(p(0),d(1,ni,5,5,"ng-container",4),g()),t&2){a(2);let i=X(3),e=a(2);s(),l("ngIf",(e.reaction==null||e.reaction.from==null?null:e.reaction.from.name)||(e.reaction==null||e.reaction.from==null?null:e.reaction.from.email))("ngIfElse",i)}}function oi(t,o){if(t&1&&(p(0),d(1,ii,2,2,"ng-container",1),g()),t&2){let i=a(3);s(),l("ngIf",i.reaction)}}function ri(t,o){t&1&&F(0,"velt-skeleton-loader-internal",8)}function ai(t,o){if(t&1&&(p(0),d(1,oi,2,1,"ng-container",3)(2,ri,1,0,"ng-template",null,0,oe),g()),t&2){let i=a().ngIf,e=a();s(),l("veltDynamicTemplate",B(3,ei,e.template,y(1,fn,e.componentConfigSignal),i==null?null:i.variant,e.setIfCondition.bind(e),e.elementRef))}}function ci(t,o){if(t&1&&(p(0),d(1,ai,4,9,"ng-container",2),g()),t&2){let i=a();s(),l("veltIf",E(3,qn,i.conditionSignal(),y(1,fn,i.componentConfigSignal)))}}var $e=(()=>{let o=class o extends W{constructor(e,n,r){super(e,r,n),this.elementRef=e,this.loggingService=n,this.dynamicDataService=r,this.componentId="velt-reaction-pin-tooltip-name",super.initializeComponentConfigSignal(new ee)}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in ReactionPinTooltipUserNameComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in ReactionPinTooltipUserNameComponent ngOnDestroy:",e)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in ReactionPinTooltipUserNameComponent setupA11yAttributes:",e)}}};o.\u0275fac=function(n){return new(n||o)(v(O),v(I),v(_))},o.\u0275cmp=w({type:o,selectors:[["velt-reaction-pin-tooltip-user-name-internal"]],inputs:{reaction:"reaction"},standalone:!1,features:[M([_]),P],decls:1,vars:1,consts:[["loadingTemplateRef",""],[4,"ngIf"],[4,"veltIf"],[4,"veltDynamicTemplate"],[4,"ngIf","ngIfElse"],[1,"velt-reaction-pin-tooltip-user-name"],["class","velt-reaction-pin-tooltip-user-name-suffix",4,"ngIf"],[1,"velt-reaction-pin-tooltip-user-name-suffix"],["height","20px","width","64px","borderRadius","20px"]],template:function(n,r){n&1&&d(0,ci,2,6,"ng-container",1),n&2&&l("ngIf",r.componentConfigSignal())},dependencies:[j,A,U,at,z],styles:["[_nghost-%COMP%]{display:flex;align-items:center;gap:var(--velt-spacing-sm)}[_nghost-%COMP%]:empty{display:none}"],changeDetection:0});let t=o;return t})();var _n=(t,o)=>({componentConfigSignal:t,reaction:o}),si=(t,o)=>({condition:t,data:o}),mi=(t,o,i,e,n)=>({template:t,context:o,componentName:"velt-reaction-pin-tooltip-user-wireframe",variant:i,setIfCondition:e,componentElementRef:n});function di(t,o){if(t&1&&(b(0,"div",3),T(1,"translate"),T(2,"translate"),F(3,"velt-reaction-pin-tooltip-user-avatar-internal",4)(4,"velt-reaction-pin-tooltip-user-name-internal",5),x()),t&2){let i=a(3);k("data-testid",i.componentId)("aria-label",D(1,5,"Reaction by")+" "+D(2,7,(i.reaction==null||i.reaction.from==null?null:i.reaction.from.name)||(i.reaction==null||i.reaction.from==null?null:i.reaction.from.email)||"user")),s(3),l("reaction",i.reaction),s(),l("reaction",i.reaction)("componentConfigSignal",i.componentConfigSignal)}}function vi(t,o){if(t&1&&(p(0),d(1,di,5,9,"div",2),g()),t&2){let i=a().ngIf,e=a();s(),l("veltDynamicTemplate",B(4,mi,e.template,E(1,_n,e.componentConfigSignal,e.reaction),i==null?null:i.variant,e.setIfCondition.bind(e),e.elementRef))}}function pi(t,o){if(t&1&&(p(0),d(1,vi,2,10,"ng-container",1),g()),t&2){let i=a();s(),l("veltIf",E(4,si,i.conditionSignal(),E(1,_n,i.componentConfigSignal,i.reaction)))}}var He=(()=>{let o=class o extends W{set _userWireframe(e){try{this.userWireframe=e,this.userWireframe?this.template=this.domService.deepCloneElement(this.userWireframe):this.template=null}catch{}}constructor(e,n,r,c){super(n,c,r),this.domService=e,this.elementRef=n,this.loggingService=r,this.dynamicDataService=c,this.componentId="velt-reaction-pin-tooltip-user",super.initializeComponentConfigSignal(new ee)}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in ReactionPinTooltipUserComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in ReactionPinTooltipUserComponent ngOnDestroy:",e)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in ReactionPinTooltipUserComponent setupA11yAttributes:",e)}}};o.\u0275fac=function(n){return new(n||o)(v(xe),v(O),v(I),v(_))},o.\u0275cmp=w({type:o,selectors:[["velt-reaction-pin-tooltip-user-internal"]],inputs:{reaction:"reaction",_userWireframe:[0,"userWireframe","_userWireframe"]},standalone:!1,features:[M([_]),P],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],["class","v-tooltip-reaction-user velt-reaction-pin-tooltip-user","role","listitem",4,"veltDynamicTemplate"],["role","listitem",1,"v-tooltip-reaction-user","velt-reaction-pin-tooltip-user"],[3,"reaction"],[3,"reaction","componentConfigSignal"]],template:function(n,r){n&1&&d(0,pi,2,7,"ng-container",0),n&2&&l("ngIf",r.componentConfigSignal())},dependencies:[j,A,U,Ve,$e,z],styles:["[_nghost-%COMP%]:empty{display:none}.velt-reaction-pin-tooltip-user[_ngcontent-%COMP%]{display:flex;align-items:center;gap:var(--velt-spacing-sm);padding:var(--velt-spacing-sm)}"],changeDetection:0});let t=o;return t})();var Cn=t=>({componentConfigSignal:t}),ui=(t,o)=>({condition:t,data:o}),hi=(t,o,i,e,n)=>({template:t,context:o,componentName:"velt-reaction-pin-tooltip-users-wireframe",variant:i,setIfCondition:e,componentElementRef:n,replaceTemplate:!1});function fi(t,o){if(t&1&&(b(0,"div",5),F(1,"velt-reaction-pin-tooltip-user-internal",6),x()),t&2){let i=o.$implicit,e=o.index,n=a(4);k("data-testid",n.componentId+"-item-"+e),s(),l("userWireframe",n.userTemplate)("reaction",i)("componentConfigSignal",n.componentConfigSignal)}}function _i(t,o){if(t&1&&(p(0),b(1,"div",3),T(2,"translate"),d(3,fi,2,4,"div",4),x(),g()),t&2){let i=a(2).ngIf,e=a();s(),k("data-testid",e.componentId)("aria-label",D(2,3,"Users who reacted")),s(2),l("ngForOf",i==null||i.annotation==null?null:i.annotation.reactions)}}function Ci(t,o){if(t&1&&(p(0),d(1,_i,4,5,"ng-container",2),g()),t&2){let i=a().ngIf,e=a();s(),l("veltDynamicTemplate",B(3,hi,e.template,y(1,Cn,e.componentConfigSignal),i==null?null:i.variant,e.setIfCondition.bind(e),e.elementRef))}}function bi(t,o){if(t&1&&(p(0),d(1,Ci,2,9,"ng-container",1),g()),t&2){let i=a();s(),l("veltIf",E(3,ui,i.conditionSignal(),y(1,Cn,i.componentConfigSignal)))}}var Ye=(()=>{let o=class o extends W{constructor(e,n,r){super(e,r,n),this.elementRef=e,this.loggingService=n,this.dynamicDataService=r,this.componentId="velt-reaction-pin-tooltip-users",super.initializeComponentConfigSignal(new ee)}ngOnInit(){try{if(super.ngOnInit(),this.setupA11yAttributes(),!this.userTemplate){let e=this.template?.querySelector("velt-reaction-pin-tooltip-user-wireframe");be(e)||(this.userTemplate=e)}}catch{}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in ReactionPinTooltipUsersComponent ngOnDestroy:",e)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in ReactionPinTooltipUsersComponent setupA11yAttributes:",e)}}};o.\u0275fac=function(n){return new(n||o)(v(O),v(I),v(_))},o.\u0275cmp=w({type:o,selectors:[["velt-reaction-pin-tooltip-users-internal"]],standalone:!1,features:[M([_]),P],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],[4,"veltDynamicTemplate"],["role","list",1,"velt-reaction-pin-tooltip-users"],["role","presentation",4,"ngFor","ngForOf"],["role","presentation"],[3,"userWireframe","reaction","componentConfigSignal"]],template:function(n,r){n&1&&d(0,bi,2,6,"ng-container",0),n&2&&l("ngIf",r.componentConfigSignal())},dependencies:[we,j,A,U,He,z],styles:["[_nghost-%COMP%]:empty{display:none}.velt-reaction-pin-tooltip-users[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:var(--velt-spacing-xs)}"],changeDetection:0});let t=o;return t})();var Ii=t=>({componentConfigSignal:t}),Si=(t,o)=>({template:t,context:o});function yi(t,o){t&1&&de(0)}function ki(t,o){if(t&1&&(b(0,"velt-shadow-dom-internal"),d(1,yi,1,0,"ng-container",3),x()),t&2){a();let i=X(3);s(),l("ngTemplateOutlet",i)}}function Ri(t,o){if(t&1&&(b(0,"div",5),T(1,"translate"),F(2,"velt-reaction-pin-tooltip-users-internal",6),x()),t&2){let i=a(3);k("data-testid",i.componentId)("aria-label",D(1,4,"Reaction details")),s(2),l("componentConfigSignal",i.componentConfigSignal),k("data-testid",i.componentId+"-users")}}function Ti(t,o){if(t&1&&d(0,Ri,3,6,"div",4),t&2){let i=a(2);l("veltDynamicTemplate",E(3,Si,i.template,y(1,Ii,i.componentConfigSignal)))}}function Ei(t,o){if(t&1&&(p(0),d(1,ki,2,1,"velt-shadow-dom-internal",2)(2,Ti,1,6,"ng-template",null,0,oe),g()),t&2){let i=X(3),e=a();s(),l("ngIf",e.shadowDom&&!e.template||e.template&&e.isExplicitShadowDom)("ngIfElse",i)}}var Xe=(()=>{let o=class o extends ue{set shadowDom(e){this._shadowDom=e}get shadowDom(){return this._shadowDom}constructor(e,n,r,c,u){super(r,c,void 0,void 0,void 0,u,e),this.loggingService=e,this.wireframeService=n,this.elementRef=r,this.themeService=c,this.dynamicDataService=u,this._shadowDom=!0,this.isExplicitShadowDom=!1,this.componentId="velt-reaction-pin-tooltip",this.subscriptions=[]}ngOnInit(){try{this.loggingService.log("%c[WB] Calling FUNCTION: ngOnInit","color: green;"),super.ngOnInit();let e=this.elementRef.nativeElement,n=e.getAttribute("shadow-dom")??e.getAttribute("shadowdom");this.isExplicitShadowDom=n!==null&&n!=="false",this.setupA11yAttributes();let r="velt-reaction-pin-tooltip-wireframe";this.variant&&(r+=`---${this.variant}`),this.subscriptions.push(this.wireframeService.getWireframe$(r).subscribe(c=>{if(c){let u=document.createElement(c.tagName);u.innerHTML=c.innerHTML,this.template=u}}))}catch(e){this.catchError("Error in ReactionPinTooltipComponent OnInit: ",e)}}ngOnDestroy(){this.loggingService.log("%c[WB] Calling FUNCTION: ngOnDestroy","color: green;");try{super.ngOnDestroy(),this.unsubscribe()}catch(e){this.catchError("Error in ReactionPinTooltipComponent ondestroy: ",e)}}setupA11yAttributes(){try{let e=this.elementRef.nativeElement;e.setAttribute("role","tooltip"),e.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in ReactionPinTooltipComponent setupA11yAttributes:",e)}}unsubscribe(){this.loggingService.log("%c[WB] Calling FUNCTION: unsubscribe","color: green;");try{this.subscriptions.map(e=>{e.unsubscribe()}),this.subscriptions=[]}catch(e){this.catchError("Error in ReactionPinTooltipComponent unsubscribe: ",e)}}catchError(e,n,r){try{this.loggingService.catch(e,n,N(R({},r||{}),{annotationId:this.componentConfigSignal()?.annotation?.annotationId}))}catch{}}};o.\u0275fac=function(n){return new(n||o)(v(I),v(ce),v(O),v(ge),v(_))},o.\u0275cmp=w({type:o,selectors:[["velt-reaction-pin-tooltip-internal"]],inputs:{shadowDom:"shadowDom",variant:"variant"},standalone:!1,features:[M([_]),P],decls:1,vars:1,consts:[["reactionPinTooltipRef",""],[4,"ngIf"],[4,"ngIf","ngIfElse"],[4,"ngTemplateOutlet"],["class","velt-reaction-pin-tooltip","role","tooltip",4,"veltDynamicTemplate"],["role","tooltip",1,"velt-reaction-pin-tooltip"],[3,"componentConfigSignal"]],template:function(n,r){n&1&&d(0,Ei,4,2,"ng-container",1),n&2&&l("ngIf",r.componentConfigSignal())},dependencies:[j,ve,Ie,A,Ye,z],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%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent)}[_nghost-%COMP%]:empty{display:none}[dark][_nghost-%COMP%]{--velt-green: var(--velt-dark-mode-green);--velt-magenta: var(--velt-dark-mode-magenta);--velt-amber: var(--velt-dark-mode-amber);--velt-purple: var(--velt-dark-mode-purple);--velt-cyan: var(--velt-dark-mode-cyan);--velt-orange: var(--velt-dark-mode-orange);--velt-black: var(--velt-dark-mode-black);--velt-white: var(--velt-dark-mode-white);--velt-gray: var(--velt-dark-mode-gray);--velt-error: var(--velt-dark-mode-error);--velt-error-hover: var(--velt-dark-mode-error-hover);--velt-error-foreground: var(--velt-dark-mode-error-foreground);--velt-error-light: var(--velt-dark-mode-error-light);--velt-error-transparent: var(--velt-dark-mode-error-transparent);--velt-warning: var(--velt-dark-mode-warning);--velt-warning-hover: var(--velt-dark-mode-warning-hover);--velt-warning-foreground: var(--velt-dark-mode-warning-foreground);--velt-warning-light: var(--velt-dark-mode-warning-light);--velt-warning-transparent: var(--velt-dark-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-dark-mode-success);--velt-success-hover: var(--velt-dark-mode-success-hover);--velt-success-foreground: var(--velt-dark-mode-success-foreground);--velt-success-light: var(--velt-dark-mode-success-light);--velt-success-transparent: var(--velt-dark-mode-success-transparent);--velt-accent: var(--velt-dark-mode-accent);--velt-accent-text: var(--velt-dark-mode-accent-text);--velt-accent-hover: var(--velt-dark-mode-accent-hover);--velt-accent-foreground: var(--velt-dark-mode-accent-foreground);--velt-accent-light: var(--velt-dark-mode-accent-light);--velt-accent-transparent: var(--velt-dark-mode-accent-transparent);--velt-text-0: var(--velt-dark-mode-text-0);--velt-text-1: var(--velt-dark-mode-text-1);--velt-text-2: var(--velt-dark-mode-text-2);--velt-text-3: var(--velt-dark-mode-text-3);--velt-text-4: var(--velt-dark-mode-text-4);--velt-text-5: var(--velt-dark-mode-text-5);--velt-text-6: var(--velt-dark-mode-text-6);--velt-text-7: var(--velt-dark-mode-text-7);--velt-text-8: var(--velt-dark-mode-text-8);--velt-text-9: var(--velt-dark-mode-text-9);--velt-text-10: var(--velt-dark-mode-text-10);--velt-text-11: var(--velt-dark-mode-text-11);--velt-text-12: var(--velt-dark-mode-text-12);--velt-background-0: var(--velt-dark-mode-background-0);--velt-background-1: var(--velt-dark-mode-background-1);--velt-background-2: var(--velt-dark-mode-background-2);--velt-background-3: var(--velt-dark-mode-background-3);--velt-background-4: var(--velt-dark-mode-background-4);--velt-background-5: var(--velt-dark-mode-background-5);--velt-background-6: var(--velt-dark-mode-background-6);--velt-background-7: var(--velt-dark-mode-background-7);--velt-background-8: var(--velt-dark-mode-background-8);--velt-background-9: var(--velt-dark-mode-background-9);--velt-background-10: var(--velt-dark-mode-background-10);--velt-border-0: var(--velt-dark-mode-border-0);--velt-border-1: var(--velt-dark-mode-border-1);--velt-border-2: var(--velt-dark-mode-border-2);--velt-border-3: var(--velt-dark-mode-border-3);--velt-border-4: var(--velt-dark-mode-border-4);--velt-border-5: var(--velt-dark-mode-border-5);--velt-border-6: var(--velt-dark-mode-border-6);--velt-border-7: var(--velt-dark-mode-border-7);--velt-border-8: var(--velt-dark-mode-border-8);--velt-border-9: var(--velt-dark-mode-border-9);--velt-border-10: var(--velt-dark-mode-border-10);--velt-background-transparent: var(--velt-dark-mode-background-transparent);--velt-border-transparent: var(--velt-dark-mode-border-transparent);--velt-animation-transparent: var(--velt-dark-mode-animation-transparent)}.velt-reaction-pin-tooltip[_ngcontent-%COMP%]{margin-block:8px;opacity:1;padding:4px;border-radius:var(--velt-border-radius-md);background:var(--velt-background-0);box-shadow:0 4px 21px #00000014;display:flex;flex-direction:column;gap:var(--velt-spacing-xs);color:var(--velt-text-0);font-size:var(--velt-font-size-xs);font-style:normal;font-weight:500;line-height:normal}.velt-reaction-pin-tooltip[_ngcontent-%COMP%]:empty{display:none}"],changeDetection:0});let t=o;return t})();var Oi=["trigger"],wi=["overlay"],bn=t=>({componentConfigSignal:t}),xn=(t,o)=>({template:t,context:o}),Pi=(t,o)=>({reactionAnnotation:t,user:o});function Mi(t,o){if(t&1){let i=Z();b(0,"div",8)(1,"div",9),T(2,"translate"),T(3,"translate"),q("click",function(n){return J(i),a(4).onReactionClick(),K(n.stopPropagation())}),F(4,"div",10),T(5,"emoji"),x()()}if(t&2){let i=a(3).ngIf,e=a();k("data-testid",e.componentId+"-timeline"),s(),k("data-testid",e.componentId+"-timeline-item")("aria-label",D(2,4,"React with")+" "+D(3,6,(i==null||i.annotation==null?null:i.annotation.icon)||"emoji")),s(3),l("innerHTML",Le(5,8,i==null||i.annotation==null?null:i.annotation.icon,i==null?null:i.annotation),Ee)}}function ji(t,o){if(t&1&&(p(0),F(1,"velt-reaction-pin-emoji-internal",13)(2,"velt-reaction-pin-count-internal",13),g()),t&2){let i=a(5);s(),l("componentConfigSignal",i.componentConfigSignal),s(),l("componentConfigSignal",i.componentConfigSignal)}}function Ai(t,o){if(t&1){let i=Z();b(0,"div")(1,"div",11),T(2,"translate"),T(3,"translate"),q("click",function(n){return J(i),a(4).onReactionClick(),K(n.stopPropagation())}),d(4,ji,3,2,"ng-container",12),x()()}if(t&2){let i=a(3).ngIf,e=a();s(),fe("velt-reaction-pin--default",!e.template)("velt-reaction-pin--no-reactions",!(!(i==null||i.annotation==null||i.annotation.reactions==null)&&i.annotation.reactions.length)),k("data-testid",e.componentId+"-default")("aria-label",D(2,7,"React with")+" "+D(3,9,(i==null||i.annotation==null?null:i.annotation.icon)||"emoji")),s(3),l("veltDynamicTemplate",E(13,xn,e.template,y(11,bn,e.componentConfigSignal)))}}function Fi(t,o){if(t&1&&(p(0),b(1,"div",5),d(2,Mi,6,11,"div",6)(3,Ai,5,16,"div",7),x(),g()),t&2){let i=a(3);s(),l("ngSwitch",i.type),s(),l("ngSwitchCase","timeline")}}function Ni(t,o){if(t&1){let i=Z();b(0,"div",9),T(1,"translate"),T(2,"translate"),q("click",function(n){return J(i),a(6).onReactionClick(),K(n.stopPropagation())}),F(3,"div",10),T(4,"emoji"),x()}if(t&2){let i=a(5).ngIf,e=a();fe("active",i==null?null:i.isReactionSelectedByCurrentUser),k("data-testid",e.componentId+"-timeline-item")("aria-pressed",i==null?null:i.isReactionSelectedByCurrentUser)("aria-label",D(1,6,"React with")+" "+D(2,8,(i==null||i.annotation==null?null:i.annotation.icon)||"emoji")),s(3),l("innerHTML",Le(4,10,i==null||i.annotation==null?null:i.annotation.icon,i==null?null:i.annotation),Ee)}}function Bi(t,o){if(t&1&&(b(0,"div",8)