@phenixrts/sdk 2023.0.2 → 2023.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/dist/debug/channels.js +1 -1
  2. package/dist/debug/full.js +1 -1
  3. package/dist/debug/groups.js +1 -1
  4. package/dist/debug/messaging.js +1 -1
  5. package/dist/debug/publish.js +3 -3
  6. package/dist/debug.private/channels.js +1 -1
  7. package/dist/debug.private/full.js +1 -1
  8. package/dist/debug.private/groups.js +1 -1
  9. package/dist/debug.private/messaging.js +1 -1
  10. package/dist/debug.private/publish.js +3 -3
  11. package/dist/es5.debug.private/channels.js +1 -1
  12. package/dist/es5.debug.private/full.js +1 -1
  13. package/dist/es5.debug.private/groups.js +1 -1
  14. package/dist/es5.debug.private/messaging.js +1 -1
  15. package/dist/es5.debug.private/publish.js +3 -3
  16. package/dist/legacy.debug/channels.js +1 -1
  17. package/dist/legacy.debug/full.js +1 -1
  18. package/dist/legacy.debug/groups.js +1 -1
  19. package/dist/legacy.debug/messaging.js +1 -1
  20. package/dist/legacy.debug/publish.js +3 -3
  21. package/dist/legacy.debug.private/channels.js +1 -1
  22. package/dist/legacy.debug.private/full.js +1 -1
  23. package/dist/legacy.debug.private/groups.js +1 -1
  24. package/dist/legacy.debug.private/messaging.js +1 -1
  25. package/dist/legacy.debug.private/publish.js +3 -3
  26. package/dist/legacy.min/channels.js +1 -1
  27. package/dist/legacy.min/full.js +1 -1
  28. package/dist/legacy.min/groups.js +1 -1
  29. package/dist/legacy.min/messaging.js +1 -1
  30. package/dist/legacy.min/publish.js +1 -1
  31. package/dist/legacy.min/publish.js.map +1 -1
  32. package/dist/min/channels.js +1 -1
  33. package/dist/min/full.js +1 -1
  34. package/dist/min/groups.js +1 -1
  35. package/dist/min/messaging.js +1 -1
  36. package/dist/min/publish.js +1 -1
  37. package/dist/min/publish.js.map +1 -1
  38. package/dist/min.private/channels.js +1 -1
  39. package/dist/min.private/full.js +1 -1
  40. package/dist/min.private/groups.js +1 -1
  41. package/dist/min.private/messaging.js +1 -1
  42. package/dist/min.private/publish.js +1 -1
  43. package/dist/min.private/publish.js.map +1 -1
  44. package/examples/src/channel-viewer-native-peer-connection-access.html +13 -0
  45. package/examples/src/channel-viewer-native-peer-connection-access.js +57 -0
  46. package/examples/src/user-media-publisher-change-video-track.html +27 -0
  47. package/examples/src/user-media-publisher-change-video-track.js +122 -0
  48. package/package.json +1 -1
@@ -1,3 +1,3 @@
1
1
  /*! For license information please see channels.js.LICENSE.txt */
2
- !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,(function(){return function(){var e={7228:function(e){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},e.exports.__esModule=!0,e.exports.default=e.exports},2858:function(e){e.exports=function(e){if(Array.isArray(e))return e},e.exports.__esModule=!0,e.exports.default=e.exports},3646:function(e,t,n){var r=n(7228);e.exports=function(e){if(Array.isArray(e))return r(e)},e.exports.__esModule=!0,e.exports.default=e.exports},1506:function(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},8926:function(e,t,n){var r=n(202).default;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},4575:function(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},3913:function(e,t,n){var r=n(3696);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},9713:function(e,t,n){var r=n(3696);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},9754:function(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},2205:function(e,t,n){var r=n(9489);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},6860:function(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},3884:function(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},521:function(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},8206:function(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},8585:function(e,t,n){var r=n(8).default,i=n(1506);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},9591:function(e,t,n){var r=n(202).default,i=n(8).default;function o(){"use strict";e.exports=o=function(){return t},e.exports.__esModule=!0,e.exports.default=e.exports;var t={},n=Object.prototype,a=n.hasOwnProperty,s=Object.defineProperty||function(e,t,n){e[t]=n.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",l=u.asyncIterator||"@@asyncIterator",h=u.toStringTag||"@@toStringTag";function d(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{d({},"")}catch(e){d=function(e,t,n){return e[t]=n}}function f(e,t,n,r){var i=t&&t.prototype instanceof g?t:g,o=Object.create(i.prototype),a=new P(r||[]);return s(o,"_invoke",{value:k(e,n,a)}),o}function p(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=f;var v={};function g(){}function m(){}function y(){}var _={};d(_,c,(function(){return this}));var b=Object.getPrototypeOf,w=b&&b(b(O([])));w&&w!==n&&a.call(w,c)&&(_=w);var x=y.prototype=g.prototype=Object.create(_);function C(e){["next","throw","return"].forEach((function(t){d(e,t,(function(e){return this._invoke(t,e)}))}))}function S(e,t){function n(r,o,s,u){var c=p(e[r],e,o);if("throw"!==c.type){var l=c.arg,h=l.value;return h&&"object"==i(h)&&a.call(h,"__await")?t.resolve(h.__await).then((function(e){n("next",e,s,u)}),(function(e){n("throw",e,s,u)})):t.resolve(h).then((function(e){l.value=e,s(l)}),(function(e){return n("throw",e,s,u)}))}u(c.arg)}var r;s(this,"_invoke",{value:function(e,i){function o(){return new t((function(t,r){n(e,i,t,r)}))}return r=r?r.then(o,o):o()}})}function k(e,t,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return{value:void 0,done:!0}}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=T(a,n);if(s){if(s===v)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=p(e,t,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===v)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}function T(e,t){var n=t.method,r=e.iterator[n];if(void 0===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,T(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=p(r,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,v;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,v):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,v)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function L(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function O(e){if(e){var t=e[c];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,r=function t(){for(;++n<e.length;)if(a.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return r.next=r}}return{next:R}}function R(){return{value:void 0,done:!0}}return m.prototype=y,s(x,"constructor",{value:y,configurable:!0}),s(y,"constructor",{value:m,configurable:!0}),m.displayName=d(y,h,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,d(e,h,"GeneratorFunction")),e.prototype=Object.create(x),e},t.awrap=function(e){return{__await:e}},C(S.prototype),d(S.prototype,l,(function(){return this})),t.AsyncIterator=S,t.async=function(e,n,i,o,a){void 0===a&&(a=r);var s=new S(f(e,n,i,o),a);return t.isGeneratorFunction(n)?s:s.next().then((function(e){return e.done?e.value:s.next()}))},C(x),d(x,h,"Generator"),d(x,c,(function(){return this})),d(x,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=O,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(L),!e)for(var t in this)"t"===t.charAt(0)&&a.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(n,r){return o.type="throw",o.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r],o=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&a.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),L(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;L(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:O(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),v}},t}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},9489:function(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},3038:function(e,t,n){var r=n(2858),i=n(3884),o=n(379),a=n(521);e.exports=function(e,t){return r(e)||i(e,t)||o(e,t)||a()},e.exports.__esModule=!0,e.exports.default=e.exports},319:function(e,t,n){var r=n(3646),i=n(6860),o=n(379),a=n(8206);e.exports=function(e){return r(e)||i(e)||o(e)||a()},e.exports.__esModule=!0,e.exports.default=e.exports},8868:function(e,t,n){var r=n(8).default;e.exports=function(e,t){if("object"!==r(e)||null===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},3696:function(e,t,n){var r=n(8).default,i=n(8868);e.exports=function(e){var t=i(e,"string");return"symbol"===r(t)?t:String(t)},e.exports.__esModule=!0,e.exports.default=e.exports},8:function(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},379:function(e,t,n){var r=n(7228);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.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},7757:function(e,t,n){var r=n(9591)();e.exports=r;try{regeneratorRuntime=r}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}},6406:function(e,t,n){"use strict";n.d(t,{Z:function(){return v}}),n(3843),n(3710),n(2564);var r=n(8),i=n.n(r),o=n(4575),a=n.n(o),s=n(3913),u=n.n(s),c=n(9713),l=n.n(c),h=n(6330),d=n(7426),f=n(841),p=n(2493),v=function(){function e(){a()(this,e),l()(this,"_disposables",new p.Z),l()(this,"_readOnlyIsForeground",void 0),l()(this,"_isForeground",void 0),l()(this,"_timeOfLastTabFocusChange",Date.now()),l()(this,"_documentFocusInterval",void 0),this._isForeground=new d.Z(!0),this._readOnlyIsForeground=new f.Z(this._isForeground),this.detectTabFocusChange()}return u()(e,[{key:"isForeground",get:function(){return this._readOnlyIsForeground}},{key:"getTimeSinceLastChange",value:function(){return Date.now()-this._timeOfLastTabFocusChange}},{key:"dispose",value:function(){this._disposables.dispose()}},{key:"detectTabFocusChange",value:function(){var e,t,n=this;if("object"===("undefined"==typeof document?"undefined":i()(document))){void 0!==document.msHidden?(e="msHidden",t="msvisibilitychange"):void 0!==document.webkitHidden?(e="webkitHidden",t="webkitvisibilitychange"):void 0!==document.hidden&&(e="hidden",t="visibilitychange");var r=function(){var t=!document[e];n.setFocusState(t)};void 0!==document.addEventListener&&void 0!==document[e]?(document.addEventListener(t,r,!1),this._disposables.add(new h.Z((function(){document.removeEventListener(t,r,!1)})))):this.listenForDocumentFocus.call(this)}}},{key:"listenForDocumentFocus",value:function(){var e=this;this._documentFocusInterval=window.setInterval((function(){var t=document.hasFocus();e.setFocusState(t)}),3e3),this._disposables.add(new h.Z((function(){e._documentFocusInterval&&clearInterval(e._documentFocusInterval),e._documentFocusInterval=null})))}},{key:"setFocusState",value:function(e){this._isForeground!==e&&(this._isForeground.value=e)}}]),e}()},9845:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}}),n(6699),n(2772),n(9653),n(1058),n(4916),n(2023),n(4723),n(3123);var r=n(4575),i=n.n(r),o=n(3913),a=n.n(o),s=n(9713),u=n.n(s),c=function(){function e(){i()(this,e)}return a()(e,null,[{key:"browserNameAndVersion",get:function(){return e._browserNameAndVersion}},{key:"browserName",get:function(){return this._browserName}},{key:"browserMajorVersion",get:function(){return this._browserMajorVersion}},{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:"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""}}]),e}();u()(c,"_browserNameAndVersionRegex",/(MSIE|(?!Gecko.+)Firefox|(?!AppleWebKit.+Chrome.+)Safari|(?!AppleWebKit.+)Chrome|AppleWebKit(?!.+Chrome|.+Safari)|Gecko(?!.+Firefox))(?: |\/)([\d.apre]+)/g),u()(c,"_browserNameAndVersion",c.parseBrowserNameAndVersion()),u()(c,"_browserName",c.parseBrowserName()),u()(c,"_browserMajorVersion",c.parseBrowserMajorVersion()),u()(c,"_isChrome69",c._browserNameAndVersion.includes("Chrome/69.")),u()(c,"_isChrome70",c._browserNameAndVersion.includes("Chrome/70.")),u()(c,"_isChrome71",c._browserNameAndVersion.includes("Chrome/71.")),u()(c,"_isChrome72",c._browserNameAndVersion.includes("Chrome/72.")),u()(c,"_isChrome74",c._browserNameAndVersion.includes("Chrome/74.")),u()(c,"_isChrome75",c._browserNameAndVersion.includes("Chrome/75.")),u()(c,"_isChrome76",c._browserNameAndVersion.includes("Chrome/76.")),u()(c,"_isChrome77",c._browserNameAndVersion.includes("Chrome/77."))},4381:function(e,t,n){"use strict";n.d(t,{Z:function(){return h}}),n(6992),n(1539),n(4916),n(8783),n(4765),n(3948),n(285);var r=n(4575),i=n.n(r),o=n(3913),a=n.n(o),s=n(3588),u=n(4417),c=n(2394),l=n(1178),h=function(){function e(){i()(this,e)}return a()(e,[{key:"getStringValue",value:function(e){return this.readConfigurationParameterValue(e)||this.readConfigurationParameterURIValue("".concat(e,"-uri-parameter-name"))||this.defaultStringValue[e]}},{key:"getBooleanValue",value:function(e){var t=this.readConfigurationParameterValue(e);return t||this.readConfigurationParameterURIValue("".concat(e,"-uri-parameter-name"))?"true"===t||"1"===t||"On"===t:!0===this.defaultBooleanValue[e]}},{key:"defaultStringValue",get:function(){return{"phenix-metrics-level":u.Z.convertTelemetryLevelToTelemetryLevelType(s.Z.defaultTelemetryLevel),"phenix-logging-level":c.Z.convertLoggingLevelToLoggingLevelType(l.Z.defaultLoggingLevel),"phenix-console-logging-level":c.Z.convertLoggingLevelToLoggingLevelType(l.Z.defaultConsoleLoggingLevel),"phenix-telemetry-logging-level":c.Z.convertLoggingLevelToLoggingLevelType(l.Z.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}}},{key:"readConfigurationParameterValue",value:function(e){var t=document.querySelector("meta[name='".concat(e,"']"));if(t){var n=t.getAttribute("value");if(n)return n}}},{key:"readConfigurationParameterURIValue",value:function(e){var t=this.readConfigurationParameterValue(e);if(t){var n=new URLSearchParams(location.search).get(t)||void 0;if(n)return n}}}]),e}()},3953:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(4575),i=n.n(r),o=n(3913),a=n.n(o),s=n(9713),u=n.n(s),c=function(){function e(){i()(this,e)}return a()(e,null,[{key:"isPrivate",get:function(){return this._isPrivate}},{key:"applyIsPrivate",value:function(){try{this._isPrivate=!1}catch(e){this._isPrivate=!1}}}]),e}();u()(c,"_isPrivate",void 0),c.applyIsPrivate()},6330:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(4575),i=n.n(r),o=n(3913),a=n.n(o),s=n(9713),u=n.n(s),c=function(){function e(t){i()(this,e),u()(this,"_disposed",void 0),u()(this,"_disposable",void 0),this._disposed=!1,this._disposable=t}return a()(e,[{key:"dispose",value:function(){if(!this._disposed)return this._disposed=!0,this._disposable.call(this)}}]),e}()},2493:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}}),n(9554),n(4747);var r=n(4575),i=n.n(r),o=n(3913),a=n.n(o),s=n(9713),u=n.n(s),c=function(){function e(){i()(this,e),u()(this,"_list",[])}return a()(e,[{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,"]")}}]),e}()},4827:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}}),n(3290),n(5827),n(3710),n(1539),n(9714);var r=n(4575),i=n.n(r),o=n(3913),a=n.n(o),s=function(){function e(){throw i()(this,e),new Error("Strings is a static class that may not be instantiated")}return a()(e,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)}}]),e}()},8701:function(e,t,n){"use strict";t.Z=function(e){throw new Error("Unexpected value [".concat(e,"]. This should never be reached"))}},709:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}}),n(5827);var r=n(4575),i=n.n(r),o=n(3913),a=n.n(o),s=n(9713),u=n.n(s),c=function(){function e(){i()(this,e),u()(this,"_appenders",[])}return a()(e,[{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}),[])}}]),e}()},1502:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}}),n(2222),n(8733);var r=n(4575),i=n.n(r),o=n(3913),a=n.n(o),s=n(9713),u=n.n(s),c=n(5149),l=function(){function e(t){i()(this,e),u()(this,"_threshold",void 0),this._threshold=t}return a()(e,[{key:"log",value:function(e,t,n,r){if(!(e<this._threshold)){var i="".concat(r.toISOString()," [").concat(n,"] [").concat(c.G[e],"] ").concat(t);e<c.G.Warn?console.log(i):console.error(i)}}}]),e}()},5149:function(e,t,n){"use strict";n.d(t,{G:function(){return r},Z:function(){return l}}),n(9554),n(6699),n(2772),n(5827),n(561),n(3710),n(1539),n(9714),n(4747);var r,i=n(4575),o=n.n(i),a=n(3913),s=n.n(a),u=n(9713),c=n.n(u);!function(e){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"}(r||(r={}));var l=function(){function e(t,n,r){o()(this,e),c()(this,"_category",void 0),c()(this,"_appenders",void 0),c()(this,"_threshold",void 0),this._category=t,this._appenders=n,this._threshold=r}return s()(e,[{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?e+"\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}}]),e}()},1178:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(4575),i=n.n(r),o=n(3913),a=n.n(o),s=n(3953),u=n(5149),c=function(){function e(){i()(this,e)}return a()(e,null,[{key:"defaultLoggingLevel",get:function(){return s.Z.isPrivate?u.G.Off:u.G.All}},{key:"defaultConsoleLoggingLevel",get:function(){return s.Z.isPrivate?u.G.Off:u.G.All}},{key:"defaultTelemetryLoggingLevel",get:function(){return u.G.Info}}]),e}()},9571:function(e,t,n){"use strict";n.d(t,{Z:function(){return m}}),n(4812);var r=n(4575),i=n.n(r),o=n(3913),a=n.n(o),s=n(9713),u=n.n(s),c=n(5149),l=n(709),h=n(6016),d=n(1502),f=n(3552),p=n(5259),v=n(4381),g=n(1178),m=function(){function e(){throw i()(this,e),new Error("LoggerFactory is a static class that may not be instantiated")}return a()(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 c.Z(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=this._configurationParameterReader.getStringValue("phenix-logging-level");c.G[e]&&this._threshold.setThreshold(c.G[e])}},{key:"applyAppenderLoggingLevel",value:function(e,t){var n=this._configurationParameterReader.getStringValue("phenix-".concat(e,"-logging-level"));"Off"!==n&&t(c.G[n])}},{key:"applyConsoleLogger",value:function(e){this._appenders.add(new d.Z(e||g.Z.defaultConsoleLoggingLevel))}},{key:"applyTelemetryLogger",value:function(e){this._telemetryConfiguration.threshold=e||g.Z.defaultTelemetryLoggingLevel,this._appenders.add(new f.Z(this._telemetryConfiguration))}}]),e}();u()(m,"_configurationParameterReader",new v.Z),u()(m,"_loggers",{}),u()(m,"_appenders",new l.Z),u()(m,"_threshold",new h.Z),u()(m,"_telemetryConfiguration",new p.Z),m.applyLoggerConfigFromParameterConfiguration()},2394:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(4575),i=n.n(r),o=n(3913),a=n.n(o),s=n(8701),u=n(5149),c=function(){function e(){i()(this,e)}return a()(e,null,[{key:"convertLoggingLevelToLoggingLevelType",value:function(e){switch(e){case u.G.Off:return"Off";case u.G.Trace:return"Trace";case u.G.Debug:return"Debug";case u.G.Info:return"Trace";case u.G.Warn:return"Warn";case u.G.Error:return"Error";case u.G.Fatal:return"Fatal";case u.G.All:return"All";default:(0,s.Z)(e)}}},{key:"convertLoggingLevelTypeToLoggingLevel",value:function(e){switch(e){case"Off":return u.G.Off;case"Trace":return u.G.Trace;case"Debug":return u.G.Debug;case"Info":return u.G.Info;case"Warn":return u.G.Warn;case"Error":return u.G.Error;case"Fatal":return u.G.Fatal;case"All":return u.G.All;default:(0,s.Z)(e)}}}]),e}()},6016:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(4575),i=n.n(r),o=n(3913),a=n.n(o),s=n(9713),u=n.n(s),c=n(1178),l=function(){function e(){i()(this,e),u()(this,"_threshold",c.Z.defaultLoggingLevel)}return a()(e,[{key:"value",get:function(){return this._threshold}},{key:"setThreshold",value:function(e){this._threshold=e}}]),e}()},4574:function(e,t,n){"use strict";n.d(t,{Z:function(){return d}});var r=n(4575),i=n.n(r),o=n(3913),a=n.n(o),s=n(9713),u=n.n(s),c=n(2889),l=n(8701),h=n(8963),d=function(){function e(t){i()(this,e),u()(this,"_metrics",void 0),this._metrics=t}return a()(e,[{key:"getName",value:function(){return h.Z[this._metrics]}},{key:"getTelemetryLevel",value:function(){switch(this._metrics){case h.Z.TimeToFirstFrame:case h.Z.ChannelCreationTimeToFirstFrame:return c.g.Essential;case h.Z.Stalled:case h.Z.Buffering:case h.Z.SetupCompleted:case h.Z.SetupFailed:case h.Z.RoundTripTime:case h.Z.DownlinkThroughputCapacity:case h.Z.NetworkType:case h.Z.ResolutionChanged:case h.Z.ApplicationForeground:case h.Z.ApplicationBackground:return c.g.All;default:(0,l.Z)(this._metrics)}}}]),e}()},2889:function(e,t,n){"use strict";n.d(t,{g:function(){return r},Z:function(){return h}}),n(6992),n(3710),n(1539),n(9714),n(8783),n(3948),n(285);var r,i=n(4575),o=n.n(i),a=n(3913),s=n.n(a),u=n(9713),c=n.n(u),l=n(3588);!function(e){e[e.Off=100]="Off",e[e.Essential=10]="Essential",e[e.All=-1]="All"}(r||(r={}));var h=function(){function e(){o()(this,e),c()(this,"_url","https://telemetry.phenixrts.com/telemetry/metrics"),c()(this,"_tenancy",void 0),c()(this,"_sessionId",void 0),c()(this,"_environment",void 0),c()(this,"_threshold",l.Z.defaultTelemetryLevel)}return s()(e,[{key:"url",get:function(){return this._url},set:function(e){var t=new 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}}]),e}()},6062:function(e,t,n){"use strict";n.d(t,{Z:function(){return v}}),n(9554),n(2479),n(4747);var r=n(4575),i=n.n(r),o=n(3913),a=n.n(o),s=n(9713),u=n.n(s),c=n(3896),l=n(2889),h=n(5508),d=n(4760),f=n(5021),p=n(4417),v=function(){function e(){throw i()(this,e),new Error("LoggerFactory is a static class that may not be instantiated")}return a()(e,null,[{key:"getMetricsService",value:function(t){if("string"!=typeof t)throw new Error("ur");var n=e._metricsServices[t];if(n)return n;var r=new l.Z;return r.sessionId=h.Z.clientSessionId,r.tenancy=h.Z.tenancy.value,r.url=d.Z.getTelemetryUrl(t),r.environment=f.Z.getEnvironmentFromUrl(t),r.threshold=p.Z.convertTelemetryLevelTypeToTelemetryLevel(h.Z.telemetryLevel),e._metricsServices[t]=new c.Z(r)}},{key:"setTelemetryLevel",value:function(t){var n=Object.values(e._metricsServices);n&&n.length&&n.forEach((function(e){e.metricsConfiguration.threshold=t}))}}]),e}();u()(v,"_metricsServices",{})},3896:function(e,t,n){"use strict";n.d(t,{Z:function(){return v}}),n(7042),n(8733),n(3710),n(1539),n(8674),n(5666);var r=n(8926),i=n.n(r),o=n(4575),a=n.n(o),s=n(3913),u=n.n(s),c=n(9713),l=n.n(c),h=n(7757),d=n.n(h),f=n(8862),p=n(4574),v=function(){function e(t){a()(this,e),l()(this,"_metricsConfiguration",void 0),l()(this,"_metrics",[]),l()(this,"_isSending",void 0),l()(this,"_domain",location.hostname),this._metricsConfiguration=t}var t,n;return u()(e,[{key:"metricsConfiguration",get:function(){return this._metricsConfiguration}},{key:"push",value:function(e){var t=e.streamId,n=e.value,r=e.previousValue,i=e.runtime,o=e.resource,a=e.kind,s=new p.Z(e.metricType);if(!(this._metricsConfiguration.threshold>s.getTelemetryLevel())){var u={timestamp:(new Date).toISOString(),tenancy:this._metricsConfiguration.tenancy,sessionId:this._metricsConfiguration.sessionId,streamId:t,metric:s.getName(),value:n,previousValue:r,fullQualifiedName:this._domain,environment:this._metricsConfiguration.environment,version:f.Z.sdkVersion,runtime:i,resource:o,kind:a};this._metrics.push(u),this.sendMetricsIfAble()}}},{key:"sendMetrics",value:(n=i()(d().mark((function e(t){var n;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(n=new FormData).append("jsonBody",JSON.stringify({records:t})),e.next=4,fetch(this._metricsConfiguration.url,{method:"POST",body:n});case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"sendMetricsIfAble",value:(t=i()(d().mark((function e(){var t,n=this;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(this._metrics.length<=0||this._isSending)){e.next=2;break}return e.abrupt("return");case 2:return this._isSending=!0,t=this._metrics.slice(0,1024),this._metrics=this._metrics.slice(1024),e.abrupt("return",this.sendMetrics(t).then((function(e){return n._isSending=!1,n.sendMetricsIfAble(),e})).catch((function(){n._isSending=!1,n.sendMetricsIfAble()})));case 6:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}()},8963:function(e,t){"use strict";var n;!function(e){e[e.TimeToFirstFrame=0]="TimeToFirstFrame",e[e.ChannelCreationTimeToFirstFrame=1]="ChannelCreationTimeToFirstFrame",e[e.Stalled=2]="Stalled",e[e.Buffering=3]="Buffering",e[e.SetupCompleted=4]="SetupCompleted",e[e.SetupFailed=5]="SetupFailed",e[e.RoundTripTime=6]="RoundTripTime",e[e.DownlinkThroughputCapacity=7]="DownlinkThroughputCapacity",e[e.NetworkType=8]="NetworkType",e[e.ResolutionChanged=9]="ResolutionChanged",e[e.ApplicationForeground=10]="ApplicationForeground",e[e.ApplicationBackground=11]="ApplicationBackground"}(n||(n={})),t.Z=n},4417:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(4575),i=n.n(r),o=n(3913),a=n.n(o),s=n(2889),u=n(8701),c=function(){function e(){i()(this,e)}return a()(e,null,[{key:"convertTelemetryLevelToTelemetryLevelType",value:function(e){switch(e){case s.g.Off:return"Off";case s.g.Essential:return"Essential";case s.g.All:return"All";default:(0,u.Z)(e)}}},{key:"convertTelemetryLevelTypeToTelemetryLevel",value:function(e){switch(e){case"Off":return s.g.Off;case"Essential":return s.g.Essential;case"All":return s.g.All;default:(0,u.Z)(e)}}}]),e}()},3588:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(4575),i=n.n(r),o=n(3913),a=n.n(o),s=n(3953),u=n(2889),c=function(){function e(){i()(this,e)}return a()(e,null,[{key:"defaultTelemetryLevel",get:function(){return s.Z.isPrivate?u.g.Essential:u.g.All}}]),e}()},202:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return f}}),n(9753),n(7042),n(1539),n(8674),n(7727),n(2564);var r=n(8),i=n.n(r),o=n(4575),a=n.n(o),s=n(3913),u=n.n(s),c=n(9713),l=n.n(c),h=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})),d=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=void 0,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=null}},{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(a,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 t(a,e)}),n)}r[a]=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){setTimeout(e,0)}},{key:"_unhandledRejection",value:function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)}}]),e}();d.prototype.catch=function(e){return this.then(null,e)},d.prototype.then=function(e,t){var n=new this.constructor((function(){return null}));return this.handle(new h(e,t,n)),n},d.prototype.finally=function(e){var t=this.constructor;return this.then((function(n){return t.resolve(e()).then((function(){return n}))}),(function(n){return t.resolve(e()).then((function(){return t.reject(n)}))}))};var f=d},4554:function(e,t,n){"use strict";n(9554),n(1539),n(8674),n(4916),n(4723),n(4747),n(5666);var r=n(8926),i=n.n(r),o=n(4575),a=n.n(o),s=n(3913),u=n.n(s),c=n(9713),l=n.n(c),h=n(7757),d=n.n(h),f=n(9571),p=n(1228),v=n(202).default,g=function(){function e(t){a()(this,e),l()(this,"_logger",f.Z.getLogger("VanillaPeerConnection")),l()(this,"_peerConnection",void 0),p.Z.webkitRTCPeerConnectionEnabled?this._peerConnection=new webkitRTCPeerConnection(t):this._peerConnection=new RTCPeerConnection(t)}var t,n,r,o;return u()(e,[{key:"native",get:function(){return this._peerConnection}},{key:"currentLocalDescription",get:function(){return this._peerConnection.currentLocalDescription}},{key:"currentRemoteDescription",get:function(){return this._peerConnection.currentRemoteDescription}},{key:"iceConnectionState",get:function(){return this._peerConnection.iceConnectionState}},{key:"supportsGetConfiguration",get:function(){return"function"==typeof this._peerConnection.getConfiguration}},{key:"supportsSetConfiguration",get:function(){return"function"==typeof this._peerConnection.setConfiguration}},{key:"supportsAddTransceiver",get:function(){return!p.Z.addTranceiverDisabled&&"function"==typeof this._peerConnection.addTransceiver}},{key:"createOffer",value:(o=i()(d().mark((function e(t){var n=this;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!p.Z.promiseBasedPCMethodsDisabled){e.next=2;break}return e.abrupt("return",new v((function(e,r){return n._peerConnection.createOffer(e,r,t)})));case 2:return e.abrupt("return",this._peerConnection.createOffer(t));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"createAnswer",value:(r=i()(d().mark((function e(t){var n=this;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!p.Z.promiseBasedPCMethodsDisabled){e.next=2;break}return e.abrupt("return",new v((function(e,r){return n._peerConnection.createAnswer(e,r,t)})));case 2:return e.abrupt("return",this._peerConnection.createAnswer(t));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"setLocalDescription",value:(n=i()(d().mark((function e(t){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._peerConnection.setLocalDescription(p.Z.promiseBasedPCMethodsDisabled?new RTCSessionDescription(t):t));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"setRemoteDescription",value:(t=i()(d().mark((function e(t){var n;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0: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.abrupt("return",this._peerConnection.setRemoteDescription(p.Z.promiseBasedPCMethodsDisabled?new RTCSessionDescription(t):t));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"getSenders",value:function(){return this._peerConnection.getSenders()}},{key:"getStats",value:function(e){return this._peerConnection.getStats(e)}},{key:"getStatsLegacy",value:function(){var e=this;return new v((function(t){e._peerConnection.getStats(t)}))}},{key:"addEventListener",value:function(e,t,n){this._peerConnection.addEventListener(e,t,n)}},{key:"removeEventListener",value:function(e,t,n){this._peerConnection.removeEventListener(e,t,n)}},{key:"addTransceiver",value:function(e,t){return this._peerConnection.addTransceiver(e,t)}},{key:"addStream",value:function(e){var t=this;e.getTracks().forEach((function(e){t._peerConnection.addTrack(e)}))}},{key:"getConfiguration",value:function(){return this._peerConnection.getConfiguration()}},{key:"setConfiguration",value:function(e){this._peerConnection.setConfiguration(e)}},{key:"ontrack",get:function(){return this._peerConnection.ontrack},set:function(e){this._peerConnection.ontrack=e}},{key:"onicecandidate",get:function(){return this._peerConnection.onicecandidate},set:function(e){this._peerConnection.onicecandidate=e}},{key:"oniceconnectionstatechange",get:function(){return this._peerConnection.oniceconnectionstatechange},set:function(e){this._peerConnection.oniceconnectionstatechange=e}},{key:"close",value:function(){this._peerConnection.close()}}]),e}();t.Z=g},4009:function(e,t,n){"use strict";n(5666);var r=n(8926),i=n.n(r),o=n(4575),a=n.n(o),s=n(3913),u=n.n(s),c=n(7757),l=n.n(c),h=n(4554),d=function(){function e(){a()(this,e)}var t;return u()(e,[{key:"createPeerConnection",value:(t=i()(l().mark((function e(t){return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new h.Z(t));case 1:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})}]),e}();t.Z=d},841:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(4575),i=n.n(r),o=n(3913),a=n.n(o),s=n(9713),u=n.n(s),c=function(){function e(t){i()(this,e),u()(this,"_subject",void 0),this._subject=t}return a()(e,[{key:"value",get:function(){return this._subject.value}},{key:"subscribe",value:function(e){return this._subject.subscribe(e)}}]),e}()},7426:function(e,t,n){"use strict";n.d(t,{Z:function(){return g}}),n(9554),n(2772),n(561),n(4747);var r=n(9713),i=n.n(r),o=n(3913),a=n.n(o),s=n(4575),u=n.n(s),c=n(2205),l=n.n(c),h=n(8585),d=n.n(h),f=n(9754),p=n.n(f);var v=function(e){l()(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=p()(t);if(n){var i=p()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return d()(this,e)});function i(e,t){return u()(this,i),r.call(this,(function(){var n=e.indexOf(t);n>=0&&e.splice(n,1)}))}return a()(i)}(n(6330).Z),g=function(){function e(t){u()(this,e),i()(this,"_listeners",void 0),i()(this,"_value",void 0),this._listeners=[],this._value=t}return a()(e,[{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))}t&&(this._value=e,this._listeners.forEach((function(t){t(e)})))}},{key:"subscribe",value:function(e){return this._listeners.push(e),e(this._value),new v(this._listeners,e)}}]),e}()},5021:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}}),n(6992),n(1539),n(8783),n(3948),n(285);var r=n(4575),i=n.n(r),o=n(3913),a=n.n(o),s=function(){function e(){i()(this,e)}return a()(e,null,[{key:"getEnvironmentFromUrl",value:function(e){try{return new URL(e).origin}catch(e){return""}}}]),e}()},5508:function(e,t,n){"use strict";n.d(t,{Z:function(){return R}}),n(9826),n(3843),n(3710),n(1539),n(9714);var r=n(4575),i=n.n(r),o=n(3913),a=n.n(o),s=n(9713),u=n.n(s),c=n(9571),l=n(4827),h=n(7426),d=n(841),f=n(4009),p=n(3297),v=n(5149),g=n(1502),m=n(3552),y=n(4381),_=n(2889),b=n(4417),w=n(2394),x=n(3953),C=n(9845),S=n(6406),k=n(4760),T=n(5021),E=n(5564),L=n(6062),P=n(3588),O=window.__phenixPageLoadTime||window.__pageLoadTime||Date.now(),R=function(){function e(){throw i()(this,e),new Error("SDK is a static class that may not be instantiated")}return a()(e,null,[{key:"pageLoadTime",get:function(){return O}},{key:"sendLocalCandidates",get:function(){return this._sendLocalCandidates}},{key:"tenancy",get:function(){return this._tenancy}},{key:"clientSessionId",get:function(){return e._clientSessionId}},{key:"loadedTimestamp",get:function(){return e._loadedTimestamp}},{key:"initialized",get:function(){return e._readOnlyInitialized}},{key:"discoveryUri",get:function(){return e._readOnlyDiscoveryUri}},{key:"peerConnectionFactory",get:function(){return e._readOnlyPeerConnectionFactory}},{key:"automaticRetryOnFailure",get:function(){return e._automaticallyRetryOnFailure}},{key:"automaticallyReconnectPeerConnection",get:function(){return e._automaticallyReconnectPeerConnection}},{key:"automaticallyPlayMediaStream",get:function(){return e._automaticallyPlayMediaStream}},{key:"automaticallyMuteVideoOnPlayFailure",get:function(){return e._automaticallyMuteVideoOnPlayFailure}},{key:"webPlayerLoader",get:function(){return this._webPlayerLoader}},{key:"shakaPlayerLoader",get:function(){return this._shakaPlayerLoader}},{key:"hlsJsLoader",get:function(){return this._hlsJsLoader}},{key:"metricsService",get:function(){return e._metricsService}},{key:"applicationActivityMonitor",get:function(){return this._applicationActivityMonitor}},{key:"telemetryUrl",get:function(){return this._telemetryUrl}},{key:"maximalNumberOfPeerConnectionReconnectAttempts",get:function(){return this._maximalNumberOfPeerConnectionReconnectAttempts},set:function(e){this._maximalNumberOfPeerConnectionReconnectAttempts=e}},{key:"loggingLevel",get:function(){return w.Z.convertLoggingLevelToLoggingLevelType(this._logger.threshold.value)}},{key:"telemetryLevel",get:function(){return b.Z.convertTelemetryLevelToTelemetryLevelType(e._telemetryLevel.value)}},{key:"browserDetector",get:function(){return C.Z}},{key:"applyTelemetryConfiguration",value:function(){var t=this,n=c.Z.telemetryConfiguration;n.sessionId=e.clientSessionId,e._environment.subscribe((function(e){n.environment=e})),e.telemetryUrl.subscribe((function(e){var r=t._logger.appenders.value.find((function(e){return e instanceof m.Z}));r&&(n.url=e,t._logger.appenders.remove(r),t._logger.appenders.add(new m.Z(n)),t._logger.info("Telemetry URL was set to [%s]",n.url))})),e._tenancy.subscribe((function(e){var r=t._logger.appenders.value.find((function(e){return e instanceof m.Z}));r&&e&&(n.tenancy=e,t._logger.appenders.remove(r),t._logger.appenders.add(new m.Z(n)),t._logger.info("Telemetry tenancy was set to [%s]",n.tenancy))}))}},{key:"applyMetricsConfiguration",value:function(){e._metricsService=L.Z.getMetricsService(E.Z.uri.value),e._metricsConfiguration=e._metricsService.metricsConfiguration,e._metricsConfiguration.sessionId=e.clientSessionId,e._environment.subscribe((function(t){e._metricsConfiguration.environment=t})),e.telemetryUrl.subscribe((function(t){e._metricsConfiguration.url=t})),e._tenancy.subscribe((function(t){e._metricsConfiguration.tenancy=t}));var t=this._configurationParameterReader.getStringValue("phenix-metrics-level");t&&L.Z.setTelemetryLevel(_.g[t]),e._telemetryLevel.subscribe((function(e){L.Z.setTelemetryLevel(e)}))}},{key:"applyAutomaticallyRetryOnFailureFromParameterConfiguration",value:function(){this._automaticallyRetryOnFailure=this._configurationParameterReader.getBooleanValue("phenix-automatically-retry-on-failure"),this._logger.info("Automatically retry on failure is set to: [%s]",this._automaticallyRetryOnFailure)}},{key:"applyAutomaticallyReconnectPeerConnectionFromParameterConfiguration",value:function(){this._automaticallyReconnectPeerConnection=this._configurationParameterReader.getBooleanValue("phenix-automatically-reconnect-peer-connection"),this._logger.info("Automatically reconnect peer connection is set to: [%s]",this._automaticallyReconnectPeerConnection)}},{key:"applyDiscoveryUriDefaultFromParameterConfiguration",value:function(){e.discoveryUri.subscribe((function(t){e.telemetryUrl.value=e.getTelemetryUrl(t),e._environment.value=T.Z.getEnvironmentFromUrl(t)}));var t=this._configurationParameterReader.getStringValue("phenix-channel-token");if(t){var n=p.Z.parseToken(t);return e._tenancy.value=p.Z.getTenancy(n),E.Z.uri.value=(p.Z.getUri(n)||e.discoveryUri.value).toString(),void this._logger.info("Discovery URI set from configuration parameter to [%s]",e.discoveryUri.value)}var r=this._configurationParameterReader.getStringValue("phenix-uri");if(r)return E.Z.uri.value=r,void this._logger.info('Discovery URI set from "phenix-uri" configuration parameter tag to [%s]',e.discoveryUri.value);var i=this._configurationParameterReader.getStringValue("phenix-base-uri");return i?(E.Z.uri.value="".concat(i,"/pcast/endPoints"),void this._logger.info('Discovery URI set from "phenix-base-uri" configuration parameter tag to [%s]',e.discoveryUri.value)):void 0}},{key:"init",value:function(t){if(this._initialized.value||(this._applicationActivityMonitor=new S.Z),t){if(t.discoveryUri&&(E.Z.uri.value=t.discoveryUri),t.peerConnectionFactory&&(e._peerConnectionFactory.value=t.peerConnectionFactory),t.telemetryLevel&&_.g[t.telemetryLevel]&&(e._telemetryLevel.value=b.Z.convertTelemetryLevelTypeToTelemetryLevel(t.telemetryLevel)),t.loggingLevel&&v.G[t.loggingLevel]&&this._logger.threshold.setThreshold(w.Z.convertLoggingLevelTypeToLoggingLevel(t.loggingLevel)),t.consoleLoggingLevel&&v.G[t.consoleLoggingLevel]){var n=this._logger.appenders.value.find((function(e){return e instanceof g.Z}));n&&this._logger.appenders.remove(n),"Off"!==t.consoleLoggingLevel&&this._logger.appenders.add(new g.Z(w.Z.convertLoggingLevelTypeToLoggingLevel(t.consoleLoggingLevel)))}"boolean"==typeof t.automaticallyPlayMediaStream&&(this._automaticallyPlayMediaStream=t.automaticallyPlayMediaStream),"boolean"==typeof t.automaticallyMuteVideoOnPlayFailure&&(this._automaticallyMuteVideoOnPlayFailure=t.automaticallyMuteVideoOnPlayFailure),t.webPlayerLoader&&(this._webPlayerLoader=t.webPlayerLoader),t.shakaPlayerLoader&&(this._shakaPlayerLoader=t.shakaPlayerLoader),t.hlsJsLoader&&(this._hlsJsLoader=t.hlsJsLoader)}e._initialized.value=!0}},{key:"dispose",value:function(){e._initialized.value=!1,this._applicationActivityMonitor.dispose(),this._applicationActivityMonitor=null}},{key:"getTelemetryUrl",value:function(e){return k.Z.getTelemetryUrl(e)}}]),e}();u()(R,"_automaticallyRetryOnFailure",!0),u()(R,"_automaticallyReconnectPeerConnection",!0),u()(R,"_automaticallyPlayMediaStream",!0),u()(R,"_automaticallyMuteVideoOnPlayFailure",!0),u()(R,"_webPlayerLoader",null),u()(R,"_shakaPlayerLoader",null),u()(R,"_hlsJsLoader",null),u()(R,"_configurationParameterReader",new y.Z),u()(R,"_applicationActivityMonitor",void 0),u()(R,"_environment",new h.Z("")),u()(R,"_telemetryUrl",new h.Z("https://telemetry.phenixrts.com/telemetry")),u()(R,"_maximalNumberOfPeerConnectionReconnectAttempts",8),u()(R,"_telemetryLevel",new h.Z(P.Z.defaultTelemetryLevel)),u()(R,"_metricsService",void 0),u()(R,"_metricsConfiguration",void 0),u()(R,"_sendLocalCandidates",new h.Z(!x.Z.isPrivate)),u()(R,"_tenancy",new h.Z("")),u()(R,"_clientSessionId",l.Z.random(32)),u()(R,"_loadedTimestamp",new Date),u()(R,"_logger",c.Z.getLogger("SDK")),u()(R,"_initialized",new h.Z(!1)),u()(R,"_peerConnectionFactory",new h.Z(new f.Z)),u()(R,"_readOnlyInitialized",new d.Z(R._initialized)),u()(R,"_readOnlyDiscoveryUri",new d.Z(E.Z.uri)),u()(R,"_readOnlyPeerConnectionFactory",new d.Z(R._peerConnectionFactory)),window.addEventListener("unload",(function(){R.dispose()})),R.applyDiscoveryUriDefaultFromParameterConfiguration(),R.applyMetricsConfiguration(),R.applyTelemetryConfiguration(),R.applyAutomaticallyRetryOnFailureFromParameterConfiguration(),R.applyAutomaticallyReconnectPeerConnectionFromParameterConfiguration(),R.init()},4760:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}}),n(6699),n(6992),n(9600),n(1539),n(4916),n(7852),n(2023),n(8783),n(3123),n(6755),n(3948),n(285);var r=n(4575),i=n.n(r),o=n(3913),a=n.n(o),s=function(){function e(){i()(this,e)}return a()(e,null,[{key:"getTelemetryUrl",value:function(e){try{var t=new URL(e),n=t.hostname.split(".");switch(t.protocol){case"ws:":t.protocol="http:";break;case"wss:":t.protocol="https:"}return 2===n.length||3===n.length&&n[n.length-2].length<=2&&n[n.length-1].length<=3?n.unshift("telemetry"):n[0].startsWith("stg-")||n[0].endsWith("-stg")||n[0].includes("-stg-")||"stg"===n[0]?n[0]="telemetry-stg":n[0].startsWith("local")||n[0].endsWith("-local")||(n[0]="telemetry"),t.hostname=n.join("."),"".concat(t.origin,"/telemetry")}catch(t){return e}}}]),e}()},2250:function(e,t){"use strict";var n;!function(e){e[e.Offline=1]="Offline",e[e.Starting=2]="Starting",e[e.Paused=3]="Paused",e[e.Playing=4]="Playing",e[e.Recovering=5]="Recovering",e[e.Reconnecting=6]="Reconnecting",e[e.StandBy=7]="StandBy",e[e.Stopped=8]="Stopped",e[e.Unauthorized=9]="Unauthorized",e[e.GeoRestricted=10]="GeoRestricted",e[e.GeoBlocked=11]="GeoBlocked",e[e.Error=12]="Error",e[e.UnsupportedFeature=13]="UnsupportedFeature"}(n||(n={})),t.Z=n},2070:function(e,t,n){"use strict";n.d(t,{Z:function(){return Ie}});var r,i,o=n(4575),a=n.n(o),s=n(3913),u=n.n(s),c=(n(7327),n(9554),n(6992),n(3843),n(3710),n(4812),n(1539),n(8674),n(7727),n(9714),n(8783),n(4747),n(3948),n(2564),n(285),n(5666),n(8926)),l=n.n(c),h=n(9713),d=n.n(h),f=n(7757),p=n.n(f),v=n(9571),g=n(841),m=(n(2222),function(){function e(t,n){a()(this,e),d()(this,"width",void 0),d()(this,"height",void 0),this.width=t,this.height=n}return u()(e,[{key:"equals",value:function(e){return e&&this.width===e.width&&this.height===e.height}},{key:"toString",value:function(){return"".concat(this.width,"x").concat(this.height)}}],[{key:"empty",get:function(){return new e(0,0)}}]),e}()),y=n(5508),_=n(2250),b=n(8701),w=n(6330),x=n(3297),C=(n(9600),n(7042),n(3112),n(2481),function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;a()(this,e),d()(this,"_duration",void 0),this._duration=t}return u()(e,[{key:"toIsoString",value:function(){if(0===this._duration)return"P0S";var e=this._duration<0,t=e?Math.abs(this._duration):this._duration,n=Math.floor(t),r=n%1e3,i=(n=Math.floor(n/1e3))%60,o=(n=Math.floor(n/60))%60,a=(n=Math.floor(n/60))%24,s=["PT"];return e&&s.unshift("-"),a&&s.push(a+"H"),o&&s.push(o+"M"),(i||r)&&(s.push(String(i)),r&&s.push("."+this.padStart(r.toString(),3,"0")),s.push("S")),s.join("")}},{key:"padStart",value:function(e,t,n){return t>>=0,n=String(void 0!==n?n:" "),e.length>t?e:((t-=e.length)>n.length&&(n+=n.repeat(t/n.length)),n.slice(0,t)+e)}}]),e}()),S=n(8963),k=n(2493),T=function(){function e(t,n,r,i){a()(this,e),d()(this,"_pageLoadTime",void 0),d()(this,"_channelStartTime",void 0),d()(this,"_logger",v.Z.getLogger("StreamTelemetry")),d()(this,"_disposables",new k.Z),d()(this,"_streamId",void 0),d()(this,"_metricsService",void 0),d()(this,"_listenToFirstTime",void 0),d()(this,"_listenForStall",void 0),d()(this,"_listenForContinuation",void 0),d()(this,"_timeToFirstFrame",void 0),d()(this,"_channelCreationTimeToFirstFrame",void 0),d()(this,"_startRecordingFirstFrame",void 0),d()(this,"_videoStalled",void 0),d()(this,"_lastProgress",void 0),d()(this,"_videoResolution",void 0),d()(this,"_clearTimeToFirstFrameListener",void 0),d()(this,"_clearRebufferingListener",void 0),this._streamId=t,this._pageLoadTime=n,this._channelStartTime=r,this._metricsService=i}return u()(e,[{key:"setupListenerForTimeToFirstTime",value:function(e){var t=this;this._startRecordingFirstFrame=Date.now(),this._listenToFirstTime=function(){return t.callTimeToFirstFrame()},e.addEventListener("loadeddata",this._listenToFirstTime),e.addEventListener("loadedmetadata",this._listenToFirstTime),this._clearTimeToFirstFrameListener=new w.Z((function(){e.removeEventListener("loadeddata",t._listenToFirstTime),e.removeEventListener("loadedmetadata",t._listenToFirstTime)})),this._disposables.add(this._clearTimeToFirstFrameListener)}},{key:"setupListenerForRebuffering",value:function(e){var t=this;this._listenForStall=function(){return t.onStall()},this._listenForContinuation=function(n){return t.onContinuation(n,e)},e.addEventListener("stalled",this._listenForStall),e.addEventListener("pause",this._listenForStall),e.addEventListener("suspend",this._listenForStall),e.addEventListener("play",this._listenForContinuation),e.addEventListener("playing",this._listenForContinuation),e.addEventListener("progress",this._listenForContinuation),e.addEventListener("timeupdate",this._listenForContinuation),this._clearRebufferingListener=new w.Z((function(){e.removeEventListener("stalled",t._listenForStall),e.removeEventListener("pause",t._listenForStall),e.removeEventListener("suspend",t._listenForStall),e.removeEventListener("play",t._listenForContinuation),e.removeEventListener("playing",t._listenForContinuation),e.removeEventListener("progress",t._listenForContinuation),e.removeEventListener("timeupdate",t._listenForContinuation)})),this._disposables.add(this._clearRebufferingListener)}},{key:"dispose",value:function(){this._disposables.dispose()}},{key:"durationSincePageLoad",get:function(){var e=Date.now();return new C(e-this._pageLoadTime).toIsoString()}},{key:"callTimeToFirstFrame",value:function(){var e=Date.now();this.pushTimeToFirstFrame(e),this.pushChannelCreationTimeToFirstFrame(e),this._clearTimeToFirstFrameListener.dispose()}},{key:"pushTimeToFirstFrame",value:function(e){this._timeToFirstFrame=e-this._startRecordingFirstFrame,this._metricsService.push({metricType:S.Z.TimeToFirstFrame,runtime:(e-this._pageLoadTime)/1e3,value:{uint64:this._timeToFirstFrame},streamId:this._streamId}),this._logger.info("[%s] [%s] First frame [%s]",this.durationSincePageLoad,this._streamId,new C(this._timeToFirstFrame).toIsoString())}},{key:"pushChannelCreationTimeToFirstFrame",value:function(e){this._channelCreationTimeToFirstFrame=e-this._channelStartTime,this._metricsService.push({metricType:S.Z.ChannelCreationTimeToFirstFrame,runtime:(e-this._pageLoadTime)/1e3,value:{uint64:this._channelCreationTimeToFirstFrame},streamId:this._streamId}),this._logger.info("[%s] [%s] Channel creation to first frame [%s]",this.durationSincePageLoad,this._streamId,new C(this._channelCreationTimeToFirstFrame).toIsoString())}},{key:"onStall",value:function(){this._videoStalled||(this._metricsService.push({metricType:S.Z.Stalled,runtime:(Date.now()-this._pageLoadTime)/1e3,streamId:this._streamId}),this._videoStalled=Date.now(),this._logger.info("[%s] [%s] [buffering] Stream has stalled",this.durationSincePageLoad,this._streamId))}},{key:"onContinuation",value:function(e,t){if(t.buffered){var n=t.buffered.length,r=!("playing"===e.type||n>0)||("progress"===e.type||"timeupdate"===e.type)&&t.buffered.end(n-1)===this._lastProgress;if(this._videoStalled&&!r){"progress"===e.type&&(this._lastProgress=t.buffered.end(n-1));var i=Date.now()-this._videoStalled;this._metricsService.push({metricType:S.Z.Buffering,runtime:(Date.now()-this._pageLoadTime)/1e3,value:{uint64:i},streamId:this._streamId}),this._logger.info("[%s] [%s] [buffering] Stream has recovered from stall after [%s]",this.durationSincePageLoad,this._streamId,new C(i).toIsoString()),this._videoStalled=null}}}},{key:"onVideoResolutionChanges",value:function(e){this._metricsService.push({metricType:S.Z.ResolutionChanged,runtime:(Date.now()-this._pageLoadTime)/1e3,value:{string:e},previousValue:this._videoResolution?{string:this._videoResolution}:void 0,streamId:this._streamId}),this._videoResolution=e}}]),e}(),E=n(4574),L=function(){function e(t){a()(this,e),d()(this,"_logger",v.Z.getLogger("StreamSetupListener")),d()(this,"metricsService",y.Z.metricsService),d()(this,"_pageLoadTime",void 0),d()(this,"_startTime",void 0),d()(this,"_metricSubmitted",!1),this._startTime=Date.now(),this._pageLoadTime=t}return u()(e,[{key:"success",value:function(e){this.recordStreamMetric(S.Z.SetupCompleted,e)}},{key:"fail",value:function(){this.recordStreamMetric(S.Z.SetupFailed)}},{key:"recordStreamMetric",value:function(e,t){if(!this._metricSubmitted){this._metricSubmitted=!0;var n=Date.now(),r=n-this._startTime,i=new E.Z(e).getName();this.metricsService.push({metricType:e,runtime:(n-this._pageLoadTime)/1e3,value:{uint64:r},streamId:t}),this._logger.info("[%s] [%s] Stream metric [%s] in [%s]",new C(n-this._pageLoadTime).toIsoString(),t,i,new C(r).toIsoString())}}}]),e}(),P=n(7426),O=function(){function e(){a()(this,e),d()(this,"_disposables",new k.Z),d()(this,"_isSupported",navigator&&navigator.connection),d()(this,"_rtt",new P.Z(void 0)),d()(this,"_effectiveType",new P.Z(void 0)),d()(this,"_downlinkThroughputCapacity",new P.Z(void 0)),this.isSupported&&(this.setupNetworkChangeListeners(),this.updateStatistics())}return u()(e,[{key:"isSupported",get:function(){return this._isSupported}},{key:"rtt",get:function(){return this._rtt}},{key:"effectiveType",get:function(){return this._effectiveType}},{key:"downlinkThroughputCapacity",get:function(){return this._downlinkThroughputCapacity}},{key:"dispose",value:function(){this._disposables.dispose()}},{key:"getDownlinkThroughputCapacity",value:function(){return this.isSupported?navigator.connection.downlink||navigator.connection.downlinkMax:-1}},{key:"getEffectiveType",value:function(){return this.isSupported?navigator.connection.effectiveType||navigator.connection.type:"Unknown"}},{key:"getRoundTripTime",value:function(){return navigator.connection.rtt}},{key:"setupNetworkChangeListeners",value:function(){var e=this,t=function(){e.updateStatistics()};navigator.connection.addEventListener("change",t),this._disposables.add(new w.Z((function(){navigator.connection.removeEventListener("change",t)})))}},{key:"updateStatistics",value:function(){this._rtt.value=this.getRoundTripTime(),this._effectiveType.value=this.getEffectiveType(),this._downlinkThroughputCapacity.value=this.getDownlinkThroughputCapacity()}}]),e}(),R=function(){function e(t,n){var r=this;a()(this,e),d()(this,"_logger",v.Z.getLogger("SessionTelemetry")),d()(this,"_metricsService",void 0),d()(this,"_applicationActivityMonitor",y.Z.applicationActivityMonitor),d()(this,"_networkMonitor",new O),d()(this,"_pageLoadTime",void 0),d()(this,"_disposables",new k.Z),d()(this,"_lastNetworkStatistics",{}),this._pageLoadTime=t,this._disposables.add(this._networkMonitor),this._metricsService=n,this._networkMonitor.isSupported&&(this._disposables.add(this._applicationActivityMonitor.isForeground.subscribe((function(e){r.recordForegroundChange(e)}))),this._disposables.add(this._networkMonitor.rtt.subscribe((function(e){r.recordNetworkRTTUpdate(e)}))),this._disposables.add(this._networkMonitor.effectiveType.subscribe((function(e){r.recordNetworkTypeChangeUpdate(e)}))),this._disposables.add(this._networkMonitor.downlinkThroughputCapacity.subscribe((function(e){r.recordNetworkDownlinkThroughputCapacityUpdate(e)}))))}return u()(e,[{key:"listenOnStreamSetup",value:function(){return new L(this._pageLoadTime)}},{key:"dispose",value:function(){this._disposables.dispose()}},{key:"recordForegroundChange",value:function(e){var t=Date.now(),n=this._applicationActivityMonitor.getTimeSinceLastChange();this._metricsService.push({metricType:e?S.Z.ApplicationForeground:S.Z.ApplicationBackground,runtime:(t-this._pageLoadTime)/1e3,value:{uint64:n}}),this._logger.info("Application has gone into the [%s] after [%s] ms",e?"foreground":"background",new C(n).toIsoString())}},{key:"recordNetworkRTTUpdate",value:function(e){var t=Date.now(),n=this._lastNetworkStatistics.rtt;this._lastNetworkStatistics.rtt=e,this._metricsService.push({metricType:S.Z.RoundTripTime,runtime:(t-this._pageLoadTime)/1e3,value:{uint64:e},previousValue:n?{uint64:n}:void 0,resource:"navigator"}),this._logger.info("[%s] Network RTT changed to [%s] from [%s]",new C(t-this._pageLoadTime).toIsoString(),e,n)}},{key:"recordNetworkTypeChangeUpdate",value:function(e){var t=Date.now(),n=this._lastNetworkStatistics.effectiveType;this._lastNetworkStatistics.effectiveType=e,this._metricsService.push({metricType:S.Z.NetworkType,runtime:(t-this._pageLoadTime)/1e3,value:{string:e},previousValue:n?{string:n}:void 0}),this._logger.info("[%s] Network effective type has changed to [%s] from [%s]",new C(t-this._pageLoadTime).toIsoString(),e,n)}},{key:"recordNetworkDownlinkThroughputCapacityUpdate",value:function(e){var t=Date.now(),n=this._lastNetworkStatistics.downlinkThroughputCapacity;this._lastNetworkStatistics.downlinkThroughputCapacity=e,this._metricsService.push({metricType:S.Z.DownlinkThroughputCapacity,runtime:(t-this._pageLoadTime)/1e3,value:{float:e},previousValue:n?{float:n}:void 0}),this._logger.info("[%s] Network downlink throughput capacity changed to [%s] from [%s]",new C(t-this._pageLoadTime).toIsoString(),e,n)}}]),e}();!function(e){e[e.Keep=0]="Keep",e[e.Reset=1]="Reset"}(r||(r={})),function(e){e[e.Normal=0]="Normal",e[e.Force=1]="Force",e[e.Reset=2]="Reset"}(i||(i={}));var Z=u()((function e(t){a()(this,e),d()(this,"token",void 0),d()(this,"tokenExpiring",void 0),this.token=new P.Z(t),this.tokenExpiring=new P.Z(!1)})),I=function(){function e(t){a()(this,e),d()(this,"channelInitialization",void 0),d()(this,"disposables",void 0),d()(this,"channelDisposables",void 0),d()(this,"rendererDisposables",void 0),d()(this,"videoElement",void 0),d()(this,"state",void 0),d()(this,"autoMuted",void 0),d()(this,"autoPaused",void 0),d()(this,"authorized",void 0),d()(this,"online",void 0),d()(this,"loading",void 0),d()(this,"playing",void 0),d()(this,"standby",void 0),d()(this,"stopped",void 0),d()(this,"targetLag",void 0),d()(this,"lag",void 0),d()(this,"bitrateLimit",void 0),d()(this,"resolution",void 0),d()(this,"failureCount",void 0),d()(this,"endPoint",void 0),d()(this,"stream",void 0),d()(this,"rtcStatistics",void 0),d()(this,"videoTelemetry",void 0),d()(this,"rtcAudioStatistic",void 0),d()(this,"rtcVideoStatistic",void 0),d()(this,"clearFailureCountTimeout",void 0),this.disposables=new k.Z,this.channelDisposables=new k.Z,this.rendererDisposables=new k.Z,this.channelInitialization=new Date,this.videoElement=new P.Z(null),this.state=new P.Z(_.Z.Starting),this.autoMuted=new P.Z(!1),this.autoPaused=new P.Z(!1),this.authorized=new P.Z(!0),this.online=new P.Z(!0),this.loading=new P.Z(!1),this.playing=new P.Z(!1),this.standby=new P.Z(!1),this.stopped=new P.Z(!1),this.targetLag=new P.Z(t),this.lag=new P.Z(0),this.bitrateLimit=new P.Z(0),this.resolution=new P.Z(m.empty),this.failureCount=new P.Z(0),this.endPoint=new P.Z(null),this.stream=new P.Z(null),this.rtcStatistics=new P.Z(null)}return u()(e,[{key:"streamId",get:function(){var e=this.stream.value;return e?e.streamId:"-"}},{key:"applyStatus",value:function(e){switch(e){case"ok":break;case"unauthorized":case"geo-restricted":case"geo-blocked":this.authorized.value=!1;case"no-stream":case"not-found":return this.failureCount.value=0,this.playing.value=!1,this.standby.value=!0,this.stopped.value=!1,void(this.stream.value=null);default:return this.failureCount.value++,this.playing.value=!1,this.standby.value=!0,this.stopped.value=!1,this.stream.value=null,void(this.state.value=_.Z.Error)}}},{key:"applySessionAndStreamPropertiesToVideoElement",value:function(){this.videoElement.value&&this.videoElement.value.dataset&&(this.videoElement.value.dataset.sessionId=y.Z.clientSessionId,this.videoElement.value.dataset.streamId=this.streamId)}},{key:"mapSubscribeStatusToChannelStatus",value:function(e){switch(e){case"ok":return _.Z.Starting;case"no-stream":case"not-found":return _.Z.StandBy;case"geo-restricted":return _.Z.GeoRestricted;case"geo-blocked":return _.Z.GeoBlocked;case"unauthorized":return _.Z.Unauthorized;case"capacity":case"rate-limited":case"timeout":return _.Z.Recovering;case"failed":return _.Z.Error;default:(0,b.Z)(e)}}}]),e}(),A=u()((function e(){a()(this,e),d()(this,"mediaStream",void 0),d()(this,"peerConnection",void 0),d()(this,"peerConnectionReconnectAttempts",void 0),this.mediaStream=new P.Z(null),this.peerConnection=new P.Z(null),this.peerConnectionReconnectAttempts=0})),D=u()((function e(){a()(this,e),d()(this,"isStarting",void 0),d()(this,"isDisposed",void 0),this.isStarting=new P.Z(!1),this.isDisposed=!1})),F=(n(6699),n(2023),n(4916),n(4723),n(1249),n(3123),n(4765),n(319)),j=n.n(F),M=n(8862),N=function(){function e(){a()(this,e)}return u()(e,null,[{key:"convertBitrateModeToBitrateModeType",value:function(e){switch(e){case i.Normal:return"Normal";case i.Force:return"Force";case i.Reset:return"Reset";default:(0,b.Z)(e)}}}]),e}(),U=function(){function e(){a()(this,e)}return u()(e,null,[{key:"convertBitrateStateToBitrateStateType",value:function(e){switch(e){case r.Keep:return"Keep";case r.Reset:return"Reset";default:(0,b.Z)(e)}}}]),e}(),V=n(202).default,B=function(){function e(t,n){if(a()(this,e),d()(this,"_logger",v.Z.getLogger("EndPoint")),d()(this,"_uri",void 0),d()(this,"_timeout",void 0),d()(this,"_roundTripTime",void 0),this._uri=t,this._timeout=n,!n)throw new Error("End point requires a timeout")}var t,n,r,i,o,s,c,h,f,g,m,y;return u()(e,[{key:"roundTripTime",get:function(){return this._roundTripTime}},{key:"toString",value:function(){return"EndPoint[uri=".concat(this._uri,"]")}},{key:"ping",value:(y=l()(p().mark((function e(){var t,n,r,i,o=this;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.buildPingUrl(),n=Date.now(),e.next=4,V.race([fetch(t,{method:"GET",cache:"no-cache"}),new V((function(e,n){return setTimeout((function(){return n(new Error("Ping timed out [".concat(t,"]")))}),o._timeout)}))]);case 4:if(r=e.sent,i=Date.now(),r.ok){e.next=8;break}throw new Error("Ping failed [".concat(t,"] [").concat(r.status,"]"));case 8:return this._roundTripTime=i-n,e.abrupt("return",this._roundTripTime);case 10:case"end":return e.stop()}}),e,this)}))),function(){return y.apply(this,arguments)})},{key:"subscribe",value:(m=l()(p().mark((function e(t,n,r){var i,o,a,s,u,c,l,h,d,f,v,g,m,y=this;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((i=x.Z.parseToken(t))&&i.applicationId){e.next=4;break}return this._logger.error("Failed to parse token [%s]",t),e.abrupt("return",{status:"unauthorized"});case 4:return o=i.applicationId,a=this.buildUrl([o,"stream","subscribe"]).toString(),s=new FormData,u=M.Z.sdkVersion,0===r&&n?(c={apiVersion:6,clientVersion:u,edgeAuthToken:t,failureCount:r,httpRoundTripTime:this._roundTripTime,setRemoteDescription:{apiVersion:6,sessionDescription:{type:this.convertRTCSdpTypeToSdpType(n.type),sdp:n.sdp}},createAnswerDescription:{apiVersion:6}},s.append("jsonBody",JSON.stringify(c))):(l={apiVersion:6,clientVersion:u,edgeAuthToken:t,failureCount:r,httpRoundTripTime:this._roundTripTime,createOfferDescription:{apiVersion:6}},s.append("jsonBody",JSON.stringify(l))),h=Date.now(),e.prev=10,f=null,e.next=14,V.race([fetch(a,{method:"POST",body:s}),new V((function(e){return f=window.setTimeout((function(){y._logger.error("Failed to subscribe",new Error("Subscribe timed out [".concat(a,"]"))),e({status:408})}),y._timeout)}))]).finally((function(){f&&clearTimeout(f)}));case 14:d=e.sent,e.next=21;break;case 17:return e.prev=17,e.t0=e.catch(10),this._logger.error("Failed to subscribe",e.t0),e.abrupt("return",{status:"failed"});case 21:if("ok"===(v=this.mapHttpStatusToSubscribeStatus(d))){e.next=24;break}return e.abrupt("return",{status:v});case 24:return g=Date.now(),e.next=27,this.convertHttpResponseToSubscribeResponse(o,d);case 27:return m=e.sent,this._logger.debug("Got subscribe response [%j] in [%s] ms",m,g-h),e.abrupt("return",m);case 30:case"end":return e.stop()}}),e,this,[[10,17]])}))),function(e,t,n){return m.apply(this,arguments)})},{key:"publish",value:(g=l()(p().mark((function e(t,n,r,i){var o,a,s,u,c,l,h,d,f,v,g,m,y,_=this;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((o=x.Z.parseToken(n))&&o.applicationId){e.next=4;break}return this._logger.error("Failed to parse token [%s]",n),e.abrupt("return",{status:"unauthorized"});case 4:return a=o.applicationId,s=this.buildUrl([a,"stream","publish"]).toString(),u=new FormData,c=M.Z.sdkVersion,0===i&&r?(l={apiVersion:6,clientVersion:c,edgeAuthToken:n,failureCount:i,httpRoundTripTime:this._roundTripTime,name:t,setRemoteDescription:{apiVersion:6,sessionDescription:{type:this.convertRTCSdpTypeToSdpType(r.type),sdp:r.sdp}},createAnswerDescription:{streamId:"",options:["upload"],apiVersion:6}},u.append("jsonBody",JSON.stringify(l))):(h={apiVersion:6,clientVersion:c,edgeAuthToken:n,failureCount:i,httpRoundTripTime:this._roundTripTime,name:t,createOfferDescription:{streamId:"",options:["upload"],apiVersion:6}},u.append("jsonBody",JSON.stringify(h))),d=Date.now(),e.prev=10,v=null,e.next=14,V.race([fetch(s,{method:"POST",body:u}),new V((function(e){return v=window.setTimeout((function(){_._logger.error("Failed to publish",new Error("Publish timed out [".concat(s,"]"))),e({status:408})}),_._timeout)}))]).finally((function(){v&&clearTimeout(v)}));case 14:f=e.sent,e.next=21;break;case 17:return e.prev=17,e.t0=e.catch(10),this._logger.error("Failed to publish",e.t0),e.abrupt("return",{status:"failed"});case 21:if("ok"===(g=this.mapHttpStatusToPublishStatus(f))){e.next=24;break}return e.abrupt("return",{status:g});case 24:return m=Date.now(),e.next=27,this.convertHttpResponseToPublishResponse(a,f);case 27:return y=e.sent,this._logger.debug("Got publish response [%j] in [%s] ms",y,m-d),e.abrupt("return",y);case 30:case"end":return e.stop()}}),e,this,[[10,17]])}))),function(e,t,n,r){return g.apply(this,arguments)})},{key:"setRemoteDescription",value:(f=l()(p().mark((function e(t,n){var r,i,o,a,s,u,c,l,h,d=this;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this.buildUrl([t.tenancy,"stream",t.streamId,"description","remote"]).toString(),i=new FormData,o={apiVersion:6,sharedSecret:t.sharedSecret,sessionDescription:{type:this.convertRTCSdpTypeToSdpType(n.type),sdp:n.sdp}},i.append("jsonBody",JSON.stringify(o)),a=Date.now(),e.prev=5,u=null,e.next=9,V.race([fetch(r,{method:"POST",body:i}),new V((function(e){return u=window.setTimeout((function(){d._logger.error("Failed to set remote description",new Error("Set remote description timed out [".concat(r,"]"))),e({status:408})}),d._timeout)}))]).finally((function(){u&&clearTimeout(u)}));case 9:s=e.sent,e.next=16;break;case 12:return e.prev=12,e.t0=e.catch(5),this._logger.error("Failed to set remote description",e.t0),e.abrupt("return",{status:"failed"});case 16:if("ok"===(c=this.mapHttpStatusToSetRemoteDescriptionStatus(s))){e.next=19;break}return e.abrupt("return",{status:c});case 19:return l=Date.now(),e.next=22,this.convertHttpResponseToSetRemoteDescriptionResponse(s);case 22:return h=e.sent,this._logger.debug("Got set remote description response [%j] in [%s] ms",h,l-a),e.abrupt("return",h);case 25:case"end":return e.stop()}}),e,this,[[5,12]])}))),function(e,t){return f.apply(this,arguments)})},{key:"limitBitrate",value:(h=l()(p().mark((function e(t,n,r,i,o){var a,s,u,c,l,h,d,f,v=this;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=this.buildUrl([t.tenancy,"stream",t.streamId,"bitrate"]).toString(),s=new FormData,u={apiVersion:6,sharedSecret:t.sharedSecret,elapsedInMilliseconds:n,bitrateInBitsPerSecond:r,bitrateState:U.convertBitrateStateToBitrateStateType(i),bitrateMode:N.convertBitrateModeToBitrateModeType(o)},s.append("jsonBody",JSON.stringify(u)),c=Date.now(),e.prev=5,h=null,e.next=9,V.race([fetch(a,{method:"POST",body:s}),new V((function(e){return h=window.setTimeout((function(){v._logger.error("Failed to set limit bitrate timed",new Error("Set limit bitrate timed out [".concat(a,"]"))),e({status:408})}),v._timeout)}))]).finally((function(){h&&clearTimeout(h)}));case 9:l=e.sent,e.next=16;break;case 12:return e.prev=12,e.t0=e.catch(5),this._logger.error("Failed to set limit bitrate timed",e.t0),e.abrupt("return",{status:"failed"});case 16:return d=this.mapHttpStatusToSetTemporaryMaximalBitrateStatus(l),f=Date.now(),this._logger.info("Got set limit bitrate response [%s] in [%s] ms",d,f-c),e.abrupt("return",{status:d});case 20:case"end":return e.stop()}}),e,this,[[5,12]])}))),function(e,t,n,r,i){return h.apply(this,arguments)})},{key:"addIceCandidates",value:(c=l()(p().mark((function e(t,n,r){var i,o,a,s,u,c,l,h,d,f,v=this,g=arguments;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=g.length>3&&void 0!==g[3]?g[3]:[],o=this.buildUrl([t.tenancy,"stream",t.streamId,"ice","candidates"]).toString(),a=new FormData,s={apiVersion:6,sharedSecret:t.sharedSecret,candidates:n,discoveryCompleted:r,options:i},a.append("jsonBody",JSON.stringify(s)),u=Date.now(),e.prev=6,l=null,e.next=10,V.race([fetch(o,{method:"POST",body:a}),new V((function(e){return l=window.setTimeout((function(){v._logger.error("Failed to add ice candidates",new Error("Add ice candidates timed out [".concat(o,"]"))),e({status:408})}),v._timeout)}))]).finally((function(){l&&clearTimeout(l)}));case 10:c=e.sent,e.next=17;break;case 13:return e.prev=13,e.t0=e.catch(6),this._logger.error("Failed to add ice candidates",e.t0),e.abrupt("return",{status:"failed"});case 17:if("ok"===(h=this.mapHttpStatusToAddIceCandidatesStatus(c))){e.next=20;break}return e.abrupt("return",{status:h});case 20:return d=Date.now(),e.next=23,this.convertHttpResponseToAddIceCandidatesResponse(c);case 23:return f=e.sent,this._logger.info("Got add ICE candidates response [%j] in [%s] ms",f,d-u),e.abrupt("return",f);case 26:case"end":return e.stop()}}),e,this,[[6,13]])}))),function(e,t,n){return c.apply(this,arguments)})},{key:"destroyStream",value:(s=l()(p().mark((function e(t,n){var r,i,o,a,s,u,c,l,h,d=this;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this.buildUrl([t.tenancy,"stream",t.streamId,"destroy"]).toString(),i=new FormData,o={apiVersion:6,sharedSecret:t.sharedSecret,reason:n,options:[]},i.append("jsonBody",JSON.stringify(o)),a=Date.now(),e.prev=5,u=null,e.next=9,V.race([fetch(r,{method:"POST",body:i,cache:"no-cache"}),new V((function(e){return u=window.setTimeout((function(){d._logger.error("Failed to subscribe",new Error("Delete stream timed out [".concat(r,"]"))),e({status:408})}),d._timeout)}))]).finally((function(){u&&clearTimeout(u)}));case 9:s=e.sent,e.next=16;break;case 12:return e.prev=12,e.t0=e.catch(5),this._logger.error("Failed to delete stream",e.t0),e.abrupt("return",{status:"failed"});case 16:if("ok"===(c=this.mapHttpStatusToSetDestroyStreamStatus(s))){e.next=19;break}return e.abrupt("return",{status:c});case 19:return l=Date.now(),e.next=22,this.convertHttpResponseToDestroyStreamResponse(s);case 22:return h=e.sent,this._logger.info("Got destroy stream response [%j] in [%s] ms",h,l-a),e.abrupt("return",h);case 25:case"end":return e.stop()}}),e,this,[[5,12]])}))),function(e,t){return s.apply(this,arguments)})},{key:"buildUrl",value:function(e){var t=new URL(this._uri),n=t.pathname.split("/");return n.length=n.length-1,t.pathname=n.concat.apply(n,j()(e)).join("/"),t}},{key:"buildPingUrl",value:function(){var e=new URL(this._uri),t=M.Z.sdkVersion;return e.search="?".concat(new URLSearchParams([["type","http"],["version",t],["_","".concat(Date.now())]]).toString()),e.toString()}},{key:"mapHttpStatusToPublishStatus",value:function(e){if(!e)return"failed";switch(e.status){case 200:return"ok";case 401:return"unauthorized";case 402:return"geo-restricted";case 403:return"geo-blocked";case 408:return"timeout";case 503:return"capacity";case 504:return"rate-limited";default:return"failed"}}},{key:"mapHttpStatusToSubscribeStatus",value:function(e){if(!e)return"failed";switch(e.status){case 200:return"ok";case 401:return"unauthorized";case 402:return"geo-restricted";case 403:return"geo-blocked";case 408:return"timeout";case 503:return"capacity";case 504:return"rate-limited";default:return"failed"}}},{key:"mapHttpStatusToSetRemoteDescriptionStatus",value:function(e){if(!e)return"failed";switch(e.status){case 200:return"ok";case 401:return"unauthorized";case 408:return"timeout";case 503:return"capacity";case 504:return"rate-limited";default:return"failed"}}},{key:"mapHttpStatusToSetTemporaryMaximalBitrateStatus",value:function(e){if(!e)return"failed";switch(e.status){case 200:return"ok";case 401:return"unauthorized";case 408:return"timeout";case 503:return"capacity";case 504:return"rate-limited";default:return"failed"}}},{key:"mapHttpStatusToAddIceCandidatesStatus",value:function(e){if(!e)return"failed";switch(e.status){case 200:return"ok";case 401:return"unauthorized";case 408:return"timeout";case 503:return"capacity";case 504:return"rate-limited";default:return"failed"}}},{key:"mapHttpStatusToSetDestroyStreamStatus",value:function(e){if(!e)return"failed";switch(e.status){case 200:return"ok";case 401:return"unauthorized";case 408:return"timeout";case 503:return"capacity";case 504:return"rate-limited";default:return"failed"}}},{key:"convertHttpResponseToSubscribeResponse",value:(o=l()(p().mark((function e(t,n){var r,i;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.json();case 2:return r=e.sent,(i={status:r.status}).stream={tenancy:t,streamId:r.streamId,sharedSecret:r.sharedSecret},i.lag=r.lag,r&&(r.rtcConfiguration&&(i.rtcConfiguration=this.convertIRtcConfigurationToRTCConfiguration(r.rtcConfiguration)),r.setRemoteDescriptionResponse&&r.setRemoteDescriptionResponse.sessionDescription&&(i.setRemoteDescriptionResponse={sessionDescription:this.convertISessionDescriptionToRTCSessionDescription(r.setRemoteDescriptionResponse.sessionDescription)}),r.createAnswerDescriptionResponse&&r.createAnswerDescriptionResponse.sessionDescription&&(i.createAnswerDescriptionResponse={sessionDescription:this.convertISessionDescriptionToRTCSessionDescription(r.createAnswerDescriptionResponse.sessionDescription)}),r.createOfferDescriptionResponse&&r.createOfferDescriptionResponse.sessionDescription&&(i.createOfferDescriptionResponse={sessionDescription:this.convertISessionDescriptionToRTCSessionDescription(r.createOfferDescriptionResponse.sessionDescription)})),e.abrupt("return",i);case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return o.apply(this,arguments)})},{key:"convertHttpResponseToPublishResponse",value:(i=l()(p().mark((function e(t,n){var r,i;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.json();case 2:return r=e.sent,(i={status:r.status}).stream={tenancy:t,streamId:r.streamId,sharedSecret:r.sharedSecret},r&&(r.rtcConfiguration&&(i.rtcConfiguration=this.convertIRtcConfigurationToRTCConfiguration(r.rtcConfiguration)),r.setRemoteDescriptionResponse&&r.setRemoteDescriptionResponse.sessionDescription&&(i.setRemoteDescriptionResponse={sessionDescription:this.convertISessionDescriptionToRTCSessionDescription(r.setRemoteDescriptionResponse.sessionDescription)}),r.createAnswerDescriptionResponse&&r.createAnswerDescriptionResponse.sessionDescription&&(i.createAnswerDescriptionResponse={sessionDescription:this.convertISessionDescriptionToRTCSessionDescription(r.createAnswerDescriptionResponse.sessionDescription)}),r.createOfferDescriptionResponse&&r.createOfferDescriptionResponse.sessionDescription&&(i.createOfferDescriptionResponse={sessionDescription:this.convertISessionDescriptionToRTCSessionDescription(r.createOfferDescriptionResponse.sessionDescription)})),e.abrupt("return",i);case 7:case"end":return e.stop()}}),e,this)}))),function(e,t){return i.apply(this,arguments)})},{key:"convertIRtcConfigurationToRTCConfiguration",value:function(e){var t={};if(e.bundlePolicy)switch(e.bundlePolicy){case"BundlePolicyBalanced":t.bundlePolicy="balanced";break;case"BundlePolicyMaxCompat":t.bundlePolicy="max-compat";break;case"BundlePolicyMaxBundle":t.bundlePolicy="max-bundle";break;default:(0,b.Z)(e.bundlePolicy)}if("number"==typeof e.iceCandidatePoolSize&&(t.iceCandidatePoolSize=e.iceCandidatePoolSize),e.iceServers){for(var n=[],r=0;r<e.iceServers.length;r++)n.push({urls:e.iceServers[r].urls,username:e.iceServers[r].username,credential:e.iceServers[r].credential});t.iceServers=n}if(e.iceTransportPolicy)switch(e.iceTransportPolicy){case"IceTransportPolicyAll":t.iceTransportPolicy="all";break;case"IceTransportPolicyRelay":t.iceTransportPolicy="relay";break;case"IceTransportPolicyPublic":break;default:(0,b.Z)(e.iceTransportPolicy)}if(e.peerIdentity&&(t.peerIdentity=e.peerIdentity),e.rtcpMuxPolicy)switch(e.rtcpMuxPolicy){case"RtcpMuxPolicyNegotiate":t.rtcpMuxPolicy="negotiate";break;case"RtcpMuxPolicyRequire":t.rtcpMuxPolicy="require";break;default:(0,b.Z)(e.rtcpMuxPolicy)}return t}},{key:"convertISessionDescriptionToRTCSessionDescription",value:function(e){var t={sdp:e.sdp};switch(e.type){case"Offer":t.type="offer";break;case"Answer":t.type="answer";break;default:(0,b.Z)(e.type)}return t}},{key:"convertHttpResponseToSetRemoteDescriptionResponse",value:(r=l()(p().mark((function e(t){var n,r;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.json();case 2:return n=e.sent,r={status:n.status},n&&n.sessionDescription&&(r.sessionDescription=this.convertISessionDescriptionToRTCSessionDescription(n.sessionDescription)),e.abrupt("return",r);case 6:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"convertHttpResponseToAddIceCandidatesResponse",value:(n=l()(p().mark((function e(t){var n,r;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.json();case 2:return n=e.sent,r={status:n.status,options:[]},n&&n.options&&(r.options=n.options),e.abrupt("return",r);case 6:case"end":return e.stop()}}),e)}))),function(e){return n.apply(this,arguments)})},{key:"convertHttpResponseToDestroyStreamResponse",value:(t=l()(p().mark((function e(t){var n,r;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.json();case 2:return n=e.sent,r={status:n.status},e.abrupt("return",r);case 5:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})},{key:"convertRTCSdpTypeToSdpType",value:function(e){switch(e){case"answer":return"Answer";case"offer":return"Offer";case"pranswer":case"rollback":throw new Error("SDP type [".concat(e,"] is not supported"));default:(0,b.Z)(e)}}}]),e}(),G=n(5564),H=n(6062),z=n(202).default,W=function(){function e(t){if(a()(this,e),d()(this,"_logger",v.Z.getLogger("Discovery")),d()(this,"_metricsService",void 0),d()(this,"_uri",void 0),!t)throw new Error("Discovery requires uri");this._metricsService=H.Z.getMetricsService(t.toString()),this._uri=t}var t,n;return u()(e,[{key:"discoverNearbyEndPoints",value:(n=l()(p().mark((function e(t,n){var r,i,o,a;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n){e.next=2;break}throw new Error("Discovery requires timeout");case 2:return r=t.toString(),e.next=5,z.race([fetch(r,{method:"GET",cache:"no-cache"}),new z((function(e,t){return setTimeout((function(){return t(new Error("Discovery timed out [".concat(r,"]")))}),n)}))]);case 5:if((i=e.sent).ok){e.next=8;break}throw new Error("Discovery failed [".concat(r,"] [").concat(i.status,"]"));case 8:if(null!==i.body){e.next=10;break}throw new Error("Discovery failed with no data [".concat(r,"]"));case 10:return e.next=12,i.text();case 12:return o=e.sent,a=o.split(","),e.abrupt("return",a.map((function(e){return new B(e,n)})));case 15:case"end":return e.stop()}}),e)}))),function(e,t){return n.apply(this,arguments)})},{key:"discoverClosestEndPoint",value:(t=l()(p().mark((function e(){var t,n,r,i,o,a=this,s=arguments;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=s.length>0&&void 0!==s[0]?s[0]:2e4,n=G.Z.buildDiscoveryUrl(this._uri),e.next=4,this.discoverNearbyEndPoints(new URL(n),t);case 4:return r=e.sent,i=function(){return new z((function(){a._logger.info("Request [%s] failed, preventing it from completing",n)}))},e.next=8,z.race(r.map((function(e){return e.ping().catch((function(t){return a._logger.warn("Failed to ping end point [%s]",e,t),i()})).then((function(t){var n=Date.now();return a._logger.info("Discovered end point [%s] with time [%s]",e.toString(),t),a._metricsService.push({metricType:S.Z.RoundTripTime,runtime:(n-y.Z.pageLoadTime)/1e3,value:{uint64:t||0},resource:e.toString(),kind:"ping"}),e}))})));case 8:return o=e.sent,e.abrupt("return",o);case 10:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}(),q=function(){function e(){throw a()(this,e),new Error("Discovery is a static class that may not be instantiated")}var t,n;return u()(e,null,[{key:"precacheClosestEndPointDiscovery",value:(n=l()(p().mark((function t(){var n;return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=new URL(y.Z.discoveryUri.value),t.abrupt("return",e.discoverClosestEndPointWithCaching(n));case 2:case"end":return t.stop()}}),t)}))),function(){return n.apply(this,arguments)})},{key:"discoverClosestEndPointWithCaching",value:(t=l()(p().mark((function t(n){var r,i,o;return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=n.toString(),!e._cache[r]){t.next=3;break}return t.abrupt("return",e._cache[r]);case 3:return i=new W(n),o=e._cache[r]=i.discoverClosestEndPoint(),e._cache[r].then((function(){setTimeout((function(){e._cache[r]===o&&delete e._cache[r]}),6e4)})).catch((function(t){throw delete e._cache[r],t})),t.abrupt("return",o);case 7:case"end":return t.stop()}}),t)}))),function(e){return t.apply(this,arguments)})}]),e}();d()(q,"_cache",{}),q.precacheClosestEndPointDiscovery(),n(2526),n(1817),n(1058),n(5306),n(2772),n(9826),n(4553),n(561),n(8309),n(9601);var J,$=n(9845),K=n(4827),X={width:480,height:360,videoWidth:480,videoHeight:360,muted:!1,volume:1,currentTime:0,duration:1/0,readyState:0,ended:!1,buffered:null,autoplay:!0},Y="Edge"===$.Z.browserName,Q=function(){function e(t,n,r){var i=this;a()(this,e),d()(this,"_logger",v.Z.getLogger("FlashPlayer")),d()(this,"_isVideo",void 0),d()(this,"_swfSrc",void 0),d()(this,"_id",void 0),d()(this,"_width",void 0),d()(this,"_height",void 0),d()(this,"_ghost",void 0),d()(this,"_element",void 0),d()(this,"_eventDisposables",void 0),d()(this,"_disposables",new k.Z),d()(this,"_flashVars",void 0),d()(this,"_isFullscreen",void 0),this._isVideo="video"===t.tagName,this._swfSrc=r.swfSrc,this._id=t.id||r.streamId,this._width=t.clientWidth,this._height=t.clientHeight,this._ghost=t,this._element=null,this._eventDisposables=[],this._flashVars=["uid="+this._id,"autoplay=".concat(!!t.autoplay),"muted=".concat(!!t.muted),"allowScriptAccess=always","preload=true","src=".concat(JSON.stringify(n))],this._disposables.add(new w.Z((function(){i.triggerFlashEvent("fire_stop")})));try{this._element=Y?this.createMicrosoftFlashElement():this.setupCrossBrowserFlashElement(),this.setupElement()}catch(e){this._logger.error("Error while loading Flash Player "+e)}}return u()(e,[{key:"element",get:function(){return this._element}},{key:"addEventListener",value:function(e,t){if(!(this.findEventListenerIndex(e,t)>-1)){document.addEventListener(e,t);var n=new w.Z((function(){document.removeEventListener(e,t)}));this._disposables.add(n),this._eventDisposables.push({name:e,listener:t,disposable:n})}}},{key:"removeEventListener",value:function(e,t){var n=this.findEventListenerIndex(e,t);n>-1&&this._eventDisposables.splice(n,1)[0].disposable.dispose()}},{key:"triggerFlashEvent",value:function(e,t){var n=this._element[e];if(n)return n.apply(this._element,t)}},{key:"dispose",value:function(){this._disposables.dispose()}},{key:"createMicrosoftFlashElement",value:function(){return document.createElement("div")}},{key:"setupCrossBrowserFlashElement",value:function(){var e=document.createElement("embed");return e.setAttribute("id",this._id),e.setAttribute("name","__"+this._id),e.setAttribute("play","true"),e.setAttribute("loop","false"),e.setAttribute("quality","high"),e.setAttribute("bgcolor","#000000"),e.setAttribute("wmode","transparent"),e.setAttribute("allowScriptAccess","always"),e.setAttribute("allowFullScreen","true"),e.setAttribute("type","application/x-shockwave-flash"),e.setAttribute("pluginspage","//www.macromedia.com/go/getflashplayer"),e.setAttribute("src",this._swfSrc),e.setAttribute("flashvars",this._flashVars.join("&")),this._isVideo&&(e.setAttribute("width",this._width.toString()),e.setAttribute("height",this._height.toString())),e}},{key:"createParameterElement",value:function(e,t){var n=document.createElement("param");return n.setAttribute("name",e),n.setAttribute("value",t),n}},{key:"setupElement",value:function(){this._element=Object.assign(this._element,X,{id:this._id,width:this._width,height:this._height,videoWidth:this._width,videoHeight:this._height}),this.setupAccessors(),this.propagateAttributeChanges(),this.setupVolumeAndMutedListeners()}},{key:"createEvent",value:function(e,t){var n=e.match(/([a-z]+\.([a-z]+))/i),r={target:t,namespace:""};if(null!==n&&(e=n[1],r.namespace=n[2]),"IE"===$.Z.browserName&&$.Z.browserMajorVersion>8){var i=window.document.createEvent("CustomEvent");return i.initCustomEvent(e,!1,!1,r),i}return window.CustomEvent?new window.CustomEvent(e,{detail:r}):r}},{key:"getValueFromFlash",value:function(e){return(this._element["get_"+e]||function(){return null}).call(this._element)}},{key:"setupAccessors",value:function(){var e=this;window["__event__"+this._id]=function(t,n){var r=e.createEvent(t,e._element);if(n)try{r.data=JSON.parse(n),r.details.data=r.data}catch(e){r.message=n}switch(t){case"ended":e._element.ended=!0,e._element.dispatchEvent(r);break;case"error":e._element.error=r.data,e._element.dispatchEvent&&e._element.dispatchEvent(new Error(n));break;case"loadeddata":case"loadedmetadata":case"loadstart":case"progress":case"seeked":case"seeking":case"stalled":case"suspend":e._element.dispatchEvent&&e._element.dispatchEvent(r);break;case"pause":e._element.paused=!0;break;case"play":case"playing":e._element.paused=!1;break;case"timeupdate":e._element.currentTime=e.getValueFromFlash("currentTime"),e._element.dispatchEvent&&e._element.dispatchEvent(r)}e._element.dispatchEvent(r)};var t=this._element.requestFullscreen||this._element.mozRequestFullScreen||this._element.webkitRequestFullScreen||this._element.msRequestFullscreen;this._disposables.add(new w.Z((function(){delete window["__event__"+e._id]}))),this._element.play=function(){e.triggerFlashEvent("fire_play")},this._element.load=function(){e.triggerFlashEvent("fire_load")},this._element.seek=function(){e.triggerFlashEvent("fire_seek")},this._element.pause=function(){e.triggerFlashEvent("fire_pause")},this._element.requestFullscreen=function(){if(this._isFullscreen=!0,this.addListenerForExitFullScreen(),this._previousHeight=this._element.style.height,this._previousWidth=this._element.style.width,this._previousPosition=this._element.style.position,this._element.style.position="absolute",this._element.style.height="100%",this._element.style.width="100%",void 0!==window.ActiveXObject){var e=new window.ActiveXObject("WScript.Shell");null!==e&&e.SendKeys("{F11}")}t.call(this._element)};var n=function(){e.triggerFlashEvent("set_size",[e._isFullscreen?screen.width:e._element.clientWidth,e._isFullscreen?screen.height:e._element.clientHeight])};window.addEventListener("resize",n),this._disposables.add(new w.Z((function(){window.removeEventListener("resize",n)})))}},{key:"finishInitializationInDom",value:function(){if(!Y)return this._element;var e=(Y?"__"+this._id:this._id)+K.Z.random(32),t=document.createElement("object"),n=document.createElement("div"),r=[this.createParameterElement("movie",this._swfSrc+"?x="+Date.now()),this.createParameterElement("flashvars",this._flashVars.join("&")),this.createParameterElement("quality","2"),this.createParameterElement("bgcolor","#000000"),this.createParameterElement("wmode","transparent"),this.createParameterElement("allowScriptAccess","always"),this.createParameterElement("allowFullScreen","true"),n];return n.innerHTML="You are using a browser this does not have Flash player enabled or installed. Please turn on your Flash player plugin or download the latest version from https://get.adobe.com/flashplayer/",Y?(t.setAttribute("type","application/x-shockwave-flash"),t.setAttribute("data",this._swfSrc),t.setAttribute("id",e),t.setAttribute("width","__"+this._width.toString()),t.setAttribute("height","__"+this._height.toString())):(t.setAttribute("classid","clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"),t.setAttribute("codebase","//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab"),t.setAttribute("id",e),t.setAttribute("width",this._width.toString()),t.setAttribute("height",this._height.toString())),"object"in t?(r.forEach((function(e){t.object[e.name]||"value"in e&&(t.object[e.name]=e.value)})),t.appendChild(n)):r.forEach((function(e){var n=t.children.find((function(t){return"name"in e&&t.name===e.name}));return n?t.replaceChild(e,n):t.appendChild(e)})),this._element.outerHTML=t.outerHTML,window.document.getElementById&&(this._element=window.document.getElementById(e),this.setupElement()),this._element}},{key:"propagateAttributeChanges",value:function(){var e=this,t=["currentTime","paused","error","src"];if(window.MutationObserver){var n=new MutationObserver((function(n){n.forEach((function(n){"attributes"!==n.type||n.target!==e._element||t.includes(n.attributeName)||e.setFlashValue(n.attributeName,e._element[n.attributeName])}))}));n.observe(this._element,{attributes:!0}),this._disposables.add(new w.Z((function(){n.disconnect()})))}else{this._logger.info("Falling back to use of DOM event listeners. This results in degraded performance for further DOM modifications and does not work for IE prior to version 9. See https://developer.mozilla.org/en-US/docs/Web/Guide/Events/Mutation_events for details.");var r=function(n){t.includes(n.target.tagName)||e.setFlashValue(n.target.tagName,e._element[n.target.tagName])};this._element.addEventListener?(this._element.addEventListener("DOMAttrModified",r,!1),this._disposables.add(new w.Z((function(){e._element.removeEventListener("DOMAttrModified",r,!1)})))):(this._element.attachEvent("onpropertychange",r),this._disposables.add(new w.Z((function(){e._element.detachEvent("DOMAttrModified",r)}))))}}},{key:"getElement",value:function(){return this._element}},{key:"setFlashValue",value:function(e,t){return(this._element["set_"+e]||function(){return null}).call(this._element,t)}},{key:"setupVolumeAndMutedListeners",value:function(){var e=this.getMutedListener(),t=this.getVolumeListener(),n=setInterval((function(){e(),t()}),300);this._disposables.add(new w.Z((function(){clearInterval(n)})))}},{key:"getMutedListener",value:function(){var e=this;if(!this._ghost||!this._element)return function(){return null};var t=this._ghost.muted,n=this._element.muted;return function(){var r=e._element.muted,i=e._element.muted;r===t&&i===n||(r!==t&&(t=r,n=r,i=r),i!==n&&(t=r,n=r),e._element.muted=i,e._ghost.muted=i,e.setFlashValue("muted",i))}}},{key:"getVolumeListener",value:function(){var e=this;if(!this._ghost||!this._element)return function(){return null};var t=this._ghost.volume,n=this._element.volume;return function(){var r=e._element.volume,i=e._element.volume;r===t&&i===n||(r!==t&&(t=r,n=r,i=r),i!==n&&(t=r,n=r),e._element.volume=i,e._ghost.volume=i,e.setFlashValue("volume",i))}}},{key:"findEventListenerIndex",value:function(e,t){return this._eventDisposables.findIndex((function(n){return n.name===e&&n.listener===t}))}}]),e}(),ee=function(){function e(t,n,r){var i=this;a()(this,e),d()(this,"_logger",v.Z.getLogger("PhenixFlashVideo")),d()(this,"_ghost",void 0),d()(this,"_stream",void 0),d()(this,"_options",void 0),d()(this,"_disposables",new k.Z),d()(this,"_flashPlayer",void 0),d()(this,"_loaded",void 0),d()(this,"_enabled",void 0),d()(this,"_onReady",void 0),d()(this,"_video",void 0),d()(this,"_ghostInitStyleCssText",void 0),this._ghost=t,this._stream=n,this._options=r||{},this._flashPlayer=null;var o=function(e){i._loaded=!0,i._enabled=!0===e,e?i.initialize():i._logger.error("Failed to create Phenix video element"),i._onReady&&i._onReady(i._enabled)};try{this._video=this.createPhenixFlashVideoElement(),this._video.className=this._ghost.className,this._video.height=this._ghost.height,this._video.width=this._ghost.width,this._ghostInitStyleCssText=this._ghost.style.cssText,this._ghost.style.cssText="visibility:hidden !important;width:0px !important;height:0px !important;margin:0px !important;padding:0px !important;border-style:none !important;border-width:0px !important;max-width:0px !important;max-height:0px !important;outline:none !important",this._disposables.add(new w.Z((function(){i._ghost.style.cssText=i._ghostInitStyleCssText}))),this._video.onunload=function(){this._loaded=!1},this.observeInsertion(),document.body&&document.body.contains||this._logger.info("document.body.contains is not supported"),document.body&&document.body.contains&&document.body.contains(this._ghost)&&(this._ghost.parentNode.replaceChild(this._video,this._ghost),this._flashPlayer&&(this._video=this._flashPlayer.finishInitializationInDom()),this._disposables.add(new w.Z((function(){i._video.parentNode&&i._video.parentNode.replaceChild(i._ghost,i._video)})))),setTimeout((function(){o(!0)}))}catch(e){this._logger.error("Error while loading Phenix RTC "+e),o(!1)}}return u()(e,[{key:"hookUpEvents",value:function(){var e=this,t=this._ghost,n=function(){e.dispatchEvent(t,"error")},r=function(){t.muted=e._video.muted,e.dispatchEvent(t,"mute")},i=function(){t.muted=e._video.muted,e.dispatchEvent(t,"unmute")},o=function(){t.ended=e._video.ended,e.dispatchEvent(t,"ended")},a=function(){t.width=e._video.width,t.height=e._video.height,e.dispatchEvent(t,"loadedmetadata")},s=function(){t.width=e._video.width,t.height=e._video.height,e.dispatchEvent(t,"loadeddata")},u=function(){t.width=e._video.width,t.height=e._video.height,e.dispatchEvent(t,"resize")};this.addEventListener("error",n),this.addEventListener("mute",r),this.addEventListener("unmute",i),this.addEventListener("ended",o),this.addEventListener("loadedmetadata",a),this.addEventListener("loadeddata",s),this.addEventListener("resize",u);var c=new w.Z((function(){e.removeEventListener("error",n),e.removeEventListener("mute",r),e.removeEventListener("unmute",i),e.removeEventListener("ended",o),e.removeEventListener("loadedmetadata",a),e.removeEventListener("loadeddata",s),e.removeEventListener("resize",u)}));this._disposables.add(c)}},{key:"getElement",value:function(){return this._video}},{key:"onReady",value:function(e){var t=this;this._loaded?setTimeout((function(){e(t._enabled)}),1):this._onReady=e}},{key:"dispose",value:function(){this._disposables.dispose()}},{key:"addEventListener",value:function(e,t){window.addEventListener(e,t)}},{key:"removeEventListener",value:function(e,t){window.removeEventListener(e,t)}},{key:"dispatchEvent",value:function(e,t){var n;document.createEvent?(n=document.createEvent("HTMLEvents")).initEvent(t,!0,!0):(n=document.createEventObject()).eventType=t,n.eventName=t,setTimeout((function(){document.createEvent?e.dispatchEvent(n):e.fireEvent("on"+n.eventType,n)}))}},{key:"createPhenixFlashVideoElement",value:function(){var e=this;return this._flashPlayer=new Q(this._ghost,this._stream,this._options),this._disposables.add(new w.Z((function(){e._flashPlayer.dispose()}))),this._flashPlayer.getElement()}},{key:"observeInsertion",value:function(){var e=this;if(window.MutationObserver){var t=new MutationObserver((function(t){t.forEach((function(t){if("childList"===t.type)for(var n=0;n<t.addedNodes.length;n++){var r=t.addedNodes[n];t.target!==e._video&&(r===e._ghost?(t.target.replaceChild(e._video,e._ghost),e.initialize()):e.isDescendant(t.target,e._ghost)&&(e._ghost.parentNode&&e._ghost.parentNode.replaceChild(e._video,e._ghost),e.initialize()))}}))}));t.observe(document.body,{childList:!0,attributes:!1,characterData:!1,subtree:!0}),this._disposables.add(new w.Z((function(){t.disconnect()})))}else{this._logger.info("Falling back to use of DOM event listeners. This results in degraded performance for further DOM modifications and does not work for IE prior to version 9. See https://developer.mozilla.org/en-US/docs/Web/Guide/Events/Mutation_events for details.");var n=function(){e._ghost.parentNode&&e._ghost.parentNode.replaceChild(e._video,e._ghost)};this.addEventListener("DOMNodeInserted",n),this._disposables.add(new w.Z((function(){e.removeEventListener("DOMNodeInserted",n)})))}}},{key:"initialize",value:function(){this.hookUpEvents(),this.propagateAttributeChanges(),this._video.id=this._ghost.id||this._video.id,this._video.style.cssText=this._ghostInitStyleCssText,this._video.className=this._ghost.className,this._video.innerHtml=this._ghost.innerHTML,this._video.width=this._ghost.width,this._video.height=this._ghost.height,this._video.autoplay=this._ghost.autoplay,this._video.muted=this._ghost.muted,this._video.defaultMuted=this._ghost.defaultMuted,this._video.volume=this._ghost.volume}},{key:"isDescendant",value:function(e,t){for(var n=t.parentNode;null!==n;){if(n===e)return!0;n=n.parentNode}return!1}},{key:"propagateAttributeChanges",value:function(){var e=this,t=["style"];if(window.MutationObserver){var n=new MutationObserver((function(n){n.forEach((function(n){"attributes"===n.type&&n.target===e._ghost&&-1===t.indexOf(n.attributeName)&&(e._video[n.attributeName]=e._ghost[n.attributeName])}))}));n.observe(this._ghost,{attributes:!0}),this._disposables.add(new w.Z((function(){n.disconnect()})))}else{this._logger.info("Falling back to use of DOM event listeners. This results in degraded performance for further DOM modifications and does not work for IE prior to version 9. See https://developer.mozilla.org/en-US/docs/Web/Guide/Events/Mutation_events for details.");var r=function(t){e._video[t.target.tagName]=e._ghost[t.target.tagName]};this._ghost.addEventListener?(this._ghost.addEventListener("DOMAttrModified",r,!1),this._disposables.add(new w.Z((function(){e._ghost.removeEventListener("DOMAttrModified",r,!1)})))):(this._ghost.attachEvent("onpropertychange",r),this._disposables.add(new w.Z((function(){e._ghost.detachEvent("DOMAttrModified",r)}))))}}}]),e}();!function(e){e[e.NetworkEmpty=0]="NetworkEmpty",e[e.NetworkIdle=1]="NetworkIdle",e[e.NetworkLoading=2]="NetworkLoading",e[e.NetworkNoSource=3]="NetworkNoSource"}(J||(J={}));var te="rtmp-flash-renderer-2019.2.18.swf",ne={local:"https://local.phenixrts.com/public/rtmp/"+te,staging:"https://stg.phenixrts.com/public/rtmp/"+te,production:"https://phenixrts.com/public/rtmp/"+te},re=function(){function e(t,n,r,i,o,s){a()(this,e),d()(this,"_logger",v.Z.getLogger("FlashPlayer")),d()(this,"_stopPlayer",void 0),d()(this,"_onStalled",void 0),d()(this,"_onEnded",void 0),d()(this,"_streamId",void 0),d()(this,"_streamsInfo",void 0),d()(this,"_swfSrc",void 0),d()(this,"_options",void 0),d()(this,"_phenixVideo",void 0),d()(this,"_playerElement",void 0),d()(this,"_originElement",void 0),d()(this,"_player",void 0),d()(this,"_hasFlashPlugin",void 0),d()(this,"_lastReloadTime",void 0);var u=ne[o.env||"staging"];this._streamId=r,this._streamsInfo=i.map((function(e){return e.uri=encodeURI(e.uri).replace(/[#]/g,"%23"),e})),this._options=o,this._phenixVideo=null,this._playerElement=null,this._player=null,this._originElement=t,this._onStalled=this.stalled.bind(this),this._onEnded=this.ended.bind(this),this._swfSrc=o.swfSrc||u,this._stopPlayer=s}return u()(e,[{key:"isSupported",value:function(){return this.detectFlashPlugin()}},{key:"start",value:function(){var e={streamId:this._streamId,swfSrc:this._swfSrc};return this._phenixVideo=new ee(this._originElement,this._streamsInfo,e),this._phenixVideo.hookUpEvents(),this._playerElement=this._phenixVideo.getElement(),this._playerElement&&this._playerElement.play(),this._playerElement.addEventListener("stalled",this._onStalled,!1),this._playerElement.addEventListener("pause",this._onStalled,!1),this._playerElement.addEventListener("suspend",this._onStalled,!1),this._playerElement.addEventListener("ended",this._onEnded,!1),this._playerElement}},{key:"dispose",value:function(){var e=this;if(this._phenixVideo){var t=function(){e._playerElement&&(e._playerElement.removeEventListener("stalled",e._onStalled,!1),e._playerElement.removeEventListener("pause",e._onStalled,!1),e._playerElement.removeEventListener("suspend",e._onStalled,!1),e._playerElement.removeEventListener("ended",e._onEnded,!1)),e._playerElement=null,e._originElement=null};try{this._phenixVideo.dispose(),this._phenixVideo=null,t(),this._logger.info("[%s] Flash player has been destroyed",this._streamId)}catch(e){this._logger.error("[%s] Error while destroying Flash player [%s]",this._streamId,e.code,e),t()}}}},{key:"getStats",value:function(){var e={width:0,height:0,currentTime:0,lag:0,networkState:J.NetworkNoSource};if(!this._playerElement)return e;e.currentTime=this._playerElement.currentTime;var t=(Date.now()-this._options.originStartTime)/1e3;return e.lag=Math.max(0,t-e.currentTime),e}},{key:"getPlayer",value:function(){return this._playerElement}},{key:"reload",value:function(){this._phenixVideo.dispose(),this.start()}},{key:"detectFlashPlugin",value:function(){var e=[10,0,0],t="Shockwave Flash",n="application/x-shockwave-flash",r=["0","0","0"];if("boolean"==typeof this._hasFlashPlugin)return this._hasFlashPlugin;if(window.navigator&&window.navigator.plugins&&window.navigator.plugins[t]){var i=window.navigator.plugins[t].description;if(i&&window.navigator.mimeTypes&&window.navigator.mimeTypes[n]&&!window.navigator.mimeTypes[n].enabledPlugin)for(var o=0,a=(r=i.replace(t,"").replace(/^\s+/,"").replace(/\sr/gi,".").split(".")).length;o<a;o++)r[o]=parseInt(r[o].match(/\d+/),10)}else if(window.ActiveXObject)try{var s=new window.ActiveXObject("ShockwaveFlash.ShockwaveFlash");if(s){var u=(s.GetVariable("$version")||"").split(" ")[1].version.split(",");r=[parseInt(u[0],10),parseInt(u[1],10),parseInt(u[2],10)]}}catch(e){console.error(e)}return this._hasFlashPlugin=r[0]>e[0]||r[0]===e[0]&&r[1]>0||r[0]===e[0]&&0===r[1]&&r[2]>=0,this._hasFlashPlugin}},{key:"stalled",value:function(){var e=this;this._logger.info("[%s] Loading flash player stalled caused by [%s] event.",this._streamId,event.type);var t=this._playerElement.currentTime;setTimeout((function(){e._playerElement&&e._playerElement.currentTime===t&&!e._playerElement.paused&&e.canReload()&&(e._logger.warn("Reloading stream after being stalled for [%s] seconds",6),e.reloadIfAble())}),6e3)}},{key:"ended",value:function(){this._logger.info("[%s] Flash player ended.",this._streamId),this._stopPlayer()}},{key:"canReload",value:function(){var e=!this._lastReloadTime||Date.now()-this._lastReloadTime>15e3;return this._playerElement&&0!==this._playerElement.buffered.length&&e}},{key:"reloadIfAble",value:function(){this.canReload()&&(this._logger.warn("Reloading unhealthy stream that was active for at least [%s] seconds",15),this._lastReloadTime=Date.now(),this.reload())}}]),e}(),ie=n(4146),oe=function(){function e(t,n){a()(this,e),d()(this,"_logger",v.Z.getLogger("RtmpStream")),d()(this,"_channelContext",void 0),d()(this,"_monitorDisposables",new k.Z),d()(this,"_handleStreamFailure",void 0),d()(this,"_originElement",void 0),d()(this,"_monitorFailureCount",0),this._channelContext=t,this._handleStreamFailure=n,this._channelContext.disposables.add(this)}return u()(e,[{key:"start",value:function(e,t){var n=this;return q.discoverClosestEndPointWithCaching(e).then((function(e){return n._channelContext.online.value=!0,n._channelContext.endPoint.value=e,n._logger.info("Connecting to [%s]",e.toString()),e.subscribe(t,null,n._channelContext.failureCount.value)})).then((function(e){var t=e.status,r=e.stream,i=e.createOfferDescriptionResponse,o=e.lag;if(n._channelContext.stream.value=r,n._channelContext.lag.value=o,n._channelContext.applySessionAndStreamPropertiesToVideoElement(),n._logger.debug("[%s] Subscribe completed [%s] [%j]",n._channelContext.streamId,t,i),n._channelContext.state.value=n._channelContext.mapSubscribeStatusToChannelStatus(t),n._channelContext.applyStatus(t),"ok"===t){var a=i.sessionDescription.sdp,s={originStartTime:Date.now()-o+n._channelContext.endPoint.value.roundTripTime/2,lag:o},u=a.match(/a=x-rtmp:(rtmp:\/\/[^\n]*)/m),c=u&&u[1]?u[1]:"";if(!c)throw n._channelContext.state.value=ie.ChannelState.Error,new Error("No RTMP URL provided in SDP");var l=c,h=l.match(/(rtmp:\/\/[^\n\s]*)/)[0]||"",d=l.match(/bitrate=([^\n\s;]*)/)[1],f=l.match(/resolution=([^\n\s;]*)/)[1],p=new re(n._channelContext.videoElement.value,"rtmp",n._channelContext.streamId,[{uri:h,bitrate:d,resolution:f}],s,(function(){return n.onEnded(p)}));n._originElement=n._channelContext.videoElement.value,n.monitor(p),p.start(),n._channelContext.videoElement.value=p.getPlayer()}}))}},{key:"onEnded",value:function(e){var t=this;this._channelContext.state.value=ie.ChannelState.Error,this._channelContext.videoElement.value=this._originElement,this._channelContext.playing.value=!1,this._channelContext.loading.value=!0,e.dispose(),this._monitorDisposables.dispose(),this._handleStreamFailure().catch((function(e){t._logger.error("Failed handling stream failure",e)}))}},{key:"monitor",value:function(e){var t=this;this._monitorDisposables.dispose();var n=e.getPlayer(),r=window.setTimeout((function(){var n=e.getStats();if(isNaN(n.currentTime)){if(t._monitorFailureCount++,t._monitorFailureCount>6)return t._monitorFailureCount=0,void t.onEnded(e)}else t._monitorFailureCount=0;t.monitor(e)}),1e3);n&&n.paused&&this._channelContext.state.value===ie.ChannelState.Playing&&(this._channelContext.state.value=ie.ChannelState.Paused),n&&!n.paused&&this._channelContext.state.value!==ie.ChannelState.Playing&&(this._channelContext.state.value=ie.ChannelState.Playing),this._monitorDisposables.add(new w.Z((function(){clearTimeout(r)})))}},{key:"dispose",value:function(){this._monitorDisposables.dispose()}}]),e}(),ae=n(1228);function se(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ue(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?se(Object(n),!0).forEach((function(t){d()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):se(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ce=function(){function e(t,n,r,i,o){a()(this,e),d()(this,"_logger",v.Z.getLogger("WebPlayer")),d()(this,"_videoElement",void 0),d()(this,"_kind",void 0),d()(this,"_streamId",void 0),d()(this,"_manifestURI",void 0),d()(this,"_options",void 0),d()(this,"_player",void 0),d()(this,"_lastReloadTime",void 0),this._videoElement=t,this._kind=n,this._streamId=r,this._manifestURI=encodeURI(i).replace(/[#]/g,"%23"),this._options=o}return u()(e,[{key:"start",value:function(){var e=this;if(me.phenixWebPlayer){var t=ue(ue({},this._options),{},{bandwidthToStartAt:3e6});return this._player=new me.phenixWebPlayer.WebPlayer(this._logger,this._videoElement,t),this._player.start(this._manifestURI),void this._player.addEventListener("error",(function(t){e.canReload()&&t&&(3===t.code||t.severity===me.phenixWebPlayer.errors.severity.RECOVERABLE)&&(e._logger.warn("Reloading unhealthy stream after error event [%j]",t),e.reloadIfAble()),e._logger.error("Cannot reload with error [%j]",t)}))}}},{key:"isSupported",value:function(){return me.phenixWebPlayer&&me.phenixWebPlayer.isSupported}},{key:"getStats",value:function(){if(!this._player)return{width:0,height:0,currentTime:0,lag:0,networkState:J.NetworkNoSource,dataBuffered:0};var e=this._player.getStats(),t=e.currentTime||this._videoElement.currentTime,n=(Date.now()-this._options.originStartTime)/1e3;return this._videoElement.buffered&&this._videoElement.buffered.length&&(e.dataBuffered=this._videoElement.buffered.end(0)),e.isNative&&"Hls"===e.deliveryType&&(e.currentTime=t-e.lag),e.currentTime||(e.currentTime=t),e.isNative||(e.lag=Math.max(0,n-t)),e.estimatedBandwidth>0?e.networkState=J.NetworkLoading:e.playTime>0?e.networkState=J.NetworkIdle:e.video?e.networkState=J.NetworkEmpty:e.networkState=J.NetworkNoSource,e}},{key:"dispose",value:function(){this._player&&this._player.dispose(),this._player=null}},{key:"canReload",value:function(){var e=!this._lastReloadTime||Date.now()-this._lastReloadTime>15e3;return this._videoElement&&this._player&&0!==this._videoElement.buffered.length&&e}},{key:"reloadIfAble",value:function(){this.canReload()&&(this._logger.warn("[%s] Reloading unhealthy stream that was active for at least [%s] seconds",this._streamId,15),this._lastReloadTime=Date.now(),this.reload())}},{key:"reload",value:function(){this._player.dispose(),this._player=null,this.start()}}]),e}();function le(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function he(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?le(Object(n),!0).forEach((function(t){d()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):le(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var de=function(){function e(t,n,r,i,o){a()(this,e),d()(this,"_logger",v.Z.getLogger("ShakaPlayer")),d()(this,"_videoElement",void 0),d()(this,"_kind",void 0),d()(this,"_streamId",void 0),d()(this,"_manifestURI",void 0),d()(this,"_options",void 0),d()(this,"_player",void 0),this._videoElement=t,this._kind=n,this._streamId=r,this._manifestURI=encodeURI(i).replace(/[#]/g,"%23"),this._options=o}return u()(e,[{key:"start",value:function(){if(me.shaka)return this._player=new me.shaka.Player(this._videoElement),void this.loadPlayer({abr:{defaultBandwidthEstimate:2e6},manifest:{retryParameters:{timeout:1e4}},streaming:{rebufferingGoal:2,bufferingGoal:10,bufferBehind:30,retryParameters:{timeout:1e4,maxAttempts:10,backoffFactor:1.1}}})}},{key:"getStats",value:function(){if(!this._player)return{width:0,height:0,currentTime:0,lag:0,networkState:J.NetworkNoSource};var e=he(he({},this._player.getStats()),{},{currentTime:0,lag:0}),t=this._videoElement.currentTime||0,n=(Date.now()-this._options.originStartTime)/1e3,r=Math.max(0,n-t);return this._videoElement&&(e.currentTime=t,e.lag=r,this._videoElement.buffered&&this._videoElement.buffered.length&&(e.dataBuffered=this._videoElement.buffered.end(0))),e.estimatedBandwidth>0?e.networkState=J.NetworkLoading:e.playTime>0?e.networkState=J.NetworkIdle:e.video?e.networkState=J.NetworkEmpty:e.networkState=J.NetworkNoSource,e}},{key:"dispose",value:function(){this._player&&(this._player.unload(),this._player.destroy()),this._player=null}},{key:"loadPlayer",value:function(e){var t=this;this._player.configure(e),this._player.load(this._manifestURI).then((function(){t._logger.info("[%s] DASH live stream has been loaded",t._streamId),t._videoElement.play&&t._videoElement.play()})).catch((function(e){t._logger.error("[%s] Error while loading DASH live stream [%s]",t._streamId,e.code,e)}))}}]),e}(),fe=function(){function e(t,n,r,i,o){a()(this,e),d()(this,"_videoElement",void 0),d()(this,"_kind",void 0),d()(this,"_streamId",void 0),d()(this,"_manifestURI",void 0),d()(this,"_options",void 0),d()(this,"_player",void 0),this._videoElement=t,this._kind=n,this._streamId=r,this._manifestURI=encodeURI(i).replace(/[#]/g,"%23"),this._options=o}return u()(e,[{key:"start",value:function(){me.hlsPlayer&&(me.hlsPlayer.isSupported()?(this._player=new me.hlsPlayer({enableWorker:!0,maxBufferLength:1,liveBackBufferLength:0,liveSyncDuration:7,liveDurationInfinity:!0,liveMaxLatencyDuration:1/0,highBufferWatchdogPeriod:1}),this._player.loadSource(this._manifestURI),this._player.attachMedia(this._videoElement)):this._videoElement.canPlayType("application/vnd.apple.mpegurl")&&(this._videoElement.src=this._manifestURI))}},{key:"isSupported",value:function(){return me.hlsPlayer&&me.hlsPlayer.isSupported()}},{key:"getStats",value:function(){if(!this._player)return{width:0,height:0,currentTime:0,lag:0,networkState:J.NetworkNoSource};var e={width:this._player.media.offsetWidth,height:this._player.media.offsetHeight,currentTime:this._player.media.currentTime,lag:0,networkState:J.NetworkIdle,dataBuffered:0};this._videoElement.buffered&&this._videoElement.buffered.length&&(e.dataBuffered=this._videoElement.buffered.end(0)),"IDLE"===this._player.streamController.state?e.networkState=J.NetworkIdle:"ERROR"===this._player.streamController.state||"ENDED"===this._player.streamController.state?e.networkState=J.NetworkNoSource:this._player.streamController.state.includes("LOADING")||this._player.streamController.state.includes("WAITING")?e.networkState=J.NetworkLoading:e.networkState=J.NetworkEmpty;var t=this._videoElement.currentTime||0,n=(Date.now()-this._options.originStartTime)/1e3;return e.lag=Math.max(0,t+this._options.lag/1e3-n),e}},{key:"dispose",value:function(){this._player&&this._player.destroy&&(this._player.destroy(),this._player=null)}}]),e}(),pe=n(202).default;function ve(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ge(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ve(Object(n),!0).forEach((function(t){d()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ve(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var me=function(){function e(){a()(this,e)}var t;return u()(e,null,[{key:"hlsPlayer",get:function(){return this._hlsPlayer}},{key:"phenixWebPlayer",get:function(){return this._phenixWebPlayer}},{key:"shaka",get:function(){return this._shaka}},{key:"start",value:(t=l()(p().mark((function e(t,n,r,i){var o=this;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._options=i,!(this._hlsPlayer||this._shaka||this._phenixWebPlayer)){e.next=3;break}return e.abrupt("return",this.loaded(t,n,r));case 3:if(y.Z.webPlayerLoader||y.Z.shakaPlayerLoader||y.Z.hlsJsLoader){e.next=5;break}throw new Error("No player is provided");case 5:if(y.Z.webPlayerLoader||y.Z.shakaPlayerLoader||y.Z.hlsJsLoader){e.next=7;break}throw new Error("Unsupported-feature, add stream player");case 7:return e.abrupt("return",new pe((function(e){y.Z.hlsJsLoader&&(o._pending=!0,y.Z.hlsJsLoader((function(i){o._hlsPlayer=i,o._pending&&(o._pending=!1,e(o.loaded(t,n,r)))}))),y.Z.webPlayerLoader&&(o._pending=!0,y.Z.webPlayerLoader((function(i){o._phenixWebPlayer=i,o._pending&&(o._pending=!1,e(o.loaded(t,n,r)))}))),y.Z.shakaPlayerLoader&&(o._pending=!0,y.Z.shakaPlayerLoader((function(i){o._shaka=i,o._pending&&(o._pending=!1,e(o.loaded(t,n,r)))})))})));case 8:case"end":return e.stop()}}),e,this)}))),function(e,n,r,i){return t.apply(this,arguments)})},{key:"getStats",value:function(){return this._player?this._player.getStats():null}},{key:"play",value:function(e,t,n,r,i){var o=r.match(/a=x-playlist:([^\n]*[.]mpd\??[^\s]*)/m),a=r.match(/a=x-playlist:([^\n]*[.]m3u8\??[^\s]*)/m),s=o&&o[1]?o[1]:"",u=a&&a[1]?a[1]:"";return ae.Z.shouldUseNativeHls||this._hlsPlayer&&this._hlsPlayer.isSupported()?(this._player=new e(t,"hls",n,u,i),this._player.start(),this._player):(this._player=new e(t,"dash",n,s,i),this._player.start(),this._player)}},{key:"loaded",value:function(e,t,n){if(this._shaka||this._phenixWebPlayer||this._hlsPlayer)return this._hlsPlayer?this.play(fe,e,t,n,ge(ge({},this._options),{},{preferNative:ae.Z.shouldUseNativeHls})):this._phenixWebPlayer?this.play(ce,e,t,n,ge(ge({},this._options),{},{preferNative:ae.Z.shouldUseNativeHls})):this._shaka?this.play(de,e,t,n,ge(ge({},this._options),{},{preferNative:ae.Z.shouldUseNativeHls})):void 0}}]),e}();d()(me,"_pending",!1),d()(me,"_hlsPlayer",void 0),d()(me,"_phenixWebPlayer",void 0),d()(me,"_shaka",void 0),d()(me,"_options",void 0),d()(me,"_player",void 0);var ye=function(){function e(t,n){a()(this,e),d()(this,"_logger",v.Z.getLogger("ChunkedStream")),d()(this,"_channelContext",void 0),d()(this,"_monitorDisposables",new k.Z),d()(this,"_handleStreamFailure",void 0),d()(this,"_streamStatistics",void 0),d()(this,"_monitorFailureCount",0),this._channelContext=t,this._handleStreamFailure=n,this._channelContext.disposables.add(this)}return u()(e,[{key:"start",value:function(e,t){var n=this;return q.discoverClosestEndPointWithCaching(e).then((function(e){return n._channelContext.online.value=!0,n._channelContext.endPoint.value=e,n._logger.info("Connecting to [%s]",e.toString()),e.subscribe(t,null,n._channelContext.failureCount.value)})).then((function(e){var t=e.status,r=e.stream,i=e.createOfferDescriptionResponse,o=e.lag;if(n._channelContext.stream.value=r,n._channelContext.lag.value=o,n._channelContext.applySessionAndStreamPropertiesToVideoElement(),n._logger.debug("[%s] Subscribe completed [%s] [%j] [%j] [%j] [%j]",n._channelContext.streamId,t,i),n._channelContext.state.value=n._channelContext.mapSubscribeStatusToChannelStatus(t),n._channelContext.applyStatus(t),"ok"===t){var a=i.sessionDescription.sdp,s={originStartTime:Date.now()-o+n._channelContext.endPoint.value.roundTripTime/2,lag:o};return me.start(n._channelContext.videoElement.value,n._channelContext.streamId,a,s).then((function(e){return n.monitor(e),e})).catch((function(e){n._logger.error("LiveStreaming failed",e),n._channelContext.loading.value=!1,n._channelContext.playing.value=!1,n._channelContext.state.value=ie.ChannelState.Stopped}))}}))}},{key:"monitor",value:function(e){var t=this;this._monitorDisposables.dispose();var n=window.setTimeout((function(){var n=me.getStats();if(t._streamStatistics&&t._streamStatistics.currentTime>=n.currentTime&&t._streamStatistics.dataBuffered>=n.dataBuffered){if(t._monitorFailureCount++,t._monitorFailureCount>6)return t._monitorFailureCount=0,t._channelContext.state.value=ie.ChannelState.Error,t._channelContext.playing.value=!1,t._channelContext.loading.value=!0,e.dispose(),t._monitorDisposables.dispose(),void t._handleStreamFailure().catch((function(e){t._logger.error("Failed handling stream failure",e)}))}else t._monitorFailureCount=0;t._channelContext.videoElement.value.paused&&t._channelContext.state.value===ie.ChannelState.Playing&&(t._channelContext.state.value=ie.ChannelState.Paused),t._channelContext.videoElement.value.paused||t._channelContext.state.value===ie.ChannelState.Playing||(t._channelContext.state.value=ie.ChannelState.Playing),t._streamStatistics=n,t.monitor(e)}),1e3);this._monitorDisposables.add(new w.Z((function(){clearTimeout(n)})))}},{key:"dispose",value:function(){this._monitorDisposables.dispose()}}]),e}(),_e=n(3038),be=n.n(_e),we=function(){function e(){throw a()(this,e),new Error("PeerConnectionService is a static class that may not be instantiated")}var t,n;return u()(e,null,[{key:"initiateInitialPrecaching",value:function(){ae.Z.isPrecachingEnabled&&e.precacheCreatePeerConnectionOffer().catch((function(t){return e._logger.error('Failed to pre-cache peer connection offer"',t)}))}},{key:"precacheCreatePeerConnectionOffer",value:(n=l()(p().mark((function t(){return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e._cached={direction:"recvonly",peerConnection:e.createPeerConnectionOffer().catch((function(t){throw e._cached=null,t}))});case 1:case"end":return t.stop()}}),t)}))),function(){return n.apply(this,arguments)})},{key:"createPeerConnectionOffer",value:(t=l()(p().mark((function t(){var n,r,i,o=arguments;return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=o.length>0&&void 0!==o[0]?o[0]:"recvonly",!e._cached||e._cached.direction!==n){t.next=5;break}return r=e._cached.peerConnection,e._cached=null,t.abrupt("return",r);case 5:return i=y.Z.peerConnectionFactory.value,t.abrupt("return",i.createPeerConnection().then(function(){var e=l()(p().mark((function e(t){var r,i,o;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.supportsAddTransceiver){e.next=11;break}return i=t.addTransceiver("audio",{direction:n}),r=t.addTransceiver("video",{direction:n}),e.t0=i,e.t1=r,e.t2=t,e.next=9,t.createOffer(void 0);case 9:return e.t3=e.sent,e.abrupt("return",{audioTransceiver:e.t0,videoTransceiver:e.t1,peerConnection:e.t2,localOffer:e.t3});case 11:return o="recvonly"===n?{offerToReceiveAudio:!0,offerToReceiveVideo:!0}:{},e.t4=t,e.next=15,t.createOffer(o);case 15:return e.t5=e.sent,e.abrupt("return",{peerConnection:e.t4,localOffer:e.t5});case 17:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 7:case"end":return t.stop()}}),t)}))),function(){return t.apply(this,arguments)})}]),e}();d()(we,"_logger",v.Z.getLogger("PeerConnectionService")),d()(we,"_cached",void 0),we.initiateInitialPrecaching(),n(6755);var xe=function(){function e(t){a()(this,e),d()(this,"_sdp",void 0),d()(this,"_audioCodec",void 0),d()(this,"_videoCodec",void 0),d()(this,"_isAudioTrackEnabled",void 0),d()(this,"_isVideoTrackEnabled",void 0),this._sdp=t;var n=this._sdp.split(/(\r\n|\r|\n)/),r=this._sdp.split("m=");this._audioCodec=this.applyCodec("audio",n),this._videoCodec=this.applyCodec("video",n),this._isAudioTrackEnabled=this.isTrackByTypeEnabled("audio",r),this._isVideoTrackEnabled=this.isTrackByTypeEnabled("video",r)}return u()(e,[{key:"audioCodec",get:function(){return this._audioCodec}},{key:"videoCodec",get:function(){return this._videoCodec}},{key:"isAudioTrackEnabled",get:function(){return this._isAudioTrackEnabled}},{key:"isVideoTrackEnabled",get:function(){return this._isVideoTrackEnabled}},{key:"isTrackByTypeEnabled",value:function(e,t){var n=t.find((function(t){return t.startsWith(e)}));return!!n&&!n.includes("a=inactive")}},{key:"applyCodec",value:function(e,t){return t.find((function(n){return n.includes("a=rtpmap:".concat(t.find((function(t){return t.includes("m=".concat(e))})).split(" ")[3]))})).split(" ")[1].split("/")[0]}}]),e}(),Ce=function(){function e(t,n,r){if(a()(this,e),d()(this,"_estimatedRoundTripTime",void 0),d()(this,"_estimatedVideoCodec",void 0),d()(this,"_estimatedAudioCodec",void 0),d()(this,"_rtcStatistic",new P.Z({})),d()(this,"_peerConnection",void 0),d()(this,"_isMonitorRunning",!0),d()(this,"_updateTimeOut",void 0),d()(this,"_tracksToMonitor",void 0),this._peerConnection=t,this._estimatedRoundTripTime=r,this._tracksToMonitor=n.getTracks().map((function(e){return e.kind}))||[],this._peerConnection){if(!ae.Z.getCurrentOfferDisabled){var i=new xe(this._peerConnection.currentRemoteDescription.sdp);this._estimatedAudioCodec=i.audioCodec,this._estimatedVideoCodec=i.videoCodec}this.updateStatistic()}}var t,n;return u()(e,[{key:"rtcStatistic",get:function(){return this._rtcStatistic}},{key:"dispose",value:function(){this._isMonitorRunning=!1,this._peerConnection=null,this._updateTimeOut&&(clearTimeout(this._updateTimeOut),this._updateTimeOut=null)}},{key:"updateStatistic",value:(n=l()(p().mark((function e(){var t,n=this;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!ae.Z.getStatsPromiseBasedDisabled){e.next=5;break}return e.next=3,this.updateStatisticLegacy();case 3:return e.sent,e.abrupt("return");case 5:return t=function(e){return e.id.includes("Audio")?"audio":e.id.includes("Video")?"video":""},e.next=8,this._peerConnection.getStats(null).then((function(e){var r={};if(e){var i,o=n._estimatedRoundTripTime;e.forEach((function(a){if("candidate-pair"===a.type&&a.currentRoundTripTime&&(o=1e3*a.currentRoundTripTime,r.audio&&(r.audio.roundTripTime=o),r.video&&(r.video.roundTripTime=o)),"candidate-pair"===a.type&&a.lastPacketReceivedTimestamp&&(i=a.lastPacketReceivedTimestamp,r.audio&&(r.audio.lastPacketReceivedTimestamp=i),r.video&&(r.video.lastPacketReceivedTimestamp=i)),"inbound-rtp"===a.type){var s=a.kind||a.mediaType||t(a),u="";if(e.forEach((function(e){e.id===a.codecId&&(u=e.mimeType)})),s&&n._tracksToMonitor.includes(s)){var c,l,h,d,f,p=(a.bytesReceived||0)-(null!==(c=null===(l=n._rtcStatistic.value)||void 0===l||null===(h=l[s])||void 0===h?void 0:h.bytesReceived)&&void 0!==c?c:0),v=a.timestamp-(null===(d=n._rtcStatistic.value)||void 0===d||null===(f=d[s])||void 0===f?void 0:f.timestamp),g=p&&v?Math.floor(8*p/v*1e3):0;if(r[s]={ssrc:a.ssrc,mediaType:s,timestamp:a.timestamp,bitrate:g,bytesReceived:a.bytesReceived,packetsLost:a.packetsLost,packetsReceived:a.packetsReceived,codec:u||n.getCodecByType(s),roundTripTime:o},(a.lastPacketReceivedTimestamp||i)&&(r[s].lastPacketReceivedTimestamp=a.lastPacketReceivedTimestamp||i),"video"===s&&n._rtcStatistic.value&&n._rtcStatistic.value.video){r[s].framesDecoded=a.framesDecoded;var m=(a.framesDecoded-n._rtcStatistic.value.video.framesDecoded)/(r[s].timestamp-n._rtcStatistic.value.video.timestamp)*1e3;r[s].fps=m?Math.round(100*m)/100:0}}}}))}n._rtcStatistic.value=r})).then((function(){n._isMonitorRunning&&(n._updateTimeOut=window.setTimeout((function(){return n.updateStatistic()}),1e3))}));case 8:e.sent;case 9:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"updateStatisticLegacy",value:(t=l()(p().mark((function e(){var t=this;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._peerConnection.getStatsLegacy().then((function(e){var n={},r=t._estimatedRoundTripTime;e.result().forEach((function(e){if(e.names().forEach((function(t){"googRTT"===t&&(r=e.stat(t))})),"ssrc"===e.type){var i=e.stat("mediaType").toString();n[i]={timestamp:Date.now()},n[i].ssrc=e.stat("ssrc").toString(),n[i].mediaType=i,n[i].bytesReceived=e.stat("bytesReceived"),n[i].packetsLost=e.stat("packetsLost"),n[i].packetsReceived=e.stat("packetsReceived"),n[i].codec=e.stat("googCodecName").toString()||t.getCodecByType(i),n[i].roundTripTime=r,"video"===i&&t._rtcStatistic.value&&t._rtcStatistic.value.video&&(n[i].framesDecoded=e.stat("framesDecoded"),n[i].fps=(n[i].framesDecoded-t._rtcStatistic.value.video.framesDecoded)/(n[i].timestamp-t._rtcStatistic.value.video.timestamp)*1e3||0)}})),t._rtcStatistic.value=n})).then((function(){t._isMonitorRunning&&(t._updateTimeOut=window.setTimeout((function(){return t.updateStatistic()}),1e3))}));case 2:e.sent;case 3:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"getCodecByType",value:function(e){switch(e){case"audio":return this._estimatedAudioCodec;case"video":return this._estimatedVideoCodec;default:return"unknown"}}}]),e}(),Se=function(){function e(){throw a()(this,e),new Error("RtcConfigurationManager is a static class that may not be instantiated")}return u()(e,null,[{key:"truncateIceServers",value:function(e){for(var t=[],n=0;n<e.iceServers.length;n++){for(var r=[],i=0;i<2;i++)e.iceServers[n].urls[i]&&r.push(e.iceServers[n].urls[i]);t.push({urls:r,username:e.iceServers[n].username,credential:e.iceServers[n].credential})}return e.iceServers=t,e}}]),e}(),ke=n(202).default;function Te(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ee(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Te(Object(n),!0).forEach((function(t){d()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Te(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Le=function(){function e(t,n,r){a()(this,e),d()(this,"_logger",v.Z.getLogger("RealTimeStream")),d()(this,"_channelContext",void 0),d()(this,"_peerConnectionContext",void 0),d()(this,"_handleStreamFailure",void 0),this._channelContext=t,this._peerConnectionContext=n,this._handleStreamFailure=r}var t;return u()(e,[{key:"start",value:function(e,t,n,r){var i=this;return ke.all([q.discoverClosestEndPointWithCaching(e),we.createPeerConnectionOffer()]).then((function(e){var n=be()(e,2),r=n[0],o=n[1],a=o.localOffer,s=o.peerConnection;return i._channelContext.online.value=!0,i._channelContext.endPoint.value=r,i._logger.info("Connecting to [%s]",r.toString()),i._logger.info("Local offer:\n"+a.sdp),!ae.Z.clientOfferDisabled&&s.supportsSetConfiguration&&s.supportsGetConfiguration||(s.close(),s=null,a=null),i._peerConnectionContext.peerConnection.value=s,r.subscribe(t,a,i._channelContext.failureCount.value)})).then((function(e){var t=e.status,o=e.stream,a=e.rtcConfiguration,s=e.setRemoteDescriptionResponse,u=e.createOfferDescriptionResponse,c=e.createAnswerDescriptionResponse,l=e.lag;if(i._channelContext.stream.value=o,i._channelContext.lag.value=l,i._channelContext.applySessionAndStreamPropertiesToVideoElement(),i._logger.debug("[%s] Subscribe completed [%s] [%j] [%j] [%j] [%j]",i._channelContext.streamId,t,a,s,u,c),i._channelContext.state.value=i._channelContext.mapSubscribeStatusToChannelStatus(t),i._channelContext.applyStatus(t),"ok"===t)return i.applyRtcConfiguration(i._peerConnectionContext.peerConnection.value,a).then((function(e){var t,a=!1,l=!1,h=[];i._peerConnectionContext.peerConnection.value||(i._peerConnectionContext.peerConnection.value=e),e.onicecandidate=function(n){i._channelContext.stream.value===o&&i._peerConnectionContext.peerConnection.value===e&&(a||y.Z.sendLocalCandidates.value&&(n.candidate&&n.candidate.candidate?h.push(n.candidate):l=!0,t||(t=setTimeout((function(){i._channelContext.stream.value!==o||a||i._channelContext.endPoint.value.addIceCandidates(o,h,l).then((function(e){var t=e.status,n=e.options;"ok"===t?(n.includes("cancel")&&(a=!0),i._logger.info("[%s] Added ICE candidates with reason [%s] and options [%s]",i._channelContext.streamId,t,n)):i._logger.warn("[%s] Failed to add ICE candidates with reason [%s]",i._channelContext.streamId,t)})).catch((function(e){i._logger.error("[%s] Failed to add ICE candidates",i._channelContext.streamId,e)}))}),100))))},e.oniceconnectionstatechange=function(){if(i._channelContext.stream.value===o&&i._peerConnectionContext.peerConnection.value===e){var t=function(){i._channelContext.state.value=_.Z.Error,i._channelContext.videoElement.value&&(i._channelContext.videoElement.value.pause(),i._channelContext.videoElement.value.srcObject=null),i._channelContext.playing.value=!1,i._channelContext.loading.value=!0,i._handleStreamFailure().catch((function(t){i._logger.error("[%s] Failed handling stream failure after peer connection stopped with state [%s]",i._channelContext.streamId,e.iceConnectionState,t)}))};switch(e.iceConnectionState){case"checking":case"completed":case"connected":case"new":return;case"disconnected":case"failed":return void(navigator.onLine&&(i._logger.info("[%s] ICE connection state changed to [%s], trying to reconnect",i._channelContext.streamId,e.iceConnectionState),i.reconnectPeerConnection(e,t)));case"closed":return i._logger.info("[%s] ICE connection state changed to [%s], retrying to connect",i._channelContext.streamId,e.iceConnectionState),void t();default:(0,b.Z)(e.iceConnectionState)}}};var d=new ke((function(t,n){if(ae.Z.onTrackDisabled){var r=function n(r){clearTimeout(i),e.removeEventListener("track",n),e.removeEventListener("addstream",n),r.streams?t(r.streams[0]):t(r.stream)},i=setTimeout((function(){e.removeEventListener("track",r),e.removeEventListener("addstream",r),n(new Error("Stream setup timed out"))}),3e4);e.addEventListener("track",r),e.addEventListener("addstream",r)}else{var o=setTimeout((function(){return n(new Error("Stream setup timed out"))}),3e4);e.ontrack=function(e){clearTimeout(o),t(e.streams[0])}}}));return new ke((function(e){e()})).then((function(){if(s)return i._logger.info("[%s] Set local SDP offer [%s]",i._channelContext.streamId,s.sessionDescription.sdp),e.setLocalDescription(s.sessionDescription).catch((function(e){throw i._logger.info("[%s] Failed to set local description [%j] with message [%s]",i._channelContext.streamId,s.sessionDescription,e.message),e}))})).then((function(){if(c)return i._logger.info("[%s] Set remote SDP answer [%s]",i._channelContext.streamId,c.sessionDescription.sdp),e.setRemoteDescription(c.sessionDescription).catch((function(e){throw i._logger.info("[%s] Failed to set remote description [%j] with message [%s]",i._channelContext.streamId,c.sessionDescription,e.message),e}))})).then((function(){if(u)return i._logger.info("[%s] Set remote SDP offer [%s]",i._channelContext.streamId,u.sessionDescription.sdp),e.setRemoteDescription(u.sessionDescription).catch((function(e){throw i._logger.info("[%s] Failed to set remote description [%j] with message [%s]",i._channelContext.streamId,u.sessionDescription,e.message),e})).then((function(){return e.createAnswer({offerToReceiveAudio:!0,offerToReceiveVideo:!0})})).then((function(e){return i._logger.info("[%s] Set local SDP answer [%j]",i._channelContext.streamId,e),i._channelContext.endPoint.value.setRemoteDescription(o,e)})).then((function(t){var n=t.status,r=t.sessionDescription;return i._channelContext.state.value=i.mapSetRemoteDescriptionStatusToChannelStatus(n),"ok"!==n?(i._channelContext.playing.value=!1,i._channelContext.standby.value=!0,void(i._channelContext.stopped.value=!1)):e.setLocalDescription(r).catch((function(e){throw i._logger.info("[%s] Failed to set local description [%j] with message [%s]",i._channelContext.streamId,r,e.message),e}))}))})).then((function(){return n.success(i._channelContext.streamId),d})).then((function(t){i._peerConnectionContext.mediaStream.value=t;var n=new Ce(e,t,i._channelContext.endPoint.value.roundTripTime/4);return i._channelContext.disposables.add(n),n.rtcStatistic.subscribe((function(t){if(i._channelContext.rtcStatistics.value=t,!i._channelContext.rtcVideoStatistic&&!i._channelContext.rtcAudioStatistic)return i._channelContext.rtcAudioStatistic=t.audio,void(i._channelContext.rtcVideoStatistic=t.video);var r=!1,o=!1;t.audio&&i._channelContext.rtcAudioStatistic&&i._channelContext.rtcAudioStatistic.timestamp!==t.audio.timestamp&&((r=i._channelContext.rtcAudioStatistic&&i._channelContext.rtcAudioStatistic.bytesReceived===t.audio.bytesReceived)&&navigator.onLine&&i._logger.info("[%s] Audio track failed with last bytesReceived [%s] is equal to previous bytesReceived [%s] within [%s]",i._channelContext.streamId,t.audio.bytesReceived,i._channelContext.rtcAudioStatistic.bytesReceived,new C(t.audio.timestamp-i._channelContext.rtcAudioStatistic.timestamp).toIsoString()),i._channelContext.rtcAudioStatistic=t.audio),t.video&&i._channelContext.rtcVideoStatistic&&i._channelContext.rtcVideoStatistic.timestamp!==t.video.timestamp&&((o=i._channelContext.rtcVideoStatistic&&i._channelContext.rtcVideoStatistic.bytesReceived===t.video.bytesReceived)&&navigator.onLine&&i._logger.info("[%s] Video track failed with last bytesReceived [%s] is equal to previous bytesReceived [%s] within [%s]",i._channelContext.streamId,t.video.bytesReceived,i._channelContext.rtcVideoStatistic.bytesReceived,new C(t.video.timestamp-i._channelContext.rtcVideoStatistic.timestamp).toIsoString()),i._channelContext.rtcVideoStatistic=t.video),(o||r)&&navigator.onLine?i.reconnectPeerConnection(e,(function(){i._channelContext.state.value=_.Z.Error,i._channelContext.videoElement.value&&(i._channelContext.videoElement.value.pause(),i._channelContext.videoElement.value.srcObject=null),i._channelContext.playing.value=!1,i._channelContext.loading.value=!0,n.dispose(),i._handleStreamFailure().catch((function(t){i._logger.error("[%s] Failed handling stream failure after track stopped with state [%s]",i._channelContext.streamId,e.iceConnectionState,t)}))})):i._peerConnectionContext.peerConnectionReconnectAttempts=0})),y.Z.automaticallyPlayMediaStream?r(t):(i._channelContext.autoMuted.value=!1,i._channelContext.autoPaused.value=!0,i._channelContext.loading.value=!1,i._channelContext.playing.value=!1,void(i._channelContext.state.value=_.Z.Paused))}))}))}))}},{key:"applyRtcConfiguration",value:(t=l()(p().mark((function e(t,n){var r;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=3;break}return n=Se.truncateIceServers(n),e.abrupt("return",y.Z.peerConnectionFactory.value.createPeerConnection(n));case 3:return r=Ee(Ee({},t.getConfiguration()),n),t.setConfiguration(r),e.abrupt("return",t);case 6:case"end":return e.stop()}}),e)}))),function(e,n){return t.apply(this,arguments)})},{key:"reconnectPeerConnection",value:function(e,t){var n=this;if("closed"!==e.iceConnectionState)if(this._channelContext.state.value=_.Z.Reconnecting,this._peerConnectionContext.peerConnectionReconnectAttempts<y.Z.maximalNumberOfPeerConnectionReconnectAttempts||!y.Z.automaticallyReconnectPeerConnection){if(this._peerConnectionContext.peerConnectionReconnectAttempts++,ae.Z.clientOfferDisabled||!e.supportsSetConfiguration||!e.supportsGetConfiguration||this._channelContext.failureCount.value)return;this._logger.info("Reconnecting peer connection by restarting ICE");var r=e.currentLocalDescription;e.createOffer({iceRestart:!0}).then((function(t){return e.setLocalDescription(t).then((function(){return e.setLocalDescription(r)}))})).catch((function(e){n._logger.error("Failed to reconnect peer connection",e),n._peerConnectionContext.peerConnectionReconnectAttempts=0,t()}))}else this._logger.info("Failed to reconnect peer connection after [%s] attempts, performing full recovery",this._peerConnectionContext.peerConnectionReconnectAttempts),this._peerConnectionContext.peerConnectionReconnectAttempts=0,t()}},{key:"mapSetRemoteDescriptionStatusToChannelStatus",value:function(e){switch(e){case"ok":return _.Z.Starting;case"unauthorized":return _.Z.Unauthorized;case"not-found":case"capacity":case"rate-limited":case"timeout":return _.Z.Recovering;case"failed":return _.Z.Error;default:(0,b.Z)(e)}}}]),e}(),Pe=function(){function e(){throw a()(this,e),new Error("LegacyStreamFactory is a static class that may not be instantiated")}return u()(e,null,[{key:"create",value:function(e,t,n,r){var i=x.Z.parseToken(e);return i&&i.token&&i.token.capabilities&&i.token.capabilities.includes("rtmp")?ae.Z.isRTMPEnabled?new oe(t,r):(t.state.value=_.Z.UnsupportedFeature,void this._logger.error("RTMP playback is not enabled.")):i&&i.token&&i.token.capabilities&&i.token.capabilities.includes("streaming")?new ye(t,r):new Le(t,n,r)}}]),e}();d()(Pe,"_logger",v.Z.getLogger("Streaming"));var Oe=n(202).default,Re="client:termination",Ze=function(){function e(t,n){var o=this,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;a()(this,e),d()(this,"_logger",v.Z.getLogger("Channel")),d()(this,"_tokenContext",void 0),d()(this,"_channelContext",void 0),d()(this,"_peerConnectionContext",void 0),d()(this,"_stateContext",void 0),d()(this,"_channelStartTime",void 0),d()(this,"_readOnlyVideoElement",void 0),d()(this,"_readOnlyToken",void 0),d()(this,"_readOnlyPeerConnection",void 0),d()(this,"_readOnlyState",void 0),d()(this,"_readOnlyAutoMuted",void 0),d()(this,"_readOnlyAutoPaused",void 0),d()(this,"_readOnlyTokenExpiring",void 0),d()(this,"_readOnlyAuthorized",void 0),d()(this,"_readOnlyOnline",void 0),d()(this,"_readOnlyLoading",void 0),d()(this,"_readOnlyPlaying",void 0),d()(this,"_readOnlyStandby",void 0),d()(this,"_readOnlyStopped",void 0),d()(this,"_readOnlyTargetLag",void 0),d()(this,"_readOnlyLag",void 0),d()(this,"_readOnlyBitrateLimit",void 0),d()(this,"_readOnlyResolution",void 0),d()(this,"_readOnlyFailureCount",void 0),d()(this,"_readOnlyEndPoint",void 0),d()(this,"_readOnlyStream",void 0),d()(this,"_readOnlyRtcStatistics",void 0),d()(this,"_readOnlyMediaStream",void 0),d()(this,"_metricsService",void 0),d()(this,"_sessionTelemetry",void 0),d()(this,"_videoMetaDataChangedHandler",void 0),this._tokenContext=new Z(n),this._channelContext=new I(s),this._peerConnectionContext=new A,this._stateContext=new D,this._channelStartTime=Date.now(),this._readOnlyVideoElement=new g.Z(this._channelContext.videoElement),this._readOnlyToken=new g.Z(this._tokenContext.token),this._readOnlyPeerConnection=new g.Z(this._peerConnectionContext.peerConnection),this._readOnlyState=new g.Z(this._channelContext.state),this._readOnlyAutoMuted=new g.Z(this._channelContext.autoMuted),this._readOnlyAutoPaused=new g.Z(this._channelContext.autoPaused),this._readOnlyTokenExpiring=new g.Z(this._tokenContext.tokenExpiring),this._readOnlyAuthorized=new g.Z(this._channelContext.authorized),this._readOnlyOnline=new g.Z(this._channelContext.online),this._readOnlyLoading=new g.Z(this._channelContext.loading),this._readOnlyPlaying=new g.Z(this._channelContext.playing),this._readOnlyStandby=new g.Z(this._channelContext.standby),this._readOnlyStopped=new g.Z(this._channelContext.stopped),this._readOnlyTargetLag=new g.Z(this._channelContext.targetLag),this._readOnlyLag=new g.Z(this._channelContext.lag),this._readOnlyBitrateLimit=new g.Z(this._channelContext.bitrateLimit),this._readOnlyResolution=new g.Z(this._channelContext.resolution),this._readOnlyFailureCount=new g.Z(this._channelContext.failureCount),this._readOnlyEndPoint=new g.Z(this._channelContext.endPoint),this._readOnlyStream=new g.Z(this._channelContext.stream),this._readOnlyRtcStatistics=new g.Z(this._channelContext.rtcStatistics),this._readOnlyMediaStream=new g.Z(this._peerConnectionContext.mediaStream);var u=x.Z.parseToken(this._tokenContext.token.value),c=(x.Z.getUri(u)||y.Z.discoveryUri.value).toString();y.Z.tenancy.value=x.Z.getTenancy(u)||y.Z.tenancy.value,G.Z.uri.value=c,this._metricsService=H.Z.getMetricsService(c),this._sessionTelemetry=new R(y.Z.pageLoadTime,this._metricsService),this._channelContext.channelDisposables.add(this._sessionTelemetry),this._videoMetaDataChangedHandler=this.handleVideoMetaDataChanged.bind(this),this.videoElement=t,this._channelContext.channelDisposables.add(this._channelContext.videoElement.subscribe((function(e){o._channelContext.rendererDisposables.dispose(),e&&(o._channelContext.rendererDisposables.add(o._channelContext.stream.subscribe((function(e){o._channelContext.videoTelemetry&&o._channelContext.videoTelemetry.dispose(),e&&o.videoElement&&(o.videoElement.dataset&&(o.videoElement.dataset.sessionId=y.Z.clientSessionId,o.videoElement.dataset.streamId=o.streamId),o._channelContext.videoTelemetry=new T(o.streamId,y.Z.pageLoadTime,o._channelStartTime,o._metricsService),o._channelContext.videoTelemetry.setupListenerForTimeToFirstTime(o.videoElement),o._channelContext.videoTelemetry.setupListenerForRebuffering(o.videoElement),o._channelContext.state.value===_.Z.Stopped)&&o.restartAfterStop()}))),o._channelContext.channelDisposables.add(o._channelContext.rendererDisposables))}))),this._channelContext.channelDisposables.add(this._channelContext.state.subscribe((function(e){o._channelContext.clearFailureCountTimeout&&clearTimeout(o._channelContext.clearFailureCountTimeout),o._channelContext.failureCount.value&&e===_.Z.Playing&&(o._channelContext.clearFailureCountTimeout=window.setTimeout((function(){o._channelContext.failureCount.value=0}),3e3))}))),this._channelContext.channelDisposables.add(this._channelContext.resolution.subscribe((function(e){o._channelContext.videoTelemetry&&o._channelContext.videoTelemetry.onVideoResolutionChanges(e.toString())}))),this._channelContext.channelDisposables.add(this._channelContext.bitrateLimit.subscribe((function(e){if(e&&o._channelContext.endPoint.value&&o._channelContext.stream.value){var t=Date.now()-o._channelContext.channelInitialization.getTime();o._channelContext.endPoint.value.limitBitrate(o._channelContext.stream.value,t,e,r.Keep,i.Normal).catch((function(e){o._logger.error("Error while setting limit bitrate",e)}))}})));var l=function(){o._channelContext.stream.value&&o._channelContext.endPoint.value&&o._channelContext.endPoint.value.destroyStream(o._channelContext.stream.value,"client:termination-on-window-unload")};window.addEventListener("beforeunload",l),this._channelContext.channelDisposables.add(new w.Z((function(){window.removeEventListener("beforeunload",l)}))),this.start()}var t,n,o,s,c,h,f,C,S;return u()(e,[{key:"videoElement",get:function(){return this._channelContext.videoElement.value},set:function(e){this._channelContext.videoElement.value&&(this._channelContext.videoElement.value.removeEventListener("loadeddata",this._videoMetaDataChangedHandler),this._channelContext.videoElement.value.removeEventListener("loadedmetadata",this._videoMetaDataChangedHandler),this._channelContext.videoElement.value.removeEventListener("resize",this._videoMetaDataChangedHandler),this._channelContext.videoElement.value.dataset&&(this._channelContext.videoElement.value.dataset.sessionId="",this._channelContext.videoElement.value.dataset.streamId=""),this._channelContext.rendererDisposables.dispose(),this._channelContext.videoElement.value.pause(),this._channelContext.videoElement.value.srcObject=null),this._channelContext.autoMuted.value=!1,this._channelContext.autoPaused.value=!1,this._channelContext.loading.value=!1,this._channelContext.playing.value=!1,this._channelContext.state.value=_.Z.Stopped,this._channelContext.videoElement.value=e,this._channelContext.videoElement.value&&(this._channelContext.videoElement.value.addEventListener("loadeddata",this._videoMetaDataChangedHandler),this._channelContext.videoElement.value.addEventListener("loadedmetadata",this._videoMetaDataChangedHandler),this._channelContext.videoElement.value.addEventListener("resize",this._videoMetaDataChangedHandler))}},{key:"handleVideoMetaDataChanged",value:function(){var e=this._channelContext.videoElement.value;e?this.resolution.value.width===e.videoWidth&&this.resolution.value.height===e.videoHeight||(this._channelContext.resolution.value=new m(e.videoWidth,e.videoHeight)):this._channelContext.resolution.value=m.empty}},{key:"token",get:function(){return this._tokenContext.token.value},set:function(e){this._channelContext.disposables.dispose(),this._tokenContext.token.value=e,this._tokenContext.tokenExpiring.value=!1;var t=x.Z.parseToken(this._tokenContext.token.value),n=(x.Z.getUri(t)||y.Z.discoveryUri.value).toString();y.Z.tenancy.value=x.Z.getTenancy(t)||y.Z.tenancy.value,G.Z.uri.value=n,this._metricsService=H.Z.getMetricsService(n),this.start()}},{key:"peerConnection",get:function(){return this._readOnlyPeerConnection}},{key:"state",get:function(){return this._readOnlyState}},{key:"autoMuted",get:function(){return this._readOnlyAutoMuted}},{key:"autoPaused",get:function(){return this._readOnlyAutoPaused}},{key:"tokenExpiring",get:function(){return this._readOnlyTokenExpiring}},{key:"authorized",get:function(){return this._readOnlyAuthorized}},{key:"online",get:function(){return this._readOnlyOnline}},{key:"loading",get:function(){return this._readOnlyLoading}},{key:"playing",get:function(){return this._readOnlyPlaying}},{key:"standby",get:function(){return this._readOnlyStandby}},{key:"stopped",get:function(){return this._readOnlyStopped}},{key:"targetLag",get:function(){return this._readOnlyTargetLag}},{key:"lag",get:function(){return this._readOnlyLag}},{key:"bitrateLimit",get:function(){return this._readOnlyBitrateLimit.value}},{key:"resolution",get:function(){return this._readOnlyResolution}},{key:"failureCount",get:function(){return this._readOnlyFailureCount}},{key:"endPoint",get:function(){return this._readOnlyEndPoint}},{key:"stream",get:function(){return this._readOnlyStream}},{key:"streamId",get:function(){return this._channelContext.streamId}},{key:"rtcStatistics",get:function(){return this._readOnlyRtcStatistics}},{key:"mediaStream",get:function(){return this._readOnlyMediaStream}},{key:"setBitrateLimit",value:function(e){this._channelContext.bitrateLimit.value=e}},{key:"clearBitrateLimit",value:function(){var e=this;if(this._channelContext.bitrateLimit.value&&this._channelContext.endPoint.value&&this._channelContext.stream.value){var t=Date.now()-this._channelContext.channelInitialization.getTime();this._channelContext.endPoint.value.limitBitrate(this._channelContext.stream.value,t,0,r.Keep,i.Reset).then((function(t){"ok"===t.status&&(e._channelContext.bitrateLimit.value=0)})).catch((function(t){e._logger.error("Error while setting limit bitrate",t)}))}}},{key:"updateTargetLag",value:function(e){this._channelContext.targetLag.value=e}},{key:"stop",value:(S=l()(p().mark((function e(t){var n=this;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Oe((function(e){if(!n._stateContext.isStarting.value)return n.processStop(t),void e();n._channelContext.rendererDisposables.add(n._stateContext.isStarting.subscribe((function(r){r||(n.processStop(t),e())})))})));case 1:case"end":return e.stop()}}),e)}))),function(e){return S.apply(this,arguments)})},{key:"processStop",value:function(e){this._channelContext.videoElement.value&&(this._channelContext.videoElement.value.pause(),this._channelContext.videoElement.value.srcObject=null),this._channelContext.rendererDisposables.dispose(),this.cleanUpResources(e),this._channelContext.state.value=_.Z.Stopped}},{key:"resume",value:(C=l()(p().mark((function e(){return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._peerConnectionContext.mediaStream.value){e.next=3;break}return this._channelContext.autoPaused.value=!1,e.abrupt("return",this.playMediaStreamInVideoElement(this._peerConnectionContext.mediaStream.value));case 3:case"end":return e.stop()}}),e,this)}))),function(){return C.apply(this,arguments)})},{key:"mute",value:function(){var e=this._channelContext.videoElement.value;e&&(e.muted=!0)}},{key:"unmute",value:function(){var e=this._channelContext.videoElement.value;e&&(e.muted=!1,this._channelContext.autoMuted.value=!1)}},{key:"dispose",value:(f=l()(p().mark((function e(){var t=this;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.stop("client:channel-dispose").then((function(){t._channelContext.channelDisposables.dispose(),t._stateContext.isDisposed=!0})));case 1:case"end":return e.stop()}}),e,this)}))),function(){return f.apply(this,arguments)})},{key:"getUri",value:function(e){var t=x.Z.parseToken(e);return x.Z.getUri(t)||(this._logger.info("Fall back to the default discover URI [%s]",y.Z.discoveryUri.value),new URL(y.Z.discoveryUri.value))}},{key:"start",value:(h=l()(p().mark((function e(){return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._stateContext.isDisposed){e.next=2;break}throw new Error("Channel was already disposed");case 2:if(!this._stateContext.isStarting.value){e.next=5;break}return this._logger.info("Channel is already starting, skipping start"),e.abrupt("return");case 5:return this._stateContext.isStarting.value=!0,e.abrupt("return",this.processStart());case 7:case"end":return e.stop()}}),e,this)}))),function(){return h.apply(this,arguments)})},{key:"processStart",value:(c=l()(p().mark((function e(){var t,n,r,i,o,a=this;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this._tokenContext.token.value,n=this._sessionTelemetry.listenOnStreamSetup(),x.Z.isValidToken(t)){e.next=8;break}return this._logger.error("Failed to parse token [%s]",t),this._channelContext.state.value=_.Z.Unauthorized,this._channelContext.authorized.value=!1,this._stateContext.isStarting.value=!1,e.abrupt("return");case 8:if(this.cleanUpResources("client:start"),this._channelContext.state.value=_.Z.Starting,this._channelContext.loading.value=!0,r=this.getUri(t),i=function(){return new Oe((function(e){return a._stateContext.isStarting.value=!1,e(a.handleStreamFailure())}))},o=Pe.create(t,this._channelContext,this._peerConnectionContext,i)){e.next=17;break}return this._stateContext.isStarting.value=!1,e.abrupt("return");case 17:return e.abrupt("return",o.start(r,t,n,this.playMediaStreamInVideoElement.bind(this)).then((function(){a._channelContext.loading.value=!1})).catch((function(e){n.fail(),a._channelContext.failureCount.value++,a._channelContext.online.value=!1,a.cleanUpResources("client:cleanup-after-failed-setup"),a._channelContext.state.value=_.Z.Error,a._logger.error("Failed to start channel",e)})).finally((function(){if(a._stateContext.isStarting.value=!1,a._channelContext.state.value!==_.Z.Playing&&y.Z.automaticRetryOnFailure){var e=setTimeout((function(){a.handleStreamFailure().catch((function(e){a._logger.error("Failed handling stream failure",e)}))}),a.getRetryInterval());a._channelContext.disposables.add(new w.Z((function(){clearTimeout(e)})))}})));case 18:case"end":return e.stop()}}),e,this)}))),function(){return c.apply(this,arguments)})},{key:"restartAfterStop",value:(s=l()(p().mark((function e(){return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._stateContext.isDisposed){e.next=2;break}throw new Error("Channel was already disposed");case 2:if(!this._peerConnectionContext.mediaStream.value){e.next=4;break}return e.abrupt("return",this.playMediaStreamInVideoElement(this._peerConnectionContext.mediaStream.value));case 4:this._tokenContext.token.value&&this.start();case 5:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"play",value:(o=l()(p().mark((function e(){var t;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this._peerConnectionContext.mediaStream.value){e.next=3;break}return e.abrupt("return",this.start());case 3:return e.abrupt("return",this.playMediaStreamInVideoElement(t));case 4:case"end":return e.stop()}}),e,this)}))),function(){return o.apply(this,arguments)})},{key:"getRetryInterval",value:function(){switch(this._channelContext.state.value){case _.Z.StandBy:case _.Z.Offline:return 15e3;case _.Z.Error:case _.Z.Recovering:case _.Z.Unauthorized:case _.Z.GeoRestricted:case _.Z.GeoBlocked:case _.Z.Stopped:case _.Z.Starting:case _.Z.Playing:case _.Z.Paused:case _.Z.Reconnecting:case _.Z.UnsupportedFeature:return Math.min(3e5,Math.pow(2e3,Math.max(0,this._channelContext.failureCount.value-1)));default:(0,b.Z)(this._channelContext.state.value)}}},{key:"handleStreamFailure",value:(n=l()(p().mark((function e(){return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=this._channelContext.state.value,e.next=e.t0===_.Z.Error||e.t0===_.Z.Reconnecting||e.t0===_.Z.StandBy||e.t0===_.Z.Offline||e.t0===_.Z.Recovering?3:e.t0===_.Z.Unauthorized?5:e.t0===_.Z.GeoRestricted?7:e.t0===_.Z.GeoBlocked?9:e.t0===_.Z.Stopped?11:e.t0===_.Z.Playing?13:e.t0===_.Z.Paused?15:e.t0===_.Z.Starting?17:e.t0===_.Z.UnsupportedFeature?19:21;break;case 3:return this._logger.info("Retry start with initial state [%s] [%s]",this._channelContext.state.value,_.Z[this._channelContext.state.value]),e.abrupt("break",22);case 5:return this._logger.info("Channel is unauthorized, skipping retry of start. Please provide a new token and invoke start()"),e.abrupt("return");case 7:return this._logger.info("Channel is geo restricted, skipping retry of start. Please provide a new token and invoke start()"),e.abrupt("return");case 9:return this._logger.info("Channel is geo blocked, skipping retry of start. Please provide a new token and invoke start()"),e.abrupt("return");case 11:return this._logger.info("Channel is stopped, skipping retry of start."),e.abrupt("return");case 13:return this._logger.info("Channel is playing, skipping retry of start"),e.abrupt("return");case 15:return this._logger.info("Channel is paused, skipping retry of start. Please invoke play()"),e.abrupt("return");case 17:return this._logger.info("Channel is already starting, skipping retry of start"),e.abrupt("return");case 19:return this._logger.info("Channel is stopped due to unsupported feature, skipping retry of start."),e.abrupt("return");case 21:(0,b.Z)(this._channelContext.state.value);case 22:return e.abrupt("return",this.start());case 23:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"cleanUpResources",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Re;this._channelContext.disposables.dispose();var n=this._peerConnectionContext.peerConnection.value;n&&(this._peerConnectionContext.peerConnection.value=null,n.close()),this._peerConnectionContext.mediaStream.value&&(this._peerConnectionContext.mediaStream.value.getTracks().forEach((function(e){return e.stop()})),this._peerConnectionContext.mediaStream.value=null),this._channelContext.autoPaused.value=!1,this._channelContext.autoMuted.value=!1,this._channelContext.playing.value=!1,this._channelContext.stopped.value=!0,this._channelContext.standby.value=!1,this._channelContext.stream.value&&this._channelContext.endPoint.value&&this._channelContext.endPoint.value.destroyStream(this._channelContext.stream.value,t).then((function(t){var n=t.status;"ok"===n?e._logger.info("[%s] Destroyed stream with reason [%s]",e.streamId,n):e._logger.warn("[%s] Failed to destroy stream with reason [%s]",e.streamId,n)})).catch((function(t){e._logger.error("[%s] Failed to destroy stream",e.streamId,t)})),this.videoElement&&this.videoElement.dataset&&(this.videoElement.dataset.sessionId="",this.videoElement.dataset.streamId=""),this._channelContext.stream.value=null,this._channelContext.endPoint.value=null,this._peerConnectionContext.peerConnectionReconnectAttempts=0}},{key:"playMediaStreamInVideoElement",value:(t=l()(p().mark((function e(t){var n,r,i=this;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this._channelContext.videoElement.value){e.next=8;break}return this._channelContext.autoMuted.value=!1,this._channelContext.autoPaused.value=!1,this._channelContext.loading.value=!1,this._channelContext.playing.value=!1,this._channelContext.state.value=_.Z.Stopped,e.abrupt("return");case 8:if(n.srcObject=t,void 0!==(r=n.play())){e.next=17;break}return this._channelContext.autoMuted.value=!1,this._channelContext.autoPaused.value=!1,this._channelContext.loading.value=!1,this._channelContext.playing.value=!0,this._channelContext.state.value=_.Z.Playing,e.abrupt("return");case 17:return e.abrupt("return",r.then((function(){i._channelContext.autoMuted.value=!1,i._channelContext.autoPaused.value=!1,i._channelContext.loading.value=!1,i._channelContext.playing.value=!0,i._channelContext.state.value=_.Z.Playing})).catch((function(e){var r=!!t.getTracks().filter((function(e){return"audio"===e.kind})),o=!y.Z.automaticallyMuteVideoOnPlayFailure;return o||n.muted||!r?(i._channelContext.autoMuted.value=!1,i._channelContext.autoPaused.value=!0,i._channelContext.loading.value=!1,i._channelContext.playing.value=!1,i._channelContext.state.value=_.Z.Paused,o?(i._logger.info("[%s] Paused video after play failed. Manual user action required.",i.streamId,e),void(n.srcObject=null)):r?void i._logger.info("[%s] Failed to play video. Manual user action required.",i.streamId,e):void i._logger.info("[%s] Failed to play muted video. Manual user action required.",i.streamId,e)):(n.muted=!0,n.play().then((function(){i._logger.info("[%s] Played video after auto muting. Manual user action required to unmute.",i.streamId),i._channelContext.autoMuted.value=!0,i._channelContext.autoPaused.value=!1,i._channelContext.loading.value=!1,i._channelContext.playing.value=!0,i._channelContext.state.value=_.Z.Playing})).catch((function(e){n.muted=!1,i._logger.info("[%s] Failed to play video. Manual user action required.",i.streamId,e),i._channelContext.autoMuted.value=!1,i._channelContext.autoPaused.value=!0,i._channelContext.loading.value=!1,i._channelContext.playing.value=!1,i._channelContext.state.value=_.Z.Paused})))})));case 18:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),e}(),Ie=function(){function e(){throw a()(this,e),new Error("Channels is a static class that may not be instantiated")}return u()(e,null,[{key:"createChannel",value:function(e){if(!y.Z.initialized.value)throw new Error("SDK is not loaded.");return new Ze(e.videoElement,e.token,e.targetLag)}}]),e}()},4146:function(e,t,n){"use strict";n.r(t),n.d(t,{SDK:function(){return r.Z},Channels:function(){return i.Z},ChannelState:function(){return o.Z}});var r=n(5508),i=n(2070),o=n(2250);t.default={SDK:r.Z,Channels:i.Z,ChannelState:o.Z}},79:function(e,t,n){"use strict";n.d(t,{w:function(){return r}});var r="https://pcast.phenixrts.com/pcast/endPoints"},5564:function(e,t,n){"use strict";n.d(t,{Z:function(){return d}}),n(6992),n(3843),n(3710),n(1539),n(4916),n(9714),n(8783),n(4765),n(3948),n(285);var r=n(4575),i=n.n(r),o=n(3913),a=n.n(o),s=n(9713),u=n.n(s),c=n(79),l=n(7426),h=n(8862),d=function(){function e(){throw i()(this,e),new Error("DiscoveryUri is a static class that may not be instantiated")}return a()(e,null,[{key:"uri",get:function(){return e._discoveryUri}},{key:"buildDiscoveryUrl",value:function(e){var t=new URL(e.toString()),n=h.Z.sdkVersion;return t.search="?".concat(new URLSearchParams([["version",n],["_","".concat(Date.now())]]).toString()),"/"===t.pathname&&(t.pathname="/pcast/endPoints"),t.toString()}}]),e}();u()(d,"_discoveryUri",new l.Z(c.w))},3297:function(e,t,n){"use strict";n.d(t,{Z:function(){return h}}),n(6992),n(1539),n(8783),n(6755),n(3948),n(285);var r=n(4575),i=n.n(r),o=n(3913),a=n.n(o),s=n(9713),u=n.n(s),c=n(9571),l="DIGEST:",h=function(){function e(){i()(this,e)}return a()(e,null,[{key:"parseToken",value:function(t){if(this.isValidToken(t))try{var n=atob(t.substr(l.length)),r=JSON.parse(n);return r.token=JSON.parse(r.token),r}catch(t){return void e._logger.error("Cannot parse token value",t)}else e._logger.error("Token is not valid [%s]",t)}},{key:"getUri",value:function(e){return e&&e.token&&e.token.uri?new URL(e.token.uri):null}},{key:"getTenancy",value:function(e){return e&&e.applicationId?e.applicationId:""}},{key:"isValidToken",value:function(e){return!!e&&e.startsWith(l)}}]),e}();u()(h,"_logger",c.Z.getLogger("EdgeAuth"))},1228:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(4575),i=n.n(r),o=n(3913),a=n.n(o),s=n(9845),u=function(){function e(){i()(this,e)}return a()(e,null,[{key:"clientOfferDisabled",get:function(){return s.Z.isChrome74||s.Z.isChrome75||s.Z.isChrome76||s.Z.isChrome77}},{key:"addTranceiverDisabled",get:function(){return s.Z.isChrome69||s.Z.isChrome70||s.Z.isChrome71||s.Z.isChrome72}},{key:"getStatsPromiseBasedDisabled",get:function(){return"Chrome"===s.Z.browserName&&s.Z.browserMajorVersion<=66}},{key:"getCurrentOfferDisabled",get:function(){return"Chrome"===s.Z.browserName&&s.Z.browserMajorVersion<=69||"Firefox"===s.Z.browserName&&s.Z.browserMajorVersion<=56}},{key:"onTrackDisabled",get:function(){return"Chrome"===s.Z.browserName&&s.Z.browserMajorVersion<=63||"Firefox"===s.Z.browserName&&s.Z.browserMajorVersion<=52}},{key:"webkitRTCPeerConnectionEnabled",get:function(){return"Chrome"===s.Z.browserName&&s.Z.browserMajorVersion<=55}},{key:"promiseBasedPCMethodsDisabled",get:function(){return"Firefox"===s.Z.browserName&&s.Z.browserMajorVersion<=52}},{key:"shouldUseNativeHls",get:function(){return"Safari"===s.Z.browserName||"SamsungBrowser"===s.Z.browserName}},{key:"isRTMPEnabled",get:function(){return"Firefox"===s.Z.browserName&&s.Z.browserMajorVersion<84||"Chrome"===s.Z.browserName&&s.Z.browserMajorVersion<70||"Edge"===s.Z.browserName||"IE"===s.Z.browserName}},{key:"isPrecachingEnabled",get:function(){return"IE"!==s.Z.browserName}}]),e}()},8862:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}}),n(8733),n(3710);var r=n(4575),i=n.n(r),o=n(3913),a=n.n(o),s=n(9713),u=n.n(s),c=function(){function e(){i()(this,e)}return a()(e,null,[{key:"sdkVersion",get:function(){try{return"2022-12-23T18:20:11.081Z (2023.0.2)"}catch(e){return this._defaultVersion}}}]),e}();u()(c,"_defaultVersion",(new Date).toISOString())},3552:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(4575),i=n.n(r),o=n(3913),a=n.n(o),s=n(9713),u=n.n(s),c=n(5183),l=function(){function e(t){i()(this,e),u()(this,"_telemetryService",void 0),u()(this,"_tenancy",void 0),u()(this,"_sessionId",void 0),u()(this,"_threshold",void 0),this._tenancy=t.tenancy,this._sessionId=t.sessionId,this._threshold=t.threshold,this._telemetryService=new c.Z(t)}return a()(e,[{key:"log",value:function(e,t,n,r){e<this._threshold||this._telemetryService.push(e,t,n,r)}}]),e}()},5259:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}}),n(6992),n(3710),n(1539),n(9714),n(8783),n(3948),n(285);var r=n(4575),i=n.n(r),o=n(3913),a=n.n(o),s=n(9713),u=n.n(s),c=n(1178),l=function(){function e(){i()(this,e),u()(this,"_url","https://telemetry.phenixrts.com/telemetry/logs"),u()(this,"_tenancy",void 0),u()(this,"_sessionId",void 0),u()(this,"_environment",void 0),u()(this,"_threshold",c.Z.defaultTelemetryLoggingLevel)}return a()(e,[{key:"url",get:function(){return this._url},set:function(e){var t=new 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:"threshold",get:function(){return this._threshold},set:function(e){this._threshold=e}}]),e}()},5183:function(e,t,n){"use strict";n.d(t,{Z:function(){return v}}),n(5827),n(7042),n(8733),n(1539),n(2479),n(8674),n(5666);var r=n(8926),i=n.n(r),o=n(4575),a=n.n(o),s=n(3913),u=n.n(s),c=n(9713),l=n.n(c),h=n(7757),d=n.n(h),f=n(5149),p=n(8862),v=function(){function e(t){a()(this,e),l()(this,"_telemetryConfiguration",void 0),l()(this,"_logs",[]),l()(this,"_isSending",void 0),l()(this,"_domain",location.hostname),this._telemetryConfiguration=t}var t,n;return u()(e,[{key:"push",value:function(e,t,n,r){var i={timestamp:r.toISOString(),tenancy:this._telemetryConfiguration.tenancy,level:f.G[e],category:n,message:t,sessionId:this._telemetryConfiguration.sessionId,version:p.Z.sdkVersion,environment:this._telemetryConfiguration.environment,fullQualifiedName:this._domain};e<f.G.Error?this._logs.push(i):this._logs.unshift(i),this.sendLogsIfAble()}},{key:"sendLogs",value:(n=i()(d().mark((function e(t){var n;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(n=new FormData).append("jsonBody",JSON.stringify({records:t})),e.next=4,fetch(this._telemetryConfiguration.url,{method:"POST",body:n});case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"sendLogsIfAble",value:(t=i()(d().mark((function e(){var t,n,r,i,o=this;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(this._logs.length<=0||this._isSending)){e.next=2;break}return e.abrupt("return");case 2:for(t=0,n=0,this._isSending=!0,r=function(e){return Object.values(e).reduce((function(e,t){return e+(t?t.length:0)}),0)};this._logs.length>t&&r(this._logs[t])+n<8192;)n+=r(this._logs[t]),t++;return t||(this._logs[t].message=this._logs[t].message.substring(0,r(this._logs[t])+(8192-r(this._logs[t]))),t=1),i=this._logs.slice(0,t),this._logs=this._logs.slice(t),e.abrupt("return",this.sendLogs(i).then((function(e){return o._isSending=!1,o.sendLogsIfAble(),e})).catch((function(){o._isSending=!1,o.sendLogsIfAble()})));case 11:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}()},3099:function(e){e.exports=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e}},6077:function(e,t,n){var r=n(111);e.exports=function(e){if(!r(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype");return e}},1223:function(e,t,n){var r=n(5112),i=n(30),o=n(3070),a=r("unscopables"),s=Array.prototype;null==s[a]&&o.f(s,a,{configurable:!0,value:i(null)}),e.exports=function(e){s[a][e]=!0}},1530:function(e,t,n){"use strict";var r=n(8710).charAt;e.exports=function(e,t,n){return t+(n?r(e,t).length:1)}},5787:function(e){e.exports=function(e,t,n){if(!(e instanceof t))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation");return e}},9670:function(e,t,n){var r=n(111);e.exports=function(e){if(!r(e))throw TypeError(String(e)+" is not an object");return e}},1285:function(e,t,n){"use strict";var r=n(7908),i=n(1400),o=n(7466);e.exports=function(e){for(var t=r(this),n=o(t.length),a=arguments.length,s=i(a>1?arguments[1]:void 0,n),u=a>2?arguments[2]:void 0,c=void 0===u?n:i(u,n);c>s;)t[s++]=e;return t}},8533:function(e,t,n){"use strict";var r=n(2092).forEach,i=n(9341),o=n(9207),a=i("forEach"),s=o("forEach");e.exports=a&&s?[].forEach:function(e){return r(this,e,arguments.length>1?arguments[1]:void 0)}},8457:function(e,t,n){"use strict";var r=n(9974),i=n(7908),o=n(3411),a=n(7659),s=n(7466),u=n(6135),c=n(1246);e.exports=function(e){var t,n,l,h,d,f,p=i(e),v="function"==typeof this?this:Array,g=arguments.length,m=g>1?arguments[1]:void 0,y=void 0!==m,_=c(p),b=0;if(y&&(m=r(m,g>2?arguments[2]:void 0,2)),null==_||v==Array&&a(_))for(n=new v(t=s(p.length));t>b;b++)f=y?m(p[b],b):p[b],u(n,b,f);else for(d=(h=_.call(p)).next,n=new v;!(l=d.call(h)).done;b++)f=y?o(h,m,[l.value,b],!0):l.value,u(n,b,f);return n.length=b,n}},1318:function(e,t,n){var r=n(5656),i=n(7466),o=n(1400),a=function(e){return function(t,n,a){var s,u=r(t),c=i(u.length),l=o(a,c);if(e&&n!=n){for(;c>l;)if((s=u[l++])!=s)return!0}else for(;c>l;l++)if((e||l in u)&&u[l]===n)return e||l||0;return!e&&-1}};e.exports={includes:a(!0),indexOf:a(!1)}},2092:function(e,t,n){var r=n(9974),i=n(8361),o=n(7908),a=n(7466),s=n(5417),u=[].push,c=function(e){var t=1==e,n=2==e,c=3==e,l=4==e,h=6==e,d=7==e,f=5==e||h;return function(p,v,g,m){for(var y,_,b=o(p),w=i(b),x=r(v,g,3),C=a(w.length),S=0,k=m||s,T=t?k(p,C):n||d?k(p,0):void 0;C>S;S++)if((f||S in w)&&(_=x(y=w[S],S,b),e))if(t)T[S]=_;else if(_)switch(e){case 3:return!0;case 5:return y;case 6:return S;case 2:u.call(T,y)}else switch(e){case 4:return!1;case 7:u.call(T,y)}return h?-1:c||l?l:T}};e.exports={forEach:c(0),map:c(1),filter:c(2),some:c(3),every:c(4),find:c(5),findIndex:c(6),filterOut:c(7)}},1194:function(e,t,n){var r=n(7293),i=n(5112),o=n(7392),a=i("species");e.exports=function(e){return o>=51||!r((function(){var t=[];return(t.constructor={})[a]=function(){return{foo:1}},1!==t[e](Boolean).foo}))}},9341:function(e,t,n){"use strict";var r=n(7293);e.exports=function(e,t){var n=[][e];return!!n&&r((function(){n.call(null,t||function(){throw 1},1)}))}},9207:function(e,t,n){var r=n(9781),i=n(7293),o=n(6656),a=Object.defineProperty,s={},u=function(e){throw e};e.exports=function(e,t){if(o(s,e))return s[e];t||(t={});var n=[][e],c=!!o(t,"ACCESSORS")&&t.ACCESSORS,l=o(t,0)?t[0]:u,h=o(t,1)?t[1]:void 0;return s[e]=!!n&&!i((function(){if(c&&!r)return!0;var e={length:-1};c?a(e,1,{enumerable:!0,get:u}):e[1]=1,n.call(e,l,h)}))}},3671:function(e,t,n){var r=n(3099),i=n(7908),o=n(8361),a=n(7466),s=function(e){return function(t,n,s,u){r(n);var c=i(t),l=o(c),h=a(c.length),d=e?h-1:0,f=e?-1:1;if(s<2)for(;;){if(d in l){u=l[d],d+=f;break}if(d+=f,e?d<0:h<=d)throw TypeError("Reduce of empty array with no initial value")}for(;e?d>=0:h>d;d+=f)d in l&&(u=n(u,l[d],d,c));return u}};e.exports={left:s(!1),right:s(!0)}},5417:function(e,t,n){var r=n(111),i=n(3157),o=n(5112)("species");e.exports=function(e,t){var n;return i(e)&&("function"!=typeof(n=e.constructor)||n!==Array&&!i(n.prototype)?r(n)&&null===(n=n[o])&&(n=void 0):n=void 0),new(void 0===n?Array:n)(0===t?0:t)}},3411:function(e,t,n){var r=n(9670),i=n(9212);e.exports=function(e,t,n,o){try{return o?t(r(n)[0],n[1]):t(n)}catch(t){throw i(e),t}}},7072:function(e,t,n){var r=n(5112)("iterator"),i=!1;try{var o=0,a={next:function(){return{done:!!o++}},return:function(){i=!0}};a[r]=function(){return this},Array.from(a,(function(){throw 2}))}catch(e){}e.exports=function(e,t){if(!t&&!i)return!1;var n=!1;try{var o={};o[r]=function(){return{next:function(){return{done:n=!0}}}},e(o)}catch(e){}return n}},4326:function(e){var t={}.toString;e.exports=function(e){return t.call(e).slice(8,-1)}},648:function(e,t,n){var r=n(1694),i=n(4326),o=n(5112)("toStringTag"),a="Arguments"==i(function(){return arguments}());e.exports=r?i:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),o))?n:a?i(t):"Object"==(r=i(t))&&"function"==typeof t.callee?"Arguments":r}},9920:function(e,t,n){var r=n(6656),i=n(3887),o=n(1236),a=n(3070);e.exports=function(e,t){for(var n=i(t),s=a.f,u=o.f,c=0;c<n.length;c++){var l=n[c];r(e,l)||s(e,l,u(t,l))}}},4964:function(e,t,n){var r=n(5112)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[r]=!1,"/./"[e](t)}catch(e){}}return!1}},8544:function(e,t,n){var r=n(7293);e.exports=!r((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},4994:function(e,t,n){"use strict";var r=n(3383).IteratorPrototype,i=n(30),o=n(9114),a=n(8003),s=n(7497),u=function(){return this};e.exports=function(e,t,n){var c=t+" Iterator";return e.prototype=i(r,{next:o(1,n)}),a(e,c,!1,!0),s[c]=u,e}},8880:function(e,t,n){var r=n(9781),i=n(3070),o=n(9114);e.exports=r?function(e,t,n){return i.f(e,t,o(1,n))}:function(e,t,n){return e[t]=n,e}},9114:function(e){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},6135:function(e,t,n){"use strict";var r=n(7593),i=n(3070),o=n(9114);e.exports=function(e,t,n){var a=r(t);a in e?i.f(e,a,o(0,n)):e[a]=n}},5573:function(e,t,n){"use strict";var r=n(7293),i=n(6650).start,o=Math.abs,a=Date.prototype,s=a.getTime,u=a.toISOString;e.exports=r((function(){return"0385-07-25T07:06:39.999Z"!=u.call(new Date(-50000000000001))}))||!r((function(){u.call(new Date(NaN))}))?function(){if(!isFinite(s.call(this)))throw RangeError("Invalid time value");var e=this,t=e.getUTCFullYear(),n=e.getUTCMilliseconds(),r=t<0?"-":t>9999?"+":"";return r+i(o(t),r?6:4,0)+"-"+i(e.getUTCMonth()+1,2,0)+"-"+i(e.getUTCDate(),2,0)+"T"+i(e.getUTCHours(),2,0)+":"+i(e.getUTCMinutes(),2,0)+":"+i(e.getUTCSeconds(),2,0)+"."+i(n,3,0)+"Z"}:u},654:function(e,t,n){"use strict";var r=n(2109),i=n(4994),o=n(9518),a=n(7674),s=n(8003),u=n(8880),c=n(1320),l=n(5112),h=n(1913),d=n(7497),f=n(3383),p=f.IteratorPrototype,v=f.BUGGY_SAFARI_ITERATORS,g=l("iterator"),m="keys",y="values",_="entries",b=function(){return this};e.exports=function(e,t,n,l,f,w,x){i(n,t,l);var C,S,k,T=function(e){if(e===f&&R)return R;if(!v&&e in P)return P[e];switch(e){case m:case y:case _:return function(){return new n(this,e)}}return function(){return new n(this)}},E=t+" Iterator",L=!1,P=e.prototype,O=P[g]||P["@@iterator"]||f&&P[f],R=!v&&O||T(f),Z="Array"==t&&P.entries||O;if(Z&&(C=o(Z.call(new e)),p!==Object.prototype&&C.next&&(h||o(C)===p||(a?a(C,p):"function"!=typeof C[g]&&u(C,g,b)),s(C,E,!0,!0),h&&(d[E]=b))),f==y&&O&&O.name!==y&&(L=!0,R=function(){return O.call(this)}),h&&!x||P[g]===R||u(P,g,R),d[t]=R,f)if(S={values:T(y),keys:w?R:T(m),entries:T(_)},x)for(k in S)(v||L||!(k in P))&&c(P,k,S[k]);else r({target:t,proto:!0,forced:v||L},S);return S}},7235:function(e,t,n){var r=n(857),i=n(6656),o=n(6061),a=n(3070).f;e.exports=function(e){var t=r.Symbol||(r.Symbol={});i(t,e)||a(t,e,{value:o.f(e)})}},9781:function(e,t,n){var r=n(7293);e.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},317:function(e,t,n){var r=n(7854),i=n(111),o=r.document,a=i(o)&&i(o.createElement);e.exports=function(e){return a?o.createElement(e):{}}},8324:function(e){e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},6833:function(e,t,n){var r=n(8113);e.exports=/(iphone|ipod|ipad).*applewebkit/i.test(r)},5268:function(e,t,n){var r=n(4326),i=n(7854);e.exports="process"==r(i.process)},8113:function(e,t,n){var r=n(5005);e.exports=r("navigator","userAgent")||""},7392:function(e,t,n){var r,i,o=n(7854),a=n(8113),s=o.process,u=s&&s.versions,c=u&&u.v8;c?i=(r=c.split("."))[0]+r[1]:a&&(!(r=a.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=a.match(/Chrome\/(\d+)/))&&(i=r[1]),e.exports=i&&+i},748:function(e){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},2109:function(e,t,n){var r=n(7854),i=n(1236).f,o=n(8880),a=n(1320),s=n(3505),u=n(9920),c=n(4705);e.exports=function(e,t){var n,l,h,d,f,p=e.target,v=e.global,g=e.stat;if(n=v?r:g?r[p]||s(p,{}):(r[p]||{}).prototype)for(l in t){if(d=t[l],h=e.noTargetGet?(f=i(n,l))&&f.value:n[l],!c(v?l:p+(g?".":"#")+l,e.forced)&&void 0!==h){if(typeof d==typeof h)continue;u(d,h)}(e.sham||h&&h.sham)&&o(d,"sham",!0),a(n,l,d,e)}}},7293:function(e){e.exports=function(e){try{return!!e()}catch(e){return!0}}},7007:function(e,t,n){"use strict";n(4916);var r=n(1320),i=n(7293),o=n(5112),a=n(2261),s=n(8880),u=o("species"),c=!i((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")})),l="$0"==="a".replace(/./,"$0"),h=o("replace"),d=!!/./[h]&&""===/./[h]("a","$0"),f=!i((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2!==n.length||"a"!==n[0]||"b"!==n[1]}));e.exports=function(e,t,n,h){var p=o(e),v=!i((function(){var t={};return t[p]=function(){return 7},7!=""[e](t)})),g=v&&!i((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[u]=function(){return n},n.flags="",n[p]=/./[p]),n.exec=function(){return t=!0,null},n[p](""),!t}));if(!v||!g||"replace"===e&&(!c||!l||d)||"split"===e&&!f){var m=/./[p],y=n(p,""[e],(function(e,t,n,r,i){return t.exec===a?v&&!i?{done:!0,value:m.call(t,n,r)}:{done:!0,value:e.call(n,t,r)}:{done:!1}}),{REPLACE_KEEPS_$0:l,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:d}),_=y[0],b=y[1];r(String.prototype,e,_),r(RegExp.prototype,p,2==t?function(e,t){return b.call(e,this,t)}:function(e){return b.call(e,this)})}h&&s(RegExp.prototype[p],"sham",!0)}},9974:function(e,t,n){var r=n(3099);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 0:return function(){return e.call(t)};case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}},7065:function(e,t,n){"use strict";var r=n(3099),i=n(111),o=[].slice,a={},s=function(e,t,n){if(!(t in a)){for(var r=[],i=0;i<t;i++)r[i]="a["+i+"]";a[t]=Function("C,a","return new C("+r.join(",")+")")}return a[t](e,n)};e.exports=Function.bind||function(e){var t=r(this),n=o.call(arguments,1),a=function(){var r=n.concat(o.call(arguments));return this instanceof a?s(t,r.length,r):t.apply(e,r)};return i(t.prototype)&&(a.prototype=t.prototype),a}},5005:function(e,t,n){var r=n(857),i=n(7854),o=function(e){return"function"==typeof e?e:void 0};e.exports=function(e,t){return arguments.length<2?o(r[e])||o(i[e]):r[e]&&r[e][t]||i[e]&&i[e][t]}},1246:function(e,t,n){var r=n(648),i=n(7497),o=n(5112)("iterator");e.exports=function(e){if(null!=e)return e[o]||e["@@iterator"]||i[r(e)]}},8554:function(e,t,n){var r=n(9670),i=n(1246);e.exports=function(e){var t=i(e);if("function"!=typeof t)throw TypeError(String(e)+" is not iterable");return r(t.call(e))}},7854:function(e,t,n){var r=function(e){return e&&e.Math==Math&&e};e.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof n.g&&n.g)||function(){return this}()||Function("return this")()},6656:function(e){var t={}.hasOwnProperty;e.exports=function(e,n){return t.call(e,n)}},3501:function(e){e.exports={}},842:function(e,t,n){var r=n(7854);e.exports=function(e,t){var n=r.console;n&&n.error&&(1===arguments.length?n.error(e):n.error(e,t))}},490:function(e,t,n){var r=n(5005);e.exports=r("document","documentElement")},4664:function(e,t,n){var r=n(9781),i=n(7293),o=n(317);e.exports=!r&&!i((function(){return 7!=Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},8361:function(e,t,n){var r=n(7293),i=n(4326),o="".split;e.exports=r((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==i(e)?o.call(e,""):Object(e)}:Object},9587:function(e,t,n){var r=n(111),i=n(7674);e.exports=function(e,t,n){var o,a;return i&&"function"==typeof(o=t.constructor)&&o!==n&&r(a=o.prototype)&&a!==n.prototype&&i(e,a),e}},2788:function(e,t,n){var r=n(5465),i=Function.toString;"function"!=typeof r.inspectSource&&(r.inspectSource=function(e){return i.call(e)}),e.exports=r.inspectSource},9909:function(e,t,n){var r,i,o,a=n(8536),s=n(7854),u=n(111),c=n(8880),l=n(6656),h=n(5465),d=n(6200),f=n(3501),p=s.WeakMap;if(a){var v=h.state||(h.state=new p),g=v.get,m=v.has,y=v.set;r=function(e,t){return t.facade=e,y.call(v,e,t),t},i=function(e){return g.call(v,e)||{}},o=function(e){return m.call(v,e)}}else{var _=d("state");f[_]=!0,r=function(e,t){return t.facade=e,c(e,_,t),t},i=function(e){return l(e,_)?e[_]:{}},o=function(e){return l(e,_)}}e.exports={set:r,get:i,has:o,enforce:function(e){return o(e)?i(e):r(e,{})},getterFor:function(e){return function(t){var n;if(!u(t)||(n=i(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}}}},7659:function(e,t,n){var r=n(5112),i=n(7497),o=r("iterator"),a=Array.prototype;e.exports=function(e){return void 0!==e&&(i.Array===e||a[o]===e)}},3157:function(e,t,n){var r=n(4326);e.exports=Array.isArray||function(e){return"Array"==r(e)}},4705:function(e,t,n){var r=n(7293),i=/#|\.prototype\./,o=function(e,t){var n=s[a(e)];return n==c||n!=u&&("function"==typeof t?r(t):!!t)},a=o.normalize=function(e){return String(e).replace(i,".").toLowerCase()},s=o.data={},u=o.NATIVE="N",c=o.POLYFILL="P";e.exports=o},111:function(e){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},1913:function(e){e.exports=!1},7850:function(e,t,n){var r=n(111),i=n(4326),o=n(5112)("match");e.exports=function(e){var t;return r(e)&&(void 0!==(t=e[o])?!!t:"RegExp"==i(e))}},408:function(e,t,n){var r=n(9670),i=n(7659),o=n(7466),a=n(9974),s=n(1246),u=n(9212),c=function(e,t){this.stopped=e,this.result=t};e.exports=function(e,t,n){var l,h,d,f,p,v,g,m=n&&n.that,y=!(!n||!n.AS_ENTRIES),_=!(!n||!n.IS_ITERATOR),b=!(!n||!n.INTERRUPTED),w=a(t,m,1+y+b),x=function(e){return l&&u(l),new c(!0,e)},C=function(e){return y?(r(e),b?w(e[0],e[1],x):w(e[0],e[1])):b?w(e,x):w(e)};if(_)l=e;else{if("function"!=typeof(h=s(e)))throw TypeError("Target is not iterable");if(i(h)){for(d=0,f=o(e.length);f>d;d++)if((p=C(e[d]))&&p instanceof c)return p;return new c(!1)}l=h.call(e)}for(v=l.next;!(g=v.call(l)).done;){try{p=C(g.value)}catch(e){throw u(l),e}if("object"==typeof p&&p&&p instanceof c)return p}return new c(!1)}},9212:function(e,t,n){var r=n(9670);e.exports=function(e){var t=e.return;if(void 0!==t)return r(t.call(e)).value}},3383:function(e,t,n){"use strict";var r,i,o,a=n(9518),s=n(8880),u=n(6656),c=n(5112),l=n(1913),h=c("iterator"),d=!1;[].keys&&("next"in(o=[].keys())?(i=a(a(o)))!==Object.prototype&&(r=i):d=!0),null==r&&(r={}),l||u(r,h)||s(r,h,(function(){return this})),e.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:d}},7497:function(e){e.exports={}},5948:function(e,t,n){var r,i,o,a,s,u,c,l,h=n(7854),d=n(1236).f,f=n(261).set,p=n(6833),v=n(5268),g=h.MutationObserver||h.WebKitMutationObserver,m=h.document,y=h.process,_=h.Promise,b=d(h,"queueMicrotask"),w=b&&b.value;w||(r=function(){var e,t;for(v&&(e=y.domain)&&e.exit();i;){t=i.fn,i=i.next;try{t()}catch(e){throw i?a():o=void 0,e}}o=void 0,e&&e.enter()},!p&&!v&&g&&m?(s=!0,u=m.createTextNode(""),new g(r).observe(u,{characterData:!0}),a=function(){u.data=s=!s}):_&&_.resolve?(c=_.resolve(void 0),l=c.then,a=function(){l.call(c,r)}):a=v?function(){y.nextTick(r)}:function(){f.call(h,r)}),e.exports=w||function(e){var t={fn:e,next:void 0};o&&(o.next=t),i||(i=t,a()),o=t}},3366:function(e,t,n){var r=n(7854);e.exports=r.Promise},133:function(e,t,n){var r=n(7293);e.exports=!!Object.getOwnPropertySymbols&&!r((function(){return!String(Symbol())}))},590:function(e,t,n){var r=n(7293),i=n(5112),o=n(1913),a=i("iterator");e.exports=!r((function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,n="";return e.pathname="c%20d",t.forEach((function(e,r){t.delete("b"),n+=r+e})),o&&!e.toJSON||!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[a]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==n||"x"!==new URL("http://x",void 0).host}))},8536:function(e,t,n){var r=n(7854),i=n(2788),o=r.WeakMap;e.exports="function"==typeof o&&/native code/.test(i(o))},8523:function(e,t,n){"use strict";var r=n(3099),i=function(e){var t,n;this.promise=new e((function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r})),this.resolve=r(t),this.reject=r(n)};e.exports.f=function(e){return new i(e)}},3929:function(e,t,n){var r=n(7850);e.exports=function(e){if(r(e))throw TypeError("The method doesn't accept regular expressions");return e}},3009:function(e,t,n){var r=n(7854),i=n(3111).trim,o=n(1361),a=r.parseInt,s=/^[+-]?0[Xx]/,u=8!==a(o+"08")||22!==a(o+"0x16");e.exports=u?function(e,t){var n=i(String(e));return a(n,t>>>0||(s.test(n)?16:10))}:a},1574:function(e,t,n){"use strict";var r=n(9781),i=n(7293),o=n(1956),a=n(5181),s=n(5296),u=n(7908),c=n(8361),l=Object.assign,h=Object.defineProperty;e.exports=!l||i((function(){if(r&&1!==l({b:1},l(h({},"a",{enumerable:!0,get:function(){h(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},n=Symbol(),i="abcdefghijklmnopqrst";return e[n]=7,i.split("").forEach((function(e){t[e]=e})),7!=l({},e)[n]||o(l({},t)).join("")!=i}))?function(e,t){for(var n=u(e),i=arguments.length,l=1,h=a.f,d=s.f;i>l;)for(var f,p=c(arguments[l++]),v=h?o(p).concat(h(p)):o(p),g=v.length,m=0;g>m;)f=v[m++],r&&!d.call(p,f)||(n[f]=p[f]);return n}:l},30:function(e,t,n){var r,i=n(9670),o=n(6048),a=n(748),s=n(3501),u=n(490),c=n(317),l=n(6200),h="prototype",d="script",f=l("IE_PROTO"),p=function(){},v=function(e){return"<"+d+">"+e+"</"+d+">"},g=function(){try{r=document.domain&&new ActiveXObject("htmlfile")}catch(e){}var e,t,n;g=r?function(e){e.write(v("")),e.close();var t=e.parentWindow.Object;return e=null,t}(r):(t=c("iframe"),n="java"+d+":",t.style.display="none",u.appendChild(t),t.src=String(n),(e=t.contentWindow.document).open(),e.write(v("document.F=Object")),e.close(),e.F);for(var i=a.length;i--;)delete g[h][a[i]];return g()};s[f]=!0,e.exports=Object.create||function(e,t){var n;return null!==e?(p[h]=i(e),n=new p,p[h]=null,n[f]=e):n=g(),void 0===t?n:o(n,t)}},6048:function(e,t,n){var r=n(9781),i=n(3070),o=n(9670),a=n(1956);e.exports=r?Object.defineProperties:function(e,t){o(e);for(var n,r=a(t),s=r.length,u=0;s>u;)i.f(e,n=r[u++],t[n]);return e}},3070:function(e,t,n){var r=n(9781),i=n(4664),o=n(9670),a=n(7593),s=Object.defineProperty;t.f=r?s:function(e,t,n){if(o(e),t=a(t,!0),o(n),i)try{return s(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},1236:function(e,t,n){var r=n(9781),i=n(5296),o=n(9114),a=n(5656),s=n(7593),u=n(6656),c=n(4664),l=Object.getOwnPropertyDescriptor;t.f=r?l:function(e,t){if(e=a(e),t=s(t,!0),c)try{return l(e,t)}catch(e){}if(u(e,t))return o(!i.f.call(e,t),e[t])}},1156:function(e,t,n){var r=n(5656),i=n(8006).f,o={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return a&&"[object Window]"==o.call(e)?function(e){try{return i(e)}catch(e){return a.slice()}}(e):i(r(e))}},8006:function(e,t,n){var r=n(6324),i=n(748).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,i)}},5181:function(e,t){t.f=Object.getOwnPropertySymbols},9518:function(e,t,n){var r=n(6656),i=n(7908),o=n(6200),a=n(8544),s=o("IE_PROTO"),u=Object.prototype;e.exports=a?Object.getPrototypeOf:function(e){return e=i(e),r(e,s)?e[s]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?u:null}},6324:function(e,t,n){var r=n(6656),i=n(5656),o=n(1318).indexOf,a=n(3501);e.exports=function(e,t){var n,s=i(e),u=0,c=[];for(n in s)!r(a,n)&&r(s,n)&&c.push(n);for(;t.length>u;)r(s,n=t[u++])&&(~o(c,n)||c.push(n));return c}},1956:function(e,t,n){var r=n(6324),i=n(748);e.exports=Object.keys||function(e){return r(e,i)}},5296:function(e,t){"use strict";var n={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,i=r&&!n.call({1:2},1);t.f=i?function(e){var t=r(this,e);return!!t&&t.enumerable}:n},7674:function(e,t,n){var r=n(9670),i=n(6077);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),t=n instanceof Array}catch(e){}return function(n,o){return r(n),i(o),t?e.call(n,o):n.__proto__=o,n}}():void 0)},4699:function(e,t,n){var r=n(9781),i=n(1956),o=n(5656),a=n(5296).f,s=function(e){return function(t){for(var n,s=o(t),u=i(s),c=u.length,l=0,h=[];c>l;)n=u[l++],r&&!a.call(s,n)||h.push(e?[n,s[n]]:s[n]);return h}};e.exports={entries:s(!0),values:s(!1)}},288:function(e,t,n){"use strict";var r=n(1694),i=n(648);e.exports=r?{}.toString:function(){return"[object "+i(this)+"]"}},3887:function(e,t,n){var r=n(5005),i=n(8006),o=n(5181),a=n(9670);e.exports=r("Reflect","ownKeys")||function(e){var t=i.f(a(e)),n=o.f;return n?t.concat(n(e)):t}},857:function(e,t,n){var r=n(7854);e.exports=r},2534:function(e){e.exports=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}},9478:function(e,t,n){var r=n(9670),i=n(111),o=n(8523);e.exports=function(e,t){if(r(e),i(t)&&t.constructor===e)return t;var n=o.f(e);return(0,n.resolve)(t),n.promise}},2248:function(e,t,n){var r=n(1320);e.exports=function(e,t,n){for(var i in t)r(e,i,t[i],n);return e}},1320:function(e,t,n){var r=n(7854),i=n(8880),o=n(6656),a=n(3505),s=n(2788),u=n(9909),c=u.get,l=u.enforce,h=String(String).split("String");(e.exports=function(e,t,n,s){var u,c=!!s&&!!s.unsafe,d=!!s&&!!s.enumerable,f=!!s&&!!s.noTargetGet;"function"==typeof n&&("string"!=typeof t||o(n,"name")||i(n,"name",t),(u=l(n)).source||(u.source=h.join("string"==typeof t?t:""))),e!==r?(c?!f&&e[t]&&(d=!0):delete e[t],d?e[t]=n:i(e,t,n)):d?e[t]=n:a(t,n)})(Function.prototype,"toString",(function(){return"function"==typeof this&&c(this).source||s(this)}))},7651:function(e,t,n){var r=n(4326),i=n(2261);e.exports=function(e,t){var n=e.exec;if("function"==typeof n){var o=n.call(e,t);if("object"!=typeof o)throw TypeError("RegExp exec method returned something other than an Object or null");return o}if("RegExp"!==r(e))throw TypeError("RegExp#exec called on incompatible receiver");return i.call(e,t)}},2261:function(e,t,n){"use strict";var r,i,o=n(7066),a=n(2999),s=RegExp.prototype.exec,u=String.prototype.replace,c=s,l=(r=/a/,i=/b*/g,s.call(r,"a"),s.call(i,"a"),0!==r.lastIndex||0!==i.lastIndex),h=a.UNSUPPORTED_Y||a.BROKEN_CARET,d=void 0!==/()??/.exec("")[1];(l||d||h)&&(c=function(e){var t,n,r,i,a=this,c=h&&a.sticky,f=o.call(a),p=a.source,v=0,g=e;return c&&(-1===(f=f.replace("y","")).indexOf("g")&&(f+="g"),g=String(e).slice(a.lastIndex),a.lastIndex>0&&(!a.multiline||a.multiline&&"\n"!==e[a.lastIndex-1])&&(p="(?: "+p+")",g=" "+g,v++),n=new RegExp("^(?:"+p+")",f)),d&&(n=new RegExp("^"+p+"$(?!\\s)",f)),l&&(t=a.lastIndex),r=s.call(c?n:a,g),c?r?(r.input=r.input.slice(v),r[0]=r[0].slice(v),r.index=a.lastIndex,a.lastIndex+=r[0].length):a.lastIndex=0:l&&r&&(a.lastIndex=a.global?r.index+r[0].length:t),d&&r&&r.length>1&&u.call(r[0],n,(function(){for(i=1;i<arguments.length-2;i++)void 0===arguments[i]&&(r[i]=void 0)})),r}),e.exports=c},7066:function(e,t,n){"use strict";var r=n(9670);e.exports=function(){var e=r(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}},2999:function(e,t,n){"use strict";var r=n(7293);function i(e,t){return RegExp(e,t)}t.UNSUPPORTED_Y=r((function(){var e=i("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),t.BROKEN_CARET=r((function(){var e=i("^r","gy");return e.lastIndex=2,null!=e.exec("str")}))},4488:function(e){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},1150:function(e){e.exports=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}},3505:function(e,t,n){var r=n(7854),i=n(8880);e.exports=function(e,t){try{i(r,e,t)}catch(n){r[e]=t}return t}},6340:function(e,t,n){"use strict";var r=n(5005),i=n(3070),o=n(5112),a=n(9781),s=o("species");e.exports=function(e){var t=r(e),n=i.f;a&&t&&!t[s]&&n(t,s,{configurable:!0,get:function(){return this}})}},8003:function(e,t,n){var r=n(3070).f,i=n(6656),o=n(5112)("toStringTag");e.exports=function(e,t,n){e&&!i(e=n?e:e.prototype,o)&&r(e,o,{configurable:!0,value:t})}},6200:function(e,t,n){var r=n(2309),i=n(9711),o=r("keys");e.exports=function(e){return o[e]||(o[e]=i(e))}},5465:function(e,t,n){var r=n(7854),i=n(3505),o="__core-js_shared__",a=r[o]||i(o,{});e.exports=a},2309:function(e,t,n){var r=n(1913),i=n(5465);(e.exports=function(e,t){return i[e]||(i[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.8.1",mode:r?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},6707:function(e,t,n){var r=n(9670),i=n(3099),o=n(5112)("species");e.exports=function(e,t){var n,a=r(e).constructor;return void 0===a||null==(n=r(a)[o])?t:i(n)}},8710:function(e,t,n){var r=n(9958),i=n(4488),o=function(e){return function(t,n){var o,a,s=String(i(t)),u=r(n),c=s.length;return u<0||u>=c?e?"":void 0:(o=s.charCodeAt(u))<55296||o>56319||u+1===c||(a=s.charCodeAt(u+1))<56320||a>57343?e?s.charAt(u):o:e?s.slice(u,u+2):a-56320+(o-55296<<10)+65536}};e.exports={codeAt:o(!1),charAt:o(!0)}},4986:function(e,t,n){var r=n(8113);e.exports=/Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(r)},6650:function(e,t,n){var r=n(7466),i=n(8415),o=n(4488),a=Math.ceil,s=function(e){return function(t,n,s){var u,c,l=String(o(t)),h=l.length,d=void 0===s?" ":String(s),f=r(n);return f<=h||""==d?l:(u=f-h,(c=i.call(d,a(u/d.length))).length>u&&(c=c.slice(0,u)),e?l+c:c+l)}};e.exports={start:s(!1),end:s(!0)}},3197:function(e){"use strict";var t=2147483647,n=/[^\0-\u007E]/,r=/[.\u3002\uFF0E\uFF61]/g,i="Overflow: input needs wider integers to process",o=Math.floor,a=String.fromCharCode,s=function(e){return e+22+75*(e<26)},u=function(e,t,n){var r=0;for(e=n?o(e/700):e>>1,e+=o(e/t);e>455;r+=36)e=o(e/35);return o(r+36*e/(e+38))},c=function(e){var n=[];e=function(e){for(var t=[],n=0,r=e.length;n<r;){var i=e.charCodeAt(n++);if(i>=55296&&i<=56319&&n<r){var o=e.charCodeAt(n++);56320==(64512&o)?t.push(((1023&i)<<10)+(1023&o)+65536):(t.push(i),n--)}else t.push(i)}return t}(e);var r,c,l=e.length,h=128,d=0,f=72;for(r=0;r<e.length;r++)(c=e[r])<128&&n.push(a(c));var p=n.length,v=p;for(p&&n.push("-");v<l;){var g=t;for(r=0;r<e.length;r++)(c=e[r])>=h&&c<g&&(g=c);var m=v+1;if(g-h>o((t-d)/m))throw RangeError(i);for(d+=(g-h)*m,h=g,r=0;r<e.length;r++){if((c=e[r])<h&&++d>t)throw RangeError(i);if(c==h){for(var y=d,_=36;;_+=36){var b=_<=f?1:_>=f+26?26:_-f;if(y<b)break;var w=y-b,x=36-b;n.push(a(s(b+w%x))),y=o(w/x)}n.push(a(s(y))),f=u(d,m,v==p),d=0,++v}}++d,++h}return n.join("")};e.exports=function(e){var t,i,o=[],a=e.toLowerCase().replace(r,".").split(".");for(t=0;t<a.length;t++)i=a[t],o.push(n.test(i)?"xn--"+c(i):i);return o.join(".")}},8415:function(e,t,n){"use strict";var r=n(9958),i=n(4488);e.exports="".repeat||function(e){var t=String(i(this)),n="",o=r(e);if(o<0||o==1/0)throw RangeError("Wrong number of repetitions");for(;o>0;(o>>>=1)&&(t+=t))1&o&&(n+=t);return n}},3111:function(e,t,n){var r=n(4488),i="["+n(1361)+"]",o=RegExp("^"+i+i+"*"),a=RegExp(i+i+"*$"),s=function(e){return function(t){var n=String(r(t));return 1&e&&(n=n.replace(o,"")),2&e&&(n=n.replace(a,"")),n}};e.exports={start:s(1),end:s(2),trim:s(3)}},261:function(e,t,n){var r,i,o,a=n(7854),s=n(7293),u=n(9974),c=n(490),l=n(317),h=n(6833),d=n(5268),f=a.location,p=a.setImmediate,v=a.clearImmediate,g=a.process,m=a.MessageChannel,y=a.Dispatch,_=0,b={},w="onreadystatechange",x=function(e){if(b.hasOwnProperty(e)){var t=b[e];delete b[e],t()}},C=function(e){return function(){x(e)}},S=function(e){x(e.data)},k=function(e){a.postMessage(e+"",f.protocol+"//"+f.host)};p&&v||(p=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return b[++_]=function(){("function"==typeof e?e:Function(e)).apply(void 0,t)},r(_),_},v=function(e){delete b[e]},d?r=function(e){g.nextTick(C(e))}:y&&y.now?r=function(e){y.now(C(e))}:m&&!h?(o=(i=new m).port2,i.port1.onmessage=S,r=u(o.postMessage,o,1)):a.addEventListener&&"function"==typeof postMessage&&!a.importScripts&&f&&"file:"!==f.protocol&&!s(k)?(r=k,a.addEventListener("message",S,!1)):r=w in l("script")?function(e){c.appendChild(l("script"))[w]=function(){c.removeChild(this),x(e)}}:function(e){setTimeout(C(e),0)}),e.exports={set:p,clear:v}},1400:function(e,t,n){var r=n(9958),i=Math.max,o=Math.min;e.exports=function(e,t){var n=r(e);return n<0?i(n+t,0):o(n,t)}},5656:function(e,t,n){var r=n(8361),i=n(4488);e.exports=function(e){return r(i(e))}},9958:function(e){var t=Math.ceil,n=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?n:t)(e)}},7466:function(e,t,n){var r=n(9958),i=Math.min;e.exports=function(e){return e>0?i(r(e),9007199254740991):0}},7908:function(e,t,n){var r=n(4488);e.exports=function(e){return Object(r(e))}},7593:function(e,t,n){var r=n(111);e.exports=function(e,t){if(!r(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!r(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},1694:function(e,t,n){var r={};r[n(5112)("toStringTag")]="z",e.exports="[object z]"===String(r)},9711:function(e){var t=0,n=Math.random();e.exports=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++t+n).toString(36)}},3307:function(e,t,n){var r=n(133);e.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},6061:function(e,t,n){var r=n(5112);t.f=r},5112:function(e,t,n){var r=n(7854),i=n(2309),o=n(6656),a=n(9711),s=n(133),u=n(3307),c=i("wks"),l=r.Symbol,h=u?l:l&&l.withoutSetter||a;e.exports=function(e){return o(c,e)||(s&&o(l,e)?c[e]=l[e]:c[e]=h("Symbol."+e)),c[e]}},1361:function(e){e.exports="\t\n\v\f\r                 \u2028\u2029\ufeff"},2222:function(e,t,n){"use strict";var r=n(2109),i=n(7293),o=n(3157),a=n(111),s=n(7908),u=n(7466),c=n(6135),l=n(5417),h=n(1194),d=n(5112),f=n(7392),p=d("isConcatSpreadable"),v=9007199254740991,g="Maximum allowed index exceeded",m=f>=51||!i((function(){var e=[];return e[p]=!1,e.concat()[0]!==e})),y=h("concat"),_=function(e){if(!a(e))return!1;var t=e[p];return void 0!==t?!!t:o(e)};r({target:"Array",proto:!0,forced:!m||!y},{concat:function(e){var t,n,r,i,o,a=s(this),h=l(a,0),d=0;for(t=-1,r=arguments.length;t<r;t++)if(_(o=-1===t?a:arguments[t])){if(d+(i=u(o.length))>v)throw TypeError(g);for(n=0;n<i;n++,d++)n in o&&c(h,d,o[n])}else{if(d>=v)throw TypeError(g);c(h,d++,o)}return h.length=d,h}})},3290:function(e,t,n){var r=n(2109),i=n(1285),o=n(1223);r({target:"Array",proto:!0},{fill:i}),o("fill")},7327:function(e,t,n){"use strict";var r=n(2109),i=n(2092).filter,o=n(1194),a=n(9207),s=o("filter"),u=a("filter");r({target:"Array",proto:!0,forced:!s||!u},{filter:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},4553:function(e,t,n){"use strict";var r=n(2109),i=n(2092).findIndex,o=n(1223),a=n(9207),s="findIndex",u=!0,c=a(s);s in[]&&Array(1)[s]((function(){u=!1})),r({target:"Array",proto:!0,forced:u||!c},{findIndex:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),o(s)},9826:function(e,t,n){"use strict";var r=n(2109),i=n(2092).find,o=n(1223),a=n(9207),s="find",u=!0,c=a(s);s in[]&&Array(1)[s]((function(){u=!1})),r({target:"Array",proto:!0,forced:u||!c},{find:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),o(s)},9554:function(e,t,n){"use strict";var r=n(2109),i=n(8533);r({target:"Array",proto:!0,forced:[].forEach!=i},{forEach:i})},6699:function(e,t,n){"use strict";var r=n(2109),i=n(1318).includes,o=n(1223);r({target:"Array",proto:!0,forced:!n(9207)("indexOf",{ACCESSORS:!0,1:0})},{includes:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),o("includes")},2772:function(e,t,n){"use strict";var r=n(2109),i=n(1318).indexOf,o=n(9341),a=n(9207),s=[].indexOf,u=!!s&&1/[1].indexOf(1,-0)<0,c=o("indexOf"),l=a("indexOf",{ACCESSORS:!0,1:0});r({target:"Array",proto:!0,forced:u||!c||!l},{indexOf:function(e){return u?s.apply(this,arguments)||0:i(this,e,arguments.length>1?arguments[1]:void 0)}})},9753:function(e,t,n){n(2109)({target:"Array",stat:!0},{isArray:n(3157)})},6992:function(e,t,n){"use strict";var r=n(5656),i=n(1223),o=n(7497),a=n(9909),s=n(654),u="Array Iterator",c=a.set,l=a.getterFor(u);e.exports=s(Array,"Array",(function(e,t){c(this,{type:u,target:r(e),index:0,kind:t})}),(function(){var e=l(this),t=e.target,n=e.kind,r=e.index++;return!t||r>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:r,done:!1}:"values"==n?{value:t[r],done:!1}:{value:[r,t[r]],done:!1}}),"values"),o.Arguments=o.Array,i("keys"),i("values"),i("entries")},9600:function(e,t,n){"use strict";var r=n(2109),i=n(8361),o=n(5656),a=n(9341),s=[].join,u=i!=Object,c=a("join",",");r({target:"Array",proto:!0,forced:u||!c},{join:function(e){return s.call(o(this),void 0===e?",":e)}})},1249:function(e,t,n){"use strict";var r=n(2109),i=n(2092).map,o=n(1194),a=n(9207),s=o("map"),u=a("map");r({target:"Array",proto:!0,forced:!s||!u},{map:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},5827:function(e,t,n){"use strict";var r=n(2109),i=n(3671).left,o=n(9341),a=n(9207),s=n(7392),u=n(5268),c=o("reduce"),l=a("reduce",{1:0});r({target:"Array",proto:!0,forced:!c||!l||!u&&s>79&&s<83},{reduce:function(e){return i(this,e,arguments.length,arguments.length>1?arguments[1]:void 0)}})},7042:function(e,t,n){"use strict";var r=n(2109),i=n(111),o=n(3157),a=n(1400),s=n(7466),u=n(5656),c=n(6135),l=n(5112),h=n(1194),d=n(9207),f=h("slice"),p=d("slice",{ACCESSORS:!0,0:0,1:2}),v=l("species"),g=[].slice,m=Math.max;r({target:"Array",proto:!0,forced:!f||!p},{slice:function(e,t){var n,r,l,h=u(this),d=s(h.length),f=a(e,d),p=a(void 0===t?d:t,d);if(o(h)&&("function"!=typeof(n=h.constructor)||n!==Array&&!o(n.prototype)?i(n)&&null===(n=n[v])&&(n=void 0):n=void 0,n===Array||void 0===n))return g.call(h,f,p);for(r=new(void 0===n?Array:n)(m(p-f,0)),l=0;f<p;f++,l++)f in h&&c(r,l,h[f]);return r.length=l,r}})},561:function(e,t,n){"use strict";var r=n(2109),i=n(1400),o=n(9958),a=n(7466),s=n(7908),u=n(5417),c=n(6135),l=n(1194),h=n(9207),d=l("splice"),f=h("splice",{ACCESSORS:!0,0:0,1:2}),p=Math.max,v=Math.min,g=9007199254740991,m="Maximum allowed length exceeded";r({target:"Array",proto:!0,forced:!d||!f},{splice:function(e,t){var n,r,l,h,d,f,y=s(this),_=a(y.length),b=i(e,_),w=arguments.length;if(0===w?n=r=0:1===w?(n=0,r=_-b):(n=w-2,r=v(p(o(t),0),_-b)),_+n-r>g)throw TypeError(m);for(l=u(y,r),h=0;h<r;h++)(d=b+h)in y&&c(l,h,y[d]);if(l.length=r,n<r){for(h=b;h<_-r;h++)f=h+n,(d=h+r)in y?y[f]=y[d]:delete y[f];for(h=_;h>_-r+n;h--)delete y[h-1]}else if(n>r)for(h=_-r;h>b;h--)f=h+n-1,(d=h+r-1)in y?y[f]=y[d]:delete y[f];for(h=0;h<n;h++)y[h+b]=arguments[h+2];return y.length=_-r+n,l}})},3843:function(e,t,n){n(2109)({target:"Date",stat:!0},{now:function(){return(new Date).getTime()}})},8733:function(e,t,n){var r=n(2109),i=n(5573);r({target:"Date",proto:!0,forced:Date.prototype.toISOString!==i},{toISOString:i})},3710:function(e,t,n){var r=n(1320),i=Date.prototype,o="Invalid Date",a="toString",s=i[a],u=i.getTime;new Date(NaN)+""!=o&&r(i,a,(function(){var e=u.call(this);return e==e?s.call(this):o}))},4812:function(e,t,n){n(2109)({target:"Function",proto:!0},{bind:n(7065)})},8309:function(e,t,n){var r=n(9781),i=n(3070).f,o=Function.prototype,a=o.toString,s=/^\s*function ([^ (]*)/,u="name";r&&!(u in o)&&i(o,u,{configurable:!0,get:function(){try{return a.call(this).match(s)[1]}catch(e){return""}}})},9653:function(e,t,n){"use strict";var r=n(9781),i=n(7854),o=n(4705),a=n(1320),s=n(6656),u=n(4326),c=n(9587),l=n(7593),h=n(7293),d=n(30),f=n(8006).f,p=n(1236).f,v=n(3070).f,g=n(3111).trim,m="Number",y=i[m],_=y.prototype,b=u(d(_))==m,w=function(e){var t,n,r,i,o,a,s,u,c=l(e,!1);if("string"==typeof c&&c.length>2)if(43===(t=(c=g(c)).charCodeAt(0))||45===t){if(88===(n=c.charCodeAt(2))||120===n)return NaN}else if(48===t){switch(c.charCodeAt(1)){case 66:case 98:r=2,i=49;break;case 79:case 111:r=8,i=55;break;default:return+c}for(a=(o=c.slice(2)).length,s=0;s<a;s++)if((u=o.charCodeAt(s))<48||u>i)return NaN;return parseInt(o,r)}return+c};if(o(m,!y(" 0o1")||!y("0b1")||y("+0x1"))){for(var x,C=function(e){var t=arguments.length<1?0:e,n=this;return n instanceof C&&(b?h((function(){_.valueOf.call(n)})):u(n)!=m)?c(new y(w(t)),n,C):w(t)},S=r?f(y):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger,fromString,range".split(","),k=0;S.length>k;k++)s(y,x=S[k])&&!s(C,x)&&v(C,x,p(y,x));C.prototype=_,_.constructor=C,a(i,m,C)}},9601:function(e,t,n){var r=n(2109),i=n(1574);r({target:"Object",stat:!0,forced:Object.assign!==i},{assign:i})},1539:function(e,t,n){var r=n(1694),i=n(1320),o=n(288);r||i(Object.prototype,"toString",o,{unsafe:!0})},2479:function(e,t,n){var r=n(2109),i=n(4699).values;r({target:"Object",stat:!0},{values:function(e){return i(e)}})},1058:function(e,t,n){var r=n(2109),i=n(3009);r({global:!0,forced:parseInt!=i},{parseInt:i})},7727:function(e,t,n){"use strict";var r=n(2109),i=n(1913),o=n(3366),a=n(7293),s=n(5005),u=n(6707),c=n(9478),l=n(1320);r({target:"Promise",proto:!0,real:!0,forced:!!o&&a((function(){o.prototype.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=u(this,s("Promise")),n="function"==typeof e;return this.then(n?function(n){return c(t,e()).then((function(){return n}))}:e,n?function(n){return c(t,e()).then((function(){throw n}))}:e)}}),i||"function"!=typeof o||o.prototype.finally||l(o.prototype,"finally",s("Promise").prototype.finally)},8674:function(e,t,n){"use strict";var r,i,o,a,s=n(2109),u=n(1913),c=n(7854),l=n(5005),h=n(3366),d=n(1320),f=n(2248),p=n(8003),v=n(6340),g=n(111),m=n(3099),y=n(5787),_=n(2788),b=n(408),w=n(7072),x=n(6707),C=n(261).set,S=n(5948),k=n(9478),T=n(842),E=n(8523),L=n(2534),P=n(9909),O=n(4705),R=n(5112),Z=n(5268),I=n(7392),A=R("species"),D="Promise",F=P.get,j=P.set,M=P.getterFor(D),N=h,U=c.TypeError,V=c.document,B=c.process,G=l("fetch"),H=E.f,z=H,W=!!(V&&V.createEvent&&c.dispatchEvent),q="function"==typeof PromiseRejectionEvent,J="unhandledrejection",$=O(D,(function(){if(_(N)===String(N)){if(66===I)return!0;if(!Z&&!q)return!0}if(u&&!N.prototype.finally)return!0;if(I>=51&&/native code/.test(N))return!1;var e=N.resolve(1),t=function(e){e((function(){}),(function(){}))};return(e.constructor={})[A]=t,!(e.then((function(){}))instanceof t)})),K=$||!w((function(e){N.all(e).catch((function(){}))})),X=function(e){var t;return!(!g(e)||"function"!=typeof(t=e.then))&&t},Y=function(e,t){if(!e.notified){e.notified=!0;var n=e.reactions;S((function(){for(var r=e.value,i=1==e.state,o=0;n.length>o;){var a,s,u,c=n[o++],l=i?c.ok:c.fail,h=c.resolve,d=c.reject,f=c.domain;try{l?(i||(2===e.rejection&&ne(e),e.rejection=1),!0===l?a=r:(f&&f.enter(),a=l(r),f&&(f.exit(),u=!0)),a===c.promise?d(U("Promise-chain cycle")):(s=X(a))?s.call(a,h,d):h(a)):d(r)}catch(e){f&&!u&&f.exit(),d(e)}}e.reactions=[],e.notified=!1,t&&!e.rejection&&ee(e)}))}},Q=function(e,t,n){var r,i;W?((r=V.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),c.dispatchEvent(r)):r={promise:t,reason:n},!q&&(i=c["on"+e])?i(r):e===J&&T("Unhandled promise rejection",n)},ee=function(e){C.call(c,(function(){var t,n=e.facade,r=e.value;if(te(e)&&(t=L((function(){Z?B.emit("unhandledRejection",r,n):Q(J,n,r)})),e.rejection=Z||te(e)?2:1,t.error))throw t.value}))},te=function(e){return 1!==e.rejection&&!e.parent},ne=function(e){C.call(c,(function(){var t=e.facade;Z?B.emit("rejectionHandled",t):Q("rejectionhandled",t,e.value)}))},re=function(e,t,n){return function(r){e(t,r,n)}},ie=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,Y(e,!0))},oe=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw U("Promise can't be resolved itself");var r=X(t);r?S((function(){var n={done:!1};try{r.call(t,re(oe,n,e),re(ie,n,e))}catch(t){ie(n,t,e)}})):(e.value=t,e.state=1,Y(e,!1))}catch(t){ie({done:!1},t,e)}}};$&&(N=function(e){y(this,N,D),m(e),r.call(this);var t=F(this);try{e(re(oe,t),re(ie,t))}catch(e){ie(t,e)}},(r=function(e){j(this,{type:D,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=f(N.prototype,{then:function(e,t){var n=M(this),r=H(x(this,N));return r.ok="function"!=typeof e||e,r.fail="function"==typeof t&&t,r.domain=Z?B.domain:void 0,n.parent=!0,n.reactions.push(r),0!=n.state&&Y(n,!1),r.promise},catch:function(e){return this.then(void 0,e)}}),i=function(){var e=new r,t=F(e);this.promise=e,this.resolve=re(oe,t),this.reject=re(ie,t)},E.f=H=function(e){return e===N||e===o?new i(e):z(e)},u||"function"!=typeof h||(a=h.prototype.then,d(h.prototype,"then",(function(e,t){var n=this;return new N((function(e,t){a.call(n,e,t)})).then(e,t)}),{unsafe:!0}),"function"==typeof G&&s({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return k(N,G.apply(c,arguments))}}))),s({global:!0,wrap:!0,forced:$},{Promise:N}),p(N,D,!1,!0),v(D),o=l(D),s({target:D,stat:!0,forced:$},{reject:function(e){var t=H(this);return t.reject.call(void 0,e),t.promise}}),s({target:D,stat:!0,forced:u||$},{resolve:function(e){return k(u&&this===o?N:this,e)}}),s({target:D,stat:!0,forced:K},{all:function(e){var t=this,n=H(t),r=n.resolve,i=n.reject,o=L((function(){var n=m(t.resolve),o=[],a=0,s=1;b(e,(function(e){var u=a++,c=!1;o.push(void 0),s++,n.call(t,e).then((function(e){c||(c=!0,o[u]=e,--s||r(o))}),i)})),--s||r(o)}));return o.error&&i(o.value),n.promise},race:function(e){var t=this,n=H(t),r=n.reject,i=L((function(){var i=m(t.resolve);b(e,(function(e){i.call(t,e).then(n.resolve,r)}))}));return i.error&&r(i.value),n.promise}})},4916:function(e,t,n){"use strict";var r=n(2109),i=n(2261);r({target:"RegExp",proto:!0,forced:/./.exec!==i},{exec:i})},9714:function(e,t,n){"use strict";var r=n(1320),i=n(9670),o=n(7293),a=n(7066),s="toString",u=RegExp.prototype,c=u[s],l=o((function(){return"/a/b"!=c.call({source:"a",flags:"b"})})),h=c.name!=s;(l||h)&&r(RegExp.prototype,s,(function(){var e=i(this),t=String(e.source),n=e.flags;return"/"+t+"/"+String(void 0===n&&e instanceof RegExp&&!("flags"in u)?a.call(e):n)}),{unsafe:!0})},7852:function(e,t,n){"use strict";var r,i=n(2109),o=n(1236).f,a=n(7466),s=n(3929),u=n(4488),c=n(4964),l=n(1913),h="".endsWith,d=Math.min,f=c("endsWith");i({target:"String",proto:!0,forced:!(!l&&!f&&(r=o(String.prototype,"endsWith"),r&&!r.writable)||f)},{endsWith:function(e){var t=String(u(this));s(e);var n=arguments.length>1?arguments[1]:void 0,r=a(t.length),i=void 0===n?r:d(a(n),r),o=String(e);return h?h.call(t,o,i):t.slice(i-o.length,i)===o}})},2023:function(e,t,n){"use strict";var r=n(2109),i=n(3929),o=n(4488);r({target:"String",proto:!0,forced:!n(4964)("includes")},{includes:function(e){return!!~String(o(this)).indexOf(i(e),arguments.length>1?arguments[1]:void 0)}})},8783:function(e,t,n){"use strict";var r=n(8710).charAt,i=n(9909),o=n(654),a="String Iterator",s=i.set,u=i.getterFor(a);o(String,"String",(function(e){s(this,{type:a,string:String(e),index:0})}),(function(){var e,t=u(this),n=t.string,i=t.index;return i>=n.length?{value:void 0,done:!0}:(e=r(n,i),t.index+=e.length,{value:e,done:!1})}))},4723:function(e,t,n){"use strict";var r=n(7007),i=n(9670),o=n(7466),a=n(4488),s=n(1530),u=n(7651);r("match",1,(function(e,t,n){return[function(t){var n=a(this),r=null==t?void 0:t[e];return void 0!==r?r.call(t,n):new RegExp(t)[e](String(n))},function(e){var r=n(t,e,this);if(r.done)return r.value;var a=i(e),c=String(this);if(!a.global)return u(a,c);var l=a.unicode;a.lastIndex=0;for(var h,d=[],f=0;null!==(h=u(a,c));){var p=String(h[0]);d[f]=p,""===p&&(a.lastIndex=s(c,o(a.lastIndex),l)),f++}return 0===f?null:d}]}))},3112:function(e,t,n){"use strict";var r=n(2109),i=n(6650).start;r({target:"String",proto:!0,forced:n(4986)},{padStart:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},2481:function(e,t,n){n(2109)({target:"String",proto:!0},{repeat:n(8415)})},5306:function(e,t,n){"use strict";var r=n(7007),i=n(9670),o=n(7908),a=n(7466),s=n(9958),u=n(4488),c=n(1530),l=n(7651),h=Math.max,d=Math.min,f=Math.floor,p=/\$([$&'`]|\d\d?|<[^>]*>)/g,v=/\$([$&'`]|\d\d?)/g;r("replace",2,(function(e,t,n,r){var g=r.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,m=r.REPLACE_KEEPS_$0,y=g?"$":"$0";return[function(n,r){var i=u(this),o=null==n?void 0:n[e];return void 0!==o?o.call(n,i,r):t.call(String(i),n,r)},function(e,r){if(!g&&m||"string"==typeof r&&-1===r.indexOf(y)){var o=n(t,e,this,r);if(o.done)return o.value}var u=i(e),f=String(this),p="function"==typeof r;p||(r=String(r));var v=u.global;if(v){var b=u.unicode;u.lastIndex=0}for(var w=[];;){var x=l(u,f);if(null===x)break;if(w.push(x),!v)break;""===String(x[0])&&(u.lastIndex=c(f,a(u.lastIndex),b))}for(var C,S="",k=0,T=0;T<w.length;T++){x=w[T];for(var E=String(x[0]),L=h(d(s(x.index),f.length),0),P=[],O=1;O<x.length;O++)P.push(void 0===(C=x[O])?C:String(C));var R=x.groups;if(p){var Z=[E].concat(P,L,f);void 0!==R&&Z.push(R);var I=String(r.apply(void 0,Z))}else I=_(E,f,L,P,R,r);L>=k&&(S+=f.slice(k,L)+I,k=L+E.length)}return S+f.slice(k)}];function _(e,n,r,i,a,s){var u=r+e.length,c=i.length,l=v;return void 0!==a&&(a=o(a),l=p),t.call(s,l,(function(t,o){var s;switch(o.charAt(0)){case"$":return"$";case"&":return e;case"`":return n.slice(0,r);case"'":return n.slice(u);case"<":s=a[o.slice(1,-1)];break;default:var l=+o;if(0===l)return t;if(l>c){var h=f(l/10);return 0===h?t:h<=c?void 0===i[h-1]?o.charAt(1):i[h-1]+o.charAt(1):t}s=i[l-1]}return void 0===s?"":s}))}}))},4765:function(e,t,n){"use strict";var r=n(7007),i=n(9670),o=n(4488),a=n(1150),s=n(7651);r("search",1,(function(e,t,n){return[function(t){var n=o(this),r=null==t?void 0:t[e];return void 0!==r?r.call(t,n):new RegExp(t)[e](String(n))},function(e){var r=n(t,e,this);if(r.done)return r.value;var o=i(e),u=String(this),c=o.lastIndex;a(c,0)||(o.lastIndex=0);var l=s(o,u);return a(o.lastIndex,c)||(o.lastIndex=c),null===l?-1:l.index}]}))},3123:function(e,t,n){"use strict";var r=n(7007),i=n(7850),o=n(9670),a=n(4488),s=n(6707),u=n(1530),c=n(7466),l=n(7651),h=n(2261),d=n(7293),f=[].push,p=Math.min,v=4294967295,g=!d((function(){return!RegExp(v,"y")}));r("split",2,(function(e,t,n){var r;return r="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,n){var r=String(a(this)),o=void 0===n?v:n>>>0;if(0===o)return[];if(void 0===e)return[r];if(!i(e))return t.call(r,e,o);for(var s,u,c,l=[],d=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),p=0,g=new RegExp(e.source,d+"g");(s=h.call(g,r))&&!((u=g.lastIndex)>p&&(l.push(r.slice(p,s.index)),s.length>1&&s.index<r.length&&f.apply(l,s.slice(1)),c=s[0].length,p=u,l.length>=o));)g.lastIndex===s.index&&g.lastIndex++;return p===r.length?!c&&g.test("")||l.push(""):l.push(r.slice(p)),l.length>o?l.slice(0,o):l}:"0".split(void 0,0).length?function(e,n){return void 0===e&&0===n?[]:t.call(this,e,n)}:t,[function(t,n){var i=a(this),o=null==t?void 0:t[e];return void 0!==o?o.call(t,i,n):r.call(String(i),t,n)},function(e,i){var a=n(r,e,this,i,r!==t);if(a.done)return a.value;var h=o(e),d=String(this),f=s(h,RegExp),m=h.unicode,y=(h.ignoreCase?"i":"")+(h.multiline?"m":"")+(h.unicode?"u":"")+(g?"y":"g"),_=new f(g?h:"^(?:"+h.source+")",y),b=void 0===i?v:i>>>0;if(0===b)return[];if(0===d.length)return null===l(_,d)?[d]:[];for(var w=0,x=0,C=[];x<d.length;){_.lastIndex=g?x:0;var S,k=l(_,g?d:d.slice(x));if(null===k||(S=p(c(_.lastIndex+(g?0:x)),d.length))===w)x=u(d,x,m);else{if(C.push(d.slice(w,x)),C.length===b)return C;for(var T=1;T<=k.length-1;T++)if(C.push(k[T]),C.length===b)return C;x=w=S}}return C.push(d.slice(w)),C}]}),!g)},6755:function(e,t,n){"use strict";var r,i=n(2109),o=n(1236).f,a=n(7466),s=n(3929),u=n(4488),c=n(4964),l=n(1913),h="".startsWith,d=Math.min,f=c("startsWith");i({target:"String",proto:!0,forced:!(!l&&!f&&(r=o(String.prototype,"startsWith"),r&&!r.writable)||f)},{startsWith:function(e){var t=String(u(this));s(e);var n=a(d(arguments.length>1?arguments[1]:void 0,t.length)),r=String(e);return h?h.call(t,r,n):t.slice(n,n+r.length)===r}})},1817:function(e,t,n){"use strict";var r=n(2109),i=n(9781),o=n(7854),a=n(6656),s=n(111),u=n(3070).f,c=n(9920),l=o.Symbol;if(i&&"function"==typeof l&&(!("description"in l.prototype)||void 0!==l().description)){var h={},d=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:String(arguments[0]),t=this instanceof d?new l(e):void 0===e?l():l(e);return""===e&&(h[t]=!0),t};c(d,l);var f=d.prototype=l.prototype;f.constructor=d;var p=f.toString,v="Symbol(test)"==String(l("test")),g=/^Symbol\((.*)\)[^)]+$/;u(f,"description",{configurable:!0,get:function(){var e=s(this)?this.valueOf():this,t=p.call(e);if(a(h,e))return"";var n=v?t.slice(7,-1):t.replace(g,"$1");return""===n?void 0:n}}),r({global:!0,forced:!0},{Symbol:d})}},2526:function(e,t,n){"use strict";var r=n(2109),i=n(7854),o=n(5005),a=n(1913),s=n(9781),u=n(133),c=n(3307),l=n(7293),h=n(6656),d=n(3157),f=n(111),p=n(9670),v=n(7908),g=n(5656),m=n(7593),y=n(9114),_=n(30),b=n(1956),w=n(8006),x=n(1156),C=n(5181),S=n(1236),k=n(3070),T=n(5296),E=n(8880),L=n(1320),P=n(2309),O=n(6200),R=n(3501),Z=n(9711),I=n(5112),A=n(6061),D=n(7235),F=n(8003),j=n(9909),M=n(2092).forEach,N=O("hidden"),U="Symbol",V="prototype",B=I("toPrimitive"),G=j.set,H=j.getterFor(U),z=Object[V],W=i.Symbol,q=o("JSON","stringify"),J=S.f,$=k.f,K=x.f,X=T.f,Y=P("symbols"),Q=P("op-symbols"),ee=P("string-to-symbol-registry"),te=P("symbol-to-string-registry"),ne=P("wks"),re=i.QObject,ie=!re||!re[V]||!re[V].findChild,oe=s&&l((function(){return 7!=_($({},"a",{get:function(){return $(this,"a",{value:7}).a}})).a}))?function(e,t,n){var r=J(z,t);r&&delete z[t],$(e,t,n),r&&e!==z&&$(z,t,r)}:$,ae=function(e,t){var n=Y[e]=_(W[V]);return G(n,{type:U,tag:e,description:t}),s||(n.description=t),n},se=c?function(e){return"symbol"==typeof e}:function(e){return Object(e)instanceof W},ue=function(e,t,n){e===z&&ue(Q,t,n),p(e);var r=m(t,!0);return p(n),h(Y,r)?(n.enumerable?(h(e,N)&&e[N][r]&&(e[N][r]=!1),n=_(n,{enumerable:y(0,!1)})):(h(e,N)||$(e,N,y(1,{})),e[N][r]=!0),oe(e,r,n)):$(e,r,n)},ce=function(e,t){p(e);var n=g(t),r=b(n).concat(fe(n));return M(r,(function(t){s&&!le.call(n,t)||ue(e,t,n[t])})),e},le=function(e){var t=m(e,!0),n=X.call(this,t);return!(this===z&&h(Y,t)&&!h(Q,t))&&(!(n||!h(this,t)||!h(Y,t)||h(this,N)&&this[N][t])||n)},he=function(e,t){var n=g(e),r=m(t,!0);if(n!==z||!h(Y,r)||h(Q,r)){var i=J(n,r);return!i||!h(Y,r)||h(n,N)&&n[N][r]||(i.enumerable=!0),i}},de=function(e){var t=K(g(e)),n=[];return M(t,(function(e){h(Y,e)||h(R,e)||n.push(e)})),n},fe=function(e){var t=e===z,n=K(t?Q:g(e)),r=[];return M(n,(function(e){!h(Y,e)||t&&!h(z,e)||r.push(Y[e])})),r};u||(W=function(){if(this instanceof W)throw TypeError("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?String(arguments[0]):void 0,t=Z(e),n=function(e){this===z&&n.call(Q,e),h(this,N)&&h(this[N],t)&&(this[N][t]=!1),oe(this,t,y(1,e))};return s&&ie&&oe(z,t,{configurable:!0,set:n}),ae(t,e)},L(W[V],"toString",(function(){return H(this).tag})),L(W,"withoutSetter",(function(e){return ae(Z(e),e)})),T.f=le,k.f=ue,S.f=he,w.f=x.f=de,C.f=fe,A.f=function(e){return ae(I(e),e)},s&&($(W[V],"description",{configurable:!0,get:function(){return H(this).description}}),a||L(z,"propertyIsEnumerable",le,{unsafe:!0}))),r({global:!0,wrap:!0,forced:!u,sham:!u},{Symbol:W}),M(b(ne),(function(e){D(e)})),r({target:U,stat:!0,forced:!u},{for:function(e){var t=String(e);if(h(ee,t))return ee[t];var n=W(t);return ee[t]=n,te[n]=t,n},keyFor:function(e){if(!se(e))throw TypeError(e+" is not a symbol");if(h(te,e))return te[e]},useSetter:function(){ie=!0},useSimple:function(){ie=!1}}),r({target:"Object",stat:!0,forced:!u,sham:!s},{create:function(e,t){return void 0===t?_(e):ce(_(e),t)},defineProperty:ue,defineProperties:ce,getOwnPropertyDescriptor:he}),r({target:"Object",stat:!0,forced:!u},{getOwnPropertyNames:de,getOwnPropertySymbols:fe}),r({target:"Object",stat:!0,forced:l((function(){C.f(1)}))},{getOwnPropertySymbols:function(e){return C.f(v(e))}}),q&&r({target:"JSON",stat:!0,forced:!u||l((function(){var e=W();return"[null]"!=q([e])||"{}"!=q({a:e})||"{}"!=q(Object(e))}))},{stringify:function(e,t,n){for(var r,i=[e],o=1;arguments.length>o;)i.push(arguments[o++]);if(r=t,(f(t)||void 0!==e)&&!se(e))return d(t)||(t=function(e,t){if("function"==typeof r&&(t=r.call(this,e,t)),!se(t))return t}),i[1]=t,q.apply(null,i)}}),W[V][B]||E(W[V],B,W[V].valueOf),F(W,U),R[N]=!0},4747:function(e,t,n){var r=n(7854),i=n(8324),o=n(8533),a=n(8880);for(var s in i){var u=r[s],c=u&&u.prototype;if(c&&c.forEach!==o)try{a(c,"forEach",o)}catch(e){c.forEach=o}}},3948:function(e,t,n){var r=n(7854),i=n(8324),o=n(6992),a=n(8880),s=n(5112),u=s("iterator"),c=s("toStringTag"),l=o.values;for(var h in i){var d=r[h],f=d&&d.prototype;if(f){if(f[u]!==l)try{a(f,u,l)}catch(e){f[u]=l}if(f[c]||a(f,c,h),i[h])for(var p in o)if(f[p]!==o[p])try{a(f,p,o[p])}catch(e){f[p]=o[p]}}}},2564:function(e,t,n){var r=n(2109),i=n(7854),o=n(8113),a=[].slice,s=function(e){return function(t,n){var r=arguments.length>2,i=r?a.call(arguments,2):void 0;return e(r?function(){("function"==typeof t?t:Function(t)).apply(this,i)}:t,n)}};r({global:!0,bind:!0,forced:/MSIE .\./.test(o)},{setTimeout:s(i.setTimeout),setInterval:s(i.setInterval)})},1637:function(e,t,n){"use strict";n(6992);var r=n(2109),i=n(5005),o=n(590),a=n(1320),s=n(2248),u=n(8003),c=n(4994),l=n(9909),h=n(5787),d=n(6656),f=n(9974),p=n(648),v=n(9670),g=n(111),m=n(30),y=n(9114),_=n(8554),b=n(1246),w=n(5112),x=i("fetch"),C=i("Headers"),S=w("iterator"),k="URLSearchParams",T=k+"Iterator",E=l.set,L=l.getterFor(k),P=l.getterFor(T),O=/\+/g,R=Array(4),Z=function(e){return R[e-1]||(R[e-1]=RegExp("((?:%[\\da-f]{2}){"+e+"})","gi"))},I=function(e){try{return decodeURIComponent(e)}catch(t){return e}},A=function(e){var t=e.replace(O," "),n=4;try{return decodeURIComponent(t)}catch(e){for(;n;)t=t.replace(Z(n--),I);return t}},D=/[!'()~]|%20/g,F={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},j=function(e){return F[e]},M=function(e){return encodeURIComponent(e).replace(D,j)},N=function(e,t){if(t)for(var n,r,i=t.split("&"),o=0;o<i.length;)(n=i[o++]).length&&(r=n.split("="),e.push({key:A(r.shift()),value:A(r.join("="))}))},U=function(e){this.entries.length=0,N(this.entries,e)},V=function(e,t){if(e<t)throw TypeError("Not enough arguments")},B=c((function(e,t){E(this,{type:T,iterator:_(L(e).entries),kind:t})}),"Iterator",(function(){var e=P(this),t=e.kind,n=e.iterator.next(),r=n.value;return n.done||(n.value="keys"===t?r.key:"values"===t?r.value:[r.key,r.value]),n})),G=function(){h(this,G,k);var e,t,n,r,i,o,a,s,u,c=arguments.length>0?arguments[0]:void 0,l=this,f=[];if(E(l,{type:k,entries:f,updateURL:function(){},updateSearchParams:U}),void 0!==c)if(g(c))if("function"==typeof(e=b(c)))for(n=(t=e.call(c)).next;!(r=n.call(t)).done;){if((a=(o=(i=_(v(r.value))).next).call(i)).done||(s=o.call(i)).done||!o.call(i).done)throw TypeError("Expected sequence with length 2");f.push({key:a.value+"",value:s.value+""})}else for(u in c)d(c,u)&&f.push({key:u,value:c[u]+""});else N(f,"string"==typeof c?"?"===c.charAt(0)?c.slice(1):c:c+"")},H=G.prototype;s(H,{append:function(e,t){V(arguments.length,2);var n=L(this);n.entries.push({key:e+"",value:t+""}),n.updateURL()},delete:function(e){V(arguments.length,1);for(var t=L(this),n=t.entries,r=e+"",i=0;i<n.length;)n[i].key===r?n.splice(i,1):i++;t.updateURL()},get:function(e){V(arguments.length,1);for(var t=L(this).entries,n=e+"",r=0;r<t.length;r++)if(t[r].key===n)return t[r].value;return null},getAll:function(e){V(arguments.length,1);for(var t=L(this).entries,n=e+"",r=[],i=0;i<t.length;i++)t[i].key===n&&r.push(t[i].value);return r},has:function(e){V(arguments.length,1);for(var t=L(this).entries,n=e+"",r=0;r<t.length;)if(t[r++].key===n)return!0;return!1},set:function(e,t){V(arguments.length,1);for(var n,r=L(this),i=r.entries,o=!1,a=e+"",s=t+"",u=0;u<i.length;u++)(n=i[u]).key===a&&(o?i.splice(u--,1):(o=!0,n.value=s));o||i.push({key:a,value:s}),r.updateURL()},sort:function(){var e,t,n,r=L(this),i=r.entries,o=i.slice();for(i.length=0,n=0;n<o.length;n++){for(e=o[n],t=0;t<n;t++)if(i[t].key>e.key){i.splice(t,0,e);break}t===n&&i.push(e)}r.updateURL()},forEach:function(e){for(var t,n=L(this).entries,r=f(e,arguments.length>1?arguments[1]:void 0,3),i=0;i<n.length;)r((t=n[i++]).value,t.key,this)},keys:function(){return new B(this,"keys")},values:function(){return new B(this,"values")},entries:function(){return new B(this,"entries")}},{enumerable:!0}),a(H,S,H.entries),a(H,"toString",(function(){for(var e,t=L(this).entries,n=[],r=0;r<t.length;)e=t[r++],n.push(M(e.key)+"="+M(e.value));return n.join("&")}),{enumerable:!0}),u(G,k),r({global:!0,forced:!o},{URLSearchParams:G}),o||"function"!=typeof x||"function"!=typeof C||r({global:!0,enumerable:!0,forced:!0},{fetch:function(e){var t,n,r,i=[e];return arguments.length>1&&(g(t=arguments[1])&&(n=t.body,p(n)===k&&((r=t.headers?new C(t.headers):new C).has("content-type")||r.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),t=m(t,{body:y(0,String(n)),headers:y(0,r)}))),i.push(t)),x.apply(this,i)}}),e.exports={URLSearchParams:G,getState:L}},285:function(e,t,n){"use strict";n(8783);var r,i=n(2109),o=n(9781),a=n(590),s=n(7854),u=n(6048),c=n(1320),l=n(5787),h=n(6656),d=n(1574),f=n(8457),p=n(8710).codeAt,v=n(3197),g=n(8003),m=n(1637),y=n(9909),_=s.URL,b=m.URLSearchParams,w=m.getState,x=y.set,C=y.getterFor("URL"),S=Math.floor,k=Math.pow,T="Invalid scheme",E="Invalid host",L="Invalid port",P=/[A-Za-z]/,O=/[\d+-.A-Za-z]/,R=/\d/,Z=/^(0x|0X)/,I=/^[0-7]+$/,A=/^\d+$/,D=/^[\dA-Fa-f]+$/,F=/[\u0000\u0009\u000A\u000D #%/:?@[\\]]/,j=/[\u0000\u0009\u000A\u000D #/:?@[\\]]/,M=/^[\u0000-\u001F ]+|[\u0000-\u001F ]+$/g,N=/[\u0009\u000A\u000D]/g,U=function(e,t){var n,r,i;if("["==t.charAt(0)){if("]"!=t.charAt(t.length-1))return E;if(!(n=B(t.slice(1,-1))))return E;e.host=n}else if(K(e)){if(t=v(t),F.test(t))return E;if(null===(n=V(t)))return E;e.host=n}else{if(j.test(t))return E;for(n="",r=f(t),i=0;i<r.length;i++)n+=J(r[i],H);e.host=n}},V=function(e){var t,n,r,i,o,a,s,u=e.split(".");if(u.length&&""==u[u.length-1]&&u.pop(),(t=u.length)>4)return e;for(n=[],r=0;r<t;r++){if(""==(i=u[r]))return e;if(o=10,i.length>1&&"0"==i.charAt(0)&&(o=Z.test(i)?16:8,i=i.slice(8==o?1:2)),""===i)a=0;else{if(!(10==o?A:8==o?I:D).test(i))return e;a=parseInt(i,o)}n.push(a)}for(r=0;r<t;r++)if(a=n[r],r==t-1){if(a>=k(256,5-t))return null}else if(a>255)return null;for(s=n.pop(),r=0;r<n.length;r++)s+=n[r]*k(256,3-r);return s},B=function(e){var t,n,r,i,o,a,s,u=[0,0,0,0,0,0,0,0],c=0,l=null,h=0,d=function(){return e.charAt(h)};if(":"==d()){if(":"!=e.charAt(1))return;h+=2,l=++c}for(;d();){if(8==c)return;if(":"!=d()){for(t=n=0;n<4&&D.test(d());)t=16*t+parseInt(d(),16),h++,n++;if("."==d()){if(0==n)return;if(h-=n,c>6)return;for(r=0;d();){if(i=null,r>0){if(!("."==d()&&r<4))return;h++}if(!R.test(d()))return;for(;R.test(d());){if(o=parseInt(d(),10),null===i)i=o;else{if(0==i)return;i=10*i+o}if(i>255)return;h++}u[c]=256*u[c]+i,2!=++r&&4!=r||c++}if(4!=r)return;break}if(":"==d()){if(h++,!d())return}else if(d())return;u[c++]=t}else{if(null!==l)return;h++,l=++c}}if(null!==l)for(a=c-l,c=7;0!=c&&a>0;)s=u[c],u[c--]=u[l+a-1],u[l+--a]=s;else if(8!=c)return;return u},G=function(e){var t,n,r,i;if("number"==typeof e){for(t=[],n=0;n<4;n++)t.unshift(e%256),e=S(e/256);return t.join(".")}if("object"==typeof e){for(t="",r=function(e){for(var t=null,n=1,r=null,i=0,o=0;o<8;o++)0!==e[o]?(i>n&&(t=r,n=i),r=null,i=0):(null===r&&(r=o),++i);return i>n&&(t=r,n=i),t}(e),n=0;n<8;n++)i&&0===e[n]||(i&&(i=!1),r===n?(t+=n?":":"::",i=!0):(t+=e[n].toString(16),n<7&&(t+=":")));return"["+t+"]"}return e},H={},z=d({},H,{" ":1,'"':1,"<":1,">":1,"`":1}),W=d({},z,{"#":1,"?":1,"{":1,"}":1}),q=d({},W,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),J=function(e,t){var n=p(e,0);return n>32&&n<127&&!h(t,e)?e:encodeURIComponent(e)},$={ftp:21,file:null,http:80,https:443,ws:80,wss:443},K=function(e){return h($,e.scheme)},X=function(e){return""!=e.username||""!=e.password},Y=function(e){return!e.host||e.cannotBeABaseURL||"file"==e.scheme},Q=function(e,t){var n;return 2==e.length&&P.test(e.charAt(0))&&(":"==(n=e.charAt(1))||!t&&"|"==n)},ee=function(e){var t;return e.length>1&&Q(e.slice(0,2))&&(2==e.length||"/"===(t=e.charAt(2))||"\\"===t||"?"===t||"#"===t)},te=function(e){var t=e.path,n=t.length;!n||"file"==e.scheme&&1==n&&Q(t[0],!0)||t.pop()},ne=function(e){return"."===e||"%2e"===e.toLowerCase()},re={},ie={},oe={},ae={},se={},ue={},ce={},le={},he={},de={},fe={},pe={},ve={},ge={},me={},ye={},_e={},be={},we={},xe={},Ce={},Se=function(e,t,n,i){var o,a,s,u,c,l=n||re,d=0,p="",v=!1,g=!1,m=!1;for(n||(e.scheme="",e.username="",e.password="",e.host=null,e.port=null,e.path=[],e.query=null,e.fragment=null,e.cannotBeABaseURL=!1,t=t.replace(M,"")),t=t.replace(N,""),o=f(t);d<=o.length;){switch(a=o[d],l){case re:if(!a||!P.test(a)){if(n)return T;l=oe;continue}p+=a.toLowerCase(),l=ie;break;case ie:if(a&&(O.test(a)||"+"==a||"-"==a||"."==a))p+=a.toLowerCase();else{if(":"!=a){if(n)return T;p="",l=oe,d=0;continue}if(n&&(K(e)!=h($,p)||"file"==p&&(X(e)||null!==e.port)||"file"==e.scheme&&!e.host))return;if(e.scheme=p,n)return void(K(e)&&$[e.scheme]==e.port&&(e.port=null));p="","file"==e.scheme?l=ge:K(e)&&i&&i.scheme==e.scheme?l=ae:K(e)?l=le:"/"==o[d+1]?(l=se,d++):(e.cannotBeABaseURL=!0,e.path.push(""),l=we)}break;case oe:if(!i||i.cannotBeABaseURL&&"#"!=a)return T;if(i.cannotBeABaseURL&&"#"==a){e.scheme=i.scheme,e.path=i.path.slice(),e.query=i.query,e.fragment="",e.cannotBeABaseURL=!0,l=Ce;break}l="file"==i.scheme?ge:ue;continue;case ae:if("/"!=a||"/"!=o[d+1]){l=ue;continue}l=he,d++;break;case se:if("/"==a){l=de;break}l=be;continue;case ue:if(e.scheme=i.scheme,a==r)e.username=i.username,e.password=i.password,e.host=i.host,e.port=i.port,e.path=i.path.slice(),e.query=i.query;else if("/"==a||"\\"==a&&K(e))l=ce;else if("?"==a)e.username=i.username,e.password=i.password,e.host=i.host,e.port=i.port,e.path=i.path.slice(),e.query="",l=xe;else{if("#"!=a){e.username=i.username,e.password=i.password,e.host=i.host,e.port=i.port,e.path=i.path.slice(),e.path.pop(),l=be;continue}e.username=i.username,e.password=i.password,e.host=i.host,e.port=i.port,e.path=i.path.slice(),e.query=i.query,e.fragment="",l=Ce}break;case ce:if(!K(e)||"/"!=a&&"\\"!=a){if("/"!=a){e.username=i.username,e.password=i.password,e.host=i.host,e.port=i.port,l=be;continue}l=de}else l=he;break;case le:if(l=he,"/"!=a||"/"!=p.charAt(d+1))continue;d++;break;case he:if("/"!=a&&"\\"!=a){l=de;continue}break;case de:if("@"==a){v&&(p="%40"+p),v=!0,s=f(p);for(var y=0;y<s.length;y++){var _=s[y];if(":"!=_||m){var b=J(_,q);m?e.password+=b:e.username+=b}else m=!0}p=""}else if(a==r||"/"==a||"?"==a||"#"==a||"\\"==a&&K(e)){if(v&&""==p)return"Invalid authority";d-=f(p).length+1,p="",l=fe}else p+=a;break;case fe:case pe:if(n&&"file"==e.scheme){l=ye;continue}if(":"!=a||g){if(a==r||"/"==a||"?"==a||"#"==a||"\\"==a&&K(e)){if(K(e)&&""==p)return E;if(n&&""==p&&(X(e)||null!==e.port))return;if(u=U(e,p))return u;if(p="",l=_e,n)return;continue}"["==a?g=!0:"]"==a&&(g=!1),p+=a}else{if(""==p)return E;if(u=U(e,p))return u;if(p="",l=ve,n==pe)return}break;case ve:if(!R.test(a)){if(a==r||"/"==a||"?"==a||"#"==a||"\\"==a&&K(e)||n){if(""!=p){var w=parseInt(p,10);if(w>65535)return L;e.port=K(e)&&w===$[e.scheme]?null:w,p=""}if(n)return;l=_e;continue}return L}p+=a;break;case ge:if(e.scheme="file","/"==a||"\\"==a)l=me;else{if(!i||"file"!=i.scheme){l=be;continue}if(a==r)e.host=i.host,e.path=i.path.slice(),e.query=i.query;else if("?"==a)e.host=i.host,e.path=i.path.slice(),e.query="",l=xe;else{if("#"!=a){ee(o.slice(d).join(""))||(e.host=i.host,e.path=i.path.slice(),te(e)),l=be;continue}e.host=i.host,e.path=i.path.slice(),e.query=i.query,e.fragment="",l=Ce}}break;case me:if("/"==a||"\\"==a){l=ye;break}i&&"file"==i.scheme&&!ee(o.slice(d).join(""))&&(Q(i.path[0],!0)?e.path.push(i.path[0]):e.host=i.host),l=be;continue;case ye:if(a==r||"/"==a||"\\"==a||"?"==a||"#"==a){if(!n&&Q(p))l=be;else if(""==p){if(e.host="",n)return;l=_e}else{if(u=U(e,p))return u;if("localhost"==e.host&&(e.host=""),n)return;p="",l=_e}continue}p+=a;break;case _e:if(K(e)){if(l=be,"/"!=a&&"\\"!=a)continue}else if(n||"?"!=a)if(n||"#"!=a){if(a!=r&&(l=be,"/"!=a))continue}else e.fragment="",l=Ce;else e.query="",l=xe;break;case be:if(a==r||"/"==a||"\\"==a&&K(e)||!n&&("?"==a||"#"==a)){if(".."===(c=(c=p).toLowerCase())||"%2e."===c||".%2e"===c||"%2e%2e"===c?(te(e),"/"==a||"\\"==a&&K(e)||e.path.push("")):ne(p)?"/"==a||"\\"==a&&K(e)||e.path.push(""):("file"==e.scheme&&!e.path.length&&Q(p)&&(e.host&&(e.host=""),p=p.charAt(0)+":"),e.path.push(p)),p="","file"==e.scheme&&(a==r||"?"==a||"#"==a))for(;e.path.length>1&&""===e.path[0];)e.path.shift();"?"==a?(e.query="",l=xe):"#"==a&&(e.fragment="",l=Ce)}else p+=J(a,W);break;case we:"?"==a?(e.query="",l=xe):"#"==a?(e.fragment="",l=Ce):a!=r&&(e.path[0]+=J(a,H));break;case xe:n||"#"!=a?a!=r&&("'"==a&&K(e)?e.query+="%27":e.query+="#"==a?"%23":J(a,H)):(e.fragment="",l=Ce);break;case Ce:a!=r&&(e.fragment+=J(a,z))}d++}},ke=function(e){var t,n,r=l(this,ke,"URL"),i=arguments.length>1?arguments[1]:void 0,a=String(e),s=x(r,{type:"URL"});if(void 0!==i)if(i instanceof ke)t=C(i);else if(n=Se(t={},String(i)))throw TypeError(n);if(n=Se(s,a,null,t))throw TypeError(n);var u=s.searchParams=new b,c=w(u);c.updateSearchParams(s.query),c.updateURL=function(){s.query=String(u)||null},o||(r.href=Ee.call(r),r.origin=Le.call(r),r.protocol=Pe.call(r),r.username=Oe.call(r),r.password=Re.call(r),r.host=Ze.call(r),r.hostname=Ie.call(r),r.port=Ae.call(r),r.pathname=De.call(r),r.search=Fe.call(r),r.searchParams=je.call(r),r.hash=Me.call(r))},Te=ke.prototype,Ee=function(){var e=C(this),t=e.scheme,n=e.username,r=e.password,i=e.host,o=e.port,a=e.path,s=e.query,u=e.fragment,c=t+":";return null!==i?(c+="//",X(e)&&(c+=n+(r?":"+r:"")+"@"),c+=G(i),null!==o&&(c+=":"+o)):"file"==t&&(c+="//"),c+=e.cannotBeABaseURL?a[0]:a.length?"/"+a.join("/"):"",null!==s&&(c+="?"+s),null!==u&&(c+="#"+u),c},Le=function(){var e=C(this),t=e.scheme,n=e.port;if("blob"==t)try{return new URL(t.path[0]).origin}catch(e){return"null"}return"file"!=t&&K(e)?t+"://"+G(e.host)+(null!==n?":"+n:""):"null"},Pe=function(){return C(this).scheme+":"},Oe=function(){return C(this).username},Re=function(){return C(this).password},Ze=function(){var e=C(this),t=e.host,n=e.port;return null===t?"":null===n?G(t):G(t)+":"+n},Ie=function(){var e=C(this).host;return null===e?"":G(e)},Ae=function(){var e=C(this).port;return null===e?"":String(e)},De=function(){var e=C(this),t=e.path;return e.cannotBeABaseURL?t[0]:t.length?"/"+t.join("/"):""},Fe=function(){var e=C(this).query;return e?"?"+e:""},je=function(){return C(this).searchParams},Me=function(){var e=C(this).fragment;return e?"#"+e:""},Ne=function(e,t){return{get:e,set:t,configurable:!0,enumerable:!0}};if(o&&u(Te,{href:Ne(Ee,(function(e){var t=C(this),n=String(e),r=Se(t,n);if(r)throw TypeError(r);w(t.searchParams).updateSearchParams(t.query)})),origin:Ne(Le),protocol:Ne(Pe,(function(e){var t=C(this);Se(t,String(e)+":",re)})),username:Ne(Oe,(function(e){var t=C(this),n=f(String(e));if(!Y(t)){t.username="";for(var r=0;r<n.length;r++)t.username+=J(n[r],q)}})),password:Ne(Re,(function(e){var t=C(this),n=f(String(e));if(!Y(t)){t.password="";for(var r=0;r<n.length;r++)t.password+=J(n[r],q)}})),host:Ne(Ze,(function(e){var t=C(this);t.cannotBeABaseURL||Se(t,String(e),fe)})),hostname:Ne(Ie,(function(e){var t=C(this);t.cannotBeABaseURL||Se(t,String(e),pe)})),port:Ne(Ae,(function(e){var t=C(this);Y(t)||(""==(e=String(e))?t.port=null:Se(t,e,ve))})),pathname:Ne(De,(function(e){var t=C(this);t.cannotBeABaseURL||(t.path=[],Se(t,e+"",_e))})),search:Ne(Fe,(function(e){var t=C(this);""==(e=String(e))?t.query=null:("?"==e.charAt(0)&&(e=e.slice(1)),t.query="",Se(t,e,xe)),w(t.searchParams).updateSearchParams(t.query)})),searchParams:Ne(je),hash:Ne(Me,(function(e){var t=C(this);""!=(e=String(e))?("#"==e.charAt(0)&&(e=e.slice(1)),t.fragment="",Se(t,e,Ce)):t.fragment=null}))}),c(Te,"toJSON",(function(){return Ee.call(this)}),{enumerable:!0}),c(Te,"toString",(function(){return Ee.call(this)}),{enumerable:!0}),_){var Ue=_.createObjectURL,Ve=_.revokeObjectURL;Ue&&c(ke,"createObjectURL",(function(e){return Ue.apply(_,arguments)})),Ve&&c(ke,"revokeObjectURL",(function(e){return Ve.apply(_,arguments)}))}g(ke,"URL"),i({global:!0,forced:!a,sham:!o},{URL:ke})},5666:function(e,t,n){var r=n(202).default,i=function(e){"use strict";var t,n=Object.prototype,i=n.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(e,t,n,r){var i=t&&t.prototype instanceof g?t:g,o=Object.create(i.prototype),a=new L(r||[]);return o._invoke=function(e,t,n){var r=h;return function(i,o){if(r===f)throw new Error("Generator is already running");if(r===p){if("throw"===i)throw o;return O()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=k(a,n);if(s){if(s===v)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===h)throw r=p,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=f;var u=l(e,t,n);if("normal"===u.type){if(r=n.done?p:d,u.arg===v)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=p,n.method="throw",n.arg=u.arg)}}}(e,n,a),o}function l(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var h="suspendedStart",d="suspendedYield",f="executing",p="completed",v={};function g(){}function m(){}function y(){}var _={};_[a]=function(){return this};var b=Object.getPrototypeOf,w=b&&b(b(P([])));w&&w!==n&&i.call(w,a)&&(_=w);var x=y.prototype=g.prototype=Object.create(_);function C(e){["next","throw","return"].forEach((function(t){e[t]=function(e){return this._invoke(t,e)}}))}function S(e,t){function n(r,o,a,s){var u=l(e[r],e,o);if("throw"!==u.type){var c=u.arg,h=c.value;return h&&"object"==typeof h&&i.call(h,"__await")?t.resolve(h.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(h).then((function(e){c.value=e,a(c)}),(function(e){return n("throw",e,a,s)}))}s(u.arg)}var r;this._invoke=function(e,i){function o(){return new t((function(t,r){n(e,i,t,r)}))}return r=r?r.then(o,o):o()}}function k(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,k(e,n),"throw"===n.method))return v;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var i=l(r,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var o=i.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function P(e){if(e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,o=function n(){for(;++r<e.length;)if(i.call(e,r))return n.value=e[r],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}return{next:O}}function O(){return{value:t,done:!0}}return m.prototype=x.constructor=y,y.constructor=m,y[u]=m.displayName="GeneratorFunction",e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,u in e||(e[u]="GeneratorFunction")),e.prototype=Object.create(x),e},e.awrap=function(e){return{__await:e}},C(S.prototype),S.prototype[s]=function(){return this},e.AsyncIterator=S,e.async=function(t,n,i,o,a){void 0===a&&(a=r);var s=new S(c(t,n,i,o),a);return e.isGeneratorFunction(n)?s:s.next().then((function(e){return e.done?e.value:s.next()}))},C(x),x[u]="Generator",x[a]=function(){return this},x.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=P,L.prototype={constructor:L,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(E),!e)for(var n in this)"t"===n.charAt(0)&&i.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function r(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),c=i.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,v):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),E(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;E(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:P(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}(e.exports);try{regeneratorRuntime=i}catch(e){Function("r","regeneratorRuntime = r")(i)}},7147:function(e,t,n){"use strict";var r=n(202).default,i="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==i&&i,o="URLSearchParams"in i,a="Symbol"in i&&"iterator"in Symbol,s="FileReader"in i&&"Blob"in i&&function(){try{return new Blob,!0}catch(e){return!1}}(),u="FormData"in i,c="ArrayBuffer"in i;if(c)var l=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],h=ArrayBuffer.isView||function(e){return e&&l.indexOf(Object.prototype.toString.call(e))>-1};function d(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function f(e){return"string"!=typeof e&&(e=String(e)),e}function p(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return a&&(t[Symbol.iterator]=function(){return t}),t}function v(e){this.map={},e instanceof v?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function g(e){if(e.bodyUsed)return r.reject(new TypeError("Already read"));e.bodyUsed=!0}function m(e){return new r((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function y(e){var t=new FileReader,n=m(t);return t.readAsArrayBuffer(e),n}function _(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function b(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:s&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:u&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:o&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():c&&s&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=_(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):c&&(ArrayBuffer.prototype.isPrototypeOf(e)||h(e))?this._bodyArrayBuffer=_(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):o&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},s&&(this.blob=function(){var e=g(this);if(e)return e;if(this._bodyBlob)return r.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return r.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return r.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?g(this)||(ArrayBuffer.isView(this._bodyArrayBuffer)?r.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):r.resolve(this._bodyArrayBuffer)):this.blob().then(y)}),this.text=function(){var e,t,n,i=g(this);if(i)return i;if(this._bodyBlob)return e=this._bodyBlob,n=m(t=new FileReader),t.readAsText(e),n;if(this._bodyArrayBuffer)return r.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return r.resolve(this._bodyText)},u&&(this.formData=function(){return this.text().then(C)}),this.json=function(){return this.text().then(JSON.parse)},this}v.prototype.append=function(e,t){e=d(e),t=f(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},v.prototype.delete=function(e){delete this.map[d(e)]},v.prototype.get=function(e){return e=d(e),this.has(e)?this.map[e]:null},v.prototype.has=function(e){return this.map.hasOwnProperty(d(e))},v.prototype.set=function(e,t){this.map[d(e)]=f(t)},v.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},v.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),p(e)},v.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),p(e)},v.prototype.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),p(e)},a&&(v.prototype[Symbol.iterator]=v.prototype.entries);var w=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function x(e,t){if(!(this instanceof x))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var n,r,i=(t=t||{}).body;if(e instanceof x){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new v(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,i||null==e._bodyInit||(i=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new v(t.headers)),this.method=(r=(n=t.method||this.method||"GET").toUpperCase(),w.indexOf(r)>-1?r:n),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(i),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache)){var o=/([?&])_=[^&]*/;o.test(this.url)?this.url=this.url.replace(o,"$1_="+(new Date).getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}function C(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(i))}})),t}function S(e,t){if(!(this instanceof S))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText=void 0===t.statusText?"":""+t.statusText,this.headers=new v(t.headers),this.url=t.url||"",this._initBody(e)}x.prototype.clone=function(){return new x(this,{body:this._bodyInit})},b.call(x.prototype),b.call(S.prototype),S.prototype.clone=function(){return new S(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new v(this.headers),url:this.url})},S.error=function(){var e=new S(null,{status:0,statusText:""});return e.type="error",e};var k=[301,302,303,307,308];S.redirect=function(e,t){if(-1===k.indexOf(t))throw new RangeError("Invalid status code");return new S(null,{status:t,headers:{location:e}})};var T=i.DOMException;try{new T}catch(e){(T=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack}).prototype=Object.create(Error.prototype),T.prototype.constructor=T}function E(e,t){return new r((function(n,r){var o=new x(e,t);if(o.signal&&o.signal.aborted)return r(new T("Aborted","AbortError"));var a=new XMLHttpRequest;function u(){a.abort()}a.onload=function(){var e,t,r={status:a.status,statusText:a.statusText,headers:(e=a.getAllResponseHeaders()||"",t=new v,e.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e})).forEach((function(e){var n=e.split(":"),r=n.shift().trim();if(r){var i=n.join(":").trim();t.append(r,i)}})),t)};r.url="responseURL"in a?a.responseURL:r.headers.get("X-Request-URL");var i="response"in a?a.response:a.responseText;setTimeout((function(){n(new S(i,r))}),0)},a.onerror=function(){setTimeout((function(){r(new TypeError("Network request failed"))}),0)},a.ontimeout=function(){setTimeout((function(){r(new TypeError("Network request failed"))}),0)},a.onabort=function(){setTimeout((function(){r(new T("Aborted","AbortError"))}),0)},a.open(o.method,function(e){try{return""===e&&i.location.href?i.location.href:e}catch(t){return e}}(o.url),!0),"include"===o.credentials?a.withCredentials=!0:"omit"===o.credentials&&(a.withCredentials=!1),"responseType"in a&&(s?a.responseType="blob":c&&o.headers.get("Content-Type")&&-1!==o.headers.get("Content-Type").indexOf("application/octet-stream")&&(a.responseType="arraybuffer")),!t||"object"!=typeof t.headers||t.headers instanceof v?o.headers.forEach((function(e,t){a.setRequestHeader(t,e)})):Object.getOwnPropertyNames(t.headers).forEach((function(e){a.setRequestHeader(e,f(t.headers[e]))})),o.signal&&(o.signal.addEventListener("abort",u),a.onreadystatechange=function(){4===a.readyState&&o.signal.removeEventListener("abort",u)}),a.send(void 0===o._bodyInit?null:o._bodyInit)}))}E.polyfill=!0,i.fetch||(i.fetch=E,i.Headers=v,i.Request=x,i.Response=S)}},t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}return n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(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.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n(7147),n(4146)}()}));
2
+ !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,(function(){return function(){var e={7228:function(e){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},e.exports.__esModule=!0,e.exports.default=e.exports},2858:function(e){e.exports=function(e){if(Array.isArray(e))return e},e.exports.__esModule=!0,e.exports.default=e.exports},3646:function(e,t,n){var r=n(7228);e.exports=function(e){if(Array.isArray(e))return r(e)},e.exports.__esModule=!0,e.exports.default=e.exports},1506:function(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},8926:function(e,t,n){var r=n(202).default;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},4575:function(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},3913:function(e,t,n){var r=n(3696);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},9713:function(e,t,n){var r=n(3696);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},9754:function(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},2205:function(e,t,n){var r=n(9489);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},6860:function(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},3884:function(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},521:function(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},8206:function(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},8585:function(e,t,n){var r=n(8).default,i=n(1506);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},9591:function(e,t,n){var r=n(202).default,i=n(8).default;function o(){"use strict";e.exports=o=function(){return t},e.exports.__esModule=!0,e.exports.default=e.exports;var t={},n=Object.prototype,a=n.hasOwnProperty,s=Object.defineProperty||function(e,t,n){e[t]=n.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",l=u.asyncIterator||"@@asyncIterator",h=u.toStringTag||"@@toStringTag";function d(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{d({},"")}catch(e){d=function(e,t,n){return e[t]=n}}function f(e,t,n,r){var i=t&&t.prototype instanceof g?t:g,o=Object.create(i.prototype),a=new P(r||[]);return s(o,"_invoke",{value:k(e,n,a)}),o}function p(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=f;var v={};function g(){}function m(){}function y(){}var _={};d(_,c,(function(){return this}));var b=Object.getPrototypeOf,w=b&&b(b(O([])));w&&w!==n&&a.call(w,c)&&(_=w);var x=y.prototype=g.prototype=Object.create(_);function C(e){["next","throw","return"].forEach((function(t){d(e,t,(function(e){return this._invoke(t,e)}))}))}function S(e,t){function n(r,o,s,u){var c=p(e[r],e,o);if("throw"!==c.type){var l=c.arg,h=l.value;return h&&"object"==i(h)&&a.call(h,"__await")?t.resolve(h.__await).then((function(e){n("next",e,s,u)}),(function(e){n("throw",e,s,u)})):t.resolve(h).then((function(e){l.value=e,s(l)}),(function(e){return n("throw",e,s,u)}))}u(c.arg)}var r;s(this,"_invoke",{value:function(e,i){function o(){return new t((function(t,r){n(e,i,t,r)}))}return r=r?r.then(o,o):o()}})}function k(e,t,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return{value:void 0,done:!0}}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=T(a,n);if(s){if(s===v)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=p(e,t,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===v)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}function T(e,t){var n=t.method,r=e.iterator[n];if(void 0===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,T(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=p(r,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,v;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,v):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,v)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function L(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function O(e){if(e){var t=e[c];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,r=function t(){for(;++n<e.length;)if(a.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return r.next=r}}return{next:R}}function R(){return{value:void 0,done:!0}}return m.prototype=y,s(x,"constructor",{value:y,configurable:!0}),s(y,"constructor",{value:m,configurable:!0}),m.displayName=d(y,h,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,d(e,h,"GeneratorFunction")),e.prototype=Object.create(x),e},t.awrap=function(e){return{__await:e}},C(S.prototype),d(S.prototype,l,(function(){return this})),t.AsyncIterator=S,t.async=function(e,n,i,o,a){void 0===a&&(a=r);var s=new S(f(e,n,i,o),a);return t.isGeneratorFunction(n)?s:s.next().then((function(e){return e.done?e.value:s.next()}))},C(x),d(x,h,"Generator"),d(x,c,(function(){return this})),d(x,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=O,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(L),!e)for(var t in this)"t"===t.charAt(0)&&a.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(n,r){return o.type="throw",o.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r],o=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&a.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),L(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;L(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:O(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),v}},t}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},9489:function(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},3038:function(e,t,n){var r=n(2858),i=n(3884),o=n(379),a=n(521);e.exports=function(e,t){return r(e)||i(e,t)||o(e,t)||a()},e.exports.__esModule=!0,e.exports.default=e.exports},319:function(e,t,n){var r=n(3646),i=n(6860),o=n(379),a=n(8206);e.exports=function(e){return r(e)||i(e)||o(e)||a()},e.exports.__esModule=!0,e.exports.default=e.exports},8868:function(e,t,n){var r=n(8).default;e.exports=function(e,t){if("object"!==r(e)||null===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},3696:function(e,t,n){var r=n(8).default,i=n(8868);e.exports=function(e){var t=i(e,"string");return"symbol"===r(t)?t:String(t)},e.exports.__esModule=!0,e.exports.default=e.exports},8:function(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},379:function(e,t,n){var r=n(7228);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.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},7757:function(e,t,n){var r=n(9591)();e.exports=r;try{regeneratorRuntime=r}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}},6406:function(e,t,n){"use strict";n.d(t,{Z:function(){return v}}),n(3843),n(3710),n(2564);var r=n(8),i=n.n(r),o=n(4575),a=n.n(o),s=n(3913),u=n.n(s),c=n(9713),l=n.n(c),h=n(6330),d=n(7426),f=n(841),p=n(2493),v=function(){function e(){a()(this,e),l()(this,"_disposables",new p.Z),l()(this,"_readOnlyIsForeground",void 0),l()(this,"_isForeground",void 0),l()(this,"_timeOfLastTabFocusChange",Date.now()),l()(this,"_documentFocusInterval",void 0),this._isForeground=new d.Z(!0),this._readOnlyIsForeground=new f.Z(this._isForeground),this.detectTabFocusChange()}return u()(e,[{key:"isForeground",get:function(){return this._readOnlyIsForeground}},{key:"getTimeSinceLastChange",value:function(){return Date.now()-this._timeOfLastTabFocusChange}},{key:"dispose",value:function(){this._disposables.dispose()}},{key:"detectTabFocusChange",value:function(){var e,t,n=this;if("object"===("undefined"==typeof document?"undefined":i()(document))){void 0!==document.msHidden?(e="msHidden",t="msvisibilitychange"):void 0!==document.webkitHidden?(e="webkitHidden",t="webkitvisibilitychange"):void 0!==document.hidden&&(e="hidden",t="visibilitychange");var r=function(){var t=!document[e];n.setFocusState(t)};void 0!==document.addEventListener&&void 0!==document[e]?(document.addEventListener(t,r,!1),this._disposables.add(new h.Z((function(){document.removeEventListener(t,r,!1)})))):this.listenForDocumentFocus.call(this)}}},{key:"listenForDocumentFocus",value:function(){var e=this;this._documentFocusInterval=window.setInterval((function(){var t=document.hasFocus();e.setFocusState(t)}),3e3),this._disposables.add(new h.Z((function(){e._documentFocusInterval&&clearInterval(e._documentFocusInterval),e._documentFocusInterval=null})))}},{key:"setFocusState",value:function(e){this._isForeground!==e&&(this._isForeground.value=e)}}]),e}()},9845:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}}),n(6699),n(2772),n(9653),n(1058),n(4916),n(2023),n(4723),n(3123);var r=n(4575),i=n.n(r),o=n(3913),a=n.n(o),s=n(9713),u=n.n(s),c=function(){function e(){i()(this,e)}return a()(e,null,[{key:"browserNameAndVersion",get:function(){return e._browserNameAndVersion}},{key:"browserName",get:function(){return this._browserName}},{key:"browserMajorVersion",get:function(){return this._browserMajorVersion}},{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:"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""}}]),e}();u()(c,"_browserNameAndVersionRegex",/(MSIE|(?!Gecko.+)Firefox|(?!AppleWebKit.+Chrome.+)Safari|(?!AppleWebKit.+)Chrome|AppleWebKit(?!.+Chrome|.+Safari)|Gecko(?!.+Firefox))(?: |\/)([\d.apre]+)/g),u()(c,"_browserNameAndVersion",c.parseBrowserNameAndVersion()),u()(c,"_browserName",c.parseBrowserName()),u()(c,"_browserMajorVersion",c.parseBrowserMajorVersion()),u()(c,"_isChrome69",c._browserNameAndVersion.includes("Chrome/69.")),u()(c,"_isChrome70",c._browserNameAndVersion.includes("Chrome/70.")),u()(c,"_isChrome71",c._browserNameAndVersion.includes("Chrome/71.")),u()(c,"_isChrome72",c._browserNameAndVersion.includes("Chrome/72.")),u()(c,"_isChrome74",c._browserNameAndVersion.includes("Chrome/74.")),u()(c,"_isChrome75",c._browserNameAndVersion.includes("Chrome/75.")),u()(c,"_isChrome76",c._browserNameAndVersion.includes("Chrome/76.")),u()(c,"_isChrome77",c._browserNameAndVersion.includes("Chrome/77."))},4381:function(e,t,n){"use strict";n.d(t,{Z:function(){return h}}),n(6992),n(1539),n(4916),n(8783),n(4765),n(3948),n(285);var r=n(4575),i=n.n(r),o=n(3913),a=n.n(o),s=n(3588),u=n(4417),c=n(2394),l=n(1178),h=function(){function e(){i()(this,e)}return a()(e,[{key:"getStringValue",value:function(e){return this.readConfigurationParameterValue(e)||this.readConfigurationParameterURIValue("".concat(e,"-uri-parameter-name"))||this.defaultStringValue[e]}},{key:"getBooleanValue",value:function(e){var t=this.readConfigurationParameterValue(e);return t||this.readConfigurationParameterURIValue("".concat(e,"-uri-parameter-name"))?"true"===t||"1"===t||"On"===t:!0===this.defaultBooleanValue[e]}},{key:"defaultStringValue",get:function(){return{"phenix-metrics-level":u.Z.convertTelemetryLevelToTelemetryLevelType(s.Z.defaultTelemetryLevel),"phenix-logging-level":c.Z.convertLoggingLevelToLoggingLevelType(l.Z.defaultLoggingLevel),"phenix-console-logging-level":c.Z.convertLoggingLevelToLoggingLevelType(l.Z.defaultConsoleLoggingLevel),"phenix-telemetry-logging-level":c.Z.convertLoggingLevelToLoggingLevelType(l.Z.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}}},{key:"readConfigurationParameterValue",value:function(e){var t=document.querySelector("meta[name='".concat(e,"']"));if(t){var n=t.getAttribute("value");if(n)return n}}},{key:"readConfigurationParameterURIValue",value:function(e){var t=this.readConfigurationParameterValue(e);if(t){var n=new URLSearchParams(location.search).get(t)||void 0;if(n)return n}}}]),e}()},3953:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(4575),i=n.n(r),o=n(3913),a=n.n(o),s=n(9713),u=n.n(s),c=function(){function e(){i()(this,e)}return a()(e,null,[{key:"isPrivate",get:function(){return this._isPrivate}},{key:"applyIsPrivate",value:function(){try{this._isPrivate=!1}catch(e){this._isPrivate=!1}}}]),e}();u()(c,"_isPrivate",void 0),c.applyIsPrivate()},6330:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(4575),i=n.n(r),o=n(3913),a=n.n(o),s=n(9713),u=n.n(s),c=function(){function e(t){i()(this,e),u()(this,"_disposed",void 0),u()(this,"_disposable",void 0),this._disposed=!1,this._disposable=t}return a()(e,[{key:"dispose",value:function(){if(!this._disposed)return this._disposed=!0,this._disposable.call(this)}}]),e}()},2493:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}}),n(9554),n(4747);var r=n(4575),i=n.n(r),o=n(3913),a=n.n(o),s=n(9713),u=n.n(s),c=function(){function e(){i()(this,e),u()(this,"_list",[])}return a()(e,[{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,"]")}}]),e}()},4827:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}}),n(3290),n(5827),n(3710),n(1539),n(9714);var r=n(4575),i=n.n(r),o=n(3913),a=n.n(o),s=function(){function e(){throw i()(this,e),new Error("Strings is a static class that may not be instantiated")}return a()(e,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)}}]),e}()},8701:function(e,t,n){"use strict";t.Z=function(e){throw new Error("Unexpected value [".concat(e,"]. This should never be reached"))}},709:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}}),n(5827);var r=n(4575),i=n.n(r),o=n(3913),a=n.n(o),s=n(9713),u=n.n(s),c=function(){function e(){i()(this,e),u()(this,"_appenders",[])}return a()(e,[{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}),[])}}]),e}()},1502:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}}),n(2222),n(8733);var r=n(4575),i=n.n(r),o=n(3913),a=n.n(o),s=n(9713),u=n.n(s),c=n(5149),l=function(){function e(t){i()(this,e),u()(this,"_threshold",void 0),this._threshold=t}return a()(e,[{key:"log",value:function(e,t,n,r){if(!(e<this._threshold)){var i="".concat(r.toISOString()," [").concat(n,"] [").concat(c.G[e],"] ").concat(t);e<c.G.Warn?console.log(i):console.error(i)}}}]),e}()},5149:function(e,t,n){"use strict";n.d(t,{G:function(){return r},Z:function(){return l}}),n(9554),n(6699),n(2772),n(5827),n(561),n(3710),n(1539),n(9714),n(4747);var r,i=n(4575),o=n.n(i),a=n(3913),s=n.n(a),u=n(9713),c=n.n(u);!function(e){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"}(r||(r={}));var l=function(){function e(t,n,r){o()(this,e),c()(this,"_category",void 0),c()(this,"_appenders",void 0),c()(this,"_threshold",void 0),this._category=t,this._appenders=n,this._threshold=r}return s()(e,[{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?e+"\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}}]),e}()},1178:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(4575),i=n.n(r),o=n(3913),a=n.n(o),s=n(3953),u=n(5149),c=function(){function e(){i()(this,e)}return a()(e,null,[{key:"defaultLoggingLevel",get:function(){return s.Z.isPrivate?u.G.Off:u.G.All}},{key:"defaultConsoleLoggingLevel",get:function(){return s.Z.isPrivate?u.G.Off:u.G.All}},{key:"defaultTelemetryLoggingLevel",get:function(){return u.G.Info}}]),e}()},9571:function(e,t,n){"use strict";n.d(t,{Z:function(){return m}}),n(4812);var r=n(4575),i=n.n(r),o=n(3913),a=n.n(o),s=n(9713),u=n.n(s),c=n(5149),l=n(709),h=n(6016),d=n(1502),f=n(3552),p=n(5259),v=n(4381),g=n(1178),m=function(){function e(){throw i()(this,e),new Error("LoggerFactory is a static class that may not be instantiated")}return a()(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 c.Z(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=this._configurationParameterReader.getStringValue("phenix-logging-level");c.G[e]&&this._threshold.setThreshold(c.G[e])}},{key:"applyAppenderLoggingLevel",value:function(e,t){var n=this._configurationParameterReader.getStringValue("phenix-".concat(e,"-logging-level"));"Off"!==n&&t(c.G[n])}},{key:"applyConsoleLogger",value:function(e){this._appenders.add(new d.Z(e||g.Z.defaultConsoleLoggingLevel))}},{key:"applyTelemetryLogger",value:function(e){this._telemetryConfiguration.threshold=e||g.Z.defaultTelemetryLoggingLevel,this._appenders.add(new f.Z(this._telemetryConfiguration))}}]),e}();u()(m,"_configurationParameterReader",new v.Z),u()(m,"_loggers",{}),u()(m,"_appenders",new l.Z),u()(m,"_threshold",new h.Z),u()(m,"_telemetryConfiguration",new p.Z),m.applyLoggerConfigFromParameterConfiguration()},2394:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(4575),i=n.n(r),o=n(3913),a=n.n(o),s=n(8701),u=n(5149),c=function(){function e(){i()(this,e)}return a()(e,null,[{key:"convertLoggingLevelToLoggingLevelType",value:function(e){switch(e){case u.G.Off:return"Off";case u.G.Trace:return"Trace";case u.G.Debug:return"Debug";case u.G.Info:return"Trace";case u.G.Warn:return"Warn";case u.G.Error:return"Error";case u.G.Fatal:return"Fatal";case u.G.All:return"All";default:(0,s.Z)(e)}}},{key:"convertLoggingLevelTypeToLoggingLevel",value:function(e){switch(e){case"Off":return u.G.Off;case"Trace":return u.G.Trace;case"Debug":return u.G.Debug;case"Info":return u.G.Info;case"Warn":return u.G.Warn;case"Error":return u.G.Error;case"Fatal":return u.G.Fatal;case"All":return u.G.All;default:(0,s.Z)(e)}}}]),e}()},6016:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(4575),i=n.n(r),o=n(3913),a=n.n(o),s=n(9713),u=n.n(s),c=n(1178),l=function(){function e(){i()(this,e),u()(this,"_threshold",c.Z.defaultLoggingLevel)}return a()(e,[{key:"value",get:function(){return this._threshold}},{key:"setThreshold",value:function(e){this._threshold=e}}]),e}()},4574:function(e,t,n){"use strict";n.d(t,{Z:function(){return d}});var r=n(4575),i=n.n(r),o=n(3913),a=n.n(o),s=n(9713),u=n.n(s),c=n(2889),l=n(8701),h=n(8963),d=function(){function e(t){i()(this,e),u()(this,"_metrics",void 0),this._metrics=t}return a()(e,[{key:"getName",value:function(){return h.Z[this._metrics]}},{key:"getTelemetryLevel",value:function(){switch(this._metrics){case h.Z.TimeToFirstFrame:case h.Z.ChannelCreationTimeToFirstFrame:return c.g.Essential;case h.Z.Stalled:case h.Z.Buffering:case h.Z.SetupCompleted:case h.Z.SetupFailed:case h.Z.RoundTripTime:case h.Z.DownlinkThroughputCapacity:case h.Z.NetworkType:case h.Z.ResolutionChanged:case h.Z.ApplicationForeground:case h.Z.ApplicationBackground:return c.g.All;default:(0,l.Z)(this._metrics)}}}]),e}()},2889:function(e,t,n){"use strict";n.d(t,{g:function(){return r},Z:function(){return h}}),n(6992),n(3710),n(1539),n(9714),n(8783),n(3948),n(285);var r,i=n(4575),o=n.n(i),a=n(3913),s=n.n(a),u=n(9713),c=n.n(u),l=n(3588);!function(e){e[e.Off=100]="Off",e[e.Essential=10]="Essential",e[e.All=-1]="All"}(r||(r={}));var h=function(){function e(){o()(this,e),c()(this,"_url","https://telemetry.phenixrts.com/telemetry/metrics"),c()(this,"_tenancy",void 0),c()(this,"_sessionId",void 0),c()(this,"_environment",void 0),c()(this,"_threshold",l.Z.defaultTelemetryLevel)}return s()(e,[{key:"url",get:function(){return this._url},set:function(e){var t=new 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}}]),e}()},6062:function(e,t,n){"use strict";n.d(t,{Z:function(){return v}}),n(9554),n(2479),n(4747);var r=n(4575),i=n.n(r),o=n(3913),a=n.n(o),s=n(9713),u=n.n(s),c=n(3896),l=n(2889),h=n(5508),d=n(4760),f=n(5021),p=n(4417),v=function(){function e(){throw i()(this,e),new Error("LoggerFactory is a static class that may not be instantiated")}return a()(e,null,[{key:"getMetricsService",value:function(t){if("string"!=typeof t)throw new Error("ur");var n=e._metricsServices[t];if(n)return n;var r=new l.Z;return r.sessionId=h.Z.clientSessionId,r.tenancy=h.Z.tenancy.value,r.url=d.Z.getTelemetryUrl(t),r.environment=f.Z.getEnvironmentFromUrl(t),r.threshold=p.Z.convertTelemetryLevelTypeToTelemetryLevel(h.Z.telemetryLevel),e._metricsServices[t]=new c.Z(r)}},{key:"setTelemetryLevel",value:function(t){var n=Object.values(e._metricsServices);n&&n.length&&n.forEach((function(e){e.metricsConfiguration.threshold=t}))}}]),e}();u()(v,"_metricsServices",{})},3896:function(e,t,n){"use strict";n.d(t,{Z:function(){return v}}),n(7042),n(8733),n(3710),n(1539),n(8674),n(5666);var r=n(8926),i=n.n(r),o=n(4575),a=n.n(o),s=n(3913),u=n.n(s),c=n(9713),l=n.n(c),h=n(7757),d=n.n(h),f=n(8862),p=n(4574),v=function(){function e(t){a()(this,e),l()(this,"_metricsConfiguration",void 0),l()(this,"_metrics",[]),l()(this,"_isSending",void 0),l()(this,"_domain",location.hostname),this._metricsConfiguration=t}var t,n;return u()(e,[{key:"metricsConfiguration",get:function(){return this._metricsConfiguration}},{key:"push",value:function(e){var t=e.streamId,n=e.value,r=e.previousValue,i=e.runtime,o=e.resource,a=e.kind,s=new p.Z(e.metricType);if(!(this._metricsConfiguration.threshold>s.getTelemetryLevel())){var u={timestamp:(new Date).toISOString(),tenancy:this._metricsConfiguration.tenancy,sessionId:this._metricsConfiguration.sessionId,streamId:t,metric:s.getName(),value:n,previousValue:r,fullQualifiedName:this._domain,environment:this._metricsConfiguration.environment,version:f.Z.sdkVersion,runtime:i,resource:o,kind:a};this._metrics.push(u),this.sendMetricsIfAble()}}},{key:"sendMetrics",value:(n=i()(d().mark((function e(t){var n;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(n=new FormData).append("jsonBody",JSON.stringify({records:t})),e.next=4,fetch(this._metricsConfiguration.url,{method:"POST",body:n});case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"sendMetricsIfAble",value:(t=i()(d().mark((function e(){var t,n=this;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(this._metrics.length<=0||this._isSending)){e.next=2;break}return e.abrupt("return");case 2:return this._isSending=!0,t=this._metrics.slice(0,1024),this._metrics=this._metrics.slice(1024),e.abrupt("return",this.sendMetrics(t).then((function(e){return n._isSending=!1,n.sendMetricsIfAble(),e})).catch((function(){n._isSending=!1,n.sendMetricsIfAble()})));case 6:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}()},8963:function(e,t){"use strict";var n;!function(e){e[e.TimeToFirstFrame=0]="TimeToFirstFrame",e[e.ChannelCreationTimeToFirstFrame=1]="ChannelCreationTimeToFirstFrame",e[e.Stalled=2]="Stalled",e[e.Buffering=3]="Buffering",e[e.SetupCompleted=4]="SetupCompleted",e[e.SetupFailed=5]="SetupFailed",e[e.RoundTripTime=6]="RoundTripTime",e[e.DownlinkThroughputCapacity=7]="DownlinkThroughputCapacity",e[e.NetworkType=8]="NetworkType",e[e.ResolutionChanged=9]="ResolutionChanged",e[e.ApplicationForeground=10]="ApplicationForeground",e[e.ApplicationBackground=11]="ApplicationBackground"}(n||(n={})),t.Z=n},4417:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(4575),i=n.n(r),o=n(3913),a=n.n(o),s=n(2889),u=n(8701),c=function(){function e(){i()(this,e)}return a()(e,null,[{key:"convertTelemetryLevelToTelemetryLevelType",value:function(e){switch(e){case s.g.Off:return"Off";case s.g.Essential:return"Essential";case s.g.All:return"All";default:(0,u.Z)(e)}}},{key:"convertTelemetryLevelTypeToTelemetryLevel",value:function(e){switch(e){case"Off":return s.g.Off;case"Essential":return s.g.Essential;case"All":return s.g.All;default:(0,u.Z)(e)}}}]),e}()},3588:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(4575),i=n.n(r),o=n(3913),a=n.n(o),s=n(3953),u=n(2889),c=function(){function e(){i()(this,e)}return a()(e,null,[{key:"defaultTelemetryLevel",get:function(){return s.Z.isPrivate?u.g.Essential:u.g.All}}]),e}()},202:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return f}}),n(9753),n(7042),n(1539),n(8674),n(7727),n(2564);var r=n(8),i=n.n(r),o=n(4575),a=n.n(o),s=n(3913),u=n.n(s),c=n(9713),l=n.n(c),h=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})),d=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=void 0,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=null}},{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(a,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 t(a,e)}),n)}r[a]=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){setTimeout(e,0)}},{key:"_unhandledRejection",value:function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)}}]),e}();d.prototype.catch=function(e){return this.then(null,e)},d.prototype.then=function(e,t){var n=new this.constructor((function(){return null}));return this.handle(new h(e,t,n)),n},d.prototype.finally=function(e){var t=this.constructor;return this.then((function(n){return t.resolve(e()).then((function(){return n}))}),(function(n){return t.resolve(e()).then((function(){return t.reject(n)}))}))};var f=d},4554:function(e,t,n){"use strict";n(9554),n(1539),n(8674),n(4916),n(4723),n(4747),n(5666);var r=n(8926),i=n.n(r),o=n(4575),a=n.n(o),s=n(3913),u=n.n(s),c=n(9713),l=n.n(c),h=n(7757),d=n.n(h),f=n(9571),p=n(1228),v=n(202).default,g=function(){function e(t){a()(this,e),l()(this,"_logger",f.Z.getLogger("VanillaPeerConnection")),l()(this,"_peerConnection",void 0),p.Z.webkitRTCPeerConnectionEnabled?this._peerConnection=new webkitRTCPeerConnection(t):this._peerConnection=new RTCPeerConnection(t)}var t,n,r,o;return u()(e,[{key:"native",get:function(){return this._peerConnection}},{key:"currentLocalDescription",get:function(){return this._peerConnection.currentLocalDescription}},{key:"currentRemoteDescription",get:function(){return this._peerConnection.currentRemoteDescription}},{key:"iceConnectionState",get:function(){return this._peerConnection.iceConnectionState}},{key:"supportsGetConfiguration",get:function(){return"function"==typeof this._peerConnection.getConfiguration}},{key:"supportsSetConfiguration",get:function(){return"function"==typeof this._peerConnection.setConfiguration}},{key:"supportsAddTransceiver",get:function(){return!p.Z.addTranceiverDisabled&&"function"==typeof this._peerConnection.addTransceiver}},{key:"createOffer",value:(o=i()(d().mark((function e(t){var n=this;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!p.Z.promiseBasedPCMethodsDisabled){e.next=2;break}return e.abrupt("return",new v((function(e,r){return n._peerConnection.createOffer(e,r,t)})));case 2:return e.abrupt("return",this._peerConnection.createOffer(t));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"createAnswer",value:(r=i()(d().mark((function e(t){var n=this;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!p.Z.promiseBasedPCMethodsDisabled){e.next=2;break}return e.abrupt("return",new v((function(e,r){return n._peerConnection.createAnswer(e,r,t)})));case 2:return e.abrupt("return",this._peerConnection.createAnswer(t));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"setLocalDescription",value:(n=i()(d().mark((function e(t){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._peerConnection.setLocalDescription(p.Z.promiseBasedPCMethodsDisabled?new RTCSessionDescription(t):t));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"setRemoteDescription",value:(t=i()(d().mark((function e(t){var n;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0: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.abrupt("return",this._peerConnection.setRemoteDescription(p.Z.promiseBasedPCMethodsDisabled?new RTCSessionDescription(t):t));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"getSenders",value:function(){return this._peerConnection.getSenders()}},{key:"getStats",value:function(e){return this._peerConnection.getStats(e)}},{key:"getStatsLegacy",value:function(){var e=this;return new v((function(t){e._peerConnection.getStats(t)}))}},{key:"addEventListener",value:function(e,t,n){this._peerConnection.addEventListener(e,t,n)}},{key:"removeEventListener",value:function(e,t,n){this._peerConnection.removeEventListener(e,t,n)}},{key:"addTransceiver",value:function(e,t){return this._peerConnection.addTransceiver(e,t)}},{key:"addStream",value:function(e){var t=this;e.getTracks().forEach((function(e){t._peerConnection.addTrack(e)}))}},{key:"getConfiguration",value:function(){return this._peerConnection.getConfiguration()}},{key:"setConfiguration",value:function(e){this._peerConnection.setConfiguration(e)}},{key:"ontrack",get:function(){return this._peerConnection.ontrack},set:function(e){this._peerConnection.ontrack=e}},{key:"onicecandidate",get:function(){return this._peerConnection.onicecandidate},set:function(e){this._peerConnection.onicecandidate=e}},{key:"oniceconnectionstatechange",get:function(){return this._peerConnection.oniceconnectionstatechange},set:function(e){this._peerConnection.oniceconnectionstatechange=e}},{key:"close",value:function(){this._peerConnection.close()}}]),e}();t.Z=g},4009:function(e,t,n){"use strict";n(5666);var r=n(8926),i=n.n(r),o=n(4575),a=n.n(o),s=n(3913),u=n.n(s),c=n(7757),l=n.n(c),h=n(4554),d=function(){function e(){a()(this,e)}var t;return u()(e,[{key:"createPeerConnection",value:(t=i()(l().mark((function e(t){return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new h.Z(t));case 1:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})}]),e}();t.Z=d},841:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(4575),i=n.n(r),o=n(3913),a=n.n(o),s=n(9713),u=n.n(s),c=function(){function e(t){i()(this,e),u()(this,"_subject",void 0),this._subject=t}return a()(e,[{key:"value",get:function(){return this._subject.value}},{key:"subscribe",value:function(e){return this._subject.subscribe(e)}}]),e}()},7426:function(e,t,n){"use strict";n.d(t,{Z:function(){return g}}),n(9554),n(2772),n(561),n(4747);var r=n(9713),i=n.n(r),o=n(3913),a=n.n(o),s=n(4575),u=n.n(s),c=n(2205),l=n.n(c),h=n(8585),d=n.n(h),f=n(9754),p=n.n(f);var v=function(e){l()(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=p()(t);if(n){var i=p()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return d()(this,e)});function i(e,t){return u()(this,i),r.call(this,(function(){var n=e.indexOf(t);n>=0&&e.splice(n,1)}))}return a()(i)}(n(6330).Z),g=function(){function e(t){u()(this,e),i()(this,"_listeners",void 0),i()(this,"_value",void 0),this._listeners=[],this._value=t}return a()(e,[{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))}t&&(this._value=e,this._listeners.forEach((function(t){t(e)})))}},{key:"subscribe",value:function(e){return this._listeners.push(e),e(this._value),new v(this._listeners,e)}}]),e}()},5021:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}}),n(6992),n(1539),n(8783),n(3948),n(285);var r=n(4575),i=n.n(r),o=n(3913),a=n.n(o),s=function(){function e(){i()(this,e)}return a()(e,null,[{key:"getEnvironmentFromUrl",value:function(e){try{return new URL(e).origin}catch(e){return""}}}]),e}()},5508:function(e,t,n){"use strict";n.d(t,{Z:function(){return R}}),n(9826),n(3843),n(3710),n(1539),n(9714);var r=n(4575),i=n.n(r),o=n(3913),a=n.n(o),s=n(9713),u=n.n(s),c=n(9571),l=n(4827),h=n(7426),d=n(841),f=n(4009),p=n(3297),v=n(5149),g=n(1502),m=n(3552),y=n(4381),_=n(2889),b=n(4417),w=n(2394),x=n(3953),C=n(9845),S=n(6406),k=n(4760),T=n(5021),E=n(5564),L=n(6062),P=n(3588),O=window.__phenixPageLoadTime||window.__pageLoadTime||Date.now(),R=function(){function e(){throw i()(this,e),new Error("SDK is a static class that may not be instantiated")}return a()(e,null,[{key:"pageLoadTime",get:function(){return O}},{key:"sendLocalCandidates",get:function(){return this._sendLocalCandidates}},{key:"tenancy",get:function(){return this._tenancy}},{key:"clientSessionId",get:function(){return e._clientSessionId}},{key:"loadedTimestamp",get:function(){return e._loadedTimestamp}},{key:"initialized",get:function(){return e._readOnlyInitialized}},{key:"discoveryUri",get:function(){return e._readOnlyDiscoveryUri}},{key:"peerConnectionFactory",get:function(){return e._readOnlyPeerConnectionFactory}},{key:"automaticRetryOnFailure",get:function(){return e._automaticallyRetryOnFailure}},{key:"automaticallyReconnectPeerConnection",get:function(){return e._automaticallyReconnectPeerConnection}},{key:"automaticallyPlayMediaStream",get:function(){return e._automaticallyPlayMediaStream}},{key:"automaticallyMuteVideoOnPlayFailure",get:function(){return e._automaticallyMuteVideoOnPlayFailure}},{key:"webPlayerLoader",get:function(){return this._webPlayerLoader}},{key:"shakaPlayerLoader",get:function(){return this._shakaPlayerLoader}},{key:"hlsJsLoader",get:function(){return this._hlsJsLoader}},{key:"metricsService",get:function(){return e._metricsService}},{key:"applicationActivityMonitor",get:function(){return this._applicationActivityMonitor}},{key:"telemetryUrl",get:function(){return this._telemetryUrl}},{key:"maximalNumberOfPeerConnectionReconnectAttempts",get:function(){return this._maximalNumberOfPeerConnectionReconnectAttempts},set:function(e){this._maximalNumberOfPeerConnectionReconnectAttempts=e}},{key:"loggingLevel",get:function(){return w.Z.convertLoggingLevelToLoggingLevelType(this._logger.threshold.value)}},{key:"telemetryLevel",get:function(){return b.Z.convertTelemetryLevelToTelemetryLevelType(e._telemetryLevel.value)}},{key:"browserDetector",get:function(){return C.Z}},{key:"applyTelemetryConfiguration",value:function(){var t=this,n=c.Z.telemetryConfiguration;n.sessionId=e.clientSessionId,e._environment.subscribe((function(e){n.environment=e})),e.telemetryUrl.subscribe((function(e){var r=t._logger.appenders.value.find((function(e){return e instanceof m.Z}));r&&(n.url=e,t._logger.appenders.remove(r),t._logger.appenders.add(new m.Z(n)),t._logger.info("Telemetry URL was set to [%s]",n.url))})),e._tenancy.subscribe((function(e){var r=t._logger.appenders.value.find((function(e){return e instanceof m.Z}));r&&e&&(n.tenancy=e,t._logger.appenders.remove(r),t._logger.appenders.add(new m.Z(n)),t._logger.info("Telemetry tenancy was set to [%s]",n.tenancy))}))}},{key:"applyMetricsConfiguration",value:function(){e._metricsService=L.Z.getMetricsService(E.Z.uri.value),e._metricsConfiguration=e._metricsService.metricsConfiguration,e._metricsConfiguration.sessionId=e.clientSessionId,e._environment.subscribe((function(t){e._metricsConfiguration.environment=t})),e.telemetryUrl.subscribe((function(t){e._metricsConfiguration.url=t})),e._tenancy.subscribe((function(t){e._metricsConfiguration.tenancy=t}));var t=this._configurationParameterReader.getStringValue("phenix-metrics-level");t&&L.Z.setTelemetryLevel(_.g[t]),e._telemetryLevel.subscribe((function(e){L.Z.setTelemetryLevel(e)}))}},{key:"applyAutomaticallyRetryOnFailureFromParameterConfiguration",value:function(){this._automaticallyRetryOnFailure=this._configurationParameterReader.getBooleanValue("phenix-automatically-retry-on-failure"),this._logger.info("Automatically retry on failure is set to: [%s]",this._automaticallyRetryOnFailure)}},{key:"applyAutomaticallyReconnectPeerConnectionFromParameterConfiguration",value:function(){this._automaticallyReconnectPeerConnection=this._configurationParameterReader.getBooleanValue("phenix-automatically-reconnect-peer-connection"),this._logger.info("Automatically reconnect peer connection is set to: [%s]",this._automaticallyReconnectPeerConnection)}},{key:"applyDiscoveryUriDefaultFromParameterConfiguration",value:function(){e.discoveryUri.subscribe((function(t){e.telemetryUrl.value=e.getTelemetryUrl(t),e._environment.value=T.Z.getEnvironmentFromUrl(t)}));var t=this._configurationParameterReader.getStringValue("phenix-channel-token");if(t){var n=p.Z.parseToken(t);return e._tenancy.value=p.Z.getTenancy(n),E.Z.uri.value=(p.Z.getUri(n)||e.discoveryUri.value).toString(),void this._logger.info("Discovery URI set from configuration parameter to [%s]",e.discoveryUri.value)}var r=this._configurationParameterReader.getStringValue("phenix-uri");if(r)return E.Z.uri.value=r,void this._logger.info('Discovery URI set from "phenix-uri" configuration parameter tag to [%s]',e.discoveryUri.value);var i=this._configurationParameterReader.getStringValue("phenix-base-uri");return i?(E.Z.uri.value="".concat(i,"/pcast/endPoints"),void this._logger.info('Discovery URI set from "phenix-base-uri" configuration parameter tag to [%s]',e.discoveryUri.value)):void 0}},{key:"init",value:function(t){if(this._initialized.value||(this._applicationActivityMonitor=new S.Z),t){if(t.discoveryUri&&(E.Z.uri.value=t.discoveryUri),t.peerConnectionFactory&&(e._peerConnectionFactory.value=t.peerConnectionFactory),t.telemetryLevel&&_.g[t.telemetryLevel]&&(e._telemetryLevel.value=b.Z.convertTelemetryLevelTypeToTelemetryLevel(t.telemetryLevel)),t.loggingLevel&&v.G[t.loggingLevel]&&this._logger.threshold.setThreshold(w.Z.convertLoggingLevelTypeToLoggingLevel(t.loggingLevel)),t.consoleLoggingLevel&&v.G[t.consoleLoggingLevel]){var n=this._logger.appenders.value.find((function(e){return e instanceof g.Z}));n&&this._logger.appenders.remove(n),"Off"!==t.consoleLoggingLevel&&this._logger.appenders.add(new g.Z(w.Z.convertLoggingLevelTypeToLoggingLevel(t.consoleLoggingLevel)))}"boolean"==typeof t.automaticallyPlayMediaStream&&(this._automaticallyPlayMediaStream=t.automaticallyPlayMediaStream),"boolean"==typeof t.automaticallyMuteVideoOnPlayFailure&&(this._automaticallyMuteVideoOnPlayFailure=t.automaticallyMuteVideoOnPlayFailure),t.webPlayerLoader&&(this._webPlayerLoader=t.webPlayerLoader),t.shakaPlayerLoader&&(this._shakaPlayerLoader=t.shakaPlayerLoader),t.hlsJsLoader&&(this._hlsJsLoader=t.hlsJsLoader)}e._initialized.value=!0}},{key:"dispose",value:function(){e._initialized.value=!1,this._applicationActivityMonitor.dispose(),this._applicationActivityMonitor=null}},{key:"getTelemetryUrl",value:function(e){return k.Z.getTelemetryUrl(e)}}]),e}();u()(R,"_automaticallyRetryOnFailure",!0),u()(R,"_automaticallyReconnectPeerConnection",!0),u()(R,"_automaticallyPlayMediaStream",!0),u()(R,"_automaticallyMuteVideoOnPlayFailure",!0),u()(R,"_webPlayerLoader",null),u()(R,"_shakaPlayerLoader",null),u()(R,"_hlsJsLoader",null),u()(R,"_configurationParameterReader",new y.Z),u()(R,"_applicationActivityMonitor",void 0),u()(R,"_environment",new h.Z("")),u()(R,"_telemetryUrl",new h.Z("https://telemetry.phenixrts.com/telemetry")),u()(R,"_maximalNumberOfPeerConnectionReconnectAttempts",8),u()(R,"_telemetryLevel",new h.Z(P.Z.defaultTelemetryLevel)),u()(R,"_metricsService",void 0),u()(R,"_metricsConfiguration",void 0),u()(R,"_sendLocalCandidates",new h.Z(!x.Z.isPrivate)),u()(R,"_tenancy",new h.Z("")),u()(R,"_clientSessionId",l.Z.random(32)),u()(R,"_loadedTimestamp",new Date),u()(R,"_logger",c.Z.getLogger("SDK")),u()(R,"_initialized",new h.Z(!1)),u()(R,"_peerConnectionFactory",new h.Z(new f.Z)),u()(R,"_readOnlyInitialized",new d.Z(R._initialized)),u()(R,"_readOnlyDiscoveryUri",new d.Z(E.Z.uri)),u()(R,"_readOnlyPeerConnectionFactory",new d.Z(R._peerConnectionFactory)),window.addEventListener("unload",(function(){R.dispose()})),R.applyDiscoveryUriDefaultFromParameterConfiguration(),R.applyMetricsConfiguration(),R.applyTelemetryConfiguration(),R.applyAutomaticallyRetryOnFailureFromParameterConfiguration(),R.applyAutomaticallyReconnectPeerConnectionFromParameterConfiguration(),R.init()},4760:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}}),n(6699),n(6992),n(9600),n(1539),n(4916),n(7852),n(2023),n(8783),n(3123),n(6755),n(3948),n(285);var r=n(4575),i=n.n(r),o=n(3913),a=n.n(o),s=function(){function e(){i()(this,e)}return a()(e,null,[{key:"getTelemetryUrl",value:function(e){try{var t=new URL(e),n=t.hostname.split(".");switch(t.protocol){case"ws:":t.protocol="http:";break;case"wss:":t.protocol="https:"}return 2===n.length||3===n.length&&n[n.length-2].length<=2&&n[n.length-1].length<=3?n.unshift("telemetry"):n[0].startsWith("stg-")||n[0].endsWith("-stg")||n[0].includes("-stg-")||"stg"===n[0]?n[0]="telemetry-stg":n[0].startsWith("local")||n[0].endsWith("-local")||(n[0]="telemetry"),t.hostname=n.join("."),"".concat(t.origin,"/telemetry")}catch(t){return e}}}]),e}()},2250:function(e,t){"use strict";var n;!function(e){e[e.Offline=1]="Offline",e[e.Starting=2]="Starting",e[e.Paused=3]="Paused",e[e.Playing=4]="Playing",e[e.Recovering=5]="Recovering",e[e.Reconnecting=6]="Reconnecting",e[e.StandBy=7]="StandBy",e[e.Stopped=8]="Stopped",e[e.Unauthorized=9]="Unauthorized",e[e.GeoRestricted=10]="GeoRestricted",e[e.GeoBlocked=11]="GeoBlocked",e[e.Error=12]="Error",e[e.UnsupportedFeature=13]="UnsupportedFeature"}(n||(n={})),t.Z=n},2070:function(e,t,n){"use strict";n.d(t,{Z:function(){return Ie}});var r,i,o=n(4575),a=n.n(o),s=n(3913),u=n.n(s),c=(n(7327),n(9554),n(6992),n(3843),n(3710),n(4812),n(1539),n(8674),n(7727),n(9714),n(8783),n(4747),n(3948),n(2564),n(285),n(5666),n(8926)),l=n.n(c),h=n(9713),d=n.n(h),f=n(7757),p=n.n(f),v=n(9571),g=n(841),m=(n(2222),function(){function e(t,n){a()(this,e),d()(this,"width",void 0),d()(this,"height",void 0),this.width=t,this.height=n}return u()(e,[{key:"equals",value:function(e){return e&&this.width===e.width&&this.height===e.height}},{key:"toString",value:function(){return"".concat(this.width,"x").concat(this.height)}}],[{key:"empty",get:function(){return new e(0,0)}}]),e}()),y=n(5508),_=n(2250),b=n(8701),w=n(6330),x=n(3297),C=(n(9600),n(7042),n(3112),n(2481),function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;a()(this,e),d()(this,"_duration",void 0),this._duration=t}return u()(e,[{key:"toIsoString",value:function(){if(0===this._duration)return"P0S";var e=this._duration<0,t=e?Math.abs(this._duration):this._duration,n=Math.floor(t),r=n%1e3,i=(n=Math.floor(n/1e3))%60,o=(n=Math.floor(n/60))%60,a=(n=Math.floor(n/60))%24,s=["PT"];return e&&s.unshift("-"),a&&s.push(a+"H"),o&&s.push(o+"M"),(i||r)&&(s.push(String(i)),r&&s.push("."+this.padStart(r.toString(),3,"0")),s.push("S")),s.join("")}},{key:"padStart",value:function(e,t,n){return t>>=0,n=String(void 0!==n?n:" "),e.length>t?e:((t-=e.length)>n.length&&(n+=n.repeat(t/n.length)),n.slice(0,t)+e)}}]),e}()),S=n(8963),k=n(2493),T=function(){function e(t,n,r,i){a()(this,e),d()(this,"_pageLoadTime",void 0),d()(this,"_channelStartTime",void 0),d()(this,"_logger",v.Z.getLogger("StreamTelemetry")),d()(this,"_disposables",new k.Z),d()(this,"_streamId",void 0),d()(this,"_metricsService",void 0),d()(this,"_listenToFirstTime",void 0),d()(this,"_listenForStall",void 0),d()(this,"_listenForContinuation",void 0),d()(this,"_timeToFirstFrame",void 0),d()(this,"_channelCreationTimeToFirstFrame",void 0),d()(this,"_startRecordingFirstFrame",void 0),d()(this,"_videoStalled",void 0),d()(this,"_lastProgress",void 0),d()(this,"_videoResolution",void 0),d()(this,"_clearTimeToFirstFrameListener",void 0),d()(this,"_clearRebufferingListener",void 0),this._streamId=t,this._pageLoadTime=n,this._channelStartTime=r,this._metricsService=i}return u()(e,[{key:"setupListenerForTimeToFirstTime",value:function(e){var t=this;this._startRecordingFirstFrame=Date.now(),this._listenToFirstTime=function(){return t.callTimeToFirstFrame()},e.addEventListener("loadeddata",this._listenToFirstTime),e.addEventListener("loadedmetadata",this._listenToFirstTime),this._clearTimeToFirstFrameListener=new w.Z((function(){e.removeEventListener("loadeddata",t._listenToFirstTime),e.removeEventListener("loadedmetadata",t._listenToFirstTime)})),this._disposables.add(this._clearTimeToFirstFrameListener)}},{key:"setupListenerForRebuffering",value:function(e){var t=this;this._listenForStall=function(){return t.onStall()},this._listenForContinuation=function(n){return t.onContinuation(n,e)},e.addEventListener("stalled",this._listenForStall),e.addEventListener("pause",this._listenForStall),e.addEventListener("suspend",this._listenForStall),e.addEventListener("play",this._listenForContinuation),e.addEventListener("playing",this._listenForContinuation),e.addEventListener("progress",this._listenForContinuation),e.addEventListener("timeupdate",this._listenForContinuation),this._clearRebufferingListener=new w.Z((function(){e.removeEventListener("stalled",t._listenForStall),e.removeEventListener("pause",t._listenForStall),e.removeEventListener("suspend",t._listenForStall),e.removeEventListener("play",t._listenForContinuation),e.removeEventListener("playing",t._listenForContinuation),e.removeEventListener("progress",t._listenForContinuation),e.removeEventListener("timeupdate",t._listenForContinuation)})),this._disposables.add(this._clearRebufferingListener)}},{key:"dispose",value:function(){this._disposables.dispose()}},{key:"durationSincePageLoad",get:function(){var e=Date.now();return new C(e-this._pageLoadTime).toIsoString()}},{key:"callTimeToFirstFrame",value:function(){var e=Date.now();this.pushTimeToFirstFrame(e),this.pushChannelCreationTimeToFirstFrame(e),this._clearTimeToFirstFrameListener.dispose()}},{key:"pushTimeToFirstFrame",value:function(e){this._timeToFirstFrame=e-this._startRecordingFirstFrame,this._metricsService.push({metricType:S.Z.TimeToFirstFrame,runtime:(e-this._pageLoadTime)/1e3,value:{uint64:this._timeToFirstFrame},streamId:this._streamId}),this._logger.info("[%s] [%s] First frame [%s]",this.durationSincePageLoad,this._streamId,new C(this._timeToFirstFrame).toIsoString())}},{key:"pushChannelCreationTimeToFirstFrame",value:function(e){this._channelCreationTimeToFirstFrame=e-this._channelStartTime,this._metricsService.push({metricType:S.Z.ChannelCreationTimeToFirstFrame,runtime:(e-this._pageLoadTime)/1e3,value:{uint64:this._channelCreationTimeToFirstFrame},streamId:this._streamId}),this._logger.info("[%s] [%s] Channel creation to first frame [%s]",this.durationSincePageLoad,this._streamId,new C(this._channelCreationTimeToFirstFrame).toIsoString())}},{key:"onStall",value:function(){this._videoStalled||(this._metricsService.push({metricType:S.Z.Stalled,runtime:(Date.now()-this._pageLoadTime)/1e3,streamId:this._streamId}),this._videoStalled=Date.now(),this._logger.info("[%s] [%s] [buffering] Stream has stalled",this.durationSincePageLoad,this._streamId))}},{key:"onContinuation",value:function(e,t){if(t.buffered){var n=t.buffered.length,r=!("playing"===e.type||n>0)||("progress"===e.type||"timeupdate"===e.type)&&t.buffered.end(n-1)===this._lastProgress;if(this._videoStalled&&!r){"progress"===e.type&&(this._lastProgress=t.buffered.end(n-1));var i=Date.now()-this._videoStalled;this._metricsService.push({metricType:S.Z.Buffering,runtime:(Date.now()-this._pageLoadTime)/1e3,value:{uint64:i},streamId:this._streamId}),this._logger.info("[%s] [%s] [buffering] Stream has recovered from stall after [%s]",this.durationSincePageLoad,this._streamId,new C(i).toIsoString()),this._videoStalled=null}}}},{key:"onVideoResolutionChanges",value:function(e){this._metricsService.push({metricType:S.Z.ResolutionChanged,runtime:(Date.now()-this._pageLoadTime)/1e3,value:{string:e},previousValue:this._videoResolution?{string:this._videoResolution}:void 0,streamId:this._streamId}),this._videoResolution=e}}]),e}(),E=n(4574),L=function(){function e(t){a()(this,e),d()(this,"_logger",v.Z.getLogger("StreamSetupListener")),d()(this,"metricsService",y.Z.metricsService),d()(this,"_pageLoadTime",void 0),d()(this,"_startTime",void 0),d()(this,"_metricSubmitted",!1),this._startTime=Date.now(),this._pageLoadTime=t}return u()(e,[{key:"success",value:function(e){this.recordStreamMetric(S.Z.SetupCompleted,e)}},{key:"fail",value:function(){this.recordStreamMetric(S.Z.SetupFailed)}},{key:"recordStreamMetric",value:function(e,t){if(!this._metricSubmitted){this._metricSubmitted=!0;var n=Date.now(),r=n-this._startTime,i=new E.Z(e).getName();this.metricsService.push({metricType:e,runtime:(n-this._pageLoadTime)/1e3,value:{uint64:r},streamId:t}),this._logger.info("[%s] [%s] Stream metric [%s] in [%s]",new C(n-this._pageLoadTime).toIsoString(),t,i,new C(r).toIsoString())}}}]),e}(),P=n(7426),O=function(){function e(){a()(this,e),d()(this,"_disposables",new k.Z),d()(this,"_isSupported",navigator&&navigator.connection),d()(this,"_rtt",new P.Z(void 0)),d()(this,"_effectiveType",new P.Z(void 0)),d()(this,"_downlinkThroughputCapacity",new P.Z(void 0)),this.isSupported&&(this.setupNetworkChangeListeners(),this.updateStatistics())}return u()(e,[{key:"isSupported",get:function(){return this._isSupported}},{key:"rtt",get:function(){return this._rtt}},{key:"effectiveType",get:function(){return this._effectiveType}},{key:"downlinkThroughputCapacity",get:function(){return this._downlinkThroughputCapacity}},{key:"dispose",value:function(){this._disposables.dispose()}},{key:"getDownlinkThroughputCapacity",value:function(){return this.isSupported?navigator.connection.downlink||navigator.connection.downlinkMax:-1}},{key:"getEffectiveType",value:function(){return this.isSupported?navigator.connection.effectiveType||navigator.connection.type:"Unknown"}},{key:"getRoundTripTime",value:function(){return navigator.connection.rtt}},{key:"setupNetworkChangeListeners",value:function(){var e=this,t=function(){e.updateStatistics()};navigator.connection.addEventListener("change",t),this._disposables.add(new w.Z((function(){navigator.connection.removeEventListener("change",t)})))}},{key:"updateStatistics",value:function(){this._rtt.value=this.getRoundTripTime(),this._effectiveType.value=this.getEffectiveType(),this._downlinkThroughputCapacity.value=this.getDownlinkThroughputCapacity()}}]),e}(),R=function(){function e(t,n){var r=this;a()(this,e),d()(this,"_logger",v.Z.getLogger("SessionTelemetry")),d()(this,"_metricsService",void 0),d()(this,"_applicationActivityMonitor",y.Z.applicationActivityMonitor),d()(this,"_networkMonitor",new O),d()(this,"_pageLoadTime",void 0),d()(this,"_disposables",new k.Z),d()(this,"_lastNetworkStatistics",{}),this._pageLoadTime=t,this._disposables.add(this._networkMonitor),this._metricsService=n,this._networkMonitor.isSupported&&(this._disposables.add(this._applicationActivityMonitor.isForeground.subscribe((function(e){r.recordForegroundChange(e)}))),this._disposables.add(this._networkMonitor.rtt.subscribe((function(e){r.recordNetworkRTTUpdate(e)}))),this._disposables.add(this._networkMonitor.effectiveType.subscribe((function(e){r.recordNetworkTypeChangeUpdate(e)}))),this._disposables.add(this._networkMonitor.downlinkThroughputCapacity.subscribe((function(e){r.recordNetworkDownlinkThroughputCapacityUpdate(e)}))))}return u()(e,[{key:"listenOnStreamSetup",value:function(){return new L(this._pageLoadTime)}},{key:"dispose",value:function(){this._disposables.dispose()}},{key:"recordForegroundChange",value:function(e){var t=Date.now(),n=this._applicationActivityMonitor.getTimeSinceLastChange();this._metricsService.push({metricType:e?S.Z.ApplicationForeground:S.Z.ApplicationBackground,runtime:(t-this._pageLoadTime)/1e3,value:{uint64:n}}),this._logger.info("Application has gone into the [%s] after [%s] ms",e?"foreground":"background",new C(n).toIsoString())}},{key:"recordNetworkRTTUpdate",value:function(e){var t=Date.now(),n=this._lastNetworkStatistics.rtt;this._lastNetworkStatistics.rtt=e,this._metricsService.push({metricType:S.Z.RoundTripTime,runtime:(t-this._pageLoadTime)/1e3,value:{uint64:e},previousValue:n?{uint64:n}:void 0,resource:"navigator"}),this._logger.info("[%s] Network RTT changed to [%s] from [%s]",new C(t-this._pageLoadTime).toIsoString(),e,n)}},{key:"recordNetworkTypeChangeUpdate",value:function(e){var t=Date.now(),n=this._lastNetworkStatistics.effectiveType;this._lastNetworkStatistics.effectiveType=e,this._metricsService.push({metricType:S.Z.NetworkType,runtime:(t-this._pageLoadTime)/1e3,value:{string:e},previousValue:n?{string:n}:void 0}),this._logger.info("[%s] Network effective type has changed to [%s] from [%s]",new C(t-this._pageLoadTime).toIsoString(),e,n)}},{key:"recordNetworkDownlinkThroughputCapacityUpdate",value:function(e){var t=Date.now(),n=this._lastNetworkStatistics.downlinkThroughputCapacity;this._lastNetworkStatistics.downlinkThroughputCapacity=e,this._metricsService.push({metricType:S.Z.DownlinkThroughputCapacity,runtime:(t-this._pageLoadTime)/1e3,value:{float:e},previousValue:n?{float:n}:void 0}),this._logger.info("[%s] Network downlink throughput capacity changed to [%s] from [%s]",new C(t-this._pageLoadTime).toIsoString(),e,n)}}]),e}();!function(e){e[e.Keep=0]="Keep",e[e.Reset=1]="Reset"}(r||(r={})),function(e){e[e.Normal=0]="Normal",e[e.Force=1]="Force",e[e.Reset=2]="Reset"}(i||(i={}));var Z=u()((function e(t){a()(this,e),d()(this,"token",void 0),d()(this,"tokenExpiring",void 0),this.token=new P.Z(t),this.tokenExpiring=new P.Z(!1)})),I=function(){function e(t){a()(this,e),d()(this,"channelInitialization",void 0),d()(this,"disposables",void 0),d()(this,"channelDisposables",void 0),d()(this,"rendererDisposables",void 0),d()(this,"videoElement",void 0),d()(this,"state",void 0),d()(this,"autoMuted",void 0),d()(this,"autoPaused",void 0),d()(this,"authorized",void 0),d()(this,"online",void 0),d()(this,"loading",void 0),d()(this,"playing",void 0),d()(this,"standby",void 0),d()(this,"stopped",void 0),d()(this,"targetLag",void 0),d()(this,"lag",void 0),d()(this,"bitrateLimit",void 0),d()(this,"resolution",void 0),d()(this,"failureCount",void 0),d()(this,"endPoint",void 0),d()(this,"stream",void 0),d()(this,"rtcStatistics",void 0),d()(this,"videoTelemetry",void 0),d()(this,"rtcAudioStatistic",void 0),d()(this,"rtcVideoStatistic",void 0),d()(this,"clearFailureCountTimeout",void 0),this.disposables=new k.Z,this.channelDisposables=new k.Z,this.rendererDisposables=new k.Z,this.channelInitialization=new Date,this.videoElement=new P.Z(null),this.state=new P.Z(_.Z.Starting),this.autoMuted=new P.Z(!1),this.autoPaused=new P.Z(!1),this.authorized=new P.Z(!0),this.online=new P.Z(!0),this.loading=new P.Z(!1),this.playing=new P.Z(!1),this.standby=new P.Z(!1),this.stopped=new P.Z(!1),this.targetLag=new P.Z(t),this.lag=new P.Z(0),this.bitrateLimit=new P.Z(0),this.resolution=new P.Z(m.empty),this.failureCount=new P.Z(0),this.endPoint=new P.Z(null),this.stream=new P.Z(null),this.rtcStatistics=new P.Z(null)}return u()(e,[{key:"streamId",get:function(){var e=this.stream.value;return e?e.streamId:"-"}},{key:"applyStatus",value:function(e){switch(e){case"ok":break;case"unauthorized":case"geo-restricted":case"geo-blocked":this.authorized.value=!1;case"no-stream":case"not-found":return this.failureCount.value=0,this.playing.value=!1,this.standby.value=!0,this.stopped.value=!1,void(this.stream.value=null);default:return this.failureCount.value++,this.playing.value=!1,this.standby.value=!0,this.stopped.value=!1,this.stream.value=null,void(this.state.value=_.Z.Error)}}},{key:"applySessionAndStreamPropertiesToVideoElement",value:function(){this.videoElement.value&&this.videoElement.value.dataset&&(this.videoElement.value.dataset.sessionId=y.Z.clientSessionId,this.videoElement.value.dataset.streamId=this.streamId)}},{key:"mapSubscribeStatusToChannelStatus",value:function(e){switch(e){case"ok":return _.Z.Starting;case"no-stream":case"not-found":return _.Z.StandBy;case"geo-restricted":return _.Z.GeoRestricted;case"geo-blocked":return _.Z.GeoBlocked;case"unauthorized":return _.Z.Unauthorized;case"capacity":case"rate-limited":case"timeout":return _.Z.Recovering;case"failed":return _.Z.Error;default:(0,b.Z)(e)}}}]),e}(),A=u()((function e(){a()(this,e),d()(this,"mediaStream",void 0),d()(this,"peerConnection",void 0),d()(this,"peerConnectionReconnectAttempts",void 0),this.mediaStream=new P.Z(null),this.peerConnection=new P.Z(null),this.peerConnectionReconnectAttempts=0})),D=u()((function e(){a()(this,e),d()(this,"isStarting",void 0),d()(this,"isDisposed",void 0),this.isStarting=new P.Z(!1),this.isDisposed=!1})),F=(n(6699),n(2023),n(4916),n(4723),n(1249),n(3123),n(4765),n(319)),j=n.n(F),M=n(8862),N=function(){function e(){a()(this,e)}return u()(e,null,[{key:"convertBitrateModeToBitrateModeType",value:function(e){switch(e){case i.Normal:return"Normal";case i.Force:return"Force";case i.Reset:return"Reset";default:(0,b.Z)(e)}}}]),e}(),U=function(){function e(){a()(this,e)}return u()(e,null,[{key:"convertBitrateStateToBitrateStateType",value:function(e){switch(e){case r.Keep:return"Keep";case r.Reset:return"Reset";default:(0,b.Z)(e)}}}]),e}(),V=n(202).default,B=function(){function e(t,n){if(a()(this,e),d()(this,"_logger",v.Z.getLogger("EndPoint")),d()(this,"_uri",void 0),d()(this,"_timeout",void 0),d()(this,"_roundTripTime",void 0),this._uri=t,this._timeout=n,!n)throw new Error("End point requires a timeout")}var t,n,r,i,o,s,c,h,f,g,m,y;return u()(e,[{key:"roundTripTime",get:function(){return this._roundTripTime}},{key:"toString",value:function(){return"EndPoint[uri=".concat(this._uri,"]")}},{key:"ping",value:(y=l()(p().mark((function e(){var t,n,r,i,o=this;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.buildPingUrl(),n=Date.now(),e.next=4,V.race([fetch(t,{method:"GET",cache:"no-cache"}),new V((function(e,n){return setTimeout((function(){return n(new Error("Ping timed out [".concat(t,"]")))}),o._timeout)}))]);case 4:if(r=e.sent,i=Date.now(),r.ok){e.next=8;break}throw new Error("Ping failed [".concat(t,"] [").concat(r.status,"]"));case 8:return this._roundTripTime=i-n,e.abrupt("return",this._roundTripTime);case 10:case"end":return e.stop()}}),e,this)}))),function(){return y.apply(this,arguments)})},{key:"subscribe",value:(m=l()(p().mark((function e(t,n,r){var i,o,a,s,u,c,l,h,d,f,v,g,m,y=this;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((i=x.Z.parseToken(t))&&i.applicationId){e.next=4;break}return this._logger.error("Failed to parse token [%s]",t),e.abrupt("return",{status:"unauthorized"});case 4:return o=i.applicationId,a=this.buildUrl([o,"stream","subscribe"]).toString(),s=new FormData,u=M.Z.sdkVersion,0===r&&n?(c={apiVersion:6,clientVersion:u,edgeAuthToken:t,failureCount:r,httpRoundTripTime:this._roundTripTime,setRemoteDescription:{apiVersion:6,sessionDescription:{type:this.convertRTCSdpTypeToSdpType(n.type),sdp:n.sdp}},createAnswerDescription:{apiVersion:6}},s.append("jsonBody",JSON.stringify(c))):(l={apiVersion:6,clientVersion:u,edgeAuthToken:t,failureCount:r,httpRoundTripTime:this._roundTripTime,createOfferDescription:{apiVersion:6}},s.append("jsonBody",JSON.stringify(l))),h=Date.now(),e.prev=10,f=null,e.next=14,V.race([fetch(a,{method:"POST",body:s}),new V((function(e){return f=window.setTimeout((function(){y._logger.error("Failed to subscribe",new Error("Subscribe timed out [".concat(a,"]"))),e({status:408})}),y._timeout)}))]).finally((function(){f&&clearTimeout(f)}));case 14:d=e.sent,e.next=21;break;case 17:return e.prev=17,e.t0=e.catch(10),this._logger.error("Failed to subscribe",e.t0),e.abrupt("return",{status:"failed"});case 21:if("ok"===(v=this.mapHttpStatusToSubscribeStatus(d))){e.next=24;break}return e.abrupt("return",{status:v});case 24:return g=Date.now(),e.next=27,this.convertHttpResponseToSubscribeResponse(o,d);case 27:return m=e.sent,this._logger.debug("Got subscribe response [%j] in [%s] ms",m,g-h),e.abrupt("return",m);case 30:case"end":return e.stop()}}),e,this,[[10,17]])}))),function(e,t,n){return m.apply(this,arguments)})},{key:"publish",value:(g=l()(p().mark((function e(t,n,r,i){var o,a,s,u,c,l,h,d,f,v,g,m,y,_=this;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((o=x.Z.parseToken(n))&&o.applicationId){e.next=4;break}return this._logger.error("Failed to parse token [%s]",n),e.abrupt("return",{status:"unauthorized"});case 4:return a=o.applicationId,s=this.buildUrl([a,"stream","publish"]).toString(),u=new FormData,c=M.Z.sdkVersion,0===i&&r?(l={apiVersion:6,clientVersion:c,edgeAuthToken:n,failureCount:i,httpRoundTripTime:this._roundTripTime,name:t,setRemoteDescription:{apiVersion:6,sessionDescription:{type:this.convertRTCSdpTypeToSdpType(r.type),sdp:r.sdp}},createAnswerDescription:{streamId:"",options:["upload"],apiVersion:6}},u.append("jsonBody",JSON.stringify(l))):(h={apiVersion:6,clientVersion:c,edgeAuthToken:n,failureCount:i,httpRoundTripTime:this._roundTripTime,name:t,createOfferDescription:{streamId:"",options:["upload"],apiVersion:6}},u.append("jsonBody",JSON.stringify(h))),d=Date.now(),e.prev=10,v=null,e.next=14,V.race([fetch(s,{method:"POST",body:u}),new V((function(e){return v=window.setTimeout((function(){_._logger.error("Failed to publish",new Error("Publish timed out [".concat(s,"]"))),e({status:408})}),_._timeout)}))]).finally((function(){v&&clearTimeout(v)}));case 14:f=e.sent,e.next=21;break;case 17:return e.prev=17,e.t0=e.catch(10),this._logger.error("Failed to publish",e.t0),e.abrupt("return",{status:"failed"});case 21:if("ok"===(g=this.mapHttpStatusToPublishStatus(f))){e.next=24;break}return e.abrupt("return",{status:g});case 24:return m=Date.now(),e.next=27,this.convertHttpResponseToPublishResponse(a,f);case 27:return y=e.sent,this._logger.debug("Got publish response [%j] in [%s] ms",y,m-d),e.abrupt("return",y);case 30:case"end":return e.stop()}}),e,this,[[10,17]])}))),function(e,t,n,r){return g.apply(this,arguments)})},{key:"setRemoteDescription",value:(f=l()(p().mark((function e(t,n){var r,i,o,a,s,u,c,l,h,d=this;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this.buildUrl([t.tenancy,"stream",t.streamId,"description","remote"]).toString(),i=new FormData,o={apiVersion:6,sharedSecret:t.sharedSecret,sessionDescription:{type:this.convertRTCSdpTypeToSdpType(n.type),sdp:n.sdp}},i.append("jsonBody",JSON.stringify(o)),a=Date.now(),e.prev=5,u=null,e.next=9,V.race([fetch(r,{method:"POST",body:i}),new V((function(e){return u=window.setTimeout((function(){d._logger.error("Failed to set remote description",new Error("Set remote description timed out [".concat(r,"]"))),e({status:408})}),d._timeout)}))]).finally((function(){u&&clearTimeout(u)}));case 9:s=e.sent,e.next=16;break;case 12:return e.prev=12,e.t0=e.catch(5),this._logger.error("Failed to set remote description",e.t0),e.abrupt("return",{status:"failed"});case 16:if("ok"===(c=this.mapHttpStatusToSetRemoteDescriptionStatus(s))){e.next=19;break}return e.abrupt("return",{status:c});case 19:return l=Date.now(),e.next=22,this.convertHttpResponseToSetRemoteDescriptionResponse(s);case 22:return h=e.sent,this._logger.debug("Got set remote description response [%j] in [%s] ms",h,l-a),e.abrupt("return",h);case 25:case"end":return e.stop()}}),e,this,[[5,12]])}))),function(e,t){return f.apply(this,arguments)})},{key:"limitBitrate",value:(h=l()(p().mark((function e(t,n,r,i,o){var a,s,u,c,l,h,d,f,v=this;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=this.buildUrl([t.tenancy,"stream",t.streamId,"bitrate"]).toString(),s=new FormData,u={apiVersion:6,sharedSecret:t.sharedSecret,elapsedInMilliseconds:n,bitrateInBitsPerSecond:r,bitrateState:U.convertBitrateStateToBitrateStateType(i),bitrateMode:N.convertBitrateModeToBitrateModeType(o)},s.append("jsonBody",JSON.stringify(u)),c=Date.now(),e.prev=5,h=null,e.next=9,V.race([fetch(a,{method:"POST",body:s}),new V((function(e){return h=window.setTimeout((function(){v._logger.error("Failed to set limit bitrate timed",new Error("Set limit bitrate timed out [".concat(a,"]"))),e({status:408})}),v._timeout)}))]).finally((function(){h&&clearTimeout(h)}));case 9:l=e.sent,e.next=16;break;case 12:return e.prev=12,e.t0=e.catch(5),this._logger.error("Failed to set limit bitrate timed",e.t0),e.abrupt("return",{status:"failed"});case 16:return d=this.mapHttpStatusToSetTemporaryMaximalBitrateStatus(l),f=Date.now(),this._logger.info("Got set limit bitrate response [%s] in [%s] ms",d,f-c),e.abrupt("return",{status:d});case 20:case"end":return e.stop()}}),e,this,[[5,12]])}))),function(e,t,n,r,i){return h.apply(this,arguments)})},{key:"addIceCandidates",value:(c=l()(p().mark((function e(t,n,r){var i,o,a,s,u,c,l,h,d,f,v=this,g=arguments;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=g.length>3&&void 0!==g[3]?g[3]:[],o=this.buildUrl([t.tenancy,"stream",t.streamId,"ice","candidates"]).toString(),a=new FormData,s={apiVersion:6,sharedSecret:t.sharedSecret,candidates:n,discoveryCompleted:r,options:i},a.append("jsonBody",JSON.stringify(s)),u=Date.now(),e.prev=6,l=null,e.next=10,V.race([fetch(o,{method:"POST",body:a}),new V((function(e){return l=window.setTimeout((function(){v._logger.error("Failed to add ice candidates",new Error("Add ice candidates timed out [".concat(o,"]"))),e({status:408})}),v._timeout)}))]).finally((function(){l&&clearTimeout(l)}));case 10:c=e.sent,e.next=17;break;case 13:return e.prev=13,e.t0=e.catch(6),this._logger.error("Failed to add ice candidates",e.t0),e.abrupt("return",{status:"failed"});case 17:if("ok"===(h=this.mapHttpStatusToAddIceCandidatesStatus(c))){e.next=20;break}return e.abrupt("return",{status:h});case 20:return d=Date.now(),e.next=23,this.convertHttpResponseToAddIceCandidatesResponse(c);case 23:return f=e.sent,this._logger.info("Got add ICE candidates response [%j] in [%s] ms",f,d-u),e.abrupt("return",f);case 26:case"end":return e.stop()}}),e,this,[[6,13]])}))),function(e,t,n){return c.apply(this,arguments)})},{key:"destroyStream",value:(s=l()(p().mark((function e(t,n){var r,i,o,a,s,u,c,l,h,d=this;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this.buildUrl([t.tenancy,"stream",t.streamId,"destroy"]).toString(),i=new FormData,o={apiVersion:6,sharedSecret:t.sharedSecret,reason:n,options:[]},i.append("jsonBody",JSON.stringify(o)),a=Date.now(),e.prev=5,u=null,e.next=9,V.race([fetch(r,{method:"POST",body:i,cache:"no-cache"}),new V((function(e){return u=window.setTimeout((function(){d._logger.error("Failed to subscribe",new Error("Delete stream timed out [".concat(r,"]"))),e({status:408})}),d._timeout)}))]).finally((function(){u&&clearTimeout(u)}));case 9:s=e.sent,e.next=16;break;case 12:return e.prev=12,e.t0=e.catch(5),this._logger.error("Failed to delete stream",e.t0),e.abrupt("return",{status:"failed"});case 16:if("ok"===(c=this.mapHttpStatusToSetDestroyStreamStatus(s))){e.next=19;break}return e.abrupt("return",{status:c});case 19:return l=Date.now(),e.next=22,this.convertHttpResponseToDestroyStreamResponse(s);case 22:return h=e.sent,this._logger.info("Got destroy stream response [%j] in [%s] ms",h,l-a),e.abrupt("return",h);case 25:case"end":return e.stop()}}),e,this,[[5,12]])}))),function(e,t){return s.apply(this,arguments)})},{key:"buildUrl",value:function(e){var t=new URL(this._uri),n=t.pathname.split("/");return n.length=n.length-1,t.pathname=n.concat.apply(n,j()(e)).join("/"),t}},{key:"buildPingUrl",value:function(){var e=new URL(this._uri),t=M.Z.sdkVersion;return e.search="?".concat(new URLSearchParams([["type","http"],["version",t],["_","".concat(Date.now())]]).toString()),e.toString()}},{key:"mapHttpStatusToPublishStatus",value:function(e){if(!e)return"failed";switch(e.status){case 200:return"ok";case 401:return"unauthorized";case 402:return"geo-restricted";case 403:return"geo-blocked";case 408:return"timeout";case 503:return"capacity";case 504:return"rate-limited";default:return"failed"}}},{key:"mapHttpStatusToSubscribeStatus",value:function(e){if(!e)return"failed";switch(e.status){case 200:return"ok";case 401:return"unauthorized";case 402:return"geo-restricted";case 403:return"geo-blocked";case 408:return"timeout";case 503:return"capacity";case 504:return"rate-limited";default:return"failed"}}},{key:"mapHttpStatusToSetRemoteDescriptionStatus",value:function(e){if(!e)return"failed";switch(e.status){case 200:return"ok";case 401:return"unauthorized";case 408:return"timeout";case 503:return"capacity";case 504:return"rate-limited";default:return"failed"}}},{key:"mapHttpStatusToSetTemporaryMaximalBitrateStatus",value:function(e){if(!e)return"failed";switch(e.status){case 200:return"ok";case 401:return"unauthorized";case 408:return"timeout";case 503:return"capacity";case 504:return"rate-limited";default:return"failed"}}},{key:"mapHttpStatusToAddIceCandidatesStatus",value:function(e){if(!e)return"failed";switch(e.status){case 200:return"ok";case 401:return"unauthorized";case 408:return"timeout";case 503:return"capacity";case 504:return"rate-limited";default:return"failed"}}},{key:"mapHttpStatusToSetDestroyStreamStatus",value:function(e){if(!e)return"failed";switch(e.status){case 200:return"ok";case 401:return"unauthorized";case 408:return"timeout";case 503:return"capacity";case 504:return"rate-limited";default:return"failed"}}},{key:"convertHttpResponseToSubscribeResponse",value:(o=l()(p().mark((function e(t,n){var r,i;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.json();case 2:return r=e.sent,(i={status:r.status}).stream={tenancy:t,streamId:r.streamId,sharedSecret:r.sharedSecret},i.lag=r.lag,r&&(r.rtcConfiguration&&(i.rtcConfiguration=this.convertIRtcConfigurationToRTCConfiguration(r.rtcConfiguration)),r.setRemoteDescriptionResponse&&r.setRemoteDescriptionResponse.sessionDescription&&(i.setRemoteDescriptionResponse={sessionDescription:this.convertISessionDescriptionToRTCSessionDescription(r.setRemoteDescriptionResponse.sessionDescription)}),r.createAnswerDescriptionResponse&&r.createAnswerDescriptionResponse.sessionDescription&&(i.createAnswerDescriptionResponse={sessionDescription:this.convertISessionDescriptionToRTCSessionDescription(r.createAnswerDescriptionResponse.sessionDescription)}),r.createOfferDescriptionResponse&&r.createOfferDescriptionResponse.sessionDescription&&(i.createOfferDescriptionResponse={sessionDescription:this.convertISessionDescriptionToRTCSessionDescription(r.createOfferDescriptionResponse.sessionDescription)})),e.abrupt("return",i);case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return o.apply(this,arguments)})},{key:"convertHttpResponseToPublishResponse",value:(i=l()(p().mark((function e(t,n){var r,i;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.json();case 2:return r=e.sent,(i={status:r.status}).stream={tenancy:t,streamId:r.streamId,sharedSecret:r.sharedSecret},r&&(r.rtcConfiguration&&(i.rtcConfiguration=this.convertIRtcConfigurationToRTCConfiguration(r.rtcConfiguration)),r.setRemoteDescriptionResponse&&r.setRemoteDescriptionResponse.sessionDescription&&(i.setRemoteDescriptionResponse={sessionDescription:this.convertISessionDescriptionToRTCSessionDescription(r.setRemoteDescriptionResponse.sessionDescription)}),r.createAnswerDescriptionResponse&&r.createAnswerDescriptionResponse.sessionDescription&&(i.createAnswerDescriptionResponse={sessionDescription:this.convertISessionDescriptionToRTCSessionDescription(r.createAnswerDescriptionResponse.sessionDescription)}),r.createOfferDescriptionResponse&&r.createOfferDescriptionResponse.sessionDescription&&(i.createOfferDescriptionResponse={sessionDescription:this.convertISessionDescriptionToRTCSessionDescription(r.createOfferDescriptionResponse.sessionDescription)})),e.abrupt("return",i);case 7:case"end":return e.stop()}}),e,this)}))),function(e,t){return i.apply(this,arguments)})},{key:"convertIRtcConfigurationToRTCConfiguration",value:function(e){var t={};if(e.bundlePolicy)switch(e.bundlePolicy){case"BundlePolicyBalanced":t.bundlePolicy="balanced";break;case"BundlePolicyMaxCompat":t.bundlePolicy="max-compat";break;case"BundlePolicyMaxBundle":t.bundlePolicy="max-bundle";break;default:(0,b.Z)(e.bundlePolicy)}if("number"==typeof e.iceCandidatePoolSize&&(t.iceCandidatePoolSize=e.iceCandidatePoolSize),e.iceServers){for(var n=[],r=0;r<e.iceServers.length;r++)n.push({urls:e.iceServers[r].urls,username:e.iceServers[r].username,credential:e.iceServers[r].credential});t.iceServers=n}if(e.iceTransportPolicy)switch(e.iceTransportPolicy){case"IceTransportPolicyAll":t.iceTransportPolicy="all";break;case"IceTransportPolicyRelay":t.iceTransportPolicy="relay";break;case"IceTransportPolicyPublic":break;default:(0,b.Z)(e.iceTransportPolicy)}if(e.peerIdentity&&(t.peerIdentity=e.peerIdentity),e.rtcpMuxPolicy)switch(e.rtcpMuxPolicy){case"RtcpMuxPolicyNegotiate":t.rtcpMuxPolicy="negotiate";break;case"RtcpMuxPolicyRequire":t.rtcpMuxPolicy="require";break;default:(0,b.Z)(e.rtcpMuxPolicy)}return t}},{key:"convertISessionDescriptionToRTCSessionDescription",value:function(e){var t={sdp:e.sdp};switch(e.type){case"Offer":t.type="offer";break;case"Answer":t.type="answer";break;default:(0,b.Z)(e.type)}return t}},{key:"convertHttpResponseToSetRemoteDescriptionResponse",value:(r=l()(p().mark((function e(t){var n,r;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.json();case 2:return n=e.sent,r={status:n.status},n&&n.sessionDescription&&(r.sessionDescription=this.convertISessionDescriptionToRTCSessionDescription(n.sessionDescription)),e.abrupt("return",r);case 6:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"convertHttpResponseToAddIceCandidatesResponse",value:(n=l()(p().mark((function e(t){var n,r;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.json();case 2:return n=e.sent,r={status:n.status,options:[]},n&&n.options&&(r.options=n.options),e.abrupt("return",r);case 6:case"end":return e.stop()}}),e)}))),function(e){return n.apply(this,arguments)})},{key:"convertHttpResponseToDestroyStreamResponse",value:(t=l()(p().mark((function e(t){var n,r;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.json();case 2:return n=e.sent,r={status:n.status},e.abrupt("return",r);case 5:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})},{key:"convertRTCSdpTypeToSdpType",value:function(e){switch(e){case"answer":return"Answer";case"offer":return"Offer";case"pranswer":case"rollback":throw new Error("SDP type [".concat(e,"] is not supported"));default:(0,b.Z)(e)}}}]),e}(),G=n(5564),H=n(6062),z=n(202).default,W=function(){function e(t){if(a()(this,e),d()(this,"_logger",v.Z.getLogger("Discovery")),d()(this,"_metricsService",void 0),d()(this,"_uri",void 0),!t)throw new Error("Discovery requires uri");this._metricsService=H.Z.getMetricsService(t.toString()),this._uri=t}var t,n;return u()(e,[{key:"discoverNearbyEndPoints",value:(n=l()(p().mark((function e(t,n){var r,i,o,a;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n){e.next=2;break}throw new Error("Discovery requires timeout");case 2:return r=t.toString(),e.next=5,z.race([fetch(r,{method:"GET",cache:"no-cache"}),new z((function(e,t){return setTimeout((function(){return t(new Error("Discovery timed out [".concat(r,"]")))}),n)}))]);case 5:if((i=e.sent).ok){e.next=8;break}throw new Error("Discovery failed [".concat(r,"] [").concat(i.status,"]"));case 8:if(null!==i.body){e.next=10;break}throw new Error("Discovery failed with no data [".concat(r,"]"));case 10:return e.next=12,i.text();case 12:return o=e.sent,a=o.split(","),e.abrupt("return",a.map((function(e){return new B(e,n)})));case 15:case"end":return e.stop()}}),e)}))),function(e,t){return n.apply(this,arguments)})},{key:"discoverClosestEndPoint",value:(t=l()(p().mark((function e(){var t,n,r,i,o,a=this,s=arguments;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=s.length>0&&void 0!==s[0]?s[0]:2e4,n=G.Z.buildDiscoveryUrl(this._uri),e.next=4,this.discoverNearbyEndPoints(new URL(n),t);case 4:return r=e.sent,i=function(){return new z((function(){a._logger.info("Request [%s] failed, preventing it from completing",n)}))},e.next=8,z.race(r.map((function(e){return e.ping().catch((function(t){return a._logger.warn("Failed to ping end point [%s]",e,t),i()})).then((function(t){var n=Date.now();return a._logger.info("Discovered end point [%s] with time [%s]",e.toString(),t),a._metricsService.push({metricType:S.Z.RoundTripTime,runtime:(n-y.Z.pageLoadTime)/1e3,value:{uint64:t||0},resource:e.toString(),kind:"ping"}),e}))})));case 8:return o=e.sent,e.abrupt("return",o);case 10:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}(),q=function(){function e(){throw a()(this,e),new Error("Discovery is a static class that may not be instantiated")}var t,n;return u()(e,null,[{key:"precacheClosestEndPointDiscovery",value:(n=l()(p().mark((function t(){var n;return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=new URL(y.Z.discoveryUri.value),t.abrupt("return",e.discoverClosestEndPointWithCaching(n));case 2:case"end":return t.stop()}}),t)}))),function(){return n.apply(this,arguments)})},{key:"discoverClosestEndPointWithCaching",value:(t=l()(p().mark((function t(n){var r,i,o;return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=n.toString(),!e._cache[r]){t.next=3;break}return t.abrupt("return",e._cache[r]);case 3:return i=new W(n),o=e._cache[r]=i.discoverClosestEndPoint(),e._cache[r].then((function(){setTimeout((function(){e._cache[r]===o&&delete e._cache[r]}),6e4)})).catch((function(t){throw delete e._cache[r],t})),t.abrupt("return",o);case 7:case"end":return t.stop()}}),t)}))),function(e){return t.apply(this,arguments)})}]),e}();d()(q,"_cache",{}),q.precacheClosestEndPointDiscovery(),n(2526),n(1817),n(1058),n(5306),n(2772),n(9826),n(4553),n(561),n(8309),n(9601);var J,$=n(9845),K=n(4827),X={width:480,height:360,videoWidth:480,videoHeight:360,muted:!1,volume:1,currentTime:0,duration:1/0,readyState:0,ended:!1,buffered:null,autoplay:!0},Y="Edge"===$.Z.browserName,Q=function(){function e(t,n,r){var i=this;a()(this,e),d()(this,"_logger",v.Z.getLogger("FlashPlayer")),d()(this,"_isVideo",void 0),d()(this,"_swfSrc",void 0),d()(this,"_id",void 0),d()(this,"_width",void 0),d()(this,"_height",void 0),d()(this,"_ghost",void 0),d()(this,"_element",void 0),d()(this,"_eventDisposables",void 0),d()(this,"_disposables",new k.Z),d()(this,"_flashVars",void 0),d()(this,"_isFullscreen",void 0),this._isVideo="video"===t.tagName,this._swfSrc=r.swfSrc,this._id=t.id||r.streamId,this._width=t.clientWidth,this._height=t.clientHeight,this._ghost=t,this._element=null,this._eventDisposables=[],this._flashVars=["uid="+this._id,"autoplay=".concat(!!t.autoplay),"muted=".concat(!!t.muted),"allowScriptAccess=always","preload=true","src=".concat(JSON.stringify(n))],this._disposables.add(new w.Z((function(){i.triggerFlashEvent("fire_stop")})));try{this._element=Y?this.createMicrosoftFlashElement():this.setupCrossBrowserFlashElement(),this.setupElement()}catch(e){this._logger.error("Error while loading Flash Player "+e)}}return u()(e,[{key:"element",get:function(){return this._element}},{key:"addEventListener",value:function(e,t){if(!(this.findEventListenerIndex(e,t)>-1)){document.addEventListener(e,t);var n=new w.Z((function(){document.removeEventListener(e,t)}));this._disposables.add(n),this._eventDisposables.push({name:e,listener:t,disposable:n})}}},{key:"removeEventListener",value:function(e,t){var n=this.findEventListenerIndex(e,t);n>-1&&this._eventDisposables.splice(n,1)[0].disposable.dispose()}},{key:"triggerFlashEvent",value:function(e,t){var n=this._element[e];if(n)return n.apply(this._element,t)}},{key:"dispose",value:function(){this._disposables.dispose()}},{key:"createMicrosoftFlashElement",value:function(){return document.createElement("div")}},{key:"setupCrossBrowserFlashElement",value:function(){var e=document.createElement("embed");return e.setAttribute("id",this._id),e.setAttribute("name","__"+this._id),e.setAttribute("play","true"),e.setAttribute("loop","false"),e.setAttribute("quality","high"),e.setAttribute("bgcolor","#000000"),e.setAttribute("wmode","transparent"),e.setAttribute("allowScriptAccess","always"),e.setAttribute("allowFullScreen","true"),e.setAttribute("type","application/x-shockwave-flash"),e.setAttribute("pluginspage","//www.macromedia.com/go/getflashplayer"),e.setAttribute("src",this._swfSrc),e.setAttribute("flashvars",this._flashVars.join("&")),this._isVideo&&(e.setAttribute("width",this._width.toString()),e.setAttribute("height",this._height.toString())),e}},{key:"createParameterElement",value:function(e,t){var n=document.createElement("param");return n.setAttribute("name",e),n.setAttribute("value",t),n}},{key:"setupElement",value:function(){this._element=Object.assign(this._element,X,{id:this._id,width:this._width,height:this._height,videoWidth:this._width,videoHeight:this._height}),this.setupAccessors(),this.propagateAttributeChanges(),this.setupVolumeAndMutedListeners()}},{key:"createEvent",value:function(e,t){var n=e.match(/([a-z]+\.([a-z]+))/i),r={target:t,namespace:""};if(null!==n&&(e=n[1],r.namespace=n[2]),"IE"===$.Z.browserName&&$.Z.browserMajorVersion>8){var i=window.document.createEvent("CustomEvent");return i.initCustomEvent(e,!1,!1,r),i}return window.CustomEvent?new window.CustomEvent(e,{detail:r}):r}},{key:"getValueFromFlash",value:function(e){return(this._element["get_"+e]||function(){return null}).call(this._element)}},{key:"setupAccessors",value:function(){var e=this;window["__event__"+this._id]=function(t,n){var r=e.createEvent(t,e._element);if(n)try{r.data=JSON.parse(n),r.details.data=r.data}catch(e){r.message=n}switch(t){case"ended":e._element.ended=!0,e._element.dispatchEvent(r);break;case"error":e._element.error=r.data,e._element.dispatchEvent&&e._element.dispatchEvent(new Error(n));break;case"loadeddata":case"loadedmetadata":case"loadstart":case"progress":case"seeked":case"seeking":case"stalled":case"suspend":e._element.dispatchEvent&&e._element.dispatchEvent(r);break;case"pause":e._element.paused=!0;break;case"play":case"playing":e._element.paused=!1;break;case"timeupdate":e._element.currentTime=e.getValueFromFlash("currentTime"),e._element.dispatchEvent&&e._element.dispatchEvent(r)}e._element.dispatchEvent(r)};var t=this._element.requestFullscreen||this._element.mozRequestFullScreen||this._element.webkitRequestFullScreen||this._element.msRequestFullscreen;this._disposables.add(new w.Z((function(){delete window["__event__"+e._id]}))),this._element.play=function(){e.triggerFlashEvent("fire_play")},this._element.load=function(){e.triggerFlashEvent("fire_load")},this._element.seek=function(){e.triggerFlashEvent("fire_seek")},this._element.pause=function(){e.triggerFlashEvent("fire_pause")},this._element.requestFullscreen=function(){if(this._isFullscreen=!0,this.addListenerForExitFullScreen(),this._previousHeight=this._element.style.height,this._previousWidth=this._element.style.width,this._previousPosition=this._element.style.position,this._element.style.position="absolute",this._element.style.height="100%",this._element.style.width="100%",void 0!==window.ActiveXObject){var e=new window.ActiveXObject("WScript.Shell");null!==e&&e.SendKeys("{F11}")}t.call(this._element)};var n=function(){e.triggerFlashEvent("set_size",[e._isFullscreen?screen.width:e._element.clientWidth,e._isFullscreen?screen.height:e._element.clientHeight])};window.addEventListener("resize",n),this._disposables.add(new w.Z((function(){window.removeEventListener("resize",n)})))}},{key:"finishInitializationInDom",value:function(){if(!Y)return this._element;var e=(Y?"__"+this._id:this._id)+K.Z.random(32),t=document.createElement("object"),n=document.createElement("div"),r=[this.createParameterElement("movie",this._swfSrc+"?x="+Date.now()),this.createParameterElement("flashvars",this._flashVars.join("&")),this.createParameterElement("quality","2"),this.createParameterElement("bgcolor","#000000"),this.createParameterElement("wmode","transparent"),this.createParameterElement("allowScriptAccess","always"),this.createParameterElement("allowFullScreen","true"),n];return n.innerHTML="You are using a browser this does not have Flash player enabled or installed. Please turn on your Flash player plugin or download the latest version from https://get.adobe.com/flashplayer/",Y?(t.setAttribute("type","application/x-shockwave-flash"),t.setAttribute("data",this._swfSrc),t.setAttribute("id",e),t.setAttribute("width","__"+this._width.toString()),t.setAttribute("height","__"+this._height.toString())):(t.setAttribute("classid","clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"),t.setAttribute("codebase","//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab"),t.setAttribute("id",e),t.setAttribute("width",this._width.toString()),t.setAttribute("height",this._height.toString())),"object"in t?(r.forEach((function(e){t.object[e.name]||"value"in e&&(t.object[e.name]=e.value)})),t.appendChild(n)):r.forEach((function(e){var n=t.children.find((function(t){return"name"in e&&t.name===e.name}));return n?t.replaceChild(e,n):t.appendChild(e)})),this._element.outerHTML=t.outerHTML,window.document.getElementById&&(this._element=window.document.getElementById(e),this.setupElement()),this._element}},{key:"propagateAttributeChanges",value:function(){var e=this,t=["currentTime","paused","error","src"];if(window.MutationObserver){var n=new MutationObserver((function(n){n.forEach((function(n){"attributes"!==n.type||n.target!==e._element||t.includes(n.attributeName)||e.setFlashValue(n.attributeName,e._element[n.attributeName])}))}));n.observe(this._element,{attributes:!0}),this._disposables.add(new w.Z((function(){n.disconnect()})))}else{this._logger.info("Falling back to use of DOM event listeners. This results in degraded performance for further DOM modifications and does not work for IE prior to version 9. See https://developer.mozilla.org/en-US/docs/Web/Guide/Events/Mutation_events for details.");var r=function(n){t.includes(n.target.tagName)||e.setFlashValue(n.target.tagName,e._element[n.target.tagName])};this._element.addEventListener?(this._element.addEventListener("DOMAttrModified",r,!1),this._disposables.add(new w.Z((function(){e._element.removeEventListener("DOMAttrModified",r,!1)})))):(this._element.attachEvent("onpropertychange",r),this._disposables.add(new w.Z((function(){e._element.detachEvent("DOMAttrModified",r)}))))}}},{key:"getElement",value:function(){return this._element}},{key:"setFlashValue",value:function(e,t){return(this._element["set_"+e]||function(){return null}).call(this._element,t)}},{key:"setupVolumeAndMutedListeners",value:function(){var e=this.getMutedListener(),t=this.getVolumeListener(),n=setInterval((function(){e(),t()}),300);this._disposables.add(new w.Z((function(){clearInterval(n)})))}},{key:"getMutedListener",value:function(){var e=this;if(!this._ghost||!this._element)return function(){return null};var t=this._ghost.muted,n=this._element.muted;return function(){var r=e._element.muted,i=e._element.muted;r===t&&i===n||(r!==t&&(t=r,n=r,i=r),i!==n&&(t=r,n=r),e._element.muted=i,e._ghost.muted=i,e.setFlashValue("muted",i))}}},{key:"getVolumeListener",value:function(){var e=this;if(!this._ghost||!this._element)return function(){return null};var t=this._ghost.volume,n=this._element.volume;return function(){var r=e._element.volume,i=e._element.volume;r===t&&i===n||(r!==t&&(t=r,n=r,i=r),i!==n&&(t=r,n=r),e._element.volume=i,e._ghost.volume=i,e.setFlashValue("volume",i))}}},{key:"findEventListenerIndex",value:function(e,t){return this._eventDisposables.findIndex((function(n){return n.name===e&&n.listener===t}))}}]),e}(),ee=function(){function e(t,n,r){var i=this;a()(this,e),d()(this,"_logger",v.Z.getLogger("PhenixFlashVideo")),d()(this,"_ghost",void 0),d()(this,"_stream",void 0),d()(this,"_options",void 0),d()(this,"_disposables",new k.Z),d()(this,"_flashPlayer",void 0),d()(this,"_loaded",void 0),d()(this,"_enabled",void 0),d()(this,"_onReady",void 0),d()(this,"_video",void 0),d()(this,"_ghostInitStyleCssText",void 0),this._ghost=t,this._stream=n,this._options=r||{},this._flashPlayer=null;var o=function(e){i._loaded=!0,i._enabled=!0===e,e?i.initialize():i._logger.error("Failed to create Phenix video element"),i._onReady&&i._onReady(i._enabled)};try{this._video=this.createPhenixFlashVideoElement(),this._video.className=this._ghost.className,this._video.height=this._ghost.height,this._video.width=this._ghost.width,this._ghostInitStyleCssText=this._ghost.style.cssText,this._ghost.style.cssText="visibility:hidden !important;width:0px !important;height:0px !important;margin:0px !important;padding:0px !important;border-style:none !important;border-width:0px !important;max-width:0px !important;max-height:0px !important;outline:none !important",this._disposables.add(new w.Z((function(){i._ghost.style.cssText=i._ghostInitStyleCssText}))),this._video.onunload=function(){this._loaded=!1},this.observeInsertion(),document.body&&document.body.contains||this._logger.info("document.body.contains is not supported"),document.body&&document.body.contains&&document.body.contains(this._ghost)&&(this._ghost.parentNode.replaceChild(this._video,this._ghost),this._flashPlayer&&(this._video=this._flashPlayer.finishInitializationInDom()),this._disposables.add(new w.Z((function(){i._video.parentNode&&i._video.parentNode.replaceChild(i._ghost,i._video)})))),setTimeout((function(){o(!0)}))}catch(e){this._logger.error("Error while loading Phenix RTC "+e),o(!1)}}return u()(e,[{key:"hookUpEvents",value:function(){var e=this,t=this._ghost,n=function(){e.dispatchEvent(t,"error")},r=function(){t.muted=e._video.muted,e.dispatchEvent(t,"mute")},i=function(){t.muted=e._video.muted,e.dispatchEvent(t,"unmute")},o=function(){t.ended=e._video.ended,e.dispatchEvent(t,"ended")},a=function(){t.width=e._video.width,t.height=e._video.height,e.dispatchEvent(t,"loadedmetadata")},s=function(){t.width=e._video.width,t.height=e._video.height,e.dispatchEvent(t,"loadeddata")},u=function(){t.width=e._video.width,t.height=e._video.height,e.dispatchEvent(t,"resize")};this.addEventListener("error",n),this.addEventListener("mute",r),this.addEventListener("unmute",i),this.addEventListener("ended",o),this.addEventListener("loadedmetadata",a),this.addEventListener("loadeddata",s),this.addEventListener("resize",u);var c=new w.Z((function(){e.removeEventListener("error",n),e.removeEventListener("mute",r),e.removeEventListener("unmute",i),e.removeEventListener("ended",o),e.removeEventListener("loadedmetadata",a),e.removeEventListener("loadeddata",s),e.removeEventListener("resize",u)}));this._disposables.add(c)}},{key:"getElement",value:function(){return this._video}},{key:"onReady",value:function(e){var t=this;this._loaded?setTimeout((function(){e(t._enabled)}),1):this._onReady=e}},{key:"dispose",value:function(){this._disposables.dispose()}},{key:"addEventListener",value:function(e,t){window.addEventListener(e,t)}},{key:"removeEventListener",value:function(e,t){window.removeEventListener(e,t)}},{key:"dispatchEvent",value:function(e,t){var n;document.createEvent?(n=document.createEvent("HTMLEvents")).initEvent(t,!0,!0):(n=document.createEventObject()).eventType=t,n.eventName=t,setTimeout((function(){document.createEvent?e.dispatchEvent(n):e.fireEvent("on"+n.eventType,n)}))}},{key:"createPhenixFlashVideoElement",value:function(){var e=this;return this._flashPlayer=new Q(this._ghost,this._stream,this._options),this._disposables.add(new w.Z((function(){e._flashPlayer.dispose()}))),this._flashPlayer.getElement()}},{key:"observeInsertion",value:function(){var e=this;if(window.MutationObserver){var t=new MutationObserver((function(t){t.forEach((function(t){if("childList"===t.type)for(var n=0;n<t.addedNodes.length;n++){var r=t.addedNodes[n];t.target!==e._video&&(r===e._ghost?(t.target.replaceChild(e._video,e._ghost),e.initialize()):e.isDescendant(t.target,e._ghost)&&(e._ghost.parentNode&&e._ghost.parentNode.replaceChild(e._video,e._ghost),e.initialize()))}}))}));t.observe(document.body,{childList:!0,attributes:!1,characterData:!1,subtree:!0}),this._disposables.add(new w.Z((function(){t.disconnect()})))}else{this._logger.info("Falling back to use of DOM event listeners. This results in degraded performance for further DOM modifications and does not work for IE prior to version 9. See https://developer.mozilla.org/en-US/docs/Web/Guide/Events/Mutation_events for details.");var n=function(){e._ghost.parentNode&&e._ghost.parentNode.replaceChild(e._video,e._ghost)};this.addEventListener("DOMNodeInserted",n),this._disposables.add(new w.Z((function(){e.removeEventListener("DOMNodeInserted",n)})))}}},{key:"initialize",value:function(){this.hookUpEvents(),this.propagateAttributeChanges(),this._video.id=this._ghost.id||this._video.id,this._video.style.cssText=this._ghostInitStyleCssText,this._video.className=this._ghost.className,this._video.innerHtml=this._ghost.innerHTML,this._video.width=this._ghost.width,this._video.height=this._ghost.height,this._video.autoplay=this._ghost.autoplay,this._video.muted=this._ghost.muted,this._video.defaultMuted=this._ghost.defaultMuted,this._video.volume=this._ghost.volume}},{key:"isDescendant",value:function(e,t){for(var n=t.parentNode;null!==n;){if(n===e)return!0;n=n.parentNode}return!1}},{key:"propagateAttributeChanges",value:function(){var e=this,t=["style"];if(window.MutationObserver){var n=new MutationObserver((function(n){n.forEach((function(n){"attributes"===n.type&&n.target===e._ghost&&-1===t.indexOf(n.attributeName)&&(e._video[n.attributeName]=e._ghost[n.attributeName])}))}));n.observe(this._ghost,{attributes:!0}),this._disposables.add(new w.Z((function(){n.disconnect()})))}else{this._logger.info("Falling back to use of DOM event listeners. This results in degraded performance for further DOM modifications and does not work for IE prior to version 9. See https://developer.mozilla.org/en-US/docs/Web/Guide/Events/Mutation_events for details.");var r=function(t){e._video[t.target.tagName]=e._ghost[t.target.tagName]};this._ghost.addEventListener?(this._ghost.addEventListener("DOMAttrModified",r,!1),this._disposables.add(new w.Z((function(){e._ghost.removeEventListener("DOMAttrModified",r,!1)})))):(this._ghost.attachEvent("onpropertychange",r),this._disposables.add(new w.Z((function(){e._ghost.detachEvent("DOMAttrModified",r)}))))}}}]),e}();!function(e){e[e.NetworkEmpty=0]="NetworkEmpty",e[e.NetworkIdle=1]="NetworkIdle",e[e.NetworkLoading=2]="NetworkLoading",e[e.NetworkNoSource=3]="NetworkNoSource"}(J||(J={}));var te="rtmp-flash-renderer-2019.2.18.swf",ne={local:"https://local.phenixrts.com/public/rtmp/"+te,staging:"https://stg.phenixrts.com/public/rtmp/"+te,production:"https://phenixrts.com/public/rtmp/"+te},re=function(){function e(t,n,r,i,o,s){a()(this,e),d()(this,"_logger",v.Z.getLogger("FlashPlayer")),d()(this,"_stopPlayer",void 0),d()(this,"_onStalled",void 0),d()(this,"_onEnded",void 0),d()(this,"_streamId",void 0),d()(this,"_streamsInfo",void 0),d()(this,"_swfSrc",void 0),d()(this,"_options",void 0),d()(this,"_phenixVideo",void 0),d()(this,"_playerElement",void 0),d()(this,"_originElement",void 0),d()(this,"_player",void 0),d()(this,"_hasFlashPlugin",void 0),d()(this,"_lastReloadTime",void 0);var u=ne[o.env||"staging"];this._streamId=r,this._streamsInfo=i.map((function(e){return e.uri=encodeURI(e.uri).replace(/[#]/g,"%23"),e})),this._options=o,this._phenixVideo=null,this._playerElement=null,this._player=null,this._originElement=t,this._onStalled=this.stalled.bind(this),this._onEnded=this.ended.bind(this),this._swfSrc=o.swfSrc||u,this._stopPlayer=s}return u()(e,[{key:"isSupported",value:function(){return this.detectFlashPlugin()}},{key:"start",value:function(){var e={streamId:this._streamId,swfSrc:this._swfSrc};return this._phenixVideo=new ee(this._originElement,this._streamsInfo,e),this._phenixVideo.hookUpEvents(),this._playerElement=this._phenixVideo.getElement(),this._playerElement&&this._playerElement.play(),this._playerElement.addEventListener("stalled",this._onStalled,!1),this._playerElement.addEventListener("pause",this._onStalled,!1),this._playerElement.addEventListener("suspend",this._onStalled,!1),this._playerElement.addEventListener("ended",this._onEnded,!1),this._playerElement}},{key:"dispose",value:function(){var e=this;if(this._phenixVideo){var t=function(){e._playerElement&&(e._playerElement.removeEventListener("stalled",e._onStalled,!1),e._playerElement.removeEventListener("pause",e._onStalled,!1),e._playerElement.removeEventListener("suspend",e._onStalled,!1),e._playerElement.removeEventListener("ended",e._onEnded,!1)),e._playerElement=null,e._originElement=null};try{this._phenixVideo.dispose(),this._phenixVideo=null,t(),this._logger.info("[%s] Flash player has been destroyed",this._streamId)}catch(e){this._logger.error("[%s] Error while destroying Flash player [%s]",this._streamId,e.code,e),t()}}}},{key:"getStats",value:function(){var e={width:0,height:0,currentTime:0,lag:0,networkState:J.NetworkNoSource};if(!this._playerElement)return e;e.currentTime=this._playerElement.currentTime;var t=(Date.now()-this._options.originStartTime)/1e3;return e.lag=Math.max(0,t-e.currentTime),e}},{key:"getPlayer",value:function(){return this._playerElement}},{key:"reload",value:function(){this._phenixVideo.dispose(),this.start()}},{key:"detectFlashPlugin",value:function(){var e=[10,0,0],t="Shockwave Flash",n="application/x-shockwave-flash",r=["0","0","0"];if("boolean"==typeof this._hasFlashPlugin)return this._hasFlashPlugin;if(window.navigator&&window.navigator.plugins&&window.navigator.plugins[t]){var i=window.navigator.plugins[t].description;if(i&&window.navigator.mimeTypes&&window.navigator.mimeTypes[n]&&!window.navigator.mimeTypes[n].enabledPlugin)for(var o=0,a=(r=i.replace(t,"").replace(/^\s+/,"").replace(/\sr/gi,".").split(".")).length;o<a;o++)r[o]=parseInt(r[o].match(/\d+/),10)}else if(window.ActiveXObject)try{var s=new window.ActiveXObject("ShockwaveFlash.ShockwaveFlash");if(s){var u=(s.GetVariable("$version")||"").split(" ")[1].version.split(",");r=[parseInt(u[0],10),parseInt(u[1],10),parseInt(u[2],10)]}}catch(e){console.error(e)}return this._hasFlashPlugin=r[0]>e[0]||r[0]===e[0]&&r[1]>0||r[0]===e[0]&&0===r[1]&&r[2]>=0,this._hasFlashPlugin}},{key:"stalled",value:function(){var e=this;this._logger.info("[%s] Loading flash player stalled caused by [%s] event.",this._streamId,event.type);var t=this._playerElement.currentTime;setTimeout((function(){e._playerElement&&e._playerElement.currentTime===t&&!e._playerElement.paused&&e.canReload()&&(e._logger.warn("Reloading stream after being stalled for [%s] seconds",6),e.reloadIfAble())}),6e3)}},{key:"ended",value:function(){this._logger.info("[%s] Flash player ended.",this._streamId),this._stopPlayer()}},{key:"canReload",value:function(){var e=!this._lastReloadTime||Date.now()-this._lastReloadTime>15e3;return this._playerElement&&0!==this._playerElement.buffered.length&&e}},{key:"reloadIfAble",value:function(){this.canReload()&&(this._logger.warn("Reloading unhealthy stream that was active for at least [%s] seconds",15),this._lastReloadTime=Date.now(),this.reload())}}]),e}(),ie=n(4146),oe=function(){function e(t,n){a()(this,e),d()(this,"_logger",v.Z.getLogger("RtmpStream")),d()(this,"_channelContext",void 0),d()(this,"_monitorDisposables",new k.Z),d()(this,"_handleStreamFailure",void 0),d()(this,"_originElement",void 0),d()(this,"_monitorFailureCount",0),this._channelContext=t,this._handleStreamFailure=n,this._channelContext.disposables.add(this)}return u()(e,[{key:"start",value:function(e,t){var n=this;return q.discoverClosestEndPointWithCaching(e).then((function(e){return n._channelContext.online.value=!0,n._channelContext.endPoint.value=e,n._logger.info("Connecting to [%s]",e.toString()),e.subscribe(t,null,n._channelContext.failureCount.value)})).then((function(e){var t=e.status,r=e.stream,i=e.createOfferDescriptionResponse,o=e.lag;if(n._channelContext.stream.value=r,n._channelContext.lag.value=o,n._channelContext.applySessionAndStreamPropertiesToVideoElement(),n._logger.debug("[%s] Subscribe completed [%s] [%j]",n._channelContext.streamId,t,i),n._channelContext.state.value=n._channelContext.mapSubscribeStatusToChannelStatus(t),n._channelContext.applyStatus(t),"ok"===t){var a=i.sessionDescription.sdp,s={originStartTime:Date.now()-o+n._channelContext.endPoint.value.roundTripTime/2,lag:o},u=a.match(/a=x-rtmp:(rtmp:\/\/[^\n]*)/m),c=u&&u[1]?u[1]:"";if(!c)throw n._channelContext.state.value=ie.ChannelState.Error,new Error("No RTMP URL provided in SDP");var l=c,h=l.match(/(rtmp:\/\/[^\n\s]*)/)[0]||"",d=l.match(/bitrate=([^\n\s;]*)/)[1],f=l.match(/resolution=([^\n\s;]*)/)[1],p=new re(n._channelContext.videoElement.value,"rtmp",n._channelContext.streamId,[{uri:h,bitrate:d,resolution:f}],s,(function(){return n.onEnded(p)}));n._originElement=n._channelContext.videoElement.value,n.monitor(p),p.start(),n._channelContext.videoElement.value=p.getPlayer()}}))}},{key:"onEnded",value:function(e){var t=this;this._channelContext.state.value=ie.ChannelState.Error,this._channelContext.videoElement.value=this._originElement,this._channelContext.playing.value=!1,this._channelContext.loading.value=!0,e.dispose(),this._monitorDisposables.dispose(),this._handleStreamFailure().catch((function(e){t._logger.error("Failed handling stream failure",e)}))}},{key:"monitor",value:function(e){var t=this;this._monitorDisposables.dispose();var n=e.getPlayer(),r=window.setTimeout((function(){var n=e.getStats();if(isNaN(n.currentTime)){if(t._monitorFailureCount++,t._monitorFailureCount>6)return t._monitorFailureCount=0,void t.onEnded(e)}else t._monitorFailureCount=0;t.monitor(e)}),1e3);n&&n.paused&&this._channelContext.state.value===ie.ChannelState.Playing&&(this._channelContext.state.value=ie.ChannelState.Paused),n&&!n.paused&&this._channelContext.state.value!==ie.ChannelState.Playing&&(this._channelContext.state.value=ie.ChannelState.Playing),this._monitorDisposables.add(new w.Z((function(){clearTimeout(r)})))}},{key:"dispose",value:function(){this._monitorDisposables.dispose()}}]),e}(),ae=n(1228);function se(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ue(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?se(Object(n),!0).forEach((function(t){d()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):se(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ce=function(){function e(t,n,r,i,o){a()(this,e),d()(this,"_logger",v.Z.getLogger("WebPlayer")),d()(this,"_videoElement",void 0),d()(this,"_kind",void 0),d()(this,"_streamId",void 0),d()(this,"_manifestURI",void 0),d()(this,"_options",void 0),d()(this,"_player",void 0),d()(this,"_lastReloadTime",void 0),this._videoElement=t,this._kind=n,this._streamId=r,this._manifestURI=encodeURI(i).replace(/[#]/g,"%23"),this._options=o}return u()(e,[{key:"start",value:function(){var e=this;if(me.phenixWebPlayer){var t=ue(ue({},this._options),{},{bandwidthToStartAt:3e6});return this._player=new me.phenixWebPlayer.WebPlayer(this._logger,this._videoElement,t),this._player.start(this._manifestURI),void this._player.addEventListener("error",(function(t){e.canReload()&&t&&(3===t.code||t.severity===me.phenixWebPlayer.errors.severity.RECOVERABLE)&&(e._logger.warn("Reloading unhealthy stream after error event [%j]",t),e.reloadIfAble()),e._logger.error("Cannot reload with error [%j]",t)}))}}},{key:"isSupported",value:function(){return me.phenixWebPlayer&&me.phenixWebPlayer.isSupported}},{key:"getStats",value:function(){if(!this._player)return{width:0,height:0,currentTime:0,lag:0,networkState:J.NetworkNoSource,dataBuffered:0};var e=this._player.getStats(),t=e.currentTime||this._videoElement.currentTime,n=(Date.now()-this._options.originStartTime)/1e3;return this._videoElement.buffered&&this._videoElement.buffered.length&&(e.dataBuffered=this._videoElement.buffered.end(0)),e.isNative&&"Hls"===e.deliveryType&&(e.currentTime=t-e.lag),e.currentTime||(e.currentTime=t),e.isNative||(e.lag=Math.max(0,n-t)),e.estimatedBandwidth>0?e.networkState=J.NetworkLoading:e.playTime>0?e.networkState=J.NetworkIdle:e.video?e.networkState=J.NetworkEmpty:e.networkState=J.NetworkNoSource,e}},{key:"dispose",value:function(){this._player&&this._player.dispose(),this._player=null}},{key:"canReload",value:function(){var e=!this._lastReloadTime||Date.now()-this._lastReloadTime>15e3;return this._videoElement&&this._player&&0!==this._videoElement.buffered.length&&e}},{key:"reloadIfAble",value:function(){this.canReload()&&(this._logger.warn("[%s] Reloading unhealthy stream that was active for at least [%s] seconds",this._streamId,15),this._lastReloadTime=Date.now(),this.reload())}},{key:"reload",value:function(){this._player.dispose(),this._player=null,this.start()}}]),e}();function le(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function he(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?le(Object(n),!0).forEach((function(t){d()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):le(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var de=function(){function e(t,n,r,i,o){a()(this,e),d()(this,"_logger",v.Z.getLogger("ShakaPlayer")),d()(this,"_videoElement",void 0),d()(this,"_kind",void 0),d()(this,"_streamId",void 0),d()(this,"_manifestURI",void 0),d()(this,"_options",void 0),d()(this,"_player",void 0),this._videoElement=t,this._kind=n,this._streamId=r,this._manifestURI=encodeURI(i).replace(/[#]/g,"%23"),this._options=o}return u()(e,[{key:"start",value:function(){if(me.shaka)return this._player=new me.shaka.Player(this._videoElement),void this.loadPlayer({abr:{defaultBandwidthEstimate:2e6},manifest:{retryParameters:{timeout:1e4}},streaming:{rebufferingGoal:2,bufferingGoal:10,bufferBehind:30,retryParameters:{timeout:1e4,maxAttempts:10,backoffFactor:1.1}}})}},{key:"getStats",value:function(){if(!this._player)return{width:0,height:0,currentTime:0,lag:0,networkState:J.NetworkNoSource};var e=he(he({},this._player.getStats()),{},{currentTime:0,lag:0}),t=this._videoElement.currentTime||0,n=(Date.now()-this._options.originStartTime)/1e3,r=Math.max(0,n-t);return this._videoElement&&(e.currentTime=t,e.lag=r,this._videoElement.buffered&&this._videoElement.buffered.length&&(e.dataBuffered=this._videoElement.buffered.end(0))),e.estimatedBandwidth>0?e.networkState=J.NetworkLoading:e.playTime>0?e.networkState=J.NetworkIdle:e.video?e.networkState=J.NetworkEmpty:e.networkState=J.NetworkNoSource,e}},{key:"dispose",value:function(){this._player&&(this._player.unload(),this._player.destroy()),this._player=null}},{key:"loadPlayer",value:function(e){var t=this;this._player.configure(e),this._player.load(this._manifestURI).then((function(){t._logger.info("[%s] DASH live stream has been loaded",t._streamId),t._videoElement.play&&t._videoElement.play()})).catch((function(e){t._logger.error("[%s] Error while loading DASH live stream [%s]",t._streamId,e.code,e)}))}}]),e}(),fe=function(){function e(t,n,r,i,o){a()(this,e),d()(this,"_videoElement",void 0),d()(this,"_kind",void 0),d()(this,"_streamId",void 0),d()(this,"_manifestURI",void 0),d()(this,"_options",void 0),d()(this,"_player",void 0),this._videoElement=t,this._kind=n,this._streamId=r,this._manifestURI=encodeURI(i).replace(/[#]/g,"%23"),this._options=o}return u()(e,[{key:"start",value:function(){me.hlsPlayer&&(me.hlsPlayer.isSupported()?(this._player=new me.hlsPlayer({enableWorker:!0,maxBufferLength:1,liveBackBufferLength:0,liveSyncDuration:7,liveDurationInfinity:!0,liveMaxLatencyDuration:1/0,highBufferWatchdogPeriod:1}),this._player.loadSource(this._manifestURI),this._player.attachMedia(this._videoElement)):this._videoElement.canPlayType("application/vnd.apple.mpegurl")&&(this._videoElement.src=this._manifestURI))}},{key:"isSupported",value:function(){return me.hlsPlayer&&me.hlsPlayer.isSupported()}},{key:"getStats",value:function(){if(!this._player)return{width:0,height:0,currentTime:0,lag:0,networkState:J.NetworkNoSource};var e={width:this._player.media.offsetWidth,height:this._player.media.offsetHeight,currentTime:this._player.media.currentTime,lag:0,networkState:J.NetworkIdle,dataBuffered:0};this._videoElement.buffered&&this._videoElement.buffered.length&&(e.dataBuffered=this._videoElement.buffered.end(0)),"IDLE"===this._player.streamController.state?e.networkState=J.NetworkIdle:"ERROR"===this._player.streamController.state||"ENDED"===this._player.streamController.state?e.networkState=J.NetworkNoSource:this._player.streamController.state.includes("LOADING")||this._player.streamController.state.includes("WAITING")?e.networkState=J.NetworkLoading:e.networkState=J.NetworkEmpty;var t=this._videoElement.currentTime||0,n=(Date.now()-this._options.originStartTime)/1e3;return e.lag=Math.max(0,t+this._options.lag/1e3-n),e}},{key:"dispose",value:function(){this._player&&this._player.destroy&&(this._player.destroy(),this._player=null)}}]),e}(),pe=n(202).default;function ve(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ge(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ve(Object(n),!0).forEach((function(t){d()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ve(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var me=function(){function e(){a()(this,e)}var t;return u()(e,null,[{key:"hlsPlayer",get:function(){return this._hlsPlayer}},{key:"phenixWebPlayer",get:function(){return this._phenixWebPlayer}},{key:"shaka",get:function(){return this._shaka}},{key:"start",value:(t=l()(p().mark((function e(t,n,r,i){var o=this;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._options=i,!(this._hlsPlayer||this._shaka||this._phenixWebPlayer)){e.next=3;break}return e.abrupt("return",this.loaded(t,n,r));case 3:if(y.Z.webPlayerLoader||y.Z.shakaPlayerLoader||y.Z.hlsJsLoader){e.next=5;break}throw new Error("No player is provided");case 5:if(y.Z.webPlayerLoader||y.Z.shakaPlayerLoader||y.Z.hlsJsLoader){e.next=7;break}throw new Error("Unsupported-feature, add stream player");case 7:return e.abrupt("return",new pe((function(e){y.Z.hlsJsLoader&&(o._pending=!0,y.Z.hlsJsLoader((function(i){o._hlsPlayer=i,o._pending&&(o._pending=!1,e(o.loaded(t,n,r)))}))),y.Z.webPlayerLoader&&(o._pending=!0,y.Z.webPlayerLoader((function(i){o._phenixWebPlayer=i,o._pending&&(o._pending=!1,e(o.loaded(t,n,r)))}))),y.Z.shakaPlayerLoader&&(o._pending=!0,y.Z.shakaPlayerLoader((function(i){o._shaka=i,o._pending&&(o._pending=!1,e(o.loaded(t,n,r)))})))})));case 8:case"end":return e.stop()}}),e,this)}))),function(e,n,r,i){return t.apply(this,arguments)})},{key:"getStats",value:function(){return this._player?this._player.getStats():null}},{key:"play",value:function(e,t,n,r,i){var o=r.match(/a=x-playlist:([^\n]*[.]mpd\??[^\s]*)/m),a=r.match(/a=x-playlist:([^\n]*[.]m3u8\??[^\s]*)/m),s=o&&o[1]?o[1]:"",u=a&&a[1]?a[1]:"";return ae.Z.shouldUseNativeHls||this._hlsPlayer&&this._hlsPlayer.isSupported()?(this._player=new e(t,"hls",n,u,i),this._player.start(),this._player):(this._player=new e(t,"dash",n,s,i),this._player.start(),this._player)}},{key:"loaded",value:function(e,t,n){if(this._shaka||this._phenixWebPlayer||this._hlsPlayer)return this._hlsPlayer?this.play(fe,e,t,n,ge(ge({},this._options),{},{preferNative:ae.Z.shouldUseNativeHls})):this._phenixWebPlayer?this.play(ce,e,t,n,ge(ge({},this._options),{},{preferNative:ae.Z.shouldUseNativeHls})):this._shaka?this.play(de,e,t,n,ge(ge({},this._options),{},{preferNative:ae.Z.shouldUseNativeHls})):void 0}}]),e}();d()(me,"_pending",!1),d()(me,"_hlsPlayer",void 0),d()(me,"_phenixWebPlayer",void 0),d()(me,"_shaka",void 0),d()(me,"_options",void 0),d()(me,"_player",void 0);var ye=function(){function e(t,n){a()(this,e),d()(this,"_logger",v.Z.getLogger("ChunkedStream")),d()(this,"_channelContext",void 0),d()(this,"_monitorDisposables",new k.Z),d()(this,"_handleStreamFailure",void 0),d()(this,"_streamStatistics",void 0),d()(this,"_monitorFailureCount",0),this._channelContext=t,this._handleStreamFailure=n,this._channelContext.disposables.add(this)}return u()(e,[{key:"start",value:function(e,t){var n=this;return q.discoverClosestEndPointWithCaching(e).then((function(e){return n._channelContext.online.value=!0,n._channelContext.endPoint.value=e,n._logger.info("Connecting to [%s]",e.toString()),e.subscribe(t,null,n._channelContext.failureCount.value)})).then((function(e){var t=e.status,r=e.stream,i=e.createOfferDescriptionResponse,o=e.lag;if(n._channelContext.stream.value=r,n._channelContext.lag.value=o,n._channelContext.applySessionAndStreamPropertiesToVideoElement(),n._logger.debug("[%s] Subscribe completed [%s] [%j] [%j] [%j] [%j]",n._channelContext.streamId,t,i),n._channelContext.state.value=n._channelContext.mapSubscribeStatusToChannelStatus(t),n._channelContext.applyStatus(t),"ok"===t){var a=i.sessionDescription.sdp,s={originStartTime:Date.now()-o+n._channelContext.endPoint.value.roundTripTime/2,lag:o};return me.start(n._channelContext.videoElement.value,n._channelContext.streamId,a,s).then((function(e){return n.monitor(e),e})).catch((function(e){n._logger.error("LiveStreaming failed",e),n._channelContext.loading.value=!1,n._channelContext.playing.value=!1,n._channelContext.state.value=ie.ChannelState.Stopped}))}}))}},{key:"monitor",value:function(e){var t=this;this._monitorDisposables.dispose();var n=window.setTimeout((function(){var n=me.getStats();if(t._streamStatistics&&t._streamStatistics.currentTime>=n.currentTime&&t._streamStatistics.dataBuffered>=n.dataBuffered){if(t._monitorFailureCount++,t._monitorFailureCount>6)return t._monitorFailureCount=0,t._channelContext.state.value=ie.ChannelState.Error,t._channelContext.playing.value=!1,t._channelContext.loading.value=!0,e.dispose(),t._monitorDisposables.dispose(),void t._handleStreamFailure().catch((function(e){t._logger.error("Failed handling stream failure",e)}))}else t._monitorFailureCount=0;t._channelContext.videoElement.value.paused&&t._channelContext.state.value===ie.ChannelState.Playing&&(t._channelContext.state.value=ie.ChannelState.Paused),t._channelContext.videoElement.value.paused||t._channelContext.state.value===ie.ChannelState.Playing||(t._channelContext.state.value=ie.ChannelState.Playing),t._streamStatistics=n,t.monitor(e)}),1e3);this._monitorDisposables.add(new w.Z((function(){clearTimeout(n)})))}},{key:"dispose",value:function(){this._monitorDisposables.dispose()}}]),e}(),_e=n(3038),be=n.n(_e),we=function(){function e(){throw a()(this,e),new Error("PeerConnectionService is a static class that may not be instantiated")}var t,n;return u()(e,null,[{key:"initiateInitialPrecaching",value:function(){ae.Z.isPrecachingEnabled&&e.precacheCreatePeerConnectionOffer().catch((function(t){return e._logger.error('Failed to pre-cache peer connection offer"',t)}))}},{key:"precacheCreatePeerConnectionOffer",value:(n=l()(p().mark((function t(){return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e._cached={direction:"recvonly",peerConnection:e.createPeerConnectionOffer().catch((function(t){throw e._cached=null,t}))});case 1:case"end":return t.stop()}}),t)}))),function(){return n.apply(this,arguments)})},{key:"createPeerConnectionOffer",value:(t=l()(p().mark((function t(){var n,r,i,o=arguments;return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=o.length>0&&void 0!==o[0]?o[0]:"recvonly",!e._cached||e._cached.direction!==n){t.next=5;break}return r=e._cached.peerConnection,e._cached=null,t.abrupt("return",r);case 5:return i=y.Z.peerConnectionFactory.value,t.abrupt("return",i.createPeerConnection().then(function(){var e=l()(p().mark((function e(t){var r,i,o;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.supportsAddTransceiver){e.next=11;break}return i=t.addTransceiver("audio",{direction:n}),r=t.addTransceiver("video",{direction:n}),e.t0=i,e.t1=r,e.t2=t,e.next=9,t.createOffer(void 0);case 9:return e.t3=e.sent,e.abrupt("return",{audioTransceiver:e.t0,videoTransceiver:e.t1,peerConnection:e.t2,localOffer:e.t3});case 11:return o="recvonly"===n?{offerToReceiveAudio:!0,offerToReceiveVideo:!0}:{},e.t4=t,e.next=15,t.createOffer(o);case 15:return e.t5=e.sent,e.abrupt("return",{peerConnection:e.t4,localOffer:e.t5});case 17:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 7:case"end":return t.stop()}}),t)}))),function(){return t.apply(this,arguments)})}]),e}();d()(we,"_logger",v.Z.getLogger("PeerConnectionService")),d()(we,"_cached",void 0),we.initiateInitialPrecaching(),n(6755);var xe=function(){function e(t){a()(this,e),d()(this,"_sdp",void 0),d()(this,"_audioCodec",void 0),d()(this,"_videoCodec",void 0),d()(this,"_isAudioTrackEnabled",void 0),d()(this,"_isVideoTrackEnabled",void 0),this._sdp=t;var n=this._sdp.split(/(\r\n|\r|\n)/),r=this._sdp.split("m=");this._audioCodec=this.applyCodec("audio",n),this._videoCodec=this.applyCodec("video",n),this._isAudioTrackEnabled=this.isTrackByTypeEnabled("audio",r),this._isVideoTrackEnabled=this.isTrackByTypeEnabled("video",r)}return u()(e,[{key:"audioCodec",get:function(){return this._audioCodec}},{key:"videoCodec",get:function(){return this._videoCodec}},{key:"isAudioTrackEnabled",get:function(){return this._isAudioTrackEnabled}},{key:"isVideoTrackEnabled",get:function(){return this._isVideoTrackEnabled}},{key:"isTrackByTypeEnabled",value:function(e,t){var n=t.find((function(t){return t.startsWith(e)}));return!!n&&!n.includes("a=inactive")}},{key:"applyCodec",value:function(e,t){return t.find((function(n){return n.includes("a=rtpmap:".concat(t.find((function(t){return t.includes("m=".concat(e))})).split(" ")[3]))})).split(" ")[1].split("/")[0]}}]),e}(),Ce=function(){function e(t,n,r){if(a()(this,e),d()(this,"_estimatedRoundTripTime",void 0),d()(this,"_estimatedVideoCodec",void 0),d()(this,"_estimatedAudioCodec",void 0),d()(this,"_rtcStatistic",new P.Z({})),d()(this,"_peerConnection",void 0),d()(this,"_isMonitorRunning",!0),d()(this,"_updateTimeOut",void 0),d()(this,"_tracksToMonitor",void 0),this._peerConnection=t,this._estimatedRoundTripTime=r,this._tracksToMonitor=n.getTracks().map((function(e){return e.kind}))||[],this._peerConnection){if(!ae.Z.getCurrentOfferDisabled){var i=new xe(this._peerConnection.currentRemoteDescription.sdp);this._estimatedAudioCodec=i.audioCodec,this._estimatedVideoCodec=i.videoCodec}this.updateStatistic()}}var t,n;return u()(e,[{key:"rtcStatistic",get:function(){return this._rtcStatistic}},{key:"dispose",value:function(){this._isMonitorRunning=!1,this._peerConnection=null,this._updateTimeOut&&(clearTimeout(this._updateTimeOut),this._updateTimeOut=null)}},{key:"updateStatistic",value:(n=l()(p().mark((function e(){var t,n=this;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!ae.Z.getStatsPromiseBasedDisabled){e.next=5;break}return e.next=3,this.updateStatisticLegacy();case 3:return e.sent,e.abrupt("return");case 5:return t=function(e){return e.id.includes("Audio")?"audio":e.id.includes("Video")?"video":""},e.next=8,this._peerConnection.getStats(null).then((function(e){var r={};if(e){var i,o=n._estimatedRoundTripTime;e.forEach((function(a){if("candidate-pair"===a.type&&a.currentRoundTripTime&&(o=1e3*a.currentRoundTripTime,r.audio&&(r.audio.roundTripTime=o),r.video&&(r.video.roundTripTime=o)),"candidate-pair"===a.type&&a.lastPacketReceivedTimestamp&&(i=a.lastPacketReceivedTimestamp,r.audio&&(r.audio.lastPacketReceivedTimestamp=i),r.video&&(r.video.lastPacketReceivedTimestamp=i)),"inbound-rtp"===a.type){var s=a.kind||a.mediaType||t(a),u="";if(e.forEach((function(e){e.id===a.codecId&&(u=e.mimeType)})),s&&n._tracksToMonitor.includes(s)){var c,l,h,d,f,p=(a.bytesReceived||0)-(null!==(c=null===(l=n._rtcStatistic.value)||void 0===l||null===(h=l[s])||void 0===h?void 0:h.bytesReceived)&&void 0!==c?c:0),v=a.timestamp-(null===(d=n._rtcStatistic.value)||void 0===d||null===(f=d[s])||void 0===f?void 0:f.timestamp),g=p&&v?Math.floor(8*p/v*1e3):0;if(r[s]={ssrc:a.ssrc,mediaType:s,timestamp:a.timestamp,bitrate:g,bytesReceived:a.bytesReceived,packetsLost:a.packetsLost,packetsReceived:a.packetsReceived,codec:u||n.getCodecByType(s),roundTripTime:o},(a.lastPacketReceivedTimestamp||i)&&(r[s].lastPacketReceivedTimestamp=a.lastPacketReceivedTimestamp||i),"video"===s&&n._rtcStatistic.value&&n._rtcStatistic.value.video){r[s].framesDecoded=a.framesDecoded;var m=(a.framesDecoded-n._rtcStatistic.value.video.framesDecoded)/(r[s].timestamp-n._rtcStatistic.value.video.timestamp)*1e3;r[s].fps=m?Math.round(100*m)/100:0}}}}))}n._rtcStatistic.value=r})).then((function(){n._isMonitorRunning&&(n._updateTimeOut=window.setTimeout((function(){return n.updateStatistic()}),1e3))}));case 8:e.sent;case 9:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"updateStatisticLegacy",value:(t=l()(p().mark((function e(){var t=this;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._peerConnection.getStatsLegacy().then((function(e){var n={},r=t._estimatedRoundTripTime;e.result().forEach((function(e){if(e.names().forEach((function(t){"googRTT"===t&&(r=e.stat(t))})),"ssrc"===e.type){var i=e.stat("mediaType").toString();n[i]={timestamp:Date.now()},n[i].ssrc=e.stat("ssrc").toString(),n[i].mediaType=i,n[i].bytesReceived=e.stat("bytesReceived"),n[i].packetsLost=e.stat("packetsLost"),n[i].packetsReceived=e.stat("packetsReceived"),n[i].codec=e.stat("googCodecName").toString()||t.getCodecByType(i),n[i].roundTripTime=r,"video"===i&&t._rtcStatistic.value&&t._rtcStatistic.value.video&&(n[i].framesDecoded=e.stat("framesDecoded"),n[i].fps=(n[i].framesDecoded-t._rtcStatistic.value.video.framesDecoded)/(n[i].timestamp-t._rtcStatistic.value.video.timestamp)*1e3||0)}})),t._rtcStatistic.value=n})).then((function(){t._isMonitorRunning&&(t._updateTimeOut=window.setTimeout((function(){return t.updateStatistic()}),1e3))}));case 2:e.sent;case 3:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"getCodecByType",value:function(e){switch(e){case"audio":return this._estimatedAudioCodec;case"video":return this._estimatedVideoCodec;default:return"unknown"}}}]),e}(),Se=function(){function e(){throw a()(this,e),new Error("RtcConfigurationManager is a static class that may not be instantiated")}return u()(e,null,[{key:"truncateIceServers",value:function(e){for(var t=[],n=0;n<e.iceServers.length;n++){for(var r=[],i=0;i<2;i++)e.iceServers[n].urls[i]&&r.push(e.iceServers[n].urls[i]);t.push({urls:r,username:e.iceServers[n].username,credential:e.iceServers[n].credential})}return e.iceServers=t,e}}]),e}(),ke=n(202).default;function Te(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ee(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Te(Object(n),!0).forEach((function(t){d()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Te(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Le=function(){function e(t,n,r){a()(this,e),d()(this,"_logger",v.Z.getLogger("RealTimeStream")),d()(this,"_channelContext",void 0),d()(this,"_peerConnectionContext",void 0),d()(this,"_handleStreamFailure",void 0),this._channelContext=t,this._peerConnectionContext=n,this._handleStreamFailure=r}var t;return u()(e,[{key:"start",value:function(e,t,n,r){var i=this;return ke.all([q.discoverClosestEndPointWithCaching(e),we.createPeerConnectionOffer()]).then((function(e){var n=be()(e,2),r=n[0],o=n[1],a=o.localOffer,s=o.peerConnection;return i._channelContext.online.value=!0,i._channelContext.endPoint.value=r,i._logger.info("Connecting to [%s]",r.toString()),i._logger.info("Local offer:\n"+a.sdp),!ae.Z.clientOfferDisabled&&s.supportsSetConfiguration&&s.supportsGetConfiguration||(s.close(),s=null,a=null),i._peerConnectionContext.peerConnection.value=s,r.subscribe(t,a,i._channelContext.failureCount.value)})).then((function(e){var t=e.status,o=e.stream,a=e.rtcConfiguration,s=e.setRemoteDescriptionResponse,u=e.createOfferDescriptionResponse,c=e.createAnswerDescriptionResponse,l=e.lag;if(i._channelContext.stream.value=o,i._channelContext.lag.value=l,i._channelContext.applySessionAndStreamPropertiesToVideoElement(),i._logger.debug("[%s] Subscribe completed [%s] [%j] [%j] [%j] [%j]",i._channelContext.streamId,t,a,s,u,c),i._channelContext.state.value=i._channelContext.mapSubscribeStatusToChannelStatus(t),i._channelContext.applyStatus(t),"ok"===t)return i.applyRtcConfiguration(i._peerConnectionContext.peerConnection.value,a).then((function(e){var t,a=!1,l=!1,h=[];i._peerConnectionContext.peerConnection.value||(i._peerConnectionContext.peerConnection.value=e),e.onicecandidate=function(n){i._channelContext.stream.value===o&&i._peerConnectionContext.peerConnection.value===e&&(a||y.Z.sendLocalCandidates.value&&(n.candidate&&n.candidate.candidate?h.push(n.candidate):l=!0,t||(t=setTimeout((function(){i._channelContext.stream.value!==o||a||i._channelContext.endPoint.value.addIceCandidates(o,h,l).then((function(e){var t=e.status,n=e.options;"ok"===t?(n.includes("cancel")&&(a=!0),i._logger.info("[%s] Added ICE candidates with reason [%s] and options [%s]",i._channelContext.streamId,t,n)):i._logger.warn("[%s] Failed to add ICE candidates with reason [%s]",i._channelContext.streamId,t)})).catch((function(e){i._logger.error("[%s] Failed to add ICE candidates",i._channelContext.streamId,e)}))}),100))))},e.oniceconnectionstatechange=function(){if(i._channelContext.stream.value===o&&i._peerConnectionContext.peerConnection.value===e){var t=function(){i._channelContext.state.value=_.Z.Error,i._channelContext.videoElement.value&&(i._channelContext.videoElement.value.pause(),i._channelContext.videoElement.value.srcObject=null),i._channelContext.playing.value=!1,i._channelContext.loading.value=!0,i._handleStreamFailure().catch((function(t){i._logger.error("[%s] Failed handling stream failure after peer connection stopped with state [%s]",i._channelContext.streamId,e.iceConnectionState,t)}))};switch(e.iceConnectionState){case"checking":case"completed":case"connected":case"new":return;case"disconnected":case"failed":return void(navigator.onLine&&(i._logger.info("[%s] ICE connection state changed to [%s], trying to reconnect",i._channelContext.streamId,e.iceConnectionState),i.reconnectPeerConnection(e,t)));case"closed":return i._logger.info("[%s] ICE connection state changed to [%s], retrying to connect",i._channelContext.streamId,e.iceConnectionState),void t();default:(0,b.Z)(e.iceConnectionState)}}};var d=new ke((function(t,n){if(ae.Z.onTrackDisabled){var r=function n(r){clearTimeout(i),e.removeEventListener("track",n),e.removeEventListener("addstream",n),r.streams?t(r.streams[0]):t(r.stream)},i=setTimeout((function(){e.removeEventListener("track",r),e.removeEventListener("addstream",r),n(new Error("Stream setup timed out"))}),3e4);e.addEventListener("track",r),e.addEventListener("addstream",r)}else{var o=setTimeout((function(){return n(new Error("Stream setup timed out"))}),3e4);e.ontrack=function(e){clearTimeout(o),t(e.streams[0])}}}));return new ke((function(e){e()})).then((function(){if(s)return i._logger.info("[%s] Set local SDP offer [%s]",i._channelContext.streamId,s.sessionDescription.sdp),e.setLocalDescription(s.sessionDescription).catch((function(e){throw i._logger.info("[%s] Failed to set local description [%j] with message [%s]",i._channelContext.streamId,s.sessionDescription,e.message),e}))})).then((function(){if(c)return i._logger.info("[%s] Set remote SDP answer [%s]",i._channelContext.streamId,c.sessionDescription.sdp),e.setRemoteDescription(c.sessionDescription).catch((function(e){throw i._logger.info("[%s] Failed to set remote description [%j] with message [%s]",i._channelContext.streamId,c.sessionDescription,e.message),e}))})).then((function(){if(u)return i._logger.info("[%s] Set remote SDP offer [%s]",i._channelContext.streamId,u.sessionDescription.sdp),e.setRemoteDescription(u.sessionDescription).catch((function(e){throw i._logger.info("[%s] Failed to set remote description [%j] with message [%s]",i._channelContext.streamId,u.sessionDescription,e.message),e})).then((function(){return e.createAnswer({offerToReceiveAudio:!0,offerToReceiveVideo:!0})})).then((function(e){return i._logger.info("[%s] Set local SDP answer [%j]",i._channelContext.streamId,e),i._channelContext.endPoint.value.setRemoteDescription(o,e)})).then((function(t){var n=t.status,r=t.sessionDescription;return i._channelContext.state.value=i.mapSetRemoteDescriptionStatusToChannelStatus(n),"ok"!==n?(i._channelContext.playing.value=!1,i._channelContext.standby.value=!0,void(i._channelContext.stopped.value=!1)):e.setLocalDescription(r).catch((function(e){throw i._logger.info("[%s] Failed to set local description [%j] with message [%s]",i._channelContext.streamId,r,e.message),e}))}))})).then((function(){return n.success(i._channelContext.streamId),d})).then((function(t){i._peerConnectionContext.mediaStream.value=t;var n=new Ce(e,t,i._channelContext.endPoint.value.roundTripTime/4);return i._channelContext.disposables.add(n),n.rtcStatistic.subscribe((function(t){if(i._channelContext.rtcStatistics.value=t,!i._channelContext.rtcVideoStatistic&&!i._channelContext.rtcAudioStatistic)return i._channelContext.rtcAudioStatistic=t.audio,void(i._channelContext.rtcVideoStatistic=t.video);var r=!1,o=!1;t.audio&&i._channelContext.rtcAudioStatistic&&i._channelContext.rtcAudioStatistic.timestamp!==t.audio.timestamp&&((r=i._channelContext.rtcAudioStatistic&&i._channelContext.rtcAudioStatistic.bytesReceived===t.audio.bytesReceived)&&navigator.onLine&&i._logger.info("[%s] Audio track failed with last bytesReceived [%s] is equal to previous bytesReceived [%s] within [%s]",i._channelContext.streamId,t.audio.bytesReceived,i._channelContext.rtcAudioStatistic.bytesReceived,new C(t.audio.timestamp-i._channelContext.rtcAudioStatistic.timestamp).toIsoString()),i._channelContext.rtcAudioStatistic=t.audio),t.video&&i._channelContext.rtcVideoStatistic&&i._channelContext.rtcVideoStatistic.timestamp!==t.video.timestamp&&((o=i._channelContext.rtcVideoStatistic&&i._channelContext.rtcVideoStatistic.bytesReceived===t.video.bytesReceived)&&navigator.onLine&&i._logger.info("[%s] Video track failed with last bytesReceived [%s] is equal to previous bytesReceived [%s] within [%s]",i._channelContext.streamId,t.video.bytesReceived,i._channelContext.rtcVideoStatistic.bytesReceived,new C(t.video.timestamp-i._channelContext.rtcVideoStatistic.timestamp).toIsoString()),i._channelContext.rtcVideoStatistic=t.video),(o||r)&&navigator.onLine?i.reconnectPeerConnection(e,(function(){i._channelContext.state.value=_.Z.Error,i._channelContext.videoElement.value&&(i._channelContext.videoElement.value.pause(),i._channelContext.videoElement.value.srcObject=null),i._channelContext.playing.value=!1,i._channelContext.loading.value=!0,n.dispose(),i._handleStreamFailure().catch((function(t){i._logger.error("[%s] Failed handling stream failure after track stopped with state [%s]",i._channelContext.streamId,e.iceConnectionState,t)}))})):i._peerConnectionContext.peerConnectionReconnectAttempts=0})),y.Z.automaticallyPlayMediaStream?r(t):(i._channelContext.autoMuted.value=!1,i._channelContext.autoPaused.value=!0,i._channelContext.loading.value=!1,i._channelContext.playing.value=!1,void(i._channelContext.state.value=_.Z.Paused))}))}))}))}},{key:"applyRtcConfiguration",value:(t=l()(p().mark((function e(t,n){var r;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=3;break}return n=Se.truncateIceServers(n),e.abrupt("return",y.Z.peerConnectionFactory.value.createPeerConnection(n));case 3:return r=Ee(Ee({},t.getConfiguration()),n),t.setConfiguration(r),e.abrupt("return",t);case 6:case"end":return e.stop()}}),e)}))),function(e,n){return t.apply(this,arguments)})},{key:"reconnectPeerConnection",value:function(e,t){var n=this;if("closed"!==e.iceConnectionState)if(this._channelContext.state.value=_.Z.Reconnecting,this._peerConnectionContext.peerConnectionReconnectAttempts<y.Z.maximalNumberOfPeerConnectionReconnectAttempts||!y.Z.automaticallyReconnectPeerConnection){if(this._peerConnectionContext.peerConnectionReconnectAttempts++,ae.Z.clientOfferDisabled||!e.supportsSetConfiguration||!e.supportsGetConfiguration||this._channelContext.failureCount.value)return;this._logger.info("Reconnecting peer connection by restarting ICE");var r=e.currentLocalDescription;e.createOffer({iceRestart:!0}).then((function(t){return e.setLocalDescription(t).then((function(){return e.setLocalDescription(r)}))})).catch((function(e){n._logger.error("Failed to reconnect peer connection",e),n._peerConnectionContext.peerConnectionReconnectAttempts=0,t()}))}else this._logger.info("Failed to reconnect peer connection after [%s] attempts, performing full recovery",this._peerConnectionContext.peerConnectionReconnectAttempts),this._peerConnectionContext.peerConnectionReconnectAttempts=0,t()}},{key:"mapSetRemoteDescriptionStatusToChannelStatus",value:function(e){switch(e){case"ok":return _.Z.Starting;case"unauthorized":return _.Z.Unauthorized;case"not-found":case"capacity":case"rate-limited":case"timeout":return _.Z.Recovering;case"failed":return _.Z.Error;default:(0,b.Z)(e)}}}]),e}(),Pe=function(){function e(){throw a()(this,e),new Error("LegacyStreamFactory is a static class that may not be instantiated")}return u()(e,null,[{key:"create",value:function(e,t,n,r){var i=x.Z.parseToken(e);return i&&i.token&&i.token.capabilities&&i.token.capabilities.includes("rtmp")?ae.Z.isRTMPEnabled?new oe(t,r):(t.state.value=_.Z.UnsupportedFeature,void this._logger.error("RTMP playback is not enabled.")):i&&i.token&&i.token.capabilities&&i.token.capabilities.includes("streaming")?new ye(t,r):new Le(t,n,r)}}]),e}();d()(Pe,"_logger",v.Z.getLogger("Streaming"));var Oe=n(202).default,Re="client:termination",Ze=function(){function e(t,n){var o=this,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;a()(this,e),d()(this,"_logger",v.Z.getLogger("Channel")),d()(this,"_tokenContext",void 0),d()(this,"_channelContext",void 0),d()(this,"_peerConnectionContext",void 0),d()(this,"_stateContext",void 0),d()(this,"_channelStartTime",void 0),d()(this,"_readOnlyVideoElement",void 0),d()(this,"_readOnlyToken",void 0),d()(this,"_readOnlyPeerConnection",void 0),d()(this,"_readOnlyState",void 0),d()(this,"_readOnlyAutoMuted",void 0),d()(this,"_readOnlyAutoPaused",void 0),d()(this,"_readOnlyTokenExpiring",void 0),d()(this,"_readOnlyAuthorized",void 0),d()(this,"_readOnlyOnline",void 0),d()(this,"_readOnlyLoading",void 0),d()(this,"_readOnlyPlaying",void 0),d()(this,"_readOnlyStandby",void 0),d()(this,"_readOnlyStopped",void 0),d()(this,"_readOnlyTargetLag",void 0),d()(this,"_readOnlyLag",void 0),d()(this,"_readOnlyBitrateLimit",void 0),d()(this,"_readOnlyResolution",void 0),d()(this,"_readOnlyFailureCount",void 0),d()(this,"_readOnlyEndPoint",void 0),d()(this,"_readOnlyStream",void 0),d()(this,"_readOnlyRtcStatistics",void 0),d()(this,"_readOnlyMediaStream",void 0),d()(this,"_metricsService",void 0),d()(this,"_sessionTelemetry",void 0),d()(this,"_videoMetaDataChangedHandler",void 0),this._tokenContext=new Z(n),this._channelContext=new I(s),this._peerConnectionContext=new A,this._stateContext=new D,this._channelStartTime=Date.now(),this._readOnlyVideoElement=new g.Z(this._channelContext.videoElement),this._readOnlyToken=new g.Z(this._tokenContext.token),this._readOnlyPeerConnection=new g.Z(this._peerConnectionContext.peerConnection),this._readOnlyState=new g.Z(this._channelContext.state),this._readOnlyAutoMuted=new g.Z(this._channelContext.autoMuted),this._readOnlyAutoPaused=new g.Z(this._channelContext.autoPaused),this._readOnlyTokenExpiring=new g.Z(this._tokenContext.tokenExpiring),this._readOnlyAuthorized=new g.Z(this._channelContext.authorized),this._readOnlyOnline=new g.Z(this._channelContext.online),this._readOnlyLoading=new g.Z(this._channelContext.loading),this._readOnlyPlaying=new g.Z(this._channelContext.playing),this._readOnlyStandby=new g.Z(this._channelContext.standby),this._readOnlyStopped=new g.Z(this._channelContext.stopped),this._readOnlyTargetLag=new g.Z(this._channelContext.targetLag),this._readOnlyLag=new g.Z(this._channelContext.lag),this._readOnlyBitrateLimit=new g.Z(this._channelContext.bitrateLimit),this._readOnlyResolution=new g.Z(this._channelContext.resolution),this._readOnlyFailureCount=new g.Z(this._channelContext.failureCount),this._readOnlyEndPoint=new g.Z(this._channelContext.endPoint),this._readOnlyStream=new g.Z(this._channelContext.stream),this._readOnlyRtcStatistics=new g.Z(this._channelContext.rtcStatistics),this._readOnlyMediaStream=new g.Z(this._peerConnectionContext.mediaStream);var u=x.Z.parseToken(this._tokenContext.token.value),c=(x.Z.getUri(u)||y.Z.discoveryUri.value).toString();y.Z.tenancy.value=x.Z.getTenancy(u)||y.Z.tenancy.value,G.Z.uri.value=c,this._metricsService=H.Z.getMetricsService(c),this._sessionTelemetry=new R(y.Z.pageLoadTime,this._metricsService),this._channelContext.channelDisposables.add(this._sessionTelemetry),this._videoMetaDataChangedHandler=this.handleVideoMetaDataChanged.bind(this),this.videoElement=t,this._channelContext.channelDisposables.add(this._channelContext.videoElement.subscribe((function(e){o._channelContext.rendererDisposables.dispose(),e&&(o._channelContext.rendererDisposables.add(o._channelContext.stream.subscribe((function(e){o._channelContext.videoTelemetry&&o._channelContext.videoTelemetry.dispose(),e&&o.videoElement&&(o.videoElement.dataset&&(o.videoElement.dataset.sessionId=y.Z.clientSessionId,o.videoElement.dataset.streamId=o.streamId),o._channelContext.videoTelemetry=new T(o.streamId,y.Z.pageLoadTime,o._channelStartTime,o._metricsService),o._channelContext.videoTelemetry.setupListenerForTimeToFirstTime(o.videoElement),o._channelContext.videoTelemetry.setupListenerForRebuffering(o.videoElement),o._channelContext.state.value===_.Z.Stopped)&&o.restartAfterStop()}))),o._channelContext.channelDisposables.add(o._channelContext.rendererDisposables))}))),this._channelContext.channelDisposables.add(this._channelContext.state.subscribe((function(e){o._channelContext.clearFailureCountTimeout&&clearTimeout(o._channelContext.clearFailureCountTimeout),o._channelContext.failureCount.value&&e===_.Z.Playing&&(o._channelContext.clearFailureCountTimeout=window.setTimeout((function(){o._channelContext.failureCount.value=0}),3e3))}))),this._channelContext.channelDisposables.add(this._channelContext.resolution.subscribe((function(e){o._channelContext.videoTelemetry&&o._channelContext.videoTelemetry.onVideoResolutionChanges(e.toString())}))),this._channelContext.channelDisposables.add(this._channelContext.bitrateLimit.subscribe((function(e){if(e&&o._channelContext.endPoint.value&&o._channelContext.stream.value){var t=Date.now()-o._channelContext.channelInitialization.getTime();o._channelContext.endPoint.value.limitBitrate(o._channelContext.stream.value,t,e,r.Keep,i.Normal).catch((function(e){o._logger.error("Error while setting limit bitrate",e)}))}})));var l=function(){o._channelContext.stream.value&&o._channelContext.endPoint.value&&o._channelContext.endPoint.value.destroyStream(o._channelContext.stream.value,"client:termination-on-window-unload")};window.addEventListener("beforeunload",l),this._channelContext.channelDisposables.add(new w.Z((function(){window.removeEventListener("beforeunload",l)}))),this.start()}var t,n,o,s,c,h,f,C,S;return u()(e,[{key:"videoElement",get:function(){return this._channelContext.videoElement.value},set:function(e){this._channelContext.videoElement.value&&(this._channelContext.videoElement.value.removeEventListener("loadeddata",this._videoMetaDataChangedHandler),this._channelContext.videoElement.value.removeEventListener("loadedmetadata",this._videoMetaDataChangedHandler),this._channelContext.videoElement.value.removeEventListener("resize",this._videoMetaDataChangedHandler),this._channelContext.videoElement.value.dataset&&(this._channelContext.videoElement.value.dataset.sessionId="",this._channelContext.videoElement.value.dataset.streamId=""),this._channelContext.rendererDisposables.dispose(),this._channelContext.videoElement.value.pause(),this._channelContext.videoElement.value.srcObject=null),this._channelContext.autoMuted.value=!1,this._channelContext.autoPaused.value=!1,this._channelContext.loading.value=!1,this._channelContext.playing.value=!1,this._channelContext.state.value=_.Z.Stopped,this._channelContext.videoElement.value=e,this._channelContext.videoElement.value&&(this._channelContext.videoElement.value.addEventListener("loadeddata",this._videoMetaDataChangedHandler),this._channelContext.videoElement.value.addEventListener("loadedmetadata",this._videoMetaDataChangedHandler),this._channelContext.videoElement.value.addEventListener("resize",this._videoMetaDataChangedHandler))}},{key:"handleVideoMetaDataChanged",value:function(){var e=this._channelContext.videoElement.value;e?this.resolution.value.width===e.videoWidth&&this.resolution.value.height===e.videoHeight||(this._channelContext.resolution.value=new m(e.videoWidth,e.videoHeight)):this._channelContext.resolution.value=m.empty}},{key:"token",get:function(){return this._tokenContext.token.value},set:function(e){this._channelContext.disposables.dispose(),this._tokenContext.token.value=e,this._tokenContext.tokenExpiring.value=!1;var t=x.Z.parseToken(this._tokenContext.token.value),n=(x.Z.getUri(t)||y.Z.discoveryUri.value).toString();y.Z.tenancy.value=x.Z.getTenancy(t)||y.Z.tenancy.value,G.Z.uri.value=n,this._metricsService=H.Z.getMetricsService(n),this.start()}},{key:"peerConnection",get:function(){return this._readOnlyPeerConnection}},{key:"state",get:function(){return this._readOnlyState}},{key:"autoMuted",get:function(){return this._readOnlyAutoMuted}},{key:"autoPaused",get:function(){return this._readOnlyAutoPaused}},{key:"tokenExpiring",get:function(){return this._readOnlyTokenExpiring}},{key:"authorized",get:function(){return this._readOnlyAuthorized}},{key:"online",get:function(){return this._readOnlyOnline}},{key:"loading",get:function(){return this._readOnlyLoading}},{key:"playing",get:function(){return this._readOnlyPlaying}},{key:"standby",get:function(){return this._readOnlyStandby}},{key:"stopped",get:function(){return this._readOnlyStopped}},{key:"targetLag",get:function(){return this._readOnlyTargetLag}},{key:"lag",get:function(){return this._readOnlyLag}},{key:"bitrateLimit",get:function(){return this._readOnlyBitrateLimit.value}},{key:"resolution",get:function(){return this._readOnlyResolution}},{key:"failureCount",get:function(){return this._readOnlyFailureCount}},{key:"endPoint",get:function(){return this._readOnlyEndPoint}},{key:"stream",get:function(){return this._readOnlyStream}},{key:"streamId",get:function(){return this._channelContext.streamId}},{key:"rtcStatistics",get:function(){return this._readOnlyRtcStatistics}},{key:"mediaStream",get:function(){return this._readOnlyMediaStream}},{key:"setBitrateLimit",value:function(e){this._channelContext.bitrateLimit.value=e}},{key:"clearBitrateLimit",value:function(){var e=this;if(this._channelContext.bitrateLimit.value&&this._channelContext.endPoint.value&&this._channelContext.stream.value){var t=Date.now()-this._channelContext.channelInitialization.getTime();this._channelContext.endPoint.value.limitBitrate(this._channelContext.stream.value,t,0,r.Keep,i.Reset).then((function(t){"ok"===t.status&&(e._channelContext.bitrateLimit.value=0)})).catch((function(t){e._logger.error("Error while setting limit bitrate",t)}))}}},{key:"updateTargetLag",value:function(e){this._channelContext.targetLag.value=e}},{key:"stop",value:(S=l()(p().mark((function e(t){var n=this;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Oe((function(e){if(!n._stateContext.isStarting.value)return n.processStop(t),void e();n._channelContext.rendererDisposables.add(n._stateContext.isStarting.subscribe((function(r){r||(n.processStop(t),e())})))})));case 1:case"end":return e.stop()}}),e)}))),function(e){return S.apply(this,arguments)})},{key:"processStop",value:function(e){this._channelContext.videoElement.value&&(this._channelContext.videoElement.value.pause(),this._channelContext.videoElement.value.srcObject=null),this._channelContext.rendererDisposables.dispose(),this.cleanUpResources(e),this._channelContext.state.value=_.Z.Stopped}},{key:"resume",value:(C=l()(p().mark((function e(){return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._peerConnectionContext.mediaStream.value){e.next=3;break}return this._channelContext.autoPaused.value=!1,e.abrupt("return",this.playMediaStreamInVideoElement(this._peerConnectionContext.mediaStream.value));case 3:case"end":return e.stop()}}),e,this)}))),function(){return C.apply(this,arguments)})},{key:"mute",value:function(){var e=this._channelContext.videoElement.value;e&&(e.muted=!0)}},{key:"unmute",value:function(){var e=this._channelContext.videoElement.value;e&&(e.muted=!1,this._channelContext.autoMuted.value=!1)}},{key:"dispose",value:(f=l()(p().mark((function e(){var t=this;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.stop("client:channel-dispose").then((function(){t._channelContext.channelDisposables.dispose(),t._stateContext.isDisposed=!0})));case 1:case"end":return e.stop()}}),e,this)}))),function(){return f.apply(this,arguments)})},{key:"getUri",value:function(e){var t=x.Z.parseToken(e);return x.Z.getUri(t)||(this._logger.info("Fall back to the default discover URI [%s]",y.Z.discoveryUri.value),new URL(y.Z.discoveryUri.value))}},{key:"start",value:(h=l()(p().mark((function e(){return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._stateContext.isDisposed){e.next=2;break}throw new Error("Channel was already disposed");case 2:if(!this._stateContext.isStarting.value){e.next=5;break}return this._logger.info("Channel is already starting, skipping start"),e.abrupt("return");case 5:return this._stateContext.isStarting.value=!0,e.abrupt("return",this.processStart());case 7:case"end":return e.stop()}}),e,this)}))),function(){return h.apply(this,arguments)})},{key:"processStart",value:(c=l()(p().mark((function e(){var t,n,r,i,o,a=this;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this._tokenContext.token.value,n=this._sessionTelemetry.listenOnStreamSetup(),x.Z.isValidToken(t)){e.next=8;break}return this._logger.error("Failed to parse token [%s]",t),this._channelContext.state.value=_.Z.Unauthorized,this._channelContext.authorized.value=!1,this._stateContext.isStarting.value=!1,e.abrupt("return");case 8:if(this.cleanUpResources("client:start"),this._channelContext.state.value=_.Z.Starting,this._channelContext.loading.value=!0,r=this.getUri(t),i=function(){return new Oe((function(e){return a._stateContext.isStarting.value=!1,e(a.handleStreamFailure())}))},o=Pe.create(t,this._channelContext,this._peerConnectionContext,i)){e.next=17;break}return this._stateContext.isStarting.value=!1,e.abrupt("return");case 17:return e.abrupt("return",o.start(r,t,n,this.playMediaStreamInVideoElement.bind(this)).then((function(){a._channelContext.loading.value=!1})).catch((function(e){n.fail(),a._channelContext.failureCount.value++,a._channelContext.online.value=!1,a.cleanUpResources("client:cleanup-after-failed-setup"),a._channelContext.state.value=_.Z.Error,a._logger.error("Failed to start channel",e)})).finally((function(){if(a._stateContext.isStarting.value=!1,a._channelContext.state.value!==_.Z.Playing&&y.Z.automaticRetryOnFailure){var e=setTimeout((function(){a.handleStreamFailure().catch((function(e){a._logger.error("Failed handling stream failure",e)}))}),a.getRetryInterval());a._channelContext.disposables.add(new w.Z((function(){clearTimeout(e)})))}})));case 18:case"end":return e.stop()}}),e,this)}))),function(){return c.apply(this,arguments)})},{key:"restartAfterStop",value:(s=l()(p().mark((function e(){return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._stateContext.isDisposed){e.next=2;break}throw new Error("Channel was already disposed");case 2:if(!this._peerConnectionContext.mediaStream.value){e.next=4;break}return e.abrupt("return",this.playMediaStreamInVideoElement(this._peerConnectionContext.mediaStream.value));case 4:this._tokenContext.token.value&&this.start();case 5:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"play",value:(o=l()(p().mark((function e(){var t;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this._peerConnectionContext.mediaStream.value){e.next=3;break}return e.abrupt("return",this.start());case 3:return e.abrupt("return",this.playMediaStreamInVideoElement(t));case 4:case"end":return e.stop()}}),e,this)}))),function(){return o.apply(this,arguments)})},{key:"getRetryInterval",value:function(){switch(this._channelContext.state.value){case _.Z.StandBy:case _.Z.Offline:return 15e3;case _.Z.Error:case _.Z.Recovering:case _.Z.Unauthorized:case _.Z.GeoRestricted:case _.Z.GeoBlocked:case _.Z.Stopped:case _.Z.Starting:case _.Z.Playing:case _.Z.Paused:case _.Z.Reconnecting:case _.Z.UnsupportedFeature:return Math.min(3e5,Math.pow(2e3,Math.max(0,this._channelContext.failureCount.value-1)));default:(0,b.Z)(this._channelContext.state.value)}}},{key:"handleStreamFailure",value:(n=l()(p().mark((function e(){return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=this._channelContext.state.value,e.next=e.t0===_.Z.Error||e.t0===_.Z.Reconnecting||e.t0===_.Z.StandBy||e.t0===_.Z.Offline||e.t0===_.Z.Recovering?3:e.t0===_.Z.Unauthorized?5:e.t0===_.Z.GeoRestricted?7:e.t0===_.Z.GeoBlocked?9:e.t0===_.Z.Stopped?11:e.t0===_.Z.Playing?13:e.t0===_.Z.Paused?15:e.t0===_.Z.Starting?17:e.t0===_.Z.UnsupportedFeature?19:21;break;case 3:return this._logger.info("Retry start with initial state [%s] [%s]",this._channelContext.state.value,_.Z[this._channelContext.state.value]),e.abrupt("break",22);case 5:return this._logger.info("Channel is unauthorized, skipping retry of start. Please provide a new token and invoke start()"),e.abrupt("return");case 7:return this._logger.info("Channel is geo restricted, skipping retry of start. Please provide a new token and invoke start()"),e.abrupt("return");case 9:return this._logger.info("Channel is geo blocked, skipping retry of start. Please provide a new token and invoke start()"),e.abrupt("return");case 11:return this._logger.info("Channel is stopped, skipping retry of start."),e.abrupt("return");case 13:return this._logger.info("Channel is playing, skipping retry of start"),e.abrupt("return");case 15:return this._logger.info("Channel is paused, skipping retry of start. Please invoke play()"),e.abrupt("return");case 17:return this._logger.info("Channel is already starting, skipping retry of start"),e.abrupt("return");case 19:return this._logger.info("Channel is stopped due to unsupported feature, skipping retry of start."),e.abrupt("return");case 21:(0,b.Z)(this._channelContext.state.value);case 22:return e.abrupt("return",this.start());case 23:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"cleanUpResources",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Re;this._channelContext.disposables.dispose();var n=this._peerConnectionContext.peerConnection.value;n&&(this._peerConnectionContext.peerConnection.value=null,n.close()),this._peerConnectionContext.mediaStream.value&&(this._peerConnectionContext.mediaStream.value.getTracks().forEach((function(e){return e.stop()})),this._peerConnectionContext.mediaStream.value=null),this._channelContext.autoPaused.value=!1,this._channelContext.autoMuted.value=!1,this._channelContext.playing.value=!1,this._channelContext.stopped.value=!0,this._channelContext.standby.value=!1,this._channelContext.stream.value&&this._channelContext.endPoint.value&&this._channelContext.endPoint.value.destroyStream(this._channelContext.stream.value,t).then((function(t){var n=t.status;"ok"===n?e._logger.info("[%s] Destroyed stream with reason [%s]",e.streamId,n):e._logger.warn("[%s] Failed to destroy stream with reason [%s]",e.streamId,n)})).catch((function(t){e._logger.error("[%s] Failed to destroy stream",e.streamId,t)})),this.videoElement&&this.videoElement.dataset&&(this.videoElement.dataset.sessionId="",this.videoElement.dataset.streamId=""),this._channelContext.stream.value=null,this._channelContext.endPoint.value=null,this._peerConnectionContext.peerConnectionReconnectAttempts=0}},{key:"playMediaStreamInVideoElement",value:(t=l()(p().mark((function e(t){var n,r,i=this;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this._channelContext.videoElement.value){e.next=8;break}return this._channelContext.autoMuted.value=!1,this._channelContext.autoPaused.value=!1,this._channelContext.loading.value=!1,this._channelContext.playing.value=!1,this._channelContext.state.value=_.Z.Stopped,e.abrupt("return");case 8:if(n.srcObject=t,void 0!==(r=n.play())){e.next=17;break}return this._channelContext.autoMuted.value=!1,this._channelContext.autoPaused.value=!1,this._channelContext.loading.value=!1,this._channelContext.playing.value=!0,this._channelContext.state.value=_.Z.Playing,e.abrupt("return");case 17:return e.abrupt("return",r.then((function(){i._channelContext.autoMuted.value=!1,i._channelContext.autoPaused.value=!1,i._channelContext.loading.value=!1,i._channelContext.playing.value=!0,i._channelContext.state.value=_.Z.Playing})).catch((function(e){var r=!!t.getTracks().filter((function(e){return"audio"===e.kind})),o=!y.Z.automaticallyMuteVideoOnPlayFailure;return o||n.muted||!r?(i._channelContext.autoMuted.value=!1,i._channelContext.autoPaused.value=!0,i._channelContext.loading.value=!1,i._channelContext.playing.value=!1,i._channelContext.state.value=_.Z.Paused,o?(i._logger.info("[%s] Paused video after play failed. Manual user action required.",i.streamId,e),void(n.srcObject=null)):r?void i._logger.info("[%s] Failed to play video. Manual user action required.",i.streamId,e):void i._logger.info("[%s] Failed to play muted video. Manual user action required.",i.streamId,e)):(n.muted=!0,n.play().then((function(){i._logger.info("[%s] Played video after auto muting. Manual user action required to unmute.",i.streamId),i._channelContext.autoMuted.value=!0,i._channelContext.autoPaused.value=!1,i._channelContext.loading.value=!1,i._channelContext.playing.value=!0,i._channelContext.state.value=_.Z.Playing})).catch((function(e){n.muted=!1,i._logger.info("[%s] Failed to play video. Manual user action required.",i.streamId,e),i._channelContext.autoMuted.value=!1,i._channelContext.autoPaused.value=!0,i._channelContext.loading.value=!1,i._channelContext.playing.value=!1,i._channelContext.state.value=_.Z.Paused})))})));case 18:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),e}(),Ie=function(){function e(){throw a()(this,e),new Error("Channels is a static class that may not be instantiated")}return u()(e,null,[{key:"createChannel",value:function(e){if(!y.Z.initialized.value)throw new Error("SDK is not loaded.");return new Ze(e.videoElement,e.token,e.targetLag)}}]),e}()},4146:function(e,t,n){"use strict";n.r(t),n.d(t,{SDK:function(){return r.Z},Channels:function(){return i.Z},ChannelState:function(){return o.Z}});var r=n(5508),i=n(2070),o=n(2250);t.default={SDK:r.Z,Channels:i.Z,ChannelState:o.Z}},79:function(e,t,n){"use strict";n.d(t,{w:function(){return r}});var r="https://pcast.phenixrts.com/pcast/endPoints"},5564:function(e,t,n){"use strict";n.d(t,{Z:function(){return d}}),n(6992),n(3843),n(3710),n(1539),n(4916),n(9714),n(8783),n(4765),n(3948),n(285);var r=n(4575),i=n.n(r),o=n(3913),a=n.n(o),s=n(9713),u=n.n(s),c=n(79),l=n(7426),h=n(8862),d=function(){function e(){throw i()(this,e),new Error("DiscoveryUri is a static class that may not be instantiated")}return a()(e,null,[{key:"uri",get:function(){return e._discoveryUri}},{key:"buildDiscoveryUrl",value:function(e){var t=new URL(e.toString()),n=h.Z.sdkVersion;return t.search="?".concat(new URLSearchParams([["version",n],["_","".concat(Date.now())]]).toString()),"/"===t.pathname&&(t.pathname="/pcast/endPoints"),t.toString()}}]),e}();u()(d,"_discoveryUri",new l.Z(c.w))},3297:function(e,t,n){"use strict";n.d(t,{Z:function(){return h}}),n(6992),n(1539),n(8783),n(6755),n(3948),n(285);var r=n(4575),i=n.n(r),o=n(3913),a=n.n(o),s=n(9713),u=n.n(s),c=n(9571),l="DIGEST:",h=function(){function e(){i()(this,e)}return a()(e,null,[{key:"parseToken",value:function(t){if(this.isValidToken(t))try{var n=atob(t.substr(l.length)),r=JSON.parse(n);return r.token=JSON.parse(r.token),r}catch(t){return void e._logger.error("Cannot parse token value",t)}else e._logger.error("Token is not valid [%s]",t)}},{key:"getUri",value:function(e){return e&&e.token&&e.token.uri?new URL(e.token.uri):null}},{key:"getTenancy",value:function(e){return e&&e.applicationId?e.applicationId:""}},{key:"isValidToken",value:function(e){return!!e&&e.startsWith(l)}}]),e}();u()(h,"_logger",c.Z.getLogger("EdgeAuth"))},1228:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(4575),i=n.n(r),o=n(3913),a=n.n(o),s=n(9845),u=function(){function e(){i()(this,e)}return a()(e,null,[{key:"clientOfferDisabled",get:function(){return s.Z.isChrome74||s.Z.isChrome75||s.Z.isChrome76||s.Z.isChrome77}},{key:"addTranceiverDisabled",get:function(){return s.Z.isChrome69||s.Z.isChrome70||s.Z.isChrome71||s.Z.isChrome72}},{key:"getStatsPromiseBasedDisabled",get:function(){return"Chrome"===s.Z.browserName&&s.Z.browserMajorVersion<=66}},{key:"getCurrentOfferDisabled",get:function(){return"Chrome"===s.Z.browserName&&s.Z.browserMajorVersion<=69||"Firefox"===s.Z.browserName&&s.Z.browserMajorVersion<=56}},{key:"onTrackDisabled",get:function(){return"Chrome"===s.Z.browserName&&s.Z.browserMajorVersion<=63||"Firefox"===s.Z.browserName&&s.Z.browserMajorVersion<=52}},{key:"webkitRTCPeerConnectionEnabled",get:function(){return"Chrome"===s.Z.browserName&&s.Z.browserMajorVersion<=55}},{key:"promiseBasedPCMethodsDisabled",get:function(){return"Firefox"===s.Z.browserName&&s.Z.browserMajorVersion<=52}},{key:"shouldUseNativeHls",get:function(){return"Safari"===s.Z.browserName||"SamsungBrowser"===s.Z.browserName}},{key:"isRTMPEnabled",get:function(){return"Firefox"===s.Z.browserName&&s.Z.browserMajorVersion<84||"Chrome"===s.Z.browserName&&s.Z.browserMajorVersion<70||"Edge"===s.Z.browserName||"IE"===s.Z.browserName}},{key:"isPrecachingEnabled",get:function(){return"IE"!==s.Z.browserName}}]),e}()},8862:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}}),n(8733),n(3710);var r=n(4575),i=n.n(r),o=n(3913),a=n.n(o),s=n(9713),u=n.n(s),c=function(){function e(){i()(this,e)}return a()(e,null,[{key:"sdkVersion",get:function(){try{return"2023-01-06T18:19:52.372Z (2023.0.3)"}catch(e){return this._defaultVersion}}}]),e}();u()(c,"_defaultVersion",(new Date).toISOString())},3552:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(4575),i=n.n(r),o=n(3913),a=n.n(o),s=n(9713),u=n.n(s),c=n(5183),l=function(){function e(t){i()(this,e),u()(this,"_telemetryService",void 0),u()(this,"_tenancy",void 0),u()(this,"_sessionId",void 0),u()(this,"_threshold",void 0),this._tenancy=t.tenancy,this._sessionId=t.sessionId,this._threshold=t.threshold,this._telemetryService=new c.Z(t)}return a()(e,[{key:"log",value:function(e,t,n,r){e<this._threshold||this._telemetryService.push(e,t,n,r)}}]),e}()},5259:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}}),n(6992),n(3710),n(1539),n(9714),n(8783),n(3948),n(285);var r=n(4575),i=n.n(r),o=n(3913),a=n.n(o),s=n(9713),u=n.n(s),c=n(1178),l=function(){function e(){i()(this,e),u()(this,"_url","https://telemetry.phenixrts.com/telemetry/logs"),u()(this,"_tenancy",void 0),u()(this,"_sessionId",void 0),u()(this,"_environment",void 0),u()(this,"_threshold",c.Z.defaultTelemetryLoggingLevel)}return a()(e,[{key:"url",get:function(){return this._url},set:function(e){var t=new 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:"threshold",get:function(){return this._threshold},set:function(e){this._threshold=e}}]),e}()},5183:function(e,t,n){"use strict";n.d(t,{Z:function(){return v}}),n(5827),n(7042),n(8733),n(1539),n(2479),n(8674),n(5666);var r=n(8926),i=n.n(r),o=n(4575),a=n.n(o),s=n(3913),u=n.n(s),c=n(9713),l=n.n(c),h=n(7757),d=n.n(h),f=n(5149),p=n(8862),v=function(){function e(t){a()(this,e),l()(this,"_telemetryConfiguration",void 0),l()(this,"_logs",[]),l()(this,"_isSending",void 0),l()(this,"_domain",location.hostname),this._telemetryConfiguration=t}var t,n;return u()(e,[{key:"push",value:function(e,t,n,r){var i={timestamp:r.toISOString(),tenancy:this._telemetryConfiguration.tenancy,level:f.G[e],category:n,message:t,sessionId:this._telemetryConfiguration.sessionId,version:p.Z.sdkVersion,environment:this._telemetryConfiguration.environment,fullQualifiedName:this._domain};e<f.G.Error?this._logs.push(i):this._logs.unshift(i),this.sendLogsIfAble()}},{key:"sendLogs",value:(n=i()(d().mark((function e(t){var n;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(n=new FormData).append("jsonBody",JSON.stringify({records:t})),e.next=4,fetch(this._telemetryConfiguration.url,{method:"POST",body:n});case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"sendLogsIfAble",value:(t=i()(d().mark((function e(){var t,n,r,i,o=this;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(this._logs.length<=0||this._isSending)){e.next=2;break}return e.abrupt("return");case 2:for(t=0,n=0,this._isSending=!0,r=function(e){return Object.values(e).reduce((function(e,t){return e+(t?t.length:0)}),0)};this._logs.length>t&&r(this._logs[t])+n<8192;)n+=r(this._logs[t]),t++;return t||(this._logs[t].message=this._logs[t].message.substring(0,r(this._logs[t])+(8192-r(this._logs[t]))),t=1),i=this._logs.slice(0,t),this._logs=this._logs.slice(t),e.abrupt("return",this.sendLogs(i).then((function(e){return o._isSending=!1,o.sendLogsIfAble(),e})).catch((function(){o._isSending=!1,o.sendLogsIfAble()})));case 11:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}()},3099:function(e){e.exports=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e}},6077:function(e,t,n){var r=n(111);e.exports=function(e){if(!r(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype");return e}},1223:function(e,t,n){var r=n(5112),i=n(30),o=n(3070),a=r("unscopables"),s=Array.prototype;null==s[a]&&o.f(s,a,{configurable:!0,value:i(null)}),e.exports=function(e){s[a][e]=!0}},1530:function(e,t,n){"use strict";var r=n(8710).charAt;e.exports=function(e,t,n){return t+(n?r(e,t).length:1)}},5787:function(e){e.exports=function(e,t,n){if(!(e instanceof t))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation");return e}},9670:function(e,t,n){var r=n(111);e.exports=function(e){if(!r(e))throw TypeError(String(e)+" is not an object");return e}},1285:function(e,t,n){"use strict";var r=n(7908),i=n(1400),o=n(7466);e.exports=function(e){for(var t=r(this),n=o(t.length),a=arguments.length,s=i(a>1?arguments[1]:void 0,n),u=a>2?arguments[2]:void 0,c=void 0===u?n:i(u,n);c>s;)t[s++]=e;return t}},8533:function(e,t,n){"use strict";var r=n(2092).forEach,i=n(9341),o=n(9207),a=i("forEach"),s=o("forEach");e.exports=a&&s?[].forEach:function(e){return r(this,e,arguments.length>1?arguments[1]:void 0)}},8457:function(e,t,n){"use strict";var r=n(9974),i=n(7908),o=n(3411),a=n(7659),s=n(7466),u=n(6135),c=n(1246);e.exports=function(e){var t,n,l,h,d,f,p=i(e),v="function"==typeof this?this:Array,g=arguments.length,m=g>1?arguments[1]:void 0,y=void 0!==m,_=c(p),b=0;if(y&&(m=r(m,g>2?arguments[2]:void 0,2)),null==_||v==Array&&a(_))for(n=new v(t=s(p.length));t>b;b++)f=y?m(p[b],b):p[b],u(n,b,f);else for(d=(h=_.call(p)).next,n=new v;!(l=d.call(h)).done;b++)f=y?o(h,m,[l.value,b],!0):l.value,u(n,b,f);return n.length=b,n}},1318:function(e,t,n){var r=n(5656),i=n(7466),o=n(1400),a=function(e){return function(t,n,a){var s,u=r(t),c=i(u.length),l=o(a,c);if(e&&n!=n){for(;c>l;)if((s=u[l++])!=s)return!0}else for(;c>l;l++)if((e||l in u)&&u[l]===n)return e||l||0;return!e&&-1}};e.exports={includes:a(!0),indexOf:a(!1)}},2092:function(e,t,n){var r=n(9974),i=n(8361),o=n(7908),a=n(7466),s=n(5417),u=[].push,c=function(e){var t=1==e,n=2==e,c=3==e,l=4==e,h=6==e,d=7==e,f=5==e||h;return function(p,v,g,m){for(var y,_,b=o(p),w=i(b),x=r(v,g,3),C=a(w.length),S=0,k=m||s,T=t?k(p,C):n||d?k(p,0):void 0;C>S;S++)if((f||S in w)&&(_=x(y=w[S],S,b),e))if(t)T[S]=_;else if(_)switch(e){case 3:return!0;case 5:return y;case 6:return S;case 2:u.call(T,y)}else switch(e){case 4:return!1;case 7:u.call(T,y)}return h?-1:c||l?l:T}};e.exports={forEach:c(0),map:c(1),filter:c(2),some:c(3),every:c(4),find:c(5),findIndex:c(6),filterOut:c(7)}},1194:function(e,t,n){var r=n(7293),i=n(5112),o=n(7392),a=i("species");e.exports=function(e){return o>=51||!r((function(){var t=[];return(t.constructor={})[a]=function(){return{foo:1}},1!==t[e](Boolean).foo}))}},9341:function(e,t,n){"use strict";var r=n(7293);e.exports=function(e,t){var n=[][e];return!!n&&r((function(){n.call(null,t||function(){throw 1},1)}))}},9207:function(e,t,n){var r=n(9781),i=n(7293),o=n(6656),a=Object.defineProperty,s={},u=function(e){throw e};e.exports=function(e,t){if(o(s,e))return s[e];t||(t={});var n=[][e],c=!!o(t,"ACCESSORS")&&t.ACCESSORS,l=o(t,0)?t[0]:u,h=o(t,1)?t[1]:void 0;return s[e]=!!n&&!i((function(){if(c&&!r)return!0;var e={length:-1};c?a(e,1,{enumerable:!0,get:u}):e[1]=1,n.call(e,l,h)}))}},3671:function(e,t,n){var r=n(3099),i=n(7908),o=n(8361),a=n(7466),s=function(e){return function(t,n,s,u){r(n);var c=i(t),l=o(c),h=a(c.length),d=e?h-1:0,f=e?-1:1;if(s<2)for(;;){if(d in l){u=l[d],d+=f;break}if(d+=f,e?d<0:h<=d)throw TypeError("Reduce of empty array with no initial value")}for(;e?d>=0:h>d;d+=f)d in l&&(u=n(u,l[d],d,c));return u}};e.exports={left:s(!1),right:s(!0)}},5417:function(e,t,n){var r=n(111),i=n(3157),o=n(5112)("species");e.exports=function(e,t){var n;return i(e)&&("function"!=typeof(n=e.constructor)||n!==Array&&!i(n.prototype)?r(n)&&null===(n=n[o])&&(n=void 0):n=void 0),new(void 0===n?Array:n)(0===t?0:t)}},3411:function(e,t,n){var r=n(9670),i=n(9212);e.exports=function(e,t,n,o){try{return o?t(r(n)[0],n[1]):t(n)}catch(t){throw i(e),t}}},7072:function(e,t,n){var r=n(5112)("iterator"),i=!1;try{var o=0,a={next:function(){return{done:!!o++}},return:function(){i=!0}};a[r]=function(){return this},Array.from(a,(function(){throw 2}))}catch(e){}e.exports=function(e,t){if(!t&&!i)return!1;var n=!1;try{var o={};o[r]=function(){return{next:function(){return{done:n=!0}}}},e(o)}catch(e){}return n}},4326:function(e){var t={}.toString;e.exports=function(e){return t.call(e).slice(8,-1)}},648:function(e,t,n){var r=n(1694),i=n(4326),o=n(5112)("toStringTag"),a="Arguments"==i(function(){return arguments}());e.exports=r?i:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),o))?n:a?i(t):"Object"==(r=i(t))&&"function"==typeof t.callee?"Arguments":r}},9920:function(e,t,n){var r=n(6656),i=n(3887),o=n(1236),a=n(3070);e.exports=function(e,t){for(var n=i(t),s=a.f,u=o.f,c=0;c<n.length;c++){var l=n[c];r(e,l)||s(e,l,u(t,l))}}},4964:function(e,t,n){var r=n(5112)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[r]=!1,"/./"[e](t)}catch(e){}}return!1}},8544:function(e,t,n){var r=n(7293);e.exports=!r((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},4994:function(e,t,n){"use strict";var r=n(3383).IteratorPrototype,i=n(30),o=n(9114),a=n(8003),s=n(7497),u=function(){return this};e.exports=function(e,t,n){var c=t+" Iterator";return e.prototype=i(r,{next:o(1,n)}),a(e,c,!1,!0),s[c]=u,e}},8880:function(e,t,n){var r=n(9781),i=n(3070),o=n(9114);e.exports=r?function(e,t,n){return i.f(e,t,o(1,n))}:function(e,t,n){return e[t]=n,e}},9114:function(e){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},6135:function(e,t,n){"use strict";var r=n(7593),i=n(3070),o=n(9114);e.exports=function(e,t,n){var a=r(t);a in e?i.f(e,a,o(0,n)):e[a]=n}},5573:function(e,t,n){"use strict";var r=n(7293),i=n(6650).start,o=Math.abs,a=Date.prototype,s=a.getTime,u=a.toISOString;e.exports=r((function(){return"0385-07-25T07:06:39.999Z"!=u.call(new Date(-50000000000001))}))||!r((function(){u.call(new Date(NaN))}))?function(){if(!isFinite(s.call(this)))throw RangeError("Invalid time value");var e=this,t=e.getUTCFullYear(),n=e.getUTCMilliseconds(),r=t<0?"-":t>9999?"+":"";return r+i(o(t),r?6:4,0)+"-"+i(e.getUTCMonth()+1,2,0)+"-"+i(e.getUTCDate(),2,0)+"T"+i(e.getUTCHours(),2,0)+":"+i(e.getUTCMinutes(),2,0)+":"+i(e.getUTCSeconds(),2,0)+"."+i(n,3,0)+"Z"}:u},654:function(e,t,n){"use strict";var r=n(2109),i=n(4994),o=n(9518),a=n(7674),s=n(8003),u=n(8880),c=n(1320),l=n(5112),h=n(1913),d=n(7497),f=n(3383),p=f.IteratorPrototype,v=f.BUGGY_SAFARI_ITERATORS,g=l("iterator"),m="keys",y="values",_="entries",b=function(){return this};e.exports=function(e,t,n,l,f,w,x){i(n,t,l);var C,S,k,T=function(e){if(e===f&&R)return R;if(!v&&e in P)return P[e];switch(e){case m:case y:case _:return function(){return new n(this,e)}}return function(){return new n(this)}},E=t+" Iterator",L=!1,P=e.prototype,O=P[g]||P["@@iterator"]||f&&P[f],R=!v&&O||T(f),Z="Array"==t&&P.entries||O;if(Z&&(C=o(Z.call(new e)),p!==Object.prototype&&C.next&&(h||o(C)===p||(a?a(C,p):"function"!=typeof C[g]&&u(C,g,b)),s(C,E,!0,!0),h&&(d[E]=b))),f==y&&O&&O.name!==y&&(L=!0,R=function(){return O.call(this)}),h&&!x||P[g]===R||u(P,g,R),d[t]=R,f)if(S={values:T(y),keys:w?R:T(m),entries:T(_)},x)for(k in S)(v||L||!(k in P))&&c(P,k,S[k]);else r({target:t,proto:!0,forced:v||L},S);return S}},7235:function(e,t,n){var r=n(857),i=n(6656),o=n(6061),a=n(3070).f;e.exports=function(e){var t=r.Symbol||(r.Symbol={});i(t,e)||a(t,e,{value:o.f(e)})}},9781:function(e,t,n){var r=n(7293);e.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},317:function(e,t,n){var r=n(7854),i=n(111),o=r.document,a=i(o)&&i(o.createElement);e.exports=function(e){return a?o.createElement(e):{}}},8324:function(e){e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},6833:function(e,t,n){var r=n(8113);e.exports=/(iphone|ipod|ipad).*applewebkit/i.test(r)},5268:function(e,t,n){var r=n(4326),i=n(7854);e.exports="process"==r(i.process)},8113:function(e,t,n){var r=n(5005);e.exports=r("navigator","userAgent")||""},7392:function(e,t,n){var r,i,o=n(7854),a=n(8113),s=o.process,u=s&&s.versions,c=u&&u.v8;c?i=(r=c.split("."))[0]+r[1]:a&&(!(r=a.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=a.match(/Chrome\/(\d+)/))&&(i=r[1]),e.exports=i&&+i},748:function(e){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},2109:function(e,t,n){var r=n(7854),i=n(1236).f,o=n(8880),a=n(1320),s=n(3505),u=n(9920),c=n(4705);e.exports=function(e,t){var n,l,h,d,f,p=e.target,v=e.global,g=e.stat;if(n=v?r:g?r[p]||s(p,{}):(r[p]||{}).prototype)for(l in t){if(d=t[l],h=e.noTargetGet?(f=i(n,l))&&f.value:n[l],!c(v?l:p+(g?".":"#")+l,e.forced)&&void 0!==h){if(typeof d==typeof h)continue;u(d,h)}(e.sham||h&&h.sham)&&o(d,"sham",!0),a(n,l,d,e)}}},7293:function(e){e.exports=function(e){try{return!!e()}catch(e){return!0}}},7007:function(e,t,n){"use strict";n(4916);var r=n(1320),i=n(7293),o=n(5112),a=n(2261),s=n(8880),u=o("species"),c=!i((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")})),l="$0"==="a".replace(/./,"$0"),h=o("replace"),d=!!/./[h]&&""===/./[h]("a","$0"),f=!i((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2!==n.length||"a"!==n[0]||"b"!==n[1]}));e.exports=function(e,t,n,h){var p=o(e),v=!i((function(){var t={};return t[p]=function(){return 7},7!=""[e](t)})),g=v&&!i((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[u]=function(){return n},n.flags="",n[p]=/./[p]),n.exec=function(){return t=!0,null},n[p](""),!t}));if(!v||!g||"replace"===e&&(!c||!l||d)||"split"===e&&!f){var m=/./[p],y=n(p,""[e],(function(e,t,n,r,i){return t.exec===a?v&&!i?{done:!0,value:m.call(t,n,r)}:{done:!0,value:e.call(n,t,r)}:{done:!1}}),{REPLACE_KEEPS_$0:l,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:d}),_=y[0],b=y[1];r(String.prototype,e,_),r(RegExp.prototype,p,2==t?function(e,t){return b.call(e,this,t)}:function(e){return b.call(e,this)})}h&&s(RegExp.prototype[p],"sham",!0)}},9974:function(e,t,n){var r=n(3099);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 0:return function(){return e.call(t)};case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}},7065:function(e,t,n){"use strict";var r=n(3099),i=n(111),o=[].slice,a={},s=function(e,t,n){if(!(t in a)){for(var r=[],i=0;i<t;i++)r[i]="a["+i+"]";a[t]=Function("C,a","return new C("+r.join(",")+")")}return a[t](e,n)};e.exports=Function.bind||function(e){var t=r(this),n=o.call(arguments,1),a=function(){var r=n.concat(o.call(arguments));return this instanceof a?s(t,r.length,r):t.apply(e,r)};return i(t.prototype)&&(a.prototype=t.prototype),a}},5005:function(e,t,n){var r=n(857),i=n(7854),o=function(e){return"function"==typeof e?e:void 0};e.exports=function(e,t){return arguments.length<2?o(r[e])||o(i[e]):r[e]&&r[e][t]||i[e]&&i[e][t]}},1246:function(e,t,n){var r=n(648),i=n(7497),o=n(5112)("iterator");e.exports=function(e){if(null!=e)return e[o]||e["@@iterator"]||i[r(e)]}},8554:function(e,t,n){var r=n(9670),i=n(1246);e.exports=function(e){var t=i(e);if("function"!=typeof t)throw TypeError(String(e)+" is not iterable");return r(t.call(e))}},7854:function(e,t,n){var r=function(e){return e&&e.Math==Math&&e};e.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof n.g&&n.g)||function(){return this}()||Function("return this")()},6656:function(e){var t={}.hasOwnProperty;e.exports=function(e,n){return t.call(e,n)}},3501:function(e){e.exports={}},842:function(e,t,n){var r=n(7854);e.exports=function(e,t){var n=r.console;n&&n.error&&(1===arguments.length?n.error(e):n.error(e,t))}},490:function(e,t,n){var r=n(5005);e.exports=r("document","documentElement")},4664:function(e,t,n){var r=n(9781),i=n(7293),o=n(317);e.exports=!r&&!i((function(){return 7!=Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},8361:function(e,t,n){var r=n(7293),i=n(4326),o="".split;e.exports=r((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==i(e)?o.call(e,""):Object(e)}:Object},9587:function(e,t,n){var r=n(111),i=n(7674);e.exports=function(e,t,n){var o,a;return i&&"function"==typeof(o=t.constructor)&&o!==n&&r(a=o.prototype)&&a!==n.prototype&&i(e,a),e}},2788:function(e,t,n){var r=n(5465),i=Function.toString;"function"!=typeof r.inspectSource&&(r.inspectSource=function(e){return i.call(e)}),e.exports=r.inspectSource},9909:function(e,t,n){var r,i,o,a=n(8536),s=n(7854),u=n(111),c=n(8880),l=n(6656),h=n(5465),d=n(6200),f=n(3501),p=s.WeakMap;if(a){var v=h.state||(h.state=new p),g=v.get,m=v.has,y=v.set;r=function(e,t){return t.facade=e,y.call(v,e,t),t},i=function(e){return g.call(v,e)||{}},o=function(e){return m.call(v,e)}}else{var _=d("state");f[_]=!0,r=function(e,t){return t.facade=e,c(e,_,t),t},i=function(e){return l(e,_)?e[_]:{}},o=function(e){return l(e,_)}}e.exports={set:r,get:i,has:o,enforce:function(e){return o(e)?i(e):r(e,{})},getterFor:function(e){return function(t){var n;if(!u(t)||(n=i(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}}}},7659:function(e,t,n){var r=n(5112),i=n(7497),o=r("iterator"),a=Array.prototype;e.exports=function(e){return void 0!==e&&(i.Array===e||a[o]===e)}},3157:function(e,t,n){var r=n(4326);e.exports=Array.isArray||function(e){return"Array"==r(e)}},4705:function(e,t,n){var r=n(7293),i=/#|\.prototype\./,o=function(e,t){var n=s[a(e)];return n==c||n!=u&&("function"==typeof t?r(t):!!t)},a=o.normalize=function(e){return String(e).replace(i,".").toLowerCase()},s=o.data={},u=o.NATIVE="N",c=o.POLYFILL="P";e.exports=o},111:function(e){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},1913:function(e){e.exports=!1},7850:function(e,t,n){var r=n(111),i=n(4326),o=n(5112)("match");e.exports=function(e){var t;return r(e)&&(void 0!==(t=e[o])?!!t:"RegExp"==i(e))}},408:function(e,t,n){var r=n(9670),i=n(7659),o=n(7466),a=n(9974),s=n(1246),u=n(9212),c=function(e,t){this.stopped=e,this.result=t};e.exports=function(e,t,n){var l,h,d,f,p,v,g,m=n&&n.that,y=!(!n||!n.AS_ENTRIES),_=!(!n||!n.IS_ITERATOR),b=!(!n||!n.INTERRUPTED),w=a(t,m,1+y+b),x=function(e){return l&&u(l),new c(!0,e)},C=function(e){return y?(r(e),b?w(e[0],e[1],x):w(e[0],e[1])):b?w(e,x):w(e)};if(_)l=e;else{if("function"!=typeof(h=s(e)))throw TypeError("Target is not iterable");if(i(h)){for(d=0,f=o(e.length);f>d;d++)if((p=C(e[d]))&&p instanceof c)return p;return new c(!1)}l=h.call(e)}for(v=l.next;!(g=v.call(l)).done;){try{p=C(g.value)}catch(e){throw u(l),e}if("object"==typeof p&&p&&p instanceof c)return p}return new c(!1)}},9212:function(e,t,n){var r=n(9670);e.exports=function(e){var t=e.return;if(void 0!==t)return r(t.call(e)).value}},3383:function(e,t,n){"use strict";var r,i,o,a=n(9518),s=n(8880),u=n(6656),c=n(5112),l=n(1913),h=c("iterator"),d=!1;[].keys&&("next"in(o=[].keys())?(i=a(a(o)))!==Object.prototype&&(r=i):d=!0),null==r&&(r={}),l||u(r,h)||s(r,h,(function(){return this})),e.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:d}},7497:function(e){e.exports={}},5948:function(e,t,n){var r,i,o,a,s,u,c,l,h=n(7854),d=n(1236).f,f=n(261).set,p=n(6833),v=n(5268),g=h.MutationObserver||h.WebKitMutationObserver,m=h.document,y=h.process,_=h.Promise,b=d(h,"queueMicrotask"),w=b&&b.value;w||(r=function(){var e,t;for(v&&(e=y.domain)&&e.exit();i;){t=i.fn,i=i.next;try{t()}catch(e){throw i?a():o=void 0,e}}o=void 0,e&&e.enter()},!p&&!v&&g&&m?(s=!0,u=m.createTextNode(""),new g(r).observe(u,{characterData:!0}),a=function(){u.data=s=!s}):_&&_.resolve?(c=_.resolve(void 0),l=c.then,a=function(){l.call(c,r)}):a=v?function(){y.nextTick(r)}:function(){f.call(h,r)}),e.exports=w||function(e){var t={fn:e,next:void 0};o&&(o.next=t),i||(i=t,a()),o=t}},3366:function(e,t,n){var r=n(7854);e.exports=r.Promise},133:function(e,t,n){var r=n(7293);e.exports=!!Object.getOwnPropertySymbols&&!r((function(){return!String(Symbol())}))},590:function(e,t,n){var r=n(7293),i=n(5112),o=n(1913),a=i("iterator");e.exports=!r((function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,n="";return e.pathname="c%20d",t.forEach((function(e,r){t.delete("b"),n+=r+e})),o&&!e.toJSON||!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[a]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==n||"x"!==new URL("http://x",void 0).host}))},8536:function(e,t,n){var r=n(7854),i=n(2788),o=r.WeakMap;e.exports="function"==typeof o&&/native code/.test(i(o))},8523:function(e,t,n){"use strict";var r=n(3099),i=function(e){var t,n;this.promise=new e((function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r})),this.resolve=r(t),this.reject=r(n)};e.exports.f=function(e){return new i(e)}},3929:function(e,t,n){var r=n(7850);e.exports=function(e){if(r(e))throw TypeError("The method doesn't accept regular expressions");return e}},3009:function(e,t,n){var r=n(7854),i=n(3111).trim,o=n(1361),a=r.parseInt,s=/^[+-]?0[Xx]/,u=8!==a(o+"08")||22!==a(o+"0x16");e.exports=u?function(e,t){var n=i(String(e));return a(n,t>>>0||(s.test(n)?16:10))}:a},1574:function(e,t,n){"use strict";var r=n(9781),i=n(7293),o=n(1956),a=n(5181),s=n(5296),u=n(7908),c=n(8361),l=Object.assign,h=Object.defineProperty;e.exports=!l||i((function(){if(r&&1!==l({b:1},l(h({},"a",{enumerable:!0,get:function(){h(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},n=Symbol(),i="abcdefghijklmnopqrst";return e[n]=7,i.split("").forEach((function(e){t[e]=e})),7!=l({},e)[n]||o(l({},t)).join("")!=i}))?function(e,t){for(var n=u(e),i=arguments.length,l=1,h=a.f,d=s.f;i>l;)for(var f,p=c(arguments[l++]),v=h?o(p).concat(h(p)):o(p),g=v.length,m=0;g>m;)f=v[m++],r&&!d.call(p,f)||(n[f]=p[f]);return n}:l},30:function(e,t,n){var r,i=n(9670),o=n(6048),a=n(748),s=n(3501),u=n(490),c=n(317),l=n(6200),h="prototype",d="script",f=l("IE_PROTO"),p=function(){},v=function(e){return"<"+d+">"+e+"</"+d+">"},g=function(){try{r=document.domain&&new ActiveXObject("htmlfile")}catch(e){}var e,t,n;g=r?function(e){e.write(v("")),e.close();var t=e.parentWindow.Object;return e=null,t}(r):(t=c("iframe"),n="java"+d+":",t.style.display="none",u.appendChild(t),t.src=String(n),(e=t.contentWindow.document).open(),e.write(v("document.F=Object")),e.close(),e.F);for(var i=a.length;i--;)delete g[h][a[i]];return g()};s[f]=!0,e.exports=Object.create||function(e,t){var n;return null!==e?(p[h]=i(e),n=new p,p[h]=null,n[f]=e):n=g(),void 0===t?n:o(n,t)}},6048:function(e,t,n){var r=n(9781),i=n(3070),o=n(9670),a=n(1956);e.exports=r?Object.defineProperties:function(e,t){o(e);for(var n,r=a(t),s=r.length,u=0;s>u;)i.f(e,n=r[u++],t[n]);return e}},3070:function(e,t,n){var r=n(9781),i=n(4664),o=n(9670),a=n(7593),s=Object.defineProperty;t.f=r?s:function(e,t,n){if(o(e),t=a(t,!0),o(n),i)try{return s(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},1236:function(e,t,n){var r=n(9781),i=n(5296),o=n(9114),a=n(5656),s=n(7593),u=n(6656),c=n(4664),l=Object.getOwnPropertyDescriptor;t.f=r?l:function(e,t){if(e=a(e),t=s(t,!0),c)try{return l(e,t)}catch(e){}if(u(e,t))return o(!i.f.call(e,t),e[t])}},1156:function(e,t,n){var r=n(5656),i=n(8006).f,o={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return a&&"[object Window]"==o.call(e)?function(e){try{return i(e)}catch(e){return a.slice()}}(e):i(r(e))}},8006:function(e,t,n){var r=n(6324),i=n(748).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,i)}},5181:function(e,t){t.f=Object.getOwnPropertySymbols},9518:function(e,t,n){var r=n(6656),i=n(7908),o=n(6200),a=n(8544),s=o("IE_PROTO"),u=Object.prototype;e.exports=a?Object.getPrototypeOf:function(e){return e=i(e),r(e,s)?e[s]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?u:null}},6324:function(e,t,n){var r=n(6656),i=n(5656),o=n(1318).indexOf,a=n(3501);e.exports=function(e,t){var n,s=i(e),u=0,c=[];for(n in s)!r(a,n)&&r(s,n)&&c.push(n);for(;t.length>u;)r(s,n=t[u++])&&(~o(c,n)||c.push(n));return c}},1956:function(e,t,n){var r=n(6324),i=n(748);e.exports=Object.keys||function(e){return r(e,i)}},5296:function(e,t){"use strict";var n={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,i=r&&!n.call({1:2},1);t.f=i?function(e){var t=r(this,e);return!!t&&t.enumerable}:n},7674:function(e,t,n){var r=n(9670),i=n(6077);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),t=n instanceof Array}catch(e){}return function(n,o){return r(n),i(o),t?e.call(n,o):n.__proto__=o,n}}():void 0)},4699:function(e,t,n){var r=n(9781),i=n(1956),o=n(5656),a=n(5296).f,s=function(e){return function(t){for(var n,s=o(t),u=i(s),c=u.length,l=0,h=[];c>l;)n=u[l++],r&&!a.call(s,n)||h.push(e?[n,s[n]]:s[n]);return h}};e.exports={entries:s(!0),values:s(!1)}},288:function(e,t,n){"use strict";var r=n(1694),i=n(648);e.exports=r?{}.toString:function(){return"[object "+i(this)+"]"}},3887:function(e,t,n){var r=n(5005),i=n(8006),o=n(5181),a=n(9670);e.exports=r("Reflect","ownKeys")||function(e){var t=i.f(a(e)),n=o.f;return n?t.concat(n(e)):t}},857:function(e,t,n){var r=n(7854);e.exports=r},2534:function(e){e.exports=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}},9478:function(e,t,n){var r=n(9670),i=n(111),o=n(8523);e.exports=function(e,t){if(r(e),i(t)&&t.constructor===e)return t;var n=o.f(e);return(0,n.resolve)(t),n.promise}},2248:function(e,t,n){var r=n(1320);e.exports=function(e,t,n){for(var i in t)r(e,i,t[i],n);return e}},1320:function(e,t,n){var r=n(7854),i=n(8880),o=n(6656),a=n(3505),s=n(2788),u=n(9909),c=u.get,l=u.enforce,h=String(String).split("String");(e.exports=function(e,t,n,s){var u,c=!!s&&!!s.unsafe,d=!!s&&!!s.enumerable,f=!!s&&!!s.noTargetGet;"function"==typeof n&&("string"!=typeof t||o(n,"name")||i(n,"name",t),(u=l(n)).source||(u.source=h.join("string"==typeof t?t:""))),e!==r?(c?!f&&e[t]&&(d=!0):delete e[t],d?e[t]=n:i(e,t,n)):d?e[t]=n:a(t,n)})(Function.prototype,"toString",(function(){return"function"==typeof this&&c(this).source||s(this)}))},7651:function(e,t,n){var r=n(4326),i=n(2261);e.exports=function(e,t){var n=e.exec;if("function"==typeof n){var o=n.call(e,t);if("object"!=typeof o)throw TypeError("RegExp exec method returned something other than an Object or null");return o}if("RegExp"!==r(e))throw TypeError("RegExp#exec called on incompatible receiver");return i.call(e,t)}},2261:function(e,t,n){"use strict";var r,i,o=n(7066),a=n(2999),s=RegExp.prototype.exec,u=String.prototype.replace,c=s,l=(r=/a/,i=/b*/g,s.call(r,"a"),s.call(i,"a"),0!==r.lastIndex||0!==i.lastIndex),h=a.UNSUPPORTED_Y||a.BROKEN_CARET,d=void 0!==/()??/.exec("")[1];(l||d||h)&&(c=function(e){var t,n,r,i,a=this,c=h&&a.sticky,f=o.call(a),p=a.source,v=0,g=e;return c&&(-1===(f=f.replace("y","")).indexOf("g")&&(f+="g"),g=String(e).slice(a.lastIndex),a.lastIndex>0&&(!a.multiline||a.multiline&&"\n"!==e[a.lastIndex-1])&&(p="(?: "+p+")",g=" "+g,v++),n=new RegExp("^(?:"+p+")",f)),d&&(n=new RegExp("^"+p+"$(?!\\s)",f)),l&&(t=a.lastIndex),r=s.call(c?n:a,g),c?r?(r.input=r.input.slice(v),r[0]=r[0].slice(v),r.index=a.lastIndex,a.lastIndex+=r[0].length):a.lastIndex=0:l&&r&&(a.lastIndex=a.global?r.index+r[0].length:t),d&&r&&r.length>1&&u.call(r[0],n,(function(){for(i=1;i<arguments.length-2;i++)void 0===arguments[i]&&(r[i]=void 0)})),r}),e.exports=c},7066:function(e,t,n){"use strict";var r=n(9670);e.exports=function(){var e=r(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}},2999:function(e,t,n){"use strict";var r=n(7293);function i(e,t){return RegExp(e,t)}t.UNSUPPORTED_Y=r((function(){var e=i("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),t.BROKEN_CARET=r((function(){var e=i("^r","gy");return e.lastIndex=2,null!=e.exec("str")}))},4488:function(e){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},1150:function(e){e.exports=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}},3505:function(e,t,n){var r=n(7854),i=n(8880);e.exports=function(e,t){try{i(r,e,t)}catch(n){r[e]=t}return t}},6340:function(e,t,n){"use strict";var r=n(5005),i=n(3070),o=n(5112),a=n(9781),s=o("species");e.exports=function(e){var t=r(e),n=i.f;a&&t&&!t[s]&&n(t,s,{configurable:!0,get:function(){return this}})}},8003:function(e,t,n){var r=n(3070).f,i=n(6656),o=n(5112)("toStringTag");e.exports=function(e,t,n){e&&!i(e=n?e:e.prototype,o)&&r(e,o,{configurable:!0,value:t})}},6200:function(e,t,n){var r=n(2309),i=n(9711),o=r("keys");e.exports=function(e){return o[e]||(o[e]=i(e))}},5465:function(e,t,n){var r=n(7854),i=n(3505),o="__core-js_shared__",a=r[o]||i(o,{});e.exports=a},2309:function(e,t,n){var r=n(1913),i=n(5465);(e.exports=function(e,t){return i[e]||(i[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.8.1",mode:r?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},6707:function(e,t,n){var r=n(9670),i=n(3099),o=n(5112)("species");e.exports=function(e,t){var n,a=r(e).constructor;return void 0===a||null==(n=r(a)[o])?t:i(n)}},8710:function(e,t,n){var r=n(9958),i=n(4488),o=function(e){return function(t,n){var o,a,s=String(i(t)),u=r(n),c=s.length;return u<0||u>=c?e?"":void 0:(o=s.charCodeAt(u))<55296||o>56319||u+1===c||(a=s.charCodeAt(u+1))<56320||a>57343?e?s.charAt(u):o:e?s.slice(u,u+2):a-56320+(o-55296<<10)+65536}};e.exports={codeAt:o(!1),charAt:o(!0)}},4986:function(e,t,n){var r=n(8113);e.exports=/Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(r)},6650:function(e,t,n){var r=n(7466),i=n(8415),o=n(4488),a=Math.ceil,s=function(e){return function(t,n,s){var u,c,l=String(o(t)),h=l.length,d=void 0===s?" ":String(s),f=r(n);return f<=h||""==d?l:(u=f-h,(c=i.call(d,a(u/d.length))).length>u&&(c=c.slice(0,u)),e?l+c:c+l)}};e.exports={start:s(!1),end:s(!0)}},3197:function(e){"use strict";var t=2147483647,n=/[^\0-\u007E]/,r=/[.\u3002\uFF0E\uFF61]/g,i="Overflow: input needs wider integers to process",o=Math.floor,a=String.fromCharCode,s=function(e){return e+22+75*(e<26)},u=function(e,t,n){var r=0;for(e=n?o(e/700):e>>1,e+=o(e/t);e>455;r+=36)e=o(e/35);return o(r+36*e/(e+38))},c=function(e){var n=[];e=function(e){for(var t=[],n=0,r=e.length;n<r;){var i=e.charCodeAt(n++);if(i>=55296&&i<=56319&&n<r){var o=e.charCodeAt(n++);56320==(64512&o)?t.push(((1023&i)<<10)+(1023&o)+65536):(t.push(i),n--)}else t.push(i)}return t}(e);var r,c,l=e.length,h=128,d=0,f=72;for(r=0;r<e.length;r++)(c=e[r])<128&&n.push(a(c));var p=n.length,v=p;for(p&&n.push("-");v<l;){var g=t;for(r=0;r<e.length;r++)(c=e[r])>=h&&c<g&&(g=c);var m=v+1;if(g-h>o((t-d)/m))throw RangeError(i);for(d+=(g-h)*m,h=g,r=0;r<e.length;r++){if((c=e[r])<h&&++d>t)throw RangeError(i);if(c==h){for(var y=d,_=36;;_+=36){var b=_<=f?1:_>=f+26?26:_-f;if(y<b)break;var w=y-b,x=36-b;n.push(a(s(b+w%x))),y=o(w/x)}n.push(a(s(y))),f=u(d,m,v==p),d=0,++v}}++d,++h}return n.join("")};e.exports=function(e){var t,i,o=[],a=e.toLowerCase().replace(r,".").split(".");for(t=0;t<a.length;t++)i=a[t],o.push(n.test(i)?"xn--"+c(i):i);return o.join(".")}},8415:function(e,t,n){"use strict";var r=n(9958),i=n(4488);e.exports="".repeat||function(e){var t=String(i(this)),n="",o=r(e);if(o<0||o==1/0)throw RangeError("Wrong number of repetitions");for(;o>0;(o>>>=1)&&(t+=t))1&o&&(n+=t);return n}},3111:function(e,t,n){var r=n(4488),i="["+n(1361)+"]",o=RegExp("^"+i+i+"*"),a=RegExp(i+i+"*$"),s=function(e){return function(t){var n=String(r(t));return 1&e&&(n=n.replace(o,"")),2&e&&(n=n.replace(a,"")),n}};e.exports={start:s(1),end:s(2),trim:s(3)}},261:function(e,t,n){var r,i,o,a=n(7854),s=n(7293),u=n(9974),c=n(490),l=n(317),h=n(6833),d=n(5268),f=a.location,p=a.setImmediate,v=a.clearImmediate,g=a.process,m=a.MessageChannel,y=a.Dispatch,_=0,b={},w="onreadystatechange",x=function(e){if(b.hasOwnProperty(e)){var t=b[e];delete b[e],t()}},C=function(e){return function(){x(e)}},S=function(e){x(e.data)},k=function(e){a.postMessage(e+"",f.protocol+"//"+f.host)};p&&v||(p=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return b[++_]=function(){("function"==typeof e?e:Function(e)).apply(void 0,t)},r(_),_},v=function(e){delete b[e]},d?r=function(e){g.nextTick(C(e))}:y&&y.now?r=function(e){y.now(C(e))}:m&&!h?(o=(i=new m).port2,i.port1.onmessage=S,r=u(o.postMessage,o,1)):a.addEventListener&&"function"==typeof postMessage&&!a.importScripts&&f&&"file:"!==f.protocol&&!s(k)?(r=k,a.addEventListener("message",S,!1)):r=w in l("script")?function(e){c.appendChild(l("script"))[w]=function(){c.removeChild(this),x(e)}}:function(e){setTimeout(C(e),0)}),e.exports={set:p,clear:v}},1400:function(e,t,n){var r=n(9958),i=Math.max,o=Math.min;e.exports=function(e,t){var n=r(e);return n<0?i(n+t,0):o(n,t)}},5656:function(e,t,n){var r=n(8361),i=n(4488);e.exports=function(e){return r(i(e))}},9958:function(e){var t=Math.ceil,n=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?n:t)(e)}},7466:function(e,t,n){var r=n(9958),i=Math.min;e.exports=function(e){return e>0?i(r(e),9007199254740991):0}},7908:function(e,t,n){var r=n(4488);e.exports=function(e){return Object(r(e))}},7593:function(e,t,n){var r=n(111);e.exports=function(e,t){if(!r(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!r(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},1694:function(e,t,n){var r={};r[n(5112)("toStringTag")]="z",e.exports="[object z]"===String(r)},9711:function(e){var t=0,n=Math.random();e.exports=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++t+n).toString(36)}},3307:function(e,t,n){var r=n(133);e.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},6061:function(e,t,n){var r=n(5112);t.f=r},5112:function(e,t,n){var r=n(7854),i=n(2309),o=n(6656),a=n(9711),s=n(133),u=n(3307),c=i("wks"),l=r.Symbol,h=u?l:l&&l.withoutSetter||a;e.exports=function(e){return o(c,e)||(s&&o(l,e)?c[e]=l[e]:c[e]=h("Symbol."+e)),c[e]}},1361:function(e){e.exports="\t\n\v\f\r                 \u2028\u2029\ufeff"},2222:function(e,t,n){"use strict";var r=n(2109),i=n(7293),o=n(3157),a=n(111),s=n(7908),u=n(7466),c=n(6135),l=n(5417),h=n(1194),d=n(5112),f=n(7392),p=d("isConcatSpreadable"),v=9007199254740991,g="Maximum allowed index exceeded",m=f>=51||!i((function(){var e=[];return e[p]=!1,e.concat()[0]!==e})),y=h("concat"),_=function(e){if(!a(e))return!1;var t=e[p];return void 0!==t?!!t:o(e)};r({target:"Array",proto:!0,forced:!m||!y},{concat:function(e){var t,n,r,i,o,a=s(this),h=l(a,0),d=0;for(t=-1,r=arguments.length;t<r;t++)if(_(o=-1===t?a:arguments[t])){if(d+(i=u(o.length))>v)throw TypeError(g);for(n=0;n<i;n++,d++)n in o&&c(h,d,o[n])}else{if(d>=v)throw TypeError(g);c(h,d++,o)}return h.length=d,h}})},3290:function(e,t,n){var r=n(2109),i=n(1285),o=n(1223);r({target:"Array",proto:!0},{fill:i}),o("fill")},7327:function(e,t,n){"use strict";var r=n(2109),i=n(2092).filter,o=n(1194),a=n(9207),s=o("filter"),u=a("filter");r({target:"Array",proto:!0,forced:!s||!u},{filter:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},4553:function(e,t,n){"use strict";var r=n(2109),i=n(2092).findIndex,o=n(1223),a=n(9207),s="findIndex",u=!0,c=a(s);s in[]&&Array(1)[s]((function(){u=!1})),r({target:"Array",proto:!0,forced:u||!c},{findIndex:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),o(s)},9826:function(e,t,n){"use strict";var r=n(2109),i=n(2092).find,o=n(1223),a=n(9207),s="find",u=!0,c=a(s);s in[]&&Array(1)[s]((function(){u=!1})),r({target:"Array",proto:!0,forced:u||!c},{find:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),o(s)},9554:function(e,t,n){"use strict";var r=n(2109),i=n(8533);r({target:"Array",proto:!0,forced:[].forEach!=i},{forEach:i})},6699:function(e,t,n){"use strict";var r=n(2109),i=n(1318).includes,o=n(1223);r({target:"Array",proto:!0,forced:!n(9207)("indexOf",{ACCESSORS:!0,1:0})},{includes:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),o("includes")},2772:function(e,t,n){"use strict";var r=n(2109),i=n(1318).indexOf,o=n(9341),a=n(9207),s=[].indexOf,u=!!s&&1/[1].indexOf(1,-0)<0,c=o("indexOf"),l=a("indexOf",{ACCESSORS:!0,1:0});r({target:"Array",proto:!0,forced:u||!c||!l},{indexOf:function(e){return u?s.apply(this,arguments)||0:i(this,e,arguments.length>1?arguments[1]:void 0)}})},9753:function(e,t,n){n(2109)({target:"Array",stat:!0},{isArray:n(3157)})},6992:function(e,t,n){"use strict";var r=n(5656),i=n(1223),o=n(7497),a=n(9909),s=n(654),u="Array Iterator",c=a.set,l=a.getterFor(u);e.exports=s(Array,"Array",(function(e,t){c(this,{type:u,target:r(e),index:0,kind:t})}),(function(){var e=l(this),t=e.target,n=e.kind,r=e.index++;return!t||r>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:r,done:!1}:"values"==n?{value:t[r],done:!1}:{value:[r,t[r]],done:!1}}),"values"),o.Arguments=o.Array,i("keys"),i("values"),i("entries")},9600:function(e,t,n){"use strict";var r=n(2109),i=n(8361),o=n(5656),a=n(9341),s=[].join,u=i!=Object,c=a("join",",");r({target:"Array",proto:!0,forced:u||!c},{join:function(e){return s.call(o(this),void 0===e?",":e)}})},1249:function(e,t,n){"use strict";var r=n(2109),i=n(2092).map,o=n(1194),a=n(9207),s=o("map"),u=a("map");r({target:"Array",proto:!0,forced:!s||!u},{map:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},5827:function(e,t,n){"use strict";var r=n(2109),i=n(3671).left,o=n(9341),a=n(9207),s=n(7392),u=n(5268),c=o("reduce"),l=a("reduce",{1:0});r({target:"Array",proto:!0,forced:!c||!l||!u&&s>79&&s<83},{reduce:function(e){return i(this,e,arguments.length,arguments.length>1?arguments[1]:void 0)}})},7042:function(e,t,n){"use strict";var r=n(2109),i=n(111),o=n(3157),a=n(1400),s=n(7466),u=n(5656),c=n(6135),l=n(5112),h=n(1194),d=n(9207),f=h("slice"),p=d("slice",{ACCESSORS:!0,0:0,1:2}),v=l("species"),g=[].slice,m=Math.max;r({target:"Array",proto:!0,forced:!f||!p},{slice:function(e,t){var n,r,l,h=u(this),d=s(h.length),f=a(e,d),p=a(void 0===t?d:t,d);if(o(h)&&("function"!=typeof(n=h.constructor)||n!==Array&&!o(n.prototype)?i(n)&&null===(n=n[v])&&(n=void 0):n=void 0,n===Array||void 0===n))return g.call(h,f,p);for(r=new(void 0===n?Array:n)(m(p-f,0)),l=0;f<p;f++,l++)f in h&&c(r,l,h[f]);return r.length=l,r}})},561:function(e,t,n){"use strict";var r=n(2109),i=n(1400),o=n(9958),a=n(7466),s=n(7908),u=n(5417),c=n(6135),l=n(1194),h=n(9207),d=l("splice"),f=h("splice",{ACCESSORS:!0,0:0,1:2}),p=Math.max,v=Math.min,g=9007199254740991,m="Maximum allowed length exceeded";r({target:"Array",proto:!0,forced:!d||!f},{splice:function(e,t){var n,r,l,h,d,f,y=s(this),_=a(y.length),b=i(e,_),w=arguments.length;if(0===w?n=r=0:1===w?(n=0,r=_-b):(n=w-2,r=v(p(o(t),0),_-b)),_+n-r>g)throw TypeError(m);for(l=u(y,r),h=0;h<r;h++)(d=b+h)in y&&c(l,h,y[d]);if(l.length=r,n<r){for(h=b;h<_-r;h++)f=h+n,(d=h+r)in y?y[f]=y[d]:delete y[f];for(h=_;h>_-r+n;h--)delete y[h-1]}else if(n>r)for(h=_-r;h>b;h--)f=h+n-1,(d=h+r-1)in y?y[f]=y[d]:delete y[f];for(h=0;h<n;h++)y[h+b]=arguments[h+2];return y.length=_-r+n,l}})},3843:function(e,t,n){n(2109)({target:"Date",stat:!0},{now:function(){return(new Date).getTime()}})},8733:function(e,t,n){var r=n(2109),i=n(5573);r({target:"Date",proto:!0,forced:Date.prototype.toISOString!==i},{toISOString:i})},3710:function(e,t,n){var r=n(1320),i=Date.prototype,o="Invalid Date",a="toString",s=i[a],u=i.getTime;new Date(NaN)+""!=o&&r(i,a,(function(){var e=u.call(this);return e==e?s.call(this):o}))},4812:function(e,t,n){n(2109)({target:"Function",proto:!0},{bind:n(7065)})},8309:function(e,t,n){var r=n(9781),i=n(3070).f,o=Function.prototype,a=o.toString,s=/^\s*function ([^ (]*)/,u="name";r&&!(u in o)&&i(o,u,{configurable:!0,get:function(){try{return a.call(this).match(s)[1]}catch(e){return""}}})},9653:function(e,t,n){"use strict";var r=n(9781),i=n(7854),o=n(4705),a=n(1320),s=n(6656),u=n(4326),c=n(9587),l=n(7593),h=n(7293),d=n(30),f=n(8006).f,p=n(1236).f,v=n(3070).f,g=n(3111).trim,m="Number",y=i[m],_=y.prototype,b=u(d(_))==m,w=function(e){var t,n,r,i,o,a,s,u,c=l(e,!1);if("string"==typeof c&&c.length>2)if(43===(t=(c=g(c)).charCodeAt(0))||45===t){if(88===(n=c.charCodeAt(2))||120===n)return NaN}else if(48===t){switch(c.charCodeAt(1)){case 66:case 98:r=2,i=49;break;case 79:case 111:r=8,i=55;break;default:return+c}for(a=(o=c.slice(2)).length,s=0;s<a;s++)if((u=o.charCodeAt(s))<48||u>i)return NaN;return parseInt(o,r)}return+c};if(o(m,!y(" 0o1")||!y("0b1")||y("+0x1"))){for(var x,C=function(e){var t=arguments.length<1?0:e,n=this;return n instanceof C&&(b?h((function(){_.valueOf.call(n)})):u(n)!=m)?c(new y(w(t)),n,C):w(t)},S=r?f(y):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger,fromString,range".split(","),k=0;S.length>k;k++)s(y,x=S[k])&&!s(C,x)&&v(C,x,p(y,x));C.prototype=_,_.constructor=C,a(i,m,C)}},9601:function(e,t,n){var r=n(2109),i=n(1574);r({target:"Object",stat:!0,forced:Object.assign!==i},{assign:i})},1539:function(e,t,n){var r=n(1694),i=n(1320),o=n(288);r||i(Object.prototype,"toString",o,{unsafe:!0})},2479:function(e,t,n){var r=n(2109),i=n(4699).values;r({target:"Object",stat:!0},{values:function(e){return i(e)}})},1058:function(e,t,n){var r=n(2109),i=n(3009);r({global:!0,forced:parseInt!=i},{parseInt:i})},7727:function(e,t,n){"use strict";var r=n(2109),i=n(1913),o=n(3366),a=n(7293),s=n(5005),u=n(6707),c=n(9478),l=n(1320);r({target:"Promise",proto:!0,real:!0,forced:!!o&&a((function(){o.prototype.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=u(this,s("Promise")),n="function"==typeof e;return this.then(n?function(n){return c(t,e()).then((function(){return n}))}:e,n?function(n){return c(t,e()).then((function(){throw n}))}:e)}}),i||"function"!=typeof o||o.prototype.finally||l(o.prototype,"finally",s("Promise").prototype.finally)},8674:function(e,t,n){"use strict";var r,i,o,a,s=n(2109),u=n(1913),c=n(7854),l=n(5005),h=n(3366),d=n(1320),f=n(2248),p=n(8003),v=n(6340),g=n(111),m=n(3099),y=n(5787),_=n(2788),b=n(408),w=n(7072),x=n(6707),C=n(261).set,S=n(5948),k=n(9478),T=n(842),E=n(8523),L=n(2534),P=n(9909),O=n(4705),R=n(5112),Z=n(5268),I=n(7392),A=R("species"),D="Promise",F=P.get,j=P.set,M=P.getterFor(D),N=h,U=c.TypeError,V=c.document,B=c.process,G=l("fetch"),H=E.f,z=H,W=!!(V&&V.createEvent&&c.dispatchEvent),q="function"==typeof PromiseRejectionEvent,J="unhandledrejection",$=O(D,(function(){if(_(N)===String(N)){if(66===I)return!0;if(!Z&&!q)return!0}if(u&&!N.prototype.finally)return!0;if(I>=51&&/native code/.test(N))return!1;var e=N.resolve(1),t=function(e){e((function(){}),(function(){}))};return(e.constructor={})[A]=t,!(e.then((function(){}))instanceof t)})),K=$||!w((function(e){N.all(e).catch((function(){}))})),X=function(e){var t;return!(!g(e)||"function"!=typeof(t=e.then))&&t},Y=function(e,t){if(!e.notified){e.notified=!0;var n=e.reactions;S((function(){for(var r=e.value,i=1==e.state,o=0;n.length>o;){var a,s,u,c=n[o++],l=i?c.ok:c.fail,h=c.resolve,d=c.reject,f=c.domain;try{l?(i||(2===e.rejection&&ne(e),e.rejection=1),!0===l?a=r:(f&&f.enter(),a=l(r),f&&(f.exit(),u=!0)),a===c.promise?d(U("Promise-chain cycle")):(s=X(a))?s.call(a,h,d):h(a)):d(r)}catch(e){f&&!u&&f.exit(),d(e)}}e.reactions=[],e.notified=!1,t&&!e.rejection&&ee(e)}))}},Q=function(e,t,n){var r,i;W?((r=V.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),c.dispatchEvent(r)):r={promise:t,reason:n},!q&&(i=c["on"+e])?i(r):e===J&&T("Unhandled promise rejection",n)},ee=function(e){C.call(c,(function(){var t,n=e.facade,r=e.value;if(te(e)&&(t=L((function(){Z?B.emit("unhandledRejection",r,n):Q(J,n,r)})),e.rejection=Z||te(e)?2:1,t.error))throw t.value}))},te=function(e){return 1!==e.rejection&&!e.parent},ne=function(e){C.call(c,(function(){var t=e.facade;Z?B.emit("rejectionHandled",t):Q("rejectionhandled",t,e.value)}))},re=function(e,t,n){return function(r){e(t,r,n)}},ie=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,Y(e,!0))},oe=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw U("Promise can't be resolved itself");var r=X(t);r?S((function(){var n={done:!1};try{r.call(t,re(oe,n,e),re(ie,n,e))}catch(t){ie(n,t,e)}})):(e.value=t,e.state=1,Y(e,!1))}catch(t){ie({done:!1},t,e)}}};$&&(N=function(e){y(this,N,D),m(e),r.call(this);var t=F(this);try{e(re(oe,t),re(ie,t))}catch(e){ie(t,e)}},(r=function(e){j(this,{type:D,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=f(N.prototype,{then:function(e,t){var n=M(this),r=H(x(this,N));return r.ok="function"!=typeof e||e,r.fail="function"==typeof t&&t,r.domain=Z?B.domain:void 0,n.parent=!0,n.reactions.push(r),0!=n.state&&Y(n,!1),r.promise},catch:function(e){return this.then(void 0,e)}}),i=function(){var e=new r,t=F(e);this.promise=e,this.resolve=re(oe,t),this.reject=re(ie,t)},E.f=H=function(e){return e===N||e===o?new i(e):z(e)},u||"function"!=typeof h||(a=h.prototype.then,d(h.prototype,"then",(function(e,t){var n=this;return new N((function(e,t){a.call(n,e,t)})).then(e,t)}),{unsafe:!0}),"function"==typeof G&&s({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return k(N,G.apply(c,arguments))}}))),s({global:!0,wrap:!0,forced:$},{Promise:N}),p(N,D,!1,!0),v(D),o=l(D),s({target:D,stat:!0,forced:$},{reject:function(e){var t=H(this);return t.reject.call(void 0,e),t.promise}}),s({target:D,stat:!0,forced:u||$},{resolve:function(e){return k(u&&this===o?N:this,e)}}),s({target:D,stat:!0,forced:K},{all:function(e){var t=this,n=H(t),r=n.resolve,i=n.reject,o=L((function(){var n=m(t.resolve),o=[],a=0,s=1;b(e,(function(e){var u=a++,c=!1;o.push(void 0),s++,n.call(t,e).then((function(e){c||(c=!0,o[u]=e,--s||r(o))}),i)})),--s||r(o)}));return o.error&&i(o.value),n.promise},race:function(e){var t=this,n=H(t),r=n.reject,i=L((function(){var i=m(t.resolve);b(e,(function(e){i.call(t,e).then(n.resolve,r)}))}));return i.error&&r(i.value),n.promise}})},4916:function(e,t,n){"use strict";var r=n(2109),i=n(2261);r({target:"RegExp",proto:!0,forced:/./.exec!==i},{exec:i})},9714:function(e,t,n){"use strict";var r=n(1320),i=n(9670),o=n(7293),a=n(7066),s="toString",u=RegExp.prototype,c=u[s],l=o((function(){return"/a/b"!=c.call({source:"a",flags:"b"})})),h=c.name!=s;(l||h)&&r(RegExp.prototype,s,(function(){var e=i(this),t=String(e.source),n=e.flags;return"/"+t+"/"+String(void 0===n&&e instanceof RegExp&&!("flags"in u)?a.call(e):n)}),{unsafe:!0})},7852:function(e,t,n){"use strict";var r,i=n(2109),o=n(1236).f,a=n(7466),s=n(3929),u=n(4488),c=n(4964),l=n(1913),h="".endsWith,d=Math.min,f=c("endsWith");i({target:"String",proto:!0,forced:!(!l&&!f&&(r=o(String.prototype,"endsWith"),r&&!r.writable)||f)},{endsWith:function(e){var t=String(u(this));s(e);var n=arguments.length>1?arguments[1]:void 0,r=a(t.length),i=void 0===n?r:d(a(n),r),o=String(e);return h?h.call(t,o,i):t.slice(i-o.length,i)===o}})},2023:function(e,t,n){"use strict";var r=n(2109),i=n(3929),o=n(4488);r({target:"String",proto:!0,forced:!n(4964)("includes")},{includes:function(e){return!!~String(o(this)).indexOf(i(e),arguments.length>1?arguments[1]:void 0)}})},8783:function(e,t,n){"use strict";var r=n(8710).charAt,i=n(9909),o=n(654),a="String Iterator",s=i.set,u=i.getterFor(a);o(String,"String",(function(e){s(this,{type:a,string:String(e),index:0})}),(function(){var e,t=u(this),n=t.string,i=t.index;return i>=n.length?{value:void 0,done:!0}:(e=r(n,i),t.index+=e.length,{value:e,done:!1})}))},4723:function(e,t,n){"use strict";var r=n(7007),i=n(9670),o=n(7466),a=n(4488),s=n(1530),u=n(7651);r("match",1,(function(e,t,n){return[function(t){var n=a(this),r=null==t?void 0:t[e];return void 0!==r?r.call(t,n):new RegExp(t)[e](String(n))},function(e){var r=n(t,e,this);if(r.done)return r.value;var a=i(e),c=String(this);if(!a.global)return u(a,c);var l=a.unicode;a.lastIndex=0;for(var h,d=[],f=0;null!==(h=u(a,c));){var p=String(h[0]);d[f]=p,""===p&&(a.lastIndex=s(c,o(a.lastIndex),l)),f++}return 0===f?null:d}]}))},3112:function(e,t,n){"use strict";var r=n(2109),i=n(6650).start;r({target:"String",proto:!0,forced:n(4986)},{padStart:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},2481:function(e,t,n){n(2109)({target:"String",proto:!0},{repeat:n(8415)})},5306:function(e,t,n){"use strict";var r=n(7007),i=n(9670),o=n(7908),a=n(7466),s=n(9958),u=n(4488),c=n(1530),l=n(7651),h=Math.max,d=Math.min,f=Math.floor,p=/\$([$&'`]|\d\d?|<[^>]*>)/g,v=/\$([$&'`]|\d\d?)/g;r("replace",2,(function(e,t,n,r){var g=r.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,m=r.REPLACE_KEEPS_$0,y=g?"$":"$0";return[function(n,r){var i=u(this),o=null==n?void 0:n[e];return void 0!==o?o.call(n,i,r):t.call(String(i),n,r)},function(e,r){if(!g&&m||"string"==typeof r&&-1===r.indexOf(y)){var o=n(t,e,this,r);if(o.done)return o.value}var u=i(e),f=String(this),p="function"==typeof r;p||(r=String(r));var v=u.global;if(v){var b=u.unicode;u.lastIndex=0}for(var w=[];;){var x=l(u,f);if(null===x)break;if(w.push(x),!v)break;""===String(x[0])&&(u.lastIndex=c(f,a(u.lastIndex),b))}for(var C,S="",k=0,T=0;T<w.length;T++){x=w[T];for(var E=String(x[0]),L=h(d(s(x.index),f.length),0),P=[],O=1;O<x.length;O++)P.push(void 0===(C=x[O])?C:String(C));var R=x.groups;if(p){var Z=[E].concat(P,L,f);void 0!==R&&Z.push(R);var I=String(r.apply(void 0,Z))}else I=_(E,f,L,P,R,r);L>=k&&(S+=f.slice(k,L)+I,k=L+E.length)}return S+f.slice(k)}];function _(e,n,r,i,a,s){var u=r+e.length,c=i.length,l=v;return void 0!==a&&(a=o(a),l=p),t.call(s,l,(function(t,o){var s;switch(o.charAt(0)){case"$":return"$";case"&":return e;case"`":return n.slice(0,r);case"'":return n.slice(u);case"<":s=a[o.slice(1,-1)];break;default:var l=+o;if(0===l)return t;if(l>c){var h=f(l/10);return 0===h?t:h<=c?void 0===i[h-1]?o.charAt(1):i[h-1]+o.charAt(1):t}s=i[l-1]}return void 0===s?"":s}))}}))},4765:function(e,t,n){"use strict";var r=n(7007),i=n(9670),o=n(4488),a=n(1150),s=n(7651);r("search",1,(function(e,t,n){return[function(t){var n=o(this),r=null==t?void 0:t[e];return void 0!==r?r.call(t,n):new RegExp(t)[e](String(n))},function(e){var r=n(t,e,this);if(r.done)return r.value;var o=i(e),u=String(this),c=o.lastIndex;a(c,0)||(o.lastIndex=0);var l=s(o,u);return a(o.lastIndex,c)||(o.lastIndex=c),null===l?-1:l.index}]}))},3123:function(e,t,n){"use strict";var r=n(7007),i=n(7850),o=n(9670),a=n(4488),s=n(6707),u=n(1530),c=n(7466),l=n(7651),h=n(2261),d=n(7293),f=[].push,p=Math.min,v=4294967295,g=!d((function(){return!RegExp(v,"y")}));r("split",2,(function(e,t,n){var r;return r="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,n){var r=String(a(this)),o=void 0===n?v:n>>>0;if(0===o)return[];if(void 0===e)return[r];if(!i(e))return t.call(r,e,o);for(var s,u,c,l=[],d=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),p=0,g=new RegExp(e.source,d+"g");(s=h.call(g,r))&&!((u=g.lastIndex)>p&&(l.push(r.slice(p,s.index)),s.length>1&&s.index<r.length&&f.apply(l,s.slice(1)),c=s[0].length,p=u,l.length>=o));)g.lastIndex===s.index&&g.lastIndex++;return p===r.length?!c&&g.test("")||l.push(""):l.push(r.slice(p)),l.length>o?l.slice(0,o):l}:"0".split(void 0,0).length?function(e,n){return void 0===e&&0===n?[]:t.call(this,e,n)}:t,[function(t,n){var i=a(this),o=null==t?void 0:t[e];return void 0!==o?o.call(t,i,n):r.call(String(i),t,n)},function(e,i){var a=n(r,e,this,i,r!==t);if(a.done)return a.value;var h=o(e),d=String(this),f=s(h,RegExp),m=h.unicode,y=(h.ignoreCase?"i":"")+(h.multiline?"m":"")+(h.unicode?"u":"")+(g?"y":"g"),_=new f(g?h:"^(?:"+h.source+")",y),b=void 0===i?v:i>>>0;if(0===b)return[];if(0===d.length)return null===l(_,d)?[d]:[];for(var w=0,x=0,C=[];x<d.length;){_.lastIndex=g?x:0;var S,k=l(_,g?d:d.slice(x));if(null===k||(S=p(c(_.lastIndex+(g?0:x)),d.length))===w)x=u(d,x,m);else{if(C.push(d.slice(w,x)),C.length===b)return C;for(var T=1;T<=k.length-1;T++)if(C.push(k[T]),C.length===b)return C;x=w=S}}return C.push(d.slice(w)),C}]}),!g)},6755:function(e,t,n){"use strict";var r,i=n(2109),o=n(1236).f,a=n(7466),s=n(3929),u=n(4488),c=n(4964),l=n(1913),h="".startsWith,d=Math.min,f=c("startsWith");i({target:"String",proto:!0,forced:!(!l&&!f&&(r=o(String.prototype,"startsWith"),r&&!r.writable)||f)},{startsWith:function(e){var t=String(u(this));s(e);var n=a(d(arguments.length>1?arguments[1]:void 0,t.length)),r=String(e);return h?h.call(t,r,n):t.slice(n,n+r.length)===r}})},1817:function(e,t,n){"use strict";var r=n(2109),i=n(9781),o=n(7854),a=n(6656),s=n(111),u=n(3070).f,c=n(9920),l=o.Symbol;if(i&&"function"==typeof l&&(!("description"in l.prototype)||void 0!==l().description)){var h={},d=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:String(arguments[0]),t=this instanceof d?new l(e):void 0===e?l():l(e);return""===e&&(h[t]=!0),t};c(d,l);var f=d.prototype=l.prototype;f.constructor=d;var p=f.toString,v="Symbol(test)"==String(l("test")),g=/^Symbol\((.*)\)[^)]+$/;u(f,"description",{configurable:!0,get:function(){var e=s(this)?this.valueOf():this,t=p.call(e);if(a(h,e))return"";var n=v?t.slice(7,-1):t.replace(g,"$1");return""===n?void 0:n}}),r({global:!0,forced:!0},{Symbol:d})}},2526:function(e,t,n){"use strict";var r=n(2109),i=n(7854),o=n(5005),a=n(1913),s=n(9781),u=n(133),c=n(3307),l=n(7293),h=n(6656),d=n(3157),f=n(111),p=n(9670),v=n(7908),g=n(5656),m=n(7593),y=n(9114),_=n(30),b=n(1956),w=n(8006),x=n(1156),C=n(5181),S=n(1236),k=n(3070),T=n(5296),E=n(8880),L=n(1320),P=n(2309),O=n(6200),R=n(3501),Z=n(9711),I=n(5112),A=n(6061),D=n(7235),F=n(8003),j=n(9909),M=n(2092).forEach,N=O("hidden"),U="Symbol",V="prototype",B=I("toPrimitive"),G=j.set,H=j.getterFor(U),z=Object[V],W=i.Symbol,q=o("JSON","stringify"),J=S.f,$=k.f,K=x.f,X=T.f,Y=P("symbols"),Q=P("op-symbols"),ee=P("string-to-symbol-registry"),te=P("symbol-to-string-registry"),ne=P("wks"),re=i.QObject,ie=!re||!re[V]||!re[V].findChild,oe=s&&l((function(){return 7!=_($({},"a",{get:function(){return $(this,"a",{value:7}).a}})).a}))?function(e,t,n){var r=J(z,t);r&&delete z[t],$(e,t,n),r&&e!==z&&$(z,t,r)}:$,ae=function(e,t){var n=Y[e]=_(W[V]);return G(n,{type:U,tag:e,description:t}),s||(n.description=t),n},se=c?function(e){return"symbol"==typeof e}:function(e){return Object(e)instanceof W},ue=function(e,t,n){e===z&&ue(Q,t,n),p(e);var r=m(t,!0);return p(n),h(Y,r)?(n.enumerable?(h(e,N)&&e[N][r]&&(e[N][r]=!1),n=_(n,{enumerable:y(0,!1)})):(h(e,N)||$(e,N,y(1,{})),e[N][r]=!0),oe(e,r,n)):$(e,r,n)},ce=function(e,t){p(e);var n=g(t),r=b(n).concat(fe(n));return M(r,(function(t){s&&!le.call(n,t)||ue(e,t,n[t])})),e},le=function(e){var t=m(e,!0),n=X.call(this,t);return!(this===z&&h(Y,t)&&!h(Q,t))&&(!(n||!h(this,t)||!h(Y,t)||h(this,N)&&this[N][t])||n)},he=function(e,t){var n=g(e),r=m(t,!0);if(n!==z||!h(Y,r)||h(Q,r)){var i=J(n,r);return!i||!h(Y,r)||h(n,N)&&n[N][r]||(i.enumerable=!0),i}},de=function(e){var t=K(g(e)),n=[];return M(t,(function(e){h(Y,e)||h(R,e)||n.push(e)})),n},fe=function(e){var t=e===z,n=K(t?Q:g(e)),r=[];return M(n,(function(e){!h(Y,e)||t&&!h(z,e)||r.push(Y[e])})),r};u||(W=function(){if(this instanceof W)throw TypeError("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?String(arguments[0]):void 0,t=Z(e),n=function(e){this===z&&n.call(Q,e),h(this,N)&&h(this[N],t)&&(this[N][t]=!1),oe(this,t,y(1,e))};return s&&ie&&oe(z,t,{configurable:!0,set:n}),ae(t,e)},L(W[V],"toString",(function(){return H(this).tag})),L(W,"withoutSetter",(function(e){return ae(Z(e),e)})),T.f=le,k.f=ue,S.f=he,w.f=x.f=de,C.f=fe,A.f=function(e){return ae(I(e),e)},s&&($(W[V],"description",{configurable:!0,get:function(){return H(this).description}}),a||L(z,"propertyIsEnumerable",le,{unsafe:!0}))),r({global:!0,wrap:!0,forced:!u,sham:!u},{Symbol:W}),M(b(ne),(function(e){D(e)})),r({target:U,stat:!0,forced:!u},{for:function(e){var t=String(e);if(h(ee,t))return ee[t];var n=W(t);return ee[t]=n,te[n]=t,n},keyFor:function(e){if(!se(e))throw TypeError(e+" is not a symbol");if(h(te,e))return te[e]},useSetter:function(){ie=!0},useSimple:function(){ie=!1}}),r({target:"Object",stat:!0,forced:!u,sham:!s},{create:function(e,t){return void 0===t?_(e):ce(_(e),t)},defineProperty:ue,defineProperties:ce,getOwnPropertyDescriptor:he}),r({target:"Object",stat:!0,forced:!u},{getOwnPropertyNames:de,getOwnPropertySymbols:fe}),r({target:"Object",stat:!0,forced:l((function(){C.f(1)}))},{getOwnPropertySymbols:function(e){return C.f(v(e))}}),q&&r({target:"JSON",stat:!0,forced:!u||l((function(){var e=W();return"[null]"!=q([e])||"{}"!=q({a:e})||"{}"!=q(Object(e))}))},{stringify:function(e,t,n){for(var r,i=[e],o=1;arguments.length>o;)i.push(arguments[o++]);if(r=t,(f(t)||void 0!==e)&&!se(e))return d(t)||(t=function(e,t){if("function"==typeof r&&(t=r.call(this,e,t)),!se(t))return t}),i[1]=t,q.apply(null,i)}}),W[V][B]||E(W[V],B,W[V].valueOf),F(W,U),R[N]=!0},4747:function(e,t,n){var r=n(7854),i=n(8324),o=n(8533),a=n(8880);for(var s in i){var u=r[s],c=u&&u.prototype;if(c&&c.forEach!==o)try{a(c,"forEach",o)}catch(e){c.forEach=o}}},3948:function(e,t,n){var r=n(7854),i=n(8324),o=n(6992),a=n(8880),s=n(5112),u=s("iterator"),c=s("toStringTag"),l=o.values;for(var h in i){var d=r[h],f=d&&d.prototype;if(f){if(f[u]!==l)try{a(f,u,l)}catch(e){f[u]=l}if(f[c]||a(f,c,h),i[h])for(var p in o)if(f[p]!==o[p])try{a(f,p,o[p])}catch(e){f[p]=o[p]}}}},2564:function(e,t,n){var r=n(2109),i=n(7854),o=n(8113),a=[].slice,s=function(e){return function(t,n){var r=arguments.length>2,i=r?a.call(arguments,2):void 0;return e(r?function(){("function"==typeof t?t:Function(t)).apply(this,i)}:t,n)}};r({global:!0,bind:!0,forced:/MSIE .\./.test(o)},{setTimeout:s(i.setTimeout),setInterval:s(i.setInterval)})},1637:function(e,t,n){"use strict";n(6992);var r=n(2109),i=n(5005),o=n(590),a=n(1320),s=n(2248),u=n(8003),c=n(4994),l=n(9909),h=n(5787),d=n(6656),f=n(9974),p=n(648),v=n(9670),g=n(111),m=n(30),y=n(9114),_=n(8554),b=n(1246),w=n(5112),x=i("fetch"),C=i("Headers"),S=w("iterator"),k="URLSearchParams",T=k+"Iterator",E=l.set,L=l.getterFor(k),P=l.getterFor(T),O=/\+/g,R=Array(4),Z=function(e){return R[e-1]||(R[e-1]=RegExp("((?:%[\\da-f]{2}){"+e+"})","gi"))},I=function(e){try{return decodeURIComponent(e)}catch(t){return e}},A=function(e){var t=e.replace(O," "),n=4;try{return decodeURIComponent(t)}catch(e){for(;n;)t=t.replace(Z(n--),I);return t}},D=/[!'()~]|%20/g,F={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},j=function(e){return F[e]},M=function(e){return encodeURIComponent(e).replace(D,j)},N=function(e,t){if(t)for(var n,r,i=t.split("&"),o=0;o<i.length;)(n=i[o++]).length&&(r=n.split("="),e.push({key:A(r.shift()),value:A(r.join("="))}))},U=function(e){this.entries.length=0,N(this.entries,e)},V=function(e,t){if(e<t)throw TypeError("Not enough arguments")},B=c((function(e,t){E(this,{type:T,iterator:_(L(e).entries),kind:t})}),"Iterator",(function(){var e=P(this),t=e.kind,n=e.iterator.next(),r=n.value;return n.done||(n.value="keys"===t?r.key:"values"===t?r.value:[r.key,r.value]),n})),G=function(){h(this,G,k);var e,t,n,r,i,o,a,s,u,c=arguments.length>0?arguments[0]:void 0,l=this,f=[];if(E(l,{type:k,entries:f,updateURL:function(){},updateSearchParams:U}),void 0!==c)if(g(c))if("function"==typeof(e=b(c)))for(n=(t=e.call(c)).next;!(r=n.call(t)).done;){if((a=(o=(i=_(v(r.value))).next).call(i)).done||(s=o.call(i)).done||!o.call(i).done)throw TypeError("Expected sequence with length 2");f.push({key:a.value+"",value:s.value+""})}else for(u in c)d(c,u)&&f.push({key:u,value:c[u]+""});else N(f,"string"==typeof c?"?"===c.charAt(0)?c.slice(1):c:c+"")},H=G.prototype;s(H,{append:function(e,t){V(arguments.length,2);var n=L(this);n.entries.push({key:e+"",value:t+""}),n.updateURL()},delete:function(e){V(arguments.length,1);for(var t=L(this),n=t.entries,r=e+"",i=0;i<n.length;)n[i].key===r?n.splice(i,1):i++;t.updateURL()},get:function(e){V(arguments.length,1);for(var t=L(this).entries,n=e+"",r=0;r<t.length;r++)if(t[r].key===n)return t[r].value;return null},getAll:function(e){V(arguments.length,1);for(var t=L(this).entries,n=e+"",r=[],i=0;i<t.length;i++)t[i].key===n&&r.push(t[i].value);return r},has:function(e){V(arguments.length,1);for(var t=L(this).entries,n=e+"",r=0;r<t.length;)if(t[r++].key===n)return!0;return!1},set:function(e,t){V(arguments.length,1);for(var n,r=L(this),i=r.entries,o=!1,a=e+"",s=t+"",u=0;u<i.length;u++)(n=i[u]).key===a&&(o?i.splice(u--,1):(o=!0,n.value=s));o||i.push({key:a,value:s}),r.updateURL()},sort:function(){var e,t,n,r=L(this),i=r.entries,o=i.slice();for(i.length=0,n=0;n<o.length;n++){for(e=o[n],t=0;t<n;t++)if(i[t].key>e.key){i.splice(t,0,e);break}t===n&&i.push(e)}r.updateURL()},forEach:function(e){for(var t,n=L(this).entries,r=f(e,arguments.length>1?arguments[1]:void 0,3),i=0;i<n.length;)r((t=n[i++]).value,t.key,this)},keys:function(){return new B(this,"keys")},values:function(){return new B(this,"values")},entries:function(){return new B(this,"entries")}},{enumerable:!0}),a(H,S,H.entries),a(H,"toString",(function(){for(var e,t=L(this).entries,n=[],r=0;r<t.length;)e=t[r++],n.push(M(e.key)+"="+M(e.value));return n.join("&")}),{enumerable:!0}),u(G,k),r({global:!0,forced:!o},{URLSearchParams:G}),o||"function"!=typeof x||"function"!=typeof C||r({global:!0,enumerable:!0,forced:!0},{fetch:function(e){var t,n,r,i=[e];return arguments.length>1&&(g(t=arguments[1])&&(n=t.body,p(n)===k&&((r=t.headers?new C(t.headers):new C).has("content-type")||r.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),t=m(t,{body:y(0,String(n)),headers:y(0,r)}))),i.push(t)),x.apply(this,i)}}),e.exports={URLSearchParams:G,getState:L}},285:function(e,t,n){"use strict";n(8783);var r,i=n(2109),o=n(9781),a=n(590),s=n(7854),u=n(6048),c=n(1320),l=n(5787),h=n(6656),d=n(1574),f=n(8457),p=n(8710).codeAt,v=n(3197),g=n(8003),m=n(1637),y=n(9909),_=s.URL,b=m.URLSearchParams,w=m.getState,x=y.set,C=y.getterFor("URL"),S=Math.floor,k=Math.pow,T="Invalid scheme",E="Invalid host",L="Invalid port",P=/[A-Za-z]/,O=/[\d+-.A-Za-z]/,R=/\d/,Z=/^(0x|0X)/,I=/^[0-7]+$/,A=/^\d+$/,D=/^[\dA-Fa-f]+$/,F=/[\u0000\u0009\u000A\u000D #%/:?@[\\]]/,j=/[\u0000\u0009\u000A\u000D #/:?@[\\]]/,M=/^[\u0000-\u001F ]+|[\u0000-\u001F ]+$/g,N=/[\u0009\u000A\u000D]/g,U=function(e,t){var n,r,i;if("["==t.charAt(0)){if("]"!=t.charAt(t.length-1))return E;if(!(n=B(t.slice(1,-1))))return E;e.host=n}else if(K(e)){if(t=v(t),F.test(t))return E;if(null===(n=V(t)))return E;e.host=n}else{if(j.test(t))return E;for(n="",r=f(t),i=0;i<r.length;i++)n+=J(r[i],H);e.host=n}},V=function(e){var t,n,r,i,o,a,s,u=e.split(".");if(u.length&&""==u[u.length-1]&&u.pop(),(t=u.length)>4)return e;for(n=[],r=0;r<t;r++){if(""==(i=u[r]))return e;if(o=10,i.length>1&&"0"==i.charAt(0)&&(o=Z.test(i)?16:8,i=i.slice(8==o?1:2)),""===i)a=0;else{if(!(10==o?A:8==o?I:D).test(i))return e;a=parseInt(i,o)}n.push(a)}for(r=0;r<t;r++)if(a=n[r],r==t-1){if(a>=k(256,5-t))return null}else if(a>255)return null;for(s=n.pop(),r=0;r<n.length;r++)s+=n[r]*k(256,3-r);return s},B=function(e){var t,n,r,i,o,a,s,u=[0,0,0,0,0,0,0,0],c=0,l=null,h=0,d=function(){return e.charAt(h)};if(":"==d()){if(":"!=e.charAt(1))return;h+=2,l=++c}for(;d();){if(8==c)return;if(":"!=d()){for(t=n=0;n<4&&D.test(d());)t=16*t+parseInt(d(),16),h++,n++;if("."==d()){if(0==n)return;if(h-=n,c>6)return;for(r=0;d();){if(i=null,r>0){if(!("."==d()&&r<4))return;h++}if(!R.test(d()))return;for(;R.test(d());){if(o=parseInt(d(),10),null===i)i=o;else{if(0==i)return;i=10*i+o}if(i>255)return;h++}u[c]=256*u[c]+i,2!=++r&&4!=r||c++}if(4!=r)return;break}if(":"==d()){if(h++,!d())return}else if(d())return;u[c++]=t}else{if(null!==l)return;h++,l=++c}}if(null!==l)for(a=c-l,c=7;0!=c&&a>0;)s=u[c],u[c--]=u[l+a-1],u[l+--a]=s;else if(8!=c)return;return u},G=function(e){var t,n,r,i;if("number"==typeof e){for(t=[],n=0;n<4;n++)t.unshift(e%256),e=S(e/256);return t.join(".")}if("object"==typeof e){for(t="",r=function(e){for(var t=null,n=1,r=null,i=0,o=0;o<8;o++)0!==e[o]?(i>n&&(t=r,n=i),r=null,i=0):(null===r&&(r=o),++i);return i>n&&(t=r,n=i),t}(e),n=0;n<8;n++)i&&0===e[n]||(i&&(i=!1),r===n?(t+=n?":":"::",i=!0):(t+=e[n].toString(16),n<7&&(t+=":")));return"["+t+"]"}return e},H={},z=d({},H,{" ":1,'"':1,"<":1,">":1,"`":1}),W=d({},z,{"#":1,"?":1,"{":1,"}":1}),q=d({},W,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),J=function(e,t){var n=p(e,0);return n>32&&n<127&&!h(t,e)?e:encodeURIComponent(e)},$={ftp:21,file:null,http:80,https:443,ws:80,wss:443},K=function(e){return h($,e.scheme)},X=function(e){return""!=e.username||""!=e.password},Y=function(e){return!e.host||e.cannotBeABaseURL||"file"==e.scheme},Q=function(e,t){var n;return 2==e.length&&P.test(e.charAt(0))&&(":"==(n=e.charAt(1))||!t&&"|"==n)},ee=function(e){var t;return e.length>1&&Q(e.slice(0,2))&&(2==e.length||"/"===(t=e.charAt(2))||"\\"===t||"?"===t||"#"===t)},te=function(e){var t=e.path,n=t.length;!n||"file"==e.scheme&&1==n&&Q(t[0],!0)||t.pop()},ne=function(e){return"."===e||"%2e"===e.toLowerCase()},re={},ie={},oe={},ae={},se={},ue={},ce={},le={},he={},de={},fe={},pe={},ve={},ge={},me={},ye={},_e={},be={},we={},xe={},Ce={},Se=function(e,t,n,i){var o,a,s,u,c,l=n||re,d=0,p="",v=!1,g=!1,m=!1;for(n||(e.scheme="",e.username="",e.password="",e.host=null,e.port=null,e.path=[],e.query=null,e.fragment=null,e.cannotBeABaseURL=!1,t=t.replace(M,"")),t=t.replace(N,""),o=f(t);d<=o.length;){switch(a=o[d],l){case re:if(!a||!P.test(a)){if(n)return T;l=oe;continue}p+=a.toLowerCase(),l=ie;break;case ie:if(a&&(O.test(a)||"+"==a||"-"==a||"."==a))p+=a.toLowerCase();else{if(":"!=a){if(n)return T;p="",l=oe,d=0;continue}if(n&&(K(e)!=h($,p)||"file"==p&&(X(e)||null!==e.port)||"file"==e.scheme&&!e.host))return;if(e.scheme=p,n)return void(K(e)&&$[e.scheme]==e.port&&(e.port=null));p="","file"==e.scheme?l=ge:K(e)&&i&&i.scheme==e.scheme?l=ae:K(e)?l=le:"/"==o[d+1]?(l=se,d++):(e.cannotBeABaseURL=!0,e.path.push(""),l=we)}break;case oe:if(!i||i.cannotBeABaseURL&&"#"!=a)return T;if(i.cannotBeABaseURL&&"#"==a){e.scheme=i.scheme,e.path=i.path.slice(),e.query=i.query,e.fragment="",e.cannotBeABaseURL=!0,l=Ce;break}l="file"==i.scheme?ge:ue;continue;case ae:if("/"!=a||"/"!=o[d+1]){l=ue;continue}l=he,d++;break;case se:if("/"==a){l=de;break}l=be;continue;case ue:if(e.scheme=i.scheme,a==r)e.username=i.username,e.password=i.password,e.host=i.host,e.port=i.port,e.path=i.path.slice(),e.query=i.query;else if("/"==a||"\\"==a&&K(e))l=ce;else if("?"==a)e.username=i.username,e.password=i.password,e.host=i.host,e.port=i.port,e.path=i.path.slice(),e.query="",l=xe;else{if("#"!=a){e.username=i.username,e.password=i.password,e.host=i.host,e.port=i.port,e.path=i.path.slice(),e.path.pop(),l=be;continue}e.username=i.username,e.password=i.password,e.host=i.host,e.port=i.port,e.path=i.path.slice(),e.query=i.query,e.fragment="",l=Ce}break;case ce:if(!K(e)||"/"!=a&&"\\"!=a){if("/"!=a){e.username=i.username,e.password=i.password,e.host=i.host,e.port=i.port,l=be;continue}l=de}else l=he;break;case le:if(l=he,"/"!=a||"/"!=p.charAt(d+1))continue;d++;break;case he:if("/"!=a&&"\\"!=a){l=de;continue}break;case de:if("@"==a){v&&(p="%40"+p),v=!0,s=f(p);for(var y=0;y<s.length;y++){var _=s[y];if(":"!=_||m){var b=J(_,q);m?e.password+=b:e.username+=b}else m=!0}p=""}else if(a==r||"/"==a||"?"==a||"#"==a||"\\"==a&&K(e)){if(v&&""==p)return"Invalid authority";d-=f(p).length+1,p="",l=fe}else p+=a;break;case fe:case pe:if(n&&"file"==e.scheme){l=ye;continue}if(":"!=a||g){if(a==r||"/"==a||"?"==a||"#"==a||"\\"==a&&K(e)){if(K(e)&&""==p)return E;if(n&&""==p&&(X(e)||null!==e.port))return;if(u=U(e,p))return u;if(p="",l=_e,n)return;continue}"["==a?g=!0:"]"==a&&(g=!1),p+=a}else{if(""==p)return E;if(u=U(e,p))return u;if(p="",l=ve,n==pe)return}break;case ve:if(!R.test(a)){if(a==r||"/"==a||"?"==a||"#"==a||"\\"==a&&K(e)||n){if(""!=p){var w=parseInt(p,10);if(w>65535)return L;e.port=K(e)&&w===$[e.scheme]?null:w,p=""}if(n)return;l=_e;continue}return L}p+=a;break;case ge:if(e.scheme="file","/"==a||"\\"==a)l=me;else{if(!i||"file"!=i.scheme){l=be;continue}if(a==r)e.host=i.host,e.path=i.path.slice(),e.query=i.query;else if("?"==a)e.host=i.host,e.path=i.path.slice(),e.query="",l=xe;else{if("#"!=a){ee(o.slice(d).join(""))||(e.host=i.host,e.path=i.path.slice(),te(e)),l=be;continue}e.host=i.host,e.path=i.path.slice(),e.query=i.query,e.fragment="",l=Ce}}break;case me:if("/"==a||"\\"==a){l=ye;break}i&&"file"==i.scheme&&!ee(o.slice(d).join(""))&&(Q(i.path[0],!0)?e.path.push(i.path[0]):e.host=i.host),l=be;continue;case ye:if(a==r||"/"==a||"\\"==a||"?"==a||"#"==a){if(!n&&Q(p))l=be;else if(""==p){if(e.host="",n)return;l=_e}else{if(u=U(e,p))return u;if("localhost"==e.host&&(e.host=""),n)return;p="",l=_e}continue}p+=a;break;case _e:if(K(e)){if(l=be,"/"!=a&&"\\"!=a)continue}else if(n||"?"!=a)if(n||"#"!=a){if(a!=r&&(l=be,"/"!=a))continue}else e.fragment="",l=Ce;else e.query="",l=xe;break;case be:if(a==r||"/"==a||"\\"==a&&K(e)||!n&&("?"==a||"#"==a)){if(".."===(c=(c=p).toLowerCase())||"%2e."===c||".%2e"===c||"%2e%2e"===c?(te(e),"/"==a||"\\"==a&&K(e)||e.path.push("")):ne(p)?"/"==a||"\\"==a&&K(e)||e.path.push(""):("file"==e.scheme&&!e.path.length&&Q(p)&&(e.host&&(e.host=""),p=p.charAt(0)+":"),e.path.push(p)),p="","file"==e.scheme&&(a==r||"?"==a||"#"==a))for(;e.path.length>1&&""===e.path[0];)e.path.shift();"?"==a?(e.query="",l=xe):"#"==a&&(e.fragment="",l=Ce)}else p+=J(a,W);break;case we:"?"==a?(e.query="",l=xe):"#"==a?(e.fragment="",l=Ce):a!=r&&(e.path[0]+=J(a,H));break;case xe:n||"#"!=a?a!=r&&("'"==a&&K(e)?e.query+="%27":e.query+="#"==a?"%23":J(a,H)):(e.fragment="",l=Ce);break;case Ce:a!=r&&(e.fragment+=J(a,z))}d++}},ke=function(e){var t,n,r=l(this,ke,"URL"),i=arguments.length>1?arguments[1]:void 0,a=String(e),s=x(r,{type:"URL"});if(void 0!==i)if(i instanceof ke)t=C(i);else if(n=Se(t={},String(i)))throw TypeError(n);if(n=Se(s,a,null,t))throw TypeError(n);var u=s.searchParams=new b,c=w(u);c.updateSearchParams(s.query),c.updateURL=function(){s.query=String(u)||null},o||(r.href=Ee.call(r),r.origin=Le.call(r),r.protocol=Pe.call(r),r.username=Oe.call(r),r.password=Re.call(r),r.host=Ze.call(r),r.hostname=Ie.call(r),r.port=Ae.call(r),r.pathname=De.call(r),r.search=Fe.call(r),r.searchParams=je.call(r),r.hash=Me.call(r))},Te=ke.prototype,Ee=function(){var e=C(this),t=e.scheme,n=e.username,r=e.password,i=e.host,o=e.port,a=e.path,s=e.query,u=e.fragment,c=t+":";return null!==i?(c+="//",X(e)&&(c+=n+(r?":"+r:"")+"@"),c+=G(i),null!==o&&(c+=":"+o)):"file"==t&&(c+="//"),c+=e.cannotBeABaseURL?a[0]:a.length?"/"+a.join("/"):"",null!==s&&(c+="?"+s),null!==u&&(c+="#"+u),c},Le=function(){var e=C(this),t=e.scheme,n=e.port;if("blob"==t)try{return new URL(t.path[0]).origin}catch(e){return"null"}return"file"!=t&&K(e)?t+"://"+G(e.host)+(null!==n?":"+n:""):"null"},Pe=function(){return C(this).scheme+":"},Oe=function(){return C(this).username},Re=function(){return C(this).password},Ze=function(){var e=C(this),t=e.host,n=e.port;return null===t?"":null===n?G(t):G(t)+":"+n},Ie=function(){var e=C(this).host;return null===e?"":G(e)},Ae=function(){var e=C(this).port;return null===e?"":String(e)},De=function(){var e=C(this),t=e.path;return e.cannotBeABaseURL?t[0]:t.length?"/"+t.join("/"):""},Fe=function(){var e=C(this).query;return e?"?"+e:""},je=function(){return C(this).searchParams},Me=function(){var e=C(this).fragment;return e?"#"+e:""},Ne=function(e,t){return{get:e,set:t,configurable:!0,enumerable:!0}};if(o&&u(Te,{href:Ne(Ee,(function(e){var t=C(this),n=String(e),r=Se(t,n);if(r)throw TypeError(r);w(t.searchParams).updateSearchParams(t.query)})),origin:Ne(Le),protocol:Ne(Pe,(function(e){var t=C(this);Se(t,String(e)+":",re)})),username:Ne(Oe,(function(e){var t=C(this),n=f(String(e));if(!Y(t)){t.username="";for(var r=0;r<n.length;r++)t.username+=J(n[r],q)}})),password:Ne(Re,(function(e){var t=C(this),n=f(String(e));if(!Y(t)){t.password="";for(var r=0;r<n.length;r++)t.password+=J(n[r],q)}})),host:Ne(Ze,(function(e){var t=C(this);t.cannotBeABaseURL||Se(t,String(e),fe)})),hostname:Ne(Ie,(function(e){var t=C(this);t.cannotBeABaseURL||Se(t,String(e),pe)})),port:Ne(Ae,(function(e){var t=C(this);Y(t)||(""==(e=String(e))?t.port=null:Se(t,e,ve))})),pathname:Ne(De,(function(e){var t=C(this);t.cannotBeABaseURL||(t.path=[],Se(t,e+"",_e))})),search:Ne(Fe,(function(e){var t=C(this);""==(e=String(e))?t.query=null:("?"==e.charAt(0)&&(e=e.slice(1)),t.query="",Se(t,e,xe)),w(t.searchParams).updateSearchParams(t.query)})),searchParams:Ne(je),hash:Ne(Me,(function(e){var t=C(this);""!=(e=String(e))?("#"==e.charAt(0)&&(e=e.slice(1)),t.fragment="",Se(t,e,Ce)):t.fragment=null}))}),c(Te,"toJSON",(function(){return Ee.call(this)}),{enumerable:!0}),c(Te,"toString",(function(){return Ee.call(this)}),{enumerable:!0}),_){var Ue=_.createObjectURL,Ve=_.revokeObjectURL;Ue&&c(ke,"createObjectURL",(function(e){return Ue.apply(_,arguments)})),Ve&&c(ke,"revokeObjectURL",(function(e){return Ve.apply(_,arguments)}))}g(ke,"URL"),i({global:!0,forced:!a,sham:!o},{URL:ke})},5666:function(e,t,n){var r=n(202).default,i=function(e){"use strict";var t,n=Object.prototype,i=n.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(e,t,n,r){var i=t&&t.prototype instanceof g?t:g,o=Object.create(i.prototype),a=new L(r||[]);return o._invoke=function(e,t,n){var r=h;return function(i,o){if(r===f)throw new Error("Generator is already running");if(r===p){if("throw"===i)throw o;return O()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=k(a,n);if(s){if(s===v)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===h)throw r=p,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=f;var u=l(e,t,n);if("normal"===u.type){if(r=n.done?p:d,u.arg===v)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=p,n.method="throw",n.arg=u.arg)}}}(e,n,a),o}function l(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var h="suspendedStart",d="suspendedYield",f="executing",p="completed",v={};function g(){}function m(){}function y(){}var _={};_[a]=function(){return this};var b=Object.getPrototypeOf,w=b&&b(b(P([])));w&&w!==n&&i.call(w,a)&&(_=w);var x=y.prototype=g.prototype=Object.create(_);function C(e){["next","throw","return"].forEach((function(t){e[t]=function(e){return this._invoke(t,e)}}))}function S(e,t){function n(r,o,a,s){var u=l(e[r],e,o);if("throw"!==u.type){var c=u.arg,h=c.value;return h&&"object"==typeof h&&i.call(h,"__await")?t.resolve(h.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(h).then((function(e){c.value=e,a(c)}),(function(e){return n("throw",e,a,s)}))}s(u.arg)}var r;this._invoke=function(e,i){function o(){return new t((function(t,r){n(e,i,t,r)}))}return r=r?r.then(o,o):o()}}function k(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,k(e,n),"throw"===n.method))return v;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var i=l(r,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var o=i.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function P(e){if(e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,o=function n(){for(;++r<e.length;)if(i.call(e,r))return n.value=e[r],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}return{next:O}}function O(){return{value:t,done:!0}}return m.prototype=x.constructor=y,y.constructor=m,y[u]=m.displayName="GeneratorFunction",e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,u in e||(e[u]="GeneratorFunction")),e.prototype=Object.create(x),e},e.awrap=function(e){return{__await:e}},C(S.prototype),S.prototype[s]=function(){return this},e.AsyncIterator=S,e.async=function(t,n,i,o,a){void 0===a&&(a=r);var s=new S(c(t,n,i,o),a);return e.isGeneratorFunction(n)?s:s.next().then((function(e){return e.done?e.value:s.next()}))},C(x),x[u]="Generator",x[a]=function(){return this},x.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=P,L.prototype={constructor:L,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(E),!e)for(var n in this)"t"===n.charAt(0)&&i.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function r(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),c=i.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,v):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),E(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;E(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:P(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}(e.exports);try{regeneratorRuntime=i}catch(e){Function("r","regeneratorRuntime = r")(i)}},7147:function(e,t,n){"use strict";var r=n(202).default,i="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==i&&i,o="URLSearchParams"in i,a="Symbol"in i&&"iterator"in Symbol,s="FileReader"in i&&"Blob"in i&&function(){try{return new Blob,!0}catch(e){return!1}}(),u="FormData"in i,c="ArrayBuffer"in i;if(c)var l=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],h=ArrayBuffer.isView||function(e){return e&&l.indexOf(Object.prototype.toString.call(e))>-1};function d(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function f(e){return"string"!=typeof e&&(e=String(e)),e}function p(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return a&&(t[Symbol.iterator]=function(){return t}),t}function v(e){this.map={},e instanceof v?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function g(e){if(e.bodyUsed)return r.reject(new TypeError("Already read"));e.bodyUsed=!0}function m(e){return new r((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function y(e){var t=new FileReader,n=m(t);return t.readAsArrayBuffer(e),n}function _(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function b(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:s&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:u&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:o&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():c&&s&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=_(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):c&&(ArrayBuffer.prototype.isPrototypeOf(e)||h(e))?this._bodyArrayBuffer=_(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):o&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},s&&(this.blob=function(){var e=g(this);if(e)return e;if(this._bodyBlob)return r.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return r.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return r.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?g(this)||(ArrayBuffer.isView(this._bodyArrayBuffer)?r.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):r.resolve(this._bodyArrayBuffer)):this.blob().then(y)}),this.text=function(){var e,t,n,i=g(this);if(i)return i;if(this._bodyBlob)return e=this._bodyBlob,n=m(t=new FileReader),t.readAsText(e),n;if(this._bodyArrayBuffer)return r.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return r.resolve(this._bodyText)},u&&(this.formData=function(){return this.text().then(C)}),this.json=function(){return this.text().then(JSON.parse)},this}v.prototype.append=function(e,t){e=d(e),t=f(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},v.prototype.delete=function(e){delete this.map[d(e)]},v.prototype.get=function(e){return e=d(e),this.has(e)?this.map[e]:null},v.prototype.has=function(e){return this.map.hasOwnProperty(d(e))},v.prototype.set=function(e,t){this.map[d(e)]=f(t)},v.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},v.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),p(e)},v.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),p(e)},v.prototype.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),p(e)},a&&(v.prototype[Symbol.iterator]=v.prototype.entries);var w=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function x(e,t){if(!(this instanceof x))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var n,r,i=(t=t||{}).body;if(e instanceof x){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new v(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,i||null==e._bodyInit||(i=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new v(t.headers)),this.method=(r=(n=t.method||this.method||"GET").toUpperCase(),w.indexOf(r)>-1?r:n),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(i),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache)){var o=/([?&])_=[^&]*/;o.test(this.url)?this.url=this.url.replace(o,"$1_="+(new Date).getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}function C(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(i))}})),t}function S(e,t){if(!(this instanceof S))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText=void 0===t.statusText?"":""+t.statusText,this.headers=new v(t.headers),this.url=t.url||"",this._initBody(e)}x.prototype.clone=function(){return new x(this,{body:this._bodyInit})},b.call(x.prototype),b.call(S.prototype),S.prototype.clone=function(){return new S(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new v(this.headers),url:this.url})},S.error=function(){var e=new S(null,{status:0,statusText:""});return e.type="error",e};var k=[301,302,303,307,308];S.redirect=function(e,t){if(-1===k.indexOf(t))throw new RangeError("Invalid status code");return new S(null,{status:t,headers:{location:e}})};var T=i.DOMException;try{new T}catch(e){(T=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack}).prototype=Object.create(Error.prototype),T.prototype.constructor=T}function E(e,t){return new r((function(n,r){var o=new x(e,t);if(o.signal&&o.signal.aborted)return r(new T("Aborted","AbortError"));var a=new XMLHttpRequest;function u(){a.abort()}a.onload=function(){var e,t,r={status:a.status,statusText:a.statusText,headers:(e=a.getAllResponseHeaders()||"",t=new v,e.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e})).forEach((function(e){var n=e.split(":"),r=n.shift().trim();if(r){var i=n.join(":").trim();t.append(r,i)}})),t)};r.url="responseURL"in a?a.responseURL:r.headers.get("X-Request-URL");var i="response"in a?a.response:a.responseText;setTimeout((function(){n(new S(i,r))}),0)},a.onerror=function(){setTimeout((function(){r(new TypeError("Network request failed"))}),0)},a.ontimeout=function(){setTimeout((function(){r(new TypeError("Network request failed"))}),0)},a.onabort=function(){setTimeout((function(){r(new T("Aborted","AbortError"))}),0)},a.open(o.method,function(e){try{return""===e&&i.location.href?i.location.href:e}catch(t){return e}}(o.url),!0),"include"===o.credentials?a.withCredentials=!0:"omit"===o.credentials&&(a.withCredentials=!1),"responseType"in a&&(s?a.responseType="blob":c&&o.headers.get("Content-Type")&&-1!==o.headers.get("Content-Type").indexOf("application/octet-stream")&&(a.responseType="arraybuffer")),!t||"object"!=typeof t.headers||t.headers instanceof v?o.headers.forEach((function(e,t){a.setRequestHeader(t,e)})):Object.getOwnPropertyNames(t.headers).forEach((function(e){a.setRequestHeader(e,f(t.headers[e]))})),o.signal&&(o.signal.addEventListener("abort",u),a.onreadystatechange=function(){4===a.readyState&&o.signal.removeEventListener("abort",u)}),a.send(void 0===o._bodyInit?null:o._bodyInit)}))}E.polyfill=!0,i.fetch||(i.fetch=E,i.Headers=v,i.Request=x,i.Response=S)}},t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}return n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(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.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n(7147),n(4146)}()}));
3
3
  //# sourceMappingURL=channels.js.map