@phenixrts/sdk
Version:
JavaScript SDK
2 lines • 256 kB
JavaScript
/*! For license information please see full.js.LICENSE.txt */
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.phenix=t():e.phenix=t()}(self,()=>(()=>{var e={981:(e,t,n)=>{"use strict";n.d(t,{A:()=>f});var r=n(738),i=n.n(r),o=n(383),a=n.n(o),s=n(579),u=n.n(s),c=n(693),l=n.n(c),d=u()(function e(t,n,r){a()(this,e),l()(this,"onFulfilled",void 0),l()(this,"onRejected",void 0),l()(this,"promise",void 0),this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof n?n:null,this.promise=r}),h=function(){function e(t){if(a()(this,e),l()(this,"_state",void 0),l()(this,"_handled",void 0),l()(this,"_value",void 0),l()(this,"_deferreds",void 0),!(this instanceof e))throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=null,this._deferreds=[],this.doResolve(t)}return u()(e,[{key:"doResolve",value:function(e){var t=this,n=!1;try{e(function(e){n||(n=!0,t.promiseResolve(e))},function(e){n||(n=!0,t.promiseReject(e))})}catch(e){if(n)return;n=!0,this.promiseReject(e)}}},{key:"promiseResolve",value:function(t){var n=this;try{if(t===n)throw new TypeError("A Promise cannot be resolved with it self.");if(t&&("object"===i()(t)||"function"==typeof t)){var r=t.then;if(t instanceof e)return n._state=3,n._value=t,void n.finale();if("function"==typeof r)return void n.doResolve(function(){r.apply(t,arguments)})}n._state=1,n._value=t,n.finale()}catch(e){n.promiseReject(e)}}},{key:"promiseReject",value:function(e){this._state=2,this._value=e,this.finale()}},{key:"finale",value:function(){var t=this;2===this._state&&0===this._deferreds.length&&e._immediate(function(){t._handled||e._unhandledRejection(t._value)});for(var n=0,r=this._deferreds.length;n<r;n++)this.handle(this._deferreds[n]);this._deferreds=[]}},{key:"handle",value:function(t){for(var n=this;3===n._state;)n=n._value;0!==n._state?(n._handled=!0,e._immediate(function(){var e=1===n._state?t.onFulfilled:t.onRejected;if(null!==e){var r;try{r=e(n._value)}catch(e){return void t.promise.promiseReject(e)}t.promise.promiseResolve(r)}else 1===n._state?t.promise.promiseResolve(n._value):t.promise.promiseReject(n._value)})):n._deferreds.push(t)}}],[{key:"all",value:function(t){return new e(function(e,n){if(!Array.isArray(t))return n(new TypeError("Promise.all accepts an array"));var r=Array.prototype.slice.call(t);if(0===r.length)return e([]);for(var o=r.length,a=function(t,s){try{if(s&&("object"===i()(s)||"function"==typeof s)){var u=s.then;if("function"==typeof u)return void u.call(s,function(e){return a(t,e)},n)}r[t]=s,0===--o&&e(r)}catch(e){n(e)}},s=0;s<r.length;s++)a(s,r[s])})}},{key:"resolve",value:function(t){return t&&"object"===i()(t)&&t.constructor===e?t:new e(function(e){return e(t)})}},{key:"reject",value:function(t){return new e(function(e,n){return n(t)})}},{key:"race",value:function(t){return new e(function(n,r){if(!Array.isArray(t))return r(new TypeError("Promise.race accepts an array"));for(var i=0,o=t.length;i<o;i++)e.resolve(t[i]).then(n,r)})}},{key:"_immediate",value:function(e){window.setTimeout(e,0)}},{key:"_unhandledRejection",value:function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)}}])}();h.prototype.catch=function(e){return this.then(null,e)},h.prototype.then=function(e,t){var n=new h(function(){return null});return this.handle(new d(e,t,n)),n},h.prototype.finally=function(e){return this.then(function(t){return h.resolve(e()).then(function(){return t},function(){return null})},function(t){return h.resolve(e()).then(function(){return h.reject(t)},function(){return null})})};var f=h},512:e=>{"use strict";e.exports=function(e,t,n,r){var i=self||window;try{try{var o;try{o=new i.Blob([e])}catch(t){(o=new(i.BlobBuilder||i.WebKitBlobBuilder||i.MozBlobBuilder||i.MSBlobBuilder)).append(e),o=o.getBlob()}var a=i.URL||i.webkitURL,s=a.createObjectURL(o),u=new i[t](s,n);return a.revokeObjectURL(s),u}catch(r){return new i[t]("data:application/javascript,".concat(encodeURIComponent(e)),n)}}catch(e){if(!r)throw Error("Inline worker is not supported");return new i[t](r,n)}}},79:e=>{e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r},e.exports.__esModule=!0,e.exports.default=e.exports},987:e=>{e.exports=function(e){if(Array.isArray(e))return e},e.exports.__esModule=!0,e.exports.default=e.exports},901:(e,t,n)=>{var r=n(79);e.exports=function(e){if(Array.isArray(e))return r(e)},e.exports.__esModule=!0,e.exports.default=e.exports},475:e=>{e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.__esModule=!0,e.exports.default=e.exports},293:(e,t,n)=>{var r=n(981).A;function i(e,t,n,i,o,a,s){try{var u=e[a](s),c=u.value}catch(e){return void n(e)}u.done?t(c):r.resolve(c).then(i,o)}e.exports=function(e){return function(){var t=this,n=arguments;return new r(function(r,o){var a=e.apply(t,n);function s(e){i(a,r,o,s,u,"next",e)}function u(e){i(a,r,o,s,u,"throw",e)}s(void 0)})}},e.exports.__esModule=!0,e.exports.default=e.exports},383:e=>{e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},579:(e,t,n)=>{var r=n(736);function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,r(i.key),i)}}e.exports=function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports},693:(e,t,n)=>{var r=n(736);e.exports=function(e,t,n){return(t=r(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.__esModule=!0,e.exports.default=e.exports},72:e=>{function t(n){return e.exports=t=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},511:(e,t,n)=>{var r=n(636);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&r(e,t)},e.exports.__esModule=!0,e.exports.default=e.exports},291:e=>{e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.__esModule=!0,e.exports.default=e.exports},156:e=>{e.exports=function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],u=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);u=!0);}catch(e){c=!0,i=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}},e.exports.__esModule=!0,e.exports.default=e.exports},752:e=>{e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},869:e=>{e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},847:(e,t,n)=>{var r=n(893);e.exports=function(e,t){if(null==e)return{};var n,i,o=r(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],t.indexOf(n)>=0||{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o},e.exports.__esModule=!0,e.exports.default=e.exports},893:e=>{e.exports=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n},e.exports.__esModule=!0,e.exports.default=e.exports},452:(e,t,n)=>{var r=n(738).default,i=n(475);e.exports=function(e,t){if(t&&("object"==r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return i(e)},e.exports.__esModule=!0,e.exports.default=e.exports},636:e=>{function t(n,r){return e.exports=t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n,r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},715:(e,t,n)=>{var r=n(987),i=n(156),o=n(122),a=n(752);e.exports=function(e,t){return r(e)||i(e,t)||o(e,t)||a()},e.exports.__esModule=!0,e.exports.default=e.exports},132:(e,t,n)=>{var r=n(901),i=n(291),o=n(122),a=n(869);e.exports=function(e){return r(e)||i(e)||o(e)||a()},e.exports.__esModule=!0,e.exports.default=e.exports},45:(e,t,n)=>{var r=n(738).default;e.exports=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=r(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},736:(e,t,n)=>{var r=n(738).default,i=n(45);e.exports=function(e){var t=i(e,"string");return"symbol"==r(t)?t:t+""},e.exports.__esModule=!0,e.exports.default=e.exports},738:e=>{function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},122:(e,t,n)=>{var r=n(79);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{ChannelState:()=>Ne,Channels:()=>yn,PublisherState:()=>bn,Publishers:()=>jn,SDK:()=>Ve,default:()=>An});var e=n(383),t=n.n(e),i=n(579),o=n.n(i),a=n(693),s=n.n(a),u=n(132),c=n.n(u),l=n(452),d=n.n(l),h=n(72),f=n.n(h),p=n(511),v=n.n(p),m=function(){return o()(function e(n){t()(this,e),s()(this,"_disposed",void 0),s()(this,"_disposable",void 0),this._disposed=!1,this._disposable=n},[{key:"dispose",value:function(){if(!this._disposed)return this._disposed=!0,this._disposable.call(this)}}])}();function g(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(g=function(){return!!e})()}var y,_=function(e){function n(e,r){return t()(this,n),i=this,o=n,a=[function(){var t=e.indexOf(r);t>=0&&e.splice(t,1)}],o=f()(o),d()(i,g()?Reflect.construct(o,a||[],f()(i).constructor):o.apply(i,a));var i,o,a}return v()(n,e),o()(n)}(m),b=function(){return o()(function e(n){t()(this,e),s()(this,"_listeners",void 0),s()(this,"_value",void 0),this._listeners=[],this._value=n},[{key:"value",get:function(){return this._value},set:function(e){var t=this._value!==e;if(t&&e){var n=e;"function"==typeof n.equals&&(t=!n.equals(this._value))}if(t){this._value=e;for(var r=0,i=c()(this._listeners);r<i.length;r++)(0,i[r])(e)}}},{key:"subscribe",value:function(e){return this._listeners.push(e),e(this._value),new _(this._listeners,e)}}])}(),C=function(){return o()(function e(n){t()(this,e),s()(this,"_subject",void 0),this._subject=n},[{key:"value",get:function(){return this._subject.value}},{key:"subscribe",value:function(e){return this._subject.subscribe(e)}}])}(),k={document,location,navigator,window},S=function(){function e(n){t()(this,e),s()(this,"_document",void 0),s()(this,"_location",void 0),s()(this,"_navigator",void 0),s()(this,"_window",void 0),this._document=n.document,this._location=n.location,this._navigator=n.navigator,this._window=n.window}return o()(e,[{key:"FormData",get:function(){return this._window.FormData}},{key:"HTMLVideoElement",get:function(){return this._window.HTMLVideoElement}},{key:"MediaStream",get:function(){return this._window.MediaStream}},{key:"MediaStreamTrack",get:function(){return this._window.MediaStreamTrack}},{key:"MediaSource",get:function(){return this._window.MediaSource}},{key:"RTCPeerConnection",get:function(){return this._window.RTCPeerConnection}},{key:"RTCSessionDescription",get:function(){return this._window.RTCSessionDescription}},{key:"RTCIceCandidate",get:function(){return this._window.RTCIceCandidate}},{key:"URL",get:function(){return this._window.URL}},{key:"URLSearchParams",get:function(){return this._window.URLSearchParams}},{key:"addDocumentEventListener",get:function(){return this._document.addEventListener.bind(this._document)}},{key:"addWindowEventListener",get:function(){return this._window.addEventListener.bind(this._window)}},{key:"clearInterval",get:function(){return this._window.clearInterval.bind(this._window)}},{key:"clearTimeout",get:function(){return this._window.clearTimeout.bind(this._window)}},{key:"documentCreateElement",get:function(){return this._document.createElement.bind(this._document)}},{key:"documentHasFocus",get:function(){return this._document.hasFocus.bind(this._document)}},{key:"documentIsHidden",get:function(){return!!this._document.hidden}},{key:"documentQuerySelector",get:function(){return this._document.querySelector.bind(this._document)}},{key:"fetch",get:function(){return this._window.fetch.bind(this._window)}},{key:"locationHostname",get:function(){return this._location.hostname}},{key:"locationSearch",get:function(){return this._location.search}},{key:"navigatorConnection",get:function(){return this._navigator.connection}},{key:"navigatorIsOnLine",get:function(){return this._navigator.onLine}},{key:"pageLoadTime",get:function(){return this._window.__phenixPageLoadTime||this._window.__pageLoadTime}},{key:"queueMicrotask",get:function(){return this._window.queueMicrotask.bind(this._window)}},{key:"removeDocumentEventListener",get:function(){return this._document.removeEventListener.bind(this._document)}},{key:"removeWindowEventListener",get:function(){return this._window.removeEventListener.bind(this._window)}},{key:"setInterval",get:function(){return this._window.setInterval.bind(this._window)}},{key:"setTimeout",get:function(){return this._window.setTimeout.bind(this._window)}}],[{key:"setInstance",value:function(e){throw new Error("This build does not support setting the GlobalScope")}},{key:"getInstance",value:function(){return e._readOnlyInstance}},{key:"subscribe",value:function(t){return e._readOnlyInstance.subscribe(t)}}])}();y=S,s()(S,"_instance",new b(new y(k))),s()(S,"_readOnlyInstance",new C(y._instance));var w,T,x,P=S.getInstance(),E=function(){function e(){t()(this,e)}return o()(e,null,[{key:"browserNameAndVersion",get:function(){return e._browserNameAndVersion}},{key:"browserName",get:function(){return this._browserName}},{key:"browserMajorVersion",get:function(){return this._browserMajorVersion}},{key:"isAndroid",get:function(){return e._isAndroid}},{key:"isChrome69",get:function(){return e._isChrome69}},{key:"isChrome70",get:function(){return e._isChrome70}},{key:"isChrome71",get:function(){return e._isChrome71}},{key:"isChrome72",get:function(){return e._isChrome72}},{key:"isChrome74",get:function(){return e._isChrome74}},{key:"isChrome75",get:function(){return e._isChrome75}},{key:"isChrome76",get:function(){return e._isChrome76}},{key:"isChrome77",get:function(){return e._isChrome77}},{key:"isMobile",value:function(){return e._isMobile}},{key:"parseBrowserNameAndVersion",value:function(){if(!navigator||!navigator.userAgent)return"";var t=navigator.userAgent.match(e._browserNameAndVersionRegex);return t&&t[0]?t[0]:e.parseBrowserNameAndVersionForIE()}},{key:"parseBrowserName",value:function(){if(!e._browserNameAndVersion)return"";var t=e._browserNameAndVersion.split("/");return t&&t[0]?t[0]:""}},{key:"parseBrowserMajorVersion",value:function(){if(!e._browserNameAndVersion)return 0;var t=e._browserNameAndVersion.split("/");if(!t||!t[1])return 0;var n=t[1];return n&&Number(n.split(".")[0])||0}},{key:"parseBrowserNameAndVersionForIE",value:function(){if(!navigator||!navigator.userAgent)return"";var e=navigator.userAgent,t=e.indexOf("MSIE ");if(t>0)return"IE/".concat(parseInt(e.substring(t+5,e.indexOf(".",t)),10));if(e.indexOf("Trident/")>0){var n=e.indexOf("rv:");return"IE/".concat(parseInt(e.substring(n+3,e.indexOf(".",n)),10))}return""}}])}();w=E,s()(E,"_browserNameAndVersionRegex",/(MSIE|(?!Gecko.+)Firefox|(?!AppleWebKit.+Chrome.+)Safari|(?!AppleWebKit.+)Chrome|AppleWebKit(?!.+Chrome|.+Safari)|Gecko(?!.+Firefox))(?: |\/)([\d.apre]+)/g),s()(E,"_browserNameAndVersion",w.parseBrowserNameAndVersion()),s()(E,"_browserName",w.parseBrowserName()),s()(E,"_browserMajorVersion",w.parseBrowserMajorVersion()),s()(E,"_isMobile",/Android|iPhone|iPad|iPod|BlackBerry|Opera Mini/i.test(null===(T=navigator)||void 0===T?void 0:T.userAgent)),s()(E,"_isAndroid",/Android/i.test(null===(x=navigator)||void 0===x?void 0:x.userAgent)),s()(E,"_isChrome69",w._browserNameAndVersion.includes("Chrome/69.")),s()(E,"_isChrome70",w._browserNameAndVersion.includes("Chrome/70.")),s()(E,"_isChrome71",w._browserNameAndVersion.includes("Chrome/71.")),s()(E,"_isChrome72",w._browserNameAndVersion.includes("Chrome/72.")),s()(E,"_isChrome74",w._browserNameAndVersion.includes("Chrome/74.")),s()(E,"_isChrome75",w._browserNameAndVersion.includes("Chrome/75.")),s()(E,"_isChrome76",w._browserNameAndVersion.includes("Chrome/76.")),s()(E,"_isChrome77",w._browserNameAndVersion.includes("Chrome/77."));var O=function(){function e(){t()(this,e)}return o()(e,null,[{key:"clientOfferDisabled",get:function(){return E.isChrome74||E.isChrome75||E.isChrome76||E.isChrome77}},{key:"getTransceiversDisabled",get:function(){return e.addTranceiverDisabled}},{key:"addTranceiverDisabled",get:function(){return E.isChrome69||E.isChrome70||E.isChrome71||E.isChrome72}},{key:"getStatsPromiseBasedDisabled",get:function(){return"Chrome"===E.browserName&&E.browserMajorVersion<=66}},{key:"getCurrentOfferDisabled",get:function(){return"Chrome"===E.browserName&&E.browserMajorVersion<=69||"Firefox"===E.browserName&&E.browserMajorVersion<=56}},{key:"onTrackDisabled",get:function(){return"Chrome"===E.browserName&&E.browserMajorVersion<=63||"Firefox"===E.browserName&&E.browserMajorVersion<=52}},{key:"webkitRTCPeerConnectionEnabled",get:function(){return"Chrome"===E.browserName&&E.browserMajorVersion<=55}},{key:"promiseBasedPCMethodsDisabled",get:function(){return"Firefox"===E.browserName&&E.browserMajorVersion<=52}},{key:"shouldUseNativeHls",get:function(){return"Safari"===E.browserName||"SamsungBrowser"===E.browserName}},{key:"isPrecachingEnabled",get:function(){return"IE"!==E.browserName}},{key:"isForceChromeGarbageCollectionSupported",get:function(){var e;return"Chrome"===E.browserName&&"function"==typeof(null===(e=P.value)||void 0===e?void 0:e.documentCreateElement)}},{key:"isQueueMicrotaskSupported",get:function(){return"Chrome"===E.browserName&&E.browserMajorVersion>=71||"Firefox"===E.browserName&&E.browserMajorVersion>=69||"Safari"===E.browserName}},{key:"isMobile",get:function(){return E.isMobile()}},{key:"isInsertableStreamsSupported",get:function(){return!("undefined"==typeof MediaStreamTrackProcessor||"undefined"==typeof MediaStreamTrackGenerator)}},{key:"isEncodedInsertableStreamsSupported",get:function(){return"undefined"!=typeof RTCRtpReceiver&&void 0!==RTCRtpReceiver.prototype.createEncodedStreams}},{key:"isRTCRtpScriptTransformSupported",get:function(){return"undefined"!=typeof RTCRtpScriptTransform}},{key:"isRequestVideoFrameCallbackSupported",get:function(){var e;return void 0!==(null===(e=P.value)||void 0===e?void 0:e.HTMLVideoElement.prototype.requestVideoFrameCallback)}},{key:"isChannelFrameTimingInformationSupported",get:function(){return e.isRequestVideoFrameCallbackSupported&&(e.isEncodedInsertableStreamsSupported||e.isRTCRtpScriptTransformSupported)}},{key:"errorStackAlsoHasErrorMessage",get:function(){return"Firefox"!==E.browserName&&"Safari"!==E.browserName}}])}(),R=function(e){return e[e.All=-1]="All",e[e.Trace=10]="Trace",e[e.Debug=20]="Debug",e[e.Info=30]="Info",e[e.Warn=40]="Warn",e[e.Error=50]="Error",e[e.Fatal=60]="Fatal",e[e.Off=100]="Off",e}({}),F=function(){return o()(function e(n,r,i){t()(this,e),s()(this,"_category",void 0),s()(this,"_appenders",void 0),s()(this,"_threshold",void 0),this._category=n,this._appenders=r,this._threshold=i},[{key:"category",get:function(){return this._category}},{key:"appenders",get:function(){return this._appenders}},{key:"threshold",get:function(){return this._threshold}},{key:"trace",value:function(){if(this._threshold.value&&!(this._threshold.value>R.Trace)){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.log(R.Trace,t)}}},{key:"debug",value:function(){if(this._threshold.value&&!(this._threshold.value>R.Debug)){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.log(R.Debug,t)}}},{key:"info",value:function(){if(this._threshold.value&&!(this._threshold.value>R.Info)){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.log(R.Info,t)}}},{key:"warn",value:function(){if(this._threshold.value&&!(this._threshold.value>R.Warn)){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.log(R.Warn,t)}}},{key:"error",value:function(){if(this._threshold.value&&!(this._threshold.value>R.Error)){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.log(R.Error,t)}}},{key:"fatal",value:function(){if(this._threshold.value&&!(this._threshold.value>R.Fatal)){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.log(R.Fatal,t)}}},{key:"log",value:function(e,t){var n=this,r=new Date,i=this.replacePlaceholders(t);this._appenders.value.forEach(function(t){t.log(e,i,n.category,r)})}},{key:"replacePlaceholders",value:function(e){for(var t=this,n=e[0],r=0;n.indexOf&&e.length>1&&r>=0;)if((r=n.indexOf("%",r))>0)switch(n.substring(r+1,r+2)){case"%":n=n.substring(0,r)+n.substring(r+1),r++;break;case"s":case"d":e[0]=n=this.replaceArgument(this.toString(e[1]),n,r),e.splice(1,1);break;case"j":e[0]=n=this.replaceArgument(this.stringify(e[1]),n,r),e.splice(1,1);break;default:return e.toString()}return e.length>1&&(e=e.reduce(function(e,n,r,i){return r+1===i.length&&n instanceof Error?O.errorStackAlsoHasErrorMessage?e+"\n"+t.toString(n.stack):e+"\n"+t.toString(n.message)+"\n"+t.toString(n.stack):e+"[".concat(t.toString(n),"]")})),e.toString()}},{key:"stringify",value:function(e){var t=[];try{return JSON.stringify(e instanceof Error?this.toString(e):e,function(e,n){if(n&&n instanceof Object){if(t.includes(n))return"<recursive>";t.push(n)}return n},2)}catch(e){return"[object invalid JSON.stringify]"}}},{key:"replaceArgument",value:function(e,t,n){return t.substring(0,n)+this.toString(e)+t.substring(n+2)}},{key:"toString",value:function(e){if("string"==typeof e)return e;if("boolean"==typeof e)return e?"true":"false";if("number"==typeof e)return e.toString();var t="";if(e)if("function"==typeof e)t=e.toString();else if(e instanceof Object)try{t=e.toString()}catch(e){t="[object invalid toString()]"}return t}}])}(),I=function(){return o()(function e(){t()(this,e),s()(this,"_appenders",[])},[{key:"value",get:function(){return this._appenders}},{key:"add",value:function(e){this._appenders.push(e)}},{key:"remove",value:function(e){this._appenders=this._appenders.reduce(function(t,n){return n!==e&&t.push(n),t},[])}}])}(),L=function(){return o()(function e(){t()(this,e)},null,[{key:"sendLocalCandidates",get:function(){return this._sendLocalCandidates}},{key:"sendLogs",get:function(){return this._sendLogs}},{key:"sendMetrics",get:function(){return this._sendMetrics}},{key:"logToConsole",get:function(){return this._logToConsole}},{key:"applyFeatures",value:function(){try{var e={sendLocalCandidates:!1,sendLogs:"Off",sendMetrics:"Essential",logToConsole:"Off"};this._sendLocalCandidates=!("sendLocalCandidates"in e)||e.sendLocalCandidates,this._sendLogs="sendLogs"in e?e.sendLogs:"All",this._sendMetrics="sendMetrics"in e?e.sendMetrics:"All",this._logToConsole="logToConsole"in e?e.logToConsole:"All"}catch(e){this._sendLocalCandidates=!0,this._sendLogs="All",this._sendMetrics="All",this._logToConsole="All"}}}])}();s()(L,"_sendLocalCandidates",void 0),s()(L,"_sendLogs",void 0),s()(L,"_sendMetrics",void 0),s()(L,"_logToConsole",void 0),L.applyFeatures();var D=function(){return o()(function e(){t()(this,e)},null,[{key:"defaultLoggingLevel",get:function(){return R[L.sendLogs]}},{key:"defaultConsoleLoggingLevel",get:function(){return R[L.logToConsole]}},{key:"defaultTelemetryLoggingLevel",get:function(){return R.Info}}])}(),j=function(){return o()(function e(){t()(this,e),s()(this,"_threshold",D.defaultLoggingLevel)},[{key:"value",get:function(){return this._threshold}},{key:"setThreshold",value:function(e){this._threshold=e}}])}(),A=function(){return o()(function e(n){t()(this,e),s()(this,"_threshold",void 0),this._threshold=n},[{key:"log",value:function(e,t,n,r){if(!(e<this._threshold)){var i="".concat(r.toISOString()," [").concat(n,"] [").concat(R[e],"] ").concat(t);e<R.Warn?console.log(i):console.error(i)}}}])}(),M=n(293),V=n.n(M),B=function(){function e(){throw t()(this,e),new Error("Numbers is a static class that may not be instantiated")}return o()(e,null,[{key:"countNumberLength",value:function(t){var n=0,r=t;return r<0&&(r*=-1,n++),e.countDigitsBeforeDecimal(r)+n+(r!==Math.floor(r)?e.countDigitsAfterDecimal(r)+1:0)}},{key:"fixRounding",value:function(e,t){var n=Math.pow(10,t);return Math.round(e*n)/n}},{key:"countDigitsBeforeDecimal",value:function(e){for(var t=1,n=e;n>=10;)n/=10,t++;return t}},{key:"countDigitsAfterDecimal",value:function(t){for(var n=t,r=Math.floor(t),i=0;r!==n&&i<15;)i++,r=e.fixRounding(n,i);return i}}])}(),G=function(){return o()(function e(){t()(this,e)},null,[{key:"sdkVersion",get:function(){try{return"2025-08-14T15:38:21.184Z (2025.2.2)"}catch(e){return this._defaultVersion}}}])}();s()(G,"_defaultVersion",(new Date).toISOString());var U=n(981).A;function N(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function o(n,r,i,o){var u=r&&r.prototype instanceof s?r:s,c=Object.create(u.prototype);return z(c,"_invoke",function(n,r,i){var o,s,u,c=0,l=i||[],d=!1,h={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return o=t,s=0,u=e,h.n=n,a}};function f(n,r){for(s=n,u=r,t=0;!d&&c&&!i&&t<l.length;t++){var i,o=l[t],f=h.p,p=o[2];n>3?(i=p===r)&&(u=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=f&&((i=n<2&&f<o[1])?(s=0,h.v=r,h.n=o[1]):f<p&&(i=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,h.n=p,s=0))}if(i||n>1)return a;throw d=!0,r}return function(i,l,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===l&&f(l,p),s=l,u=p;(t=s<2?e:u)||!d;){o||(s?s<3?(s>1&&(h.n=-1),f(s,u)):h.n=u:h.v=u);try{if(c=2,o){if(s||(i="next"),t=o[i]){if(!(t=t.call(o,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(u=TypeError("The iterator does not provide a '"+i+"' method"),s=1);o=e}else if((t=(d=h.n<0)?u:n.call(r,h))!==a)break}catch(t){o=e,s=1,u=t}finally{c=1}}return{value:t,done:d}}}(n,i,o),!0),c}var a={};function s(){}function u(){}function c(){}t=Object.getPrototypeOf;var l=[][r]?t(t([][r]())):(z(t={},r,function(){return this}),t),d=c.prototype=s.prototype=Object.create(l);function h(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,z(e,i,"GeneratorFunction")),e.prototype=Object.create(d),e}return u.prototype=c,z(d,"constructor",c),z(c,"constructor",u),u.displayName="GeneratorFunction",z(c,i,"GeneratorFunction"),z(d),z(d,i,"Generator"),z(d,r,function(){return this}),z(d,"toString",function(){return"[object Generator]"}),(N=function(){return{w:o,m:h}})()}function z(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}z=function(e,t,n,r){function o(t,n){z(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},z(e,t,n,r)}var H=function(){return o()(function e(n){var r=this;t()(this,e),s()(this,"_telemetryConfiguration",void 0),s()(this,"_logs",[]),s()(this,"_isSending",!1),s()(this,"_domain",""),this._telemetryConfiguration=n,this.getLocationHostnameFromGlobalScope().then(function(e){r._domain=e})},[{key:"push",value:function(e,t,n,r){var i=(r.valueOf()-this._telemetryConfiguration.pageLoadTime)/1e3,o={timestamp:r.toISOString(),tenancy:this._telemetryConfiguration.tenancy,level:R[e],category:n,message:t,sessionId:this._telemetryConfiguration.sessionId,version:G.sdkVersion,environment:this._telemetryConfiguration.environment,fullQualifiedName:this._domain,runtime:i};e<R.Error?this._logs.push(o):this._logs.unshift(o),this.sendLogsIfAble()}},{key:"getLocationHostnameFromGlobalScope",value:function(){return new U(function(e){var t=P.subscribe(function(n){n&&(e(n.locationHostname),n.setTimeout(function(){return t.dispose()},0))})})}},{key:"sendLogs",value:(n=V()(N().m(function e(t){var n;return N().w(function(e){for(;;)switch(e.n){case 0:return(n=new P.value.FormData).append("jsonBody",JSON.stringify({records:t})),e.n=1,P.value.fetch(this._telemetryConfiguration.url,{method:"POST",body:n});case 1:return e.a(2,e.v)}},e,this)})),function(e){return n.apply(this,arguments)})},{key:"sendLogsIfAble",value:(e=V()(N().m(function e(){var t,n,r,i,o,a=this;return N().w(function(e){for(;;)switch(e.n){case 0:if(!(this._logs.length<=0||this._isSending)&&P.value){e.n=1;break}return e.a(2);case 1:for(t=0,n=0,this._isSending=!0,r=function(e){return"number"==typeof e?B.countNumberLength(e):e.length},i=function(e){return Object.values(e).reduce(function(e,t){return e+(t?r(t):0)},0)};this._logs.length>t&&i(this._logs[t])+n<8192;)n+=i(this._logs[t]),t++;return t||(this._logs[t].message=this._logs[t].message.substring(0,i(this._logs[t])+(8192-i(this._logs[t]))),t=1),o=this._logs.slice(0,t),this._logs=this._logs.slice(t),e.a(2,this.sendLogs(o).then(function(e){return a._isSending=!1,a.sendLogsIfAble(),e}).catch(function(){a._isSending=!1,a.sendLogsIfAble()}))}},e,this)})),function(){return e.apply(this,arguments)})}]);var e,n}(),W=function(){return o()(function e(n){t()(this,e),s()(this,"_telemetryService",void 0),s()(this,"_tenancy",void 0),s()(this,"_sessionId",void 0),s()(this,"_threshold",void 0),this._tenancy=n.tenancy,this._sessionId=n.sessionId,this._threshold=n.threshold,this._telemetryService=new H(n)},[{key:"log",value:function(e,t,n,r){e<this._threshold||this._telemetryService.push(e,t,n,r)}}])}(),q=function(){return o()(function e(){t()(this,e),s()(this,"_url","https://telemetry.phenixrts.com/telemetry/logs"),s()(this,"_tenancy","-"),s()(this,"_sessionId","-"),s()(this,"_environment","-"),s()(this,"_pageLoadTime",0),s()(this,"_threshold",D.defaultTelemetryLoggingLevel)},[{key:"url",get:function(){return this._url},set:function(e){var t=new P.value.URL(e);t.pathname=t.pathname+"/logs",this._url=t.toString()}},{key:"environment",get:function(){return this._environment},set:function(e){this._environment=e}},{key:"tenancy",get:function(){return this._tenancy},set:function(e){this._tenancy=e}},{key:"sessionId",get:function(){return this._sessionId},set:function(e){this._sessionId=e}},{key:"pageLoadTime",get:function(){return this._pageLoadTime},set:function(e){this._pageLoadTime=e}},{key:"threshold",get:function(){return this._threshold},set:function(e){this._threshold=e}}])}(),J=function(){return o()(function e(){t()(this,e)},null,[{key:"defaultTelemetryLevel",get:function(){return K[L.sendMetrics]}}])}(),K=function(e){return e[e.Off=100]="Off",e[e.Essential=10]="Essential",e[e.All=-1]="All",e}({}),Q=function(){return o()(function e(){t()(this,e),s()(this,"_url","https://telemetry.phenixrts.com/telemetry/metrics"),s()(this,"_tenancy","-"),s()(this,"_sessionId","-"),s()(this,"_environment","-"),s()(this,"_threshold",J.defaultTelemetryLevel)},[{key:"url",get:function(){return this._url},set:function(e){var t=new P.value.URL(e);t.pathname=t.pathname+"/metrics",this._url=t.toString()}},{key:"environment",get:function(){return this._environment},set:function(e){this._environment=e}},{key:"tenancy",get:function(){return this._tenancy},set:function(e){this._tenancy=e}},{key:"sessionId",get:function(){return this._sessionId},set:function(e){this._sessionId=e}},{key:"threshold",get:function(){return this._threshold},set:function(e){this._threshold=e}}])}(),Z=function(e){throw new Error("Unexpected value [".concat(e,"]. This should never be reached"))},$=function(){return o()(function e(){t()(this,e)},null,[{key:"convertTelemetryLevelToTelemetryLevelType",value:function(e){switch(e){case K.Off:return"Off";case K.Essential:return"Essential";case K.All:return"All";default:Z(e)}}},{key:"convertTelemetryLevelTypeToTelemetryLevel",value:function(e){switch(e){case"Off":return K.Off;case"Essential":return K.Essential;case"All":return K.All;default:Z(e)}}}])}(),X=function(){return o()(function e(){t()(this,e)},null,[{key:"convertLoggingLevelToLoggingLevelType",value:function(e){switch(e){case R.Off:return"Off";case R.Trace:return"Trace";case R.Debug:return"Debug";case R.Info:return"Trace";case R.Warn:return"Warn";case R.Error:return"Error";case R.Fatal:return"Fatal";case R.All:return"All";default:Z(e)}}},{key:"convertLoggingLevelTypeToLoggingLevel",value:function(e){switch(e){case"Off":return R.Off;case"Trace":return R.Trace;case"Debug":return R.Debug;case"Info":return R.Info;case"Warn":return R.Warn;case"Error":return R.Error;case"Fatal":return R.Fatal;case"All":return R.All;default:Z(e)}}}])}(),Y=function(){function e(){t()(this,e)}return o()(e,null,[{key:"getStringValue",value:function(t){return e.defaultStringValue[t]}},{key:"getBooleanValue",value:function(t){return e.defaultBooleanValue[t]}},{key:"defaultStringValue",get:function(){return{"phenix-metrics-level":$.convertTelemetryLevelToTelemetryLevelType(J.defaultTelemetryLevel),"phenix-logging-level":X.convertLoggingLevelToLoggingLevelType(D.defaultLoggingLevel),"phenix-console-logging-level":X.convertLoggingLevelToLoggingLevelType(D.defaultConsoleLoggingLevel),"phenix-telemetry-logging-level":X.convertLoggingLevelToLoggingLevelType(D.defaultTelemetryLoggingLevel),"phenix-channel-token":"","phenix-uri":"","phenix-base-uri":""}}},{key:"defaultBooleanValue",get:function(){return{"phenix-automatically-retry-on-failure":!0,"phenix-automatically-reconnect-peer-connection":!0,"phenix-force-garbage-collection-on-restart":!0,"phenix-skip-garbage-collection-on-mobile-devices":!0}}}])}(),ee=function(){function e(){throw t()(this,e),new Error("LoggerFactory is a static class that may not be instantiated")}return o()(e,null,[{key:"telemetryConfiguration",get:function(){return e._telemetryConfiguration}},{key:"getLogger",value:function(t){return"string"!=typeof t&&(t="SDK"),e._loggers[t]||(e._loggers[t]=new F(t,this._appenders,this._threshold))}},{key:"applyLoggerConfigFromParameterConfiguration",value:function(){e.applyLoggingLevel(),e.applyAppenderLoggingLevel("console",e.applyConsoleLogger.bind(this)),e.applyAppenderLoggingLevel("telemetry",e.applyTelemetryLogger.bind(this))}},{key:"applyLoggingLevel",value:function(){var e=Y.getStringValue("phenix-logging-level");R[e]&&this._threshold.setThreshold(R[e])}},{key:"applyAppenderLoggingLevel",value:function(e,t){var n=Y.getStringValue("phenix-".concat(e,"-logging-level"));"Off"!==n&&t(R[n])}},{key:"applyConsoleLogger",value:function(e){this._appenders.add(new A(e||D.defaultConsoleLoggingLevel))}},{key:"applyTelemetryLogger",value:function(e){this._telemetryConfiguration.threshold=e||D.defaultTelemetryLoggingLevel,this._appenders.add(new W(this._telemetryConfiguration))}}])}();s()(ee,"_loggers",{}),s()(ee,"_appenders",new I),s()(ee,"_threshold",new j),s()(ee,"_telemetryConfiguration",new q),ee.applyLoggerConfigFromParameterConfiguration();var te=function(){return o()(function e(){throw t()(this,e),new Error("Strings is a static class that may not be instantiated")},null,[{key:"random",value:function(e){var t=Math.ceil(e/13);return new Array(t).fill(function(){return Math.random().toString(16).substring(2,15)}).reduce(function(e,t){return e+t()},"").substring(0,e)}}])}(),ne=function(){return o()(function e(n){var r,i;t()(this,e),s()(this,"_applicationId",void 0),s()(this,"_token",void 0),this._applicationId=(null==n?void 0:n.applicationId)||"",this._token={uri:null!=n&&null!==(r=n.token)&&void 0!==r&&r.uri?new P.value.URL(n.token.uri):null,capabilities:(null==n||null===(i=n.token)||void 0===i?void 0:i.capabilities)||[]}},[{key:"uri",get:function(){return this._token.uri}},{key:"capabilities",get:function(){return this._token.capabilities}},{key:"tenancy",get:function(){return this._applicationId}}])}(),re=function(){function e(){t()(this,e)}return o()(e,null,[{key:"parseToken",value:function(t){if(!this.isEncodedEdgeTokenValid(t))return e._logger.error("Token is not valid [%s]",t),new ne(null);try{var n=atob(t.substr(7)),r=JSON.parse(n);return r.token=JSON.parse(r.token),new ne(r)}catch(t){return e._logger.error("Cannot parse token value",t),new ne(null)}}},{key:"isEncodedEdgeTokenValid",value:function(e){return!!e&&e.startsWith("DIGEST:")}}])}();s()(re,"_logger",ee.getLogger("EdgeAuthParser"));var ie=function(){return o()(function e(){t()(this,e),s()(this,"_list",[])},[{key:"add",value:function(e){this._list.push(e)}},{key:"dispose",value:function(){this._list.forEach(function(e){return e.dispose()}),this._list.length=0}},{key:"toString",value:function(){return"DisposableList[disposables=".concat(this._list.length,"]")}}])}(),oe="visibilitychange",ae=function(){return o()(function e(){t()(this,e),s()(this,"_disposables",new ie),s()(this,"_readOnlyIsForeground",void 0),s()(this,"_isForeground",void 0),s()(this,"_timeOfLastTabFocusChange",Date.now()),this._isForeground=new b(!0),this._readOnlyIsForeground=new C(this._isForeground),this.initialize()},[{key:"isForeground",get:function(){return this._readOnlyIsForeground}},{key:"getTimeSinceLastChange",value:function(){return Date.now()-this._timeOfLastTabFocusChange}},{key:"dispose",value:function(){this._disposables.dispose()}},{key:"initialize",value:function(){var e=this,t=function(){return e._isForeground.value=!P.value.documentIsHidden},n=!1;P.value.addDocumentEventListener(oe,t,n),this._disposables.add(new m(function(){return P.value.removeDocumentEventListener(oe,t,n)}))}}])}(),se=n(981).A;function ue(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function o(n,r,i,o){var u=r&&r.prototype instanceof s?r:s,c=Object.create(u.prototype);return ce(c,"_invoke",function(n,r,i){var o,s,u,c=0,l=i||[],d=!1,h={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return o=t,s=0,u=e,h.n=n,a}};function f(n,r){for(s=n,u=r,t=0;!d&&c&&!i&&t<l.length;t++){var i,o=l[t],f=h.p,p=o[2];n>3?(i=p===r)&&(u=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=f&&((i=n<2&&f<o[1])?(s=0,h.v=r,h.n=o[1]):f<p&&(i=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,h.n=p,s=0))}if(i||n>1)return a;throw d=!0,r}return function(i,l,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===l&&f(l,p),s=l,u=p;(t=s<2?e:u)||!d;){o||(s?s<3?(s>1&&(h.n=-1),f(s,u)):h.n=u:h.v=u);try{if(c=2,o){if(s||(i="next"),t=o[i]){if(!(t=t.call(o,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(u=TypeError("The iterator does not provide a '"+i+"' method"),s=1);o=e}else if((t=(d=h.n<0)?u:n.call(r,h))!==a)break}catch(t){o=e,s=1,u=t}finally{c=1}}return{value:t,done:d}}}(n,i,o),!0),c}var a={};function s(){}function u(){}function c(){}t=Object.getPrototypeOf;var l=[][r]?t(t([][r]())):(ce(t={},r,function(){return this}),t),d=c.prototype=s.prototype=Object.create(l);function h(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,ce(e,i,"GeneratorFunction")),e.prototype=Object.create(d),e}return u.prototype=c,ce(d,"constructor",c),ce(c,"constructor",u),u.displayName="GeneratorFunction",ce(c,i,"GeneratorFunction"),ce(d),ce(d,i,"Generator"),ce(d,r,function(){return this}),ce(d,"toString",function(){return"[object Generator]"}),(ue=function(){return{w:o,m:h}})()}function ce(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}ce=function(e,t,n,r){function o(t,n){ce(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},ce(e,t,n,r)}var le=function(){return o()(function e(n){t()(this,e),s()(this,"_logger",ee.getLogger("VanillaPeerConnection")),s()(this,"_peerConnection",void 0),O.webkitRTCPeerConnectionEnabled?this._peerConnection=new webkitRTCPeerConnection(n):this._peerConnection=new P.value.RTCPeerConnection(n)},[{key:"native",get:function(){return this._peerConnection}},{key:"currentLocalDescription",get:function(){var e;return(null===(e=this._peerConnection)||void 0===e?void 0:e.currentLocalDescription)||null}},{key:"currentRemoteDescription",get:function(){var e;return(null===(e=this._peerConnection)||void 0===e?void 0:e.currentRemoteDescription)||null}},{key:"connectionState",get:function(){var e;return(null===(e=this._peerConnection)||void 0===e?void 0:e.connectionState)||null}},{key:"iceConnectionState",get:function(){var e;return(null===(e=this._peerConnection)||void 0===e?void 0:e.iceConnectionState)||null}},{key:"supportsGetConfiguration",get:function(){var e;return"function"==typeof(null===(e=this._peerConnection)||void 0===e?void 0:e.getConfiguration)}},{key:"supportsSetConfiguration",get:function(){var e;return"function"==typeof(null===(e=this._peerConnection)||void 0===e?void 0:e.setConfiguration)}},{key:"supportsGetTransceivers",get:function(){var e;return!O.getTransceiversDisabled&&"function"==typeof(null===(e=this._peerConnection)||void 0===e?void 0:e.getTransceivers)}},{key:"supportsAddTransceiver",get:function(){var e;return!O.addTranceiverDisabled&&"function"==typeof(null===(e=this._peerConnection)||void 0===e?void 0:e.addTransceiver)}},{key:"createOffer",value:(i=V()(ue().m(function e(t){var n=this;return ue().w(function(e){for(;;)switch(e.n){case 0:if(this._peerConnection){e.n=1;break}throw new Error("No PeerConnection initialized");case 1:if(!O.promiseBasedPCMethodsDisabled){e.n=2;break}return e.a(2,new se(function(e,r){return n._peerConnection.createOffer(e,r,t)}));case 2:return e.a(2,this._peerConnection.createOffer(t))}},e,this)})),function(e){return i.apply(this,arguments)})},{key:"createAnswer",value:(r=V()(ue().m(function e(t){var n=this;return ue().w(function(e){for(;;)switch(e.n){case 0:if(this._peerConnection){e.n=1;break}throw new Error("No PeerConnection initialized");case 1:if(!O.promiseBasedPCMethodsDisabled){e.n=2;break}return e.a(2,new se(function(e,r){return n._peerConnection.createAnswer(e,r,t)}));case 2:return e.a(2,this._peerConnection.createAnswer(t))}},e,this)})),function(e){return r.apply(this,arguments)})},{key:"setLocalDescription",value:(n=V()(ue().m(function e(t){return ue().w(function(e){for(;;)switch(e.n){case 0:if(this._peerConnection){e.n=1;break}throw new Error("No PeerConnection initialized");case 1:return e.a(2,this._peerConnection.setLocalDescription(O.promiseBasedPCMethodsDisabled?new RTCSessionDescription(t):t))}},e,this)})),function(e){return n.apply(this,arguments)})},{key:"setRemoteDescription",value:(e=V()(ue().m(function e(t){var n;return ue().w(function(e){for(;;)switch(e.n){case 0:if(this._peerConnection){e.n=1;break}throw new Error("No PeerConnection initialized");case 1:return(null===(n=t.sdp)||void 0===n?void 0:n.match(/a=crypto:/i))&&this._logger.warn("SDP a=crypto is not supported"),e.a(2,this._peerConnection.setRemoteDescription(O.promiseBasedPCMethodsDisabled?new RTCSessionDescription(t):t))}},e,this)})),function(t){return e.apply(this,arguments)})},{key:"getSenders",value:function(){if(!this._peerConnection)throw new Error("No PeerConnection initialized");return this._peerConnection.getSenders()}},{key:"getReceivers",value:function(){if(!this._peerConnection)throw new Error("No PeerConnection initialized");return this._peerConnection.getReceivers()}},{key:"getStats",value:function(e){if(!this._peerConnection)throw new Error("No PeerConnection initialized");return this._peerConnection.getStats(e)}},{key:"getStatsLegacy",value:function(){var e=this;if(!this._peerConnection)throw new Error("No PeerConnection initialized");return new se(function(t){e._peerConnection.getStats(t)})}},{key:"addEventListener",value:function(e,t,n){if(!this._peerConnection)throw new Error("No PeerConnection initialized");this._peerConnection.addEventListener(e,t,n)}},{key:"removeEventListener",value:function(e,t,n){if(!this._peerConnection)throw new Error("No PeerConnection initialized");this._peerConnection.removeEventListener(e,t,n)}},{key:"getTransceivers",value:function(){if(!this._peerConnection)throw new Error("No PeerConnection initialized");return this._peerConnection.getTransceivers()}},{key:"addTransceiver",value:function(e,t){if(!this._peerConnection)throw new Error("No PeerConnection initialized");return this._peerConnection.addTransceiver(e,t)}},{key:"addStream",value:function(e){var t=this;e.getTracks().forEach(function(e){if(!t._peerConnection)throw new Error("No PeerConnection initialized");t._peerConnection.addTrack(e)})}},{key:"getConfiguration",value:function(){if(!this._peerConnection)throw new Error("No PeerConnection initialized");return this._peerConnection.getConfiguration()}},{key:"setConfiguration",value:function(e){if(!this._peerConnection)throw new Error("No PeerConnection initialized");this._peerConnection.setConfiguration(e)}},{key:"ontrack",get:function(){if(!this._peerConnection)throw new Error("No PeerConnection initialized");return this._peerConnection.ontrack},set:function(e){if(!this._peerConnection)throw new Error("No PeerConnection initialized");this._peerConnection.ontrack=e}},{key:"onicecandidate",get:function(){if(!this._peerConnection)throw new Error("No PeerConnection initialized");return this._peerConnection.onicecandidate},set:function(e){if(!this._peerConnection)throw new Error("No PeerConnection initialized");this._peerConnection.onicecandidate=e}},{key:"onconnectionstatechange",get:function(){if(!this._peerConnection)throw new Error("No PeerConnection initialized");return this._peerConnection.onconnectionstatechange},set:function(e){if(!this._peerConnection)throw new Error("No PeerConnection initialized");this._peerConnection.onconnectionstatechange=e}},{key:"oniceconnectionstatechange",get:function(){if(!this._peerConnection)throw new Error("No PeerConnection initialized");return this._peerConnection.oniceconnectionstatechange},set:function(e){if(!this._peerConnection)throw new Error("No PeerConnection initialized");this._peerConnection.oniceconnectionstatechange=e}},{key:"close",value:function(){var e;null===(e=this._peerConnection)||void 0===e||e.close()}},{key:"dispose",value:function(){this._peerConnection=null}}]);var e,n,r,i}(),de=n(981).A;function he(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function o(n,r,i,o){var u=r&&r.prototype instanceof s?r:s,c=Object.create(u.prototype);return fe(c,"_invoke",function(n,r,i){var o,s,u,c=0,l=i||[],d=!1,h={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return o=t,s=0,u=e,h.n=n,a}};function f(n,r){for(s=n,u=r,t=0;!d&&c&&!i&&t<l.length;t++){var i,o=l[t],f=h.p,p=o[2];n>3?(i=p===r)&&(u=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=f&&((i=n<2&&f<o[1])?(s=0,h.v=r,h.n=o[1]):f<p&&(i=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,h.n=p,s=0))}if(i||n>1)return a;throw d=!0,r}return function(i,l,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===l&&f(l,p),s=l,u=p;(t=s<2?e:u)||!d;){o||(s?s<3?(s>1&&(h.n=-1),f(s,u)):h.n=u:h.v=u);try{if(c=2,o){if(s||(i="next"),t=o[i]){if(!(t=t.call(o,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(u=TypeError("The iterator does not provide a '"+i+"' method"),s=1);o=e}else if((t=(d=h.n<0)?u:n.call(r,h))!==a)break}catch(t){o=e,s=1,u=t}finally{c=1}}return{value:t,done:d}}}(n,i,o),!0),c}var a={};function s(){}function u(){}function c(){}t=Object.getPrototypeOf;var l=[][r]?t(t([][r]())):(fe(t={},r,function(){return this}),t),d=c.prototype=s.prototype=Object.create(l);function h(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,fe(e,i,"GeneratorFunction")),e.prototype=Object.create(d),e}return u.prototype=c,fe(d,"constructor",c),fe(c,"constructor",u),u.displayName="GeneratorFunction",fe(c,i,"GeneratorFunction"),fe(d),fe(d,i,"Generator"),fe(d,r,function(){return this}),fe(d,"toString",function(){return"[object Generator]"}),(he=function(){return{w:o,m:h}})()}function fe(e,t,n,r){var