@citrixcloud/ucsdk
Version:
Citrix UCSDK for developing optimized WebRTC applications
113 lines (110 loc) • 418 kB
JavaScript
//===============================================
// By using these Developer Materials, you accept and agree to comply with
// the terms of the Cloud Software Group Developer Terms of Use found here
// (https://www.cloud.com/legal)
//===============================================
var $jscomp={scope:{},getGlobal:function(f){return"undefined"!=typeof window&&window===f?f:"undefined"!=typeof global?global:f}};$jscomp.global=$jscomp.getGlobal(this);$jscomp.initSymbol=function(){$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol);$jscomp.initSymbol=function(){}};$jscomp.symbolCounter_=0;$jscomp.Symbol=function(f){return"jscomp_symbol_"+f+$jscomp.symbolCounter_++};
$jscomp.initSymbolIterator=function(){$jscomp.initSymbol();$jscomp.global.Symbol.iterator||($jscomp.global.Symbol.iterator=$jscomp.global.Symbol("iterator"));$jscomp.initSymbolIterator=function(){}};$jscomp.makeIterator=function(f){$jscomp.initSymbolIterator();if(f[$jscomp.global.Symbol.iterator])return f[$jscomp.global.Symbol.iterator]();var k=0;return{next:function(){return k==f.length?{done:!0}:{done:!1,value:f[k++]}}}};
$jscomp.arrayFromIterator=function(f){for(var k,q=[];!(k=f.next()).done;)q.push(k.value);return q};$jscomp.arrayFromIterable=function(f){return f instanceof Array?f:$jscomp.arrayFromIterator($jscomp.makeIterator(f))};
$jscomp.inherits=function(f,k){function q(){}q.prototype=k.prototype;f.prototype=new q;f.prototype.constructor=f;for(var b in k)if($jscomp.global.Object.defineProperties){var a=$jscomp.global.Object.getOwnPropertyDescriptor(k,b);a&&$jscomp.global.Object.defineProperty(f,b,a)}else f[b]=k[b]};$jscomp.array=$jscomp.array||{};$jscomp.array.done_=function(){return{done:!0,value:void 0}};
$jscomp.array.arrayIterator_=function(f,k){f instanceof String&&(f=String(f));var q=0;$jscomp.initSymbol();$jscomp.initSymbolIterator();var b={},a=(b.next=function(){if(q<f.length){var b=q++;return{value:k(b,f[b]),done:!1}}a.next=$jscomp.array.done_;return $jscomp.array.done_()},b[Symbol.iterator]=function(){return a},b);return a};
$jscomp.array.findInternal_=function(f,k,q){f instanceof String&&(f=String(f));for(var b=f.length,a=0;a<b;a++){var d=f[a];if(k.call(q,d,a,f))return{i:a,v:d}}return{i:-1,v:void 0}};
$jscomp.array.from=function(f,k,q){k=void 0===k?function(a){return a}:k;var b=[];$jscomp.initSymbol();$jscomp.initSymbolIterator();if(f[Symbol.iterator]){$jscomp.initSymbol();$jscomp.initSymbolIterator();f=f[Symbol.iterator]();for(var a;!(a=f.next()).done;)b.push(k.call(q,a.value))}else{a=f.length;for(var d=0;d<a;d++)b.push(k.call(q,f[d]))}return b};$jscomp.array.of=function(f){for(var k=[],q=0;q<arguments.length;++q)k[q-0]=arguments[q];return $jscomp.array.from(k)};
$jscomp.array.entries=function(){return $jscomp.array.arrayIterator_(this,function(f,k){return[f,k]})};$jscomp.array.entries$install=function(){Array.prototype.entries||(Array.prototype.entries=$jscomp.array.entries)};$jscomp.array.keys=function(){return $jscomp.array.arrayIterator_(this,function(f){return f})};$jscomp.array.keys$install=function(){Array.prototype.keys||(Array.prototype.keys=$jscomp.array.keys)};$jscomp.array.values=function(){return $jscomp.array.arrayIterator_(this,function(f,k){return k})};
$jscomp.array.values$install=function(){Array.prototype.values||(Array.prototype.values=$jscomp.array.values)};$jscomp.array.copyWithin=function(f,k,q){var b=this.length;f=Number(f);k=Number(k);q=Number(null!=q?q:b);if(f<k)for(q=Math.min(q,b);k<q;)k in this?this[f++]=this[k++]:(delete this[f++],k++);else for(q=Math.min(q,b+k-f),f+=q-k;q>k;)--q in this?this[--f]=this[q]:delete this[f];return this};$jscomp.array.copyWithin$install=function(){Array.prototype.copyWithin||(Array.prototype.copyWithin=$jscomp.array.copyWithin)};
$jscomp.array.fill=function(f,k,q){null!=q&&f.length||(q=this.length||0);q=Number(q);for(k=Number((void 0===k?0:k)||0);k<q;k++)this[k]=f;return this};$jscomp.array.fill$install=function(){Array.prototype.fill||(Array.prototype.fill=$jscomp.array.fill)};$jscomp.array.find=function(f,k){return $jscomp.array.findInternal_(this,f,k).v};$jscomp.array.find$install=function(){Array.prototype.find||(Array.prototype.find=$jscomp.array.find)};
$jscomp.array.findIndex=function(f,k){return $jscomp.array.findInternal_(this,f,k).i};$jscomp.array.findIndex$install=function(){Array.prototype.findIndex||(Array.prototype.findIndex=$jscomp.array.findIndex)};$jscomp.Map=function(f){f=void 0===f?[]:f;this.data_={};this.head_=$jscomp.Map.createHead_();this.size=0;if(f){f=$jscomp.makeIterator(f);for(var k=f.next();!k.done;k=f.next())k=k.value,this.set(k[0],k[1])}};
$jscomp.Map.checkBrowserConformance_=function(){var f=$jscomp.global.Map;if(!f||!f.prototype.entries||!Object.seal)return!1;try{var k=Object.seal({x:4}),q=new f($jscomp.makeIterator([[k,"s"]]));if("s"!=q.get(k)||1!=q.size||q.get({x:4})||q.set({x:4},"t")!=q||2!=q.size)return!1;var b=q.entries(),a=b.next();if(a.done||a.value[0]!=k||"s"!=a.value[1])return!1;a=b.next();return a.done||4!=a.value[0].x||"t"!=a.value[1]||!b.next().done?!1:!0}catch(d){return!1}};
$jscomp.Map.createHead_=function(){var f={};return f.previous=f.next=f.head=f};$jscomp.Map.getId_=function(f){if(!(f instanceof Object))return String(f);$jscomp.Map.key_ in f||f instanceof Object&&Object.isExtensible&&Object.isExtensible(f)&&$jscomp.Map.defineProperty_(f,$jscomp.Map.key_,++$jscomp.Map.index_);return $jscomp.Map.key_ in f?f[$jscomp.Map.key_]:" "+f};
$jscomp.Map.prototype.set=function(f,k){var q=this.maybeGetEntry_(f),b=q.id,a=q.list,q=q.entry;a||(a=this.data_[b]=[]);q?q.value=k:(q={next:this.head_,previous:this.head_.previous,head:this.head_,key:f,value:k},a.push(q),this.head_.previous.next=q,this.head_.previous=q,this.size++);return this};
$jscomp.Map.prototype["delete"]=function(f){var k=this.maybeGetEntry_(f);f=k.id;var q=k.list,b=k.index;return(k=k.entry)&&q?(q.splice(b,1),q.length||delete this.data_[f],k.previous.next=k.next,k.next.previous=k.previous,k.head=null,this.size--,!0):!1};$jscomp.Map.prototype.clear=function(){this.data_={};this.head_=this.head_.previous=$jscomp.Map.createHead_();this.size=0};$jscomp.Map.prototype.has=function(f){return!!this.maybeGetEntry_(f).entry};
$jscomp.Map.prototype.get=function(f){return(f=this.maybeGetEntry_(f).entry)&&f.value};$jscomp.Map.prototype.maybeGetEntry_=function(f){var k=$jscomp.Map.getId_(f),q=this.data_[k];if(q)for(var b=0;b<q.length;b++){var a=q[b];if(f!==f&&a.key!==a.key||f===a.key)return{id:k,list:q,index:b,entry:a}}return{id:k,list:q,index:-1,entry:void 0}};$jscomp.Map.prototype.entries=function(){return this.iter_(function(f){return[f.key,f.value]})};$jscomp.Map.prototype.keys=function(){return this.iter_(function(f){return f.key})};
$jscomp.Map.prototype.values=function(){return this.iter_(function(f){return f.value})};$jscomp.Map.prototype.forEach=function(f,k){for(var q=$jscomp.makeIterator(this.entries()),b=q.next();!b.done;b=q.next())b=b.value,f.call(k,b[1],b[0],this)};
$jscomp.Map.prototype.iter_=function(f){var k=this,q=this.head_;$jscomp.initSymbol();$jscomp.initSymbolIterator();var b={};return b.next=function(){if(q){for(;q.head!=k.head_;)q=q.previous;for(;q.next!=q.head;)return q=q.next,{done:!1,value:f(q)};q=null}return{done:!0,value:void 0}},b[Symbol.iterator]=function(){return this},b};$jscomp.Map.index_=0;$jscomp.Map.defineProperty_=Object.defineProperty?function(f,k,q){Object.defineProperty(f,k,{value:String(q)})}:function(f,k,q){f[k]=String(q)};
$jscomp.Map.Entry_=function(){};$jscomp.Map.ASSUME_NO_NATIVE=!1;$jscomp.Map$install=function(){$jscomp.initSymbol();$jscomp.initSymbolIterator();!$jscomp.Map.ASSUME_NO_NATIVE&&$jscomp.Map.checkBrowserConformance_()?$jscomp.Map=$jscomp.global.Map:($jscomp.initSymbol(),$jscomp.initSymbolIterator(),$jscomp.Map.prototype[Symbol.iterator]=$jscomp.Map.prototype.entries,$jscomp.initSymbol(),$jscomp.Map.key_=Symbol("map-id-key"));$jscomp.Map$install=function(){}};$jscomp.math=$jscomp.math||{};
$jscomp.math.clz32=function(f){f=Number(f)>>>0;if(0===f)return 32;var k=0;0===(f&4294901760)&&(f<<=16,k+=16);0===(f&4278190080)&&(f<<=8,k+=8);0===(f&4026531840)&&(f<<=4,k+=4);0===(f&3221225472)&&(f<<=2,k+=2);0===(f&2147483648)&&k++;return k};$jscomp.math.imul=function(f,k){f=Number(f);k=Number(k);var q=f&65535,b=k&65535;return q*b+((f>>>16&65535)*b+q*(k>>>16&65535)<<16>>>0)|0};$jscomp.math.sign=function(f){f=Number(f);return 0===f||isNaN(f)?f:0<f?1:-1};
$jscomp.math.log10=function(f){return Math.log(f)/Math.LN10};$jscomp.math.log2=function(f){return Math.log(f)/Math.LN2};$jscomp.math.log1p=function(f){f=Number(f);if(.25>f&&-.25<f){for(var k=f,q=1,b=f,a=0,d=1;a!=b;)k*=f,d*=-1,b=(a=b)+d*k/++q;return b}return Math.log(1+f)};$jscomp.math.expm1=function(f){f=Number(f);if(.25>f&&-.25<f){for(var k=f,q=1,b=f,a=0;a!=b;)k*=f/++q,b=(a=b)+k;return b}return Math.exp(f)-1};$jscomp.math.cosh=function(f){f=Number(f);return(Math.exp(f)+Math.exp(-f))/2};
$jscomp.math.sinh=function(f){f=Number(f);return 0===f?f:(Math.exp(f)-Math.exp(-f))/2};$jscomp.math.tanh=function(f){f=Number(f);if(0===f)return f;var k=Math.exp(2*-Math.abs(f)),k=(1-k)/(1+k);return 0>f?-k:k};$jscomp.math.acosh=function(f){f=Number(f);return Math.log(f+Math.sqrt(f*f-1))};$jscomp.math.asinh=function(f){f=Number(f);if(0===f)return f;var k=Math.log(Math.abs(f)+Math.sqrt(f*f+1));return 0>f?-k:k};
$jscomp.math.atanh=function(f){f=Number(f);return($jscomp.math.log1p(f)-$jscomp.math.log1p(-f))/2};
$jscomp.math.hypot=function(f,k,q){for(var b=[],a=2;a<arguments.length;++a)b[a-2]=arguments[a];f=Number(f);k=Number(k);for(var d=Math.max(Math.abs(f),Math.abs(k)),V=$jscomp.makeIterator(b),a=V.next();!a.done;a=V.next())d=Math.max(d,Math.abs(a.value));if(1E100<d||1E-100>d){f/=d;k/=d;V=f*f+k*k;b=$jscomp.makeIterator(b);for(a=b.next();!a.done;a=b.next())a=a.value,a=Number(a)/d,V+=a*a;return Math.sqrt(V)*d}d=f*f+k*k;b=$jscomp.makeIterator(b);for(a=b.next();!a.done;a=b.next())a=a.value,a=Number(a),d+=
a*a;return Math.sqrt(d)};$jscomp.math.trunc=function(f){f=Number(f);if(isNaN(f)||Infinity===f||-Infinity===f||0===f)return f;var k=Math.floor(Math.abs(f));return 0>f?-k:k};$jscomp.math.cbrt=function(f){if(0===f)return f;f=Number(f);var k=Math.pow(Math.abs(f),1/3);return 0>f?-k:k};$jscomp.number=$jscomp.number||{};$jscomp.number.isFinite=function(f){return"number"!==typeof f?!1:!isNaN(f)&&Infinity!==f&&-Infinity!==f};
$jscomp.number.isInteger=function(f){return $jscomp.number.isFinite(f)?f===Math.floor(f):!1};$jscomp.number.isNaN=function(f){return"number"===typeof f&&isNaN(f)};$jscomp.number.isSafeInteger=function(f){return $jscomp.number.isInteger(f)&&Math.abs(f)<=$jscomp.number.MAX_SAFE_INTEGER};$jscomp.number.EPSILON=Math.pow(2,-52);$jscomp.number.MAX_SAFE_INTEGER=9007199254740991;$jscomp.number.MIN_SAFE_INTEGER=-9007199254740991;$jscomp.object=$jscomp.object||{};
$jscomp.object.assign=function(f,k){for(var q=[],b=1;b<arguments.length;++b)q[b-1]=arguments[b];q=$jscomp.makeIterator(q);for(b=q.next();!b.done;b=q.next())if(b=b.value)for(var a in b)Object.prototype.hasOwnProperty.call(b,a)&&(f[a]=b[a]);return f};$jscomp.object.is=function(f,k){return f===k?0!==f||1/f===1/k:f!==f&&k!==k};$jscomp.Set=function(f){f=void 0===f?[]:f;this.map_=new $jscomp.Map;if(f){f=$jscomp.makeIterator(f);for(var k=f.next();!k.done;k=f.next())this.add(k.value)}this.size=this.map_.size};
$jscomp.Set.checkBrowserConformance_=function(){var f=$jscomp.global.Set;if(!f||!f.prototype.entries||!Object.seal)return!1;var k=Object.seal({x:4}),f=new f($jscomp.makeIterator([k]));if(f.has(k)||1!=f.size||f.add(k)!=f||1!=f.size||f.add({x:4})!=f||2!=f.size)return!1;var f=f.entries(),q=f.next();if(q.done||q.value[0]!=k||q.value[1]!=k)return!1;q=f.next();return q.done||q.value[0]==k||4!=q.value[0].x||q.value[1]!=q.value[0]?!1:f.next().done};
$jscomp.Set.prototype.add=function(f){this.map_.set(f,f);this.size=this.map_.size;return this};$jscomp.Set.prototype["delete"]=function(f){f=this.map_["delete"](f);this.size=this.map_.size;return f};$jscomp.Set.prototype.clear=function(){this.map_.clear();this.size=0};$jscomp.Set.prototype.has=function(f){return this.map_.has(f)};$jscomp.Set.prototype.entries=function(){return this.map_.entries()};$jscomp.Set.prototype.values=function(){return this.map_.values()};
$jscomp.Set.prototype.forEach=function(f,k){var q=this;this.map_.forEach(function(b){return f.call(k,b,b,q)})};$jscomp.Set.ASSUME_NO_NATIVE=!1;$jscomp.Set$install=function(){!$jscomp.Set.ASSUME_NO_NATIVE&&$jscomp.Set.checkBrowserConformance_()?$jscomp.Set=$jscomp.global.Set:($jscomp.Map$install(),$jscomp.initSymbol(),$jscomp.initSymbolIterator(),$jscomp.Set.prototype[Symbol.iterator]=$jscomp.Set.prototype.values);$jscomp.Set$install=function(){}};$jscomp.string=$jscomp.string||{};
$jscomp.string.noRegExp_=function(f,k){if(f instanceof RegExp)throw new TypeError("First argument to String.prototype."+k+" must not be a regular expression");};
$jscomp.string.fromCodePoint=function(f){for(var k=[],q=0;q<arguments.length;++q)k[q-0]=arguments[q];for(var q="",k=$jscomp.makeIterator(k),b=k.next();!b.done;b=k.next()){b=b.value;b=+b;if(0>b||1114111<b||b!==Math.floor(b))throw new RangeError("invalid_code_point "+b);65535>=b?q+=String.fromCharCode(b):(b-=65536,q+=String.fromCharCode(b>>>10&1023|55296),q+=String.fromCharCode(b&1023|56320))}return q};
$jscomp.string.repeat=function(f){var k=this.toString();if(0>f||1342177279<f)throw new RangeError("Invalid count value");f|=0;for(var q="";f;)if(f&1&&(q+=k),f>>>=1)k+=k;return q};$jscomp.string.repeat$install=function(){String.prototype.repeat||(String.prototype.repeat=$jscomp.string.repeat)};
$jscomp.string.codePointAt=function(f){var k=this.toString(),q=k.length;f=Number(f)||0;if(0<=f&&f<q){f|=0;var b=k.charCodeAt(f);if(55296>b||56319<b||f+1===q)return b;f=k.charCodeAt(f+1);return 56320>f||57343<f?b:1024*(b-55296)+f+9216}};$jscomp.string.codePointAt$install=function(){String.prototype.codePointAt||(String.prototype.codePointAt=$jscomp.string.codePointAt)};
$jscomp.string.includes=function(f,k){k=void 0===k?0:k;$jscomp.string.noRegExp_(f,"includes");return-1!==this.toString().indexOf(f,k)};$jscomp.string.includes$install=function(){String.prototype.includes||(String.prototype.includes=$jscomp.string.includes)};
$jscomp.string.startsWith=function(f,k){k=void 0===k?0:k;$jscomp.string.noRegExp_(f,"startsWith");var q=this.toString();f+="";for(var b=q.length,a=f.length,d=Math.max(0,Math.min(k|0,q.length)),V=0;V<a&&d<b;)if(q[d++]!=f[V++])return!1;return V>=a};$jscomp.string.startsWith$install=function(){String.prototype.startsWith||(String.prototype.startsWith=$jscomp.string.startsWith)};
$jscomp.string.endsWith=function(f,k){$jscomp.string.noRegExp_(f,"endsWith");var q=this.toString();f+="";void 0===k&&(k=q.length);for(var b=Math.max(0,Math.min(k|0,q.length)),a=f.length;0<a&&0<b;)if(q[--b]!=f[--a])return!1;return 0>=a};$jscomp.string.endsWith$install=function(){String.prototype.endsWith||(String.prototype.endsWith=$jscomp.string.endsWith)};
(function(f,k){"object"===typeof exports&&"object"===typeof module?module.exports=k():"function"===typeof define&&define.amd?define([],k):"object"===typeof exports?exports.CitrixWebRTC=k():f.CitrixWebRTC=k()})(self,function(){return function(){function f(b){var a=q[b];if(void 0!==a)return a.exports;a=q[b]={exports:{}};k[b].call(a.exports,a,a.exports,f);return a.exports}var k={945:function(b,a,d){var f=this&&this.__extends||function(){var a=function(e,b){a=Object.setPrototypeOf||{__proto__:[]}instanceof
Array&&function(a,e){a.__proto__=e}||function(a,e){for(var c in e)e.hasOwnProperty(c)&&(a[c]=e[c])};return a(e,b)};return function(e,b){function d(){this.constructor=e}a(e,b);e.prototype=null===b?Object.create(b):(d.prototype=b.prototype,new d)}}();Object.defineProperty(a,"__esModule",{value:!0});a.AudioElement=void 0;var k=d(658),p=d(550),g=d(851),e=d(946),t;(function(a){a.Init="Init";a.PlayStarted="PlayStarted";a.PauseCalled="PauseCalled"})(t||(t={}));b=function(a){function b(){var e=a.call(this,
null,p.class_id_t.AudioElement,0,k.ProxyMode.Local)||this;e.sinkId_="";e.srcObject_=null;e.loop_=!1;e.notiState=t.Init;return e}f(b,a);b.prototype.setSinkId=function(a){var b=this;g.logger.info(this.user_friendly_id()+".setSinkId: set sinkId to "+a);return new Promise(function(h,c){b.waitUntilConnected("AudioElement.sinkId").then(function(){var c=b.remoteInvoke(!0,p.method_id_AudioElement_t.sinkId,a);e.getRedirector().getFeatureValue(p.FEATURE_ms_teams_pstn)||(b.sinkId_=a,h());return c}).then(function(){g.logger.info(b.user_friendly_id()+
".setSinkId: success! resolving...");b.sinkId_=a;h()})["catch"](function(a){a=b.logRemoteInvokeError(a,".sinkId setter: failed to connect!");c(a)})})};Object.defineProperty(b.prototype,"sinkId",{get:function(){return this.sinkId_},set:function(a){this.setSinkId(a)},enumerable:!1,configurable:!0});Object.defineProperty(b.prototype,"srcObject",{get:function(){return this.srcObject_},set:function(a){var e=this;g.logger.info(this.user_friendly_id()+".srcObject: set srcObject to "+JSON.stringify(a));a!==
this.srcObject_&&(this.srcObject_=a,this.waitUntilConnected("AudioElement.srcObject").then(function(){return a.syncBarrier()}).then(function(a){g.logger.info(e.user_friendly_id()+".srcObject: set srcObject to s "+JSON.stringify(a));return e.remoteInvoke(!0,p.method_id_AudioElement_t.srcObject,null!==a&&void 0!==a?a.id:"null")}).then(function(){g.logger.info(e.user_friendly_id()+".srcObject setter: remote success!")})["catch"](function(a){e.logRemoteInvokeError(a,".srcObject setter: failed to connect!")}))},
enumerable:!1,configurable:!0});Object.defineProperty(b.prototype,"src",{get:function(){return this.src_},set:function(a){var e=this;g.logger.info(this.user_friendly_id()+".src: set src to "+a);this.src_=a;this.waitUntilConnected("AudioElement.src").then(function(){e.remoteInvoke(!0,p.method_id_AudioElement_t.src,a)})["catch"](function(a){e.logRemoteInvokeError(a,".src setter: failed to connect!")})},enumerable:!1,configurable:!0});b.prototype.play=function(){var a=this;g.logger.info(this.user_friendly_id()+
".play() called.");this.toggleAudio(!0);return new Promise(function(e,b){a.waitUntilConnected("AudioElement.play").then(function(){return a.remoteInvoke(!1,p.method_id_AudioElement_t.play)}).then(function(){e()})["catch"](function(c){a.logRemoteInvokeError(c,".play: failed to connect!");b(c)})})};b.prototype.playEx=function(a,e,b){var c=this;g.logger.info(this.user_friendly_id()+".playEx() src:"+a+" sinkId:"+e+" loop:"+b);this.notiState=t.PlayStarted;this.waitUntilConnected("AudioElement.playEx").then(function(){var a=
[];e&&a.push(c.setSinkId(e));void 0!==b&&null!==b&&(c.loop_=b,a.push(c.remoteInvoke(!0,p.method_id_AudioElement_t.loop,b)));return Promise.all(a)}).then(function(){c.src_=a;return c.remoteInvoke(!0,p.method_id_AudioElement_t.src,a)}).then(function(){return c.play()}).then(function(){if(c.notiState==t.PauseCalled)return g.logger.info(c.user_friendly_id()+".playEx() run deferred pause"),c.doPauseAndDispose()}).then(function(){c.notiState=t.Init;g.logger.info(c.user_friendly_id()+".playEx() done")})["catch"](function(a){c.notiState=
t.Init;c.logRemoteInvokeError(a,".playEx() failed!")})};b.prototype.pause=function(){var a=this;g.logger.info(this.user_friendly_id()+".pause() called.");this.toggleAudio(!1);return new Promise(function(e,b){a.waitUntilConnected("AudioElement.pause").then(function(){return a.remoteInvoke(!1,p.method_id_AudioElement_t.pause)}).then(function(){e()})["catch"](function(c){a.logRemoteInvokeError(c,".pause: failed!");b()})})};b.prototype.doPauseAndDispose=function(){var a=this;g.logger.info(this.user_friendly_id()+
".doPauseAndDispose() called.");this.toggleAudio(!1);return new Promise(function(e,b){a.waitUntilConnected("AudioElement.doPauseAndDispose").then(function(){return a.remoteInvoke(!1,p.method_id_AudioElement_t.pause,[])}).then(function(){g.logger.info(a.user_friendly_id()+".doPauseAndDispose() resolving...");e();a.dispose()})["catch"](function(c){a.logRemoteInvokeError(c,".doPauseAndDispose: failed to connect!")})})};b.prototype.pauseAndDispose=function(){g.logger.info(this.user_friendly_id()+".pauseAndDispose() notiState: "+
this.notiState);this.notiState==t.PlayStarted?this.notiState=t.PauseCalled:this.doPauseAndDispose()};b.prototype.toggleAudio=function(a){this.srcObject_&&(g.logger.info(this.user_friendly_id()+".toggleAudio() toggle audio tracks:"+a),this.srcObject_.toggleAudio(a))};Object.defineProperty(b.prototype,"loop",{get:function(){return this.loop_},set:function(a){var e=this;g.logger.info(this.user_friendly_id()+".loop: set loop to "+a);this.loop_=a;this.waitUntilConnected("AudioElement.loop").then(function(){e.remoteInvoke(!0,
p.method_id_AudioElement_t.loop,a)})["catch"](function(a){e.logRemoteInvokeError(a,".loop setter: failed to connect!")})},enumerable:!1,configurable:!0});b.prototype.dispose=function(){g.logger.info(this.user_friendly_id()+".dispose()");this.src_=this.sinkId_="";this.srcObject_=null;this.loop_=!1;this.release()};return b}(k.ProxyObject);a.AudioElement=b},239:function(b,a,d){a.E=void 0;var f=d(945),k=d(851),p=function(){function a(){this.sinkId=void 0;this.src="";this.loop=void 0;this.element=null}
a.prototype.getSrc=function(){return this.src};a.prototype.setSinkId=function(a){this.sinkId=a};a.prototype.getLoop=function(){return!0===this.loop};a.prototype.setLoop=function(a){this.loop=a};a.prototype.play=function(a){this.element=new f.AudioElement;this.src=a;this.element.playEx(this.src,this.sinkId,this.loop)};a.prototype.pause=function(){this.element&&(this.element.pauseAndDispose(),this.element=null)};a.prototype.release=function(){this.element&&(this.element.dispose(),this.element=null)};
return a}();b=function(){function a(){this.audioIdMap=null;this.audioIdMap=new Map}a.prototype.getNotificationInfo=function(a){if(this.audioIdMap.has(a))return this.audioIdMap.get(a);var b=new p;this.audioIdMap.set(a,b);return b};a.prototype.playNotifyAudio=function(a,b){b&&(k.logger.info("AudioNotification.playNotifyAudio, Remote to Thin Client audioId:"+a+" src:"+b),this.getNotificationInfo(a).play(b))};a.prototype.pauseNotifyAudio=function(a,b){if(this.audioIdMap.has(a)){var d=this.audioIdMap.get(a);
b&&b!=d.getSrc()&&k.logger.warning("AudioNotification.pauseNotifyAudio warning: for audioId:"+a+", different param src:"+b+" from org src:"+d.getSrc());d.pause()}else k.logger.warning("AudioNotification.pauseNotifyAudio no audioId:"+a+" src:"+b)};a.prototype.setSinkId=function(a,b){if(null!=b&&b.startsWith("speaker:")){k.logger.info("AudioNotification.setSinkId before parsing audioId:"+a+" sinkId:"+b);var d=b.slice(8);k.logger.info("AudioNotification.setSinkId after parsing audioId:"+a+" speakersinkId:"+
d);b=d}this.getNotificationInfo(a).setSinkId(b)};a.prototype.getLoop=function(a){return this.getNotificationInfo(a).getLoop()};a.prototype.setLoop=function(a,b){this.getNotificationInfo(a).setLoop(b)};a.prototype.release=function(){this.audioIdMap.forEach(function(a,b,d){a.release()});this.audioIdMap.clear()};return a}();a.E=b},610:function(b,a,d){Object.defineProperty(a,"__esModule",{value:!0});a.deferred_action=void 0;var f=d(851);b=function(){function a(b,d,e){this.resolve=b;this.reject=d;this.name_=
e}Object.defineProperty(a.prototype,"name",{get:function(){return this.name_},enumerable:!1,configurable:!0});a.prototype.post=function(a){1==a?(f.logger.info('deferred_action.post(): resolving "'+this.name_+'"'),this.resolve()):(f.logger.info('deferred_action.post(): rejecting "'+this.name_+'"'),this.reject())};a.prototype.postWithResult=function(a,b){1==a?(f.logger.info('deferred_action.post(): resolving "'+this.name_+'"'),this.resolve(b)):(f.logger.info('deferred_action.post(): rejecting "'+this.name_+
'"'),this.reject())};a.prototype.postResolve=function(a){this.resolve(a)};a.prototype.postReject=function(a){void 0==a?this.reject():this.reject(a)};return a}();a.deferred_action=b},613:function(b,a,d){var f=this&&this.__extends||function(){var a=function(b,e){a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var e in b)b.hasOwnProperty(e)&&(a[e]=b[e])};return a(b,e)};return function(b,e){function d(){this.constructor=b}a(b,e);b.prototype=null===
e?Object.create(e):(d.prototype=e.prototype,new d)}}(),k=this&&this.__read||function(a,b){$jscomp.initSymbol();$jscomp.initSymbol();$jscomp.initSymbolIterator();var e="function"===typeof Symbol&&a[Symbol.iterator];if(!e)return a;var d=e.call(a),w,h=[],c;try{for(;(void 0===b||0<b--)&&!(w=d.next()).done;)h.push(w.value)}catch(u){c={error:u}}finally{try{w&&!w.done&&(e=d["return"])&&e.call(d)}finally{if(c)throw c.error;}}return h};Object.defineProperty(a,"__esModule",{value:!0});a.E911Service=void 0;
var p=d(550),g=d(658),e=d(851);b=function(a){function b(){var e=a.call(this,null,p.class_id_t.E911Service,0,g.ProxyMode.Local)||this;e.preE911Info_=null;return e}f(b,a);b.prototype.isSameInfo=function(a){if(null==this.preE911Info_&&null!=a||null!=this.preE911Info_&&null==a||this.preE911Info_.bssid!=a.bssid||this.preE911Info_.ipv4!=a.ipv4||this.preE911Info_.subnetLengthIpv4!=a.subnetLengthIpv4||this.preE911Info_.ipv6!=a.ipv6||this.preE911Info_.subnetLengthIpv6!=a.subnetLengthIpv6||this.preE911Info_.mac!=
a.mac||1E-4<=Math.abs(this.preE911Info_.latitude-a.latitude)||1E-4<=Math.abs(this.preE911Info_.longitude-a.longitude)||!Array.isArray(this.preE911Info_.e911)||!Array.isArray(a.e911)||this.preE911Info_.e911.length!=a.e911.length)return!1;for(var b=0;b<a.e911.length;b++)if(this.preE911Info_.e911[b].chassisId!=a.e911[b].chassisId||this.preE911Info_.e911[b].portId!=a.e911[b].portId)return!1;return!0};Object.defineProperty(b.prototype,"onupdate",{get:function(){return this.onupdate_},set:function(a){var b=
this;this.onupdate_=a;this.waitUntilConnected(this.user_friendly_id()+".onupdate").then(function(){var a=b.registerCallbacks(!1,b.isNullCallback(b.onupdate_),p.method_id_E911Service_t.onupdate);a.then(function(a){a=k(a.params);var c=a[0];a.slice(1);null!==b.preE911Info_&&b.isSameInfo(c)||(e.logger.info(b.user_friendly_id()+".onupdate",JSON.stringify(c)),b.onupdate_&&b.onupdate_(c),b.preE911Info_=c)});return b.remoteInvoke(!0,p.method_id_E911Service_t.onupdate,a.success)})["catch"](function(){return e.logger.error(b.user_friendly_id()+
".onupdate, could not set listener")})},enumerable:!1,configurable:!0});b.prototype.getE911Info=function(){var a=this;return new Promise(function(b,d){a.waitUntilConnected(a.user_friendly_id()+".getE911Info").then(function(){return a.remoteInvoke(!1,p.method_id_E911Service_t.getE911Info)}).then(function(d){e.logger.info(a.user_friendly_id()+".getE911Info",JSON.stringify(a.param0(d)));b(a.param0(d))})["catch"](function(){e.logger.error(a.user_friendly_id()+".getE911Info promise rejected");d()})})};
b.prototype.updateE911Info=function(){var a=this;this.getE911Info().then(function(b){return a.onupdate&&a.onupdate(b)})["catch"](function(){return e.logger.error("Fail to get e911 information!")})};return b}(g.ProxyObject);a.E911Service=b},9:function(b,a,d){var f=this&&this.__extends||function(){var a=function(b,e){a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,c){a.__proto__=c}||function(a,c){for(var b in c)c.hasOwnProperty(b)&&(a[b]=c[b])};return a(b,e)};return function(b,e){function d(){this.constructor=
b}a(b,e);b.prototype=null===e?Object.create(e):(d.prototype=e.prototype,new d)}}(),k=this&&this.__read||function(a,b){$jscomp.initSymbol();$jscomp.initSymbol();$jscomp.initSymbolIterator();var e="function"===typeof Symbol&&a[Symbol.iterator];if(!e)return a;var d=e.call(a),c,u=[],v;try{for(;(void 0===b||0<b--)&&!(c=d.next()).done;)u.push(c.value)}catch(z){v={error:z}}finally{try{c&&!c.done&&(e=d["return"])&&e.call(d)}finally{if(v)throw v.error;}}return u},p=this&&this.__values||function(a){$jscomp.initSymbol();
$jscomp.initSymbol();$jscomp.initSymbolIterator();var b="function"===typeof Symbol&&Symbol.iterator,e=b&&a[b],d=0;if(e)return e.call(a);if(a&&"number"===typeof a.length)return{next:function(){a&&d>=a.length&&(a=void 0);return{value:a&&a[d++],done:!a}}};throw new TypeError(b?"Object is not iterable.":"Symbol.iterator is not defined.");};Object.defineProperty(a,"__esModule",{value:!0});a.EngineControl=a.VersionType=void 0;var g=d(550),e=d(946),t=d(658),x=d(851);(function(a){a[a.Webrpc=0]="Webrpc";a[a.WebrtcCodecs=
1]="WebrtcCodecs";a[a.Receiver=2]="Receiver";a[a.Vda=3]="Vda";a[a.Endpoint=4]="Endpoint";a[a.TypeScript=5]="TypeScript";a[a.HdxRtcEngine=6]="HdxRtcEngine";a[a.Max=7]="Max"})(a.VersionType||(a.VersionType={}));b=function(a){function b(e){var d=a.call(this,null,g.class_id_t.EngineControl,0,t.ProxyMode.Local)||this;d.clientInfo_="";d.clientInfo_=e;return d}f(b,a);b.prototype.bind=function(){x.logger.info(this.user_friendly_id()+".bind() called.");this.reconstructor(null,g.class_id_t.EngineControl,0)};
b.prototype.syncBarrier=function(){var a=this;x.logger.info(this.user_friendly_id()+".syncBarrier() called.");return new Promise(function(b,c){a.syncBarrierDeep(b,c)&&a.waitUntilConnected("EngineControl.syncBarrier").then(function(){return Promise.all([a.remoteInvoke(!1,g.method_id_EngineControl_t.version,{major:0,minor:0,revision:0,build:0}),a.remoteInvoke(!1,g.method_id_EngineControl_t.feature_flags,[])])}).then(function(c){var b,d;c=k(c.map(function(c){return a.param0(c)}),2);a.version_=c[0];a.features_=
c[1];x.logger.info(a.user_friendly_id()+" features: "+JSON.stringify(a.features_));e.getRedirector().setFeatures(a.features_);a.remoteInvoke(!1,g.method_id_EngineControl_t.set_client_info,(a.clientInfo_||"Unknown")+"; vdiShim/"+g.HDXMS_VERSION,e.getRedirector().sessionClientId)["catch"](function(){return x.logger.error(a.user_friendly_id()+" could not set client info")});c=[];try{for(var h=p(a.features_),l=h.next();!l.done;l=h.next()){var C=l.value;"ms_teams_desktop_sharing"===C.name&&C.value?c.push(a.remoteInvoke(!1,
g.method_id_EngineControl_t.version_info,[])):"ms_teams_osinfo"===C.name&&C.value?c.push(a.remoteInvoke(!1,g.method_id_EngineControl_t.osinfo,{family:"",version:"",architecture:"",distro:"",edition:""})):"ms_teams_endpoint_id"===C.name&&C.value?c.push(a.remoteInvoke(!1,g.method_id_EngineControl_t.endpoint_id,{machine_id:"",user_id:""})):"ms_teams_hardware_info"===C.name&&C.value&&c.push(a.remoteInvoke(!1,g.method_id_EngineControl_t.hardware_info))}}catch(r){b={error:r}}finally{try{l&&!l.done&&(d=
h["return"])&&d.call(h)}finally{if(b)throw b.error;}}if(0<c.length)return Promise.all(c)}).then(function(c){var b,e;if(void 0===c)x.logger.info(a.user_friendly_id()+"release-1905 client.");else{x.logger.info(a.user_friendly_id()+"release-1906 or later client: received detailed client version list.");try{for(var d=p(c),l=d.next();!l.done;l=d.next()){var h=l.value;h.hdr.proc.iid==g.class_id_t.EngineControl&&h.hdr.proc.methodid==g.method_id_EngineControl_t.version_info?a.versions_=a.param0(h):h.hdr.proc.iid==
g.class_id_t.EngineControl&&h.hdr.proc.methodid==g.method_id_EngineControl_t.osinfo?a.osinfo_=a.param0(h):h.hdr.proc.iid==g.class_id_t.EngineControl&&h.hdr.proc.methodid==g.method_id_EngineControl_t.endpoint_id?a.endpointid_=a.param0(h):h.hdr.proc.iid==g.class_id_t.EngineControl&&h.hdr.proc.methodid==g.method_id_EngineControl_t.hardware_info&&(a.hardwareinfo_=a.param0(h))}}catch(r){b={error:r}}finally{try{l&&!l.done&&(e=d["return"])&&e.call(d)}finally{if(b)throw b.error;}}}a.syncBarrierResolve(a)})["catch"](function(c){c=
a.logRemoteInvokeError(c,"failure to retrieve version/feature related client info.");a.syncBarrierReject(c)})})};return b}(t.ProxyObject);a.EngineControl=b},368:function(b,a,d){var f=this&&this.__extends||function(){var a=function(c,b){a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,c){a.__proto__=c}||function(a,c){for(var b in c)c.hasOwnProperty(b)&&(a[b]=c[b])};return a(c,b)};return function(c,b){function e(){this.constructor=c}a(c,b);c.prototype=null===b?Object.create(b):(e.prototype=
b.prototype,new e)}}(),k=this&&this.__values||function(a){$jscomp.initSymbol();$jscomp.initSymbol();$jscomp.initSymbolIterator();var c="function"===typeof Symbol&&Symbol.iterator,b=c&&a[c],e=0;if(b)return b.call(a);if(a&&"number"===typeof a.length)return{next:function(){a&&e>=a.length&&(a=void 0);return{value:a&&a[e++],done:!a}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.");};Object.defineProperty(a,"__esModule",{value:!0});a.Frames=a.FrameTracker=void 0;var p=
d(851),g=d(946),e=d(121),t=d(679),x=function(){return function(a,c){this.handle=a;this.color=c}}(),m;(function(a){a[a.unknown=0]="unknown";a[a.capable=1]="capable";a[a.configured=2]="configured"})(m||(m={}));var n=function(a){function c(){var c=a.call(this)||this;c.name="overlay";c.color_clipping_=m.unknown;e.protocol_handler_manager.addProtocolHandler(c);return c}f(c,a);c.prototype.is_color_clipping_enabled=function(){return this.color_clipping_==m.configured};c.prototype.disable_color_clipping=
function(){this.color_clipping_=m.unknown;p.logger.info(this.user_friendly_id()+": disabled color clipping!")};c.prototype.init=function(a){};c.prototype.deinit=function(){this.clearRequests();this.clearCallbacks()};c.prototype.on_message=function(a){var c,b,e=this;p.logger.trace("HDXMS: Overlay <<< "+JSON.stringify(a));if("capabilities"==a.command){a=a.caps;try{for(var l=k(a),d=l.next();!d.done;d=l.next())"clipping"==d.value&&(this.color_clipping_=m.capable,p.logger.info(this.user_friendly_id()+
": agent is capable to do color clipping!"))}catch(r){c={error:r}}finally{try{d&&!d.done&&(b=l["return"])&&b.call(l)}finally{if(c)throw c.error;}}new Promise(function(a,c){e.processRequest(a,c);var b=[];e.color_clipping_==m.capable?(b.push("clipping"),p.logger.info(e.user_friendly_id()+": sending config request with clipping!")):p.logger.info(e.user_friendly_id()+": sending config request without clipping!");g.getRedirector().WSSendObject({v:"overlay",command:"configure",caps:b})})}else"clipping"==
a.command?(a=new x(a.windowHandle,a.color),(c=this.getCallback(a.handle))?c.resolve(a):p.logger.info("didn't find callback: ignore clipping event for windowHandle:"+a.handle)):(c=this.processResponse(),void 0!=c?(p.logger.info(this.user_friendly_id()+" msg:"+JSON.stringify(a)),1==a.status?"track_window"==a.command?c.resolve(a.windowId):"untrack_window"==a.command?c.resolve(a.windowHandle):"configure"==a.command?(this.color_clipping_==m.capable&&(this.color_clipping_=m.configured,p.logger.info(this.user_friendly_id()+
": color clipping is fully configured!")),c.resolve({})):c.reject({}):(0==a.status&&"configure"==a.command&&this.color_clipping_==m.capable&&(this.color_clipping_=m.unknown,p.logger.info(this.user_friendly_id()+": failed to configure color clipping, falling back to legacy clipping!")),p.logger.info(this.user_friendly_id()+"failure/unknown response for message: "+a.command),c.reject({}))):p.logger.info("spurious response for message: "+a.command))};c.prototype.registerWindowWithServiceLegacy=function(){var a=
this;return new Promise(function(c,b){var e=g.getRedirector();p.logger.info(a.user_friendly_id()+".registerWindowWithService: legacy case");var l=window.getWindowHandleAsHex.bind(window);if(void 0===l||null===l)p.logger.error(a.user_friendly_id()+".registerWindowWithService: getWindowHandle method is undefined or null"),b({});Promise.all([l(),e.startRedirection(!1,"registerWindowWithService")]).then(function(b){p.logger.info(a.user_friendly_id()+".registerWindowWithService: set window handle: "+b[0]);
e.WSSendObject({v:"overlay",command:"window",windowHandle:b[0]});c(b[0])})})};c.prototype.registerWindowWithService=function(a){var c=this;return new Promise(function(b,e){var l=g.getRedirector();p.logger.info(c.user_friendly_id()+".registerWindowWithService: new MW case");l.startRedirection(!1,"registerWindowWithService").then(function(){c.processRequest(b,e);l.WSSendObject({v:"overlay",command:"track_window",windowHandle:a})})})};c.prototype.unregisterWindowWithService=function(a){var c=this;p.logger.info(this.user_friendly_id()+
".unregisterWindowWithService(handle: "+a+")");return new Promise(function(b,e){void 0==a?e({}):(c.processRequest(b,e),g.getRedirector().WSSendObject({v:"overlay",command:"untrack_window",windowHandle:a}))})};c.prototype.replyClippingStatus=function(a,c,b){var e=this;p.logger.info(this.user_friendly_id()+".replyClippingStatus(handle: "+a+", color:"+c+", status:"+b+")");return new Promise(function(l,d){void 0==a?d():g.getRedirector().WSSendObject({v:"overlay",command:"clipping",windowHandle:a,color:c,
status:b}).then(function(){p.logger.info(e.user_friendly_id()+".replyClippingStatus(): status sent success!");l()})["catch"](function(){p.logger.info(e.user_friendly_id()+".replyClippingStatus(): status sent failure!");d()})})};return c}(e.protocol_base),w=function(){function a(c){var b=this;this.running_=!1;this.elements_=[];this.clipRects=new Set;this.legacy_=!1;this.videos_=[];this.connected_=!1;this.yClientAreaOffset_=this.xClientAreaOffset_=0;this.wheelEventHandler=function(a){setTimeout(function(){b.updateAll()},
10)};this.scrollEventHandler=function(a){b.updateAll()};this.keyupEventHandler=function(a){"Tab"!=a.code&&"ArrowUp"!=a.code&&"ArrowDown"!=a.code&&"ArrowLeft"!=a.code&&"ArrowRight"!=a.code&&"PageUp"!=a.code&&"PageDown"!=a.code&&"Home"!=a.code&&"End"!=a.code||b.updateAll()};this.resizeEventHandler=function(a){p.logger.info("onWindowResize... update video elements position");b.updateAll()};p.logger.info("FrameTracker.constructor: (handle: "+c+")");this.handle_=c;this.handle_||(this.legacy_=!0);this.connectToService();
this.observer_=new MutationObserver(function(a){b.updateAll()})}a.prototype.user_friendly_id=function(){return this.constructor.name};a.prototype.is_color_clipping_enabled=function(){return a.Protocol.is_color_clipping_enabled()};a.prototype.connectToService=function(){var c=this;(this.legacy_?a.Protocol.registerWindowWithServiceLegacy():a.Protocol.registerWindowWithService(this.handle_)).then(function(a){p.logger.info("FrameTracker: connected to service. (windowId="+a+")");c.connected_=!0;"number"==
typeof a?c.windowId_=a:"string"==typeof a&&(c.handle_=a);c.is_color_clipping_enabled()&&(c.oncolorclipping=function(){p.logger.debug("FrameTracker: .onclipping event received! handle_:"+c.handle_+" legacy_:"+c.legacy_)});c.videos_.forEach(function(a){a.sinkId=JSON.stringify(c.windowId_)});c.videos_=[]})["catch"](function(a){p.logger.error("registerWindowWithService failed! "+a)})};Object.defineProperty(a.prototype,"oncolorclipping",{set:function(c){var b=this;this.oncolorclipping_=c;a.Protocol.registerCallback(this.handle_).then(function(c){p.logger.info(b.user_friendly_id()+
".oncolorclipping_ callback received!");if(b.handle_==c.handle){if("FFFFFFFF"==c.color.toUpperCase()?(a.Protocol.disable_color_clipping(),p.logger.info(b.user_friendly_id()+".oncolorclipping_ replying with failure!"),a.Protocol.replyClippingStatus(c.handle,c.color,!1)):(b.color_="#"+c.color,b.elements_.forEach(function(a,c){a.target.style.backgroundColor=b.color_}),p.logger.info(b.user_friendly_id()+".oncolorclipping_ replying with success!"),a.Protocol.replyClippingStatus(c.handle,c.color,!0)),b.oncolorclipping_)b.oncolorclipping_()}else p.logger.warning(b.user_friendly_id()+
".oncolorclipping_ handle mismatch, replying with failure!"),a.Protocol.replyClippingStatus(c.handle,c.color,!1)})},enumerable:!1,configurable:!0});Object.defineProperty(a.prototype,"handle",{get:function(){return this.handle_},enumerable:!1,configurable:!0});a.prototype.getWindowFromElement=function(a){return a.ownerDocument.defaultView};a.prototype.rectanglesIntersect=function(a,b){return a.x<b.x+b.width&&a.x+a.width>b.x&&a.y<b.y+b.height&&a.y+a.height>b.y?!0:!1};a.prototype.intersectingRect=function(a,
b){var e=Math.max(a.left,b.left),d=Math.max(a.top,b.top);return new DOMRect(e,d,Math.min(a.right,b.right)-e,Math.min(a.bottom,b.bottom)-d)};a.prototype.pedigreeCount=function(a,b){for(var e=0,d=a.parentElement;null!=d&&d!=b;)e++,d=d.parentElement;return{isAncestor:null!=d,pedigree:e}};a.prototype.selectTopmost=function(a,b){var e=this.getBoundingClientRect(a),d=this.getBoundingClientRect(b),e=this.intersectingRect(e,d),d=a.ownerDocument.elementFromPoint(e.left+e.width/2,e.top+e.height/2);if(d==a)return a;
if(d==b)return b;e=this.pedigreeCount(a,d);d=this.pedigreeCount(b,d);if(e.isAncestor&&d.isAncestor){if(e.pedigree<d.pedigree)return a;if(d.pedigree<e.pedigree)return b}else{if(e.isAncestor)return a;if(d.isAncestor)return b}};a.prototype.checkOverlappingVideos=function(a){var b=this;if(this.is_color_clipping_enabled())p.logger.debug("color based clipping is active!");else{var e=this.getBoundingClientRect(a.target);a.overlaps.forEach(function(b){a.target.remoteVideoElement.removeClipRect(b.rect)});
a.overlaps=[];this.elements_.forEach(function(d){if(d!=a){var h=d.overlaps.map(function(a){return a.element}).indexOf(a.target);-1!=h&&(h=d.overlaps.splice(h,1)[0],d.target.remoteVideoElement.removeClipRect(h.rect));h=b.getBoundingClientRect(d.target);if(b.rectanglesIntersect(e,h)){var l=b.selectTopmost(a.target,d.target);l==a.target?(d.overlaps.push({element:a.target,rect:e}),d.target.remoteVideoElement.addClipRect(e)):l==d.target&&(a.overlaps.push({element:d.target,rect:h}),a.target.remoteVideoElement.addClipRect(h))}}})}};
a.prototype.updateAll=function(){var a=this;this.elements_.forEach(function(b){var e=a.getBoundingClientRect(b.target);if(void 0!==e){var d=b.clientRect;if(void 0===d||d.x!==e.x||d.y!==e.y||d.width!==e.width||d.height!==e.height)b.clientRect=e,b.callback(e),a.checkOverlappingVideos(b)}})};a.prototype.track=function(a,b){var e=this,d=this.getBoundingClientRect(a);p.logger.info("Track (handle: "+this.handle_+") element frame",a,JSON.stringify(d));this.elements_.push({target:a,clientRect:void 0,callback:b,
overlaps:[]});if(this.is_color_clipping_enabled())a.style.backgroundColor=this.color_,p.logger.info("color based clipping is active!");else try{p.logger.info("Initializing occlusion for new videoElement"),this.clipRects.forEach(function(b){e.applyOcclusion(a,JSON.parse(b))})}catch(h){p.logger.error("addOcclusionInit failed! "+h)}this.running_||(p.logger.info("Start FrameTracker observer..."),this.observer_.observe(a.ownerDocument.body,{attributes:!0,childList:!0,subtree:!0}),d=this.getWindowFromElement(a),
d.addEventListener("wheel",this.wheelEventHandler),d.addEventListener("scroll",this.scrollEventHandler),d.addEventListener("keyup",this.keyupEventHandler),d.addEventListener("resize",this.resizeEventHandler),this.running_=!0);this.updateAll()};a.prototype.untrack=function(a){p.logger.info("Untrack (handle: "+this.handle_+") element frame:"+a);var b=-1;this.elements_.forEach(function(e,d){e.target===a&&(b=d)});if(0<=b&&(this.elements_.splice(b,1),0===this.elements_.length)){p.logger.info("Stop FrameTracker observer...");
this.observer_.disconnect();var e=this.getWindowFromElement(a);e.removeEventListener("wheel",this.wheelEventHandler);e.removeEventListener("scroll",this.scrollEventHandler);e.removeEventListener("keyup",this.keyupEventHandler);e.removeEventListener("resize",this.resizeEventHandler);this.running_=!1}};a.prototype.applyOcclusion=function(a,b){if(this.is_color_clipping_enabled())p.logger.debug("color based clipping is active!");else{var e=this.getBoundingClientRect(a);this.rectanglesIntersect(b,e)&&
void 0!==a.remoteVideoElement&&a.remoteVideoElement.addClipRect(b)}};a.prototype.addOcclusion=function(a){var b=this;this.is_color_clipping_enabled()?p.logger.debug("color based clipping is active!"):(p.logger.info("Adding occlusion "+JSON.stringify(a)+"\nTracking '"+this.elements_.length+"' elements."),this.clipRects.add(JSON.stringify(a)),this.elements_.forEach(function(e){b.applyOcclusion(e.target,a)}))};a.prototype.removeOcclusion=function(a){this.is_color_clipping_enabled()?p.logger.debug("color based clipping is active!"):
(p.logger.info("Removing occlusion "+JSON.stringify(a)+"\nTracking '"+this.elements_.length+"' elements."),this.clipRects["delete"](JSON.stringify(a)),this.elements_.forEach(function(b){void 0!==b.target.remoteVideoElement&&b.target.remoteVideoElement.removeClipRect(a)}))};a.prototype.setClientAreaOffset=function(a,b){this.xClientAreaOffset_=a;this.yClientAreaOffset_=b};a.prototype.getBoundingClientRect=function(a){a=a.getBoundingClientRect();a.x+=this.xClientAreaOffset_;a.y+=this.yClientAreaOffset_;
return a};a.prototype.newVideoElement=function(c){var b=this;p.logger.info("FrameTracker.newVideoElement: (id: "+c.id+")");if(void 0!==c.remoteVideoElement)p.logger.warning("Video element is already configured!!!");else{c.id||(c.id="ctx-vid-"+a.videoElementIDs++);var e=new t.VideoElement(c.id,this.getWindowFromElement(c));e.style=c.style;this.connected_?(p.logger.info("FrameTracker.newVideoElement: initializing video element with sink id "+this.windowId_),e.sinkId=JSON.stringify(this.windowId_)):
(p.logger.info("FrameTracker.newVideoElement: video element awaiting stable window state"),this.videos_.push(e));e.onloadedmetadata=function(){c.dispatchEvent(new Event("loadedmetadata"))};e.ontimeupdate=function(){c.dispatchEvent(new Event("timeupdate"))};e.onconnectionstatechange=function(){"connected"==e.connectionState?b.track(c,function(a){e.setFrame(a)}):b.untrack(c)};delete c.remoteVideoElement;Object.defineProperty(c,"remoteVideoElement",{writable:!0,configurable:!0,value:null});c.remoteVideoElement=
e;delete c.srcObject;Object.defineProperty(c,"srcObject",{configurable:!0,get:function(){return e.srcObject},set:function(a){p.logger.info("VDI Shim set video element srcObject "+a);e.srcObject=a}});delete c.videoWidth;Object.defineProperty(c,"videoWidth",{configurable:!0,get:function(){return e.videoWidth}});delete c.videoHeight;Object.defineProperty(c,"videoHeight",{configurable:!0,get:function(){return e.videoHeight}})}};a.prototype.disposeVideoElement=function(a){p.logger.info("FrameTracker.disposeVideoElement: (id: "+
a.id+")");var b=a.remoteVideoElement;if(void 0!=b){var e=this.videos_.findIndex(function(a){return a.Id==b.Id});-1<e&&this.videos_.splice(e,1);b.dispose();a.remoteVideoElement=void 0}};a.videoElementIDs=0;a.Protocol=new n;return a}();a.FrameTracker=w;b=function(){function a(c){this.frames_=[];c&&this.frames_.push(new w(void 0))}a.prototype.newFrame=function(a){p.logger.info("Frames.newFrame: (handle: "+a+")");var b=this.findFrame(a);void 0==b&&(b=new w(a),this.frames_.push(b));return b};a.prototype.disposeFrame=
function(a){p.logger.info("Frames.disposeFrame: (handle: "+a+")");var b=this.frames_.findIndex(function(b){return b.handle==a});-1<b&&(w.Protocol.unregisterWindowWithService(a).then(function(a){p.logger.info("Untrack window (handle: "+a+") successful")}),this.frames_.splice(b,1))};a.prototype.findFrame=function(a){p.logger.debug("Frames.findFrame: (handle: "+a+")");return void 0!=a?this.frames_.find(function(b){return b.handle==a}):this.frames_[0]};a.prototype.reconnect=function(){p.logger.info("Frames.reconnect()");
this.frames_.forEach(function(a){a.connectToService()})};return a}();a.Frames=b},247:function(b,a){var d=this&&this.__values||function(a){$jscomp.initSymbol();$jscomp.initSymbol();$jscomp.initSymbolIterator();var b="function"===typeof Symbol&&Symbol.iterator,d=b&&a[b],x=0;if(d)return d.call(a);if(a&&"number"===typeof a.length)return{next:function(){a&&x>=a.length&&(a=void 0);return{value:a&&a[x++],done:!a}}};throw new TypeError(b?"Object is not iterable.":"Symbol.iterator is not defined.");};Object.defineProperty(a,
"__esModule",{value:!0});a.getGC=a.GC=void 0;var f=function(){function a(b){this.parent_=this.object_=null;this.children_=[];this.object_=b}a.prototype.addChild=function(a){a.parent_!=this&&(a.parent_=this,this.children_.push(a))};a.prototype.removeChild=function(a){var b=this.children_.indexOf(a);this.children_.splice(b,1);a.parent_=null};return a}(),k=function(){function a(){this.root_=new f(null)}a.prototype.trackObject=function(a,b){void 0===b&&(b=null);if(null===this.findNode(a,this.root_)){var d=
this.findNode(b,this.root_),g=new f(a);d?d.addChild(g):this.root_.addChild(g)}};a.prototype.releaseObject=function(a){a=this.findNode(a,this.root_);if(null===a||a===this.root_)return!1;this.destroyNodeObjectRecurse(a);a.parent_.removeChild(a);return!0};a.prototype.destroyNodeObjectRecurse=function(a){var b,g;try{for(var m=d(a.children_),n=m.next();!n.done;n=m.next())this.destroyNodeObjectRecurse(n.value)}catch(w){b={error:w}}finally{try{n&&!n.done&&(g=m["return"])&&g.call(m)}finally{if(b)throw b.error;
}}a.object_.destroy()};a.prototype.setParent=function(a,b){var d=this.findNode(a,this.root_);if(null===d)return!1;var g=this.findNode(b,this.root_);if(null===g)return!1;if(d.parent_===g)return!0;d.parent_.removeChild(d);g.addChild(d);return!0};a.prototype.reset=function(){this.root_.children_=[]};a.prototype.findNode=function(a,b){var g,m;if(b.object_===a)return b;var n=null;try{for(var w=d(b.children_),h=w.next();!h.done&&(n=this.findNode(a,h.value),null===n);h=w.next());}catch(c){g={error:c}}finally{try{h&&
!h.done&&(m=w["return"])&&m.call(w)}finally{if(g)throw g.error;}}return n};return a}();a.GC=k;var p=new k;a.getGC=function(){return p}},946:function(b,a,d){var f=this&&this.__extends||function(){var a=function(b,c){a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])};return a(b,c)};return function(b,c){function e(){this.constructor=b}a(b,c);b.prototype=null===c?Object.create(c):(e.prototype=c.prototype,
new e)}}(),k=this&&this.__values||function(a){$jscomp.initSymbol();$jscomp.initSymbol();$jscomp.initSymbolIterator();var b="function"===typeof Symbol&&Symbol.iterator,c=b&&a[b],e=0;if(c)return c.call(a);if(a&&"number"===typeof a.length)return{next:function(){a&&e>=a.length&&(a=void 0);return{value:a&&a[e++],done:!a}}};throw new TypeError(b?"Object is not iterabl