-
Notifications
You must be signed in to change notification settings - Fork 0
/
650.391afbb1866149c3.js
1 lines (1 loc) · 334 KB
/
650.391afbb1866149c3.js
1
(self.webpackChunkdoge_academy=self.webpackChunkdoge_academy||[]).push([[650],{8650:(ne,U,w)=>{"use strict";w.r(U),w.d(U,{ClassroomModule:()=>li});var p=w(9808),L=w(4996),D=w(5039),h=w(9164),v=w(2805),t=w(5e3),f=w(8698),m=w(6394),_=w(7293),u=w(6652),P=w(2382);const B=["canvasElement"];let I=(()=>{class o{constructor(){this.selectedColor="#215d96",this.selectedLineWidth=1,this.sharing=!1,this.isDrawing=!1,this.mouseX=-1,this.mouseY=-1}ngOnInit(){}ngAfterViewInit(){var e,i;if(this.canvas=null===(e=this.canvasElementRef)||void 0===e?void 0:e.nativeElement,!this.canvas)return;this.canvas.style.width="99%",this.canvas.style.height="90%",this.canvas.width=this.canvas.offsetWidth,this.canvas.height=this.canvas.offsetHeight,this.canvas.style.width="auto",this.canvas.style.height="auto";let s=null===(i=this.canvas)||void 0===i?void 0:i.getContext("2d");s&&(s.fillStyle="white",s.fillRect(0,0,this.canvas.width,this.canvas.height),s.lineCap="round",s.lineJoin="round",s.strokeStyle=this.selectedColor,s.lineWidth=this.selectedLineWidth,this.context=s)}canvasContainerResize(){console.log("shod")}canvasMouseDown(e){this.setMouseCoordinates(e),this.isDrawing=!0,this.context&&(this.context.beginPath(),this.context.moveTo(this.mouseX,this.mouseY))}canvasMouseMove(e){var i,s;this.setMouseCoordinates(e),this.isDrawing&&(null===(i=this.context)||void 0===i||i.lineTo(this.mouseX,this.mouseY),null===(s=this.context)||void 0===s||s.stroke())}setMouseCoordinates(e){this.canvas&&(this.mouseX=e.clientX-this.canvas.getBoundingClientRect().left,this.mouseY=e.clientY-this.canvas.getBoundingClientRect().top)}clearCanvas(){this.canvas&&(this.canvas.style.width="0%",this.canvas.style.height="0%",this.canvas.width=this.canvas.offsetWidth,this.canvas.height=this.canvas.offsetHeight),this.ngAfterViewInit()}cancelDrawing(){this.isDrawing=!1}colorChangeHandle(e){this.context&&(this.context.strokeStyle=e)}lineWidthChange(){this.context&&(this.context.lineWidth=this.selectedLineWidth)}}return o.\u0275fac=function(e){return new(e||o)},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-whiteboard"]],viewQuery:function(e,i){if(1&e&&t.Gf(B,5),2&e){let s;t.iGM(s=t.CRH())&&(i.canvasElementRef=s.first)}},inputs:{sharing:"sharing",ngAfterViewInit:["viewInit","ngAfterViewInit"]},decls:19,vars:3,consts:[[1,"d-flex","flex-column","h-100","w-100","p-3",2,"user-select","none"],[1,"d-flex","align-items-center","mb-2"],["type","color",1,"form-control","form-control-color",3,"ngModel","ngModelChange","change"],["selectColor",""],[1,"form-select","mx-3",2,"width","100px",3,"ngModel","ngModelChange","change"],["value","1"],["value","2"],["value","3"],["value","4"],["value","5"],["type","image","src","assets/icons/eraser.svg","alt","eraser","title","\u067e\u0627\u06a9 \u06a9\u0631\u062f\u0646 \u062a\u062e\u062a\u0647",1,"ms-auto","icon-button",3,"click"],[1,"w-100","flex-grow-1","overflow-auto"],[1,"border","border-3",3,"ngClass","mousedown","mousemove","mouseup","mouseout"],["canvasElement",""]],template:function(e,i){if(1&e){const s=t.EpF();t.TgZ(0,"div",0)(1,"div",1)(2,"input",2,3),t.NdJ("ngModelChange",function(G){return i.selectedColor=G})("change",function(){t.CHM(s);const G=t.MAs(3);return i.colorChangeHandle(G.value)}),t.qZA(),t.TgZ(4,"select",4),t.NdJ("ngModelChange",function(G){return i.selectedLineWidth=G})("change",function(){return i.lineWidthChange()}),t.TgZ(5,"option",5),t._uU(6,"1"),t.qZA(),t.TgZ(7,"option",6),t._uU(8,"2"),t.qZA(),t.TgZ(9,"option",7),t._uU(10,"3"),t.qZA(),t.TgZ(11,"option",8),t._uU(12,"4"),t.qZA(),t.TgZ(13,"option",9),t._uU(14,"5"),t.qZA()(),t.TgZ(15,"input",10),t.NdJ("click",function(){return i.clearCanvas()}),t.qZA()(),t.TgZ(16,"div",11)(17,"canvas",12,13),t.NdJ("mousedown",function(G){return i.canvasMouseDown(G)})("mousemove",function(G){return i.canvasMouseMove(G)})("mouseup",function(){return i.cancelDrawing()})("mouseout",function(){return i.cancelDrawing()}),t.qZA()()()}2&e&&(t.xp6(2),t.Q6J("ngModel",i.selectedColor),t.xp6(2),t.Q6J("ngModel",i.selectedLineWidth),t.xp6(13),t.Q6J("ngClass",i.sharing?"border-info":""))},directives:[P.Fj,P.JJ,P.On,P.EJ,P.YN,P.Kr,p.mk],styles:[".icon-button[_ngcontent-%COMP%]{height:2rem;padding:.2rem;border-radius:5px;transition:background-color .2s}.icon-button[_ngcontent-%COMP%]:hover:enabled{background-color:#d3d3d3}"]}),o})();const R=["videoElement"],J=["videoContainer"];function j(o,n){if(1&o&&(t.TgZ(0,"div",7)(1,"div",8)(2,"span"),t._uU(3),t.ALo(4,"uppercase"),t.qZA()()()),2&o){const e=t.oxw();t.xp6(1),t.Q6J("ngClass",e.speaking?"speaking":""),t.xp6(2),t.Oqu(t.lcZ(4,2,null==e.streamerName?null:e.streamerName.charAt(0)))}}let c,g=(()=>{class o{constructor(){this.speaking=!1,this.loading=!1}ngOnInit(){}ngAfterViewInit(){this.sManager&&this.videoElement&&(this.loading=!0,this.sManager.addVideoElement(this.videoElement.nativeElement))}set streamManager(e){var i,s;this.sManager=e,this.sManager&&this.videoElement&&this.sManager.addVideoElement(this.videoElement.nativeElement),null===(i=this.sManager)||void 0===i||i.on("publisherStartSpeaking",k=>{this.speaking=!0}),null===(s=this.sManager)||void 0===s||s.on("publisherStopSpeaking",k=>{this.speaking=!1})}set user(e){this.streamerName=e}fullscreen(){if(!this.videoContainerElement)return;const e=window.document;e.fullscreenElement||e.mozFullScreenElement||e.webkitFullscreenElement||e.msFullscreenElement?e.exitFullscreen?e.exitFullscreen():e.msExitFullscreen?e.msExitFullscreen():e.mozCancelFullScreen?e.mozCancelFullScreen():e.webkitExitFullscreen&&e.webkitExitFullscreen():this.videoContainerElement.nativeElement.requestFullscreen?this.videoContainerElement.nativeElement.requestFullscreen():this.videoContainerElement.nativeElement.msRequestFullscreen?this.videoContainerElement.nativeElement.msRequestFullscreen():this.videoContainerElement.nativeElement.mozRequestFullScreen?this.videoContainerElement.nativeElement.mozRequestFullScreen():this.videoContainerElement.nativeElement.webkitRequestFullscreen&&this.videoContainerElement.nativeElement.webkitRequestFullscreen()}}return o.\u0275fac=function(e){return new(e||o)},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-ov-stream"]],viewQuery:function(e,i){if(1&e&&(t.Gf(R,5),t.Gf(J,5)),2&e){let s;t.iGM(s=t.CRH())&&(i.videoElement=s.first),t.iGM(s=t.CRH())&&(i.videoContainerElement=s.first)}},inputs:{streamManager:"streamManager",user:"user"},decls:10,vars:2,consts:[[1,"ov-stream"],["videoContainer",""],["videoElement",""],["class","profile-container",4,"ngIf"],[1,"video-overlay"],[1,"d-flex","align-items-center","justify-content-between"],["type","image","alt","fullscreen","src","assets/icons/fullscreen.svg",1,"fullscreen-button",3,"click"],[1,"profile-container"],[3,"ngClass"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0,1),t._UZ(2,"video",null,2),t.YNc(4,j,5,4,"div",3),t.TgZ(5,"div",4)(6,"div",5)(7,"span"),t._uU(8),t.qZA(),t.TgZ(9,"input",6),t.NdJ("click",function(){return i.fullscreen()}),t.qZA()()()()),2&e&&(t.xp6(4),t.Q6J("ngIf",!(null!=i.sManager&&null!=i.sManager.stream&&i.sManager.stream.videoActive)),t.xp6(4),t.Oqu(i.streamerName))},directives:[p.O5,p.mk],pipes:[p.gd],styles:[".ov-stream[_ngcontent-%COMP%]{position:relative;width:100%;max-height:100%;max-width:100%}.ov-stream[_ngcontent-%COMP%] video[_ngcontent-%COMP%]{border-radius:4px;width:100%;max-height:100%;max-width:100%}.profile-container[_ngcontent-%COMP%]{position:absolute;width:100%;height:100%;top:0;display:flex;justify-content:center;align-content:center}.profile-container[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{display:table;margin:auto;border-radius:50%;border:0 solid;transition:border .2s}.profile-container[_ngcontent-%COMP%] div.speaking[_ngcontent-%COMP%]{animation:speaking .25s infinite;animation-direction:alternate}@keyframes speaking{0%{border:.5rem solid}to{border:1.5rem solid}}.profile-container[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:flex;background:sandybrown;width:2em;height:2em;font-size:4rem;justify-content:center;align-items:center;color:#fff;border-radius:50%}.video-overlay[_ngcontent-%COMP%]{width:100%;height:100%;position:absolute;top:0;opacity:0;padding:.5rem;transition:opacity .5s;z-index:2;-webkit-user-select:none;user-select:none}.video-overlay[_ngcontent-%COMP%]:hover{opacity:1}.video-overlay[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#fff;font-size:1rem;padding:.2rem;border-radius:5px;background-color:#0006}.fullscreen-button[_ngcontent-%COMP%]{height:2rem;padding:.2rem;border-radius:5px;background-color:#0006;transition:background-color .2s}.fullscreen-button[_ngcontent-%COMP%]:hover{background-color:#d3d3d3b3}"]}),o})();try{c="undefined"!=typeof Intl&&Intl.v8BreakIterator}catch(o){c=!1}let V,O,M=(()=>{class o{constructor(e){this._platformId=e,this.isBrowser=this._platformId?(0,p.NF)(this._platformId):"object"==typeof document&&!!document,this.EDGE=this.isBrowser&&/(edge)/i.test(navigator.userAgent),this.TRIDENT=this.isBrowser&&/(msie|trident)/i.test(navigator.userAgent),this.BLINK=this.isBrowser&&!(!window.chrome&&!c)&&"undefined"!=typeof CSS&&!this.EDGE&&!this.TRIDENT,this.WEBKIT=this.isBrowser&&/AppleWebKit/i.test(navigator.userAgent)&&!this.BLINK&&!this.EDGE&&!this.TRIDENT,this.IOS=this.isBrowser&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!("MSStream"in window),this.FIREFOX=this.isBrowser&&/(firefox|minefield)/i.test(navigator.userAgent),this.ANDROID=this.isBrowser&&/android/i.test(navigator.userAgent)&&!this.TRIDENT,this.SAFARI=this.isBrowser&&/safari/i.test(navigator.userAgent)&&this.WEBKIT}}return o.\u0275fac=function(e){return new(e||o)(t.LFG(t.Lbi))},o.\u0275prov=t.Yz7({token:o,factory:o.\u0275fac,providedIn:"root"}),o})();function y(o){return function C(){if(null==V&&"undefined"!=typeof window)try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>V=!0}))}finally{V=V||!1}return V}()?o:!!o.capture}function T(o){if(function S(){if(null==O){const o="undefined"!=typeof document?document.head:null;O=!(!o||!o.createShadowRoot&&!o.attachShadow)}return O}()){const n=o.getRootNode?o.getRootNode():null;if("undefined"!=typeof ShadowRoot&&ShadowRoot&&n instanceof ShadowRoot)return n}return null}function H(o){return o.composedPath?o.composedPath()[0]:o.target}function ie(o){return null!=o&&"false"!=`${o}`}function le(o){return o instanceof t.SBq?o.nativeElement:o}var we=w(7579),Ne=w(727),lt=w(4986),dt=w(4408);const Ue={schedule(o){let n=requestAnimationFrame,e=cancelAnimationFrame;const{delegate:i}=Ue;i&&(n=i.requestAnimationFrame,e=i.cancelAnimationFrame);const s=n(k=>{e=void 0,o(k)});return new Ne.w0(()=>null==e?void 0:e(s))},requestAnimationFrame(...o){const{delegate:n}=Ue;return((null==n?void 0:n.requestAnimationFrame)||requestAnimationFrame)(...o)},cancelAnimationFrame(...o){const{delegate:n}=Ue;return((null==n?void 0:n.cancelAnimationFrame)||cancelAnimationFrame)(...o)},delegate:void 0};var ut=w(640);const ht=new class en extends ut.v{flush(n){this._active=!0;const e=this._scheduled;this._scheduled=void 0;const{actions:i}=this;let s;n=n||i.shift();do{if(s=n.execute(n.state,n.delay))break}while((n=i[0])&&n.id===e&&i.shift());if(this._active=!1,s){for(;(n=i[0])&&n.id===e&&i.shift();)n.unsubscribe();throw s}}}(class qt extends dt.o{constructor(n,e){super(n,e),this.scheduler=n,this.work=e}requestAsyncId(n,e,i=0){return null!==i&&i>0?super.requestAsyncId(n,e,i):(n.actions.push(this),n._scheduled||(n._scheduled=Ue.requestAnimationFrame(()=>n.flush(void 0))))}recycleAsyncId(n,e,i=0){if(null!=i&&i>0||null==i&&this.delay>0)return super.recycleAsyncId(n,e,i);n.actions.some(s=>s.id===e)||(Ue.cancelAnimationFrame(e),n._scheduled=void 0)}});var ft=w(8306),pt=w(6451),Xe=w(2722),tn=w(4004),mt=w(5698),gt=w(8675),nn=w(8505),rn=w(3900);let Qe,on=1;const ze={};function vt(o){return o in ze&&(delete ze[o],!0)}const sn={setImmediate(o){const n=on++;return ze[n]=!0,Qe||(Qe=Promise.resolve()),Qe.then(()=>vt(n)&&o()),n},clearImmediate(o){vt(o)}},{setImmediate:an,clearImmediate:cn}=sn,Ge={setImmediate(...o){const{delegate:n}=Ge;return((null==n?void 0:n.setImmediate)||an)(...o)},clearImmediate(o){const{delegate:n}=Ge;return((null==n?void 0:n.clearImmediate)||cn)(o)},delegate:void 0};new class dn extends ut.v{flush(n){this._active=!0;const e=this._scheduled;this._scheduled=void 0;const{actions:i}=this;let s;n=n||i.shift();do{if(s=n.execute(n.state,n.delay))break}while((n=i[0])&&n.id===e&&i.shift());if(this._active=!1,s){for(;(n=i[0])&&n.id===e&&i.shift();)n.unsubscribe();throw s}}}(class ln extends dt.o{constructor(n,e){super(n,e),this.scheduler=n,this.work=e}requestAsyncId(n,e,i=0){return null!==i&&i>0?super.requestAsyncId(n,e,i):(n.actions.push(this),n._scheduled||(n._scheduled=Ge.setImmediate(n.flush.bind(n,void 0))))}recycleAsyncId(n,e,i=0){if(null!=i&&i>0||null==i&&this.delay>0)return super.recycleAsyncId(n,e,i);n.actions.some(s=>s.id===e)||(Ge.clearImmediate(e),n._scheduled=void 0)}});var hn=w(4482),fn=w(8421),bt=w(5403);let vn=(()=>{class o{constructor(e,i,s){this._platform=e,this._change=new we.x,this._changeListener=k=>{this._change.next(k)},this._document=s,i.runOutsideAngular(()=>{if(e.isBrowser){const k=this._getWindow();k.addEventListener("resize",this._changeListener),k.addEventListener("orientationchange",this._changeListener)}this.change().subscribe(()=>this._viewportSize=null)})}ngOnDestroy(){if(this._platform.isBrowser){const e=this._getWindow();e.removeEventListener("resize",this._changeListener),e.removeEventListener("orientationchange",this._changeListener)}this._change.complete()}getViewportSize(){this._viewportSize||this._updateViewportSize();const e={width:this._viewportSize.width,height:this._viewportSize.height};return this._platform.isBrowser||(this._viewportSize=null),e}getViewportRect(){const e=this.getViewportScrollPosition(),{width:i,height:s}=this.getViewportSize();return{top:e.top,left:e.left,bottom:e.top+s,right:e.left+i,height:s,width:i}}getViewportScrollPosition(){if(!this._platform.isBrowser)return{top:0,left:0};const e=this._document,i=this._getWindow(),s=e.documentElement,k=s.getBoundingClientRect();return{top:-k.top||e.body.scrollTop||i.scrollY||s.scrollTop||0,left:-k.left||e.body.scrollLeft||i.scrollX||s.scrollLeft||0}}change(e=20){return e>0?this._change.pipe(function mn(o,n=lt.z){return function pn(o){return(0,hn.e)((n,e)=>{let i=!1,s=null,k=null,G=!1;const q=()=>{if(null==k||k.unsubscribe(),k=null,i){i=!1;const ce=s;s=null,e.next(ce)}G&&e.complete()},oe=()=>{k=null,G&&e.complete()};n.subscribe((0,bt.x)(e,ce=>{i=!0,s=ce,k||(0,fn.Xf)(o(ce)).subscribe(k=(0,bt.x)(e,q,oe))},()=>{G=!0,(!i||!k||k.closed)&&e.complete()}))})}(()=>(0,v.H)(o,n))}(e)):this._change}_getWindow(){return this._document.defaultView||window}_updateViewportSize(){const e=this._getWindow();this._viewportSize=this._platform.isBrowser?{width:e.innerWidth,height:e.innerHeight}:{width:0,height:0}}}return o.\u0275fac=function(e){return new(e||o)(t.LFG(M),t.LFG(t.R0b),t.LFG(p.K0,8))},o.\u0275prov=t.Yz7({token:o,factory:o.\u0275fac,providedIn:"root"}),o})(),bn=(()=>{class o{}return o.\u0275fac=function(e){return new(e||o)},o.\u0275mod=t.oAB({type:o}),o.\u0275inj=t.cJS({}),o})();const _n=new t.OlP("cdk-dir-doc",{providedIn:"root",factory:function En(){return(0,t.f3M)(p.K0)}}),Sn=/^(ar|ckb|dv|he|iw|fa|nqo|ps|sd|ug|ur|yi|.*[-_](Adlm|Arab|Hebr|Nkoo|Rohg|Thaa))(?!.*[-_](Latn|Cyrl)($|-|_))($|-|_)/i;let wn=(()=>{class o{constructor(e){if(this.value="ltr",this.change=new t.vpe,e){const s=e.documentElement?e.documentElement.dir:null;this.value=function yn(o){const n=(null==o?void 0:o.toLowerCase())||"";return"auto"===n&&"undefined"!=typeof navigator&&(null==navigator?void 0:navigator.language)?Sn.test(navigator.language)?"rtl":"ltr":"rtl"===n?"rtl":"ltr"}((e.body?e.body.dir:null)||s||"ltr")}}ngOnDestroy(){this.change.complete()}}return o.\u0275fac=function(e){return new(e||o)(t.LFG(_n,8))},o.\u0275prov=t.Yz7({token:o,factory:o.\u0275fac,providedIn:"root"}),o})();function qe(o,n,e){for(let i in n)if(n.hasOwnProperty(i)){const s=n[i];s?o.setProperty(i,s,(null==e?void 0:e.has(i))?"important":""):o.removeProperty(i)}return o}function Ve(o,n){const e=n?"":"none";qe(o.style,{"touch-action":n?"":"none","-webkit-user-drag":n?"":"none","-webkit-tap-highlight-color":n?"":"transparent","user-select":e,"-ms-user-select":e,"-webkit-user-select":e,"-moz-user-select":e})}function _t(o,n,e){qe(o.style,{position:n?"":"fixed",top:n?"":"0",opacity:n?"":"0",left:n?"":"-999em"},e)}function Ze(o,n){return n&&"none"!=n?o+" "+n:o}function Et(o){const n=o.toLowerCase().indexOf("ms")>-1?1:1e3;return parseFloat(o)*n}function et(o,n){return o.getPropertyValue(n).split(",").map(i=>i.trim())}function tt(o){const n=o.getBoundingClientRect();return{top:n.top,right:n.right,bottom:n.bottom,left:n.left,width:n.width,height:n.height,x:n.x,y:n.y}}function nt(o,n,e){const{top:i,bottom:s,left:k,right:G}=o;return e>=i&&e<=s&&n>=k&&n<=G}function je(o,n,e){o.top+=n,o.bottom=o.top+o.height,o.left+=e,o.right=o.left+o.width}function St(o,n,e,i){const{top:s,right:k,bottom:G,left:q,width:oe,height:ce}=o,he=oe*n,_e=ce*n;return i>s-_e&&i<G+_e&&e>q-he&&e<k+he}class yt{constructor(n){this._document=n,this.positions=new Map}clear(){this.positions.clear()}cache(n){this.clear(),this.positions.set(this._document,{scrollPosition:this.getViewportScrollPosition()}),n.forEach(e=>{this.positions.set(e,{scrollPosition:{top:e.scrollTop,left:e.scrollLeft},clientRect:tt(e)})})}handleScroll(n){const e=H(n),i=this.positions.get(e);if(!i)return null;const s=i.scrollPosition;let k,G;if(e===this._document){const ce=this.getViewportScrollPosition();k=ce.top,G=ce.left}else k=e.scrollTop,G=e.scrollLeft;const q=s.top-k,oe=s.left-G;return this.positions.forEach((ce,he)=>{ce.clientRect&&e!==he&&e.contains(he)&&je(ce.clientRect,q,oe)}),s.top=k,s.left=G,{top:q,left:oe}}getViewportScrollPosition(){return{top:window.scrollY,left:window.scrollX}}}function wt(o){const n=o.cloneNode(!0),e=n.querySelectorAll("[id]"),i=o.nodeName.toLowerCase();n.removeAttribute("id");for(let s=0;s<e.length;s++)e[s].removeAttribute("id");return"canvas"===i?Rt(o,n):("input"===i||"select"===i||"textarea"===i)&&It(o,n),Ct("canvas",o,n,Rt),Ct("input, textarea, select",o,n,It),n}function Ct(o,n,e,i){const s=n.querySelectorAll(o);if(s.length){const k=e.querySelectorAll(o);for(let G=0;G<s.length;G++)i(s[G],k[G])}}let In=0;function It(o,n){"file"!==n.type&&(n.value=o.value),"radio"===n.type&&n.name&&(n.name=`mat-clone-${n.name}-${In++}`)}function Rt(o,n){const e=n.getContext("2d");if(e)try{e.drawImage(o,0,0)}catch(i){}}const Ot=y({passive:!0}),$e=y({passive:!1}),it=new Set(["position"]);class On{constructor(n,e,i,s,k,G){this._config=e,this._document=i,this._ngZone=s,this._viewportRuler=k,this._dragDropRegistry=G,this._passiveTransform={x:0,y:0},this._activeTransform={x:0,y:0},this._hasStartedDragging=!1,this._moveEvents=new we.x,this._pointerMoveSubscription=Ne.w0.EMPTY,this._pointerUpSubscription=Ne.w0.EMPTY,this._scrollSubscription=Ne.w0.EMPTY,this._resizeSubscription=Ne.w0.EMPTY,this._boundaryElement=null,this._nativeInteractionsEnabled=!0,this._handles=[],this._disabledHandles=new Set,this._direction="ltr",this.dragStartDelay=0,this._disabled=!1,this.beforeStarted=new we.x,this.started=new we.x,this.released=new we.x,this.ended=new we.x,this.entered=new we.x,this.exited=new we.x,this.dropped=new we.x,this.moved=this._moveEvents,this._pointerDown=q=>{if(this.beforeStarted.next(),this._handles.length){const oe=this._getTargetHandle(q);oe&&!this._disabledHandles.has(oe)&&!this.disabled&&this._initializeDragSequence(oe,q)}else this.disabled||this._initializeDragSequence(this._rootElement,q)},this._pointerMove=q=>{const oe=this._getPointerPositionOnPage(q);if(!this._hasStartedDragging){if(Math.abs(oe.x-this._pickupPositionOnPage.x)+Math.abs(oe.y-this._pickupPositionOnPage.y)>=this._config.dragStartThreshold){const Ae=Date.now()>=this._dragStartTime+this._getDragStartDelay(q),Le=this._dropContainer;if(!Ae)return void this._endDragSequence(q);(!Le||!Le.isDragging()&&!Le.isReceiving())&&(q.preventDefault(),this._hasStartedDragging=!0,this._ngZone.run(()=>this._startDragSequence(q)))}return}q.preventDefault();const ce=this._getConstrainedPointerPosition(oe);if(this._hasMoved=!0,this._lastKnownPointerPosition=oe,this._updatePointerDirectionDelta(ce),this._dropContainer)this._updateActiveDropContainer(ce,oe);else{const he=this._activeTransform;he.x=ce.x-this._pickupPositionOnPage.x+this._passiveTransform.x,he.y=ce.y-this._pickupPositionOnPage.y+this._passiveTransform.y,this._applyRootElementTransform(he.x,he.y)}this._moveEvents.observers.length&&this._ngZone.run(()=>{this._moveEvents.next({source:this,pointerPosition:ce,event:q,distance:this._getDragDistance(ce),delta:this._pointerDirectionDelta})})},this._pointerUp=q=>{this._endDragSequence(q)},this._nativeDragStart=q=>{if(this._handles.length){const oe=this._getTargetHandle(q);oe&&!this._disabledHandles.has(oe)&&!this.disabled&&q.preventDefault()}else this.disabled||q.preventDefault()},this.withRootElement(n).withParent(e.parentDragRef||null),this._parentPositions=new yt(i),G.registerDragItem(this)}get disabled(){return this._disabled||!(!this._dropContainer||!this._dropContainer.disabled)}set disabled(n){const e=ie(n);e!==this._disabled&&(this._disabled=e,this._toggleNativeDragInteractions(),this._handles.forEach(i=>Ve(i,e)))}getPlaceholderElement(){return this._placeholder}getRootElement(){return this._rootElement}getVisibleElement(){return this.isDragging()?this.getPlaceholderElement():this.getRootElement()}withHandles(n){this._handles=n.map(i=>le(i)),this._handles.forEach(i=>Ve(i,this.disabled)),this._toggleNativeDragInteractions();const e=new Set;return this._disabledHandles.forEach(i=>{this._handles.indexOf(i)>-1&&e.add(i)}),this._disabledHandles=e,this}withPreviewTemplate(n){return this._previewTemplate=n,this}withPlaceholderTemplate(n){return this._placeholderTemplate=n,this}withRootElement(n){const e=le(n);return e!==this._rootElement&&(this._rootElement&&this._removeRootElementListeners(this._rootElement),this._ngZone.runOutsideAngular(()=>{e.addEventListener("mousedown",this._pointerDown,$e),e.addEventListener("touchstart",this._pointerDown,Ot),e.addEventListener("dragstart",this._nativeDragStart,$e)}),this._initialTransform=void 0,this._rootElement=e),"undefined"!=typeof SVGElement&&this._rootElement instanceof SVGElement&&(this._ownerSVGElement=this._rootElement.ownerSVGElement),this}withBoundaryElement(n){return this._boundaryElement=n?le(n):null,this._resizeSubscription.unsubscribe(),n&&(this._resizeSubscription=this._viewportRuler.change(10).subscribe(()=>this._containInsideBoundaryOnResize())),this}withParent(n){return this._parentDragRef=n,this}dispose(){var n,e;this._removeRootElementListeners(this._rootElement),this.isDragging()&&(null===(n=this._rootElement)||void 0===n||n.remove()),null===(e=this._anchor)||void 0===e||e.remove(),this._destroyPreview(),this._destroyPlaceholder(),this._dragDropRegistry.removeDragItem(this),this._removeSubscriptions(),this.beforeStarted.complete(),this.started.complete(),this.released.complete(),this.ended.complete(),this.entered.complete(),this.exited.complete(),this.dropped.complete(),this._moveEvents.complete(),this._handles=[],this._disabledHandles.clear(),this._dropContainer=void 0,this._resizeSubscription.unsubscribe(),this._parentPositions.clear(),this._boundaryElement=this._rootElement=this._ownerSVGElement=this._placeholderTemplate=this._previewTemplate=this._anchor=this._parentDragRef=null}isDragging(){return this._hasStartedDragging&&this._dragDropRegistry.isDragging(this)}reset(){this._rootElement.style.transform=this._initialTransform||"",this._activeTransform={x:0,y:0},this._passiveTransform={x:0,y:0}}disableHandle(n){!this._disabledHandles.has(n)&&this._handles.indexOf(n)>-1&&(this._disabledHandles.add(n),Ve(n,!0))}enableHandle(n){this._disabledHandles.has(n)&&(this._disabledHandles.delete(n),Ve(n,this.disabled))}withDirection(n){return this._direction=n,this}_withDropContainer(n){this._dropContainer=n}getFreeDragPosition(){const n=this.isDragging()?this._activeTransform:this._passiveTransform;return{x:n.x,y:n.y}}setFreeDragPosition(n){return this._activeTransform={x:0,y:0},this._passiveTransform.x=n.x,this._passiveTransform.y=n.y,this._dropContainer||this._applyRootElementTransform(n.x,n.y),this}withPreviewContainer(n){return this._previewContainer=n,this}_sortFromLastPointerPosition(){const n=this._lastKnownPointerPosition;n&&this._dropContainer&&this._updateActiveDropContainer(this._getConstrainedPointerPosition(n),n)}_removeSubscriptions(){this._pointerMoveSubscription.unsubscribe(),this._pointerUpSubscription.unsubscribe(),this._scrollSubscription.unsubscribe()}_destroyPreview(){var n,e;null===(n=this._preview)||void 0===n||n.remove(),null===(e=this._previewRef)||void 0===e||e.destroy(),this._preview=this._previewRef=null}_destroyPlaceholder(){var n,e;null===(n=this._placeholder)||void 0===n||n.remove(),null===(e=this._placeholderRef)||void 0===e||e.destroy(),this._placeholder=this._placeholderRef=null}_endDragSequence(n){if(this._dragDropRegistry.isDragging(this)&&(this._removeSubscriptions(),this._dragDropRegistry.stopDragging(this),this._toggleNativeDragInteractions(),this._handles&&(this._rootElement.style.webkitTapHighlightColor=this._rootElementTapHighlight),this._hasStartedDragging))if(this.released.next({source:this}),this._dropContainer)this._dropContainer._stopScrolling(),this._animatePreviewToPlaceholder().then(()=>{this._cleanupDragArtifacts(n),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this)});else{this._passiveTransform.x=this._activeTransform.x;const e=this._getPointerPositionOnPage(n);this._passiveTransform.y=this._activeTransform.y,this._ngZone.run(()=>{this.ended.next({source:this,distance:this._getDragDistance(e),dropPoint:e})}),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this)}}_startDragSequence(n){He(n)&&(this._lastTouchEventTime=Date.now()),this._toggleNativeDragInteractions();const e=this._dropContainer;if(e){const i=this._rootElement,s=i.parentNode,k=this._placeholder=this._createPlaceholderElement(),G=this._anchor=this._anchor||this._document.createComment(""),q=this._getShadowRoot();s.insertBefore(G,i),this._initialTransform=i.style.transform||"",this._preview=this._createPreviewElement(),_t(i,!1,it),this._document.body.appendChild(s.replaceChild(k,i)),this._getPreviewInsertionPoint(s,q).appendChild(this._preview),this.started.next({source:this}),e.start(),this._initialContainer=e,this._initialIndex=e.getItemIndex(this)}else this.started.next({source:this}),this._initialContainer=this._initialIndex=void 0;this._parentPositions.cache(e?e.getScrollableParents():[])}_initializeDragSequence(n,e){this._parentDragRef&&e.stopPropagation();const i=this.isDragging(),s=He(e),k=!s&&0!==e.button,G=this._rootElement,q=H(e),oe=!s&&this._lastTouchEventTime&&this._lastTouchEventTime+800>Date.now(),ce=s?function Yt(o){const n=o.touches&&o.touches[0]||o.changedTouches&&o.changedTouches[0];return!(!n||-1!==n.identifier||null!=n.radiusX&&1!==n.radiusX||null!=n.radiusY&&1!==n.radiusY)}(e):function Jt(o){return 0===o.buttons||0===o.offsetX&&0===o.offsetY}(e);if(q&&q.draggable&&"mousedown"===e.type&&e.preventDefault(),i||k||oe||ce)return;if(this._handles.length){const Oe=G.style;this._rootElementTapHighlight=Oe.webkitTapHighlightColor||"",Oe.webkitTapHighlightColor="transparent"}this._hasStartedDragging=this._hasMoved=!1,this._removeSubscriptions(),this._pointerMoveSubscription=this._dragDropRegistry.pointerMove.subscribe(this._pointerMove),this._pointerUpSubscription=this._dragDropRegistry.pointerUp.subscribe(this._pointerUp),this._scrollSubscription=this._dragDropRegistry.scrolled(this._getShadowRoot()).subscribe(Oe=>this._updateOnScroll(Oe)),this._boundaryElement&&(this._boundaryRect=tt(this._boundaryElement));const he=this._previewTemplate;this._pickupPositionInElement=he&&he.template&&!he.matchSize?{x:0,y:0}:this._getPointerPositionInElement(n,e);const _e=this._pickupPositionOnPage=this._lastKnownPointerPosition=this._getPointerPositionOnPage(e);this._pointerDirectionDelta={x:0,y:0},this._pointerPositionAtLastDirectionChange={x:_e.x,y:_e.y},this._dragStartTime=Date.now(),this._dragDropRegistry.startDragging(this,e)}_cleanupDragArtifacts(n){_t(this._rootElement,!0,it),this._anchor.parentNode.replaceChild(this._rootElement,this._anchor),this._destroyPreview(),this._destroyPlaceholder(),this._boundaryRect=this._previewRect=this._initialTransform=void 0,this._ngZone.run(()=>{const e=this._dropContainer,i=e.getItemIndex(this),s=this._getPointerPositionOnPage(n),k=this._getDragDistance(s),G=e._isOverContainer(s.x,s.y);this.ended.next({source:this,distance:k,dropPoint:s}),this.dropped.next({item:this,currentIndex:i,previousIndex:this._initialIndex,container:e,previousContainer:this._initialContainer,isPointerOverContainer:G,distance:k,dropPoint:s}),e.drop(this,i,this._initialIndex,this._initialContainer,G,k,s),this._dropContainer=this._initialContainer})}_updateActiveDropContainer({x:n,y:e},{x:i,y:s}){let k=this._initialContainer._getSiblingContainerFromPosition(this,n,e);!k&&this._dropContainer!==this._initialContainer&&this._initialContainer._isOverContainer(n,e)&&(k=this._initialContainer),k&&k!==this._dropContainer&&this._ngZone.run(()=>{this.exited.next({item:this,container:this._dropContainer}),this._dropContainer.exit(this),this._dropContainer=k,this._dropContainer.enter(this,n,e,k===this._initialContainer&&k.sortingDisabled?this._initialIndex:void 0),this.entered.next({item:this,container:k,currentIndex:k.getItemIndex(this)})}),this.isDragging()&&(this._dropContainer._startScrollingIfNecessary(i,s),this._dropContainer._sortItem(this,n,e,this._pointerDirectionDelta),this._applyPreviewTransform(n-this._pickupPositionInElement.x,e-this._pickupPositionInElement.y))}_createPreviewElement(){const n=this._previewTemplate,e=this.previewClass,i=n?n.template:null;let s;if(i&&n){const k=n.matchSize?this._rootElement.getBoundingClientRect():null,G=n.viewContainer.createEmbeddedView(i,n.context);G.detectChanges(),s=Dt(G,this._document),this._previewRef=G,n.matchSize?Pt(s,k):s.style.transform=Ke(this._pickupPositionOnPage.x,this._pickupPositionOnPage.y)}else{const k=this._rootElement;s=wt(k),Pt(s,k.getBoundingClientRect()),this._initialTransform&&(s.style.transform=this._initialTransform)}return qe(s.style,{"pointer-events":"none",margin:"0",position:"fixed",top:"0",left:"0","z-index":`${this._config.zIndex||1e3}`},it),Ve(s,!1),s.classList.add("cdk-drag-preview"),s.setAttribute("dir",this._direction),e&&(Array.isArray(e)?e.forEach(k=>s.classList.add(k)):s.classList.add(e)),s}_animatePreviewToPlaceholder(){if(!this._hasMoved)return Promise.resolve();const n=this._placeholder.getBoundingClientRect();this._preview.classList.add("cdk-drag-animating"),this._applyPreviewTransform(n.left,n.top);const e=function Cn(o){const n=getComputedStyle(o),e=et(n,"transition-property"),i=e.find(q=>"transform"===q||"all"===q);if(!i)return 0;const s=e.indexOf(i),k=et(n,"transition-duration"),G=et(n,"transition-delay");return Et(k[s])+Et(G[s])}(this._preview);return 0===e?Promise.resolve():this._ngZone.runOutsideAngular(()=>new Promise(i=>{const s=G=>{var q;(!G||H(G)===this._preview&&"transform"===G.propertyName)&&(null===(q=this._preview)||void 0===q||q.removeEventListener("transitionend",s),i(),clearTimeout(k))},k=setTimeout(s,1.5*e);this._preview.addEventListener("transitionend",s)}))}_createPlaceholderElement(){const n=this._placeholderTemplate,e=n?n.template:null;let i;return e?(this._placeholderRef=n.viewContainer.createEmbeddedView(e,n.context),this._placeholderRef.detectChanges(),i=Dt(this._placeholderRef,this._document)):i=wt(this._rootElement),i.style.pointerEvents="none",i.classList.add("cdk-drag-placeholder"),i}_getPointerPositionInElement(n,e){const i=this._rootElement.getBoundingClientRect(),s=n===this._rootElement?null:n,k=s?s.getBoundingClientRect():i,G=He(e)?e.targetTouches[0]:e,q=this._getViewportScrollPosition();return{x:k.left-i.left+(G.pageX-k.left-q.left),y:k.top-i.top+(G.pageY-k.top-q.top)}}_getPointerPositionOnPage(n){const e=this._getViewportScrollPosition(),i=He(n)?n.touches[0]||n.changedTouches[0]||{pageX:0,pageY:0}:n,s=i.pageX-e.left,k=i.pageY-e.top;if(this._ownerSVGElement){const G=this._ownerSVGElement.getScreenCTM();if(G){const q=this._ownerSVGElement.createSVGPoint();return q.x=s,q.y=k,q.matrixTransform(G.inverse())}}return{x:s,y:k}}_getConstrainedPointerPosition(n){const e=this._dropContainer?this._dropContainer.lockAxis:null;let{x:i,y:s}=this.constrainPosition?this.constrainPosition(n,this):n;if("x"===this.lockAxis||"x"===e?s=this._pickupPositionOnPage.y:("y"===this.lockAxis||"y"===e)&&(i=this._pickupPositionOnPage.x),this._boundaryRect){const{x:k,y:G}=this._pickupPositionInElement,q=this._boundaryRect,{width:oe,height:ce}=this._getPreviewRect(),he=q.top+G,_e=q.bottom-(ce-G);i=Tt(i,q.left+k,q.right-(oe-k)),s=Tt(s,he,_e)}return{x:i,y:s}}_updatePointerDirectionDelta(n){const{x:e,y:i}=n,s=this._pointerDirectionDelta,k=this._pointerPositionAtLastDirectionChange,G=Math.abs(e-k.x),q=Math.abs(i-k.y);return G>this._config.pointerDirectionChangeThreshold&&(s.x=e>k.x?1:-1,k.x=e),q>this._config.pointerDirectionChangeThreshold&&(s.y=i>k.y?1:-1,k.y=i),s}_toggleNativeDragInteractions(){if(!this._rootElement||!this._handles)return;const n=this._handles.length>0||!this.isDragging();n!==this._nativeInteractionsEnabled&&(this._nativeInteractionsEnabled=n,Ve(this._rootElement,n))}_removeRootElementListeners(n){n.removeEventListener("mousedown",this._pointerDown,$e),n.removeEventListener("touchstart",this._pointerDown,Ot),n.removeEventListener("dragstart",this._nativeDragStart,$e)}_applyRootElementTransform(n,e){const i=Ke(n,e),s=this._rootElement.style;null==this._initialTransform&&(this._initialTransform=s.transform&&"none"!=s.transform?s.transform:""),s.transform=Ze(i,this._initialTransform)}_applyPreviewTransform(n,e){var i;const s=(null===(i=this._previewTemplate)||void 0===i?void 0:i.template)?void 0:this._initialTransform,k=Ke(n,e);this._preview.style.transform=Ze(k,s)}_getDragDistance(n){const e=this._pickupPositionOnPage;return e?{x:n.x-e.x,y:n.y-e.y}:{x:0,y:0}}_cleanupCachedDimensions(){this._boundaryRect=this._previewRect=void 0,this._parentPositions.clear()}_containInsideBoundaryOnResize(){let{x:n,y:e}=this._passiveTransform;if(0===n&&0===e||this.isDragging()||!this._boundaryElement)return;const i=this._boundaryElement.getBoundingClientRect(),s=this._rootElement.getBoundingClientRect();if(0===i.width&&0===i.height||0===s.width&&0===s.height)return;const k=i.left-s.left,G=s.right-i.right,q=i.top-s.top,oe=s.bottom-i.bottom;i.width>s.width?(k>0&&(n+=k),G>0&&(n-=G)):n=0,i.height>s.height?(q>0&&(e+=q),oe>0&&(e-=oe)):e=0,(n!==this._passiveTransform.x||e!==this._passiveTransform.y)&&this.setFreeDragPosition({y:e,x:n})}_getDragStartDelay(n){const e=this.dragStartDelay;return"number"==typeof e?e:He(n)?e.touch:e?e.mouse:0}_updateOnScroll(n){const e=this._parentPositions.handleScroll(n);if(e){const i=H(n);this._boundaryRect&&i!==this._boundaryElement&&i.contains(this._boundaryElement)&&je(this._boundaryRect,e.top,e.left),this._pickupPositionOnPage.x+=e.left,this._pickupPositionOnPage.y+=e.top,this._dropContainer||(this._activeTransform.x-=e.left,this._activeTransform.y-=e.top,this._applyRootElementTransform(this._activeTransform.x,this._activeTransform.y))}}_getViewportScrollPosition(){var n;return(null===(n=this._parentPositions.positions.get(this._document))||void 0===n?void 0:n.scrollPosition)||this._parentPositions.getViewportScrollPosition()}_getShadowRoot(){return void 0===this._cachedShadowRoot&&(this._cachedShadowRoot=T(this._rootElement)),this._cachedShadowRoot}_getPreviewInsertionPoint(n,e){const i=this._previewContainer||"global";if("parent"===i)return n;if("global"===i){const s=this._document;return e||s.fullscreenElement||s.webkitFullscreenElement||s.mozFullScreenElement||s.msFullscreenElement||s.body}return le(i)}_getPreviewRect(){return(!this._previewRect||!this._previewRect.width&&!this._previewRect.height)&&(this._previewRect=(this._preview||this._rootElement).getBoundingClientRect()),this._previewRect}_getTargetHandle(n){return this._handles.find(e=>n.target&&(n.target===e||e.contains(n.target)))}}function Ke(o,n){return`translate3d(${Math.round(o)}px, ${Math.round(n)}px, 0)`}function Tt(o,n,e){return Math.max(n,Math.min(e,o))}function He(o){return"t"===o.type[0]}function Dt(o,n){const e=o.rootNodes;if(1===e.length&&e[0].nodeType===n.ELEMENT_NODE)return e[0];const i=n.createElement("div");return e.forEach(s=>i.appendChild(s)),i}function Pt(o,n){o.style.width=`${n.width}px`,o.style.height=`${n.height}px`,o.style.transform=Ke(n.left,n.top)}function We(o,n){return Math.max(0,Math.min(n,o))}class Dn{constructor(n,e,i,s,k){this._dragDropRegistry=e,this._ngZone=s,this._viewportRuler=k,this.disabled=!1,this.sortingDisabled=!1,this.autoScrollDisabled=!1,this.autoScrollStep=2,this.enterPredicate=()=>!0,this.sortPredicate=()=>!0,this.beforeStarted=new we.x,this.entered=new we.x,this.exited=new we.x,this.dropped=new we.x,this.sorted=new we.x,this._isDragging=!1,this._itemPositions=[],this._previousSwap={drag:null,delta:0,overlaps:!1},this._draggables=[],this._siblings=[],this._orientation="vertical",this._activeSiblings=new Set,this._direction="ltr",this._viewportScrollSubscription=Ne.w0.EMPTY,this._verticalScrollDirection=0,this._horizontalScrollDirection=0,this._stopScrollTimers=new we.x,this._cachedShadowRoot=null,this._startScrollInterval=()=>{this._stopScrolling(),function Qt(o=0,n=lt.z){return o<0&&(o=0),(0,v.H)(o,o,n)}(0,ht).pipe((0,Xe.R)(this._stopScrollTimers)).subscribe(()=>{const G=this._scrollNode,q=this.autoScrollStep;1===this._verticalScrollDirection?G.scrollBy(0,-q):2===this._verticalScrollDirection&&G.scrollBy(0,q),1===this._horizontalScrollDirection?G.scrollBy(-q,0):2===this._horizontalScrollDirection&&G.scrollBy(q,0)})},this.element=le(n),this._document=i,this.withScrollableParents([this.element]),e.registerDropContainer(this),this._parentPositions=new yt(i)}dispose(){this._stopScrolling(),this._stopScrollTimers.complete(),this._viewportScrollSubscription.unsubscribe(),this.beforeStarted.complete(),this.entered.complete(),this.exited.complete(),this.dropped.complete(),this.sorted.complete(),this._activeSiblings.clear(),this._scrollNode=null,this._parentPositions.clear(),this._dragDropRegistry.removeDropContainer(this)}isDragging(){return this._isDragging}start(){this._draggingStarted(),this._notifyReceivingSiblings()}enter(n,e,i,s){let k;this._draggingStarted(),null==s?(k=this.sortingDisabled?this._draggables.indexOf(n):-1,-1===k&&(k=this._getItemIndexFromPointerPosition(n,e,i))):k=s;const G=this._activeDraggables,q=G.indexOf(n),oe=n.getPlaceholderElement();let ce=G[k];if(ce===n&&(ce=G[k+1]),!ce&&(null==k||-1===k||k<G.length-1)&&this._shouldEnterAsFirstChild(e,i)&&(ce=G[0]),q>-1&&G.splice(q,1),ce&&!this._dragDropRegistry.isDragging(ce)){const he=ce.getRootElement();he.parentElement.insertBefore(oe,he),G.splice(k,0,n)}else le(this.element).appendChild(oe),G.push(n);oe.style.transform="",this._cacheItemPositions(),this._cacheParentPositions(),this._notifyReceivingSiblings(),this.entered.next({item:n,container:this,currentIndex:this.getItemIndex(n)})}exit(n){this._reset(),this.exited.next({item:n,container:this})}drop(n,e,i,s,k,G,q){this._reset(),this.dropped.next({item:n,currentIndex:e,previousIndex:i,container:this,previousContainer:s,isPointerOverContainer:k,distance:G,dropPoint:q})}withItems(n){const e=this._draggables;return this._draggables=n,n.forEach(i=>i._withDropContainer(this)),this.isDragging()&&(e.filter(s=>s.isDragging()).every(s=>-1===n.indexOf(s))?this._reset():this._cacheItems()),this}withDirection(n){return this._direction=n,this}connectedTo(n){return this._siblings=n.slice(),this}withOrientation(n){return this._orientation=n,this}withScrollableParents(n){const e=le(this.element);return this._scrollableElements=-1===n.indexOf(e)?[e,...n]:n.slice(),this}getScrollableParents(){return this._scrollableElements}getItemIndex(n){return this._isDragging?("horizontal"===this._orientation&&"rtl"===this._direction?this._itemPositions.slice().reverse():this._itemPositions).findIndex(i=>i.drag===n):this._draggables.indexOf(n)}isReceiving(){return this._activeSiblings.size>0}_sortItem(n,e,i,s){if(this.sortingDisabled||!this._clientRect||!St(this._clientRect,.05,e,i))return;const k=this._itemPositions,G=this._getItemIndexFromPointerPosition(n,e,i,s);if(-1===G&&k.length>0)return;const q="horizontal"===this._orientation,oe=k.findIndex(xe=>xe.drag===n),ce=k[G],_e=ce.clientRect,Oe=oe>G?1:-1,Ae=this._getItemOffsetPx(k[oe].clientRect,_e,Oe),Le=this._getSiblingOffsetPx(oe,k,Oe),Fe=k.slice();(function Tn(o,n,e){const i=We(n,o.length-1),s=We(e,o.length-1);if(i===s)return;const k=o[i],G=s<i?-1:1;for(let q=i;q!==s;q+=G)o[q]=o[q+G];o[s]=k})(k,oe,G),this.sorted.next({previousIndex:oe,currentIndex:G,container:this,item:n}),k.forEach((xe,di)=>{if(Fe[di]===xe)return;const Ft=xe.drag===n,rt=Ft?Ae:Le,Bt=Ft?n.getPlaceholderElement():xe.drag.getRootElement();xe.offset+=rt,q?(Bt.style.transform=Ze(`translate3d(${Math.round(xe.offset)}px, 0, 0)`,xe.initialTransform),je(xe.clientRect,0,rt)):(Bt.style.transform=Ze(`translate3d(0, ${Math.round(xe.offset)}px, 0)`,xe.initialTransform),je(xe.clientRect,rt,0))}),this._previousSwap.overlaps=nt(_e,e,i),this._previousSwap.drag=ce.drag,this._previousSwap.delta=q?s.x:s.y}_startScrollingIfNecessary(n,e){if(this.autoScrollDisabled)return;let i,s=0,k=0;if(this._parentPositions.positions.forEach((G,q)=>{q===this._document||!G.clientRect||i||St(G.clientRect,.05,n,e)&&([s,k]=function Pn(o,n,e,i){const s=At(n,i),k=Mt(n,e);let G=0,q=0;if(s){const oe=o.scrollTop;1===s?oe>0&&(G=1):o.scrollHeight-oe>o.clientHeight&&(G=2)}if(k){const oe=o.scrollLeft;1===k?oe>0&&(q=1):o.scrollWidth-oe>o.clientWidth&&(q=2)}return[G,q]}(q,G.clientRect,n,e),(s||k)&&(i=q))}),!s&&!k){const{width:G,height:q}=this._viewportRuler.getViewportSize(),oe={width:G,height:q,top:0,right:G,bottom:q,left:0};s=At(oe,e),k=Mt(oe,n),i=window}i&&(s!==this._verticalScrollDirection||k!==this._horizontalScrollDirection||i!==this._scrollNode)&&(this._verticalScrollDirection=s,this._horizontalScrollDirection=k,this._scrollNode=i,(s||k)&&i?this._ngZone.runOutsideAngular(this._startScrollInterval):this._stopScrolling())}_stopScrolling(){this._stopScrollTimers.next()}_draggingStarted(){const n=le(this.element).style;this.beforeStarted.next(),this._isDragging=!0,this._initialScrollSnap=n.msScrollSnapType||n.scrollSnapType||"",n.scrollSnapType=n.msScrollSnapType="none",this._cacheItems(),this._viewportScrollSubscription.unsubscribe(),this._listenToScrollEvents()}_cacheParentPositions(){const n=le(this.element);this._parentPositions.cache(this._scrollableElements),this._clientRect=this._parentPositions.positions.get(n).clientRect}_cacheItemPositions(){const n="horizontal"===this._orientation;this._itemPositions=this._activeDraggables.map(e=>{const i=e.getVisibleElement();return{drag:e,offset:0,initialTransform:i.style.transform||"",clientRect:tt(i)}}).sort((e,i)=>n?e.clientRect.left-i.clientRect.left:e.clientRect.top-i.clientRect.top)}_reset(){this._isDragging=!1;const n=le(this.element).style;n.scrollSnapType=n.msScrollSnapType=this._initialScrollSnap,this._activeDraggables.forEach(e=>{var i;const s=e.getRootElement();if(s){const k=null===(i=this._itemPositions.find(G=>G.drag===e))||void 0===i?void 0:i.initialTransform;s.style.transform=k||""}}),this._siblings.forEach(e=>e._stopReceiving(this)),this._activeDraggables=[],this._itemPositions=[],this._previousSwap.drag=null,this._previousSwap.delta=0,this._previousSwap.overlaps=!1,this._stopScrolling(),this._viewportScrollSubscription.unsubscribe(),this._parentPositions.clear()}_getSiblingOffsetPx(n,e,i){const s="horizontal"===this._orientation,k=e[n].clientRect,G=e[n+-1*i];let q=k[s?"width":"height"]*i;if(G){const oe=s?"left":"top",ce=s?"right":"bottom";-1===i?q-=G.clientRect[oe]-k[ce]:q+=k[oe]-G.clientRect[ce]}return q}_getItemOffsetPx(n,e,i){const s="horizontal"===this._orientation;let k=s?e.left-n.left:e.top-n.top;return-1===i&&(k+=s?e.width-n.width:e.height-n.height),k}_shouldEnterAsFirstChild(n,e){if(!this._activeDraggables.length)return!1;const i=this._itemPositions,s="horizontal"===this._orientation;if(i[0].drag!==this._activeDraggables[0]){const G=i[i.length-1].clientRect;return s?n>=G.right:e>=G.bottom}{const G=i[0].clientRect;return s?n<=G.left:e<=G.top}}_getItemIndexFromPointerPosition(n,e,i,s){const k="horizontal"===this._orientation,G=this._itemPositions.findIndex(({drag:q,clientRect:oe})=>{if(q===n)return!1;if(s){const ce=k?s.x:s.y;if(q===this._previousSwap.drag&&this._previousSwap.overlaps&&ce===this._previousSwap.delta)return!1}return k?e>=Math.floor(oe.left)&&e<Math.floor(oe.right):i>=Math.floor(oe.top)&&i<Math.floor(oe.bottom)});return-1!==G&&this.sortPredicate(G,n,this)?G:-1}_cacheItems(){this._activeDraggables=this._draggables.slice(),this._cacheItemPositions(),this._cacheParentPositions()}_isOverContainer(n,e){return null!=this._clientRect&&nt(this._clientRect,n,e)}_getSiblingContainerFromPosition(n,e,i){return this._siblings.find(s=>s._canReceive(n,e,i))}_canReceive(n,e,i){if(!this._clientRect||!nt(this._clientRect,e,i)||!this.enterPredicate(n,this))return!1;const s=this._getShadowRoot().elementFromPoint(e,i);if(!s)return!1;const k=le(this.element);return s===k||k.contains(s)}_startReceiving(n,e){const i=this._activeSiblings;!i.has(n)&&e.every(s=>this.enterPredicate(s,this)||this._draggables.indexOf(s)>-1)&&(i.add(n),this._cacheParentPositions(),this._listenToScrollEvents())}_stopReceiving(n){this._activeSiblings.delete(n),this._viewportScrollSubscription.unsubscribe()}_listenToScrollEvents(){this._viewportScrollSubscription=this._dragDropRegistry.scrolled(this._getShadowRoot()).subscribe(n=>{if(this.isDragging()){const e=this._parentPositions.handleScroll(n);e&&(this._itemPositions.forEach(({clientRect:i})=>{je(i,e.top,e.left)}),this._itemPositions.forEach(({drag:i})=>{this._dragDropRegistry.isDragging(i)&&i._sortFromLastPointerPosition()}))}else this.isReceiving()&&this._cacheParentPositions()})}_getShadowRoot(){if(!this._cachedShadowRoot){const n=T(le(this.element));this._cachedShadowRoot=n||this._document}return this._cachedShadowRoot}_notifyReceivingSiblings(){const n=this._activeDraggables.filter(e=>e.isDragging());this._siblings.forEach(e=>e._startReceiving(this,n))}}function At(o,n){const{top:e,bottom:i,height:s}=o,k=.05*s;return n>=e-k&&n<=e+k?1:n>=i-k&&n<=i+k?2:0}function Mt(o,n){const{left:e,right:i,width:s}=o,k=.05*s;return n>=e-k&&n<=e+k?1:n>=i-k&&n<=i+k?2:0}const Je=y({passive:!1,capture:!0});let xn=(()=>{class o{constructor(e,i){this._ngZone=e,this._dropInstances=new Set,this._dragInstances=new Set,this._activeDragInstances=[],this._globalListeners=new Map,this._draggingPredicate=s=>s.isDragging(),this.pointerMove=new we.x,this.pointerUp=new we.x,this.scroll=new we.x,this._preventDefaultWhileDragging=s=>{this._activeDragInstances.length>0&&s.preventDefault()},this._persistentTouchmoveListener=s=>{this._activeDragInstances.length>0&&(this._activeDragInstances.some(this._draggingPredicate)&&s.preventDefault(),this.pointerMove.next(s))},this._document=i}registerDropContainer(e){this._dropInstances.has(e)||this._dropInstances.add(e)}registerDragItem(e){this._dragInstances.add(e),1===this._dragInstances.size&&this._ngZone.runOutsideAngular(()=>{this._document.addEventListener("touchmove",this._persistentTouchmoveListener,Je)})}removeDropContainer(e){this._dropInstances.delete(e)}removeDragItem(e){this._dragInstances.delete(e),this.stopDragging(e),0===this._dragInstances.size&&this._document.removeEventListener("touchmove",this._persistentTouchmoveListener,Je)}startDragging(e,i){if(!(this._activeDragInstances.indexOf(e)>-1)&&(this._activeDragInstances.push(e),1===this._activeDragInstances.length)){const s=i.type.startsWith("touch");this._globalListeners.set(s?"touchend":"mouseup",{handler:k=>this.pointerUp.next(k),options:!0}).set("scroll",{handler:k=>this.scroll.next(k),options:!0}).set("selectstart",{handler:this._preventDefaultWhileDragging,options:Je}),s||this._globalListeners.set("mousemove",{handler:k=>this.pointerMove.next(k),options:Je}),this._ngZone.runOutsideAngular(()=>{this._globalListeners.forEach((k,G)=>{this._document.addEventListener(G,k.handler,k.options)})})}}stopDragging(e){const i=this._activeDragInstances.indexOf(e);i>-1&&(this._activeDragInstances.splice(i,1),0===this._activeDragInstances.length&&this._clearGlobalListeners())}isDragging(e){return this._activeDragInstances.indexOf(e)>-1}scrolled(e){const i=[this.scroll];return e&&e!==this._document&&i.push(new ft.y(s=>this._ngZone.runOutsideAngular(()=>{const G=q=>{this._activeDragInstances.length&&s.next(q)};return e.addEventListener("scroll",G,!0),()=>{e.removeEventListener("scroll",G,!0)}}))),(0,pt.T)(...i)}ngOnDestroy(){this._dragInstances.forEach(e=>this.removeDragItem(e)),this._dropInstances.forEach(e=>this.removeDropContainer(e)),this._clearGlobalListeners(),this.pointerMove.complete(),this.pointerUp.complete()}_clearGlobalListeners(){this._globalListeners.forEach((e,i)=>{this._document.removeEventListener(i,e.handler,e.options)}),this._globalListeners.clear()}}return o.\u0275fac=function(e){return new(e||o)(t.LFG(t.R0b),t.LFG(p.K0))},o.\u0275prov=t.Yz7({token:o,factory:o.\u0275fac,providedIn:"root"}),o})();const kn={dragStartThreshold:5,pointerDirectionChangeThreshold:5};let Lt=(()=>{class o{constructor(e,i,s,k){this._document=e,this._ngZone=i,this._viewportRuler=s,this._dragDropRegistry=k}createDrag(e,i=kn){return new On(e,i,this._document,this._ngZone,this._viewportRuler,this._dragDropRegistry)}createDropList(e){return new Dn(e,this._dragDropRegistry,this._document,this._ngZone,this._viewportRuler)}}return o.\u0275fac=function(e){return new(e||o)(t.LFG(p.K0),t.LFG(t.R0b),t.LFG(vn),t.LFG(xn))},o.\u0275prov=t.Yz7({token:o,factory:o.\u0275fac,providedIn:"root"}),o})();const Nt=new t.OlP("CDK_DRAG_PARENT"),An=new t.OlP("CDK_DRAG_CONFIG"),Mn=new t.OlP("CdkDropList"),Vt=new t.OlP("CdkDragHandle"),Ln=new t.OlP("CdkDragPlaceholder"),Nn=new t.OlP("CdkDragPreview");let Fn=(()=>{class o{constructor(e,i,s,k,G,q,oe,ce,he,_e,Oe){this.element=e,this.dropContainer=i,this._ngZone=k,this._viewContainerRef=G,this._dir=oe,this._changeDetectorRef=he,this._selfHandle=_e,this._parentDrag=Oe,this._destroyed=new we.x,this.started=new t.vpe,this.released=new t.vpe,this.ended=new t.vpe,this.entered=new t.vpe,this.exited=new t.vpe,this.dropped=new t.vpe,this.moved=new ft.y(Ae=>{const Le=this._dragRef.moved.pipe((0,tn.U)(Fe=>({source:this,pointerPosition:Fe.pointerPosition,event:Fe.event,delta:Fe.delta,distance:Fe.distance}))).subscribe(Ae);return()=>{Le.unsubscribe()}}),this._dragRef=ce.createDrag(e,{dragStartThreshold:q&&null!=q.dragStartThreshold?q.dragStartThreshold:5,pointerDirectionChangeThreshold:q&&null!=q.pointerDirectionChangeThreshold?q.pointerDirectionChangeThreshold:5,zIndex:null==q?void 0:q.zIndex}),this._dragRef.data=this,o._dragInstances.push(this),q&&this._assignDefaults(q),i&&(this._dragRef._withDropContainer(i._dropListRef),i.addItem(this)),this._syncInputs(this._dragRef),this._handleEvents(this._dragRef)}get disabled(){return this._disabled||this.dropContainer&&this.dropContainer.disabled}set disabled(e){this._disabled=ie(e),this._dragRef.disabled=this._disabled}getPlaceholderElement(){return this._dragRef.getPlaceholderElement()}getRootElement(){return this._dragRef.getRootElement()}reset(){this._dragRef.reset()}getFreeDragPosition(){return this._dragRef.getFreeDragPosition()}ngAfterViewInit(){this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.pipe((0,mt.q)(1),(0,Xe.R)(this._destroyed)).subscribe(()=>{this._updateRootElement(),this._setupHandlesListener(),this.freeDragPosition&&this._dragRef.setFreeDragPosition(this.freeDragPosition)})})}ngOnChanges(e){const i=e.rootElementSelector,s=e.freeDragPosition;i&&!i.firstChange&&this._updateRootElement(),s&&!s.firstChange&&this.freeDragPosition&&this._dragRef.setFreeDragPosition(this.freeDragPosition)}ngOnDestroy(){this.dropContainer&&this.dropContainer.removeItem(this);const e=o._dragInstances.indexOf(this);e>-1&&o._dragInstances.splice(e,1),this._ngZone.runOutsideAngular(()=>{this._destroyed.next(),this._destroyed.complete(),this._dragRef.dispose()})}_updateRootElement(){var e;const i=this.element.nativeElement;let s=i;this.rootElementSelector&&(s=void 0!==i.closest?i.closest(this.rootElementSelector):null===(e=i.parentElement)||void 0===e?void 0:e.closest(this.rootElementSelector)),this._dragRef.withRootElement(s||i)}_getBoundaryElement(){const e=this.boundaryElement;return e?"string"==typeof e?this.element.nativeElement.closest(e):le(e):null}_syncInputs(e){e.beforeStarted.subscribe(()=>{if(!e.isDragging()){const i=this._dir,s=this.dragStartDelay,k=this._placeholderTemplate?{template:this._placeholderTemplate.templateRef,context:this._placeholderTemplate.data,viewContainer:this._viewContainerRef}:null,G=this._previewTemplate?{template:this._previewTemplate.templateRef,context:this._previewTemplate.data,matchSize:this._previewTemplate.matchSize,viewContainer:this._viewContainerRef}:null;e.disabled=this.disabled,e.lockAxis=this.lockAxis,e.dragStartDelay="object"==typeof s&&s?s:function se(o,n=0){return function ae(o){return!isNaN(parseFloat(o))&&!isNaN(Number(o))}(o)?Number(o):n}(s),e.constrainPosition=this.constrainPosition,e.previewClass=this.previewClass,e.withBoundaryElement(this._getBoundaryElement()).withPlaceholderTemplate(k).withPreviewTemplate(G).withPreviewContainer(this.previewContainer||"global"),i&&e.withDirection(i.value)}}),e.beforeStarted.pipe((0,mt.q)(1)).subscribe(()=>{var i;if(this._parentDrag)return void e.withParent(this._parentDrag._dragRef);let s=this.element.nativeElement.parentElement;for(;s;){if(s.classList.contains("cdk-drag")){e.withParent((null===(i=o._dragInstances.find(k=>k.element.nativeElement===s))||void 0===i?void 0:i._dragRef)||null);break}s=s.parentElement}})}_handleEvents(e){e.started.subscribe(()=>{this.started.emit({source:this}),this._changeDetectorRef.markForCheck()}),e.released.subscribe(()=>{this.released.emit({source:this})}),e.ended.subscribe(i=>{this.ended.emit({source:this,distance:i.distance,dropPoint:i.dropPoint}),this._changeDetectorRef.markForCheck()}),e.entered.subscribe(i=>{this.entered.emit({container:i.container.data,item:this,currentIndex:i.currentIndex})}),e.exited.subscribe(i=>{this.exited.emit({container:i.container.data,item:this})}),e.dropped.subscribe(i=>{this.dropped.emit({previousIndex:i.previousIndex,currentIndex:i.currentIndex,previousContainer:i.previousContainer.data,container:i.container.data,isPointerOverContainer:i.isPointerOverContainer,item:this,distance:i.distance,dropPoint:i.dropPoint})})}_assignDefaults(e){const{lockAxis:i,dragStartDelay:s,constrainPosition:k,previewClass:G,boundaryElement:q,draggingDisabled:oe,rootElementSelector:ce,previewContainer:he}=e;this.disabled=null!=oe&&oe,this.dragStartDelay=s||0,i&&(this.lockAxis=i),k&&(this.constrainPosition=k),G&&(this.previewClass=G),q&&(this.boundaryElement=q),ce&&(this.rootElementSelector=ce),he&&(this.previewContainer=he)}_setupHandlesListener(){this._handles.changes.pipe((0,gt.O)(this._handles),(0,nn.b)(e=>{const i=e.filter(s=>s._parentDrag===this).map(s=>s.element);this._selfHandle&&this.rootElementSelector&&i.push(this.element),this._dragRef.withHandles(i)}),(0,rn.w)(e=>(0,pt.T)(...e.map(i=>i._stateChanges.pipe((0,gt.O)(i))))),(0,Xe.R)(this._destroyed)).subscribe(e=>{const i=this._dragRef,s=e.element.nativeElement;e.disabled?i.disableHandle(s):i.enableHandle(s)})}}return o._dragInstances=[],o.\u0275fac=function(e){return new(e||o)(t.Y36(t.SBq),t.Y36(Mn,12),t.Y36(p.K0),t.Y36(t.R0b),t.Y36(t.s_b),t.Y36(An,8),t.Y36(wn,8),t.Y36(Lt),t.Y36(t.sBO),t.Y36(Vt,10),t.Y36(Nt,12))},o.\u0275dir=t.lG2({type:o,selectors:[["","cdkDrag",""]],contentQueries:function(e,i,s){if(1&e&&(t.Suo(s,Nn,5),t.Suo(s,Ln,5),t.Suo(s,Vt,5)),2&e){let k;t.iGM(k=t.CRH())&&(i._previewTemplate=k.first),t.iGM(k=t.CRH())&&(i._placeholderTemplate=k.first),t.iGM(k=t.CRH())&&(i._handles=k)}},hostAttrs:[1,"cdk-drag"],hostVars:4,hostBindings:function(e,i){2&e&&t.ekj("cdk-drag-disabled",i.disabled)("cdk-drag-dragging",i._dragRef.isDragging())},inputs:{data:["cdkDragData","data"],lockAxis:["cdkDragLockAxis","lockAxis"],rootElementSelector:["cdkDragRootElement","rootElementSelector"],boundaryElement:["cdkDragBoundary","boundaryElement"],dragStartDelay:["cdkDragStartDelay","dragStartDelay"],freeDragPosition:["cdkDragFreeDragPosition","freeDragPosition"],disabled:["cdkDragDisabled","disabled"],constrainPosition:["cdkDragConstrainPosition","constrainPosition"],previewClass:["cdkDragPreviewClass","previewClass"],previewContainer:["cdkDragPreviewContainer","previewContainer"]},outputs:{started:"cdkDragStarted",released:"cdkDragReleased",ended:"cdkDragEnded",entered:"cdkDragEntered",exited:"cdkDragExited",dropped:"cdkDragDropped",moved:"cdkDragMoved"},exportAs:["cdkDrag"],features:[t._Bn([{provide:Nt,useExisting:o}]),t.TTD]}),o})(),Bn=(()=>{class o{}return o.\u0275fac=function(e){return new(e||o)},o.\u0275mod=t.oAB({type:o}),o.\u0275inj=t.cJS({providers:[Lt],imports:[bn]}),o})();const Un=["userInteractionConfirm"],jn=["myStream"],Hn=["mainStream"],Wn=["whiteboardComponent"];function zn(o,n){if(1&o){const e=t.EpF();t.TgZ(0,"div",42)(1,"h4",43),t._uU(2,"\u062a\u0648\u062c\u0647"),t.qZA(),t.TgZ(3,"button",44),t.NdJ("click",function(){return t.CHM(e).$implicit.close("cross click")}),t.qZA()(),t.TgZ(4,"div",45)(5,"p"),t._uU(6,"\u0628\u0647 \u062f\u0644\u06cc\u0644 \u0633\u06cc\u0627\u0633\u062a \u0645\u0631\u0648\u0631\u06af\u0631\u0647\u0627 \u067e\u062e\u0634 \u062e\u0648\u062f\u06a9\u0627\u0631 \u0648\u06cc\u062f\u06cc\u0648 \u0646\u06cc\u0627\u0632\u0645\u0646\u062f \u0627\u06cc\u0646 \u0627\u0633\u062a \u06a9\u0647 \u06a9\u0627\u0631\u0628\u0631 \u0627\u0628\u062a\u062f\u0627 \u0628\u0627 \u0635\u0641\u062d\u0647 \u062a\u0639\u0627\u0645\u0644 \u062f\u0627\u0634\u062a\u0647 \u0628\u0627\u0634\u062f"),t.qZA(),t.TgZ(7,"strong"),t._uU(8,"\u0628\u0631\u0627\u06cc \u0634\u0631\u0648\u0639 \u06a9\u0644\u0627\u0633 \u062a\u0627\u06cc\u06cc\u062f \u0634\u0645\u0627 \u0644\u0627\u0632\u0645 \u0627\u0633\u062a."),t.qZA()(),t.TgZ(9,"div",46)(10,"button",47),t.NdJ("click",function(){return t.CHM(e).$implicit.close("ok click")}),t._uU(11,"\u062a\u0627\u06cc\u06cc\u062f"),t.qZA()()}}function Gn(o,n){if(1&o&&(t.TgZ(0,"div",48)(1,"strong",49),t._uU(2),t.qZA()()),2&o){const e=t.oxw();t.xp6(2),t.hij(" ",e.courseTeacher?e.courseName+" ("+e.courseTeacher.firstName+" "+e.courseTeacher.lastName+") ":"\u062f\u0631 \u062d\u0627\u0644 \u062f\u0631\u06cc\u0627\u0641\u062a..."," ")}}function Zn(o,n){1&o&&t._UZ(0,"video",50,51)}function $n(o,n){if(1&o&&t._UZ(0,"app-whiteboard",52,53),2&o){const e=t.oxw();t.Q6J("sharing",e.sharingWhiteboard)}}function Kn(o,n){if(1&o&&t._UZ(0,"app-ov-stream",56),2&o){const e=n.$implicit,i=t.oxw(2);t.Q6J("streamManager",e)("user",i.fetchServerData(e.stream.connection.data).firstName)}}function Jn(o,n){if(1&o&&(t.TgZ(0,"div",54),t.YNc(1,Kn,1,2,"app-ov-stream",55),t.qZA()),2&o){const e=t.oxw();t.xp6(1),t.Q6J("ngForOf",e.subscribers)}}function Yn(o,n){if(1&o){const e=t.EpF();t.TgZ(0,"input",57),t.NdJ("click",function(){return t.CHM(e),t.oxw().sidePanelIsOpen=!0}),t.qZA()}}function Xn(o,n){if(1&o){const e=t.EpF();t.TgZ(0,"div",65)(1,"input",66),t.NdJ("click",function(){t.CHM(e);const s=t.oxw().$implicit;return t.oxw(2).kickUser(s.id)}),t.qZA(),t.TgZ(2,"input",67),t.NdJ("click",function(){t.CHM(e);const s=t.oxw().$implicit;return t.oxw(2).restrictUser(s.id)}),t.qZA()()}}function Qn(o,n){if(1&o&&(t.TgZ(0,"li",62),t.YNc(1,Xn,3,0,"div",63),t.TgZ(2,"span",64),t._uU(3),t.qZA()()),2&o){const e=n.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngIf",i.userIsTeacher),t.xp6(2),t.hij(" ",e.firstName+" "+e.lastName," ")}}function qn(o,n){if(1&o&&(t.TgZ(0,"div",58)(1,"ul",59)(2,"li",60),t._uU(3," \u0634\u0645\u0627 "),t.qZA(),t.YNc(4,Qn,4,2,"li",61),t.qZA()()),2&o){const e=t.oxw();t.xp6(4),t.Q6J("ngForOf",e.participants)}}function ei(o,n){if(1&o&&(t.TgZ(0,"a",73),t._uU(1," open link "),t.qZA()),2&o){const e=t.oxw().$implicit;t.s9C("href",e.message.split(" ")[0],t.LSH)}}function ti(o,n){if(1&o&&(t.TgZ(0,"div",68)(1,"div",69)(2,"span",70),t._uU(3),t.qZA(),t.TgZ(4,"span",71),t._uU(5),t.qZA()(),t.TgZ(6,"p"),t._uU(7),t.YNc(8,ei,2,1,"a",72),t.qZA()()),2&o){const e=n.$implicit;t.xp6(2),t.Q6J("ngClass",0===e.sender.id?"text-secondary":"text-primary"),t.xp6(1),t.hij(" ",e.sender.firstName+" "+e.sender.lastName," "),t.xp6(2),t.Oqu(e.time),t.xp6(2),t.hij(" ",e.message," "),t.xp6(1),t.Q6J("ngIf",e.message.startsWith("http"))}}function ni(o,n){if(1&o&&(t.TgZ(0,"span"),t._uU(1),t.qZA()),2&o){const e=t.oxw();t.xp6(1),t.hij(" ",e.typists[0].user.firstName+" "," \u062f\u0631 \u062d\u0627\u0644 \u0646\u0648\u0634\u062a\u0646 \u0627\u0633\u062a... ")}}function ii(o,n){if(1&o&&(t.TgZ(0,"span"),t._uU(1),t.qZA()),2&o){const e=t.oxw();t.xp6(1),t.AsE(" ",e.typists[0].user.firstName+" "," \u0648 ",e.typists[1].user.firstName+" "," \u062f\u0631 \u062d\u0627\u0644 \u0646\u0648\u0634\u062a\u0646 \u0647\u0633\u062a\u0646\u062f... ")}}function ri(o,n){if(1&o&&(t.TgZ(0,"span"),t._uU(1),t.qZA()),2&o){const e=t.oxw();t.xp6(1),t.lnq(" ",e.typists[0].user.firstName+" "," \u060c ",e.typists[1].user.firstName+" "," \u0648 "," "+(e.typists.length-2)+" "," \u0646\u0641\u0631 \u062f\u06cc\u06af\u0631 \u062f\u0631 \u062d\u0627\u0644 \u0646\u0648\u0634\u062a\u0646 \u0647\u0633\u062a\u0646\u062f... ")}}function oi(o,n){if(1&o){const e=t.EpF();t.TgZ(0,"button",74),t.NdJ("click",function(){return t.CHM(e),t.oxw().closeSession()}),t._uU(1," \u0628\u0633\u062a\u0646 \u062c\u0644\u0633\u0647 "),t.qZA()}}function si(o,n){if(1&o){const e=t.EpF();t.TgZ(0,"input",75),t.NdJ("click",function(){return t.CHM(e),t.oxw().toggleWhiteBoard()}),t.qZA()}if(2&o){const e=t.oxw();t.Q6J("src",e.sharingWhiteboard?"assets/icons/red-whiteboard.svg":"assets/icons/whiteboard.svg",t.LSH)("disabled",e.togglingVideo||!e.session)}}const ai=[{path:"",component:(()=>{class o{constructor(e,i,s,k,G,q){var oe;this.authenticationService=e,this.videoSessionService=i,this.userDashboardService=s,this.route=k,this.router=G,this.modalService=q,this.sidePanelIsOpen=!0,this.participantsViewIsOpen=!1,this.userIsTeacher=!1,this.subscribers=[],this.participants=[],this.chatMessages=[],this.messageText="",this.msgIsSending=!1,this.publisherProperties={audioSource:void 0,videoSource:void 0,publishAudio:!1,publishVideo:!1,resolution:"640x480",frameRate:15,mirror:!1},this.selectedResolution="640x480",this.selectedFrameRate=15,this.settingIsCollapsed=!0,this.sharingScreen=!1,this.webcamActivated=!1,this.audioActivated=!1,this.togglingVideo=!1,this.togglingAudio=!1,this.sharingWhiteboard=!1,this.typists=[],this.courseId=Number(this.route.snapshot.paramMap.get("id")),this.userIsTeacher=(null===(oe=this.authenticationService.currentUserValue)||void 0===oe?void 0:oe.role)===h.u.Teacher}ngOnInit(){this.messageLog("\u062f\u0631 \u062d\u0627\u0644 \u062f\u0631\u06cc\u0627\u0641\u062a \u0627\u0637\u0644\u0627\u0639\u0627\u062a..."),this.userDashboardService.getOneCourse(this.courseId).subscribe({next:e=>{this.courseName=e.title,this.courseTeacher=e.teacher},error:e=>{console.log(e),this.messageLog(404===e.status?"\u062f\u0631\u0633 \u0645\u0648\u0631\u062f \u0646\u0638\u0631 \u06cc\u0627\u0641\u062a \u0646\u0634\u062f":"\u062e\u0637\u0627 \u062f\u0631 \u062f\u0631\u06cc\u0627\u0641\u062a \u0627\u0637\u0644\u0627\u0639\u0627\u062a \u06a9\u0644\u0627\u0633")}})}ngAfterViewInit(){this.modalService.open(this.userConfirmModal,{keyboard:!1}).result.then(()=>{this.startClassroom()},()=>{this.startClassroom()})}ngOnDestroy(){this.videoSessionService.leaveSession(this.courseId).subscribe({complete:()=>{this.session&&this.session.disconnect(),this.subscribers=[],delete this.publisher,delete this.session,delete this.openVidu,location.reload()}})}startClassroom(){setInterval(()=>{this.typists.forEach((e,i)=>{e.liveTime=e.liveTime-1,e.liveTime<1&&this.typists.splice(i,1)})},1e3),this.userIsTeacher?this.videoSessionService.createSession(this.courseId).subscribe({next:()=>{this.videoSessionService.generateToken(this.courseId).subscribe({next:e=>{this.token=e[0],console.log("token: "+this.token),this.OPEN_VIDU_CONNECTION()},error:e=>{console.log(e),this.messageLog("\u062e\u0637\u0627 \u062f\u0631 \u062f\u0631\u06cc\u0627\u0641\u062a \u062a\u0648\u06a9\u0646")}})},error:e=>{console.log(e),this.messageLog("\u062e\u0637\u0627 \u062f\u0631 \u0634\u0631\u0648\u0639 \u06a9\u0631\u062f\u0646 \u06a9\u0644\u0627\u0633")}}):this.videoSessionService.generateToken(this.courseId).subscribe({next:e=>{this.token=e[0],console.log("token: "+this.token),this.OPEN_VIDU_CONNECTION()},error:e=>{console.log(e),this.messageLog("\u062e\u0637\u0627 \u062f\u0631 \u062f\u0631\u06cc\u0627\u0641\u062a \u062a\u0648\u06a9\u0646"),404===e.status&&this.messageLog("\u06a9\u0644\u0627\u0633 \u0634\u0631\u0648\u0639 \u0646\u0634\u062f\u0647 \u0627\u0633\u062a")}})}OPEN_VIDU_CONNECTION(){var e;this.openVidu=new D.Dn,this.openVidu.setAdvancedConfiguration({publisherSpeakingEventsOptions:{interval:100,threshold:-50}}),this.session=this.openVidu.initSession(),this.session.on("streamCreated",i=>{var s,k,G,q,oe;if(this.fetchServerData(i.stream.connection.data).id===(null===(s=this.courseTeacher)||void 0===s?void 0:s.id))this.mainStreamManager=null===(k=this.session)||void 0===k?void 0:k.subscribe(i.stream,""),null===(G=this.mainStreamManager)||void 0===G||G.addVideoElement(null===(q=this.mainStreamElement)||void 0===q?void 0:q.nativeElement);else{const he=null===(oe=this.session)||void 0===oe?void 0:oe.subscribe(i.stream,"");he&&this.subscribers.push(he)}}),this.session.on("streamDestroyed",i=>{this.deleteSubscriber(i.stream.streamManager)}),this.session.on("connectionCreated",i=>{var s;if(i.connection.connectionId!==(null===(s=this.session)||void 0===s?void 0:s.connection.connectionId)){const k=this.fetchServerData(i.connection.data);this.participants.push(k)}}),this.session.on("connectionDestroyed",i=>{this.removeLeftUserFromList(this.fetchServerData(i.connection.data))}),this.session.on("sessionDisconnected",i=>{"networkDisconnect"===i.reason?this.messageLog("\u0627\u062a\u0635\u0627\u0644 \u0628\u0647 \u062c\u0644\u0633\u0647 \u0642\u0637\u0639 \u0634\u062f! (\u0645\u0634\u06a9\u0644 \u062f\u0631 \u0634\u0628\u06a9\u0647)"):"sessionClosedByServer"===i.reason?(this.messageLog("\u062c\u0644\u0633\u0647 \u062a\u0648\u0633\u0637 \u0645\u06cc\u0632\u0628\u0627\u0646 \u0628\u0633\u062a\u0647 \u0634\u062f"),this.messageLog("\u0634\u0645\u0627 \u0628\u0647 \u0635\u0641\u062d\u0647 \u062e\u0627\u0646\u0647 \u0647\u062f\u0627\u06cc\u062a \u0645\u06cc \u0634\u0648\u06cc\u062f"),(0,v.H)(5e3).subscribe(()=>{this.router.navigate(["/"]).then(()=>{location.reload()})})):"forceDisconnectByServer"===i.reason?(this.messageLog("\u0634\u0645\u0627 \u0627\u0632 \u062c\u0644\u0633\u0647 \u0627\u062e\u0631\u0627\u062c \u0634\u062f\u06cc\u062f"),this.messageLog("\u0628\u0647 \u0635\u0641\u062d\u0647 \u062e\u0627\u0646\u0647 \u0647\u062f\u0627\u06cc\u062a \u0645\u06cc \u0634\u0648\u06cc\u062f"),(0,v.H)(5e3).subscribe(()=>{this.router.navigate(["/"]).then(()=>{location.reload()})})):this.messageLog("\u0627\u062a\u0635\u0627\u0644 \u0628\u0647 \u062c\u0644\u0633\u0647 \u0642\u0637\u0639 \u0634\u062f!")}),this.session.on("reconnecting",()=>this.messageLog("\u062f\u0631\u062d\u0627\u0644 \u0627\u062a\u0635\u0627\u0644 \u0645\u062c\u062f\u062f...")),this.session.on("reconnected",()=>this.messageLog("\u0627\u062a\u0635\u0627\u0644 \u0645\u062c\u062f\u062f \u0628\u0631\u0642\u0631\u0627\u0631 \u0634\u062f.")),this.session.on("signal",i=>{var s,k;const G=this.fetchServerData(String(null===(s=i.from)||void 0===s?void 0:s.data));if("signal:chatMessage"===i.type){const q=new Date,oe={sender:G,message:String(i.data),time:q.getHours().toString().padStart(2,"0")+":"+q.getMinutes().toString().padStart(2,"0")};this.chatMessages.push(oe),this.typists.forEach((ce,he)=>{ce.user.id===G.id&&this.typists.splice(he,1)})}else if("signal:typing"===i.type)if("start"===i.data){let q=!1;this.typists.forEach(oe=>{if(oe.user.id===G.id)return oe.liveTime=5,void(q=!0)}),!q&&G.id!==(null===(k=this.authenticationService.currentUserValue)||void 0===k?void 0:k.id)&&this.typists.push({user:G,liveTime:5})}else"stop"===i.data&&this.typists.forEach((q,oe)=>{q.user.id===G.id&&this.typists.splice(oe,1)})}),this.token&&(this.messageLog("\u062f\u0631\u062d\u0627\u0644 \u0627\u062a\u0635\u0627\u0644..."),this.messageLog(this.token.replace("wss","https")),this.session.connect(this.token,"CLIENT:"+(null===(e=this.authenticationService.currentUserValue)||void 0===e?void 0:e.username)).then(()=>{this.messageLog("\u0627\u062a\u0635\u0627\u0644 \u0628\u0631\u0642\u0631\u0627\u0631 \u0634\u062f.")}).catch(i=>{this.messageLog("\u062e\u0637\u0627 \u062f\u0631 \u0627\u062a\u0635\u0627\u0644 \u0628\u0647 \u062c\u0644\u0633\u0647:\n"+i.code+i.message)}))}fetchServerData(e){const i=JSON.parse(e.split("%/%")[1]).serverData;return{id:i.id,firstName:this.b64DecodeUnicode(i.firstName),lastName:this.b64DecodeUnicode(i.lastName)}}b64DecodeUnicode(e){return e=e.replace("_","/"),decodeURIComponent(Array.prototype.map.call(atob(e),function(i){return"%"+("00"+i.charCodeAt(0).toString(16)).slice(-2)}).join(""))}deleteSubscriber(e){const i=this.subscribers.indexOf(e,0);i>-1&&this.subscribers.splice(i,1)}removeLeftUserFromList(e){console.log(e.lastName+"left the classroom");let i=-1;this.participants.forEach((s,k)=>{s.id!==e.id||(i=k)}),i>-1&&this.participants.splice(i,1)}sendMessage(){if(""===this.messageText||this.msgIsSending||!this.session)return;const e=this.messageText;this.messageText="",this.msgIsSending=!0,this.session.signal({data:e,to:[],type:"chatMessage"}).then(()=>{console.log("msg sent"),this.msgIsSending=!1}).catch(i=>{this.messageLog("error: "+i.message),this.msgIsSending=!1})}applySettingChanges(){this.publisherProperties.frameRate==this.selectedFrameRate&&this.publisherProperties.resolution==this.selectedResolution||this.togglingVideo||this.togglingAudio||(this.publisherProperties.frameRate=this.selectedFrameRate,this.publisherProperties.resolution=this.selectedResolution,this.publisherProperties.publishVideo=this.webcamActivated||this.sharingScreen||this.sharingWhiteboard,this.publisherProperties.publishAudio=this.audioActivated,this.session&&this.publisher&&!this.sharingWhiteboard&&this.session.unpublish(this.publisher).then(()=>{var i,s;this.publisher=null===(i=this.openVidu)||void 0===i?void 0:i.initPublisher("",this.publisherProperties),this.publisher&&(null===(s=this.session)||void 0===s||s.publish(this.publisher).then(()=>{var k,G;null===(k=this.publisher)||void 0===k||k.addVideoElement(null===(G=this.myStreamElement)||void 0===G?void 0:G.nativeElement)}))}))}toggleWebcam(){console.log("toggle webcam"),!this.togglingVideo&&(this.togglingVideo=!0,this.webcamActivated=!this.webcamActivated,this.publisherProperties.publishVideo=this.webcamActivated,this.webcamActivated&&(this.sharingWhiteboard=!1,this.sharingScreen=!1,this.publisherProperties.videoSource=void 0),this.checkPublisherVideoChanges())}toggleAudio(){var e,i,s;this.togglingAudio||(this.togglingAudio=!0,this.audioActivated=!this.audioActivated,!this.publisher&&this.audioActivated?(this.publisherProperties.publishAudio=!0,this.publisherProperties.videoSource=void 0,this.publisher=null===(e=this.openVidu)||void 0===e?void 0:e.initPublisher("",this.publisherProperties),this.publisher&&(null===(i=this.session)||void 0===i||i.publish(this.publisher).finally(()=>{var k,G;null===(k=this.publisher)||void 0===k||k.addVideoElement(null===(G=this.myStreamElement)||void 0===G?void 0:G.nativeElement),this.togglingAudio=!1}))):this.publisher&&this.audioActivated?(this.publisherProperties.publishAudio=!0,this.publisher.publishAudio(!0),this.togglingAudio=!1):this.publisher&&!this.audioActivated&&(this.publisherProperties.publishAudio=!1,this.publisherProperties.publishVideo?null===(s=this.session)||void 0===s||s.unpublish(this.publisher).finally(()=>{this.publisher=void 0,this.togglingAudio=!1}):(this.publisher.publishAudio(!1),this.togglingAudio=!1)))}toggleScreenShare(){console.warn(this.sharingScreen),!this.togglingVideo&&(this.togglingVideo=!0,this.sharingScreen=!this.sharingScreen,this.publisherProperties.publishVideo=this.sharingScreen,this.sharingScreen&&(this.webcamActivated=!1,this.sharingWhiteboard=!1,this.publisherProperties.videoSource="screen"),this.checkPublisherVideoChanges())}toggleWhiteBoard(){var e,i;console.log("toggle whiteboard"),!this.togglingVideo&&(this.togglingVideo=!0,this.sharingWhiteboard=!this.sharingWhiteboard,this.publisherProperties.publishVideo=this.sharingWhiteboard,this.sharingWhiteboard&&(this.whiteboardVideoTrack=null===(i=null===(e=this.whiteboard)||void 0===e?void 0:e.canvas)||void 0===i?void 0:i.captureStream(10).getVideoTracks()[0],this.webcamActivated=!1,this.sharingScreen=!1,this.publisherProperties.videoSource=this.whiteboardVideoTrack),this.checkPublisherVideoChanges())}closeSession(){this.videoSessionService.closeSession(this.courseId).subscribe({complete:()=>{}})}kickUser(e){this.videoSessionService.removeUser(this.courseId,e).subscribe(()=>{var i;null===(i=this.session)||void 0===i||i.signal({data:`user ${e} kicked`,to:[],type:"chatMessage"}).then(()=>{console.log("msg sent")}).catch(s=>{this.messageLog(s.message)})})}restrictUser(e){this.subscribers.forEach(i=>{if(this.fetchServerData(i.stream.connection.data).id===e)return console.log(i.stream.streamId),void this.videoSessionService.restrictUser(this.courseId,i.stream.streamId).subscribe(()=>{this.messageLog(`user ${e} restricted`)})})}messageLog(e){const i=new Date,s={sender:{id:0,firstName:"",lastName:"system"},message:e,time:i.getHours().toString().padStart(2,"0")+":"+i.getMinutes().toString().padStart(2,"0")};this.chatMessages.push(s)}checkPublisherVideoChanges(){var e,i,s,k,G,q,oe,ce;this.publisher?this.publisherProperties.publishVideo?(this.webcamActivated&&void 0===this.publisherProperties.videoSource?null===(e=this.openVidu)||void 0===e||e.getUserMedia({audioSource:!1,videoSource:void 0,resolution:this.publisherProperties.resolution,frameRate:this.publisherProperties.frameRate}).then(he=>{var _e;const Oe=he.getVideoTracks()[0];null===(_e=this.publisher)||void 0===_e||_e.replaceTrack(Oe).then(()=>{this.togglingVideo=!1})}):this.sharingScreen&&"screen"===this.publisherProperties.videoSource?(null===(i=this.publisher)||void 0===i||i.once("accessAllowed",()=>{var he,_e;null===(he=this.publisher)||void 0===he||he.stream.getMediaStream().getVideoTracks()[0].addEventListener("ended",()=>{console.log('User pressed the "Stop sharing" button (ended)'),this.toggleScreenShare()}),null===(_e=this.openVidu)||void 0===_e||_e.getUserMedia({audioSource:!1,videoSource:"screen",resolution:this.publisherProperties.resolution,frameRate:this.publisherProperties.frameRate}).then(Oe=>{var Ae;const Le=Oe.getVideoTracks()[0];null===(Ae=this.publisher)||void 0===Ae||Ae.replaceTrack(Le).then(()=>{this.togglingVideo=!1})})}),null===(s=this.publisher)||void 0===s||s.once("accessDenied",()=>{this.messageLog("\u0627\u062c\u0627\u0632\u0647 \u062f\u062a\u0633\u0631\u0633\u06cc \u0628\u0647 \u0635\u0641\u062d\u0647 \u0646\u0645\u0627\u06cc\u0634 \u062f\u0627\u062f\u0647 \u0646\u0634\u062f."),this.publisherProperties.publishVideo=!1,this.sharingScreen=!1,this.togglingVideo=!1})):this.sharingWhiteboard&&this.publisherProperties.videoSource===this.whiteboardVideoTrack&&(console.log(""),this.whiteboardVideoTrack&&this.publisher.replaceTrack(this.whiteboardVideoTrack).then(()=>{this.togglingVideo=!1})),this.publisher.publishVideo(!0).then(()=>{this.togglingVideo=!1})):(console.log("1"),this.audioActivated?this.publisher.publishVideo(!1).then(()=>{this.togglingVideo=!1}):(console.log("2"),null===(k=this.session)||void 0===k||k.unpublish(this.publisher).then(()=>{this.publisher=void 0,this.togglingVideo=!1}))):(this.publisherProperties.publishAudio||this.publisherProperties.publishVideo)&&(this.publisher=null===(G=this.openVidu)||void 0===G?void 0:G.initPublisher("",this.publisherProperties),"screen"===this.publisherProperties.videoSource&&(null===(q=this.publisher)||void 0===q||q.once("accessAllowed",()=>{var he;null===(he=this.publisher)||void 0===he||he.stream.getMediaStream().getVideoTracks()[0].addEventListener("ended",()=>{console.log('User pressed the "Stop sharing" button(ended)'),this.toggleScreenShare()})}),null===(oe=this.publisher)||void 0===oe||oe.once("accessDenied",()=>{this.messageLog("\u0627\u062c\u0627\u0632\u0647 \u062f\u062a\u0633\u0631\u0633\u06cc \u0628\u0647 \u0635\u0641\u062d\u0647 \u0646\u0645\u0627\u06cc\u0634 \u062f\u0627\u062f\u0647 \u0646\u0634\u062f."),this.publisherProperties.publishVideo=!1,this.sharingScreen=!1,this.togglingVideo=!1})),this.publisher&&(null===(ce=this.session)||void 0===ce||ce.publish(this.publisher).finally(()=>{var he,_e;null===(he=this.publisher)||void 0===he||he.addVideoElement(null===(_e=this.myStreamElement)||void 0===_e?void 0:_e.nativeElement),this.togglingVideo=!1})))}typingChange(){this.session&&this.session.sessionConnected()&&this.session.signal({data:""===this.messageText?"stop":"start",to:[],type:"typing"}).catch(()=>{console.log("ggg")})}}return o.\u0275fac=function(e){return new(e||o)(t.Y36(f.$),t.Y36(m.Y),t.Y36(_.B),t.Y36(L.gz),t.Y36(L.F0),t.Y36(u.FF))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-classroom"]],viewQuery:function(e,i){if(1&e&&(t.Gf(Un,5),t.Gf(jn,5),t.Gf(Hn,5),t.Gf(Wn,5)),2&e){let s;t.iGM(s=t.CRH())&&(i.userConfirmModal=s.first),t.iGM(s=t.CRH())&&(i.myStreamElement=s.first),t.iGM(s=t.CRH())&&(i.mainStreamElement=s.first),t.iGM(s=t.CRH())&&(i.whiteboard=s.first)}},decls:68,vars:28,consts:[["userInteractionConfirm",""],[1,"d-flex","h-100","w-100","overflow-hidden"],[1,"d-flex","flex-grow-1","position-relative"],[1,"flex-grow-1","h-100","p-2"],["class","d-flex justify-content-center pb-2",4,"ngIf"],["class","main-stream-video",4,"ngIf"],[3,"sharing",4,"ngIf"],["class","others-stream-container",4,"ngIf"],[1,"w-100","h-100","position-absolute","p-2",2,"pointer-events","none"],["id","my-stream-container",1,"w-100","h-100"],["cdkDrag","","cdkDragBoundary","#my-stream-container",1,"d-table",2,"pointer-events","auto"],["oncontextmenu","return false;",1,"my-stream-box",3,"hidden"],["myStream",""],["type","image","class","open-panel-button icon-button","src","assets/icons/arrow-left.svg","alt","arrow-left-icon",3,"click",4,"ngIf"],[1,"d-flex","flex-column","side-panel","position-relative",3,"ngClass"],[1,"border","border-bottom","d-flex","justify-content-between","align-items-center"],["type","image","src","assets/icons/arrow-right.svg","alt","arrow-right-icon",1,"icon-button",3,"click"],["type","image","alt","people-toggle-icon","width","24",3,"src","click"],["class","participants-view",4,"ngIf"],[1,"flex-grow-1","d-flex","flex-column-reverse","overflow-auto"],[1,"w-100","px-2"],["class","chat-message-container",4,"ngFor","ngForOf"],["dir","rtl",1,"px-2","text-secondary",2,"height","1.5em","min-height","1.5em"],[4,"ngIf"],[3,"ngbCollapse","ngbCollapseChange"],["setting","ngbCollapse"],[1,"d-flex","justify-content-between","p-2","border-top"],[1,"form-control","form-control-sm","w-50",3,"ngModel","ngModelChange"],[1,"d-flex","justify-content-between","p-2"],[1,"d-flex","justify-content-end","p-2"],[1,"btn","btn-outline-success",3,"click"],["class","btn btn-outline-danger mx-2",3,"click",4,"ngIf"],[1,"border","border-top"],[1,"d-flex","my-2"],[1,"btn","btn-primary","ms-2",3,"disabled","title","click"],["dir","rtl","placeholder","\u0627\u0631\u0633\u0627\u0644 \u067e\u06cc\u0627\u0645",1,"form-control","mx-2",3,"ngModel","ngModelChange","keydown.enter","input"],[1,"d-flex","flex-row-reverse","m-2"],["type","image","alt","mic-on","title","\u0645\u06cc\u06a9\u0631\u0648\u0641\u0648\u0646",1,"icon-button",3,"src","disabled","click"],["type","image","alt","camera-on","title","\u062f\u0648\u0631\u0628\u06cc\u0646",1,"icon-button",3,"src","disabled","click"],["type","image","alt","screen","title","\u0627\u0634\u062a\u0631\u0627\u06a9 \u06af\u0630\u0627\u0631\u06cc \u062a\u0635\u0648\u06cc\u0631",1,"icon-button",3,"src","disabled","click"],["type","image","class","icon-button","alt","whiteboard","title","\u0648\u0627\u06cc\u062a \u0628\u0648\u0631\u062f",3,"src","disabled","click",4,"ngIf"],["type","image","role","button","src","assets/icons/setting.svg","alt","setting","title","\u062a\u0646\u0638\u06cc\u0645\u0627\u062a",1,"icon-button",3,"click"],[1,"modal-header"],[1,"modal-title"],["aria-label","Close",1,"btn-close",3,"click"],["dir","rtl",1,"modal-body"],[1,"modal-footer","text-center"],["type","button","ngbAutofocus","",1,"btn","btn-primary",3,"click"],[1,"d-flex","justify-content-center","pb-2"],["dir","rtl"],[1,"main-stream-video"],["mainStream",""],[3,"sharing"],["whiteboardComponent",""],[1,"others-stream-container"],[3,"streamManager","user",4,"ngFor","ngForOf"],[3,"streamManager","user"],["type","image","src","assets/icons/arrow-left.svg","alt","arrow-left-icon",1,"open-panel-button","icon-button",3,"click"],[1,"participants-view"],[1,"list-group"],[1,"list-group-item","text-end"],["class","list-group-item d-flex align-items-center",4,"ngFor","ngForOf"],[1,"list-group-item","d-flex","align-items-center"],["class","d-flex",4,"ngIf"],[1,"ms-auto"],[1,"d-flex"],["type","image","src","assets/icons/exit.svg","alt","kick","title","\u0627\u062e\u0631\u0627\u062c",1,"icon-button",3,"click"],["type","image","src","assets/icons/restrict.svg","alt","restrict","title","\u0633\u06a9\u0648\u062a",1,"icon-button",3,"click"],[1,"chat-message-container"],[1,"d-flex","justify-content-between","align-items-center"],[3,"ngClass"],[1,"font-monospace","small","text-secondary"],["target","_blank",3,"href",4,"ngIf"],["target","_blank",3,"href"],[1,"btn","btn-outline-danger","mx-2",3,"click"],["type","image","alt","whiteboard","title","\u0648\u0627\u06cc\u062a \u0628\u0648\u0631\u062f",1,"icon-button",3,"src","disabled","click"]],template:function(e,i){if(1&e){const s=t.EpF();t.YNc(0,zn,12,0,"ng-template",null,0,t.W1O),t.TgZ(2,"div",1)(3,"div",2)(4,"div",3),t.YNc(5,Gn,3,1,"div",4),t.YNc(6,Zn,2,0,"video",5),t.YNc(7,$n,2,1,"app-whiteboard",6),t.qZA(),t.YNc(8,Jn,2,1,"div",7),t.TgZ(9,"div",8)(10,"div",9)(11,"div",10),t._UZ(12,"video",11,12),t.qZA()()(),t.YNc(14,Yn,1,0,"input",13),t.qZA(),t.TgZ(15,"div",14)(16,"div",15)(17,"input",16),t.NdJ("click",function(){return i.sidePanelIsOpen=!1}),t.qZA(),t.TgZ(18,"strong"),t._uU(19),t.qZA(),t.TgZ(20,"input",17),t.NdJ("click",function(){return i.participantsViewIsOpen=!i.participantsViewIsOpen}),t.qZA()(),t.YNc(21,qn,5,1,"div",18),t.TgZ(22,"div",19)(23,"div",20),t.YNc(24,ti,9,5,"div",21),t.qZA()(),t.TgZ(25,"div",22),t.YNc(26,ni,2,1,"span",23),t.YNc(27,ii,2,2,"span",23),t.YNc(28,ri,2,3,"span",23),t.qZA(),t.TgZ(29,"div",24,25),t.NdJ("ngbCollapseChange",function(G){return i.settingIsCollapsed=G}),t.TgZ(31,"div",26)(32,"select",27),t.NdJ("ngModelChange",function(G){return i.selectedResolution=G}),t.TgZ(33,"option"),t._uU(34,"1280x720"),t.qZA(),t.TgZ(35,"option"),t._uU(36,"640x480"),t.qZA(),t.TgZ(37,"option"),t._uU(38,"320x240"),t.qZA()(),t.TgZ(39,"span"),t._uU(40,"\u0631\u0632\u0648\u0644\u0648\u0634\u0646"),t.qZA()(),t.TgZ(41,"div",28)(42,"select",27),t.NdJ("ngModelChange",function(G){return i.selectedFrameRate=G}),t.TgZ(43,"option"),t._uU(44,"30"),t.qZA(),t.TgZ(45,"option"),t._uU(46,"20"),t.qZA(),t.TgZ(47,"option"),t._uU(48,"15"),t.qZA(),t.TgZ(49,"option"),t._uU(50,"5"),t.qZA()(),t.TgZ(51,"span"),t._uU(52,"\u0631\u0641\u0631\u0634 \u0631\u06cc\u062a"),t.qZA()(),t.TgZ(53,"div",29)(54,"button",30),t.NdJ("click",function(){t.CHM(s);const G=t.MAs(30);return i.applySettingChanges(),G.toggle()}),t._uU(55," \u0627\u0639\u0645\u0627\u0644 \u062a\u063a\u06cc\u06cc\u0631\u0627\u062a "),t.qZA(),t.YNc(56,oi,2,0,"button",31),t.qZA()(),t.TgZ(57,"div",32)(58,"div",33)(59,"button",34),t.NdJ("click",function(){return i.sendMessage()}),t._uU(60,"\u0627\u0631\u0633\u0627\u0644"),t.qZA(),t.TgZ(61,"input",35),t.NdJ("ngModelChange",function(G){return i.messageText=G})("keydown.enter",function(){return i.sendMessage()})("input",function(){return i.typingChange()}),t.qZA()(),t.TgZ(62,"div",36)(63,"input",37),t.NdJ("click",function(){return i.toggleAudio()}),t.qZA(),t.TgZ(64,"input",38),t.NdJ("click",function(){return i.toggleWebcam()}),t.qZA(),t.TgZ(65,"input",39),t.NdJ("click",function(){return i.toggleScreenShare()}),t.qZA(),t.YNc(66,si,1,2,"input",40),t.TgZ(67,"input",41),t.NdJ("click",function(){return t.CHM(s),t.MAs(30).toggle()}),t.qZA()()()()()}2&e&&(t.xp6(5),t.Q6J("ngIf",!i.userIsTeacher),t.xp6(1),t.Q6J("ngIf",!i.userIsTeacher),t.xp6(1),t.Q6J("ngIf",i.userIsTeacher),t.xp6(1),t.Q6J("ngIf",i.subscribers.length||i.userIsTeacher),t.xp6(4),t.Q6J("hidden",!i.publisher||!i.publisherProperties.publishVideo),t.xp6(2),t.Q6J("ngIf",!i.sidePanelIsOpen),t.xp6(1),t.Q6J("ngClass",i.sidePanelIsOpen?"side-panel-open":""),t.xp6(4),t.Oqu(i.participantsViewIsOpen?"\u0627\u0641\u0631\u0627\u062f \u062d\u0627\u0638\u0631":"\u06af\u0641\u062a\u06af\u0648"),t.xp6(1),t.s9C("src",i.participantsViewIsOpen?"assets/icons/chat-icon.svg":"assets/icons/people.svg",t.LSH),t.xp6(1),t.Q6J("ngIf",i.participantsViewIsOpen),t.xp6(3),t.Q6J("ngForOf",i.chatMessages),t.xp6(2),t.Q6J("ngIf",1===i.typists.length),t.xp6(1),t.Q6J("ngIf",2===i.typists.length),t.xp6(1),t.Q6J("ngIf",i.typists.length>2),t.xp6(1),t.Q6J("ngbCollapse",i.settingIsCollapsed),t.xp6(3),t.Q6J("ngModel",i.selectedResolution),t.xp6(10),t.Q6J("ngModel",i.selectedFrameRate),t.xp6(14),t.Q6J("ngIf",i.userIsTeacher),t.xp6(3),t.s9C("title",i.session?"\u0627\u0631\u0633\u0627\u0644 \u067e\u06cc\u0627\u0645":"\u0627\u062a\u0635\u0627\u0644 \u0628\u0631\u0642\u0631\u0627\u0631 \u0646\u06cc\u0633\u062a"),t.Q6J("disabled",i.msgIsSending||!i.session),t.xp6(2),t.Q6J("ngModel",i.messageText),t.xp6(2),t.Q6J("src",i.audioActivated?"assets/icons/mic-on.svg":"assets/icons/mic-off.svg",t.LSH)("disabled",i.togglingAudio||!i.session),t.xp6(1),t.Q6J("src",i.webcamActivated?"assets/icons/webcam-on.svg":"assets/icons/webcam-off.svg",t.LSH)("disabled",i.togglingVideo||!i.session),t.xp6(1),t.Q6J("src",i.sharingScreen?"assets/icons/red-screen.svg":"assets/icons/screen.svg",t.LSH)("disabled",i.togglingVideo||!i.session),t.xp6(1),t.Q6J("ngIf",i.userIsTeacher))},directives:[p.O5,I,p.sg,g,Fn,p.mk,u._D,P.EJ,P.JJ,P.On,P.YN,P.Kr,P.Fj],styles:[".side-panel[_ngcontent-%COMP%]{width:20rem;min-width:20rem;height:100%;max-height:100%;margin-right:-20rem;transition:margin-right .5s;border-left:#000000 1px solid}.side-panel-open[_ngcontent-%COMP%]{margin-right:0}.open-panel-button[_ngcontent-%COMP%]{position:absolute;right:0;top:.25rem}.main-stream-video[_ngcontent-%COMP%]{border:2px solid gray;border-radius:4px;width:100%;max-height:90%;max-width:100%}.others-stream-container[_ngcontent-%COMP%]{padding:2.2rem .5rem .5rem;width:20rem;max-height:100%;overflow-y:auto}.others-stream-container[_ngcontent-%COMP%] video[_ngcontent-%COMP%]{border-radius:4px;width:100%;max-height:100%;max-width:100%}.my-stream-box[_ngcontent-%COMP%]{max-height:15rem;max-width:15rem;box-sizing:border-box;display:flex;justify-content:center;align-items:center;text-align:center;border-radius:4px;transition:box-shadow .2s cubic-bezier(0,0,.2,1);box-shadow:0 3px 1px -2px #0003,0 2px 2px #00000024,0 1px 5px #0000001f}.my-stream-box[_ngcontent-%COMP%]:active{box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.participants-view[_ngcontent-%COMP%]{position:absolute;top:2rem;padding-bottom:2rem;width:100%;height:100%;max-height:100%;z-index:1;background-color:#d3d3d3;overflow:auto}.messages-container[_ngcontent-%COMP%]{max-height:100%;overflow:auto}.chat-message-container[_ngcontent-%COMP%]{direction:rtl;width:100%;max-width:100%;padding-left:10px;padding-right:10px;border-radius:5px;word-wrap:break-word;background-color:#fff;transition:background-color .2s;overflow:hidden;cursor:context-menu}.chat-message-container[_ngcontent-%COMP%]:hover{background-color:#d3d3d3}.icon-button[_ngcontent-%COMP%]{height:2rem;padding:.2rem;border-radius:5px;transition:background-color .2s}.icon-button[_ngcontent-%COMP%]:hover:enabled{background-color:#d3d3d3}.icon-button[_ngcontent-%COMP%]:disabled{opacity:.75}"]}),o})()}];let ci=(()=>{class o{}return o.\u0275fac=function(e){return new(e||o)},o.\u0275mod=t.oAB({type:o}),o.\u0275inj=t.cJS({imports:[[L.Bz.forChild(ai)],L.Bz]}),o})(),li=(()=>{class o{}return o.\u0275fac=function(e){return new(e||o)},o.\u0275mod=t.oAB({type:o}),o.\u0275inj=t.cJS({imports:[[p.ez,ci,Bn,P.u5,u.lQ]]}),o})()},9069:ne=>{"use strict";var p,U="object"==typeof Reflect?Reflect:null,w=U&&"function"==typeof U.apply?U.apply:function(E,l,a){return Function.prototype.apply.call(E,l,a)};p=U&&"function"==typeof U.ownKeys?U.ownKeys:Object.getOwnPropertySymbols?function(E){return Object.getOwnPropertyNames(E).concat(Object.getOwnPropertySymbols(E))}:function(E){return Object.getOwnPropertyNames(E)};var D=Number.isNaN||function(E){return E!=E};function h(){h.init.call(this)}ne.exports=h,ne.exports.once=function j(M,E){return new Promise(function(l,a){function d(C){M.removeListener(E,V),a(C)}function V(){"function"==typeof M.removeListener&&M.removeListener("error",d),l([].slice.call(arguments))}c(M,E,V,{once:!0}),"error"!==E&&function g(M,E,l){"function"==typeof M.on&&c(M,"error",E,l)}(M,d,{once:!0})})},h.EventEmitter=h,h.prototype._events=void 0,h.prototype._eventsCount=0,h.prototype._maxListeners=void 0;var v=10;function t(M){if("function"!=typeof M)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof M)}function f(M){return void 0===M._maxListeners?h.defaultMaxListeners:M._maxListeners}function m(M,E,l,a){var d,V,C;if(t(l),void 0===(V=M._events)?(V=M._events=Object.create(null),M._eventsCount=0):(void 0!==V.newListener&&(M.emit("newListener",E,l.listener?l.listener:l),V=M._events),C=V[E]),void 0===C)C=V[E]=l,++M._eventsCount;else if("function"==typeof C?C=V[E]=a?[l,C]:[C,l]:a?C.unshift(l):C.push(l),(d=f(M))>0&&C.length>d&&!C.warned){C.warned=!0;var y=new Error("Possible EventEmitter memory leak detected. "+C.length+" "+String(E)+" listeners added. Use emitter.setMaxListeners() to increase limit");y.name="MaxListenersExceededWarning",y.emitter=M,y.type=E,y.count=C.length,function L(M){console&&console.warn&&console.warn(M)}(y)}return M}function _(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function u(M,E,l){var a={fired:!1,wrapFn:void 0,target:M,type:E,listener:l},d=_.bind(a);return d.listener=l,a.wrapFn=d,d}function P(M,E,l){var a=M._events;if(void 0===a)return[];var d=a[E];return void 0===d?[]:"function"==typeof d?l?[d.listener||d]:[d]:l?function J(M){for(var E=new Array(M.length),l=0;l<E.length;++l)E[l]=M[l].listener||M[l];return E}(d):I(d,d.length)}function B(M){var E=this._events;if(void 0!==E){var l=E[M];if("function"==typeof l)return 1;if(void 0!==l)return l.length}return 0}function I(M,E){for(var l=new Array(E),a=0;a<E;++a)l[a]=M[a];return l}function c(M,E,l,a){if("function"==typeof M.on)a.once?M.once(E,l):M.on(E,l);else{if("function"!=typeof M.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof M);M.addEventListener(E,function d(V){a.once&&M.removeEventListener(E,d),l(V)})}}Object.defineProperty(h,"defaultMaxListeners",{enumerable:!0,get:function(){return v},set:function(M){if("number"!=typeof M||M<0||D(M))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+M+".");v=M}}),h.init=function(){(void 0===this._events||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},h.prototype.setMaxListeners=function(E){if("number"!=typeof E||E<0||D(E))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+E+".");return this._maxListeners=E,this},h.prototype.getMaxListeners=function(){return f(this)},h.prototype.emit=function(E){for(var l=[],a=1;a<arguments.length;a++)l.push(arguments[a]);var d="error"===E,V=this._events;if(void 0!==V)d=d&&void 0===V.error;else if(!d)return!1;if(d){var C;if(l.length>0&&(C=l[0]),C instanceof Error)throw C;var y=new Error("Unhandled error."+(C?" ("+C.message+")":""));throw y.context=C,y}var N=V[E];if(void 0===N)return!1;if("function"==typeof N)w(N,this,l);else{var r=N.length,b=I(N,r);for(a=0;a<r;++a)w(b[a],this,l)}return!0},h.prototype.on=h.prototype.addListener=function(E,l){return m(this,E,l,!1)},h.prototype.prependListener=function(E,l){return m(this,E,l,!0)},h.prototype.once=function(E,l){return t(l),this.on(E,u(this,E,l)),this},h.prototype.prependOnceListener=function(E,l){return t(l),this.prependListener(E,u(this,E,l)),this},h.prototype.off=h.prototype.removeListener=function(E,l){var a,d,V,C,y;if(t(l),void 0===(d=this._events))return this;if(void 0===(a=d[E]))return this;if(a===l||a.listener===l)0==--this._eventsCount?this._events=Object.create(null):(delete d[E],d.removeListener&&this.emit("removeListener",E,a.listener||l));else if("function"!=typeof a){for(V=-1,C=a.length-1;C>=0;C--)if(a[C]===l||a[C].listener===l){y=a[C].listener,V=C;break}if(V<0)return this;0===V?a.shift():function R(M,E){for(;E+1<M.length;E++)M[E]=M[E+1];M.pop()}(a,V),1===a.length&&(d[E]=a[0]),void 0!==d.removeListener&&this.emit("removeListener",E,y||l)}return this},h.prototype.removeAllListeners=function(E){var l,a,d;if(void 0===(a=this._events))return this;if(void 0===a.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==a[E]&&(0==--this._eventsCount?this._events=Object.create(null):delete a[E]),this;if(0===arguments.length){var C,V=Object.keys(a);for(d=0;d<V.length;++d)"removeListener"!==(C=V[d])&&this.removeAllListeners(C);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(l=a[E]))this.removeListener(E,l);else if(void 0!==l)for(d=l.length-1;d>=0;d--)this.removeListener(E,l[d]);return this},h.prototype.listeners=function(E){return P(this,E,!0)},h.prototype.rawListeners=function(E){return P(this,E,!1)},h.listenerCount=function(M,E){return"function"==typeof M.listenerCount?M.listenerCount(E):B.call(M,E)},h.prototype.listenerCount=B,h.prototype.eventNames=function(){return this._eventsCount>0?p(this._events):[]}},4491:(ne,U,w)=>{"use strict";var p=w(1897);ne.exports=function(D){var f,h={stun:(D||{}).stun||w(8808),turn:(D||{}).turn||w(4576)},t=(D||{}).turnCount||0;function m(_,u){for(var I,P=[],B=[].concat(h[_]);B.length&&P.length<u;)I=Math.random()*B.length|0,P=P.concat(B.splice(I,1));return P.map(function(R){return"string"==typeof R||R instanceof String?p(_+":"+R):R})}return f=[].concat(m("stun",(D||{}).stunCount||2)),t&&(f=f.concat(m("turn",t))),f}},5164:(ne,U,w)=>{var D,p=w(2069);"undefined"!=typeof window&&(D=window.AudioContext||window.webkitAudioContext);var h=null;ne.exports=function(v,m){var f=new p;if(!D)return f;var J,j,g,_=(m=m||{}).smoothing||.1,u=m.interval||50,P=m.threshold,B=m.play,I=m.history||10,R=!0;h=m.audioContext||h||new D,(g=h.createAnalyser()).fftSize=512,g.smoothingTimeConstant=_,j=new Float32Array(g.frequencyBinCount),v.jquery&&(v=v[0]),v instanceof HTMLAudioElement||v instanceof HTMLVideoElement?(J=h.createMediaElementSource(v),void 0===B&&(B=!0),P=P||-50):(J=h.createMediaStreamSource(v),P=P||-50),J.connect(g),B&&g.connect(h.destination),f.speaking=!1,f.suspend=function(){return h.suspend()},f.resume=function(){return h.resume()},Object.defineProperty(f,"state",{get:function(){return h.state}}),h.onstatechange=function(){f.emit("state_change",h.state)},f.setThreshold=function(E){P=E},f.setInterval=function(E){u=E},f.stop=function(){R=!1,f.emit("volume_change",-100,P),f.speaking&&(f.speaking=!1,f.emit("stopped_speaking")),g.disconnect(),J.disconnect()},f.speakingHistory=[];for(var c=0;c<I;c++)f.speakingHistory.push(0);var M=function(){setTimeout(function(){if(R){var E=function L(v,t){var f=-1/0;v.getFloatFrequencyData(t);for(var m=4,_=t.length;m<_;m++)t[m]>f&&t[m]<0&&(f=t[m]);return f}(g,j);f.emit("volume_change",E,P);var l=0;if(E>P&&!f.speaking){for(var a=f.speakingHistory.length-3;a<f.speakingHistory.length;a++)l+=f.speakingHistory[a];l>=2&&(f.speaking=!0,f.emit("speaking"))}else if(E<P&&f.speaking){for(a=0;a<f.speakingHistory.length;a++)l+=f.speakingHistory[a];0==l&&(f.speaking=!1,f.emit("stopped_speaking"))}f.speakingHistory.shift(),f.speakingHistory.push(0+(E>P)),M()}},u)};return M(),f}},3894:ne=>{ne.exports="function"==typeof Object.create?function(w,p){p&&(w.super_=p,w.prototype=Object.create(p.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}))}:function(w,p){if(p){w.super_=p;var L=function(){};L.prototype=p.prototype,w.prototype=new L,w.prototype.constructor=w}}},8659:function(ne,U){var D,w=this&&this.__extends||(D=function(h,v){return(D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,f){t.__proto__=f}||function(t,f){for(var m in f)Object.prototype.hasOwnProperty.call(f,m)&&(t[m]=f[m])})(h,v)},function(h,v){function t(){this.constructor=h}D(h,v),h.prototype=null===v?Object.create(v):(t.prototype=v.prototype,new t)});function p(D){if(!D)return p.__;Array.prototype.reduce||(Array.prototype.reduce=function(t,f){for(var m=f,_=0;_<this.length;_++)m=t(m,this[_],_,this);return m});var h="";return("."+D).split(".").reduce(function(t,f,m,_){h?h+="."+f:h=f;var u=t["__"+h];return void 0===u&&(p.Logger.prototype=t,u=new p.Logger(h),t["__"+h]=u),u},p.__)}(function(D){function h(S,T,F){if(void 0!==T[S]){if(null===T[S])return void delete F[S];F[S]=T[S]}}function v(S){if(null!=D.enabled&&!D.enabled)return!1;try{if(S.userAgentRegex&&!new RegExp(S.userAgentRegex).test(navigator.userAgent))return!1}catch(T){}try{if(S.ipRegex&&D.clientIP&&!new RegExp(S.ipRegex).test(D.clientIP))return!1}catch(T){}return!0}function t(S,T){try{if(S.disallow&&new RegExp(S.disallow).test(T))return!1}catch(F){}return!0}function f(S){return"function"==typeof S?S instanceof RegExp?S.toString():S():S}D.requestId="",D.entryId=0,D._createXMLHttpRequest=function(){return new XMLHttpRequest},D._getTime=function(){return(new Date).getTime()},D._console=console,D._appenderNames=[];var m=function S(T,F,H){this.msg=T,this.meta=F,this.finalString=H};function _(S){var F,T=f(S);switch(typeof T){case"string":return new m(T,null,T);case"number":case"boolean":return F=T.toString(),new m(F,null,F);case"undefined":return new m("undefined",null,"undefined");case"object":return T instanceof RegExp||T instanceof String||T instanceof Number||T instanceof Boolean?(F=T.toString(),new m(F,null,F)):(F="function"==typeof D.serialize?D.serialize.call(this,T):JSON.stringify(T),new m("",T,F));default:return new m("unknown",null,"unknown")}}function M(S){return S<=1e3?"trace":S<=2e3?"debug":S<=3e3?"info":S<=4e3?"warn":S<=5e3?"error":"fatal"}D.setOptions=function u(S){return h("enabled",S,this),h("maxMessages",S,this),h("defaultAjaxUrl",S,this),h("clientIP",S,this),h("requestId",S,this),h("defaultBeforeSend",S,this),h("serialize",S,this),this},D.getAllLevel=function P(){return-2147483648},D.getTraceLevel=function B(){return 1e3},D.getDebugLevel=function I(){return 2e3},D.getInfoLevel=function R(){return 3e3},D.getWarnLevel=function J(){return 4e3},D.getErrorLevel=function j(){return 5e3},D.getFatalLevel=function g(){return 6e3},D.getOffLevel=function c(){return 2147483647};var E=function S(T,F){this.inner=F,this.name="JL.Exception",this.message=_(T).finalString};D.Exception=E,E.prototype=new Error;var l=function S(T,F,H,ee,ie){this.l=T,this.m=F,this.n=H,this.t=ee,this.u=ie};function a(S,T,F){return D.entryId++,new l(S,T,F,D._getTime(),D.entryId)}function d(S){S.id&&(clearTimeout(S.id),S.id=null)}function V(S,T,F){var H=this;S.id||(S.id=setTimeout(function(){F.call(H)},T))}D.LogItem=l;var C=function(){function S(T,F){this.appenderName=T,this.sendLogItems=F,this.level=D.getTraceLevel(),this.sendWithBufferLevel=2147483647,this.storeInBufferLevel=-2147483648,this.bufferSize=0,this.batchSize=1,this.maxBatchSize=20,this.batchTimeout=2147483647,this.sendTimeout=5e3,this.buffer=[],this.batchBuffer=[],this.batchTimeoutTimer={id:null},this.sendTimeoutTimer={id:null},this.nbrLogItemsSkipped=0,this.nbrLogItemsBeingSent=0;var H="Trying to create an appender without a name or with an empty name";if(null==T)throw H;if(-1!=D._appenderNames.indexOf(T))throw T?"Multiple appenders use the same name "+T:H;D._appenderNames.push(T)}return S.prototype.addLogItemsToBuffer=function(T){if(this.batchBuffer.length>=this.maxBatchSize)this.nbrLogItemsSkipped+=T.length;else{if(null!=D.maxMessages){if(D.maxMessages<1)return;D.maxMessages-=T.length}this.batchBuffer=this.batchBuffer.concat(T);var F=this;V(this.batchTimeoutTimer,this.batchTimeout,function(){F.sendBatch.call(F)})}},S.prototype.batchBufferHasOverdueMessages=function(){for(var T=0;T<this.batchBuffer.length;T++)if(D._getTime()-this.batchBuffer[T].t>this.batchTimeout)return!0;return!1},S.prototype.batchBufferHasStrandedMessage=function(){return null!=D.maxMessages&&D.maxMessages<1&&this.batchBuffer.length>0},S.prototype.sendBatchIfComplete=function(){(this.batchBuffer.length>=this.batchSize||this.batchBufferHasOverdueMessages()||this.batchBufferHasStrandedMessage())&&this.sendBatch()},S.prototype.onSendingEnded=function(){d(this.sendTimeoutTimer),this.nbrLogItemsBeingSent=0,this.sendBatchIfComplete()},S.prototype.setOptions=function(T){if(h("level",T,this),h("ipRegex",T,this),h("userAgentRegex",T,this),h("disallow",T,this),h("sendWithBufferLevel",T,this),h("storeInBufferLevel",T,this),h("bufferSize",T,this),h("batchSize",T,this),h("maxBatchSize",T,this),h("batchTimeout",T,this),h("sendTimeout",T,this),this.bufferSize<this.buffer.length&&(this.buffer.length=this.bufferSize),this.maxBatchSize<this.batchSize)throw new D.Exception({message:"maxBatchSize cannot be smaller than batchSize",maxBatchSize:this.maxBatchSize,batchSize:this.batchSize});return this},S.prototype.log=function(T,F,H,ee,ie,se,ae){var fe;if(v(this)&&t(this,se)&&!(ie<this.storeInBufferLevel)){if(fe=a(ie,se,ae),ie<this.level)return void(this.bufferSize>0&&(this.buffer.push(fe),this.buffer.length>this.bufferSize&&this.buffer.shift()));this.addLogItemsToBuffer([fe]),ie>=this.sendWithBufferLevel&&this.buffer.length&&(this.addLogItemsToBuffer(this.buffer),this.buffer.length=0),this.sendBatchIfComplete()}},S.prototype.sendBatch=function(){if(!(this.nbrLogItemsBeingSent>0)&&(d(this.batchTimeoutTimer),0!=this.batchBuffer.length)){this.nbrLogItemsBeingSent=this.batchBuffer.length;var T=this;V(this.sendTimeoutTimer,this.sendTimeout,function(){T.onSendingEnded.call(T)}),this.sendLogItems(this.batchBuffer,function(){T.batchBuffer.splice(0,T.nbrLogItemsBeingSent),T.nbrLogItemsSkipped>0&&(T.batchBuffer.push(a(4e3,"Lost "+T.nbrLogItemsSkipped+" messages. Either connection with the server was down or logging was disabled via the enabled option. Reduce lost messages by increasing the ajaxAppender option maxBatchSize.",T.appenderName)),T.nbrLogItemsSkipped=0),T.onSendingEnded.call(T)})}},S}();D.Appender=C;var y=function(S){function T(F){return S.call(this,F,T.prototype.sendLogItemsAjax)||this}return w(T,S),T.prototype.setOptions=function(F){return h("url",F,this),h("beforeSend",F,this),S.prototype.setOptions.call(this,F),this},T.prototype.sendLogItemsAjax=function(F,H){try{if(!v(this))return;this.xhr&&0!=this.xhr.readyState&&4!=this.xhr.readyState&&this.xhr.abort(),this.xhr=D._createXMLHttpRequest();var ee="/jsnlog.logger";null!=D.defaultAjaxUrl&&(ee=D.defaultAjaxUrl),this.url&&(ee=this.url),this.xhr.open("POST",ee),this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.setRequestHeader("JSNLog-RequestId",D.requestId);var ie=this;this.xhr.onreadystatechange=function(){4==ie.xhr.readyState&&ie.xhr.status>=200&&ie.xhr.status<300&&H()};var se={r:D.requestId,lg:F};"function"==typeof this.beforeSend?this.beforeSend.call(this,this.xhr,se):"function"==typeof D.defaultBeforeSend&&D.defaultBeforeSend.call(this,this.xhr,se);var ae=JSON.stringify(se);this.xhr.send(ae)}catch(fe){}},T}(C);D.AjaxAppender=y;var N=function(S){function T(F){return S.call(this,F,T.prototype.sendLogItemsConsole)||this}return w(T,S),T.prototype.clog=function(F){D._console.log(F)},T.prototype.cerror=function(F){D._console.error?D._console.error(F):this.clog(F)},T.prototype.cwarn=function(F){D._console.warn?D._console.warn(F):this.clog(F)},T.prototype.cinfo=function(F){D._console.info?D._console.info(F):this.clog(F)},T.prototype.cdebug=function(F){D._console.debug?D._console.debug(F):this.cinfo(F)},T.prototype.sendLogItemsConsole=function(F,H){try{if(!v(this)||!D._console)return;var ee;for(ee=0;ee<F.length;++ee){var ie=F[ee],se=ie.n+": "+ie.m;"undefined"==typeof window&&(se=new Date(ie.t)+" | "+se),ie.l<=D.getDebugLevel()?this.cdebug(se):ie.l<=D.getInfoLevel()?this.cinfo(se):ie.l<=D.getWarnLevel()?this.cwarn(se):this.cerror(se)}}catch(ae){}H()},T}(C);D.ConsoleAppender=N;var O,r=function(){function S(T){this.loggerName=T,this.seenRegexes=[]}return S.prototype.setOptions=function(T){return h("level",T,this),h("userAgentRegex",T,this),h("disallow",T,this),h("ipRegex",T,this),h("appenders",T,this),h("onceOnly",T,this),this.seenRegexes=[],this},S.prototype.buildExceptionObject=function(T){var F={};return T.stack?F.stack=T.stack:F.e=T,T.message&&(F.message=T.message),T.name&&(F.name=T.name),T.data&&(F.data=T.data),T.inner&&(F.inner=this.buildExceptionObject(T.inner)),F},S.prototype.log=function(T,F,H){var ie,se,ee=0;if(!this.appenders)return this;if(T>=this.level&&v(this)&&(H?(se=this.buildExceptionObject(H)).logData=f(F):se=F,t(this,(ie=_(se)).finalString))){if(this.onceOnly)for(ee=this.onceOnly.length-1;ee>=0;){if(new RegExp(this.onceOnly[ee]).test(ie.finalString)){if(this.seenRegexes[ee])return this;this.seenRegexes[ee]=!0}ee--}for(ie.meta=ie.meta||{},ee=this.appenders.length-1;ee>=0;)this.appenders[ee].log(M(T),ie.msg,ie.meta,function(){},T,ie.finalString,this.loggerName),ee--}return this},S.prototype.trace=function(T){return this.log(1e3,T)},S.prototype.debug=function(T){return this.log(2e3,T)},S.prototype.info=function(T){return this.log(3e3,T)},S.prototype.warn=function(T){return this.log(4e3,T)},S.prototype.error=function(T){return this.log(5e3,T)},S.prototype.fatal=function(T){return this.log(6e3,T)},S.prototype.fatalException=function(T,F){return this.log(6e3,T,F)},S}();D.Logger=r,D.createAjaxAppender=function b(S){return new y(S)},D.createConsoleAppender=function x(S){return new N(S)},O="undefined"!=typeof window?new y(""):new N(""),D.__=new D.Logger(""),D.__.setOptions({level:D.getDebugLevel(),appenders:[O]})})(p||(p={})),U.__esModule=!0,U.JL=p,"function"==typeof __jsnlog_configure&&__jsnlog_configure(p),"undefined"!=typeof window&&!window.onerror&&(window.onerror=function(D,h,v,t,f){return p("onerrorLogger").fatalException({msg:"Uncaught Exception",errorMsg:D?D.message||D:"",url:h,"line number":v,column:t},f),!1}),"undefined"!=typeof window&&!window.onunhandledrejection&&(window.onunhandledrejection=function(D){p("onerrorLogger").fatalException({msg:"unhandledrejection",errorMsg:D.reason?D.reason.message:D.message||null},D.reason)})},1897:ne=>{var U=["stun:","turn:"];ne.exports=function(w){var L,D,p=(w||{}).url||w,h={};return("string"==typeof p||p instanceof String)&&(p=p.trim(),L=U[U.indexOf(p.slice(0,5))])?(D=(p=p.slice(5)).split("@"),h.username=w.username,h.credential=w.credential,D.length>1&&(p=D[1],D=D[0].split(":"),h.username=D[0],h.credential=(w||{}).credential||D[1]||""),h.url=L+p,h.urls=[h.url],h):w}},7490:(ne,U,w)=>{"use strict";Object.defineProperty(U,"__esModule",{value:!0}),U.Connection=void 0;var p=w(2096),L=w(6946),D=w(7507),h=L.OpenViduLogger.getInstance(),v=function(){function t(f,m){this.session=f,this.disposed=!1;var _="'Connection' created ";m.role?(this.localOptions=m,this.connectionId=this.localOptions.id,this.creationTime=this.localOptions.createdAt,this.data=this.localOptions.metadata,this.rpcSessionId=this.localOptions.sessionId,this.role=this.localOptions.role,this.record=this.localOptions.record,_+="(local)"):(this.remoteOptions=m,this.connectionId=this.remoteOptions.id,this.creationTime=this.remoteOptions.createdAt,this.remoteOptions.metadata&&(this.data=this.remoteOptions.metadata),this.remoteOptions.streams&&this.initRemoteStreams(this.remoteOptions.streams),_+="(remote) with 'connectionId' ["+this.remoteOptions.id+"]"),h.info(_)}return t.prototype.sendIceCandidate=function(f){var m=this;h.debug((this.stream.outboundStreamOpts?"Local":"Remote")+"candidate for"+this.connectionId,f),this.session.openvidu.sendRequest("onIceCandidate",{endpointName:this.connectionId,candidate:f.candidate,sdpMid:f.sdpMid,sdpMLineIndex:f.sdpMLineIndex},function(_,u){_&&(h.error("Error sending ICE candidate: "+JSON.stringify(_)),m.session.emitEvent("exception",[new D.ExceptionEvent(m.session,D.ExceptionEventName.ICE_CANDIDATE_ERROR,m.session,"There was an unexpected error on the server-side processing an ICE candidate generated and sent by the client-side",_)]))})},t.prototype.initRemoteStreams=function(f){var m=this;f.forEach(function(_){var u={id:_.id,createdAt:_.createdAt,connection:m,hasAudio:_.hasAudio,hasVideo:_.hasVideo,audioActive:_.audioActive,videoActive:_.videoActive,typeOfVideo:_.typeOfVideo,frameRate:_.frameRate,videoDimensions:_.videoDimensions?JSON.parse(_.videoDimensions):void 0,filter:_.filter?_.filter:void 0},P=new p.Stream(m.session,u);m.addStream(P)}),h.info("Remote 'Connection' with 'connectionId' ["+this.connectionId+"] is now configured for receiving Streams with options: ",this.stream.inboundStreamOpts)},t.prototype.addStream=function(f){f.connection=this,this.stream=f},t.prototype.removeStream=function(f){delete this.stream},t.prototype.dispose=function(){this.stream&&delete this.stream,this.disposed=!0},t}();U.Connection=v},8074:(ne,U,w)=>{"use strict";Object.defineProperty(U,"__esModule",{value:!0}),U.EventDispatcher=void 0;var p=w(940),D=w(6946).OpenViduLogger.getInstance(),h=function(){function v(){this.userHandlerArrowHandler=new WeakMap,this.ee=new p}return v.prototype.onAux=function(t,f,m){var _=function(u){u?D.info(f,u):D.info(f),m(u)};return this.userHandlerArrowHandler.set(m,_),this.ee.on(t,_),this},v.prototype.onceAux=function(t,f,m){var _=this,u=function(P){P?D.info(f,P):D.info(f),m(P),_.userHandlerArrowHandler.delete(m)};return this.userHandlerArrowHandler.set(m,u),this.ee.once(t,u),this},v.prototype.offAux=function(t,f){if(f){var m=this.userHandlerArrowHandler.get(f);m&&this.ee.off(t,m),this.userHandlerArrowHandler.delete(f)}else this.ee.removeAllListeners(t);return this},v}();U.EventDispatcher=h},4540:(ne,U,w)=>{"use strict";Object.defineProperty(U,"__esModule",{value:!0}),U.Filter=void 0;var p=w(2798),L=w(4103),h=w(6946).OpenViduLogger.getInstance(),v=function(){function t(f,m){this.handlers=new Map,this.type=f,this.options=m}return t.prototype.execMethod=function(f,m){var _=this;return new Promise(function(u,P){var B;h.info("Executing filter method to stream "+_.stream.streamId);var I,R=function(g){h.info("Filter method successfully executed on Stream "+_.stream.streamId);var c=Object.assign({},_.stream.filter);return _.stream.filter.lastExecMethod={method:f,params:I},g&&(_.stream.session.emitEvent("streamPropertyChanged",[new p.StreamPropertyChangedEvent(_.stream.session,_.stream,"filter",_.stream.filter,c,"execFilterMethod")]),_.stream.streamManager.emitEvent("streamPropertyChanged",[new p.StreamPropertyChangedEvent(_.stream.streamManager,_.stream,"filter",_.stream.filter,c,"execFilterMethod")])),u()};if(_.type.startsWith("VB:")){if("string"==typeof m)try{m=JSON.parse(m)}catch(g){return P(new L.OpenViduError(L.OpenViduErrorName.VIRTUAL_BACKGROUND_ERROR,"Wrong params syntax: "+g))}if(I=m,"update"!==f)return P(new L.OpenViduError(L.OpenViduErrorName.VIRTUAL_BACKGROUND_ERROR,'Unknown Virtual Background method "'.concat(f,'"')));if(!(null===(B=_.stream.virtualBackgroundSinkElements)||void 0===B?void 0:B.VB))return P(new L.OpenViduError(L.OpenViduErrorName.VIRTUAL_BACKGROUND_ERROR,"There is no Virtual Background filter applied"));_.stream.virtualBackgroundSinkElements.VB.updateValues(m).then(function(){return R(!1)}).catch(function(g){return P(g.name===L.OpenViduErrorName.VIRTUAL_BACKGROUND_ERROR?new L.OpenViduError(g.name,g.message):new L.OpenViduError(L.OpenViduErrorName.VIRTUAL_BACKGROUND_ERROR,"Error updating values on Virtual Background filter: "+g))})}else{var J=void 0;if("string"!=typeof m)try{J=JSON.stringify(m)}catch(g){var j="'params' property must be a JSON formatted object";return h.error(j),P(j)}else J=m;I=J,_.stream.session.openvidu.sendRequest("execFilterMethod",{streamId:_.stream.streamId,method:f,params:J},function(g,c){return g?(h.error("Error executing filter method for Stream "+_.stream.streamId,g),P(401===g.code?new L.OpenViduError(L.OpenViduErrorName.OPENVIDU_PERMISSION_DENIED,"You don't have permissions to execute a filter method"):g)):R(!0)})}})},t.prototype.addEventListener=function(f,m){var _=this;return new Promise(function(u,P){h.info("Adding filter event listener to event "+f+" to stream "+_.stream.streamId),_.stream.session.openvidu.sendRequest("addFilterEventListener",{streamId:_.stream.streamId,eventType:f},function(B,I){return B?(h.error("Error adding filter event listener to event "+f+"for Stream "+_.stream.streamId,B),P(401===B.code?new L.OpenViduError(L.OpenViduErrorName.OPENVIDU_PERMISSION_DENIED,"You don't have permissions to add a filter event listener"):B)):(_.handlers.set(f,m),h.info("Filter event listener to event "+f+" successfully applied on Stream "+_.stream.streamId),u())})})},t.prototype.removeEventListener=function(f){var m=this;return new Promise(function(_,u){h.info("Removing filter event listener to event "+f+" to stream "+m.stream.streamId),m.stream.session.openvidu.sendRequest("removeFilterEventListener",{streamId:m.stream.streamId,eventType:f},function(P,B){return P?(h.error("Error removing filter event listener to event "+f+"for Stream "+m.stream.streamId,P),u(401===P.code?new L.OpenViduError(L.OpenViduErrorName.OPENVIDU_PERMISSION_DENIED,"You don't have permissions to add a filter event listener"):P)):(m.handlers.delete(f),h.info("Filter event listener to event "+f+" successfully removed on Stream "+m.stream.streamId),_())})})},t}();U.Filter=v},4289:(ne,U,w)=>{"use strict";Object.defineProperty(U,"__esModule",{value:!0}),U.LocalRecorder=void 0;var t,p=w(5156),L=w(6946),D=w(543),h=w(8946),v=L.OpenViduLogger.getInstance(),f=function(){function m(_){this.stream=_,this.chunks=[],t=D.PlatformUtils.getInstance(),this.connectionId=this.stream.connection?this.stream.connection.connectionId:"default-connection",this.id=this.stream.streamId+"_"+this.connectionId+"_localrecord",this.state=p.LocalRecorderState.READY}return m.prototype.record=function(_){var u=this;return new Promise(function(P,B){try{if("string"==typeof _||_ instanceof String)return B("When calling LocalRecorder.record(options) parameter 'options' cannot be a string. Must be an object like { mimeType: \"".concat(_,'" }'));if("undefined"==typeof MediaRecorder)throw v.error("MediaRecorder not supported on your device. See compatibility in https://caniuse.com/#search=MediaRecorder"),Error("MediaRecorder not supported on your device. See compatibility in https://caniuse.com/#search=MediaRecorder");if(u.state!==p.LocalRecorderState.READY)throw Error("'LocalRecord.record()' needs 'LocalRecord.state' to be 'READY' (current value: '"+u.state+"'). Call 'LocalRecorder.clean()' or init a new LocalRecorder before");v.log("Starting local recording of stream '"+u.stream.streamId+"' of connection '"+u.connectionId+"'"),_?_.mimeType||(_.mimeType="video/webm"):_={mimeType:"video/webm"},u.mediaRecorder=new MediaRecorder(u.stream.getMediaStream(),_),u.mediaRecorder.start()}catch(I){return B(I)}return u.mediaRecorder.ondataavailable=function(I){I.data.size>0&&u.chunks.push(I.data)},u.mediaRecorder.onerror=function(I){v.error("MediaRecorder error: ",I)},u.mediaRecorder.onstart=function(){v.log("MediaRecorder started (state="+u.mediaRecorder.state+")")},u.mediaRecorder.onstop=function(){u.onStopDefault()},u.mediaRecorder.onpause=function(){v.log("MediaRecorder paused (state="+u.mediaRecorder.state+")")},u.mediaRecorder.onresume=function(){v.log("MediaRecorder resumed (state="+u.mediaRecorder.state+")")},u.state=p.LocalRecorderState.RECORDING,P()})},m.prototype.stop=function(){var _=this;return new Promise(function(u,P){try{if(_.state===p.LocalRecorderState.READY||_.state===p.LocalRecorderState.FINISHED)throw Error("'LocalRecord.stop()' needs 'LocalRecord.state' to be 'RECORDING' or 'PAUSED' (current value: '"+_.state+"'). Call 'LocalRecorder.start()' before");_.mediaRecorder.onstop=function(){return _.onStopDefault(),u()},_.mediaRecorder.stop()}catch(B){return P(B)}})},m.prototype.pause=function(){var _=this;return new Promise(function(u,P){try{return _.state!==p.LocalRecorderState.RECORDING?P(Error("'LocalRecord.pause()' needs 'LocalRecord.state' to be 'RECORDING' (current value: '"+_.state+"'). Call 'LocalRecorder.start()' or 'LocalRecorder.resume()' before")):(_.mediaRecorder.pause(),_.state=p.LocalRecorderState.PAUSED,u())}catch(B){return P(B)}})},m.prototype.resume=function(){var _=this;return new Promise(function(u,P){try{if(_.state!==p.LocalRecorderState.PAUSED)throw Error("'LocalRecord.resume()' needs 'LocalRecord.state' to be 'PAUSED' (current value: '"+_.state+"'). Call 'LocalRecorder.pause()' before");return _.mediaRecorder.resume(),_.state=p.LocalRecorderState.RECORDING,u()}catch(B){return P(B)}})},m.prototype.preview=function(_){if(this.state!==p.LocalRecorderState.FINISHED)throw Error("'LocalRecord.preview()' needs 'LocalRecord.state' to be 'FINISHED' (current value: '"+this.state+"'). Call 'LocalRecorder.stop()' before");if(this.videoPreview=document.createElement("video"),this.videoPreview.id=this.id,this.videoPreview.autoplay=!0,t.isSafariBrowser()&&this.videoPreview.setAttribute("playsinline","true"),"string"==typeof _){var u=document.getElementById(_);u&&(this.videoPreview=u.appendChild(this.videoPreview))}else this.videoPreview=_.appendChild(this.videoPreview);return this.videoPreview.src=this.videoPreviewSrc,this.videoPreview},m.prototype.clean=function(){var _=this,u=function(){delete _.blob,_.chunks=[],_.state=p.LocalRecorderState.READY};this.state===p.LocalRecorderState.RECORDING||this.state===p.LocalRecorderState.PAUSED?this.stop().then(function(){return u()}).catch(function(){return u()}):u()},m.prototype.download=function(){if(this.state!==p.LocalRecorderState.FINISHED)throw Error("'LocalRecord.download()' needs 'LocalRecord.state' to be 'FINISHED' (current value: '"+this.state+"'). Call 'LocalRecorder.stop()' before");var _=document.createElement("a");_.style.display="none",document.body.appendChild(_);var u=window.URL.createObjectURL(this.blob);_.href=u,_.download=this.id+"."+h.getExtension(this.blob.type),_.click(),window.URL.revokeObjectURL(u),document.body.removeChild(_)},m.prototype.getBlob=function(){if(this.state!==p.LocalRecorderState.FINISHED)throw Error("Call 'LocalRecord.stop()' before getting Blob file");return this.blob},m.prototype.uploadAsBinary=function(_,u){var P=this;return new Promise(function(B,I){if(P.state!==p.LocalRecorderState.FINISHED)return I(Error("'LocalRecord.uploadAsBinary()' needs 'LocalRecord.state' to be 'FINISHED' (current value: '"+P.state+"'). Call 'LocalRecorder.stop()' before"));var R=new XMLHttpRequest;if(R.open("POST",_,!0),"object"==typeof u)for(var J=0,j=Object.keys(u);J<j.length;J++){var g=j[J];R.setRequestHeader(g,u[g])}R.onreadystatechange=function(){if(4===R.readyState)return"2"===R.status.toString().charAt(0)?B(R.responseText):I(R.status)},R.send(P.blob)})},m.prototype.uploadAsMultipartfile=function(_,u){var P=this;return new Promise(function(B,I){if(P.state!==p.LocalRecorderState.FINISHED)return I(Error("'LocalRecord.uploadAsMultipartfile()' needs 'LocalRecord.state' to be 'FINISHED' (current value: '"+P.state+"'). Call 'LocalRecorder.stop()' before"));var R=new XMLHttpRequest;if(R.open("POST",_,!0),"object"==typeof u)for(var J=0,j=Object.keys(u);J<j.length;J++){var g=j[J];R.setRequestHeader(g,u[g])}var c=new FormData;c.append("file",P.blob,P.id+"."+h.getExtension(P.blob.type)),R.onreadystatechange=function(){if(4===R.readyState)return"2"===R.status.toString().charAt(0)?B(R.responseText):I(R.status)},R.send(c)})},m.prototype.onStopDefault=function(){v.log("MediaRecorder stopped (state="+this.mediaRecorder.state+")"),this.blob=new Blob(this.chunks,{type:this.mediaRecorder.mimeType}),this.chunks=[],this.videoPreviewSrc=window.URL.createObjectURL(this.blob),this.state=p.LocalRecorderState.FINISHED},m}();U.LocalRecorder=f},763:(ne,U,w)=>{"use strict";Object.defineProperty(U,"__esModule",{value:!0}),U.OpenVidu=void 0;var g,p=w(4289),L=w(4259),D=w(8402),h=w(1018),v=w(2798),t=w(4103),f=w(6274),m=w(6946),_=w(543),u=w(4611),P=w(4627),B=w(541),I=w(940),R=w(3031),J=w(5549),j=m.OpenViduLogger.getInstance(),c=function(){function M(){var E=this;this.masterNodeHasCrashed=!1,this.publishers=[],this.secret="",this.recorder=!1,this.life=-1,this.advancedConfiguration={},this.webrtcStatsInterval=-1,this.sendBrowserLogs=B.OpenViduLoggerConfiguration.disabled,this.isAtLeastPro=!1,this.isEnterprise=!1,this.ee=new I,g=_.PlatformUtils.getInstance(),this.libraryVersion=J.version,j.info("OpenVidu initialized"),j.info("Platform detected: "+g.getDescription()),j.info("openvidu-browser version: "+this.libraryVersion),(g.isMobileDevice()||g.isReactNative())&&this.onOrientationChanged(function(){E.publishers.forEach(function(l){l.stream.isLocalStreamPublished&&l.stream&&l.stream.hasVideo&&E.sendNewVideoDimensionsIfRequired(l,"deviceRotated",75,10)})})}return M.prototype.initSession=function(){return this.session=new D.Session(this),this.session},M.prototype.initPublisher=function(E,l,a){var d;d=l&&"function"!=typeof l?{audioSource:void 0!==(d=l).audioSource?d.audioSource:void 0,frameRate:"undefined"!=typeof MediaStreamTrack&&d.videoSource instanceof MediaStreamTrack?void 0:void 0!==d.frameRate?d.frameRate:void 0,insertMode:void 0!==d.insertMode?"string"==typeof d.insertMode?f.VideoInsertMode[d.insertMode]:d.insertMode:f.VideoInsertMode.APPEND,mirror:void 0===d.mirror||d.mirror,publishAudio:void 0===d.publishAudio||d.publishAudio,publishVideo:void 0===d.publishVideo||d.publishVideo,resolution:"undefined"!=typeof MediaStreamTrack&&d.videoSource instanceof MediaStreamTrack?void 0:void 0!==d.resolution?d.resolution:"640x480",videoSource:void 0!==d.videoSource?d.videoSource:void 0,videoSimulcast:d.videoSimulcast,filter:d.filter}:{insertMode:f.VideoInsertMode.APPEND,mirror:!0,publishAudio:!0,publishVideo:!0,resolution:"640x480"};var C,V=new L.Publisher(E,d,this);return l&&"function"==typeof l?C=l:a&&(C=a),V.initialize().then(function(){void 0!==C&&C(void 0),V.emitEvent("accessAllowed",[])}).catch(function(y){void 0!==C&&C(y),V.emitEvent("accessDenied",[y])}),this.publishers.push(V),V},M.prototype.initPublisherAsync=function(E,l){var a=this;return new Promise(function(d,V){var C,y=function(N){return N?V(N):d(C)};C=l?a.initPublisher(E,l,y):a.initPublisher(E,y)})},M.prototype.initLocalRecorder=function(E){return new p.LocalRecorder(E)},M.prototype.checkSystemRequirements=function(){return g.isIPhoneOrIPad()?g.isIOSWithSafari()||g.isIonicIos()||g.isChromeMobileBrowser()||g.isEdgeMobileBrowser()||g.isOperaMobileBrowser()||g.isFirefoxMobileBrowser()?1:0:g.isChromeBrowser()||g.isChromeMobileBrowser()||g.isFirefoxBrowser()||g.isFirefoxMobileBrowser()||g.isOperaBrowser()||g.isOperaMobileBrowser()||g.isEdgeBrowser()||g.isEdgeMobileBrowser()||g.isSafariBrowser()||g.isAndroidBrowser()||g.isElectron()||g.isSamsungBrowser()?1:0},M.prototype.checkScreenSharingCapabilities=function(){return g.canScreenShare()},M.prototype.getDevices=function(){return new Promise(function(E,l){navigator.mediaDevices.enumerateDevices().then(function(a){var d,V=[];if(!g.isIonicAndroid()||"undefined"==typeof cordova||!(null===(d=null==cordova?void 0:cordova.plugins)||void 0===d?void 0:d.EnumerateDevicesPlugin))return a.forEach(function(C){("audioinput"===C.kind||"videoinput"===C.kind)&&V.push({kind:C.kind,deviceId:C.deviceId,label:C.label})}),E(V);cordova.plugins.EnumerateDevicesPlugin.getEnumerateDevices().then(function(C){var y=[],N=[],r=[];return y=C.filter(function(b){return"audioinput"===b.kind}),N=a.filter(function(b){return"videoinput"===b.kind}),r=a.filter(function(b){return"audioinput"===b.kind}),N.forEach(function(b,x){V.push(b.label?{kind:b.kind,deviceId:b.deviceId,label:b.label}:{kind:b.kind,deviceId:b.deviceId,label:0===x?"Front Camera":1===x?"Back Camera":"Unknown Camera"})}),r.forEach(function(b,x){if(b.label)V.push({kind:b.kind,deviceId:b.deviceId,label:b.label});else{var O="";switch(x){case 0:O="Default";break;case 1:var S=y.filter(function(H){return H.label.includes("Built")})[0];O=S?S.label:"Built-in Microphone";break;case 2:var T=y.filter(function(H){return H.label.includes("Wired")})[0];O=T?T.label:"Headset earpiece";break;case 3:var F=y.filter(function(H){return H.label.includes("Bluetooth")})[0];O=F?F.label:"Wireless";break;default:O="Unknown Microphone"}V.push({kind:b.kind,deviceId:b.deviceId,label:O})}}),E(V)})}).catch(function(a){return j.error("Error getting devices",a),l(a)})})},M.prototype.getUserMedia=function(E){var l=this;return new Promise(function(a,d){var V=function(C,y){var r={audio:void 0===y.audio||y.audio,video:!1};navigator.mediaDevices.getUserMedia(r).then(function(b){return C.addTrack(b.getAudioTracks()[0]),a(C)}).catch(function(b){return C.getAudioTracks().forEach(function(x){x.stop()}),C.getVideoTracks().forEach(function(x){x.stop()}),d(l.generateAudioDeviceError(b,r))})};l.generateMediaConstraints(E).then(function(C){var y,N;if(C.videoTrack&&C.audioTrack||C.audioTrack&&!1===(null===(y=C.constraints)||void 0===y?void 0:y.video)||C.videoTrack&&!1===(null===(N=C.constraints)||void 0===N?void 0:N.audio))return a(l.addAlreadyProvidedTracks(C,new MediaStream));C.videoTrack&&delete C.constraints.video,C.audioTrack&&delete C.constraints.audio;var r=!1;"string"==typeof E.videoSource&&("screen"===E.videoSource||"window"===E.videoSource||g.isElectron()&&E.videoSource.startsWith("screen:"))&&(r=!C.audioTrack&&null!==E.audioSource&&!1!==E.audioSource,navigator.mediaDevices.getDisplayMedia&&!g.isElectron())?navigator.mediaDevices.getDisplayMedia({video:!0}).then(function(x){return l.addAlreadyProvidedTracks(C,x),r?void V(x,C.constraints):a(x)}).catch(function(x){var O=t.OpenViduErrorName.SCREEN_CAPTURE_DENIED,S=x.toString();return d(new t.OpenViduError(O,S))}):navigator.mediaDevices.getUserMedia(r?{video:C.constraints.video}:C.constraints).then(function(x){return l.addAlreadyProvidedTracks(C,x),r?void V(x,C.constraints):a(x)}).catch(function(x){var S=x.toString();return d(new t.OpenViduError("screen"!==E.videoSource?t.OpenViduErrorName.DEVICE_ACCESS_DENIED:t.OpenViduErrorName.SCREEN_CAPTURE_DENIED,S))})}).catch(function(C){return d(C)})})},M.prototype.enableProdMode=function(){j.enableProdMode()},M.prototype.setAdvancedConfiguration=function(E){this.advancedConfiguration=E},M.prototype.onOrientationChanged=function(E){window.addEventListener("orientationchange",E)},M.prototype.sendNewVideoDimensionsIfRequired=function(E,l,a,d){var V=this,C=0,y=E.stream.videoDimensions.width,N=E.stream.videoDimensions.height,r=setInterval(function(){++C>d&&clearTimeout(r),E.getVideoDimensions().then(function(b){(b.width!==y||b.height!==N)&&(clearTimeout(r),V.sendVideoDimensionsChangedEvent(E,l,y,N,b.width,b.height))})},a)},M.prototype.sendVideoDimensionsChangedEvent=function(E,l,a,d,V,C){var y=this;E.stream.videoDimensions={width:V||0,height:C||0},this.sendRequest("streamPropertyChanged",{streamId:E.stream.streamId,property:"videoDimensions",newValue:JSON.stringify(E.stream.videoDimensions),reason:l},function(N,r){N?j.error("Error sending 'streamPropertyChanged' event",N):(y.session.emitEvent("streamPropertyChanged",[new v.StreamPropertyChangedEvent(y.session,E.stream,"videoDimensions",E.stream.videoDimensions,{width:a,height:d},l)]),E.emitEvent("streamPropertyChanged",[new v.StreamPropertyChangedEvent(E,E.stream,"videoDimensions",E.stream.videoDimensions,{width:a,height:d},l)]),y.session.sendVideoData(E))})},M.prototype.generateMediaConstraints=function(E){var l=this;return new Promise(function(a,d){var V={audioTrack:void 0,videoTrack:void 0,constraints:{audio:void 0,video:void 0}},C=E.audioSource,y=E.videoSource;if((null===C||!1===C)&&(V.constraints.audio=!1),(null===y||!1===y)&&(V.constraints.video=!1),!1===V.constraints.audio&&!1===V.constraints.video)return d(new t.OpenViduError(t.OpenViduErrorName.NO_INPUT_SOURCE_SET,"Properties 'audioSource' and 'videoSource' cannot be set to false or null at the same time"));if("undefined"!=typeof MediaStreamTrack&&C instanceof MediaStreamTrack&&(V.audioTrack=C),"undefined"!=typeof MediaStreamTrack&&y instanceof MediaStreamTrack&&(V.videoTrack=y),void 0===C&&(V.constraints.audio=!0),void 0===y&&(V.constraints.video={width:{ideal:640},height:{ideal:480}}),null!==y&&!1!==y){if(E.resolution){var N=E.resolution.toLowerCase().split("x"),r=Number(N[0]),b=Number(N[1]);V.constraints.video={width:{ideal:r},height:{ideal:b}}}E.frameRate&&(V.constraints.video.frameRate={ideal:E.frameRate})}return l.configureDeviceIdOrScreensharing(V,E,a,d),a(V)})},M.prototype.startWs=function(E){var l={heartbeat:5e3,ws:{uri:this.wsUri+"?sessionId="+this.session.sessionId,onconnected:E,ondisconnect:this.disconnectCallback.bind(this),onreconnecting:this.reconnectingCallback.bind(this),onreconnected:this.reconnectedCallback.bind(this),ismasternodecrashed:this.isMasterNodeCrashed.bind(this)},rpc:{requestTimeout:1e4,heartbeatRequestTimeout:5e3,participantJoined:this.session.onParticipantJoined.bind(this.session),participantPublished:this.session.onParticipantPublished.bind(this.session),participantUnpublished:this.session.onParticipantUnpublished.bind(this.session),participantLeft:this.session.onParticipantLeft.bind(this.session),participantEvicted:this.session.onParticipantEvicted.bind(this.session),recordingStarted:this.session.onRecordingStarted.bind(this.session),recordingStopped:this.session.onRecordingStopped.bind(this.session),sendMessage:this.session.onNewMessage.bind(this.session),streamPropertyChanged:this.session.onStreamPropertyChanged.bind(this.session),connectionPropertyChanged:this.session.onConnectionPropertyChanged.bind(this.session),networkQualityLevelChanged:this.session.onNetworkQualityLevelChangedChanged.bind(this.session),filterEventDispatched:this.session.onFilterEventDispatched.bind(this.session),iceCandidate:this.session.recvIceCandidate.bind(this.session),mediaError:this.session.onMediaError.bind(this.session),masterNodeCrashedNotification:this.onMasterNodeCrashedNotification.bind(this),forciblyReconnectSubscriber:this.session.onForciblyReconnectSubscriber.bind(this.session)}};this.jsonRpcClient=new R.clients.JsonRpcClient(l)},M.prototype.onMasterNodeCrashedNotification=function(E){console.error("Master Node has crashed"),this.masterNodeHasCrashed=!0,this.session.onLostConnection("nodeCrashed"),this.jsonRpcClient.close(4103,"Master Node has crashed")},M.prototype.getWsReadyState=function(){return this.jsonRpcClient.getReadyState()},M.prototype.closeWs=function(){this.jsonRpcClient.close(4102,"Connection closed by client")},M.prototype.sendRequest=function(E,l,a){l&&l instanceof Function&&(a=l,l={}),j.debug('Sending request: {method:"'+E+'", params: '+JSON.stringify(l)+"}"),this.jsonRpcClient.send(E,l,a)},M.prototype.getWsUri=function(){return this.wsUri},M.prototype.getSecret=function(){return this.secret},M.prototype.getRecorder=function(){return this.recorder},M.prototype.generateAudioDeviceError=function(E,l){var a,d;switch("Error"===E.name&&(E.name=E.constructor.name),E.name.toLowerCase()){case"notfounderror":return a=t.OpenViduErrorName.INPUT_AUDIO_DEVICE_NOT_FOUND,d=E.toString(),new t.OpenViduError(a,d);case"notallowederror":return a=t.OpenViduErrorName.DEVICE_ACCESS_DENIED,d=E.toString(),new t.OpenViduError(a,d);case"overconstrainederror":return"deviceid"===E.constraint.toLowerCase()?(a=t.OpenViduErrorName.INPUT_AUDIO_DEVICE_NOT_FOUND,d="Audio input device with deviceId '"+l.audio.deviceId.exact+"' not found"):(a=t.OpenViduErrorName.PUBLISHER_PROPERTIES_ERROR,d="Audio input device doesn't support the value passed for constraint '"+E.constraint+"'"),new t.OpenViduError(a,d);case"notreadableerror":return a=t.OpenViduErrorName.DEVICE_ALREADY_IN_USE,d=E.toString(),new t.OpenViduError(a,d);default:return new t.OpenViduError(t.OpenViduErrorName.INPUT_AUDIO_DEVICE_GENERIC_ERROR,E.toString())}},M.prototype.addAlreadyProvidedTracks=function(E,l,a){return E.videoTrack&&(l.addTrack(E.videoTrack),a&&(a.lastVideoTrackConstraints=E.constraints.video?E.constraints.video:E.videoTrack.getConstraints())),E.audioTrack&&l.addTrack(E.audioTrack),l},M.prototype.configureDeviceIdOrScreensharing=function(E,l,a,d){var V=this,C=l.audioSource,y=l.videoSource;if("string"==typeof C&&(E.constraints.audio={deviceId:{exact:C}}),"string"==typeof y){if(this.isScreenShare(y)){if(this.checkScreenSharingCapabilities()){if(g.isElectron()){var r="screen:",x=y.substr(y.indexOf(r)+r.length);return E.constraints.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:x}},a(E)}if(!this.advancedConfiguration.screenShareChromeExtension||g.isFirefoxBrowser()||g.isFirefoxMobileBrowser()||navigator.mediaDevices.getDisplayMedia){if(navigator.mediaDevices.getDisplayMedia)return a(E);var O=g.isFirefoxBrowser()||g.isFirefoxMobileBrowser()?l.videoSource:void 0;return void u.getScreenId(O,function(S,T,F){if(S){if("not-installed"===S){var ee=new t.OpenViduError(t.OpenViduErrorName.SCREEN_EXTENSION_NOT_INSTALLED,V.advancedConfiguration.screenShareChromeExtension?V.advancedConfiguration.screenShareChromeExtension:"https://chrome.google.com/webstore/detail/openvidu-screensharing/lfcgfepafnobdloecchnfaclibenjold");return j.error(ee),d(ee)}return"installed-disabled"===S?(ee=new t.OpenViduError(t.OpenViduErrorName.SCREEN_EXTENSION_DISABLED,"You must enable the screen extension"),j.error(ee),d(ee)):"permission-denied"===S?(ee=new t.OpenViduError(t.OpenViduErrorName.SCREEN_CAPTURE_DENIED,"You must allow access to one window of your desktop"),j.error(ee),d(ee)):(ee=new t.OpenViduError(t.OpenViduErrorName.GENERIC_ERROR,"Unknown error when accessing screen share"),j.error(ee),j.error(S),d(ee))}return E.constraints.video=F.video,a(E)})}return void P.getScreenConstraints(function(S,T){if(!(S||T.mandatory&&"screen"===T.mandatory.chromeMediaSource))return E.constraints.video=T,a(E);if("permission-denied"===S||"PermissionDeniedError"===S){var F=new t.OpenViduError(t.OpenViduErrorName.SCREEN_CAPTURE_DENIED,"You must allow access to one window of your desktop");return j.error(F),d(F)}var H=V.advancedConfiguration.screenShareChromeExtension.split("/").pop().trim();P.getChromeExtensionStatus(H,function(ee){if("installed-disabled"===ee){var ie=new t.OpenViduError(t.OpenViduErrorName.SCREEN_EXTENSION_DISABLED,"You must enable the screen extension");return j.error(ie),d(ie)}if("not-installed"===ee){var se=new t.OpenViduError(t.OpenViduErrorName.SCREEN_EXTENSION_NOT_INSTALLED,V.advancedConfiguration.screenShareChromeExtension);return j.error(se),d(se)}})})}var N=new t.OpenViduError(t.OpenViduErrorName.SCREEN_SHARING_NOT_SUPPORTED,"You can only screen share in desktop Chrome, Firefox, Opera, Safari (>=13.0), Edge (>= 80) or Electron. Detected client: "+g.getName()+" "+g.getVersion());return j.error(N),d(N)}this.setVideoSource(E,y)}},M.prototype.setVideoSource=function(E,l){E.constraints.video||(E.constraints.video={}),E.constraints.video.deviceId={exact:l}},M.prototype.disconnectCallback=function(){j.warn("Websocket connection lost"),this.isRoomAvailable()?this.session.onLostConnection("networkDisconnect"):alert("Connection error. Please reload page.")},M.prototype.reconnectingCallback=function(){j.warn("Websocket connection lost (reconnecting)"),this.isRoomAvailable()?this.session.emitEvent("reconnecting",[]):alert("Connection error. Please reload page.")},M.prototype.reconnectWebsocketThroughRpcConnectMethod=function(E){var l=this;this.sendRequest("connect",{sessionId:E,reconnect:!0},function(a,d){if(a)if(l.isMasterNodeCrashed())j.warn("Master Node has crashed!");else{j.error(a);var V=function(y,N){j.warn(N),l.session.onLostConnection(y),l.jsonRpcClient.close(4101,"Reconnection fault: "+N)};40007===a.code&&"reconnection error"===a.message&&console.error("Invalid RPC sessionId. Client network disconnection or Master Node crash"),-1===l.life?V("networkDisconnect","WS successfully reconnected but the user was already evicted due to timeout"):l.sendRequest("sessionStatus",{sessionId:l.session.sessionId},function(y,N){null!=y?console.error("Error checking session status",y):l.life===N.life?V("networkDisconnect","WS successfully reconnected but the user was already evicted due to timeout"):V("nodeCrashed","WS successfully reconnected to OpenVidu Server but your Master Node crashed")})}else l.jsonRpcClient.resetPing(),l.session.onRecoveredConnection()})},M.prototype.reconnectedCallback=function(){if(j.warn("Websocket reconnected"),this.isRoomAvailable())if(this.session.connection)this.reconnectWebsocketThroughRpcConnectMethod(this.session.connection.rpcSessionId);else{j.warn("There was no previous connection when running reconnection callback");var E=new h.SessionDisconnectedEvent(this.session,"networkDisconnect");this.session.ee.emitEvent("sessionDisconnected",[E]),E.callDefaultBehavior()}else alert("Connection error. Please reload page.")},M.prototype.isMasterNodeCrashed=function(){return this.masterNodeHasCrashed},M.prototype.isRoomAvailable=function(){return void 0!==this.session&&this.session instanceof D.Session||(j.warn("Session instance not found"),!1)},M.prototype.isScreenShare=function(E){return"screen"===E||"window"===E||g.isElectron()&&E.startsWith("screen:")},M}();U.OpenVidu=c},4259:function(ne,U,w){"use strict";var j,p=this&&this.__extends||(j=function(g,c){return(j=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(M,E){M.__proto__=E}||function(M,E){for(var l in E)Object.prototype.hasOwnProperty.call(E,l)&&(M[l]=E[l])})(g,c)},function(g,c){if("function"!=typeof c&&null!==c)throw new TypeError("Class extends value "+String(c)+" is not a constructor or null");function M(){this.constructor=g}j(g,c),g.prototype=null===c?Object.create(c):(M.prototype=c.prototype,new M)}),L=this&&this.__awaiter||function(j,g,c,M){return new(c||(c=Promise))(function(l,a){function d(y){try{C(M.next(y))}catch(N){a(N)}}function V(y){try{C(M.throw(y))}catch(N){a(N)}}function C(y){y.done?l(y.value):function E(l){return l instanceof c?l:new c(function(a){a(l)})}(y.value).then(d,V)}C((M=M.apply(j,g||[])).next())})},D=this&&this.__generator||function(j,g){var M,E,l,a,c={label:0,sent:function(){if(1&l[0])throw l[1];return l[1]},trys:[],ops:[]};return a={next:d(0),throw:d(1),return:d(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function d(C){return function(y){return function V(C){if(M)throw new TypeError("Generator is already executing.");for(;c;)try{if(M=1,E&&(l=2&C[0]?E.return:C[0]?E.throw||((l=E.return)&&l.call(E),0):E.next)&&!(l=l.call(E,C[1])).done)return l;switch(E=0,l&&(C=[2&C[0],l.value]),C[0]){case 0:case 1:l=C;break;case 4:return c.label++,{value:C[1],done:!1};case 5:c.label++,E=C[1],C=[0];continue;case 7:C=c.ops.pop(),c.trys.pop();continue;default:if(!(l=(l=c.trys).length>0&&l[l.length-1])&&(6===C[0]||2===C[0])){c=0;continue}if(3===C[0]&&(!l||C[1]>l[0]&&C[1]<l[3])){c.label=C[1];break}if(6===C[0]&&c.label<l[1]){c.label=l[1],l=C;break}if(l&&c.label<l[2]){c.label=l[2],c.ops.push(C);break}l[2]&&c.ops.pop(),c.trys.pop();continue}C=g.call(j,c)}catch(y){C=[6,y],E=0}finally{M=l=0}if(5&C[0])throw C[1];return{value:C[0]?C[1]:void 0,done:!0}}([C,y])}}};Object.defineProperty(U,"__esModule",{value:!0}),U.Publisher=void 0;var R,h=w(8402),v=w(2096),t=w(8613),f=w(2299),m=w(2798),_=w(4103),u=w(6946),P=w(543),B=w(5913),I=u.OpenViduLogger.getInstance(),J=function(j){function g(c,M,E){var l=j.call(this,new v.Stream(E.session?E.session:new h.Session(E),{publisherProperties:M,mediaConstraints:{}}),c)||this;return l.accessAllowed=!1,l.isSubscribedToRemote=!1,l.accessDenied=!1,R=P.PlatformUtils.getInstance(),l.properties=M,l.openvidu=E,l.stream.ee.on("local-stream-destroyed",function(a){l.stream.isLocalStreamPublished=!1;var d=new f.StreamEvent(!0,l,"streamDestroyed",l.stream,a);l.emitEvent("streamDestroyed",[d]),d.callDefaultBehavior()}),l}return p(g,j),g.prototype.publishAudio=function(c){var M=this;this.stream.audioActive!==c&&((this.stream.displayMyRemote()?this.stream.localMediaStreamWhenSubscribedToRemote:this.stream.getMediaStream()).getAudioTracks().forEach(function(l){l.enabled=c}),!!this.session&&!!this.stream.streamId&&this.session.openvidu.sendRequest("streamPropertyChanged",{streamId:this.stream.streamId,property:"audioActive",newValue:c,reason:"publishAudio"},function(l,a){l?I.error("Error sending 'streamPropertyChanged' event",l):(M.session.emitEvent("streamPropertyChanged",[new m.StreamPropertyChangedEvent(M.session,M.stream,"audioActive",c,!c,"publishAudio")]),M.emitEvent("streamPropertyChanged",[new m.StreamPropertyChangedEvent(M,M.stream,"audioActive",c,!c,"publishAudio")]),M.session.sendVideoData(M.stream.streamManager))}),this.stream.audioActive=c,I.info("'Publisher' has "+(c?"published":"unpublished")+" its audio stream"))},g.prototype.publishVideo=function(c,M){var E=this;return new Promise(function(l,a){return L(E,void 0,void 0,function(){var d,V,C,y,N,r,b=this;return D(this,function(x){switch(x.label){case 0:return this.stream.videoActive===c?[3,9]:(d=this.stream.displayMyRemote()?this.stream.localMediaStreamWhenSubscribedToRemote:this.stream.getMediaStream(),V=!1,d.getVideoTracks().forEach(function(O){O.enabled=c,c||!0!==M?c&&"ended"===O.readyState&&(V=!0):O.stop()}),!c&&!0===M&&this.stream.filter&&this.stream.filter.type.startsWith("VB:")?(this.stream.lastVBFilter=this.stream.filter,[4,this.stream.removeFilterAux(!0)]):[3,2]);case 1:x.sent(),x.label=2;case 2:return V?(C=d.getVideoTracks()[0],d.removeTrack(C),y=function(O){return L(b,void 0,void 0,function(){var S=this;return D(this,function(T){switch(T.label){case 0:return d.addTrack(O),this.stream.isLocalStreamPublished?[4,this.replaceTrackInRtcRtpSender(O)]:[3,2];case 1:T.sent(),T.label=2;case 2:return this.stream.lastVBFilter&&setTimeout(function(){return L(S,void 0,void 0,function(){var F,H;return D(this,function(ee){switch(ee.label){case 0:return F=this.stream.lastVBFilter.options,!!(H=this.stream.lastVBFilter.lastExecMethod)&&"update"===H.method&&(F=Object.assign({},F,H.params)),[4,this.stream.applyFilter(this.stream.lastVBFilter.type,F)];case 1:return ee.sent(),delete this.stream.lastVBFilter,[2]}})})},1),[2]}})})},M&&M instanceof MediaStreamTrack?[4,y(M)]:[3,4]):[3,8];case 3:return x.sent(),[3,8];case 4:return x.trys.push([4,7,,8]),[4,navigator.mediaDevices.getUserMedia({audio:!1,video:this.stream.lastVideoTrackConstraints})];case 5:return N=x.sent(),[4,y(N.getVideoTracks()[0])];case 6:return x.sent(),[3,8];case 7:return r=x.sent(),[2,a(r)];case 8:return!!this.session&&!!this.stream.streamId&&this.session.openvidu.sendRequest("streamPropertyChanged",{streamId:this.stream.streamId,property:"videoActive",newValue:c,reason:"publishVideo"},function(O,S){O?I.error("Error sending 'streamPropertyChanged' event",O):(b.session.emitEvent("streamPropertyChanged",[new m.StreamPropertyChangedEvent(b.session,b.stream,"videoActive",c,!c,"publishVideo")]),b.emitEvent("streamPropertyChanged",[new m.StreamPropertyChangedEvent(b,b.stream,"videoActive",c,!c,"publishVideo")]),b.session.sendVideoData(b.stream.streamManager))}),this.stream.videoActive=c,I.info("'Publisher' has "+(c?"published":"unpublished")+" its video stream"),[2,l()];case 9:return[2]}})})})},g.prototype.subscribeToRemote=function(c){this.isSubscribedToRemote=c=void 0===c||c,this.stream.subscribeToMyRemote(c)},g.prototype.on=function(c,M){var E=this;return j.prototype.on.call(this,c,M),"streamCreated"===c&&(this.stream&&this.stream.isLocalStreamPublished?this.emitEvent("streamCreated",[new f.StreamEvent(!1,this,"streamCreated",this.stream,"")]):this.stream.ee.on("stream-created-by-publisher",function(){E.emitEvent("streamCreated",[new f.StreamEvent(!1,E,"streamCreated",E.stream,"")])})),"accessAllowed"===c&&this.accessAllowed&&this.emitEvent("accessAllowed",[]),"accessDenied"===c&&this.accessDenied&&this.emitEvent("accessDenied",[]),this},g.prototype.once=function(c,M){var E=this;return j.prototype.once.call(this,c,M),"streamCreated"===c&&(this.stream&&this.stream.isLocalStreamPublished?this.emitEvent("streamCreated",[new f.StreamEvent(!1,this,"streamCreated",this.stream,"")]):this.stream.ee.once("stream-created-by-publisher",function(){E.emitEvent("streamCreated",[new f.StreamEvent(!1,E,"streamCreated",E.stream,"")])})),"accessAllowed"===c&&this.accessAllowed&&this.emitEvent("accessAllowed",[]),"accessDenied"===c&&this.accessDenied&&this.emitEvent("accessDenied",[]),this},g.prototype.off=function(c,M){return j.prototype.off.call(this,c,M),this},g.prototype.replaceTrack=function(c){return L(this,void 0,void 0,function(){return D(this,function(M){return[2,this.replaceTrackAux(c,!0)]})})},g.prototype.initialize=function(){var c=this;return new Promise(function(M,E){var V,l={},a={},d=2e3,C=function(b){return c.accessDenied=!0,c.accessAllowed=!1,I.error("Publisher initialization failed. ".concat(b.name,": ").concat(b.message)),E(b)},y=function(b){var x,O;if(c.accessAllowed=!0,c.accessDenied=!1,"undefined"!=typeof MediaStreamTrack&&c.properties.audioSource instanceof MediaStreamTrack&&(b.removeTrack(b.getAudioTracks()[0]),b.addTrack(c.properties.audioSource)),"undefined"!=typeof MediaStreamTrack&&c.properties.videoSource instanceof MediaStreamTrack&&(b.removeTrack(b.getVideoTracks()[0]),b.addTrack(c.properties.videoSource)),b.getAudioTracks()[0]){var S=null!=c.stream.audioActive?c.stream.audioActive:!!c.stream.outboundStreamOpts.publisherProperties.publishAudio;b.getAudioTracks()[0].enabled=S}b.getVideoTracks()[0]&&(S=null!=c.stream.videoActive?c.stream.videoActive:!!c.stream.outboundStreamOpts.publisherProperties.publishVideo,b.getVideoTracks()[0].enabled=S);for(var T=0,F=b.getAudioTracks();T<F.length;T++)(null===(x=(H=F[T]).contentHint)||void 0===x?void 0:x.length)||(H.contentHint="",I.info("Audio track Content Hint set: '".concat(H.contentHint,"'")));for(var ee=0,ie=b.getVideoTracks();ee<ie.length;ee++){var H;if(!(null===(O=(H=ie[ee]).contentHint)||void 0===O?void 0:O.length)){switch(c.stream.typeOfVideo){case B.TypeOfVideo.SCREEN:H.contentHint="detail";break;case B.TypeOfVideo.CUSTOM:I.warn("CUSTOM type video track was provided without Content Hint!"),H.contentHint="motion";break;default:H.contentHint="motion"}I.info("Video track Content Hint set: '".concat(H.contentHint,"'"))}}return c.initializeVideoReference(b),c.stream.displayMyRemote()||c.stream.updateMediaStreamInVideos(),delete c.firstVideoElement,c.stream.isSendVideo()?c.getVideoDimensions().then(function(se){c.stream.videoDimensions={width:se.width,height:se.height},c.stream.isSendScreen()&&(c.screenShareResizeInterval=setInterval(function(){var ae=b.getVideoTracks()[0].getSettings(),fe=ae.width,de=ae.height;c.stream.isLocalStreamPublished&&(null!=fe&&fe!==c.stream.videoDimensions.width||null!=de&&de!==c.stream.videoDimensions.height)&&c.openvidu.sendVideoDimensionsChangedEvent(c,"screenResized",c.stream.videoDimensions.width,c.stream.videoDimensions.height,fe||0,de||0)},650)),c.stream.isLocalStreamReadyToPublish=!0,c.stream.ee.emitEvent("stream-ready-to-publish",[])}):(c.stream.isLocalStreamReadyToPublish=!0,c.stream.ee.emitEvent("stream-ready-to-publish",[])),M()},N=function(b,x){c.clearPermissionDialogTimer(V,d),c.stream.isSendScreen()&&c.stream.isSendAudio()?(a.audio=x,a.video=!1,V=Date.now(),c.setPermissionDialogTimer(d),navigator.mediaDevices.getUserMedia(a).then(function(O){c.clearPermissionDialogTimer(V,d),b.addTrack(O.getAudioTracks()[0]),y(b)}).catch(function(O){c.clearPermissionDialogTimer(V,d),b.getAudioTracks().forEach(function(S){S.stop()}),b.getVideoTracks().forEach(function(S){S.stop()}),C(c.openvidu.generateAudioDeviceError(O,l))})):y(b)},r=function(b){var x,O;switch(I.error("getMediaError: ".concat(b.toString())),c.clearPermissionDialogTimer(V,d),"Error"===b.name&&(b.name=b.constructor.name),b.name.toLowerCase()){case"notfounderror":navigator.mediaDevices.getUserMedia({audio:!1,video:l.video}).then(function(S){S.getVideoTracks().forEach(function(T){T.stop()}),x=_.OpenViduErrorName.INPUT_AUDIO_DEVICE_NOT_FOUND,O=b.toString(),C(new _.OpenViduError(x,O))}).catch(function(S){x=_.OpenViduErrorName.INPUT_VIDEO_DEVICE_NOT_FOUND,O=b.toString(),C(new _.OpenViduError(x,O))});break;case"notallowederror":x=c.stream.isSendScreen()?_.OpenViduErrorName.SCREEN_CAPTURE_DENIED:_.OpenViduErrorName.DEVICE_ACCESS_DENIED,O=b.toString(),C(new _.OpenViduError(x,O));break;case"overconstrainederror":navigator.mediaDevices.getUserMedia({audio:!1,video:l.video}).then(function(S){S.getVideoTracks().forEach(function(T){T.stop()}),"deviceid"===b.constraint.toLowerCase()?(x=_.OpenViduErrorName.INPUT_AUDIO_DEVICE_NOT_FOUND,O="Audio input device with deviceId '"+l.audio.deviceId.exact+"' not found"):(x=_.OpenViduErrorName.PUBLISHER_PROPERTIES_ERROR,O="Audio input device doesn't support the value passed for constraint '"+b.constraint+"'"),C(new _.OpenViduError(x,O))}).catch(function(S){"deviceid"===b.constraint.toLowerCase()?(x=_.OpenViduErrorName.INPUT_VIDEO_DEVICE_NOT_FOUND,O="Video input device with deviceId '"+l.video.deviceId.exact+"' not found"):(x=_.OpenViduErrorName.PUBLISHER_PROPERTIES_ERROR,O="Video input device doesn't support the value passed for constraint '"+b.constraint+"'"),C(new _.OpenViduError(x,O))});break;case"aborterror":case"notreadableerror":x=_.OpenViduErrorName.DEVICE_ALREADY_IN_USE,O=b.toString(),C(new _.OpenViduError(x,O));break;default:x=_.OpenViduErrorName.GENERIC_ERROR,O=b.toString(),C(new _.OpenViduError(x,O))}};c.openvidu.generateMediaConstraints(c.properties).then(function(b){var x,O;if(b.videoTrack&&b.audioTrack||b.audioTrack&&!1===(null===(x=b.constraints)||void 0===x?void 0:x.video)||b.videoTrack&&!1===(null===(O=b.constraints)||void 0===O?void 0:O.audio))y(c.openvidu.addAlreadyProvidedTracks(b,new MediaStream,c.stream));else{c.stream.setOutboundStreamOptions({mediaConstraints:l=b.constraints,publisherProperties:c.properties});var T=void 0===l.audio||l.audio;a.audio=!c.stream.isSendScreen()&&T,a.video=l.video,V=Date.now(),c.setPermissionDialogTimer(d),c.stream.isSendScreen()&&navigator.mediaDevices.getDisplayMedia&&!R.isElectron()?navigator.mediaDevices.getDisplayMedia({video:!0}).then(function(F){c.openvidu.addAlreadyProvidedTracks(b,F),N(F,T)}).catch(function(F){r(F)}):(c.stream.lastVideoTrackConstraints=a.video,navigator.mediaDevices.getUserMedia(a).then(function(F){c.openvidu.addAlreadyProvidedTracks(b,F,c.stream),N(F,T)}).catch(function(F){r(F)}))}}).catch(function(b){C(b)})})},g.prototype.replaceTrackAux=function(c,M){return L(this,void 0,void 0,function(){var E,l;return D(this,function(a){switch(a.label){case 0:E=c.enabled,"video"===c.kind?c.enabled=this.stream.videoActive:"audio"===c.kind&&(c.enabled=this.stream.audioActive),a.label=1;case 1:return a.trys.push([1,7,,8]),this.stream.isLocalStreamPublished?[4,this.replaceTrackInMediaStream(c,M)]:[3,4];case 2:return a.sent(),[4,this.replaceTrackInRtcRtpSender(c)];case 3:return[2,a.sent()];case 4:return[4,this.replaceTrackInMediaStream(c,M)];case 5:return[2,a.sent()];case 6:return[3,8];case 7:throw l=a.sent(),c.enabled=E,l;case 8:return[2]}})})},g.prototype.getVideoDimensions=function(){var c=this;return new Promise(function(M,E){var a,l=R.isIonicIos()||R.isIOSWithSafari(),d=function(){var V,C;if("function"==typeof c.stream.getMediaStream().getVideoTracks()[0].getSettings){var y=c.stream.getMediaStream().getVideoTracks()[0].getSettings();V=y.width||c.videoReference.videoWidth,C=y.height||c.videoReference.videoHeight}else I.warn("MediaStreamTrack does not have getSettings method on "+R.getDescription()),V=c.videoReference.videoWidth,C=c.videoReference.videoHeight;return null!=a&&c.videoReference.removeEventListener("loadedmetadata",a),l&&document.body.removeChild(c.videoReference),M({width:V,height:C})};c.videoReference.readyState>=1?d():(c.videoReference.addEventListener("loadedmetadata",a=function(){if(c.videoReference.videoWidth)d();else var V=setInterval(function(){c.videoReference.videoWidth&&(clearInterval(V),d())},40)}),l&&document.body.appendChild(c.videoReference))})},g.prototype.reestablishStreamPlayingEvent=function(){this.ee.getListeners("streamPlaying").length>0&&this.addPlayEventToFirstVideo()},g.prototype.initializeVideoReference=function(c){this.videoReference=document.createElement("video"),this.videoReference.setAttribute("muted","true"),this.videoReference.style.display="none",(R.isSafariBrowser()||R.isIPhoneOrIPad()&&(R.isChromeMobileBrowser()||R.isEdgeMobileBrowser()||R.isOperaMobileBrowser()||R.isFirefoxMobileBrowser()))&&this.videoReference.setAttribute("playsinline","true"),this.stream.setMediaStream(c),this.firstVideoElement&&this.createVideoElement(this.firstVideoElement.targetElement,this.properties.insertMode),this.videoReference.srcObject=c},g.prototype.replaceTrackInMediaStream=function(c,M){return L(this,void 0,void 0,function(){var E,l;return D(this,function(a){return E=this.stream.displayMyRemote()?this.stream.localMediaStreamWhenSubscribedToRemote:this.stream.getMediaStream(),"video"===c.kind?(l=E.getVideoTracks()[0],M&&(this.stream.lastVideoTrackConstraints=c.getConstraints())):l=E.getAudioTracks()[0],E.removeTrack(l),l.stop(),E.addTrack(c),"video"===c.kind&&this.stream.isLocalStreamPublished&&M&&(this.openvidu.sendNewVideoDimensionsIfRequired(this,"trackReplaced",50,30),this.session.sendVideoData(this.stream.streamManager,5,!0,5)),[2]})})},g.prototype.setPermissionDialogTimer=function(c){var M=this;this.permissionDialogTimeout=setTimeout(function(){M.emitEvent("accessDialogOpened",[])},c)},g.prototype.clearPermissionDialogTimer=function(c,M){clearTimeout(this.permissionDialogTimeout),Date.now()-c>M&&this.emitEvent("accessDialogClosed",[])},g.prototype.replaceTrackInRtcRtpSender=function(c){return L(this,void 0,void 0,function(){var M,E;return D(this,function(l){switch(l.label){case 0:if(M=this.stream.getRTCPeerConnection().getSenders(),"video"===c.kind){if(!(E=M.find(function(a){return!!a.track&&"video"===a.track.kind})))throw new Error("There's no replaceable track for that kind of MediaStreamTrack in this Publisher object")}else{if("audio"!==c.kind)throw new Error("Unknown track kind "+c.kind);if(!(E=M.find(function(a){return!!a.track&&"audio"===a.track.kind})))throw new Error("There's no replaceable track for that kind of MediaStreamTrack in this Publisher object")}return[4,E.replaceTrack(c)];case 1:return l.sent(),[2]}})})},g}(t.StreamManager);U.Publisher=J},8402:function(ne,U,w){"use strict";var y,p=this&&this.__extends||(y=function(N,r){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,x){b.__proto__=x}||function(b,x){for(var O in x)Object.prototype.hasOwnProperty.call(x,O)&&(b[O]=x[O])})(N,r)},function(N,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function b(){this.constructor=N}y(N,r),N.prototype=null===r?Object.create(r):(b.prototype=r.prototype,new b)}),L=this&&this.__awaiter||function(y,N,r,b){return new(r||(r=Promise))(function(O,S){function T(ee){try{H(b.next(ee))}catch(ie){S(ie)}}function F(ee){try{H(b.throw(ee))}catch(ie){S(ie)}}function H(ee){ee.done?O(ee.value):function x(O){return O instanceof r?O:new r(function(S){S(O)})}(ee.value).then(T,F)}H((b=b.apply(y,N||[])).next())})},D=this&&this.__generator||function(y,N){var b,x,O,S,r={label:0,sent:function(){if(1&O[0])throw O[1];return O[1]},trys:[],ops:[]};return S={next:T(0),throw:T(1),return:T(2)},"function"==typeof Symbol&&(S[Symbol.iterator]=function(){return this}),S;function T(H){return function(ee){return function F(H){if(b)throw new TypeError("Generator is already executing.");for(;r;)try{if(b=1,x&&(O=2&H[0]?x.return:H[0]?x.throw||((O=x.return)&&O.call(x),0):x.next)&&!(O=O.call(x,H[1])).done)return O;switch(x=0,O&&(H=[2&H[0],O.value]),H[0]){case 0:case 1:O=H;break;case 4:return r.label++,{value:H[1],done:!1};case 5:r.label++,x=H[1],H=[0];continue;case 7:H=r.ops.pop(),r.trys.pop();continue;default:if(!(O=(O=r.trys).length>0&&O[O.length-1])&&(6===H[0]||2===H[0])){r=0;continue}if(3===H[0]&&(!O||H[1]>O[0]&&H[1]<O[3])){r.label=H[1];break}if(6===H[0]&&r.label<O[1]){r.label=O[1],O=H;break}if(O&&r.label<O[2]){r.label=O[2],r.ops.push(H);break}O[2]&&r.ops.pop(),r.trys.pop();continue}H=N.call(y,r)}catch(ee){H=[6,ee],x=0}finally{b=O=0}if(5&H[0])throw H[1];return{value:H[0]?H[1]:void 0,done:!0}}([H,ee])}}};Object.defineProperty(U,"__esModule",{value:!0}),U.Session=void 0;var V,h=w(7490),v=w(4540),t=w(1758),f=w(8074),m=w(8702),_=w(2156),u=w(7936),P=w(1018),B=w(5785),I=w(2299),R=w(2798),J=w(865),j=w(6237),g=w(4103),c=w(6274),M=w(6946),E=w(543),l=w(4303),a=w(7920),d=M.OpenViduLogger.getInstance(),C=function(y){function N(r){var b=y.call(this)||this;return b.streamManagers=[],b.remoteStreamsCreated=new Map,b.remoteConnections=new Map,V=E.PlatformUtils.getInstance(),b.openvidu=r,b}return p(N,y),N.prototype.connect=function(r,b){var x=this;return new Promise(function(O,S){if(x.processToken(r),!x.openvidu.checkSystemRequirements())return S(new g.OpenViduError(g.OpenViduErrorName.BROWSER_NOT_SUPPORTED,"Browser "+V.getName()+" (version "+V.getVersion()+") for "+V.getFamily()+" is not supported in OpenVidu"));x.options={sessionId:x.sessionId,participantId:r,metadata:b?x.stringClientMetadata(b):""},x.connectAux(r).then(function(){return O()}).catch(function(T){return S(T)})})},N.prototype.disconnect=function(){this.leave(!1,"disconnect")},N.prototype.subscribe=function(r,b,x,O){var S={};S=x&&"function"!=typeof x?{insertMode:void 0!==x.insertMode?"string"==typeof x.insertMode?c.VideoInsertMode[x.insertMode]:S.insertMode:c.VideoInsertMode.APPEND,subscribeToAudio:void 0===x.subscribeToAudio||x.subscribeToAudio,subscribeToVideo:void 0===x.subscribeToVideo||x.subscribeToVideo}:{insertMode:c.VideoInsertMode.APPEND,subscribeToAudio:!0,subscribeToVideo:!0};var T=void 0;if(x&&"function"==typeof x?T=x:O&&(T=O),!this.sessionConnected())throw void 0!==T&&T(this.notConnectedError()),this.notConnectedError();d.info("Subscribing to "+r.connection.connectionId),r.subscribe().then(function(){d.info("Subscribed correctly to "+r.connection.connectionId),void 0!==T&&T(void 0)}).catch(function(H){void 0!==T&&T(H)});var F=new t.Subscriber(r,b,S);return F.targetElement&&r.streamManager.createVideoElement(F.targetElement,S.insertMode),F},N.prototype.subscribeAsync=function(r,b,x){var O=this;return new Promise(function(S,T){if(!O.sessionConnected())return T(O.notConnectedError());var F,H=function(ee){return ee?T(ee):S(F)};F=x?O.subscribe(r,b,x,H):O.subscribe(r,b,H)})},N.prototype.unsubscribe=function(r){var b=this;return new Promise(function(x,O){if(!b.sessionConnected())return O(b.notConnectedError());var S=r.stream.connection.connectionId;d.info("Unsubscribing from "+S),b.openvidu.sendRequest("unsubscribeFromVideo",{sender:r.stream.connection.connectionId},function(T,F){return T?(d.error("Error unsubscribing from "+S),O(T)):(d.info("Unsubscribed correctly from "+S),r.stream.streamManager.removeAllVideos(),r.stream.disposeWebRtcPeer(),r.stream.disposeMediaStream(),x())})})},N.prototype.publish=function(r){var b=this;return new Promise(function(x,O){if(!b.sessionConnected())return O(b.notConnectedError());r.session=b,r.stream.session=b,r.stream.publishedOnce?r.initialize().then(function(){b.connection.addStream(r.stream),r.reestablishStreamPlayingEvent(),r.stream.publish().then(function(){return b.sendVideoData(r,8,!0,5),x()}).catch(function(S){return O(S)})}).catch(function(S){return O(S)}):(b.connection.addStream(r.stream),r.stream.publish().then(function(){return b.sendVideoData(r,8,!0,5),x()}).catch(function(S){return O(S)}))})},N.prototype.unpublish=function(r){var b=this;return new Promise(function(x,O){if(!b.sessionConnected())throw b.notConnectedError();var S=r.stream;return S.connection?S.connection!==b.connection?O(new Error("The associated Connection object of this Publisher is not your local Connection.Only moderators can force unpublish on remote Streams via 'forceUnpublish' method")):(d.info("Unpublishing local media ("+S.connection.connectionId+")"),void b.openvidu.sendRequest("unpublishVideo",function(T,F){if(T)return O(T);d.info("Media unpublished correctly"),S.disposeWebRtcPeer(),S.connection.stream==S&&delete S.connection.stream;var H=new I.StreamEvent(!0,r,"streamDestroyed",r.stream,"unpublish");return r.emitEvent("streamDestroyed",[H]),H.callDefaultBehavior(),x()})):O(new Error("The associated Connection object of this Publisher is null"))})},N.prototype.forceDisconnect=function(r){var b=this;return new Promise(function(x,O){if(!b.sessionConnected())return O(b.notConnectedError());d.info("Forcing disconnect for connection "+r.connectionId),b.openvidu.sendRequest("forceDisconnect",{connectionId:r.connectionId},function(S,T){return S?(d.error("Error forcing disconnect for Connection "+r.connectionId,S),O(401===S.code?new g.OpenViduError(g.OpenViduErrorName.OPENVIDU_PERMISSION_DENIED,"You don't have permissions to force a disconnection"):S)):(d.info("Forcing disconnect correctly for Connection "+r.connectionId),x())})})},N.prototype.forceUnpublish=function(r){var b=this;return new Promise(function(x,O){if(!b.sessionConnected())return O(b.notConnectedError());d.info("Forcing unpublish for stream "+r.streamId),b.openvidu.sendRequest("forceUnpublish",{streamId:r.streamId},function(S,T){return S?(d.error("Error forcing unpublish for Stream "+r.streamId,S),O(401===S.code?new g.OpenViduError(g.OpenViduErrorName.OPENVIDU_PERMISSION_DENIED,"You don't have permissions to force an unpublishing"):S)):(d.info("Forcing unpublish correctly for Stream "+r.streamId),x())})})},N.prototype.signal=function(r){var b=this;return new Promise(function(x,O){if(!b.sessionConnected())return O(b.notConnectedError());var S={};if(r.to&&r.to.length>0){var T=[];r.to.forEach(function(H){H.connectionId&&T.push(H.connectionId)}),S.to=T}else S.to=[];S.data=r.data?r.data:"";var F=r.type?r.type:"signal";F&&"signal:"!==F.substring(0,7)&&(F="signal:"+F),S.type=F,b.openvidu.sendRequest("sendMessage",{message:JSON.stringify(S)},function(H,ee){return H?O(H):x()})})},N.prototype.on=function(r,b){var x,O,S,T;return y.prototype.onAux.call(this,r,"Event '"+r+"' triggered by 'Session'",b),"publisherStartSpeaking"===r&&(this.remoteConnections.forEach(function(F){var H;(null===(H=F.stream)||void 0===H?void 0:H.hasAudio)&&F.stream.enableHarkSpeakingEvent()}),(null===(O=null===(x=this.connection)||void 0===x?void 0:x.stream)||void 0===O?void 0:O.hasAudio)&&this.connection.stream.enableHarkSpeakingEvent()),"publisherStopSpeaking"===r&&(this.remoteConnections.forEach(function(F){var H;(null===(H=F.stream)||void 0===H?void 0:H.hasAudio)&&F.stream.enableHarkStoppedSpeakingEvent()}),(null===(T=null===(S=this.connection)||void 0===S?void 0:S.stream)||void 0===T?void 0:T.hasAudio)&&this.connection.stream.enableHarkStoppedSpeakingEvent()),this},N.prototype.once=function(r,b){var x,O,S,T;return y.prototype.onceAux.call(this,r,"Event '"+r+"' triggered once by 'Session'",b),"publisherStartSpeaking"===r&&(this.remoteConnections.forEach(function(F){var H;(null===(H=F.stream)||void 0===H?void 0:H.hasAudio)&&F.stream.enableOnceHarkSpeakingEvent()}),(null===(O=null===(x=this.connection)||void 0===x?void 0:x.stream)||void 0===O?void 0:O.hasAudio)&&this.connection.stream.enableOnceHarkSpeakingEvent()),"publisherStopSpeaking"===r&&(this.remoteConnections.forEach(function(F){var H;(null===(H=F.stream)||void 0===H?void 0:H.hasAudio)&&F.stream.enableOnceHarkStoppedSpeakingEvent()}),(null===(T=null===(S=this.connection)||void 0===S?void 0:S.stream)||void 0===T?void 0:T.hasAudio)&&this.connection.stream.enableOnceHarkStoppedSpeakingEvent()),this},N.prototype.off=function(r,b){var O,S,T,F,x=this;return y.prototype.offAux.call(this,r,b),"publisherStartSpeaking"===r&&(this.anySpeechEventListenerEnabled("publisherStartSpeaking",!1)||(this.remoteConnections.forEach(function(H){var ee;(null===(ee=H.stream)||void 0===ee?void 0:ee.streamManager)&&(x.anySpeechEventListenerEnabled("publisherStartSpeaking",!1,H.stream.streamManager)||H.stream.disableHarkSpeakingEvent(!1))}),(null===(S=null===(O=this.connection)||void 0===O?void 0:O.stream)||void 0===S?void 0:S.streamManager)&&(this.anySpeechEventListenerEnabled("publisherStartSpeaking",!1,this.connection.stream.streamManager)||this.connection.stream.disableHarkSpeakingEvent(!1)))),"publisherStopSpeaking"===r&&(this.anySpeechEventListenerEnabled("publisherStopSpeaking",!1)||(this.remoteConnections.forEach(function(H){var ee;(null===(ee=H.stream)||void 0===ee?void 0:ee.streamManager)&&(x.anySpeechEventListenerEnabled("publisherStopSpeaking",!1,H.stream.streamManager)||H.stream.disableHarkStoppedSpeakingEvent(!1))}),(null===(F=null===(T=this.connection)||void 0===T?void 0:T.stream)||void 0===F?void 0:F.streamManager)&&(this.anySpeechEventListenerEnabled("publisherStopSpeaking",!1,this.connection.stream.streamManager)||this.connection.stream.disableHarkStoppedSpeakingEvent(!1)))),this},N.prototype.onParticipantJoined=function(r){var b=this;this.getConnection(r.id,"").then(function(x){d.warn("Connection "+x.connectionId+" already exists in connections list")}).catch(function(x){var O=new h.Connection(b,r);b.remoteConnections.set(r.id,O),b.ee.emitEvent("connectionCreated",[new m.ConnectionEvent(!1,b,"connectionCreated",O,"")])})},N.prototype.onParticipantLeft=function(r){var b=this;this.getRemoteConnection(r.connectionId,"onParticipantLeft").then(function(x){if(x.stream){var O=x.stream,S=new I.StreamEvent(!0,b,"streamDestroyed",O,r.reason);b.ee.emitEvent("streamDestroyed",[S]),S.callDefaultBehavior(),b.remoteStreamsCreated.delete(O.streamId)}b.remoteConnections.delete(x.connectionId),b.ee.emitEvent("connectionDestroyed",[new m.ConnectionEvent(!1,b,"connectionDestroyed",x,r.reason)])}).catch(function(x){d.error(x)})},N.prototype.onParticipantPublished=function(r){var O,b=this,x=function(S){b.remoteConnections.set(S.connectionId,S),b.remoteStreamsCreated.get(S.stream.streamId)||b.ee.emitEvent("streamCreated",[new I.StreamEvent(!1,b,"streamCreated",S.stream,"")]),b.remoteStreamsCreated.set(S.stream.streamId,!0)};this.getRemoteConnection(r.id,"onParticipantPublished").then(function(S){O=S,r.metadata=S.data,O.remoteOptions=r,O.initRemoteStreams(r.streams),x(O)}).catch(function(S){O=new h.Connection(b,r),x(O)})},N.prototype.onParticipantUnpublished=function(r){var b=this;r.connectionId===this.connection.connectionId?this.stopPublisherStream(r.reason):this.getRemoteConnection(r.connectionId,"onParticipantUnpublished").then(function(x){var O=new I.StreamEvent(!0,b,"streamDestroyed",x.stream,r.reason);b.ee.emitEvent("streamDestroyed",[O]),O.callDefaultBehavior();var S=x.stream.streamId;b.remoteStreamsCreated.delete(S),x.removeStream(S)}).catch(function(x){d.error(x)})},N.prototype.onParticipantEvicted=function(r){r.connectionId===this.connection.connectionId&&this.sessionId&&!this.connection.disposed&&this.leave(!0,r.reason)},N.prototype.onNewMessage=function(r){var b=this;d.info("New signal: "+JSON.stringify(r));var x=r.type?r.type.replace(/^(signal:)/,""):void 0;r.from?this.getConnection(r.from,"Connection '"+r.from+"' unknown when 'onNewMessage'. Existing remote connections: "+JSON.stringify(this.remoteConnections.keys())+". Existing local connection: "+this.connection.connectionId).then(function(O){b.ee.emitEvent("signal",[new B.SignalEvent(b,x,r.data,O)]),r.type&&"signal"!==r.type&&b.ee.emitEvent(r.type,[new B.SignalEvent(b,x,r.data,O)])}).catch(function(O){d.error(O)}):(this.ee.emitEvent("signal",[new B.SignalEvent(this,x,r.data,void 0)]),r.type&&"signal"!==r.type&&this.ee.emitEvent(r.type,[new B.SignalEvent(this,x,r.data,void 0)]))},N.prototype.onStreamPropertyChanged=function(r){var b=this,x=function(O){if(O.stream&&O.stream.streamId===r.streamId){var S=O.stream,T=void 0;switch(r.property){case"audioActive":T=S.audioActive,r.newValue="true"===r.newValue,S.audioActive=r.newValue;break;case"videoActive":T=S.videoActive,r.newValue="true"===r.newValue,S.videoActive=r.newValue;break;case"videoDimensions":T=S.videoDimensions,r.newValue=JSON.parse(JSON.parse(r.newValue)),S.videoDimensions=r.newValue;break;case"filter":T=S.filter,r.newValue=Object.keys(r.newValue).length>0?r.newValue:void 0,void 0!==r.newValue?(S.filter=new v.Filter(r.newValue.type,r.newValue.options),S.filter.stream=S,r.newValue.lastExecMethod&&(S.filter.lastExecMethod=r.newValue.lastExecMethod)):delete S.filter,r.newValue=S.filter}b.ee.emitEvent("streamPropertyChanged",[new R.StreamPropertyChangedEvent(b,S,r.property,r.newValue,T,r.reason)]),S.streamManager&&S.streamManager.emitEvent("streamPropertyChanged",[new R.StreamPropertyChangedEvent(S.streamManager,S,r.property,r.newValue,T,r.reason)])}else d.error("No stream with streamId '"+r.streamId+"' found for connection '"+r.connectionId+"' on 'streamPropertyChanged' event")};r.connectionId===this.connection.connectionId?x(this.connection):this.getRemoteConnection(r.connectionId,"onStreamPropertyChanged").then(function(O){x(O)}).catch(function(O){d.error(O)})},N.prototype.onConnectionPropertyChanged=function(r){var b;switch(r.property){case"role":b=this.connection.role.slice(),this.connection.role=r.newValue,this.connection.localOptions.role=r.newValue;break;case"record":b=this.connection.record,r.newValue="true"===r.newValue,this.connection.record=r.newValue,this.connection.localOptions.record=r.newValue}this.ee.emitEvent("connectionPropertyChanged",[new J.ConnectionPropertyChangedEvent(this,this.connection,r.property,r.newValue,b)])},N.prototype.onNetworkQualityLevelChangedChanged=function(r){var b=this;r.connectionId===this.connection.connectionId?this.ee.emitEvent("networkQualityLevelChanged",[new j.NetworkQualityLevelChangedEvent(this,r.newValue,r.oldValue,this.connection)]):this.getConnection(r.connectionId,"Connection not found for connectionId "+r.connectionId).then(function(x){b.ee.emitEvent("networkQualityLevelChanged",[new j.NetworkQualityLevelChangedEvent(b,r.newValue,r.oldValue,x)])}).catch(function(x){d.error(x)})},N.prototype.recvIceCandidate=function(r){var x=new RTCIceCandidate({candidate:r.candidate,sdpMLineIndex:r.sdpMLineIndex,sdpMid:r.sdpMid});this.getConnection(r.senderConnectionId,"Connection not found for connectionId "+r.senderConnectionId+" owning endpoint "+r.endpointName+". Ice candidate will be ignored: "+x).then(function(O){var S=O.stream;S.getWebRtcPeer().addIceCandidate(x).catch(function(T){d.error("Error adding candidate for "+S.streamId+" stream of endpoint "+r.endpointName+": "+T)})}).catch(function(O){d.error(O)})},N.prototype.onSessionClosed=function(r){d.info("Session closed: "+JSON.stringify(r));var b=r.sessionId;void 0!==b?this.ee.emitEvent("session-closed",[{session:b}]):d.warn("Session undefined on session closed",r)},N.prototype.onLostConnection=function(r){d.warn("Lost connection in Session "+this.sessionId),this.sessionId&&this.connection&&!this.connection.disposed&&this.leave(!0,r)},N.prototype.onRecoveredConnection=function(){d.info("Recovered connection in Session "+this.sessionId),this.reconnectBrokenStreams(),this.ee.emitEvent("reconnected",[])},N.prototype.onMediaError=function(r){d.error("Media error: "+JSON.stringify(r));var b=r.error;b?this.ee.emitEvent("error-media",[{error:b}]):d.warn("Received undefined media error:",r)},N.prototype.onRecordingStarted=function(r){this.ee.emitEvent("recordingStarted",[new u.RecordingEvent(this,"recordingStarted",r.id,r.name)])},N.prototype.onRecordingStopped=function(r){this.ee.emitEvent("recordingStopped",[new u.RecordingEvent(this,"recordingStopped",r.id,r.name,r.reason)])},N.prototype.onFilterEventDispatched=function(r){var b=this,x=r.connectionId;this.getConnection(x,"No connection found for connectionId "+x).then(function(O){d.info('Filter event of type "'.concat(r.eventType,'" dispatched'));var S=O.stream;if(!S||!S.filter)return d.error('Filter event of type "'.concat(r.eventType,'" dispatched for stream ').concat(S.streamId," but there is no ").concat(S?"filter":"stream"," defined"));var T=S.filter.handlers.get(r.eventType);if(!T||"function"!=typeof T){var F=Array.from(S.filter.handlers.keys());return d.error('Filter event of type "'.concat(r.eventType,'" not handled or not a function! Active filter events: ').concat(F.join(",")))}T.call(b,new _.FilterEvent(S.filter,r.eventType,r.data))})},N.prototype.onForciblyReconnectSubscriber=function(r){var b=this;return new Promise(function(x,O){b.getRemoteConnection(r.connectionId,"onForciblyReconnectSubscriber").then(function(S){if(!S.stream||S.stream.streamId!==r.streamId){var H="No stream with streamId '"+r.streamId+"' found for connection '"+r.connectionId+"' on 'streamPropertyChanged' event";return d.error(H),O(H)}var T=S.stream;if(T.setupReconnectionEventEmitter(x,O)){if(null!=T.reconnectionEventEmitter.onForciblyReconnectSubscriberLastEvent)return T.reconnectionEventEmitter.onForciblyReconnectSubscriberLastEvent=r,O("Ongoing forced subscriber reconnection");T.reconnectionEventEmitter.onForciblyReconnectSubscriberLastEvent=r;var F=function(){var ee=T.reconnectionEventEmitter.onForciblyReconnectSubscriberLastEvent;delete T.reconnectionEventEmitter.onForciblyReconnectSubscriberLastEvent,b.onForciblyReconnectSubscriber(ee)};return T.reconnectionEventEmitter.once("success",function(){F()}),void T.reconnectionEventEmitter.once("error",function(){F()})}T.completeWebRtcPeerReceive(!0,!0,r.sdpOffer).then(function(){return T.finalResolveForSubscription(!0,x)}).catch(function(ee){return T.finalRejectForSubscription(!0,"Error while forcibly reconnecting remote stream ".concat(r.streamId,": ").concat(ee.toString()),O)})}).catch(function(S){return d.error(S),O(S)})})},N.prototype.reconnectBrokenStreams=function(){d.info("Re-establishing media connections...");var r=!1;!!this.connection.stream&&this.connection.stream.streamIceConnectionStateBroken()&&(d.warn("Re-establishing Publisher "+this.connection.stream.streamId),this.connection.stream.initWebRtcPeerSend(!0),r=!0),this.remoteConnections.forEach(function(b){b.stream&&b.stream.streamIceConnectionStateBroken()&&(d.warn("Re-establishing Subscriber "+b.stream.streamId),b.stream.initWebRtcPeerReceive(!0),r=!0)}),r||d.info("There were no media streams in need of a reconnection")},N.prototype.emitEvent=function(r,b){this.ee.emitEvent(r,b)},N.prototype.leave=function(r,b){var x=this;if(d.info("Leaving Session (forced="+(r=!!r)+")"),this.stopVideoDataIntervals(),this.connection){if(this.connection.disposed||r?this.openvidu.closeWs():this.openvidu.sendRequest("leaveRoom",function(S,T){S&&d.error("leaveRoom error: ".concat(JSON.stringify(S))),x.openvidu.closeWs()}),this.stopPublisherStream(b),!this.connection.disposed){var O=new P.SessionDisconnectedEvent(this,b);this.ee.emitEvent("sessionDisconnected",[O]),O.callDefaultBehavior()}}else d.warn("You were not connected to the session "+this.sessionId);d.flush()},N.prototype.initializeParams=function(r){return{token:r||"",session:this.sessionId,platform:V.getDescription()?V.getDescription():"unknown",sdkVersion:this.openvidu.libraryVersion,metadata:this.options.metadata?this.options.metadata:"",secret:this.openvidu.getSecret(),recorder:this.openvidu.getRecorder()}},N.prototype.sendVideoData=function(r,b,x,O){var T,F,S=this;if(void 0===b&&(b=1),void 0===x&&(x=!1),void 0===O&&(O=1),V.isChromeBrowser()||V.isChromeMobileBrowser()||V.isOperaBrowser()||V.isOperaMobileBrowser()||V.isEdgeBrowser()||V.isEdgeMobileBrowser()||V.isElectron()||V.isSafariBrowser()&&!V.isIonicIos()||V.isAndroidBrowser()||V.isSamsungBrowser()||V.isIonicAndroid()||V.isIOSWithSafari()){var H=function(){return L(S,void 0,void 0,function(){var ie,se,ae;return D(this,function(fe){switch(fe.label){case 0:return"connected"!==(ie=r.stream.getRTCPeerConnection()).connectionState?[3,2]:[4,ie.getStats()];case 1:se=fe.sent(),ae=[],se.forEach(function(de){"frameWidth"in de&&"frameHeight"in de&&0===ae.length&&ae.push(de)}),ae.length>0&&this.openvidu.sendRequest("videoData",{height:ae[0].frameHeight,width:ae[0].frameWidth,videoActive:null!=r.stream.videoActive&&r.stream.videoActive,audioActive:null!=r.stream.audioActive&&r.stream.audioActive},function(de,le){de&&d.error("Error sending 'videoData' event",de)}),fe.label=2;case 2:return[2]}})})};if(x){var ee=1;this.videoDataInterval=setInterval(function(){ee<O?(ee++,H()):clearInterval(S.videoDataInterval)},1e3*b)}else this.videoDataTimeout=setTimeout(H,1e3*b)}else V.isFirefoxBrowser()||V.isFirefoxMobileBrowser()||V.isIonicIos()||V.isReactNative()?this.openvidu.sendRequest("videoData",{height:(null===(T=r.stream.videoDimensions)||void 0===T?void 0:T.height)||0,width:(null===(F=r.stream.videoDimensions)||void 0===F?void 0:F.width)||0,videoActive:null!=r.stream.videoActive&&r.stream.videoActive,audioActive:null!=r.stream.audioActive&&r.stream.audioActive},function(ie,se){ie&&d.error("Error sending 'videoData' event",ie)}):d.error("Browser "+V.getName()+" (version "+V.getVersion()+") for "+V.getFamily()+" is not supported in OpenVidu for Network Quality")},N.prototype.sessionConnected=function(){return null!=this.connection},N.prototype.notConnectedError=function(){return new g.OpenViduError(g.OpenViduErrorName.OPENVIDU_NOT_CONNECTED,"There is no connection to the session. Method 'Session.connect' must be successfully completed first")},N.prototype.anySpeechEventListenerEnabled=function(r,b,x){var O=this.ee.getListeners(r);if(b&&(O=O.filter(function(H){return H.once})),O.length>0)return!0;var T=0;if(x){var F=x.ee.getListeners(r);b&&(F=F.filter(function(H){return H.once})),T=F.length}return T>0},N.prototype.getTokenParams=function(r){var b=r.match(/^(wss?\:)\/\/(([^:\/?#]*)(?:\:([0-9]+))?)([\/]{0,1}[^?#]*)(\?[^#]*|)(#.*|)$/);if(b){var x={protocol:b[1],host:b[2],hostname:b[3],port:b[4],pathname:b[5],search:b[6],hash:b[7]},O=r.split("?"),S=decodeURI(O[1]).split("&").map(function(T){return T.split("=")}).reduce(function(T,F){return T[F[0]]=F[1],T},{});return{sessionId:S.sessionId,secret:S.secret,recorder:S.recorder,webrtcStatsInterval:S.webrtcStatsInterval,sendBrowserLogs:S.sendBrowserLogs,edition:S.edition,wsUri:"wss://"+x.host+"/openvidu",httpUri:"https://"+x.host}}throw new Error('Token not valid: "'.concat(r,'"'))},N.prototype.connectAux=function(r){var b=this;return new Promise(function(x,O){b.openvidu.startWs(function(S){if(S)return O(S);var T=b.initializeParams(r);b.openvidu.sendRequest("joinRoom",T,function(F,H){if(F)return O(F);b.processJoinRoomResponse(H,r),b.connection=new h.Connection(b,H);var ee={connections:new Array,streams:new Array};return H.value.forEach(function(se){var ae=new h.Connection(b,se);b.remoteConnections.set(ae.connectionId,ae),ee.connections.push(ae),ae.stream&&(b.remoteStreamsCreated.set(ae.stream.streamId,!0),ee.streams.push(ae.stream))}),b.ee.emitEvent("connectionCreated",[new m.ConnectionEvent(!1,b,"connectionCreated",b.connection,"")]),ee.connections.forEach(function(se){b.ee.emitEvent("connectionCreated",[new m.ConnectionEvent(!1,b,"connectionCreated",se,"")])}),ee.streams.forEach(function(se){b.ee.emitEvent("streamCreated",[new I.StreamEvent(!1,b,"streamCreated",se,"")])}),x()})})})},N.prototype.stopPublisherStream=function(r){this.connection.stream&&(this.connection.stream.disposeWebRtcPeer(),this.connection.stream.isLocalStreamPublished&&this.connection.stream.ee.emitEvent("local-stream-destroyed",[r]))},N.prototype.stopVideoDataIntervals=function(){clearInterval(this.videoDataInterval),clearTimeout(this.videoDataTimeout)},N.prototype.stringClientMetadata=function(r){return"string"!=typeof r?JSON.stringify(r):r},N.prototype.getConnection=function(r,b){var x=this;return new Promise(function(O,S){var T=x.remoteConnections.get(r);return T?O(T):x.connection.connectionId===r?O(x.connection):S(new g.OpenViduError(g.OpenViduErrorName.GENERIC_ERROR,b))})},N.prototype.getRemoteConnection=function(r,b){var x=this;return new Promise(function(O,S){var T=x.remoteConnections.get(r);if(T)return O(T);var F="Remote connection "+r+" unknown when '"+b+"'. Existing remote connections: "+JSON.stringify(x.remoteConnections.keys());return S(new g.OpenViduError(g.OpenViduErrorName.GENERIC_ERROR,F))})},N.prototype.processToken=function(r){var b=this.getTokenParams(r);this.sessionId=b.sessionId,b.secret&&(this.openvidu.secret=b.secret),b.recorder&&(this.openvidu.recorder=!0),b.webrtcStatsInterval&&(this.openvidu.webrtcStatsInterval=b.webrtcStatsInterval),b.sendBrowserLogs&&(this.openvidu.sendBrowserLogs=b.sendBrowserLogs),this.openvidu.isAtLeastPro="pro"===b.edition||"enterprise"===b.edition,this.openvidu.isEnterprise="enterprise"===b.edition,this.openvidu.wsUri=b.wsUri,this.openvidu.httpUri=b.httpUri},N.prototype.processJoinRoomResponse=function(r,b){if(this.sessionId=r.session,null!=r.customIceServers&&r.customIceServers.length>0){this.openvidu.iceServers=[];for(var x=0,O=r.customIceServers;x<O.length;x++){var S=O[x],T={urls:[S.url]};d.log("STUN/TURN server IP: "+S.url),null!=S.username&&null!=S.credential&&(T.username=S.username,T.credential=S.credential,d.log("TURN credentials ["+S.username+":"+S.credential+"]")),this.openvidu.iceServers.push(T)}}else null!=r.coturnIp&&null!=r.coturnPort&&null!=r.turnUsername&&null!=r.turnCredential&&(this.openvidu.iceServers=[{urls:["turn:"+r.coturnIp+":"+r.coturnPort],username:r.turnUsername,credential:r.turnCredential}],d.log("STUN/TURN server IP: "+r.coturnIp),d.log("TURN temp credentials ["+r.turnUsername+":"+r.turnCredential+"]"));this.openvidu.role=r.role,this.openvidu.finalUserId=r.finalUserId,this.openvidu.mediaServer=r.mediaServer,this.openvidu.videoSimulcast=r.videoSimulcast,this.capabilities={subscribe:!0,publish:"SUBSCRIBER"!==this.openvidu.role,forceUnpublish:"MODERATOR"===this.openvidu.role,forceDisconnect:"MODERATOR"===this.openvidu.role},d.info("openvidu-server version: "+r.version),null!=r.life&&(this.openvidu.life=r.life);var H=a(r.version)-a(this.openvidu.libraryVersion);l(r.version)!==l(this.openvidu.libraryVersion)||0!=H&&1!=H?d.error("openvidu-browser (".concat(this.openvidu.libraryVersion,") and openvidu-server (").concat(r.version,") versions are incompatible. ")+"Errors are likely to occur. openvidu-browser SDK is only compatible with the same version or the immediately following minor version of an OpenVidu deployment"):1==H&&d.warn("openvidu-browser version ".concat(this.openvidu.libraryVersion," does not match openvidu-server version ").concat(r.version,". ")+"These versions are still compatible with each other, but openvidu-browser version must be updated as soon as possible to ".concat(l(r.version),".").concat(a(r.version),".x. ")+"This client using openvidu-browser ".concat(this.openvidu.libraryVersion," will become incompatible with the next release of openvidu-server")),M.OpenViduLogger.configureJSNLog(this.openvidu,b),this.token=b},N}(f.EventDispatcher);U.Session=C},2096:function(ne,U,w){"use strict";var p=this&&this.__awaiter||function(l,a,d,V){return new(d||(d=Promise))(function(y,N){function r(O){try{x(V.next(O))}catch(S){N(S)}}function b(O){try{x(V.throw(O))}catch(S){N(S)}}function x(O){O.done?y(O.value):function C(y){return y instanceof d?y:new d(function(N){N(y)})}(O.value).then(r,b)}x((V=V.apply(l,a||[])).next())})},L=this&&this.__generator||function(l,a){var V,C,y,N,d={label:0,sent:function(){if(1&y[0])throw y[1];return y[1]},trys:[],ops:[]};return N={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(N[Symbol.iterator]=function(){return this}),N;function r(x){return function(O){return function b(x){if(V)throw new TypeError("Generator is already executing.");for(;d;)try{if(V=1,C&&(y=2&x[0]?C.return:x[0]?C.throw||((y=C.return)&&y.call(C),0):C.next)&&!(y=y.call(C,x[1])).done)return y;switch(C=0,y&&(x=[2&x[0],y.value]),x[0]){case 0:case 1:y=x;break;case 4:return d.label++,{value:x[1],done:!1};case 5:d.label++,C=x[1],x=[0];continue;case 7:x=d.ops.pop(),d.trys.pop();continue;default:if(!(y=(y=d.trys).length>0&&y[y.length-1])&&(6===x[0]||2===x[0])){d=0;continue}if(3===x[0]&&(!y||x[1]>y[0]&&x[1]<y[3])){d.label=x[1];break}if(6===x[0]&&d.label<y[1]){d.label=y[1],y=x;break}if(y&&d.label<y[2]){d.label=y[2],d.ops.push(x);break}y[2]&&d.ops.pop(),d.trys.pop();continue}x=a.call(l,d)}catch(O){x=[6,O],C=0}finally{V=y=0}if(5&x[0])throw x[1];return{value:x[0]?x[1]:void 0,done:!0}}([x,O])}}};Object.defineProperty(U,"__esModule",{value:!0}),U.Stream=void 0;var M,D=w(4540),h=w(1758),v=w(4641),t=w(2102),f=w(7507),m=w(805),_=w(4006),u=w(2798),P=w(4103),B=w(5913),I=w(6946),R=w(543),J=w(1464),j=w(5164),g=w(940),c=I.OpenViduLogger.getInstance(),E=function(){function l(a,d){var V=this;this.isSubscribeToRemote=!1,this.isLocalStreamReadyToPublish=!1,this.isLocalStreamPublished=!1,this.publishedOnce=!1,this.harkSpeakingEnabled=!1,this.harkSpeakingEnabledOnce=!1,this.harkStoppedSpeakingEnabled=!1,this.harkStoppedSpeakingEnabledOnce=!1,this.harkVolumeChangeEnabled=!1,this.harkVolumeChangeEnabledOnce=!1,this.ee=new g,M=R.PlatformUtils.getInstance(),this.session=a,d.hasOwnProperty("id")?(this.inboundStreamOpts=d,this.streamId=this.inboundStreamOpts.id,this.creationTime=this.inboundStreamOpts.createdAt,this.hasAudio=this.inboundStreamOpts.hasAudio,this.hasVideo=this.inboundStreamOpts.hasVideo,this.hasAudio&&(this.audioActive=this.inboundStreamOpts.audioActive),this.hasVideo&&(this.videoActive=this.inboundStreamOpts.videoActive,this.typeOfVideo=this.inboundStreamOpts.typeOfVideo?this.inboundStreamOpts.typeOfVideo:void 0,this.frameRate=-1===this.inboundStreamOpts.frameRate?void 0:this.inboundStreamOpts.frameRate,this.videoDimensions=this.inboundStreamOpts.videoDimensions),!!this.inboundStreamOpts.filter&&Object.keys(this.inboundStreamOpts.filter).length>0&&(!!this.inboundStreamOpts.filter.lastExecMethod&&0===Object.keys(this.inboundStreamOpts.filter.lastExecMethod).length&&delete this.inboundStreamOpts.filter.lastExecMethod,this.filter=this.inboundStreamOpts.filter)):(this.outboundStreamOpts=d,this.hasAudio=this.isSendAudio(),this.hasVideo=this.isSendVideo(),this.hasAudio&&(this.audioActive=!!this.outboundStreamOpts.publisherProperties.publishAudio),this.hasVideo&&(this.videoActive=!!this.outboundStreamOpts.publisherProperties.publishVideo,this.frameRate=this.outboundStreamOpts.publisherProperties.frameRate,this.typeOfVideo="undefined"!=typeof MediaStreamTrack&&this.outboundStreamOpts.publisherProperties.videoSource instanceof MediaStreamTrack?B.TypeOfVideo.CUSTOM:this.isSendScreen()?B.TypeOfVideo.SCREEN:B.TypeOfVideo.CAMERA),this.outboundStreamOpts.publisherProperties.filter&&(this.filter=this.outboundStreamOpts.publisherProperties.filter)),this.ee.on("mediastream-updated",function(){var C;V.streamManager.updateMediaStream(V.mediaStream),c.debug("Video srcObject ["+(null===(C=V.mediaStream)||void 0===C?void 0:C.id)+"] updated in stream ["+V.streamId+"]")})}return l.prototype.reconnect=function(){return this.reconnectStream("API")},l.prototype.applyFilter=function(a,d){var V=this;return new Promise(function(C,y){return p(V,void 0,void 0,function(){var N,r,b,x,O,S,T=this;return L(this,function(F){if(this.filter)return[2,y(new P.OpenViduError(P.OpenViduErrorName.GENERIC_ERROR,"There is already a filter applied to Stream "+this.streamId))];if(N=function(H,ee){if(H)return c.error("Error applying filter for Stream "+T.streamId,H),y(401===H.code?new P.OpenViduError(P.OpenViduErrorName.OPENVIDU_PERMISSION_DENIED,"You don't have permissions to apply a filter"):H);c.info("Filter successfully applied on Stream "+T.streamId);var ie=T.filter;return T.filter=new D.Filter(a,d),T.filter.stream=T,ee&&(T.session.emitEvent("streamPropertyChanged",[new u.StreamPropertyChangedEvent(T.session,T,"filter",T.filter,ie,"applyFilter")]),T.streamManager.emitEvent("streamPropertyChanged",[new u.StreamPropertyChangedEvent(T.streamManager,T,"filter",T.filter,ie,"applyFilter")])),C(T.filter)},a.startsWith("VB:")){if(!this.hasVideo)return[2,y(new P.OpenViduError(P.OpenViduErrorName.VIRTUAL_BACKGROUND_ERROR,"The Virtual Background filter requires a video track to be applied"))];if(!this.mediaStream||0===this.streamManager.videos.length)return[2,y(new P.OpenViduError(P.OpenViduErrorName.VIRTUAL_BACKGROUND_ERROR,"The StreamManager requires some video element to be attached to it in order to apply a Virtual Background filter"))];if(!(r=this.session.token?this.session.token:d.token))return[2,y(new P.OpenViduError(P.OpenViduErrorName.VIRTUAL_BACKGROUND_ERROR,'Virtual Background requires the client to be connected to a Session or to have a "token" property available in "options" parameter with a valid OpenVidu token'))];if("pro"!==(b=this.session.getTokenParams(r)).edition&&"enterprise"!==b.edition)return[2,y(new P.OpenViduError(P.OpenViduErrorName.VIRTUAL_BACKGROUND_ERROR,"OpenVidu Virtual Background API is available from OpenVidu Pro edition onwards"))];r=encodeURIComponent(btoa(r)),c.info("Applying Virtual Background to stream "+this.streamId),x=function(){return p(T,void 0,void 0,function(){var H,ee,ie,se,ae,de;return L(this,function(le){switch(le.label){case 0:return le.trys.push([0,8,,9]),H=this.streamId+"_"+(0,J.v4)(),ee=this.mediaStream.clone(),(ie=this.streamManager.videos[0].video.cloneNode(!1)).id=VirtualBackground.VirtualBackground.SOURCE_VIDEO_PREFIX+H,ie.srcObject=ee,ie.muted=!0,this.virtualBackgroundSourceElements={videoClone:ie,mediaStreamClone:ee},VirtualBackground.VirtualBackground.hideHtmlElement(ie,!1),VirtualBackground.VirtualBackground.appendHtmlElementToHiddenContainer(ie,H),[4,ie.play()];case 1:switch(le.sent(),se=new VirtualBackground.VirtualBackground({id:H,openviduServerUrl:new URL(b.httpUri),openviduToken:r,inputVideo:ie,inputResolution:"160x96",outputFramerate:24}),ae=void 0,a){case"VB:blur":return[3,2];case"VB:image":return[3,4]}return[3,6];case 2:return[4,se.backgroundBlur(d)];case 3:case 5:return ae=le.sent(),[3,7];case 4:return[4,se.backgroundImage(d)];case 6:throw new Error("Unknown Virtual Background filter: "+a);case 7:return this.virtualBackgroundSinkElements={VB:se,video:ae},ie.style.display="none",this.streamManager.remote?this.streamManager.replaceTrackInMediaStream(this.virtualBackgroundSinkElements.video.srcObject.getVideoTracks()[0],!1):this.streamManager.replaceTrackAux(this.virtualBackgroundSinkElements.video.srcObject.getVideoTracks()[0],!1),N(void 0,!1),[3,9];case 8:return de=le.sent(),N(de.name===P.OpenViduErrorName.VIRTUAL_BACKGROUND_ERROR?new P.OpenViduError(P.OpenViduErrorName.VIRTUAL_BACKGROUND_ERROR,de.message):de,!1),[3,9];case 9:return[2]}})})},"undefined"==typeof VirtualBackground?((O=document.createElement("script")).type="text/javascript",O.src=b.httpUri+"/openvidu/virtual-background/openvidu-virtual-background.js?token="+r,O.onload=function(){return p(T,void 0,void 0,function(){var H;return L(this,function(ee){switch(ee.label){case 0:return ee.trys.push([0,2,,3]),[4,x()];case 1:return ee.sent(),C(new D.Filter(a,d)),[3,3];case 2:return H=ee.sent(),y(H),[3,3];case 3:return[2]}})})},document.body.appendChild(O)):x().then(function(){return C(new D.Filter(a,d))}).catch(function(H){return y(H)})}else{if(!this.session.sessionConnected())return[2,y(this.session.notConnectedError())];c.info("Applying server filter to stream "+this.streamId),"string"!=typeof(S=d=null!=d?d:{})&&(S=JSON.stringify(S)),this.session.openvidu.sendRequest("applyFilter",{streamId:this.streamId,type:a,options:S},function(H,ee){N(H,!0)})}return[2]})})})},l.prototype.removeFilter=function(){return p(this,void 0,void 0,function(){return L(this,function(a){switch(a.label){case 0:return[4,this.removeFilterAux(!1)];case 1:return[2,a.sent()]}})})},l.prototype.getRTCPeerConnection=function(){return this.webRtcPeer.pc},l.prototype.getMediaStream=function(){return this.mediaStream},l.prototype.removeFilterAux=function(a){var d=this;return new Promise(function(V,C){return p(d,void 0,void 0,function(){var y,N,r,x,b=this;return L(this,function(O){switch(O.label){case 0:if(y=function(S,T){if(S)return delete b.filter,c.error("Error removing filter for Stream "+b.streamId,S),C(401===S.code?new P.OpenViduError(P.OpenViduErrorName.OPENVIDU_PERMISSION_DENIED,"You don't have permissions to remove a filter"):S);c.info("Filter successfully removed from Stream "+b.streamId);var F=b.filter;return delete b.filter,T&&(b.session.emitEvent("streamPropertyChanged",[new u.StreamPropertyChangedEvent(b.session,b,"filter",b.filter,F,"applyFilter")]),b.streamManager.emitEvent("streamPropertyChanged",[new u.StreamPropertyChangedEvent(b.streamManager,b,"filter",b.filter,F,"applyFilter")])),V()},!this.filter)return[3,12];if(!(null===(x=this.filter)||void 0===x?void 0:x.type.startsWith("VB:")))return[3,10];O.label=1;case 1:return O.trys.push([1,8,,9]),N=this.virtualBackgroundSourceElements.mediaStreamClone,a?[3,6]:this.streamManager.remote?[4,this.streamManager.replaceTrackInMediaStream(N.getVideoTracks()[0],!1)]:[3,3];case 2:return O.sent(),[3,5];case 3:return[4,this.streamManager.replaceTrackAux(N.getVideoTracks()[0],!1)];case 4:O.sent(),O.label=5;case 5:return[3,7];case 6:N.getTracks().forEach(function(S){return S.stop()}),O.label=7;case 7:return this.virtualBackgroundSinkElements.VB.cleanUp(),delete this.virtualBackgroundSinkElements,delete this.virtualBackgroundSourceElements,[2,y(void 0,!1)];case 8:return r=O.sent(),[2,y(r,!1)];case 9:return[3,11];case 10:if(!this.session.sessionConnected())return[2,C(this.session.notConnectedError())];c.info("Removing filter of stream "+this.streamId),this.session.openvidu.sendRequest("removeFilter",{streamId:this.streamId},function(S,T){return y(S,!0)}),O.label=11;case 11:return[3,13];case 12:return[2,C(new P.OpenViduError(P.OpenViduErrorName.GENERIC_ERROR,"Stream "+this.streamId+" has no filter applied"))];case 13:return[2]}})})})},l.prototype.setMediaStream=function(a){this.mediaStream=a},l.prototype.updateMediaStreamInVideos=function(){this.ee.emitEvent("mediastream-updated",[])},l.prototype.getWebRtcPeer=function(){return this.webRtcPeer},l.prototype.subscribeToMyRemote=function(a){this.isSubscribeToRemote=a},l.prototype.setOutboundStreamOptions=function(a){this.outboundStreamOpts=a},l.prototype.subscribe=function(){var a=this;return new Promise(function(d,V){a.initWebRtcPeerReceive(!1).then(function(){return d()}).catch(function(C){return V(C)})})},l.prototype.publish=function(){var a=this;return new Promise(function(d,V){a.isLocalStreamReadyToPublish?a.initWebRtcPeerSend(!1).then(function(){return d()}).catch(function(C){return V(C)}):a.ee.once("stream-ready-to-publish",function(){a.publish().then(function(){return d()}).catch(function(C){return V(C)})})})},l.prototype.disposeWebRtcPeer=function(){var a;this.webRtcPeer&&(this.webRtcPeer.dispose(),a=this.webRtcPeer.getId()),this.stopWebRtcStats(),c.info((this.outboundStreamOpts?"Outbound ":"Inbound ")+"RTCPeerConnection with id ["+a+"] from 'Stream' with id ["+this.streamId+"] is now closed")},l.prototype.disposeMediaStream=function(){return p(this,void 0,void 0,function(){var a;return L(this,function(d){switch(d.label){case 0:if(!this.filter||!this.filter.type.startsWith("VB:"))return[3,4];d.label=1;case 1:return d.trys.push([1,3,,4]),[4,this.removeFilterAux(!0)];case 2:return d.sent(),console.debug("Success removing Virtual Background filter for stream ".concat(this.streamId)),[3,4];case 3:return a=d.sent(),console.error("Error removing Virtual Background filter for stream ".concat(this.streamId),a),[3,4];case 4:return this.mediaStream&&(this.mediaStream.getAudioTracks().forEach(function(V){V.stop()}),this.mediaStream.getVideoTracks().forEach(function(V){V.stop()}),delete this.mediaStream),this.localMediaStreamWhenSubscribedToRemote&&(this.localMediaStreamWhenSubscribedToRemote.getAudioTracks().forEach(function(V){V.stop()}),this.localMediaStreamWhenSubscribedToRemote.getVideoTracks().forEach(function(V){V.stop()}),delete this.localMediaStreamWhenSubscribedToRemote),this.speechEvent&&(this.speechEvent.stop&&this.speechEvent.stop(),delete this.speechEvent),c.info((this.outboundStreamOpts?"Local ":"Remote ")+"MediaStream from 'Stream' with id ["+this.streamId+"] is now disposed"),[2]}})})},l.prototype.displayMyRemote=function(){return this.isSubscribeToRemote},l.prototype.isSendAudio=function(){return!!this.outboundStreamOpts&&null!==this.outboundStreamOpts.publisherProperties.audioSource&&!1!==this.outboundStreamOpts.publisherProperties.audioSource},l.prototype.isSendVideo=function(){return!!this.outboundStreamOpts&&null!==this.outboundStreamOpts.publisherProperties.videoSource&&!1!==this.outboundStreamOpts.publisherProperties.videoSource},l.prototype.isSendScreen=function(){var a="screen"===this.outboundStreamOpts.publisherProperties.videoSource;return M.isElectron()&&(a="string"==typeof this.outboundStreamOpts.publisherProperties.videoSource&&this.outboundStreamOpts.publisherProperties.videoSource.startsWith("screen:")),!!this.outboundStreamOpts&&a},l.prototype.enableHarkSpeakingEvent=function(){var a=this;this.setHarkListenerIfNotExists(),!this.harkSpeakingEnabled&&this.speechEvent&&(this.harkSpeakingEnabled=!0,this.speechEvent.on("speaking",function(){a.session.emitEvent("publisherStartSpeaking",[new m.PublisherSpeakingEvent(a.session,"publisherStartSpeaking",a.connection,a.streamId)]),a.streamManager.emitEvent("publisherStartSpeaking",[new m.PublisherSpeakingEvent(a.streamManager,"publisherStartSpeaking",a.connection,a.streamId)]),a.harkSpeakingEnabledOnce=!1}))},l.prototype.enableOnceHarkSpeakingEvent=function(){var a=this;this.setHarkListenerIfNotExists(),!this.harkSpeakingEnabledOnce&&this.speechEvent&&(this.harkSpeakingEnabledOnce=!0,this.speechEvent.once("speaking",function(){a.harkSpeakingEnabledOnce&&(a.session.emitEvent("publisherStartSpeaking",[new m.PublisherSpeakingEvent(a.session,"publisherStartSpeaking",a.connection,a.streamId)]),a.streamManager.emitEvent("publisherStartSpeaking",[new m.PublisherSpeakingEvent(a.streamManager,"publisherStartSpeaking",a.connection,a.streamId)])),a.disableHarkSpeakingEvent(!0)}))},l.prototype.disableHarkSpeakingEvent=function(a){if(this.speechEvent){if(this.harkSpeakingEnabledOnce=!1,a){if(this.harkSpeakingEnabled)return}else this.harkSpeakingEnabled=!1;this.harkVolumeChangeEnabled||this.harkVolumeChangeEnabledOnce||this.harkStoppedSpeakingEnabled||this.harkStoppedSpeakingEnabledOnce?this.speechEvent.off("speaking"):(this.speechEvent.stop(),delete this.speechEvent)}},l.prototype.enableHarkStoppedSpeakingEvent=function(){var a=this;this.setHarkListenerIfNotExists(),!this.harkStoppedSpeakingEnabled&&this.speechEvent&&(this.harkStoppedSpeakingEnabled=!0,this.speechEvent.on("stopped_speaking",function(){a.session.emitEvent("publisherStopSpeaking",[new m.PublisherSpeakingEvent(a.session,"publisherStopSpeaking",a.connection,a.streamId)]),a.streamManager.emitEvent("publisherStopSpeaking",[new m.PublisherSpeakingEvent(a.streamManager,"publisherStopSpeaking",a.connection,a.streamId)]),a.harkStoppedSpeakingEnabledOnce=!1}))},l.prototype.enableOnceHarkStoppedSpeakingEvent=function(){var a=this;this.setHarkListenerIfNotExists(),!this.harkStoppedSpeakingEnabledOnce&&this.speechEvent&&(this.harkStoppedSpeakingEnabledOnce=!0,this.speechEvent.once("stopped_speaking",function(){a.harkStoppedSpeakingEnabledOnce&&(a.session.emitEvent("publisherStopSpeaking",[new m.PublisherSpeakingEvent(a.session,"publisherStopSpeaking",a.connection,a.streamId)]),a.streamManager.emitEvent("publisherStopSpeaking",[new m.PublisherSpeakingEvent(a.streamManager,"publisherStopSpeaking",a.connection,a.streamId)])),a.disableHarkStoppedSpeakingEvent(!0)}))},l.prototype.disableHarkStoppedSpeakingEvent=function(a){if(this.speechEvent){if(this.harkStoppedSpeakingEnabledOnce=!1,a){if(this.harkStoppedSpeakingEnabled)return}else this.harkStoppedSpeakingEnabled=!1;this.harkVolumeChangeEnabled||this.harkVolumeChangeEnabledOnce||this.harkSpeakingEnabled||this.harkSpeakingEnabledOnce?this.speechEvent.off("stopped_speaking"):(this.speechEvent.stop(),delete this.speechEvent)}},l.prototype.enableHarkVolumeChangeEvent=function(a){var d=this;this.setHarkListenerIfNotExists()?(!this.harkVolumeChangeEnabled||a)&&(this.harkVolumeChangeEnabled=!0,this.speechEvent.on("volume_change",function(V){var y={newValue:V,oldValue:d.speechEvent.oldVolumeValue};d.speechEvent.oldVolumeValue=V,d.streamManager.emitEvent("streamAudioVolumeChange",[new _.StreamManagerEvent(d.streamManager,"streamAudioVolumeChange",y)])})):this.harkVolumeChangeEnabled=!0},l.prototype.enableOnceHarkVolumeChangeEvent=function(a){var d=this;this.setHarkListenerIfNotExists()?(!this.harkVolumeChangeEnabledOnce||a)&&(this.harkVolumeChangeEnabledOnce=!0,this.speechEvent.once("volume_change",function(V){var y={newValue:V,oldValue:d.speechEvent.oldVolumeValue};d.speechEvent.oldVolumeValue=V,d.disableHarkVolumeChangeEvent(!0),d.streamManager.emitEvent("streamAudioVolumeChange",[new _.StreamManagerEvent(d.streamManager,"streamAudioVolumeChange",y)])})):this.harkVolumeChangeEnabledOnce=!0},l.prototype.disableHarkVolumeChangeEvent=function(a){if(this.speechEvent){if(this.harkVolumeChangeEnabledOnce=!1,a){if(this.harkVolumeChangeEnabled)return}else this.harkVolumeChangeEnabled=!1;this.harkSpeakingEnabled||this.harkSpeakingEnabledOnce||this.harkStoppedSpeakingEnabled||this.harkStoppedSpeakingEnabledOnce?this.speechEvent.off("volume_change"):(this.speechEvent.stop(),delete this.speechEvent)}},l.prototype.isLocal=function(){return!this.inboundStreamOpts&&!!this.outboundStreamOpts},l.prototype.getSelectedIceCandidate=function(){var a=this;return new Promise(function(d,V){a.webRtcStats.getSelectedIceCandidateInfo().then(function(C){return d(C)}).catch(function(C){return V(C)})})},l.prototype.getRemoteIceCandidateList=function(){return this.webRtcPeer.remoteCandidatesQueue},l.prototype.getLocalIceCandidateList=function(){return this.webRtcPeer.localCandidatesQueue},l.prototype.streamIceConnectionStateBroken=function(){if(!this.getWebRtcPeer()||!this.getRTCPeerConnection())return!1;if(this.isLocal()&&this.session.openvidu.advancedConfiguration.forceMediaReconnectionAfterNetworkDrop)return c.warn('OpenVidu Browser advanced configuration option "forceMediaReconnectionAfterNetworkDrop" is enabled. Stream '.concat(this.streamId," (").concat(this.isLocal()?"Publisher":"Subscriber",") will force a reconnection")),!0;var a=this.getRTCPeerConnection().iceConnectionState;return"connected"!==a&&"completed"!==a},l.prototype.setHarkListenerIfNotExists=function(){if(this.mediaStream){if(!this.speechEvent){var a=this.harkOptions?this.harkOptions:this.session.openvidu.advancedConfiguration.publisherSpeakingEventsOptions||{};a.interval="number"==typeof a.interval?a.interval:100,a.threshold="number"==typeof a.threshold?a.threshold:-50,this.speechEvent=j(this.mediaStream,a)}return!0}return!1},l.prototype.setupReconnectionEventEmitter=function(a,d){return null==this.reconnectionEventEmitter?(this.reconnectionEventEmitter=new g,!1):(console.warn("Trying to reconnect stream ".concat(this.streamId," (").concat(this.isLocal()?"Publisher":"Subscriber",") but an ongoing reconnection process is active. Waiting for response...")),this.reconnectionEventEmitter.once("success",function(){return a()}),this.reconnectionEventEmitter.once("error",function(V){return d(V)}),!0)},l.prototype.initWebRtcPeerSend=function(a){var d=this;return new Promise(function(V,C){var y;if(a){if(d.setupReconnectionEventEmitter(V,C))return}else d.initHarkEvents();var r=function(O){var S;return a&&(null===(S=d.reconnectionEventEmitter)||void 0===S||S.emitEvent("error",[O]),delete d.reconnectionEventEmitter),C(O)},x={mediaConstraints:{audio:d.hasAudio,video:d.hasVideo},simulcast:null!==(y=d.outboundStreamOpts.publisherProperties.videoSimulcast)&&void 0!==y?y:d.session.openvidu.videoSimulcast,onIceCandidate:d.connection.sendIceCandidate.bind(d.connection),onIceConnectionStateException:function(O,S,T){d.session.emitEvent("exception",[new f.ExceptionEvent(d.session,O,d,S,T)])},iceServers:d.getIceServersConf(),mediaStream:d.mediaStream,mediaServer:d.session.openvidu.mediaServer,typeOfVideo:d.typeOfVideo?B.TypeOfVideo[d.typeOfVideo]:void 0};"mediasoup"!==d.session.openvidu.mediaServer&&(x.simulcast=!1),a&&d.disposeWebRtcPeer(),d.webRtcPeer=d.displayMyRemote()?new v.WebRtcPeerSendrecv(x):new v.WebRtcPeerSendonly(x),d.webRtcPeer.addIceConnectionStateChangeListener("publisher of "+d.connection.connectionId),d.webRtcPeer.createOffer().then(function(O){d.webRtcPeer.processLocalOffer(O).then(function(){!function(O){c.debug("Sending SDP offer to publish as "+d.streamId,O);var T,S=a?"reconnectStream":"publishVideo";if(a)T={stream:d.streamId,sdpString:O};else{var F=void 0;d.isSendVideo()&&(F="undefined"!=typeof MediaStreamTrack&&d.outboundStreamOpts.publisherProperties.videoSource instanceof MediaStreamTrack?B.TypeOfVideo.CUSTOM:d.isSendScreen()?B.TypeOfVideo.SCREEN:B.TypeOfVideo.CAMERA),T={doLoopback:d.displayMyRemote()||!1,hasAudio:d.isSendAudio(),hasVideo:d.isSendVideo(),audioActive:d.audioActive,videoActive:d.videoActive,typeOfVideo:F,frameRate:d.frameRate?d.frameRate:-1,videoDimensions:JSON.stringify(d.videoDimensions),filter:d.outboundStreamOpts.publisherProperties.filter,sdpOffer:O}}d.session.openvidu.sendRequest(S,T,function(H,ee){H?r(401===H.code?new P.OpenViduError(P.OpenViduErrorName.OPENVIDU_PERMISSION_DENIED,"You don't have permissions to publish"):"Error on publishVideo: "+JSON.stringify(H)):d.webRtcPeer.processRemoteAnswer(ee.sdpAnswer).then(function(){d.streamId=ee.id,d.creationTime=ee.createdAt,d.isLocalStreamPublished=!0,d.publishedOnce=!0,d.displayMyRemote()&&(d.localMediaStreamWhenSubscribedToRemote=d.mediaStream,d.remotePeerSuccessfullyEstablished(a)),d.ee.emitEvent(a?"stream-reconnected-by-publisher":"stream-created-by-publisher",[]),d.initWebRtcStats(),c.info("'Publisher' ("+d.streamId+") successfully "+(a?"reconnected":"published")+" to session"),function(){var O;a&&(null===(O=d.reconnectionEventEmitter)||void 0===O||O.emitEvent("success"),delete d.reconnectionEventEmitter),V()}()}).catch(function(ie){r(ie)})})}(O.sdp)}).catch(function(S){r(new Error("(publish) SDP process local offer error: "+JSON.stringify(S)))})}).catch(function(O){r(new Error("(publish) SDP create offer error: "+JSON.stringify(O)))})})},l.prototype.finalResolveForSubscription=function(a,d){var V;return c.info("'Subscriber' ("+this.streamId+") successfully "+(a?"reconnected":"subscribed")),this.remotePeerSuccessfullyEstablished(a),this.initWebRtcStats(),a&&(null===(V=this.reconnectionEventEmitter)||void 0===V||V.emitEvent("success"),delete this.reconnectionEventEmitter),d()},l.prototype.finalRejectForSubscription=function(a,d,V){var C;return c.error("Error for 'Subscriber' ("+this.streamId+") while trying to "+(a?"reconnect":"subscribe")+": "+d.toString()),a&&(null===(C=this.reconnectionEventEmitter)||void 0===C||C.emitEvent("error",[d]),delete this.reconnectionEventEmitter),V(d)},l.prototype.initWebRtcPeerReceive=function(a){var d=this;return new Promise(function(V,C){a&&d.setupReconnectionEventEmitter(V,C)||("mediasoup"===d.session.openvidu.mediaServer?d.initWebRtcPeerReceiveFromServer(a).then(function(){return d.finalResolveForSubscription(a,V)}).catch(function(y){return d.finalRejectForSubscription(a,y,C)}):d.initWebRtcPeerReceiveFromClient(a).then(function(){return d.finalResolveForSubscription(a,V)}).catch(function(y){return d.finalRejectForSubscription(a,y,C)}))})},l.prototype.initWebRtcPeerReceiveFromClient=function(a){var d=this;return new Promise(function(V,C){d.completeWebRtcPeerReceive(a,!1).then(function(y){d.webRtcPeer.processRemoteAnswer(y.sdpAnswer).then(function(){return V()}).catch(function(N){return C(N)})}).catch(function(y){return C(y)})})},l.prototype.initWebRtcPeerReceiveFromServer=function(a){var d=this;return new Promise(function(V,C){d.session.openvidu.sendRequest("prepareReceiveVideoFrom",{sender:d.streamId,reconnect:a},function(y,N){if(y)return C(new Error("Error on prepareReceiveVideoFrom: "+JSON.stringify(y)));d.completeWebRtcPeerReceive(a,!1,N.sdpOffer).then(function(){return V()}).catch(function(r){return C(r)})})})},l.prototype.completeWebRtcPeerReceive=function(a,d,V){var C=this;return new Promise(function(y,N){c.debug("'Session.subscribe(Stream)' called");var r=function(x){c.debug("Sending local SDP ".concat(V?"answer":"offer"," to subscribe to ").concat(C.streamId),x);var O=a?"reconnectStream":"receiveVideoFrom",S={};S[a?"stream":"sender"]=C.streamId,V?S[a?"sdpString":"sdpAnswer"]=x:S.sdpOffer=x,a&&(S.forciblyReconnect=d),C.session.openvidu.sendRequest(O,S,function(T,F){return T?N(new Error("Error on "+O+" : "+JSON.stringify(T))):y(F)})},b={mediaConstraints:{audio:C.hasAudio,video:C.hasVideo},simulcast:!1,onIceCandidate:C.connection.sendIceCandidate.bind(C.connection),onIceConnectionStateException:function(x,O,S){C.session.emitEvent("exception",[new f.ExceptionEvent(C.session,x,C,O,S)])},iceServers:C.getIceServersConf(),mediaServer:C.session.openvidu.mediaServer,typeOfVideo:C.typeOfVideo?B.TypeOfVideo[C.typeOfVideo]:void 0};a&&C.disposeWebRtcPeer(),C.webRtcPeer=new v.WebRtcPeerRecvonly(b),C.webRtcPeer.addIceConnectionStateChangeListener(C.streamId),V?C.webRtcPeer.processRemoteOffer(V).then(function(){C.webRtcPeer.createAnswer().then(function(x){C.webRtcPeer.processLocalAnswer(x).then(function(){r(x.sdp)}).catch(function(O){return N(new Error("(subscribe) SDP process local answer error: "+JSON.stringify(O)))})}).catch(function(x){return N(new Error("(subscribe) SDP create answer error: "+JSON.stringify(x)))})}).catch(function(x){return N(new Error("(subscribe) SDP process remote offer error: "+JSON.stringify(x)))}):C.webRtcPeer.createOffer().then(function(x){C.webRtcPeer.processLocalOffer(x).then(function(){r(x.sdp)}).catch(function(O){return N(new Error("(subscribe) SDP process local offer error: "+JSON.stringify(O)))})}).catch(function(x){return N(new Error("(subscribe) SDP create offer error: "+JSON.stringify(x)))})})},l.prototype.remotePeerSuccessfullyEstablished=function(a){a&&null!=this.mediaStream&&this.disposeMediaStream(),this.mediaStream=new MediaStream;for(var d,V=0,C=this.webRtcPeer.pc.getReceivers();V<C.length;V++)(d=C[V]).track&&this.mediaStream.addTrack(d.track);if(c.debug("Peer remote stream",this.mediaStream),this.mediaStream){if(this.streamManager instanceof h.Subscriber){if(this.mediaStream.getAudioTracks()[0]){var y=a?this.audioActive:!!this.streamManager.properties.subscribeToAudio;this.mediaStream.getAudioTracks()[0].enabled=y}this.mediaStream.getVideoTracks()[0]&&(y=a?this.videoActive:!!this.streamManager.properties.subscribeToVideo,this.mediaStream.getVideoTracks()[0].enabled=y)}this.updateMediaStreamInVideos(),this.initHarkEvents()}},l.prototype.initHarkEvents=function(){this.mediaStream.getAudioTracks()[0]&&(this.session.anySpeechEventListenerEnabled("publisherStartSpeaking",!0,this.streamManager)&&this.enableOnceHarkSpeakingEvent(),this.session.anySpeechEventListenerEnabled("publisherStartSpeaking",!1,this.streamManager)&&this.enableHarkSpeakingEvent(),this.session.anySpeechEventListenerEnabled("publisherStopSpeaking",!0,this.streamManager)&&this.enableOnceHarkStoppedSpeakingEvent(),this.session.anySpeechEventListenerEnabled("publisherStopSpeaking",!1,this.streamManager)&&this.enableHarkStoppedSpeakingEvent(),this.harkVolumeChangeEnabledOnce&&this.enableOnceHarkVolumeChangeEvent(!0),this.harkVolumeChangeEnabled&&this.enableHarkVolumeChangeEvent(!0))},l.prototype.onIceConnectionStateExceptionHandler=function(a,d,V){switch(a){case f.ExceptionEventName.ICE_CONNECTION_FAILED:this.onIceConnectionFailed();break;case f.ExceptionEventName.ICE_CONNECTION_DISCONNECTED:this.onIceConnectionDisconnected()}this.session.emitEvent("exception",[new f.ExceptionEvent(this.session,a,this,d,V)])},l.prototype.onIceConnectionFailed=function(){c.log("[ICE_CONNECTION_FAILED] Handling ICE_CONNECTION_FAILED event. Reconnecting stream ".concat(this.streamId," (").concat(this.isLocal()?"Publisher":"Subscriber",")")),this.reconnectStreamAndLogResultingIceConnectionState(f.ExceptionEventName.ICE_CONNECTION_FAILED)},l.prototype.onIceConnectionDisconnected=function(){var a=this;c.log("[ICE_CONNECTION_DISCONNECTED] Handling ICE_CONNECTION_DISCONNECTED event. Waiting for ICE to be restored and reconnect stream ".concat(this.streamId," (").concat(this.isLocal()?"Publisher":"Subscriber",") if not possible"));var d=this.session.openvidu.advancedConfiguration.iceConnectionDisconnectedExceptionTimeout||4e3;this.awaitWebRtcPeerConnectionState(d).then(function(V){switch(V){case"failed":c.warn("[ICE_CONNECTION_DISCONNECTED] ICE connection of stream ".concat(a.streamId," (").concat(a.isLocal()?"Publisher":"Subscriber",") is now failed after ICE_CONNECTION_DISCONNECTED"));break;case"connected":case"completed":c.log("[ICE_CONNECTION_DISCONNECTED] ICE connection of stream ".concat(a.streamId," (").concat(a.isLocal()?"Publisher":"Subscriber",") automatically restored after ICE_CONNECTION_DISCONNECTED. Current ICE connection state: ").concat(V));break;case"closed":case"checking":case"new":case"disconnected":c.warn("[ICE_CONNECTION_DISCONNECTED] ICE connection of stream ".concat(a.streamId," (").concat(a.isLocal()?"Publisher":"Subscriber",") couldn't be restored after ICE_CONNECTION_DISCONNECTED event. Current ICE connection state after ").concat(d," ms: ").concat(V)),a.reconnectStreamAndLogResultingIceConnectionState(f.ExceptionEventName.ICE_CONNECTION_DISCONNECTED)}})},l.prototype.reconnectStreamAndLogResultingIceConnectionState=function(a){return p(this,void 0,void 0,function(){var d,V;return L(this,function(C){switch(C.label){case 0:return C.trys.push([0,2,,3]),[4,this.reconnectStreamAndReturnIceConnectionState(a)];case 1:switch(d=C.sent()){case"connected":case"completed":c.log("[".concat(a,"] Stream ").concat(this.streamId," (").concat(this.isLocal()?"Publisher":"Subscriber",") successfully reconnected after ").concat(a,". Current ICE connection state: ").concat(d));break;default:c.error("[".concat(a,"] Stream ").concat(this.streamId," (").concat(this.isLocal()?"Publisher":"Subscriber",") failed to reconnect after ").concat(a,". Current ICE connection state: ").concat(d))}return[3,3];case 2:return V=C.sent(),c.error("[".concat(a,"] Error reconnecting stream ").concat(this.streamId," (").concat(this.isLocal()?"Publisher":"Subscriber",") after ").concat(a,": ").concat(V)),[3,3];case 3:return[2]}})})},l.prototype.reconnectStreamAndReturnIceConnectionState=function(a){return p(this,void 0,void 0,function(){var V;return L(this,function(C){switch(C.label){case 0:c.log("[".concat(a,"] Reconnecting stream ").concat(this.streamId," (").concat(this.isLocal()?"Publisher":"Subscriber",") after event ").concat(a)),C.label=1;case 1:return C.trys.push([1,3,,4]),[4,this.reconnectStream(a)];case 2:return C.sent(),[2,this.awaitWebRtcPeerConnectionState(this.session.openvidu.advancedConfiguration.iceConnectionDisconnectedExceptionTimeout||4e3)];case 3:return V=C.sent(),c.warn("[".concat(a,"] Error reconnecting stream ").concat(this.streamId," (").concat(this.isLocal()?"Publisher":"Subscriber","). Reason: ").concat(V)),[2,this.awaitWebRtcPeerConnectionState(1)];case 4:return[2]}})})},l.prototype.reconnectStream=function(a){return p(this,void 0,void 0,function(){var V;return L(this,function(C){switch(C.label){case 0:return[4,this.isWebsocketConnected(a,3e3)];case 1:if(C.sent())return c.log("[".concat(a,"] Trying to reconnect stream ").concat(this.streamId," (").concat(this.isLocal()?"Publisher":"Subscriber",") and the websocket is opened")),this.isLocal()?[2,this.initWebRtcPeerSend(!0)]:[2,this.initWebRtcPeerReceive(!0)];throw V="[".concat(a,"] Trying to reconnect stream ").concat(this.streamId," (").concat(this.isLocal()?"Publisher":"Subscriber",") but the websocket wasn't opened"),c.error(V),Error(V)}})})},l.prototype.isWebsocketConnected=function(a,d){var V=this;return new Promise(function(C,y){var N=V.session.openvidu.getWsReadyState();if(1!==N)return console.warn("[".concat(a,"] Websocket readyState is ").concat(N)),C(!1);var r=setTimeout(function(){return console.warn("[".concat(a,"] Websocket timeout of ").concat(d,"ms")),C(!1)},d);V.session.openvidu.sendRequest("echo",{},function(b,x){return clearTimeout(r),b?(console.warn("[".concat(a,"] Websocket 'echo' returned error: ").concat(b)),C(!1)):C(!0)})})},l.prototype.awaitWebRtcPeerConnectionState=function(a){return p(this,void 0,void 0,function(){var d,V,C,y;return L(this,function(N){switch(N.label){case 0:d=this.getRTCPeerConnection().iceConnectionState,V=150,C=Math.ceil(a/V),y=0,N.label=1;case 1:return y<C?"connected"===(d=this.getRTCPeerConnection().iceConnectionState)||"completed"===d?[3,4]:[4,new Promise(function(r){return setTimeout(r,V)})]:[3,4];case 2:N.sent(),N.label=3;case 3:return y++,[3,1];case 4:return[2,d]}})})},l.prototype.initWebRtcStats=function(){this.webRtcStats=new t.WebRtcStats(this),this.webRtcStats.initWebRtcStats()},l.prototype.stopWebRtcStats=function(){this.webRtcStats&&this.webRtcStats.isEnabled()&&this.webRtcStats.stopWebRtcStats()},l.prototype.getIceServersConf=function(){return this.session.openvidu.advancedConfiguration.iceServers?"freeice"===this.session.openvidu.advancedConfiguration.iceServers?void 0:this.session.openvidu.advancedConfiguration.iceServers:this.session.openvidu.iceServers?this.session.openvidu.iceServers:void 0},l.prototype.gatherStatsForPeer=function(){var a=this;return new Promise(function(d,V){a.isLocal()?a.getRTCPeerConnection().getSenders().forEach(function(C){return C.getStats().then(function(y){y.forEach(function(N){if(a.isReportWanted(N)){var r={};r.type=N.type,r.timestamp=N.timestamp,r.id=N.id,"outbound-rtp"===N.type&&(r.ssrc=N.ssrc,r.firCount=N.firCount,r.pliCount=N.pliCount,r.nackCount=N.nackCount,r.qpSum=N.qpSum,r.mediaType=N.kind?N.kind:N.mediaType?N.mediaType:-1!==N.id.indexOf("VideoStream")?"video":"audio","video"===r.mediaType&&(r.framesEncoded=N.framesEncoded),r.packetsSent=N.packetsSent,r.bytesSent=N.bytesSent),"candidate-pair"===N.type&&void 0!==N.totalRoundTripTime&&(r.availableOutgoingBitrate=N.availableOutgoingBitrate,r.rtt=N.currentRoundTripTime,r.averageRtt=N.totalRoundTripTime/N.responsesReceived),c.log(r)}})})}):a.getRTCPeerConnection().getReceivers().forEach(function(C){return C.getStats().then(function(y){y.forEach(function(N){if(a.isReportWanted(N)){var r={};r.type=N.type,r.timestamp=N.timestamp,r.id=N.id,"inbound-rtp"===N.type&&(r.ssrc=N.ssrc,r.firCount=N.firCount,r.pliCount=N.pliCount,r.nackCount=N.nackCount,r.qpSum=N.qpSum,r.mediaType=N.kind?N.kind:N.mediaType?N.mediaType:-1!==N.id.indexOf("VideoStream")?"video":"audio","video"===r.mediaType&&(r.framesDecoded=N.framesDecoded),r.packetsReceived=N.packetsReceived,r.packetsLost=N.packetsLost,r.jitter=N.jitter,r.bytesReceived=N.bytesReceived),"candidate-pair"===N.type&&void 0!==N.totalRoundTripTime&&(r.availableIncomingBitrate=N.availableIncomingBitrate,r.rtt=N.currentRoundTripTime,r.averageRtt=N.totalRoundTripTime/N.responsesReceived),c.log(r)}})})})})},l.prototype.isReportWanted=function(a){return"inbound-rtp"===a.type&&!this.isLocal()||"outbound-rtp"===a.type&&this.isLocal()||"candidate-pair"===a.type&&a.nominated&&a.bytesSent>0},l}();U.Stream=E},8613:function(ne,U,w){"use strict";var B,p=this&&this.__extends||(B=function(I,R){return(B=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(J,j){J.__proto__=j}||function(J,j){for(var g in j)Object.prototype.hasOwnProperty.call(j,g)&&(J[g]=j[g])})(I,R)},function(I,R){if("function"!=typeof R&&null!==R)throw new TypeError("Class extends value "+String(R)+" is not a constructor or null");function J(){this.constructor=I}B(I,R),I.prototype=null===R?Object.create(R):(J.prototype=R.prototype,new J)});Object.defineProperty(U,"__esModule",{value:!0}),U.StreamManager=void 0;var u,L=w(8074),D=w(4006),h=w(4281),v=w(7507),t=w(6274),f=w(6946),m=w(543),_=f.OpenViduLogger.getInstance(),P=function(B){function I(R,J){var j=B.call(this)||this;if(j.videos=[],j.lazyLaunchVideoElementCreatedEvent=!1,u=m.PlatformUtils.getInstance(),j.stream=R,j.stream.streamManager=j,j.remote=!j.stream.isLocal(),J){var g=void 0;"string"==typeof J?g=document.getElementById(J):J instanceof HTMLElement&&(g=J),g&&(j.firstVideoElement={targetElement:g,video:document.createElement("video"),id:"",canplayListenerAdded:!1},(u.isSafariBrowser()||u.isIPhoneOrIPad()&&(u.isChromeMobileBrowser()||u.isEdgeMobileBrowser()||u.isOperaMobileBrowser()||u.isFirefoxMobileBrowser()))&&j.firstVideoElement.video.setAttribute("playsinline","true"),j.targetElement=g,j.element=g)}return j.canPlayListener=function(){j.deactivateStreamPlayingEventExceptionTimeout(),j.ee.emitEvent("streamPlaying",[new D.StreamManagerEvent(j,"streamPlaying",void 0)])},j}return p(I,B),I.prototype.on=function(R,J){return B.prototype.onAux.call(this,R,"Event '"+R+"' triggered by '"+(this.remote?"Subscriber":"Publisher")+"'",J),"videoElementCreated"===R&&!!this.stream&&this.lazyLaunchVideoElementCreatedEvent&&(this.ee.emitEvent("videoElementCreated",[new h.VideoElementEvent(this.videos[0].video,this,"videoElementCreated")]),this.lazyLaunchVideoElementCreatedEvent=!1),"streamPlaying"===R&&this.videos[0]&&this.videos[0].video&&this.videos[0].video.currentTime>0&&!1===this.videos[0].video.paused&&!1===this.videos[0].video.ended&&4===this.videos[0].video.readyState&&this.ee.emitEvent("streamPlaying",[new D.StreamManagerEvent(this,"streamPlaying",void 0)]),this.stream.hasAudio&&("publisherStartSpeaking"===R&&this.stream.enableHarkSpeakingEvent(),"publisherStopSpeaking"===R&&this.stream.enableHarkStoppedSpeakingEvent(),"streamAudioVolumeChange"===R&&this.stream.enableHarkVolumeChangeEvent(!1)),this},I.prototype.once=function(R,J){return B.prototype.onceAux.call(this,R,"Event '"+R+"' triggered once by '"+(this.remote?"Subscriber":"Publisher")+"'",J),"videoElementCreated"===R&&!!this.stream&&this.lazyLaunchVideoElementCreatedEvent&&this.ee.emitEvent("videoElementCreated",[new h.VideoElementEvent(this.videos[0].video,this,"videoElementCreated")]),"streamPlaying"===R&&this.videos[0]&&this.videos[0].video&&this.videos[0].video.currentTime>0&&!1===this.videos[0].video.paused&&!1===this.videos[0].video.ended&&4===this.videos[0].video.readyState&&this.ee.emitEvent("streamPlaying",[new D.StreamManagerEvent(this,"streamPlaying",void 0)]),this.stream.hasAudio&&("publisherStartSpeaking"===R&&this.stream.enableOnceHarkSpeakingEvent(),"publisherStopSpeaking"===R&&this.stream.enableOnceHarkStoppedSpeakingEvent(),"streamAudioVolumeChange"===R&&this.stream.enableOnceHarkVolumeChangeEvent(!1)),this},I.prototype.off=function(R,J){return B.prototype.offAux.call(this,R,J),"publisherStartSpeaking"===R&&0===this.ee.getListeners(R).length+this.stream.session.ee.getListeners(R).length&&this.stream.disableHarkSpeakingEvent(!1),"publisherStopSpeaking"===R&&0===this.ee.getListeners(R).length+this.stream.session.ee.getListeners(R).length&&this.stream.disableHarkStoppedSpeakingEvent(!1),"streamAudioVolumeChange"===R&&0===this.ee.getListeners(R).length&&this.stream.disableHarkVolumeChangeEvent(!1),this},I.prototype.addVideoElement=function(R){this.initializeVideoProperties(R),!this.remote&&this.stream.displayMyRemote()&&R.srcObject!==this.stream.getMediaStream()&&(R.srcObject=this.stream.getMediaStream());for(var J=0,j=this.videos;J<j.length;J++)if(j[J].video===R)return 0;for(var c=1,M=0,E=this.stream.session.streamManagers;M<E.length;M++)if(E[M].disassociateVideo(R)){c=-1;break}return this.stream.session.streamManagers.forEach(function(a){a.disassociateVideo(R)}),this.pushNewStreamManagerVideo({video:R,id:R.id,canplayListenerAdded:!1}),_.info("New video element associated to ",this),c},I.prototype.createVideoElement=function(R,J){var j;if("string"==typeof R){if(!(j=document.getElementById(R)))throw new Error("The provided 'targetElement' couldn't be resolved to any HTML element: "+R)}else{if(!(R instanceof HTMLElement))throw new Error("The provided 'targetElement' couldn't be resolved to any HTML element: "+R);j=R}var g=this.createVideo();this.initializeVideoProperties(g);var c=J||t.VideoInsertMode.APPEND;switch(c){case t.VideoInsertMode.AFTER:j.parentNode.insertBefore(g,j.nextSibling);break;case t.VideoInsertMode.APPEND:j.appendChild(g);break;case t.VideoInsertMode.BEFORE:j.parentNode.insertBefore(g,j);break;case t.VideoInsertMode.PREPEND:j.insertBefore(g,j.childNodes[0]);break;case t.VideoInsertMode.REPLACE:j.parentNode.replaceChild(g,j);break;default:c=t.VideoInsertMode.APPEND,j.appendChild(g)}var M={targetElement:j,video:g,insertMode:c,id:g.id,canplayListenerAdded:!1};return this.pushNewStreamManagerVideo(M),this.ee.emitEvent("videoElementCreated",[new h.VideoElementEvent(M.video,this,"videoElementCreated")]),this.lazyLaunchVideoElementCreatedEvent=!!this.firstVideoElement,g},I.prototype.updatePublisherSpeakingEventsOptions=function(R){var J=this.stream.harkOptions?this.stream.harkOptions:this.stream.session.openvidu.advancedConfiguration.publisherSpeakingEventsOptions||{},j="number"==typeof R.interval?R.interval:"number"==typeof J.interval?J.interval:100,g="number"==typeof R.threshold?R.threshold:"number"==typeof J.threshold?J.threshold:-50;this.stream.harkOptions={interval:j,threshold:g},this.stream.speechEvent&&(this.stream.speechEvent.setInterval(j),this.stream.speechEvent.setThreshold(g))},I.prototype.initializeVideoProperties=function(R){!this.remote&&this.stream.displayMyRemote()||R.srcObject!==this.stream.getMediaStream()&&(R.srcObject=this.stream.getMediaStream()),R.autoplay=!0,R.controls=!1,(u.isSafariBrowser()||u.isIPhoneOrIPad()&&(u.isChromeMobileBrowser()||u.isEdgeMobileBrowser()||u.isOperaMobileBrowser()||u.isFirefoxMobileBrowser()))&&R.setAttribute("playsinline","true"),R.id||(R.id=(this.remote?"remote-":"local-")+"video-"+this.stream.streamId,!this.id&&!!this.targetElement&&(this.id=R.id)),this.remote&&this.isMirroredVideo(R)?this.removeMirrorVideo(R):!this.remote&&!this.stream.displayMyRemote()&&(R.muted=!0,this.isMirroredVideo(R)&&!this.stream.outboundStreamOpts.publisherProperties.mirror?this.removeMirrorVideo(R):this.stream.outboundStreamOpts.publisherProperties.mirror&&!this.stream.isSendScreen()&&this.mirrorVideo(R))},I.prototype.removeAllVideos=function(){for(var R=this,J=this.stream.session.streamManagers.length-1;J>=0;--J)this.stream.session.streamManagers[J]===this&&this.stream.session.streamManagers.splice(J,1);this.videos.forEach(function(j){!!j.video&&!!j.video.removeEventListener&&j.video.removeEventListener("canplay",R.canPlayListener),j.canplayListenerAdded=!1,j.targetElement&&(j.video.parentNode.removeChild(j.video),R.ee.emitEvent("videoElementDestroyed",[new h.VideoElementEvent(j.video,R,"videoElementDestroyed")])),R.removeSrcObject(j),R.videos.filter(function(g){return!g.targetElement})})},I.prototype.disassociateVideo=function(R){for(var J=!1,j=0;j<this.videos.length;j++)if(this.videos[j].video===R){this.videos[j].video.removeEventListener("canplay",this.canPlayListener),this.videos.splice(j,1),J=!0,_.info("Video element disassociated from ",this);break}return J},I.prototype.addPlayEventToFirstVideo=function(){this.videos[0]&&this.videos[0].video&&!this.videos[0].canplayListenerAdded&&(this.activateStreamPlayingEventExceptionTimeout(),this.videos[0].video.addEventListener("canplay",this.canPlayListener),this.videos[0].canplayListenerAdded=!0)},I.prototype.updateMediaStream=function(R){this.videos.forEach(function(J){if(J.video.srcObject=R,u.isIonicIos()){var g=J.video;J.video.parentElement.replaceChild(g,J.video),J.video=g}})},I.prototype.emitEvent=function(R,J){this.ee.emitEvent(R,J)},I.prototype.createVideo=function(){return document.createElement("video")},I.prototype.removeSrcObject=function(R){R.video.srcObject=null,this.deactivateStreamPlayingEventExceptionTimeout()},I.prototype.pushNewStreamManagerVideo=function(R){this.videos.push(R),this.addPlayEventToFirstVideo(),-1===this.stream.session.streamManagers.indexOf(this)&&this.stream.session.streamManagers.push(this)},I.prototype.mirrorVideo=function(R){u.isIonicIos()||(R.style.transform="rotateY(180deg)",R.style.webkitTransform="rotateY(180deg)")},I.prototype.removeMirrorVideo=function(R){R.style.transform="unset",R.style.webkitTransform="unset"},I.prototype.isMirroredVideo=function(R){return"rotateY(180deg)"===R.style.transform||"rotateY(180deg)"===R.style.webkitTransform},I.prototype.activateStreamPlayingEventExceptionTimeout=function(){var R=this;if(this.remote&&null==this.streamPlayingEventExceptionTimeout){var J=this.stream.session.openvidu.advancedConfiguration.noStreamPlayingEventExceptionTimeout||4e3;this.streamPlayingEventExceptionTimeout=setTimeout(function(){var j="StreamManager of Stream "+R.stream.streamId+" ("+(R.remote?"Subscriber":"Publisher")+') did not trigger "streamPlaying" event in '+J+" ms";_.warn(j),R.stream.session.emitEvent("exception",[new v.ExceptionEvent(R.stream.session,v.ExceptionEventName.NO_STREAM_PLAYING_EVENT,R,j)]),delete R.streamPlayingEventExceptionTimeout},J)}},I.prototype.deactivateStreamPlayingEventExceptionTimeout=function(){clearTimeout(this.streamPlayingEventExceptionTimeout),delete this.streamPlayingEventExceptionTimeout},I}(L.EventDispatcher);U.StreamManager=P},1758:function(ne,U,w){"use strict";var m,p=this&&this.__extends||(m=function(_,u){return(m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(P,B){P.__proto__=B}||function(P,B){for(var I in B)Object.prototype.hasOwnProperty.call(B,I)&&(P[I]=B[I])})(_,u)},function(_,u){if("function"!=typeof u&&null!==u)throw new TypeError("Class extends value "+String(u)+" is not a constructor or null");function P(){this.constructor=_}m(_,u),_.prototype=null===u?Object.create(u):(P.prototype=u.prototype,new P)}),L=this&&this.__awaiter||function(m,_,u,P){return new(u||(u=Promise))(function(I,R){function J(c){try{g(P.next(c))}catch(M){R(M)}}function j(c){try{g(P.throw(c))}catch(M){R(M)}}function g(c){c.done?I(c.value):function B(I){return I instanceof u?I:new u(function(R){R(I)})}(c.value).then(J,j)}g((P=P.apply(m,_||[])).next())})},D=this&&this.__generator||function(m,_){var P,B,I,R,u={label:0,sent:function(){if(1&I[0])throw I[1];return I[1]},trys:[],ops:[]};return R={next:J(0),throw:J(1),return:J(2)},"function"==typeof Symbol&&(R[Symbol.iterator]=function(){return this}),R;function J(g){return function(c){return function j(g){if(P)throw new TypeError("Generator is already executing.");for(;u;)try{if(P=1,B&&(I=2&g[0]?B.return:g[0]?B.throw||((I=B.return)&&I.call(B),0):B.next)&&!(I=I.call(B,g[1])).done)return I;switch(B=0,I&&(g=[2&g[0],I.value]),g[0]){case 0:case 1:I=g;break;case 4:return u.label++,{value:g[1],done:!1};case 5:u.label++,B=g[1],g=[0];continue;case 7:g=u.ops.pop(),u.trys.pop();continue;default:if(!(I=(I=u.trys).length>0&&I[I.length-1])&&(6===g[0]||2===g[0])){u=0;continue}if(3===g[0]&&(!I||g[1]>I[0]&&g[1]<I[3])){u.label=g[1];break}if(6===g[0]&&u.label<I[1]){u.label=I[1],I=g;break}if(I&&u.label<I[2]){u.label=I[2],u.ops.push(g);break}I[2]&&u.ops.pop(),u.trys.pop();continue}g=_.call(m,u)}catch(c){g=[6,c],B=0}finally{P=I=0}if(5&g[0])throw g[1];return{value:g[0]?g[1]:void 0,done:!0}}([g,c])}}};Object.defineProperty(U,"__esModule",{value:!0}),U.Subscriber=void 0;var h=w(8613),t=w(6946).OpenViduLogger.getInstance(),f=function(m){function _(u,P,B){var I=m.call(this,u,P)||this;return I.element=I.targetElement,I.stream=u,I.properties=B,I}return p(_,m),_.prototype.subscribeToAudio=function(u){return this.stream.getMediaStream().getAudioTracks().forEach(function(P){P.enabled=u}),this.stream.audioActive=u,t.info("'Subscriber' has "+(u?"subscribed to":"unsubscribed from")+" its audio stream"),this},_.prototype.subscribeToVideo=function(u){return this.stream.getMediaStream().getVideoTracks().forEach(function(P){P.enabled=u}),this.stream.videoActive=u,t.info("'Subscriber' has "+(u?"subscribed to":"unsubscribed from")+" its video stream"),this},_.prototype.replaceTrackInMediaStream=function(u,P){return L(this,void 0,void 0,function(){var B,I;return D(this,function(R){return B=this.stream.getMediaStream(),"video"===u.kind?(I=B.getVideoTracks()[0],P&&(this.stream.lastVideoTrackConstraints=u.getConstraints())):I=B.getAudioTracks()[0],B.removeTrack(I),I.stop(),B.addTrack(u),[2]})})},_}(h.StreamManager);U.Subscriber=f},5156:(ne,U)=>{"use strict";var p;Object.defineProperty(U,"__esModule",{value:!0}),U.LocalRecorderState=void 0,(p=U.LocalRecorderState||(U.LocalRecorderState={})).READY="READY",p.RECORDING="RECORDING",p.PAUSED="PAUSED",p.FINISHED="FINISHED"},4103:(ne,U)=>{"use strict";var L;Object.defineProperty(U,"__esModule",{value:!0}),U.OpenViduError=U.OpenViduErrorName=void 0,(L=U.OpenViduErrorName||(U.OpenViduErrorName={})).BROWSER_NOT_SUPPORTED="BROWSER_NOT_SUPPORTED",L.DEVICE_ACCESS_DENIED="DEVICE_ACCESS_DENIED",L.DEVICE_ALREADY_IN_USE="DEVICE_ALREADY_IN_USE",L.SCREEN_CAPTURE_DENIED="SCREEN_CAPTURE_DENIED",L.SCREEN_SHARING_NOT_SUPPORTED="SCREEN_SHARING_NOT_SUPPORTED",L.SCREEN_EXTENSION_NOT_INSTALLED="SCREEN_EXTENSION_NOT_INSTALLED",L.SCREEN_EXTENSION_DISABLED="SCREEN_EXTENSION_DISABLED",L.INPUT_VIDEO_DEVICE_NOT_FOUND="INPUT_VIDEO_DEVICE_NOT_FOUND",L.INPUT_AUDIO_DEVICE_NOT_FOUND="INPUT_AUDIO_DEVICE_NOT_FOUND",L.INPUT_AUDIO_DEVICE_GENERIC_ERROR="INPUT_AUDIO_DEVICE_GENERIC_ERROR",L.NO_INPUT_SOURCE_SET="NO_INPUT_SOURCE_SET",L.PUBLISHER_PROPERTIES_ERROR="PUBLISHER_PROPERTIES_ERROR",L.OPENVIDU_PERMISSION_DENIED="OPENVIDU_PERMISSION_DENIED",L.OPENVIDU_NOT_CONNECTED="OPENVIDU_NOT_CONNECTED",L.VIRTUAL_BACKGROUND_ERROR="VIRTUAL_BACKGROUND_ERROR",L.GENERIC_ERROR="GENERIC_ERROR",U.OpenViduError=function L(D,h){this.name=D,this.message=h}},5913:(ne,U)=>{"use strict";var p;Object.defineProperty(U,"__esModule",{value:!0}),U.TypeOfVideo=void 0,(p=U.TypeOfVideo||(U.TypeOfVideo={})).CAMERA="CAMERA",p.SCREEN="SCREEN",p.CUSTOM="CUSTOM",p.IPCAM="IPCAM"},6274:(ne,U)=>{"use strict";var p;Object.defineProperty(U,"__esModule",{value:!0}),U.VideoInsertMode=void 0,(p=U.VideoInsertMode||(U.VideoInsertMode={})).AFTER="AFTER",p.APPEND="APPEND",p.BEFORE="BEFORE",p.PREPEND="PREPEND",p.REPLACE="REPLACE"},8702:function(ne,U,w){"use strict";var h,p=this&&this.__extends||(h=function(v,t){return(h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,m){f.__proto__=m}||function(f,m){for(var _ in m)Object.prototype.hasOwnProperty.call(m,_)&&(f[_]=m[_])})(v,t)},function(v,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function f(){this.constructor=v}h(v,t),v.prototype=null===t?Object.create(t):(f.prototype=t.prototype,new f)});Object.defineProperty(U,"__esModule",{value:!0}),U.ConnectionEvent=void 0;var D=function(h){function v(t,f,m,_,u){var P=h.call(this,t,f,m)||this;return P.connection=_,P.reason=u,P}return p(v,h),v.prototype.callDefaultBehavior=function(){},v}(w(2345).Event);U.ConnectionEvent=D},865:function(ne,U,w){"use strict";var h,p=this&&this.__extends||(h=function(v,t){return(h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,m){f.__proto__=m}||function(f,m){for(var _ in m)Object.prototype.hasOwnProperty.call(m,_)&&(f[_]=m[_])})(v,t)},function(v,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function f(){this.constructor=v}h(v,t),v.prototype=null===t?Object.create(t):(f.prototype=t.prototype,new f)});Object.defineProperty(U,"__esModule",{value:!0}),U.ConnectionPropertyChangedEvent=void 0;var D=function(h){function v(t,f,m,_,u){var P=h.call(this,!1,t,"connectionPropertyChanged")||this;return P.connection=f,P.changedProperty=m,P.newValue=_,P.oldValue=u,P}return p(v,h),v.prototype.callDefaultBehavior=function(){},v}(w(2345).Event);U.ConnectionPropertyChangedEvent=D},2345:(ne,U)=>{"use strict";Object.defineProperty(U,"__esModule",{value:!0}),U.Event=void 0;var w=function(){function p(L,D,h){this.hasBeenPrevented=!1,this.cancelable=L,this.target=D,this.type=h}return p.prototype.isDefaultPrevented=function(){return this.hasBeenPrevented},p.prototype.preventDefault=function(){this.callDefaultBehavior=function(){},this.hasBeenPrevented=!0},p}();U.Event=w},7507:function(ne,U,w){"use strict";var v,p=this&&this.__extends||(v=function(t,f){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,_){m.__proto__=_}||function(m,_){for(var u in _)Object.prototype.hasOwnProperty.call(_,u)&&(m[u]=_[u])})(t,f)},function(t,f){if("function"!=typeof f&&null!==f)throw new TypeError("Class extends value "+String(f)+" is not a constructor or null");function m(){this.constructor=t}v(t,f),t.prototype=null===f?Object.create(f):(m.prototype=f.prototype,new m)});Object.defineProperty(U,"__esModule",{value:!0}),U.ExceptionEvent=U.ExceptionEventName=void 0;var L=w(2345);!function(v){v.ICE_CANDIDATE_ERROR="ICE_CANDIDATE_ERROR",v.ICE_CONNECTION_FAILED="ICE_CONNECTION_FAILED",v.ICE_CONNECTION_DISCONNECTED="ICE_CONNECTION_DISCONNECTED",v.NO_STREAM_PLAYING_EVENT="NO_STREAM_PLAYING_EVENT"}(U.ExceptionEventName||(U.ExceptionEventName={}));var h=function(v){function t(f,m,_,u,P){var B=v.call(this,!1,f,"exception")||this;return B.name=m,B.origin=_,B.message=u,B.data=P,B}return p(t,v),t.prototype.callDefaultBehavior=function(){},t}(L.Event);U.ExceptionEvent=h},2156:function(ne,U,w){"use strict";var h,p=this&&this.__extends||(h=function(v,t){return(h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,m){f.__proto__=m}||function(f,m){for(var _ in m)Object.prototype.hasOwnProperty.call(m,_)&&(f[_]=m[_])})(v,t)},function(v,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function f(){this.constructor=v}h(v,t),v.prototype=null===t?Object.create(t):(f.prototype=t.prototype,new f)});Object.defineProperty(U,"__esModule",{value:!0}),U.FilterEvent=void 0;var D=function(h){function v(t,f,m){var _=h.call(this,!1,t,f)||this;return _.data=m,_}return p(v,h),v.prototype.callDefaultBehavior=function(){},v}(w(2345).Event);U.FilterEvent=D},6237:function(ne,U,w){"use strict";var h,p=this&&this.__extends||(h=function(v,t){return(h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,m){f.__proto__=m}||function(f,m){for(var _ in m)Object.prototype.hasOwnProperty.call(m,_)&&(f[_]=m[_])})(v,t)},function(v,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function f(){this.constructor=v}h(v,t),v.prototype=null===t?Object.create(t):(f.prototype=t.prototype,new f)});Object.defineProperty(U,"__esModule",{value:!0}),U.NetworkQualityLevelChangedEvent=void 0;var D=function(h){function v(t,f,m,_){var u=h.call(this,!1,t,"networkQualityLevelChanged")||this;return u.newValue=f,u.oldValue=m,u.connection=_,u}return p(v,h),v.prototype.callDefaultBehavior=function(){},v}(w(2345).Event);U.NetworkQualityLevelChangedEvent=D},805:function(ne,U,w){"use strict";var h,p=this&&this.__extends||(h=function(v,t){return(h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,m){f.__proto__=m}||function(f,m){for(var _ in m)Object.prototype.hasOwnProperty.call(m,_)&&(f[_]=m[_])})(v,t)},function(v,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function f(){this.constructor=v}h(v,t),v.prototype=null===t?Object.create(t):(f.prototype=t.prototype,new f)});Object.defineProperty(U,"__esModule",{value:!0}),U.PublisherSpeakingEvent=void 0;var D=function(h){function v(t,f,m,_){var u=h.call(this,!1,t,f)||this;return u.type=f,u.connection=m,u.streamId=_,u}return p(v,h),v.prototype.callDefaultBehavior=function(){},v}(w(2345).Event);U.PublisherSpeakingEvent=D},7936:function(ne,U,w){"use strict";var h,p=this&&this.__extends||(h=function(v,t){return(h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,m){f.__proto__=m}||function(f,m){for(var _ in m)Object.prototype.hasOwnProperty.call(m,_)&&(f[_]=m[_])})(v,t)},function(v,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function f(){this.constructor=v}h(v,t),v.prototype=null===t?Object.create(t):(f.prototype=t.prototype,new f)});Object.defineProperty(U,"__esModule",{value:!0}),U.RecordingEvent=void 0;var D=function(h){function v(t,f,m,_,u){var P=h.call(this,!1,t,f)||this;return P.id=m,_!==m&&(P.name=_),P.reason=u,P}return p(v,h),v.prototype.callDefaultBehavior=function(){},v}(w(2345).Event);U.RecordingEvent=D},1018:function(ne,U,w){"use strict";var t,p=this&&this.__extends||(t=function(f,m){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(_,u){_.__proto__=u}||function(_,u){for(var P in u)Object.prototype.hasOwnProperty.call(u,P)&&(_[P]=u[P])})(f,m)},function(f,m){if("function"!=typeof m&&null!==m)throw new TypeError("Class extends value "+String(m)+" is not a constructor or null");function _(){this.constructor=f}t(f,m),f.prototype=null===m?Object.create(m):(_.prototype=m.prototype,new _)});Object.defineProperty(U,"__esModule",{value:!0}),U.SessionDisconnectedEvent=void 0;var L=w(2345),h=w(6946).OpenViduLogger.getInstance(),v=function(t){function f(m,_){var u=t.call(this,!0,m,"sessionDisconnected")||this;return u.reason=_,u}return p(f,t),f.prototype.callDefaultBehavior=function(){h.info("Calling default behavior upon '"+this.type+"' event dispatched by 'Session'");var m=this.target;m.remoteConnections.forEach(function(_){var u,P,B,I,R,J,j,g,c=_.connectionId;if(null===(u=m.remoteConnections.get(c))||void 0===u?void 0:u.stream){null===(P=m.remoteConnections.get(c))||void 0===P||P.stream.disposeWebRtcPeer(),null===(B=m.remoteConnections.get(c))||void 0===B||B.stream.disposeMediaStream(),(null===(I=m.remoteConnections.get(c))||void 0===I?void 0:I.stream.streamManager)&&(null===(R=m.remoteConnections.get(c))||void 0===R||R.stream.streamManager.removeAllVideos());var M=null===(j=null===(J=m.remoteConnections.get(c))||void 0===J?void 0:J.stream)||void 0===j?void 0:j.streamId;M&&m.remoteStreamsCreated.delete(M),null===(g=m.remoteConnections.get(c))||void 0===g||g.dispose()}m.remoteConnections.delete(c)})},f}(L.Event);U.SessionDisconnectedEvent=v},5785:function(ne,U,w){"use strict";var h,p=this&&this.__extends||(h=function(v,t){return(h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,m){f.__proto__=m}||function(f,m){for(var _ in m)Object.prototype.hasOwnProperty.call(m,_)&&(f[_]=m[_])})(v,t)},function(v,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function f(){this.constructor=v}h(v,t),v.prototype=null===t?Object.create(t):(f.prototype=t.prototype,new f)});Object.defineProperty(U,"__esModule",{value:!0}),U.SignalEvent=void 0;var D=function(h){function v(t,f,m,_){var u=h.call(this,!1,t,"signal")||this;return f&&(u.type="signal:"+f),u.data=m,u.from=_,u}return p(v,h),v.prototype.callDefaultBehavior=function(){},v}(w(2345).Event);U.SignalEvent=D},2299:function(ne,U,w){"use strict";var m,p=this&&this.__extends||(m=function(_,u){return(m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(P,B){P.__proto__=B}||function(P,B){for(var I in B)Object.prototype.hasOwnProperty.call(B,I)&&(P[I]=B[I])})(_,u)},function(_,u){if("function"!=typeof u&&null!==u)throw new TypeError("Class extends value "+String(u)+" is not a constructor or null");function P(){this.constructor=_}m(_,u),_.prototype=null===u?Object.create(u):(P.prototype=u.prototype,new P)});Object.defineProperty(U,"__esModule",{value:!0}),U.StreamEvent=void 0;var L=w(2345),D=w(4259),h=w(8402),t=w(6946).OpenViduLogger.getInstance(),f=function(m){function _(u,P,B,I,R){var J=m.call(this,u,P,B)||this;return J.stream=I,J.reason=R,J}return p(_,m),_.prototype.callDefaultBehavior=function(){if("streamDestroyed"===this.type){if(this.target instanceof h.Session)t.info("Calling default behavior upon '"+this.type+"' event dispatched by 'Session'"),this.stream.disposeWebRtcPeer();else if(this.target instanceof D.Publisher){t.info("Calling default behavior upon '"+this.type+"' event dispatched by 'Publisher'"),clearInterval(this.target.screenShareResizeInterval),this.stream.isLocalStreamReadyToPublish=!1;for(var u=this.target.openvidu.publishers,P=0;P<u.length;P++)if(u[P]===this.target){u.splice(P,1);break}}this.stream.disposeMediaStream(),this.stream.streamManager&&this.stream.streamManager.removeAllVideos(),this.stream.session.remoteStreamsCreated.delete(this.stream.streamId);var B=this.stream.session.remoteConnections.get(this.stream.connection.connectionId);if(B&&B.remoteOptions){var I=B.remoteOptions.streams;for(P=I.length-1;P>=0;--P)I[P].id===this.stream.streamId&&I.splice(P,1)}}},_}(L.Event);U.StreamEvent=f},4006:function(ne,U,w){"use strict";var h,p=this&&this.__extends||(h=function(v,t){return(h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,m){f.__proto__=m}||function(f,m){for(var _ in m)Object.prototype.hasOwnProperty.call(m,_)&&(f[_]=m[_])})(v,t)},function(v,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function f(){this.constructor=v}h(v,t),v.prototype=null===t?Object.create(t):(f.prototype=t.prototype,new f)});Object.defineProperty(U,"__esModule",{value:!0}),U.StreamManagerEvent=void 0;var D=function(h){function v(t,f,m){var _=h.call(this,!1,t,f)||this;return _.value=m,_}return p(v,h),v.prototype.callDefaultBehavior=function(){},v}(w(2345).Event);U.StreamManagerEvent=D},2798:function(ne,U,w){"use strict";var h,p=this&&this.__extends||(h=function(v,t){return(h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,m){f.__proto__=m}||function(f,m){for(var _ in m)Object.prototype.hasOwnProperty.call(m,_)&&(f[_]=m[_])})(v,t)},function(v,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function f(){this.constructor=v}h(v,t),v.prototype=null===t?Object.create(t):(f.prototype=t.prototype,new f)});Object.defineProperty(U,"__esModule",{value:!0}),U.StreamPropertyChangedEvent=void 0;var D=function(h){function v(t,f,m,_,u,P){var B=h.call(this,!1,t,"streamPropertyChanged")||this;return B.stream=f,B.changedProperty=m,B.newValue=_,B.oldValue=u,B.reason=P,B}return p(v,h),v.prototype.callDefaultBehavior=function(){},v}(w(2345).Event);U.StreamPropertyChangedEvent=D},4281:function(ne,U,w){"use strict";var h,p=this&&this.__extends||(h=function(v,t){return(h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,m){f.__proto__=m}||function(f,m){for(var _ in m)Object.prototype.hasOwnProperty.call(m,_)&&(f[_]=m[_])})(v,t)},function(v,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function f(){this.constructor=v}h(v,t),v.prototype=null===t?Object.create(t):(f.prototype=t.prototype,new f)});Object.defineProperty(U,"__esModule",{value:!0}),U.VideoElementEvent=void 0;var D=function(h){function v(t,f,m){var _=h.call(this,!1,f,m)||this;return _.element=t,_}return p(v,h),v.prototype.callDefaultBehavior=function(){},v}(w(2345).Event);U.VideoElementEvent=D},6842:ne=>{function U(){var w={};this.forEach=function(p){for(var L in w){var D=w[L];for(var h in D)p(D[h])}},this.get=function(p,L){var D=w[L];if(null!=D)return D[p]},this.remove=function(p,L){var D=w[L];if(null!=D){for(var h in delete D[p],D)return!1;delete w[L]}},this.set=function(p,L,D){if(null==p)return this.remove(L,D);var h=w[D];null==h&&(w[D]=h={}),h[L]=p}}U.prototype.pop=function(w,p){var L=this.get(w,p);if(null!=L)return this.remove(w,p),L},ne.exports=U},5150:(ne,U,w)=>{var p=w(245);U.JsonRpcClient=p},245:(ne,U,w)=>{var p=w(3031),L=w(7182),D=w(6946).OpenViduLogger;Date.now=Date.now||function(){return+new Date};var v="RECONNECTING",t="CONNECTED",f="DISCONNECTED",m=D.getInstance();ne.exports=function _(u){var g,P=this,B=u.ws,I=-1,R=0,J=!0,j=!1,c=f,M=B.onreconnecting,E=B.onreconnected,l=B.onconnected,a=B.onerror;u.rpc.pull=function(x,O){O.reply(null,"push")},B.onreconnecting=function(){m.debug("--------- ONRECONNECTING -----------"),c!==v?(b(),c=v,M&&M()):m.error("Websocket already in RECONNECTING state when receiving a new ONRECONNECTING message. Ignoring it")},B.onreconnected=function(){m.debug("--------- ONRECONNECTED -----------"),c!==t?(c=t,y(),E&&E()):m.error("Websocket already in CONNECTED state when receiving a new ONRECONNECTED message. Ignoring it")},B.onconnected=function(){m.debug("--------- ONCONNECTED -----------"),c!==t?(c=t,J=!0,r(),l&&l()):m.error("Websocket already in CONNECTED state when receiving a new ONCONNECTED message. Ignoring it")},B.onerror=function(x){m.debug("--------- ONERROR -----------"),c=f,b(),a&&a(x)};var d=new L(B);m.debug("Connecting websocket to URI: "+B.uri);var C=new p(p.packers.JsonRPC,{request_timeout:u.rpc.requestTimeout,ping_request_timeout:u.rpc.heartbeatRequestTimeout},d,function(x){m.debug("Received request: "+JSON.stringify(x));try{var O=u.rpc[x.method];void 0===O?m.error("Method "+x.method+" not registered in client"):O(x.params,x)}catch(S){m.error("Exception processing request: "+JSON.stringify(x)),m.error(S)}});function y(){m.debug("notReconnectIfNumLessThan = "+R+" (old="+I+")"),I=R}function N(){if(J){var x=null;(0==R||R==I)&&(x={interval:u.heartbeat||5e3}),R++,P.send("ping",x,(O=R,function(S,T){S&&(m.debug("Error in ping request #"+O+" ("+S.message+")"),O>I&&(J=!1,y(),m.debug("Server did not respond to ping message #"+O+". Reconnecting... "),d.reconnectWs()))}))}else m.debug("Trying to send ping, but ping is not enabled");var O}function r(){j||(m.debug("Starting ping (if configured)"),j=!0,null!=u.heartbeat&&(g=setInterval(N,u.heartbeat),N()))}function b(){clearInterval(g),j=!1,J=!1,R=-1,C.cancel()}this.send=function(x,O,S){var T=Date.now();C.encode(x,O,function(F,H){if(F){try{m.error("ERROR:"+F.message+" in Request: method:"+x+" params:"+JSON.stringify(O)+" request:"+F.request),F.data&&m.error("ERROR DATA:"+JSON.stringify(F.data))}catch(ee){}F.requestTime=T}S&&(null!=H&&"pong"!==H.value&&m.debug("Response: "+JSON.stringify(H)),S(F,H))})},this.close=function(x,O){m.debug("Closing with code: "+x+" because: "+O),null!=g&&(m.debug("Clearing ping interval"),clearInterval(g)),j=!1,J=!1,d.close(x,O)},this.reconnect=function(){d.reconnectWs()},this.resetPing=function(){J=!0,R=0,r()},this.getReadyState=function(){return d.getReadyState()}}},593:(ne,U,w)=>{var p=w(7182);U.WebSocketWithReconnection=p},7182:(ne,U,w)=>{"use strict";var L=w(6946).OpenViduLogger.getInstance();ne.exports=function _(u){var B,P=!1,I=u.uri,R=!1,J=new WebSocket(I);J.onopen=function(){L.debug("WebSocket connected to "+I),u.onconnected&&u.onconnected()},J.onerror=function(E){L.error("Could not connect to "+I+" (invoking onerror if defined)",E),u.onerror&&u.onerror(E)};var j=function(){3===J.readyState?P?L.debug("Connection closed by user"):u.ismasternodecrashed()?L.error("Master Node has crashed. Stopping reconnection process"):(L.debug("Connection closed unexpectedly. Reconnecting..."),g(2e3,1)):L.debug("Close callback from previous websocket. Ignoring it")};function g(E,l){if(L.debug("reconnect (attempt #"+l+", max="+E+")"),1===l){if(R)return void L.warn("Trying to reconnect when already reconnecting... Ignoring this reconnection.");R=!0,u.onreconnecting&&u.onreconnecting()}!function M(E,l){L.debug("Reconnection attempt #"+l),J.close(4104,"Connection closed for reconnection"),I=function c(E){var l=new URLSearchParams(new URL(E).search);return l.has("reconnect")||(E=Array.from(l).length>0?E+"&reconnect=true":E+"?reconnect=true"),E}(I),(J=new WebSocket(I)).onopen=function(){L.debug("Reconnected to "+I+" after "+l+" attempts..."),R=!1,B(),u.onreconnected()&&u.onreconnected(),J.onclose=j},J.onerror=function(a){L.warn("Reconnection error: ",a),l===E?u.ondisconnect&&u.ondisconnect():setTimeout(function(){g(E,l+1)},3e3)}}(E,l)}J.onclose=j,this.close=function(E,l){P=!0,J.close(E,l)},this.reconnectWs=function(){L.debug("reconnectWs"),g(2e3,1)},this.send=function(E){J.send(E)},this.addEventListener=function(E,l){(B=function(){J.addEventListener(E,l)})()},this.getReadyState=function(){return J.readyState}}},3031:(ne,U,w)=>{var p=!1;if(Object.defineProperty)try{Object.defineProperty({},"x",{})}catch(I){p=!0}Function.prototype.bind||(Function.prototype.bind=function(I){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var R=Array.prototype.slice.call(arguments,1),J=this,j=function(){},g=function(){return J.apply(this instanceof j&&I?this:I,R.concat(Array.prototype.slice.call(arguments)))};return j.prototype=this.prototype,g.prototype=new j,g});var L=w(9069).EventEmitter,D=w(3894),h=w(8080),v=w(6842),t=5e3;function m(I){if(I){if(I instanceof Function)return{send:I};if(I.send instanceof Function)return I;if(I.postMessage instanceof Function)return I.send=I.postMessage,I;if(I.write instanceof Function)return I.send=I.write,I;if(void 0===I.onmessage&&!(I.pause instanceof Function))throw new SyntaxError("Transport is not a function nor a valid object")}}function _(I,R){p?(this.method=I,this.params=R):(Object.defineProperty(this,"method",{value:I,enumerable:!0}),Object.defineProperty(this,"params",{value:R,enumerable:!0}))}function u(I,R,J,j){var g=this;if(!I)throw new SyntaxError("Packer is not defined");if(!I.pack||!I.unpack)throw new SyntaxError("Packer is invalid");var c=function f(I){if(!I)return{};for(var R in I){var J=I[R];"string"==typeof J&&(I[R]={response:J})}return I}(I.responseMethods);if(R instanceof Function){if(null!=J)throw new SyntaxError("There can't be parameters after onRequest");j=R,J=void 0,R=void 0}if(R&&R.send instanceof Function){if(J&&!(J instanceof Function))throw new SyntaxError("Only a function can be after transport");j=J,J=R,R=void 0}if(J instanceof Function){if(null!=j)throw new SyntaxError("There can't be parameters after onRequest");j=J,J=void 0}if(J&&J.send instanceof Function&&j&&!(j instanceof Function))throw new SyntaxError("Only a function can be after transport");R=R||{},L.call(this),j&&this.on("request",j),p?this.peerID=R.peerID:Object.defineProperty(this,"peerID",{value:R.peerID});var M=R.max_retries||0;function E(F){g.decode(F.data||F)}this.getTransport=function(){return J},this.setTransport=function(F){J&&(J.removeEventListener?J.removeEventListener("message",E):J.removeListener&&J.removeListener("data",E)),F&&(F.addEventListener?F.addEventListener("message",E):F.addListener&&F.addListener("data",E)),J=m(F)},p||Object.defineProperty(this,"transport",{get:this.getTransport.bind(this),set:this.setTransport.bind(this)}),this.setTransport(J);var l=R.request_timeout||t,a=R.ping_request_timeout||l,d=R.response_timeout||t,V=R.duplicates_timeout||t,C=0,y=new v,N=new v,r=new v,b={};function O(F,H){var ee=setTimeout(function(){r.remove(F,H)},V);r.set(ee,F,H)}function S(F,H,ee,ie,se){_.call(this,F,H),this.getTransport=function(){return se},this.setTransport=function(de){se=m(de)},p||Object.defineProperty(this,"transport",{get:this.getTransport.bind(this),set:this.setTransport.bind(this)});var ae=N.get(ee,ie);se||g.getTransport()||(p?this.duplicated=Boolean(ae):Object.defineProperty(this,"duplicated",{value:Boolean(ae)}));var fe=c[F];this.pack=I.pack.bind(I,this,ee),this.reply=function(de,le,me){if(de instanceof Function||de&&de.send instanceof Function){if(null!=le)throw new SyntaxError("There can't be parameters after callback");me=de,le=null,de=void 0}else if(le instanceof Function||le&&le.send instanceof Function){if(null!=me)throw new SyntaxError("There can't be parameters after callback");me=le,le=null}var Ee;return me=m(me),ae&&clearTimeout(ae.timeout),null!=ie&&(de&&(de.dest=ie),le&&(le.dest=ie)),de||null!=le?(null!=g.peerID&&(de?de.from=g.peerID:le.from=g.peerID),Ee=I.pack(Ee=fe?null==fe.error&&de?{error:de}:{method:de?fe.error:fe.response,params:de||le}:{error:de,result:le},ee)):Ee=ae?ae.message:I.pack({result:null},ee),function x(F,H,ee){var ie={message:F,timeout:setTimeout(function(){N.remove(H,ee)},d)};N.set(ie,H,ee)}(Ee,ee,ie),(me=me||this.getTransport()||g.getTransport())?me.send(Ee):Ee}}function T(F){var H=b[F];if(H){delete b[F];var ee=y.pop(H.id,H.dest);!ee||(clearTimeout(ee.timeout),O(H.id,H.dest))}}D(S,_),this.cancel=function(F){if(F)return T(F);for(var F in b)T(F)},this.close=function(){var F=this.getTransport();F&&F.close&&F.close(4003,"Cancel request"),this.cancel(),r.forEach(clearTimeout),N.forEach(function(H){clearTimeout(H.timeout)})},this.encode=function(F,H,ee,ie,se){if(H instanceof Function){if(null!=ee)throw new SyntaxError("There can't be parameters after callback");se=H,ie=void 0,ee=void 0,H=void 0}else if(ee instanceof Function){if(null!=ie)throw new SyntaxError("There can't be parameters after callback");se=ee,ie=void 0,ee=void 0}else if(ie instanceof Function){if(null!=se)throw new SyntaxError("There can't be parameters after callback");se=ie,ie=void 0}null!=g.peerID&&((H=H||{}).from=g.peerID),null!=ee&&((H=H||{}).dest=ee);var ae={method:F,params:H};if(se){let be=function(K,W){g.cancel(ae),se(K,W)},$=function(K){return le.timeout=setTimeout(z,("ping"===F?a:l)*Math.pow(2,de++)),b[ae]={id:fe,dest:ee},y.set(le,fe,ee),(K=K||me||g.getTransport())?K.send(ae):ae},X=function(K){K=m(K),console.warn(de+" retry for request message:",ae);var W=r.pop(fe,ee);return clearTimeout(W),$(K)},z=function(){if(de<M)return X(ie);var K=new Error("Request has timed out");K.request=ae,K.retry=X,be(K)};var fe=C++,de=0,le={message:ae=I.pack(ae,fe),callback:be,responseMethods:c[F]||{}},me=m(ie);return $(ie)}return ae=I.pack(ae),(ie=ie||this.getTransport())?ie.send(ae):ae},this.decode=function(F,H){if(!F)throw new TypeError("Message is not defined");try{F=I.unpack(F)}catch(z){return console.debug(z,F)}var ee=F.id,ie=F.ack,se=F.method,ae=F.params||{},fe=ae.from,de=ae.dest;if(null==g.peerID||fe!=g.peerID){if(null==ee&&null==ie){var le=new _(se,ae);return g.emit("request",le)?void 0:le}if(se){if(null==de||de==g.peerID){if(X=y.get(ie,fe)){var De=X.responseMethods;return se==De.error?Ee(X,ae):se==De.response?Ee(X,null,ae):me()}if(ue=r.get(ie,fe))return Y(ue)}return me()}var be=F.error,$=F.result;if(!(be&&be.dest&&be.dest!=g.peerID||$&&$.dest&&$.dest!=g.peerID)){var X,ue;if(!(X=y.get(ie,fe)))return(ue=r.get(ie,fe))?Y(ue):console.warn("No callback was defined for this message",F);Ee(X,be,$)}}function me(){if(H=m(H)||g.getTransport()){var z=N.get(ee,fe);if(z)return H.send(z.message)}var W=new S(se,ae,null!=ee?ee:ie,fe,H);if(!g.emit("request",W))return W}function Ee(z,K,W){z.callback(K,W)}function Y(z){console.warn("Response already processed",F),clearTimeout(z),O(ie,fe)}}}D(u,L),u.RpcNotification=_,ne.exports=u;var P=w(5150),B=w(593);(u.clients=P).transports=B,u.packers=h},8727:(ne,U)=>{U.pack=function w(L,D){var h={jsonrpc:"2.0"};if(L.method)h.method=L.method,L.params&&(h.params=L.params),null!=D&&(h.id=D);else if(null!=D){if(L.error){if(void 0!==L.result)throw new TypeError("Both result and error are defined");h.error=L.error}else{if(void 0===L.result)throw new TypeError("No result or error is defined");h.result=L.result}h.id=D}return JSON.stringify(h)},U.unpack=function p(L){var D=L;("string"==typeof L||L instanceof String)&&(D=JSON.parse(L));var h=D.jsonrpc;if("2.0"!==h)throw new TypeError("Invalid JsonRPC version '"+h+"': "+L);if(null==D.method){if(null==D.id)throw new TypeError("Invalid message: "+L);var v=void 0!==D.result,t=void 0!==D.error;if(v&&t)throw new TypeError("Both result and error are defined: "+L);if(!v&&!t)throw new TypeError("No result or error is defined: "+L);D.ack=D.id,delete D.id}return D}},9688:(ne,U)=>{U.pack=function w(L){throw new TypeError("Not yet implemented")},U.unpack=function p(L){throw new TypeError("Not yet implemented")}},8080:(ne,U,w)=>{var p=w(8727),L=w(9688);U.JsonRPC=p,U.XmlRPC=L},9380:(ne,U)=>{"use strict";Object.defineProperty(U,"__esModule",{value:!0}),U.ConsoleLogger=void 0,U.ConsoleLogger=function p(L){this.logger=L,this.log=window.console.log,this.info=window.console.info,this.debug=window.console.debug,this.warn=window.console.warn,this.error=window.console.error}},6946:(ne,U,w)=>{"use strict";Object.defineProperty(U,"__esModule",{value:!0}),U.OpenViduLogger=void 0;var p=w(8659),L=w(9380),D=w(541),h=function(){function v(){this.JSNLOG_URL="/openvidu/elk/openvidu-browser-logs",this.MAX_JSNLOG_BATCH_LOG_MESSAGES=100,this.MAX_MSECONDS_BATCH_MESSAGES=5e3,this.MAX_LENGTH_STRING_JSON=1e3,this.defaultConsoleLogger=new L.ConsoleLogger(window.console),this.isProdMode=!1,this.isJSNLogSetup=!1}return v.configureJSNLog=function(t,f){var m=this;try{if(window.LOG_JSNLOG_RESULTS||this.instance&&t.isAtLeastPro&&this.instance.isOpenViduBrowserLogsDebugActive(t)&&this.instance.canConfigureJSNLog(t,this.instance)){t.sendBrowserLogs===D.OpenViduLoggerConfiguration.debug_app&&this.instance.replaceWindowConsole(),this.instance.isJSNLogSetup=!1,this.instance.info("Configuring JSNLogs.");var _=t.finalUserId,u=t.session.sessionId;this.instance.currentAppender=p.JL.createAjaxAppender("appender-".concat(_,"-").concat(u)),this.instance.currentAppender.setOptions({beforeSend:function(I){var R=I.onreadystatechange;I.onreadystatechange=function(){m.isInvalidResponse(I)&&(Object.defineProperty(I,"readyState",{value:4}),Object.defineProperty(I,"status",{value:200}),m.instance.disableLogger()),R()},I.setRequestHeader("Authorization","Basic "+btoa("".concat(_,"%/%").concat(u)+":"+f)),I.setRequestHeader("X-Requested-With","XMLHttpRequest"),I.setRequestHeader("OV-Final-User-Id",_),I.setRequestHeader("OV-Session-Id",u),I.setRequestHeader("OV-Token",f)},maxBatchSize:1e3,batchSize:this.instance.MAX_JSNLOG_BATCH_LOG_MESSAGES,batchTimeout:this.instance.MAX_MSECONDS_BATCH_MESSAGES}),p.JL.setOptions({defaultAjaxUrl:t.httpUri+this.instance.JSNLOG_URL,serialize:function(I){var j,J=JSON.stringify(I,(j=new WeakSet,function(g,c){if("object"==typeof c&&null!=c){if(j.has(c)||HTMLElement&&c instanceof HTMLElement)return;j.add(c)}return c}));return J.length>m.instance.MAX_LENGTH_STRING_JSON&&(J="".concat(J.substring(0,m.instance.MAX_LENGTH_STRING_JSON),"...")),window.LOG_JSNLOG_RESULTS&&console.log(J),J},enabled:!0}),(0,p.JL)().setOptions({appenders:[this.instance.currentAppender]}),this.instance.isJSNLogSetup=!0,this.instance.loggingSessionId=u,this.instance.info("JSNLog configured.")}}catch(I){console.error("Error configuring JSNLog: "),console.error(I),this.instance.disableLogger()}},v.getInstance=function(){return v.instance||(v.instance=new v),v.instance},v.isInvalidResponse=function(t){return 401==t.status||403==t.status||404==t.status||0==t.status},v.prototype.canConfigureJSNLog=function(t,f){return t.session.sessionId!=f.loggingSessionId},v.prototype.isOpenViduBrowserLogsDebugActive=function(t){return t.sendBrowserLogs===D.OpenViduLoggerConfiguration.debug||t.sendBrowserLogs===D.OpenViduLoggerConfiguration.debug_app},v.prototype.getConsoleWithJSNLog=function(){return t=this,{log:function(){for(var f=[],m=0;m<arguments.length;m++)f[m]=arguments[m];t.defaultConsoleLogger.log.apply(t.defaultConsoleLogger.logger,arguments),t.isJSNLogSetup&&(0,p.JL)().info(arguments)},info:function(){for(var f=[],m=0;m<arguments.length;m++)f[m]=arguments[m];t.defaultConsoleLogger.info.apply(t.defaultConsoleLogger.logger,arguments),t.isJSNLogSetup&&(0,p.JL)().info(arguments)},debug:function(){for(var f=[],m=0;m<arguments.length;m++)f[m]=arguments[m];t.defaultConsoleLogger.debug.apply(t.defaultConsoleLogger.logger,arguments)},warn:function(){for(var f=[],m=0;m<arguments.length;m++)f[m]=arguments[m];t.defaultConsoleLogger.warn.apply(t.defaultConsoleLogger.logger,arguments),t.isJSNLogSetup&&(0,p.JL)().warn(arguments)},error:function(){for(var f=[],m=0;m<arguments.length;m++)f[m]=arguments[m];t.defaultConsoleLogger.error.apply(t.defaultConsoleLogger.logger,arguments),t.isJSNLogSetup&&(0,p.JL)().error(arguments)}};var t},v.prototype.replaceWindowConsole=function(){window.console=this.defaultConsoleLogger.logger,window.console.log=this.getConsoleWithJSNLog().log,window.console.info=this.getConsoleWithJSNLog().info,window.console.debug=this.getConsoleWithJSNLog().debug,window.console.warn=this.getConsoleWithJSNLog().warn,window.console.error=this.getConsoleWithJSNLog().error},v.prototype.disableLogger=function(){p.JL.setOptions({enabled:!1}),this.isJSNLogSetup=!1,this.loggingSessionId=void 0,this.currentAppender=void 0,window.console=this.defaultConsoleLogger.logger,window.console.log=this.defaultConsoleLogger.log,window.console.info=this.defaultConsoleLogger.info,window.console.debug=this.defaultConsoleLogger.debug,window.console.warn=this.defaultConsoleLogger.warn,window.console.error=this.defaultConsoleLogger.error},v.prototype.log=function(){for(var t=[],f=0;f<arguments.length;f++)t[f]=arguments[f];this.isProdMode||this.defaultConsoleLogger.log.apply(this.defaultConsoleLogger.logger,arguments),this.isJSNLogSetup&&(0,p.JL)().info(arguments)},v.prototype.debug=function(){for(var t=[],f=0;f<arguments.length;f++)t[f]=arguments[f];this.isProdMode||this.defaultConsoleLogger.debug.apply(this.defaultConsoleLogger.logger,arguments)},v.prototype.info=function(){for(var t=[],f=0;f<arguments.length;f++)t[f]=arguments[f];this.isProdMode||this.defaultConsoleLogger.info.apply(this.defaultConsoleLogger.logger,arguments),this.isJSNLogSetup&&(0,p.JL)().info(arguments)},v.prototype.warn=function(){for(var t=[],f=0;f<arguments.length;f++)t[f]=arguments[f];this.defaultConsoleLogger.warn.apply(this.defaultConsoleLogger.logger,arguments),this.isJSNLogSetup&&(0,p.JL)().warn(arguments)},v.prototype.error=function(){for(var t=[],f=0;f<arguments.length;f++)t[f]=arguments[f];this.defaultConsoleLogger.error.apply(this.defaultConsoleLogger.logger,arguments),this.isJSNLogSetup&&(0,p.JL)().error(arguments)},v.prototype.flush=function(){this.isJSNLogSetup&&null!=this.currentAppender&&this.currentAppender.sendBatch()},v.prototype.enableProdMode=function(){this.isProdMode=!0},v}();U.OpenViduLogger=h},541:(ne,U)=>{"use strict";var p;Object.defineProperty(U,"__esModule",{value:!0}),U.OpenViduLoggerConfiguration=void 0,(p=U.OpenViduLoggerConfiguration||(U.OpenViduLoggerConfiguration={})).disabled="disabled",p.debug="debug",p.debug_app="debug_app"},4611:(ne,U)=>{function w(v,t,f){var m={audio:!1,video:{mandatory:{chromeMediaSource:v?"screen":"desktop",maxWidth:window.screen.width>1920?window.screen.width:1920,maxHeight:window.screen.height>1080?window.screen.height:1080},optional:[]}};return f&&(m.audio={mandatory:{chromeMediaSource:v?"screen":"desktop"},optional:[]}),t&&(m.video.mandatory.chromeMediaSourceId=t,m.audio&&m.audio.mandatory&&(m.audio.mandatory.chromeMediaSourceId=t)),m}function p(v){L?L.isLoaded?L.contentWindow.postMessage(v?v.forEach?{captureCustomSourceId:v}:{captureSourceIdWithAudio:!0}:{captureSourceId:!0},"*"):setTimeout(function(){p(v)},100):D(function(){p(v)})}var L;function D(v){L?v():((L=document.createElement("iframe")).onload=function(){L.isLoaded=!0,v()},L.src="https://openvidu.github.io/openvidu-screen-sharing-chrome-extension/",L.style.display="none",(document.body||document.documentElement).appendChild(L))}function h(){L?L.isLoaded?L.contentWindow.postMessage({getChromeExtensionStatus:!0},"*"):setTimeout(h,100):D(h)}window.getScreenId=function(v,t,f){-1===navigator.userAgent.indexOf("Edge")||!navigator.msSaveOrOpenBlob&&!navigator.msSaveBlob?navigator.mozGetUserMedia?t(null,"firefox",{video:{mozMediaSource:v,mediaSource:v}}):(window.addEventListener("message",function m(_){!_.data||(_.data.chromeMediaSourceId&&("PermissionDeniedError"===_.data.chromeMediaSourceId?t("permission-denied"):t(null,_.data.chromeMediaSourceId,w(null,_.data.chromeMediaSourceId,_.data.canRequestAudioTrack)),window.removeEventListener("message",m)),_.data.chromeExtensionStatus&&(t(_.data.chromeExtensionStatus,null,w(_.data.chromeExtensionStatus)),window.removeEventListener("message",m)))}),setTimeout(f?function(){p(f)}:p,100)):t({video:!0})},window.getScreenConstraints=function(v){D(function(){getScreenId(function(t,f,m){m||(m={video:!0}),v(t,m.video)})})},window.getChromeExtensionStatus=function(v){navigator.mozGetUserMedia?v("installed-enabled"):(window.addEventListener("message",function t(f){!f.data||f.data.chromeExtensionStatus&&(v(f.data.chromeExtensionStatus),window.removeEventListener("message",t))}),setTimeout(h,100))},U.getScreenId=window.getScreenId},4627:(ne,U)=>{var p,L,w="screen";if("undefined"!=typeof window&&"undefined"!=typeof navigator&&void 0!==navigator.userAgent){var D=void 0!==window.InstallTrigger;!!window.opera||navigator.userAgent.indexOf(" OPR/");window,window.addEventListener("message",function(R){R.origin==window.location.origin&&function t(R){if("PermissionDeniedError"==R){if(L)return L("PermissionDeniedError");throw new Error("PermissionDeniedError")}"rtcmulticonnection-extension-loaded"==R&&(w="desktop"),R.sourceId&&L&&L(p=R.sourceId,!0===R.canRequestAudioTrack)}(R.data)})}function m(R){if(!R)throw'"callback" parameter is mandatory.';if(p)return R(p);L=R,window.postMessage("get-sourceId","*")}function I(R,J){if(p="",D)return R(null,{mozMediaSource:"window",mediaSource:"window"});var g={mandatory:{chromeMediaSource:w,maxWidth:screen.width>1920?screen.width:1920,maxHeight:screen.height>1080?screen.height:1080},optional:[]};"desktop"!=w||p?("desktop"==w&&(g.mandatory.chromeMediaSourceId=p),R(null,g)):J?function u(R){if(!R)throw'"callback" parameter is mandatory.';if(p)return R(p);L=R,window.postMessage("audio-plus-tab","*")}(function(c,M){g.mandatory.chromeMediaSourceId=c,M&&(g.canRequestAudioTrack=!0),R("PermissionDeniedError"==c?c:null,g)}):m(function(c){g.mandatory.chromeMediaSourceId=c,R("PermissionDeniedError"==c?c:null,g)})}U.getScreenConstraints=I,U.getScreenConstraintsWithAudio=function B(R){I(R,!0)},U.isChromeExtensionAvailable=function f(R){if(R){if("desktop"==w)return R(!0);window.postMessage("are-you-there","*"),setTimeout(function(){R("screen"!=w)},2e3)}},U.getChromeExtensionStatus=function P(R,J){if(D)return J("not-chrome");2!=arguments.length&&(J=R,R="lfcgfepafnobdloecchnfaclibenjold");var j=document.createElement("img");j.src="chrome-extension://"+R+"/icon.png",j.onload=function(){w="screen",window.postMessage("are-you-there","*"),setTimeout(function(){J("screen"==w?"installed-disabled":"installed-enabled")},2e3)},j.onerror=function(){J("not-installed")}},U.getSourceId=m},543:(ne,U,w)=>{"use strict";Object.defineProperty(U,"__esModule",{value:!0}),U.PlatformUtils=void 0;var p=w(2437),L=function(){function D(){}return D.getInstance=function(){return this.instance||(this.instance=new D),D.instance},D.prototype.isChromeBrowser=function(){return"Chrome"===p.name},D.prototype.isSafariBrowser=function(){return"Safari"===p.name},D.prototype.isChromeMobileBrowser=function(){return"Chrome Mobile"===p.name},D.prototype.isFirefoxBrowser=function(){return"Firefox"===p.name},D.prototype.isFirefoxMobileBrowser=function(){return"Firefox Mobile"===p.name||"Firefox for iOS"===p.name},D.prototype.isOperaBrowser=function(){return"Opera"===p.name},D.prototype.isOperaMobileBrowser=function(){return"Opera Mobile"===p.name},D.prototype.isEdgeBrowser=function(){var h=(null==p?void 0:p.version)?parseFloat(p.version):-1;return"Microsoft Edge"===p.name&&h>=80},D.prototype.isEdgeMobileBrowser=function(){var h,v,t=(null==p?void 0:p.version)?parseFloat(p.version):-1;return"Microsoft Edge"===p.name&&("Android"===(null===(h=p.os)||void 0===h?void 0:h.family)||"iOS"===(null===(v=p.os)||void 0===v?void 0:v.family))&&t>45},D.prototype.isAndroidBrowser=function(){return"Android Browser"===p.name},D.prototype.isElectron=function(){return"Electron"===p.name},D.prototype.isSamsungBrowser=function(){return"Samsung Internet Mobile"===p.name||"Samsung Internet"===p.name},D.prototype.isIPhoneOrIPad=function(){var h=p.ua?p.ua:navigator.userAgent,v="ontouchend"in document,t=/\b(\w*Macintosh\w*)\b/.test(h)&&v,f=/\b(\w*iPhone\w*)\b/.test(h)&&/\b(\w*Mobile\w*)\b/.test(h)&&v;return t||f},D.prototype.isIOSWithSafari=function(){var h=p.ua?p.ua:navigator.userAgent;return this.isIPhoneOrIPad()&&/\b(\w*Apple\w*)\b/.test(navigator.vendor)&&/\b(\w*Safari\w*)\b/.test(h)&&!/\b(\w*CriOS\w*)\b/.test(h)&&!/\b(\w*FxiOS\w*)\b/.test(h)},D.prototype.isIonicIos=function(){return this.isIPhoneOrIPad()&&-1===p.ua.indexOf("Safari")},D.prototype.isIonicAndroid=function(){return"Android"===p.os.family&&"Android Browser"==p.name},D.prototype.isMobileDevice=function(){return"iOS"===p.os.family||"Android"===p.os.family},D.prototype.isReactNative=function(){return!1},D.prototype.isChromium=function(){return this.isChromeBrowser()||this.isChromeMobileBrowser()||this.isOperaBrowser()||this.isOperaMobileBrowser()||this.isEdgeBrowser()||this.isEdgeMobileBrowser()||this.isSamsungBrowser()||this.isIonicAndroid()||this.isIonicIos()||this.isElectron()},D.prototype.canScreenShare=function(){var h=(null==p?void 0:p.version)?parseFloat(p.version):-1;return!this.isMobileDevice()&&(this.isChromeBrowser()||this.isFirefoxBrowser()||this.isOperaBrowser()||this.isElectron()||this.isEdgeBrowser()||this.isSafariBrowser()&&h>=13)},D.prototype.getName=function(){return p.name||""},D.prototype.getVersion=function(){return p.version||""},D.prototype.getFamily=function(){return p.os.family||""},D.prototype.getDescription=function(){return p.description||""},D}();U.PlatformUtils=L},4641:function(ne,U,w){"use strict";var j,p=this&&this.__extends||(j=function(g,c){return(j=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(M,E){M.__proto__=E}||function(M,E){for(var l in E)Object.prototype.hasOwnProperty.call(E,l)&&(M[l]=E[l])})(g,c)},function(g,c){if("function"!=typeof c&&null!==c)throw new TypeError("Class extends value "+String(c)+" is not a constructor or null");function M(){this.constructor=g}j(g,c),g.prototype=null===c?Object.create(c):(M.prototype=c.prototype,new M)}),L=this&&this.__assign||function(){return L=Object.assign||function(j){for(var g,c=1,M=arguments.length;c<M;c++)for(var E in g=arguments[c])Object.prototype.hasOwnProperty.call(g,E)&&(j[E]=g[E]);return j},L.apply(this,arguments)},D=this&&this.__awaiter||function(j,g,c,M){return new(c||(c=Promise))(function(l,a){function d(y){try{C(M.next(y))}catch(N){a(N)}}function V(y){try{C(M.throw(y))}catch(N){a(N)}}function C(y){y.done?l(y.value):function E(l){return l instanceof c?l:new c(function(a){a(l)})}(y.value).then(d,V)}C((M=M.apply(j,g||[])).next())})},h=this&&this.__generator||function(j,g){var M,E,l,a,c={label:0,sent:function(){if(1&l[0])throw l[1];return l[1]},trys:[],ops:[]};return a={next:d(0),throw:d(1),return:d(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function d(C){return function(y){return function V(C){if(M)throw new TypeError("Generator is already executing.");for(;c;)try{if(M=1,E&&(l=2&C[0]?E.return:C[0]?E.throw||((l=E.return)&&l.call(E),0):E.next)&&!(l=l.call(E,C[1])).done)return l;switch(E=0,l&&(C=[2&C[0],l.value]),C[0]){case 0:case 1:l=C;break;case 4:return c.label++,{value:C[1],done:!1};case 5:c.label++,E=C[1],C=[0];continue;case 7:C=c.ops.pop(),c.trys.pop();continue;default:if(!(l=(l=c.trys).length>0&&l[l.length-1])&&(6===C[0]||2===C[0])){c=0;continue}if(3===C[0]&&(!l||C[1]>l[0]&&C[1]<l[3])){c.label=C[1];break}if(6===C[0]&&c.label<l[1]){c.label=l[1],l=C;break}if(l&&c.label<l[2]){c.label=l[2],c.ops.push(C);break}l[2]&&c.ops.pop(),c.trys.pop();continue}C=g.call(j,c)}catch(y){C=[6,y],E=0}finally{M=l=0}if(5&C[0])throw C[1];return{value:C[0]?C[1]:void 0,done:!0}}([C,y])}}};Object.defineProperty(U,"__esModule",{value:!0}),U.WebRtcPeerSendrecv=U.WebRtcPeerSendonly=U.WebRtcPeerRecvonly=U.WebRtcPeer=void 0;var v=w(4491),t=w(1464),f=w(7507),m=w(6946),_=w(543),u=m.OpenViduLogger.getInstance(),B=function(){function j(g){var c=this;this.remoteCandidatesQueue=[],this.localCandidatesQueue=[],this.iceCandidateList=[],this.candidategatheringdone=!1,_.PlatformUtils.getInstance(),this.configuration=L(L({},g),{iceServers:g.iceServers&&g.iceServers.length>0?g.iceServers:v(),mediaStream:void 0!==g.mediaStream?g.mediaStream:null,mode:g.mode?g.mode:"sendrecv",id:g.id?g.id:this.generateUniqueId()}),u.debug("[WebRtcPeer] configuration:\n".concat(JSON.stringify(this.configuration,null,2))),this.pc=new RTCPeerConnection({iceServers:this.configuration.iceServers}),this.pc.addEventListener("icecandidate",function(M){if(null!==M.candidate){var l=new RTCIceCandidate(M.candidate);c.configuration.onIceCandidate(l),""!==l.candidate&&c.localCandidatesQueue.push(l)}}),this.pc.addEventListener("signalingstatechange",function(){if("stable"===c.pc.signalingState)for(;c.iceCandidateList.length>0;){var M=c.iceCandidateList.shift();c.pc.addIceCandidate(M)}})}return j.prototype.getId=function(){return this.configuration.id},j.prototype.dispose=function(){if(u.debug("Disposing WebRtcPeer"),this.pc){if("closed"===this.pc.signalingState)return;this.pc.close(),this.remoteCandidatesQueue=[],this.localCandidatesQueue=[]}},j.prototype.createOfferLegacy=function(){this.configuration.mediaStream&&this.deprecatedPeerConnectionTrackApi();var M={offerToReceiveAudio:"sendonly"!==this.configuration.mode&&this.configuration.mediaConstraints.audio,offerToReceiveVideo:"sendonly"!==this.configuration.mode&&this.configuration.mediaConstraints.video};return u.debug("[createOfferLegacy] RTCPeerConnection.createOffer() options:",JSON.stringify(M)),this.pc.createOffer(M)},j.prototype.createOffer=function(){var g,c,M,E,l,a,d,V;return D(this,void 0,void 0,function(){var C,y,N,r,b,x,O,S,T,F,H,ee,ie,se,ae,fe,de,le,me,Ee,Y,De,ue;return h(this,function(be){switch(be.label){case 0:if(!("addTransceiver"in this.pc))return u.warn("[createOffer] Method RTCPeerConnection.addTransceiver() is NOT available; using LEGACY offerToReceive{Audio,Video}"),[2,this.createOfferLegacy()];if(u.debug("[createOffer] Method RTCPeerConnection.addTransceiver() is available; using it"),"recvonly"===this.configuration.mode)return[3,7];if(!this.configuration.mediaStream)throw new Error("[WebRtcPeer.createOffer] Direction is '".concat(this.configuration.mode,"', but no stream was configured to be sent"));C=0,y=this.configuration.mediaStream.getTracks(),be.label=1;case 1:if(!(C<y.length))return[3,6];if(r={direction:this.configuration.mode,streams:[this.configuration.mediaStream]},"video"===(N=y[C]).kind&&this.configuration.simulcast)for(b=N.getSettings(),x=N.getConstraints(),O=null!==(M=null!==(c=null!==(g=b.width)&&void 0!==g?g:x.width.ideal)&&void 0!==c?c:x.width)&&void 0!==M?M:0,S=null!==(a=null!==(l=null!==(E=b.height)&&void 0!==E?E:x.height.ideal)&&void 0!==l?l:x.height)&&void 0!==a?a:0,u.info("[createOffer] Video track dimensions: ".concat(O,"x").concat(S)),0,F=(T=O*S)>=518400?3:T>=129600?2:1,r.sendEncodings=[],H=0;H<F;H++)ee=Math.pow(2,F-H-1),ie={rid:"rdiv"+ee.toString(),scalabilityMode:"L1T1"},["detail","text"].includes(N.contentHint)?(ie.scaleResolutionDownBy=1,ie.maxFramerate=Math.floor(30/ee)):ie.scaleResolutionDownBy=ee,r.sendEncodings.push(ie);if(se=this.pc.addTransceiver(N,r),"video"!==N.kind)return[3,5];if(ae=se.sender.getParameters(),fe=!1,(null===(d=ae.degradationPreference)||void 0===d?void 0:d.length)||(ae.degradationPreference=["detail","text"].includes(N.contentHint)?"maintain-resolution":"balanced",u.info("[createOffer] Video sender Degradation Preference set: ".concat(ae.degradationPreference)),fe=!0),this.configuration.simulcast&&(null===(V=ae.encodings)||void 0===V?void 0:V.length)!==r.sendEncodings.length&&(ae.encodings=r.sendEncodings,fe=!0),!fe)return[3,5];u.debug("[createOffer] Setting new RTCRtpSendParameters to video sender"),be.label=2;case 2:return be.trys.push([2,4,,5]),[4,se.sender.setParameters(ae)];case 3:return be.sent(),[3,5];case 4:throw de=be.sent(),ue="[WebRtcPeer.createOffer] Cannot set RTCRtpSendParameters to video sender",de instanceof Error&&(ue+=": ".concat(de.message)),new Error(ue);case 5:return C++,[3,1];case 6:return[3,8];case 7:for(le=0,me=["audio","video"];le<me.length;le++)this.configuration.mediaConstraints[Ee=me[le]]&&(this.configuration.mediaStream=new MediaStream,this.pc.addTransceiver(Ee,{direction:this.configuration.mode,streams:[this.configuration.mediaStream]}));be.label=8;case 8:return be.trys.push([8,10,,11]),[4,this.pc.createOffer()];case 9:return Y=be.sent(),[3,11];case 10:throw De=be.sent(),ue="[WebRtcPeer.createOffer] Browser failed creating an SDP Offer",De instanceof Error&&(ue+=": ".concat(De.message)),new Error(ue);case 11:return[2,Y]}})})},j.prototype.deprecatedPeerConnectionTrackApi=function(){for(var g=0,c=this.configuration.mediaStream.getTracks();g<c.length;g++)this.pc.addTrack(c[g],this.configuration.mediaStream)},j.prototype.createAnswer=function(){var g=this;return new Promise(function(c,M){if("getTransceivers"in g.pc){u.debug("[createAnswer] Method RTCPeerConnection.getTransceivers() is available; using it");for(var E=function(r){if(!g.configuration.mediaConstraints[r])return"continue";var b=g.pc.getTransceivers().find(function(x){return x.receiver.track.kind===r});if(!b)return{value:M(new Error("".concat(r," requested, but no transceiver was created from remote description")))};b.direction=g.configuration.mode},l=0,a=["audio","video"];l<a.length;l++){var V=E(a[l]);if("object"==typeof V)return V.value}g.pc.createAnswer().then(function(r){return c(r)}).catch(function(r){return M(r)})}else g.configuration.mediaConstraints&&g.pc.createAnswer({offerToReceiveAudio:"boolean"!=typeof g.configuration.mediaConstraints.audio||g.configuration.mediaConstraints.audio,offerToReceiveVideo:"boolean"!=typeof g.configuration.mediaConstraints.video||g.configuration.mediaConstraints.video}).then(function(r){return c(r)}).catch(function(r){return M(r)})})},j.prototype.processLocalOffer=function(g){var c=this;return new Promise(function(M,E){c.pc.setLocalDescription(g).then(function(){var l=c.pc.localDescription;return l?(u.debug("Local description set",l.sdp),M()):E("Local description is not defined")}).catch(function(l){return E(l)})})},j.prototype.processRemoteOffer=function(g){var c=this;return new Promise(function(M,E){var l={type:"offer",sdp:g};if(u.debug("SDP offer received, setting remote description",l),"closed"===c.pc.signalingState)return E("RTCPeerConnection is closed when trying to set remote description");c.setRemoteDescription(l).then(function(){return M()}).catch(function(a){return E(a)})})},j.prototype.processLocalAnswer=function(g){var c=this;return new Promise(function(M,E){if(u.debug("SDP answer created, setting local description"),"closed"===c.pc.signalingState)return E("RTCPeerConnection is closed when trying to set local description");c.pc.setLocalDescription(g).then(function(){return M()}).catch(function(l){return E(l)})})},j.prototype.processRemoteAnswer=function(g){var c=this;return new Promise(function(M,E){var l={type:"answer",sdp:g};if(u.debug("SDP answer received, setting remote description"),"closed"===c.pc.signalingState)return E("RTCPeerConnection is closed when trying to set remote description");c.setRemoteDescription(l).then(function(){M()}).catch(function(a){return E(a)})})},j.prototype.setRemoteDescription=function(g){return D(this,void 0,void 0,function(){return h(this,function(c){return[2,this.pc.setRemoteDescription(g)]})})},j.prototype.addIceCandidate=function(g){var c=this;return new Promise(function(M,E){switch(u.debug("Remote ICE candidate received",g),c.remoteCandidatesQueue.push(g),c.pc.signalingState){case"closed":E(new Error("PeerConnection object is closed"));break;case"stable":c.pc.remoteDescription?c.pc.addIceCandidate(g).then(function(){return M()}).catch(function(l){return E(l)}):(c.iceCandidateList.push(g),M());break;default:c.iceCandidateList.push(g),M()}})},j.prototype.addIceConnectionStateChangeListener=function(g){var c=this;this.pc.addEventListener("iceconnectionstatechange",function(){switch(c.pc.iceConnectionState){case"disconnected":var E="IceConnectionState of RTCPeerConnection "+c.configuration.id+" ("+g+') change to "disconnected". Possible network disconnection';u.warn(E),c.configuration.onIceConnectionStateException(f.ExceptionEventName.ICE_CONNECTION_DISCONNECTED,E);break;case"failed":var l="IceConnectionState of RTCPeerConnection "+c.configuration.id+" ("+g+') to "failed"';u.error(l),c.configuration.onIceConnectionStateException(f.ExceptionEventName.ICE_CONNECTION_FAILED,l);break;case"closed":u.log("IceConnectionState of RTCPeerConnection "+c.configuration.id+" ("+g+') change to "closed"');break;case"new":u.log("IceConnectionState of RTCPeerConnection "+c.configuration.id+" ("+g+') change to "new"');break;case"checking":u.log("IceConnectionState of RTCPeerConnection "+c.configuration.id+" ("+g+') change to "checking"');break;case"connected":u.log("IceConnectionState of RTCPeerConnection "+c.configuration.id+" ("+g+') change to "connected"');break;case"completed":u.log("IceConnectionState of RTCPeerConnection "+c.configuration.id+" ("+g+') change to "completed"')}})},j.prototype.generateUniqueId=function(){return(0,t.v4)()},j}();U.WebRtcPeer=B;var I=function(j){function g(c){return c.mode="recvonly",j.call(this,c)||this}return p(g,j),g}(B);U.WebRtcPeerRecvonly=I;var R=function(j){function g(c){return c.mode="sendonly",j.call(this,c)||this}return p(g,j),g}(B);U.WebRtcPeerSendonly=R;var J=function(j){function g(c){return c.mode="sendrecv",j.call(this,c)||this}return p(g,j),g}(B);U.WebRtcPeerSendrecv=J},2102:function(ne,U,w){"use strict";var p=this&&this.__awaiter||function(m,_,u,P){return new(u||(u=Promise))(function(I,R){function J(c){try{g(P.next(c))}catch(M){R(M)}}function j(c){try{g(P.throw(c))}catch(M){R(M)}}function g(c){c.done?I(c.value):function B(I){return I instanceof u?I:new u(function(R){R(I)})}(c.value).then(J,j)}g((P=P.apply(m,_||[])).next())})},L=this&&this.__generator||function(m,_){var P,B,I,R,u={label:0,sent:function(){if(1&I[0])throw I[1];return I[1]},trys:[],ops:[]};return R={next:J(0),throw:J(1),return:J(2)},"function"==typeof Symbol&&(R[Symbol.iterator]=function(){return this}),R;function J(g){return function(c){return function j(g){if(P)throw new TypeError("Generator is already executing.");for(;u;)try{if(P=1,B&&(I=2&g[0]?B.return:g[0]?B.throw||((I=B.return)&&I.call(B),0):B.next)&&!(I=I.call(B,g[1])).done)return I;switch(B=0,I&&(g=[2&g[0],I.value]),g[0]){case 0:case 1:I=g;break;case 4:return u.label++,{value:g[1],done:!1};case 5:u.label++,B=g[1],g=[0];continue;case 7:g=u.ops.pop(),u.trys.pop();continue;default:if(!(I=(I=u.trys).length>0&&I[I.length-1])&&(6===g[0]||2===g[0])){u=0;continue}if(3===g[0]&&(!I||g[1]>I[0]&&g[1]<I[3])){u.label=g[1];break}if(6===g[0]&&u.label<I[1]){u.label=I[1],I=g;break}if(I&&u.label<I[2]){u.label=I[2],u.ops.push(g);break}I[2]&&u.ops.pop(),u.trys.pop();continue}g=_.call(m,u)}catch(c){g=[6,c],B=0}finally{P=I=0}if(5&g[0])throw g[1];return{value:g[0]?g[1]:void 0,done:!0}}([g,c])}}};Object.defineProperty(U,"__esModule",{value:!0}),U.WebRtcStats=void 0;var t,D=w(6946),h=w(543),v=D.OpenViduLogger.getInstance(),f=function(){function m(_){this.stream=_,this.STATS_ITEM_NAME="webrtc-stats-config",this.webRtcStatsEnabled=!1,this.statsInterval=1,t=h.PlatformUtils.getInstance()}return m.prototype.isEnabled=function(){return this.webRtcStatsEnabled},m.prototype.initWebRtcStats=function(){var _=this,u=localStorage.getItem(this.STATS_ITEM_NAME);if(u){this.webRtcStatsEnabled=!0;var P=JSON.parse(u);v.warn("WebRtc stats enabled for stream "+this.stream.streamId+" of connection "+this.stream.connection.connectionId),v.warn("localStorage item: "+JSON.stringify(P)),this.POST_URL=P.httpEndpoint,this.statsInterval=P.interval,this.webRtcStatsIntervalId=setInterval(function(){return p(_,void 0,void 0,function(){return L(this,function(B){switch(B.label){case 0:return[4,this.sendStatsToHttpEndpoint()];case 1:return B.sent(),[2]}})})},1e3*this.statsInterval)}else v.debug("WebRtc stats not enabled")},m.prototype.getSelectedIceCandidateInfo=function(){var _=this;return new Promise(function(u,P){return p(_,void 0,void 0,function(){var B,I,R,J,j,g,M,E,l,a,V,C,y,N,r,b,x,O,S;return L(this,function(F){switch(F.label){case 0:return[4,this.stream.getRTCPeerConnection().getStats()];case 1:if(B=F.sent(),R=new Map,J=new Map,j=new Map,B.forEach(function(H){switch("transport"===H.type&&(t.isChromium()||t.isSafariBrowser()||t.isReactNative())&&(I=H),H.type){case"candidate-pair":R.set(H.id,H);break;case"local-candidate":J.set(H.id,H);break;case"remote-candidate":j.set(H.id,H)}}),null!=I)g=R.get(I.selectedCandidatePairId);else for(M=R.size,E=R.values(),l=0;l<M;l++)if((a=E.next().value).selected){g=a;break}if(V=g.remoteCandidateId,C=J.get(g.localCandidateId))for(b=this.stream.getLocalIceCandidateList(),x=b.filter(function(H){return!!H.candidate&&(H.candidate.indexOf(C.ip)>=0||H.candidate.indexOf(C.address)>=0)&&H.candidate.indexOf(C.port)>=0}),C.raw=[],y=0,N=x;y<N.length;y++)C.raw.push(N[y].candidate);else C="ERROR: No active local ICE candidate. Probably ICE-TCP is being used";if(r=j.get(V))for(b=this.stream.getRemoteIceCandidateList(),x=b.filter(function(H){return!!H.candidate&&(H.candidate.indexOf(r.ip)>=0||H.candidate.indexOf(r.address)>=0)&&H.candidate.indexOf(r.port)>=0}),r.raw=[],O=0,S=x;O<S.length;O++)r.raw.push(S[O].candidate);else r="ERROR: No active remote ICE candidate. Probably ICE-TCP is being used";return[2,u({localCandidate:C,remoteCandidate:r})]}})})})},m.prototype.stopWebRtcStats=function(){this.webRtcStatsEnabled&&(clearInterval(this.webRtcStatsIntervalId),v.warn("WebRtc stats stopped for disposed stream "+this.stream.streamId+" of connection "+this.stream.connection.connectionId))},m.prototype.sendStats=function(_,u){return p(this,void 0,void 0,function(){var P,B;return L(this,function(I){switch(I.label){case 0:return I.trys.push([0,2,,3]),P={headers:{"Content-type":"application/json"},body:JSON.stringify(u),method:"POST"},[4,fetch(_,P)];case 1:return I.sent(),[3,3];case 2:return B=I.sent(),v.error("sendStats error: ".concat(JSON.stringify(B))),[3,3];case 3:return[2]}})})},m.prototype.sendStatsToHttpEndpoint=function(){return p(this,void 0,void 0,function(){var _,u,P;return L(this,function(B){switch(B.label){case 0:return B.trys.push([0,3,,4]),[4,this.getCommonStats()];case 1:return _=B.sent(),u=this.generateJSONStatsResponse(_),[4,this.sendStats(this.POST_URL,u)];case 2:return B.sent(),[3,4];case 3:return P=B.sent(),v.log(P),[3,4];case 4:return[2]}})})},m.prototype.getCommonStats=function(){return p(this,void 0,void 0,function(){var _=this;return L(this,function(u){return[2,new Promise(function(P,B){return p(_,void 0,void 0,function(){var I,R,J,j,g,c=this;return L(this,function(M){switch(M.label){case 0:return M.trys.push([0,2,,3]),[4,this.stream.getRTCPeerConnection().getStats()];case 1:return I=M.sent(),R=this.getWebRtcStatsResponseOutline(),J=["framesReceived","framesDropped","framesSent","frameHeight","frameWidth"],j=["availableOutgoingBitrate","currentRoundTripTime"],I.forEach(function(E){var l=null!=E.mediaType?E.mediaType:E.kind,a=function(d,V){null!=E[V]&&null!=R[d]&&(!l&&J.indexOf(V)>-1&&(l="video"),null!=d&&null!=l&&null!=V&&null!=R[d][l]?R[d][l][V]=Number(E[V]):null!=d&&null!=V&&j.includes(V)&&(R[d][V]=Number(E[V])))};switch(E.type){case"outbound-rtp":a("outbound","bytesSent"),a("outbound","packetsSent"),a("outbound","framesEncoded"),a("outbound","nackCount"),a("outbound","firCount"),a("outbound","pliCount"),a("outbound","qpSum");break;case"inbound-rtp":a("inbound","bytesReceived"),a("inbound","packetsReceived"),a("inbound","packetsLost"),a("inbound","jitter"),a("inbound","framesDecoded"),a("inbound","nackCount"),a("inbound","firCount"),a("inbound","pliCount");break;case"track":a("inbound","jitterBufferDelay"),a("inbound","framesReceived"),a("outbound","framesDropped"),a("outbound","framesSent"),a(c.stream.isLocal()?"outbound":"inbound","frameHeight"),a(c.stream.isLocal()?"outbound":"inbound","frameWidth");break;case"candidate-pair":a("candidatepair","currentRoundTripTime"),a("candidatepair","availableOutgoingBitrate")}}),(!(null==R?void 0:R.candidatepair)||0===Object.keys(R.candidatepair).length)&&delete R.candidatepair,[2,P(R)];case 2:return g=M.sent(),v.error("Error getting common stats: ",g),[2,B(g)];case 3:return[2]}})})})]})})},m.prototype.generateJSONStatsResponse=function(_){return{"@timestamp":(new Date).toISOString(),participant_id:this.stream.connection.data,session_id:this.stream.session.sessionId,platform:t.getName(),platform_description:t.getDescription(),stream:"webRTC",webrtc_stats:_}},m.prototype.getWebRtcStatsResponseOutline=function(){return this.stream.isLocal()?{outbound:{audio:{},video:{}},candidatepair:{}}:{inbound:{audio:{},video:{}}}},m}();U.WebRtcStats=f},5039:(ne,U,w)=>{"use strict";U.Dn=void 0;var L=w(8659),D=w(763);Object.defineProperty(U,"Dn",{enumerable:!0,get:function(){return D.OpenVidu}});w(8402),w(4259),w(1758),w(8613),w(2096),w(7490),w(4289),w(4540),w(5156),w(4103),w(5913),w(6274),w(2345),w(8702),w(805),w(7936),w(1018),w(5785),w(2299),w(4006),w(4281),w(2798),w(865),w(2156),w(6237),w(7507),w(8074);L.JL.setOptions({enabled:!1})},835:ne=>{"use strict";function U(){this._types=Object.create(null),this._extensions=Object.create(null);for(let w=0;w<arguments.length;w++)this.define(arguments[w]);this.define=this.define.bind(this),this.getType=this.getType.bind(this),this.getExtension=this.getExtension.bind(this)}U.prototype.define=function(w,p){for(let L in w){let D=w[L].map(function(h){return h.toLowerCase()});L=L.toLowerCase();for(let h=0;h<D.length;h++){const v=D[h];if("*"!==v[0]){if(!p&&v in this._types)throw new Error('Attempt to change mapping for "'+v+'" extension from "'+this._types[v]+'" to "'+L+'". Pass `force=true` to allow this, otherwise remove "'+v+'" from the list of extensions for "'+L+'".');this._types[v]=L}}if(p||!this._extensions[L]){const h=D[0];this._extensions[L]="*"!==h[0]?h:h.substr(1)}}},U.prototype.getType=function(w){let p=(w=String(w)).replace(/^.*[/\\]/,"").toLowerCase(),L=p.replace(/^.*\./,"").toLowerCase();return(L.length<p.length-1||!(p.length<w.length))&&this._types[L]||null},U.prototype.getExtension=function(w){return(w=/^\s*([^;\s]*)/.test(w)&&RegExp.$1)&&this._extensions[w.toLowerCase()]||null},ne.exports=U},8946:(ne,U,w)=>{"use strict";let p=w(835);ne.exports=new p(w(9920))},9920:ne=>{ne.exports={"application/andrew-inset":["ez"],"application/applixware":["aw"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomdeleted+xml":["atomdeleted"],"application/atomsvc+xml":["atomsvc"],"application/atsc-dwd+xml":["dwd"],"application/atsc-held+xml":["held"],"application/atsc-rsat+xml":["rsat"],"application/bdoc":["bdoc"],"application/calendar+xml":["xcs"],"application/ccxml+xml":["ccxml"],"application/cdfx+xml":["cdfx"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cu-seeme":["cu"],"application/dash+xml":["mpd"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["es","ecma"],"application/emma+xml":["emma"],"application/emotionml+xml":["emotionml"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/express":["exp"],"application/fdt+xml":["fdt"],"application/font-tdpfr":["pfr"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hjson":["hjson"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/its+xml":["its"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["js","mjs"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lgr+xml":["lgr"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mmt-aei+xml":["maei"],"application/mmt-usd+xml":["musd"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["mp4s","m4p"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/n-quads":["nq"],"application/n-triples":["nt"],"application/node":["cjs"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/p2p-overlay+xml":["relo"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-signature":["asc","sig"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/provenance+xml":["provx"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf","owl"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/route-apd+xml":["rapd"],"application/route-s-tsid+xml":["sls"],"application/route-usd+xml":["rusd"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/senml+xml":["senmlx"],"application/sensml+xml":["sensmlx"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/sieve":["siv","sieve"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/swid+xml":["swidtag"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/toml":["toml"],"application/trig":["trig"],"application/ttml+xml":["ttml"],"application/ubjson":["ubj"],"application/urc-ressheet+xml":["rsheet"],"application/urc-targetdesc+xml":["td"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/xaml+xml":["xaml"],"application/xcap-att+xml":["xav"],"application/xcap-caps+xml":["xca"],"application/xcap-diff+xml":["xdf"],"application/xcap-el+xml":["xel"],"application/xcap-ns+xml":["xns"],"application/xenc+xml":["xenc"],"application/xhtml+xml":["xhtml","xht"],"application/xliff+xml":["xlf"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["*xsl","xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":["*3gpp"],"audio/adpcm":["adp"],"audio/amr":["amr"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mobile-xmf":["mxmf"],"audio/mp3":["*mp3"],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx","opus"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/wav":["wav"],"audio/wave":["*wav"],"audio/webm":["weba"],"audio/xm":["xm"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/aces":["exr"],"image/apng":["apng"],"image/avif":["avif"],"image/bmp":["bmp"],"image/cgm":["cgm"],"image/dicom-rle":["drle"],"image/emf":["emf"],"image/fits":["fits"],"image/g3fax":["g3"],"image/gif":["gif"],"image/heic":["heic"],"image/heic-sequence":["heics"],"image/heif":["heif"],"image/heif-sequence":["heifs"],"image/hej2k":["hej2"],"image/hsj2":["hsj2"],"image/ief":["ief"],"image/jls":["jls"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpeg","jpg","jpe"],"image/jph":["jph"],"image/jphc":["jhc"],"image/jpm":["jpm"],"image/jpx":["jpx","jpf"],"image/jxr":["jxr"],"image/jxra":["jxra"],"image/jxrs":["jxrs"],"image/jxs":["jxs"],"image/jxsc":["jxsc"],"image/jxsi":["jxsi"],"image/jxss":["jxss"],"image/ktx":["ktx"],"image/ktx2":["ktx2"],"image/png":["png"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/t38":["t38"],"image/tiff":["tif","tiff"],"image/tiff-fx":["tfx"],"image/webp":["webp"],"image/wmf":["wmf"],"message/disposition-notification":["disposition-notification"],"message/global":["u8msg"],"message/global-delivery-status":["u8dsn"],"message/global-disposition-notification":["u8mdn"],"message/global-headers":["u8hdr"],"message/rfc822":["eml","mime"],"model/3mf":["3mf"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/mesh":["msh","mesh","silo"],"model/mtl":["mtl"],"model/obj":["obj"],"model/step+xml":["stpx"],"model/step+zip":["stpz"],"model/step-xml+zip":["stpxz"],"model/stl":["stl"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["*x3db","x3dbz"],"model/x3d+fastinfoset":["x3db"],"model/x3d+vrml":["*x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"model/x3d-vrml":["x3dv"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["markdown","md"],"text/mathml":["mml"],"text/mdx":["mdx"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/richtext":["rtx"],"text/rtf":["*rtf"],"text/sgml":["sgml","sgm"],"text/shex":["shex"],"text/slim":["slim","slm"],"text/spdx":["spdx"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vtt":["vtt"],"text/xml":["*xml"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/iso.segment":["m4s"],"video/jpeg":["jpgv"],"video/jpm":["*jpm","jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/webm":["webm"]}},2437:function(ne,U,w){var p;ne=w.nmd(ne),function(){"use strict";var L={function:!0,object:!0},D=L[typeof window]&&window||this,f=L[typeof U]&&U&&L.object&&ne&&!ne.nodeType&&ne&&"object"==typeof global&&global;f&&(f.global===f||f.window===f||f.self===f)&&(D=f);var m=Math.pow(2,53)-1,_=/\bOpera/,P=Object.prototype,B=P.hasOwnProperty,I=P.toString;function R(y){return(y=String(y)).charAt(0).toUpperCase()+y.slice(1)}function g(y){return y=d(y),/^(?:webOS|i(?:OS|P))/.test(y)?y:R(y)}function c(y,N){for(var r in y)B.call(y,r)&&N(y[r],r,y)}function M(y){return null==y?R(y):I.call(y).slice(8,-1)}function l(y){return String(y).replace(/([ -])(?!$)/g,"$1?")}function a(y,N){var r=null;return function j(y,N){var r=-1,b=y?y.length:0;if("number"==typeof b&&b>-1&&b<=m)for(;++r<b;)N(y[r],r,y);else c(y,N)}(y,function(b,x){r=N(r,b,x,y)}),r}function d(y){return String(y).replace(/^ +| +$/g,"")}var C=function V(y){var N=D,r=y&&"object"==typeof y&&"String"!=M(y);r&&(N=y,y=null);var b=N.navigator||{},x=b.userAgent||"";y||(y=x);var Y,z,S=r?!!b.likeChrome:/\bChrome\b/.test(y)&&!/internal|\n/i.test(I.toString()),T="Object",F=r?T:"ScriptBridgingProxyObject",H=r?T:"Environment",ee=r&&N.java?"JavaPackage":M(N.java),ie=r?T:"RuntimeObject",se=/\bJava/.test(ee)&&N.java,ae=se&&M(N.environment)==H,fe=se?"a":"\u03b1",de=se?"b":"\u03b2",le=N.document||{},me=N.operamini||N.opera,Ee=_.test(Ee=r&&me?me["[[Class]]"]:M(me))?Ee:me=null,De=y,ue=[],be=null,$=y==x,X=$&&me&&"function"==typeof me.version&&me.version(),K=function ge(Se){return a(Se,function(ve,pe){return ve||RegExp("\\b"+(pe.pattern||l(pe))+"\\b","i").exec(y)&&(pe.label||pe)})}([{label:"EdgeHTML",pattern:"Edge"},"Trident",{label:"WebKit",pattern:"AppleWebKit"},"iCab","Presto","NetFront","Tasman","KHTML","Gecko"]),W=function Te(Se){return a(Se,function(ve,pe){return ve||RegExp("\\b"+(pe.pattern||l(pe))+"\\b","i").exec(y)&&(pe.label||pe)})}(["Adobe AIR","Arora","Avant Browser","Breach","Camino","Electron","Epiphany","Fennec","Flock","Galeon","GreenBrowser","iCab","Iceweasel","K-Meleon","Konqueror","Lunascape","Maxthon",{label:"Microsoft Edge",pattern:"(?:Edge|Edg|EdgA|EdgiOS)"},"Midori","Nook Browser","PaleMoon","PhantomJS","Raven","Rekonq","RockMelt",{label:"Samsung Internet",pattern:"SamsungBrowser"},"SeaMonkey",{label:"Silk",pattern:"(?:Cloud9|Silk-Accelerated)"},"Sleipnir","SlimBrowser",{label:"SRWare Iron",pattern:"Iron"},"Sunrise","Swiftfox","Vivaldi","Waterfox","WebPositive",{label:"Yandex Browser",pattern:"YaBrowser"},{label:"UC Browser",pattern:"UCBrowser"},"Opera Mini",{label:"Opera Mini",pattern:"OPiOS"},"Opera",{label:"Opera",pattern:"OPR"},"Chromium","Chrome",{label:"Chrome",pattern:"(?:HeadlessChrome)"},{label:"Chrome Mobile",pattern:"(?:CriOS|CrMo)"},{label:"Firefox",pattern:"(?:Firefox|Minefield)"},{label:"Firefox for iOS",pattern:"FxiOS"},{label:"IE",pattern:"IEMobile"},{label:"IE",pattern:"MSIE"},"Safari"]),Q=Ie([{label:"BlackBerry",pattern:"BB10"},"BlackBerry",{label:"Galaxy S",pattern:"GT-I9000"},{label:"Galaxy S2",pattern:"GT-I9100"},{label:"Galaxy S3",pattern:"GT-I9300"},{label:"Galaxy S4",pattern:"GT-I9500"},{label:"Galaxy S5",pattern:"SM-G900"},{label:"Galaxy S6",pattern:"SM-G920"},{label:"Galaxy S6 Edge",pattern:"SM-G925"},{label:"Galaxy S7",pattern:"SM-G930"},{label:"Galaxy S7 Edge",pattern:"SM-G935"},"Google TV","Lumia","iPad","iPod","iPhone","Kindle",{label:"Kindle Fire",pattern:"(?:Cloud9|Silk-Accelerated)"},"Nexus","Nook","PlayBook","PlayStation Vita","PlayStation","TouchPad","Transformer",{label:"Wii U",pattern:"WiiU"},"Wii","Xbox One",{label:"Xbox 360",pattern:"Xbox"},"Xoom"]),te=function Ce(Se){return a(Se,function(ve,pe,Re){return ve||(pe[Q]||pe[/^[a-z]+(?: +[a-z]+\b)*/i.exec(Q)]||RegExp("\\b"+l(Re)+"(?:\\b|\\w*\\d)","i").exec(y))&&Re})}({Apple:{iPad:1,iPhone:1,iPod:1},Alcatel:{},Archos:{},Amazon:{Kindle:1,"Kindle Fire":1},Asus:{Transformer:1},"Barnes & Noble":{Nook:1},BlackBerry:{PlayBook:1},Google:{"Google TV":1,Nexus:1},HP:{TouchPad:1},HTC:{},Huawei:{},Lenovo:{},LG:{},Microsoft:{Xbox:1,"Xbox One":1},Motorola:{Xoom:1},Nintendo:{"Wii U":1,Wii:1},Nokia:{Lumia:1},Oppo:{},Samsung:{"Galaxy S":1,"Galaxy S2":1,"Galaxy S3":1,"Galaxy S4":1},Sony:{PlayStation:1,"PlayStation Vita":1},Xiaomi:{Mi:1,Redmi:1}}),re=function ke(Se){return a(Se,function(ve,pe){var Re=pe.pattern||l(pe);return!ve&&(ve=RegExp("\\b"+Re+"(?:/[\\d.]+|[ \\w.]*)","i").exec(y))&&(ve=function J(y,N,r){var b={"10.0":"10",6.4:"10 Technical Preview",6.3:"8.1",6.2:"8",6.1:"Server 2008 R2 / 7","6.0":"Server 2008 / Vista",5.2:"Server 2003 / XP 64-bit",5.1:"XP",5.01:"2000 SP1","5.0":"2000","4.0":"NT","4.90":"ME"};return N&&r&&/^Win/i.test(y)&&!/^Windows Phone /i.test(y)&&(b=b[/[\d.]+$/.exec(y)])&&(y="Windows "+b),y=String(y),N&&r&&(y=y.replace(RegExp(N,"i"),r)),g(y.replace(/ ce$/i," CE").replace(/\bhpw/i,"web").replace(/\bMacintosh\b/,"Mac OS").replace(/_PowerPC\b/i," OS").replace(/\b(OS X) [^ \d]+/i,"$1").replace(/\bMac (OS X)\b/,"$1").replace(/\/(\d)/," $1").replace(/_/g,".").replace(/(?: BePC|[ .]*fc[ \d.]+)$/i,"").replace(/\bx86\.64\b/gi,"x86_64").replace(/\b(Windows Phone) OS\b/,"$1").replace(/\b(Chrome OS \w+) [\d.]+\b/,"$1").split(" on ")[0])}(ve,Re,pe.label||pe)),ve})}(["Windows Phone","KaiOS","Android","CentOS",{label:"Chrome OS",pattern:"CrOS"},"Debian",{label:"DragonFly BSD",pattern:"DragonFly"},"Fedora","FreeBSD","Gentoo","Haiku","Kubuntu","Linux Mint","OpenBSD","Red Hat","SuSE","Ubuntu","Xubuntu","Cygwin","Symbian OS","hpwOS","webOS ","webOS","Tablet OS","Tizen","Linux","Mac OS X","Macintosh","Mac","Windows 98;","Windows "]);function Ie(Se){return a(Se,function(ve,pe){var Re=pe.pattern||l(pe);return!ve&&(ve=RegExp("\\b"+Re+" *\\d+[.\\w_]*","i").exec(y)||RegExp("\\b"+Re+" *\\w+-[\\w]*","i").exec(y)||RegExp("\\b"+Re+"(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)","i").exec(y))&&((ve=String(pe.label&&!RegExp(Re,"i").test(pe.label)?pe.label:ve).split("/"))[1]&&!/[\d.]+/.test(ve[0])&&(ve[0]+=" "+ve[1]),pe=pe.label||pe,ve=g(ve[0].replace(RegExp(Re,"i"),pe).replace(RegExp("; *(?:"+pe+"[_-])?","i")," ").replace(RegExp("("+pe+")[-_.]?(\\w)","i"),"$1 $2"))),ve})}function Pe(Se){return a(Se,function(ve,pe){return ve||(RegExp(pe+"(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)","i").exec(y)||0)[1]||null})}if(K&&(K=[K]),/\bAndroid\b/.test(re)&&!Q&&(Y=/\bAndroid[^;]*;(.*?)(?:Build|\) AppleWebKit)\b/i.exec(y))&&(Q=d(Y[1]).replace(/^[a-z]{2}-[a-z]{2};\s*/i,"")||null),te&&!Q?Q=Ie([te]):te&&Q&&(Q=Q.replace(RegExp("^("+l(te)+")[-_.\\s]","i"),te+" ").replace(RegExp("^("+l(te)+")[-_.]?(\\w)","i"),te+" $2")),(Y=/\bGoogle TV\b/.exec(Q))&&(Q=Y[0]),/\bSimulator\b/i.test(y)&&(Q=(Q?Q+" ":"")+"Simulator"),"Opera Mini"==W&&/\bOPiOS\b/.test(y)&&ue.push("running in Turbo/Uncompressed mode"),"IE"==W&&/\blike iPhone OS\b/.test(y)?(te=(Y=V(y.replace(/like iPhone OS/,""))).manufacturer,Q=Y.product):/^iP/.test(Q)?(W||(W="Safari"),re="iOS"+((Y=/ OS ([\d_]+)/i.exec(y))?" "+Y[1].replace(/_/g,"."):"")):"Konqueror"==W&&/^Linux\b/i.test(re)?re="Kubuntu":te&&"Google"!=te&&(/Chrome/.test(W)&&!/\bMobile Safari\b/i.test(y)||/\bVita\b/.test(Q))||/\bAndroid\b/.test(re)&&/^Chrome/.test(W)&&/\bVersion\//i.test(y)?(W="Android Browser",re=/\bAndroid\b/.test(re)?re:"Android"):"Silk"==W?(/\bMobi/i.test(y)||(re="Android",ue.unshift("desktop mode")),/Accelerated *= *true/i.test(y)&&ue.unshift("accelerated")):"UC Browser"==W&&/\bUCWEB\b/.test(y)?ue.push("speed mode"):"PaleMoon"==W&&(Y=/\bFirefox\/([\d.]+)\b/.exec(y))?ue.push("identifying as Firefox "+Y[1]):"Firefox"==W&&(Y=/\b(Mobile|Tablet|TV)\b/i.exec(y))?(re||(re="Firefox OS"),Q||(Q=Y[1])):!W||(Y=!/\bMinefield\b/i.test(y)&&/\b(?:Firefox|Safari)\b/.exec(W))?(W&&!Q&&/[\/,]|^[^(]+?\)/.test(y.slice(y.indexOf(Y+"/")+8))&&(W=null),(Y=Q||te||re)&&(Q||te||/\b(?:Android|Symbian OS|Tablet OS|webOS)\b/.test(re))&&(W=/[a-z]+(?: Hat)?/i.exec(/\bAndroid\b/.test(re)?re:Y)+" Browser")):"Electron"==W&&(Y=(/\bChrome\/([\d.]+)\b/.exec(y)||0)[1])&&ue.push("Chromium "+Y),X||(X=Pe(["(?:Cloud9|CriOS|CrMo|Edge|Edg|EdgA|EdgiOS|FxiOS|HeadlessChrome|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|SamsungBrowser|Silk(?!/[\\d.]+$)|UCBrowser|YaBrowser)","Version",l(W),"(?:Firefox|Minefield|NetFront)"])),(Y=("iCab"==K&&parseFloat(X)>3?"WebKit":/\bOpera\b/.test(W)&&(/\bOPR\b/.test(y)?"Blink":"Presto"))||/\b(?:Midori|Nook|Safari)\b/i.test(y)&&!/^(?:Trident|EdgeHTML)$/.test(K)&&"WebKit"||!K&&/\bMSIE\b/i.test(y)&&("Mac OS"==re?"Tasman":"Trident")||"WebKit"==K&&/\bPlayStation\b(?! Vita\b)/i.test(W)&&"NetFront")&&(K=[Y]),"IE"==W&&(Y=(/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(y)||0)[1])?(W+=" Mobile",re="Windows Phone "+(/\+$/.test(Y)?Y:Y+".x"),ue.unshift("desktop mode")):/\bWPDesktop\b/i.test(y)?(W="IE Mobile",re="Windows Phone 8.x",ue.unshift("desktop mode"),X||(X=(/\brv:([\d.]+)/.exec(y)||0)[1])):"IE"!=W&&"Trident"==K&&(Y=/\brv:([\d.]+)/.exec(y))&&(W&&ue.push("identifying as "+W+(X?" "+X:"")),W="IE",X=Y[1]),$){if(function E(y,N){var r=null!=y?typeof y[N]:"number";return!(/^(?:boolean|number|string|undefined)$/.test(r)||"object"==r&&!y[N])}(N,"global"))if(se&&(De=(Y=se.lang.System).getProperty("os.arch"),re=re||Y.getProperty("os.name")+" "+Y.getProperty("os.version")),ae){try{X=N.require("ringo/engine").version.join("."),W="RingoJS"}catch(Se){(Y=N.system)&&Y.global.system==N.system&&(W="Narwhal",re||(re=Y[0].os||null))}W||(W="Rhino")}else"object"==typeof N.process&&!N.process.browser&&(Y=N.process)&&("object"==typeof Y.versions&&("string"==typeof Y.versions.electron?(ue.push("Node "+Y.versions.node),W="Electron",X=Y.versions.electron):"string"==typeof Y.versions.nw&&(ue.push("Chromium "+X,"Node "+Y.versions.node),W="NW.js",X=Y.versions.nw)),W||(W="Node.js",De=Y.arch,re=Y.platform,X=(X=/[\d.]+/.exec(Y.version))?X[0]:null));else M(Y=N.runtime)==F?(W="Adobe AIR",re=Y.flash.system.Capabilities.os):M(Y=N.phantom)==ie?(W="PhantomJS",X=(Y=Y.version||null)&&Y.major+"."+Y.minor+"."+Y.patch):"number"==typeof le.documentMode&&(Y=/\bTrident\/(\d+)/i.exec(y))?((Y=+Y[1]+4)!=(X=[X,le.documentMode])[1]&&(ue.push("IE "+X[1]+" mode"),K&&(K[1]=""),X[1]=Y),X="IE"==W?String(X[1].toFixed(1)):X[0]):"number"==typeof le.documentMode&&/^(?:Chrome|Firefox)\b/.test(W)&&(ue.push("masking as "+W+" "+X),W="IE",X="11.0",K=["Trident"],re="Windows");re=re&&g(re)}if(X&&(Y=/(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(X)||/(?:alpha|beta)(?: ?\d)?/i.exec(y+";"+($&&b.appMinorVersion))||/\bMinefield\b/i.test(y)&&"a")&&(be=/b/i.test(Y)?"beta":"alpha",X=X.replace(RegExp(Y+"\\+?$"),"")+("beta"==be?de:fe)+(/\d+\+?/.exec(Y)||"")),"Fennec"==W||"Firefox"==W&&/\b(?:Android|Firefox OS|KaiOS)\b/.test(re))W="Firefox Mobile";else if("Maxthon"==W&&X)X=X.replace(/\.[\d.]+/,".x");else if(/\bXbox\b/i.test(Q))"Xbox 360"==Q&&(re=null),"Xbox 360"==Q&&/\bIEMobile\b/.test(y)&&ue.unshift("mobile mode");else if(!/^(?:Chrome|IE|Opera)$/.test(W)&&(!W||Q||/Browser|Mobi/.test(W))||"Windows CE"!=re&&!/Mobi/i.test(y))if("IE"==W&&$)try{null===N.external&&ue.unshift("platform preview")}catch(Se){ue.unshift("embedded")}else(/\bBlackBerry\b/.test(Q)||/\bBB10\b/.test(y))&&(Y=(RegExp(Q.replace(/ +/g," *")+"/([.\\d]+)","i").exec(y)||0)[1]||X)?(re=((Y=[Y,/BB10/.test(y)])[1]?(Q=null,te="BlackBerry"):"Device Software")+" "+Y[0],X=null):this!=c&&"Wii"!=Q&&($&&me||/Opera/.test(W)&&/\b(?:MSIE|Firefox)\b/i.test(y)||"Firefox"==W&&/\bOS X (?:\d+\.){2,}/.test(re)||"IE"==W&&(re&&!/^Win/.test(re)&&X>5.5||/\bWindows XP\b/.test(re)&&X>8||8==X&&!/\bTrident\b/.test(y)))&&!_.test(Y=V.call(c,y.replace(_,"")+";"))&&Y.name&&(Y="ing as "+Y.name+((Y=Y.version)?" "+Y:""),_.test(W)?(/\bIE\b/.test(Y)&&"Mac OS"==re&&(re=null),Y="identify"+Y):(Y="mask"+Y,W=Ee?g(Ee.replace(/([a-z])([A-Z])/g,"$1 $2")):"Opera",/\bIE\b/.test(Y)&&(re=null),$||(X=null)),K=["Presto"],ue.push(Y));else W+=" Mobile";(Y=(/\bAppleWebKit\/([\d.]+\+?)/i.exec(y)||0)[1])&&(Y=[parseFloat(Y.replace(/\.(\d)$/,".0$1")),Y],"Safari"==W&&"+"==Y[1].slice(-1)?(W="WebKit Nightly",be="alpha",X=Y[1].slice(0,-1)):(X==Y[1]||X==(Y[2]=(/\bSafari\/([\d.]+\+?)/i.exec(y)||0)[1]))&&(X=null),Y[1]=(/\b(?:Headless)?Chrome\/([\d.]+)/i.exec(y)||0)[1],537.36==Y[0]&&537.36==Y[2]&&parseFloat(Y[1])>=28&&"WebKit"==K&&(K=["Blink"]),$&&(S||Y[1])?(K&&(K[1]="like Chrome"),Y=Y[1]||((Y=Y[0])<530?1:Y<532?2:Y<532.05?3:Y<533?4:Y<534.03?5:Y<534.07?6:Y<534.1?7:Y<534.13?8:Y<534.16?9:Y<534.24?10:Y<534.3?11:Y<535.01?12:Y<535.02?"13+":Y<535.07?15:Y<535.11?16:Y<535.19?17:Y<536.05?18:Y<536.1?19:Y<537.01?20:Y<537.11?"21+":Y<537.13?23:Y<537.18?24:Y<537.24?25:Y<537.36?26:"Blink"!=K?"27":"28")):(K&&(K[1]="like Safari"),Y=(Y=Y[0])<400?1:Y<500?2:Y<526?3:Y<533?4:Y<534?"4+":Y<535?5:Y<537?6:Y<538?7:Y<601?8:Y<602?9:Y<604?10:Y<606?11:Y<608?12:"12"),K&&(K[1]+=" "+(Y+="number"==typeof Y?".x":/[.+]/.test(Y)?"":"+")),"Safari"==W&&(!X||parseInt(X)>45)?X=Y:"Chrome"==W&&/\bHeadlessChrome/i.test(y)&&ue.unshift("headless")),"Opera"==W&&(Y=/\bzbov|zvav$/.exec(re))?(W+=" ",ue.unshift("desktop mode"),"zvav"==Y?(W+="Mini",X=null):W+="Mobile",re=re.replace(RegExp(" *"+Y+"$"),"")):"Safari"==W&&/\bChrome\b/.exec(K&&K[1])?(ue.unshift("desktop mode"),W="Chrome Mobile",X=null,/\bOS X\b/.test(re)?(te="Apple",re="iOS 4.3+"):re=null):/\bSRWare Iron\b/.test(W)&&!X&&(X=Pe("Chrome")),X&&0==X.indexOf(Y=/[\d.]+$/.exec(re))&&y.indexOf("/"+Y+"-")>-1&&(re=d(re.replace(Y,""))),re&&-1!=re.indexOf(W)&&!RegExp(W+" OS").test(re)&&(re=re.replace(RegExp(" *"+l(W)+" *"),"")),K&&!/\b(?:Avant|Nook)\b/.test(W)&&(/Browser|Lunascape|Maxthon/.test(W)||"Safari"!=W&&/^iOS/.test(re)&&/\bSafari\b/.test(K[1])||/^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|SRWare Iron|Vivaldi|Web)/.test(W)&&K[1])&&(Y=K[K.length-1])&&ue.push(Y),ue.length&&(ue=["("+ue.join("; ")+")"]),te&&Q&&Q.indexOf(te)<0&&ue.push("on "+te),Q&&ue.push((/^on /.test(ue[ue.length-1])?"":"on ")+Q),re&&(Y=/ ([\d.+]+)$/.exec(re),z=Y&&"/"==re.charAt(re.length-Y[0].length-1),re={architecture:32,family:Y&&!z?re.replace(Y[0],""):re,version:Y?Y[1]:null,toString:function(){var Se=this.version;return this.family+(Se&&!z?" "+Se:"")+(64==this.architecture?" 64-bit":"")}}),(Y=/\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(De))&&!/\bi686\b/i.test(De)?(re&&(re.architecture=64,re.family=re.family.replace(RegExp(" *"+Y),"")),W&&(/\bWOW64\b/i.test(y)||$&&/\w(?:86|32)$/.test(b.cpuClass||b.platform)&&!/\bWin64; x64\b/i.test(y))&&ue.unshift("32-bit")):re&&/^OS X/.test(re.family)&&"Chrome"==W&&parseFloat(X)>=39&&(re.architecture=64),y||(y=null);var ye={};return ye.description=y,ye.layout=K&&K[0],ye.manufacturer=te,ye.name=W,ye.prerelease=be,ye.product=Q,ye.ua=y,ye.version=W&&X,ye.os=re||{architecture:null,family:null,version:null,toString:function(){return"null"}},ye.parse=V,ye.toString=function Me(){return this.description||""},ye.version&&ue.unshift(X),ye.name&&ue.unshift(W),re&&W&&!(re==String(re).split(" ")[0]&&(re==W.split(" ")[0]||Q))&&ue.push(Q?"("+re+")":"on "+re),ue.length&&(ye.description=ue.join(" ")),ye}();D.platform=C,void 0!==(p=function(){return C}.call(U,w,U,ne))&&(ne.exports=p)}.call(this)},1839:(ne,U,w)=>{const p=w(6070),{MAX_LENGTH:L,MAX_SAFE_INTEGER:D}=w(1696),{re:h,t:v}=w(1338),t=w(471),{compareIdentifiers:f}=w(7165);class m{constructor(u,P){if(P=t(P),u instanceof m){if(u.loose===!!P.loose&&u.includePrerelease===!!P.includePrerelease)return u;u=u.version}else if("string"!=typeof u)throw new TypeError(`Invalid Version: ${u}`);if(u.length>L)throw new TypeError(`version is longer than ${L} characters`);p("SemVer",u,P),this.options=P,this.loose=!!P.loose,this.includePrerelease=!!P.includePrerelease;const B=u.trim().match(P.loose?h[v.LOOSE]:h[v.FULL]);if(!B)throw new TypeError(`Invalid Version: ${u}`);if(this.raw=u,this.major=+B[1],this.minor=+B[2],this.patch=+B[3],this.major>D||this.major<0)throw new TypeError("Invalid major version");if(this.minor>D||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>D||this.patch<0)throw new TypeError("Invalid patch version");this.prerelease=B[4]?B[4].split(".").map(I=>{if(/^[0-9]+$/.test(I)){const R=+I;if(R>=0&&R<D)return R}return I}):[],this.build=B[5]?B[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(u){if(p("SemVer.compare",this.version,this.options,u),!(u instanceof m)){if("string"==typeof u&&u===this.version)return 0;u=new m(u,this.options)}return u.version===this.version?0:this.compareMain(u)||this.comparePre(u)}compareMain(u){return u instanceof m||(u=new m(u,this.options)),f(this.major,u.major)||f(this.minor,u.minor)||f(this.patch,u.patch)}comparePre(u){if(u instanceof m||(u=new m(u,this.options)),this.prerelease.length&&!u.prerelease.length)return-1;if(!this.prerelease.length&&u.prerelease.length)return 1;if(!this.prerelease.length&&!u.prerelease.length)return 0;let P=0;do{const B=this.prerelease[P],I=u.prerelease[P];if(p("prerelease compare",P,B,I),void 0===B&&void 0===I)return 0;if(void 0===I)return 1;if(void 0===B)return-1;if(B!==I)return f(B,I)}while(++P)}compareBuild(u){u instanceof m||(u=new m(u,this.options));let P=0;do{const B=this.build[P],I=u.build[P];if(p("prerelease compare",P,B,I),void 0===B&&void 0===I)return 0;if(void 0===I)return 1;if(void 0===B)return-1;if(B!==I)return f(B,I)}while(++P)}inc(u,P){switch(u){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",P);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",P);break;case"prepatch":this.prerelease.length=0,this.inc("patch",P),this.inc("pre",P);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",P),this.inc("pre",P);break;case"major":(0!==this.minor||0!==this.patch||0===this.prerelease.length)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(0!==this.patch||0===this.prerelease.length)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":if(0===this.prerelease.length)this.prerelease=[0];else{let B=this.prerelease.length;for(;--B>=0;)"number"==typeof this.prerelease[B]&&(this.prerelease[B]++,B=-2);-1===B&&this.prerelease.push(0)}P&&(this.prerelease[0]===P?isNaN(this.prerelease[1])&&(this.prerelease=[P,0]):this.prerelease=[P,0]);break;default:throw new Error(`invalid increment argument: ${u}`)}return this.format(),this.raw=this.version,this}}ne.exports=m},4303:(ne,U,w)=>{const p=w(1839);ne.exports=(D,h)=>new p(D,h).major},7920:(ne,U,w)=>{const p=w(1839);ne.exports=(D,h)=>new p(D,h).minor},1696:ne=>{ne.exports={SEMVER_SPEC_VERSION:"2.0.0",MAX_LENGTH:256,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991,MAX_SAFE_COMPONENT_LENGTH:16}},6070:ne=>{const U="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...w)=>console.error("SEMVER",...w):()=>{};ne.exports=U},7165:ne=>{const U=/^[0-9]+$/,w=(L,D)=>{const h=U.test(L),v=U.test(D);return h&&v&&(L=+L,D=+D),L===D?0:h&&!v?-1:v&&!h?1:L<D?-1:1};ne.exports={compareIdentifiers:w,rcompareIdentifiers:(L,D)=>w(D,L)}},471:ne=>{const U=["includePrerelease","loose","rtl"];ne.exports=p=>p?"object"!=typeof p?{loose:!0}:U.filter(L=>p[L]).reduce((L,D)=>(L[D]=!0,L),{}):{}},1338:(ne,U,w)=>{const{MAX_SAFE_COMPONENT_LENGTH:p}=w(1696),L=w(6070),D=(U=ne.exports={}).re=[],h=U.src=[],v=U.t={};let t=0;const f=(m,_,u)=>{const P=t++;L(P,_),v[m]=P,h[P]=_,D[P]=new RegExp(_,u?"g":void 0)};f("NUMERICIDENTIFIER","0|[1-9]\\d*"),f("NUMERICIDENTIFIERLOOSE","[0-9]+"),f("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),f("MAINVERSION",`(${h[v.NUMERICIDENTIFIER]})\\.(${h[v.NUMERICIDENTIFIER]})\\.(${h[v.NUMERICIDENTIFIER]})`),f("MAINVERSIONLOOSE",`(${h[v.NUMERICIDENTIFIERLOOSE]})\\.(${h[v.NUMERICIDENTIFIERLOOSE]})\\.(${h[v.NUMERICIDENTIFIERLOOSE]})`),f("PRERELEASEIDENTIFIER",`(?:${h[v.NUMERICIDENTIFIER]}|${h[v.NONNUMERICIDENTIFIER]})`),f("PRERELEASEIDENTIFIERLOOSE",`(?:${h[v.NUMERICIDENTIFIERLOOSE]}|${h[v.NONNUMERICIDENTIFIER]})`),f("PRERELEASE",`(?:-(${h[v.PRERELEASEIDENTIFIER]}(?:\\.${h[v.PRERELEASEIDENTIFIER]})*))`),f("PRERELEASELOOSE",`(?:-?(${h[v.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${h[v.PRERELEASEIDENTIFIERLOOSE]})*))`),f("BUILDIDENTIFIER","[0-9A-Za-z-]+"),f("BUILD",`(?:\\+(${h[v.BUILDIDENTIFIER]}(?:\\.${h[v.BUILDIDENTIFIER]})*))`),f("FULLPLAIN",`v?${h[v.MAINVERSION]}${h[v.PRERELEASE]}?${h[v.BUILD]}?`),f("FULL",`^${h[v.FULLPLAIN]}$`),f("LOOSEPLAIN",`[v=\\s]*${h[v.MAINVERSIONLOOSE]}${h[v.PRERELEASELOOSE]}?${h[v.BUILD]}?`),f("LOOSE",`^${h[v.LOOSEPLAIN]}$`),f("GTLT","((?:<|>)?=?)"),f("XRANGEIDENTIFIERLOOSE",`${h[v.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),f("XRANGEIDENTIFIER",`${h[v.NUMERICIDENTIFIER]}|x|X|\\*`),f("XRANGEPLAIN",`[v=\\s]*(${h[v.XRANGEIDENTIFIER]})(?:\\.(${h[v.XRANGEIDENTIFIER]})(?:\\.(${h[v.XRANGEIDENTIFIER]})(?:${h[v.PRERELEASE]})?${h[v.BUILD]}?)?)?`),f("XRANGEPLAINLOOSE",`[v=\\s]*(${h[v.XRANGEIDENTIFIERLOOSE]})(?:\\.(${h[v.XRANGEIDENTIFIERLOOSE]})(?:\\.(${h[v.XRANGEIDENTIFIERLOOSE]})(?:${h[v.PRERELEASELOOSE]})?${h[v.BUILD]}?)?)?`),f("XRANGE",`^${h[v.GTLT]}\\s*${h[v.XRANGEPLAIN]}$`),f("XRANGELOOSE",`^${h[v.GTLT]}\\s*${h[v.XRANGEPLAINLOOSE]}$`),f("COERCE",`(^|[^\\d])(\\d{1,${p}})(?:\\.(\\d{1,${p}}))?(?:\\.(\\d{1,${p}}))?(?:$|[^\\d])`),f("COERCERTL",h[v.COERCE],!0),f("LONETILDE","(?:~>?)"),f("TILDETRIM",`(\\s*)${h[v.LONETILDE]}\\s+`,!0),U.tildeTrimReplace="$1~",f("TILDE",`^${h[v.LONETILDE]}${h[v.XRANGEPLAIN]}$`),f("TILDELOOSE",`^${h[v.LONETILDE]}${h[v.XRANGEPLAINLOOSE]}$`),f("LONECARET","(?:\\^)"),f("CARETTRIM",`(\\s*)${h[v.LONECARET]}\\s+`,!0),U.caretTrimReplace="$1^",f("CARET",`^${h[v.LONECARET]}${h[v.XRANGEPLAIN]}$`),f("CARETLOOSE",`^${h[v.LONECARET]}${h[v.XRANGEPLAINLOOSE]}$`),f("COMPARATORLOOSE",`^${h[v.GTLT]}\\s*(${h[v.LOOSEPLAIN]})$|^$`),f("COMPARATOR",`^${h[v.GTLT]}\\s*(${h[v.FULLPLAIN]})$|^$`),f("COMPARATORTRIM",`(\\s*)${h[v.GTLT]}\\s*(${h[v.LOOSEPLAIN]}|${h[v.XRANGEPLAIN]})`,!0),U.comparatorTrimReplace="$1$2$3",f("HYPHENRANGE",`^\\s*(${h[v.XRANGEPLAIN]})\\s+-\\s+(${h[v.XRANGEPLAIN]})\\s*$`),f("HYPHENRANGELOOSE",`^\\s*(${h[v.XRANGEPLAINLOOSE]})\\s+-\\s+(${h[v.XRANGEPLAINLOOSE]})\\s*$`),f("STAR","(<|>)?=?\\s*\\*"),f("GTE0","^\\s*>=\\s*0.0.0\\s*$"),f("GTE0PRE","^\\s*>=\\s*0.0.0-0\\s*$")},1464:(ne,U,w)=>{"use strict";w.r(U),w.d(U,{NIL:()=>De,parse:()=>c,stringify:()=>u,v1:()=>j,v3:()=>ie,v4:()=>ae,v5:()=>Y,validate:()=>t,version:()=>be});var p,L=new Uint8Array(16);function D(){if(!p&&!(p="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return p(L)}const h=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,t=function v($){return"string"==typeof $&&h.test($)};for(var f=[],m=0;m<256;++m)f.push((m+256).toString(16).substr(1));const u=function _($){var X=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,z=(f[$[X+0]]+f[$[X+1]]+f[$[X+2]]+f[$[X+3]]+"-"+f[$[X+4]]+f[$[X+5]]+"-"+f[$[X+6]]+f[$[X+7]]+"-"+f[$[X+8]]+f[$[X+9]]+"-"+f[$[X+10]]+f[$[X+11]]+f[$[X+12]]+f[$[X+13]]+f[$[X+14]]+f[$[X+15]]).toLowerCase();if(!t(z))throw TypeError("Stringified UUID is invalid");return z};var P,B,I=0,R=0;const j=function J($,X,z){var K=X&&z||0,W=X||new Array(16),Q=($=$||{}).node||P,te=void 0!==$.clockseq?$.clockseq:B;if(null==Q||null==te){var re=$.random||($.rng||D)();null==Q&&(Q=P=[1|re[0],re[1],re[2],re[3],re[4],re[5]]),null==te&&(te=B=16383&(re[6]<<8|re[7]))}var ge=void 0!==$.msecs?$.msecs:Date.now(),Ce=void 0!==$.nsecs?$.nsecs:R+1,Te=ge-I+(Ce-R)/1e4;if(Te<0&&void 0===$.clockseq&&(te=te+1&16383),(Te<0||ge>I)&&void 0===$.nsecs&&(Ce=0),Ce>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");I=ge,R=Ce,B=te;var ke=(1e4*(268435455&(ge+=122192928e5))+Ce)%4294967296;W[K++]=ke>>>24&255,W[K++]=ke>>>16&255,W[K++]=ke>>>8&255,W[K++]=255&ke;var Ie=ge/4294967296*1e4&268435455;W[K++]=Ie>>>8&255,W[K++]=255&Ie,W[K++]=Ie>>>24&15|16,W[K++]=Ie>>>16&255,W[K++]=te>>>8|128,W[K++]=255&te;for(var Pe=0;Pe<6;++Pe)W[K+Pe]=Q[Pe];return X||u(W)},c=function g($){if(!t($))throw TypeError("Invalid UUID");var X,z=new Uint8Array(16);return z[0]=(X=parseInt($.slice(0,8),16))>>>24,z[1]=X>>>16&255,z[2]=X>>>8&255,z[3]=255&X,z[4]=(X=parseInt($.slice(9,13),16))>>>8,z[5]=255&X,z[6]=(X=parseInt($.slice(14,18),16))>>>8,z[7]=255&X,z[8]=(X=parseInt($.slice(19,23),16))>>>8,z[9]=255&X,z[10]=(X=parseInt($.slice(24,36),16))/1099511627776&255,z[11]=X/4294967296&255,z[12]=X>>>24&255,z[13]=X>>>16&255,z[14]=X>>>8&255,z[15]=255&X,z};function a($,X,z){function K(W,Q,te,re){if("string"==typeof W&&(W=function M($){$=unescape(encodeURIComponent($));for(var X=[],z=0;z<$.length;++z)X.push($.charCodeAt(z));return X}(W)),"string"==typeof Q&&(Q=c(Q)),16!==Q.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var ge=new Uint8Array(16+W.length);if(ge.set(Q),ge.set(W,Q.length),(ge=z(ge))[6]=15&ge[6]|X,ge[8]=63&ge[8]|128,te){re=re||0;for(var Ce=0;Ce<16;++Ce)te[re+Ce]=ge[Ce];return te}return u(ge)}try{K.name=$}catch(W){}return K.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",K.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",K}function C($){return 14+($+64>>>9<<4)+1}function r($,X){var z=(65535&$)+(65535&X);return($>>16)+(X>>16)+(z>>16)<<16|65535&z}function x($,X,z,K,W,Q){return r(function b($,X){return $<<X|$>>>32-X}(r(r(X,$),r(K,Q)),W),z)}function O($,X,z,K,W,Q,te){return x(X&z|~X&K,$,X,W,Q,te)}function S($,X,z,K,W,Q,te){return x(X&K|z&~K,$,X,W,Q,te)}function T($,X,z,K,W,Q,te){return x(X^z^K,$,X,W,Q,te)}function F($,X,z,K,W,Q,te){return x(z^(X|~K),$,X,W,Q,te)}const ie=a("v3",48,function d($){if("string"==typeof $){var X=unescape(encodeURIComponent($));$=new Uint8Array(X.length);for(var z=0;z<X.length;++z)$[z]=X.charCodeAt(z)}return function V($){for(var X=[],z=32*$.length,K="0123456789abcdef",W=0;W<z;W+=8){var Q=$[W>>5]>>>W%32&255,te=parseInt(K.charAt(Q>>>4&15)+K.charAt(15&Q),16);X.push(te)}return X}(function y($,X){$[X>>5]|=128<<X%32,$[C(X)-1]=X;for(var z=1732584193,K=-271733879,W=-1732584194,Q=271733878,te=0;te<$.length;te+=16){var re=z,ge=K,Ce=W,Te=Q;z=O(z,K,W,Q,$[te],7,-680876936),Q=O(Q,z,K,W,$[te+1],12,-389564586),W=O(W,Q,z,K,$[te+2],17,606105819),K=O(K,W,Q,z,$[te+3],22,-1044525330),z=O(z,K,W,Q,$[te+4],7,-176418897),Q=O(Q,z,K,W,$[te+5],12,1200080426),W=O(W,Q,z,K,$[te+6],17,-1473231341),K=O(K,W,Q,z,$[te+7],22,-45705983),z=O(z,K,W,Q,$[te+8],7,1770035416),Q=O(Q,z,K,W,$[te+9],12,-1958414417),W=O(W,Q,z,K,$[te+10],17,-42063),K=O(K,W,Q,z,$[te+11],22,-1990404162),z=O(z,K,W,Q,$[te+12],7,1804603682),Q=O(Q,z,K,W,$[te+13],12,-40341101),W=O(W,Q,z,K,$[te+14],17,-1502002290),z=S(z,K=O(K,W,Q,z,$[te+15],22,1236535329),W,Q,$[te+1],5,-165796510),Q=S(Q,z,K,W,$[te+6],9,-1069501632),W=S(W,Q,z,K,$[te+11],14,643717713),K=S(K,W,Q,z,$[te],20,-373897302),z=S(z,K,W,Q,$[te+5],5,-701558691),Q=S(Q,z,K,W,$[te+10],9,38016083),W=S(W,Q,z,K,$[te+15],14,-660478335),K=S(K,W,Q,z,$[te+4],20,-405537848),z=S(z,K,W,Q,$[te+9],5,568446438),Q=S(Q,z,K,W,$[te+14],9,-1019803690),W=S(W,Q,z,K,$[te+3],14,-187363961),K=S(K,W,Q,z,$[te+8],20,1163531501),z=S(z,K,W,Q,$[te+13],5,-1444681467),Q=S(Q,z,K,W,$[te+2],9,-51403784),W=S(W,Q,z,K,$[te+7],14,1735328473),z=T(z,K=S(K,W,Q,z,$[te+12],20,-1926607734),W,Q,$[te+5],4,-378558),Q=T(Q,z,K,W,$[te+8],11,-2022574463),W=T(W,Q,z,K,$[te+11],16,1839030562),K=T(K,W,Q,z,$[te+14],23,-35309556),z=T(z,K,W,Q,$[te+1],4,-1530992060),Q=T(Q,z,K,W,$[te+4],11,1272893353),W=T(W,Q,z,K,$[te+7],16,-155497632),K=T(K,W,Q,z,$[te+10],23,-1094730640),z=T(z,K,W,Q,$[te+13],4,681279174),Q=T(Q,z,K,W,$[te],11,-358537222),W=T(W,Q,z,K,$[te+3],16,-722521979),K=T(K,W,Q,z,$[te+6],23,76029189),z=T(z,K,W,Q,$[te+9],4,-640364487),Q=T(Q,z,K,W,$[te+12],11,-421815835),W=T(W,Q,z,K,$[te+15],16,530742520),z=F(z,K=T(K,W,Q,z,$[te+2],23,-995338651),W,Q,$[te],6,-198630844),Q=F(Q,z,K,W,$[te+7],10,1126891415),W=F(W,Q,z,K,$[te+14],15,-1416354905),K=F(K,W,Q,z,$[te+5],21,-57434055),z=F(z,K,W,Q,$[te+12],6,1700485571),Q=F(Q,z,K,W,$[te+3],10,-1894986606),W=F(W,Q,z,K,$[te+10],15,-1051523),K=F(K,W,Q,z,$[te+1],21,-2054922799),z=F(z,K,W,Q,$[te+8],6,1873313359),Q=F(Q,z,K,W,$[te+15],10,-30611744),W=F(W,Q,z,K,$[te+6],15,-1560198380),K=F(K,W,Q,z,$[te+13],21,1309151649),z=F(z,K,W,Q,$[te+4],6,-145523070),Q=F(Q,z,K,W,$[te+11],10,-1120210379),W=F(W,Q,z,K,$[te+2],15,718787259),K=F(K,W,Q,z,$[te+9],21,-343485551),z=r(z,re),K=r(K,ge),W=r(W,Ce),Q=r(Q,Te)}return[z,K,W,Q]}(function N($){if(0===$.length)return[];for(var X=8*$.length,z=new Uint32Array(C(X)),K=0;K<X;K+=8)z[K>>5]|=(255&$[K/8])<<K%32;return z}($),8*$.length))}),ae=function se($,X,z){var K=($=$||{}).random||($.rng||D)();if(K[6]=15&K[6]|64,K[8]=63&K[8]|128,X){z=z||0;for(var W=0;W<16;++W)X[z+W]=K[W];return X}return u(K)};function fe($,X,z,K){switch($){case 0:return X&z^~X&K;case 1:case 3:return X^z^K;case 2:return X&z^X&K^z&K}}function de($,X){return $<<X|$>>>32-X}const Y=a("v5",80,function le($){var X=[1518500249,1859775393,2400959708,3395469782],z=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof $){var K=unescape(encodeURIComponent($));$=[];for(var W=0;W<K.length;++W)$.push(K.charCodeAt(W))}else Array.isArray($)||($=Array.prototype.slice.call($));$.push(128);for(var te=Math.ceil(($.length/4+2)/16),re=new Array(te),ge=0;ge<te;++ge){for(var Ce=new Uint32Array(16),Te=0;Te<16;++Te)Ce[Te]=$[64*ge+4*Te]<<24|$[64*ge+4*Te+1]<<16|$[64*ge+4*Te+2]<<8|$[64*ge+4*Te+3];re[ge]=Ce}re[te-1][14]=8*($.length-1)/Math.pow(2,32),re[te-1][14]=Math.floor(re[te-1][14]),re[te-1][15]=8*($.length-1)&4294967295;for(var ke=0;ke<te;++ke){for(var Ie=new Uint32Array(80),Pe=0;Pe<16;++Pe)Ie[Pe]=re[ke][Pe];for(var Me=16;Me<80;++Me)Ie[Me]=de(Ie[Me-3]^Ie[Me-8]^Ie[Me-14]^Ie[Me-16],1);for(var ye=z[0],Se=z[1],ve=z[2],pe=z[3],Re=z[4],Be=0;Be<80;++Be){var Ye=Math.floor(Be/20),ot=de(ye,5)+fe(Ye,Se,ve,pe)+Re+X[Ye]+Ie[Be]>>>0;Re=pe,pe=ve,ve=de(Se,30)>>>0,Se=ye,ye=ot}z[0]=z[0]+ye>>>0,z[1]=z[1]+Se>>>0,z[2]=z[2]+ve>>>0,z[3]=z[3]+pe>>>0,z[4]=z[4]+Re>>>0}return[z[0]>>24&255,z[0]>>16&255,z[0]>>8&255,255&z[0],z[1]>>24&255,z[1]>>16&255,z[1]>>8&255,255&z[1],z[2]>>24&255,z[2]>>16&255,z[2]>>8&255,255&z[2],z[3]>>24&255,z[3]>>16&255,z[3]>>8&255,255&z[3],z[4]>>24&255,z[4]>>16&255,z[4]>>8&255,255&z[4]]}),De="00000000-0000-0000-0000-000000000000",be=function ue($){if(!t($))throw TypeError("Invalid UUID");return parseInt($.substr(14,1),16)}},2069:ne=>{function U(){}ne.exports=U,U.mixin=function(w){var p=w.prototype||w;p.isWildEmitter=!0,p.on=function(L,D,h){this.callbacks=this.callbacks||{};var v=3===arguments.length,t=v?arguments[1]:void 0,f=v?arguments[2]:arguments[1];return f._groupName=t,(this.callbacks[L]=this.callbacks[L]||[]).push(f),this},p.once=function(L,D,h){var v=this,t=3===arguments.length,f=t?arguments[1]:void 0,m=t?arguments[2]:arguments[1];function _(){v.off(L,_),m.apply(this,arguments)}return this.on(L,f,_),this},p.releaseGroup=function(L){var D,h,v,t;for(D in this.callbacks=this.callbacks||{},this.callbacks)for(h=0,v=(t=this.callbacks[D]).length;h<v;h++)t[h]._groupName===L&&(t.splice(h,1),h--,v--);return this},p.off=function(L,D){this.callbacks=this.callbacks||{};var v,h=this.callbacks[L];return h?1===arguments.length?(delete this.callbacks[L],this):(-1!==(v=h.indexOf(D))&&(h.splice(v,1),0===h.length&&delete this.callbacks[L]),this):this},p.emit=function(L){this.callbacks=this.callbacks||{};var t,f,_,D=[].slice.call(arguments,1),h=this.callbacks[L],v=this.getWildcardCallbacks(L);if(h)for(t=0,f=(_=h.slice()).length;t<f&&_[t];++t)_[t].apply(this,D);if(v)for(f=v.length,t=0,f=(_=v.slice()).length;t<f&&_[t];++t)_[t].apply(this,[L].concat(D));return this},p.getWildcardCallbacks=function(L){this.callbacks=this.callbacks||{};var D,h,v=[];for(D in this.callbacks)h=D.split("*"),("*"===D||2===h.length&&L.slice(0,h[0].length)===h[0])&&(v=v.concat(this.callbacks[D]));return v}},U.mixin(U)},940:function(ne,U,w){var p;!function(L){"use strict";function D(){}var h=D.prototype,v=L.EventEmitter;function t(_,u){for(var P=_.length;P--;)if(_[P].listener===u)return P;return-1}function f(_){return function(){return this[_].apply(this,arguments)}}function m(_){return"function"==typeof _||_ instanceof RegExp||!(!_||"object"!=typeof _)&&m(_.listener)}h.getListeners=function(u){var B,I,P=this._getEvents();if(u instanceof RegExp)for(I in B={},P)P.hasOwnProperty(I)&&u.test(I)&&(B[I]=P[I]);else B=P[u]||(P[u]=[]);return B},h.flattenListeners=function(u){var B,P=[];for(B=0;B<u.length;B+=1)P.push(u[B].listener);return P},h.getListenersAsObject=function(u){var B,P=this.getListeners(u);return P instanceof Array&&((B={})[u]=P),B||P},h.addListener=function(u,P){if(!m(P))throw new TypeError("listener must be a function");var R,B=this.getListenersAsObject(u),I="object"==typeof P;for(R in B)B.hasOwnProperty(R)&&-1===t(B[R],P)&&B[R].push(I?P:{listener:P,once:!1});return this},h.on=f("addListener"),h.addOnceListener=function(u,P){return this.addListener(u,{listener:P,once:!0})},h.once=f("addOnceListener"),h.defineEvent=function(u){return this.getListeners(u),this},h.defineEvents=function(u){for(var P=0;P<u.length;P+=1)this.defineEvent(u[P]);return this},h.removeListener=function(u,P){var I,R,B=this.getListenersAsObject(u);for(R in B)B.hasOwnProperty(R)&&-1!==(I=t(B[R],P))&&B[R].splice(I,1);return this},h.off=f("removeListener"),h.addListeners=function(u,P){return this.manipulateListeners(!1,u,P)},h.removeListeners=function(u,P){return this.manipulateListeners(!0,u,P)},h.manipulateListeners=function(u,P,B){var I,R,J=u?this.removeListener:this.addListener,j=u?this.removeListeners:this.addListeners;if("object"!=typeof P||P instanceof RegExp)for(I=B.length;I--;)J.call(this,P,B[I]);else for(I in P)P.hasOwnProperty(I)&&(R=P[I])&&("function"==typeof R?J.call(this,I,R):j.call(this,I,R));return this},h.removeEvent=function(u){var I,P=typeof u,B=this._getEvents();if("string"===P)delete B[u];else if(u instanceof RegExp)for(I in B)B.hasOwnProperty(I)&&u.test(I)&&delete B[I];else delete this._events;return this},h.removeAllListeners=f("removeEvent"),h.emitEvent=function(u,P){var I,R,J,j,B=this.getListenersAsObject(u);for(j in B)if(B.hasOwnProperty(j))for(I=B[j].slice(0),J=0;J<I.length;J++)!0===(R=I[J]).once&&this.removeListener(u,R.listener),R.listener.apply(this,P||[])===this._getOnceReturnValue()&&this.removeListener(u,R.listener);return this},h.trigger=f("emitEvent"),h.emit=function(u){var P=Array.prototype.slice.call(arguments,1);return this.emitEvent(u,P)},h.setOnceReturnValue=function(u){return this._onceReturnValue=u,this},h._getOnceReturnValue=function(){return!this.hasOwnProperty("_onceReturnValue")||this._onceReturnValue},h._getEvents=function(){return this._events||(this._events={})},D.noConflict=function(){return L.EventEmitter=v,D},void 0!==(p=function(){return D}.call(L,w,L,ne))&&(ne.exports=p)}("undefined"!=typeof window?window:this||{})},8808:ne=>{"use strict";ne.exports=JSON.parse('["stun.l.google.com:19302","stun1.l.google.com:19302","stun2.l.google.com:19302","stun3.l.google.com:19302","stun4.l.google.com:19302","stun.ekiga.net","stun.ideasip.com","stun.schlund.de","stun.stunprotocol.org:3478","stun.voiparound.com","stun.voipbuster.com","stun.voipstunt.com","stun.voxgratia.org"]')},4576:ne=>{"use strict";ne.exports=[]},5549:ne=>{"use strict";ne.exports=JSON.parse('{"author":"OpenVidu","dependencies":{"freeice":"2.2.2","hark":"1.2.3","jsnlog":"2.30.0","mime":"3.0.0","platform":"1.3.6","semver":"7.3.5","uuid":"8.3.2","wolfy87-eventemitter":"5.2.9","events":"3.3.0","inherits":"2.0.4"},"description":"OpenVidu Browser","devDependencies":{"@types/node":"17.0.8","@types/platform":"1.3.4","browserify":"17.0.0","grunt":"1.4.1","grunt-cli":"1.4.3","grunt-contrib-copy":"1.0.0","grunt-contrib-sass":"2.0.0","grunt-contrib-uglify":"5.0.1","grunt-contrib-watch":"1.1.0","grunt-postcss":"0.9.0","grunt-string-replace":"1.3.1","grunt-ts":"6.0.0-beta.22","terser":"5.10.0","tsify":"5.0.4","tslint":"6.1.3","typedoc":"0.22.10","typescript":"4.5.4"},"license":"Apache-2.0","main":"lib/index.js","name":"openvidu-browser","repository":{"type":"git","url":"git://github.com/OpenVidu/openvidu"},"scripts":{"browserify":"VERSION=${VERSION:-dev}; mkdir -p static/js/ && cd src && ../node_modules/browserify/bin/cmd.js Main.ts -p [ tsify ] --exclude kurento-browser-extensions --debug -o ../static/js/openvidu-browser-$VERSION.js -v","browserify-prod":"VERSION=${VERSION:-dev}; mkdir -p static/js/ && cd src && ../node_modules/browserify/bin/cmd.js --debug Main.ts -p [ tsify ] --exclude kurento-browser-extensions | ../node_modules/terser/bin/terser --source-map content=inline --output ../static/js/openvidu-browser-$VERSION.min.js","build":"cd src/OpenVidu && ./../../node_modules/typescript/bin/tsc && cd ../.. && ./node_modules/typescript/bin/tsc --declaration src/index.ts --outDir ./lib --sourceMap --target es5 --lib dom,es5,es2015.promise,scripthost && rm -rf ./ts4.4 && mkdir -p ./ts4.4/lib && cp -r ./lib ./ts4.4 && find ./ts4.4/lib -type f ! -iname \'*.d.ts\' -delete && ./config/replace_for_ts44.sh","docs":"./generate-docs.sh"},"types":"lib/index.d.ts","typesVersions":{"<4.4":{"*":["ts4.4/*"]}},"version":"2.22.0"}')}}]);