@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 • 185 kB
JavaScript
import{a as At,b as Oe}from"./chunk-4ACOV475.js";import{b as Ie}from"./chunk-WTYACTR5.js";import{ca as _t,da as x,ea as Ht,fa as dt,ga as ke}from"./chunk-KU45CEXD.js";import{$ as et,Aa as Bt,Bc as pe,Ca as Lt,Cf as he,Ee as ge,Fa as f,Ib as H,Kb as Dt,L as ie,La as $t,Nb as B,Nh as ut,Ob as wt,Oh as _e,Pa as D,Pb as X,Qb as Gt,Ra as zt,T as gt,U as ae,Ua as P,Wa as Vt,Ya as U,_a as g,_b as F,a as d,ac as Ft,b as h,ba as le,bb as se,bc as R,be as Zt,bi as Tt,c as re,ca as G,cc as O,da as Q,db as M,dc as rt,di as L,ec as ft,ei as be,fa as ce,fb as w,fc as z,g as pt,gb as T,gc as de,gh as at,ha as St,hc as me,ia as yt,ja as ct,jh as fe,ji as xe,k as kt,kc as N,l as jt,la as st,lb as v,lc as j,li as Se,mb as S,mi as Et,nb as I,ob as Y,p as xt,pa as nt,pc as W,qa as A,rf as ue,rh as Ce,sb as y,sc as it,tb as k,tc as Ct,ub as $,vb as It,vc as Xt,w as Ut,wa as ot,xb as Ot,xc as ve,yi as ye,zb as l}from"./chunk-GR3NESUB.js";var De=(()=>{let r=class r{constructor(t){this.loggingService=t,this.autocompleteDataMap$=new jt({}),this.onAutocompleteChipClick$=new kt;try{this.loggingService.log("%c[WB] Creating CLASS: AutocompleteService","color: blue;"),this.create({hotkey:"@",type:"contact",data:[]})}catch(e){this.loggingService.catch("Error in AutocompleteService constructor: ",e)}}create(t){try{if(this.loggingService.log("%c[WB] Calling AutocompleteService FUNCTION: create","color: green;"),t?.hotkey){let e=this.autocompleteDataMap$.value;e[t.hotkey]=t,this.autocompleteDataMap$.next(e)}}catch(e){this.loggingService.catch("Error in AutocompleteService create: ",e)}}remove(t){try{this.loggingService.log("%c[WB] Calling AutocompleteService FUNCTION: remove","color: green;");let e=this.autocompleteDataMap$.value;delete e[t],this.autocompleteDataMap$.next(e)}catch(e){this.loggingService.catch("Error in AutocompleteService remove: ",e)}}getAutocompleteDataMap$(){return this.autocompleteDataMap$.asObservable()}getAutocompleteDataMap(){return this.autocompleteDataMap$.value}setOnAutocompleteChipClick(t){this.onAutocompleteChipClick$.next(t)}getOnAutocompleteChipClick$(){return this.onAutocompleteChipClick$.asObservable()}};r.\u0275fac=function(e){return new(e||r)(G(L))},r.\u0275prov=et({token:r,factory:r.\u0275fac,providedIn:"root"});let n=r;return n})();var we=(()=>{let r=class r{constructor(t,e,i,a){this.docService=t,this.loggingService=e,this.authService=i,this.configService=a;try{this.loggingService.log("%c[WB] Creating CLASS: MetadataService","color: blue;")}catch(c){this.loggingService.catch("Error in MetadataService constructor: ",c)}}getGlobalMetadata(){return pt(this,null,function*(){try{let t=this.authService.getUser();if(!t)return this.loggingService.catch("User not found. Ensure Identify method is called.",void 0,void 0,!0),{};let e=this.docService.getOrganizationMetadata(t?.organizationId),i=this.docService.getDocumentMetadataOfAvailableDocuments(),a=this.docService.getLocation();e&&(e=JSON.parse(JSON.stringify(e)),delete e?.organizationId,e.organizationId=e?.clientOrganizationId,delete e?.clientOrganizationId,delete e?.pageInfo),i&&(i=JSON.parse(JSON.stringify(i)),i.forEach(u=>{delete u?.locations,delete u?.location,delete u?.locationId,delete u?.pageInfo,delete u?.documentId,u.documentId=u?.clientDocumentId,delete u?.clientDocumentId,delete u?.veltFolderId,u?.clientOrganizationId&&(u.organizationId=u?.clientOrganizationId,delete u?.clientOrganizationId)}));let c=[];a&&(a=JSON.parse(JSON.stringify(a)),a?.location&&c.push(a?.location));let m=this.docService.getLocations();m&&Object.values(m).forEach(u=>{u?.location&&c.push(u?.location)});let s=this.docService.getDocumentPaths()?.folderId;return{organization:e,documents:i,locations:c,folderId:s}}catch(t){return this.loggingService.catch("Error in MetadataService getGlobalMetadata: ",t),{}}})}getDebugInfo(){return pt(this,null,function*(){try{let t=this.authService.getUser();if(!t)return null;let e,i;t&&(e=Ce(t)??void 0,i=JSON.parse(JSON.stringify(t)),delete i?.contacts);let a=this.configService.getApiKey(),c=window?.Velt?.version,m=this.docService.getOrganizationMetadata(t?.organizationId),s,p;m&&(s=JSON.parse(JSON.stringify(m)),delete s?.organizationId,s.organizationId=s?.clientOrganizationId,delete s?.clientOrganizationId,delete s?.pageInfo,delete s?.apiKey,p=JSON.parse(JSON.stringify(m)),delete p?.clientOrganizationId,delete p?.pageInfo,delete p?.apiKey);let u=this.docService.getDocumentMetadataOfAvailableDocuments(),E=this.docService.getLocation(),b=[],_=[];E&&(b.push(E),E?.location&&_.push(E?.location));let C=this.docService.getLocations();C&&Object.values(C).forEach(V=>{b.push(V),V?.location&&_.push(V?.location)});let K=[],Z=[];u&&(K=JSON.parse(JSON.stringify(u)),K.forEach(V=>{delete V?.apiKey,delete V?.locations,delete V?.location,delete V?.locationId,delete V?.pageInfo,delete V?.documentId,V.documentId=V?.clientDocumentId,delete V?.clientDocumentId,delete V?.veltFolderId,V?.clientOrganizationId&&(V.organizationId=V?.clientOrganizationId,delete V?.clientOrganizationId)}),Z=JSON.parse(JSON.stringify(u)),Z.forEach(V=>{delete V?.apiKey,delete V?.locations,delete V?.location,delete V?.locationId,delete V?.pageInfo,delete V?.clientDocumentId,V.folderId=V?.veltFolderId,delete V?.veltFolderId,delete V?.clientOrganizationId}));let lt,Nt=this.docService.getDocumentPaths();Nt?.folderId&&Nt?.veltFolderId&&(lt={folderId:Nt?.folderId,veltFolderId:Nt?.veltFolderId});let Yt,Mt;lt&&(Yt=JSON.parse(JSON.stringify(lt)),delete Yt?.veltFolderId,Mt=JSON.parse(JSON.stringify(lt)),Mt.folderId=Mt.veltFolderId,delete Mt?.veltFolderId);let Pt={};return Pt.veltVersion=c,Pt.apiKey=a,Pt.serverMap={organization:p??void 0,documents:Z,locations:b??void 0,folder:Mt??void 0,user:i??void 0,accessFields:this.docService.getProcessedDocContext()??void 0},Pt.clientMap={organization:s??void 0,documents:K,locations:_??void 0,folder:Yt??void 0,user:e??void 0,context:this.docService.getDocContext()??void 0},Pt}catch(t){return this.loggingService.catch("Error in MetadataService getDebugInfo: ",t),null}})}getDebugInfo$(){return Ut([this.authService.getUser$(),this.docService.getOrganizationConfig$(),this.docService.getOrganizationMetadataMap$(),this.docService.getAllDocumentMetadataMap$(),this.docService.getDocContext$()]).pipe(gt(()=>pt(this,null,function*(){return yield this.getDebugInfo()})),ie(fe))}};r.\u0275fac=function(e){return new(e||r)(G(ye),G(L),G(Et),G(be))},r.\u0275prov=et({token:r,factory:r.\u0275fac,providedIn:"root"});let n=r;return n})();var mt=class{constructor(){this.isGroupHeader=!1,this.isGroupMember=!1,this.isNewContact=!1,this.disabled=!1}},Rt=class{constructor(){this.appState={user:null,darkMode:!1},this.featureState={customAutocompleteSearch:!1,expandMentionGroups:!1,showMentionGroupsFirst:!1,showMentionGroupsOnly:!1,customGroupsEnabled:!1,paginatedContactList:!1,atHereEnabled:!1,showAtHere:!1},this.data={userContacts:[],organizationGroups:[],userDocumentContacts:[],flattenedItems:[],hereUserContact:{name:"here",email:"",userId:"here",visibility:"here"},atHereDescription:null,autocompleteDataMap:{},selectedAutocompleteData:void 0,newUserContact:void 0,newUserContactError:void 0},this.uiState={variant:void 0,autoCompleteScrollConfig:{itemSize:55,minBufferPx:350,maxBufferPx:600,templateCacheSize:350}},this.trackByFlattenedItem=(r,o)=>{try{return o?.id||r.toString()}catch{return r.toString()}},this.onOptionClick=()=>{}}};function qt(){return{panelOpen:!1,filterText:"",highlightedIndex:-1,autocompleteDisabledPositions:new Set,darkMode:!1,variant:void 0}}var Te=new le("AutocompleteLocalUIStateSignal");var Wt=(()=>{let r=class r{constructor(t,e,i,a,c,m){this.authService=t,this.contactService=e,this.autocompleteService=i,this.serviceBook=a,this.themeService=c,this.loggingService=m,this.contextMap=new Map,this.registryMap=new Map,this.serviceSubscriptions=[],this.currentUser=null,this.currentDarkMode=!1,this.currentUserContacts=[],this.currentOrganizationGroups=[],this.currentUserDocumentContacts=[],this.currentAutocompleteDataMap={},this.currentAtHereEnabled=!1,this.currentAtHereLabel="here",this.currentAtHereDescription=null,this.currentCustomAutocompleteSearch=!1,this.currentExpandMentionGroups=!1,this.currentShowMentionGroupsFirst=!1,this.currentShowMentionGroupsOnly=!1,this.currentPaginatedContactList=!1,this.currentAutoCompleteScrollConfig={itemSize:55,minBufferPx:350,maxBufferPx:600,templateCacheSize:350},this.setupSubscriptions()}setupSubscriptions(){try{this.serviceSubscriptions.push(this.authService.getUser$().subscribe(t=>{t&&(this.currentUser=t,this.updateAllContexts(e=>h(d({},e),{appState:h(d({},e.appState),{user:t})})))})),this.serviceSubscriptions.push(this.themeService.getDarkMode$().subscribe(t=>{this.currentDarkMode=t,this.updateAllContexts(e=>h(d({},e),{appState:h(d({},e.appState),{darkMode:t})}))})),this.serviceSubscriptions.push(this.contactService.getUserContacts$().subscribe(t=>{this.currentUserContacts=t?.slice()||[],this.updateAllContexts(e=>h(d({},e),{data:h(d({},e.data),{userContacts:this.buildUserContactsWithHere(this.currentUserContacts)})}))})),this.serviceSubscriptions.push(this.contactService.getOrganizationGroups$().subscribe(t=>{this.currentOrganizationGroups=t||[],this.updateAllContexts(e=>h(d({},e),{data:h(d({},e.data),{organizationGroups:this.currentOrganizationGroups})}))})),this.serviceSubscriptions.push(this.contactService.getUserDocumentContacts$().subscribe(t=>{this.currentUserDocumentContacts=t||[],this.updateAllContexts(e=>h(d({},e),{data:h(d({},e.data),{userDocumentContacts:this.currentUserDocumentContacts})}))})),this.serviceSubscriptions.push(this.autocompleteService.getAutocompleteDataMap$().subscribe(t=>{this.currentAutocompleteDataMap=t||{},this.updateAllContexts(e=>h(d({},e),{data:h(d({},e.data),{autocompleteDataMap:this.currentAutocompleteDataMap})}))})),this.serviceSubscriptions.push(this.contactService.getAtHereEnabled$().subscribe(t=>{this.currentAtHereEnabled=t,this.updateAllContexts(e=>h(d({},e),{featureState:h(d({},e.featureState),{atHereEnabled:t}),data:h(d({},e.data),{userContacts:this.buildUserContactsWithHere(this.currentUserContacts)})}))})),this.serviceSubscriptions.push(this.contactService.getAtHereLabel().subscribe(t=>{this.currentAtHereLabel=t,this.updateAllContexts(e=>h(d({},e),{data:h(d({},e.data),{hereUserContact:h(d({},e.data.hereUserContact),{name:t})})}))})),this.serviceSubscriptions.push(this.contactService.getAtHereDescription().subscribe(t=>{this.currentAtHereDescription=t,this.updateAllContexts(e=>h(d({},e),{data:h(d({},e.data),{atHereDescription:t})}))})),this.serviceSubscriptions.push(this.serviceBook.observe(ut).pipe(gt(t=>t?t.getCustomAutocompleteSearch$():xt)).subscribe(t=>{this.currentCustomAutocompleteSearch=t,this.updateAllContexts(e=>h(d({},e),{featureState:h(d({},e.featureState),{customAutocompleteSearch:t})}))})),this.serviceSubscriptions.push(this.serviceBook.observe(ut).pipe(gt(t=>t?t.getExpandMentionGroups$():xt)).subscribe(t=>{this.currentExpandMentionGroups=t,this.updateAllContexts(e=>h(d({},e),{featureState:h(d({},e.featureState),{expandMentionGroups:t})}))})),this.serviceSubscriptions.push(this.serviceBook.observe(ut).pipe(gt(t=>t?t.getShowMentionGroupsFirst$():xt)).subscribe(t=>{this.currentShowMentionGroupsFirst=t,this.updateAllContexts(e=>h(d({},e),{featureState:h(d({},e.featureState),{showMentionGroupsFirst:t})}))})),this.serviceSubscriptions.push(this.serviceBook.observe(ut).pipe(gt(t=>t?t.getShowMentionGroupsOnly$():xt)).subscribe(t=>{this.currentShowMentionGroupsOnly=t,this.updateAllContexts(e=>h(d({},e),{featureState:h(d({},e.featureState),{showMentionGroupsOnly:t})}))})),this.serviceSubscriptions.push(this.serviceBook.observe(ut).pipe(gt(t=>t?t.getPaginatedContactList$():xt)).subscribe(t=>{this.currentPaginatedContactList=t,this.updateAllContexts(e=>h(d({},e),{featureState:h(d({},e.featureState),{paginatedContactList:t})}))})),this.serviceSubscriptions.push(this.serviceBook.observe(ut).pipe(gt(t=>t?t.getAutoCompleteScrollConfig$():xt)).subscribe(t=>{this.currentAutoCompleteScrollConfig=t,this.updateAllContexts(e=>h(d({},e),{uiState:h(d({},e.uiState),{autoCompleteScrollConfig:t})}))}))}catch(t){this.loggingService.catch("Error in AutocompleteCoreService setupSubscriptions:",t)}}buildUserContactsWithHere(t){try{let e=t?.slice()||[];if(this.currentAtHereEnabled){let i={name:this.currentAtHereLabel,email:"",userId:"here",visibility:"here"};e.find(a=>a?.visibility==="here")||e.unshift(i)}return e}catch(e){return this.loggingService.catch("Error in AutocompleteCoreService buildUserContactsWithHere:",e),t||[]}}getOrCreateContextConfig(t){try{let e=this.contextMap.get(t);if(!e){let i=new Rt;i.appState.user=this.currentUser,i.appState.darkMode=this.currentDarkMode,i.data.userContacts=this.buildUserContactsWithHere(this.currentUserContacts),i.data.organizationGroups=this.currentOrganizationGroups,i.data.userDocumentContacts=this.currentUserDocumentContacts,i.data.autocompleteDataMap=this.currentAutocompleteDataMap,i.data.hereUserContact.name=this.currentAtHereLabel,i.data.atHereDescription=this.currentAtHereDescription,i.featureState.customAutocompleteSearch=this.currentCustomAutocompleteSearch,i.featureState.expandMentionGroups=this.currentExpandMentionGroups,i.featureState.showMentionGroupsFirst=this.currentShowMentionGroupsFirst,i.featureState.showMentionGroupsOnly=this.currentShowMentionGroupsOnly,i.featureState.paginatedContactList=this.currentPaginatedContactList,i.featureState.atHereEnabled=this.currentAtHereEnabled,i.uiState.autoCompleteScrollConfig=this.currentAutoCompleteScrollConfig,e=A(i),this.contextMap.set(t,e)}return e}catch(e){return this.loggingService.catch("Error in AutocompleteCoreService getOrCreateContextConfig:",e),A(new Rt)}}getContextConfig(t){try{return this.contextMap.get(t)}catch(e){this.loggingService.catch("Error in AutocompleteCoreService getContextConfig:",e);return}}setContextConfig(t,e){try{this.contextMap.set(t,e)}catch(i){this.loggingService.catch("Error in AutocompleteCoreService setContextConfig:",i)}}clearContextConfig(t){try{this.contextMap.delete(t),this.registryMap.delete(t)}catch(e){this.loggingService.catch("Error in AutocompleteCoreService clearContextConfig:",e)}}setRegistry(t,e){try{this.registryMap.set(t,e)}catch(i){this.loggingService.catch("Error in AutocompleteCoreService setRegistry:",i)}}getRegistry(t){try{return this.registryMap.get(t)}catch(e){this.loggingService.catch("Error in AutocompleteCoreService getRegistry:",e);return}}findParentAutocompleteId(t){try{let e=t?.nativeElement;if(!e)return;let i=e.parentElement;for(;i;){let a=i.getAttribute?.("autocomplete-id");if(a)return a;if(i.tagName?.toLowerCase()==="velt-autocomplete-context-wrapper"){let c=i.getAttribute?.("autocomplete-id");if(c)return c}i=i.parentElement}return}catch(e){this.loggingService.catch("Error in AutocompleteCoreService findParentAutocompleteId:",e);return}}updateAllContexts(t){try{this.contextMap.forEach(e=>{let i=e();e.set(t(i))})}catch(e){this.loggingService.catch("Error in AutocompleteCoreService updateAllContexts:",e)}}};r.\u0275fac=function(e){return new(e||r)(G(Et),G(_t),G(De),G(Tt),G(Ht),G(L))},r.\u0275prov=et({token:r,factory:r.\u0275fac,providedIn:"root"});let n=r;return n})();var Ee=(()=>{let r=class r{constructor(t,e,i,a){this.coreService=t,this.contactService=e,this.loggingService=i,this.serviceBook=a,this.componentId="velt-autocomplete-panel",this.commentActionsService=null,this.serviceBook.observe(_e).subscribe(c=>this.commentActionsService=c)}filterOptions(t,e,i){try{let c=t().data.selectedAutocompleteData;c&&(c.type==="contact"?this.filterContactOptions(t,e,i):this.filterCustomOptions(t,e))}catch(a){this.loggingService.catch("Error in AutocompleteActionService filterOptions:",a)}}filterContactOptions(t,e,i){try{let a=t(),c=e?.toLowerCase()?.trim()||"",m=new ue;m.email=c;let s=new RegExp(ge.REGEX_EMAIL).test("@"+m?.email),p=a.data.userContacts.slice();a.featureState.customAutocompleteSearch||e&&(p=this.filterContacts(p,m),a.featureState.paginatedContactList&&p.length<3&&this.fetchFilteredUsersFromDb(e).then(()=>{})),a.featureState.atHereEnabled&&a.data.hereUserContact?.name?.includes(c)&&(p?.find(C=>C?.userId==="here")||(p=[a.data.hereUserContact,...p])),i?.length&&(p=p.filter(C=>!i.find(K=>K?.email===C?.email)));let u=e?this.filterGroups(a.data.organizationGroups,e):a.data.organizationGroups,E=p.map(C=>{if(C.visibility==="here"){if(a.data.atHereDescription)C=h(d({},C),{email:a.data.atHereDescription}),C.description=a.data.atHereDescription;else if(a.appState.user&&a.appState.user?.organizationId){let K=a.data.userDocumentContacts?.length||0;C=h(d({},C),{email:`${K} members`}),C.description=`${K} members`}}return{type:"contact",contact:C,disabled:!1}}),b=u.map(C=>({type:"group",group:C})),_=[...E,...b];if(a.featureState.expandMentionGroups)this.buildExpandedGroupItems(t,_,a,m,s);else{let C=_.length?void 0:{type:"contact",contact:m},K=this.createFlattenedItems({allItems:_,newUserContact:C,isExpandedGroups:!1,isCustomGroups:!1,showMentionGroupsOnly:a.featureState.showMentionGroupsOnly,showMentionGroupsFirst:a.featureState.showMentionGroupsFirst});t.update(Z=>h(d({},Z),{data:h(d({},Z.data),{flattenedItems:K,newUserContactError:s?void 0:"Invalid email",newUserContact:C})}))}}catch(a){this.loggingService.catch("Error in AutocompleteActionService filterContactOptions:",a)}}buildExpandedGroupItems(t,e,i,a,c){try{let m=[],s={},p=new Map;e.forEach(C=>{if(C.contact?.userId){let K=he(C.contact.userId);p.set(K,C),s[C.contact.userId]=!1}});let u=new Map;i.data.organizationGroups.forEach(C=>{u.set(C.metadata.clientGroupId,{id:C.metadata.clientGroupId,name:C.metadata.groupName,members:[],userIds:Object.keys(C.users||{})})}),u.forEach(C=>{C.userIds.forEach(K=>{let Z=p.get(K);Z&&(C.members.push(Z),Z.contact?.userId&&(s[Z.contact.userId]=!0))})}),e.forEach(C=>{C.type==="contact"&&C.contact?.userId&&!s[C.contact.userId]&&m.push(C)});let E=Array.from(u.values()),b=e.length?void 0:{type:"contact",contact:a},_=this.createFlattenedItems({allItems:e,contactsWithoutGroup:m,groups:E,newUserContact:b,isExpandedGroups:!0,isCustomGroups:!1,showMentionGroupsOnly:i.featureState.showMentionGroupsOnly,showMentionGroupsFirst:i.featureState.showMentionGroupsFirst});t.update(C=>h(d({},C),{data:h(d({},C.data),{flattenedItems:_,newUserContactError:c?void 0:"Invalid email",newUserContact:b,contactsWithoutGroup:m,groups:E})}))}catch(m){this.loggingService.catch("Error in AutocompleteActionService buildExpandedGroupItems:",m)}}filterCustomOptions(t,e){try{let i=t(),a=i.data.selectedAutocompleteData,c=i.data.autocompleteDataMap?.[a?.hotkey],m=c?.data?.slice()||[];if(i.featureState.customAutocompleteSearch||(e?m=m.filter(p=>p.name?.toLowerCase()?.includes(e?.toLowerCase())):m=a?.data?.slice()||[]),c?.groups&&c.groups.length>0){let p=[],u=new Map;c.groups?.forEach(_=>{u.set(_.id,{id:_.id,name:_.name,members:[]})}),m.forEach(_=>{let C={type:"custom",custom:_};_.groupId&&u.has(_.groupId)?u.get(_.groupId)?.members.push(C):p.push(C)});let E=Array.from(u.values()).filter(_=>_.members.length>0),b=this.createFlattenedItems({allItems:[],contactsWithoutGroup:p,groups:E,isExpandedGroups:!1,isCustomGroups:!0,showMentionGroupsOnly:i.featureState.showMentionGroupsOnly,showMentionGroupsFirst:i.featureState.showMentionGroupsFirst});t.update(_=>h(d({},_),{featureState:h(d({},_.featureState),{customGroupsEnabled:!0}),data:h(d({},_.data),{flattenedItems:b,contactsWithoutGroup:p,groups:E})}))}else{let p=m.map(E=>({type:"custom",custom:E})),u=this.createFlattenedItems({allItems:p,isExpandedGroups:!1,isCustomGroups:!1,showMentionGroupsOnly:i.featureState.showMentionGroupsOnly,showMentionGroupsFirst:i.featureState.showMentionGroupsFirst});t.update(E=>h(d({},E),{featureState:h(d({},E.featureState),{customGroupsEnabled:!1}),data:h(d({},E.data),{flattenedItems:u})}))}}catch(i){this.loggingService.catch("Error in AutocompleteActionService filterCustomOptions:",i)}}createFlattenedItems(t){try{let{allItems:e,contactsWithoutGroup:i,groups:a,newUserContact:c,isExpandedGroups:m=!1,isCustomGroups:s=!1,showMentionGroupsOnly:p=!1,showMentionGroupsFirst:u=!1}=t,E=[];if(m||s){if(!p&&!u&&i?.forEach((b,_)=>{let C=new mt;C.originalItem=b,C.disabled=!!b.disabled,C.id=s?`velt-option-custom-ungrouped-${_}`:`velt-option-user-${_}`,C.testId=s?`${this.componentId}-custom-ungrouped-${_}`:`${this.componentId}-user-${_}`,E.push(C)}),a?.forEach((b,_)=>{if(b?.members?.length){let C=new mt;C.originalItem={type:"group",group:b},C.isGroupHeader=!0,C.disabled=!0,C.group=b,C.id=s?`velt-option-custom-group-${_}`:`velt-option-group-${_}`,C.testId=s?`${this.componentId}-custom-group-${_}`:`${this.componentId}-group-${_}`,E.push(C),b.members.forEach((K,Z)=>{let lt=new mt;lt.originalItem=K,lt.isGroupMember=!0,lt.disabled=K.disabled||!1,lt.id=s?`velt-option-custom-group-${_}-member-${Z}`:`velt-option-group-${_}-member-${Z}`,lt.testId=s?`${this.componentId}-custom-group-${_}-member-${Z}`:`${this.componentId}-group-${_}-member-${Z}`,E.push(lt)})}}),!p&&u&&i?.length){let b=new mt;b.originalItem={type:"group"},b.isGroupHeader=!0,b.disabled=!0,b.groupName="Ungrouped",b.id="velt-option-ungrouped",b.testId=`${this.componentId}-ungrouped`,E.push(b),i.forEach((_,C)=>{let K=new mt;K.originalItem=_,K.isGroupMember=!0,K.disabled=_.disabled||!1,K.id=`velt-option-user-${C}`,K.testId=`${this.componentId}-user-${C}`,E.push(K)})}}else e.forEach((b,_)=>{let C=new mt;C.originalItem=b,C.disabled=b.disabled||!1,C.id=`velt-option-${_}`,C.testId=`${this.componentId}-${_}`,E.push(C)});if(c?.contact?.email){let b=new mt;b.originalItem=c,b.isNewContact=!0,b.id="velt-new-contact-option",b.testId=`${this.componentId}-new-contact`,E.push(b)}return E}catch(e){return this.loggingService.catch("Error in AutocompleteActionService createFlattenedItems:",e),[]}}addContact(t){try{let e=t();e.data.newUserContact?.contact&&(this.contactService.addUserContact(e.data.newUserContact.contact),t.update(i=>h(d({},i),{data:h(d({},i.data),{newUserContact:void 0})})))}catch(e){this.loggingService.catch("Error in AutocompleteActionService addContact:",e)}}callbackOnOptionSelected(t){try{this.contactService.onContactSelected(t)}catch(e){this.loggingService.catch("Error in AutocompleteActionService callbackOnOptionSelected:",e)}}triggerAutocompleteSearch(t,e,i){try{let a={event:t,searchText:e,type:i};this.commentActionsService?.autocompleteSearch(a)}catch(a){this.loggingService.catch("Error in AutocompleteActionService triggerAutocompleteSearch:",a)}}toggleSelection(t,e){try{let a=t().data.multiSelectItems||[],c=a.findIndex(s=>this.isSameItem(s,e)),m;return c>=0?m=[...a.slice(0,c),...a.slice(c+1)]:m=[...a,e],t.update(s=>h(d({},s),{data:h(d({},s.data),{multiSelectItems:m})})),m}catch(i){return this.loggingService.catch("Error in AutocompleteActionService toggleSelection:",i),[]}}confirmSelection(t){try{let i=t().data.multiSelectItems||[];return t.update(a=>h(d({},a),{data:h(d({},a.data),{multiSelectItems:[]})})),[...i]}catch(e){return this.loggingService.catch("Error in AutocompleteActionService confirmSelection:",e),[]}}isSameItem(t,e){try{return t.type!==e.type?!1:t.type==="contact"&&e.type==="contact"?t.contact?.userId&&e.contact?.userId?t.contact.userId===e.contact.userId:t.contact?.email&&e.contact?.email?t.contact.email===e.contact.email:!1:t.type==="custom"&&e.type==="custom"?t.custom?.id&&e.custom?.id?t.custom.id===e.custom.id:!1:t.type==="group"&&e.type==="group"&&t.group?.metadata?.groupId&&e.group?.metadata?.groupId?t.group.metadata.groupId===e.group.metadata.groupId:!1}catch{return!1}}filterContacts(t,e){try{let i=e.email?.toLowerCase();return t?.filter(a=>a?.email?.includes(i)||a?.name?.toLowerCase()?.includes(i)||a?.organizationName?.toLowerCase()?.includes(i))}catch(i){return this.loggingService.catch("Error in AutocompleteActionService _filterContacts:",i),[]}}filterGroups(t,e){try{return t?.filter(i=>i?.metadata?.groupName?.toLowerCase()?.includes(e?.toLowerCase()))}catch(i){return this.loggingService.catch("Error in AutocompleteActionService _filterGroups:",i),[]}}filterCustomItems(t,e){try{return t?.filter(i=>i.name?.toLowerCase()?.includes(e?.toLowerCase()))||[]}catch(i){return this.loggingService.catch("Error in AutocompleteActionService filterCustomItems:",i),[]}}fetchFilteredUsersFromDb(t){return pt(this,null,function*(){try{yield this.contactService.searchUsers(t)}catch(e){this.loggingService.catch("Error in AutocompleteActionService fetchFilteredUsersFromDb:",e)}})}};r.\u0275fac=function(e){return new(e||r)(G(Wt),G(_t),G(L),G(Tt))},r.\u0275prov=et({token:r,factory:r.\u0275fac,providedIn:"root"});let n=r;return n})();var Jt=(()=>{let r=class r{constructor(t){this.loggingService=t,this.subscribers=new Set}register(t){try{if(this.subscribers.add(t),this.lastPayload)try{t(this.lastPayload)}catch(e){this.loggingService.catch("[AUTOCOMPLETE REGISTRY] Error initializing subscriber:",e)}}catch(e){this.loggingService.catch("[AUTOCOMPLETE REGISTRY] Error in register:",e)}}unregister(t){try{this.subscribers.delete(t)}catch(e){this.loggingService.catch("[AUTOCOMPLETE REGISTRY] Error in unregister:",e)}}broadcast(t){try{this.lastPayload=t,this.subscribers.forEach(e=>{try{e(t)}catch(i){this.loggingService.catch("[AUTOCOMPLETE REGISTRY] Error in subscriber:",i)}})}catch(e){this.loggingService.catch("[AUTOCOMPLETE REGISTRY] Error in broadcast:",e)}}getLastPayload(){try{return this.lastPayload}catch(t){this.loggingService.catch("[AUTOCOMPLETE REGISTRY] Error in getLastPayload:",t);return}}};r.\u0275fac=function(e){return new(e||r)(G(L))},r.\u0275prov=et({token:r,factory:r.\u0275fac});let n=r;return n})();function Ae(n,r){try{let o=r?.trim();return o?(n||[]).find(t=>t?.userId===o):void 0}catch{return}}function Me(n,r,o){try{let t=o?.trim();return t?n||(r?.userId===t?r:void 0):void 0}catch{return}}var q=(()=>{let r=class r extends ke{set parentLocalUIState(t){t&&(this.localUIStateSignal=t,this.isLocalUIStateOwner=!1)}get elementRef(){return this.hostElementRef}constructor(){let t=Q(ot),e=Q(Ht),i=Q(ve),a=Q(Tt).get(ut),c=Q(x),m=Q(L);super(t,e,i,a??void 0,void 0,c,m),this.autocompleteId=Xt(),this.defaultCondition=Xt(!0,{transform:s=>{try{return typeof s=="string"?s==="true"||s==="":s}catch{return!0}}}),this._contextData={},this.isLocalUIStateOwner=!1,this.isContextInitialized=!1,this.registryCheckAttempts=0,this.MAX_REGISTRY_CHECK_ATTEMPTS=50,this.onContextPayload=s=>{try{this.isContextInitialized||(this.isContextInitialized=!0),this._autocompleteId=s.autocompleteId,this._contextData=s.contextData||{};let p=this.coreService.getContextConfig(s.autocompleteId);p&&(this.componentConfigSignal.update(u=>d({},u)),this.componentConfigSignal=p,this.cd.markForCheck())}catch(p){this.loggingService.catch("Error in AutocompletePrimitiveThemedComponent onContextPayload:",p)}},this.hostElementRef=t,this.themeService=e,this.dynamicDataService=c,this.loggingService=m,this.coreService=Q(Wt),this.actionService=Q(Ee),this.cd=i,this.commentService=a??void 0,this.registry=Q(Jt,{optional:!0})??void 0,this._userIdContactService=Q(_t),this._userIdAuthService=Q(Et),this.initializeLocalUIState()}resolveUserIdToContact(t,e){try{this._userIdValue=t,this._userIdApply=e,this._userIdSub?.unsubscribe(),this._userIdSub=void 0;let i=t?.trim();if(!i){e(void 0),this.flushChangeDetection();return}let a=this._userIdContactService.getInternalUserContacts()??[],c=Ae(a,i);if(c){e(c),this.flushChangeDetection();return}this._userIdSub=Ut([this._userIdContactService.getUserByUserId$(i),this._userIdAuthService.getUser$()]).subscribe(([m,s])=>{try{let p=Me(m,s,i);e(p),this.flushChangeDetection()}catch(p){this.loggingService.catch("Error resolving userId user:",p)}})}catch(i){this.loggingService.catch("Error looking up userId:",i)}}flushChangeDetection(){try{this.cd?.detectChanges?.()}catch{try{this.cd?.markForCheck?.()}catch{}}}cancelUserIdResolution(){this._userIdSub?.unsubscribe(),this._userIdSub=void 0}resolveUserObjectToContact(t,e){try{if(!t){this._userIdValue?.trim()?this.resolveUserIdToContact(this._userIdValue,this._userIdApply??e):(e(void 0),this.flushChangeDetection());return}this.cancelUserIdResolution();let i=typeof t=="string"?JSON.parse(t):t;e(i),this.flushChangeDetection()}catch(i){this.loggingService.catch("Error parsing userObject:",i)}}initializeLocalUIState(){try{let t=Q(Te,{optional:!0,skipSelf:!0});t?(this.localUIStateSignal=t,this.isLocalUIStateOwner=!1):(this.localUIStateSignal=A(qt()),this.isLocalUIStateOwner=!0)}catch{this.localUIStateSignal=A(qt()),this.isLocalUIStateOwner=!0}}ngOnInit(){try{super.ngOnInit();let t=this.autocompleteId();if(!t){let i=this.hostElementRef?.nativeElement?.getAttribute?.("autocomplete-id");i&&(t=i)}if(this.componentConfigSignal&&this.componentConfigSignal()&&Object.keys(this.componentConfigSignal()).length>0){this.initializeFromConfigSignal(this.componentConfigSignal),this.setupA11yAttributes(),this.setupDarkModeSync();return}if(t){this._autocompleteId=t,this.initializeFromAutocompleteId(t),this.setupA11yAttributes(),this.setupDarkModeSync();return}let e=this.findNearestParentWrapperRegistry();if(e){this.registry=e,this.registry.register(this.onContextPayload);let i=this.registry.getLastPayload?.();i&&this.onContextPayload(i),this.setupA11yAttributes(),this.setupDarkModeSync();return}if(this.registry){this.registry.register(this.onContextPayload);let i=this.registry.getLastPayload?.();i&&this.onContextPayload(i),this.setupA11yAttributes(),this.setupDarkModeSync();return}this.tryRegisterWithContext(),this.setupA11yAttributes(),this.setupDarkModeSync()}catch(t){this.loggingService.catch("Error in AutocompletePrimitiveThemedComponent ngOnInit:",t)}}ngOnDestroy(){try{this.registryCheckTimer&&(clearTimeout(this.registryCheckTimer),this.registryCheckTimer=void 0),this.registry&&this.registry.unregister(this.onContextPayload),this.darkModeConfigSyncSubscription&&this.darkModeConfigSyncSubscription.unsubscribe(),this._userIdSub?.unsubscribe(),this._userIdSub=void 0,super.ngOnDestroy()}catch(t){this.loggingService.catch("Error in AutocompletePrimitiveThemedComponent ngOnDestroy:",t)}}setupA11yAttributes(){}setupDarkModeSync(){try{this.darkModeConfigSyncSubscription=this.onDarkModeChange().subscribe(t=>{try{if(this.componentConfigSignal&&typeof this.componentConfigSignal=="function"){let e=this.componentConfigSignal();e&&e.appState&&e.appState.darkMode!==t&&this.componentConfigSignal.update(i=>h(d({},i),{appState:h(d({},i.appState),{darkMode:t})}))}}catch(e){this.loggingService.catch("Error in darkMode sync subscription:",e)}})}catch(t){this.loggingService.catch("Error in AutocompletePrimitiveThemedComponent setupDarkModeSync:",t)}}findNearestParentWrapperRegistry(){try{let t=this.hostElementRef?.nativeElement;if(!t)return;let e=t.parentElement;for(;e;){if(e.tagName?.toLowerCase()==="velt-autocomplete-context-wrapper"){let i=e.__veltContext;if(i?.registry instanceof Jt)return i.contextData&&(this._contextData=i.contextData),i.registry;let a=window.ng;if(a?.getComponent){let m=a.getComponent(e);if(m?.registry)return m.registry}let c=e.__ngContext__;if(c&&Array.isArray(c))for(let m=0;m<c.length;m++){let s=c[m];if(s&&typeof s=="object"&&s.registry instanceof Jt)return s.registry}}e=e.parentElement}}catch(t){this.loggingService.catch("[AUTOCOMPLETE PRIMITIVE BASE] Error finding parent wrapper registry:",t)}}tryRegisterWithContext(){try{let t=this.coreService.findParentAutocompleteId(this.hostElementRef);if(!t){this.registryCheckAttempts<this.MAX_REGISTRY_CHECK_ATTEMPTS&&(this.registryCheckAttempts++,this.registryCheckTimer=setTimeout(()=>this.tryRegisterWithContext(),10));return}this.registry=this.coreService.getRegistry(t),this.registry?this.registry.register(this.onContextPayload):this.registryCheckAttempts<this.MAX_REGISTRY_CHECK_ATTEMPTS?(this.registryCheckAttempts++,this.registryCheckTimer=setTimeout(()=>this.tryRegisterWithContext(),10)):this.initializeFromDOM(t)}catch(t){this.loggingService.catch("Error in AutocompletePrimitiveThemedComponent tryRegisterWithContext:",t)}}initializeFromDOM(t){try{this._autocompleteId=t;let e=this.coreService.getContextConfig(t);e&&(this.componentConfigSignal.update(i=>d({},i)),this.componentConfigSignal=e,this.isContextInitialized=!0,this.cd.markForCheck())}catch(e){this.loggingService.catch("Error in AutocompletePrimitiveThemedComponent initializeFromDOM:",e)}}initializeFromAutocompleteId(t){try{this._autocompleteId=t;let e=this.coreService.getOrCreateContextConfig(t);this.componentConfigSignal.update(i=>d({},i)),this.componentConfigSignal=e,this.isContextInitialized=!0,this.cd.markForCheck()}catch(e){this.loggingService.catch("Error in AutocompletePrimitiveThemedComponent initializeFromAutocompleteId:",e)}}initializeFromConfigSignal(t){try{this.isContextInitialized=!0,this.cd.markForCheck()}catch(e){this.loggingService.catch("Error in AutocompletePrimitiveThemedComponent initializeFromConfigSignal:",e)}}getContextValue(t){try{let e=this._contextData[t];if(e!=null)return e;let i=this.hostElementRef?.nativeElement?.getAttribute(t);return i!==null?i:void 0}catch(e){this.loggingService.catch("Error in AutocompletePrimitiveThemedComponent getContextValue:",e);return}}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=P({type:r,selectors:[["app-autocomplete-primitive-themed-base"]],inputs:{autocompleteId:[1,"autocompleteId"],defaultCondition:[1,"defaultCondition"],parentLocalUIState:"parentLocalUIState"},standalone:!1,features:[U],decls:0,vars:0,template:function(e,i){},encapsulation:2});let n=r;return n})();var pn=(n,r)=>({componentConfigSignal:n,parentLocalUIState:r}),gn=(n,r)=>({condition:n,data:r}),un=n=>({componentConfigSignal:n}),hn=(n,r,o,t,e)=>({template:n,context:r,componentName:"velt-autocomplete-chip-tooltip-description-wireframe",variant:o,setIfCondition:t,componentElementRef:e}),fn=()=>({});function Cn(n,r){n&1&&$(0)}function _n(n,r){if(n&1&&g(0,Cn,1,0,"ng-container",5),n&2){l(2);let o=H(3);v("ngTemplateOutlet",o)}}function bn(n,r){n&1&&$(0)}function xn(n,r){if(n&1&&g(0,bn,1,0,"ng-container",5),n&2){l(2);let o=H(5);v("ngTemplateOutlet",o)}}function Sn(n,r){n&1&&$(0)}function yn(n,r){if(n&1&&g(0,Sn,1,0,"ng-container",5),n&2){l(2);let o=H(7);v("ngTemplateOutlet",o)}}function kn(n,r){if(n&1&&(y(0),w(1,_n,1,1,"ng-container")(2,xn,1,1,"ng-container")(3,yn,1,1,"ng-container"),k()),n&2){let o=l(2);f(),T((o==null?null:o.type)==="contact"?1:(o==null?null:o.type)==="custom"?2:(o==null?null:o.type)==="group"?3:-1)}}function In(n,r){if(n&1&&(B(0),N(1,"translate")),n&2){let o=l(2);X(" ",j(1,1,(o==null||o.contact==null?null:o.contact.email)||(o==null?null:o.email))," ")}}function On(n,r){if(n&1&&(B(0),N(1,"translate")),n&2){let o=l(2);X(" ",j(1,1,o==null||o.custom==null||o.custom.custom==null?null:o.custom.custom.description)," ")}}function Dn(n,r){if(n&1&&(B(0),N(1,"translate")),n&2){let o,t=l(3),e=l();Gt(" ",(o=e.objectKeys((t==null||t.group==null||t.group.group==null?null:t.group.group.users)||Ft(4,fn)))==null?null:o.length," ",j(1,2,"members")," ")}}function wn(n,r){if(n&1&&w(0,Dn,2,5),n&2){let o=l(2);T(!(o==null||o.group==null)&&o.group.group?0:-1)}}function Tn(n,r){if(n&1&&(y(0),g(1,kn,4,1,"ng-container",4)(2,In,2,3,"ng-template",null,0,W)(4,On,2,3,"ng-template",null,1,W)(6,wn,1,1,"ng-template",null,2,W),k()),n&2){let o=l(),t=l();f(),v("veltDynamicTemplate",z(3,hn,t.template,R(1,un,t.componentConfigSignal),o==null?null:o.variant,t.setIfCondition.bind(t),t.elementRef))}}function En(n,r){if(n&1&&g(0,Tn,8,9,"ng-container",3),n&2){let o=l();v("veltIf",O(4,gn,o.conditionSignal(),O(1,pn,o.componentConfigSignal,o.localUIStateSignal)))}}var Pe=(()=>{let r=class r extends q{set userObject(t){this.resolveUserObjectToContact(t,e=>{this.componentConfigSignal.update(i=>h(d({},i),{type:"contact",contact:e}))})}set userId(t){this.resolveUserIdToContact(t,e=>{this.componentConfigSignal.update(i=>h(d({},i),{type:"contact",contact:e}))})}constructor(){super(),this.componentId="velt-autocomplete-chip-tooltip-description",this.objectKeys=Object.keys,this.componentConfigSignal=A({})}ngOnInit(){try{super.ngOnInit()}catch(t){this.loggingService.catch("Error in AutocompleteChipTooltipDescriptionComponent ngOnInit:",t)}}ngOnDestroy(){try{this._userIdSub?.unsubscribe(),super.ngOnDestroy()}catch(t){this.loggingService.catch("Error in AutocompleteChipTooltipDescriptionComponent ngOnDestroy:",t)}}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=P({type:r,selectors:[["velt-autocomplete-chip-tooltip-description-internal"]],inputs:{userObject:"userObject",userId:"userId"},standalone:!1,features:[F([x]),U],decls:1,vars:1,consts:[["contacEmailRef",""],["customDescriptionRef",""],["groupDescriptionRef",""],[4,"veltIf"],[4,"veltDynamicTemplate"],[4,"ngTemplateOutlet"]],template:function(e,i){if(e&1&&w(0,En,1,7,"ng-container"),e&2){let a;T((a=i.componentConfigSignal())?0:-1,a)}},styles:["[_nghost-%COMP%]:empty{display:none}"],changeDetection:0});let n=r;return n})();function ht(n,r){n&&(n.setAttribute("role","presentation"),n.setAttribute("data-testid",r+"-container"))}var An=(n,r)=>({componentConfigSignal:n,parentLocalUIState:r}),Mn=(n,r)=>({condition:n,data:r}),Pn=n=>({componentConfigSignal:n}),Fn=(n,r,o,t,e)=>({template:n,context:r,componentName:"velt-autocomplete-chip-tooltip-icon-wireframe",variant:o,setIfCondition:t,componentElementRef:e});function Rn(n,r){n&1&&$(0)}function Nn(n,r){if(n&1&&g(0,Rn,1,0,"ng-container",5),n&2){l(2);let o=H(3);v("ngTemplateOutlet",o)}}function jn(n,r){n&1&&$(0)}function Un(n,r){if(n&1&&g(0,jn,1,0,"ng-container",5),n&2){l(2);let o=H(5);v("ngTemplateOutlet",o)}}function Bn(n,r){n&1&&$(0)}function Ln(n,r){if(n&1&&g(0,Bn,1,0,"ng-container",5),n&2){l(2);let o=H(7);v("ngTemplateOutlet",o)}}function $n(n,r){if(n&1&&(y(0),w(1,Nn,1,1,"ng-container")(2,Un,1,1,"ng-container")(3,Ln,1,1,"ng-container"),k()),n&2){let o=l(2);f(),T((o==null?null:o.type)==="contact"?1:(o==null?null:o.type)==="custom"?2:(o==null?null:o.type)==="group"?3:-1)}}function zn(n,r){if(n&1&&Y(0,"snippyly-user-avatar",6),n&2){let o=l(2);v("size",32)("user",o==null?null:o.contact)}}function Vn(n,r){if(n&1&&(Y(0,"div",7),N(1,"safeSvg")),n&2){let o=l(3);v("innerHtml",j(1,1,o==null||o.custom==null||o.custom.custom==null||o.custom.custom.icon==null?null:o.custom.custom.icon.svg),Bt)}}function Gn(n,r){if(n&1&&(S(0,"div",8),Y(1,"img",9),I()),n&2){let o=l(3);f(),v("src",o==null||o.custom==null||o.custom.custom==null||o.custom.custom.icon==null?null:o.custom.custom.icon.url,Lt)}}function Hn(n,r){if(n&1&&(w(0,Vn,2,3,"div",7),w(1,Gn,2,1,"div",8)),n&2){let o=l(2);T(!(o==null||o.custom==null||o.custom.custom==null||o.custom.custom.icon==null)&&o.custom.custom.icon.svg?0:-1),f(),T(!(o==null||o.custom==null||o.custom.custom==null||o.custom.custom.icon==null)&&o.custom.custom.icon.url?1:-1)}}function Wn(n,r){n&1&&(S(0,"div",10),ct(),S(1,"svg",11),Y(2,"path",12),I()())}function Jn(n,r){if(n&1&&(y(0),g(1,$n,4,1,"ng-container",4)(2,zn,1,2,"ng-template",null,0,W)(4,Hn,2,2,"ng-template",null,1,W)(6,Wn,3,0,"ng-template",null,2,W),k()),n&2){let o=l(),t=l();f(),v("veltDynamicTemplate",z(3,Fn,t.template,R(1,Pn,t.componentConfigSignal),o==null?null:o.variant,t.setIfCondition.bind(t),t.elementRef))}}function Kn(n,r){if(n&1&&g(0,Jn,8,9,"ng-container",3),n&2){let o=l();v("veltIf",O(4,Mn,o.conditionSignal(),O(1,An,o.componentConfigSignal,o.localUIStateSignal)))}}var Re=(()=>{let r=class r extends q{set userObject(t){this.resolveUserObjectToContact(t,e=>{this.componentConfigSignal.update(i=>h(d({},i),{type:"contact",contact:e}))})}set userId(t){this.resolveUserIdToContact(t,e=>{this.componentConfigSignal.update(i=>h(d({},i),{type:"contact",contact:e}))})}constructor(){super(),this.componentId="velt-autocomplete-chip-tooltip-icon",this.componentConfigSignal=A({})}ngOnInit(){try{super.ngOnInit()}catch(t){this.loggingService.catch("Error in AutocompleteChipTooltipIconComponent ngOnInit:",t)}}ngOnDestroy(){try{this._userIdSub?.unsubscribe(),super.ngOnDestroy()}catch(t){this.loggingService.catch("Error in AutocompleteChipTooltipIconComponent ngOnDestroy:",t)}}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=P({type:r,selectors:[["velt-autocomplete-chip-tooltip-icon-internal"]],inputs:{userObject:"userObject",userId:"userId"},standalone:!1,features:[F([x]),U],decls:1,vars:1,consts:[["contactAvatarRef",""],["customIconRef",""],["groupIconRef",""],[4,"veltIf"],[4,"veltDynamicTemplate"],[4,"ngTemplateOutlet"],[1,"comment-dialog-user-avatar",3,"size","user"],[1,"velt-autocomplete-chip-tooltip--icon-svg",3,"innerHtml"],[1,"velt-autocomplete-chip-tooltip--icon-img"],[3,"src"],[1,"velt-autocomplete-chip-tooltip--group-icon","velt-autocomplete-chip-tooltip--icon-svg"],["xmlns","http://www.w3.org/2000/svg","fill","rgb(233, 242, 255)","width","16","height","16","viewBox","0 0 16 16",1,"bi","bi-people-fill"],["d","M7 14s-1 0-1-1 1-4 5-4 5 3 5 4-1 1-1 1zm4-6a3 3 0 1 0 0-6 3 3 0 0 0 0 6m-5.784 6A2.24 2.24 0 0 1 5 13c0-1.355.68-2.75 1.936-3.72A6.3 6.3 0 0 0 5 9c-4 0-5 3-5 4s1 1 1 1zM4.5 8a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5"]],template:function(e,i){if(e&1&&w(0,Kn,1,7,"ng-container"),e&2){let a;T((a=i.componentConfigSignal())?0:-1,a)}},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-autocomplete-chip-tooltip--group-icon[_ngcontent-%COMP%]{width:100%;height:100%;padding:var(--velt-spacing-xs);display:flex;align-items:center;justify-content:center;background:linear-gradient(0deg,#ffffff0a,#ffffff0a),linear-gradient(0deg,#3772ff14,#3772ff14);box-sizing:border-box}.velt-autocomplete-chip-tooltip--icon-svg[_ngcontent-%COMP%]{display:flex;width:100%;height:100%;align-items:center;justify-content:center;color:var(--velt-text-0)}.velt-autocomplete-chip-tooltip--icon-img[_ngcontent-%COMP%]{display:flex;width:100%;height:100%;align-items:center;justify-content:center}.velt-autocomplete-chip-tooltip--icon-img[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:16px;height:16px;object-fit:cover}"],changeDetection:0});let n=r;return n})();var Yn=(n,r)=>({componentConfigSignal:n,parentLocalUIState:r}),Xn=(n,r)=>({condition:n,data:r}),Zn=n=>({componentConfigSignal:n}),qn=(n,r,o,t,e)=>({template:n,context:r,componentName:"velt-autocomplete-chip-tooltip-name-wireframe",variant:o,setIfCondition:t,componentElementRef:e});function Qn(n,r){n&1&&$(0)}function to(n,r){if(n&1&&g(0,Qn,1,0,"ng-container",5),n&2){l(2)