@veltdev/sdk-staging 6.0.13 → 6.0.14-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/app/models/element/activity-element.model.d.ts +9 -0
  2. package/app/models/element/autocomplete-element.model.d.ts +10 -0
  3. package/app/models/element/comment-element.model.d.ts +72 -0
  4. package/app/models/element/notification-element.model.d.ts +17 -0
  5. package/app/utils/constants.d.ts +1 -0
  6. package/{chunk-DZYVUUMS.js → chunk-2HGCWC7B.js} +1 -1
  7. package/chunk-2KTYC2AG.js +1 -0
  8. package/{chunk-5XJDGVGO.js → chunk-3AL5S762.js} +1 -1
  9. package/{chunk-TE4S24VF.js → chunk-45X5JRZ6.js} +1 -1
  10. package/chunk-6NWFM6PC.js +1 -0
  11. package/{chunk-IKXUU4LK.js → chunk-77FADRSO.js} +1 -1
  12. package/chunk-7TFVNMHJ.js +2 -0
  13. package/{chunk-NFQ33NZA.js → chunk-C5JOX4MX.js} +1 -1
  14. package/{chunk-XXU7YXMF.js → chunk-DFEL6HM7.js} +1 -1
  15. package/{chunk-Q2XHYKCH.js → chunk-DZYXTTOX.js} +1 -1
  16. package/{chunk-GHWFNVK2.js → chunk-FZSZ6AV3.js} +1 -1
  17. package/{chunk-MUMFBRNH.js → chunk-GULBDPIM.js} +1 -1
  18. package/{chunk-EMCGVIKG.js → chunk-HRCWTVRH.js} +1 -1
  19. package/{chunk-V32SISMC.js → chunk-HWS7Y4LE.js} +1 -1
  20. package/chunk-I63T4QWP.js +6 -0
  21. package/{chunk-ZUQTUSHK.js → chunk-IMH5OESK.js} +1 -1
  22. package/chunk-IQ22I2I3.js +1 -0
  23. package/{chunk-NYRQTKJA.js → chunk-KNQJBBQA.js} +1 -1
  24. package/chunk-KQPNTB77.js +1 -0
  25. package/chunk-KWLMOL5X.js +193 -0
  26. package/chunk-L4QMAEKA.js +1 -0
  27. package/chunk-MRY4A7N6.js +1 -0
  28. package/{chunk-4VEJIKFU.js → chunk-NMPXJFDX.js} +1 -1
  29. package/chunk-O3FUWWWQ.js +1 -0
  30. package/{chunk-LOLURD74.js → chunk-PWTBCAPJ.js} +1 -1
  31. package/{chunk-4BAHMWIE.js → chunk-TQNLXTQA.js} +1 -1
  32. package/{chunk-STNBRDN3.js → chunk-UI2CRSTN.js} +1 -1
  33. package/{chunk-YTVKKNRL.js → chunk-UVKIGEOH.js} +1 -1
  34. package/{chunk-4YEJYNMX.js → chunk-VJLHHQ2Z.js} +1 -1
  35. package/chunk-VW5ND7U4.js +93 -0
  36. package/{chunk-2LJHR77K.js → chunk-WMDZMDJS.js} +1 -1
  37. package/{chunk-SYWOQU23.js → chunk-YFBAHLK6.js} +26 -26
  38. package/chunk-YO4HNOAN.js +1 -0
  39. package/{chunk-IQIWMWKJ.js → chunk-ZHXLO4CC.js} +1 -1
  40. package/package.json +1 -1
  41. package/velt-activity-log.js +1 -1
  42. package/velt-area.js +1 -1
  43. package/velt-arrow.js +2 -2
  44. package/velt-comment.js +7 -7
  45. package/velt-crdt.js +1 -1
  46. package/velt-cursor.js +2 -2
  47. package/velt-huddle.js +2 -2
  48. package/velt-live-state-sync.js +2 -2
  49. package/velt-notification.js +1 -1
  50. package/velt-portable.js +1 -1
  51. package/velt-presence.js +1 -1
  52. package/velt-reaction.js +1 -1
  53. package/velt-recorder.js +1 -1
  54. package/velt-rewriter.js +2 -2
  55. package/velt-selection.js +1 -1
  56. package/velt-tag.js +1 -1
  57. package/velt-user-invite.js +2 -2
  58. package/velt-user-request.js +1 -1
  59. package/velt-video-player.js +1 -1
  60. package/velt-views.js +2 -2
  61. package/velt.js +6 -6
  62. package/chunk-6YGRELTV.js +0 -2
  63. package/chunk-7TNGPXR5.js +0 -1
  64. package/chunk-A4HLP4VU.js +0 -1
  65. package/chunk-A6I23DJF.js +0 -1
  66. package/chunk-DAUJEOMM.js +0 -193
  67. package/chunk-IEOSSENF.js +0 -1
  68. package/chunk-KJN6PDWN.js +0 -93
  69. package/chunk-KKKGHIG4.js +0 -1
  70. package/chunk-RSCWN2VG.js +0 -1
  71. package/chunk-SZUD6M7J.js +0 -6
  72. package/chunk-TG2UOHTU.js +0 -1
  73. package/chunk-UY5BYX47.js +0 -1
package/chunk-KJN6PDWN.js DELETED
@@ -1,93 +0,0 @@
1
- import{a as rt}from"./chunk-GHWFNVK2.js";import{a as Ve}from"./chunk-RSCWN2VG.js";import{x as di}from"./chunk-NFQ33NZA.js";import{b as pi}from"./chunk-UY5BYX47.js";import{a as gi}from"./chunk-STNBRDN3.js";import{B as L,C as z}from"./chunk-TG2UOHTU.js";import{a as nt,b as si}from"./chunk-IEOSSENF.js";import{b as oe}from"./chunk-MUMFBRNH.js";import{a as li}from"./chunk-5XJDGVGO.js";import{W as jt,X as Nt,Y as Fe,ca as ci,da as C,fa as V}from"./chunk-SZUD6M7J.js";import{c as tt,d as $e,e as it,l as oi,p as Rt,t as ai}from"./chunk-KKKGHIG4.js";import{Bb as g,Bf as Ut,Cb as Tt,Cf as St,Db as Ot,E as xe,Ef as Lt,Eh as Zt,Fg as Ze,G as Le,Gd as $t,Ha as s,He as K,Ic as N,Ih as Qt,Jc as Mt,K as ke,Kb as Pe,Kc as Ft,M as ht,Mb as he,Nc as Ke,Pb as Ce,Pg as Ct,Qb as kt,Qd as Vt,Ra as S,Rb as be,Re as Te,Ri as Be,Si as Xe,Ti as E,Ug as _t,Uh as Xt,Ui as ii,V as de,Vg as yt,Vh as Ue,Wa as k,Wc as Bt,Wh as wt,Xf as Ne,Y as ze,Yi as ni,_ as ft,_a as B,_d as Je,a as y,ab as u,ac as $,b as U,ba as we,bj as Dt,cc as Me,ci as qt,dc as P,dh as Kt,di as bt,ea as j,ec as D,eh as Jt,fa as At,fb as w,g as A,gj as Ie,hc as M,hg as zt,ja as q,ji as Qe,jj as qe,k as je,ka as Y,ki as It,l as J,la as le,mc as Q,nb as l,nc as X,ne as _e,ob as b,pb as R,qb as T,qg as Wt,r as Z,rc as Ge,re as Ae,sa as We,tj as ri,ub as h,ug as Ht,v as ne,vb as f,w as ut,wa as Ee,wb as He,wi as Yt,wj as Ye,xb as ge,xi as ei,xj as et,ya as O,zb as pe,zg as Gt,zi as ti}from"./chunk-SYWOQU23.js";var F=class{constructor(){this.closeDialog=()=>{},this.startCountdown=()=>{},this.toggleAudio=()=>{},this.toggleVideo=()=>{},this.toggleSettings=()=>{},this.cancelCountdown=()=>{},this.updateMediaConfig=()=>{},this.handleOverlayClick=()=>{},this.countdownStarted=!1,this.isSettingsOpen=!1,this.mediaConfig={audio:{enabled:!1},video:{enabled:!1}},this.mediaState={audio:{enabled:!1},video:{enabled:!1}},this.type="video",this.darkMode=!1,this.shadowDom=!0,this.isExplicitShadowDom=!1}};var mi=i=>({componentConfigSignal:i}),nn=(i,o)=>({condition:i,data:o}),rn=(i,o,n,e,t)=>({template:i,context:o,componentName:"velt-recording-preview-steps-dialog-close-button-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function on(i,o){if(i&1&&(h(0),b(1,"div",4),le(),b(2,"svg",5),T(3,"path",6),R()(),f()),i&2){let n=g(3);s(),w("data-testid",n.componentId+"-icon-container"),s(),w("data-testid",n.componentId+"-icon")}}function an(i,o){if(i&1){let n=ge();h(0),b(1,"div",2),Q(2,"translate"),pe("click",function(){q(n);let t=g().ngIf;return Y(t.closeDialog())})("keydown.enter",function(){q(n);let t=g().ngIf;return Y(t.closeDialog())})("keydown.space",function(){q(n);let t=g().ngIf;return Y(t.closeDialog())}),u(3,on,4,2,"ng-container",3),R(),f()}if(i&2){let n=g(2);s(),w("data-testid",n.componentId)("aria-label",X(2,3,"Close recording preview")),s(2),l("veltDynamicTemplate",M(7,rn,n.template,P(5,mi,n.componentConfigSignal),n.variant,n.setIfCondition.bind(n),n.elementRef))}}function cn(i,o){if(i&1&&(h(0),u(1,an,4,13,"ng-container",1),f()),i&2){let n=g();s(),l("veltIf",D(3,nn,n.conditionSignal(),P(1,mi,n.componentConfigSignal)))}}var ot=(()=>{let o=class o extends V{constructor(e,t,r){super(t,r,e),this.loggingService=e,this.elementRef=t,this.dynamicDataService=r,this.componentId="velt-recording-preview-steps-dialog-close-button",super.initializeComponentConfigSignal(new F)}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogCloseButtonComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogCameraOffMessageComponent ngOnDestroy:",e)}}setupA11yAttributes(){try{let e=this.elementRef.nativeElement;e.setAttribute("data-testid",this.componentId+"-container"),e.setAttribute("role","button"),e.setAttribute("aria-label","Close recording preview"),e.setAttribute("tabindex","0")}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogCloseButtonComponent setupA11yAttributes:",e)}}};o.\u0275fac=function(t){return new(t||o)(S(E),S(O),S(C))},o.\u0275cmp=k({type:o,selectors:[["app-recording-preview-steps-dialog-close-button"]],inputs:{variant:"variant"},standalone:!1,features:[$([C]),B],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],["role","button","tabindex","0",3,"click","keydown.enter","keydown.space"],[4,"veltDynamicTemplate"],[1,"velt-recording-preview--icon-button"],["width","24","height","24","viewBox","0 0 24 24","fill","none","xmlns","http://www.w3.org/2000/svg","focusable","false","aria-hidden","true",1,"velt-cursor-pointer"],["fill-rule","evenodd","clip-rule","evenodd","d","M5.29289 5.29289C5.68342 4.90237 6.31658 4.90237 6.70711 5.29289L12 10.5858L17.2929 5.29289C17.6834 4.90237 18.3166 4.90237 18.7071 5.29289C19.0976 5.68342 19.0976 6.31658 18.7071 6.70711L13.4142 12L18.7071 17.2929C19.0976 17.6834 19.0976 18.3166 18.7071 18.7071C18.3166 19.0976 17.6834 19.0976 17.2929 18.7071L12 13.4142L6.70711 18.7071C6.31658 19.0976 5.68342 19.0976 5.29289 18.7071C4.90237 18.3166 4.90237 17.6834 5.29289 17.2929L10.5858 12L5.29289 6.70711C4.90237 6.31658 4.90237 5.68342 5.29289 5.29289Z","fill","#fff"]],template:function(t,r){t&1&&u(0,cn,2,6,"ng-container",0),t&2&&l("ngIf",r.componentConfigSignal())},dependencies:[N,L,z,oe],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}.velt-recording-preview--icon-button[_ngcontent-%COMP%]{padding:var(--velt-spacing-md);display:flex;align-items:center;justify-content:center;border-radius:var(--velt-border-radius-3xl);cursor:pointer;border:1.5px solid var(--velt-border-3);background:var(--velt-background-1);transition:all .2s ease}.velt-recording-preview--icon-button[_ngcontent-%COMP%] svg[_ngcontent-%COMP%] path[_ngcontent-%COMP%]{fill:var(--velt-text-4)}.velt-recording-preview--icon-button[_ngcontent-%COMP%]:hover{border:1.5px solid var(--velt-border-4);background:var(--velt-background-2)}"],changeDetection:0});let i=o;return i})();var sn=["*"],dn=i=>({componentConfigSignal:i}),ln=(i,o)=>({condition:i,data:o}),gn=(i,o)=>({componentConfigSignal:i,variant:o}),pn=(i,o,n,e,t)=>({template:i,context:o,componentName:"velt-recording-preview-steps-dialog-button-panel-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function mn(i,o){i&1&&(h(0),Ot(1),f())}function vn(i,o){if(i&1&&(b(0,"div",3),Q(1,"translate"),u(2,mn,2,0,"ng-container",4),R()),i&2){let n=g(3);w("data-testid",n.componentId)("aria-label",X(1,4,"Recording control buttons"))("aria-orientation","horizontal"),s(2),l("veltDynamicTemplate",M(9,pn,n.template,D(6,gn,n.componentConfigSignal,n.variant),n.variant,n.setIfCondition.bind(n),n.elementRef))}}function un(i,o){if(i&1&&(h(0),u(1,vn,3,15,"div",2),f()),i&2){let n=g().ngIf;s(),l("ngIf",!n.countdownStarted)}}function hn(i,o){if(i&1&&(h(0),u(1,un,2,1,"ng-container",1),f()),i&2){let n=g();s(),l("veltIf",D(3,ln,n.conditionSignal(),P(1,dn,n.componentConfigSignal)))}}var at=(()=>{let o=class o extends V{constructor(e,t,r){super(t,r,e),this.loggingService=e,this.elementRef=t,this.dynamicDataService=r,this.componentId="velt-recording-preview-steps-dialog-button-panel",super.initializeComponentConfigSignal(new F)}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogButtonPanelComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogButtonPanelComponent ngOnDestroy:",e)}}setupA11yAttributes(){try{let e=this.elementRef.nativeElement;e.setAttribute("data-testid",this.componentId+"-container"),e.setAttribute("role","toolbar"),e.setAttribute("aria-label","Recording controls")}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogButtonPanelComponent setupA11yAttributes:",e)}}};o.\u0275fac=function(t){return new(t||o)(S(E),S(O),S(C))},o.\u0275cmp=k({type:o,selectors:[["app-recording-preview-steps-dialog-button-panel"]],inputs:{variant:"variant"},standalone:!1,features:[$([C]),B],ngContentSelectors:sn,decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],["class","velt-recording-preview-button-panel","role","toolbar",4,"ngIf"],["role","toolbar",1,"velt-recording-preview-button-panel"],[4,"veltDynamicTemplate"]],template:function(t,r){t&1&&(Tt(),u(0,hn,2,6,"ng-container",0)),t&2&&l("ngIf",r.componentConfigSignal())},dependencies:[N,L,z,oe],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}.velt-recording-preview-button-panel[_ngcontent-%COMP%]{display:flex;align-items:center;gap:var(--velt-spacing-sm);margin-bottom:var(--velt-spacing-lg)}"],changeDetection:0});let i=o;return i})();var fn=i=>({componentConfigSignal:i}),Sn=(i,o)=>({condition:i,data:o}),Cn=(i,o)=>({componentConfigSignal:i,variant:o}),_n=(i,o,n,e,t)=>({template:i,context:o,componentName:"velt-recording-preview-steps-dialog-video-player-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function yn(i,o){if(i&1&&(h(0),T(1,"video",3),f()),i&2){let n=g(2).ngIf,e=g();s(),l("srcObject",n.mediaStream)("volume",0),w("data-testid",e.componentId)}}function wn(i,o){if(i&1&&(h(0),u(1,yn,2,3,"ng-container",2),f()),i&2){let n=g(2);s(),l("veltDynamicTemplate",M(4,_n,n.template,D(1,Cn,n.componentConfigSignal,n.variant),n.variant,n.setIfCondition.bind(n),n.elementRef))}}function bn(i,o){if(i&1&&(h(0),u(1,wn,2,10,"ng-container",1),f()),i&2){let n=g();s(),l("veltIf",D(3,Sn,n.conditionSignal(),P(1,fn,n.componentConfigSignal)))}}var hi=(()=>{let o=class o extends V{get isScreenStreamAvailable(){return!!this.componentConfigSignal()?.mediaConfig?.screen?.stream}constructor(e,t,r){super(t,r,e),this.loggingService=e,this.elementRef=t,this.dynamicDataService=r,this.componentId="velt-recording-preview-steps-dialog-video-player",super.initializeComponentConfigSignal(new F)}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogVideoPlayerComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogVideoPlayerComponent ngOnDestroy:",e)}}setupA11yAttributes(){try{let e=this.elementRef.nativeElement;e.setAttribute("data-testid",this.componentId+"-container"),e.setAttribute("role","region"),e.setAttribute("aria-label","Video preview")}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogVideoPlayerComponent setupA11yAttributes:",e)}}};o.\u0275fac=function(t){return new(t||o)(S(E),S(O),S(C))},o.\u0275cmp=k({type:o,selectors:[["app-recording-preview-steps-dialog-video-player"]],hostVars:2,hostBindings:function(t,r){t&2&&he("velt-recording-preview-steps-dialog-screen-available",r.isScreenStreamAvailable)},inputs:{variant:"variant"},standalone:!1,features:[$([C]),B],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],[4,"veltDynamicTemplate"],["id","player","autoplay","","muted","true","playsinline","","webkit-playsinline","true","x-webkit-airplay","allow","role","application","aria-live","polite",1,"flip","velt-recording-preview-video--player",3,"srcObject","volume"]],template:function(t,r){t&1&&u(0,bn,2,6,"ng-container",0),t&2&&l("ngIf",r.componentConfigSignal())},dependencies:[N,L,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%]{display:block;width:100%;position:relative}.velt-recording-preview-steps-dialog-screen-available[_nghost-%COMP%]{position:absolute;bottom:20px;left:20px}.velt-recording-preview-steps-dialog-screen-available[_nghost-%COMP%] video[_ngcontent-%COMP%]{width:150px;height:150px;object-fit:cover;border-radius:var(--velt-border-radius-full)}video[_ngcontent-%COMP%]{width:100%;z-index:9999}.velt-recording-preview-video--player[_ngcontent-%COMP%]{object-fit:cover}"],changeDetection:0});let i=o;return i})();var Dn=i=>({componentConfigSignal:i}),Rn=(i,o)=>({condition:i,data:o}),xn=(i,o)=>({componentConfigSignal:i,variant:o}),En=(i,o,n,e,t)=>({template:i,context:o,componentName:"velt-recording-preview-steps-dialog-camera-off-message-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function Pn(i,o){if(i&1&&(h(0),b(1,"h1",5),Q(2,"translate"),Ce(3),Q(4,"translate"),R(),f()),i&2){let n=g(4);s(),w("data-testid",n.componentId+"-text")("aria-label",X(2,3,"Camera is off")),s(2),kt(X(4,5,"Camera is off"))}}function An(i,o){if(i&1&&(b(0,"div",3),u(1,Pn,5,7,"ng-container",4),R()),i&2){let n=g(3);w("data-testid",n.componentId),s(),l("veltDynamicTemplate",M(5,En,n.template,D(2,xn,n.componentConfigSignal,n.variant),n.variant,n.setIfCondition.bind(n),n.elementRef))}}function Tn(i,o){if(i&1&&(h(0),u(1,An,2,11,"div",2),f()),i&2){let n=g().ngIf;s(),l("ngIf",!n.countdownStarted&&(!(n.mediaConfig.video!=null&&n.mediaConfig.video.enabled)||!n.mediaState.video.enabled))}}function On(i,o){if(i&1&&(h(0),u(1,Tn,2,1,"ng-container",1),f()),i&2){let n=g();s(),l("veltIf",D(3,Rn,n.conditionSignal(),P(1,Dn,n.componentConfigSignal)))}}var fi=(()=>{let o=class o extends V{constructor(e,t,r){super(t,r,e),this.loggingService=e,this.elementRef=t,this.dynamicDataService=r,this.componentId="velt-recording-preview-steps-dialog-camera-off-message",super.initializeComponentConfigSignal(new F)}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogCameraOffMessageComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogCameraOffMessageComponent ngOnDestroy:",e)}}setupA11yAttributes(){try{let e=this.elementRef.nativeElement;e.setAttribute("data-testid",this.componentId+"-container"),e.setAttribute("role","alert"),e.setAttribute("aria-live","polite"),e.setAttribute("aria-atomic","true")}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogCameraOffMessageComponent setupA11yAttributes:",e)}}};o.\u0275fac=function(t){return new(t||o)(S(E),S(O),S(C))},o.\u0275cmp=k({type:o,selectors:[["app-recording-preview-steps-dialog-camera-off-message"]],inputs:{variant:"variant"},standalone:!1,features:[$([C]),B],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],["role","alert","aria-live","polite","aria-atomic","true",4,"ngIf"],["role","alert","aria-live","polite","aria-atomic","true"],[4,"veltDynamicTemplate"],[1,"velt-recording-preview-camera-off-message"]],template:function(t,r){t&1&&u(0,On,2,6,"ng-container",0),t&2&&l("ngIf",r.componentConfigSignal())},dependencies:[N,L,z,oe],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}.velt-recording-preview-camera-off-message[_ngcontent-%COMP%]{font-size:var(--velt-font-size-lg);color:var(--velt-text-0);margin:0}"],changeDetection:0});let i=o;return i})();var Si=i=>({componentConfigSignal:i}),Mn=(i,o)=>({condition:i,data:o}),Fn=(i,o,n,e,t)=>({template:i,context:o,componentName:"velt-recording-preview-steps-dialog-timer-cancel-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function Bn(i,o){if(i&1&&(h(0),b(1,"div",4),Ce(2),Q(3,"translate"),R(),f()),i&2){let n=g(3);s(),w("data-testid",n.componentId+"-label"),s(),be(" ",X(3,2,"Cancel")," ")}}function $n(i,o){if(i&1){let n=ge();h(0),b(1,"div",2),pe("click",function(){q(n);let t=g().ngIf;return Y(t.cancelCountdown())})("keydown.enter",function(){q(n);let t=g().ngIf;return Y(t.cancelCountdown())})("keydown.space",function(){q(n);let t=g().ngIf;return Y(t.cancelCountdown())}),u(2,Bn,4,4,"ng-container",3),R(),f()}if(i&2){let n=g(2);s(),w("data-testid",n.componentId+"-button"),s(),l("veltDynamicTemplate",M(4,Fn,n.template,P(2,Si,n.componentConfigSignal),n.variant,n.setIfCondition.bind(n),n.elementRef))}}function Vn(i,o){if(i&1&&(h(0),u(1,$n,3,10,"ng-container",1),f()),i&2){let n=g();s(),l("veltIf",D(3,Mn,n.conditionSignal(),P(1,Si,n.componentConfigSignal)))}}var Ci=(()=>{let o=class o extends V{constructor(e,t,r){super(t,r,e),this.loggingService=e,this.elementRef=t,this.dynamicDataService=r,this.componentId="velt-recording-preview-steps-dialog-timer-cancel",super.initializeComponentConfigSignal(new F)}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogTimerCancelComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogTimerCancelComponent ngOnDestroy:",e)}}setupA11yAttributes(){try{let e=this.elementRef.nativeElement;e.setAttribute("data-testid",this.componentId+"-container"),e.setAttribute("role","region"),e.setAttribute("aria-label","Recording countdown cancel controls")}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogTimerCancelComponent setupA11yAttributes:",e)}}};o.\u0275fac=function(t){return new(t||o)(S(E),S(O),S(C))},o.\u0275cmp=k({type:o,selectors:[["app-recording-preview-steps-dialog-timer-cancel"]],inputs:{variant:"variant"},standalone:!1,features:[$([C]),B],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],["role","button","tabindex","0",1,"velt-recording-preview-timer--cancel-button",3,"click","keydown.enter","keydown.space"],[4,"veltDynamicTemplate"],[1,"velt-recording-preview-timer--cancel-button"]],template:function(t,r){t&1&&u(0,Vn,2,6,"ng-container",0),t&2&&l("ngIf",r.componentConfigSignal())},dependencies:[N,L,z,oe],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%]{position:absolute;bottom:15%}.velt-recording-preview-timer--cancel-button[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;gap:var(--velt-spacing-sm);font-weight:500;font-size:var(--velt-font-size-md);line-height:24px;color:var(--velt-error);text-transform:uppercase;letter-spacing:1.5px;cursor:pointer}.velt-recording-preview-timer--cancel-button[_ngcontent-%COMP%]:hover{color:var(--velt-error-hover)}"],changeDetection:0});let i=o;return i})();var _i=i=>({componentConfigSignal:i}),Nn=(i,o)=>({condition:i,data:o}),Un=(i,o,n,e,t)=>({template:i,context:o,componentName:"velt-recording-preview-steps-dialog-timer-countdown-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function Ln(i,o){if(i&1&&(b(0,"h1",4),Ce(1),R()),i&2){let n=g(3).ngIf,e=g();w("data-testid",e.componentId+"-value"),s(),be(" ",n.countdown)}}function zn(i,o){if(i&1&&(h(0),u(1,Ln,2,2,"h1",3),f()),i&2){let n=g(2).ngIf;s(),l("ngIf",n.countdown)}}function Wn(i,o){if(i&1&&(h(0),u(1,zn,2,1,"ng-container",2),f()),i&2){let n=g(2);s(),l("veltDynamicTemplate",M(3,Un,n.template,P(1,_i,n.componentConfigSignal),n.variant,n.setIfCondition.bind(n),n.elementRef))}}function Hn(i,o){if(i&1&&(h(0),u(1,Wn,2,9,"ng-container",1),f()),i&2){let n=g();s(),l("veltIf",D(3,Nn,n.conditionSignal(),P(1,_i,n.componentConfigSignal)))}}var yi=(()=>{let o=class o extends V{constructor(e,t,r){super(t,r,e),this.loggingService=e,this.elementRef=t,this.dynamicDataService=r,this.componentId="velt-recording-preview-steps-dialog-timer-countdown",super.initializeComponentConfigSignal(new F)}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogTimerCountdownComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogTimerCountdownComponent ngOnDestroy:",e)}}setupA11yAttributes(){try{let e=this.elementRef.nativeElement;e.setAttribute("data-testid",this.componentId+"-container"),e.setAttribute("role","timer"),e.setAttribute("aria-label","Recording countdown timer"),e.setAttribute("aria-live","assertive")}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogTimerCountdownComponent setupA11yAttributes:",e)}}};o.\u0275fac=function(t){return new(t||o)(S(E),S(O),S(C))},o.\u0275cmp=k({type:o,selectors:[["app-recording-preview-steps-dialog-timer-countdown"]],inputs:{variant:"variant"},standalone:!1,features:[$([C]),B],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],[4,"veltDynamicTemplate"],["class","velt-recording-preview-timer--countdown","role","timer","aria-live","assertive",4,"ngIf"],["role","timer","aria-live","assertive",1,"velt-recording-preview-timer--countdown"]],template:function(t,r){t&1&&u(0,Hn,2,6,"ng-container",0),t&2&&l("ngIf",r.componentConfigSignal())},dependencies:[N,L,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%]{position:absolute}.velt-recording-preview-timer--countdown[_ngcontent-%COMP%]{font-size:120px;line-height:120px;font-weight:600;color:var(--velt-text-5);margin:0}"],changeDetection:0});let i=o;return i})();var wi=i=>({componentConfigSignal:i}),Kn=(i,o)=>({condition:i,data:o}),Jn=(i,o,n,e,t)=>({template:i,context:o,componentName:"velt-recording-preview-steps-dialog-timer-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function Zn(i,o){if(i&1&&(h(0),b(1,"div",3),T(2,"app-recording-preview-steps-dialog-timer-countdown",4)(3,"app-recording-preview-steps-dialog-timer-cancel",4),R(),f()),i&2){let n=g(4);s(),w("data-testid",n.componentId),s(),l("componentConfigSignal",n.componentConfigSignal)("template",n.template)("variant",n.variant),s(),l("componentConfigSignal",n.componentConfigSignal)("template",n.template)("variant",n.variant)}}function Qn(i,o){if(i&1&&(h(0),u(1,Zn,4,7,"ng-container",2),f()),i&2){let n=g(3);s(),l("veltDynamicTemplate",M(3,Jn,n.template,P(1,wi,n.componentConfigSignal),n.variant,n.setIfCondition.bind(n),n.elementRef))}}function Xn(i,o){if(i&1&&(h(0),u(1,Qn,2,9,"ng-container",0),f()),i&2){let n=g().ngIf;s(),l("ngIf",n.countdownStarted)}}function qn(i,o){if(i&1&&(h(0),u(1,Xn,2,1,"ng-container",1),f()),i&2){let n=g();s(),l("veltIf",D(3,Kn,n.conditionSignal(),P(1,wi,n.componentConfigSignal)))}}var ct=(()=>{let o=class o extends V{constructor(e,t,r){super(t,r,e),this.loggingService=e,this.elementRef=t,this.dynamicDataService=r,this.componentId="velt-recording-preview-steps-dialog-timer",super.initializeComponentConfigSignal(new F)}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogTimerComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogTimerComponent ngOnDestroy:",e)}}setupA11yAttributes(){try{let e=this.elementRef.nativeElement;e.setAttribute("data-testid",this.componentId+"-container"),e.setAttribute("role","region"),e.setAttribute("aria-label","Recording countdown section")}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogTimerComponent setupA11yAttributes:",e)}}};o.\u0275fac=function(t){return new(t||o)(S(E),S(O),S(C))},o.\u0275cmp=k({type:o,selectors:[["app-recording-preview-steps-dialog-timer"]],inputs:{variant:"variant"},standalone:!1,features:[$([C]),B],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],[4,"veltDynamicTemplate"],["role","region","aria-live","polite",1,"velt-recording-preview-dialog-timer"],[3,"componentConfigSignal","template","variant"]],template:function(t,r){t&1&&u(0,qn,2,6,"ng-container",0),t&2&&l("ngIf",r.componentConfigSignal())},dependencies:[N,L,z,Ci,yi],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%]:empty{display:none}.velt-recording-preview-dialog-timer[_ngcontent-%COMP%]{position:relative;width:332px;height:332px;display:flex;align-items:center;justify-content:center;gap:var(--velt-spacing-lg);border-radius:100%;flex-direction:column;border:2px solid var(--velt-border-transparent);background:var(--velt-background-transparent);-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px)}"],changeDetection:0});let i=o;return i})();var Ii=i=>({componentConfigSignal:i}),Yn=(i,o)=>({condition:i,data:o}),er=(i,o,n,e,t)=>({template:i,context:o,componentName:"velt-recording-preview-steps-dialog-start-recording-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function tr(i,o){if(i&1&&(h(0),b(1,"div",4),Ce(2),Q(3,"translate"),R(),f()),i&2){let n=g(3);s(),w("data-testid",n.componentId+"-label"),s(),be(" ",X(3,2,"Start Recording"))}}function ir(i,o){if(i&1){let n=ge();h(0),b(1,"div",2),pe("click",function(){q(n);let t=g().ngIf;return Y(t.startCountdown())}),u(2,tr,4,4,"ng-container",3),R(),f()}if(i&2){let n=g().ngIf,e=g();s(),he("disabled",n.type==="video"&&(!(n.mediaConfig.video!=null&&n.mediaConfig.video.enabled)||!n.mediaState.video.enabled)||n.type==="audio"&&(!(n.mediaConfig.audio!=null&&n.mediaConfig.audio.enabled)||!n.mediaState.audio.enabled)),w("data-testid",e.componentId+"-button"),s(),l("veltDynamicTemplate",M(6,er,e.template,P(4,Ii,e.componentConfigSignal),e.variant,e.setIfCondition.bind(e),e.elementRef))}}function nr(i,o){if(i&1&&(h(0),u(1,ir,3,12,"ng-container",1),f()),i&2){let n=g();s(),l("veltIf",D(3,Yn,n.conditionSignal(),P(1,Ii,n.componentConfigSignal)))}}var st=(()=>{let o=class o extends V{constructor(e,t,r){super(t,r,e),this.loggingService=e,this.elementRef=t,this.dynamicDataService=r,this.componentId="velt-recording-preview-steps-dialog-start-recording",super.initializeComponentConfigSignal(new F)}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogStartRecordingComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogStartRecordingComponent ngOnDestroy:",e)}}setupA11yAttributes(){try{let e=this.elementRef.nativeElement;e.setAttribute("data-testid",this.componentId+"-container"),e.setAttribute("role","region"),e.setAttribute("aria-label","Start recording")}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogStartRecordingComponent setupA11yAttributes:",e)}}};o.\u0275fac=function(t){return new(t||o)(S(E),S(O),S(C))},o.\u0275cmp=k({type:o,selectors:[["app-recording-preview-steps-dialog-start-recording"]],inputs:{variant:"variant"},standalone:!1,features:[$([C]),B],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],["role","button","tabindex","0",3,"click"],[4,"veltDynamicTemplate"],[1,"velt-recording-preview-start-button"]],template:function(t,r){t&1&&u(0,nr,2,6,"ng-container",0),t&2&&l("ngIf",r.componentConfigSignal())},dependencies:[N,L,z,oe],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}.velt-recording-preview-start-button[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;gap:var(--velt-spacing-sm);padding:var(--velt-spacing-lg) var(--velt-spacing-2xl);font-size:var(--velt-font-size-sm);font-weight:600;transition:all .2s ease;cursor:pointer;width:fit-content;border-radius:var(--velt-border-radius-full);background:var(--velt-accent);color:var(--velt-accent-foreground)}.velt-recording-preview-start-button[_ngcontent-%COMP%]:hover{background:var(--velt-accent-hover)}.disabled[_ngcontent-%COMP%]{opacity:.5;pointer-events:none}"],changeDetection:0});let i=o;return i})();var Ri=i=>({componentConfigSignal:i}),rr=(i,o)=>({condition:i,data:o}),or=(i,o,n,e,t)=>({template:i,context:o,componentName:"velt-recording-preview-steps-dialog-mic-button-off-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function ar(i,o){if(i&1&&(h(0),le(),b(1,"svg",3),T(2,"path",4)(3,"path",5),R(),f()),i&2){let n=g(4);s(),w("data-testid",n.componentId+"-icon")}}function cr(i,o){if(i&1&&(h(0),u(1,ar,4,1,"ng-container",2),f()),i&2){let n=g(3);s(),l("veltDynamicTemplate",M(3,or,n.template,P(1,Ri,n.componentConfigSignal),n.variant,n.setIfCondition.bind(n),n.elementRef))}}function sr(i,o){if(i&1&&(h(0),u(1,cr,2,9,"ng-container",0),f()),i&2){let n=g().ngIf;s(),l("ngIf",!(n.mediaConfig.audio!=null&&n.mediaConfig.audio.enabled))}}function dr(i,o){if(i&1&&(h(0),u(1,sr,2,1,"ng-container",1),f()),i&2){let n=g();s(),l("veltIf",D(3,rr,n.conditionSignal(),P(1,Ri,n.componentConfigSignal)))}}var xi=(()=>{let o=class o extends V{constructor(e,t,r){super(t,r,e),this.loggingService=e,this.elementRef=t,this.dynamicDataService=r,this.componentId="velt-recording-preview-steps-dialog-mic-button-off",super.initializeComponentConfigSignal(new F)}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogMicButtonOffComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogMicButtonOffComponent ngOnDestroy:",e)}}setupA11yAttributes(){try{let e=this.elementRef.nativeElement;e.setAttribute("data-testid",this.componentId+"-container"),e.setAttribute("role","button"),e.setAttribute("aria-label","Microphone off"),e.setAttribute("aria-pressed","true"),e.setAttribute("tabindex","0")}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogMicButtonOffComponent setupA11yAttributes:",e)}}};o.\u0275fac=function(t){return new(t||o)(S(E),S(O),S(C))},o.\u0275cmp=k({type:o,selectors:[["velt-recording-preview-steps-dialog-mic-button-off-internal"]],inputs:{variant:"variant"},standalone:!1,features:[$([C]),B],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],[4,"veltDynamicTemplate"],["width","28","height","28","viewBox","0 0 28 28","fill","none","xmlns","http://www.w3.org/2000/svg","focusable","false","aria-hidden","true"],["d","M11.5013 8.1665C11.5013 7.50346 11.7647 6.86758 12.2335 6.39874C12.7024 5.9299 13.3383 5.6665 14.0013 5.6665C14.6643 5.6665 15.3002 5.9299 15.7691 6.39874C16.2379 6.86758 16.5013 7.50346 16.5013 8.1665V12.3332C16.5013 12.58 16.4648 12.8254 16.393 13.0615M14.7263 14.7282C14.3527 14.8414 13.9578 14.8655 13.5732 14.7987C13.1885 14.7318 12.8249 14.5758 12.5114 14.3432C12.198 14.1105 11.9433 13.8077 11.7679 13.459C11.5925 13.1102 11.5012 12.7252 11.5013 12.3348V11.5015M8.16797 12.3332C8.16779 13.386 8.45252 14.4192 8.99198 15.3232C9.53144 16.2273 10.3055 16.9685 11.2321 17.4683C12.1587 17.9681 13.2033 18.2078 14.2551 18.162C15.3069 18.1162 16.3267 17.7866 17.2063 17.2082M18.873 15.5415C19.5012 14.5896 19.835 13.4737 19.833 12.3332M10.668 21.4998H17.3346M14.0013 18.1665V21.4998","stroke","currentColor","stroke-opacity","0.52","stroke-width","1.5","stroke-linecap","round","stroke-linejoin","round"],["d","M6.5 6.5L21.5 21.5","stroke","#FF7162","stroke-width","1.5","stroke-linecap","round","stroke-linejoin","round"]],template:function(t,r){t&1&&u(0,dr,2,6,"ng-container",0),t&2&&l("ngIf",r.componentConfigSignal())},dependencies:[N,L,z],styles:["[_nghost-%COMP%]{display:flex}"],changeDetection:0});let i=o;return i})();var Ei=i=>({componentConfigSignal:i}),gr=(i,o)=>({condition:i,data:o}),pr=(i,o,n,e,t)=>({template:i,context:o,componentName:"velt-recording-preview-steps-dialog-mic-button-on-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function mr(i,o){if(i&1&&(h(0),le(),b(1,"svg",3),T(2,"path",4),R(),f()),i&2){let n=g(4);s(),w("data-testid",n.componentId+"-icon")}}function vr(i,o){if(i&1&&(h(0),u(1,mr,3,1,"ng-container",2),f()),i&2){let n=g(3);s(),l("veltDynamicTemplate",M(3,pr,n.template,P(1,Ei,n.componentConfigSignal),n.variant,n.setIfCondition.bind(n),n.elementRef))}}function ur(i,o){if(i&1&&(h(0),u(1,vr,2,9,"ng-container",0),f()),i&2){let n=g().ngIf;s(),l("ngIf",n.mediaConfig.audio==null?null:n.mediaConfig.audio.enabled)}}function hr(i,o){if(i&1&&(h(0),u(1,ur,2,1,"ng-container",1),f()),i&2){let n=g();s(),l("veltIf",D(3,gr,n.conditionSignal(),P(1,Ei,n.componentConfigSignal)))}}var Pi=(()=>{let o=class o extends V{constructor(e,t,r){super(t,r,e),this.loggingService=e,this.elementRef=t,this.dynamicDataService=r,this.componentId="velt-recording-preview-steps-dialog-mic-button-on",super.initializeComponentConfigSignal(new F)}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogMicButtonOnComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogMicButtonOnComponent ngOnDestroy:",e)}}setupA11yAttributes(){try{let e=this.elementRef.nativeElement;e.setAttribute("data-testid",this.componentId+"-container"),e.setAttribute("role","button"),e.setAttribute("aria-label","Microphone on"),e.setAttribute("aria-pressed","false"),e.setAttribute("tabindex","0")}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogMicButtonOnComponent setupA11yAttributes:",e)}}};o.\u0275fac=function(t){return new(t||o)(S(E),S(O),S(C))},o.\u0275cmp=k({type:o,selectors:[["velt-recording-preview-steps-dialog-mic-button-on-internal"]],inputs:{variant:"variant"},standalone:!1,features:[$([C]),B],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],[4,"veltDynamicTemplate"],["width","28","height","28","viewBox","0 0 28 28","fill","none","xmlns","http://www.w3.org/2000/svg","focusable","false","aria-hidden","true"],["d","M8.16699 12.3332C8.16699 13.8803 8.78157 15.364 9.87554 16.458C10.9695 17.5519 12.4532 18.1665 14.0003 18.1665M14.0003 18.1665C15.5474 18.1665 17.0312 17.5519 18.1251 16.458C19.2191 15.364 19.8337 13.8803 19.8337 12.3332M14.0003 18.1665V21.4998M10.667 21.4998H17.3337M11.5003 8.1665C11.5003 7.50346 11.7637 6.86758 12.2326 6.39874C12.7014 5.9299 13.3373 5.6665 14.0003 5.6665C14.6634 5.6665 15.2993 5.9299 15.7681 6.39874C16.2369 6.86758 16.5003 7.50346 16.5003 8.1665V12.3332C16.5003 12.9962 16.2369 13.6321 15.7681 14.1009C15.2993 14.5698 14.6634 14.8332 14.0003 14.8332C13.3373 14.8332 12.7014 14.5698 12.2326 14.1009C11.7637 13.6321 11.5003 12.9962 11.5003 12.3332V8.1665Z","stroke","currentColor","stroke-width","1.5","stroke-linecap","round","stroke-linejoin","round"]],template:function(t,r){t&1&&u(0,hr,2,6,"ng-container",0),t&2&&l("ngIf",r.componentConfigSignal())},dependencies:[N,L,z],styles:["[_nghost-%COMP%]{display:flex}"],changeDetection:0});let i=o;return i})();var Sr=i=>({componentConfigSignal:i}),Cr=(i,o)=>({condition:i,data:o}),_r=(i,o)=>({componentConfigSignal:i,variant:o}),yr=(i,o,n,e,t)=>({template:i,context:o,componentName:"velt-recording-preview-steps-dialog-mic-button-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function wr(i,o){if(i&1&&(h(0),b(1,"div",5),T(2,"velt-recording-preview-steps-dialog-mic-button-on-internal",6)(3,"velt-recording-preview-steps-dialog-mic-button-off-internal",6),R(),f()),i&2){let n=g(2).ngIf,e=g();s(),he("velt-recording-preview--icon-button-off",!(n.mediaConfig.audio!=null&&n.mediaConfig.audio.enabled)),w("data-testid",e.componentId+"-icon-container"),s(),l("componentConfigSignal",e.componentConfigSignal)("template",e.template)("variant",e.variant),s(),l("componentConfigSignal",e.componentConfigSignal)("template",e.template)("variant",e.variant)}}function br(i,o){if(i&1){let n=ge();h(0),b(1,"app-device-permission-button",2)(2,"div",3),Q(3,"translate"),Q(4,"translate"),Q(5,"translate"),pe("click",function(){q(n);let t=g().ngIf;return Y(t.toggleAudio())})("keydown.enter",function(){q(n);let t=g().ngIf;return Y(t.toggleAudio())})("keydown.space",function(){q(n);let t=g().ngIf;return Y(t.toggleAudio())}),u(6,wr,4,9,"ng-container",4),R()(),f()}if(i&2){let n=g().ngIf,e=g();s(),l("darkMode",!!n.darkMode),w("data-testid",e.componentId+"-permission-button"),s(),w("data-testid",e.componentId+"-toggle")("aria-label",X(3,6,"Toggle microphone")+" "+(n.mediaConfig.audio!=null&&n.mediaConfig.audio.enabled?X(4,8,"off"):X(5,10,"on")))("aria-pressed",!!(n.mediaConfig.audio!=null&&n.mediaConfig.audio.enabled)),s(4),l("veltDynamicTemplate",M(15,yr,e.template,D(12,_r,e.componentConfigSignal,e.variant),e.variant,e.setIfCondition.bind(e),e.elementRef))}}function Ir(i,o){if(i&1&&(h(0),u(1,br,7,21,"ng-container",1),f()),i&2){let n=g();s(),l("veltIf",D(3,Cr,n.conditionSignal(),P(1,Sr,n.componentConfigSignal)))}}var dt=(()=>{let o=class o extends V{constructor(e,t,r,a){super(r,a,t),this.devicePermissionService=e,this.loggingService=t,this.elementRef=r,this.dynamicDataService=a,this.componentId="velt-recording-preview-steps-dialog-mic-button",super.initializeComponentConfigSignal(new F)}ngOnChanges(e){try{if(e.componentConfigSignal){let t=this.componentConfigSignal();!t?.mediaState?.audio?.enabled&&t.type==="audio"&&this.devicePermissionService.openDevicePermissionDeniedDialog("audio",{darkMode:!1})}}catch(t){this.loggingService.catch("Error in RecordingPreviewStepsDialogMicButtonComponent ngOnChanges:",t)}}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes(),!this.componentConfigSignal()?.mediaState?.audio?.enabled&&this.componentConfigSignal().type==="audio"&&this.devicePermissionService.openDevicePermissionDeniedDialog("audio",{darkMode:!1})}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogMicButtonComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogMicButtonOnComponent ngOnDestroy:",e)}}setupA11yAttributes(){try{let e=this.elementRef.nativeElement;e.setAttribute("data-testid",this.componentId+"-container"),e.setAttribute("role","group"),e.setAttribute("aria-label","Microphone control buttons")}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogMicButtonComponent setupA11yAttributes:",e)}}};o.\u0275fac=function(t){return new(t||o)(S(Ve),S(E),S(O),S(C))},o.\u0275cmp=k({type:o,selectors:[["velt-recording-preview-steps-dialog-mic-button-internal"]],inputs:{variant:"variant"},standalone:!1,features:[$([C]),B,Ee],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],["type","audio",3,"darkMode"],["role","button","tabindex","0",3,"click","keydown.enter","keydown.space"],[4,"veltDynamicTemplate"],[1,"velt-recording-preview--icon-button"],[3,"componentConfigSignal","template","variant"]],template:function(t,r){t&1&&u(0,Ir,2,6,"ng-container",0),t&2&&l("ngIf",r.componentConfigSignal())},dependencies:[N,L,z,xi,Pi,oe],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}.velt-recording-preview--icon-button[_ngcontent-%COMP%]{padding:var(--velt-spacing-md);display:flex;align-items:center;justify-content:center;border-radius:var(--velt-border-radius-3xl);cursor:pointer;border:1.5px solid var(--velt-border-2);background:var(--velt-background-0);color:var(--velt-text-2);transition:all .2s ease}.velt-recording-preview--icon-button[_ngcontent-%COMP%]:hover{border:1.5px solid var(--velt-border-3);background:var(--velt-background-1);color:var(--velt-text-3)}"],changeDetection:0});let i=o;return i})();var Dr=i=>({componentConfigSignal:i}),Rr=(i,o)=>({condition:i,data:o}),xr=(i,o)=>({componentConfigSignal:i,variant:o}),Er=(i,o,n,e,t)=>({template:i,context:o,componentName:"velt-recording-preview-steps-dialog-camera-button-on-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function Pr(i,o){if(i&1&&(h(0),le(),b(1,"svg",3),T(2,"path",4)(3,"path",5),R(),f()),i&2){let n=g(4);s(),w("data-testid",n.componentId+"-icon")}}function Ar(i,o){if(i&1&&(h(0),u(1,Pr,4,1,"ng-container",2),f()),i&2){let n=g(3);s(),l("veltDynamicTemplate",M(4,Er,n.template,D(1,xr,n.componentConfigSignal,n.variant),n.variant,n.setIfCondition.bind(n),n.elementRef))}}function Tr(i,o){if(i&1&&(h(0),u(1,Ar,2,10,"ng-container",0),f()),i&2){let n=g().ngIf;s(),l("ngIf",n.mediaConfig.video==null?null:n.mediaConfig.video.enabled)}}function Or(i,o){if(i&1&&(h(0),u(1,Tr,2,1,"ng-container",1),f()),i&2){let n=g();s(),l("veltIf",D(3,Rr,n.conditionSignal(),P(1,Dr,n.componentConfigSignal)))}}var Oi=(()=>{let o=class o extends V{constructor(e,t,r){super(t,r,e),this.loggingService=e,this.elementRef=t,this.dynamicDataService=r,this.componentId="velt-recording-preview-steps-dialog-camera-button-on",super.initializeComponentConfigSignal(new F)}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogCameraButtonOnComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogCameraButtonOnComponent ngOnDestroy:",e)}}setupA11yAttributes(){try{let e=this.elementRef.nativeElement;e.setAttribute("data-testid",this.componentId+"-container"),e.setAttribute("role","button"),e.setAttribute("aria-label","Camera on"),e.setAttribute("aria-pressed","false"),e.setAttribute("tabindex","0")}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogCameraButtonOnComponent setupA11yAttributes:",e)}}};o.\u0275fac=function(t){return new(t||o)(S(E),S(O),S(C))},o.\u0275cmp=k({type:o,selectors:[["velt-recording-preview-steps-dialog-camera-button-on-internal"]],inputs:{variant:"variant"},standalone:!1,features:[$([C]),B],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],[4,"veltDynamicTemplate"],["width","28","height","28","viewBox","0 0 28 28","fill","none","xmlns","http://www.w3.org/2000/svg","focusable","false","aria-hidden","true"],["d","M16.5 12.3334L20.2942 10.4368C20.4212 10.3733 20.5623 10.3433 20.7042 10.3497C20.846 10.3561 20.9839 10.3986 21.1047 10.4733C21.2255 10.5479 21.3252 10.6522 21.3944 10.7762C21.4636 10.9002 21.4999 11.0398 21.5 11.1818V16.8184C21.4999 16.9604 21.4636 17.1 21.3944 17.224C21.3252 17.348 21.2255 17.4523 21.1047 17.5269C20.9839 17.6016 20.846 17.6441 20.7042 17.6505C20.5623 17.6569 20.4212 17.6269 20.2942 17.5634L16.5 15.6668V12.3334Z","stroke","currentColor","stroke-width","1.5","stroke-linecap","round","stroke-linejoin","round"],["d","M6.5 10.6667C6.5 10.2246 6.67559 9.80072 6.98816 9.48816C7.30072 9.17559 7.72464 9 8.16667 9H14.8333C15.2754 9 15.6993 9.17559 16.0118 9.48816C16.3244 9.80072 16.5 10.2246 16.5 10.6667V17.3333C16.5 17.7754 16.3244 18.1993 16.0118 18.5118C15.6993 18.8244 15.2754 19 14.8333 19H8.16667C7.72464 19 7.30072 18.8244 6.98816 18.5118C6.67559 18.1993 6.5 17.7754 6.5 17.3333V10.6667Z","stroke","currentColor","stroke-width","1.5","stroke-linecap","round","stroke-linejoin","round"]],template:function(t,r){t&1&&u(0,Or,2,6,"ng-container",0),t&2&&l("ngIf",r.componentConfigSignal())},dependencies:[N,L,z],styles:["[_nghost-%COMP%]{display:flex}"],changeDetection:0});let i=o;return i})();var Mr=i=>({componentConfigSignal:i}),Fr=(i,o)=>({condition:i,data:o}),Br=(i,o)=>({componentConfigSignal:i,variant:o}),$r=(i,o,n,e,t)=>({template:i,context:o,componentName:"velt-recording-preview-steps-dialog-camera-button-off-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function Vr(i,o){if(i&1&&(h(0),le(),b(1,"svg",3),T(2,"path",4)(3,"path",5),R(),f()),i&2){let n=g(4);s(),w("data-testid",n.componentId+"-icon")}}function jr(i,o){if(i&1&&(h(0),u(1,Vr,4,1,"ng-container",2),f()),i&2){let n=g(3);s(),l("veltDynamicTemplate",M(4,$r,n.template,D(1,Br,n.componentConfigSignal,n.variant),n.variant,n.setIfCondition.bind(n),n.elementRef))}}function Nr(i,o){if(i&1&&(h(0),u(1,jr,2,10,"ng-container",0),f()),i&2){let n=g().ngIf;s(),l("ngIf",!(n.mediaConfig.video!=null&&n.mediaConfig.video.enabled))}}function Ur(i,o){if(i&1&&(h(0),u(1,Nr,2,1,"ng-container",1),f()),i&2){let n=g();s(),l("veltIf",D(3,Fr,n.conditionSignal(),P(1,Mr,n.componentConfigSignal)))}}var ki=(()=>{let o=class o extends V{constructor(e,t,r){super(t,r,e),this.loggingService=e,this.elementRef=t,this.dynamicDataService=r,this.componentId="velt-recording-preview-steps-dialog-camera-button-off",super.initializeComponentConfigSignal(new F)}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogCameraButtonOffComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogCameraButtonOffComponent ngOnDestroy:",e)}}setupA11yAttributes(){try{let e=this.elementRef.nativeElement;e.setAttribute("data-testid",this.componentId+"-container"),e.setAttribute("role","button"),e.setAttribute("aria-label","Camera off"),e.setAttribute("aria-pressed","true"),e.setAttribute("tabindex","0")}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogCameraButtonOffComponent setupA11yAttributes:",e)}}};o.\u0275fac=function(t){return new(t||o)(S(E),S(O),S(C))},o.\u0275cmp=k({type:o,selectors:[["velt-recording-preview-steps-dialog-camera-button-off-internal"]],inputs:{variant:"variant"},standalone:!1,features:[$([C]),B],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],[4,"veltDynamicTemplate"],["width","28","height","28","viewBox","0 0 28 28","fill","none","xmlns","http://www.w3.org/2000/svg","focusable","false","aria-hidden","true"],["d","M20.9375 17.6068C21.1017 17.5503 21.2442 17.444 21.345 17.3027C21.4459 17.1614 21.5 16.9921 21.5 16.8184V11.1818C21.4999 11.0398 21.4636 10.9002 21.3944 10.7762C21.3252 10.6522 21.2255 10.5479 21.1047 10.4733C20.9839 10.3986 20.846 10.3561 20.7042 10.3497C20.5623 10.3433 20.4212 10.3733 20.2942 10.4368L16.5 12.3334V13.1668V10.6667C16.5 10.2246 16.3244 9.80072 16.0118 9.48816C15.6993 9.17559 15.2754 9 14.8333 9H12.3333M16.5 16.5V17.3333C16.5 17.7754 16.3244 18.1993 16.0118 18.5118C15.6993 18.8244 15.2754 19 14.8333 19H8.16667C7.72464 19 7.30072 18.8244 6.98816 18.5118C6.67559 18.1993 6.5 17.7754 6.5 17.3333V10.6667C6.5 10.2246 6.67559 9.80072 6.98816 9.48816C7.30072 9.17559 7.72464 9 8.16667 9H9","stroke","currentColor","stroke-opacity","0.52","stroke-width","1.5","stroke-linecap","round","stroke-linejoin","round"],["d","M6.5 6.5L21.5 21.5","stroke","#FF7162","stroke-width","1.5","stroke-linecap","round","stroke-linejoin","round"]],template:function(t,r){t&1&&u(0,Ur,2,6,"ng-container",0),t&2&&l("ngIf",r.componentConfigSignal())},dependencies:[N,L,z],styles:["[_nghost-%COMP%]{display:flex}"],changeDetection:0});let i=o;return i})();var zr=i=>({componentConfigSignal:i}),Wr=(i,o)=>({condition:i,data:o}),Hr=(i,o)=>({componentConfigSignal:i,variant:o}),Gr=(i,o,n,e,t)=>({template:i,context:o,componentName:"velt-recording-preview-steps-dialog-camera-button-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function Kr(i,o){if(i&1&&(h(0),b(1,"div",6),T(2,"velt-recording-preview-steps-dialog-camera-button-on-internal",7)(3,"velt-recording-preview-steps-dialog-camera-button-off-internal",7),R(),f()),i&2){let n=g(3).ngIf,e=g();s(),he("velt-recording-preview--icon-button-off",!(n.mediaConfig.video!=null&&n.mediaConfig.video.enabled)),w("data-testid",e.componentId+"-icon-container"),s(),l("componentConfigSignal",e.componentConfigSignal)("template",e.template)("variant",e.variant),s(),l("componentConfigSignal",e.componentConfigSignal)("template",e.template)("variant",e.variant)}}function Jr(i,o){if(i&1){let n=ge();b(0,"app-device-permission-button",3)(1,"div",4),Q(2,"translate"),Q(3,"translate"),Q(4,"translate"),pe("click",function(){q(n);let t=g(2).ngIf;return Y(t.toggleVideo())}),u(5,Kr,4,9,"ng-container",5),R()()}if(i&2){let n=g(2).ngIf,e=g();l("darkMode",!!n.darkMode),w("data-testid",e.componentId+"-permission-button"),s(),w("data-testid",e.componentId+"-toggle")("aria-label",X(2,6,"Toggle camera")+" "+(n.mediaConfig.video!=null&&n.mediaConfig.video.enabled?X(3,8,"off"):X(4,10,"on")))("aria-pressed",!!(n.mediaConfig.video!=null&&n.mediaConfig.video.enabled)),s(4),l("veltDynamicTemplate",M(15,Gr,e.template,D(12,Hr,e.componentConfigSignal,e.variant),e.variant,e.setIfCondition.bind(e),e.elementRef))}}function Zr(i,o){if(i&1&&(h(0),u(1,Jr,6,21,"app-device-permission-button",2),f()),i&2){let n=g().ngIf;s(),l("ngIf",n.type==="screen")}}function Qr(i,o){if(i&1&&(h(0),u(1,Zr,2,1,"ng-container",1),f()),i&2){let n=g();s(),l("veltIf",D(3,Wr,n.conditionSignal(),P(1,zr,n.componentConfigSignal)))}}var Mi=(()=>{let o=class o extends V{constructor(e,t,r,a){super(r,a,t),this.devicePermissionService=e,this.loggingService=t,this.elementRef=r,this.dynamicDataService=a,this.componentId="velt-recording-preview-steps-dialog-camera-button",super.initializeComponentConfigSignal(new F)}ngOnChanges(e){try{if(e.componentConfigSignal){let t=this.componentConfigSignal();!t?.mediaState?.video?.enabled&&t.type==="video"&&this.devicePermissionService.openDevicePermissionDeniedDialog("video",{darkMode:!1})}}catch(t){this.loggingService.catch("Error in RecordingPreviewStepsDialogCameraButtonComponent ngOnChanges:",t)}}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes(),!this.componentConfigSignal()?.mediaState?.video?.enabled&&this.componentConfigSignal().type==="video"&&this.devicePermissionService.openDevicePermissionDeniedDialog("video",{darkMode:!1})}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogCameraButtonComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogCameraButtonOnComponent ngOnDestroy:",e)}}setupA11yAttributes(){try{let e=this.elementRef.nativeElement;e.setAttribute("data-testid",this.componentId+"-container"),e.setAttribute("role","group"),e.setAttribute("aria-label","Camera control buttons")}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogCameraButtonComponent setupA11yAttributes:",e)}}};o.\u0275fac=function(t){return new(t||o)(S(Ve),S(E),S(O),S(C))},o.\u0275cmp=k({type:o,selectors:[["velt-recording-preview-steps-dialog-camera-button-internal"]],inputs:{variant:"variant"},standalone:!1,features:[$([C]),B,Ee],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],["type","video",3,"darkMode",4,"ngIf"],["type","video",3,"darkMode"],["role","button","tabindex","0",3,"click"],[4,"veltDynamicTemplate"],[1,"velt-recording-preview--icon-button"],[3,"componentConfigSignal","template","variant"]],template:function(t,r){t&1&&u(0,Qr,2,6,"ng-container",0),t&2&&l("ngIf",r.componentConfigSignal())},dependencies:[N,L,z,Oi,ki,oe],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%]:empty{display:none}.velt-recording-preview--icon-button[_ngcontent-%COMP%]{padding:var(--velt-spacing-md);display:flex;align-items:center;justify-content:center;border-radius:var(--velt-border-radius-3xl);cursor:pointer;border:1.5px solid var(--velt-border-2);background:var(--velt-background-0);color:var(--velt-text-2);transition:all .2s ease}.velt-recording-preview--icon-button[_ngcontent-%COMP%]:hover{border:1.5px solid var(--velt-border-3);background:var(--velt-background-1);color:var(--velt-text-3)}"],changeDetection:0});let i=o;return i})();var Fi=i=>({componentConfigSignal:i}),qr=(i,o)=>({condition:i,data:o}),Yr=(i,o,n,e,t)=>({template:i,context:o,componentName:"velt-recording-preview-steps-dialog-settings-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function eo(i,o){if(i&1&&(h(0),b(1,"div",5),le(),b(2,"svg",6),T(3,"path",7)(4,"path",8),R()(),f()),i&2){let n=g(4);s(),w("data-testid",n.componentId+"-icon-container"),s(),w("data-testid",n.componentId+"-icon")}}function to(i,o){if(i&1){let n=ge();b(0,"div",3),Q(1,"translate"),Q(2,"translate"),Q(3,"translate"),pe("click",function(t){q(n);let r=g(2).ngIf;return Y(r.toggleSettings(t))})("keydown.enter",function(t){q(n);let r=g(2).ngIf;return Y(r.toggleSettings(t))})("keydown.space",function(t){q(n);let r=g(2).ngIf;return Y(r.toggleSettings(t))}),u(4,eo,5,2,"ng-container",4),R()}if(i&2){let n=g(2).ngIf,e=g();he("velt-recording-preview--settings-button-open",n.isSettingsOpen),w("data-testid",e.componentId+"-button")("aria-label",(n.isSettingsOpen?X(1,7,"Close"):X(2,9,"Open"))+" "+X(3,11,"recording settings"))("aria-expanded",n.isSettingsOpen)("aria-controls",e.componentId+"-panel"),s(4),l("veltDynamicTemplate",M(15,Yr,e.template,P(13,Fi,e.componentConfigSignal),e.variant,e.setIfCondition.bind(e),e.elementRef))}}function io(i,o){if(i&1&&(h(0),u(1,to,5,21,"div",2),f()),i&2){let n=g().ngIf;s(),l("ngIf",!n.countdownStarted)}}function no(i,o){if(i&1&&(h(0),u(1,io,2,1,"ng-container",1),f()),i&2){let n=g();s(),l("veltIf",D(3,qr,n.conditionSignal(),P(1,Fi,n.componentConfigSignal)))}}var lt=(()=>{let o=class o extends V{constructor(e,t,r){super(t,r,e),this.loggingService=e,this.elementRef=t,this.dynamicDataService=r,this.componentId="velt-recording-preview-steps-dialog-settings",super.initializeComponentConfigSignal(new F)}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogSettingsComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogSettingsComponent ngOnDestroy:",e)}}setupA11yAttributes(){try{let e=this.elementRef.nativeElement;e.setAttribute("data-testid",this.componentId+"-container"),e.setAttribute("role","region"),e.setAttribute("aria-label","Recording preview settings")}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogSettingsComponent setupA11yAttributes:",e)}}};o.\u0275fac=function(t){return new(t||o)(S(E),S(O),S(C))},o.\u0275cmp=k({type:o,selectors:[["app-recording-preview-steps-dialog-settings"]],inputs:{variant:"variant"},standalone:!1,features:[$([C]),B],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],["role","button","tabindex","0",3,"velt-recording-preview--settings-button-open","click","keydown.enter","keydown.space",4,"ngIf"],["role","button","tabindex","0",3,"click","keydown.enter","keydown.space"],[4,"veltDynamicTemplate"],[1,"velt-recording-preview--settings-button"],["width","24","height","24","viewBox","0 0 24 24","fill","none","xmlns","http://www.w3.org/2000/svg","focusable","false","aria-hidden","true"],["d","M10.325 4.317C10.751 2.561 13.249 2.561 13.675 4.317C13.7389 4.5808 13.8642 4.82578 14.0407 5.032C14.2172 5.23822 14.4399 5.39985 14.6907 5.50375C14.9414 5.60764 15.2132 5.65085 15.4838 5.62987C15.7544 5.60889 16.0162 5.5243 16.248 5.383C17.791 4.443 19.558 6.209 18.618 7.753C18.4769 7.98466 18.3924 8.24634 18.3715 8.51677C18.3506 8.78721 18.3938 9.05877 18.4975 9.30938C18.6013 9.55999 18.7627 9.78258 18.9687 9.95905C19.1747 10.1355 19.4194 10.2609 19.683 10.325C21.439 10.751 21.439 13.249 19.683 13.675C19.4192 13.7389 19.1742 13.8642 18.968 14.0407C18.7618 14.2172 18.6001 14.4399 18.4963 14.6907C18.3924 14.9414 18.3491 15.2132 18.3701 15.4838C18.3911 15.7544 18.4757 16.0162 18.617 16.248C19.557 17.791 17.791 19.558 16.247 18.618C16.0153 18.4769 15.7537 18.3924 15.4832 18.3715C15.2128 18.3506 14.9412 18.3938 14.6906 18.4975C14.44 18.6013 14.2174 18.7627 14.0409 18.9687C13.8645 19.1747 13.7391 19.4194 13.675 19.683C13.249 21.439 10.751 21.439 10.325 19.683C10.2611 19.4192 10.1358 19.1742 9.95929 18.968C9.7828 18.7618 9.56011 18.6001 9.30935 18.4963C9.05859 18.3924 8.78683 18.3491 8.51621 18.3701C8.24559 18.3911 7.98375 18.4757 7.752 18.617C6.209 19.557 4.442 17.791 5.382 16.247C5.5231 16.0153 5.60755 15.7537 5.62848 15.4832C5.64942 15.2128 5.60624 14.9412 5.50247 14.6906C5.3987 14.44 5.23726 14.2174 5.03127 14.0409C4.82529 13.8645 4.58056 13.7391 4.317 13.675C2.561 13.249 2.561 10.751 4.317 10.325C4.5808 10.2611 4.82578 10.1358 5.032 9.95929C5.23822 9.7828 5.39985 9.56011 5.50375 9.30935C5.60764 9.05859 5.65085 8.78683 5.62987 8.51621C5.60889 8.24559 5.5243 7.98375 5.383 7.752C4.443 6.209 6.209 4.442 7.753 5.382C8.753 5.99 10.049 5.452 10.325 4.317Z","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["d","M9 12C9 12.7956 9.31607 13.5587 9.87868 14.1213C10.4413 14.6839 11.2044 15 12 15C12.7956 15 13.5587 14.6839 14.1213 14.1213C14.6839 13.5587 15 12.7956 15 12C15 11.2044 14.6839 10.4413 14.1213 9.87868C13.5587 9.31607 12.7956 9 12 9C11.2044 9 10.4413 9.31607 9.87868 9.87868C9.31607 10.4413 9 11.2044 9 12Z","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"]],template:function(t,r){t&1&&u(0,no,2,6,"ng-container",0),t&2&&l("ngIf",r.componentConfigSignal())},dependencies:[N,L,z,oe],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}.velt-recording-preview--settings-button[_ngcontent-%COMP%]{padding:var(--velt-spacing-md);display:flex;align-items:center;justify-content:center;border-radius:var(--velt-border-radius-full);cursor:pointer;border:1.5px solid var(--velt-border-2);background:var(--velt-background-0);color:var(--velt-text-2);transition:all .2s ease}.velt-recording-preview--settings-button[_ngcontent-%COMP%]:hover{border:1.5px solid var(--velt-border-3);background:var(--velt-background-1);color:var(--velt-text-3)}.velt-recording-preview--settings-button-open[_ngcontent-%COMP%]{background:var(--velt-background-0);border-radius:var(--velt-border-radius-full)}.velt-recording-preview--settings-button-open[_ngcontent-%COMP%] .velt-recording-preview--settings-button[_ngcontent-%COMP%]{color:var(--velt-accent);border:1.5px solid var(--velt-accent-transparent);background:var(--velt-accent-transparent)}"],changeDetection:0});let i=o;return i})();var ro=i=>({componentConfigSignal:i}),oo=(i,o)=>({condition:i,data:o}),ao=(i,o)=>({componentConfigSignal:i,variant:o}),co=(i,o,n,e,t)=>({template:i,context:o,componentName:"velt-recording-preview-steps-dialog-bottom-panel-close-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function so(i,o){if(i&1&&(h(0),b(1,"div",5),le(),b(2,"svg",6),T(3,"path",7),R()(),f()),i&2){let n=g(4);s(),w("data-testid",n.componentId+"-icon")}}function lo(i,o){if(i&1){let n=ge();b(0,"div",3),Q(1,"translate"),pe("click",function(){q(n);let t=g(2).ngIf;return Y(t.closeDialog())}),u(2,so,4,1,"ng-container",4),R()}if(i&2){let n=g(3);w("data-testid",n.componentId)("aria-label",X(1,3,"Cancel recording")),s(2),l("veltDynamicTemplate",M(8,co,n.template,D(5,ao,n.componentConfigSignal,n.variant),n.variant,n.setIfCondition.bind(n),n.elementRef))}}function go(i,o){if(i&1&&(h(0),u(1,lo,3,14,"div",2),f()),i&2){let n=g().ngIf;s(),l("ngIf",n.countdownStarted)}}function po(i,o){if(i&1&&(h(0),u(1,go,2,1,"ng-container",1),f()),i&2){let n=g();s(),l("veltIf",D(3,oo,n.conditionSignal(),P(1,ro,n.componentConfigSignal)))}}var $i=(()=>{let o=class o extends V{constructor(e,t,r){super(t,r,e),this.loggingService=e,this.elementRef=t,this.dynamicDataService=r,this.componentId="velt-recording-preview-steps-dialog-bottom-panel-close",super.initializeComponentConfigSignal(new F)}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogBottomPanelCloseComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogBottomPanelCloseComponent ngOnDestroy:",e)}}setupA11yAttributes(){try{let e=this.elementRef.nativeElement;e.setAttribute("data-testid",this.componentId+"-container"),e.setAttribute("role","button"),e.setAttribute("aria-label","Close recording preview")}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogBottomPanelCloseComponent setupA11yAttributes:",e)}}};o.\u0275fac=function(t){return new(t||o)(S(E),S(O),S(C))},o.\u0275cmp=k({type:o,selectors:[["app-recording-preview-steps-dialog-bottom-panel-close"]],inputs:{variant:"variant"},standalone:!1,features:[$([C]),B],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],["class","velt-recording-preview--bottom-panel-close","role","button","tabindex","0",3,"click",4,"ngIf"],["role","button","tabindex","0",1,"velt-recording-preview--bottom-panel-close",3,"click"],[4,"veltDynamicTemplate"],["aria-hidden","true",1,"velt-recording-preview--close"],["width","16","height","16","viewBox","0 0 16 16","fill","none","xmlns","http://www.w3.org/2000/svg","focusable","false","role","img","aria-hidden","true"],["d","M12 3.99805L4 11.998M4 3.99805L12 11.998","stroke","currentColor","stroke-width","1.33333","stroke-linecap","round","stroke-linejoin","round"]],template:function(t,r){t&1&&u(0,po,2,6,"ng-container",0),t&2&&l("ngIf",r.componentConfigSignal())},dependencies:[N,L,z,oe],styles:[".velt-recording-preview--close[_ngcontent-%COMP%]{padding:var(--velt-spacing-sm);cursor:pointer;display:flex;color:var(--velt-text-12);transition:all .2s ease}.velt-recording-preview--close[_ngcontent-%COMP%]:hover{color:var(--velt-text-10)}"],changeDetection:0});let i=o;return i})();var vo=i=>({componentConfigSignal:i}),uo=(i,o)=>({condition:i,data:o}),ho=(i,o)=>({componentConfigSignal:i,variant:o}),fo=(i,o,n,e,t)=>({template:i,context:o,componentName:"velt-recording-preview-steps-dialog-bottom-panel-countdown-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function So(i,o){if(i&1&&(b(0,"div",4),Ce(1),R()),i&2){let n=g(3).ngIf,e=g();w("data-testid",e.componentId)("aria-label","Recording starts in "+n.countdown+" seconds"),s(),be(" ",n.countdown," ")}}function Co(i,o){if(i&1&&(h(0),u(1,So,2,3,"div",3),f()),i&2){let n=g(2).ngIf;s(),l("ngIf",n.countdownStarted)}}function _o(i,o){if(i&1&&(h(0),u(1,Co,2,1,"ng-container",2),f()),i&2){let n=g(2);s(),l("veltDynamicTemplate",M(4,fo,n.template,D(1,ho,n.componentConfigSignal,n.variant),n.variant,n.setIfCondition.bind(n),n.elementRef))}}function yo(i,o){if(i&1&&(h(0),u(1,_o,2,10,"ng-container",1),f()),i&2){let n=g();s(),l("veltIf",D(3,uo,n.conditionSignal(),P(1,vo,n.componentConfigSignal)))}}var Vi=(()=>{let o=class o extends V{constructor(e,t,r){super(t,r,e),this.loggingService=e,this.elementRef=t,this.dynamicDataService=r,this.componentId="velt-recording-preview-steps-dialog-bottom-panel-countdown",super.initializeComponentConfigSignal(new F)}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogBottomPanelCountdownComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogBottomPanelCountdownComponent ngOnDestroy:",e)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogBottomPanelCountdownComponent setupA11yAttributes:",e)}}};o.\u0275fac=function(t){return new(t||o)(S(E),S(O),S(C))},o.\u0275cmp=k({type:o,selectors:[["app-recording-preview-steps-dialog-bottom-panel-countdown"]],inputs:{variant:"variant"},standalone:!1,features:[$([C]),B],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],[4,"veltDynamicTemplate"],["class","velt-recording-preview--countdown","role","timer","aria-live","polite",4,"ngIf"],["role","timer","aria-live","polite",1,"velt-recording-preview--countdown"]],template:function(t,r){t&1&&u(0,yo,2,6,"ng-container",0),t&2&&l("ngIf",r.componentConfigSignal())},dependencies:[N,L,z],styles:[".velt-recording-preview--countdown[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;font-size:var(--velt-font-size-sm);font-weight:500;color:var(--velt-text-4)}"],changeDetection:0});let i=o;return i})();var bo=i=>({componentConfigSignal:i}),Io=(i,o)=>({condition:i,data:o}),xt=(i,o)=>({componentConfigSignal:i,variant:o}),Et=(i,o,n,e,t)=>({template:i,context:o,componentName:"velt-recording-preview-steps-dialog-bottom-panel-icon-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function Do(i,o){if(i&1&&(h(0),b(1,"div",5),le(),b(2,"svg",6),T(3,"path",7)(4,"path",8),R()(),f()),i&2){let n=g(5);s(),w("data-testid",n.componentId+"-video")}}function Ro(i,o){if(i&1&&(h(0),u(1,Do,5,1,"ng-container",4),f()),i&2){let n=g(4);s(),l("veltDynamicTemplate",M(4,Et,n.template,D(1,xt,n.componentConfigSignal,n.variant),n.variant,n.setIfCondition.bind(n),n.elementRef))}}function xo(i,o){if(i&1&&(h(0),b(1,"div",9),le(),b(2,"svg",6),T(3,"path",10),R()(),f()),i&2){let n=g(5);s(),w("data-testid",n.componentId+"-screen")}}function Eo(i,o){if(i&1&&(h(0),u(1,xo,4,1,"ng-container",4),f()),i&2){let n=g(4);s(),l("veltDynamicTemplate",M(4,Et,n.template,D(1,xt,n.componentConfigSignal,n.variant),n.variant,n.setIfCondition.bind(n),n.elementRef))}}function Po(i,o){if(i&1&&(h(0),b(1,"div",11),le(),b(2,"svg",6),T(3,"path",12),R()(),f()),i&2){let n=g(5);s(),w("data-testid",n.componentId+"-audio")}}function Ao(i,o){if(i&1&&(h(0),u(1,Po,4,1,"ng-container",4),f()),i&2){let n=g(4);s(),l("veltDynamicTemplate",M(4,Et,n.template,D(1,xt,n.componentConfigSignal,n.variant),n.variant,n.setIfCondition.bind(n),n.elementRef))}}function To(i,o){if(i&1&&(h(0)(1,2),b(2,"div"),u(3,Ro,2,10,"ng-container",3)(4,Eo,2,10,"ng-container",3)(5,Ao,2,10,"ng-container",3),R(),f()()),i&2){let n=g(2).ngIf,e=g();s(),l("ngSwitch",n.type),s(),he("velt-recording-preview--recording-started",n.countdownStarted),w("data-testid",e.componentId),s(),l("ngSwitchCase","video"),s(),l("ngSwitchCase","screen"),s(),l("ngSwitchCase","audio")}}function Oo(i,o){if(i&1&&(h(0),u(1,To,6,7,"ng-container",0),f()),i&2){let n=g().ngIf,e=g();s(),l("ngIf",!e.type||e.type===n.type)}}function ko(i,o){if(i&1&&(h(0),u(1,Oo,2,1,"ng-container",1),f()),i&2){let n=g();s(),l("veltIf",D(3,Io,n.conditionSignal(),P(1,bo,n.componentConfigSignal)))}}var ji=(()=>{let o=class o extends V{constructor(e,t,r){super(t,r,e),this.loggingService=e,this.elementRef=t,this.dynamicDataService=r,this.componentId="velt-recording-preview-steps-dialog-bottom-panel-icon",super.initializeComponentConfigSignal(new F)}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogBottomPanelIconComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogBottomPanelIconComponent ngOnDestroy:",e)}}setupA11yAttributes(){try{let e=this.elementRef.nativeElement;e.setAttribute("data-testid",this.componentId+"-container"),e.setAttribute("role","img"),e.setAttribute("aria-label",`${this.type||""} recording icon`)}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogBottomPanelIconComponent setupA11yAttributes:",e)}}};o.\u0275fac=function(t){return new(t||o)(S(E),S(O),S(C))},o.\u0275cmp=k({type:o,selectors:[["app-recording-preview-steps-dialog-bottom-panel-icon"]],inputs:{type:"type",variant:"variant"},standalone:!1,features:[$([C]),B],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],[3,"ngSwitch"],[4,"ngSwitchCase"],[4,"veltDynamicTemplate"],["role","img","aria-label","Video recording icon | translate",1,"velt-recording-preview--bottom-panel-icon"],["width","24","height","24","viewBox","0 0 24 24","fill","none","xmlns","http://www.w3.org/2000/svg","focusable","false","aria-hidden","true"],["d","M14.6657 10.2226L18.7128 8.19949C18.8483 8.13179 18.9988 8.09983 19.1501 8.10664C19.3014 8.11346 19.4485 8.15882 19.5773 8.23843C19.7062 8.31803 19.8126 8.42924 19.8864 8.56151C19.9602 8.69377 19.9989 8.8427 19.999 8.99415V15.0066C19.9989 15.1581 19.9602 15.307 19.8864 15.4392C19.8126 15.5715 19.7062 15.6827 19.5773 15.7623C19.4485 15.8419 19.3014 15.8873 19.1501 15.8941C18.9988 15.9009 18.8483 15.869 18.7128 15.8013L14.6657 13.7782V10.2226Z","stroke","white","stroke-width","1.25","stroke-linecap","round","stroke-linejoin","round"],["d","M3.99902 8.44428C3.99902 7.97279 4.18632 7.5206 4.51972 7.1872C4.85312 6.8538 5.30531 6.6665 5.7768 6.6665H12.8879C13.3594 6.6665 13.8116 6.8538 14.145 7.1872C14.4784 7.5206 14.6657 7.97279 14.6657 8.44428V15.5554C14.6657 16.0269 14.4784 16.4791 14.145 16.8125C13.8116 17.1459 13.3594 17.3332 12.8879 17.3332H5.7768C5.30531 17.3332 4.85312 17.1459 4.51972 16.8125C4.18632 16.4791 3.99902 16.0269 3.99902 15.5554V8.44428Z","stroke","white","stroke-width","1.25","stroke-linecap","round","stroke-linejoin","round"],["role","img","aria-label","Screen recording icon | translate",1,"velt-recording-preview--bottom-panel-icon"],["d","M18.5 12.0004V14.1671C18.5 14.3586 18.4239 14.5423 18.2885 14.6778C18.153 14.8132 17.9693 14.8893 17.7778 14.8893H6.22222C6.03068 14.8893 5.84698 14.8132 5.71153 14.6778C5.57609 14.5423 5.5 14.3586 5.5 14.1671V6.94488C5.5 6.75333 5.57609 6.56963 5.71153 6.43419C5.84698 6.29875 6.03068 6.22266 6.22222 6.22266H12.7222M8.38889 17.7782H15.6111M9.83333 14.8893V17.7782M14.1667 14.8893V17.7782M15.6111 6.22266H18.5M18.5 6.22266V9.11155M18.5 6.22266L14.8889 9.83377","stroke","currentColor","stroke-width","1.25","stroke-linecap","round","stroke-linejoin","round"],["role","img","aria-label","Audio recording icon | translate",1,"velt-recording-preview--bottom-panel-icon"],["d","M7 10.4291C7 11.7552 7.52678 13.027 8.46447 13.9647C9.40215 14.9023 10.6739 15.4291 12 15.4291M12 15.4291C13.3261 15.4291 14.5979 14.9023 15.5355 13.9647C16.4732 13.027 17 11.7552 17 10.4291M12 15.4291V18.2863M9.14286 18.2863H14.8571M9.85714 6.8577C9.85714 6.28938 10.0829 5.74434 10.4848 5.34247C10.8866 4.94061 11.4317 4.71484 12 4.71484C12.5683 4.71484 13.1134 4.94061 13.5152 5.34247C13.9171 5.74434 14.1429 6.28938 14.1429 6.8577V10.4291C14.1429 10.9975 13.9171 11.5425 13.5152 11.9444C13.1134 12.3462 12.5683 12.572 12 12.572C11.4317 12.572 10.8866 12.3462 10.4848 11.9444C10.0829 11.5425 9.85714 10.9975 9.85714 10.4291V6.8577Z","stroke","currentColor","stroke-width","1.25","stroke-linecap","round","stroke-linejoin","round"]],template:function(t,r){t&1&&u(0,ko,2,6,"ng-container",0),t&2&&l("ngIf",r.componentConfigSignal())},dependencies:[N,Mt,Ft,L,z],styles:[".velt-recording-preview--bottom-panel-icon[_ngcontent-%COMP%]{padding:var(--velt-spacing-md);background:var(--velt-accent);border-radius:var(--velt-border-radius-full);display:flex;margin-right:var(--velt-spacing-md);color:var(--velt-accent-foreground)}.velt-recording-preview--recording-started[_ngcontent-%COMP%] .velt-recording-preview--bottom-panel-icon[_ngcontent-%COMP%]{padding:var(--velt-spacing-sm)}"],changeDetection:0});let i=o;return i})();var Fo=i=>({componentConfigSignal:i}),Bo=(i,o)=>({condition:i,data:o}),$o=(i,o)=>({componentConfigSignal:i,variant:o}),Vo=(i,o,n,e,t)=>({template:i,context:o,componentName:"velt-recording-preview-steps-dialog-bottom-panel-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function jo(i,o){if(i&1&&(b(0,"div",6),Ce(1),Q(2,"translate"),T(3,"app-recording-preview-steps-dialog-bottom-panel-countdown",4),R()),i&2){let n=g(4);w("data-testid",n.componentId+"-countdown"),s(),be(" ",X(2,5,"Starting recording in")," "),s(2),l("componentConfigSignal",n.componentConfigSignal)("template",n.template)("variant",n.variant)}}function No(i,o){if(i&1&&(h(0),b(1,"div",3),Q(2,"translate"),T(3,"app-recording-preview-steps-dialog-bottom-panel-icon",4),u(4,jo,4,7,"div",5),T(5,"app-recording-preview-steps-dialog-bottom-panel-close",4),R(),f()),i&2){let n=g(2).ngIf,e=g();s(),he("velt-recording-preview--recording-started",n.countdownStarted),w("data-testid",e.componentId)("aria-label",X(2,11,"Recording preview bottom panel")),s(2),l("componentConfigSignal",e.componentConfigSignal)("template",e.template)("variant",e.variant),s(),l("ngIf",n.countdownStarted),s(),l("componentConfigSignal",e.componentConfigSignal)("template",e.template)("variant",e.variant)}}function Uo(i,o){if(i&1&&(h(0),u(1,No,6,13,"ng-container",2),f()),i&2){let n=g(2);s(),l("veltDynamicTemplate",M(4,Vo,n.template,D(1,$o,n.componentConfigSignal,n.variant),n.variant,n.setIfCondition.bind(n),n.elementRef))}}function Lo(i,o){if(i&1&&(h(0),u(1,Uo,2,10,"ng-container",1),f()),i&2){let n=g();s(),l("veltIf",D(3,Bo,n.conditionSignal(),P(1,Fo,n.componentConfigSignal)))}}var gt=(()=>{let o=class o extends V{constructor(e,t,r){super(t,r,e),this.loggingService=e,this.elementRef=t,this.dynamicDataService=r,this.componentId="velt-recording-preview-steps-dialog-bottom-panel",super.initializeComponentConfigSignal(new F)}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogBottomPanelComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogBottomPanelComponent ngOnDestroy:",e)}}setupA11yAttributes(){try{let e=this.elementRef.nativeElement;e.setAttribute("data-testid",this.componentId+"-container"),e.setAttribute("role","region"),e.setAttribute("aria-label","Recording controls bottom panel")}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogBottomPanelComponent setupA11yAttributes:",e)}}};o.\u0275fac=function(t){return new(t||o)(S(E),S(O),S(C))},o.\u0275cmp=k({type:o,selectors:[["app-recording-preview-steps-dialog-bottom-panel"]],inputs:{variant:"variant"},standalone:!1,features:[$([C]),B],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],[4,"veltDynamicTemplate"],["role","region",1,"velt-recording-preview--bottom-panel"],[3,"componentConfigSignal","template","variant"],["class","velt-recording-preview--countdown","role","status","aria-live","polite",4,"ngIf"],["role","status","aria-live","polite",1,"velt-recording-preview--countdown"]],template:function(t,r){t&1&&u(0,Lo,2,6,"ng-container",0),t&2&&l("ngIf",r.componentConfigSignal())},dependencies:[N,L,z,$i,Vi,ji,oe],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%]{position:fixed;bottom:5%}.velt-recording-preview--bottom-panel[_ngcontent-%COMP%]{opacity:0;animation:_ngcontent-%COMP%_showAfterDelay .4s forwards}@keyframes _ngcontent-%COMP%_showAfterDelay{0%{opacity:0}99%{opacity:0}to{opacity:1}}.velt-recording-preview--recording-started[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;padding:var(--velt-spacing-xs) var(--velt-spacing-md) var(--velt-spacing-xs) var(--velt-spacing-xs);border-radius:var(--velt-border-radius-3xl);border:1px solid var(--velt-border-2);background:var(--velt-background-0);-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px)}.velt-recording-preview--countdown[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;font-size:var(--velt-font-size-sm);font-weight:500;color:var(--velt-text-4);gap:var(--velt-spacing-xs)}"],changeDetection:0});let i=o;return i})();var Ui=i=>({componentConfigSignal:i}),zo=(i,o)=>({condition:i,data:o}),Wo=(i,o,n,e,t)=>({template:i,context:o,componentName:"velt-recording-preview-steps-dialog-settings-panel-wireframe",variant:n,setIfCondition:e,componentElementRef:t,replaceTemplate:!1}),Ho=()=>["video","screen"];function Go(i,o){if(i&1&&(h(0),T(1,"velt-media-source-settings-internal",3),Q(2,"translate"),f()),i&2){let n=g(2).ngIf;s(),l("showMicSettings",!0)("shadowDom",n.shadowDom)("showCamSettings",Me(8,Ho).includes(n.type))("isOpen",n.isSettingsOpen)("config",n),w("aria-label",X(2,6,"Media source settings"))}}function Ko(i,o){if(i&1&&(h(0),u(1,Go,3,9,"ng-container",2),f()),i&2){let n=g(2);s(),l("veltDynamicTemplate",M(3,Wo,n.template,P(1,Ui,n.componentConfigSignal),n.variant,n.setIfCondition.bind(n),n.elementRef))}}function Jo(i,o){if(i&1&&(h(0),u(1,Ko,2,9,"ng-container",1),f()),i&2){let n=g();s(),l("veltIf",D(3,zo,n.conditionSignal(),P(1,Ui,n.componentConfigSignal)))}}var pt=(()=>{let o=class o extends V{constructor(e,t,r){super(t,r,e),this.loggingService=e,this.elementRef=t,this.dynamicDataService=r,this.componentId="velt-recording-preview-steps-dialog-settings-panel",super.initializeComponentConfigSignal(new F)}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogSettingsPanelComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogSettingsPanelComponent ngOnDestroy:",e)}}setupA11yAttributes(){try{let e=this.elementRef.nativeElement;e.setAttribute("data-testid",this.componentId+"-container"),e.setAttribute("role","dialog"),e.setAttribute("aria-label","Recording settings panel"),e.setAttribute("aria-modal","true"),e.setAttribute("tabindex","-1"),this.componentConfigSignal().isSettingsOpen?e.setAttribute("aria-hidden","false"):e.setAttribute("aria-hidden","true")}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogSettingsPanelComponent setupA11yAttributes:",e)}}};o.\u0275fac=function(t){return new(t||o)(S(E),S(O),S(C))},o.\u0275cmp=k({type:o,selectors:[["velt-recording-preview-steps-dialog-settings-panel-internal"]],inputs:{variant:"variant"},standalone:!1,features:[$([C]),B],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],[4,"veltDynamicTemplate"],["role","group",3,"showMicSettings","shadowDom","showCamSettings","isOpen","config"]],template:function(t,r){t&1&&u(0,Jo,2,6,"ng-container",0),t&2&&l("ngIf",r.componentConfigSignal())},encapsulation:2,changeDetection:0});let i=o;return i})();var Zo=i=>({componentConfigSignal:i}),Qo=(i,o)=>({condition:i,data:o}),Xo=(i,o)=>({componentConfigSignal:i,variant:o}),qo=(i,o,n,e,t)=>({template:i,context:o,componentName:"velt-recording-preview-steps-dialog-waveform-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function Yo(i,o){if(i&1&&(h(0),T(1,"app-audio-waveform",3),f()),i&2){let n=g(2).ngIf,e=g();s(),l("variant",n.type==="audio"?"preview":"preview-mini")("previewStream",e.streamSignal())("muteMic",!(n.mediaConfig.audio!=null&&n.mediaConfig.audio.enabled)),w("data-testid",e.componentId)}}function ea(i,o){if(i&1&&(h(0),u(1,Yo,2,4,"ng-container",2),f()),i&2){let n=g(2);s(),l("veltDynamicTemplate",M(4,qo,n.template,D(1,Xo,n.componentConfigSignal,n.variant),n.variant,n.setIfCondition.bind(n),n.elementRef))}}function ta(i,o){if(i&1&&(h(0),u(1,ea,2,10,"ng-container",1),f()),i&2){let n=g();s(),l("veltIf",D(3,Qo,n.conditionSignal(),P(1,Zo,n.componentConfigSignal)))}}var mt=(()=>{let o=class o extends V{constructor(e,t,r){super(t,r,e),this.loggingService=e,this.elementRef=t,this.dynamicDataService=r,this.streamSignal=We(null),this.componentId="velt-recording-preview-steps-dialog-waveform",super.initializeComponentConfigSignal(new F)}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes(),this.setupAudioElements()}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogWaveformComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy(),this.cleanupAudio()}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogWaveformComponent ngOnDestroy:",e)}}setupA11yAttributes(){try{let e=this.elementRef.nativeElement;e.setAttribute("data-testid",this.componentId+"-container"),e.setAttribute("role","img"),e.setAttribute("aria-label","Audio waveform visualization"),e.setAttribute("aria-live","polite")}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogWaveformComponent setupA11yAttributes:",e)}}setupAudioElements(){return A(this,null,function*(){try{this.audioContext=new AudioContext,this.streamSignal.set(yield navigator.mediaDevices.getUserMedia({audio:!0}))}catch(e){this.loggingService.catch("Error accessing the microphone",e)}})}cleanupAudio(){try{this.audioContext&&(this.audioContext.close(),this.audioContext=null);let e=this.streamSignal();e&&(e.getTracks().forEach(t=>t.stop()),this.streamSignal.set(null))}catch(e){this.loggingService.catch("Error cleaning up audio resources:",e)}}};o.\u0275fac=function(t){return new(t||o)(S(E),S(O),S(C))},o.\u0275cmp=k({type:o,selectors:[["app-recording-preview-steps-dialog-waveform"]],inputs:{variant:"variant"},standalone:!1,features:[$([C]),B],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],[4,"veltDynamicTemplate"],["role","img","aria-live","polite",3,"variant","previewStream","muteMic"]],template:function(t,r){t&1&&u(0,ta,2,6,"ng-container",0),t&2&&l("ngIf",r.componentConfigSignal())},encapsulation:2,changeDetection:0});let i=o;return i})();var ia=i=>({componentConfigSignal:i}),na=(i,o)=>({condition:i,data:o}),ra=(i,o)=>({componentConfigSignal:i,variant:o}),oa=(i,o,n,e,t)=>({template:i,context:o,componentName:"velt-recording-preview-steps-dialog-screen-player-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function aa(i,o){if(i&1&&(h(0),T(1,"video",3),f()),i&2){let n=g(2).ngIf,e=g();s(),l("srcObject",n.mediaConfig==null||n.mediaConfig.screen==null?null:n.mediaConfig.screen.stream)("volume",0),w("data-testid",e.componentId)}}function ca(i,o){if(i&1&&(h(0),u(1,aa,2,3,"ng-container",2),f()),i&2){let n=g(2);s(),l("veltDynamicTemplate",M(4,oa,n.template,D(1,ra,n.componentConfigSignal,n.variant),n.variant,n.setIfCondition.bind(n),n.elementRef))}}function sa(i,o){if(i&1&&(h(0),u(1,ca,2,10,"ng-container",1),f()),i&2){let n=g();s(),l("veltIf",D(3,na,n.conditionSignal(),P(1,ia,n.componentConfigSignal)))}}var Wi=(()=>{let o=class o extends V{constructor(e,t,r){super(t,r,e),this.loggingService=e,this.elementRef=t,this.dynamicDataService=r,this.componentId="velt-recording-preview-steps-dialog-screen-player",super.initializeComponentConfigSignal(new F)}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogScreenPlayerComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogScreenPlayerComponent ngOnDestroy:",e)}}setupA11yAttributes(){try{let e=this.elementRef.nativeElement;e.setAttribute("data-testid",this.componentId+"-container"),e.setAttribute("role","region"),e.setAttribute("aria-label","Video preview")}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogScreenPlayerComponent setupA11yAttributes:",e)}}};o.\u0275fac=function(t){return new(t||o)(S(E),S(O),S(C))},o.\u0275cmp=k({type:o,selectors:[["app-recording-preview-steps-dialog-screen-player"]],inputs:{variant:"variant"},standalone:!1,features:[$([C]),B],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],[4,"veltDynamicTemplate"],["id","screen-player","autoplay","","muted","true","playsinline","","webkit-playsinline","true","x-webkit-airplay","allow","role","application","aria-live","polite",1,"velt-recording-preview-screen--player",3,"srcObject","volume"]],template:function(t,r){t&1&&u(0,sa,2,6,"ng-container",0),t&2&&l("ngIf",r.componentConfigSignal())},dependencies:[N,L,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%]{display:block;width:100%;height:100%}[_nghost-%COMP%]:empty{display:none}video[_ngcontent-%COMP%]{width:100%;height:100%;z-index:9999}.velt-recording-preview-screen--player[_ngcontent-%COMP%]{object-fit:cover}"],changeDetection:0});let i=o;return i})();var ga=i=>({componentConfigSignal:i}),pa=(i,o)=>({condition:i,data:o}),ma=()=>["video","screen"],va=(i,o)=>({componentConfigSignal:i,variant:o}),ua=(i,o,n,e,t)=>({template:i,context:o,componentName:"velt-recording-preview-steps-dialog-video-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function ha(i,o){i&1&&He(0)}function fa(i,o){if(i&1&&(b(0,"velt-shadow-dom-internal"),u(1,ha,1,0,"ng-container",5),R()),i&2){g();let n=Pe(3);s(),l("ngTemplateOutlet",n)}}function Sa(i,o){if(i&1&&(h(0),T(1,"app-recording-preview-steps-dialog-video-player",9)(2,"app-recording-preview-steps-dialog-screen-player",9),b(3,"div",10)(4,"div",11),T(5,"app-recording-preview-steps-dialog-waveform",9)(6,"app-recording-preview-steps-dialog-close-button",12),R(),T(7,"app-recording-preview-steps-dialog-timer",12)(8,"app-recording-preview-steps-dialog-camera-off-message",12),b(9,"div",13),T(10,"velt-recording-preview-steps-dialog-settings-panel-internal",9),b(11,"app-recording-preview-steps-dialog-button-panel",12),T(12,"app-recording-preview-steps-dialog-start-recording",12)(13,"velt-recording-preview-steps-dialog-mic-button-internal",12)(14,"velt-recording-preview-steps-dialog-camera-button-internal",12)(15,"app-recording-preview-steps-dialog-settings",12),R(),T(16,"app-recording-preview-steps-dialog-bottom-panel",12),R()(),f()),i&2){let n=g(5);s(),l("componentConfigSignal",n.componentConfigSignal),s(),l("componentConfigSignal",n.componentConfigSignal),s(),w("data-testid",n.componentId+"-overlay"),s(),w("data-testid",n.componentId+"-header"),s(),l("componentConfigSignal",n.componentConfigSignal),s(),l("componentConfigSignal",n.componentConfigSignal)("template",n.template)("variant",n.variant),s(),l("componentConfigSignal",n.componentConfigSignal)("template",n.template)("variant",n.variant),s(),l("componentConfigSignal",n.componentConfigSignal)("template",n.template)("variant",n.variant),s(),w("data-testid",n.componentId+"-settings"),s(),l("componentConfigSignal",n.componentConfigSignal),s(),l("componentConfigSignal",n.componentConfigSignal)("template",n.template)("variant",n.variant),s(),l("componentConfigSignal",n.componentConfigSignal)("template",n.template)("variant",n.variant),s(),l("componentConfigSignal",n.componentConfigSignal)("template",n.template)("variant",n.variant),s(),l("componentConfigSignal",n.componentConfigSignal)("template",n.template)("variant",n.variant),s(),l("componentConfigSignal",n.componentConfigSignal)("template",n.template)("variant",n.variant),s(),l("componentConfigSignal",n.componentConfigSignal)("template",n.template)("variant",n.variant)}}function Ca(i,o){if(i&1){let n=ge();b(0,"div",7,1),pe("pointerdown",function(t){return q(n),Y(t.stopPropagation())})("pointerup",function(t){return q(n),Y(t.stopPropagation())})("click",function(t){q(n);let r=g(3).ngIf;return Y(r.handleOverlayClick(t))}),u(2,Sa,17,34,"ng-container",8),R()}if(i&2){let n=g(4);w("data-testid",n.componentId),s(2),l("veltDynamicTemplate",M(5,ua,n.template,D(2,va,n.componentConfigSignal,n.variant),n.variant,n.setIfCondition.bind(n),n.elementRef))}}function _a(i,o){if(i&1&&u(0,Ca,3,11,"div",6),i&2){let n=g(2).ngIf;l("ngIf",Me(1,ma).includes(n.type))}}function ya(i,o){if(i&1&&(h(0),u(1,fa,2,1,"velt-shadow-dom-internal",4)(2,_a,1,2,"ng-template",null,0,Ge),f()),i&2){let n=Pe(3),e=g().ngIf,t=g();s(),l("ngIf",e.shadowDom&&!t.template||t.template&&e.isExplicitShadowDom)("ngIfElse",n)}}function wa(i,o){if(i&1&&(h(0),u(1,ya,4,2,"ng-container",3),f()),i&2){let n=g();s(),l("veltIf",D(3,pa,n.conditionSignal(),P(1,ga,n.componentConfigSignal)))}}var Hi=(()=>{let o=class o extends V{constructor(e,t,r,a){super(r,a,e),this.loggingService=e,this.wireframeService=t,this.elementRef=r,this.dynamicDataService=a,this.componentId="velt-recording-preview-steps-dialog-video",super.initializeComponentConfigSignal(new F)}ngOnInit(){try{this.loggingService.log("%c[WB] Calling FUNCTION: ngOnInit","color: green;");let e="velt-recording-preview-steps-dialog-video-wireframe";super.ngOnInit(),this.setupA11yAttributes(),this.variant&&(e+=`---${this.variant}`),this.wireframeService.getWireframe$(e).subscribe(t=>{if(t){let r=document.createElement(t.tagName);r.innerHTML=t.innerHTML,this.template=r}})}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogVideoComponent OnInit: ",e)}}ngOnChanges(e){try{e&&Object.keys(e).forEach(t=>{this.componentConfigSignal.update(r=>(r=U(y({},r),{[t]:e[t].currentValue}),r))})}catch(t){this.loggingService.catch("Error in RecordingPreviewStepsDialogVideoComponent ngOnChanges: ",t)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogVideoComponent ngOnDestroy:",e)}}setupA11yAttributes(){try{let e=this.elementRef.nativeElement;e.setAttribute("data-testid",this.componentId+"-container"),e.setAttribute("role","region"),e.setAttribute("aria-label","Video preview area")}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogVideoComponent setupA11yAttributes:",e)}}};o.\u0275fac=function(t){return new(t||o)(S(E),S(nt),S(O),S(C))},o.\u0275cmp=k({type:o,selectors:[["app-recording-preview-steps-dialog-video"]],inputs:{variant:"variant"},standalone:!1,features:[$([C]),B,Ee],decls:1,vars:1,consts:[["videoDialogRef",""],["recordingPreviewDialogRef",""],[4,"ngIf"],[4,"veltIf"],[4,"ngIf","ngIfElse"],[4,"ngTemplateOutlet"],["role","dialog","class","velt-recording-preview-video",3,"pointerdown","pointerup","click",4,"ngIf"],["role","dialog",1,"velt-recording-preview-video",3,"pointerdown","pointerup","click"],[4,"veltDynamicTemplate"],[3,"componentConfigSignal"],["role","region","aria-label","Video controls overlay",1,"velt-recording-preview-video--overlay"],["role","region","aria-label","Video header controls",1,"velt-recording-preview-video--header"],[3,"componentConfigSignal","template","variant"],["role","region","aria-label","Recording settings and controls",1,"velt-recording-preview-video--settings"]],template:function(t,r){t&1&&u(0,wa,2,6,"ng-container",2),t&2&&l("ngIf",r.componentConfigSignal())},dependencies:[N,Ke,L,z,ot,at,hi,fi,ct,st,dt,Mi,lt,gt,pt,mt,Wi],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%]{width:100%;height:100%}.velt-recording-preview-video[_ngcontent-%COMP%], .velt-recording-preview-video--header[_ngcontent-%COMP%]{display:flex}.velt-recording-preview-video[_ngcontent-%COMP%]{position:relative;background:var(--velt-background-0);flex-direction:column;align-items:center;overflow:hidden;border-radius:var(--velt-border-radius-lg);width:calc((50rem + 0px) * var(--velt-base-rem-unit));height:calc((30rem + 0px) * var(--velt-base-rem-unit));max-width:calc(.8 * var(--legacy-velt-viewport-width))}@media screen and (max-width:768px){.velt-recording-preview-video[_ngcontent-%COMP%]{width:calc((35rem + 0px) * var(--velt-base-rem-unit));height:calc((25rem + 0px) * var(--velt-base-rem-unit));max-width:calc(.8 * var(--legacy-velt-viewport-width))}}@media screen and (max-width:425px){ .velt-mat-dialog-container.snippyly-recording-preview-steps-dialog{width:calc(1 * var(--legacy-velt-viewport-width));max-width:calc(1 * var(--legacy-velt-viewport-width))} .velt-mat-dialog-container.snippyly-recording-preview-steps-dialog mat-dialog-container .mat-mdc-dialog-surface.mdc-dialog__surface{width:calc(1 * var(--legacy-velt-viewport-width));height:calc(1 * var(--legacy-velt-viewport-height));border-radius:calc((0rem + 0px) * var(--velt-base-rem-unit))} .velt-mat-dialog-container.snippyly-recording-preview-steps-dialog mat-dialog-container .velt-recording-preview-video{width:calc(1 * var(--legacy-velt-viewport-width));height:calc(1 * var(--legacy-velt-viewport-height));max-width:calc(1 * var(--legacy-velt-viewport-width));border-radius:calc((0rem + 0px) * var(--velt-base-rem-unit))} .velt-mat-dialog-container.snippyly-recording-preview-steps-dialog mat-dialog-container .velt-recording-preview-video video{height:100%}}.velt-recording-preview-video--overlay[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:space-between;align-items:center;padding:var(--velt-spacing-2xl);content:"";position:absolute;border-radius:var(--velt-border-radius-lg);z-index:1;inset:0}.velt-recording-preview-video--header[_ngcontent-%COMP%]{justify-content:space-between;width:100%;gap:calc((.5rem + 0px) * var(--velt-base-rem-unit));align-items:flex-start}.velt-recording-preview-video--settings[_ngcontent-%COMP%]{width:366px;display:flex;flex-direction:column;gap:var(--velt-spacing-lg);align-items:center;justify-content:center;position:relative}'],changeDetection:0});let i=o;return i})();var Ia=i=>({componentConfigSignal:i}),Da=(i,o)=>({condition:i,data:o}),Ra=(i,o)=>({componentConfigSignal:i,variant:o}),xa=(i,o,n,e,t)=>({template:i,context:o,componentName:"velt-recording-preview-steps-dialog-audio-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function Ea(i,o){i&1&&He(0)}function Pa(i,o){if(i&1&&(b(0,"velt-shadow-dom-internal"),u(1,Ea,1,0,"ng-container",5),R()),i&2){g();let n=Pe(3);s(),l("ngTemplateOutlet",n)}}function Aa(i,o){if(i&1&&(h(0),b(1,"div",9)(2,"div",10),T(3,"app-recording-preview-steps-dialog-close-button",11),R(),T(4,"app-recording-preview-steps-dialog-timer",11)(5,"app-recording-preview-steps-dialog-waveform",12),b(6,"div",13),T(7,"velt-recording-preview-steps-dialog-settings-panel-internal",12),b(8,"app-recording-preview-steps-dialog-button-panel",11),T(9,"app-recording-preview-steps-dialog-start-recording",11)(10,"velt-recording-preview-steps-dialog-mic-button-internal",11)(11,"app-recording-preview-steps-dialog-settings",11),R(),T(12,"app-recording-preview-steps-dialog-bottom-panel",11),R()(),f()),i&2){let n=g(5);s(),w("data-testid",n.componentId+"-overlay"),s(),w("data-testid",n.componentId+"-header"),s(),l("componentConfigSignal",n.componentConfigSignal)("template",n.template)("variant",n.variant),s(),l("componentConfigSignal",n.componentConfigSignal)("template",n.template)("variant",n.variant),s(),l("componentConfigSignal",n.componentConfigSignal),s(),w("data-testid",n.componentId+"-settings")("role","group")("aria-label","Recording settings"),s(),l("componentConfigSignal",n.componentConfigSignal),s(),l("componentConfigSignal",n.componentConfigSignal)("template",n.template)("variant",n.variant),s(),l("componentConfigSignal",n.componentConfigSignal)("template",n.template)("variant",n.variant),s(),l("componentConfigSignal",n.componentConfigSignal)("template",n.template)("variant",n.variant),s(),l("componentConfigSignal",n.componentConfigSignal)("template",n.template)("variant",n.variant),s(),l("componentConfigSignal",n.componentConfigSignal)("template",n.template)("variant",n.variant)}}function Ta(i,o){if(i&1){let n=ge();b(0,"div",7,1),Q(2,"translate"),pe("pointerdown",function(t){return q(n),Y(t.stopPropagation())})("pointerup",function(t){return q(n),Y(t.stopPropagation())})("click",function(t){q(n);let r=g(3).ngIf;return Y(r.handleOverlayClick(t))}),u(3,Aa,13,28,"ng-container",8),R()}if(i&2){let n=g(4);w("data-testid",n.componentId)("role","dialog")("aria-label",X(2,4,"Audio recording preview")),s(3),l("veltDynamicTemplate",M(9,xa,n.template,D(6,Ra,n.componentConfigSignal,n.variant),n.variant,n.setIfCondition.bind(n),n.elementRef))}}function Oa(i,o){if(i&1&&u(0,Ta,4,15,"div",6),i&2){let n=g(2).ngIf;l("ngIf",n.type==="audio")}}function ka(i,o){if(i&1&&(h(0),u(1,Pa,2,1,"velt-shadow-dom-internal",4)(2,Oa,1,1,"ng-template",null,0,Ge),f()),i&2){let n=Pe(3),e=g().ngIf,t=g();s(),l("ngIf",e.shadowDom&&!t.template||t.template&&e.isExplicitShadowDom)("ngIfElse",n)}}function Ma(i,o){if(i&1&&(h(0),u(1,ka,4,2,"ng-container",3),f()),i&2){let n=g();s(),l("veltIf",D(3,Da,n.conditionSignal(),P(1,Ia,n.componentConfigSignal)))}}var Gi=(()=>{let o=class o extends V{constructor(e,t,r,a){super(r,a,e),this.loggingService=e,this.wireframeService=t,this.elementRef=r,this.dynamicDataService=a,this.componentId="velt-recording-preview-steps-dialog-audio",super.initializeComponentConfigSignal(new F)}ngOnInit(){try{this.loggingService.log("%c[WB] Calling FUNCTION: ngOnInit","color: green;"),super.ngOnInit(),this.setupA11yAttributes();let e="velt-recording-preview-steps-dialog-audio-wireframe";this.variant&&(e+=`---${this.variant}`),this.wireframeService.getWireframe$(e).subscribe(t=>{if(t){let r=document.createElement(t.tagName);r.innerHTML=t.innerHTML,this.template=r}})}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogAudioComponent OnInit: ",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogAudioComponent ngOnDestroy: ",e)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogAudioComponent setupA11yAttributes:",e)}}};o.\u0275fac=function(t){return new(t||o)(S(E),S(nt),S(O),S(C))},o.\u0275cmp=k({type:o,selectors:[["app-recording-preview-steps-dialog-audio"]],inputs:{variant:"variant"},standalone:!1,features:[$([C]),B],decls:1,vars:1,consts:[["audioDialogRef",""],["recordingPreviewDialogRef",""],[4,"ngIf"],[4,"veltIf"],[4,"ngIf","ngIfElse"],[4,"ngTemplateOutlet"],["class","velt-recording-preview-audio",3,"pointerdown","pointerup","click",4,"ngIf"],[1,"velt-recording-preview-audio",3,"pointerdown","pointerup","click"],[4,"veltDynamicTemplate"],[1,"velt-recording-preview-audio--overlay"],[1,"velt-recording-preview-audio--header"],[3,"componentConfigSignal","template","variant"],[3,"componentConfigSignal"],[1,"velt-recording-preview-audio--settings"]],template:function(t,r){t&1&&u(0,Ma,2,6,"ng-container",2),t&2&&l("ngIf",r.componentConfigSignal())},dependencies:[N,Ke,L,z,ot,at,ct,st,dt,lt,gt,pt,mt,oe],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%]{width:100%;height:100%}.velt-recording-preview-audio[_ngcontent-%COMP%], .velt-recording-preview-audio--header[_ngcontent-%COMP%]{display:flex}.velt-recording-preview-audio[_ngcontent-%COMP%]{position:relative;width:calc((50rem + 0px) * var(--velt-base-rem-unit));height:calc((30rem + 0px) * var(--velt-base-rem-unit));max-width:calc(.8 * var(--legacy-velt-viewport-width))}.velt-recording-preview-audio[_ngcontent-%COMP%] .velt-recording-preview-audio--audio-waves[_ngcontent-%COMP%]{transform:scale(1.5);height:100%;z-index:-1}@media screen and (max-width:768px){.velt-recording-preview-audio[_ngcontent-%COMP%]{width:calc((35rem + 0px) * var(--velt-base-rem-unit));height:calc((25rem + 0px) * var(--velt-base-rem-unit));max-width:calc(.8 * var(--legacy-velt-viewport-width))}}@media screen and (max-width:425px){ .velt-mat-dialog-container.snippyly-recording-preview-steps-dialog{width:calc(1 * var(--legacy-velt-viewport-width));max-width:calc(1 * var(--legacy-velt-viewport-width))} .velt-mat-dialog-container.snippyly-recording-preview-steps-dialog mat-dialog-container .mat-mdc-dialog-surface.mdc-dialog__surface{width:calc(1 * var(--legacy-velt-viewport-width));height:calc(1 * var(--legacy-velt-viewport-height));border-radius:calc((0rem + 0px) * var(--velt-base-rem-unit))} .velt-mat-dialog-container.snippyly-recording-preview-steps-dialog mat-dialog-container .velt-recording-preview-audio{width:calc(1 * var(--legacy-velt-viewport-width));height:calc(1 * var(--legacy-velt-viewport-height));max-width:calc(1 * var(--legacy-velt-viewport-width));border-radius:calc((0rem + 0px) * var(--velt-base-rem-unit))} .velt-mat-dialog-container.snippyly-recording-preview-steps-dialog mat-dialog-container .velt-recording-preview-audio video{height:100%}}.velt-recording-preview-audio--overlay[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:space-between;padding:var(--velt-spacing-2xl);content:"";position:absolute;border-radius:var(--velt-border-radius-lg);border:1px solid var(--velt-border-2);background:var(--velt-background-0);z-index:1;inset:0}.velt-recording-preview-audio--header[_ngcontent-%COMP%]{justify-content:flex-end;width:100%;gap:var(--velt-spacing-sm);align-items:center}.velt-recording-preview-audio--settings[_ngcontent-%COMP%]{width:366px;display:flex;flex-direction:column;gap:var(--velt-spacing-lg);align-items:center;justify-content:center;position:relative;pointer-events:auto}'],changeDetection:0});let i=o;return i})();var Ba=()=>["video","screen"];function $a(i,o){if(i&1&&T(0,"app-recording-preview-steps-dialog-video",4),i&2){let n=g(2);l("componentConfigSignal",n.componentConfigSignal)}}function Va(i,o){if(i&1&&T(0,"app-recording-preview-steps-dialog-audio",4),i&2){let n=g(2);l("componentConfigSignal",n.componentConfigSignal)}}function ja(i,o){if(i&1&&(h(0),b(1,"div",2,0),u(3,$a,1,1,"app-recording-preview-steps-dialog-video",3)(4,Va,1,1,"app-recording-preview-steps-dialog-audio",3),R(),f()),i&2){let n=o.ngIf,e=Pe(2),t=g();s(),l("snippylyOverlay",e)("snippylyOverlayZIndex",2e3),w("aria-label","Recording preview - "+n.type+" mode")("data-testid",t.componentId),s(2),l("ngIf",Me(6,Ba).includes(n.type)),s(),l("ngIf",n.type==="audio")}}var Zi=(()=>{let o=class o{constructor(e,t,r,a,c,p,d){this.loggingService=e,this.recorderService=t,this.dialog=r,this.devicePermissionService=a,this.dialogRef=c,this.elementRef=p,this.data=d,this.darkMode=!1,this.shadowDom=!0,this.startCountdownFrom=3,this.defaultMediaSourceOptions=Zt(),this.recordingCountdownEnabled=!1,this.subscriptions=[],this.veltElement=!0,this.componentId="velt-recording-preview-steps-dialog",this.componentConfigSignal=We({closeDialog:this.closeDialog.bind(this),startCountdown:this.startCountdown.bind(this),toggleAudio:this.toggleAudio.bind(this),toggleVideo:this.toggleVideo.bind(this),toggleSettings:this.toggleSettings.bind(this),cancelCountdown:this.cancelCountdown.bind(this),updateMediaConfig:this.updateMediaConfig.bind(this),handleOverlayClick:this.handleOverlayClick.bind(this),countdownStarted:!1,mediaConfig:{audio:{enabled:!1},video:{enabled:!1}},mediaState:{audio:{enabled:!1},video:{enabled:!1}},type:"video",countdown:this.startCountdownFrom,mediaStream:void 0,isSettingsOpen:!1,darkMode:this.darkMode,shadowDom:this.shadowDom,isExplicitShadowDom:!1});try{this.devicePermissionService.getPermissionState$("video").subscribe(m=>{this.componentConfigSignal.update(v=>(v=U(y({},v),{mediaState:U(y({},v.mediaState),{video:{enabled:m!=="denied"}})}),v))}),this.devicePermissionService.getPermissionState$("audio").subscribe(m=>{this.componentConfigSignal.update(v=>(v=U(y({},v),{mediaState:U(y({},v.mediaState),{audio:{enabled:m!=="denied"}})}),v))}),this.subscriptions.push(this.recorderService.getRecordingCountdownEnabled$().subscribe(m=>{this.recordingCountdownEnabled=m})),this.subscriptions.push(this.recorderService.getRecordingMicEnabled$().subscribe(m=>{m!==null&&(m?this.toggleAudioOn():this.toggleAudioOff())})),d&&(d.type&&this.componentConfigSignal.update(m=>(m=U(y({},m),{type:d.type}),m)),d.recordingCountdown!==void 0&&(this.recordingCountdownEnabled=!!d.recordingCountdown),d.mediaConfig&&(d.mediaConfig?.audio?.enabled&&!d.mediaConfig?.audio?.deviceId&&(d.mediaConfig.audio.deviceId=this.defaultMediaSourceOptions?.selectedAudioDevice?.deviceId),d.mediaConfig?.video?.enabled&&!d.mediaConfig?.video?.deviceId&&(d.mediaConfig.video.deviceId=this.defaultMediaSourceOptions?.selectedVideoDevice?.deviceId),d?.darkMode?this.elementRef.nativeElement.setAttribute("dark",""):this.elementRef.nativeElement.removeAttribute("dark"),this.componentConfigSignal.update(m=>(m=U(y({},m),{shadowDom:d?.shadowDom!==!1,isExplicitShadowDom:!!d?.isExplicitShadowDom,darkMode:d.darkMode||!1}),m)),this.updateMediaConfig(d.mediaConfig)))}catch(m){this.loggingService.catch("Error in RecordingPreviewStepsDialogComponent constructor: ",m)}}ngOnInit(){try{this.setupA11yAttributes(),this.componentConfigSignal().type==="screen"&&this.subscriptions.push(this.recorderService.getScreenStream$().subscribe(e=>{e&&e.active&&e.getVideoTracks().some(t=>t.readyState==="live")&&this.componentConfigSignal.update(t=>(t=y({},t),t.mediaConfig.screen={enabled:!0,stream:e},t))}))}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogComponent ngOnInit:",e)}}setupA11yAttributes(){try{let e=this.elementRef.nativeElement;e.setAttribute("data-testid",this.componentId+"-container"),e.setAttribute("role","dialog"),e.setAttribute("aria-label","Recording preview steps dialog")}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogComponent setupA11yAttributes:",e)}}ngOnChanges(e){try{e&&Object.keys(e).forEach(t=>{this.componentConfigSignal.update(r=>(r=U(y({},r),{[t]:e[t].currentValue}),r))})}catch(t){this.loggingService.catch("Error in RecordingPreviewStepsDialogComponent ngOnChanges: ",t)}}ngAfterViewInit(){try{this.dialogRef.addPanelClass("snippyly-recording-preview-steps-dialog"),this.dialogRef.disableClose=!0}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogComponent ngAfterViewInit: ",e)}}toggleSettings(e){try{e.stopPropagation(),this.componentConfigSignal.update(t=>(t=U(y({},t),{isSettingsOpen:!t.isSettingsOpen}),t))}catch(t){this.loggingService.catch("Error in RecordingPreviewStepsDialogComponent toggleSettings: ",t)}}toggleAudio(){try{this.componentConfigSignal().mediaConfig.audio||this.componentConfigSignal.update(r=>(r=U(y({},r),{mediaConfig:U(y({},r.mediaConfig),{audio:{enabled:!0}})}),r));let e=!this.componentConfigSignal().mediaConfig.audio?.enabled;this.componentConfigSignal.update(r=>(r=U(y({},r),{mediaConfig:U(y({},r.mediaConfig),{audio:{enabled:e}})}),r));let t=this.componentConfigSignal().mediaStream?.getAudioTracks()[0];t?t.enabled=e:e&&(this.componentConfigSignal.update(r=>(r=U(y({},r),{mediaConfig:U(y({},r.mediaConfig),{audio:U(y({},r.mediaConfig.audio),{deviceId:this.defaultMediaSourceOptions?.selectedAudioDevice?.deviceId})})}),r)),this.updateMediaConfig(this.componentConfigSignal().mediaConfig))}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogComponent toggleAudio: ",e)}}toggleAudioOn(){try{this.componentConfigSignal.update(t=>(t=U(y({},t),{mediaConfig:U(y({},t.mediaConfig),{audio:{enabled:!0}})}),t));let e=this.componentConfigSignal().mediaStream?.getAudioTracks()[0];e?e.enabled=!0:(this.componentConfigSignal.update(t=>(t=U(y({},t),{mediaConfig:U(y({},t.mediaConfig),{audio:U(y({},t.mediaConfig.audio),{deviceId:this.defaultMediaSourceOptions?.selectedAudioDevice?.deviceId})})}),t)),this.updateMediaConfig(this.componentConfigSignal().mediaConfig))}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogComponent toggleAudioOn: ",e)}}toggleAudioOff(){try{this.componentConfigSignal.update(t=>(t=U(y({},t),{mediaConfig:U(y({},t.mediaConfig),{audio:{enabled:!1}})}),t));let e=this.componentConfigSignal().mediaStream?.getAudioTracks()[0];e&&(e.enabled=!1)}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogComponent toggleAudioOn: ",e)}}toggleVideo(){try{this.componentConfigSignal.update(e=>(e=y({},e),e.mediaConfig.video||(e.mediaConfig.video={enabled:!0}),e.mediaConfig.video.enabled=!e.mediaConfig.video.enabled,e.mediaConfig.video.deviceId=this.defaultMediaSourceOptions?.selectedVideoDevice?.deviceId,e)),this.updateMediaConfig(this.componentConfigSignal().mediaConfig)}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogComponent toggleVideo: ",e)}}updateMediaConfig(e){try{this.stopMediaStream(),this.getMediaStream(e)}catch(t){this.loggingService.catch("Error in RecordingPreviewStepsDialogComponent updateMediaConfig: ",t)}}getMediaStream(e){try{if(!navigator.mediaDevices){this.loggingService.catch("Error in RecordingPreviewStepsDialogComponent getMediaStream: ","No media devices");return}if(!navigator.mediaDevices.getUserMedia){this.loggingService.catch("Error in RecordingPreviewStepsDialogComponent getMediaStream: ","No getUserMedia");return}if(e.audio?.enabled||e.video?.enabled){let t=Ki(e);navigator.mediaDevices.getUserMedia(t).then(r=>{this.componentConfigSignal.update(a=>(a=U(y({},a),{mediaConfig:e,mediaStream:r}),a))}).catch(r=>{this.loggingService.catch("Error in RecordingPreviewStepsDialogComponent getMediaStream catch: ",r)})}else this.componentConfigSignal.update(t=>(t=U(y({},t),{mediaStream:void 0,mediaConfig:e}),t))}catch(t){this.loggingService.catch("Error in RecordingPreviewStepsDialogComponent getMediaStream: ",t)}}stopMediaStream(){try{this.componentConfigSignal.update(e=>(e=y({},e),e.mediaStream?.getTracks().forEach(t=>{t.stop()}),e.mediaStream=void 0,e))}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogComponent stopMediaStream: ",e)}}startCountdown(){return A(this,null,function*(){try{let t=new Te().getBrowserName()==="Firefox",r=null;if(t&&this.componentConfigSignal().type==="screen")try{let a=this.componentConfigSignal().mediaConfig,c=Ki(a);Object.keys(c).length>0&&(r=yield navigator.mediaDevices.getUserMedia(c))}catch(a){this.loggingService.catch("Error getting Firefox user media stream:",a),r=null}if(this.componentConfigSignal().type==="screen"){if(!this.componentConfigSignal().mediaConfig.screen?.stream)try{let c=yield navigator.mediaDevices.getDisplayMedia({video:!0,audio:!0});this.componentConfigSignal.update(p=>(p=y({},p),p.mediaConfig.screen={enabled:!0,stream:c},p))}catch(c){this.loggingService.catch("Error getting screen media stream:",c),this.cancelCountdown();return}this.componentConfigSignal.update(c=>(c=y({},c),r&&(c.mediaConfig.audio?.enabled&&(c.mediaConfig.audio.stream=r),c.mediaConfig.video?.enabled&&(c.mediaConfig.video.stream=r)),c)),this.componentConfigSignal().mediaConfig.screen?.stream?.getTracks().forEach(c=>{c&&(c.onended=()=>{this.cancelCountdown()})})}this.recordingCountdownEnabled?(this.componentConfigSignal.update(a=>(a=U(y({},a),{countdownStarted:!0}),a)),this.countdownInterval=setInterval(()=>{this.componentConfigSignal().countdown>1?this.componentConfigSignal.update(a=>(a=U(y({},a),{countdown:a.countdown-1}),a)):this.closeDialog(this.componentConfigSignal().mediaConfig)},1e3)):this.closeDialog(this.componentConfigSignal().mediaConfig)}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogComponent startCountdown: ",e)}})}cancelCountdown(){try{if(this.componentConfigSignal.update(e=>(e=U(y({},e),{countdownStarted:!1,countdown:this.startCountdownFrom}),e)),this.clearInterval(),this.componentConfigSignal().type==="screen"){let e=this.componentConfigSignal().mediaConfig.screen?.stream;e&&e.getTracks().forEach(t=>{t.stop()}),this.componentConfigSignal.update(t=>(t=y({},t),t.mediaConfig.screen=void 0,t))}}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogComponent cancelCountdown: ",e)}}closeDialog(e){return A(this,null,function*(){try{this.clearInterval(),e||(this.stopMediaStream(),this.componentConfigSignal.update(t=>(t=y({},t),t.mediaConfig&&(t.mediaConfig.screen?.stream&&(t.mediaConfig.screen.stream.getTracks().forEach(r=>r.stop()),t.mediaConfig.screen.stream=void 0),t.mediaConfig.audio?.stream&&(t.mediaConfig.audio.stream.getTracks().forEach(r=>r.stop()),t.mediaConfig.audio.stream=void 0),t.mediaConfig.video?.stream&&(t.mediaConfig.video.stream.getTracks().forEach(r=>r.stop()),t.mediaConfig.video.stream=void 0)),t))),this.dialogRef.close(e)}catch(t){this.loggingService.catch("Error in RecordingPreviewStepsDialogComponent closeDialog: ",t)}})}handleOverlayClick(e){try{this.componentConfigSignal.update(t=>(t=U(y({},t),{isSettingsOpen:!1}),t)),e.stopPropagation()}catch(t){this.loggingService.catch("Error in RecordingPreviewStepsDialogComponent handleOverlayClick: ",t)}}clearInterval(){try{this.countdownInterval&&(clearInterval(this.countdownInterval),this.countdownInterval=void 0)}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogComponent clearInterval: ",e)}}ngOnDestroy(){try{this.clearInterval(),this.stopMediaStream(),this.subscriptions.forEach(e=>{e?.unsubscribe()})}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogComponent ngOnDestroy: ",e)}}};o.\u0275fac=function(t){return new(t||o)(S(E),S(vt),S(Fe),S(Ve),S(jt),S(O),S(Nt,8))},o.\u0275cmp=k({type:o,selectors:[["snippyly-recording-preview-steps-dialog"]],hostVars:1,hostBindings:function(t,r){t&2&&w("data-velt-element",r.veltElement)},inputs:{darkMode:"darkMode",shadowDom:"shadowDom"},standalone:!1,features:[Ee],decls:1,vars:1,consts:[["recordingPreviewDialogRef",""],[4,"ngIf"],["role","dialog","aria-modal","true",3,"snippylyOverlay","snippylyOverlayZIndex"],[3,"componentConfigSignal",4,"ngIf"],[3,"componentConfigSignal"]],template:function(t,r){t&1&&u(0,ja,5,7,"ng-container",1),t&2&&l("ngIf",r.componentConfigSignal())},dependencies:[N,di,Hi,Gi],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)}[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-mat-dialog-container.snippyly-recording-preview-steps-dialog{max-width:none} .velt-mat-dialog-container.snippyly-recording-preview-steps-dialog mat-dialog-container .mat-mdc-dialog-surface.mdc-dialog__surface{background:transparent;padding:0;margin:0;border-radius:var(--velt-border-radius-lg)}"],changeDetection:0});let i=o;return i})();function Ki(i){try{let o={};return i.audio?.enabled&&(o.audio={deviceId:i.audio.deviceId?{exact:i.audio.deviceId}:void 0}),i.video?.enabled&&(o.video={deviceId:i.video.deviceId?{exact:i.video.deviceId}:void 0}),o}catch{return{}}}var Xi=(()=>{let o=class o{constructor(e){this.loggingService=e,this.isPipActive$=new J(!1),this.pipStopRecordingTriggered$=new J(!1),this.pipPauseRecordingTriggered$=new J(!1),this.pictureInPicture$=new J(!1),this.pipClearRecordingTriggered$=new J(!1)}getPipClearRecordingTriggered$(){return this.pipClearRecordingTriggered$.asObservable()}resetPipClearRecordingTriggered(){this.pipClearRecordingTriggered$.next(!1)}openPictureInPicture(e,t){return A(this,null,function*(){try{if(!this.isPictureInPictureEnabled()||!e||document.pictureInPictureElement||window.documentPictureInPicture?.window)return;if("documentPictureInPicture"in window){yield this.createDocumentPip(e,t);return}if(document.pictureInPictureEnabled){let r=yield this.findVideoElement();if(!r){this.loggingService.warn("No video element found for Picture-in-Picture");return}yield r.requestPictureInPicture(),this.isPipActive$.next(!0);return}}catch(r){this.loggingService.catch("Error in PipService openPictureInPicture:",r)}})}createDocumentPip(e,t){return A(this,null,function*(){try{let r=window.documentPictureInPicture;this.pipWindow=yield r.requestWindow({width:320,height:288}),yield this.addStylesToPip(),yield this.createControlPanelInPip(e,t),this.pipWindow?.addEventListener("unload",()=>{try{this.isPipActive$.next(!1),this.pipWindow=void 0}catch(a){this.loggingService.catch("Error in PipService createDocumentPip unload:",a)}}),this.isPipActive$.next(!0)}catch{this.isPipActive$.next(!1),this.pipWindow=void 0}})}addStylesToPip(){return A(this,null,function*(){try{if(!this.pipWindow)return;this.pipWindow.document.body.style.margin="0",this.pipWindow.document.body.style.padding="0",this.pipWindow.document.body.style.backgroundColor="#000",this.pipWindow.document.body.style.display="flex",this.pipWindow.document.body.style.alignItems="center",this.pipWindow.document.body.style.justifyContent="center"}catch(e){this.loggingService.catch("Error in PipService copyStylesToPip:",e)}})}createControlPanelInPip(e,t){return A(this,null,function*(){if(this.pipWindow)try{let r=this.pipWindow.document.createElement("div");r.style.cssText=`
2
- display: flex;
3
- flex-direction: column;
4
- `;let a=this.pipWindow.document.createElement("div");a.style.cssText=`
5
- display: flex;
6
- `;let c=this.pipWindow.document.createElement("video");c.srcObject=e,c.autoplay=!0,c.muted=!0,c.controls=!1,c.style.cssText=`
7
- width: 100%;
8
- height: 100%;
9
- object-fit: cover;
10
- transform: scaleX(-1);
11
- `,a.appendChild(c);let p=this.pipWindow.document.createElement("div");p.style.cssText=`
12
- display: flex;
13
- align-items: center;
14
- justify-content: space-between;
15
- padding: 8px 12px;
16
- background: #0F0F0F;
17
- gap: 8px;
18
- `;let m=(ie=>{if(!this.pipWindow)return document.createElement("div");let ve=this.pipWindow.document.createElement("div");ve.style.cssText=`
19
- background: var(--velt-accent, #625DF5);
20
- padding: 4px;
21
- border-radius: 100px;
22
- display: flex;
23
- margin-right: 8px;
24
- `;let Re=this.pipWindow.document.createElement("div");Re.style.cssText=`
25
- display: flex;
26
- `,Re.innerHTML=`
27
- <svg
28
- style="max-width: unset; color: var(--velt-accent-foreground, #FFFFFF);"
29
- width="24"
30
- height="24"
31
- viewBox="0 0 24 24"
32
- fill="none"
33
- aria-hidden="true"
34
- focusable="false">
35
- <path
36
- d="M18.5 12.0004V14.1671C18.5 14.3586 18.4239 14.5423 18.2885 14.6778C18.153 14.8132 17.9693 14.8893 17.7778 14.8893H6.22222C6.03068 14.8893 5.84698 14.8132 5.71153 14.6778C5.57609 14.5423 5.5 14.3586 5.5 14.1671V6.94488C5.5 6.75333 5.57609 6.56963 5.71153 6.43419C5.84698 6.29875 6.03068 6.22266 6.22222 6.22266H12.7222M8.38889 17.7782H15.6111M9.83333 14.8893V17.7782M14.1667 14.8893V17.7782M15.6111 6.22266H18.5M18.5 6.22266V9.11155M18.5 6.22266L14.8889 9.83377"
37
- stroke="currentColor"
38
- stroke-width="1.25"
39
- stroke-linecap="round"
40
- stroke-linejoin="round"/>
41
- </svg>
42
- `.trim();let Pt=Re.firstElementChild;return ve.appendChild(Re),ve})("video"),v=this.pipWindow.document.createElement("div");v.style.cssText=`
43
- display: flex;
44
- align-items: center;
45
- color: var(--velt-text-2, #FFFFFF);
46
- font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
47
- font-size: 14px;
48
- margin-right: 8px;
49
- width: 65px;
50
- `,v.textContent="00:00:00";let _=ie=>{try{if(ie.origin!==window.location.origin){this.loggingService.warn("Received message from untrusted origin:",ie.origin);return}if(ie.source!==window.parent){this.loggingService.warn("Received message from untrusted source window");return}if(window.opener&&window.parent!==window.opener){this.loggingService.warn("Parent window does not match opener window");return}if(ie.data?.type==="recording-timer-update"&&this.pipWindow&&!this.pipWindow.closed)v.textContent=ie.data.display||"00:00:00";else if(ie.data?.type==="recording-status-update"&&this.pipWindow&&!this.pipWindow.closed){if(ie.data.status==="paused"){let ve=I(()=>{window.parent.postMessage({type:"pip-resume-recording"},"*");let Re=H(ue);G.__cleanup&&G.__cleanup(),G.parentNode?.replaceChild(Re,G),G=Re});G.__cleanup&&G.__cleanup(),G.parentNode?.replaceChild(ve,G),G=ve}else if(ie.data.status==="started"||ie.data.status==="resumed"){let ve=H(ue);G.__cleanup&&G.__cleanup(),G.parentNode?.replaceChild(ve,G),G=ve}}}catch(ve){this.loggingService.catch("Error in PipService createControlPanelInPip message listener:",ve)}};window.addEventListener("message",_),this.pipWindow.addEventListener("unload",()=>{try{window.removeEventListener("message",_),G.__cleanup&&G.__cleanup(),me.__cleanup&&me.__cleanup(),ye.__cleanup&&ye.__cleanup()}catch(ie){this.loggingService.catch("Error in PipService createControlPanelInPip unload cleanup:",ie)}});let x=this.pipWindow.document.createElement("div");x.style.cssText=`
51
- display: flex;
52
- align-items: center;
53
- gap: 4px;
54
- `;let I=ie=>this.createPipButton("play","Resume Recording",ie),H=ie=>this.createPipButton("pause","Pause Recording",ie),G,ue=()=>{try{window.parent.postMessage({type:"pip-pause-recording"},"*");let ie=I(()=>{window.parent.postMessage({type:"pip-resume-recording"},"*");let ve=H(ue);G.parentNode?.replaceChild(ve,G),G=ve});G.parentNode?.replaceChild(ie,G),G=ie}catch(ie){this.loggingService.catch("Error in PipService createControlPanelInPip handlePauseClick:",ie)}};G=H(ue);let me=this.createPipButton("stop","Stop Recording",()=>{window.parent.postMessage({type:"pip-stop-recording"},"*"),t(),setTimeout(()=>{this.pipWindow&&!this.pipWindow.closed&&this.pipWindow.close()},100)}),ye=this.createPipButton("close","Close Picture-in-Picture",()=>{window.parent.postMessage({type:"pip-clear-recording"},"*"),this.pipWindow&&!this.pipWindow.closed&&this.pipWindow.close()}),fe=this.pipWindow.document.createElement("div");fe.style.cssText=`
55
- display: flex;
56
- align-items: center;
57
- justify-content: space-between;
58
- flex: 1;
59
- `;let Se=this.pipWindow.document.createElement("div");Se.style.cssText=`
60
- display: flex;
61
- align-items: center;
62
- `,Se.appendChild(m),Se.appendChild(v),fe.appendChild(Se),fe.appendChild(x),x.appendChild(G),x.appendChild(me),x.appendChild(ye),p.appendChild(fe),r.appendChild(a),r.appendChild(p),this.pipWindow.document.body.appendChild(r)}catch(r){this.loggingService.catch("Error in PipService createControlPanelInPip:",r)}})}createPipButton(e,t,r){if(!this.pipWindow)return document.createElement("div");let a=this.pipWindow.document.createElement("button");a.title=t,a.style.cssText=`
63
- height: 28px;
64
- width: 28px;
65
- border: none;
66
- background: none;
67
- display: flex;
68
- cursor: pointer;
69
- align-items: center;
70
- justify-content: center;
71
- padding: 0;
72
- margin: 0 5px;
73
- color: ${e==="stop"?"var(--velt-error, #FF4D4D)":e==="close"?"var(--velt-text-12, #666666)":"var(--velt-text-2, #FFFFFF)"};
74
- transition: color 0.2s;
75
- `;let c=this.pipWindow.document.createElement("div"),p="";switch(e){case"stop":p=`
76
- <svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true" focusable="false">
77
- <path d="M1.63305 3.9642C1.81098 2.74609 2.74609 1.81098 3.9642 1.63305C5.02689 1.47782 6.4399 1.33203 7.9987 1.33203C9.5575 1.33203 10.9705 1.47782 12.0332 1.63305C13.2513 1.81098 14.1864 2.74609 14.3643 3.9642C14.5196 5.02689 14.6654 6.4399 14.6654 7.9987C14.6654 9.5575 14.5196 10.9705 14.3643 12.0332C14.1864 13.2513 13.2513 14.1864 12.0332 14.3643C10.9705 14.5196 9.5575 14.6654 7.9987 14.6654C6.4399 14.6654 5.02689 14.5196 3.9642 14.3643C2.74609 14.1864 1.81098 13.2513 1.63305 12.0332C1.47782 10.9705 1.33203 9.5575 1.33203 7.9987C1.33203 6.4399 1.47782 5.02689 1.63305 3.9642Z" fill="currentColor"/>
78
- </svg>
79
- `;break;case"close":p=`
80
- <svg width="28" height="28" viewBox="0 0 28 28" fill="none" aria-hidden="true" focusable="false">
81
- <path d="M18.998 8.99805L8.99805 18.998M8.99805 8.99805L18.998 18.998" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
82
- </svg>
83
- `;break;case"pause":p=`
84
- <svg width="21" height="20" viewBox="0 0 21 20" fill="none" aria-hidden="true" focusable="false">
85
- <rect x="6" y="4" width="2.99958" height="12" rx="1.49979" fill="currentColor"/>
86
- <rect x="12" y="4" width="2.99958" height="12" rx="1.49979" fill="currentColor"/>
87
- </svg>
88
- `;break;case"play":p=`
89
- <svg width="20" height="20" viewBox="0 0 20 20" fill="none" aria-hidden="true" focusable="false">
90
- <path d="M6 4.66685V15.3335C5.99997 15.4521 6.03158 15.5686 6.09159 15.6709C6.15159 15.7733 6.23781 15.8577 6.34135 15.9156C6.44489 15.9735 6.562 16.0027 6.68059 16.0002C6.79918 15.9978 6.91497 15.9637 7.016 15.9015L15.6827 10.5682C15.7797 10.5085 15.8599 10.425 15.9155 10.3256C15.9711 10.2261 16.0003 10.1141 16.0003 10.0002C16.0003 9.88626 15.9711 9.77423 15.9155 9.6748C15.8599 9.57536 15.7797 9.49183 15.6827 9.43219L7.016 4.09885C6.91497 4.0367 6.79918 4.00262 6.68059 4.00015C6.562 3.99767 6.44489 4.02688 6.34135 4.08476C6.23781 4.14265 6.15159 4.22711 6.09159 4.32943C6.03158 4.43175 5.99997 4.54823 6 4.66685Z" fill="currentColor"/>
91
- </svg>
92
- `;break}c.innerHTML=p.trim();let d=c.firstElementChild;return d&&a.appendChild(d),a.addEventListener("click",r),a.__cleanup=()=>{a.removeEventListener("click",r)},a}exitPictureInPicture(){return A(this,null,function*(){try{if("documentPictureInPicture"in window&&(window.documentPictureInPicture.window||this.pipWindow)){this.pipWindow&&!this.pipWindow.closed&&this.pipWindow.close(),this.pipWindow=void 0,this.isPipActive$.next(!1);return}if(document.pictureInPictureElement){yield document.exitPictureInPicture(),this.isPipActive$.next(!1);return}this.isPipActive$.next(!1),this.pipWindow=void 0}catch(e){this.loggingService.catch("Error in PipService exitPictureInPicture:",e),this.isPipActive$.next(!1),this.pipWindow=void 0}})}togglePictureInPicture(e,t){return A(this,null,function*(){try{this.isPipActive$.value||this.pipWindow||document.pictureInPictureElement?yield this.exitPictureInPicture():yield this.openPictureInPicture(e,t)}catch(r){this.loggingService.catch("Error in PipService togglePictureInPicture:",r),this.isPipActive$.next(!1),this.pipWindow=void 0}})}findVideoElement(){return A(this,null,function*(){try{let e=['[data-testid*="velt-recorder-control-panel-video-video"]','[data-testid*="velt-recorder-control-panel-screen-screen"]','video[data-testid*="recorder"]'];for(let r of e){let a=document.querySelector(r);if(a&&a.srcObject)return a}let t=Array.from(document.querySelectorAll("video"));for(let r of t)if(r.srcObject)return r;return null}catch(e){return this.loggingService.catch("Error in PipService findVideoElement:",e),null}})}getIsPipActive$(){return this.isPipActive$.asObservable()}getIsPipActive(){return this.isPipActive$.value}getPipStopRecordingTriggered$(){return this.pipStopRecordingTriggered$.asObservable()}resetPipStopRecordingTriggered(){this.pipStopRecordingTriggered$.next(!1)}getPipPauseRecordingTriggered$(){return this.pipPauseRecordingTriggered$.asObservable()}resetPipPauseRecordingTriggered(){this.pipPauseRecordingTriggered$.next(!1)}enablePictureInPicture(){try{if(this.pictureInPicture$.value===!0)return;this.pictureInPicture$.next(!0),this.messageListener||(this.messageListener=e=>{try{if(e.origin!==window.location.origin){this.loggingService.warn("Received message from untrusted origin:",e.origin);return}if(e.source!==this.pipWindow&&e.source!==window.parent){this.loggingService.warn("Received message from untrusted source window");return}e.data?.type==="pip-stop-recording"?this.pipStopRecordingTriggered$.next(!0):e.data?.type==="pip-pause-recording"||e.data?.type==="pip-resume-recording"?this.pipPauseRecordingTriggered$.next(!0):e.data?.type==="pip-clear-recording"&&this.pipClearRecordingTriggered$.next(!0)}catch(t){this.loggingService.catch("Error in PipService enablePictureInPicture message listener:",t)}},window.addEventListener("message",this.messageListener))}catch(e){this.loggingService.catch("Error in PipService enablePictureInPicture: ",e)}}disablePictureInPicture(){try{if(this.pictureInPicture$.value===!1)return;this.pictureInPicture$.next(!1),this.messageListener&&(window.removeEventListener("message",this.messageListener),this.messageListener=void 0),this.pipStopRecordingTriggered$.next(!1),this.pipPauseRecordingTriggered$.next(!1),this.pipClearRecordingTriggered$.next(!1),this.isPipActive$.next(!1),this.pipWindow&&!this.pipWindow.closed&&this.pipWindow.close(),this.pipWindow=void 0}catch(e){this.loggingService.catch("Error in PipService disablePictureInPicture: ",e)}}getPictureInPicture$(){return this.pictureInPicture$.asObservable()}isPictureInPictureEnabled(){try{let e=new Te;return this.pictureInPicture$.value&&e.getBrowserName()==="Chrome"}catch(e){return this.loggingService.catch("Error in PipService isPictureInPictureEnabled: ",e),!1}}};o.\u0275fac=function(t){return new(t||o)(j(E))},o.\u0275prov=we({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();var vt=(()=>{let o=class o{constructor(e,t,r,a,c,p,d,m,v,_,x){this.analyticsService=e,this.loggingService=t,this.matDialog=r,this.storageService=a,this.docService=c,this.databaseService=p,this.domService=d,this.attachmentResolverService=m,this.pipService=v,this.recorderAnnotationsResolverService=_,this.serviceBook=x,this.recorderStatusSubject$=new J(null),this.recorderDurationSubject$=new J(null),this.darkMode$=new J(null),this.shadowDom$=new J(null),this.recordingDurations=[],this.chunks=[],this.recordingCountdownEnabled$=new J(!0),this.recorderInitData$=new je,this.recordedRawData$=new je,this.recordedData$=new je,this.onInitRecording$=new J(null),this.onRecordingAttributeRemovedFromBodySubject$=new je,this.videoEditor$=new J(!1),this.videoEditorTimelinePreview$=new J(!1),this.settingsEmbedded$=new J(!1),this.autoOpenVideoEditor$=new J(!1),this.playVideoInFullScreen$=new J(void 0),this.recordedDataStream=[],this.documentPaths=null,this.uploadPromises=[],this.chunkUrls$=new J({}),this.recordingQualityConstraints=new J({safari:{audio:{sampleRate:48e3,echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0},video:{width:{min:640,ideal:1280,max:1280},height:{min:360,ideal:720,max:720},frameRate:{min:15,ideal:20,max:30},aspectRatio:{ideal:1.777777778}}},other:{audio:{sampleRate:48e3,echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0},video:{width:{min:640,ideal:1280,max:1280},height:{min:360,ideal:720,max:720},frameRate:{min:15,ideal:20,max:30},aspectRatio:{ideal:1.777777778}}}}),this.recordingEncodingOptions=new J({safari:{videoBitsPerSecond:25e5,audioBitsPerSecond:128e3},other:{videoBitsPerSecond:1e6,audioBitsPerSecond:128e3}}),this.recordingMicEnabled$=new J(null),this.onboardingTooltip$=new J(!1),this.audioContext=null,this.audioDestination=null,this.activeInputTracks=new Set,this.retakeOnVideoEditor$=new J(!1),this.maxRecordingLength=null,this.screenStreamSubject$=new J(null),this.playbackOnPreviewClick$=new J(!0),this.serviceBook.set(Yt,this),this.onInitRecording$.subscribe(I=>{I?this.setRecordingAttributeAtBody():this.removeRecordingAttributeFromBody()}),this.pipService.getPipPauseRecordingTriggered$().subscribe(I=>{I&&(this.recorderStatusSubject$.value==="started"||this.recorderStatusSubject$.value==="resumed"?this.pauseRecording():this.recorderStatusSubject$.value==="paused"&&this.resumeRecording(),this.pipService.resetPipPauseRecordingTriggered())}),this.databaseService.getDb().pipe(xe(I=>!!I),ke(1)).subscribe(I=>{I&&this.getDocumentPaths()},I=>{this.loggingService.catch("Error in RecorderAnnotationService getDb subscription: ",I)})}getDocumentPaths(){this.loggingService.log("%c[WB] Calling FUNCTION: getDocumentPaths","color: green;");try{this.docService.getDocumentPaths$().pipe(ze(e=>{this.documentPaths=e})).subscribe(()=>{},e=>{this.loggingService.catch("Error in getDocumentPaths subscription: ",e)})}catch(e){this.loggingService.catch("Error in CursorService getDocumentPaths: ",e)}}setRecordedDataStream(e){this.recordedDataStream=e}getRecordedDataStream(){return this.recordedDataStream}setRecordingAttributeAtBody(){try{let e=this.onInitRecording$.getValue();e&&(document.body.setAttribute(K.ATTRIBUTES.VELT_ONGOING_RECORDING,e.type),e?.isCommentRecording&&document.body.setAttribute(K.ATTRIBUTES.VELT_COMMENT_RECORDING,"true"))}catch(e){this.loggingService.catch("Error in RecorderService setRecordingAttributeAtBody: ",e)}}removeRecordingAttributeFromBody(){try{document.body.removeAttribute(K.ATTRIBUTES.VELT_ONGOING_RECORDING),document.body.removeAttribute(K.ATTRIBUTES.VELT_COMMENT_RECORDING),this.onRecordingAttributeRemovedFromBodySubject$.next()}catch(e){this.loggingService.catch("Error in RecorderService removeRecordingAttributeFromBody: ",e)}}onRecordingAttributeRemovedFromBody$(){return this.onRecordingAttributeRemovedFromBodySubject$.asObservable()}getRecorderInitData(){return this.recorderInitData$.asObservable()}onInitRecording(){return this.onInitRecording$.asObservable()}onRecordedData(){return this.recordedData$.asObservable()}setRecordedData(e){this.recordedData$.next(e)}initRecording(e,t,r,a,c,p,d,m,v,_){return A(this,null,function*(){try{let x={};switch(e){case"audio":x.audio={enabled:!0};break;case"video":x.video={enabled:!0},x.audio={enabled:!0};break;case"screen":x.screen={enabled:!0,stream:v},x.video={enabled:!1},x.audio={enabled:!1};break;default:break}v&&e==="screen"&&(x.screen={enabled:!0,stream:v}),this.matDialog.open(Zi,{panelClass:"velt-mat-dialog-container",data:{type:e,mediaConfig:x,darkMode:[!0,!1].includes(a)?a:this.darkMode$.value,shadowDom:c,isExplicitShadowDom:_,recordingCountdown:m}}).afterClosed().subscribe(I=>{if(I){let H={};switch(e){case"audio":H.audio={enabled:!0,deviceId:I.audio?.deviceId},H.audio=I.audio;break;case"video":H.video={enabled:!0,deviceId:I.video?.deviceId},H.audio={enabled:!0,deviceId:I.audio?.deviceId},H.video=I.video,H.audio=I.audio;break;case"screen":H.screen={enabled:!0},H.audio=I.audio,H.video=I.video,H.screen=I.screen;break;default:break}this.onInitRecording$.next({type:e,panelId:t,mediaConfig:H,isCommentRecording:r,darkMode:[!0,!1].includes(a)?a:!!this.darkMode$.value,shadowDom:c,isExplicitShadowDom:_,commentAnnotationId:p,clientDocumentId:d})}},I=>{this.loggingService.catch("Error in RecorderService initRecording afterClosed: ",I)})}catch(x){this.loggingService.catch("Error in RecorderService initRecording: ",x)}})}startRecording(e,t){return A(this,null,function*(){try{this.loggingService.log("[startRecording] Starting with config:",e,"mediaConfig:",t);let r=new MediaStream,a=yield this.getBrowserSpecificOptions();return yield this.collectMediaTracks(r,e,t),yield this.initializeMediaRecorder(r,a,e),this.setupRecorderData(e,r),r}catch(r){return this.loggingService.catch("Error in RecorderService startRecording: ",r),Promise.reject(r)}})}getBrowserSpecificOptions(){return A(this,null,function*(){try{let e={videoBitsPerSecond:this.recordingEncodingOptions.value[this.isSafari()?"safari":"other"]?.videoBitsPerSecond,audioBitsPerSecond:this.recordingEncodingOptions.value[this.isSafari()?"safari":"other"]?.audioBitsPerSecond},t=this.getSupportedMimeTypes();if(t.length>0){let a=t.find(c=>c.includes("mp4")&&c.includes("h264"))||t.find(c=>c.includes("mp4"))||t[0];e.mimeType=a}return new Te().getBrowserName()==="Firefox"&&(t.includes("video/webm")&&(e.mimeType="video/webm"),e.videoBitsPerSecond=Math.min(e.videoBitsPerSecond||1e6,2e6),e.audioBitsPerSecond=Math.min(e.audioBitsPerSecond||128e3,256e3)),e}catch(e){return this.loggingService.catch("Error in RecorderService getBrowserSpecificOptions: ",e),{}}})}collectMediaTracks(e,t,r){return A(this,null,function*(){try{let a=[],c=[];if(t.type.screen&&r?.screen?.stream){let p=this.getCommonVideoQualityConstraints(!0);r.screen.stream.getTracks().forEach(d=>{d.onended=()=>this.stopRecording(),d.kind==="video"?(d.applyConstraints(y({},p)),c.push(d),this.loggingService.log("[collectMediaTracks] Added screen video track"),this.registerActiveTrack(d)):d.kind==="audio"&&(a.push(d),this.loggingService.log("[collectMediaTracks] Collected tab audio track for mixing"),this.registerActiveTrack(d))})}if(t?.type.audio||t?.type.video)if(this.isFirefox()&&t.type.screen&&(r?.audio?.stream||r?.video?.stream))t.type.audio&&r?.audio?.stream&&r.audio.stream.getAudioTracks().forEach(m=>{a.push(m),this.loggingService.log("[collectMediaTracks] Collected mic audio track for mixing (Firefox)"),this.registerActiveTrack(m)}),t.type.video&&r?.video?.stream&&r.video.stream.getVideoTracks().forEach(m=>{c.push(m),this.loggingService.log("[collectMediaTracks] Added user video track (Firefox)"),this.registerActiveTrack(m)});else{let d=this.buildMediaConstraints(t,r),m=yield navigator.mediaDevices.getUserMedia(d);if(m){if(t?.type.audio){let v=m.getAudioTracks();if(v.length>0)if(this.isSafari()){let _=v[0];if(_.getSettings().sampleRate!==48e3){this.loggingService.log("[collectMediaTracks] Adjusting audio sample rate for Safari");let H=(yield navigator.mediaDevices.getUserMedia({audio:{sampleRate:48e3}})).getAudioTracks()[0];a.push(H),this.registerActiveTrack(H),_.stop()}else a.push(_),this.registerActiveTrack(_)}else v.forEach(_=>{a.push(_),this.loggingService.log("[collectMediaTracks] Collected mic audio track for mixing"),this.registerActiveTrack(_)})}if(t?.type.video){let v=m.getVideoTracks();if(v.length>0)if(this.isSafari()){let _=v[0];_.enabled=!0;let x=_.clone();c.push(x),this.loggingService.log("[collectMediaTracks] Added user video track (Safari, cloned)"),r&&r.video&&(r.video.track=_),this.registerActiveTrack(_)}else v.forEach(_=>{c.push(_),this.loggingService.log("[collectMediaTracks] Added user video track"),this.registerActiveTrack(_)})}}}if(a.length>0)if(this.loggingService.log(`[collectMediaTracks] Processing ${a.length} audio track(s)`),a.length===1)e.addTrack(a[0]),this.loggingService.log("[collectMediaTracks] Added single audio track (no mixing needed)");else{this.loggingService.log("[collectMediaTracks] Mixing multiple audio tracks...");let p=yield this.mixAudioTracks(a);p?(e.addTrack(p),this.loggingService.log("[collectMediaTracks] Added mixed audio track to stream")):(this.loggingService.warn("[collectMediaTracks] Failed to mix audio tracks, adding first track only"),e.addTrack(a[0]))}c.forEach(p=>{e.addTrack(p)}),this.loggingService.log(`[collectMediaTracks] Added ${c.length} video track(s) to stream`),this.loggingService.log(`[collectMediaTracks] Final stream: ${e.getAudioTracks().length} audio track(s), ${e.getVideoTracks().length} video track(s)`)}catch(a){this.loggingService.catch("Error in RecorderService collectMediaTracks: ",a);return}})}buildMediaConstraints(e,t){try{let r=this.getCommonVideoQualityConstraints(!!e.type.video),a=this.getCommonAudioConstraints(!!e.type.audio,t);return Ka(!!e.type.video,a,r,t)}catch(r){return this.loggingService.catch("Error in RecorderService buildMediaConstraints: ",r),{}}}getCommonAudioConstraints(e,t){try{if(!e)return!1;let r=this.recordingQualityConstraints.value[this.isSafari()?"safari":"other"]?.audio||{};return Ja(t,r)}catch(r){return this.loggingService.catch("Error in RecorderService getCommonAudioConstraints: ",r),{}}}getCommonVideoQualityConstraints(e){try{return e?this.recordingQualityConstraints.value[this.isSafari()?"safari":"other"]?.video||{}:{}}catch(t){return this.loggingService.catch("Error in RecorderService getCommonVideoQualityConstraints: ",t),{}}}adjustSafariAudioTrack(e,t){return A(this,null,function*(){try{let r=t.getAudioTracks()[0];if(r.getSettings().sampleRate!==48e3){this.loggingService.log("[startRecording] Adjusting audio sample rate for Safari");let c=yield navigator.mediaDevices.getUserMedia({audio:{sampleRate:48e3}});e.addTrack(c.getAudioTracks()[0])}else e.addTrack(r)}catch(r){this.loggingService.catch("Error in RecorderService adjustSafariAudioTrack: ",r);return}})}registerActiveTrack(e){try{e&&this.activeInputTracks.add(e)}catch(t){this.loggingService.catch("Error in RecorderService registerActiveTrack:",t)}}stopAllActiveInputTracks(){try{this.activeInputTracks.forEach(e=>{try{e?.readyState!=="ended"&&e.stop()}catch{}}),this.activeInputTracks.clear()}catch(e){this.loggingService.catch("Error in RecorderService stopAllActiveInputTracks:",e)}}mixAudioTracks(e){return A(this,null,function*(){try{if(e.length===0)return this.loggingService.warn("[mixAudioTracks] No audio tracks provided"),null;if(e.length===1)return this.loggingService.log("[mixAudioTracks] Only one audio track, no mixing needed"),e[0];this.loggingService.log(`[mixAudioTracks] Mixing ${e.length} audio tracks`),this.cleanupAudioMixing(),this.audioContext=new AudioContext,this.audioDestination=this.audioContext.createMediaStreamDestination();let t=this.audioContext.createGain();t.gain.value=1,t.connect(this.audioDestination);for(let a of e)try{let c=new MediaStream([a]),p=this.audioContext.createMediaStreamSource(c),d=this.audioContext.createGain();d.gain.value=1,p.connect(d),d.connect(t),this.loggingService.log(`[mixAudioTracks] Connected audio track: ${a.label||"unlabeled"}`)}catch(c){this.loggingService.catch(`[mixAudioTracks] Error connecting track ${a.label}:`,c)}let r=this.audioDestination.stream.getAudioTracks();return r.length>0?(this.loggingService.log("[mixAudioTracks] Successfully created mixed audio track"),r[0]):(this.loggingService.warn("[mixAudioTracks] No mixed track created"),null)}catch(t){return this.loggingService.catch("Error in RecorderService mixAudioTracks:",t),this.cleanupAudioMixing(),null}})}cleanupAudioMixing(){try{this.audioDestination&&(this.audioDestination.stream.getTracks().forEach(e=>{e.stop()}),this.audioDestination=null),this.audioContext&&(this.audioContext.state!=="closed"&&this.audioContext.close().catch(e=>{this.loggingService.catch("Error closing audio context:",e)}),this.audioContext=null)}catch(e){this.loggingService.catch("Error in RecorderService cleanupAudioMixing:",e)}}initializeMediaRecorder(e,t,r){return A(this,null,function*(){try{if(this.mediaRecorder)try{this.mediaRecorder.state!=="inactive"&&this.mediaRecorder.stop(),this.mediaRecorder=null}catch(m){this.loggingService.catch("Error cleaning up old mediaRecorder:",m)}if(e.getTracks().length===0)throw new Error("MediaStream has no tracks");this.mediaRecorder=new MediaRecorder(e,t),this.chunks=[],this.chunkUrls$.next({}),this.uploadPromises=[];let a=0;if(this.isSafari()){let m=e.getVideoTracks();m.length>0&&m.forEach(v=>{v.contentHint="detail",v.enabled=!0})}let p=new Te().getBrowserName()==="Firefox";p&&e.getTracks().forEach(m=>{m.enabled=!0}),this.mediaRecorder.addEventListener("dataavailable",m=>{if(m.data?.size>0){let v=a++;if(this.chunks.push(m.data),this.recorderAnnotationsResolverService.shouldUploadFullRecording())return;let _=`recording_${new Date().getTime()}_${Math.random().toString(36).substring(2,9)}`,x=m.data,I=this.uploadChunk(x,_,v);this.uploadPromises||(this.uploadPromises=[]),this.uploadPromises.push({promise:I,index:v}),I.then(H=>{this.chunkUrls$.next(U(y({},this.chunkUrls$.value),{[v]:H}))}).catch(H=>{})}}),this.mediaRecorder.addEventListener("stop",()=>{p&&this.chunks.length===0&&this.attemptFirefoxCanvasRecording(e),this.onStopRecording()}),this.mediaRecorder.addEventListener("error",m=>{this.loggingService.catch("MediaRecorder error event:",m)});let d=4e3;p&&r.type.screen&&(d=void 0),d?this.mediaRecorder.start(d):this.mediaRecorder.start(),p&&setTimeout(()=>{if(this.chunks.length===0&&this.mediaRecorder.state==="recording")try{this.mediaRecorder.requestData&&this.mediaRecorder.requestData()}catch{}},2e3)}catch(a){throw this.loggingService.catch("Error in RecorderService initializeMediaRecorder: ",a),a}})}uploadChunk(e,t,r){return A(this,null,function*(){try{let c=this.mediaRecorder.mimeType||"video/mp4",p=c.includes("webm")?"webm":"mp4",d=`chunk_${r}_${new Date().getTime()}.${p}`,m=new File([e],d,{type:c});return yield this.uploadChunkToStorage(m,t,r)}catch(a){throw a}})}uploadChunkToStorage(e,t,r){try{if(!this.documentPaths?.documentId)throw new Error("Document ID is required for chunk upload");let a=this.documentPaths?.organizationId,c=this.documentPaths?.documentId,p=`${K.FIREBASE_PARTIAL_PATH_DOCS}/${c}/${K.FIREBASE_PARTIAL_PATH_RECORDER}/${t}`;if(a&&(p=`${K.FIREBASE_PARTIAL_PATH_ORGANIZATIONS}/${a}/${K.FIREBASE_PARTIAL_PATH_DOCS}/${c}/${K.FIREBASE_PARTIAL_PATH_RECORDER}/${t}`),this.attachmentResolverService.attachmentDataProviderAvailable("recorder")){let d=this.docService.getBaseMetadata("recorder");return this.storageService.uploadChunk(p,e,r,{useAttachmentResolver:!0,metadata:d,attachmentScope:"recorder"})}return this.storageService.uploadChunk(p,e,r)}catch(a){throw this.loggingService.catch("Error in RecorderService uploadChunkToStorage: ",a),a}}setupRecorderData(e,t){try{return this.recorderInitData=new Ut,this.recorderStatusSubject$.next("started"),this.isSafari()&&e.type.video&&t.getVideoTracks().forEach(r=>{r.enabled=!0}),this.recorderInitData.stream=t,this.recorderInitData.status=this.recorderStatusSubject$.asObservable(),this.recorderInitData.type=this.determineRecorderType(e),this.recorderInitData.recordedTime=this.recorderDurationSubject$.asObservable(),this.recorderInitData.recordedRawData$=this.recordedRawData$.asObservable(),this.recordingDurations=[{start:new Date().getTime()}],this.startTimer(),this.recorderInitData$.next(this.recorderInitData),this.recorderActionsService?.onRecordingStarted(this.getRecorderDataFromInitData()),this.pipService.getIsPipActive()&&window.postMessage({type:"recording-status-update",status:"started"},"*"),this.recorderInitData}catch(r){return this.loggingService.catch("Error in RecorderService setupRecorderData: ",r),null}}determineRecorderType(e){try{return e.type.video?"video":e.type.screen?"screen":(e.type.audio,"audio")}catch(t){return this.loggingService.catch("Error in RecorderService determineRecorderType: ",t),"audio"}}timeout(e){return new Promise(t=>setTimeout(t,e))}pauseRecording(){try{if(this.recorderStatusSubject$.next("paused"),this.mediaRecorder.pause(),this.firefoxFallbackRecorder?.state==="recording")try{this.firefoxFallbackRecorder.pause()}catch(e){this.loggingService.catch("Error pausing Firefox fallback recorder: ",e)}this.recordingDurations?.length&&(this.recordingDurations[this.recordingDurations.length-1].end=new Date().getTime()),this.stopTimer(),this.recorderActionsService?.onRecordingPaused(this.getRecorderDataFromInitData()),this.pipService.getIsPipActive()&&window.postMessage({type:"recording-status-update",status:"paused",recordingType:this.recorderInitData?.type||"video"},window.location.origin)}catch(e){this.loggingService.catch("Error in RecorderService pauseRecording: ",e)}}resumeRecording(){try{if(this.recorderStatusSubject$.next("resumed"),this.mediaRecorder.resume(),this.firefoxFallbackRecorder?.state==="paused")try{this.firefoxFallbackRecorder.resume()}catch(e){this.loggingService.catch("Error resuming Firefox fallback recorder: ",e)}this.recordingDurations.push({start:new Date().getTime()}),this.startTimer(),this.recorderActionsService?.onRecordingResumed(this.getRecorderDataFromInitData()),this.pipService.getIsPipActive()&&window.postMessage({type:"recording-status-update",status:"started",recordingType:this.recorderInitData?.type||"video"},"*")}catch(e){this.loggingService.catch("Error in RecorderService resumeRecording: ",e)}}stopRecording(){try{if(this.mediaRecorder?.state!=="inactive"?(this.mediaRecorder.stop(),this.removeRecordingAttributeFromBody(),this.stopAllActiveInputTracks(),this.cleanupAudioMixing()):this.clearRecording(),this.firefoxFallbackRecorder?.state==="recording")try{this.firefoxFallbackRecorder.stop()}catch(e){this.loggingService.catch("Error stopping Firefox fallback recorder: ",e)}this.recorderActionsService?.onRecordingStopped(this.getRecorderDataFromInitData())}catch(e){this.loggingService.catch("Error in RecorderService stopRecording: ",e)}}onStopRecording(){return A(this,null,function*(){try{this.loggingService.log("[onStopRecording] Starting, current chunks:",this.chunks.length),this.recordingDurations?.length&&(this.recordingDurations[this.recordingDurations?.length-1].end=new Date().getTime()),this.stopTimer(),this.recorderStatusSubject$.next("stopped"),(this.recorderInitData?.stream?.getTracks()||[]).forEach(r=>{r.stop()}),this.stopAllActiveInputTracks(),this.cleanupAudioMixing(),yield this.timeout(100);let t=new St;if(this.chunks.length>0){let r=this.recorderInitData?.type==="audio"?"audio/mp4":"video/mp4";this.loggingService.log("[onStopRecording] Creating blob with type:",r),t.blob=new Blob(this.chunks,{type:r}),this.loggingService.log("[onStopRecording] Blob created, size:",t.blob.size);try{let a=yield this.getVideoDuration(t.blob);if(a&&isFinite(a)&&a>0){let c={};c.duration=a*1e3,c.display=this.convertMillisecondsToTime(a*1e3),this.recorderDurationSubject$.next(c),t.recordedTime=c}else{let c=this.recorderDurationSubject$.value;t.recordedTime=c}}catch(a){let c=this.recorderDurationSubject$.value;t.recordedTime=c,this.recorderInitData&&this.loggingService.catch("Error in RecorderService onStopRecording getVideoDuration: ",a)}if(t.blob.size===0)throw new Error("Recorded blob has zero size");if(t.url=URL.createObjectURL(t.blob),t.type=this.recorderInitData?.type,t.recordedTime=this.recorderDurationSubject$.value,t?.type!=="audio")try{yield this.timeout(200);let a=yield Kt(t.blob,3);a&&(t.thumbnail=yield Jt(a))}catch(a){this.recorderInitData&&this.loggingService.catch("Error in RecorderService onStopRecording getVideoCover: ",a)}}this.recordedRawData$.next(t)}catch(e){this.loggingService.catch("Error in RecorderService onStopRecording: ",e),this.recordedRawData$.error(e)}})}clearRecording(e){return A(this,null,function*(){try{if(this.loggingService.log("%c[WB] Calling RecorderService FUNCTION: clearRecording","color: green;"),this.mediaRecorder)try{this.mediaRecorder.state!=="inactive"&&this.mediaRecorder.stop(),this.mediaRecorder=null}catch(t){this.loggingService.catch("Error cleaning up mediaRecorder:",t)}if(this.recorderStatusSubject$.next(null),this.recorderDurationSubject$.next(null),this.onInitRecording$.next(null),this.recordingDurations=[],this.domService.resetRecordingInProgress(),this.firefoxFallbackRecorder){try{this.firefoxFallbackRecorder.state==="recording"&&this.firefoxFallbackRecorder.stop()}catch(t){this.loggingService.catch("Error stopping Firefox fallback recorder during cleanup: ",t)}this.firefoxFallbackRecorder=void 0}this.cleanupAudioMixing(),this.stopAllActiveInputTracks();try{this.screenStreamSubject$?.value?.getTracks()?.forEach(r=>{r?.readyState!=="ended"&&r.stop()}),this.screenStreamSubject$?.next(null)}catch{}this.recorderInitData?.stream?.getTracks()?.forEach(t=>{t.stop()}),e?.triggerEvent==="cancelled"&&this.recorderActionsService?.onRecordingCancelled(this.getRecorderDataFromInitData()),this.recorderInitData=null,this.recorderInitData$.next(null),this.chunks=[],this.chunkUrls$.next({}),this.stopTimer()}catch(t){this.loggingService.catch("Error in RecorderService clearRecording: ",t)}})}startTimer(){try{this.stopTimer(),this.durationInterval=setInterval(()=>{this.calculateRecordedTime()},1e3)}catch(e){this.loggingService.catch("Error in RecorderService startTimer: ",e)}}stopTimer(){try{this.durationInterval&&clearInterval(this.durationInterval)}catch(e){this.loggingService.catch("Error in RecorderService stopTimer: ",e)}}calculateRecordedTime(){try{if(this?.recordingDurations?.length){let e=0;this.recordingDurations.forEach(r=>{r.end?e+=r?.end-r.start:e+=new Date().getTime()-r.start});let t={};t.duration=e,t.display=this.convertMillisecondsToTime(e),this.recorderDurationSubject$.next(t),this.pipService.getIsPipActive()&&window.postMessage({type:"recording-timer-update",display:t.display},"*")}else this.recorderDurationSubject$.next(null)}catch(e){this.loggingService.catch("Error in RecorderService calculateRecordedTime: ",e)}}checkMaxLength(){try{if(!this.maxRecordingLength||!this.recordingDurations?.length)return!1;let e=0;this.recordingDurations.forEach(r=>{r.end?e+=r?.end-r.start:e+=new Date().getTime()-r.start});let t=e>=this.maxRecordingLength*1e3+500;return t&&this.loggingService.log("%c[WB] Max recording length reached. Duration: "+e+"ms, Target: "+this.maxRecordingLength+"s","color: orange;"),t}catch(e){return this.loggingService.catch("Error in RecorderService checkMaxLength: ",e),!1}}convertMillisecondsToTime(e){try{let t=Math.floor(e/1e3),r=Math.floor(t/60),a=Math.floor(r/60);return t=t%60,r=r%60,`${a.toString().padStart(2,"0")}:${r.toString().padStart(2,"0")}:${t.toString().padStart(2,"0")}`}catch(t){return this.loggingService.catch("Error in RecorderService convertMillisecondsToTime: ",t),""}}getRecorderStatus$(){return this.recorderDurationSubject$.asObservable()}enableRecordingCountdown(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enableRecordingCountdown","color: green;"),this.recordingCountdownEnabled$.value===!0)return;this.recordingCountdownEnabled$.next(!0)}catch(e){this.loggingService.catch("Error in RecorderService enableRecordingCountdown: ",e)}}disableRecordingCountdown(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disableRecordingCountdown","color: green;"),this.recordingCountdownEnabled$.value===!1)return;this.recordingCountdownEnabled$.next(!1)}catch(e){this.loggingService.catch("Error in RecorderService disableRecordingCountdown: ",e)}}getRecordingCountdownEnabled$(){return this.recordingCountdownEnabled$.asObservable()}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 RecorderService 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 RecorderService disableDarkMode: ",e)}}getDarkMode(){return this.darkMode$.value}getDarkMode$(){return this.darkMode$.asObservable()}enableShadowDom(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enableShadowDom","color: green;"),this.shadowDom$.value===!0)return;this.shadowDom$.next(!0)}catch(e){this.loggingService.catch("Error in RecorderService enableShadowDom: ",e)}}disableShadowDom(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disableShadowDom","color: green;"),this.shadowDom$.value===!1)return;this.shadowDom$.next(!1)}catch(e){this.loggingService.catch("Error in RecorderService disableShadowDom: ",e)}}getShadowDom(){return this.shadowDom$.value}getShadowDom$(){return this.shadowDom$.asObservable()}isSafari(){try{this.loggingService.log("%c[WB] Calling FUNCTION: isSafari","color: green;");let e=navigator.userAgent.toLowerCase();return e.includes("safari")&&!e.includes("chrome")&&!e.includes("android")}catch(e){return this.loggingService.catch("Error in RecorderService isSafari: ",e),!1}}isFirefox(){try{return new Te().getBrowserName()==="Firefox"}catch(e){return this.loggingService.catch("Error in RecorderService isFirefox: ",e),!1}}getSupportedMimeTypes(){try{return["video/mp4;codecs=h264,aac","video/mp4","audio/mp4","video/webm;codecs=vp9,opus","video/webm;codecs=vp8,opus","video/webm;codecs=h264,opus","video/webm;codecs=vp9","video/webm;codecs=vp8","video/webm","audio/webm;codecs=opus","audio/webm"].filter(r=>MediaRecorder.isTypeSupported(r))}catch(e){return this.loggingService.catch("Error in RecorderService getSupportedMimeTypes: ",e),[]}}enableVideoEditor(){try{if(this.videoEditor$.value===!0)return;this.videoEditor$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableVideoEditor: ",e)}}disableVideoEditor(){try{if(this.videoEditor$.value===!1)return;this.videoEditor$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableVideoEditor: ",e)}}getVideoEditor$(){return this.videoEditor$.asObservable()}getVideoEditor(){return this.videoEditor$.value}enableVideoEditorTimelinePreview(){try{if(this.videoEditorTimelinePreview$.value===!0)return;this.videoEditorTimelinePreview$.next(!0)}catch(e){this.loggingService.catch("Error in RecorderService enableVideoEditorTimelinePreview: ",e)}}disableVideoEditorTimelinePreview(){try{if(this.videoEditorTimelinePreview$.value===!1)return;this.videoEditorTimelinePreview$.next(!1)}catch(e){this.loggingService.catch("Error in RecorderService disableVideoEditorTimelinePreview: ",e)}}getVideoEditorTimelinePreview$(){return this.videoEditorTimelinePreview$.asObservable()}getVideoEditorTimelinePreview(){return this.videoEditorTimelinePreview$.value}waitForChunksUpload(){return A(this,null,function*(){try{if(this.uploadPromises.length===0)return{};let e=this.uploadPromises.map(t=>t.promise);return yield Promise.all(e),this.chunkUrls$.value}catch(e){return this.loggingService.catch("Error in RecorderService waitForChunksUpload: ",e),this.chunkUrls$.value}})}getChunkUrls$(){return this.chunkUrls$.asObservable()}getChunkUrls(){return this.chunkUrls$.value}shouldUploadFullRecording(){return this.recorderAnnotationsResolverService.shouldUploadFullRecording()}setRecorderActionsService(e){try{this.recorderActionsService=e}catch(t){this.loggingService.catch("Error in RecorderAnnotationService setRecorderActionsService: ",t)}}enableSettingsEmbedded(){try{if(this.settingsEmbedded$.value===!0)return;this.settingsEmbedded$.next(!0)}catch(e){this.loggingService.catch("Error in RecorderService enableSettingsEmbedded: ",e)}}disableSettingsEmbedded(){try{if(this.settingsEmbedded$.value===!1)return;this.settingsEmbedded$.next(!1)}catch(e){this.loggingService.catch("Error in RecorderService disableSettingsEmbedded: ",e)}}getSettingsEmbedded$(){return this.settingsEmbedded$.asObservable()}getSettingsEmbedded(){return this.settingsEmbedded$.value}enableAutoOpenVideoEditor(){try{if(this.autoOpenVideoEditor$.value===!0)return;this.autoOpenVideoEditor$.next(!0)}catch(e){this.loggingService.catch("Error in RecorderService enableAutoOpenVideoEditor: ",e)}}disableAutoOpenVideoEditor(){try{if(this.autoOpenVideoEditor$.value===!1)return;this.autoOpenVideoEditor$.next(!1)}catch(e){this.loggingService.catch("Error in RecorderService disableAutoOpenVideoEditor: ",e)}}getAutoOpenVideoEditor$(){return this.autoOpenVideoEditor$.asObservable()}getAutoOpenVideoEditor(){return this.autoOpenVideoEditor$.value}enablePlayVideoInFullScreen(){try{if(this.playVideoInFullScreen$.value===!0)return;this.playVideoInFullScreen$.next(!0)}catch(e){this.loggingService.catch("Error in RecorderService enablePlayVideoInFullScreen: ",e)}}disablePlayVideoInFullScreen(){try{if(this.playVideoInFullScreen$.value===!1)return;this.playVideoInFullScreen$.next(!1)}catch(e){this.loggingService.catch("Error in RecorderService disablePlayVideoInFullScreen: ",e)}}getPlayVideoInFullScreen$(){return this.playVideoInFullScreen$.asObservable()}getPlayVideoInFullScreen(){return this.playVideoInFullScreen$.value}setRecordingQualityConstraints(e){try{let t=this.recordingQualityConstraints.value;t={other:{audio:y(y({},t.other?.audio),e.other?.audio),video:y(y({},t.other?.video),e.other?.video)},safari:{audio:y(y({},t.safari?.audio),e.safari?.audio),video:y(y({},t.safari?.video),e.safari?.video)}},this.recordingQualityConstraints.next(t)}catch(t){this.loggingService.catch("Error in RecorderService setRecordingQualityConstraints: ",t)}}setRecordingEncodingOptions(e){try{let t=this.recordingEncodingOptions.value;t={other:y(y({},t.other),e.other),safari:y(y({},t.safari),e.safari)},this.recordingEncodingOptions.next(t)}catch(t){this.loggingService.catch("Error in RecorderService setRecordingEncodingOptions: ",t)}}getVideoDuration(e){return A(this,null,function*(){return new Promise((t,r)=>{try{let a=URL.createObjectURL(e),c=document.createElement("video"),p=navigator.userAgent.includes("Firefox");p&&(c.preload="auto"),c.onloadedmetadata=()=>{let d=c.duration;p&&d>0&&d<10&&e.size>1e6?setTimeout(()=>{let m=c.duration;URL.revokeObjectURL(a),t(m)},1e3):(URL.revokeObjectURL(a),t(d))},c.onerror=d=>{URL.revokeObjectURL(a),r(d)},c.src=a,c.load()}catch(a){this.loggingService.catch("Error in RecorderService getVideoDuration: ",a),r(a)}})})}enableRecordingMic(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enableRecordingMic","color: green;"),this.recordingMicEnabled$.value===!0)return;this.recordingMicEnabled$.next(!0)}catch(e){this.loggingService.catch("Error in RecorderService enableRecordingMic: ",e)}}disableRecordingMic(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disableRecordingMic","color: green;"),this.recordingMicEnabled$.value===!1)return;this.recordingMicEnabled$.next(!1)}catch(e){this.loggingService.catch("Error in RecorderService disableRecordingMic: ",e)}}getRecordingMicEnabled$(){return this.recordingMicEnabled$.asObservable()}getRecordingMicEnabled(){return this.recordingMicEnabled$.value}setOnboardingTooltip(e){try{if(this.onboardingTooltip$.value===e)return;this.onboardingTooltip$.next(e)}catch(t){this.loggingService.catch("Error in RecorderService setOnboardingTooltip: ",t)}}enableOnboardingTooltip(){try{if(this.onboardingTooltip$.value===!0)return;this.onboardingTooltip$.next(!0)}catch(e){this.loggingService.catch("Error in RecorderService enableOnboardingTooltip: ",e)}}disableOnboardingTooltip(){try{if(this.onboardingTooltip$.value===!1)return;this.onboardingTooltip$.next(!1)}catch(e){this.loggingService.catch("Error in RecorderService disableOnboardingTooltip: ",e)}}getOnboardingTooltip$(){return this.onboardingTooltip$.asObservable()}getOnboardingTooltip(){return this.onboardingTooltip$.value}enableRetakeOnVideoEditor(){try{if(this.retakeOnVideoEditor$.value===!0)return;this.retakeOnVideoEditor$.next(!0)}catch(e){this.loggingService.catch("Error in RecorderService enableRetakeOnVideoEditor: ",e)}}disableRetakeOnVideoEditor(){try{if(this.retakeOnVideoEditor$.value===!1)return;this.retakeOnVideoEditor$.next(!1)}catch(e){this.loggingService.catch("Error in RecorderService disableRetakeOnVideoEditor: ",e)}}getRetakeOnVideoEditor$(){return this.retakeOnVideoEditor$.asObservable()}getRetakeOnVideoEditor(){return this.retakeOnVideoEditor$.value}getRecorderStream(){return this.recorderInitData?.stream}getScreenStream$(){return this.screenStreamSubject$.asObservable()}requestScreenPermission(){return A(this,null,function*(){try{if(!navigator.mediaDevices||!navigator.mediaDevices.getDisplayMedia)throw new Error("Screen sharing is not supported in this browser");let e=yield navigator.mediaDevices.getDisplayMedia({video:!0,audio:!0});if(!e.getVideoTracks()[0])throw new Error("No video track available in screen share stream");return e.getTracks().forEach(r=>{r.onended=()=>{this.screenStreamSubject$.next(null),this.clearRecording()}}),this.screenStreamSubject$.next(e),e}catch(e){return e.name==="NotAllowedError"||e.name==="PermissionDeniedError"?this.loggingService.catch("Screen sharing permission denied by user"):e.name==="NotFoundError"?this.loggingService.catch("No screen sharing device found"):e.name==="NotReadableError"||e.name==="OverconstrainedError"?this.loggingService.catch("Could not access screen sharing device"):this.loggingService.catch("Error in RecorderService requestScreenPermission: ",e),null}})}setMaxRecordingLength(e){try{this.loggingService.log("%c[WB] Calling FUNCTION: setMaxRecordingLength","color: green;"),this.maxRecordingLength=e}catch(t){this.loggingService.catch("Error in RecorderService setMaxRecordingLength: ",t)}}getMaxRecordingLength(){return this.maxRecordingLength}attemptFirefoxCanvasRecording(e){return A(this,null,function*(){try{let t=document.createElement("video");t.srcObject=e,t.muted=!0,t.autoplay=!0;let r=document.createElement("canvas"),a=r.getContext("2d");yield new Promise(m=>{t.onloadedmetadata=m}),r.width=t.videoWidth||1280,r.height=t.videoHeight||720;let c=r.captureStream(30);this.firefoxFallbackRecorder=new MediaRecorder(c,{mimeType:"video/webm;codecs=vp8",videoBitsPerSecond:this.recordingEncodingOptions.value.other?.videoBitsPerSecond||1e6});let p=[];this.firefoxFallbackRecorder.addEventListener("dataavailable",m=>{m.data.size>0&&p.push(m.data)}),this.firefoxFallbackRecorder.addEventListener("stop",()=>{if(p.length>0){let m=new Blob(p,{type:"video/webm"});this.chunks=p;let v=new St;v.blob=m,v.url=URL.createObjectURL(m),v.type=this.recorderInitData?.type,v.recordedTime=this.recorderDurationSubject$.value,this.recordedRawData$.next(v)}this.firefoxFallbackRecorder=void 0});let d=()=>{t.readyState>=2&&a&&a.drawImage(t,0,0,r.width,r.height),t.srcObject&&this.firefoxFallbackRecorder?.state==="recording"&&requestAnimationFrame(d)};this.firefoxFallbackRecorder.start(1e3),d()}catch(t){this.loggingService.catch("Error in RecorderService attemptFirefoxCanvasRecording: ",t)}})}getRecorderDataFromInitData(){return{type:this.recorderInitData?.type}}askDevicePermission(e){try{this.loggingService.log("%c[WB] Calling FUNCTION: askDevicePermission","color: green;"),navigator.mediaDevices.getUserMedia({audio:e.audio??!1,video:e.video??!1}).then(t=>{t.getTracks().forEach(r=>{r.stop()})}).catch(t=>{this.loggingService.catch("Error in RecorderService askDevicePermission: ",t)})}catch(t){this.loggingService.catch("Error in RecorderService askDevicePermission: ",t)}}openPictureInPicture(){return A(this,null,function*(){try{this.loggingService.log("%c[WB] Calling FUNCTION: openPictureInPicture","color: green;");let e=this.getRecorderStream();if(!e)return;yield this.pipService.openPictureInPicture(e,()=>this.stopRecording())}catch(e){this.loggingService.catch("Error in RecorderService openPictureInPicture: ",e)}})}enablePlaybackOnPreviewClick(){try{if(this.playbackOnPreviewClick$.value===!0)return;this.playbackOnPreviewClick$.next(!0)}catch(e){this.loggingService.catch("Error in RecorderService enablePlaybackOnPreviewClick: ",e)}}disablePlaybackOnPreviewClick(){try{if(this.playbackOnPreviewClick$.value===!1)return;this.playbackOnPreviewClick$.next(!1)}catch(e){this.loggingService.catch("Error in RecorderService disablePlaybackOnPreviewClick: ",e)}}getPlaybackOnPreviewClick$(){return this.playbackOnPreviewClick$.asObservable()}getPlaybackOnPreviewClick(){return this.playbackOnPreviewClick$.value}};o.\u0275fac=function(t){return new(t||o)(j(Xe),j(E),j(Fe),j(rt),j(it),j(qe),j(Ye),j(tt),j(Xi),j($e),j(Be))},o.\u0275prov=we({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();function Ka(i,o,n,e){try{return{audio:o,video:i?y(y({deviceId:e?.video?.deviceId?{exact:e.video.deviceId}:void 0},n),e?.video?.deviceId?{}:{facingMode:"user"}):!1}}catch{return{}}}function Ja(i,o={}){try{return y({deviceId:i?.audio?.deviceId?{exact:i.audio.deviceId}:void 0},o)}catch{return{}}}var en=(()=>{let o=class o{constructor(e,t,r,a,c){this.authService=e,this.loggingService=t,this.usersService=r,this.recorderAnnotationsResolverService=a,this.serviceBook=c,this.serviceBook.set(ti,this)}getUserIdsToResolveFromRecorders(e){try{let t=new Set;for(let r of e)r?.from?.userId&&t.add(r?.from?.userId),r?.transcription?.from?.userId&&t.add(r?.transcription?.from?.userId);return Array.from(t)}catch(t){return this.loggingService.catch("Error in RecorderUtilsService getUserIdsToResolveFromRecorders:",t),[]}}mergeRecorderWithUser(e){try{if(e?.from?.userId){let t=this.usersService.getUserById(e?.from?.userId);t&&(e.from=t)}if(e?.transcription?.from?.userId){let t=this.usersService.getUserById(e?.transcription?.from?.userId);t&&(e.transcription.from=t)}return e}catch(t){return this.loggingService.catch("Error in RecorderUtilsService mergeRecorderWithUser:",t),e}}formatRecorderData(e,t){try{return e.transcription=e?.transcription?U(y({},e.transcription),{lastUpdated:t}):void 0,this.usersService.userDataProviderAvailable()&&(e?.from?.userId&&(e.from={userId:e.from.userId}),e?.transcription?.from?.userId&&(e.transcription.from={userId:e.transcription.from.userId})),e}catch(r){return this.loggingService.catch("Error in RecorderUtilsService formatRecorderData:",r),e}}formatRecorderDataForWhisperTranscription(e){try{return this.usersService.userDataProviderAvailable()&&e?.fromUser?.userId&&(e.fromUser={userId:e.fromUser?.userId}),e}catch(t){return this.loggingService.catch("Error in RecorderUtilsService formatRecorderDataForWhisperTranscription:",t),e}}encryptRecorderAnnotation(e){return A(this,null,function*(){try{return yield Gt(e,this.authService.getUser()?.userId??"")}catch(t){this.loggingService.catch("Error in RecorderUtilsService encryptRecorderAnnotation:",t);return}})}stripRecorderAnnotationData({data:e,actionType:t}){try{if(!this.recorderAnnotationsResolverService.recorderAnnotationDataProviderAvailable())return{strippedData:null,originalData:e};let r=e?.annotationId;if(!r)return{strippedData:null,originalData:e};let a=this.recorderAnnotationsResolverService.getAdditionalFields(),c=this.recorderAnnotationsResolverService.getFieldsToRemove(),p={annotationId:r,metadata:Ue(e.metadata??{})};if(e?.from&&(p.from=JSON.parse(JSON.stringify(e.from))),e?.transcription&&(p.transcription=JSON.parse(JSON.stringify(e.transcription))),e?.attachment!==void 0&&(p.attachment=e.attachment?JSON.parse(JSON.stringify(e.attachment)):null),e?.attachments?.length&&(p.attachments=JSON.parse(JSON.stringify(e.attachments))),e?.chunkUrls&&Object.keys(e.chunkUrls).length>0&&(p.chunkUrls=JSON.parse(JSON.stringify(e.chunkUrls))),e?.recordingEditVersions){let m={};for(let[v,_]of Object.entries(e.recordingEditVersions)){let x=Number(v),I={};_?.from&&(I.from=JSON.parse(JSON.stringify(_.from))),_?.attachment!==void 0&&(I.attachment=_.attachment?JSON.parse(JSON.stringify(_.attachment)):null),_?.attachments?.length&&(I.attachments=JSON.parse(JSON.stringify(_.attachments))),_?.transcription&&(I.transcription=JSON.parse(JSON.stringify(_.transcription))),Object.keys(I).length>0&&(m[x]=I)}Object.keys(m).length>0&&(p.recordingEditVersions=m)}if(e?.isUrlAvailable!==void 0&&(p.isUrlAvailable=e.isUrlAvailable),a?.length)for(let m of a)e?.[m]!==void 0&&(p[m]=JSON.parse(JSON.stringify(e[m])));if(c?.length>0)for(let m of c)e?.[m]!==void 0&&(p[m]=e[m],delete e[m]);if(e?.from?.userId&&(e.from={userId:e.from.userId}),delete e.transcription,e?.attachments?.length&&(e.attachments=e.attachments.map(m=>({attachmentId:m?.attachmentId,name:m?.name,bucketPath:m?.bucketPath}))),e.attachment=null,e?.chunkUrls&&(e.chunkUrls={}),e?.recordingEditVersions)for(let[,m]of Object.entries(e.recordingEditVersions))m?.from?.userId&&(m.from={userId:m.from.userId}),m.attachment=null,m?.attachments?.length&&(m.attachments=m.attachments.map(v=>({attachmentId:v?.attachmentId,name:v?.name,bucketPath:v?.bucketPath}))),delete m.transcription;e.isRecorderResolverUsed=!0;let d;return t===_e.ADDED?d=Je.RECORDER_ANNOTATION_ADD:t===_e.UPDATED?d=Je.RECORDER_ANNOTATION_UPDATE:t===_e.DELETED&&(d=Je.RECORDER_ANNOTATION_DELETE),{strippedData:{[r]:p},originalData:e,eventType:d}}catch(r){return this.loggingService.catch("Error in RecorderUtilsService stripRecorderAnnotationData:",r),{strippedData:null,originalData:e}}}mergeStrippedDataWithRecorderAnnotation(e){try{if(!this.recorderAnnotationsResolverService.recorderAnnotationDataProviderAvailable()||!e?.annotationId)return e;let t=this.recorderAnnotationsResolverService.getAnnotationById(e.annotationId);if(!t)return e;let r=this.recorderAnnotationsResolverService.getFieldsToRemove();if(r?.length>0)for(let a of r)t?.[a]!==void 0&&(e[a]=t[a]);if(t.from&&(e.from=t.from),t.transcription&&(e.transcription=t.transcription),t.attachments?.length&&(e.attachments=t.attachments),t.attachment!==void 0&&(e.attachment=t.attachment),t.chunkUrls&&Object.keys(t.chunkUrls).length>0&&(e.chunkUrls=t.chunkUrls),t.recordingEditVersions&&e.recordingEditVersions)for(let[a,c]of Object.entries(t.recordingEditVersions)){let p=Number(a);e.recordingEditVersions[p]&&(c.from&&(e.recordingEditVersions[p].from=c.from),c.attachment!==void 0&&(e.recordingEditVersions[p].attachment=c.attachment),c.attachments?.length&&(e.recordingEditVersions[p].attachments=c.attachments),c.transcription&&(e.recordingEditVersions[p].transcription=c.transcription))}return e}catch(t){return this.loggingService.catch("Error in RecorderUtilsService mergeStrippedDataWithRecorderAnnotation:",t),e}}};o.\u0275fac=function(t){return new(t||o)(j(et),j(E),j(oi),j($e),j(Be))},o.\u0275prov=we({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();var tn=(()=>{let o=class o{constructor(e,t){this.httpClient=e,this.loggingService=t,this.fileContentMap$=new J({})}getFileContent(e){try{let t=Ne(e);return this.fileContentMap$.value[t]?Z(this.fileContentMap$.value[t]):this.httpClient.get(e,{responseType:"text"}).pipe(ne(r=>(this.fileContentMap$.next(U(y({},this.fileContentMap$.value),{[t]:r})),r)))}catch(t){return this.loggingService.catch("Error in TranscriptionService saveRecorderToDb: ",t),Z(null)}}getVttFileTextToArray(e){try{let p=[],d=e.split(`
93
- `);for(var t=0;t<d.length;t++)if(d[t].indexOf("-->")!==-1){var r=d[t].split(" --> ")[0],a=d[t].split(" --> ")[1],c=d[t+1];p.push({startTime:r,endTime:a,startTimeInSeconds:this.getTimeInSecondsFromVttTime(r),endTimeInSeconds:this.getTimeInSecondsFromVttTime(a),text:c})}return p}catch(p){return this.loggingService.catch("Error in TranscriptionService getVttFileTextToArray: ",p),[]}}getTimeInSecondsFromVttTime(e){try{let t=e.split(":"),r=0;t.length===3&&(r=parseInt(t[0]),t.shift());let a=parseInt(t[0]),c=parseInt(t[1].split(".")[0]),p=parseInt(t[1].split(".")[1]);return((r*60*60+a*60+c)*1e3+p)/1e3}catch(t){return this.loggingService.catch("Error in TranscriptionService getTimeInSecondsFromVttTime: ",t),0}}};o.\u0275fac=function(t){return new(t||o)(j(Bt),j(E))},o.\u0275prov=we({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();var Pd=(()=>{let o=class o{constructor(e,t,r,a,c,p,d,m,v,_,x,I,H,G,ue,me,ye,fe,Se,ie,ve,Re,Pt){this.analyticsService=e,this.configService=t,this.docService=r,this.databaseService=a,this.commonDbService=c,this.authService=p,this.domService=d,this.afAuth=m,this.iamService=v,this.functions=_,this.avatarService=x,this.contactService=I,this.storageService=H,this.dialog=G,this.loggingService=ue,this.notificationService=me,this.transcriptionService=ye,this.recorderService=fe,this.recorderUtilsService=Se,this.userPermissionService=ie,this.recorderAnnotationsResolverService=ve,this.attachmentResolverService=Re,this.serviceBook=Pt,this.endpointsService=At(ni),this.recorderAnnotationById$=new J({}),this.documentPaths=null,this.allowedElementIds$=new J([]),this.addRecorderMode$=new J(!1),this.recorderContainerDarkMode$=new J(!1),this.recordingTranscriptionEnabled$=new J(!0),this.draftRecordings$=new J([]),this.recorderNotesFound$=new J(!1),this.recordedData=null,this.videoEditorAutoOpen$=new J({}),this.commentService=null,this.serviceBook.set(ei,this),this.getAllRecorderAnnotations().subscribe(W=>{}),this.loggingService.log("%c[WB] Creating CLASS: RecorderAnnotationService","color: blue;"),this.databaseService.getDb().pipe(xe(W=>!!W),ke(1)).subscribe(W=>{W&&this.getDocumentPaths()},W=>{this.loggingService.catch("Error in RecorderAnnotationService getDb subscription: ",W)}),this.domService.onWindowPointerMove$().subscribe(W=>{if(this.addRecorderMode$.value){this.highlightElement&&this.domService.removeHighlightFromElement(this.highlightElement);let Oe=this.domService.getBackgroundElement(W.clientX,W.clientY);Oe&&(this.isElementInsideAllowedElements(Oe)?_t(W.target)?this.domService.removeClassFromElement(document.body,"show-pin-cursor"):(this.domService.addClassToElement(document.body,"show-pin-cursor"),this.highlightElement=Oe):this.domService.removeClassFromElement(document.body,"show-pin-cursor"))}},W=>{this.loggingService.catch("Error in RecorderAnnotationService onWindowPointerMove$ subscription: ",W)}),this.domService.onWindowKeyupEsc$().subscribe(W=>{this.addRecorderMode$.value&&this.disableAddRecorderMode()},W=>{this.loggingService.catch("Error in RecorderAnnotationService onWindowKeyupEsc$ subscription: ",W)}),this.domService.onDocumentClick$().subscribe(W=>{if(W&&this.addRecorderMode$.value){if(W.preventDefault(),W.stopPropagation(),!_t(W.target)){let Oe=this.domService.getBackgroundElement(W.clientX,W.clientY);Oe&&this.isElementInsideAllowedElements(Oe)}this.disableAddRecorderMode()}},W=>{this.loggingService.catch("Error in RecorderAnnotationService onDocumentClick$ subscription: ",W)}),this.addRecorderMode$.subscribe(W=>{this.highlightElement&&this.domService.removeHighlightFromElement(this.highlightElement),W?this.domService.addClassToElement(document.body,"snippyly-add-recorder-mode"):(this.domService.removeClassFromElement(document.body,"snippyly-add-recorder-mode"),this.domService.removeClassFromElement(document.body,"show-pin-cursor"))},W=>{this.loggingService.catch("Error in RecorderAnnotationService addRecorderMode$ subscription: ",W)}),this.domService.onWindowKeyupBackspace$().subscribe(W=>{this.deleteRecorderPinAnnotations()},W=>{this.loggingService.catch("Error in RecorderAnnotationService onWindowKeyupBackspace$ subscription: ",W)}),this.domService.onWindowKeyupDelete$().subscribe(W=>{this.deleteRecorderPinAnnotations()},W=>{this.loggingService.catch("Error in RecorderAnnotationService onWindowKeyupDelete$ subscription: ",W)}),this.recorderService.onRecordedData().subscribe(W=>{this.recordedData=W},W=>{this.loggingService.catch("Error in RecorderAnnotationService onRecordedData subscription: ",W)}),this.domService.getDeleteCommmentAnnotations$().subscribe(W=>{W?.length&&W.forEach(Oe=>A(this,null,function*(){}))},W=>{this.loggingService.catch("Error in RecorderAnnotationService onWindowKeyupDelete$ subscription: ",W)})}clearCache(){this.loggingService.log("%c[WB] Calling FUNCTION: clearCache in RecorderAnnotationService","color: green;");try{this.recorderAnnotationById$.next({}),this.documentPaths=null,this.allowedElementIds$.next([]),this.addRecorderMode$.next(!1),this.highlightElement=null}catch(e){this.loggingService.catch("Error in RecorderAnnotationService clearCache: ",e)}}getDocumentPaths(){this.loggingService.log("%c[WB] Calling FUNCTION: getDocumentPaths","color: green;");try{this.docService.getDocumentPaths$().pipe(ze(e=>{this.documentPaths=e})).subscribe(()=>{},e=>{this.loggingService.catch("Error in getDocumentPaths subscription: ",e)})}catch(e){this.loggingService.catch("Error in CursorService getDocumentPaths: ",e)}}setCommentService(e){this.loggingService.log("%c[WB] Calling FUNCTION: setCommentService","color: green;");try{this.commentService=e}catch(t){this.loggingService.catch("Error in RecorderAnnotationService setCommentService: ",t)}}getAnonymousAvatarImage(){return this.loggingService.log("%c[WB] Calling FUNCTION: getAnonymousAvatarImage","color: green;"),this.avatarService.generateUserImage()}setAllowedElementIds(e){this.allowedElementIds$.next(e||[])}getAllowedElementIds(){return this.allowedElementIds$.asObservable()}getDraftRecordings$(){return this.draftRecordings$.asObservable()}getRecorderDataByRecorderId(e){try{return this.recorderAnnotationById$.pipe(ne(()=>this.getAnnotationById(e)),de(t=>A(this,null,function*(){return t?yield this.createRecorderData(t,!0):void 0})))}catch(t){return this.loggingService.catch("Error in RecorderAnnotationService getRecorderDataByRecorderId: ",t),Z(void 0)}}getRecorderDataByRecorderIds(e){return A(this,null,function*(){try{let t={};return yield Promise.all(e.recorderIds.map(r=>A(this,null,function*(){let a=this.getAnnotationById(r);if(!a)return;let c=yield this.createRecorderData(a,!0);c&&(t[r]=c)}))),{data:Object.keys(t).length>0?t:null}}catch(t){return this.loggingService.catch("Error in RecorderAnnotationService getRecorderDataByRecorderIds: ",t),{data:null}}})}fetchRecorderDataByRecorderIds(e){return A(this,null,function*(){try{let t=this.recorderAnnotationById$.value,r=[],a=Object.values(t);return e?.recorderIds?.length&&(a=a.filter(c=>e.recorderIds.includes(c.annotationId))),a.length===0?[]:(yield Promise.all(a.map(c=>A(this,null,function*(){if(!c)return;let p=yield this.createRecorderData(c,!0);p&&r.push(p)}))),r)}catch(t){return this.loggingService.catch("Error in RecorderAnnotationService fetchRecorderDataByRecorderIds: ",t),[]}})}deleteRecorderDataByRecorderIds(e){return A(this,null,function*(){try{let t=this.recorderAnnotationById$.value,r=[],a=Object.values(t),c=[];return e?.recorderIds?.length&&(c=a.filter(p=>e.recorderIds.includes(p.annotationId))),c.length===0?[]:(yield Promise.all(c.map(p=>A(this,null,function*(){if(!p)return;let d=yield this.createRecorderData(p,!0);yield this.deleteRecorderPinAnnotation(p),d&&r.push(d)}))),r)}catch(t){return this.loggingService.catch("Error in RecorderAnnotationService deleteRecorderDataByRecorderIds: ",t),[]}})}getRecordings(e){try{return this.recorderAnnotationById$.pipe(de(t=>A(this,null,function*(){let r=[],a=Object.values(t);return e?.recorderIds?.length&&(a=a.filter(c=>e.recorderIds.includes(c.annotationId))),a.length===0?[]:(yield Promise.all(a.map(c=>A(this,null,function*(){if(!c)return;let p=yield this.createRecorderData(c,!0);p&&r.push(p)}))),r)})),Le(t=>(this.loggingService.catch("Error in RecorderAnnotationService getRecordings: ",t),Z([]))))}catch(t){return this.loggingService.catch("Error in RecorderAnnotationService getRecordings: ",t),Z([])}}setRecorderActionsService(e){try{this.recorderActionsService=e}catch(t){this.loggingService.catch("Error in RecorderAnnotationService setRecorderActionsService: ",t)}}getVttFileTextToArray(e){try{return this.transcriptionService.getVttFileTextToArray(e)}catch(t){this.loggingService.catch("Error in RecorderAnnotationService getVttFileTextToArray: ",t)}}getAllRecorderAnnotations(e,t,r){this.loggingService.log("%c[WB] Calling FUNCTION: getAllRecorderAnnotations","color: green;");let a,c;try{if(e&&(c=Ne(e)),t&&typeof t=="object"){let p=Ht(t);a=Ne(JSON.stringify(p))}}catch(p){this.loggingService.catch("Error in RecorderAnnotationService getAllRecorderAnnotations: ",p)}return this.authService.getAuthState$().pipe(xe(p=>!!p),de(p=>this.isFeatureAllowed({firebaseUser:p,annotations:[],filteredAnnotations:[]})),de(p=>p.featureAllowed?this.iamService.isUserAllowed$().pipe(ne(d=>(p.featureAllowed=d,p))):Z(p)),de(p=>p.featureAllowed?this.authService.isPlanExpired$().pipe(ne(d=>(p.featureAllowed=!d,p))):Z(p)),de(p=>p.featureAllowed?Z(p).pipe(de(d=>this.docService.getDocumentPaths$().pipe(ne(m=>(this.documentPaths=m,d.documentPaths=m,d)))),de(d=>c?this.getDataFromDocumentIds([c]).pipe(ne(m=>(d.annotations=m||[],y({},d)))):this.docService.getDocumentIds$().pipe(de(m=>{let v=m?.length>0?m.map(_=>_.documentId):[this.documentPaths?.documentId??""];return this.getDataFromDocumentIds(v).pipe(ne(_=>(d.annotations=_||[],y({},d))))}))),de(d=>this.docService.getLocation$().pipe(ne(m=>(d.location=m,d)))),de(d=>this.docService.getLocations$().pipe(ne(m=>(d.customLocations=m,d)))),ne(d=>{if(d.filteredAnnotations=[],c&&!a)return d.filteredAnnotations=d.annotations?.slice(),d;{let m=[];return a?m.push(a):(m.push(d?.location?.locationId),m.push(...Object.values(d?.customLocations||[]).map(v=>v.locationId))),d.filteredAnnotations=this.filterAnnotationsByLocationIds(d?.annotations,m),d}}),de(d=>r?Z(d):d?.annotations?.length?this.domService.onWindowResize$().pipe(ne(()=>d)):Z(d)),de(d=>r?Z(d):d?.annotations?.length?this.domService.onDomChange$("RecorderAnnotationService getAllRecorderAnnotations").pipe(ne(()=>d)):Z(d)),ne(d=>{let m=[];return d?.filteredAnnotations?.forEach(v=>{this.calculateRecorderAnnotationPosition(v),v?.targetElement||m.push(v)}),this.draftRecordings$.next(m),d}),de(d=>d?.filteredAnnotations?Z(d?.filteredAnnotations||[]):Z([]))):Z([])),ht(Xt))}isFeatureAllowed(e){return this.configService.getConfig$().pipe(xe(t=>!!t),ne(t=>U(y({},e),{config:t})),de(t=>this.authService.getUser$().pipe(ne(r=>U(y({},t),{user:r})))),de(t=>Wt(t.config,t.user,Ae.RECORDER)?Z(U(y({},t),{featureAllowed:!0})):(this.loggingService.warn("Recorder feature is not allowed."),Z(U(y({},t),{featureAllowed:!1})))),ht((t,r)=>t?.featureAllowed===r?.featureAllowed))}getDataFromDocumentIds(e,t){return this.getDataFromDocuments({documentIds:e,filters:t})}getDataFromDocuments(e){if(this.configService?.getApiKey()){let{documentIds:t,filters:r}=e;if(t?.some(d=>!d)||!this.documentPaths)return Z([]);let a=this.docService.getDocumentPaths()?.veltFolderId,c=Z([]),p={useCollectionGroup:!0,isCollection:!0,useQuery:!0};if(this.commonDbService.shouldUseFirestore()||(p.documentId=t?.length?t[0]:void 0,p.organizationId=this.documentPaths?.organizationId),this.userPermissionService?.getIsContextEnabled()){let d=[K.DEFAULT_VELT_CONTEXT,...this.docService.getProcessedDocContext()],m=[];for(let v=0;v<(d?.length??0);v+=K.LISTENER_CONTEXT_BATCH_SIZE)m.push(d?.slice(v,v+K.LISTENER_CONTEXT_BATCH_SIZE)??[]);c=ut(m.map(v=>this.commonDbService.dbListener({feature:"allRecorders",properties:U(y({},p),{firestoreQuery:[Dt(Ie("metadata.apiKey","==",this.configService?.getApiKey()),Ie("metadata.documentId","in",t),Ie("metadata.organizationId","==",this.documentPaths?.organizationId),...a?[Ie("metadata.veltFolderId","==",a)]:[],...v?.length?[Ie("context.accessFields","array-contains-any",v)]:[])]})}).pipe(ft()))).pipe(ne(v=>wt(v)))}else{let d=[];for(let m=0;m<(t?.length??0);m+=K.LISTENER_BATCH_SIZE)d.push(t?.slice(m,m+K.LISTENER_BATCH_SIZE)??[]);c=ut(d.map(m=>this.commonDbService.dbListener({feature:"allRecorders",properties:U(y({},p),{firestoreQuery:[Dt(Ie("metadata.apiKey","==",this.configService?.getApiKey()),Ie("metadata.documentId","in",m),Ie("metadata.organizationId","==",this.documentPaths?.organizationId),...a?[Ie("metadata.veltFolderId","==",a)]:[])]})}).pipe(ft()))).pipe(ne(m=>wt(m)))}return c.pipe(ne(d=>({data:d?.data,operation:d?.operation})),ne(({data:d,operation:m})=>{let v=[];return d&&(v=Object.values(d).filter(_=>typeof _=="object")),{data:v,operation:m}}),ne(({data:d,operation:m})=>{if(!t)return{data:d,documentMap:{},operation:m};let v=d.reduce((_,x)=>{let I=x.metadata?.documentId;return I&&(_[I]||(_[I]=[]),_[I].push(x)),_},{});return{data:d,documentMap:v,operation:m}}),ne(({data:d,documentMap:m,operation:v})=>{if(!r)if(v?.type==="removed"){if(v?.ids?.length){let _=this.recorderAnnotationById$.value;v?.ids?.forEach(x=>{delete _?.[x]}),this.recorderAnnotationById$.next(_)}}else Object.entries(m).forEach(([_,x])=>{this.setRecorderAnnotationsByOrganizationIdAndDocumentId({organizationId:this.documentPaths?.organizationId,documentId:_,annotations:x})});return d}),Le(d=>(this.loggingService.catch("Error in RecorderAnnotationService getDataFromDocumentId: ",d),Z([]))))}else return Z([])}setRecorderAnnotationsByOrganizationIdAndDocumentId({organizationId:e,documentId:t,annotations:r,queryHash:a}){try{if(t){e||(e=K.NO_ORGANIZATION_ID),a||(a=K.DEFAULT_QUERY_HASH);let c={};r?.forEach(d=>{d?.annotationId&&(c[d?.annotationId]=d)});let p=y(y({},this.recorderAnnotationById$.value),c);this.recorderAnnotationById$.next(p)}}catch(c){this.loggingService.catch("Error in RecorderAnnotationService setRecorderAnnotationsByOrganizationIdAndDocumentId:",c)}}filterAnnotationsByLocationIds(e,t){try{return e.filter(r=>t.includes(r.locationId))}catch(r){return this.loggingService.catch("Error in RecorderAnnotationService filterAnnotationsByLocations:",r),[]}}calculateRecorderAnnotationPosition(e){try{if(e.targetElement){let t=this.domService.getXPath(e.targetElement?.xpath);if(t){let r=t.iterateNext();if(r&&Ze(r)){let a=r.getBoundingClientRect();if(a&&a.width&&a.height){let{height:c,width:p}=Qt(r);e.position={top:c*e.targetElement.topPercentage/100,left:p*e.targetElement.leftPercentage/100}}else e.position=null}else e.position=null}else e.position=null}}catch(t){this.loggingService.catch("Error in RecorderAnnotationService calculateRecorderAnnotationPosition:",t)}}getAnnotationById(e,t){try{let r=this.recorderAnnotationById$.value?.[e];if(r){let{documentId:a,organizationId:c}=t||{};if(a&&r.metadata?.documentId!==a||c&&r.metadata?.organizationId!==c)return}return r}catch(r){this.loggingService.catch("Error in RecorderAnnotationService getAnnotationById: ",r);return}}getBaseMetadataFromRecorderAnnotationId(e){try{let t=this.recorderAnnotationById$.value?.[e];if(t)return t.metadata}catch(t){this.loggingService.catch("Error in RecorderAnnotationService getBaseMetadataFromRecorderAnnotationId: ",t)}}getRecorderAnnotationById(e,t){return this.recorderAnnotationById$.pipe(de(()=>{let r=this.getAnnotationById(e,t);return r?Z(r):Z(null)}),Le(r=>(this.loggingService.catch("Error in RecorderAnnotationService getCommentAnnotationById: ",r),Z(null))))}getRecorderAnnotationsByOrganizationIdAndDocumentId({organizationId:e,documentId:t}){try{let r={};return Object.values(this.recorderAnnotationById$.value).forEach(a=>{a?.metadata?.documentId==t&&a?.metadata?.organizationId==e&&(r[a?.annotationId]=a)}),Object.values(r)}catch(r){return this.loggingService.catch("Error in RecorderAnnotationService getRecorderAnnotationsByOrganizationIdAndDocumentId:",r),[]}}setLocationToRecorderAnnotation(e){try{let t=this.docService.getLocation();t?(e.locationId=t.locationId,e.location=t.location):(delete e.locationId,delete e.location);try{if(e.targetElement?.xpath){let r=this.domService.getElementFromXPath(e.targetElement.xpath),a=this.docService.getAdditionLocationFromElement(r);if(a){let c=this.docService.addLocation({location:a,source:"internal"});c?.[0]&&(e.locationId=c[0].locationId,e.location=c[0].location)}}}catch{}}catch(t){this.loggingService.catch("Error in RecorderAnnotationService setLocationToRecorderAnnotation:",t)}}addRecorder(e,t,r){this.loggingService.log("%c[WB] Calling FUNCTION: addRecorder","color: green;");try{let a=this.authService.getUser();if(a){if(a.isReadOnly||a.isAnonymous)return this.loggingService.catch("Anonymous/Readonly users cannot add recorders."),Z(null);{t.from=a,t.color=K.DEFAULT_ANNOTATION_COLOR,t.lastUpdated=this.timestamp;let{topPositionX:c,topPositionY:p}=this.domService.getTopLeftPosition();t.positionX=c,t.positionY=p;let d=this.domService.getCurrentWindowSizeValue();if(t.screenWidth=d.screenWidth,t.screenHeight=d.screenHeight,t.screenScrollHeight=d.screenScrollHeight,t.recorderedElementPath="",e&&(t.targetElement=this.domService.getTargetElementForCursorPosition(e)),t?.targetElement?.xpath){let m=this.domService.getXPath(t.targetElement.xpath);if(m){let v=m.iterateNext();v&&(Ze(v)||(t.targetElement=null))}}return this.setLocationToRecorderAnnotation(t),t.pageInfo=Ct(),t.pageInfo&&(t.pageInfo.screenWidth=this.domService.getCurrentWindowSizeValue()?.screenWidth),this.saveRecorderToDb(t,r)}}else return Z(null)}catch(a){return this.loggingService.catch("Error in RecorderAnnotationService addRecorder: ",a),Z(null)}}saveRecorderToDb(e,t){this.loggingService.log("%c[WB] Calling FUNCTION: saveRecorderToDb","color: green;");try{return this.authService.getUser()&&this.authService.isFeatureAllowed(Ae.RECORDER)?this.docService.getDocumentPaths$().pipe(xe(r=>!!r),ke(1),de(r=>(this.documentPaths=r,this.loggingService.log(this.documentPaths),this.databaseService.getDb().pipe(xe(a=>!!a),ke(1),de(a=>A(this,null,function*(){if(this.documentPaths?.recorder){e.annotationId=this.commonDbService.generateDocumentId(),e.pageInfo&&(e.pageInfo.recorderUrl=this.generateRecorderUrl(e));let c=JSON.parse(JSON.stringify(e));if(c.position=null,this.recorderAnnotationsResolverService.recorderAnnotationDataProviderAvailable()||delete c?.isUrlAvailable,!c?.metadata?.documentId){c?.metadata||(c.metadata={});let v=this.docService.getBaseMetadata("recorder",{commentAnnotationId:e.commentAnnotationId});c.metadata=y(y({},c?.metadata),v)}let{documentId:p,organizationId:d}=c?.metadata||{};if(e.commentAnnotationId){let v=this.commentService?.getAnnotationById(e.commentAnnotationId??"");if(v?.context?.access&&v?.context?.accessFields){if(!this.userPermissionService?.hasUserContextAccess({userId:e.from?.userId,accessFields:v.context.accessFields}))return this.loggingService.catch("User does not have context access to add recorder annotation.",void 0,void 0,!0),null;v?.visibilityConfig?.type==="restricted"||v?.visibilityConfig?.type==="organizationPrivate"||v.context.accessFields.some(x=>zt(x))||(c.context={access:v.context.access,accessFields:v.context.accessFields})}}let m={annotationData:c,actionType:_e.ADDED,notificationSource:"recorder"};if(yield new Promise((v,_)=>A(this,null,function*(){yield this.commonDbService.setData({feature:"recorder",properties:{id:e.annotationId,documentId:p,organizationId:d},data:JSON.parse(JSON.stringify(c)),extraData:m,callback:()=>{v(!0)},errorCallback:x=>{_(x)}})})),this.analyticsService.trackEvent(Qe.Events.Recording.RECORDING_ADDED,{annotationId:e.annotationId,recorderType:e.recordingType,recorderMode:e.mode,recorderTime:e?.recordedTime?.duration,recorderSize:e?.attachments?.length?e?.attachments[0]?.size:e?.attachment?.size,sourceFeature:t||"recording"}),this.setVideoEditorAutoOpen({[e.annotationId]:!0}),t==="recording"){let v=yield this.createRecorderData(c,!1);v&&this.recorderActionsService?.onRecordingDoneLocal(v)}return this.recorderAnnotationsResolverService.recorderAnnotationDataProviderAvailable()||this.processRecording(e,"recording","merge"),this.updateNotificationsDatabase(e,_e.ADDED),e}else return null})))))):Z(null)}catch(r){return this.loggingService.catch("Error in RecorderAnnotationService saveRecorderToDb: ",r),Z(null)}}processRecording(e,t,r){return A(this,null,function*(){try{let a=It(this.functions,bt({url:this.endpointsService.getCloudFunctionUrl("processRecording"),apiProxyDomain:this.configService?.getApiProxyDomain()}),{timeout:36e5}),c=this.docService.getDocumentPaths();e?.metadata?.documentId&&(c=new Rt({apiKey:this.configService.getApiKey(),clientDocumentId:e.metadata.clientDocumentId,clientOrganizationId:e.metadata.clientOrganizationId,documentId:e.metadata.documentId,organizationId:e.metadata.organizationId}));let p={databaseUrl:this.authService.getFirebaseConfig()?.firebaseOptions?.databaseURL,entirePath:c?.recorder+e?.annotationId,fromUser:this.authService.getUser(),clientOrganizationId:c?.clientOrganizationId,clientDocumentId:c?.clientDocumentId,apiKey:this.configService.getApiKey(),sdkVersion:yt(),sdkType:this.configService.getSdkType(),useFirestore:this.commonDbService.shouldUseFirestore(),storageBucket:this.authService.getFirebaseConfig()?.firebaseOptions?.storageBucket,documentPath:c?.recorder,annotationId:e?.annotationId,sourceFeature:t||"recording",annotationData:e,skipMerge:!0,transcriptionEnabled:this.getRecordingTranscriptionEnabled(),type:r,returnType:"transcription",generatePreviewImages:this.recorderService.getVideoEditor()&&this.recorderService.getVideoEditorTimelinePreview()};if(p?.useFirestore){let H=yield this.recorderUtilsService.encryptRecorderAnnotation(e);p.annotationData=H}let d=this.documentPaths?.organizationId,m=this.documentPaths?.documentId;e?.metadata?.documentId&&(m=e.metadata.documentId,d=e.metadata.organizationId);let v=`${this.configService.getApiKey()}/${K.FIREBASE_PARTIAL_PATH_DOCS}/${m}/${K.FIREBASE_PARTIAL_PATH_RECORDER}`;d&&(v=`${this.configService.getApiKey()}/${K.FIREBASE_PARTIAL_PATH_ORGANIZATIONS}/${d}/${K.FIREBASE_PARTIAL_PATH_DOCS}/${m}/${K.FIREBASE_PARTIAL_PATH_RECORDER}`),p.bucketPath=v;let _;try{_=yield a(p)}catch(H){H?.details?.type==="recording"&&this.recorderActionsService?.onError({type:"recordingFailed",message:"Recording failed",recorderId:H.details.recorderId}),H?.details?.type==="transcription"&&this.recorderActionsService?.onError({type:"transcriptionFailed",message:"Transcription failed",recorderId:H.details.recorderId}),this.loggingService.catch("Error in RecorderAnnotationService processRecording: ",H)}let x=this.getAnnotationById(e?.annotationId);if(!x)return;let I=yield this.createRecorderData(x,!1);if(I){if(_?.data?.transcriptedText&&(I.transcription.contentSummary=_.data.transcriptedText),_?.data?.vttUrl)try{let H=yield this.transcriptionService.getFileContent(_.data.vttUrl).toPromise();H&&(I.transcription.transcriptSegments=this.getVttFileTextToArray(H),I.transcription.vttFileUrl=_.data.vttUrl),I?.assets?.length&&I.assets.forEach(G=>{G.transcription=I.transcription}),I?.assetsAllVersions?.length&&(I.assetsAllVersions[0].transcription=I.transcription),this.recorderActionsService?.onTranscriptionDone(I)}catch(H){this.loggingService.catch("Error fetching VTT content: ",H)}x?.attachments?.length&&this.recordedData&&(this.recordedData.videoUrl=x.attachments[0].url),t==="recording"&&this.recorderActionsService?.onRecordingDone(I)}this.recordedData&&this.recorderService.setRecordedData(this.recordedData)}catch(a){this.loggingService.catch("Error in RecorderAnnotationService processRecording: ",a)}})}getDocumentIdAndOrganizationIdFromRecorderAnnotation(e){try{return{documentId:e?.metadata?.documentId,organizationId:e?.metadata?.organizationId}}catch(t){return this.loggingService.catch("Error in RecorderAnnotationService getDocumentIdAndOrganizationIdFromRecorderAnnotation: ",t),{}}}createRecorderData(e,t=!1){return A(this,null,function*(){try{if(!e)return null;let r=Ue(e.metadata||{}),a=qt(e.from),c={recorderId:e.annotationId||"",from:a,assets:[],metadata:r,assetsAllVersions:[],transcription:{transcriptSegments:[],vttFileUrl:"",contentSummary:""}},p=e;e.latestVersion&&e.recordingEditVersions?.[e.latestVersion]&&(p=e.recordingEditVersions[e.latestVersion]);let d=v=>A(this,null,function*(){let _={transcriptSegments:[],vttFileUrl:"",contentSummary:v?.transcription?.transcriptedText||""};if(t&&v?.transcription?.vttUrl)try{let x=yield this.transcriptionService.getFileContent(v.transcription.vttUrl).toPromise();x&&(_.transcriptSegments=this.getVttFileTextToArray(x),_.vttFileUrl=v.transcription.vttUrl)}catch(x){this.loggingService.catch("Error fetching VTT content: ",x)}return _}),m=yield d(p);if(c.transcription=m,p?.attachments?.length)for(let v of p.attachments)v?.url&&c.assets.push({version:e.latestVersion||1,url:v.url,mimeType:v.mimeType,fileName:v.name,fileSizeInBytes:v.size,fileFormat:v.type,transcription:y({},m),thumbnailUrl:e.attachments?.[0]?.thumbnail});if(e.recordingEditVersions){let v=Object.entries(e.recordingEditVersions).map(H=>A(this,[H],function*([x,I]){let G=parseInt(x),ue=yield d(I),me=I?.attachments?.[0]||I?.attachment;return{version:G,url:me?.url,mimeType:me?.mimeType,fileName:me?.name,fileSizeInBytes:me?.size,fileFormat:me?.type,transcription:ue,thumbnailUrl:I?.attachments?.[0]?.thumbnail}})),_=yield Promise.all(v);c.assetsAllVersions=_.filter(x=>x.url)}else c.assetsAllVersions=[...c.assets];return c}catch(r){return this.loggingService.catch("Error in RecorderAnnotationService createRecorderData: ",r),null}})}updateRecorder(e,t=!1,r){try{r&&this.setLocationToRecorderAnnotation(e),t&&this.updateNotificationsDatabase(e,_e.UPDATED),this.updateRecorderToDb(e)}catch(a){this.loggingService.catch("Error in RecorderAnnotationService updateRecorder: ",a)}}resolveRecorder(e){try{this.domService.resetSelectedAnnotationsMap(!1),this.updateNotificationsDatabase(e,_e.RESOLVED),this.updateRecorderToDb(e),this.domService.updateSelectedAnnotationInMap([e])}catch(t){this.loggingService.catch("Error in RecorderAnnotationService resolveRecorder: ",t)}}updateRecorderToDb(e){this.loggingService.log("%c[WB] Calling FUNCTION: updateRecorderToDb","color: green;");try{if(e?.targetElement?.xpath){let t=this.domService.getXPath(e.targetElement.xpath);if(t){let r=t.iterateNext();r&&(Ze(r)||(e.targetElement=null))}}if(e.annotationId){let t=this.recorderAnnotationById$.value;this.recorderAnnotationById$.next(U(y({},t),{[e.annotationId]:y({},e)}))}if(this.domService.updateSelectedAnnotationInMap([e]),this.authService.getUser()&&this.authService.isFeatureAllowed(Ae.RECORDER)){let t=JSON.parse(JSON.stringify(e));if(t.position=null,this.recorderAnnotationsResolverService.recorderAnnotationDataProviderAvailable()||delete t?.isUrlAvailable,!t?.metadata?.documentId){t?.metadata||(t.metadata={});let c=this.docService.getBaseMetadata("recorder");t.metadata=y(y({},t?.metadata),c)}let{documentId:r,organizationId:a}=this.getDocumentIdAndOrganizationIdFromRecorderAnnotation(e);this.commonDbService.setData({feature:"recorder",properties:{id:e.annotationId,documentId:r,organizationId:a},data:JSON.parse(JSON.stringify(t)),extraData:{actionType:_e.UPDATED}})}}catch(t){this.loggingService.catch("Error in RecorderAnnotationService updateRecorderToDb: ",t)}}deleteRecorderPinAnnotations(){try{let e=this.domService.getSelectedAnnotationsMap(),t=this.authService.getUser(),r=[];Object.keys(e).forEach(a=>A(this,null,function*(){let c=e[a];c.type==="recorder"&&t&&c.from&&(t?.isAdmin||c.from.userId===t.userId)&&r.push(c)})),r?.length&&(this.analyticsService.trackEvent(Qe.Events.Recording.RECORDING_DELETE_TRIGGERED,{annotationId:r.map(a=>a.annotationId).join()}),this.dialog.open(si,{panelClass:"velt-mat-dialog-container",data:{title:"Delete recording?",message:"This selected recording will be deleted.",yesButton:"Delete",noButton:"Cancel",darkMode:this.recorderContainerDarkMode$.value,variant:"recorder"}}).afterClosed().pipe(ke(1)).subscribe(a=>{a&&(r.forEach(c=>A(this,null,function*(){yield this.deleteRecorderPinAnnotation(c)})),setTimeout(()=>{document.querySelectorAll(`[${K.SNIPPYLY_HIGHLIGHT}]`).forEach(p=>{this.domService.removeHighlightFromElement(p)})},100))}),this.domService.resetSelectedAnnotationsMap(!0,"recorder"))}catch(e){this.loggingService.catch("Error in RecorderAnnotationService deleteRecorderPinAnnotations: ",e)}}deleteRecorderPinAnnotation(e,t){if(this.authService.isFeatureAllowed(Ae.RECORDER)&&this.documentPaths?.recorder&&e?.annotationId){this.updateNotificationsDatabase(e,_e.DELETED);let r=this.attachmentResolverService.attachmentDataProviderAvailable("recorder"),a=this.recorderAnnotationsResolverService.recorderAnnotationDataProviderAvailable()?this.recorderUtilsService.mergeStrippedDataWithRecorderAnnotation(y({},e)):e,c=Ue(e?.metadata??{});if(a?.attachments?.length)a.attachments.forEach(_=>{let x={organizationId:c?.organizationId??null,documentId:c?.documentId??null,folderId:c?.folderId??null,attachmentId:_.attachmentId,commentAnnotationId:null,apiKey:c?.apiKey??null};this.storageService.deleteAttachment({attachment:_,metadata:x,useAttachmentResolver:r,attachmentScope:"recorder"}).catch(I=>{this.loggingService.catch("Error in RecorderAnnotationService deleteRecorderPinAnnotation delete attachment: ",I)})});else if(a?.attachment){let _={organizationId:c?.organizationId??null,documentId:c?.documentId??null,folderId:c?.folderId??null,attachmentId:a.attachment.attachmentId,commentAnnotationId:null,apiKey:c?.apiKey??null};this.storageService.deleteAttachment({attachment:a.attachment,metadata:_,useAttachmentResolver:r,attachmentScope:"recorder"})}e?.transcription&&!this.recorderAnnotationsResolverService.recorderAnnotationDataProviderAvailable()&&(e?.transcription?.srtBucketPath&&this.storageService.deleteFileFromPath(e.transcription.srtBucketPath).catch(_=>{this.loggingService.catch("Error in RecorderAnnotationService deleteRecorderPinAnnotation delete srt file: ",_)}),e?.transcription?.vttBucketPath&&this.storageService.deleteFileFromPath(e.transcription.vttBucketPath).catch(_=>{this.loggingService.catch("Error in RecorderAnnotationService deleteRecorderPinAnnotation delete vtt file: ",_)})),this.analyticsService.trackEvent(Qe.Events.Recording.RECORDING_DELETED,{annotationId:e.annotationId,recorderType:e.recordingType,recorderMode:e.mode,recorderTime:e?.recordedTime?.duration,recorderSize:e?.attachments?.length?e?.attachments[0]?.size:e.attachment?.size,sourceFeature:t||"recording"});let{documentId:p,organizationId:d}=this.getDocumentIdAndOrganizationIdFromRecorderAnnotation(e),m={annotationData:e,actionType:_e.DELETED,notificationSource:"recorder"},v={apiKey:this.configService.getApiKey(),organizationId:d,documentId:p,veltFolderId:e?.metadata?.veltFolderId};return this.commonDbService.deleteData({feature:"recorder",properties:{id:e.annotationId,documentId:p,organizationId:d,metadata:v},extraData:m}).then(_=>A(this,null,function*(){let x=yield this.createRecorderData(e,!0);x&&this.recorderActionsService?.onDeleteRecording(x)}))}else return Promise.resolve()}enableAddRecorderMode(){this.authService.isFeatureAllowed(Ae.RECORDER)?this.addRecorderMode$.next(!0):this.loggingService.catch("Error in RecorderAnnotationService enableAddRecorderMode: ","Recorder feature is not enabled.")}disableAddRecorderMode(){this.addRecorderMode$.next(!1)}addRecorderModeChange(){return this.addRecorderMode$.asObservable()}setRecorderContainerDarkMode(e){try{if(this.recorderContainerDarkMode$.value===e)return;this.recorderContainerDarkMode$.next(e)}catch(t){this.loggingService.catch("Error in RecorderAnnotationService setRecorderContainerDarkMode: ",t)}}getRecorderContainerDarkMode(){return this.recorderContainerDarkMode$.asObservable()}enableRecordingTranscription(){try{if(this.analyticsService.setFeatureConfig({feature:Ae.RECORDER,config:{recordingTranscription:!0}}),this.recordingTranscriptionEnabled$.value===!0)return;this.recordingTranscriptionEnabled$.next(!0)}catch(e){this.loggingService.catch("Error in RecorderAnnotationService enableRecordingTranscription: ",e)}}disableRecordingTranscription(){try{if(this.analyticsService.setFeatureConfig({feature:Ae.RECORDER,config:{recordingTranscription:!1}}),this.recordingTranscriptionEnabled$.value===!1)return;this.recordingTranscriptionEnabled$.next(!1)}catch(e){this.loggingService.catch("Error in RecorderAnnotationService disableRecordingTranscription: ",e)}}getRecordingTranscriptionEnabled(){return this.recordingTranscriptionEnabled$.value}getRecordingTranscriptionEnabled$(){return this.recordingTranscriptionEnabled$.asObservable()}get timestamp(){return this.commonDbService.getServerTimestamp()}isElementInsideAllowedElements(e){try{return this.domService.isElementInsideListedElementIds(e,this.allowedElementIds$.value)}catch(t){return this.loggingService.catch("Error in RecorderAnnotationService isElementInsideAllowedElements: ",t),!1}}attachRecorder(e){let t=document.getElementById(e);if(t){let r=this.domService.getXPath(t),a=this.getRecorderPinAnnotationObject();a&&(a.targetElement={xpath:r,topPercentage:50,leftPercentage:90},this.saveRecorderToDb(a))}}getRecorderPinAnnotationObject(){let e=this.authService.getUser();if(e)if(e.isReadOnly||e.isAnonymous)this.loggingService.catch("Anonymous/Readonly users cannot add recorders.");else{let t=new Lt;t.from=e,t.color=K.DEFAULT_ANNOTATION_COLOR,t.lastUpdated=this.timestamp;let{topPositionX:r,topPositionY:a}=this.domService.getTopLeftPosition();t.positionX=r,t.positionY=a;let c=this.domService.getCurrentWindowSizeValue();t.screenWidth=c.screenWidth,t.screenHeight=c.screenHeight,t.screenScrollHeight=c.screenScrollHeight,t.recorderedElementPath="";let p=this.docService.getLocation();return p&&(t.locationId=p.locationId,t.location=p.location),t}return null}updateNotificationsDatabase(e,t,r={}){try{let a=e;this.recorderAnnotationsResolverService.recorderAnnotationDataProviderAvailable()&&(a=JSON.parse(JSON.stringify(e)),a?.from?.userId&&(a.from={userId:a.from.userId}),delete a.transcription,a?.attachments?.length&&(a.attachments=a.attachments.map(p=>({attachmentId:p?.attachmentId,name:p?.name}))),a.attachment=null,a?.chunkUrls&&(a.chunkUrls={}));let c=y({annotationData:a,actionType:t,notificationSource:"recorder",recordingType:e?.recordingType},r);this.notificationService.updateNotificationDatabase(c)}catch(a){this.loggingService.catch("Error in RecorderAnnotationService updateNotificationsDatabase: ",a)}}getUserContacts$(){return this.contactService.getUserContacts$()}addUserContact(e){this.contactService.addUserContact(e)}getRecorderUrl(e){try{return e?.pageInfo?.recorderUrl?e.pageInfo.recorderUrl:e?.annotationId?(e?.pageInfo||(e.pageInfo=Ct(),e.pageInfo&&(e.pageInfo.screenWidth=this.domService.getCurrentWindowSizeValue()?.screenWidth)),e.pageInfo.recorderUrl=this.generateRecorderUrl(e),this.updateRecorder(e),e.pageInfo?.recorderUrl):""}catch(t){this.loggingService.catch("Error in RecorderAnnotationService getRecorderUrl: ",t);return}}uploadFile(e,t){let r=this.documentPaths?.organizationId,a=this.documentPaths?.documentId;t?.metadata?.documentId&&(a=t.metadata.documentId,r=t.metadata.organizationId);let c=`${K.FIREBASE_PARTIAL_PATH_DOCS}/${a}/${K.FIREBASE_PARTIAL_PATH_RECORDER}`;if(r&&(c=`${K.FIREBASE_PARTIAL_PATH_ORGANIZATIONS}/${r}/${K.FIREBASE_PARTIAL_PATH_DOCS}/${a}/${K.FIREBASE_PARTIAL_PATH_RECORDER}`),this.attachmentResolverService.attachmentDataProviderAvailable("recorder")){let p=this.docService.getBaseMetadata("recorder",{commentAnnotationId:t.commentAnnotationId});return this.storageService.uploadFile({path:c,file:e,useAttachmentResolver:!0,metadata:p,attachmentScope:"recorder"})}return this.storageService.uploadFile({path:c,file:e})}uploadFullRecordingAndUpdateAnnotation(e,t){try{if(!t?.annotationId)return;this.uploadFile(e,t).then(r=>{if(!r?.url)return;let c=this.getAnnotationById(t.annotationId)||t;c.attachments?.length&&(c.attachments[0].url=r.url,c.attachments[0].attachmentId=r.attachmentId,r.bucketPath&&(c.attachments[0].bucketPath=r.bucketPath)),c.attachment=c.attachments?.[0]??null,c.lastUpdated=new Date().getTime(),c.isUrlAvailable=!0,this.updateRecorder(c)}).catch(r=>{this.loggingService.catch("Error uploading full recording: ",r)})}catch(r){this.loggingService.catch("Error in RecorderAnnotationService uploadFullRecordingAndUpdateAnnotation: ",r)}}downloadAttachment(e){this.storageService.downloadAttachment(e)}deleteAttachment(e){return this.storageService.deleteAttachment({attachment:e})}generateRecorderUrl(e){let t;try{t=new URL(e?.pageInfo?.url||window.location.href)}catch(r){this.loggingService.catch("Error in RecorderAnnotationService generateRecorderUrl: ",r),t=new URL(window.location.href)}return t.searchParams.delete(K.URL_PARAMS.RECORDER_ID),t.searchParams.append(K.URL_PARAMS.RECORDER_ID,e.annotationId),t.href}setRecorderNotesFound(e){try{this.recorderNotesFound$.next(e)}catch(t){this.loggingService.catch("Error in RecorderAnnotationService setRecorderNotesFound: ",t)}}getRecorderNotesFound$(){try{return this.recorderNotesFound$.asObservable()}catch(e){return this.loggingService.catch("Error in RecorderAnnotationService getRecorderNotesFound: ",e),Z(!1)}}getRecorderNotesFound(){try{return this.recorderNotesFound$.value}catch(e){return this.loggingService.catch("Error in RecorderAnnotationService getRecorderNotesFound: ",e),!1}}editVideoRecording(e,t,r,a,c,p){return A(this,null,function*(){try{let d=It(this.functions,bt({url:this.endpointsService.getCloudFunctionUrl("videoBackend"),apiProxyDomain:this.configService?.getApiProxyDomain()}),{timeout:36e5}),m=this.docService.getDocumentPaths();r?.metadata?.documentId&&(m=new Rt({apiKey:this.configService.getApiKey(),clientDocumentId:r.metadata.clientDocumentId,clientOrganizationId:r.metadata.clientOrganizationId,documentId:r.metadata.documentId,organizationId:r.metadata.organizationId}));let v={databaseUrl:this.authService.getFirebaseConfig()?.firebaseOptions?.databaseURL,entirePath:m?.recorder+(r?.annotationId||""),fromUser:this.authService.getUser(),clientOrganizationId:m?.clientOrganizationId,clientDocumentId:m?.clientDocumentId,apiKey:this.configService.getApiKey(),sdkVersion:yt(),sdkType:this.configService.getSdkType(),useFirestore:this.commonDbService.shouldUseFirestore(),storageBucket:this.authService.getFirebaseConfig()?.firebaseOptions?.storageBucket,documentPath:m?.recorder,annotationId:r?.annotationId,annotationData:r,videoUrl:e,segments:t,zoomOptions:a,transcriptionEnabled:this.getRecordingTranscriptionEnabled(),type:c,backendUpload:!0};if(p){let G=yield p.arrayBuffer(),ue=new Uint8Array(G),me="";for(let fe=0;fe<ue.length;fe++)me+=String.fromCharCode(ue[fe]);let ye=btoa(me);v.videoBlobData=ye,v.videoBlobType=p.type,v.videoBlobSize=p.size}if(v?.useFirestore&&r){let G=yield this.recorderUtilsService.encryptRecorderAnnotation(r);v.annotationData=G}let _=this.documentPaths?.organizationId,x=this.documentPaths?.documentId;r?.metadata?.documentId&&(x=r.metadata.documentId,_=r.metadata.organizationId);let I=`${this.configService.getApiKey()}/${K.FIREBASE_PARTIAL_PATH_DOCS}/${x}/${K.FIREBASE_PARTIAL_PATH_RECORDER}`;_&&(I=`${this.configService.getApiKey()}/${K.FIREBASE_PARTIAL_PATH_ORGANIZATIONS}/${_}/${K.FIREBASE_PARTIAL_PATH_DOCS}/${x}/${K.FIREBASE_PARTIAL_PATH_RECORDER}`),v.bucketPath=I;let H=yield d(v);if(c==="standalone"){let G=H?.data;if(G&&G?.videoData){let ue=atob(G.videoData),me=new ArrayBuffer(ue.length),ye=new Uint8Array(me);for(let ie=0;ie<ue.length;ie++)ye[ie]=ue.charCodeAt(ie);let fe=new Blob([ye],{type:G.mimeType||"video/mp4"}),Se=document.createElement("a");Se.href=URL.createObjectURL(fe),Se.download="edited-video.mp4",document.body.appendChild(Se),Se.click(),document.body.removeChild(Se)}}return H}catch(d){throw this.loggingService.catch("Error in RecorderAnnotationService editVideoRecording: ",d),d}})}setVideoEditorAutoOpen(e){try{this.videoEditorAutoOpen$.next(y(y({},this.videoEditorAutoOpen$.value),e))}catch(t){this.loggingService.catch("Error in RecorderAnnotationService setVideoEditorAutoOpen: ",t)}}getVideoEditorAutoOpen$(){try{return this.videoEditorAutoOpen$.asObservable()}catch(e){return this.loggingService.catch("Error in RecorderAnnotationService getVideoEditorAutoOpen: ",e),Z({})}}getVideoEditorAutoOpen(){try{return this.videoEditorAutoOpen$.value}catch(e){return this.loggingService.catch("Error in RecorderAnnotationService getVideoEditorAutoOpen: ",e),{}}}downloadLatestVideo(e){return A(this,null,function*(){try{this.loggingService.log("%c[WB] Calling FUNCTION: downloadLatestVideo","color: green;");let t=this.getAnnotationById(e);if(!t)return this.loggingService.catch("Recording not found with ID: "+e),!1;let r,a,c=t.latestVersion;if(c&&t.recordingEditVersions?.[c]?(r=t.recordingEditVersions[c].attachments?.[0]?.url,a=t.recordingEditVersions[c].attachments?.[0]?.name):(r=t.attachments?.[0]?.url||t.attachment?.url,a=t.attachments?.[0]?.name||t.attachment?.name),!r)return this.loggingService.catch("No video URL found for recording: "+e),!1;let p=yield fetch(r);if(!p.ok)return this.loggingService.catch("Failed to fetch video: "+p.statusText),!1;let d=yield p.blob(),m=document.createElement("a");return m.href=URL.createObjectURL(d),m.download=a||`recording-${e}.mp4`,document.body.appendChild(m),m.click(),document.body.removeChild(m),URL.revokeObjectURL(m.href),this.loggingService.log("Successfully downloaded video: "+a),!0}catch(t){return this.loggingService.catch("Error in RecorderAnnotationService downloadLatestVideo: ",t),!1}})}};o.\u0275fac=function(t){return new(t||o)(j(Xe),j(ii),j(it),j(qe),j(ai),j(et),j(Ye),j($t),j(li),j(Vt),j(ri),j(ci),j(rt),j(Fe),j(E),j(pi),j(tn),j(vt),j(en),j(gi),j($e),j(tt),j(Be))},o.\u0275prov=we({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();export{tn as a,ot as b,at as c,hi as d,fi as e,Ci as f,yi as g,ct as h,st as i,xi as j,Pi as k,dt as l,Oi as m,ki as n,Mi as o,lt as p,$i as q,Vi as r,ji as s,gt as t,pt as u,mt as v,Wi as w,Hi as x,Gi as y,Xi as z,vt as A,en as B,Pd as C};