@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.
3 lines (2 loc) • 37.2 kB
JavaScript
import{$ as F,Ab as j,Bb as B,Ca as N,Db as G,Eb as Y,Fa as u,Fb as H,Gc as ee,Ib as W,Jb as y,Kc as te,Mb as q,Nb as $,Pa as h,Pb as Q,Pc as A,Ua as b,Xa as V,_a as S,a as s,ac as K,ah as oe,b as g,ca as E,db as p,di as k,g as D,ha as P,ia as x,lb as c,li as ne,mb as v,mi as ie,nb as C,ob as M,pc as J,qa as f,sb as T,sc as X,tb as _,tc as Z,ua as L,vb as O,wa as w,xb as z,zb as l}from"./chunk-GR3NESUB.js";var ae={en:{"Action button":"Action button",Yes:"Yes",Delete:"Delete",Cancel:"Cancel","Delete thread?":"Delete thread?","All replies to this thread will be lost.":"All replies to this thread will be lost.","Delete comment?":"Delete comment?","This selected comment will be deleted.":"This selected comment will be deleted.","Delete recording?":"Delete recording?","This selected recording will be deleted.":"This selected recording will be deleted.","Delete area?":"Delete area?","This selected area will be deleted.":"This selected area will be deleted.","Delete arrow?":"Delete arrow?","This selected arrow will be deleted.":"This selected arrow will be deleted.","Delete tag?":"Delete tag?","This selected tag will be deleted.":"This selected tag will be deleted.","Contact us":"Contact us","Let us know how can we help you!":"Let us know how can we help you!","Your email address":"Your email address","How can we help?":"How can we help?",Send:"Send","Allow mic permission to":"Allow mic permission to","enable your audio":"enable your audio","1. Click the":"1. Click the","page info icon in your browser\u2019s address bar":"page info icon in your browser\u2019s address bar","2. Turn on Microphone":"2. Turn on Microphone","2. Turn on Camera":"2. Turn on Camera","Allow camera permission":"Allow camera permission","to enable your video":"to enable your video",dropdown:"dropdown","assign dropdown":"assign dropdown","custom dropdown":"custom dropdown","options dropdown":"options dropdown","priority dropdown":"priority dropdown","status dropdown":"status dropdown","seen dropdown":"seen dropdown",menu:"menu","assign menu":"assign menu","custom menu":"custom menu","options menu":"options menu","priority menu":"priority menu","status menu":"status menu","seen menu":"seen menu","menu items":"menu items","assign menu items":"assign menu items","custom menu items":"custom menu items","options menu items":"options menu items","priority menu items":"priority menu items","status menu items":"status menu items","seen menu items":"seen menu items","Playback Speed":"Playback Speed","Subtitles not available":"Subtitles not available","Transcription not available":"Transcription not available",Feedback:"Feedback","Provide feedback on your Superflow experience.":"Provide feedback on your Superflow experience.","Tell us the details...":"Tell us the details...","You are following":"You are following","You are leading.":"You are leading.",Stop:"Stop",following:"following",leading:"leading","is editing.":"is editing.","requested edit access.":"requested edit access.","You are editing.":"You are editing.","You are editing on different tab.":"You are editing on different tab.","Access Requested":"Access Requested","Request access":"Request access","Edit here":"Edit here",Settings:"Settings",Audio:"Audio",Microphone:"Microphone",Video:"Video",Camera:"Camera","Save changes":"Save changes","Audio settings":"Audio settings","No device found":"No device found","Video settings":"Video settings","Media source settings":"Media source settings","Audio recording preview":"Audio recording preview","Cancel recording":"Cancel recording","Video recording icon":"Video recording icon","Screen recording icon":"Screen recording icon","Audio recording icon":"Audio recording icon","Recording preview bottom panel":"Recording preview bottom panel","Starting recording in":"Starting recording in","Recording control buttons":"Recording control buttons","Toggle camera":"Toggle camera",off:"off",on:"on","Camera is off":"Camera is off","Close recording preview":"Close recording preview","Toggle microphone":"Toggle microphone",Close:"Close",Open:"Open","recording settings":"recording settings","Start Recording":"Start Recording","Report bugs":"Report bugs","Let us know about any bugs so we can fix them ASAP!":"Let us know about any bugs so we can fix them ASAP!","Thank you! We will get back to you soon.":"Thank you! We will get back to you soon.","Thank you for your feedback!":"Thank you for your feedback!","Thanks for reporting the bug. We will get back to you soon.":"Thanks for reporting the bug. We will get back to you soon.","Invitation sent!":"Invitation sent!","User removed!":"User removed!",members:"members","Invalid contact":"Invalid contact","Invalid email":"Invalid email","Comment pin":"Comment pin","Add text comment":"Add text comment","Add comment annotation":"Add comment annotation","Use AI to rewrite selected text":"Use AI to rewrite selected text","Select a shorter text":"Select a shorter text","Select a longer text":"Select a longer text",Rewrite:"Rewrite","Ask ChatGPT":"Ask ChatGPT","Text comment tools":"Text comment tools","Avatar for comment author":"Avatar for comment author","comments in this thread":"comments in this thread","Assign To":"Assign To","Attach files":"Attach files","Attach files input":"Attach files input","All comments":"All comments","View all comments":"View all comments","Approve comment":"Approve comment",Approve:"Approve","Assign thread":"Assign thread",Search:"Search","Search users":"Search users","Avatar for assigned user":"Avatar for assigned user","Assigned to":"Assigned to","Comment assignment details":"Comment assignment details","Assigned to:":"Assigned to:","Comment dialog thread":"Comment dialog thread","Close comment dialog":"Close comment dialog","Comment Index":"Comment Index",Suggestion:"Suggestion","Comment tools and actions":"Comment tools and actions","Mention someone using @ symbol":"Mention someone using @ symbol","Mention someone using @ symbol while editing":"Mention someone using @ symbol while editing","Type @ to mention someone":"Type @ to mention someone","Type @ to mention someone while editing":"Type @ to mention someone while editing","Add file attachment to comment":"Add file attachment to comment","Record voice message":"Record voice message","Click to start voice recording":"Click to start voice recording","Record video message":"Record video message","Click to start screen recording":"Click to start screen recording","Record your screen":"Record your screen","Save new comment":"Save new comment","Save edited comment":"Save edited comment","Assign user":"Assign user","Remove File":"Remove File","Image attachment:":"Image attachment:","unnamed image":"unnamed image","Actions for image:":"Actions for image:","Uploading image:":"Uploading image:","Delete image:":"Delete image:","Preview of image:":"Preview of image:","Remove invalid file:":"Remove invalid file:","Error message:":"Error message:","Invalid file:":"Invalid file:","Actions for invalid file:":"Actions for invalid file:","File error:":"File error:","File cannot be uploaded":"File cannot be uploaded","Preview of invalid file:":"Preview of invalid file:","Invalid file":"Invalid file",unknown:"unknown","Delete file":"Delete file","File attachment:":"File attachment:","unnamed file":"unnamed file","File type icon for":"File type icon for","Details for file:":"Details for file:","Filename:":"Filename:","File size:":"File size:","Uploading file:":"Uploading file:","Actions for file:":"Actions for file:","Remove file:":"Remove file:","Attached files":"Attached files","total attachments":"total attachments","File attachments":"File attachments",valid:"valid","invalid files":"invalid files","User avatar for":"User avatar for","unknown user":"unknown user","New comment composer":"New comment composer","Comment or type @ to add others":"Comment or type @ to add others","Write a comment...":"Write a comment...","Edit comment composer":"Edit comment composer","Comment or add emails with @":"Comment or add emails with @","Private comment mode - only visible to your team":"Private comment mode - only visible to your team","Only for your team":"Only for your team","Screen recording":"Screen recording",unnamed:"unnamed","Screen recording controls":"Screen recording controls","Edit comment section":"Edit comment section","Add new comment section":"Add new comment section","Custom annotation options":"Custom annotation options","Toggle annotation options":"Toggle annotation options","Annotation:":"Annotation:",Select:"Select","Remaining count:":"Remaining count:","Delete comment controls":"Delete comment controls","Delete this comment":"Delete this comment","Ghost comment notification":"Ghost comment notification","Original content not found.":"Original content not found.","Comment dialog header":"Comment dialog header","Comment dialog header controls":"Comment dialog header controls","Comment metadata":"Comment metadata","1 more reply":"1 more reply","more replies":"more replies","Show 1 more reply":"Show 1 more reply","Navigate to comment location":"Navigate to comment location","Assign comment":"Assign comment","Delete thread":"Delete thread","Delete comment":"Delete comment","Edit comment":"Edit comment",Edit:"Edit","Make it private":"Make it private","Make it public":"Make it public",Subscribe:"Subscribe",Unsubscribe:"Unsubscribe","priority level":"priority level","Priority name":"Priority name",P0:"P0",P1:"P1",P2:"P2","Selected priority:":"Selected priority:","Selected priority indicator":"Selected priority indicator","Priority:":"Priority:","Priority item":"Priority item","Thread priority:":"Thread priority:","Private comment banner":"Private comment banner","Resolve thread":"Resolve thread","Sign In":"Sign In","Status dropdown for":"Status dropdown for",comment:"comment","Status name:":"Status name:","Status option:":"Status option:","Status:":"Status:","Accept suggestion":"Accept suggestion",Accept:"Accept","Reject suggestion":"Reject suggestion",Reject:"Reject","Suggestion actions":"Suggestion actions","Delete Attachment":"Delete Attachment","Download Attachment":"Download Attachment",Attachment:"Attachment",preview:"preview","Image attachment controls":"Image attachment controls","Image attachment actions":"Image attachment actions","Delete attachment":"Delete attachment","Download attachment":"Download attachment","File name:":"File name:","Attachment:":"Attachment:",Attachments:"Attachments","Avatar for":"Avatar for",user:"user","Draft comment status":"Draft comment status",Draft:"Draft",Comment:"Comment","Comment by":"Comment by",Me:"Me","Comment reactions":"Comment reactions","Comment recordings":"Comment recordings","Name for":"Name for","Time for":"Time for","Seen by":"Seen by","Users who viewed this comment":"Users who viewed this comment","List of users who have seen this comment":"List of users who have seen this comment","Seen By":"Seen By","Comment viewers list":"Comment viewers list","Show comment viewers":"Show comment viewers","Comment viewers dropdown":"Comment viewers dropdown",now:"now",Unread:"Unread","Comment thread":"Comment thread","Comment content":"Comment content","Author information":"Author information","Author details and status":"Author details and status","Comment device information":"Comment device information","Inline mode metadata":"Inline mode metadata","Comment actions":"Comment actions","Reaction options":"Reaction options","Comment message":"Comment message",of:"of","Show more replies":"Show more replies",replies:"replies",Reply:"Reply",reply:"reply",Show:"Show","Show reply":"Show reply","Unresolve comment":"Unresolve comment","Upgrade plan":"Upgrade plan",Upgrade:"Upgrade","Copy link to comment":"Copy link to comment","Link Copied!":"Link Copied!","Copy thread link":"Copy thread link","Emoji reactions menu":"Emoji reactions menu","Open emoji reactions menu":"Open emoji reactions menu",Priority:"Priority","Private Comment":"Private Comment",Resolve:"Resolve",Unresolve:"Unresolve","Comment bubble":"Comment bubble","Multi-thread comment dialog":"Multi-thread comment dialog","Comment dialog":"Comment dialog","Comment bottom sheet":"Comment bottom sheet","Comment inbox container":"Comment inbox container","Single comment dialog":"Single comment dialog","Ghost comment indicator":"Ghost comment indicator","Private comment":"Private comment","Comment icon":"Comment icon","Exit comment mode":"Exit comment mode","to exit":"to exit",exit:"exit","Private Comment Mode":"Private Comment Mode","Comment Mode":"Comment Mode","Comment mode icon":"Comment mode icon","Comments stream view":"Comments stream view","Comments inbox":"Comments inbox","Comments location overview":"Comments location overview","Comments minimap":"Comments minimap","Go to comments here.":"Go to comments here.","Close comments sidebar":"Close comments sidebar","Add your first comment":"Add your first comment","No comments to display":"No comments to display","filter section":"filter section",All:"All","Close filter panel":"Close filter panel","Apply filters and close panel":"Apply filters and close panel",Done:"Done","checkbox checked":"checkbox checked","checkbox unchecked":"checkbox unchecked",items:"items","Current viewing page":"Current viewing page","This page":"This page",selected:"selected","not selected":"not selected",pages:"pages",people:"people",priorities:"priorities",statuses:"statuses",Filters:"Filters",versions:"versions","View All":"View All","View all":"View all","Comment filters":"Comment filters","Available filters":"Available filters","Apply or cancel filters":"Apply or cancel filters","Filter comments":"Filter comments","filters applied":"filters applied","Return to all comments":"Return to all comments","Back to all comments":"Back to all comments","Search through comments":"Search through comments","Filter and status controls":"Filter and status controls","Unknown user":"Unknown user","Comment dialog for":"Comment dialog for",Collapse:"Collapse",Expand:"Expand","comment group":"comment group",arrow:"arrow","Comments list with":"Comments list with","Location filter options":"Location filter options",Pages:"Pages","Filter comments by location":"Filter comments by location","menu expanded":"menu expanded","menu collapsed":"menu collapsed","Location filter dropdown":"Location filter dropdown","Mark all comments as read":"Mark all comments as read","Mark all as read":"Mark all as read","Mark as read":"Mark as read","Mark as unread":"Mark as unread",Reset:"Reset","Show open comments only":"Show open comments only","Mark all comments as resolved":"Mark all comments as resolved","Mark all as resolved":"Mark all as resolved","Bulk actions for comments":"Bulk actions for comments","Actions menu":"Actions menu",expanded:"expanded",collapsed:"collapsed","Comment actions dropdown":"Comment actions dropdown","Show unread and read comments":"Show unread and read comments","Unread and read":"Unread and read","Show read comments only":"Show read comments only","Read only":"Read only","Show resolved comments only":"Show resolved comments only",Resolved:"Resolved","Show unread comments only":"Show unread comments only","Unread only":"Unread only","Selected indicator":"Selected indicator","Sort comments by date":"Sort comments by date","Sort by date":"Sort by date","Sort comments by unread status":"Sort comments by unread status","Sort by unread":"Sort by unread","Sort and filter comments":"Sort and filter comments","custom filter applied":"custom filter applied","Comment filters and sorting":"Comment filters and sorting",filtered:"filtered","Page comment composer":"Page comment composer","Add a comment to the page":"Add a comment to the page","Comments and feedback panel":"Comments and feedback panel","Reset all comment filters":"Reset all comment filters","Clear filters":"Clear filters","Loading comments":"Loading comments","Comment status filters":"Comment status filters",status:"status","status icon":"status icon","Status filter options":"Status filter options","Status filter dropdown":"Status filter dropdown","Comments sidebar":"Comments sidebar","Comments panel":"Comments panel","Comment composer":"Comment composer","Comments section panel":"Comments section panel",Comments:"Comments","Loading Comments":"Loading Comments","Comments section":"Comments section","No comments found for applied filters.":"No comments found for applied filters.","Comments list":"Comments list","Comment actions menu":"Comment actions menu","More actions":"More actions","Filter and sort options":"Filter and sort options","Collapse threads":"Collapse threads","Comments dialog":"Comments dialog","Clear all filters":"Clear all filters","Comments information":"Comments information","Toggle comments sidebar":"Toggle comments sidebar","Click to mute":"Click to mute","Click to unmute":"Click to unmute","Stop sharing":"Stop sharing","Share screen":"Share screen","Invite users to join this huddle":"Invite users to join this huddle","Please select a contact to invite":"Please select a contact to invite","Chat with everyone":"Chat with everyone","Enable audio or video to change the settings":"Enable audio or video to change the settings","Change audio/video settings":"Change audio/video settings",Leave:"Leave","In-call messages":"In-call messages","Type here...":"Type here...","Audio Huddle":"Audio Huddle","Video Huddle":"Video Huddle","Screen Huddle":"Screen Huddle","1 person is":"1 person is","people are":"people are","on a call now":"on a call now","You can join the call":"You can join the call","Stop Sharing":"Stop Sharing","is sharing now.":"is sharing now.",You:"You","Close notifications panel":"Close notifications panel","Notification item":"Notification item","All notifications list":"All notifications list","All notifications":"All notifications","All notifications read":"All notifications read","Document notification":"Document notification","Document name:":"Document name:",Untitled:"Untitled","Document ID:":"Document ID:",Document:"Document","unread notifications":"unread notifications","Document notifications panel":"Document notifications panel","For you notifications panel":"For you notifications panel","Notification message:":"Notification message:","Notification headline:":"Notification headline:","Notification time:":"Notification time:","Unread notification":"Unread notification",Notification:"Notification",unread:"unread",read:"read",Load:"Load","more notifications":"more notifications","Load More":"Load More","User notifications for":"User notifications for",notification:"notification",notifications:"notifications",available:"available",Notifications:"Notifications","User:":"User:","People notifications panel":"People notifications panel",Documents:"Documents","For You":"For You",People:"People","Notification categories":"Notification categories","Mark all notifications as read":"Mark all notifications as read","Notification actions":"Notification actions","View all notifications":"View all notifications","Notifications panel":"Notifications panel","Notifications bell icon - no unread notifications":"Notifications bell icon - no unread notifications","Notifications count":"Notifications count","Notification bell with":"Notification bell with","User online":"User online","mins ago.":"mins ago.","Reaction count":"Reaction count","Reaction with":"Reaction with","Reaction by":"Reaction by","Users who reacted":"Users who reacted","Reaction details":"Reaction details","React with":"React with",emoji:"emoji","Choose a reaction":"Choose a reaction","Available reactions":"Available reactions","Add reaction":"Add reaction","Reaction selector":"Reaction selector","Start audio recording":"Start audio recording","Audio Recording":"Audio Recording","Screen Recording":"Screen Recording","Start video recording":"Start video recording","Video Recording":"Video Recording","Recording options menu":"Recording options menu","Available recording types":"Available recording types",Record:"Record","Record audio":"Record audio","Record screen":"Record screen","Record video":"Record video","Recording controls for":"Recording controls for",recording:"recording","Stop recording":"Stop recording","Recording duration":"Recording duration","Resume recording":"Resume recording","Pause recording":"Pause recording","Currently recording:":"Currently recording:",none:"none","Audio waveform visualization":"Audio waveform visualization","Currently recording":"Currently recording","Recording paused":"Recording paused","Recording information":"Recording information","Recording controls":"Recording controls","Expand recording panel":"Expand recording panel","Collapse recording panel":"Collapse recording panel","Floating mode container for":"Floating mode container for","Screen recording preview":"Screen recording preview","Expanded view":"Expanded view","Mini preview":"Mini preview","Recording control panel":"Recording control panel","Draggable recording panel":"Draggable recording panel","Currently saving recording":"Currently saving recording","Saving Recording...":"Saving Recording...",Paused:"Paused","Video preview":"Video preview","Screen recording panel":"Screen recording panel","Draggable recording controls":"Draggable recording controls","Video recording preview":"Video recording preview","recording player":"recording player",Draggable:"Draggable",player:"player","recording pin":"recording pin","Created by":"Created by",Play:"Play","Draggable recording pin by":"Draggable recording pin by","Recording player":"Recording player","Audio recording":"Audio recording","Audio player":"Audio player","Audio player controls":"Audio player controls","Audio content and controls":"Audio content and controls","Playback controls":"Playback controls","Playback time":"Playback time","Audio waveform":"Audio waveform",Subtitles:"Subtitles","Additional controls and information":"Additional controls and information","Pause button":"Pause button","Pause audio":"Pause audio","Play audio":"Play audio","Audio progress":"Audio progress","Copy link to recording":"Copy link to recording","Delete recording":"Delete recording","Enter full screen mode":"Enter full screen mode","Recording name:":"Recording name:","Untitled recording":"Untitled recording","Recording player controls":"Recording player controls","Pause video":"Pause video","Play video":"Play video","Video subtitles":"Video subtitles","Toggle subtitles":"Toggle subtitles","Seek video playback":"Seek video playback","Video playback controls":"Video playback controls","Video transcription":"Video transcription","Video player":"Video player","Video player container":"Video player container","Video player with controls":"Video player with controls","Video information and controls":"Video information and controls","Video transcription summary":"Video transcription summary","Fullscreen video player":"Fullscreen video player","Expanded video player":"Expanded video player","Getting data ...":"Getting data ...","Get more options":"Get more options","Max 3 rewrites allowed":"Max 3 rewrites allowed",left:"left","Show original text":"Show original text","Select a rewritten text to create a task":"Select a rewritten text to create a task","Create Task":"Create Task","How would you like to change this copy?":"How would you like to change this copy?",Suggestions:"Suggestions","Selected users":"Selected users","additional users":"additional users",Reassign:"Reassign",Remove:"Remove","Please select a contact to assign":"Please select a contact to assign",Summary:"Summary","see more":"see more","see less":"see less","Invite users":"Invite users","No users are added.":"No users are added.",Invited:"Invited","General access":"General access","Copy Link":"Copy Link","Send invite":"Send invite","Go Back":"Go Back","Total Views":"Total Views","Views Today":"Views Today",View:"View",Views:"Views",Today:"Today","Search comments":"Search comments","In Progress":"In Progress",Status:"Status","Not set":"Not set","Comment Type":"Comment Type",Public:"Public",Private:"Private","Group By":"Group By","Assigned to Me":"Assigned to Me","Added by Me":"Added by Me",Other:"Other",Desktop:"Desktop",Mobile:"Mobile",Tablet:"Tablet",Others:"Others","Default - MacBook Pro Microphone (Built-in)":"Default - MacBook Pro Microphone (Built-in)","iPhone Microphone":"iPhone Microphone","MacBook Pro Microphone (Built-in)":"MacBook Pro Microphone (Built-in)","Sorting options":"Sorting options","Created First":"Created First","Created Last":"Created Last","Updated First":"Updated First","Updated Last":"Updated Last"}};var re=(()=>{let n=class n{constructor(e){this.loggingService=e,this.currentLanguageSignal=f(navigator.language.split("-")[0]),this.autoTranslationSignal=f(!1),this.translationsMap=new Map,this.translationCache=new Map,this.translationsUpdateSignal=f(0),this.currentLanguage=this.currentLanguageSignal.asReadonly(),this.autoTranslation=this.autoTranslationSignal.asReadonly(),this.translationsVersion=this.translationsUpdateSignal.asReadonly(),this.currentTranslations=X(()=>{let t=this.currentLanguageSignal(),o=this.translationsUpdateSignal();return this.translationsMap.get(t)||{}}),this.loggingService.log("%c[WB] Calling FUNCTION: constructor","color: green;"),this.setTranslations(ae),Z(()=>{let t=this.currentLanguageSignal();this.translationCache.clear(),this.translationsUpdateSignal.update(o=>o+1)})}translate(e){try{this.loggingService.log("%c[WB] Calling FUNCTION: translate","color: green;");let t=this.currentLanguageSignal(),o=this.translationsUpdateSignal(),r=`${t}:${e}:${o}`,d=this.translationCache.get(t);if(d?.has(r))return d.get(r)||e;let m=this.currentTranslations()[e];return this.translationCache.has(t)||this.translationCache.set(t,new Map),this.translationCache.get(t)?.set(r,m||e),oe(m)?e:m}catch{return e}}setTranslations(e){try{this.loggingService.log("%c[WB] Calling FUNCTION: setTranslations","color: green;");let t=!1;Object.entries(e).forEach(([o,r])=>{if(r&&typeof r=="object"){let d=this.translationsMap.get(o)||{};Object.keys(r).forEach(R=>{d.hasOwnProperty(R)||(t=!0)});let m=s(s({},d),r);this.translationsMap.set(o,m),this.translationCache.delete(o)}}),this.translationsUpdateSignal.update(o=>o+1),t&&setTimeout(()=>{this.translationsUpdateSignal.update(o=>o+1)},0)}catch(t){this.loggingService.catch("Error in setTranslations: ",t)}}setLanguage(e){return D(this,null,function*(){try{this.loggingService.log("%c[WB] Calling FUNCTION: setLanguage","color: green;"),this.currentLanguageSignal.set(e)}catch(t){this.loggingService.catch("Error in setLanguage: ",t)}})}enableAutoTranslation(){try{this.loggingService.log("%c[WB] Calling FUNCTION: enableAutoTranslation","color: green;"),this.autoTranslationSignal.set(!0)}catch(e){this.loggingService.catch("Error in enableAutoTranslation: ",e)}}disableAutoTranslation(){try{this.loggingService.log("%c[WB] Calling FUNCTION: disableAutoTranslation","color: green;"),this.autoTranslationSignal.set(!1),this.translationCache.clear()}catch(e){this.loggingService.catch("Error in disableAutoTranslation: ",e)}}};n.\u0275fac=function(t){return new(t||n)(E(k))},n.\u0275prov=F({token:n,factory:n.\u0275fac,providedIn:"root"});let i=n;return i})();var xe=(()=>{let n=class n{constructor(e,t){this.domService=e,this.translateService=t,this.sanitizedCache=new Map}transform(e){if(e==null)return"";let t=typeof e=="boolean"||typeof e=="number"?String(e):e;try{let o=this.translateService.currentLanguage(),r=this.translateService.translationsVersion(),d=`${o}:${t}:${r}`,m=this.sanitizedCache.get(d);if(m)return m;let R=this.translateService.translate(t),I=this.domService.sanitizeHtml(R);return this.sanitizedCache.set(d,I),this.sanitizedCache.size>1e3&&this.sanitizedCache.clear(),I}catch(o){return console.warn("Translation error:",o),t}}};n.\u0275fac=function(t){return new(t||n)(h(ne,16),h(re,16))},n.\u0275pipe=V({name:"translate",type:n,pure:!0});let i=n;return i})();var ge=()=>({}),se=(()=>{let n=class n{constructor(){this.height=void 0,this.width=void 0,this.borderRadius=void 0,this.customClass=void 0,this.veltElement=!0}ngOnInit(){}};n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=b({type:n,selectors:[["velt-skeleton-loader-internal"]],hostVars:1,hostBindings:function(t,o){t&2&&p("data-velt-element",o.veltElement)},inputs:{height:"height",width:"width",borderRadius:"borderRadius",customClass:"customClass",customStyles:"customStyles"},decls:2,vars:11,consts:[[1,"skeleton-loader",3,"ngStyle"]],template:function(t,o){t&1&&(v(0,"div",0),$(1),C()),t&2&&(q(o.customClass),y("--velt-skeleton-loader-height",o.height||"100%")("--velt-skeleton-loader-width",o.width||"100%")("--velt-skeleton-loader-border-radius",o.borderRadius||"inherit"),c("ngStyle",o.customStyles||K(10,ge)),u(),Q(" ","\u200E ",`
`))},dependencies:[A,te],styles:["[_nghost-%COMP%]{display:inline-flex;align-items:center}.skeleton-loader[_ngcontent-%COMP%]{display:inline-block;background:linear-gradient(-90deg,#f0f0f0,#e2e2e2,#f0f0f0);background-size:400% 400%;animation:_ngcontent-%COMP%_skeleton-loading 1.2s ease-in-out 4;height:var(--velt-skeleton-loader-height);width:var(--velt-skeleton-loader-width);border-radius:var(--velt-skeleton-loader-border-radius)}@keyframes _ngcontent-%COMP%_skeleton-loading{0%{background-position:100% 0}to{background-position:-100% 0}}"]});let i=n;return i})();var ue=["userAvatarRef"],pe=["*"];function he(i,n){if(i&1&&(v(0,"div",7),M(1,"span",8),C()),i&2){let a=l(2).ngIf,e=l();y("background-color",a.background||"#625DF5"),p("data-testid",e.componentId+"-initial-container"),u(),y("color",a.textColor||"#FFFFFF"),p("data-modal-author-initial",a.initial)("data-testid",e.componentId+"-initial")}}function fe(i,n){if(i&1){let a=O();v(0,"img",9),z("error",function(){P(a);let t=l(3);return x(t.onImageLoadError())})("load",function(){P(a);let t=l(3);return x(t.onImageLoaded())}),C()}if(i&2){let a=l(2).ngIf,e=l();y("display",a.imgLoaded?"":"none !important"),c("src",a.src,N),p("alt","User avatar")("data-testid",e.componentId+"-image")}}function ve(i,n){if(i&1&&(T(0),v(1,"div",4,1),S(3,he,2,7,"div",5)(4,fe,1,5,"ng-template",6),B(5),C(),_()),i&2){let a=l().ngIf,e=l();u(),p("data-testid",e.componentId+"-container")("aria-label","User avatar"),u(2),c("ngIf",!a.imgLoaded),u(),c("ngIf",!a.imgLoadError)}}function Ce(i,n){if(i&1&&M(0,"velt-skeleton-loader-internal",10),i&2){let a=l().ngIf;c("height",a.size?a.size+"px":"100%")("width",a.size?a.size+"px":"100%")}}function ye(i,n){if(i&1&&(T(0),S(1,ve,6,4,"ng-container",3)(2,Ce,1,2,"ng-template",null,0,J),_()),i&2){let a=n.ngIf,e=W(3);u(),c("ngIf",a.imgLoaded||(a==null||a.user==null?null:a.user.photoUrl)||(a==null||a.user==null?null:a.user.name)||(a==null||a.user==null?null:a.user.email)||(a==null?null:a.initial))("ngIfElse",e)}}var Ye=(()=>{let n=class n{constructor(e,t,o){this.authService=e,this.loggingService=t,this.elementRef=o,this.initial="",this.background="#625DF5",this.textColor="#FFFFFF",this.userAvatarRef=new w(null),this.componentConfigSignal=f({background:"#625DF5",textColor:"#FFFFFF",initial:"",src:"",imgLoaded:!1,imgLoadError:!1}),this.veltElement=!0,this.componentId="velt-user-avatar"}ngOnInit(){try{this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in UserAvatarComponent ngOnInit:",e)}}setupA11yAttributes(){try{let e=this.elementRef.nativeElement;e.setAttribute("role","img"),e.setAttribute("data-testid",this.componentId+"-container"),this.updateAriaLabel()}catch(e){this.loggingService.catch("Error in UserAvatarComponent setupA11yAttributes:",e)}}updateAriaLabel(){try{this.elementRef.nativeElement.setAttribute("aria-label","User avatar")}catch(e){this.loggingService.catch("Error in UserAvatarComponent updateAriaLabel:",e)}}ngAfterViewInit(){this.updateAvatarSize()}ngOnChanges(e){try{if(e&&Object.keys(e).forEach(t=>{this.componentConfigSignal.update(o=>(o=g(s({},o),{[t]:e[t].currentValue}),o))}),e?.user){let t=e.user.currentValue;t?.photoUrl!==this.componentConfigSignal().src&&this.componentConfigSignal.update(o=>(o=g(s({},o),{src:t?.photoUrl,imgLoaded:!1,imgLoadError:!1}),o)),this.componentConfigSignal.update(o=>(o=g(s({},o),{background:t?.color||this.authService.getUserAvatarColor(t?.userId)}),o)),this.componentConfigSignal.update(o=>(o=g(s({},o),{textColor:t?.textColor||this.authService.getUserTextColor(t?.userId)}),o)),this.componentConfigSignal.update(o=>(o=g(s({},o),{initial:t?.initial||t?.name?.charAt(0)||t?.email?.charAt(0)}),o))}e?.size&&this.updateAvatarSize(),e?.width&&this.updateAvatarSize(),e?.height&&this.updateAvatarSize()}catch(t){this.loggingService.catch("Error in UserAvatarComponent ngOnChanges: ",t)}}onImageLoadError(){try{this.componentConfigSignal.update(e=>(e=g(s({},e),{imgLoadError:!0}),e))}catch(e){this.loggingService.catch("Error in UserAvatarComponent onImageLoadError: ",e)}}onImageLoaded(){try{this.componentConfigSignal.update(e=>(e=g(s({},e),{imgLoaded:!0}),e))}catch(e){this.loggingService.catch("Error in UserAvatarComponent onImageLoaded: ",e)}}updateAvatarSize(){try{this.elementRef?.nativeElement&&(this.size&&(this.elementRef.nativeElement.style.setProperty("--legacy-velt-user-avatar-height",this.size+"px"),this.elementRef.nativeElement.style.setProperty("--legacy-velt-user-avatar-width",this.size+"px")),this.width&&this.elementRef.nativeElement.style.setProperty("--legacy-velt-user-avatar-width",this.size+"px"),this.height&&this.elementRef.nativeElement.style.setProperty("--legacy-velt-user-avatar-height",this.size+"px"))}catch(e){this.loggingService.catch("Error in UserAvatarComponent updateAvatarSize: ",e)}}};n.\u0275fac=function(t){return new(t||n)(h(ie),h(k),h(w))},n.\u0275cmp=b({type:n,selectors:[["snippyly-user-avatar"]],viewQuery:function(t,o){if(t&1&&G(ue,5),t&2){let r;Y(r=H())&&(o.userAvatarRef=r.first)}},hostVars:1,hostBindings:function(t,o){t&2&&p("data-velt-element",o.veltElement)},inputs:{initial:"initial",src:"src",background:"background",textColor:"textColor",size:"size",width:"width",height:"height",user:"user"},features:[L],ngContentSelectors:pe,decls:1,vars:1,consts:[["loadingTemplateRef",""],["userAvatarRef",""],[4,"ngIf"],[4,"ngIf","ngIfElse"],["velt-ignore-change-detection","true","role","img",1,"s-user-avatar-container","velt-user-avatar"],["class","s-user-avatar-initial-container velt-user-avatar--initial-container","aria-hidden","componentConfig.imgLoaded",3,"background-color",4,"ngIf"],[3,"ngIf"],["aria-hidden","componentConfig.imgLoaded",1,"s-user-avatar-initial-container","velt-user-avatar--initial-container"],[1,"s-user-avatar-initial","velt-user-avatar--initial"],["referrerpolicy","no-referrer","velt-ignore-change-detection","true",1,"s-user-avatar-image","velt-user-avatar--image",3,"error","load","src"],["borderRadius","100%",3,"height","width"]],template:function(t,o){t&1&&(j(),S(0,ye,4,2,"ng-container",2)),t&2&&c("ngIf",o.componentConfigSignal())},dependencies:[A,ee,se],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{display:flex}[_nghost-%COMP%]:empty{display:none}*[_ngcontent-%COMP%]{box-sizing:border-box;-webkit-tap-highlight-color:rgba(255,255,255,0);outline:none;margin:0;padding:0;height:unset;width:unset;text-align:left;line-height:1.5;color:#000;font-size:calc((1rem + 0px) * var(--velt-base-rem-unit));position:static}*[_ngcontent-%COMP%]:empty{display:revert}.s-user-avatar-container[_ngcontent-%COMP%]{position:relative;width:calc((var(--legacy-velt-user-avatar-size) + 0px) * var(--velt-base-rem-unit));height:calc((var(--legacy-velt-user-avatar-size) + 0px) * var(--velt-base-rem-unit));border-radius:50%;display:inline-block}velt-skeleton-loader-internal[_ngcontent-%COMP%]{width:calc((var(--legacy-velt-user-avatar-size) + 0px) * var(--velt-base-rem-unit));height:calc((var(--legacy-velt-user-avatar-size) + 0px) * var(--velt-base-rem-unit));border-radius:50%}.s-user-avatar-initial-container[_ngcontent-%COMP%]{width:100%;height:100%;display:flex;justify-content:center;border-radius:50%;align-items:center;font-size:calc((.8rem + 0px) * var(--velt-base-rem-unit))}.s-user-avatar-image[_ngcontent-%COMP%]{object-fit:cover;border-radius:50%;width:100%;height:100%;display:flex}.s-user-avatar-initial[_ngcontent-%COMP%]{color:#fff;font-size:calc((var(--legacy-velt-user-avatar-initial-font-size) + 0px) * var(--velt-base-rem-unit));position:relative;text-transform:uppercase}.s-user-avatar-initial[_ngcontent-%COMP%]:after{content:attr(data-modal-author-initial);position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.velt-user-avatar[_ngcontent-%COMP%], velt-skeleton-loader-internal[_ngcontent-%COMP%]{height:var(--legacy-velt-user-avatar-height, calc((var(--legacy-velt-user-avatar-size) + 0px) * var(--velt-base-rem-unit)));width:var(--legacy-velt-user-avatar-width, calc((var(--legacy-velt-user-avatar-size) + 0px) * var(--velt-base-rem-unit)))}"],changeDetection:0});let i=n;return i})();export{re as a,xe as b,se as c,Ye as d};