/*! For license information please see 715.bfa8e05478d819f234ce.js.LICENSE.txt */ (self.webpackChunkicf_search_client_monorepo=self.webpackChunkicf_search_client_monorepo||[]).push([[606,715],{16283:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i,o=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=n(e)&&"function"!=typeof e)return{default:e};var r=c(t);if(r&&r.has(e))return r.get(e);var i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(i,a,s):i[a]=e[a]}return i.default=e,r&&r.set(e,i),i}(r(62249)),a=r(82239),s=(i=r(92870))&&i.__esModule?i:{default:i},l=["children"];function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(c=function(e){return e?r:t})(e)}function u(){return u=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,l),i=h();return o.default.createElement(s.default,u({ref:t,className:i.root},n),r)}));d.displayName="GlobalStyles";var h=(0,a.createUseStyles)((function(e){return{root:{boxSizing:"border-box"},"@global":{"*, *::before, *::after":{boxSizing:"inherit"},"*":{margin:0},body:{fontFamily:e.typography.fontFamily,fontWeight:e.typography.fontWeight,fontSize:e.typography.fontSize,color:e.colors.baseContrast090,background:e.colors.pageBackground,"@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 2dppx)":{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"}},a:{textDecoration:"none",color:e.colors.primary},'button, [role="button"]':{cursor:"pointer",fontFamily:e.typography.fontFamily},":disabled":{cursor:"default"},img:{flexShrink:0}}}}));t.default=d},25224:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=c(r(62249)),o=c(r(50201)),a=r(71029),s=r(46503),l=["children","platformId","currentTheme","themeMode","language","supportedRtlLanguages"];function c(e){return e&&e.__esModule?e:{default:e}}function u(){return u=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,l),b=(0,a.saveThemeProps)(function(e){for(var t=1;t{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i,o=(i=r(46942))&&i.__esModule?i:{default:i},a=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=n(e)&&"function"!=typeof e)return{default:e};var r=u(t);if(r&&r.has(e))return r.get(e);var i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(i,a,s):i[a]=e[a]}return i.default=e,r&&r.set(e,i),i}(r(62249)),s=r(82239),l=r(53120),c=["className","children"];function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(u=function(e){return e?r:t})(e)}function d(){return d=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,c),f=(0,s.useTheme)();v();var g=(0,a.useRef)(null);return(0,a.useImperativeHandle)(t,(function(){return g.current})),(0,a.useEffect)((function(){g.current&&(g.current.version=f.version)}),[f.version]),(0,a.useEffect)((function(){if(f.themeProviderProps){var e=f.themeProviderProps.platformId,t="icf-"+e+"-"+f.mode+"-"+f.colors.primary;if(!document.getElementById(t)){var r,n='[data-icf-platform="'.concat(e,'"][data-icf-mode="').concat(f.mode,'"][data-icf-primary="').concat(f.colors.primary,'"]'),i=document.createElement("style");i.innerText=n+"{"+(r=function(e){var t=Object.entries(e.colors).map((function(e){var t=m(e,2);return["--theme-colors-"+t[0],t[1]]})),r=Object.entries(e.iconSizes).map((function(e){var t=m(e,2);return["--theme-sizes-"+t[0],t[1]+"px"]}));return p(p({color:e.colors.baseContrast090,"--theme-direction":e.direction,"--theme-spacing-base":e.spacing.base+"px"},Object.fromEntries(t)),Object.fromEntries(r))}(f),Object.entries(r).reduce((function(e,t){var r=m(t,2);return e+r[0]+":"+r[1]+";"}),"")+"}"),i.id=t,document.head.appendChild(i)}}}),[f,null===(r=f.themeProviderProps)||void 0===r?void 0:r.platformId,f.mode,f.colors.primary]),a.default.createElement("div",d({ref:g,dir:f.direction,lang:f.language,"data-icf-platform":null===(n=f.themeProviderProps)||void 0===n?void 0:n.platformId,"data-icf-mode":f.mode,"data-icf-primary":f.colors.primary,className:(0,o.default)(l.THEME_WRAPPER_CLASS,i)},h),u)}));y.displayName="ThemeProviderElement",t.default=y},3069:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=n(e)&&"function"!=typeof e)return{default:e};var r=d(t);if(r&&r.has(e))return r.get(e);var i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(i,a,s):i[a]=e[a]}return i.default=e,r&&r.set(e,i),i}(r(62249)),o=r(82239),a=u(r(16283)),s=u(r(92870)),l=r(53120),c=["children","withGlobalStyles","nested"];function u(e){return e&&e.__esModule?e:{default:e}}function d(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(d=function(e){return e?r:t})(e)}function h(){return h=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,c),u=(0,i.useRef)(null),d=m(u,n),p=(0,o.useTheme)();return(0,i.useEffect)((function(){if(!d){var e=document.documentElement;e.setAttribute("dir",p.direction),e.setAttribute("lang",p.language)}}),[d,p.direction,p.language]),r?i.default.createElement(a.default,h({ref:u},l),t):i.default.createElement(s.default,h({ref:u},l),t)};g.displayName="ThemeProviderWrapper",t.default=g},29532:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0});var i={};t.default=void 0;var o=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=n(e)&&"function"!=typeof e)return{default:e};var r=a(t);if(r&&r.has(e))return r.get(e);var i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&{}.hasOwnProperty.call(e,s)){var l=o?Object.getOwnPropertyDescriptor(e,s):null;l&&(l.get||l.set)?Object.defineProperty(i,s,l):i[s]=e[s]}return i.default=e,r&&r.set(e,i),i}(r(25224));function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(a=function(e){return e?r:t})(e)}Object.keys(o).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(i,e)||e in t&&t[e]===o[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}}))})),t.default=o.default},71029:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.saveThemeProps=t.prepareTheme=t.loadRemoteTheme=t.loadBundledTheme=t.getThemeFromList=void 0;var i=s(r(35750)),o=r(46503),a=s(r(63955));function s(e){return e&&e.__esModule?e:{default:e}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var l=i.call(a,"catchLoc"),c=i.call(a,"finallyLoc");if(l&&c){if(this.prev=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),D(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;D(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:x(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}function u(e,t,r,n,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,i)}function d(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){u(o,n,i,a,s,"next",e)}function s(e){u(o,n,i,a,s,"throw",e)}a(void 0)}))}}var h=function(){var e=d(c().mark((function e(t){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",i.default[t]);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),p=t.prepareTheme=function(e,t){if("extends"in e){var r=f(t,e.extends);return(0,a.default)(r,e.properties)}return e.properties},f=t.getThemeFromList=function(e,t,r){var n=e[t];if(n)return p(n,e);var i=function(e){switch(e){case o.PlatformId.streamate:case o.PlatformId.blacklabel:return o.ThemeName.whitelabel;case o.PlatformId.creator:case o.PlatformId.legal:return o.ThemeName.performer;case o.PlatformId.adminpro:return o.ThemeName.admin;case o.PlatformId.cambuilder:return o.ThemeName.cambuilder;case o.PlatformId.streamfans:return o.ThemeName.streamfans;case o.PlatformId.kwiky:return o.ThemeName.kwiky;default:throw new Error("Invalid platform id: "+e)}}(r),a=e[i];if(a)return p(a,e);throw new Error("No theme found: ".concat(t," / ").concat(r))},m=function(){var e=d(c().mark((function e(t,r){var n,i,o,a,s,u,d;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=localStorage.getItem(t)){e.next=3;break}return e.abrupt("return",null);case 3:if(!n.includes(":")){e.next=9;break}return i=n.split(":"),p=2,o=function(e){if(Array.isArray(e))return e}(c=i)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,c=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(c,p)||function(e,t){if(e){if("string"==typeof e)return l(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?l(e,t):void 0}}(c,p)||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.")}(),a=o[0],s=o[1],e.next=7,h(a);case 7:return u=e.sent,e.abrupt("return",f(u,s,r));case 9:return e.next=11,h(n);case 11:return d=e.sent,e.abrupt("return",f(d,t,r));case 13:case"end":return e.stop()}var c,p}),e)})));return function(t,r){return e.apply(this,arguments)}}();t.loadBundledTheme=function(e,t){return f(i.default,e,t)},t.loadRemoteTheme=function(){var e=d(c().mark((function e(t,r){var n,i;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,m(t,r);case 3:if(!(n=e.sent)){e.next=6;break}return e.abrupt("return",n);case 6:e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),console.error(e.t0);case 11:return e.next=13,h("master");case 13:return i=e.sent,e.abrupt("return",f(i,t,r));case 15:case"end":return e.stop()}}),e,null,[[0,8]])})));return function(t,r){return e.apply(this,arguments)}}(),t.saveThemeProps=function(e,t){return t.dark.themeProviderProps=e,t.light.themeProviderProps=e,t}},93067:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.vars=t.default=t.Storybook=void 0;var i=v(r(46942)),o=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=n(e)&&"function"!=typeof e)return{default:e};var r=g(t);if(r&&r.has(e))return r.get(e);var i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(i,a,s):i[a]=e[a]}return i.default=e,r&&r.set(e,i),i}(r(62249)),a=r(82239),s=r(95586),l=v(r(81095)),c=v(r(83180)),u=r(7393),d=v(r(93940)),h=r(75709),p=v(r(61754)),f=v(r(64621)),m=["overrides","defaultChecked","disabled","onCheck","label","className","checked","labelSide","id","name","hint","description","wrapperProps","color","primary"];function g(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(g=function(e){return e?r:t})(e)}function v(e){return e&&e.__esModule?e:{default:e}}function y(){return y=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,m),x=(0,a.useTheme)(),M=O(E.useVars(_({checkboxColor:A,checkboxPrimary:D?x.colors.primary:A},(0,d.default)(I,w))));(0,f.default)(P,"Always add the name prop to input components!");var L=_({id:null!=C?C:P,name:P,type:"checkbox",defaultChecked:l,onChange:function(e){u&&u(e.target.checked,e)},className:(0,i.default)(M.input,S({},M.disabled,c),p),disabled:c,checked:g},I),j={htmlFor:L.id,className:(0,i.default)(M.label,S({},M.flip,b===s.LabelSide.LEFT))},N=_(_({},R),{},{className:(0,i.default)(M.variables,M.root,null==R?void 0:R.className,n.root)});return o.default.createElement("div",N,o.default.createElement("input",y({ref:t},L)),o.default.createElement("label",j,o.default.createElement("svg",{className:(0,i.default)(M.svg,n.svg),viewBox:"0 0 12 10"},o.default.createElement("polyline",{points:"1.5 6 4.5 9 10.5 1"})),o.default.createElement("span",{className:(0,i.default)(M.labelText,n.label)},o.default.createElement("span",{className:(0,i.default)(M.labelTextSpan)},h),T&&o.default.createElement("span",{className:(0,i.default)(M.hint)}," (",T,")"),k&&o.default.createElement("div",{className:(0,i.default)(M.description)},k))))})),O=(0,l.default)((function(e){return{variables:E.styles,root:{position:"relative",display:"flex",fontFamily:e.typography.fontFamily},input:{opacity:0,zIndex:1,cursor:"pointer",position:"absolute",width:"100%",height:"100%",fontFamily:"inherit",margin:0,"&:checked + label svg":{backgroundColor:E.get("checkboxColor",e.colors.primary),borderColor:E.get("checkboxColor",e.colors.primary),strokeDashoffset:0},"&:required + label":{"& $labelTextSpan":{display:"flex","&:after":{content:'"\\002A"',color:e.colors.alert,paddingLeft:e.spacing.base/2,paddingRight:e.spacing.base/2}}}},disabled:{cursor:"not-allowed","&& + label":{"& svg":{borderColor:e.colors.baseContrast030,boxShadow:"none"},"& $labelText":{color:e.colors.baseContrast040}},"&:checked + label svg":{backgroundColor:e.colors.baseContrast030,borderColor:e.colors.baseContrast030}},label:{display:"flex",flexDirection:"row",fontFamily:"inherit",fontSize:e.typography.fontSize,fontWeight:e.typography.fontWeight,lineHeight:"".concat(2.5*e.spacing.base,"px")},svg:{boxSizing:"border-box",width:18,height:18,minWidth:18,borderRadius:3,borderWidth:2,borderStyle:"solid",borderColor:E.get("checkboxPrimary",e.colors.baseContrast060),fill:"none",stroke:(0,u.getContrastingTextColorHexString)(e.colors.primary,void 0,void 0,u.PRIMARY_CONTRAST_STANDARD),strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",strokeDasharray:16,strokeDashoffset:16,transition:"all .3s ease",transform:"translate3d(0,0,0)",backgroundColor:"transparent",display:"flex",margin:0,marginInlineEnd:e.spacing.base},labelText:{fontFamily:"inherit",color:e.colors.baseContrast070},labelTextSpan:{},flip:{flexDirection:"row-reverse","& svg":{margin:0,marginInlineStart:e.spacing.base}},hint:{fontSize:e.typography.fontSize-2,fontWeight:e.typography.fontWeight,color:e.colors.baseContrast050},description:{fontSize:e.typography.fontSize-2,fontWeight:e.typography.fontWeight,color:e.colors.baseContrast050}}}),{name:"Checkbox"});C.displayName="Checkbox",t.Storybook=C;var P=(0,c.default)(C);P.displayName="Checkbox",t.default=P},98756:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0});var i={};t.default=void 0;var o=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=n(e)&&"function"!=typeof e)return{default:e};var r=a(t);if(r&&r.has(e))return r.get(e);var i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&{}.hasOwnProperty.call(e,s)){var l=o?Object.getOwnPropertyDescriptor(e,s):null;l&&(l.get||l.set)?Object.defineProperty(i,s,l):i[s]=e[s]}return i.default=e,r&&r.set(e,i),i}(r(93067));function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(a=function(e){return e?r:t})(e)}Object.keys(o).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(i,e)||e in t&&t[e]===o[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}}))})),t.default=o.default},73377:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Storybook=void 0;var i=m(r(46942)),o=f(r(62249)),a=r(82239),s=f(r(67925)),l=r(87219),c=m(r(83180)),u=r(7393),d=m(r(93940)),h=["children","className","checked","defaultChecked","name","onChange","required","selectedColor","size","value"];function p(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(p=function(e){return e?r:t})(e)}function f(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=n(e)&&"function"!=typeof e)return{default:e};var r=p(t);if(r&&r.has(e))return r.get(e);var i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(i,a,s):i[a]=e[a]}return i.default=e,r&&r.set(e,i),i}function m(e){return e&&e.__esModule?e:{default:e}}function g(){return g=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,h),k=(0,a.useTheme)(),R=n.selectedColor||E,A=null!==(r=k.colors[R])&&void 0!==r?r:R,D=(0,u.getContrastingTextColorHexString)(A,void 0,void 0,u.PRIMARY_CONTRAST_STANDARD),I=n.size||O,x=n.name||v,M=(0,s.default)(s.vars.useVars(y({chipSelectedColor:A,chipSelectedContentColor:D},(0,d.default)(T,s.common)))),L=y({checked:(0,l.mergeCheckAndSelect)(f,n.selected,P),defaultChecked:(0,l.mergeCheckAndSelect)(m,n.defaultSelected,P),name:x,onChange:function(e){b&&b(e),n.onCheck&&n.onCheck(e.target.value,e)},ref:t,required:S,type:n.type||"checkbox",value:P},T);return o.default.createElement("label",{className:(0,i.default)(M.variables,M.root,M.inputRelated,M[I],p)},o.default.createElement("input",g({className:M.input},L)),c)}));b.displayName="Chip",t.Storybook=b;var _=(0,c.default)(b);_.displayName="Chip",t.default=_},67925:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.vars=t.default=t.common=void 0;var n=r(20801),i=a(r(81095)),o=a(r(61754));function a(e){return e&&e.__esModule?e:{default:e}}function s(e){return s="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},s(e)}function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeCheckAndSelect=t.ChipContext=void 0;var n=r(62249);t.ChipContext=(0,n.createContext)({defaultSelected:void 0,name:void 0,onCheck:void 0,required:void 0,selected:void 0,selectedColor:void 0,size:void 0,type:void 0}),t.mergeCheckAndSelect=function(e,t,r){return void 0!==e?e:void 0!==t?t===r:void 0}},87474:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"ChipGroupCommon",{enumerable:!0,get:function(){return a.Common}}),t.default=void 0;var i=c(r(62249)),o=r(87219),a=c(r(7074)),s=["children","defaultSelected","direction","name","onCheck","required","selected","selectedColor","size","width","gap"];function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(l=function(e){return e?r:t})(e)}function c(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=n(e)&&"function"!=typeof e)return{default:e};var r=l(t);if(r&&r.has(e))return r.get(e);var i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(i,a,s):i[a]=e[a]}return i.default=e,r&&r.set(e,i),i}function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var d=(0,i.forwardRef)((function(e,t){var r=e.children,l=e.defaultSelected,c=e.direction,d=void 0===c?"row":c,h=e.name,p=e.onCheck,f=e.required,m=e.selected,g=e.selectedColor,v=e.size,y=e.width,b=void 0===y?"fit-content":y,_=e.gap,S=function(e){for(var t=1;t=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,s));return i.default.createElement(o.ChipContext.Provider,{value:{defaultSelected:l,name:h,onCheck:p,required:f,selected:m,selectedColor:g,size:v,type:"radio"}},i.default.createElement(a.default,S,r))}));d.displayName="ChipGroup",t.default=d},71479:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0});var i={ChipGroup:!0,ChipStyles:!0,ChipCommon:!0};Object.defineProperty(t,"ChipCommon",{enumerable:!0,get:function(){return s.Common}}),Object.defineProperty(t,"ChipGroup",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"ChipStyles",{enumerable:!0,get:function(){return s.ChipStyles}}),t.default=void 0;var o=c(r(73377));Object.keys(o).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(i,e)||e in t&&t[e]===o[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}}))}));var a=c(r(87474));Object.keys(a).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(i,e)||e in t&&t[e]===a[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return a[e]}}))}));var s=r(67925);function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(l=function(e){return e?r:t})(e)}function c(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=n(e)&&"function"!=typeof e)return{default:e};var r=l(t);if(r&&r.has(e))return r.get(e);var i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(i,a,s):i[a]=e[a]}return i.default=e,r&&r.set(e,i),i}t.default=o.default},8579:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.flexStyles=t.default=t.common=t.Storybook=void 0;var i=v(r(46942)),o=g(r(62249)),a=v(r(81095)),s=r(61925),l=v(r(83180)),c=g(r(50018)),u=v(r(93940)),d=v(r(55579)),h=r(75709),p=v(r(61754)),f=["children","className","direction","wrap","gap","alignItems","justifyContent","grow","backgroundOpacity","background","opacity"];function m(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(m=function(e){return e?r:t})(e)}function g(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=n(e)&&"function"!=typeof e)return{default:e};var r=m(t);if(r&&r.has(e))return r.get(e);var i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(i,a,s):i[a]=e[a]}return i.default=e,r&&r.set(e,i),i}function v(e){return e&&e.__esModule?e:{default:e}}function y(){return y=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,f),A=(0,d.default)(P),D=k(O.useVars(_(_({flexDirection:l,gap:g,alignItems:v,justifyContent:b},(0,u.default)(R,C)),{},{background:(0,c.default)(A,E),opacity:(0,c.getOpacityPercentage)(T)})));return o.default.createElement("div",y({ref:t,className:(0,i.default)(D.variables,D.root,S(S(S({},D.row,"row"===l||"row-reverse"===l),D.wrap,p),D.grow,w),n)},R),r)})),T=t.flexStyles=function(){return{variables:O.styles,root:{display:"flex",boxSizing:"border-box","& > *":{minWidth:0,maxWidth:"100%"}},row:{alignItems:"center"},wrap:{flexWrap:"wrap"},grow:{"& > *":{flexGrow:1}}}},k=(0,a.default)(T,{name:"Flex"});P.displayName="Flex",t.Storybook=P;var R=(0,l.default)(P);R.displayName="Flex",t.default=R},7074:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0});var i={};t.default=void 0;var o=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=n(e)&&"function"!=typeof e)return{default:e};var r=a(t);if(r&&r.has(e))return r.get(e);var i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&{}.hasOwnProperty.call(e,s)){var l=o?Object.getOwnPropertyDescriptor(e,s):null;l&&(l.get||l.set)?Object.defineProperty(i,s,l):i[s]=e[s]}return i.default=e,r&&r.set(e,i),i}(r(8579));function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(a=function(e){return e?r:t})(e)}Object.keys(o).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(i,e)||e in t&&t[e]===o[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}}))})),t.default=o.default},45147:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.vars=t.default=t.common=t.Storybook=void 0;var i=b(r(46942)),o=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=n(e)&&"function"!=typeof e)return{default:e};var r=y(t);if(r&&r.has(e))return r.get(e);var i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(i,a,s):i[a]=e[a]}return i.default=e,r&&r.set(e,i),i}(r(62249)),a=r(82239),s=b(r(93792)),l=b(r(81095)),c=r(46503),u=b(r(36414)),d=b(r(83180)),h=b(r(50645)),p=b(r(8930)),f=b(r(93940)),m=r(75709),g=b(r(61754)),v=["as","className","disabled","fill","filled","type","name","overrides","outlined","shadow","size","iconSize","viewBox","selected","title","dropShadow","buttonHeight","buttonWidth","borderWidth"];function y(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(y=function(e){return e?r:t})(e)}function b(e){return e&&e.__esModule?e:{default:e}}function _(){return _=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,v),J=(0,a.useTheme)(),Q=A(C,J.colors,g,[c.PlatformId.streamfans,c.PlatformId.streamate].includes(null==J||null===(r=J.themeProviderProps)||void 0===r?void 0:r.platformId),null==J||null===(n=J.themeProviderProps)||void 0===n?void 0:n.themeMode),X=Q.baseBorder,ee=Q.baseSvg,te=Q.baseHover,re=Q.selectedBorder,ne=Q.selectedSvg,ie=Q.selectedHover,oe=D(T.useVars(w(w(w({size:F,height:K,width:$,padding:"number"==typeof F&&F<=16?6:J.spacing.base},(0,f.default)(Y,P)),e),{},{borderWidth:Z,colorsBorderColor:G?re:X,svgFill:G?ne:ee,hoverColor:G?ie:te,selectedBorder:re,selectedHover:ie}))),ae=(0,i.default)(oe.variables,oe.root,oe.colors,oe[F],E({},oe.shadowHover,"hover"===j),E({},oe.outlined,M),E({},oe.shadowOn,"on"===j),E({},oe.filled,b),I.root,d),se=(0,i.default)(oe.svgIcon,I.svgIcon),le=w(w({},Y),{},{className:ae,disabled:p,ref:t,type:"button"});return o.default.createElement(u,_({},le,{"aria-label":null!=W?W:O}),o.default.createElement(s.default,{name:O,size:B||F,overrides:{root:se},viewBox:V,fill:k(C)&&g||C,title:W,dropShadow:z}))})),A=function(e,t,r,n,i){switch(e){case"default":var o=r?t[r]||r:null;return!r&&n&&i===c.ThemeMode.light?{baseBorder:t.baseContrast070,baseSvg:t.baseContrast070,baseHover:t.baseContrast085,selectedBorder:t.primary,selectedSvg:t.baseContrast100,selectedHover:t.baseContrast100}:{baseBorder:null!=o?o:t.baseInvariant,baseSvg:null!=o?o:t.baseInvariant,baseHover:t.baseContrast100,selectedBorder:null!=o?o:t.primary,selectedSvg:t.baseContrast100,selectedHover:t.baseContrast100};case"error":return{baseBorder:t.baseInvariant,baseSvg:t.baseInvariant,baseHover:t.alert,selectedBorder:t.alert,selectedSvg:t.alert,selectedHover:(0,p.default)(t.alert,.75)};case"highContrast":return{baseBorder:n?t.baseContrast070:t.baseContrast100,baseSvg:n?t.baseContrast090:t.baseContrast100,baseHover:n?t.baseContrast100:t.baseContrast070,selectedBorder:t.primary,selectedSvg:t.primary,selectedHover:t.baseContrast100};default:var a;return{baseBorder:n?t.baseContrast070:t.baseInvariant,baseSvg:n?t.baseContrast070:t.baseInvariant,baseHover:t[e],selectedBorder:t[e],selectedSvg:t[e],selectedHover:(0,p.default)(null!==(a=t[e])&&void 0!==a?a:e,.75)}}},D=(0,l.default)((function(e){var t=e.colors;return{variables:T.styles,root:{backgroundColor:"transparent",display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",outline:"none",border:0,margin:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",textDecoration:"none",textAlign:"center",borderRadius:"50%",boxSizing:"border-box","&:disabled, &:disabled svg":{pointerEvents:"none",cursor:"default",fill:t.baseContrast020,borderColor:t.baseContrast020}},filled:{backgroundColor:t.themeBase,"&:disabled":{backgroundColor:t.baseContrast015}},outlined:{borderStyle:"solid",borderWidth:T.get("borderWidth")},shadowOn:{boxShadow:"0 1px 2px 0 ".concat((0,p.default)(t.baseShadow,.5))},shadowHover:w({},(0,h.default)({hover:{boxShadow:"0 1px 2px 0 ".concat((0,p.default)(t.baseShadow,.5))}})),svgIcon:{display:"inline-block",verticalAlign:"middle"},colors:w(w({transitionDuration:300,transitionProperty:["box-shadow","border-color"],borderColor:T.get("colorsBorderColor"),"& svg":{transitionDuration:300,transitionProperty:"fill",fill:T.get("svgFill")}},(0,h.default)({hover:{borderColor:T.get("hoverColor"),"& svg":{fill:T.get("hoverColor")}}})),{},{"&:focus-visible":{borderColor:T.get("selectedBorder"),"& svg":{fill:T.get("selectedHover")}}})}}),{name:"IconButton"});R.displayName="IconButton",t.Storybook=R;var I=(0,u.default)((0,d.default)(R));I.displayName="IconButton",t.default=I},16744:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0});var i={};t.default=void 0;var o=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=n(e)&&"function"!=typeof e)return{default:e};var r=a(t);if(r&&r.has(e))return r.get(e);var i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&{}.hasOwnProperty.call(e,s)){var l=o?Object.getOwnPropertyDescriptor(e,s):null;l&&(l.get||l.set)?Object.defineProperty(i,s,l):i[s]=e[s]}return i.default=e,r&&r.set(e,i),i}(r(45147));function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(a=function(e){return e?r:t})(e)}Object.keys(o).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(i,e)||e in t&&t[e]===o[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}}))})),t.default=o.default},10781:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.vars=t.default=t.Storybook=t.MessageBarTypes=void 0;var i=m(r(46942)),o=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=n(e)&&"function"!=typeof e)return{default:e};var r=f(t);if(r&&r.has(e))return r.get(e);var i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(i,a,s):i[a]=e[a]}return i.default=e,r&&r.set(e,i),i}(r(62249)),a=m(r(93792)),s=r(20801),l=m(r(81095)),c=m(r(83180)),u=m(r(93940)),d=r(75709),h=m(r(61754)),p=["children","overrides","className","type","noIcon"];function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(f=function(e){return e?r:t})(e)}function m(e){return e&&e.__esModule?e:{default:e}}function g(){return g=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,p),m=P(y(y({},(0,u.default)(f,w)),{},{messageBarFill:c===C.ERROR?"alert":c}));return o.default.createElement("div",g({className:(0,i.default)(m.variables,m.root,b({},m[c],c),s.root,l),ref:t},f),!h&&o.default.createElement(a.default,{size:32,name:c,className:(0,i.default)(m.svgIcon,s.svgIcon)}),o.default.createElement("div",{style:{minWidth:0}},r))})),P=(0,l.default)((function(e){return{variables:E.styles,root:y(y({display:"inline-flex",justifyContent:"flex-start",alignItems:"center",boxSizing:"border-box",width:"100%",maxWidth:696,whiteSpace:"pre-line",textAlign:"start",fontFamily:e.typography.fontFamily,padding:e.spacing.base,border:"1px solid",borderColor:E.get("messageBarFill")},(0,s.setTextCssVars)({color:e.colors.baseContrast100,lineHeight:e.typography.lineHeight,fontWeight:e.typography.fontWeight,fontSize:e.typography.fontSize})),{},{"& a":y({textDecoration:"none"},(0,s.setTextCssVars)({color:e.colors.primary,fontWeight:500}))}),svgIcon:{alignSelf:"flex-start",marginInlineEnd:e.spacing.base,fill:E.get("messageBarFill")}}}),{name:"MessageBar"});O.displayName="MessageBar",t.Storybook=O;var T=(0,c.default)(O);T.displayName="MessageBar",t.default=T},88013:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0});var i={};t.default=void 0;var o=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=n(e)&&"function"!=typeof e)return{default:e};var r=a(t);if(r&&r.has(e))return r.get(e);var i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&{}.hasOwnProperty.call(e,s)){var l=o?Object.getOwnPropertyDescriptor(e,s):null;l&&(l.get||l.set)?Object.defineProperty(i,s,l):i[s]=e[s]}return i.default=e,r&&r.set(e,i),i}(r(10781));function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(a=function(e){return e?r:t})(e)}Object.keys(o).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(i,e)||e in t&&t[e]===o[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}}))})),t.default=o.default},23687:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.ModalOverlay=void 0;var i=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=n(e)&&"function"!=typeof e)return{default:e};var r=o(t);if(r&&r.has(e))return r.get(e);var i={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&{}.hasOwnProperty.call(e,s)){var l=a?Object.getOwnPropertyDescriptor(e,s):null;l&&(l.get||l.set)?Object.defineProperty(i,s,l):i[s]=e[s]}return i.default=e,r&&r.set(e,i),i}(r(62249));function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(o=function(e){return e?r:t})(e)}function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Storybook=void 0;var i=S(r(46942)),o=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=n(e)&&"function"!=typeof e)return{default:e};var r=_(t);if(r&&r.has(e))return r.get(e);var i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(i,a,s):i[a]=e[a]}return i.default=e,r&&r.set(e,i),i}(r(62249)),a=r(82239),s=r(59897),l=r(23687),c=S(r(22613)),u=S(r(81095)),d=S(r(83180)),h=r(97432),p=S(r(8930)),f=r(78047),m=S(r(60828)),g=S(r(93940)),v=S(r(61754)),y=S(r(64621)),b=["children","className","closeOnClick","openOnClick","container","disableAnimation","disableOpenOnHover","onMouseLeave","onBlurClick","onClick","open","overlayRef","overrides","staticPosition","style","targetId","hideTriangle"];function _(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(_=function(e){return e?r:t})(e)}function S(e){return e&&e.__esModule?e:{default:e}}function w(){return w=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,b),z=s||S,K=P((0,o.useState)(I),2),$=K[0],q=K[1],Z=(0,a.useTheme)(),Y=M(R.useVars(C(C({},(0,g.default)(W,k)),{},{maxHeight:$}))),J=M(A.useVars({background:e.background})),Q=P((0,o.useState)(!1),2),X=Q[0],ee=Q[1],te=P((0,o.useState)(!1),2),re=te[0],ne=te[1],ie=P((0,o.useState)(!0),2),oe=ie[0],ae=ie[1],se=Boolean(!X&&oe&&!re),le=(0,o.useRef)(null),ce=(0,o.useRef)(null),ue=(0,o.useRef)({anchor:"left",trianglePosition:"top",triangleMargin:0,resizeTimer:null,styles:{}}),de=(0,m.default)(["onFocus","background"],W),he=P(o.default.useState(!1),2),pe=he[0],fe=he[1],me=function(e){h.isBrowser&&("animationstart"===e.type?(0,f.isAnyAnimation)(e,["simpleOpen","rootOpen"])&&(B||window.addEventListener("resize",ve),ee(!0),ae(!1)):(0,f.isAnyAnimation)(e,["simpleClose","rootClose"])&&(ue.current.styles={},ue.current.anchor="left",ue.current.trianglePosition="top",ce.current.removeEventListener("mouseleave",be),window.removeEventListener("resize",ve),ee(!1),ae(!0)))},ge=(0,o.useCallback)((function(){if(ce.current&&h.isBrowser){var e,t=ce.current.getBoundingClientRect(),r=document.body.offsetWidth,n=Z.spacing.base,i=4*Z.spacing.base+12,o=t.left+t.width/2,a=t.width/2,s=window.innerWidth/2,l=document.documentElement.clientHeight/2,c="auto",u="auto";fe(!1);var d,p=window.scrollY,f=D(ce.current);return f&&(p=0),l1?(0,y.default)(!1,"Multiple elements of the provided ID exist. Please use a unique ID."):re&&t.length<1?(0,y.default)(!1,"The provided ID belongs to an element that either does not exist or is not yet rendered. The Popover component needs a valid element to attach to."):(null===e.current&&(e.current=t[0]),!re&&oe&&!X&&e.current&&(z?s&&e.current.addEventListener("mousedown",Se):e.current.addEventListener("mouseenter",_e)),re||oe||X||(ue.current.styles={},ue.current.anchor="left",ue.current.trianglePosition="top",window.removeEventListener("resize",ve),e.current.removeEventListener("mouseleave",be),ae(!0)),void 0!==L&&L!==re&&(B||X||(ue.current.styles=ge()),ne(L)))}),[_e,be,V,L,ge,z,ve,B,X,re,oe,s,Se]);var we=(0,i.default)(J.rootVariables,Y.root,O({},Y.rootOpen,re&&!pe&&!F.rootOpen),O({},Y.rootOpenBottom,re&&pe&&!F.rootOpen),O({},Y.rootClose,!re&&X&&!pe&&!F.rootClosed),O({},Y.rootCloseTop,!re&&X&&pe&&!F.rootClosed),O({},Y.simpleOpen,v&&re&&!F.rootOpen),O({},Y.simpleClose,v&&!re&&X&&!F.rootClosed),F.root,r),Ee=B||G?"":(0,i.default)([Y.triangle],Y["".concat(ue.current.trianglePosition,"Triangle")],[F.triangle]),Ce={marginLeft:"left"===ue.current.anchor?Math.max(4*Z.spacing.base+ue.current.triangleMargin,0):"auto",marginRight:"right"===ue.current.anchor?Math.max(4*Z.spacing.base+ue.current.triangleMargin,0):"auto",marginBottom:-1,marginTop:-1};return!se&&o.default.createElement(c.default,{container:d},o.default.createElement(o.default.Fragment,null,o.default.createElement("div",w({ref:le,style:ue.current.styles,onFocus:function(e){if(le.current&&h.isBrowser){var t=document.querySelectorAll(":hover"),r=t[t.length-1];!le.current.contains(r)&&le.current.contains(document.activeElement)&&ne(!1),W.onFocus&&W.onFocus(e)}},onClick:function(e){x&&x(e),n&&ne(!1)},onBlur:function(){return!s||ne(!1)},onMouseLeave:re&&X&&!z?be:void 0,onAnimationEndCapture:me,onAnimationStart:me,className:we},de),o.default.createElement("span",{className:Ee,style:Ce}),o.default.createElement("div",{className:(0,i.default)(Y.variables,Y.content,Y.scroll,F.content)},t)),(T||s)&&o.default.createElement(l.ModalOverlay,{className:(0,i.default)(Y.overlay,F.overlay),onClick:function(e){e.stopPropagation(),T&&T(),s&&ne(!1)},ref:j,"data-ta-locator":"PopoverOverlay"})))},M=(0,u.default)((function(e){return{rootVariables:A.styles,variables:R.styles,root:{display:"flex",flexDirection:"column",minHeight:8*e.spacing.base,maxWidth:64*e.spacing.base,position:"absolute",top:0,left:0,willChange:"opacity, transform",boxSizing:"border-box",zIndex:s.Z_INDEX.Popover,margin:[0,e.spacing.base],"--background":e.colors.baseContrast020},rootOpen:{animation:"150ms linear normal forwards $rootOpen"},rootOpenBottom:{animation:"150ms linear normal forwards $rootOpenBottom"},rootClose:{animation:"150ms linear normal forwards $rootClose"},rootCloseTop:{animation:"150ms linear normal forwards $rootCloseTop"},simpleOpen:{animation:"0ms linear normal forwards $rootOpen"},simpleClose:{animation:"0ms linear normal forwards $rootClose"},triangle:{boxSizing:"border-box",borderWidth:12,borderColor:"transparent",borderStyle:"solid",zIndex:2},topTriangle:{borderBottomColor:A.get("background"),borderTopWidth:0,borderBottomWidth:11},bottomTriangle:{borderTopColor:A.get("background"),borderBottomWidth:0,borderTopWidth:11},content:{padding:2*e.spacing.base,background:A.get("background"),borderRadius:2,boxShadow:"-3px -1px 10px 0 ".concat((0,p.default)(e.colors.baseShadow,.2)),color:e.colors.baseContrast070,overflowY:"auto",maxHeight:R.get("maxHeight")},overlay:{height:"100%",width:"100vw",position:"fixed",top:0,left:0,zIndex:s.Z_INDEX.ModalOverlay,opacity:0},scroll:{scrollbarWidth:"thin","&::-webkit-scrollbar":{width:2*e.spacing.base},"&::-webkit-scrollbar-thumb":{backgroundColor:e.colors.baseContrast030,borderRadius:2,border:"solid ".concat(e.spacing.base/2,"px ").concat(e.colors.baseContrast020)},"&::-webkit-scrollbar-thumb:hover":{backgroundColor:e.colors.baseContrast040},"&::-webkit-scrollbar-track":{backgroundColor:e.colors.baseContrast020,borderRadius:2,marginTop:e.spacing.base/2,marginBottom:e.spacing.base/2}},"@keyframes rootOpen":{"0%":{opacity:0,transform:"translateY(".concat(4*e.spacing.base,"px)")},"100%":{opacity:1,transform:"translateY(0)"}},"@keyframes rootOpenBottom":{"0%":{opacity:0,transform:"translateY(-".concat(4*e.spacing.base,"px)")},"100%":{opacity:1,transform:"translateY(0)"}},"@keyframes rootClose":{"0%":{opacity:1,transform:"translateY(0px)"},"100%":{opacity:0,transform:"translateY(".concat(4*e.spacing.base,"px)")}},"@keyframes rootCloseTop":{"0%":{opacity:1,transform:"translateY(0px)"},"100%":{opacity:0,transform:"translateY(".concat(4*-e.spacing.base,"px)")}},"@keyframes simpleOpen":{"0%":{opacity:0},"100%":{opacity:1}},"@keyframes simpleClose":{"0%":{opacity:1},"100%":{opacity:0}}}}),{name:"Popover"});x.displayName="Popover",t.Storybook=x;var L=(0,d.default)(x);L.displayName="Popover",t.default=L},94522:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0});var i={};t.default=void 0;var o=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=n(e)&&"function"!=typeof e)return{default:e};var r=a(t);if(r&&r.has(e))return r.get(e);var i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&{}.hasOwnProperty.call(e,s)){var l=o?Object.getOwnPropertyDescriptor(e,s):null;l&&(l.get||l.set)?Object.defineProperty(i,s,l):i[s]=e[s]}return i.default=e,r&&r.set(e,i),i}(r(31859));function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(a=function(e){return e?r:t})(e)}Object.keys(o).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(i,e)||e in t&&t[e]===o[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}}))})),t.default=o.default},22613:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.PortalBase=void 0;var n=c(r(62249)),i=r(81699),o=r(82239),a=c(r(29532)),s=r(97432),l=c(r(60828));function c(e){return e&&e.__esModule?e:{default:e}}function u(){return u=Object.assign?Object.assign.bind():function(e){for(var t=1;t{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.vars=t.default=t.Storybook=void 0;var i=f(r(46942)),o=f(r(62249)),a=r(95586),s=f(r(81095)),l=f(r(83180)),c=f(r(93940)),u=r(75709),d=f(r(61754)),h=f(r(64621)),p=["value","name","defaultChecked","required","labelSide","className","onCheck","label","disabled","hint","description","selectedColor","wrapperProps","stretch"];function f(e){return e&&e.__esModule?e:{default:e}}function m(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function g(e){for(var t=1;t=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,p),A=S(b.useVars(g(g({},(0,c.default)(R,y)),{},{rootAlignItems:C?"flex-start":"center",rootCursor:w?"not-allowed":"pointer",checkedInputColor:O})));(0,h.default)(r,"Always add the name prop to input components!");var D=g({type:"radio",value:t,name:r,className:(0,i.default)(A.input,f),defaultChecked:n,required:l,disabled:w,onChange:function(e){m&&m(t,e)}},R),I=g(g({},P),{},{className:(0,i.default)(A.variables,A.root,v(v(v({},A.flip,d===a.LabelSide.LEFT),A.rootDisabled,w),A.stretch,k),null==P?void 0:P.className)});return o.default.createElement("label",I,o.default.createElement("input",D),o.default.createElement("div",{className:(0,i.default)(A.check,v({},A.disabled,w))}),_&&o.default.createElement("div",null,o.default.createElement("span",null,_),E&&o.default.createElement("span",{className:(0,i.default)(A.hint)}," (",E,")"),C&&o.default.createElement("div",{className:(0,i.default)(A.description)},C)))},S=(0,s.default)((function(e){return{variables:b.styles,root:{display:"inline-flex",alignItems:b.get("rootAlignItems"),fontFamily:e.typography.fontFamily,lineHeight:"".concat(2.5*e.spacing.base,"px"),cursor:b.get("rootCursor"),position:"relative",fontWeight:e.typography.fontWeight,fontSize:e.typography.fontSize,color:e.colors.baseContrast070},stretch:{justifyContent:"space-between",width:"100%"},rootDisabled:{color:e.colors.baseContrast040},input:{opacity:0,zIndex:-1,position:"absolute","&:checked + div":{borderColor:b.get("checkedInputColor",e.colors.primary),"&:before":{backgroundColor:b.get("checkedInputColor",e.colors.primary)}},"&:checked:disabled + div":{borderColor:e.colors.baseContrast030,"&:before":{backgroundColor:e.colors.baseContrast030}}},flip:{flexDirection:"row-reverse","& $check":{marginInlineStart:e.spacing.base,marginInlineEnd:0}},check:{boxSizing:"border-box",display:"flex",alignItems:"center",justifyContent:"center",border:"2px solid ".concat(e.colors.baseContrast060),borderRadius:"100%",height:18,width:18,minWidth:18,transition:"border-color .3s ease, box-shadow .3s ease",margin:0,marginInline:0,marginInlineEnd:e.spacing.base,"&:before":{content:"''",height:8,width:8,borderRadius:"100%",transition:"all .3s ease"}},disabled:{border:"2px solid ".concat(e.colors.baseContrast030)},hint:{fontSize:e.typography.fontSize-2,fontWeight:e.typography.fontWeight,color:e.colors.baseContrast050},description:{fontSize:e.typography.fontSize-2,fontWeight:e.typography.fontWeight,color:e.colors.baseContrast050}}}),{name:"RadioButton"});_.displayName="RadioButton",t.Storybook=_;var w=(0,l.default)(_);w.displayName="RadioButton",t.default=w},81351:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0});var i={};t.default=void 0;var o=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=n(e)&&"function"!=typeof e)return{default:e};var r=a(t);if(r&&r.has(e))return r.get(e);var i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&{}.hasOwnProperty.call(e,s)){var l=o?Object.getOwnPropertyDescriptor(e,s):null;l&&(l.get||l.set)?Object.defineProperty(i,s,l):i[s]=e[s]}return i.default=e,r&&r.set(e,i),i}(r(84820));function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(a=function(e){return e?r:t})(e)}Object.keys(o).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(i,e)||e in t&&t[e]===o[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}}))})),t.default=o.default},18423:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Storybook=void 0;var i=b(r(46942)),o=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=n(e)&&"function"!=typeof e)return{default:e};var r=y(t);if(r&&r.has(e))return r.get(e);var i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(i,a,s):i[a]=e[a]}return i.default=e,r&&r.set(e,i),i}(r(62249)),a=r(82239),s=b(r(93792)),l=b(r(81095)),c=b(r(3644)),u=b(r(83180)),d=r(13410),h=b(r(93940)),p=r(65253),f=b(r(30881)),m=r(75709),g=b(r(61754)),v=["size","icon","total","className","onClick","onLongPress","disabled","acknowledge","placement","overrides"];function y(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(y=function(e){return e?r:t})(e)}function b(e){return e&&e.__esModule?e:{default:e}}function _(){return _=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,v),I=(0,a.useTheme)(),x=T(O.useVars(w(w({},(0,h.default)(D,C)),{},{reactionSize:"".concat(I.iconSizes[n],"px"),reactionScale:"scale(".concat(100/I.iconSizes.medium*I.iconSizes[n]/100,")"),reactionCursor:g?"pointer":"default",reactionFontSize:"string"==typeof e.icon?I.iconSizes[n]:"unset"}))),M=(0,o.useRef)(null),L=null!=u,j=l?(0,c.default)(l):o.default.createElement(s.default,{name:"thumbUp"}),N=(0,f.default)({onLongPress:function(){return y&&y(M)},onClick:function(){return g&&g(M)}});return(0,o.useLayoutEffect)((function(){S&&M.current&&null!==l&&function(e,t){if("string"==typeof l)for(var r=e.getBoundingClientRect(),n=r.left+r.width/2,i=r.top+r.height/2,o=0;o<8;o++)(0,d.createParticle)(t,n,i)}(M.current,l)}),[l]),o.default.createElement("div",_({className:(0,i.default)(x.variables,x.root,E({},x.disabled,b),x[k],A.root,m),ref:t},N,D),o.default.createElement("span",{ref:M,className:(0,i.default)(x.icon,A.icon)},j),L&&o.default.createElement("span",{className:(0,i.default)(x.total,A.total,m)},(0,p.shortenNumber)(u)))})),T=(0,l.default)((function(e){return{"@global":{particle:{position:"fixed",top:0,left:0,opacity:0,pointerEvents:"none"}},variables:O.styles,root:{whiteSpace:"nowrap",position:"relative",cursor:O.get("reactionCursor"),userSelect:"none",lineHeight:1,display:"flex",alignItems:"center"},disabled:{pointerEvents:"none",filter:"grayscale(100%)",color:e.colors.baseContrast050,"& svg":{fill:e.colors.baseContrast030,borderColor:e.colors.baseContrast030}},icon:{margin:e.spacing.base/2,fontSize:O.get("reactionFontSize"),lineHeight:1,"& img":{width:O.get("reactionSize"),height:O.get("reactionSize")},"& svg":{fill:e.colors.baseInvariant,width:O.get("reactionSize"),height:O.get("reactionSize"),transform:O.get("reactionScale")}},total:{color:e.colors.baseInvariant,fontSize:O.get("reactionSize"),lineHeight:1,margin:e.spacing.base/2},left:{flexDirection:"row"},right:{flexDirection:"row-reverse"},top:{flexDirection:"column-reverse"},bottom:{flexDirection:"column"}}}),{name:"Reaction"});P.displayName="Reaction",t.Storybook=P;var k=(0,u.default)(P);k.displayName="Reaction",t.default=k},58250:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0});var i={};t.default=void 0;var o=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=n(e)&&"function"!=typeof e)return{default:e};var r=a(t);if(r&&r.has(e))return r.get(e);var i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&{}.hasOwnProperty.call(e,s)){var l=o?Object.getOwnPropertyDescriptor(e,s):null;l&&(l.get||l.set)?Object.defineProperty(i,s,l):i[s]=e[s]}return i.default=e,r&&r.set(e,i),i}(r(18423));function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(a=function(e){return e?r:t})(e)}Object.keys(o).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(i,e)||e in t&&t[e]===o[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}}))})),t.default=o.default},50801:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.vars=t.default=t.Storybook=void 0;var i=m(r(46942)),o=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=n(e)&&"function"!=typeof e)return{default:e};var r=f(t);if(r&&r.has(e))return r.get(e);var i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(i,a,s):i[a]=e[a]}return i.default=e,r&&r.set(e,i),i}(r(62249)),a=r(82239),s=m(r(58250)),l=m(r(81095)),c=m(r(83180)),u=m(r(93940)),d=r(75709),h=m(r(61754)),p=["className","reactions","onSelect","overrides","showLabels","showCounts","size","userReaction","wrapperProps"];function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(f=function(e){return e?r:t})(e)}function m(e){return e&&e.__esModule?e:{default:e}}function g(){return g=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,p),k=(0,a.useTheme)(),R=w(_.useVars(y(y({rootBackgroundColor:e.backgroundColor},(0,u.default)(T,b)),{},{size:k.iconSizes[E],invertedSize:"-".concat(k.iconSizes[E],"px")})));if(!n)return null;var A=function(e,t){return O===t?e+1:e};return o.default.createElement("div",g({ref:t},P,{className:(0,i.default)(R.variables,R.root,d.root,null==P?void 0:P.className)}),n.map((function(e,t){var n=e.name,a=e.icon,c=e.count;return o.default.createElement("div",{className:R.reaction,key:t},f&&n&&o.default.createElement("div",{className:R.label},n),o.default.createElement(s.default,g({className:(0,i.default)(R.icon,R.total,r),icon:a,total:v?A(c,a):void 0,placement:"bottom",size:E},T,{onClick:function(){return l(a)}})))})))})),w=(0,l.default)((function(e){return{variables:_.styles,root:{backgroundColor:_.get("rootBackgroundColor",e.colors.baseContrast030),padding:[e.spacing.base,e.spacing.base/2,0],borderRadius:16,boxShadow:"0 0 0 1px rgba(0, 0, 0, .05), 0 1px 2px rgba(0, 0, 0, .15)",display:"flex"},reaction:{boxSizing:"content-box",width:_.get("size"),padding:e.spacing.base/2,position:"relative",textAlign:"center","&:hover":{"& > $label":{transform:"translateX(-50%) translateY(-10px)",opacity:"1"},"& > $icon":{transform:"scale(1.3)"}}},label:{borderRadius:"14px",fontSize:"11px",padding:"4px 7px 3px",top:_.get("invertedSize"),background:"rgba(0,0,0,.8)",color:"#fff",position:"absolute",fontWeight:"bold",textTransform:"capitalize",left:"50%",transform:"translateX(-50%)",transition:"200ms transform cubic-bezier(0.23, 1, 0.32, 1)",opacity:"0",whiteSpace:"nowrap"},icon:{cursor:"pointer",transition:"200ms transform cubic-bezier(0.23, 1, 0.32, 1)","& svg":{fill:e.colors.baseContrast060}},total:{fontSize:"11px",cursor:"default",color:e.colors.baseContrast090}}}),{name:"ReactionSelector"});S.displayName="ReactionSelector",t.Storybook=S;var E=(0,c.default)(S);E.displayName="ReactionSelector",t.default=E},41191:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0});var i={};t.default=void 0;var o=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=n(e)&&"function"!=typeof e)return{default:e};var r=a(t);if(r&&r.has(e))return r.get(e);var i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&{}.hasOwnProperty.call(e,s)){var l=o?Object.getOwnPropertyDescriptor(e,s):null;l&&(l.get||l.set)?Object.defineProperty(i,s,l):i[s]=e[s]}return i.default=e,r&&r.set(e,i),i}(r(50801));function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(a=function(e){return e?r:t})(e)}Object.keys(o).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(i,e)||e in t&&t[e]===o[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}}))})),t.default=o.default},68997:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Storybook=void 0;var i=m(r(46942)),o=f(r(62249)),a=r(82239),s=m(r(16744)),l=f(r(27889)),c=r(46503),u=m(r(83180)),d=m(r(93940)),h=["alignItems","background","children","className","direction","shadowColor","gap"];function p(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(p=function(e){return e?r:t})(e)}function f(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=n(e)&&"function"!=typeof e)return{default:e};var r=p(t);if(r&&r.has(e))return r.get(e);var i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(i,a,s):i[a]=e[a]}return i.default=e,r&&r.set(e,i),i}function m(e){return e&&e.__esModule?e:{default:e}}function g(){return g=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,h),O="column"===v,P=(0,a.useTheme)().direction===c.Direction.ltr,T=(0,o.useRef)(null),k=_((0,o.useState)(!1),2),R=k[0],A=k[1],D=_((0,o.useState)(!0),2),I=D[0],x=D[1];(0,o.useLayoutEffect)((function(){"row"===v&&T.current.clientWidth===T.current.scrollWidth&&x(!1),"column"===v&&T.current.clientHeight===T.current.scrollHeight&&x(!1)}),[v]);var M=(0,l.default)(y({},l.varsRoot.useVars(y({contentAlign:n,background:u,scrollBarGap:E,shadowColor:null!=u?u:w},(0,d.default)(C,l.common))))),L=function(){A(!1),x(!0)},j=function(){A(!0),x(!1)},N=function(){A(!0),x(!0)},F=function(e){return T.current.scrollTo({left:T.current.scrollLeft+200*e,behavior:"smooth"})};return o.default.createElement("div",g({ref:t,className:(0,i.default)(M.variablesRoot,M.root,f)},C),o.default.createElement("div",{ref:T,className:(0,i.default)(M.bar,b({},M.vertical,O)),onScroll:function(e){var t=e.target;"row"===v?function(e){var t=Math.abs(e.scrollLeft);t<10?L():t+e.clientWidth+10>=e.scrollWidth?j():N()}(t):function(e){e.scrollTop?e.scrollTop+e.clientHeight===e.scrollHeight?j():N():L()}(t)}},p),"row"===v&&R&&o.default.createElement("div",{className:(0,i.default)(M.icon,M.iconStart)},o.default.createElement(s.default,{name:"chevronLeft",onClick:function(){return F(P?-1:1)},disabled:!R})),"row"===v&&I&&o.default.createElement("div",{className:(0,i.default)(M.icon,M.iconEnd)},o.default.createElement(s.default,{name:"chevronRight",onClick:function(){return F(P?1:-1)},disabled:!I})),o.default.createElement("div",{className:(0,i.default)(M.shadow,b(b(b(b(b({},M.shadowVisible,R),M.start,!O),M.top,O),M.startShadow,!P),M.endShadow,P))}),o.default.createElement("div",{className:(0,i.default)(M.shadow,b(b(b(b(b({},M.shadowVisible,I),M.end,!O),M.bottom,O),M.startShadow,P),M.endShadow,!P))}))}));w.displayName="Scroller",t.Storybook=w;var E=(0,u.default)(w);E.displayName="Scroller",t.default=E},27889:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.varsRoot=t.default=t.common=void 0;var i=c(r(81095)),o=r(46503),a=r(37769),s=r(75709),l=c(r(61754));function c(e){return e&&e.__esModule?e:{default:e}}function u(e,t,r){var i;return i=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,"string");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==n(i)?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function d(e){return function(e){if(Array.isArray(e))return h(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return h(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?h(e,t):void 0}}(e)||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.")}()}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0});var i={ScrollerStyles:!0};Object.defineProperty(t,"ScrollerStyles",{enumerable:!0,get:function(){return a.ScrollerStyles}}),t.default=void 0;var o=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=n(e)&&"function"!=typeof e)return{default:e};var r=s(t);if(r&&r.has(e))return r.get(e);var i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var l=o?Object.getOwnPropertyDescriptor(e,a):null;l&&(l.get||l.set)?Object.defineProperty(i,a,l):i[a]=e[a]}return i.default=e,r&&r.set(e,i),i}(r(68997));Object.keys(o).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(i,e)||e in t&&t[e]===o[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}}))}));var a=r(27889);function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(s=function(e){return e?r:t})(e)}t.default=o.default},11311:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.vars=t.default=t.common=t.TableContext=t.Storybook=void 0;var n=y(r(46942)),i=v(r(62249)),o=y(r(88015)),a=v(r(91226)),s=y(r(81182)),l=y(r(81095)),c=y(r(83180)),u=y(r(60828)),d=y(r(93940)),h=r(75709),p=y(r(61754)),f=y(r(64621)),m=["border","headers","children","overrides","className","highlightOnHover","stickyHeader","striped","tableLayout","resizerId","cellPadding"];function g(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(g=function(e){return e?r:t})(e)}function v(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=E(e)&&"function"!=typeof e)return{default:e};var r=g(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}function y(e){return e&&e.__esModule?e:{default:e}}function b(){return b=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,m),V=(l=(0,s.default)(),c=2,function(e){if(Array.isArray(e))return e}(l)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,c=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(l,c)||O(l,c)||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.")}()),H=V[0],G=V[1],W=G.height,z=G.width,K=x(S({striped:L,tableLayout:N,cellPadding:B},(0,d.default)(U,T)));(0,i.useImperativeHandle)(t,(function(){return H.current}));var $,q=(0,i.useMemo)((function(){return S(S({},e),{},{classes:K,resizerId:F})}),[e,K,F]);return i.default.createElement(D.Provider,{value:q},i.default.createElement("table",b({ref:H,className:n.default.apply(void 0,[K.variables,K.table].concat(C(R(K,p)),[_.table,P,w(w(w({},K.tableFullWidth,($=g,!(Array.isArray($)&&$.some((function(e){return"object"===E(e)&&null!==e&&!Array.isArray(e)&&("minWidth"in e||"width"in e)}))))),K.highlightOnHover,I),K.striped,L)]))},w({},a.RESIZER_ATTRIBUTE_ID,F),(0,u.default)(["sortedColumn","onHeaderClick","sortDirection"],U)),i.default.createElement("thead",{className:(0,n.default)(K.thead,_.thead)},g?i.default.createElement(o.default,{classes:K,headers:g,stickyHeader:M}):null===(r=A(v))||void 0===r?void 0:r[0]),i.default.createElement("tbody",{className:(0,n.default)(K.tbody,_.tbody)},g?v:function(e){var t=A(e);return Array.isArray(t)?t.slice(1):((0,f.default)(!1,"You might be using 2 fragments inside the Table component, body will not be rendered!"),null)}(v)),F&&i.default.createElement(a.default,{id:F,tableHeight:W,tableWidth:z})))})),x=(0,l.default)((function(e){return{variables:k.styles,table:{position:"relative",fontFamily:e.typography.fontFamily,minWidth:"100%",boxSizing:"border-box",borderCollapse:"collapse",borderWidth:1,borderColor:e.colors.baseContrast040,"& td":{borderWidth:1,borderColor:e.colors.baseContrast040},"&:hover > caption":{opacity:1}},striped:{"& tr":{"&:nth-child(even)":{background:e.colors.baseContrast015,"&:hover":{background:e.colors.baseContrast020}}}},highlightOnHover:{"& tr":{"&:hover":{background:e.colors.baseContrast020}}},horizontalBorder:{borderTopStyle:"hidden",borderBottomStyle:"none","& th, & td":{borderTopStyle:"solid",borderBottomStyle:"none"}},verticalBorder:{borderRightStyle:"hidden",borderLeftStyle:"hidden",borderBottomStyle:"hidden","& th, & td":{borderRightStyle:"solid",borderLeftStyle:"solid"}},outerBorder:{borderStyle:"solid"},thead:{textTransform:"capitalize",fontSize:14,fontWeight:600},tbody:{"& td":{padding:k.get("cellPadding","".concat(e.spacing.base,"px ").concat(2*e.spacing.base,"px")),color:e.colors.baseContrast085}},tableFullWidth:{width:"100%",maxWidth:"100%"}}}),{name:"Table"});I.displayName="Table",t.Storybook=I;var M=(0,c.default)(I);M.displayName="Table",t.default=M},9362:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=n(e)&&"function"!=typeof e)return{default:e};var r=l(t);if(r&&r.has(e))return r.get(e);var i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(i,a,s):i[a]=e[a]}return i.default=e,r&&r.set(e,i),i}(r(62249)),o=s(r(28368)),a=s(r(51759));function s(e){return e&&e.__esModule?e:{default:e}}function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(l=function(e){return e?r:t})(e)}var c=function(e){var t=e.id,r=e.tableHeight,n=e.tableWidth,s=(0,a.default)(t,n),l=s.headers,c=s.handleReset,u=s.handleResize;return i.default.createElement(i.Fragment,null,l.map((function(e,a){return a{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=a(r(46942)),i=a(r(62249)),o=r(82239);function a(e){return e&&e.__esModule?e:{default:e}}var s=(0,a(r(61754)).default)({applied:["height","insetInlineStart"]}),l=function(e){var t=e.containerWidth,r=e.handleResize,o=e.height,a=e.id,s=e.position,l=e.resetSizes,u="calc(".concat(s/(t/100),"% - ").concat(10,"px)"),d=c({height:o,insetInlineStart:u});return i.default.createElement("caption",{key:"".concat(a,"-").concat(s),className:(0,n.default)(d.unset,d.root,d.variables),onClick:function(e){return e.stopPropagation()},onDoubleClick:l,onMouseDown:r},i.default.createElement("div",{className:d.resizer}))};l.displayName="TableResizerLine";var c=(0,o.createUseStyles)((function(e){return{unset:{all:"unset"},variables:s.styles,root:{position:"absolute",display:"flex",flexDirection:"column",alignItems:"center",gap:"2px",width:20,top:-1,cursor:"col-resize",transition:"opacity 200ms linear",opacity:0,"&:hover, &:active":{opacity:1}},resizer:{width:3,height:"100%",background:e.colors.baseContrast040}}}),{name:"TableResizer"});t.default=l},91226:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"RESIZER_ATTRIBUTE_ID",{enumerable:!0,get:function(){return o.RESIZER_ATTRIBUTE_ID}}),t.default=void 0;var n,i=(n=r(9362))&&n.__esModule?n:{default:n},o=r(51759);t.default=i.default},24101:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setTableResizerStore=t.getTableResizerStore=void 0;var r=function(e){return"".concat(e,"-icfTableHeaderResizerId")};t.getTableResizerStore=function(e){return JSON.parse(window.localStorage.getItem(r(e)))},t.setTableResizerStore=function(e,t){window.localStorage.setItem(r(e),JSON.stringify(t))}},51759:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.RESIZER_ATTRIBUTE_ID=void 0;var n=r(62249),i=r(24101);function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,c=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(e,t)||s(e,t)||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.")}()}function a(e){return function(e){if(Array.isArray(e))return l(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||s(e)||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.")}()}function s(e,t){if(e){if("string"==typeof e)return l(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?l(e,t):void 0}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);rl?l:s;return t[r].width=c-o,t[r].position=c,t[r+1]&&(t[r+1].width=t[r+1].position-t[r].position),t}))};document.addEventListener("mousemove",n),document.addEventListener("mouseup",(function e(){document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",e),r.style.userSelect="auto",r.style.webkitUserSelect="auto",f(!0)})),r.style.userSelect="none",r.style.webkitUserSelect="none"}}},handleReset:function(){d(e).forEach((function(e){e.style.removeProperty("width")}));var t=d(e);h(t,l),f(!0)}}}},88015:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=o(r(62249)),i=o(r(37532));function o(e){return e&&e.__esModule?e:{default:e}}function a(e){return a="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},a(e)}var s=function(e){var t=e.classes,r=e.headers,o=e.stickyHeader;return n.default.createElement("tr",null,null==r?void 0:r.map((function(e,r){return"object"===a(s=e)&&"title"in s?n.default.createElement(i.default,{key:r,sortBy:e.sortBy,minWidth:e.minWidth,width:e.width},e.title):n.default.createElement(i.default,{key:r,className:o&&t.stickyHeader},e);var s})))};s.displayName="DeprecatedTableHeader",t.default=s},21889:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=u(r(46942)),o=u(r(62249)),a=r(82239),s=u(r(93940)),l=u(r(61754)),c=["children","className"];function u(e){return e&&e.__esModule?e:{default:e}}function d(){return d=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,c),l=g(f.useVars(function(e){for(var t=1;t{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=f(r(46942)),o=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=n(e)&&"function"!=typeof e)return{default:e};var r=p(t);if(r&&r.has(e))return r.get(e);var i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(i,a,s):i[a]=e[a]}return i.default=e,r&&r.set(e,i),i}(r(62249)),a=r(91226),s=r(11311),l=f(r(81095)),c=f(r(93940)),u=r(26789),d=f(r(61754)),h=["children","cellPadding","sortBy","className"];function p(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(p=function(e){return e?r:t})(e)}function f(e){return e&&e.__esModule?e:{default:e}}function m(){return m=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,h),p=(0,o.useContext)(s.TableContext),f=S(function(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=c(r(46942)),i=c(r(62249)),o=c(r(81095)),a=c(r(93940)),s=c(r(61754)),l=["children","className"];function c(e){return e&&e.__esModule?e:{default:e}}function u(){return u=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,l),s=m(h.useVars((0,a.default)(o,d)));return i.default.createElement("tr",u({className:(0,n.default)(s.variables,s.root,r)},o),t)},f={variables:h.styles,root:{position:"relative"}},m=(0,o.default)(f,{name:"TableRow"});p.displayName="TableRow",t.default=p},42695:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0});var i={TableData:!0,TableHeader:!0,TableRow:!0};Object.defineProperty(t,"TableData",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"TableHeader",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"TableRow",{enumerable:!0,get:function(){return s.default}}),t.default=void 0;var o=u(r(21889));Object.keys(o).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(i,e)||e in t&&t[e]===o[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}}))}));var a=u(r(37532));Object.keys(a).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(i,e)||e in t&&t[e]===a[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return a[e]}}))}));var s=u(r(5765));Object.keys(s).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(i,e)||e in t&&t[e]===s[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return s[e]}}))}));var l=u(r(11311));function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(c=function(e){return e?r:t})(e)}function u(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=n(e)&&"function"!=typeof e)return{default:e};var r=c(t);if(r&&r.has(e))return r.get(e);var i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(i,a,s):i[a]=e[a]}return i.default=e,r&&r.set(e,i),i}Object.keys(l).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(i,e)||e in t&&t[e]===l[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return l[e]}}))})),t.default=l.default},81182:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(62249);function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,c=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return o(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(e,t):void 0}}(e,t)||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.")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Storybook=void 0;var i=m(r(46942)),o=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=n(e)&&"function"!=typeof e)return{default:e};var r=f(t);if(r&&r.has(e))return r.get(e);var i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(i,a,s):i[a]=e[a]}return i.default=e,r&&r.set(e,i),i}(r(62249)),a=r(80521),s=r(20801),l=m(r(81095)),c=m(r(83180)),u=m(r(93940)),d=r(75709),h=m(r(61754)),p=["className","label","selected","overrides"];function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(f=function(e){return e?r:t})(e)}function m(e){return e&&e.__esModule?e:{default:e}}function g(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function v(e){for(var t=1;t=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,p),f=(0,o.useContext)(a.TabsContext),m=E((0,u.default)(h,_));return o.default.createElement("button",y({ref:t,className:(0,i.default)(m.variables,m.root,b(b(b(b({},m.expand,f),m.contentSize,!f),m.indicator,!f&&l),m.selected,l),r,d.root)},h),o.default.createElement("label",{className:(0,i.default)(m.label,b({},m.selected,l),d.label)},n))})),E=(0,l.default)((function(e){return{variables:S.styles,root:v(v({outline:0,background:"transparent",height:6*e.spacing.base,position:"relative",fontFamily:e.typography.fontFamily},(0,s.setTextCssVars)({fontWeight:e.typography.fontWeight,fontSize:e.typography.fontSize+2,color:e.colors.baseContrast090,lineHeight:1})),{},{textTransform:"capitalize",cursor:"pointer",border:"none","&:hover":{background:e.colors.baseContrast015}}),label:{pointerEvents:"none","& :first-child":{display:"inline-flex",alignItems:"center"},"& svg":{marginInlineEnd:e.spacing.base/2}},expand:{width:"100%",padding:[e.spacing.base,0]},contentSize:{width:"unset",padding:[e.spacing.base,2*e.spacing.base]},indicator:{borderBottom:"solid 2px ".concat(e.colors.primary),padding:[e.spacing.base,2*e.spacing.base,e.spacing.base-2,2*e.spacing.base]},selected:{}}}),{name:"Tab"});w.displayName="Tab",t.Storybook=w;var C=(0,c.default)(w);C.displayName="Tab",t.default=C},73017:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0});var i={};t.default=void 0;var o=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=n(e)&&"function"!=typeof e)return{default:e};var r=a(t);if(r&&r.has(e))return r.get(e);var i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&{}.hasOwnProperty.call(e,s)){var l=o?Object.getOwnPropertyDescriptor(e,s):null;l&&(l.get||l.set)?Object.defineProperty(i,s,l):i[s]=e[s]}return i.default=e,r&&r.set(e,i),i}(r(75170));function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(a=function(e){return e?r:t})(e)}Object.keys(o).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(i,e)||e in t&&t[e]===o[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}}))})),t.default=o.default},80521:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.TabsContext=t.Storybook=void 0;var i=m(r(46942)),o=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=n(e)&&"function"!=typeof e)return{default:e};var r=f(t);if(r&&r.has(e))return r.get(e);var i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(i,a,s):i[a]=e[a]}return i.default=e,r&&r.set(e,i),i}(r(62249)),a=r(82239),s=m(r(81095)),l=r(46503),c=m(r(83180)),u=m(r(93940)),d=r(75709),h=m(r(61754)),p=["className","children","expand","onChange","overrides","value"];function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(f=function(e){return e?r:t})(e)}function m(e){return e&&e.__esModule?e:{default:e}}function g(){return g=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,p),_=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,c=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(e,t)||b(e,t)||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.")}()}((0,o.useState)(null!=f?f:0),2),S=_[0],E=_[1],O=function(e,t){var r=(0,a.useTheme)();return{tabsExpandTransform:"translate(".concat(r.direction===l.Direction.rtl?"-":"").concat(100/e*(t*e),"%, 0)"),tabsExpandWidth:"".concat(100/e,"%")}}(r.length,S),T=O.tabsExpandTransform,k=O.tabsExpandWidth;(0,o.useEffect)((function(){void 0!==f&&E(f)}),[f]);var R=P(function(e){for(var t=1;tA.current.childNodes.length-2||c&&c(t)}},className:(0,i.default)(R.variables,R.root,h.root,t)},m),r,o.default.createElement("span",{className:(0,i.default)(y({},R.indicator,s),h.indicator)})))},P=(0,s.default)((function(e){return{variables:E.styles,root:{display:"flex",minHeight:6*e.spacing.base,height:"auto",position:"relative",background:"none",fontFamily:e.typography.fontFamily,borderBottom:[1,"solid",e.colors.baseContrast020]},indicator:{position:"absolute",bottom:0,marginInlineStart:0,zIndex:1,height:2,background:e.colors.primary,transition:"350ms all",width:E.get("tabsExpandWidth"),transform:E.get("tabsExpandTransform")}}}),{name:"Tabs"});O.displayName="Tabs",t.Storybook=O;var T=(0,c.default)(O);T.displayName="Tabs",t.default=T},865:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0});var i={Tab:!0,ITabProps:!0,TabCommon:!0,TabStorybook:!0,TabStyles:!0};Object.defineProperty(t,"ITabProps",{enumerable:!0,get:function(){return o.ITabProps}}),Object.defineProperty(t,"Tab",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"TabCommon",{enumerable:!0,get:function(){return o.Common}}),Object.defineProperty(t,"TabStorybook",{enumerable:!0,get:function(){return o.Storybook}}),Object.defineProperty(t,"TabStyles",{enumerable:!0,get:function(){return o.TabStyles}}),t.default=void 0;var o=l(r(73017)),a=l(r(80521));function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(s=function(e){return e?r:t})(e)}function l(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=n(e)&&"function"!=typeof e)return{default:e};var r=s(t);if(r&&r.has(e))return r.get(e);var i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var l=o?Object.getOwnPropertyDescriptor(e,a):null;l&&(l.get||l.set)?Object.defineProperty(i,a,l):i[a]=e[a]}return i.default=e,r&&r.set(e,i),i}Object.keys(a).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(i,e)||e in t&&t[e]===a[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return a[e]}}))})),t.default=a.default},88345:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.vars=t.getMainColor=t.common=void 0;var n=r(27321),i=s(r(50018)),o=r(75709),a=s(r(61754));function s(e){return e&&e.__esModule?e:{default:e}}var l=t.common=o.defaultCommonProps;t.vars=(0,a.default)({applied:l,variables:[{key:"fontColor",canHaveColor:!0},{key:"mainColor",canHaveColor:!0},{key:"fontColor60",canHaveColor:!0},{key:"fontColor90",canHaveColor:!0},{key:"mainColor30",canHaveColor:!0},{key:"mainColor50",canHaveColor:!0},{key:"mainColor60",canHaveColor:!0},{key:"mainColor80",canHaveColor:!0},{key:"defaultBorder",canHaveColor:!0},{key:"textTransform"}]}),t.getMainColor=function(e,t,r,o){if(void 0!==t)return r?(0,i.default)(o.colors[r],t):(0,i.default)(o.colors.baseContrast040,t);var a=e?o.colors.baseContrast070:o.colors.baseContrast040;return new n.TinyColor(r?o.colors[r]||r:a).toHexString()}},48367:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.vars=t.default=t.Storybook=void 0;var i=_(r(46942)),o=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=n(e)&&"function"!=typeof e)return{default:e};var r=b(t);if(r&&r.has(e))return r.get(e);var i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(i,a,s):i[a]=e[a]}return i.default=e,r&&r.set(e,i),i}(r(62249)),a=r(82239),s=r(65103),l=r(87121),c=_(r(16744)),u=r(20801),d=_(r(81095)),h=r(46503),p=_(r(83180)),f=_(r(93940)),m=r(75709),g=_(r(61754)),v=_(r(64621)),y=["id","name","disabled","className","errorText","labelText","labelFontSize","labelTextTransform","overrides","textarea","isValid","onBlur","onChange","onKeyDown","wrapperInput","leftIcon","rightIcon","transparent","hint","description","size","wrapperProps","prefix","suffix","rows","type","autoFocus","max","min"];function b(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(b=function(e){return e?r:t})(e)}function _(e){return e&&e.__esModule?e:{default:e}}function S(){return S=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,y),re=O((0,s.useElementSize)(),2),ne=re[0],ie=re[1].width,oe=(0,a.useTheme)(),ae=I(A.useVars(E({labelFontSize:b,labelTextTransform:_,iconFillOnHover:B?oe.colors.baseContrast100:oe.colors.textOnLight,transparentFilter:oe.mode===h.ThemeMode.light?"invert(0)":"invert(1)",inputDisabledOpacity:oe.mode===h.ThemeMode.dark?.5:1,inputDisabledAndPlaceholderColor:oe.mode===h.ThemeMode.light?oe.colors.baseContrast040:oe.colors.baseContrast060,leftIconInputTweak:ie+oe.spacing.base,leftIconMarginTweak:-ie},(0,f.default)(te,R)))),se=O((0,o.useState)(!1),2),le=se[0],ce=se[1],ue=O((0,o.useState)(Boolean(te.value)),2),de=ue[0],he=ue[1],pe=T?"textarea":"input",fe="password"===Y,me=fe?le?"text":"password":Y;(0,v.default)(u,"Always add the name prop to input components!");var ge=!0===D&&de,ve=(!1===D||null===D&&Boolean(m))&&de,ye=(null!==D||Boolean(m))&&de,be=N&&!T,_e=F&&!ge&&!ve&&!T&&!fe,Se=E(E(E({type:T?void 0:me,rows:T?q:void 0,ref:t,id:null!=n?n:u,name:u,disabled:d,autoFocus:Q,className:(0,i.default)(ae.input,(r={},C(C(C(C(C(C(C(C(C(C(r,ae.inputWithValue,ye),ae.inputWithValuePassword,fe),ae.inputWithValidValue,!T&&ge),ae.textareaWithValidValue,T&&ge),ae.inputWithInvalidValue,!T&&ve),ae.textareaWithInvalidValue,T&&ve),ae.inputWithLeftIcon,be),ae.inputWithRightIcon,_e),ae.transparent,B),ae[G],!T),C(C(C(C(C(C(C(r,ae.textarea,T),ae.prefixPresent,z),ae.suffixPresent,K),ae.inputHasPrefix,z&&(ge||ve)),ae.inputHasSuffix,K&&(ge||ve)),ae.inputPrefixSuffixValid,!T&&ge),ae.inputPrefixSuffixInvalid,!T&&ve)),null==P?void 0:P.input,p)},(0,l.getRestrictedDate)(Y,X,ee)),te),{},{onBlur:function(e){he(!0),x&&x(e)},onChange:function(e){he(!1),M&&M(e)},onKeyDown:function(e){"input"===pe&&"Enter"===e.key&&he(!0),L&&L(e)}}),we=function(){if(!ve||!m)return null;var e=(0,i.default)(ae.errorText,P.errorText);return"string"==typeof m?o.default.createElement("p",{className:e},m):o.default.createElement("div",{className:e},m)};return we.displayName="ErrorElement",o.default.createElement("span",S({},W,{className:(0,i.default)(ae.variables,ae.root,null==P?void 0:P.root,null==W?void 0:W.className)}),g&&o.default.createElement("label",{className:(0,i.default)(ae.label,null==P?void 0:P.label),htmlFor:Se.id},o.default.createElement("span",null,g),U&&o.default.createElement("span",{className:(0,i.default)(ae.hint)}," (",U,")"),V&&o.default.createElement("div",{className:(0,i.default)(ae.description)},V)),o.default.createElement("div",{className:ae.container},z&&o.default.createElement("span",{className:(0,i.default)(ae.prefix,C({},ae.prefixValid,ge),C({},ae.prefixInvalid,ve),ae[G])},z),be&&o.default.createElement("span",{ref:ne,className:(0,i.default)(ae.leftIcon,C({},ae.disabledIcon,d))},N),j?(0,o.cloneElement)(j,E({},Se)):o.default.createElement(pe,Se),!T&&o.default.createElement("span",{className:(0,i.default)(ae.border,null==P?void 0:P.border)}),_e&&o.default.createElement("span",{className:(0,i.default)(ae.rightIcon,C({},ae.disabledIcon,d))},F),K&&o.default.createElement("span",{className:(0,i.default)(ae.suffix,C({},ae.suffixDefined,ge||ve),ae[G])},K),fe&&o.default.createElement("span",{className:(0,i.default)(ae.rightIcon,C({},ae.disabledIcon,d))},o.default.createElement(c.default,{name:le?"visibilityOff":"visibility",onClick:function(){return ce((function(e){return!e}))}}))),o.default.createElement(we,null))})),I=(0,d.default)((function(e){return{variables:A.styles,root:{display:"inline-flex",flexFlow:"column",width:"100%",fontFamily:e.typography.fontFamily},input:{boxSizing:"border-box",background:e.colors.textOnDark,padding:e.spacing.base,fontSize:e.typography.fontSize,WebkitAppearance:"none",outline:0,color:e.colors.textOnLight,borderStyle:"solid",borderRadius:2,fontWeight:e.typography.fontWeight,fontFamily:"inherit",position:"relative",transition:"300ms ease-in border-color",borderWidth:1,borderColor:e.colors.baseContrast060,width:"100%",height:"100%","&:disabled":{background:e.colors.baseContrast020,borderColor:e.colors.baseContrast030,color:A.get("inputDisabledAndPlaceholderColor"),opacity:A.get("inputDisabledOpacity")},"&:disabled ~ span":{borderColor:e.colors.baseContrast030,opacity:A.get("inputDisabledOpacity")},"&::placeholder":{color:A.get("inputDisabledAndPlaceholderColor")},"&:focus-visible":{boxShadow:"inset 0 0 2px 1px ".concat(e.colors.baseInvariant)}},transparent:{background:"transparent",borderColor:e.colors.baseContrast030,color:e.colors.baseContrast070,"&::-webkit-calendar-picker-indicator":{filter:A.get("transparentFilter")}},prefixPresent:{borderStartStartRadius:0,borderEndStartRadius:0},suffixPresent:{borderStartEndRadius:0,borderEndEndRadius:0},preAndSuffix:{backgroundColor:e.mode===h.ThemeMode.dark?e.colors.baseContrast085:e.colors.baseContrast015,color:e.colors.textOnLight,border:"1px solid ".concat(e.colors.baseContrast060),display:"flex",justifyContent:"center",alignItems:"center",padding:"0 ".concat(1.5*e.spacing.base,"px")},prefix:{composes:"$preAndSuffix",borderEndStartRadius:"2px",borderStartStartRadius:"2px",borderInlineEnd:"none"},suffix:{composes:"$preAndSuffix",borderEndEndRadius:"2px",borderStartEndRadius:"2px",borderInlineStart:"none"},prefixSuffixValidity:{borderWidth:2},prefixValid:{composes:"$prefixSuffixValidity",borderColor:e.colors.success},prefixInvalid:{composes:"$prefixSuffixValidity",borderColor:e.colors.alert},suffixDefined:{composes:"$prefixSuffixValidity"},border:{boxSizing:"border-box",position:"absolute",top:0,left:0,borderColor:e.colors.baseContrast060,borderWidth:2,borderStyle:"solid",borderRadius:2,width:"100%",height:"100%",pointerEvents:"none",transform:"scaleX(0)",borderLeftWidth:0,borderRightWidth:0,transition:"500ms linear transform",transformOrigin:"center"},inputWithValue:{padding:[e.spacing.base,e.spacing.base-1],borderWidth:2,"& ~ span":{transform:"scaleX(1)"},"&:focus-visible ~ svg":{display:"inline-block"}},inputWithValuePassword:{paddingInlineEnd:5*e.spacing.base},inputWithValidValue:{borderLeftColor:e.colors.success,borderRightColor:e.colors.success,"& ~ span":{borderColor:e.colors.success},"&:focus-visible":{boxShadow:"none"}},textareaWithValidValue:{borderColor:e.colors.success,"&:focus-visible":{boxShadow:"none"}},inputWithInvalidValue:{borderLeftColor:e.colors.alert,borderRightColor:e.colors.alert,"& ~ span":{borderColor:e.colors.alert},"&:focus-visible":{boxShadow:"none"}},textareaWithInvalidValue:{borderColor:e.colors.alert,"&:focus-visible":{boxShadow:"none"}},inputWithLeftIcon:{paddingInlineStart:A.get("leftIconInputTweak")},inputWithRightIcon:{paddingInlineEnd:5*e.spacing.base},label:{fontFamily:"inherit",fontSize:A.get("labelFontSize",e.typography.fontSize-1),textTransform:A.get("labelTextTransform","none"),fontWeight:e.typography.fontWeight,color:e.colors.baseContrast060,paddingBottom:e.spacing.base/2,lineHeight:1.4},errorText:E({fontFamily:"inherit",marginTop:e.spacing.base/2,marginBottom:0},(0,u.setTextCssVars)({color:e.colors.alert,fontSize:e.typography.fontSize-1,fontWeight:600})),container:{alignItems:"center",display:"flex",position:"relative","& > svg":{animation:"$StateIconFadeIn 700ms linear",cursor:"text",marginInlineStart:-4*e.spacing.base,zIndex:1}},icon:{zIndex:2,"& :first-child":{maxHeight:4.5*e.spacing.base}},leftIcon:{extend:"icon",marginInlineEnd:A.get("leftIconMarginTweak"),"& > *":{marginInlineStart:"".concat(e.spacing.base,"px !important")}},rightIcon:{extend:"icon",marginInlineStart:-5*e.spacing.base,"& svg":{fill:e.colors.baseContrast050},"& [type='button'] svg":{fill:e.colors.primary},"& [type='button']:hover svg":{fill:e.colors.primaryDark},"&:hover svg":{fill:A.get("iconFillOnHover")}},disabledIcon:{pointerEvents:"none",cursor:"default",borderColor:e.colors.baseContrast030,"& svg, & [type='button'] svg":{fill:e.colors.baseContrast030}},"@keyframes StateIconFadeIn":{"0%":{opacity:0},"100%":{opacity:100}},hint:{fontSize:e.typography.fontSize-2,fontWeight:e.typography.fontWeight,color:e.colors.baseContrast050},description:{fontSize:e.typography.fontSize-2,fontWeight:e.typography.fontWeight,color:e.colors.baseContrast050},small:{height:36},medium:{height:40},large:{height:48},textarea:{height:"auto"},inputHasPrefix:{borderInlineStartColor:e.colors.baseContrast060,borderInlineStartWidth:1},inputHasSuffix:{borderInlineEndColor:e.colors.baseContrast060,borderInlineEndWidth:1},inputPrefixSuffixValid:{},inputPrefixSuffixInvalid:{}}}),{name:"TextInput"});D.displayName="TextInput",t.Storybook=D;var x=(0,p.default)(D);x.displayName="TextInput",t.default=x},87121:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getRestrictedDate=t.MIN_DATE=t.MAX_DATE=void 0;var r=t.MAX_DATE="9999-12-31",n=t.MIN_DATE="1900-01-01";t.getRestrictedDate=function(e,t,i){return"date"!==e?{max:t,min:i}:{max:t||r,min:i||n}}},75634:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0});var i={};t.default=void 0;var o=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=n(e)&&"function"!=typeof e)return{default:e};var r=a(t);if(r&&r.has(e))return r.get(e);var i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&{}.hasOwnProperty.call(e,s)){var l=o?Object.getOwnPropertyDescriptor(e,s):null;l&&(l.get||l.set)?Object.defineProperty(i,s,l):i[s]=e[s]}return i.default=e,r&&r.set(e,i),i}(r(48367));function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(a=function(e){return e?r:t})(e)}Object.keys(o).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(i,e)||e in t&&t[e]===o[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}}))})),t.default=o.default},5488:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"IThemeProviderProps",{enumerable:!0,get:function(){return i.IThemeProviderProps}}),t.default=void 0;var i=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=n(e)&&"function"!=typeof e)return{default:e};var r=o(t);if(r&&r.has(e))return r.get(e);var i={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&{}.hasOwnProperty.call(e,s)){var l=a?Object.getOwnPropertyDescriptor(e,s):null;l&&(l.get||l.set)?Object.defineProperty(i,s,l):i[s]=e[s]}return i.default=e,r&&r.set(e,i),i}(r(10211));function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(o=function(e){return e?r:t})(e)}var a=i.default;t.default=a},50201:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i,o=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=n(e)&&"function"!=typeof e)return{default:e};var r=d(t);if(r&&r.has(e))return r.get(e);var i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(i,a,s):i[a]=e[a]}return i.default=e,r&&r.set(e,i),i}(r(62249)),a=r(82239),s=(i=r(3069))&&i.__esModule?i:{default:i},l=r(46503),c=r(53120),u=["children","themes","themeMode","primaryColor","customTheme","direction","language","withGlobalStyles","nested"];function d(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(d=function(e){return e?r:t})(e)}function h(){return h=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,u),w=(0,o.useMemo)((function(){return(0,c.createTheme)(r,n,i,d,m,v)}),[r,n,i,m,v]),E=Object.entries(S).filter((function(e){return(t=e,r=1,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,c=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(t,r)||function(e,t){if(e){if("string"==typeof e)return p(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?p(e,t):void 0}}(t,r)||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.")}())[0].startsWith("data-");var t,r}));return o.default.createElement(a.ThemeProvider,{theme:w},o.default.createElement(s.default,h({withGlobalStyles:b,nested:_},Object.fromEntries(E)),t))};f.displayName="ThemeProviderBase",t.default=f},10501:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.vars=t.default=t.Storybook=void 0;var i=v(r(46942)),o=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=n(e)&&"function"!=typeof e)return{default:e};var r=g(t);if(r&&r.has(e))return r.get(e);var i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(i,a,s):i[a]=e[a]}return i.default=e,r&&r.set(e,i),i}(r(62249)),a=r(82239),s=v(r(81095)),l=r(91917),c=v(r(83180)),u=v(r(60828)),d=v(r(93940)),h=r(75709),p=v(r(61754)),f=v(r(64621)),m=["id","className","wrapperProps","disabled","disabledLabel","label","offLabel","onLabel","onToggle","overrides","toggled","defaultToggled","name","value","hint","description"];function g(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(g=function(e){return e?r:t})(e)}function v(e){return e&&e.__esModule?e:{default:e}}function y(){return y=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,m),B=(0,a.useTheme)(),U=P(C.useVars(w({rootAlign:N?"flex-start":"center",checkboxColor:e.onColor||B.colors.primary,rootBackground:(0,l.getHoverColor)(e.onColor||B.colors.primary).toHexString()},(0,d.default)(F,E)))),V=(r=(0,o.useState)(null!=D?D:x),n=2,function(e){if(Array.isArray(e))return e}(r)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,c=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(r,n)||b(r,n)||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.")}()),H=V[0],G=V[1];(0,f.default)(M,"Always add the name prop to input components!"),(0,o.useEffect)((function(){void 0!==D&&G(D)}),[D]);var W=(0,i.default)(U.variables,U.root,null==h?void 0:h.className),z=(0,i.default)(U.checkbox,A.root,c),K=(0,i.default)(U.label,A.label),$=(0,u.default)(["onColor"].concat(function(e){return function(e){if(Array.isArray(e))return _(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||b(e)||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)),F),q=w({id:null!=s?s:M,name:M,type:"checkbox",ref:t,className:z,disabled:g,onChange:function(e){g||(void 0===D&&G(e.target.checked),k&&k(e.target.checked,e))},checked:H},void 0!==L?{value:L}:{}),Z=v&&g?v:T&&O?H?T:O:S;return o.default.createElement("div",y({},$,h,{className:W}),o.default.createElement("input",q),o.default.createElement("span",{className:U.button}),Z&&o.default.createElement("label",{className:K,htmlFor:q.id},o.default.createElement("span",null,Z),j&&o.default.createElement("span",{className:(0,i.default)(U.hint)}," (",j,")"),N&&o.default.createElement("div",{className:(0,i.default)(U.description)},N)))})),P=(0,s.default)((function(e){return{variables:C.styles,root:{display:"inline-flex",alignItems:C.get("rootAlign"),verticalAlign:"middle",position:"relative",fontFamily:e.typography.fontFamily,fontWeight:e.typography.fontWeight,fontSize:e.typography.fontSize,color:e.colors.baseContrast070},checkbox:{opacity:0,width:"100%",height:"100%",position:"absolute",margin:0,zIndex:1,cursor:"pointer","&:checked ~ $button:after":{insetInlineStart:15},"&:checked:not(:disabled)":{"& ~ $button":{"&::after":{backgroundColor:C.get("checkboxColor")}}},"&:disabled":{cursor:"not-allowed","& ~ $button":{cursor:"not-allowed",backgroundColor:e.colors.baseContrast030,"&:after":{backgroundColor:e.colors.baseContrast040}},"& ~ $label":{fontFamily:"inherit",color:e.colors.baseContrast040}}},button:{transition:"all 0.3s ease",backgroundColor:e.colors.baseContrast030,borderRadius:20,position:"relative",width:34,minWidth:34,height:14,"&:after":{backgroundColor:e.colors.baseContrast070,boxShadow:"0 1px 1px 0 rgba(0, 0, 0, 0.24), 0 0 1px 0 rgba(0, 0, 0, 0.12)",position:"relative",display:"block",width:20,height:20,left:0,top:-3,content:'""',borderRadius:"50%",transition:"all 0.2s ease"}},label:{color:e.colors.baseContrast090,userSelect:"none",margin:"auto",marginInlineStart:e.spacing.base},hint:{fontSize:e.typography.fontSize-2,fontWeight:e.typography.fontWeight,color:e.colors.baseContrast050},description:{fontSize:e.typography.fontSize-2,fontWeight:e.typography.fontWeight,color:e.colors.baseContrast050}}}),{name:"Toggle"});O.displayName="Toggle",t.Storybook=O;var T=(0,c.default)(O);T.displayName="Toggle",t.default=T},49305:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0});var i={};t.default=void 0;var o=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=n(e)&&"function"!=typeof e)return{default:e};var r=a(t);if(r&&r.has(e))return r.get(e);var i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&{}.hasOwnProperty.call(e,s)){var l=o?Object.getOwnPropertyDescriptor(e,s):null;l&&(l.get||l.set)?Object.defineProperty(i,s,l):i[s]=e[s]}return i.default=e,r&&r.set(e,i),i}(r(10501));function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(a=function(e){return e?r:t})(e)}Object.keys(o).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(i,e)||e in t&&t[e]===o[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}}))})),t.default=o.default},10571:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.TooltipPlacement=t.Storybook=void 0;var i=m(r(46942)),o=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=n(e)&&"function"!=typeof e)return{default:e};var r=f(t);if(r&&r.has(e))return r.get(e);var i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(i,a,s):i[a]=e[a]}return i.default=e,r&&r.set(e,i),i}(r(62249)),a=r(82239),s=r(59897),l=m(r(22613)),c=m(r(81095)),u=m(r(83180)),d=r(97432),h=m(r(8930)),p=r(84877);function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(f=function(e){return e?r:t})(e)}function m(e){return e&&e.__esModule?e:{default:e}}function g(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function v(e,t,r){var i;return i=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,"string");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==n(i)?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,c=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return b(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?b(e,t):void 0}}(e,t)||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.")}()}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);rr?r-5:t},W=(0,o.cloneElement)(t,{onMouseEnter:function(e){var t;if((null===(t=e.currentTarget.querySelector("input"))||void 0===t||!t.disabled)&&D){var r=function(e){if(!B||!B.current)return T;var t=B.current.getBoundingClientRect(),r=S(_)?window.scrollY:0,n=S(_)?window.scrollX:0,i=e.top+e.height/2-t.height/2+r,o=e.left+e.width/2-t.width/2+n,a=e.bottom+m+r,s=e.top+r-(t.height+m),l=e.right+m,c=e.left-t.width-m,u=function(e,t){if(!d.isBrowser)return{y:0,x:0};var r=window,n=r.scrollY,i=r.scrollX,o=document.documentElement.clientWidth,a=o+i-t.width,s=document.documentElement.clientHeight+n-t.height;return t.width>=o?{y:G(n,e.y,s),x:i}:{y:G(n,e.y,s),x:G(i,e.x,a)}}({x:"left"===O?c:"right"===O?l:o,y:"top"===O?s:"bottom"===O?a:i},t);return{top:"".concat(u.y,"px"),left:"".concat(u.x,"px")}}(e.currentTarget.getBoundingClientRect());M(r),A(!0)}},onMouseLeave:H,onBlur:H}),z=function(e){for(var t=1;t{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0});var i={};t.default=void 0;var o=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=n(e)&&"function"!=typeof e)return{default:e};var r=a(t);if(r&&r.has(e))return r.get(e);var i={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&{}.hasOwnProperty.call(e,s)){var l=o?Object.getOwnPropertyDescriptor(e,s):null;l&&(l.get||l.set)?Object.defineProperty(i,s,l):i[s]=e[s]}return i.default=e,r&&r.set(e,i),i}(r(10571));function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(a=function(e){return e?r:t})(e)}Object.keys(o).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(i,e)||e in t&&t[e]===o[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}}))})),t.default=o.default},10211:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"IThemeProviderProps",{enumerable:!0,get:function(){return o.IThemeProviderProps}}),t.default=void 0;var n=s(r(62249)),i=s(r(29532)),o=r(46503),a=["children","themeMode","direction"];function s(e){return e&&e.__esModule?e:{default:e}}function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,a);return n.default.createElement(i.default,l({platformId:o.PlatformId.streamate,themeMode:s,direction:u},d),t)};c.displayName="WhitelabelThemeProvider",t.default=c},59897:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Z_INDEX=void 0,t.Z_INDEX={ModalOverlay:1500,ModalBox:1501,ModalRoot:1502,ModalCloseButton:1505,Snackbar:1499,Popover:1501,Select:1503,MediaActionsOverlay:1504,MediaActions:1505,Tooltip:1505}},95586:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LabelSide=void 0,t.LabelSide=function(e){return e.LEFT="left",e.RIGHT="right",e}({})},48389:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=r(20801),o=(n=r(50645))&&n.__esModule?n:{default:n};function a(e){return a="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},a(e)}function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{wrapper:{borderRadius:28,background:e.colors.baseContrast015,borderWidth:0,textTransform:"capitalize",padding:3,"&:hover":{color:e.colors.baseContrast100}},label:{color:e.colors.baseContrast070,fontSize:e.typography.fontSize,fontWeight:600,textTransform:"capitalize",marginBottom:2}}}}},95997:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(7393),i={styles:function(e){var t=(0,n.getContrastingTextColorHexString)(e.colors.primary,void 0,e.colors.themeBase,n.PRIMARY_CONTRAST_STANDARD);return{input:{"&:checked + span":{background:e.colors.primary,color:t,"& svg":{fill:t}}},button:{alignItems:"center",justifyContent:"center",minWidth:12*e.spacing.base,borderRadius:28,borderInlineWidth:0,color:e.colors.baseContrast060,"& svg":{fill:e.colors.baseContrast050},"&:hover":{background:"transparent",color:e.colors.baseContrast100}}}}};t.default=i},4225:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{root:{padding:0},contentContainer:{padding:[4,2*e.spacing.base]},titleContainer:{padding:[1.5*e.spacing.base,2*e.spacing.base],justifyContent:"space-between",fontSize:e.typography.fontSize+2,"&:hover":{color:e.colors.baseContrast090,background:e.colors.baseContrast015,borderRadius:4,transition:"300ms ease-in color","& svg":{fill:e.colors.baseContrast080,transition:"300ms ease-in color"}}},icon:{"& svg":{fill:e.colors.baseContrast070}}}}}},18578:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(98756),i={styles:function(e){return{root:{"&:hover":{"& svg":{borderColor:e.colors.primary}}},label:{fontSize:e.typography.fontSize+2},labelText:{color:e.colors.baseContrast080,fontSize:e.typography.fontSize},svg:{borderRadius:2,borderColor:n.vars.get("checkboxPrimary",e.colors.baseContrast040),strokeWidth:3,padding:2},input:{borderColor:n.vars.get("checkboxPrimary",e.colors.baseContrast040)}}}};t.default=i},69117:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(20801);function i(e){return i="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},i(e)}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{title:{color:e.colors.baseContrast070,alignItems:"flex-start"},content:{fontSize:e.typography.fontSize}}}}},56632:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=r(20801),o=(n=r(50645))&&n.__esModule?n:{default:n};function a(e){return a="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},a(e)}function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t svg":{width:18,height:18,minHeight:18,minWidth:18}},medium:{"& > svg":{width:18,height:18,minHeight:18,minWidth:18}},large:{"& > svg":{width:18,height:18,minHeight:18,minWidth:18}},label:{margin:0},primary:l({},(0,o.default)({hover:{background:"".concat(e.colors.primary,"1a")}})),ghost:l(l({},(0,i.setTextCssVars)({fontSize:e.typography.fontSize+1})),{},{borderWidth:1,borderColor:e.colors.primary,border:"1px solid ".concat(e.colors.primary),background:e.colors.themeBase},(0,o.default)({hover:{background:"".concat(e.colors.primary,"1a"),border:"2px solid ".concat(e.colors.primary),borderWidth:1}})),long:l({},(0,i.setTextCssVars)({fontSize:e.typography.fontSize})),veryLong:{padding:[0,1.5*e.spacing.base]}}}};t.default=u},75437:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{column:{"& [type='submit']":{marginTop:e.spacing.base}},row:{"& [type='submit']":{marginTop:3.5*e.spacing.base+1}}}}}},34583:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(88013),i=r(20801);function o(e){return o="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},o(e)}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=r(91917),o=(n=r(8930))&&n.__esModule?n:{default:n},a={styles:function(e){return{defaultModalBoxStyles:{borderRadius:4,borderImageSlice:0,backgroundColor:e.colors.themeBase,boxShadow:"0 ".concat(2*e.spacing.base,"px ").concat(3*e.spacing.base,"px 0 ").concat((0,o.default)(e.colors.baseShadow,.14),", 0 0 ").concat(3*e.spacing.base,"px 0 ").concat((0,o.default)(e.colors.baseShadow,.14))},defaultModalOverlayStyles:{backgroundColor:(0,o.default)(e.colors.themeBase,.8)},defaultCloseButtonStyles:{color:e.colors.primary,backgroundColor:e.colors.themeBase,"& svg":{fill:e.colors.primary,"&:hover":{fill:(0,i.getHoverColor)(e.colors.primary,130,15).toHexString()}}}}}};t.default=a},96428:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=(n=r(50645))&&n.__esModule?n:{default:n};function o(e){return o="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},o(e)}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=r(91917),o=(n=r(8930))&&n.__esModule?n:{default:n},a={styles:function(e){return{pageIndicator:{color:e.colors.baseContrast060},activePageIndicator:{color:(0,o.default)(e.colors.textOnDark,.9)},pageChanger:{backgroundColor:"transparent","&:hover":{backgroundColor:e.colors.baseContrast020,"& $pageChangerIcon":{fill:(0,i.getHoverColor)(e.colors.primary).toHexString()}}}}}};t.default=a},61291:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:{root:{borderRadius:8}}}},68348:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:{root:{maxWidth:600}}}},51719:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=r(65789),o=r(20801),a=(n=r(50645))&&n.__esModule?n:{default:n};function s(e){return s="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},s(e)}function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=r(27321),o=(n=r(8930))&&n.__esModule?n:{default:n},a=function(e){var t=e.props,r=e.theme,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return new i.TinyColor(t.errorText?r.colors.alert:r.colors.primary).darken(n).toHexString()},s=function(e){var t=e.state,r=e.props,n=e.theme,i=e.mainColor,o=void 0===i?n.colors.baseContrast040:i;return r.errorText?n.colors.alert:"flat"===r.button?"transparent":t.isFocused?n.colors.primary:o},l=function(e){var t=e.state,r=e.theme;return t.isFocused?(0,o.default)(r.colors.primary,.1):"unset"},c=function(e){var t=e.props,r=e.state,n=e.theme;return t.errorText&&r.isFocused?(0,o.default)(n.colors.alert,.1):l({state:r,theme:n})},u=function(e){var t=e.state,r=e.theme;return t.isSelected?r.colors.primary:l({state:t,theme:r})},d=function(e){var t=e.state,r=e.theme;return t.isDisabled?r.colors.baseContrast030:r.colors.baseContrast050},h=function(e){var t=e.props,r=e.state,n=e.theme;return r.isDisabled?n.colors.baseContrast030:null!==t.button?n.colors.baseContrast100:n.colors.baseContrast070},p={styles:function(e){return{labelText:{color:e.colors.baseContrast070,fontSize:e.typography.fontSize,fontWeight:600,textTransform:"capitalize",marginBottom:2}}},select:{control:function(e){var t=e.state,r=e.props,n=e.theme;return{borderColor:s({state:t,props:r,theme:n}),borderWidth:2,borderRadius:2,color:n.colors.baseContrast070,paddingInlineStart:1.5*n.spacing.base-1,background:c({props:r,state:t,theme:n}),"&:hover":{background:c({props:r,state:t,theme:n}),borderColor:s({state:t,props:r,theme:n,mainColor:n.colors.primary}),"& div > div[id*='placeholder']":{color:a({props:r,theme:n})}}}},placeholder:function(e){var t=e.state,r=e.theme;return{color:d({state:t,theme:r})}},singleValue:function(e){var t=e.state,r=e.props,n=e.theme;return{color:h({state:t,props:r,theme:n})}},dropdownIndicator:function(e){var t=e.state,r=e.theme;return{"& svg":{fill:t.isDisabled?r.colors.baseContrast030:r.colors.baseContrast070}}},menu:function(e){return{borderColor:e.theme.colors.primary,borderWidth:2}},multiValueRemove:function(e){var t=e.props,r=e.state,n=e.theme;return{color:n.colors.themeBase,background:r.isDisabled?n.colors.baseContrast030:a({props:t,theme:n}),borderRadius:0,borderStartEndRadius:2,borderEndEndRadius:2,"&:hover":{background:a({props:t,theme:n},10),color:n.colors.themeBase}}},multiValue:function(e){var t=e.props,r=e.state,n=e.theme;return{background:r.isDisabled?n.colors.baseContrast030:a({props:t,theme:n})}},multiValueLabel:function(e){return{color:e.theme.colors.themeBase,fontWeight:"bold"}},option:function(e){var t=e.state,r=e.theme;return{backgroundColor:u({state:t,theme:r})}},group:function(e){var t=e.theme;return{fontSize:t.typography.fontSize,color:t.colors.baseContrast060}},groupHeading:function(e){var t=e.theme;return{fontSize:t.typography.fontSize-3,color:t.colors.primary,fontWeight:"bold"}},clearIndicator:function(e){var t=e.props,r=e.theme;return{"& svg":{width:3*r.spacing.base,height:3*r.spacing.base,fill:a({props:t,theme:r}),"&:hover":{fill:a({props:t,theme:r},10)}}}}}};t.default=p},78379:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{content:{background:e.colors.baseContrast015}}}}},88380:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=(n=r(8930))&&n.__esModule?n:{default:n},o={styles:function(e){return{mainItem:{fontWeight:600,fontSize:e.typography.fontSize,"&:hover":{background:e.colors.baseContrast020,color:e.colors.baseContrast080}},activeMainItem:{paddingLeft:2*e.spacing.base,borderLeft:{width:e.spacing.base}},disabledMainItem:{color:e.colors.baseContrast050,background:"transparent","&:hover":{color:e.colors.baseContrast050}},indicator:{fill:e.colors.baseContrast080},subItem:{"&:hover":{color:e.colors.baseContrast080}},activeSubmenuItem:{"&, & a":{background:e.colors.primary,color:e.colors.textOnDark,"&:hover, &:focus-visible":{background:e.colors.primary,color:(0,i.default)(e.colors.textOnDark,.9)}}},disabledSubmenuItem:{color:e.colors.baseContrast050,"&:hover":{color:e.colors.baseContrast050}}}}};t.default=o},85256:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:{top:{borderRadius:[0,0,2,2]},bottom:{borderRadius:[2,2,0,0]}}}},66458:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(20801);function i(e){return i="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},i(e)}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(42695),i={defaultProps:{border:["outer"]},styles:function(e){return{table:{borderWidth:1,borderColor:e.colors.baseContrast020,"& td":{borderWidth:1,borderColor:e.colors.baseContrast020},"& tr":{background:e.colors.baseContrast010}},striped:{"& tr":{"&:nth-child(even)":{background:e.colors.themeBase,"&:hover":{background:e.colors.baseContrast015}}}},highlightOnHover:{"& tr":{"&:hover":{background:e.colors.baseContrast015}}},tbody:{color:e.colors.baseContrast070,"& td":{color:e.colors.baseContrast070,padding:n.vars.get("cellPadding",1.3*e.spacing.base)}}}}};t.default=i},89360:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(42695),i={styles:function(e){return{root:{background:e.colors.themeBase,fontSize:e.typography.fontSize+2,fontWeight:500,color:e.colors.baseContrast070,padding:n.vars.get("cellPadding",1.5*e.spacing.base),borderWidth:1,borderColor:e.colors.baseContrast020},sortIndicator:{margin:"1px 6px",borderWidth:3,borderBottomWidth:5,borderBottomColor:e.colors.baseContrast050},activeSortIndicator:{borderBottomColor:e.colors.baseContrast070}}}};t.default=i},17117:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(88345),i={defaultProps:{size:"small"},styles:function(e){return{root:{fontWeight:900,borderRadius:2,textTransform:"none",letterSpacing:"normal",padding:[Math.floor(e.spacing.base/4),e.spacing.base/2]},close:{"& svg":{backgroundColor:"unset",borderRadius:"unset",fill:function(e){return e.fontColor},"&:hover, &:focus-visible":{backgroundColor:"unset",fill:function(e){var t=e.fontColor;return"".concat(t,"60")}}}},compact:{fontWeight:"normal"},compactIcon:{paddingInlineEnd:0},transluecentCompact:{fontWeight:900},translucentClose:{"& svg":{backgroundColor:"unset",fill:n.vars.get("mainColor"),"&:hover, &:focus-visible":{backgroundColor:"unset",fill:n.vars.get("mainColor60")}}}}}};t.default=i},86100:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(20801);function i(e){return i="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},i(e)}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=(n=r(8930))&&n.__esModule?n:{default:n},o=r(75634),a={styles:function(e){return{input:{fontSize:e.typography.fontSize,padding:"".concat(e.spacing.base,"px ").concat(1.5*e.spacing.base,"px"),background:e.colors.themeBase,color:e.colors.baseContrast070,borderColor:e.colors.baseContrast040,borderWidth:2,borderRadius:2,"&::placeholder":{color:e.colors.baseContrast050},"&:hover":{borderColor:e.colors.primary,"&::placeholder":{color:e.colors.primary,transition:"300ms ease-in color"}},"&:focus-visible":{borderColor:e.colors.primary,color:e.colors.baseContrast070,background:(0,i.default)(e.colors.primary,.1),boxShadow:"none","&::placeholder":{visibility:"hidden"}},"&:disabled, &:disabled:hover":{background:e.colors.baseContrast015,borderColor:e.colors.baseContrast030,"&::placeholder":{color:e.colors.baseContrast040}},"&::-webkit-calendar-picker-indicator":{filter:o.vars.get("transparentFilter")}},preAndSuffix:{backgroundColor:e.colors.baseContrast020,color:e.colors.baseContrast070,borderColor:e.colors.baseContrast040,borderWidth:2},border:{borderWidth:2,borderRadius:2,borderColor:e.colors.baseContrast040},inputWithValue:{borderWidth:2,padding:"".concat(e.spacing.base,"px ").concat(1.5*e.spacing.base,"px"),color:e.colors.baseContrast070},inputWithValidValue:{"&:focus-visible":{borderColor:e.colors.success,color:e.colors.success,background:(0,i.default)(e.colors.success,.1)},"&:hover":{borderColor:e.colors.success,color:e.colors.success,"&::placeholder":{color:e.colors.success,transition:"300ms ease-in color"}}},inputWithInvalidValue:{"&:focus-visible":{borderColor:e.colors.alert,color:e.colors.alert,background:(0,i.default)(e.colors.alert,.1)},"&:hover":{borderColor:e.colors.alert,color:e.colors.alert,"&::placeholder":{color:e.colors.alert,transition:"300ms ease-in color"}}},label:{color:e.colors.baseContrast070,fontSize:o.vars.get("labelFontSize",e.typography.fontSize),fontWeight:600,textTransform:o.vars.get("labelTextTransform","capitalize"),marginBottom:2},icon:{"& > svg":{fill:e.colors.baseContrast070}},inputHasPrefix:{borderInlineStartColor:e.colors.baseContrast040,borderInlineStartWidth:2,"&:focus-visible":{borderInlineStartColor:e.colors.baseContrast040},"&:hover":{borderInlineStartColor:e.colors.baseContrast040}},inputHasSuffix:{borderInlineEndColor:e.colors.baseContrast040,borderInlineEndWidth:2,"&:focus-visible":{borderInlineEndColor:e.colors.baseContrast040},"&:hover":{borderInlineEndColor:e.colors.baseContrast040}}}}};t.default=a},3667:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(49305),i={styles:function(e){return{checkbox:{"&:checked ~ $button:after":{insetInlineStart:28},"&:checked:not(:disabled)":{"& ~ $button":{backgroundColor:n.vars.get("checkboxColor"),"&::after":{backgroundColor:e.colors.textOnDark,opacity:.9}}},"&:disabled:checked ~ $button":{backgroundColor:"color-mix(in srgb, ".concat(n.vars.get("checkboxColor"),", ").concat(e.colors.themeBase,")"),"&:after":{backgroundColor:"color-mix(in srgb, #fff 60%, ".concat(e.colors.themeBase,")"),opacity:.9}}},button:{borderRadius:16,minWidth:48,minHeight:24,"&:after":{backgroundColor:e.colors.themeBase,boxShadow:"none",width:16,height:16,left:4,right:4,top:4}},root:{"&:hover $checkbox":{"&:checked:not(:disabled) ~ $button":{backgroundColor:n.vars.get("rootBackground")},"&:not(:disabled) ~ $button":{backgroundColor:e.colors.baseContrast040}}}}}};t.default=i},62273:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.typography=t.spacing=t.sharedColors=t.isAlwaysNativeDropDownMenu=t.iconSizes=t.components=void 0;var n=D(r(48389)),i=D(r(54938)),o=D(r(95997)),a=D(r(4225)),s=D(r(18578)),l=D(r(69117)),c=D(r(70728)),u=D(r(56632)),d=D(r(75437)),h=D(r(34583)),p=D(r(91780)),f=D(r(96428)),m=D(r(67435)),g=D(r(61291)),v=D(r(68348)),y=D(r(51719)),b=D(r(48463)),_=D(r(78379)),S=D(r(88380)),w=D(r(85256)),E=D(r(66458)),C=D(r(90665)),O=D(r(89360)),P=D(r(17117)),T=D(r(86100)),k=D(r(40616)),R=D(r(3667)),A=r(61925);function D(e){return e&&e.__esModule?e:{default:e}}function I(e){return I="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},I(e)}function x(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}t.spacing={base:8},t.iconSizes={small:20,medium:24,large:32},t.sharedColors=function(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(46503),i=r(62273);function o(e){return o="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},o(e)}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=i(r(55328));function i(e){return e&&e.__esModule?e:{default:e}}var o={properties:{light:i(r(25582)).default,dark:n.default}};t.default=o},25582:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(46503),i=r(62273);function o(e){return o="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},o(e)}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{root:{borderRadius:2,border:"2px solid ".concat(e.colors.baseContrast050)},text:{textTransform:"uppercase",fontFamily:'Raleway, "Helvetica Neue", "Helvetica", "Arial", sans-serif'}}}}},59996:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(27321),i={styles:function(e){return{root:{textTransform:"uppercase",fontWeight:400,fontFamily:'Raleway, "Helvetica Neue", "Helvetica", "Arial", sans-serif',fontSize:18,letterSpacing:1.5,lineHeight:1},item:{"& a":{fontSize:24,letterSpacing:2,color:new n.TinyColor(e.colors.primary).darken(22).toHexString(),"&:hover, &:focus-visible":{color:new n.TinyColor(e.colors.primary).darken(22).toHexString()}}},separatorIcon:{fill:e.colors.baseContrast085}}}};t.default=i},92625:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{label:{color:e.colors.baseContrast085,fontSize:e.typography.fontSize,fontWeight:600,textTransform:"uppercase",marginBottom:2,marginInlineStart:2},wrapper:{borderRadius:7,textTransform:"capitalize",borderColor:e.colors.baseContrast040},hint:{marginInlineStart:e.spacing.base/2,textTransform:"initial",color:e.colors.baseContrast085},description:{textTransform:"initial",color:e.colors.baseContrast085}}}}},80262:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{input:{"&:checked + span":{background:e.colors.baseContrast015,"&:hover":{background:e.colors.baseContrast015}}},button:{color:e.colors.baseContrast085,fontWeight:400,borderInlineEnd:"solid 1px ".concat(e.colors.baseContrast040),"&:hover":{background:e.colors.baseContrast010}},small:{padding:[e.spacing.base,1.5*e.spacing.base]},medium:{padding:[1.5*e.spacing.base,2*e.spacing.base]},large:{padding:[2*e.spacing.base,3*e.spacing.base]}}}}},26528:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{root:{color:e.colors.baseContrast085,padding:0,"& > div:first-of-type":{padding:[1.5*e.spacing.base,2*e.spacing.base]}},titleContainer:{flexDirection:"row-reverse",justifyContent:"flex-end",padding:1.5*e.spacing.base,backgroundColor:e.colors.baseContrast010,"&:hover":{backgroundColor:e.colors.baseContrast015}},icon:{"& svg":{fill:e.colors.baseContrast085}},contentContainer:{padding:[2*e.spacing.base,5*e.spacing.base]}}}}},48387:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(98756),i={styles:function(e){return{labelText:{color:e.colors.baseContrast085},svg:{borderRadius:4,borderWidth:1,borderColor:n.vars.get("checkboxPrimary",e.colors.baseContrast060),strokeWidth:3,padding:3},hint:{marginInlineStart:e.spacing.base/2,textTransform:"initial",color:e.colors.baseContrast085},description:{textTransform:"initial",color:e.colors.baseContrast085}}}};t.default=i},91240:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={defaultProps:{selectedColor:"baseContrast010"},styles:function(e){return{root:{background:e.colors.pageBackground,borderColor:e.colors.baseContrast030,borderStyle:"solid",borderWidth:1,fontFamily:'Raleway, "Helvetica Neue", "Helvetica", "Arial", sans-serif',letterSpacing:.51},inputRelated:{"&:has(input:disabled)":{borderColor:e.colors.baseContrast040}}}}}},69914:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(7393),i={styles:function(e){return{small:{padding:2*e.spacing.base},medium:{padding:2*e.spacing.base},defaultDialogBoxStyles:{border:"none",borderRadius:12,backgroundColor:e.colors.pageBackground,padding:4*e.spacing.base},title:{textTransform:"uppercase",fontWeight:500,fontFamily:'Raleway, "Helvetica Neue", "Helvetica", "Arial", sans-serif',letterSpacing:.44},content:{fontSize:e.typography.fontSize,color:e.colors.baseContrast085},actions:{marginTop:2*e.spacing.base},button:{"& label":{color:e.colors.baseContrast085},"&:last-child > label":{color:(0,n.getContrastingTextColorHexString)(e.colors.primary,void 0,void 0,n.PRIMARY_CONTRAST_STANDARD)}},svgIcon:{width:20,height:20,minHeight:20,minWidth:20}}}};t.default=i},7687:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{contents:{background:e.colors.pageBackground},bottom:{borderRadius:[2*e.spacing.base,2*e.spacing.base,0,0],borderColor:e.colors.baseContrast020,borderStyle:"solid",borderWidth:1,boxShadow:"none"}}}}},39965:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=r(91917),o=(n=r(50645))&&n.__esModule?n:{default:n};function a(e){return a="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},a(e)}function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{fieldset:{"& > *":{marginBottom:2.5*e.spacing.base}},column:{gap:2.5*e.spacing.base,"& [type='submit']":{marginTop:0}},row:{"& [type='submit']":{marginTop:3*e.spacing.base+2}}}}}},68417:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{root:{padding:[0,1.5*e.spacing.base],"&:focus-visible, &:hover":{background:e.colors.baseContrast015,color:e.colors.baseContrast085}},selected:{background:e.colors.baseContrast015,"& span":{color:e.colors.baseContrast085},"&:focus-visible, &:hover":{color:e.colors.baseContrast085}}}}}},5886:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=(n=r(8930))&&n.__esModule?n:{default:n},o=r(88013),a=r(20801);function s(e){return s="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},s(e)}function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{defaultModalBoxStyles:{border:"none",borderRadius:12,backgroundColor:e.colors.pageBackground,padding:4*e.spacing.base,borderImageSource:"none"},defaultCloseButtonStyles:{backgroundColor:"transparent","& svg":{fill:e.colors.baseContrast070,padding:e.spacing.base}}}}}},38295:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=(n=r(50645))&&n.__esModule?n:{default:n};function o(e){return o="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},o(e)}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{pageIndicator:{borderRadius:0,color:e.colors.primary,fontSize:e.typography.fontSize,width:30,height:36,"&:hover":{backgroundColor:e.colors.baseContrast010}},dotsIconWrapper:{width:30,height:36},dotsIcon:{minWidth:2.9*e.spacing.base,minHeight:2.9*e.spacing.base,width:2.9*e.spacing.base,height:2.9*e.spacing.base,marginTop:1},pageChanger:{borderRadius:0,backgroundColor:"transparent",width:30,height:36,"&:hover":{backgroundColor:e.colors.baseContrast010,"& $pageChangerIcon":{fill:e.colors.primary}}},pageChangerIcon:{minWidth:2.9*e.spacing.base,minHeight:2.9*e.spacing.base,width:2.9*e.spacing.base,height:2.9*e.spacing.base},padRight:{marginRight:2},padLeft:{marginLeft:2}}}}},66020:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={defaultProps:{border:!0,shadow:!1},styles:function(e){return{root:{borderRadius:12,color:e.colors.baseContrast085,boxSizing:"border-box",padding:[3*e.spacing.base,0]}}}}},28127:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={defaultProps:{hideTriangle:!0},styles:function(e){return{root:{"--background":e.colors.baseContrast010},content:{padding:e.spacing.base,borderStyle:"solid",borderWidth:1,borderColor:e.colors.baseContrast020,borderRadius:5},scroll:{"&::-webkit-scrollbar-thumb":{backgroundColor:e.colors.baseContrast030,borderRadius:5,border:"solid ".concat(e.spacing.base/2,"px ").concat(e.colors.baseContrast010)},"&::-webkit-scrollbar-thumb:hover":{backgroundColor:e.colors.baseContrast040},"&::-webkit-scrollbar-track":{backgroundColor:e.colors.baseContrast010,borderRadius:5}}}}}},51217:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(81351),i={styles:function(e){return{root:{color:e.colors.baseContrast085},rootDisabled:{color:e.colors.baseContrast040},input:{"&:checked + div":{backgroundColor:n.vars.get("checkedInputColor",e.colors.primary),"&:before":{backgroundColor:e.colors.themeBase}},"&:checked:disabled + div":{borderColor:e.colors.baseContrast040,backgroundColor:e.colors.baseContrast040,"&:before":{backgroundColor:e.colors.baseContrast020}}},check:{border:"1px solid ".concat(e.colors.baseContrast060),background:e.colors.themeBase},disabled:{border:"1px solid ".concat(e.colors.baseContrast040),background:e.colors.baseContrast010},hint:{marginInlineStart:e.spacing.base/2,textTransform:"initial",color:e.colors.baseContrast085},description:{textTransform:"initial",color:e.colors.baseContrast085}}}};t.default=i},60470:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(20801);function i(e){return i="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},i(e)}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e){var t=e.props,r=e.theme,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.colors.active;return t.errorText?r.colors.alert:n},n=function(e){var t=e.state,r=e.theme;return t.isDisabled?r.colors.baseContrast050:t.isSelected?r.colors.baseContrast090:r.colors.baseContrast085},i=function(e){var t=e.props,n=e.state,i=e.theme;return t.errorText?i.colors.alert:n.isDisabled?i.colors.baseContrast030:"flat"===t.button?"transparent":n.menuIsOpen||n.isFocused?r({props:t,theme:i}):i.colors.baseContrast040},o=function(e){var t=e.props,r=e.state,n=e.theme;return r.isDisabled?n.colors.baseContrast050:null!==t.button?n.colors.baseContrast100:n.colors.baseContrast085},a={styles:function(e){return{labelText:{marginInlineStart:2,display:"block",marginBottom:2,color:e.colors.baseContrast085,textTransform:"uppercase",fontSize:e.typography.fontSize,fontWeight:600},lightBackground:{borderRadius:7},hint:{marginInlineStart:e.spacing.base/2,textTransform:"initial",color:e.colors.baseContrast085},description:{textTransform:"initial",color:e.colors.baseContrast085}}},select:{placeholder:function(e){return{color:e.theme.colors.baseContrast050}},control:function(e){var t=e.props,n=e.state,o=e.theme;return{paddingInlineStart:1.5*o.spacing.base-1,borderWidth:1,borderRadius:7,background:n.isDisabled?o.colors.baseContrast015:o.colors.pageBackground,borderColor:i({state:n,props:t,theme:o}),boxShadow:n.menuIsOpen||n.isFocused?"0 0 6px 0 ".concat(r({props:t,theme:o})):"unset","&:hover":{borderColor:r({props:t,theme:o}),background:o.colors.pageBackground}}},dropdownIndicator:function(e){var t=e.theme,r=e.state;return{paddingInlineEnd:t.spacing.base,"& svg":{fill:r.isDisabled?t.colors.baseContrast030:t.colors.baseContrast085}}},indicatorSeparator:function(e){var t=e.theme;return{background:e.state.isDisabled?t.colors.baseContrast030:t.colors.baseContrast040,width:1}},multiValue:function(e){var t=e.props,n=e.theme;return{background:e.state.isDisabled?n.colors.baseContrast030:r({props:t,theme:n},n.colors.primary),borderRadius:4}},multiValueLabel:function(e){var t=e.theme;return{color:t.colors.themeBase,marginLeft:4,marginRight:4,"&:hover, &:focus-visible":{color:t.colors.themeBase}}},multiValueRemove:function(e){var t=e.theme;return{background:"none",paddingLeft:4,paddingRight:4,color:t.colors.themeBase,"&:hover, &:focus-visible":{color:t.colors.themeBase,background:"none"}}},menu:function(e){var t=e.theme;return{color:t.colors.baseContrast085,borderRadius:4,background:t.colors.pageBackground,borderColor:t.colors.baseContrast010}},option:function(e){var t=e.theme,r=e.state;return{paddingInlineStart:2*t.spacing.base,background:r.isSelected?t.colors.baseContrast015:t.colors.baseContrast010,color:n({state:r,theme:t}),"&:hover, &:focus-visible":{borderColor:t.colors.active,background:t.colors.baseContrast020}}},singleValue:function(e){var t=e.theme,r=e.state,n=e.props;return{color:o({state:r,props:n,theme:t})}}}};t.default=a},8478:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{content:{background:e.colors.pageBackground}}}}},26431:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{submenu:{"&:first-of-type $mainItem":{borderTop:0},boxSizing:"content-box"},mainItem:{boxSizing:"content-box",fontFamily:'Raleway, "Helvetica Neue", "Helvetica", "Arial", sans-serif',fontSize:e.typography.fontSize+2,fontWeight:500,letterSpacing:.44,lineHeight:1.45,borderTop:{color:e.colors.baseContrast010,width:1,style:"solid"},paddingTop:2*e.spacing.base,paddingBottom:2*e.spacing.base,paddingLeft:2*e.spacing.base,"&:hover":{background:"".concat(e.colors.baseContrast010,"B3")}},activeMainItem:{background:e.colors.pageBackground,paddingLeft:2*e.spacing.base,borderLeft:{width:0}},disabledMainItem:{color:e.colors.baseContrast050,background:"transparent","&:hover":{color:e.colors.baseContrast050}},indicator:{fill:e.colors.baseContrast085},subItem:{boxSizing:"content-box",height:6*e.spacing.base,fontFamily:'Raleway, "Helvetica Neue", "Helvetica", "Arial", sans-serif',fontSize:e.typography.fontSize+2,fontWeight:400,letterSpacing:.44,background:e.colors.pageBackground,"&:hover":{background:"".concat(e.colors.baseContrast010,"B3"),color:e.colors.baseContrast085}},activeSubmenuItem:{borderLeft:{width:0},"&, & a":{background:e.colors.pageBackground,color:e.colors.baseContrast085,"&:hover, &:focus-visible":{backgroundColor:"".concat(e.colors.baseContrast010,"B3"),color:e.colors.baseContrast085}}},disabledSubmenuItem:{color:e.colors.baseContrast040,"&:hover":{color:e.colors.baseContrast040}}}}}},35997:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(){return{root:{borderRadius:1}}}}},10743:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{line:{borderRadius:1,height:e.spacing.base,minHeight:e.spacing.base}}}}},94545:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{root:{minHeight:6*e.spacing.base,borderRadius:2},rootOpen:{marginTop:4*e.spacing.base,marginBottom:4*e.spacing.base},left:{insetInlineStart:4*e.spacing.base},right:{insetInlineEnd:4*e.spacing.base},message:{textAlign:"center",width:"100%"}}}}},74285:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(20801);function i(e){return i="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},i(e)}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(42695),i={defaultProps:{border:["outer","horizontal"]},styles:function(e){return{table:{borderWidth:1,borderColor:e.colors.baseContrast020,"& td":{borderWidth:1,borderColor:e.colors.baseContrast020}},striped:{"& tr":{"&:nth-child(even)":{"&:hover":{background:e.colors.baseContrast020}}}},highlightOnHover:{"& tr":{"&:hover":{background:e.colors.baseContrast010}}},tbody:{"&& td":{padding:n.vars.get("cellPadding",2*e.spacing.base),fontSize:e.typography.fontSize}}}}};t.default=i},60563:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{root:{borderWidth:1,borderColor:e.colors.baseContrast020,overflow:"hidden",textOverflow:"ellipsis",textTransform:"uppercase",fontFamily:'Raleway, "Helvetica Neue", "Helvetica", "Arial", sans-serif',letterSpacing:.44,background:e.colors.baseContrast010},sortIndicator:{margin:"1px 6px",borderWidth:3,borderBottomWidth:5,borderBottomColor:e.colors.baseContrast070},activeSortIndicator:{borderBottomColor:e.colors.baseContrast085}}}}},11530:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(88345),i={defaultProps:{size:"small"},styles:function(e){return{root:{fontWeight:600,padding:[Math.floor(e.spacing.base/4),e.spacing.base/2],borderRadius:7,textTransform:"none",letterSpacing:"normal"},icon:{paddingInlineStart:e.spacing.base/2,paddingInlineEnd:0},close:{paddingInlineStart:0,paddingInlineEnd:e.spacing.base/2,"& svg":{backgroundColor:"unset",borderRadius:"unset",fill:n.vars.get("fontColor"),"&:hover, &:focus-visible":{backgroundColor:"unset",fill:n.vars.get("fontColor60")}}},translucentClose:{"& svg":{backgroundColor:"unset",fill:n.vars.get("mainColor"),"&:hover, &:focus-visible":{backgroundColor:"unset",fill:n.vars.get("mainColor60")}}},compact:{fontWeight:"normal"},compactIcon:{paddingInlineEnd:0},transluecentCompact:{fontWeight:900}}}};t.default=i},49869:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(20801);function i(e){return i="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},i(e)}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(75634),i={styles:function(e){return{input:{resize:"vertical",padding:"".concat(e.spacing.base,"px ").concat(1.5*e.spacing.base,"px"),background:e.colors.themeBase,color:e.colors.baseContrast085,borderColor:e.colors.baseContrast040,borderRadius:7,"&::placeholder":{color:e.colors.baseContrast050},"&:focus-visible":{borderColor:e.colors.active,color:e.colors.baseContrast085,boxShadow:"0 0 6px 0 ".concat(e.colors.active)},"&:hover":{borderColor:e.colors.active},"&:disabled, &:disabled:hover":{background:e.colors.baseContrast015,borderColor:e.colors.baseContrast030,color:e.colors.baseContrast050},"&::-webkit-calendar-picker-indicator":{filter:n.vars.get("transparentFilter")}},preAndSuffix:{backgroundColor:e.colors.baseContrast015,color:e.colors.baseContrast085,borderColor:e.colors.baseContrast040},prefix:{borderEndStartRadius:"7px",borderStartStartRadius:"7px"},suffix:{borderEndEndRadius:"7px",borderStartEndRadius:"7px"},prefixSuffixValidity:{borderWidth:1},border:{display:"none"},inputWithValue:{padding:"".concat(e.spacing.base,"px ").concat(1.5*e.spacing.base,"px"),borderWidth:1},inputWithValidValue:{borderColor:e.colors.success,"&:focus-visible":{boxShadow:"0 0 6px 0 ".concat(e.colors.success)},"&:hover":{borderColor:e.colors.success}},inputWithInvalidValue:{borderColor:e.colors.alert,"&:focus-visible":{boxShadow:"0 0 6px 0 ".concat(e.colors.alert)},"&:hover":{borderColor:e.colors.alert}},label:{color:e.colors.baseContrast085,fontSize:n.vars.get("labelFontSize",e.typography.fontSize),fontWeight:600,textTransform:n.vars.get("labelTextTransform","uppercase"),marginBottom:2,marginInlineStart:2},icon:{"& > svg":{fill:e.colors.baseContrast070}},hint:{marginInlineStart:e.spacing.base/2,textTransform:"initial",color:e.colors.baseContrast085},description:{textTransform:"initial",color:e.colors.baseContrast085},inputHasPrefix:{borderInlineStartColor:e.colors.baseContrast040,"&:focus-visible":{borderInlineStartColor:e.colors.baseContrast040},"&:hover":{borderInlineStartColor:e.colors.baseContrast040}},inputHasSuffix:{borderInlineEndColor:e.colors.baseContrast040,"&:focus-visible":{borderInlineEndColor:e.colors.baseContrast040},"&:hover":{borderInlineEndColor:e.colors.baseContrast040}},inputPrefixSuffixValid:{"&:focus-visible":{borderColor:e.colors.success}},inputPrefixSuffixInvalid:{"&:focus-visible":{borderColor:e.colors.alert}}}}};t.default=i},62898:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(49305),i={styles:function(e){return{checkbox:{"&:checked ~ $button:after":{insetInlineStart:16},"&:checked:not(:disabled)":{"& ~ $button":{backgroundColor:n.vars.get("checkboxColor"),"&::after":{backgroundColor:e.colors.textOnDark}}},"&:disabled":{"& ~ $label":{color:e.colors.baseContrast060,"& $description, & $hint":{color:e.colors.baseContrast060}}},"&:disabled:checked ~ $button":{backgroundColor:"color-mix(in srgb, ".concat(n.vars.get("checkboxColor"),", ").concat(e.colors.themeBase,")"),"&:after":{backgroundColor:"color-mix(in srgb, #fff 60%, ".concat(e.colors.themeBase,")"),opacity:.9}}},button:{borderRadius:16,minWidth:32,minHeight:20,"&:after":{backgroundColor:e.colors.themeBase,width:16,height:16,insetInlineStart:2,top:2}},label:{textTransform:"uppercase",color:e.colors.baseContrast085},hint:{marginInlineStart:e.spacing.base/2,textTransform:"initial",color:e.colors.baseContrast085},description:{textTransform:"initial",color:e.colors.baseContrast085}}}};t.default=i},99205:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{tooltip:{padding:e.spacing.base,background:e.colors.baseContrast010,borderStyle:"solid",borderWidth:1,borderColor:e.colors.baseContrast020,borderRadius:5,color:e.colors.baseContrast085}}}}},72684:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.typography=t.spacing=t.sharedColors=t.isAlwaysNativeDropDownMenu=t.iconSizes=t.components=void 0;var n=F(r(48036)),i=F(r(59996)),o=F(r(92625)),a=F(r(80262)),s=F(r(26528)),l=F(r(48387)),c=F(r(91240)),u=F(r(69914)),d=F(r(7687)),h=F(r(39965)),p=F(r(14684)),f=F(r(68417)),m=F(r(5886)),g=F(r(30519)),v=F(r(38295)),y=F(r(96498)),b=F(r(66020)),_=F(r(28127)),S=F(r(51217)),w=F(r(60470)),E=F(r(87650)),C=F(r(8478)),O=F(r(26431)),P=F(r(35997)),T=F(r(10743)),k=F(r(94545)),R=F(r(74285)),A=F(r(90494)),D=F(r(60563)),I=F(r(11530)),x=F(r(49869)),M=F(r(23915)),L=F(r(62898)),j=F(r(99205)),N=r(61925);function F(e){return e&&e.__esModule?e:{default:e}}function B(e){return B="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},B(e)}function U(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}t.spacing={base:8},t.iconSizes={small:20,medium:24,large:32},t.sharedColors=function(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(46503),i=r(72684);function o(e){return o="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},o(e)}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=i(r(1225));function i(e){return e&&e.__esModule?e:{default:e}}var o={properties:{light:i(r(67065)).default,dark:n.default}};t.default=o},67065:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(46503),i=r(72684);function o(e){return o="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},o(e)}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.typography=t.mode=t.default=t.colors=void 0;var n=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=s(e)&&"function"!=typeof e)return{default:e};var r=a(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var l=i?Object.getOwnPropertyDescriptor(e,o):null;l&&(l.get||l.set)?Object.defineProperty(n,o,l):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}(r(61925)),i=r(46503),o=r(90857);function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(a=function(e){return e?r:t})(e)}function s(e){return s="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},s(e)}function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=l(r(85698)),i=l(r(98937)),o=l(r(82088)),a=l(r(36531)),s=l(r(82409));function l(e){return e&&e.__esModule?e:{default:e}}var c={whitelabel:l(r(41354)).default,performer:a.default,admin:n.default,cambuilder:i.default,streamfans:s.default,kwiky:o.default};t.default=c},8811:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=(n=r(50645))&&n.__esModule?n:{default:n};function o(e){return o="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},o(e)}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{wrapper:{borderRadius:12,borderWidth:0,background:e.colors.baseContrast020},label:{color:e.colors.baseContrast060,fontSize:e.typography.fontSize+1}}}}},10843:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{button:{borderRadius:12,borderInlineWidth:0,color:e.colors.baseContrast070,"& svg":{fill:e.colors.baseContrast070}},small:{height:4*e.spacing.base,padding:[e.spacing.base,1.5*e.spacing.base]},medium:{height:5*e.spacing.base,padding:[1.5*e.spacing.base,2*e.spacing.base]},large:{height:6*e.spacing.base,padding:[2*e.spacing.base,3*e.spacing.base]}}}}},49992:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(98756),i={styles:function(e){return{root:{"&:hover":{"& svg":{borderColor:e.colors.baseContrast060}}},input:{"&:checked + label svg":{backgroundColor:n.vars.get("checkboxColor","transparent"),borderColor:n.vars.get("checkboxColor",e.colors.baseContrast100)}},disabled:{"&& + label":{"& $labelText":{color:e.colors.baseContrast030}},"&:checked + label svg":{backgroundColor:e.colors.baseContrast040,borderColor:e.colors.baseContrast040}},label:{fontSize:e.typography.fontSize+1,color:e.colors.baseContrast100},labelText:{color:e.colors.baseContrast100},svg:{borderColor:n.vars.get("checkboxPrimary",e.colors.baseContrast100),borderRadius:4,borderWidth:2,strokeWidth:3,stroke:e.colors.active,padding:2}}}};t.default=i},81059:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(20801);function i(e){return i="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},i(e)}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={defaultProps:{size:64,border:!0},styles:function(e){return{border:{borderWidth:2,borderStyle:"solid",borderColor:e.colors.baseContrast100}}}}},63589:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{defaultDialogBoxStyles:{border:"none",borderRadius:12,background:e.colors.pageBackground,padding:4*e.spacing.base},small:{padding:2*e.spacing.base},title:{color:e.colors.baseContrast070,fontSize:e.typography.fontSize+4,fontWeight:500,letterSpacing:.6,textTransform:"uppercase"},svgIcon:{width:20,height:20,minHeight:20,minWidth:20},content:{fontSize:e.typography.fontSize},actions:{marginTop:2*e.spacing.base},button:{background:"none",borderColor:e.colors.baseContrast100,border:"1px solid","&:hover, &:focus-visible":{background:"none",borderColor:e.colors.baseContrast060},"& label":{color:e.colors.baseContrast085},"&:last-child > label":{color:e.colors.baseContrast100},"&:last-child":{background:"linear-gradient(180deg, ".concat(e.colors.primary," 0%, ").concat(e.colors.primaryDark," 100%)"),border:"none","&:hover, &:focus-visible":{background:"linear-gradient(0deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)), linear-gradient(180deg, ".concat(e.colors.primary," 0%, ").concat(e.colors.primaryDark," 100%)"),"& label":{color:e.colors.textOnDark}}}}}}}},4264:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{contents:{background:e.colors.pageBackground},bottom:{borderRadius:[2*e.spacing.base,2*e.spacing.base,0,0],borderColor:e.colors.baseContrast015,borderStyle:"solid",borderWidth:[1,1,0,1],paddingTop:0,"&::before":{content:'""',display:"flex",borderRadius:4,height:e.spacing.base/2,width:4*e.spacing.base,margin:[2.25*e.spacing.base,"auto"],backgroundColor:e.colors.baseContrast030}}}}}},87859:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{flatButton:{borderRadius:2,background:e.colors.themeBase,"&:hover":{background:e.colors.baseContrast010},"& label":{color:e.colors.baseContrast090},"& svg":{fill:e.colors.baseContrast090},"&:focus-visible":{background:e.colors.baseContrast010,"& label":{color:e.colors.baseContrast070},"& svg":{fill:e.colors.baseContrast070}}},label:{color:e.colors.baseContrast070,fontSize:e.typography.fontSize},list:{"ul&, & > ul":{paddingTop:e.spacing.base,paddingBottom:e.spacing.base,background:e.colors.themeBase}},option:{"li&":{paddingLeft:2*e.spacing.base,paddingRight:2*e.spacing.base,color:e.colors.baseContrast070,"&:hover, &:focus-visible":{background:e.colors.baseContrast010}}},modal:{borderColor:e.colors.baseContrast040,borderWidth:1,borderStyle:"solid",borderRadius:2}}}}},68042:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=r(20801),o=(n=r(50645))&&n.__esModule?n:{default:n};function a(e){return a="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},a(e)}function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t svg":{width:18,height:18,minHeight:18,minWidth:18}},medium:{"& > svg":{width:18,height:18,minHeight:18,minWidth:18}},large:{"& > svg":{width:18,height:18,minHeight:18,minWidth:18}},ghost:l(l({},(0,i.setTextCssVars)({fontSize:e.typography.fontSize})),{},{borderColor:e.colors.baseContrast100,backgroundColor:"transparent"},(0,o.default)({hover:{backgroundColor:"transparent",borderColor:e.colors.baseContrast060}})),primary:l({"--color":e.colors.baseContrast100,borderColor:"".concat(e.colors.active,"99"),background:"".concat(e.colors.active,"6a"),"&&$ghost":l({background:"transparent"},(0,o.default)({hover:{background:"transparent",borderColor:"".concat(e.colors.active,"FF")}}))},(0,o.default)({hover:{borderColor:"".concat(e.colors.active,"99"),background:"".concat(e.colors.active,"B3")}})),label:{margin:0},veryLong:{padding:[0,1.5*e.spacing.base+2]}}}};t.default=u},7395:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{column:{"& [type='submit']":{marginTop:0}},row:{"& [type='submit']":{marginTop:3*e.spacing.base+1}}}}}},18252:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={defaultProps:{type:"highContrast"},styles:function(e){var t=e.colors;return{root:{"&:disabled, &:disabled svg":{fill:t.baseContrast040,borderColor:t.baseContrast040}},filled:{backgroundColor:"".concat(t.themeBase,"66"),"&:disabled":{backgroundColor:"".concat(t.baseContrast015,"66")}}}}}},29162:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{root:{"& > svg":{fill:e.colors.baseContrast100}}}}}},92279:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{root:{borderRadius:4,backgroundColor:"".concat(e.colors.themeBase,"99"),fontSize:16,fontWeight:700,padding:[e.spacing.base/4,e.spacing.base]},bug:{backgroundColor:e.colors.success,"&:after":{backgroundColor:e.colors.success}}}}}},74381:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(20801);function i(e){return i="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},i(e)}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=(n=r(8930))&&n.__esModule?n:{default:n},o={styles:function(e){return{defaultModalBoxStyles:{background:e.colors.pageBackground,borderColor:e.colors.baseContrast015,borderRadius:12,padding:3*e.spacing.base,boxShadow:"".concat((0,i.default)(e.colors.baseShadow,.5)," 0 2px 4px 0"),borderImageSource:"none"},small:{width:288,padding:3*e.spacing.base},medium:{width:560},defaultCloseButtonStyles:{backgroundColor:(0,i.default)(e.colors.baseShadow,.15),borderRadius:"100%",width:4*e.spacing.base,height:4*e.spacing.base,minHeight:4*e.spacing.base,minWidth:4*e.spacing.base,"&:hover":{backgroundColor:(0,i.default)(e.colors.baseShadow,.2)},"& svg":{fill:e.colors.baseContrast100,width:18,height:18,minHeight:18,minWidth:18}}}}};t.default=o},16754:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=r(46503),o=(n=r(50645))&&n.__esModule?n:{default:n};function a(e){return a="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},a(e)}function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{root:{"--background":e.colors.baseContrast010},content:{borderRadius:8},scroll:{"&::-webkit-scrollbar-thumb":{backgroundColor:e.colors.baseContrast020,borderRadius:8,border:"solid ".concat(e.spacing.base/2,"px ").concat(e.colors.baseContrast010)},"&::-webkit-scrollbar-thumb:hover":{backgroundColor:e.colors.baseContrast030},"&::-webkit-scrollbar-track":{backgroundColor:e.colors.baseContrast010,borderRadius:8}}}}}},5424:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(81351),i={styles:function(e){return{root:{fontSize:e.typography.fontSize+1,color:e.colors.baseContrast100,"&:hover $check":{borderColor:e.colors.baseContrast060}},rootDisabled:{color:e.colors.baseContrast040,"&:hover $check":{borderColor:e.colors.baseContrast040}},input:{"&:checked + div":{backgroundColor:"transparent",borderColor:e.colors.baseContrast100,"&:before":{backgroundColor:n.vars.get("checkedInputColor",e.colors.active)}},"&:checked:disabled + div":{borderColor:e.colors.baseContrast040,backgroundColor:e.colors.baseContrast040,"&:before":{backgroundColor:e.colors.baseContrast020}}},check:{borderWidth:2,borderStyle:"solid",borderColor:e.colors.baseContrast100,background:"transparent"},disabled:{borderColor:e.colors.baseContrast040}}}};t.default=i},98757:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=r(20801),o=(n=r(50645))&&n.__esModule?n:{default:n};function a(e){return a="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},a(e)}function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(41191),i={styles:function(e){return{root:{backgroundColor:n.vars.get("rootBackgroundColor",e.colors.baseContrast020)}}}};t.default=i},86479:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={defaultProps:{shadowColor:"themeBase"}}},85305:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e){var t=e.state,r=e.props,n=e.theme;return r.errorText?n.colors.alert:"flat"===r.button?"transparent":t.menuIsOpen||t.isFocused?n.colors.baseContrast080:n.colors.baseContrast040},n=function(e){var t=e.state,r=e.theme;return t.isDisabled?r.colors.baseContrast030:r.colors.baseContrast090},i=function(e){return"light"===e.mode?e.colors.baseContrast080:e.colors.baseContrast060},o={styles:function(e){return{labelText:{color:e.colors.baseContrast060,fontSize:e.typography.fontSize+1},lightBackground:{borderRadius:4}}},select:{menu:function(e){return{backgroundColor:e.theme.colors.baseContrast015}},control:function(e){var t=e.state,n=e.props,i=e.theme;return{borderColor:r({state:t,props:n,theme:i}),borderWidth:1,borderRadius:4,fontSize:i.typography.fontSize+2,color:i.colors.baseContrast070,paddingInlineStart:1.5*i.spacing.base-1}},placeholder:function(e){var t=e.state,r=e.theme;return{color:n({state:t,theme:r})}},dropdownIndicator:function(e){var t=e.state,r=e.theme;return{"& svg":{fill:t.isDisabled?r.colors.baseContrast030:i(r)}}}}};t.default=o},73038:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=(n=r(8930))&&n.__esModule?n:{default:n},o={styles:function(e){return{mainItem:{padding:4,background:e.colors.baseContrast015,fontWeight:400,fontSize:e.typography.fontSize+2,"&:hover":{background:"".concat(e.colors.baseContrast100,"1F")}},activeMainItem:{background:e.colors.baseContrast020,paddingLeft:3*e.spacing.base-2,fontWeight:600,borderLeft:{width:2}},disabledMainItem:{color:e.colors.baseContrast050,"&:hover":{color:e.colors.baseContrast050,background:"transparent"}},indicator:{fill:e.colors.baseContrast080},subItem:{background:e.colors.baseContrast015,"&:hover":{color:e.colors.baseContrast080}},activeSubmenuItem:{borderLeft:{width:0},"&, & a":{background:e.colors.baseContrast020,color:e.colors.baseContrast080,"&:hover, &:focus-visible":{background:"".concat(e.colors.baseContrast100,"1F"),color:(0,i.default)(e.colors.baseContrast080,.9)}}},disabledSubmenuItem:{color:e.colors.baseContrast040,"&:hover":{color:e.colors.baseContrast040}}}}};t.default=o},70578:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(20801);function i(e){return i="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},i(e)}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t label":{fontWeight:"bold"},height:4*e.spacing.base,"& > svg":{height:e.iconSizes.small,width:e.iconSizes.small,minHeight:e.iconSizes.small,minWidth:e.iconSizes.small}}}}};t.default=s},16980:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={defaultProps:{fill:"highContrast"}}},44666:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=(n=r(62249))&&n.__esModule?n:{default:n},o={search:i.default.createElement("path",{d:"M19.34,20.06c-.19,0-.38-.07-.53-.22l-3.8-3.78c-1.2.97-2.73,1.55-4.39,1.55-3.86,0-7-3.14-7-7s3.14-7,7-7,7,3.14,7,7c0,1.66-.58,3.19-1.55,4.39l3.8,3.78c.29.29.29.77,0,1.06-.15.15-.34.22-.53.22ZM10.63,5.11c-3.03,0-5.5,2.47-5.5,5.5s2.47,5.5,5.5,5.5,5.5-2.47,5.5-5.5-2.47-5.5-5.5-5.5Z"}),favorite:i.default.createElement("path",{d:"M11.9927 21.0901L3.40837 11.8759C1.53054 9.85814 1.53054 6.56903 3.40837 4.55125C4.34145 3.55985 5.57778 3 6.89576 3C8.21373 3 9.46173 3.54818 10.3831 4.55125L11.9927 6.27745L13.6023 4.55125C14.5354 3.55985 15.7717 3 17.0897 3C18.3726 3.03499 19.644 3.54818 20.5771 4.55125C21.4868 5.53098 22 6.83729 22 8.21359C22 9.58988 21.4985 10.8962 20.5771 11.8759L11.9927 21.0901Z"}),favoriteBorder:i.default.createElement("path",{d:"M11.9927 21.0901L3.40837 11.8759C1.53054 9.85814 1.53054 6.56903 3.40837 4.55125C4.34145 3.55985 5.57778 3 6.89576 3C8.21373 3 9.46173 3.54818 10.3831 4.55125L11.9927 6.27745L13.6023 4.55125C14.5354 3.55985 15.7717 3 17.0897 3C18.3726 3.03499 19.644 3.54818 20.5771 4.55125C21.4868 5.53098 22 6.83729 22 8.21359C22 9.58988 21.4985 10.8962 20.5771 11.8759L11.9927 21.0901ZM4.59805 10.7562L11.9927 18.6991L19.3874 10.7562C20.0172 10.0797 20.3671 9.17 20.3671 8.20192C20.3671 7.23385 20.0172 6.3241 19.3874 5.64762C18.7692 4.9828 17.9528 4.62123 17.0897 4.62123C16.2266 4.62123 15.4101 4.9828 14.792 5.64762L11.9927 8.64514L9.19347 5.64762C7.95714 4.31798 5.83438 4.31798 4.59805 5.64762C3.29173 7.0589 3.29173 9.34495 4.59805 10.7562Z"})};t.default=o},16444:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(20801);function i(e){return i="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},i(e)}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{striped:{"& tr":{"&:nth-child(even)":{"&:hover":{background:e.colors.baseContrast030}}}}}}}},51473:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:{root:{borderBottom:"none"},indicator:{height:0}}}},29375:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(88345),i={defaultProps:{size:"small"},styles:function(e){return{root:{fontWeight:600,padding:[e.spacing.base/4,e.spacing.base/4],borderRadius:4},icon:{paddingInlineEnd:0},translucent:{fontWeight:600,color:e.colors.baseContrast100,backgroundColor:n.vars.get("mainColor30"),"& svg":{fill:e.colors.baseContrast100}},translucentChildren:{"& > *":{color:e.colors.baseContrast100}},translucentCount:{color:e.colors.baseContrast070}}}};t.default=i},75589:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={defaultProps:{id:"kwiky-id",className:"kwiky-class"}}},8814:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=r(20801),o=(n=r(37769))&&n.__esModule?n:{default:n};function a(e){return a="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},a(e)}function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(91917),i=r(75634),o={styles:function(e){return{input:{borderRadius:4,padding:"".concat(e.spacing.base,"px ").concat(1.5*e.spacing.base,"px"),fontSize:e.typography.fontSize+2,borderColor:e.colors.baseContrast040,"&::placeholder":{color:e.colors.baseContrast050},"&:focus-visible":{borderColor:e.colors.baseContrast080,boxShadow:"none"}},preAndSuffix:{borderColor:e.colors.baseContrast040},prefix:{borderEndStartRadius:"4px",borderStartStartRadius:"4px"},suffix:{borderEndEndRadius:"4px",borderStartEndRadius:"4px"},prefixSuffixValidity:{borderWidth:1},border:{borderRadius:4,borderWidth:1,borderColor:e.colors.baseContrast040},inputWithValue:{padding:"".concat(e.spacing.base,"px ").concat(1.5*e.spacing.base,"px"),borderWidth:1},inputWithValidValue:{"&:focus-visible":{borderColor:e.colors.success}},inputWithInvalidValue:{"&:focus-visible":{borderColor:e.colors.alert}},label:{color:e.colors.baseContrast100,fontSize:i.vars.get("labelFontSize",e.typography.fontSize)},icon:{"& > svg":{fill:e.colors.baseContrast050}},rightIcon:{"& [type='button'] svg":{fill:e.colors.active},"& [type='button']:hover svg":{fill:(0,n.getHoverColor)(e.colors.active).toHexString()}},inputHasPrefix:{borderInlineStartColor:e.colors.baseContrast060,borderInlineStartWidth:1,"&:focus-visible":{borderInlineStartColor:e.colors.baseContrast060}},inputHasSuffix:{borderInlineEndColor:e.colors.baseContrast060,borderInlineEndWidth:1,"&:focus-visible":{borderInlineEndColor:e.colors.baseContrast060}}}}};t.default=o},13633:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{root:{"&:hover $checkbox":{"&:checked:not(:disabled) ~ $button":{backgroundColor:e.colors.active},"&:not(:disabled) ~ $button":{}}},checkbox:{"&:checked ~ $button:after":{insetInlineStart:16},"&:checked:not(:disabled)":{"& ~ $button":{backgroundColor:e.colors.active,"&::after":{backgroundColor:e.colors.baseContrast100}}},"&:disabled":{"& ~ $button":{backgroundColor:e.colors.baseContrast040,"&:after":{backgroundColor:e.colors.baseContrast060}}},"&:disabled:checked ~ $button":{backgroundColor:"color-mix(in srgb, ".concat(e.colors.active,", ").concat(e.colors.themeBase,")"),"&:after":{backgroundColor:"color-mix(in srgb, #fff 60%, ".concat(e.colors.themeBase,")"),opacity:.9}}},button:{boxSizing:"border-box",borderRadius:16,backgroundColor:e.colors.baseContrast030,minWidth:32,minHeight:20,"&:after":{backgroundColor:e.colors.baseContrast100,width:16,height:16,insetInlineStart:2,top:2}},label:{color:e.colors.baseContrast100}}}}},17511:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.kwikyTypography=t.kwikySpacing=t.kwikySharedColors=t.kwikyIconSizes=t.kwikyComponents=t.isAlwaysNativeDropDownMenu=void 0;var n=F(r(8811)),i=F(r(7888)),o=F(r(10843)),a=F(r(49992)),s=F(r(81059)),l=F(r(64422)),c=F(r(63589)),u=F(r(4264)),d=F(r(87859)),h=F(r(68042)),p=F(r(7395)),f=F(r(18252)),m=F(r(29162)),g=F(r(92279)),v=F(r(74381)),y=F(r(85278)),b=F(r(16754)),_=F(r(22013)),S=F(r(5424)),w=F(r(98757)),E=F(r(61371)),C=F(r(86479)),O=F(r(85305)),P=F(r(73038)),T=F(r(70578)),k=F(r(16980)),R=F(r(16444)),A=F(r(37267)),D=F(r(51473)),I=F(r(29375)),x=F(r(75589)),M=F(r(8814)),L=F(r(32034)),j=F(r(13633)),N=r(61925);function F(e){return e&&e.__esModule?e:{default:e}}function B(e){return B="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},B(e)}function U(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}t.kwikySharedColors=function(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=r(46503),o=r(17511),a=(n=r(44666))&&n.__esModule?n:{default:n};function s(e){return s="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},s(e)}function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=i(r(95846));function i(e){return e&&e.__esModule?e:{default:e}}var o={properties:{light:i(r(76116)).default,dark:n.default}};t.default=o},76116:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=r(46503),o=r(17511),a=(n=r(44666))&&n.__esModule?n:{default:n};function s(e){return s="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},s(e)}function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.typography=t.mode=t.default=t.colors=void 0;var n=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=s(e)&&"function"!=typeof e)return{default:e};var r=a(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var l=i?Object.getOwnPropertyDescriptor(e,o):null;l&&(l.get||l.set)?Object.defineProperty(n,o,l):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}(r(61925)),i=r(46503),o=r(90857);function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(a=function(e){return e?r:t})(e)}function s(e){return s="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},s(e)}function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{root:{borderRadius:24,borderColor:e.colors.baseContrast040},text:{color:e.colors.baseContrast070}}}}},60443:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{wrapper:{borderRadius:12,borderWidth:0,background:e.colors.baseContrast015},label:{color:e.colors.baseContrast070,textTransform:"uppercase",fontSize:e.typography.fontSize,fontWeight:600},description:{color:e.colors.baseContrast070,textTransform:"none",fontSize:e.typography.fontSize,lineHeight:"20px"},hint:{textTransform:"none"}}}}},84984:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{button:{borderRadius:12,borderInlineWidth:0,color:e.colors.baseContrast070,"& svg":{fill:e.colors.baseContrast060},"&:hover, &:focus-visible":{background:"transparent",color:e.colors.baseContrast080}},small:{height:4*e.spacing.base,padding:[e.spacing.base,1.5*e.spacing.base]},medium:{height:5*e.spacing.base,padding:[1.5*e.spacing.base,2*e.spacing.base]},large:{height:6*e.spacing.base,padding:[2*e.spacing.base,3*e.spacing.base]}}}}},35878:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{root:{padding:0},contentContainer:{padding:[4,2*e.spacing.base]},titleContainer:{padding:[1.5*e.spacing.base,2*e.spacing.base],justifyContent:"space-between",fontSize:e.typography.fontSize+2,"&:hover":{color:e.colors.baseContrast090,background:e.colors.baseContrast015,borderRadius:4,transition:"300ms ease-in color","& svg":{fill:e.colors.baseContrast080,transition:"300ms ease-in color"}}}}}}},88005:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(98756),i={styles:function(e){return{root:{"&:hover":{"& svg":{borderColor:e.colors.primary,boxShadow:"0 0 0 4px ".concat(e.colors.primary,"33")}}},svg:{borderRadius:4,borderColor:n.vars.get("checkboxPrimary",e.colors.baseContrast050),strokeWidth:3,padding:2},description:{color:e.colors.baseContrast070,textTransform:"none"},hint:{textTransform:"none"}}}};t.default=i},38730:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(20801);function i(e){return i="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},i(e)}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(7393),i={styles:function(e){var t=(0,n.getContrastingTextColorHexString)(e.colors.primary,void 0,void 0,n.PRIMARY_CONTRAST_STANDARD);return{title:{alignItems:"flex-start",color:e.colors.baseContrast070,fontSize:e.typography.fontSize+2,fontWeight:600,letterSpacing:.6,textTransform:"uppercase",marginBottom:e.spacing.base/2},defaultDialogBoxStyles:{border:e.colors.baseContrast050,borderRadius:8,backgroundColor:e.colors.pageBackground,padding:2*e.spacing.base,fontFamily:e.typography.fontFamily},svgIcon:{width:18,height:18,minHeight:18,minWidth:18,marginTop:2},content:{fontSize:e.typography.fontSize,fontFamily:e.typography.fontFamily},button:{borderColor:e.colors.baseContrast040,"&:hover, &:focus-visible":{backgroundColor:e.colors.baseContrast015},"& label":{color:e.colors.baseContrast070},"&:last-child > label":{color:t},"&:last-child":{background:e.colors.primary,borderColor:e.colors.primary,"&:hover, &:focus-visible":{background:e.colors.primaryDark,borderColor:e.colors.primaryDark,"& label":{color:t}}}},small:{"& $actions":{width:"100%"},"& $button":{width:"100%"}},actions:{flexWrap:"wrap"}}}};t.default=i},49314:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{flatButton:{borderRadius:2,background:e.colors.themeBase,"&:hover, &:focus-visible":{background:e.colors.baseContrast010},"& label":{color:e.colors.baseContrast090},"& svg":{fill:e.colors.baseContrast090}},label:{color:e.colors.baseContrast070,fontSize:e.typography.fontSize},list:{"ul&, & > ul":{paddingTop:e.spacing.base,paddingBottom:e.spacing.base,background:e.colors.themeBase}},option:{"li&":{paddingLeft:2*e.spacing.base,paddingRight:2*e.spacing.base,color:e.colors.baseContrast070,"&:hover, &:focus-visible":{background:e.colors.baseContrast010}}},modal:{borderColor:e.colors.baseContrast040,borderWidth:1,borderStyle:"solid",borderRadius:2}}}}},24779:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=r(20801),o=(n=r(50645))&&n.__esModule?n:{default:n};function a(e){return a="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},a(e)}function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t svg":{width:18,height:18,minHeight:18,minWidth:18}},medium:{"& > svg":{width:18,height:18,minHeight:18,minWidth:18}},large:{"& > svg":{width:18,height:18,minHeight:18,minWidth:18}},primary:l({},(0,o.default)({hover:{"--color":e.colors.active}})),ghost:l({textTransform:"capitalize",borderColor:e.colors.baseContrast040},(0,o.default)({hover:{backgroundColor:e.colors.baseContrast015}}))}}};t.default=u},20894:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{column:{gap:3*e.spacing.base}}}}},11665:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){var t=e.colors;return{root:{"&:disabled, &:disabled svg":{fill:t.baseContrast040,borderColor:t.baseContrast040}}}}}},48337:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={defaultProps:{borderRadius:8}}},11227:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{root:{"&:focus-visible, &:hover":{background:e.colors.baseContrast015,color:e.colors.baseContrast070}},selected:{color:e.colors.primary,background:"transparent",fontWeight:600,"& span":{color:e.colors.primary},"&:focus-visible, &:hover":{background:e.colors.baseContrast015}}}}}},17184:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(88013),i=r(20801);function o(e){return o="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},o(e)}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=(n=r(37769))&&n.__esModule?n:{default:n};function o(e){return o="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},o(e)}function a(e,t,r){var n;return n=function(e,t){if("object"!=o(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==o(n)?n:n+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var s={styles:function(e){return{defaultModalBoxStyles:{background:e.colors.themeBase,borderColor:"transparent",borderRadius:8,padding:3*e.spacing.base,borderImageSource:"none"},small:{width:300,padding:2*e.spacing.base},medium:{width:560},defaultCloseButtonStyles:{backgroundColor:"transparent","& svg":{fill:e.colors.baseContrast070}},fullScreen:a({},i.default.ON_DESKTOP,{width:"84vw"})}}};t.default=s},18417:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=(n=r(50645))&&n.__esModule?n:{default:n};function o(e){return o="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},o(e)}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{pageIndicator:{color:e.colors.primary,width:30,height:30,fontSize:e.typography.fontSize},activePageIndicator:{color:e.colors.baseContrast015,width:30,height:30},dotsIconWrapper:{width:30,height:30},dotsIcon:{minWidth:2.9*e.spacing.base,minHeight:2.9*e.spacing.base,width:2.9*e.spacing.base,height:2.9*e.spacing.base,marginTop:1},pageChangerIcon:{minWidth:2.9*e.spacing.base,minHeight:2.9*e.spacing.base,width:2.9*e.spacing.base,height:2.9*e.spacing.base},padRight:{marginRight:2},padLeft:{marginLeft:2},pageChanger:{borderRadius:"50%",backgroundColor:"transparent",width:30,height:30,"&:hover":{backgroundColor:e.colors.baseContrast020,"& $pageChangerIcon":{fill:e.colors.primary}}}}}}},86482:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:{root:{borderRadius:8}}}},45401:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={defaultProps:{hideTriangle:!0},styles:function(e){return{root:{"--background":e.colors.pageBackground},content:{borderStyle:"solid",borderWidth:1,borderColor:e.colors.baseContrast020,borderRadius:8,boxShadow:"0px 2px 4px 0 ".concat(e.colors.baseShadow,"1A")},scroll:{"&::-webkit-scrollbar-thumb":{borderRadius:8,border:"solid ".concat(e.spacing.base/2,"px ").concat(e.colors.pageBackground)},"&::-webkit-scrollbar-track":{backgroundColor:e.colors.pageBackground,borderRadius:8}}}}}},72343:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{root:{"&:hover":{"& $check":{boxShadow:"0 0 0 4px ".concat(e.colors.primary,"33"),border:"2px solid ".concat(e.colors.primary)},"& input:disabled ~ $check":{boxShadow:"none"}}},rootDisabled:{"&:hover":{"& $check":{border:"2px solid ".concat(e.colors.baseContrast030)}}},check:{border:"2px solid ".concat(e.colors.baseContrast050),background:e.colors.themeBase},disabled:{border:"2px solid ".concat(e.colors.baseContrast030),background:e.colors.baseContrast010},description:{color:e.colors.baseContrast070,textTransform:"none"},hint:{textTransform:"none"}}}}},17384:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(20801);function i(e){return i="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},i(e)}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{ribbon:{color:e.colors.textOnDark,fontSize:18,paddingInlineStart:0}}}}},43344:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e){var t=e.props,r=e.theme,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.colors.active;return t.errorText?r.colors.alert:n},n=function(e){var t=e.state,r=e.theme,n=e.props;return t.isDisabled?r.colors.baseContrast050:t.isSelected?r.colors.baseContrast070:n.errorText?r.colors.textOnDark:r.colors.baseContrast070},i=function(e){var t=e.state,r=e.props,n=e.theme;return r.errorText?n.colors.alert:"flat"===r.button?"transparent":t.menuIsOpen||t.isFocused?n.colors.primary:n.colors.baseContrast040},o=function(e){var t=e.state,r=e.theme;return t.isDisabled?r.colors.baseContrast040:r.colors.baseContrast050},a=function(e){var t=e.props,r=e.state,n=e.theme;return r.isDisabled?n.colors.baseContrast040:null!==t.button?n.colors.baseContrast100:n.colors.baseContrast070},s={styles:function(e){return{labelText:{marginInlineStart:2,display:"block",marginBottom:1,color:e.colors.baseContrast070,textTransform:"uppercase",fontSize:e.typography.fontSize,fontWeight:600},lightBackground:{borderRadius:8},description:{color:e.colors.baseContrast070,textTransform:"none",fontSize:e.typography.fontSize,lineHeight:"20px"},hint:{textTransform:"none"}}},select:{control:function(e){var t=e.props,n=e.state,o=e.theme;return{paddingInlineStart:1.5*o.spacing.base-1,borderWidth:1,borderRadius:8,background:n.isDisabled?o.colors.baseContrast015:o.colors.pageBackground,borderColor:i({state:n,props:t,theme:o}),boxShadow:n.menuIsOpen||n.isFocused?"0 0 0 4px ".concat(r({props:t,theme:o}),"33"):"unset","&:hover":{borderColor:r({props:t,theme:o}),background:o.colors.pageBackground}}},placeholder:function(e){var t=e.state,r=e.theme;return{color:o({state:t,theme:r})}},singleValue:function(e){var t=e.state,r=e.props,n=e.theme;return{color:a({state:t,props:r,theme:n})}},dropdownIndicator:function(e){var t=e.theme,r=e.state;return{paddingInlineEnd:t.spacing.base,"& svg":{fill:r.isDisabled?t.colors.baseContrast030:t.colors.baseContrast070,width:26,height:26,minHeight:26,minWidth:26}}},indicatorSeparator:function(e){var t=e.theme;return{background:e.state.isDisabled?t.colors.baseContrast030:t.colors.baseContrast040,width:1}},indicatorsContainer:function(e){var t=e.theme;return{"&& svg":{fill:e.state.isDisabled?t.colors.baseContrast050:t.colors.baseContrast070,"&:hover, &:focus-visible":{fill:t.colors.baseContrast080}}}},multiValue:function(e){var t=e.props,n=e.theme;return{background:e.state.isDisabled?n.colors.baseContrast030:r({props:t,theme:n},n.colors.baseContrast030),borderRadius:4}},multiValueLabel:function(e){var t=e.theme,r=e.state,i=e.props;return{color:n({state:r,theme:t,props:i}),marginInlineStart:2,"&:hover, &:focus-visible":{}}},multiValueRemove:function(e){var t=e.theme,r=e.state,i=e.props;return{background:"none",paddingLeft:4,paddingRight:4,color:n({state:r,theme:t,props:i}),"&:hover, &:focus-visible":{color:t.colors.baseContrast080,background:"none"}}},menu:function(e){var t=e.theme;return{color:t.colors.baseContrast070,borderRadius:4,background:t.colors.pageBackground,borderColor:t.colors.baseContrast010}},option:function(e){var t=e.theme,r=e.state;return{paddingInlineStart:2*t.spacing.base,background:r.isSelected?t.colors.baseContrast015:t.colors.baseContrast010,color:r.isDisabled?t.colors.baseContrast040:t.colors.baseContrast070,"&:hover, &:focus-visible":{borderColor:t.colors.baseContrast070,background:r.isDisabled?t.colors.baseContrast010:t.colors.baseContrast020}}},input:function(e){return{color:e.theme.colors.baseContrast070}}}};t.default=s},40037:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{submenu:{color:e.colors.baseContrast070},mainItem:{height:5*e.spacing.base,fontWeight:400,color:e.colors.baseContrast070,"&:hover":{color:e.colors.baseContrast070,background:e.colors.baseContrast015}},activeMainItem:{paddingInlineStart:3*e.spacing.base,border:"none"},active:{fontWeight:400,background:e.colors.primary,color:e.colors.themeBase,"&:hover":{background:e.colors.primary,color:e.colors.themeBase},"& svg":{fill:e.colors.themeBase}},subItem:{fontSize:16,height:5*e.spacing.base,"&:hover":{color:e.colors.baseContrast070,background:e.colors.baseContrast015}},subItemPadding:{paddingInlineStart:6.5*e.spacing.base},activeSubmenuItem:{"&, & a":{background:e.colors.primary,color:e.colors.themeBase,"&:hover":{background:e.colors.primary,color:e.colors.themeBase}}}}}}},21255:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{root:{borderRadius:8,minHeight:6*e.spacing.base},rootOpen:{marginTop:4*e.spacing.base,marginBottom:4*e.spacing.base},left:{insetInlineStart:4*e.spacing.base},right:{insetInlineEnd:4*e.spacing.base},button:{"& > label":{color:e.colors.baseContrast090,fontWeight:"bold"},"&:hover, &:focus-visible":{background:"".concat(e.colors.baseContrast090,"1A"),"& > label":{color:e.colors.baseContrast090}}}}}}},19295:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{default:{fill:e.colors.baseContrast060}}}}},49115:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(20801);function i(e){return i="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},i(e)}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={defaultProps:{border:["horizontal"]},styles:function(e){return{table:{borderWidth:1,borderColor:e.colors.baseContrast020,"& td":{borderWidth:1,borderColor:e.colors.baseContrast020}},striped:{"& tr":{"&:nth-child(even)":{background:e.colors.baseContrast010}}},highlightOnHover:{"& tr":{"&:hover":{background:"".concat(e.colors.primary,"1a")},"&:nth-child(even)":{"&:hover":{background:"".concat(e.colors.primary,"1a")}}}},thead:{fontWeight:400,fontSize:e.typography.fontSize},tbody:{fontSize:e.typography.fontSize,fontFamily:e.typography.fontFamily,"& td":{color:e.colors.baseContrast070}}}}}},14205:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{root:{borderWidth:1,borderColor:e.colors.baseContrast020,overflow:"hidden",textOverflow:"ellipsis",fontWeight:400,color:e.colors.baseContrast070,fontFamily:e.typography.fontFamily,background:e.colors.themeBase},sortIndicator:{margin:"1.2px 6px",borderWidth:4,borderBottomWidth:4,borderBottomColor:e.colors.baseContrast050},activeSortIndicator:{borderBottomColor:e.colors.baseContrast070}}}}},69300:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{indicator:{bottom:-1,height:2,background:e.colors.primary}}}}},9856:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r={defaultProps:{size:"small",color:"baseContrast020"},styles:function(e){return{root:{fontWeight:400,borderRadius:24,padding:[Math.floor(e.spacing.base/4),e.spacing.base]},compact:{fontSize:e.typography.fontSize,fontWeight:400},compactIcon:{paddingInlineEnd:0,"& svg":{width:18,height:18,minHeight:18,minWidth:18}},border:{padding:[Math.floor(e.spacing.base/4),e.spacing.base,Math.floor(e.spacing.base/4)-2]}}}};t.default=r},14868:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{label:{color:e.colors.baseContrast070,textTransform:"uppercase",fontSize:e.typography.fontSize,fontWeight:600,lineHeight:"20px",paddingBottom:e.spacing.base/2},description:{color:e.colors.baseContrast070,textTransform:"none",fontSize:e.typography.fontSize,lineHeight:"20px"},container:{background:e.colors.themeBase,fontSize:e.typography.fontSize+1,color:e.colors.baseContrast070,borderColor:e.colors.baseContrast040,borderRadius:8,borderWidth:1,"&:has(input:focus)":{borderColor:e.colors.primary,boxShadow:"0 0 0 4px ".concat(e.colors.primary,"33")},"&:has(input:hover)":{borderColor:e.colors.primary},"&:has(div:hover)":{borderColor:e.colors.primary}},inputContainer:{fontSize:e.typography.fontSize+1},input:{"&::placeholder":{color:e.colors.baseContrast050}},tag:{"& > span":{paddingTop:0}}}}}},92475:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(20801);function i(e){return i="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},i(e)}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(75634),i={styles:function(e){return{input:{padding:"".concat(e.spacing.base,"px ").concat(1.5*e.spacing.base,"px"),background:e.colors.themeBase,fontSize:e.typography.fontSize+1,color:e.colors.baseContrast070,borderColor:e.colors.baseContrast040,borderRadius:8,"&::placeholder":{color:e.colors.baseContrast050},"&:focus-visible":{borderColor:e.colors.primary,boxShadow:"0 0 0 4px ".concat(e.colors.primary,"33")},"&:hover":{borderColor:e.colors.primary},"&:disabled, &:disabled:hover":{background:e.colors.baseContrast015,color:e.colors.baseContrast040,borderColor:e.colors.baseContrast040,"&::placeholder":{color:e.colors.baseContrast040}},"&::-webkit-calendar-picker-indicator":{filter:n.vars.get("transparentFilter")}},preAndSuffix:{backgroundColor:e.colors.baseContrast020,color:e.colors.baseContrast070,borderColor:e.colors.baseContrast040},prefix:{borderEndStartRadius:"8px",borderStartStartRadius:"8px"},suffix:{borderEndEndRadius:"8px",borderStartEndRadius:"8px"},prefixSuffixValidity:{borderWidth:1},border:{borderWidth:1,borderColor:e.colors.baseContrast040,borderRadius:8},inputWithValue:{padding:"".concat(e.spacing.base,"px ").concat(1.5*e.spacing.base,"px"),borderWidth:1},inputWithValidValue:{borderLeftColor:e.colors.baseContrast040,borderRightColor:e.colors.baseContrast040,"&:hover":{borderColor:e.colors.primary},"& ~ span":{borderColor:e.colors.baseContrast040},"& ~ svg":{display:"none"},"&:focus-visible":{borderColor:e.colors.primary,boxShadow:"0 0 0 4px ".concat(e.colors.primary,"33"),"& ~ span":{borderColor:e.colors.primary},"& ~ svg":{display:"none"}}},inputWithInvalidValue:{"&:focus-visible":{borderColor:e.colors.alert,boxShadow:"0 0 0 4px ".concat(e.colors.alert,"33")},"&:hover":{borderColor:e.colors.alert}},label:{color:e.colors.baseContrast070,textTransform:n.vars.get("labelTextTransform","uppercase"),fontSize:n.vars.get("labelFontSize",e.typography.fontSize),fontWeight:600},description:{color:e.colors.baseContrast070,textTransform:"none",fontSize:e.typography.fontSize,lineHeight:"20px"},hint:{textTransform:"none"},icon:{"& svg":{fill:e.colors.baseContrast050}},disabledIcon:{"& svg":{fill:e.colors.baseContrast040}},inputHasPrefix:{borderInlineStartColor:e.colors.baseContrast040,"&:focus-visible":{borderInlineStartColor:e.colors.baseContrast040},"&:hover":{borderInlineStartColor:e.colors.baseContrast040}},inputHasSuffix:{borderInlineEndColor:e.colors.baseContrast040,"&:focus-visible":{borderInlineEndColor:e.colors.baseContrast040},"&:hover":{borderInlineEndColor:e.colors.baseContrast040}}}}};t.default=i},98372:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(49305),i={styles:function(e){return{checkbox:{"&:checked ~ $button:after":{insetInlineStart:16},"&:checked:not(:disabled)":{"& ~ $button":{backgroundColor:n.vars.get("checkboxColor"),"&::after":{backgroundColor:e.colors.textOnDark}}},"&:disabled:checked ~ $button":{backgroundColor:"color-mix(in srgb, ".concat(n.vars.get("checkboxColor"),", ").concat(e.colors.themeBase,")"),"&:after":{backgroundColor:"color-mix(in srgb, #fff 60%, ".concat(e.colors.themeBase,")"),opacity:.9}}},button:{backgroundColor:e.colors.baseContrast040,borderRadius:16,minWidth:32,minHeight:20,"&:after":{backgroundColor:e.colors.themeBase,width:16,height:16,insetInlineStart:2,top:2}},label:{color:e.colors.baseContrast070},root:{"&:hover $checkbox":{"&:checked:not(:disabled) ~ $button":{backgroundColor:n.vars.get("rootBackground")},"&:not(:disabled) ~ $button":{backgroundColor:e.colors.baseContrast050}}},description:{color:e.colors.baseContrast070,textTransform:"none"},hint:{textTransform:"none"}}}};t.default=i},86286:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.typography=t.spacing=t.sharedColors=t.isAlwaysNativeDropDownMenu=t.iconSizes=t.components=void 0;var n=B(r(58022)),i=B(r(60443)),o=B(r(84984)),a=B(r(35878)),s=B(r(88005)),l=B(r(38730)),c=B(r(22264)),u=B(r(49314)),d=B(r(24779)),h=B(r(20894)),p=B(r(11665)),f=B(r(48337)),m=B(r(11227)),g=B(r(17184)),v=B(r(84021)),y=B(r(18417)),b=B(r(60392)),_=B(r(86482)),S=B(r(45401)),w=B(r(72343)),E=B(r(17384)),C=B(r(58544)),O=B(r(43344)),P=B(r(40037)),T=B(r(21255)),k=B(r(19295)),R=B(r(49115)),A=B(r(50460)),D=B(r(14205)),I=B(r(69300)),x=B(r(9856)),M=B(r(14868)),L=B(r(92475)),j=B(r(76673)),N=B(r(98372)),F=r(61925);function B(e){return e&&e.__esModule?e:{default:e}}function U(e){return U="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},U(e)}function V(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}t.spacing={base:8},t.iconSizes={small:20,medium:24,large:32},t.sharedColors=function(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(46503),i=r(86286);function o(e){return o="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},o(e)}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=i(r(74219));function i(e){return e&&e.__esModule?e:{default:e}}var o={properties:{light:i(r(28635)).default,dark:n.default}};t.default=o},28635:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(46503),i=r(86286);function o(e){return o="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},o(e)}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{root:{borderRadius:24,borderColor:e.colors.baseContrast070}}}}},22785:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{wrapper:{borderRadius:12,borderWidth:0,background:e.colors.baseContrast020},label:{color:e.colors.baseContrast060,fontSize:e.typography.fontSize+1}}}}},96854:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{button:{borderRadius:12,borderInlineWidth:0,color:e.colors.baseContrast070,"& svg":{fill:e.colors.baseContrast070}},small:{height:4*e.spacing.base,padding:[e.spacing.base,1.5*e.spacing.base]},medium:{height:5*e.spacing.base,padding:[1.5*e.spacing.base,2*e.spacing.base]},large:{height:6*e.spacing.base,padding:[2*e.spacing.base,3*e.spacing.base]}}}}},80467:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(7393),i={styles:function(e){return{label:{fontSize:e.typography.fontSize+1,color:e.colors.baseContrast060},svg:{borderRadius:4,borderWidth:2,strokeWidth:3,stroke:(0,n.getContrastingTextColorHexString)(e.colors.primary,void 0,void 0,n.PRIMARY_CONTRAST_STANDARD),padding:3}}}};t.default=i},35864:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(20801);function i(e){return i="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},i(e)}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(46503),i={styles:function(e){return{small:{padding:2*e.spacing.base},title:{color:e.colors.baseContrast070,fontSize:e.typography.fontSize+2,fontWeight:"bold",letterSpacing:0,textTransform:"uppercase"},svgIcon:{width:20,height:20,minHeight:20,minWidth:20},content:{fontSize:e.typography.fontSize},actions:{marginTop:2*e.spacing.base},button:{"& label":{color:e.colors.baseContrast085},"&:last-child > label":{color:e.mode===n.ThemeMode.dark?e.colors.textOnLight:e.colors.textOnDark},"&:last-child":{background:e.mode===n.ThemeMode.dark?e.colors.textOnDark:e.colors.textOnLight,"&:hover, &:focus-visible":{background:e.colors.baseContrast070}}}}}};t.default=i},60567:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{bottom:{borderRadius:[2*e.spacing.base,2*e.spacing.base,0,0],borderColor:e.colors.baseContrast015,borderStyle:"solid",borderWidth:[1,1,0,1],paddingTop:0,"&::before":{content:'""',display:"flex",borderRadius:4,height:e.spacing.base/2,width:4*e.spacing.base,margin:[2.25*e.spacing.base,"auto"],backgroundColor:e.colors.baseContrast030}}}}}},29012:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{flatButton:{borderRadius:2,background:e.colors.themeBase,"&:hover":{background:e.colors.baseContrast010},"& label":{color:e.colors.baseContrast090},"& svg":{fill:e.colors.baseContrast090},"&:focus-visible":{background:e.colors.baseContrast010,"& label":{color:e.colors.baseContrast070},"& svg":{fill:e.colors.baseContrast070}}},label:{color:e.colors.baseContrast070,fontSize:e.typography.fontSize},list:{"ul&, & > ul":{paddingTop:e.spacing.base,paddingBottom:e.spacing.base,background:e.colors.themeBase}},option:{"li&":{paddingLeft:2*e.spacing.base,paddingRight:2*e.spacing.base,color:e.colors.baseContrast070,"&:hover, &:focus-visible":{background:e.colors.baseContrast010}}},modal:{borderColor:e.colors.baseContrast040,borderWidth:1,borderStyle:"solid",borderRadius:2}}}}},90381:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=r(20801),o=(n=r(50645))&&n.__esModule?n:{default:n};function a(e){return a="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},a(e)}function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{column:{"& [type='submit']":{marginTop:e.spacing.base}},row:{"& [type='submit']":{marginTop:3*e.spacing.base+1}}}}}},96715:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=(n=r(50645))&&n.__esModule?n:{default:n};function o(e){return o="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},o(e)}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{root:{borderRadius:4,backgroundColor:"".concat(e.colors.themeBase,"99"),fontWeight:600,padding:[0,e.spacing.base]},bug:{backgroundColor:e.colors.success,"&:after":{backgroundColor:e.colors.success}}}}}},35118:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(20801);function i(e){return i="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},i(e)}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=(n=r(8930))&&n.__esModule?n:{default:n},o={styles:function(e){return{defaultModalBoxStyles:{background:e.colors.pageBackground,borderColor:e.colors.baseContrast015,borderRadius:12,padding:3*e.spacing.base,boxShadow:"".concat((0,i.default)(e.colors.baseShadow,.5)," 0 2px 4px 0"),borderImageSource:"none"},small:{width:288,padding:3*e.spacing.base},medium:{width:560},defaultCloseButtonStyles:{backgroundColor:(0,i.default)(e.colors.baseShadow,.15),borderRadius:"100%",width:4*e.spacing.base,height:4*e.spacing.base,minHeight:4*e.spacing.base,minWidth:4*e.spacing.base,"&:hover":{backgroundColor:(0,i.default)(e.colors.baseShadow,.2)},"& svg":{fill:e.colors.baseContrast100,width:18,height:18,minHeight:18,minWidth:18}}}}};t.default=o},89383:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=(n=r(50645))&&n.__esModule?n:{default:n};function o(e){return o="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},o(e)}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:{root:{borderRadius:8}}}},81359:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={defaultProps:{hideTriangle:!0},styles:function(e){return{root:{"--background":e.colors.baseContrast010},content:{padding:e.spacing.base,borderStyle:"solid",borderWidth:1,borderColor:e.colors.baseContrast020,borderRadius:8},scroll:{"&::-webkit-scrollbar-thumb":{borderRadius:e.spacing.base,border:"solid 1px ".concat(e.colors.baseContrast020)},"&::-webkit-scrollbar-track":{backgroundColor:e.colors.baseContrast010,borderRadius:4}}}}}},92129:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(81351),i=r(7393),o={styles:function(e){return{root:{fontSize:e.typography.fontSize+1,color:e.colors.baseContrast060},rootDisabled:{color:e.colors.baseContrast040},input:{"&:checked + div":{backgroundColor:n.vars.get("checkedInputColor",e.colors.primary),"&:before":{backgroundColor:n.vars.get("checkedInputColor",(0,i.getContrastingTextColorHexString)(e.colors.primary,void 0,void 0,i.PRIMARY_CONTRAST_STANDARD))}},"&:checked:disabled + div":{borderColor:e.colors.baseContrast040,backgroundColor:e.colors.baseContrast040,"&:before":{backgroundColor:e.colors.baseContrast020}}},check:{border:"2px solid ".concat(e.colors.baseContrast060),background:"transparent"},disabled:{border:"2px solid ".concat(e.colors.baseContrast040),background:"transparent"}}}};t.default=o},15334:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(20801);function i(e){return i="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},i(e)}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t svg":{width:16,height:16,minHeight:16,minWidth:16}}}}};t.default=s},83668:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(41191),i={styles:function(e){return{root:{backgroundColor:n.vars.get("rootBackgroundColor",e.colors.baseContrast020)}}}};t.default=i},9522:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e){var t=e.state,r=e.theme;return t.isDisabled?r.colors.baseContrast050:t.isSelected?r.colors.baseContrast090:r.colors.baseContrast085},n=function(e){var t=e.state,r=e.props,n=e.theme;return r.errorText?n.colors.alert:"flat"===r.button?"transparent":t.menuIsOpen||t.isFocused?n.colors.baseContrast080:n.colors.baseContrast040},i=function(e){var t=e.state,r=e.theme;return t.isDisabled?r.colors.baseContrast030:r.colors.baseContrast050},o=function(e){return"light"===e.mode?e.colors.baseContrast080:e.colors.baseContrast060},a={styles:function(e){return{labelText:{color:e.colors.baseContrast060,fontSize:e.typography.fontSize+1},lightBackground:{borderRadius:4}}},select:{control:function(e){var t=e.state,r=e.props,i=e.theme;return{borderColor:n({state:t,props:r,theme:i}),borderWidth:1,borderRadius:4,fontSize:i.typography.fontSize+2,color:i.colors.baseContrast070,paddingInlineStart:1.5*i.spacing.base-1}},placeholder:function(e){var t=e.state,r=e.theme;return{color:i({state:t,theme:r})}},dropdownIndicator:function(e){var t=e.state,r=e.theme;return{"& svg":{fill:t.isDisabled?r.colors.baseContrast030:o(r)}}},menu:function(e){var t=e.theme;return{color:t.colors.baseContrast085,borderRadius:4,borderColor:t.colors.baseContrast010}},option:function(e){var t=e.theme,n=e.state;return{paddingInlineStart:2*t.spacing.base,background:n.isSelected?t.colors.baseContrast015:t.colors.baseContrast010,color:r({state:n,theme:t}),"&:hover, &:focus-visible":{borderColor:t.colors.active,background:t.colors.baseContrast020}}}}};t.default=a},48559:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=(n=r(8930))&&n.__esModule?n:{default:n},o={styles:function(e){return{mainItem:{boxSizing:"content-box",padding:4,background:e.colors.baseContrast015,fontWeight:400,fontSize:e.typography.fontSize+2,"&:hover":{background:"".concat(e.colors.baseContrast100,"1F")}},activeMainItem:{background:e.colors.baseContrast020,paddingLeft:3*e.spacing.base-2,fontWeight:600,borderLeft:{width:2}},disabledMainItem:{color:e.colors.baseContrast050,"&:hover":{color:e.colors.baseContrast050,background:"transparent"}},indicator:{fill:e.colors.baseContrast080},subItem:{background:e.colors.baseContrast015,"&:hover":{color:e.colors.baseContrast080}},activeSubmenuItem:{borderLeft:{width:0},"&, & a":{background:e.colors.baseContrast020,color:e.colors.baseContrast080,"&:hover, &:focus-visible":{background:"".concat(e.colors.baseContrast100,"1F"),color:(0,i.default)(e.colors.baseContrast080,.9)}}},disabledSubmenuItem:{color:e.colors.baseContrast040,"&:hover":{color:e.colors.baseContrast040}},menuItemLink:{boxSizing:"border-box",height:40}}}};t.default=o},21659:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(46503);function i(e){return i="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},i(e)}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(20801);function i(e){return i="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},i(e)}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t label":{fontWeight:"bold"},height:4*e.spacing.base,"& > svg":{height:e.iconSizes.small,width:e.iconSizes.small,minHeight:e.iconSizes.small,minWidth:e.iconSizes.small}}}}};t.default=s},61181:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={defaultProps:{fill:"baseContrast070"}}},16959:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=(n=r(62249))&&n.__esModule?n:{default:n},o={home:i.default.createElement("path",{d:"M19.7,9.1l-7.2-5c-.3-.2-.6-.2-.9,0l-7.2,5c-.3.2-.4.4-.4.7v7.5c0,1.5,1.2,2.7,2.8,2.7h10.5c1.5,0,2.8-1.2,2.8-2.8v-7.4c-.1-.3-.2-.5-.4-.7ZM11.7,12.8h.6c1.2,0,2.2,1,2.2,2.2v2.93h-5v-2.93c0-1.2,1-2.2,2.2-2.2Z"}),homeOutlined:i.default.createElement("path",{d:"M19.68,9.13l-7.25-5c-.26-.18-.6-.18-.85,0l-7.25,5c-.2.14-.32.37-.32.62v7.5c0,1.52,1.23,2.75,2.75,2.75h10.5c1.52,0,2.75-1.23,2.75-2.75v-7.5c0-.25-.12-.48-.32-.62h-.01ZM10.5,18.5v-2.75c0-.69.56-1.25,1.25-1.25h.5c.69,0,1.25.56,1.25,1.25v2.75h-3ZM18.5,17.25c0,.69-.56,1.25-1.25,1.25h-2.25v-2.75c0-1.52-1.23-2.75-2.75-2.75h-.5c-1.52,0-2.75,1.23-2.75,2.75v2.75h-2.25c-.69,0-1.25-.56-1.25-1.25v-7.11l6.5-4.48,6.5,4.48v7.11Z"}),search:i.default.createElement("path",{d:"M19.34,20.06c-.19,0-.38-.07-.53-.22l-3.8-3.78c-1.2.97-2.73,1.55-4.39,1.55-3.86,0-7-3.14-7-7s3.14-7,7-7,7,3.14,7,7c0,1.66-.58,3.19-1.55,4.39l3.8,3.78c.29.29.29.77,0,1.06-.15.15-.34.22-.53.22ZM10.63,5.11c-3.03,0-5.5,2.47-5.5,5.5s2.47,5.5,5.5,5.5,5.5-2.47,5.5-5.5-2.47-5.5-5.5-5.5Z"}),videoLibraryClapper:i.default.createElement("g",null,i.default.createElement("path",{d:"M17.4362 2H6.42953C4.01342 2 2 4.01342 2 6.42953V17.5705C2 19.9866 4.01342 22 6.42953 22H17.5705C19.9866 22 22 19.9866 22 17.5705V6.42953C22 4.01342 19.9866 2 17.5705 2H17.4362ZM12.0671 4.01342L14.349 7.36913H10.9933L8.71141 4.01342H12.0671ZM4.01342 6.42953C4.01342 5.08725 5.08725 4.14765 6.2953 4.01342L8.57718 7.36913H4.01342V6.2953V6.42953ZM19.8523 17.4362C19.8523 18.7785 18.7785 19.8523 17.4362 19.8523H6.42953C5.08725 19.8523 4.01342 18.7785 4.01342 17.4362V9.38255H19.8523V17.4362ZM19.8523 7.36913H16.8993L14.6174 4.01342H17.5705C18.9128 4.01342 19.9866 5.08725 19.9866 6.42953V7.50336L19.8523 7.36913Z"}),i.default.createElement("path",{d:"M10.8591 17.302L14.6174 14.7517C14.7517 14.6175 14.7517 14.349 14.6174 14.2148L10.8591 11.6645C10.7248 11.5302 10.3221 11.5302 10.1879 11.6645C10.1879 11.6645 10.1879 11.6645 10.1879 11.7987V17.1678V17.302C10.3221 17.4363 10.7248 17.302 10.8591 17.302Z"}))};t.default=o},86717:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(20801);function i(e){return i="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},i(e)}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={defaultProps:{border:"none"},styles:function(e){return{table:{"& th":{background:"none"}},striped:{"& tr":{"&:nth-child(even)":{"&:hover":{background:e.colors.baseContrast030}}}},thead:{"& th":{background:"none",borderBottom:"1px solid",borderBottomColor:e.colors.baseContrast020,fontSize:e.typography.fontSize+2}},tbody:{fontSize:e.typography.fontSize,"& td":{fontSize:e.typography.fontSize}},sortIndicator:{margin:"1.2px 6px",borderWidth:4,borderBottomWidth:4,borderBottomColor:e.colors.baseContrast050},activeSortIndicator:{borderBottomColor:e.colors.baseContrast070}}}}},80355:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{root:{background:"none",borderBottom:"1px solid",borderBottomColor:e.colors.baseContrast020,fontSize:e.typography.fontSize+2},sortIndicator:{margin:"1.2px 6px",borderWidth:4,borderBottomWidth:4,borderBottomColor:e.colors.baseContrast050},activeSortIndicator:{borderBottomColor:e.colors.baseContrast070}}}}},19638:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{root:{borderBottomColor:e.colors.baseContrast030},indicator:{bottom:-1,height:2,background:e.colors.primary}}}}},36058:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{root:{padding:[e.spacing.base/4,e.spacing.base/2],borderRadius:4},icon:{paddingInlineStart:e.spacing.base/2,paddingInlineEnd:0},close:{paddingInlineStart:0,paddingInlineEnd:e.spacing.base/2},compactIcon:{paddingInlineEnd:0},translucent:{backgroundColor:"".concat(e.colors.themeBase,"4D")}}}}},71101:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=r(20801),o=(n=r(37769))&&n.__esModule?n:{default:n};function a(e){return a="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},a(e)}function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(75634),i={styles:function(e){return{input:{borderRadius:4,padding:"".concat(e.spacing.base,"px ").concat(1.5*e.spacing.base,"px"),fontSize:e.typography.fontSize+2,borderColor:e.colors.baseContrast020,"&::placeholder":{color:e.colors.baseContrast050},"&:focus-visible":{borderColor:e.colors.baseContrast080,boxShadow:"none"}},preAndSuffix:{borderColor:e.colors.baseContrast030,backgroundColor:e.colors.baseContrast020,color:e.colors.baseContrast100},prefix:{borderEndStartRadius:"4px",borderStartStartRadius:"4px"},suffix:{borderEndEndRadius:"4px",borderStartEndRadius:"4px"},prefixSuffixValidity:{borderWidth:1},border:{borderRadius:4,borderWidth:1,borderColor:e.colors.baseContrast030},inputWithValue:{padding:"".concat(e.spacing.base,"px ").concat(1.5*e.spacing.base,"px"),borderWidth:1},inputWithValidValue:{"&:focus-visible":{borderColor:e.colors.success}},inputWithInvalidValue:{"&:focus-visible":{borderColor:e.colors.alert}},label:{color:e.colors.baseContrast060,fontSize:n.vars.get("labelFontSize",e.typography.fontSize+1)},icon:{"& > svg":{fill:e.colors.baseContrast050}},inputHasPrefix:{borderInlineStartColor:e.colors.baseContrast080,"&:focus-visible":{borderInlineStartColor:e.colors.baseContrast080}},inputHasSuffix:{borderInlineEndColor:e.colors.baseContrast080,"&:focus-visible":{borderInlineEndColor:e.colors.baseContrast080}}}}};t.default=i},28706:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{checkbox:{"&:checked ~ $button:after":{insetInlineStart:16},"&:checked:not(:disabled)":{"& ~ $button":{backgroundColor:e.colors.primary,"&::after":{backgroundColor:e.colors.textOnDark}}},"&:disabled":{"& ~ $button":{backgroundColor:e.colors.baseContrast040,"&:after":{backgroundColor:e.colors.baseContrast070}}},"&:disabled:checked ~ $button":{backgroundColor:"color-mix(in srgb, ".concat(e.colors.primary,", ").concat(e.colors.themeBase,")"),"&:after":{backgroundColor:"color-mix(in srgb, #fff 60%, ".concat(e.colors.themeBase,")"),opacity:.9}}},button:{boxSizing:"border-box",borderRadius:16,backgroundColor:e.colors.baseContrast030,minWidth:32,minHeight:20,"&:after":{backgroundColor:e.colors.textOnDark,width:16,height:16,insetInlineStart:2,top:2}},label:{color:e.colors.baseContrast060,fontSize:15}}}}},58172:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.streamfansTypography=t.streamfansSpacing=t.streamfansSharedColors=t.streamfansIconSizes=t.streamfansComponents=t.isAlwaysNativeDropDownMenu=void 0;var n=N(r(67572)),i=N(r(22785)),o=N(r(96854)),a=N(r(80467)),s=N(r(35864)),l=N(r(85098)),c=N(r(60567)),u=N(r(29012)),d=N(r(90381)),h=N(r(81996)),p=N(r(96715)),f=N(r(57466)),m=N(r(35118)),g=N(r(47399)),v=N(r(89383)),y=N(r(4948)),b=N(r(81359)),_=N(r(92129)),S=N(r(15334)),w=N(r(83668)),E=N(r(9522)),C=N(r(48559)),O=N(r(21659)),P=N(r(83521)),T=N(r(61181)),k=N(r(86717)),R=N(r(30126)),A=N(r(80355)),D=N(r(19638)),I=N(r(36058)),x=N(r(71101)),M=N(r(96027)),L=N(r(28706)),j=r(61925);function N(e){return e&&e.__esModule?e:{default:e}}function F(e){return F="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},F(e)}function B(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}t.streamfansSharedColors=function(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=r(46503),o=r(58172),a=(n=r(16959))&&n.__esModule?n:{default:n};function s(e){return s="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},s(e)}function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=i(r(59769));function i(e){return e&&e.__esModule?e:{default:e}}var o={properties:{light:i(r(38121)).default,dark:n.default}};t.default=o},38121:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=r(46503),o=r(58172),a=(n=r(16959))&&n.__esModule?n:{default:n};function s(e){return s="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},s(e)}function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{root:{borderRadius:4,borderColor:e.colors.baseContrast070},email:{borderColor:e.colors.baseContrast030}}}}},26642:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{wrapper:{borderRadius:4,borderWidth:1,borderColor:e.colors.baseContrast020},label:{color:e.colors.baseContrast085,fontSize:14},hint:{fontSize:12}}}}},74197:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{button:{borderRadius:"inherit",borderInlineWidth:0,color:e.colors.baseContrast070,"& svg":{fill:e.colors.baseContrast070},"&:hover":{background:e.colors.baseContrast015}},labelButton:{borderRadius:4,"&:first-child":{borderTopLeftRadius:0,borderBottomLeftRadius:0},"&:last-child":{borderTopRightRadius:0,borderBottomRightRadius:0}},input:{"&:checked + span":{color:e.colors.baseContrast100,background:e.colors.baseContrast015}},small:{height:4*e.spacing.base,padding:[e.spacing.base,1.5*e.spacing.base]},medium:{height:5*e.spacing.base,padding:[1.5*e.spacing.base,2*e.spacing.base]},large:{height:6*e.spacing.base,padding:[2*e.spacing.base,3*e.spacing.base]}}}}},39402:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{label:{fontSize:14},labelText:{color:e.colors.baseContrast085},hint:{fontSize:12},svg:{stroke:e.colors.textOnDark},input:{"& + label svg":{borderWidth:1,padding:1}}}}}},47861:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(20801);function i(e){return i="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},i(e)}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{title:{color:e.colors.baseContrast070},defaultDialogBoxStyles:{borderRadius:8}}}}},42682:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{bottom:{borderColor:e.colors.baseContrast015,"&::before":{backgroundColor:e.colors.baseContrast030}}}}}},4737:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{flatButton:{background:e.colors.themeBase,"&:hover":{background:e.colors.baseContrast010},"& label":{color:e.colors.baseContrast090},"& svg":{fill:e.colors.baseContrast090},"&:focus-visible":{background:e.colors.baseContrast010,"& label":{color:e.colors.baseContrast070},"& svg":{fill:e.colors.baseContrast070}}},label:{color:e.colors.baseContrast070},list:{"ul&, & > ul":{background:e.colors.themeBase}},option:{"li&":{color:e.colors.baseContrast070,"&:hover, &:focus-visible":{background:e.colors.baseContrast010}}},modal:{borderColor:e.colors.baseContrast040}}}}},47200:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{root:{borderRadius:4,padding:[0,1.5*e.spacing.base],minWidth:10*e.spacing.base},ghost:{backgroundColor:"transparent",borderColor:e.colors.baseContrast030,"&:disabled":{color:e.colors.baseContrast040,"&& svg":{fill:e.colors.baseContrast040}}}}}}},74250:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=(n=r(50645))&&n.__esModule?n:{default:n};function o(e){return o="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},o(e)}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{root:{borderRadius:4,backgroundColor:"".concat(e.colors.themeBase,"99"),fontWeight:600,padding:[0,e.spacing.base]},bug:{backgroundColor:e.colors.success,"&:after":{backgroundColor:e.colors.success}}}}}},34463:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(20801);function i(e){return i="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},i(e)}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=(n=r(8930))&&n.__esModule?n:{default:n},o={styles:function(e){return{defaultModalBoxStyles:{background:e.colors.pageBackground,borderColor:e.colors.baseContrast015,boxShadow:"".concat((0,i.default)(e.colors.baseShadow,.5)," 0 2px 4px 0"),borderRadius:8,borderImageSource:"none"},defaultCloseButtonStyles:{borderRadius:4,backgroundColor:(0,i.default)(e.colors.baseShadow,.15),"&:hover":{backgroundColor:(0,i.default)(e.colors.baseShadow,.2)}}}}};t.default=o},93284:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=(n=r(50645))&&n.__esModule?n:{default:n};function o(e){return o="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},o(e)}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:{pageChanger:{borderRadius:4}}}},81092:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={defaultProps:{hideTriangle:!0},styles:function(e){return{root:{"--background":e.colors.baseContrast010},content:{borderRadius:4,borderColor:e.colors.baseContrast020},scroll:{"&::-webkit-scrollbar-thumb":{border:"solid 1px ".concat(e.colors.baseContrast020)},"&::-webkit-scrollbar-track":{backgroundColor:e.colors.baseContrast010}}}}}},34398:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(81351),i={styles:function(e){return{root:{fontSize:14,color:e.colors.baseContrast085},rootDisabled:{color:e.colors.baseContrast040},input:{"&:checked + div":{backgroundColor:n.vars.get("checkedInputColor",e.colors.primary),"&:before":{backgroundColor:e.colors.textOnDark}},"&:checked:disabled + div":{borderColor:e.colors.baseContrast040,backgroundColor:e.colors.baseContrast040,"&:before":{backgroundColor:e.colors.baseContrast020}}},hint:{fontSize:12},check:{border:"1px solid ".concat(e.colors.baseContrast060),background:"transparent"},disabled:{border:"2px solid ".concat(e.colors.baseContrast040),background:"transparent"}}}};t.default=i},68495:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{root:{borderRadius:4,boxShadow:""},veryLong:{padding:[0,.5*e.spacing.base+2]},labelWidth:{minWidth:10*e.spacing.base}}}}},20713:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(41191),i={styles:function(e){return{root:{backgroundColor:n.vars.get("rootBackgroundColor",e.colors.baseContrast020)}}}};t.default=i},70551:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e){var t=e.state,r=e.theme;return t.isDisabled?r.colors.baseContrast050:t.isSelected?r.colors.baseContrast090:r.colors.baseContrast085},n=function(e){var t=e.state,r=e.props,n=e.theme;return r.errorText?n.colors.alert:"flat"===r.button?"transparent":t.menuIsOpen||t.isFocused?n.colors.baseContrast080:n.colors.baseContrast030},i=function(e){var t=e.state,r=e.theme;return t.isDisabled?r.colors.baseContrast030:r.colors.baseContrast050},o=function(e){return"light"===e.mode?e.colors.baseContrast080:e.colors.baseContrast060},a={styles:function(e){return{labelText:{fontSize:14,color:e.colors.baseContrast060},hint:{fontSize:12}}},select:{control:function(e){var t=e.state,r=e.props,i=e.theme;return{borderRadius:4,borderColor:n({state:t,props:r,theme:i}),color:i.colors.baseContrast070}},placeholder:function(e){var t=e.state,r=e.theme;return{color:i({state:t,theme:r})}},dropdownIndicator:function(e){var t=e.state,r=e.theme;return{"& svg":{fill:t.isDisabled?r.colors.baseContrast030:o(r)}}},menu:function(e){var t=e.theme;return{borderRadius:4,color:t.colors.baseContrast085,borderColor:t.colors.baseContrast010,backgroundColor:t.colors.baseContrast010}},option:function(e){var t=e.theme,n=e.state;return{background:n.isSelected?t.colors.baseContrast015:t.colors.baseContrast010,color:r({state:n,theme:t}),borderRadius:4,"&:hover, &:focus-visible":{borderColor:t.colors.active,background:t.colors.baseContrast020}}}}};t.default=a},53236:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=(n=r(8930))&&n.__esModule?n:{default:n},o={styles:function(e){return{mainItem:{"&:hover":{background:"".concat(e.colors.baseContrast100,"1F")}},disabledMainItem:{color:e.colors.baseContrast050,"&:hover":{color:e.colors.baseContrast050,background:"transparent"}},indicator:{fill:e.colors.baseContrast080},subItem:{background:e.colors.baseContrast015,"&:hover":{color:e.colors.baseContrast080}},activeSubmenuItem:{"&, & a":{background:e.colors.baseContrast020,color:e.colors.baseContrast080,"&:hover, &:focus-visible":{background:"".concat(e.colors.baseContrast100,"1F"),color:(0,i.default)(e.colors.baseContrast080,.9)}}},disabledSubmenuItem:{color:e.colors.baseContrast040,"&:hover":{color:e.colors.baseContrast040}}}}};t.default=o},49618:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(46503);function i(e){return i="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},i(e)}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(20801);function i(e){return i="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},i(e)}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t label":{fontWeight:"bold"},height:4*e.spacing.base,"& > svg":{height:e.iconSizes.small,width:e.iconSizes.small,minHeight:e.iconSizes.small,minWidth:e.iconSizes.small}}}}};t.default=s},27902:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={defaultProps:{fill:"baseContrast070"}}},6498:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(20801);function i(e){return i="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},i(e)}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={defaultProps:{border:"none"},styles:function(e){return{thead:{"& th":{background:"none",borderBottom:"1px solid",borderBottomColor:e.colors.baseContrast020}},tbody:{fontSize:e.typography.fontSize,"& tr":{"&:hover":{background:e.colors.baseContrast020}}},sortIndicator:{borderBottomColor:e.colors.baseContrast050},activeSortIndicator:{borderBottomColor:e.colors.baseContrast070}}}}},40952:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{root:{background:"none",borderBottomColor:e.colors.baseContrast020},sortIndicator:{borderBottomColor:e.colors.baseContrast050},activeSortIndicator:{borderBottomColor:e.colors.baseContrast070}}}}},17975:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{root:{borderBottomColor:e.colors.baseContrast030},indicator:{background:e.colors.primary}}}}},3795:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{label:{fontSize:14},container:{borderRadius:4},input:{color:e.colors.textOnLight}}}}},15292:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=r(20801),o=(n=r(37769))&&n.__esModule?n:{default:n};function a(e){return a="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},a(e)}function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{input:{borderRadius:4,borderColor:e.colors.baseContrast030,"&::placeholder":{color:e.colors.baseContrast050},"&:focus-visible":{boxShadow:"none"}},border:{borderRadius:4},preAndSuffix:{borderColor:e.colors.baseContrast030},prefix:{borderStartStartRadius:4,borderEndStartRadius:4},suffix:{borderEndEndRadius:4,borderStartEndRadius:4},label:{fontSize:14,color:e.colors.baseContrast085},hint:{fontSize:12},icon:{"& > svg":{fill:e.colors.baseContrast050}}}}}},75755:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={styles:function(e){return{checkbox:{"&:checked:not(:disabled)":{"& ~ $button":{backgroundColor:e.colors.primary,"&::after":{backgroundColor:e.colors.textOnDark}}},"&:disabled":{"& ~ $button":{backgroundColor:e.colors.baseContrast040,"&:after":{backgroundColor:e.colors.baseContrast070}}},"&:disabled:checked ~ $button":{backgroundColor:"color-mix(in srgb, ".concat(e.colors.primary,", ").concat(e.colors.themeBase,")"),"&:after":{backgroundColor:"color-mix(in srgb, #fff 60%, ".concat(e.colors.themeBase,")"),opacity:.9}}},label:{fontSize:14,color:e.colors.baseContrast085},hint:{fontSize:12},button:{"&:after":{backgroundColor:e.colors.textOnDark,border:"1px solid ".concat(e.colors.baseContrast020)}}}}}},90857:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.themedComponents=void 0;var n=L(r(30157)),i=L(r(26642)),o=L(r(74197)),a=L(r(39402)),s=L(r(47861)),l=L(r(79267)),c=L(r(42682)),u=L(r(4737)),d=L(r(47200)),h=L(r(74250)),p=L(r(57093)),f=L(r(34463)),m=L(r(27612)),g=L(r(93284)),v=L(r(27379)),y=L(r(81092)),b=L(r(34398)),_=L(r(68495)),S=L(r(20713)),w=L(r(70551)),E=L(r(53236)),C=L(r(49618)),O=L(r(2240)),P=L(r(27902)),T=L(r(6498)),k=L(r(2433)),R=L(r(40952)),A=L(r(17975)),D=L(r(3795)),I=L(r(15292)),x=L(r(3616)),M=L(r(75755));function L(e){return e&&e.__esModule?e:{default:e}}t.themedComponents={AuthButton:n.default,ButtonGroup:i.default,ButtonGroupItem:o.default,Checkbox:a.default,Chip:s.default,Dialog:l.default,Drawer:c.default,DropDownMenu:u.default,FlatButton:d.default,IconButton:h.default,LiveBug:p.default,MessageBar:f.default,Modal:m.default,Nav:g.default,Pagination:v.default,Popover:y.default,RadioButton:b.default,RaisedButton:_.default,ReactionSelector:S.default,Select:w.default,SideMenuSubmenu:E.default,Slider:C.default,Snackbar:O.default,SvgIcon:P.default,Tab:T.default,Table:k.default,TableHeader:R.default,Tabs:A.default,TagInput:D.default,Text:I.default,TextInput:x.default,Toggle:M.default}},41354:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=i(r(59260));function i(e){return e&&e.__esModule?e:{default:e}}var o={properties:{light:i(r(4962)).default,dark:n.default}};t.default=o},97432:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isBrowser=void 0,t.isBrowser="undefined"!=typeof window},50018:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getOpacityPercentage=t.default=void 0;var n,i=(n=r(8930))&&n.__esModule?n:{default:n},o=t.getOpacityPercentage=function(e){if("number"==typeof e||e){var t=Number(e);return isNaN(t)?e:t>1?t/100:t}};t.default=function(e,t){if(!e||void 0===t)return e;var r=o(t);return void 0===r?e:(0,i.default)(e,r)}},78047:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isAnyAnimation=t.isAnimation=void 0;var r=t.isAnimation=function(e,t){return e.animationName.includes(t)};t.isAnyAnimation=function(e,t){for(var n=0,i=t.length;n{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createParticle=void 0;var r=function(e){e.target.effect.target.remove()};t.createParticle=function(e,t,n){var i=document.createElement("particle");i.innerHTML=e,i.style.fontSize="".concat(34*Math.random(),"px");var o=70*(Math.random()-.5),a=-90*(Math.random()+.5),s=520*Math.random();document.body.appendChild(i),i.animate([{transform:"translate(-50%, -50%) translate(".concat(t,"px, ").concat(n,"px) rotate(0deg)"),opacity:1},{transform:"translate(-50%, -50%) translate(".concat(t+o,"px, ").concat(n+a,"px) rotate(").concat(s,"deg)"),opacity:0}],{easing:"cubic-bezier(0, .9, .57, 1)",duration:1e3*Math.random()+400,delay:200*Math.random()}).onfinish=r}},84877:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.placementDirection=t.oppositeDirectionOf=t.TOP=t.RIGHT=t.LEFT=t.BOTTOM=void 0;var n=r(46503);function i(e){return i="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},i(e)}function o(e,t,r){var n;return n=function(e,t){if("object"!=i(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==i(n)?n:n+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var a=t.TOP="top",s=t.BOTTOM="bottom",l=t.LEFT="left",c=t.RIGHT="right",u=t.oppositeDirectionOf=o(o(o(o({},a,s),s,a),l,c),c,l);t.placementDirection=function(e,t){return e===a||e===s?e:t===n.Direction.rtl?u[e]:e}},65253:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shortenNumber=void 0;var r=function(e){return(new Intl.NumberFormat).format(Math.round(10*e)/10)};t.shortenNumber=function(e){return e>=1e6?r(e/1e6)+"M":e>=1e3?r(e/1e3)+"k":r(e)}},26789:(e,t)=>{"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&void 0!==arguments[1]?arguments[1]:n.ASCEND;return function(r,i){var o=r[e],a=i[e];return void 0===o||void 0===a?0:"number"==typeof o&&"number"==typeof a?function(e,t,r){return r===n.ASCEND?e-t:t-e}(o,a,t):function(e,t,r){return et?r===n.ASCEND?1:-1:0}(o.toString().toLowerCase(),a.toString().toLowerCase(),t)}}(t,i)),a}},53120:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createTheme=t.applyThemeSettings=t.THEME_WRAPPER_CLASS=void 0;var n,i=r(27321),o=(n=r(63955))&&n.__esModule?n:{default:n},a=r(46503);function s(e){return s="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},s(e)}function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(82239);t.default=function(e){var t=(0,n.useTheme)();return e&&function(e,t){return e in t}(e,t.colors)?t.colors[e]:e}},30881:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.isTouchEvent=t.default=void 0;var i=r(62249);function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e,t,r){var i;return i=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,"string");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==n(i)?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&void 0!==arguments[1]?arguments[1]:{},h=d.delay,p=void 0===h?300:h,f=d.shouldPreventDefault,m=void 0===f||f,g=(t=(0,i.useState)(!1),r=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,c=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(t,r)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(e,t):void 0}}(t,r)||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.")}()),v=g[0],y=g[1],b=(0,i.useRef)(),_=(0,i.useRef)(),S=(0,i.useCallback)((function(e){var t=e;if(c(t)||0===t.button){e.persist();var r=function(e){for(var t=1;t1&&void 0!==arguments[1])||arguments[1];b.current&&clearTimeout(b.current),t&&!v&&u&&u(e),y(!1),m&&_.current&&_.current.removeEventListener("touchend",l)}),[m,u,v]);return{onMouseDown:function(e){return S(e)},onTouchStart:function(e){return S(e)},onMouseUp:function(e){return w(e)},onMouseLeave:function(e){return w(e,!1)},onTouchEnd:function(e){return w(e)}}}},64621:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.warning=t.default=void 0;var r=t.warning=function(e,t){e||console.warn(t)};t.default=r},50543:(e,t,r)=>{e.exports={EventEmitter:r(37007)}},82837:(e,t,r)=>{"use strict";e.exports=r(97389)},97389:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LoggerCore=void 0;const n=r(31635);n.__exportStar(r(16654),t);var i=r(71281);Object.defineProperty(t,"LoggerCore",{enumerable:!0,get:function(){return i.LoggerCore}}),n.__exportStar(r(17916),t)},71281:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LoggerCore=void 0;const n=r(31635),i=r(16654),o=n.__importDefault(r(4665)),a=r(37007),s=r(17916),l=r(37855),c=e=>{},u=new WeakMap;function d(e,...t){for(const r of t){if("object"!=typeof r||Array.isArray(r)){console.error("Invalid logger data:",r);continue}if((0,i.isSerializableObject)(r)){d(e,r.toJSON());continue}const{aggregates:t}=r,o=n.__rest(r,["aggregates"]);if("object"==typeof t)for(const[r,n]of Object.entries(t))e.aggregates[r]=n;for(const[t,r]of Object.entries(o))e[t]=null==r?r:JSON.parse(JSON.stringify(r))}}t.LoggerCore=class{constructor(e){this.debug=c,this.deprecated=c,this.error=c,this.fatal=c,this.info=c,this.local=c,this.network=c,this.notice=c,this.timing=c,this.trace=c,this.warn=c,this.packageContext={meta:{}},this.messageContext={},this.attachedObjects=new Set,this.emitter=new a.EventEmitter,this.printer={},this.lastLogged={},this.name=e,this.packageContext.meta={package:this.name},this.httpWriter=new s.LoggerGlobal,this.httpWriter.registerPackage(this),this.proxyingToEmitter=!1,this.debugLogger=(0,o.default)(this.name),i.LEVELS.forEach((e=>{this[e]=this.log.bind(this,e),this.printer[e]=this.printLog.bind(this,e)}))}flush(){this.httpWriter.send()}attachObject(e){return e.on("disposed",(()=>{this.attachedObjects.delete(e)})),this.attachedObjects.add(e),this}setMessageAggregate(e,t){return void 0===t?this.removeMessageAggregate(e):(null==this.messageContext.aggregates?this.messageContext.aggregates={[e]:t}:this.messageContext.aggregates[e]=t,this)}appendChain(e){var t,r;let n=0;u.has(e)&&(n=u.get(e)+1);const i=null!==(r=null===(t=this.messageContext.aggregates)||void 0===t?void 0:t.chain)&&void 0!==r?r:"",o=""===i?`${e.displayName}#${n}`:`${i}:${e.displayName}#${n}`;return this.setMessageAggregate("chain",o),u.set(e,n),this}removeMessageAggregate(e){return null!=this.messageContext.aggregates&&null!=this.messageContext.aggregates[e]&&(delete this.messageContext.aggregates[e],0===Object.keys(this.messageContext.aggregates).length&&delete this.messageContext.aggregates),this}clearMessageAggregates(){return this.messageContext={},this}setLoggerAggregate(e,t){return null==this.packageContext.aggregates?this.packageContext.aggregates={[e]:t}:this.packageContext.aggregates[e]=t,this}setLoggerMeta(e,t){return null==this.packageContext.meta?this.packageContext.meta={[e]:t,package:this.name}:this.packageContext.meta[e]=t,this}getLoggerMeta(e){var t;if((null===(t=this.packageContext)||void 0===t?void 0:t.meta)&&null!=this.packageContext.meta[e])return this.packageContext.meta[e]}log(e,t,r){var n,i;null===(i=null===(n=this.printer)||void 0===n?void 0:n[e])||void 0===i||i.call(n,t,r,this.messageContext.aggregates);const[o,a]=this.handleLogData(t,r,!0),s=Object.assign({message:`${o}`,level:"trace"===e?"debug":e,time:(new Date).toISOString()},a);this.httpWriter.add(s,this),this.proxyingToEmitter&&this.emitter.emit(e,t,a)}throttledLog(e,t,r,n){var i;(null==this.lastLogged[r]||Date.now()-(null!==(i=this.lastLogged[r])&&void 0!==i?i:0)>t)&&(this.lastLogged[r]=Date.now(),this.log(e,r,n))}handleLogData(e,t,r=!1){var n,o,a;let s="";null!=t||(t={}),e instanceof Error?(s=e.message,(0,i.isSerializableObject)(e)?t.err=e:t.err={message:e.message,name:e.name,stack:e.stack}):s=e;let l={aggregates:{}};try{d(l,{aggregates:this.packageContext.aggregates},{aggregates:this.messageContext.aggregates},t,...this.attachedObjects)}catch(t){const i=`logging data were dropped because it's not serializable; log message: ${e}; error: ${t};`;r&&this.printLog("error",i),l={aggregates:{chain:null===(n=l.aggregates)||void 0===n?void 0:n.chain,contextId:null===(o=l.aggregates)||void 0===o?void 0:o.contextId,instanceId:null===(a=l.aggregates)||void 0===a?void 0:a.instanceId},__logging_error__:i}}return[s,l]}printLog(e,t,r){var n,i,o,a,s,c,u,d,h,p,f;const[m,g]=this.handleLogData(t,r);switch(e){case"warn":case"error":"undefined"!=typeof navigator&&"ReactNative"===navigator.product?console[e](`${null!==(i=null===(n=g.aggregates)||void 0===n?void 0:n.chain)&&void 0!==i?i:""} ${m}`,g):"undefined"!=typeof window&&"function"==typeof(null===(o=window.console)||void 0===o?void 0:o.error)?window.console[e](`%c ${null!==(s=null===(a=g.aggregates)||void 0===a?void 0:a.chain)&&void 0!==s?s:""} ${m}`,l.browserStyles[e],[g]):this.debugLogger(`%c ${null!==(u=null===(c=g.aggregates)||void 0===c?void 0:c.chain)&&void 0!==u?u:""} ${m}`,l.browserStyles[e],[g]);break;default:"undefined"!=typeof navigator&&"ReactNative"===navigator.product?console.log(`${null!==(h=null===(d=g.aggregates)||void 0===d?void 0:d.chain)&&void 0!==h?h:""} ${m}`,g):this.debugLogger(`%c ${null!==(f=null===(p=g.aggregates)||void 0===p?void 0:p.chain)&&void 0!==f?f:""} ${m}`,l.browserStyles[e],[g])}}proxyToEmitter(e,t){for(const r of t)this.emitter.on(r,((t,n)=>{e.emit(r,t,n)}));this.proxyingToEmitter=!0}extend(e){var t,r,n;if(null!=(null===(t=null==e?void 0:e.messageContext)||void 0===t?void 0:t.aggregates))for(const[t,r]of Object.entries(e.messageContext.aggregates))this.setMessageAggregate(t,r);if(null!=(null===(r=null==e?void 0:e.packageContext)||void 0===r?void 0:r.aggregates))for(const[t,r]of Object.entries(e.packageContext.aggregates))this.setLoggerAggregate(t,r);if(null!=(null===(n=null==e?void 0:e.packageContext)||void 0===n?void 0:n.meta))for(const[t,r]of Object.entries(e.packageContext.meta))this.setLoggerMeta(t,r);return this}destroy(){this.flush(),this.httpWriter.removePackage(this)}}},17916:(e,t,r)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.LoggerGlobal=void 0;const i=r(31635),o=r(50543),a=r(16654),s=i.__importDefault(r(25858)),l=i.__importDefault(r(70644)),c=i.__importDefault(r(37589)),u=r(83442),d=r(61332),h=null!==(n=globalThis)&&void 0!==n?n:function(){return this}(),p={maxRequestSize:1048576,level:"warn",limit:500,interval:3e4};class f extends o.EventEmitter{constructor(){if(super(),this.options=p,this.storage=[],this.packageContextStorage=[],this.globalContext={meta:{userAgent:"undefined"!=typeof navigator?navigator.userAgent:"unknown",referrer:"undefined"!=typeof document?document.referrer:"unknown",source:"client",logId:(0,d.uuidv4)(),loggerVer:l.default.version}},this.watchTimeout=null,this.loggers=[],this.online=!0,this.throttleSend=(0,s.default)(this.send,5e3),h.LivelyHttpWriterV4)return h.LivelyHttpWriterV4;h.LivelyHttpWriterV4=this,null!=h.addEventListener&&(h.addEventListener("unload",(()=>this.send())),h.addEventListener("online",(()=>{this.online=!0,this.send()})),r.g.addEventListener("offline",(()=>{this.online=!1})))}static setOptions(e){(new f).setOptions(e)}setOptions(e){null!=e.host&&(this.options.host=e.host),null!=e.level&&(this.options.level=e.level),null!=e.maxRequestSize&&(this.options.maxRequestSize=e.maxRequestSize),null!=e.limit&&(this.options.limit=e.limit),null!=e.interval&&(this.options.interval=e.interval),this.resetTimeout()}static setGlobalAggregate(e,t){(new f).setGlobalAggregate(e,t)}setGlobalAggregate(e,t){null==this.globalContext.aggregates?this.globalContext.aggregates={[e]:t}:this.globalContext.aggregates[e]=t}static removeGlobalAggregate(e){(new f).removeGlobalAggregate(e)}removeGlobalAggregate(e){null!=this.globalContext.aggregates&&null!=this.globalContext.aggregates[e]&&(delete this.globalContext.aggregates[e],0===Object.keys(this.globalContext.aggregates).length&&delete this.globalContext.aggregates)}static clearGlobalAggregates(){(new f).clearGlobalAggregates()}clearGlobalAggregates(){this.globalContext.aggregates={}}static setGlobalMeta(e,t){(new f).setGlobalMeta(e,t)}setGlobalMeta(e,t){null==this.globalContext.meta?this.globalContext.meta={userAgent:"undefined"!=typeof navigator?navigator.userAgent:"unknown",referrer:"undefined"!=typeof document?document.referrer:"unknown",source:"client",logId:(0,d.uuidv4)(),loggerVer:l.default.version,[e]:t}:this.globalContext.meta[e]=t}static removeGlobalMeta(e){(new f).removeGlobalMeta(e)}removeGlobalMeta(e){null!=this.globalContext.meta&&null!=this.globalContext.meta[e]&&delete this.globalContext.meta[e]}resetTimeout(){this.options.interval&&(null!=this.watchTimeout&&("undefined"!=typeof window?window.clearTimeout(this.watchTimeout):clearTimeout(this.watchTimeout)),null!=this.send&&("undefined"!=typeof window?this.watchTimeout=window.setTimeout(this.send.bind(this),this.options.interval):this.watchTimeout=setTimeout(this.send.bind(this),this.options.interval)))}registerPackage(e){this.loggers.push(e)}removePackage(e){const t=this.loggers.indexOf(e);t>-1&&this.loggers.splice(t,1),this.loggers.push(e)}add(e,t){(0,u.meetsLevel)(e.level,this.options.level)&&(this.storage.push(e),null!=this.options.host&&this.online?(null!=t&&-1===this.packageContextStorage.indexOf(t.packageContext)&&this.packageContextStorage.push(t.packageContext),(0,u.meetsLevel)(e.level,"error")&&this.throttleSend()):this.checkStorageLimit())}send(){if(0===this.storage.length)return void this.resetTimeout();if(null==this.options.host)return this.checkStorageLimit(),void this.resetTimeout();const e=this.storage.splice(0,this.options.limit),t={},r={};this.packageContextStorage.forEach((e=>{null!=e.aggregates&&Object.keys(e.aggregates).forEach((r=>{var n;const i=null===(n=e.aggregates)||void 0===n?void 0:n[r];null!=i&&(t[r]=i)})),null!=e.meta&&a.PackageMetaKeys.forEach((t=>{var n;null!=(null===(n=e.meta)||void 0===n?void 0:n[t])&&(r[t]=e.meta[t])}))}));const n={aggregates:t,meta:r};this.packageContextStorage.splice(0,-1*this.packageContextStorage.length);const i={logs:e,sendTime:(new Date).toISOString(),context:{packageContexts:n,globalContext:this.globalContext}};let o;try{o=JSON.stringify(i)}catch(e){return this.add({level:"error",message:"Failed to stringify in logger",error:`${e}`,time:(new Date).toISOString()}),void this.resetTimeout()}if((0,c.default)(o)>this.options.maxRequestSize)return this.add({level:"error",message:`Body exceeds maxRequestSize. Dropped ${e.length} logs.`,time:(new Date).toISOString()}),void this.resetTimeout();f.fetch(`${this.options.host}/client-logs/v4`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json"},body:o}).then((e=>{if(!e.ok)throw new TypeError(e.status.toString());return this.resetTimeout(),e})).catch((e=>{this.add({level:"network",message:"Network failure.",error:`${e}`,time:(new Date).toISOString()}),this.resetTimeout()}))}checkStorageLimit(){this.storage.length>this.options.limit&&this.storage.slice(-1*this.options.limit)}}t.LoggerGlobal=f,f.fetch="undefined"!=typeof window?window.fetch.bind(window):()=>Promise.resolve(new Response)},70644:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"@video/log-client",version:"5.0.2"}},58024:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LoggerGlobal=void 0;const n=r(71281),i=r(17916);Object.defineProperty(t,"LoggerGlobal",{enumerable:!0,get:function(){return i.LoggerGlobal}}),t.default=n.LoggerCore},37589:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){let t=e.length;for(let r=e.length-1;r>=0;r-=1){const n=e.charCodeAt(r);n>127&&n<=2047?t+=1:n>2047&&n<=65535&&(t+=2),n>=56320&&n<=57343&&(r-=1)}return t}},37855:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ttySyles=t.browserStyles=void 0,t.browserStyles={trace:"color: rgba(169,184,186,0.6)",debug:"color: #a9b8ba",network:"color: #a9b8ba",timing:"color: #a9b8ba",local:"color: #a9b8ba",info:"",warn:"color: #c0a044",notice:"color: #c0a044",deprecated:"color: #c0a044",error:"color: #f44336",fatal:"color: #f44336"},t.ttySyles={trace:"",debug:"",network:"",timing:"",local:"",info:"",warn:"",notice:"",deprecated:"",error:"",fatal:""}},83442:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.supportedLevels=t.meetsLevel=t.supportsLevel=void 0;const r={fatal:0,error:0,warn:1,notice:1,deprecated:1,info:2,local:3,debug:3,timing:3,network:3,trace:3};function n(e){return void 0!==r[e]}t.supportedLevels=r,t.supportsLevel=n,t.meetsLevel=function(e,t){return!(!n(e)||!n(t))&&r[e]<=r[t]}},61332:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.uuidv4=void 0,t.uuidv4=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}},4665:(e,t,r)=>{var n=r(65606);t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;t.splice(1,0,r,"color: inherit");let n=0,i=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(n++,"%c"===e&&(i=n))})),t.splice(i,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&void 0!==n&&"env"in n&&(e=n.env.DEBUG),e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=r(89520)(t);const{formatters:i}=e.exports;i.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},89520:(e,t,r)=>{e.exports=function(e){function t(e){let r,i,o,a=null;function s(...e){if(!s.enabled)return;const n=s,i=Number(new Date),o=i-(r||i);n.diff=o,n.prev=r,n.curr=i,r=i,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((r,i)=>{if("%%"===r)return"%";a++;const o=t.formatters[i];if("function"==typeof o){const t=e[a];r=o.call(n,t),e.splice(a,1),a--}return r})),t.formatArgs.call(n,e),(n.log||t.log).apply(n,e)}return s.namespace=e,s.useColors=t.useColors(),s.color=t.selectColor(e),s.extend=n,s.destroy=t.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==a?a:(i!==t.namespaces&&(i=t.namespaces,o=t.enabled(e)),o),set:e=>{a=e}}),"function"==typeof t.init&&t.init(s),s}function n(e,r){const n=t(this.namespace+(void 0===r?":":r)+e);return n.log=this.log,n}function i(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){const e=[...t.names.map(i),...t.skips.map(i).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let r;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const n=("string"==typeof e?e:"").split(/[\s,]+/),i=n.length;for(r=0;r{t[r]=e[r]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let r=0;for(let t=0;t{var t=1e3,r=60*t,n=60*r,i=24*n,o=7*i;function a(e,t,r,n){var i=t>=1.5*r;return Math.round(e/r)+" "+n+(i?"s":"")}e.exports=function(e,s){s=s||{};var l,c,u=typeof e;if("string"===u&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var a=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(a){var s=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*s;case"weeks":case"week":case"w":return s*o;case"days":case"day":case"d":return s*i;case"hours":case"hour":case"hrs":case"hr":case"h":return s*n;case"minutes":case"minute":case"mins":case"min":case"m":return s*r;case"seconds":case"second":case"secs":case"sec":case"s":return s*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}(e);if("number"===u&&isFinite(e))return s.long?(l=e,(c=Math.abs(l))>=i?a(l,c,i,"day"):c>=n?a(l,c,n,"hour"):c>=r?a(l,c,r,"minute"):c>=t?a(l,c,t,"second"):l+" ms"):function(e){var o=Math.abs(e);return o>=i?Math.round(e/i)+"d":o>=n?Math.round(e/n)+"h":o>=r?Math.round(e/r)+"m":o>=t?Math.round(e/t)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},16654:(e,t,r)=>{"use strict";e.exports=r(28530)},28530:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PackageMetaKeys=t.LEVELS=t.isSerializableObject=t.isPlainRecord=t.GlobalMetaKeys=t.extractAggregates=void 0;var n=r(18293);Object.defineProperty(t,"extractAggregates",{enumerable:!0,get:function(){return n.extractAggregates}}),Object.defineProperty(t,"GlobalMetaKeys",{enumerable:!0,get:function(){return n.GlobalMetaKeys}}),Object.defineProperty(t,"isPlainRecord",{enumerable:!0,get:function(){return n.isPlainRecord}}),Object.defineProperty(t,"isSerializableObject",{enumerable:!0,get:function(){return n.isSerializableObject}}),Object.defineProperty(t,"LEVELS",{enumerable:!0,get:function(){return n.LEVELS}}),Object.defineProperty(t,"PackageMetaKeys",{enumerable:!0,get:function(){return n.PackageMetaKeys}})},18293:(e,t)=>{"use strict";function r(e){return null!=e&&"object"==typeof e&&!Array.isArray(e)&&"toJSON"in e&&"function"==typeof e.toJSON}function n(e){return null!=e&&"object"==typeof e&&!Array.isArray(e)&&!r(e)&&!Object.values(e).some((e=>null!=e&&!["number","string","boolean"].includes(typeof e)))}Object.defineProperty(t,"__esModule",{value:!0}),t.extractAggregates=t.isPlainRecord=t.isSerializableObject=t.PackageMetaKeys=t.GlobalMetaKeys=t.LEVELS=void 0,t.LEVELS=["trace","debug","network","timing","local","info","warn","notice","deprecated","error","fatal"],t.GlobalMetaKeys=["source","logId","userAgent","referrer","loggerVer"],t.PackageMetaKeys=["package","component","service","release","chain","client","contextId","instanceId","commitHash"],t.isSerializableObject=r,t.isPlainRecord=n,t.extractAggregates=function(e,...t){if(!r(e))return{};const i=e.toJSON();if(null==i||"object"!=typeof i||Array.isArray(i)||r(i))return{};const o=i.aggregates;if(!n(o))return{};for(const e of t)delete o[e];return o}},93908:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Group=void 0;const n=r(54894),i=r(11947),o=r(52482);t.Group=class{constructor(e){this.name=e,this.registeredStates=[],this.registeredHandlers={}}registerState(e,t){const r=function(t){return new i.StateInstance(r,e,t)};return r.is=function(t){return t instanceof i.StateInstance&&t[o.stateNameSym]===e},r.stateName=e,r.groupName=this.name,this.registeredStates.push(r),this.registeredHandlers[e]=t,r}bootstrap(e){return this.initFactory=e,this}accepts(e,t){return t in this.registeredHandlers[e[o.stateNameSym]]}handle(e,t,r){const a=e[this.name],s=this.registeredHandlers[a[o.stateNameSym]][t];if(null==s)return n.Result.ignore(`Signal ${String(t)} is not handled in state ${a[o.stateNameSym]}`);try{const t=s(e,r);return t instanceof n.Result?t:t instanceof i.StateInstance?n.Result.ok(t):n.Result.ok(i.StateInstance.clone(a,t))}catch(e){return n.Result.error(e)}}}},89695:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cloneState=t.isTransitioning=t.getStateName=t.MergedError=t.StateFlow=t.SignalType=t.createSignal=t.ResultKind=t.Result=void 0;const n=r(31635).__importDefault(r(80193));void 0===Symbol.dispose&&Object.defineProperty(Symbol,"dispose",{value:n.default});var i=r(54894);Object.defineProperty(t,"Result",{enumerable:!0,get:function(){return i.Result}}),Object.defineProperty(t,"ResultKind",{enumerable:!0,get:function(){return i.ResultKind}});var o=r(50658);Object.defineProperty(t,"createSignal",{enumerable:!0,get:function(){return o.createSignal}}),Object.defineProperty(t,"SignalType",{enumerable:!0,get:function(){return o.SignalType}});var a=r(88699);Object.defineProperty(t,"StateFlow",{enumerable:!0,get:function(){return a.StateFlow}});var s=r(81402);Object.defineProperty(t,"MergedError",{enumerable:!0,get:function(){return s.MergedError}}),Object.defineProperty(t,"getStateName",{enumerable:!0,get:function(){return s.getStateName}}),Object.defineProperty(t,"isTransitioning",{enumerable:!0,get:function(){return s.isTransitioning}}),Object.defineProperty(t,"cloneState",{enumerable:!0,get:function(){return s.cloneState}})},54894:(e,t,r)=>{"use strict";var n,i,o;Object.defineProperty(t,"__esModule",{value:!0}),t.Result=t.ResultKind=void 0;const a=r(31635),s=r(81402);var l;!function(e){e[e.OK=0]="OK",e[e.Ignored=1]="Ignored",e[e.InTransition=2]="InTransition",e[e.Rejected=3]="Rejected",e[e.Error=4]="Error"}(l||(t.ResultKind=l={}));class c{constructor(e,t){this.kind=e,this.data=t,n.set(this,[]),i.set(this,null),o.set(this,null),e===l.InTransition&&a.__classPrivateFieldGet(this,n,"f").push(t),Object.freeze(this)}get ok(){return this.kind===l.OK}get hasError(){return this.kind===l.Error||this.kind===l.Rejected}get ready(){return this.readyExecutors.then((e=>new Promise((t=>setTimeout((()=>t(e)),0)))))}get error(){return this.data instanceof Error?this.data:null}get message(){return"string"==typeof this.data?this.data:null}get readyExecutors(){return null==a.__classPrivateFieldGet(this,i,"f")&&(this.kind===l.InTransition?a.__classPrivateFieldSet(this,i,Promise.all(a.__classPrivateFieldGet(this,n,"f")).then((e=>e.reduce(((e,t)=>e.merge(t)),c.ignore()))),"f"):a.__classPrivateFieldSet(this,i,Promise.resolve(this),"f")),a.__classPrivateFieldGet(this,i,"f")}static ignore(e){return new c(l.Ignored,e)}static ok(e){return new c(l.OK,e)}static transition(e,t=15e3){return new c(l.InTransition,(0,s.withTimeout)(e.catch((e=>c.error(e))),t))}static reject(e){return new c(l.Rejected,e)}static error(e){return e instanceof Error?new c(l.Error,e):new c(l.Error,new Error(String(e)))}expect(...e){if(this.kind===l.InTransition&&!e.includes(l.InTransition))throw new Error("Result is in transition state but expected synchronous result");if(!e.includes(this.kind))throw new Error(function(e,t,r,n,i){let o=`${e.map((e=>l[e])).join(" or ")} but got ${l[t]}`;return null!=r&&(o+=`; ${r}`),null!=n&&(o+=`; ${n}`),o=null!=i?`[state-flow] Signal '${i}' expected ${o}`:`[state-flow] Expected ${o}`,o}(e,this.kind,this.error,this.message,String(a.__classPrivateFieldGet(this,o,"f"))));return this}withContext(e){return a.__classPrivateFieldSet(this,o,e,"f"),this}merge(e){var t,r;if(this.kind===e.kind)switch(this.kind){case l.Ignored:return c.ignore((0,s.mergeStrings)(this.data,e.data)).withContext(a.__classPrivateFieldGet(this,o,"f"));case l.OK:if(null!=this.data||null!=e.data)throw new Error("Cannot merge handled state results with data");return this;case l.InTransition:return a.__classPrivateFieldGet(this,n,"f").push(...a.__classPrivateFieldGet(e,n,"f")),this;case l.Rejected:return this;case l.Error:return c.error(new s.MergedError([this.data,e.data])).withContext(a.__classPrivateFieldGet(this,o,"f"))}const i=(e,t)=>{switch(e.kind){case l.Ignored:return t;case l.InTransition:return a.__classPrivateFieldGet(e,n,"f").push(t.ready),e;case l.Rejected:case l.Error:return e}return null};return(null!==(r=null!==(t=i(this,e))&&void 0!==t?t:i(e,this))&&void 0!==r?r:this).withContext(a.__classPrivateFieldGet(this,o,"f"))}[(n=new WeakMap,i=new WeakMap,o=new WeakMap,Symbol.toStringTag)](){return`SignalResult(${l[this.kind]})`}[Symbol.toPrimitive](){return this.kind===l.Error?`${this.error}${null!=this.message?`; ${this.message}`:""}`:`${l[this.kind]}${null!=this.message?`: ${this.message}`:""}`}}t.Result=c},50658:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SignalType=t.createSignal=void 0,t.createSignal=function(e){return new r(e)};class r{constructor(e){this.name=e}}t.SignalType=r},88699:(e,t,r)=>{"use strict";var n,i,o;Object.defineProperty(t,"__esModule",{value:!0}),t.Instance=t.StateFlow=void 0;const a=r(31635),s=r(37007),l=a.__importDefault(r(29252)),c=r(93908),u=r(54894),d=r(50658),h=r(11947),p=r(52482),f=r(81402),m=a.__importDefault(r(79879));function g(e,t,r){return r instanceof h.StateInstance?`${e}:${String(t)}:${(0,f.getStateName)(r)}`:`${e}:${String(t)}:${r.stateName}`}function v(e,t,r,n,i=!1){if(f.DEBUG_MODE){i?console.groupCollapsed(`[SIGNAL/ASYNC] ${String(e)} - ${t}`):console.groupCollapsed(`[SIGNAL] ${String(e)} - ${t}`),console.log("Params:",r);for(const[e,t]of Object.entries(n))for(const e of t)console.log(...e);console.groupEnd()}}let y="";t.StateFlow=class{constructor(){this.registeredGroups=[],n.set(this,new WeakSet)}registerGroup(e){const t=new c.Group(e);return this.registeredGroups.some((e=>e.name===t.name))?(console.error(new Error(`Group ${String(t.name)} is already registered`)),t):(this.registeredGroups.push(t),t)}initialize(...e){const t=new b(this);for(const e of this.registeredGroups)null!=e.initFactory&&t[p.applySym](e.name,e.initFactory());for(const r of e)y="displayName"in r.constructor?String(r.constructor.displayName):r.constructor.name,r.initStateFlow(t);if(y="",t[p.isInitializedSym]=!0,f.DEBUG_MODE)for(const e of this.registeredGroups)for(const t of e.registeredStates)console.debug(`Registered state ${e.name}(${t.stateName}) with ${Object.keys(e.registeredHandlers[t.stateName]).length} handlers`);return t}},n=new WeakMap;class b{constructor(e){this[o]=!1,i.set(this,new m.default),this[p.instanceSym]=e,this[p.emitterSym]=a.__classPrivateFieldGet(this,i,"f").adopt(new s.EventEmitter,(e=>{e.removeAllListeners()}))}dispatch(e,t,r){if(!this[p.isInitializedSym])throw new Error("State flow is not initialized");const n=new f.Collector(u.Result.ok());let i=u.Result.ignore();try{if(i=this.prepareChangelog(e,t,n),!i.ok||null==i.data)return i.withContext(e);const[o,a]=i.data;if(this.processExitHandlers(a,o,n),i=n.merge(),i.hasError)return i.withContext(e);if(i.kind===u.ResultKind.InTransition)return u.Result.error(new Error("async handlers are not allowed in sync dispatch")).withContext(e);if(null!=r){const e=r(o,this);null==n||n.log("LOCAL",`\tonChange: local handler => ${String(e)}`),null==n||n.push(e),i=n.merge()}if(i.hasError)return i.withContext(e);if(i.kind===u.ResultKind.InTransition)return u.Result.error(new Error("async handlers are not allowed in sync dispatch")).withContext(e);if(this.processChangesHandlers(a,o,n),i=n.merge(),i.hasError)return i.withContext(e);if(i.kind===u.ResultKind.InTransition)return u.Result.error(new Error("async handlers are not allowed in sync dispatch")).withContext(e);if(this.processEnterHandlers(a,o,n),i=n.merge(),i.hasError)return i.withContext(e);if(i.kind===u.ResultKind.InTransition)return u.Result.error(new Error("async handlers are not allowed in sync dispatch")).withContext(e);for(const[e,t]of a)this[p.applySym](e,t);return this.processCommitEvents(a,o),i.withContext(e)}finally{this[p.clearSym](),v(e,i,t,n.logs)}}async dispatchAsync(e,t){if(!this[p.isInitializedSym])throw new Error("State flow is not initialized");const r=new f.Collector(u.Result.ok());let n=u.Result.ignore();try{if(n=this.prepareChangelog(e,t,r),!n.ok||null==n.data)return n.withContext(e);const[i,o]=n.data;if(this.processExitHandlers(o,i,r),n=await r.merge().ready,n.hasError)return n.withContext(e);if(this.processChangesHandlers(o,i,r),n=await r.merge().ready,n.hasError)return n.withContext(e);if(this.processEnterHandlers(o,i,r),n=await r.merge().ready,n.hasError)return n.withContext(e);for(const[e,t]of o)this[p.applySym](e,t);return this.processCommitEvents(o,i),n.withContext(e)}finally{this[p.clearSym](),v(e,n,t,r.logs,!0)}}[(i=new WeakMap,o=p.isInitializedSym,p.applySym)](e,t){this[e]=t}[p.clearSym](){Object.values(this).forEach((e=>e[p.isTransitioningSym]=!1))}handleEnter(e,t){this.feedbackWatch(e,t,"onEnter")}handleChanges(e,t){this.feedbackWatch(e,t,"onChanges")}handleExit(e,t){this.feedbackWatch(e,t,"onExit")}onCommit(e,t){this.notifyWatch(e,t)}[Symbol.dispose](){a.__classPrivateFieldGet(this,i,"f").dispose(),this[p.emitterSym].removeAllListeners(),this[p.isInitializedSym]=!1}isStateChanged(e,t){if(null==t)return!1;const r=this[e];return null==r||!((0,f.getStateName)(r)===(0,f.getStateName)(t)&&(0,l.default)(this[e],t))}processEnterHandlers(e,t,r){const n=this;for(const[i,o]of e)if((0,f.getStateName)(n[i])!==(0,f.getStateName)(t[i])){const e=g("onEnter",i,t[i]);this[p.emitterSym].emit(e,t,r)}}processChangesHandlers(e,t,r){const n=this;for(const[i,o]of e)if((0,f.getStateName)(n[i])===(0,f.getStateName)(t[i])){const e=g("onChanges",i,t[i]);this[p.emitterSym].emit(e,t,r)}}processExitHandlers(e,t,r){const n=this;for(const[i,o]of e)if((0,f.getStateName)(n[i])!==(0,f.getStateName)(t[i])){const e=g("onExit",i,n[i]);this[p.emitterSym].emit(e,t,r)}}processCommitEvents(e,t,r){const n=this;for(const[i,o]of e){const e=g("onCommit",i,n[i]);this[p.emitterSym].emit(e,t,r)}}prepareChangelog(e,t,r){const n=e instanceof d.SignalType?e.name:e,i=[],o={};for(const a of this[p.instanceSym].registeredGroups){const s=this.get(a.name);if(o[a.name]=s,a.accepts(s,n)){let l=a.handle(this,n,t);switch(l.kind){case u.ResultKind.OK:if(this.isStateChanged(a.name,l.data)){if(s[p.isTransitioningSym])return u.Result.error(Error(`Cannot handle '${String(e)}' signal: '${a.name}' is in transition`));s[p.isTransitioningSym]=!0,i.push([a.name,l.data]),o[a.name]=l.data,r.log(a.name,`State ${a.name}: ${(0,f.getStateName)(s)} => ${(0,f.getStateName)(l.data)}`,[{...l.data}])}break;case u.ResultKind.InTransition:return u.Result.error(new Error("Transition is not allowed in signal handlers"));case u.ResultKind.Rejected:case u.ResultKind.Error:return l}}}return 0===i.length?u.Result.ignore("no changes"):u.Result.ok([o,i])}get(e){if(!(e in this))throw new Error(`State ${e} not found`);return this[e]}clone(){const e=this;return this[p.instanceSym].registeredGroups.reduce(((t,r)=>{const n=r.name;return t[n]={...e[n]},t}),{})}feedbackWatch(e,t,r){if(this[p.isInitializedSym])throw new Error("Cannot add handlers after initialization");this[p.emitterSym].on(g(r,String(e.groupName),e),((n,i)=>{try{const o=t(n,this);null==i||i.log(String(e.groupName),`\t${r}: ${t.name}() => ${String(o)}`),null==i||i.push(o)}catch(n){null==i||i.log(String(e.groupName),`\t${r}: ${t.name}() => Error: ${String(n)}`),null==i||i.push(n)}}))}notifyWatch(e,t){this[p.emitterSym].on(g("onCommit",String(e.groupName),e),((r,n)=>{try{t(r,this)}catch(t){console.error(`Error in ${String(e)} "onCommit" callback: ${t}`,t)}}))}}t.Instance=b},11947:(e,t,r)=>{"use strict";var n,i,o;Object.defineProperty(t,"__esModule",{value:!0}),t.StateInstance=void 0;const a=r(31635),s=r(52482);class l{constructor(e,t,r,s=!1){return n.set(this,!1),i.set(this,void 0),o.set(this,void 0),a.__classPrivateFieldSet(this,i,t,"f"),a.__classPrivateFieldSet(this,n,s,"f"),a.__classPrivateFieldSet(this,o,e,"f"),Object.freeze(Object.assign(this,r))}get[(n=new WeakMap,i=new WeakMap,o=new WeakMap,s.isTransitioningSym)](){return a.__classPrivateFieldGet(this,n,"f")}set[s.isTransitioningSym](e){a.__classPrivateFieldSet(this,n,e,"f")}get[s.stateNameSym](){return a.__classPrivateFieldGet(this,i,"f")}get[Symbol.toStringTag](){return this[s.stateNameSym]}static clone(e,t){return a.__classPrivateFieldGet(e,o,"f").call(e,{...e,...t})}}t.StateInstance=l},52482:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.clearSym=t.applySym=t.stateNameSym=t.isInitializedSym=t.isTransitioningSym=t.emitterSym=t.instanceSym=void 0,t.instanceSym=Symbol("instance"),t.emitterSym=Symbol("emitter"),t.isTransitioningSym=Symbol("isTransitioning"),t.isInitializedSym=Symbol("isInitialized"),t.stateNameSym=Symbol("stateName"),t.applySym=Symbol("apply"),t.clearSym=Symbol("clear")},81402:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.disableDebug=t.enableDebug=t.withTimeout=t.Collector=t.cloneState=t.isTransitioning=t.getStateName=t.mergeStrings=t.MergedError=t.DEBUG_MODE=void 0;const n=r(31635),i=r(54894),o=r(88699),a=r(11947),s=r(52482),l=n.__importDefault(r(22023));t.DEBUG_MODE=(0,l.default)("state-flow").enabled;class c extends Error{constructor(e){super(e.map((e=>String(e))).join("; ")),this.errors=e}}t.MergedError=c,t.mergeStrings=function(e,t){if(null!=e||null!=t)return null==e?String(t):null==t?String(e):`${e}; ${t}`},t.getStateName=function(e){if(e instanceof a.StateInstance)return e[s.stateNameSym];throw new Error("invalid state")},t.isTransitioning=function e(t){if(t instanceof a.StateInstance)return t[s.isTransitioningSym];if(t instanceof o.Instance)return Object.values(t).some((t=>e(t)));throw new Error("invalid state")},t.cloneState=function(e,t){if(e instanceof a.StateInstance)return a.StateInstance.clone(e,t);throw new Error("invalid state")},t.Collector=class{constructor(e=i.Result.ignore()){this.result=e,this.logs={},this.results=[]}merge(){return this.results=[this.results.reduce(((e,t)=>e.merge(t)),this.result)],this.results[0]}push(e){const t=e instanceof i.Result?e:i.Result.error(e);this.results.push(t)}log(e,...t){var r,n;null!==(r=(n=this.logs)[e])&&void 0!==r||(n[e]=[]),this.logs[e].push(t)}},t.withTimeout=function(e,t){return new Promise(((r,n)=>{const o=setTimeout((()=>{r(i.Result.error(new Error("timeout")))}),t);e.then((e=>{clearTimeout(o),r(e)}),(e=>{clearTimeout(o),n(e)}))}))},t.enableDebug=function(){t.DEBUG_MODE=!0},t.disableDebug=function(){t.DEBUG_MODE=!1}},22023:(e,t,r)=>{var n=r(65606);t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;t.splice(1,0,r,"color: inherit");let n=0,i=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(n++,"%c"===e&&(i=n))})),t.splice(i,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&void 0!==n&&"env"in n&&(e=n.env.DEBUG),e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=r(54234)(t);const{formatters:i}=e.exports;i.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},54234:(e,t,r)=>{e.exports=function(e){function t(e){let r,i,o,a=null;function s(...e){if(!s.enabled)return;const n=s,i=Number(new Date),o=i-(r||i);n.diff=o,n.prev=r,n.curr=i,r=i,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((r,i)=>{if("%%"===r)return"%";a++;const o=t.formatters[i];if("function"==typeof o){const t=e[a];r=o.call(n,t),e.splice(a,1),a--}return r})),t.formatArgs.call(n,e),(n.log||t.log).apply(n,e)}return s.namespace=e,s.useColors=t.useColors(),s.color=t.selectColor(e),s.extend=n,s.destroy=t.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==a?a:(i!==t.namespaces&&(i=t.namespaces,o=t.enabled(e)),o),set:e=>{a=e}}),"function"==typeof t.init&&t.init(s),s}function n(e,r){const n=t(this.namespace+(void 0===r?":":r)+e);return n.log=this.log,n}function i(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){const e=[...t.names.map(i),...t.skips.map(i).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let r;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const n=("string"==typeof e?e:"").split(/[\s,]+/),i=n.length;for(r=0;r{t[r]=e[r]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let r=0;for(let t=0;t{var t=1e3,r=60*t,n=60*r,i=24*n,o=7*i;function a(e,t,r,n){var i=t>=1.5*r;return Math.round(e/r)+" "+n+(i?"s":"")}e.exports=function(e,s){s=s||{};var l,c,u=typeof e;if("string"===u&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var a=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(a){var s=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*s;case"weeks":case"week":case"w":return s*o;case"days":case"day":case"d":return s*i;case"hours":case"hour":case"hrs":case"hr":case"h":return s*n;case"minutes":case"minute":case"mins":case"min":case"m":return s*r;case"seconds":case"second":case"secs":case"sec":case"s":return s*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}(e);if("number"===u&&isFinite(e))return s.long?(l=e,(c=Math.abs(l))>=i?a(l,c,i,"day"):c>=n?a(l,c,n,"hour"):c>=r?a(l,c,r,"minute"):c>=t?a(l,c,t,"second"):l+" ms"):function(e){var o=Math.abs(e);return o>=i?Math.round(e/i)+"d":o>=n?Math.round(e/n)+"h":o>=r?Math.round(e/r)+"m":o>=t?Math.round(e/t)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},28046:(e,t,r)=>{"use strict";e.exports=r(97362)},67099:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isHTMLCanvasElement=function(e){return null!=(null==e?void 0:e.getContext)&&null!=(null==e?void 0:e.toBlob)}},51327:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.Feature=void 0,function(e){e[e.APPLY_CONSTRAINTS=0]="APPLY_CONSTRAINTS",e[e.AUDIO_CONTEXT=1]="AUDIO_CONTEXT",e[e.CPU_USAGE=2]="CPU_USAGE",e[e.CREATE_CANVAS_ELEMENT=3]="CREATE_CANVAS_ELEMENT",e[e.CREATE_VIDEO_ELEMENT=4]="CREATE_VIDEO_ELEMENT",e[e.CREATE_AUDIO_ELEMENT=5]="CREATE_AUDIO_ELEMENT",e[e.CREATE_SCREENSHOT=6]="CREATE_SCREENSHOT",e[e.DOCUMENT=7]="DOCUMENT",e[e.DEBUGGING=8]="DEBUGGING",e[e.HLSJS=9]="HLSJS",e[e.LOCAL_STORAGE=10]="LOCAL_STORAGE",e[e.MATCH_MEDIA=11]="MATCH_MEDIA",e[e.MULTI_TOUCH=12]="MULTI_TOUCH",e[e.MEDIA_DEVICE=13]="MEDIA_DEVICE",e[e.MEDIA_RECORDER=14]="MEDIA_RECORDER",e[e.MEDIA_SOURCE=15]="MEDIA_SOURCE",e[e.MEDIA_STREAM=16]="MEDIA_STREAM",e[e.NETWORK_INFORMATION=17]="NETWORK_INFORMATION",e[e.URL_LOCATION=18]="URL_LOCATION",e[e.SCREEN_ORIENTATION=19]="SCREEN_ORIENTATION",e[e.WEB_SOCKET=20]="WEB_SOCKET",e[e.WEB_SOCKET_CLIENT=21]="WEB_SOCKET_CLIENT",e[e.PERMISSIONS=22]="PERMISSIONS",e[e.MPEGTS=23]="MPEGTS",e[e.URL_SEARCHPARAMS=24]="URL_SEARCHPARAMS",e[e.USER_ACTIVATION=25]="USER_ACTIVATION",e[e.USER_AGENT_DATA=26]="USER_AGENT_DATA",e[e.WEBRTC=27]="WEBRTC"}(r||(t.Feature=r={}))},51356:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},27291:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isPointerEvent=t.isKeyboardEvent=t.userActivationEvents=void 0,t.userActivationEvents=["touchend","mousedown","pointerup","pointerdown","keydown"],t.isKeyboardEvent=e=>void 0!==e.keyCode,t.isPointerEvent=e=>void 0!==e.pointerType},86729:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.onceDeviceReady=t.device=t.Feature=void 0,t.implement=function(e){t.device=e,a(t.device)};const n=r(31635),i=r(79852);var o=r(51327);let a;Object.defineProperty(t,"Feature",{enumerable:!0,get:function(){return o.Feature}}),n.__exportStar(r(51356),t),t.device=new i.WebDevice,t.onceDeviceReady=new Promise((e=>{a=e}))},7776:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},36147:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorCode=void 0,t.isVideoClientError=function(e){return(null==e?void 0:e.code)&&Object.values(r).includes(e.code)},function(e){e.H264NotSupported="h264-not-supported",e.NoBackendEndpoints="no-backend-endpoints",e.NoPlayersAvailable="no-players-available",e.NoUserId="no-userId",e.UnableJoinCall="unable-join-call",e.UnableChangeBitrate="unable-change-bitrate",e.UnableSwitchQuality="unable-switch-quality",e.MediaStreamNotSupported="media-stream-not-supported",e.MediaDeviceNotSupported="media-device-not-supported",e.ConsumerNotCreated="consumer-not-created",e.NetworkError="network-error",e.ManifestNotLoaded="manifest-not-loaded",e.PlayerLoadingFailed="player-loading-failed",e.BadManifest="bad-manifest",e.MediaDeviceNotAvailable="media-device-not-available",e.MediaControllerNotInitialized="media-controller-not-initialized",e.MediaDeviceChangingFailed="media-device-changing-failed",e.MediaStreamPreparingConflict="media-stream-preparing-conflict",e.MediaTrackEnded="media-track-ended",e.ApplyingConstraintsFailed="constraints-not-applied",e.NativeError="native-error",e.PlayerSourceNotSupported="player-source-not-supported",e.UpdateResolutionsFailed="update-resolutions-failed",e.DisposingError="disposing-error",e.AssertionError="assertion-error",e.StreamNameAlreadyExists="stream-name-already-exists",e.StreamNotFound="stream-not-found",e.BroadcastVideoFailed="broadcast-video-failed",e.BroadcastAudioFailed="broadcast-video-failed",e.SFUBusy="sfu-busy",e.WebSocketInTransit="websocket-in-transit",e.WebSocketNotConnected="websocket-not-connected",e.NotAllowed="not-allowed",e.BadInput="bad-input",e.CallError="call-error",e.CapturableStreamError="capturable-stream-error",e.Constraints="constraints",e.ConsumerNotFound="consumer-not-foud",e.DeviceInUse="device-in-use",e.DeviceNotFound="device-not-found",e.DisableAudioError="disable-audio-error",e.DisableVideoError="disable-video-error",e.DisposedObject="disposed-object",e.DriverNotSupported="driver-not-supported",e.ElementRequired="element-required",e.EmbedSWFFailed="embedding-flash-swf-failed",e.EnableAudioError="enable-audio-error",e.EnableVideoError="enable-video-error",e.EnumeratingDevices="enumerating-devices-error",e.GetUserMediaFailed="get-user-media-failed",e.HandleHlsJsError="handle-hlsjs-error",e.HlsjsNotLoaded="hlsjs-not-loaded",e.InternalCallError="internal-call-error",e.InternalError="internal-error",e.InvalidBitrate="invalid-bitrate",e.InvalidControls="invalid-controls-parent",e.InvalidElement="invalid-element",e.InvalidMediaURL="invalid-media-url",e.InvalidPopoutURL="invalid-popout-url",e.JoinCallError="join-call-error",e.JoinCallRejected="join-call-rejected",e.LayerNotFound="layer-not-found",e.ManifestError="manifest-error",e.ManifestForbidden="manifest-forbidden",e.ManifestInternalError="manifest-internal-error",e.ManifestNotFound="manifest-not-found",e.ManifestUnauthorized="manifest-unauthorized",e.ManifestUnexpectedResponse="manifest-unexpected-response",e.MediaError="media-error",e.MediaRecorderError="media-recorder-error",e.MediasoupSetupError="mediasoup-setup-error",e.MeowDriverError="meow-driver-error",e.Mp4BufferError="mp4-buffer-error",e.NoDrivers="no-valid-drivers",e.NotInitialized="not-initialized",e.NotSupported="not-supported",e.Permission="permission-error",e.PlaybackError="playback-error",e.PlayingIssue="playing-issue",e.RetrievingMediaStreamError="retrieving-media-stream-error",e.ResolutionsInUse="resolutions-in-use-error",e.SFUConsumerClosedEvent="sfu-consumer-closed-event",e.SFUConsumerLayersChangedEvent="sfu-consumer-layers-changed-event",e.SFUConsumerPausedEvent="sfu-consumer-paused-event",e.SFUConsumerResumedEvent="sfu-consumer-resumed-event",e.SFUConsumerScoreEvent="sfu-consumer-score-event",e.SFUConsumerSourcesEvent="sfu-consumer-sources-event",e.SFUNewConsumerEvent="sfu-new-consumer-event",e.SFUNewPeersEvent="sfu-new-peers-event",e.SFUPeerClosedEvent="sfu-peer-closed-event",e.SFUProducerClosedEvent="sfu-producer-closed-event",e.SFUProducerPausedEvent="sfu-producer-paused-event",e.SFUProducerResumedEvent="sfu-producer-resumed-event",e.SFUSwitchConsumerTrackEvent="sfu-switch-consumer-track-event",e.SimulcastDisabled="simulcast-disabled",e.StartBroadcastError="start-broadcast-error",e.StreamExists="stream-exists",e.TrackEnded="track-ended",e.TransportStateError="transport-state-error",e.UnknownDriver="unknown-driver",e.UnknownError="unknown-error",e.UnrecognizedDriver="unrecognized-driver",e.UpdateBroadcastError="start-broadcast-error",e.UpdateMSCError="update-msc-error",e.UserRequired="user-required",e.ValidationError="validation-error",e.WSNetworkError="websocket-network-error",e.WSRequestError="ws-request-error",e.IENotSupported="ie-not-supported"}(r||(t.ErrorCode=r={}))},80769:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isHTMLCanvasElement=t.PlayerFeature=t.ExistsStreamPolicy=t.isWebrtcFormat=t.isValidFormat=t.isManifest=t.isGenericFormat=t.ErrorCode=t.AdapterFeature=void 0;const n=r(31635);var i=r(51327);Object.defineProperty(t,"AdapterFeature",{enumerable:!0,get:function(){return i.Feature}}),n.__exportStar(r(51356),t),n.__exportStar(r(7776),t);var o=r(36147);Object.defineProperty(t,"ErrorCode",{enumerable:!0,get:function(){return o.ErrorCode}});var a=r(84368);Object.defineProperty(t,"isGenericFormat",{enumerable:!0,get:function(){return a.isGenericFormat}}),Object.defineProperty(t,"isManifest",{enumerable:!0,get:function(){return a.isManifest}}),Object.defineProperty(t,"isValidFormat",{enumerable:!0,get:function(){return a.isValidFormat}}),Object.defineProperty(t,"isWebrtcFormat",{enumerable:!0,get:function(){return a.isWebrtcFormat}});var s=r(45111);Object.defineProperty(t,"ExistsStreamPolicy",{enumerable:!0,get:function(){return s.ExistsStreamPolicy}});var l=r(80165);Object.defineProperty(t,"PlayerFeature",{enumerable:!0,get:function(){return l.Feature}}),n.__exportStar(r(15078),t);var c=r(67099);Object.defineProperty(t,"isHTMLCanvasElement",{enumerable:!0,get:function(){return c.isHTMLCanvasElement}})},84368:(e,t)=>{"use strict";function r(e){const t=e;return"object"==typeof t&&"object"==typeof t.origin&&"string"==typeof t.origin.callId}function n(e){const t=e;return"object"==typeof t&&(Array.isArray(t.encodings)||null!=t.substitute)}Object.defineProperty(t,"__esModule",{value:!0}),t.isManifest=function(e){return null!=e&&("string"==typeof e?e.startsWith("http://")||e.startsWith("https://")||e.startsWith("://"):"object"==typeof e&&"formats"in(null!=e?e:{}))},t.isManifestObject=function(e){return null!=e&&("object"==typeof e&&"formats"in(null!=e?e:{}))},t.isWebrtcFormat=r,t.isGenericFormat=n,t.isValidFormat=function(e){return r(e)||n(e)}},45111:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.ExistsStreamPolicy=void 0,function(e){e[e.stale=0]="stale",e[e.wait=1]="wait",e[e.ignore=2]="ignore",e[e.error=3]="error"}(r||(t.ExistsStreamPolicy=r={}))},97403:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PlayerOptions=t.PlayerDriverOptions=t.ManifestOptions=t.FlvHttpDriverOptions=t.FlvHttpDriverFull=t.FlvHttpDriverID=t.Mp4WsDriverOptions=t.Mp4WsDriverFull=t.Mp4WsDriverID=t.NativeHlsDriverOptions=t.NativeHlsDriverFull=t.NativeHlsDriverID=t.HlsjsDriverOptions=t.HlsjsDriverFull=t.HlsjsDriverID=t.WebrtcDriverOptions=t.WebrtcDriverFull=t.WebrtcDriverID=void 0;const n=r(21614),i=r(86729),o=r(37699);function a(e){return(t,r)=>{null!=t&&i.device.isImplements(i.Feature.DEBUGGING)&&i.device.console.warn(`[deprecated] ${r.path.join(".")} is deprecated: ${e}`)}}const s=n.z.object({timeout:n.z.number().min(1e3).max(3e4).default(1e4).describe("timeout to start player in ms"),bitrate:n.z.number().optional().superRefine(a("use 'preferredLevel' from root options instead")),muted:n.z.boolean().optional().superRefine(a("use 'muted' from root options instead")),volume:n.z.number().optional().superRefine(a("use 'volume' from root options instead")),autoPlay:n.z.boolean().optional().superRefine(a("use 'autoPlay' from root options instead")),preset:n.z.null().optional().superRefine(a("use 'preferredLevel' from root options instead"))});t.WebrtcDriverID=n.z.literal("webrtc"),t.WebrtcDriverFull=s.extend({id:t.WebrtcDriverID,joinLoadbalancerFallback:n.z.boolean().default(!0).describe("Fallback to loadbalancer if direct connection fails")}),t.WebrtcDriverOptions=t.WebrtcDriverID.or(t.WebrtcDriverFull).transform((e=>"string"==typeof e?t.WebrtcDriverFull.parse({id:e}):e)),t.HlsjsDriverID=n.z.literal("hlsjs"),t.HlsjsDriverFull=s.extend({id:t.HlsjsDriverID,hlsjsConfig:n.z.object({debug:n.z.boolean().default(!1).describe("Enable hls.js debug mode"),maxBufferLength:n.z.number().default(30).describe("Maximum buffer length in seconds"),maxBufferSize:n.z.number().default(6e7).describe("Maximum buffer size in bytes"),fragLoadingTimeOut:n.z.number().default(3900).describe("Fragment loading timeout in milliseconds"),maxBufferHole:n.z.number().default(2).describe("'Maximum' inter-fragment buffer hole tolerance that hls.js can cope with when searching for the next fragment to load"),backBufferLength:n.z.number().default(90).describe("The maximum duration of buffered media to keep once it has been played, in seconds"),progressive:n.z.boolean().default(!1).describe("Enable streaming segment data with fetch loader (experimental)"),startLevel:n.z.number().default(-1).describe("When set, use this level as the default hls.startLevel")}).passthrough().optional().describe("Fine-tuning hls.js config from https://github.com/video-dev/hls.js/blob/master/docs/API.md#fine-tuning"),hlsjsPath:n.z.string().optional().describe("Path to custom hls.js library"),estimatedKbps:n.z.number().optional().superRefine(a("use 'preferredLevel' from root options instead")),maxBufferSize:n.z.number().optional().superRefine(a("use 'hlsjsConfig.maxBufferSize' instead")),maxBufferLength:n.z.number().optional().superRefine(a("use 'hlsjsConfig.maxBufferLength' instead")),debug:n.z.boolean().optional().superRefine(a("use 'hlsjsConfig.debug' instead"))}),t.HlsjsDriverOptions=t.HlsjsDriverID.or(t.HlsjsDriverFull).transform((e=>"string"==typeof e?t.HlsjsDriverFull.parse({id:e}):e)),t.NativeHlsDriverID=n.z.literal("native-hls"),t.NativeHlsDriverFull=s.extend({id:t.NativeHlsDriverID}),t.NativeHlsDriverOptions=t.NativeHlsDriverID.or(t.NativeHlsDriverFull).transform((e=>"string"==typeof e?t.NativeHlsDriverFull.parse({id:e}):e)),t.Mp4WsDriverID=n.z.literal("mp4ws"),t.Mp4WsDriverFull=s.extend({id:t.Mp4WsDriverID,maxShifts:n.z.number().optional(),requiredBuffer:n.z.number().optional(),requiredBufferBeforeRemove:n.z.number().optional(),backFill:n.z.number().optional(),maxGap:n.z.number().optional(),retry:n.z.number().optional(),mode:n.z.enum(["N","B","N"]).optional(),download:n.z.boolean().optional(),segmentDuration:n.z.number().optional(),initFailTimeout:n.z.number().optional(),playbackFailTimeout:n.z.number().optional(),skipWatchInterval:n.z.number().optional(),skipForwardThreshold:n.z.number().optional(),bitrate:n.z.number().optional(),estimatedKbps:n.z.number().optional(),origin:n.z.boolean().optional()}),t.Mp4WsDriverOptions=t.Mp4WsDriverID.or(t.Mp4WsDriverFull).transform((e=>"string"==typeof e?t.Mp4WsDriverFull.parse({id:e}):e)),t.FlvHttpDriverID=n.z.literal("flvhttp"),t.FlvHttpDriverFull=s.extend({id:t.FlvHttpDriverID}),t.FlvHttpDriverOptions=t.FlvHttpDriverID.or(t.FlvHttpDriverFull).transform((e=>"string"==typeof e?t.FlvHttpDriverFull.parse({id:e}):e));const l=n.z.object({default:n.z.number().default(5e3).describe("Manifest polling interval in ms"),unauthorized:n.z.number().default(2e3).describe("Manifest polling interval in ms for 401, 403 codes"),notfound:n.z.number().default(1e4).describe("Manifest polling interval in ms for 404 code")});t.ManifestOptions=n.z.object({polling:l.default((()=>l.parse({}))),refetch:n.z.number().default(1e4).describe("Manifest refetch timeout for 401, 403 codes. 0 - means no re-fetch at all"),params:n.z.record(n.z.string()).default({substitute:"false",vdc:"true"}).describe("Additional query params for manifest requests")});const c=n.z.union([t.WebrtcDriverOptions,t.HlsjsDriverOptions,t.NativeHlsDriverOptions,t.Mp4WsDriverOptions,t.FlvHttpDriverOptions]),u=n.z.union([n.z.boolean(),n.z.literal("preview"),n.z.object({videoHeight:n.z.number(),videoWidth:n.z.number()})]);t.PlayerDriverOptions=n.z.array(c).default(["webrtc","hlsjs","flvhttp"]).refine((e=>{const t=e.map((e=>e.id));return t.length===new Set(t).size}),{message:"duplicates are not allowed"}).describe("Request specific drivers with options"),t.PlayerOptions=n.z.object({experimental:n.z.boolean().default(!1).describe("Use experimental player"),autoPlay:n.z.boolean().default(!0).describe("Start playback automatically"),muted:n.z.boolean().default(!1).describe("Mute playback by default"),volume:n.z.number().min(0).max(1).default(.5).describe("Set initial volume"),displayPoster:u.default(!0).describe("Display poster before playback"),preferredScoreLevel:n.z.nativeEnum(o.TranscodeScoreLevel).or(n.z.nativeEnum(o.SourceScoreLevel)).optional().describe("Preferred score level for transcoded or source streams"),drivers:t.PlayerDriverOptions,manifest:t.ManifestOptions.default((()=>t.ManifestOptions.parse({}))),players:n.z.array(c).optional().superRefine(a("use 'drivers' instead")),driverFailoverSeconds:n.z.number().optional().superRefine(a("use 'timeout' from driver options instead")),mutedAutoplayFallback:n.z.boolean().optional().superRefine(a("option does nothing now")),blurred:n.z.boolean().optional().superRefine(a("option does nothing now")),retryCall:n.z.boolean().optional().superRefine(a("use 'joinLoadbalancerFallback' from webrtc instead")),pollingInterval:n.z.number().optional().superRefine(a("use 'manifest.polling.default' instead")),notFoundPollingInterval:n.z.number().optional().superRefine(a("use 'manifest.polling.notfound' instead")),unauthorizedPollingInterval:n.z.number().optional().superRefine(a("use 'manifest.polling.unauthorized' instead")),unauthorizedRecoveryDuration:n.z.number().optional().superRefine(a("use 'manifest.refetch' instead")),refetch:n.z.boolean().optional().superRefine(a("use 'manifest.refetch = 0' instead")),urlParams:n.z.record(n.z.any()).optional().superRefine(a("use 'manifest.params' instead"))}).transform((e=>{if(null!=e.players&&(e.drivers=t.PlayerDriverOptions.parse(e.players),delete e.players),null!=e.driverFailoverSeconds){const t=1e3*e.driverFailoverSeconds;e.drivers=e.drivers.map((e=>({...e,timeout:t}))),delete e.driverFailoverSeconds}return null!=e.retryCall&&(e.drivers=e.drivers.map((t=>"webrtc"===t.id?{...t,joinLoadbalancerFallback:Boolean(e.retryCall)}:t)),delete e.retryCall),delete e.mutedAutoplayFallback,delete e.blurred,null!=e.pollingInterval&&(e.manifest.polling.default=e.pollingInterval,delete e.pollingInterval),null!=e.notFoundPollingInterval&&(e.manifest.polling.notfound=e.notFoundPollingInterval,delete e.notFoundPollingInterval),null!=e.unauthorizedPollingInterval&&(e.manifest.polling.unauthorized=e.unauthorizedPollingInterval,delete e.unauthorizedPollingInterval),null!=e.unauthorizedRecoveryDuration&&(e.manifest.refetch=e.unauthorizedRecoveryDuration,delete e.unauthorizedRecoveryDuration),!1===e.refetch&&(e.manifest.refetch=0,delete e.refetch),null!=e.urlParams&&(e.manifest.params=Object.fromEntries(Object.entries(e.urlParams).map((([e,t])=>[e,String(t)]))),delete e.urlParams),e})).readonly()},72416:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.players=void 0;const n=r(65519),i=r(35592),o=r(3824),a=r(56255),s=r(98469);t.players={"native-hls":a.NativeHlsPlayer,hlsjs:i.HlsJsPlayer,webrtc:s.WebrtcPlayer,mp4ws:o.Mp4WsPlayer,flvhttp:n.FlvHttpPlayer}},37699:(e,t)=>{"use strict";var r,n,i,o;Object.defineProperty(t,"__esModule",{value:!0}),t.AutoScoreLevel=t.AutoQualityLevel=t.SourceScoreLevel=t.TranscodeScoreLevel=void 0,function(e){e.Lowest="transcode:lowest",e.Low="transcode:low",e.MediumLow="transcode:medium-low",e.Medium="transcode:medium",e.MediumHigh="transcode:medium-high",e.High="transcode:high",e.Highest="transcode:highest"}(r||(t.TranscodeScoreLevel=r={})),function(e){e.Low="source:low",e.Medium="source:medium",e.High="source:high"}(n||(t.SourceScoreLevel=n={})),function(e){e.Auto="auto-quality"}(i||(t.AutoQualityLevel=i={})),function(e){e.Default="auto:default",e.Auto="auto:auto"}(o||(t.AutoScoreLevel=o={}))},80165:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.Feature=void 0,function(e){e[e.DURATION=0]="DURATION",e[e.CONSUMER=1]="CONSUMER",e[e.MUTED_AUTOPLAY=2]="MUTED_AUTOPLAY",e[e.BITRATE_SWITCHING=3]="BITRATE_SWITCHING",e[e.PLAYER_SELECTOR=4]="PLAYER_SELECTOR",e[e.BROADCAST=5]="BROADCAST"}(r||(t.Feature=r={}))},15078:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AutoQualityLevel=t.TranscodeScoreLevel=t.SourceScoreLevel=void 0;var n=r(37699);Object.defineProperty(t,"SourceScoreLevel",{enumerable:!0,get:function(){return n.SourceScoreLevel}}),Object.defineProperty(t,"TranscodeScoreLevel",{enumerable:!0,get:function(){return n.TranscodeScoreLevel}}),Object.defineProperty(t,"AutoQualityLevel",{enumerable:!0,get:function(){return n.AutoQualityLevel}})},67831:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Feature=void 0;const n=r(31635);var i=r(80165);Object.defineProperty(t,"Feature",{enumerable:!0,get:function(){return i.Feature}}),n.__exportStar(r(15078),t)},31818:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isErrorLike=function(e){return null!=e&&"object"==typeof e&&(void 0!==e.message&&void 0!==e.name)},t.isOverconstrainedError=function(e){return void 0!==e.constraint&&void 0!==e.name&&void 0!==e.message}},26156:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.MediaErrorCodeConstants=void 0,t.isMediaStream=function(e){return"object"==typeof e&&null!=e&&("getAudioTracks"in e&&"getVideoTracks"in e)},t.isVideoElement=function(e){return void 0!==(null==e?void 0:e.src)},function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.MEDIA_ERR_ABORTED=1]="MEDIA_ERR_ABORTED",e[e.MEDIA_ERR_NETWORK=2]="MEDIA_ERR_NETWORK",e[e.MEDIA_ERR_DECODE=3]="MEDIA_ERR_DECODE",e[e.MEDIA_ERR_SRC_NOT_SUPPORTED=4]="MEDIA_ERR_SRC_NOT_SUPPORTED",e[e.MEDIA_ERR_ENCRYPTED=5]="MEDIA_ERR_ENCRYPTED"}(r||(t.MediaErrorCodeConstants=r={}))},97362:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MediaElementSupervisor=t.AutoQualityLevel=t.SourceScoreLevel=t.TranscodeScoreLevel=t.ObservableEventEmitter=t.InstanceCollector=t.makeBounded=t.timeupdateWrapper=t.UserInteraction=t.applyUserInteractionHook=t.instanceId=t.contextId=t.RecorderCore=t.utils=t.CONSTRAINTS_SCREENCAPTURE_OPTIMAL_WEAK=t.CONSTRAINTS_VIDEO_OPTIMAL_WEAK=t.CONSTRAINTS_VIDEO_OPTIMAL_STRICT=t.CONSTRAINTS_AUDIO_OPTIMAL_WEAK=t.CONSTRAINTS_AUDIO_OPTIMAL_STRICT=t.errors=t.player=t.types=t.mediaController=t.VideoClient=t.adapter=void 0;const n=r(31635),i=r(27813);t.adapter=n.__importStar(r(86729));const o=r(64691),a=r(66543),s=r(18409);t.VideoClient=s.VideoClient,t.mediaController=o.mediaController,t.types=n.__importStar(r(80769)),t.player=n.__importStar(r(67831)),t.errors=n.__importStar(r(92491));var l=r(64691);Object.defineProperty(t,"CONSTRAINTS_AUDIO_OPTIMAL_STRICT",{enumerable:!0,get:function(){return l.CONSTRAINTS_AUDIO_OPTIMAL_STRICT}}),Object.defineProperty(t,"CONSTRAINTS_AUDIO_OPTIMAL_WEAK",{enumerable:!0,get:function(){return l.CONSTRAINTS_AUDIO_OPTIMAL_WEAK}}),Object.defineProperty(t,"CONSTRAINTS_VIDEO_OPTIMAL_STRICT",{enumerable:!0,get:function(){return l.CONSTRAINTS_VIDEO_OPTIMAL_STRICT}}),Object.defineProperty(t,"CONSTRAINTS_VIDEO_OPTIMAL_WEAK",{enumerable:!0,get:function(){return l.CONSTRAINTS_VIDEO_OPTIMAL_WEAK}}),Object.defineProperty(t,"CONSTRAINTS_SCREENCAPTURE_OPTIMAL_WEAK",{enumerable:!0,get:function(){return l.CONSTRAINTS_SCREENCAPTURE_OPTIMAL_WEAK}}),t.utils=n.__importStar(r(75440));var c=r(30434);Object.defineProperty(t,"RecorderCore",{enumerable:!0,get:function(){return c.Recorder}});var u=r(59703);Object.defineProperty(t,"contextId",{enumerable:!0,get:function(){return u.contextId}}),Object.defineProperty(t,"instanceId",{enumerable:!0,get:function(){return u.instanceId}}),Object.defineProperty(t,"applyUserInteractionHook",{enumerable:!0,get:function(){return u.applyUserInteractionHook}});var d=r(42615);Object.defineProperty(t,"UserInteraction",{enumerable:!0,get:function(){return d.UserInteraction}});var h=r(69591);Object.defineProperty(t,"timeupdateWrapper",{enumerable:!0,get:function(){return h.timeupdateWrapper}});var p=r(54873);Object.defineProperty(t,"makeBounded",{enumerable:!0,get:function(){return p.makeBounded}});var f=r(30799);Object.defineProperty(t,"InstanceCollector",{enumerable:!0,get:function(){return f.InstanceCollector}});var m=r(45831);Object.defineProperty(t,"ObservableEventEmitter",{enumerable:!0,get:function(){return m.ObservableEventEmitter}});var g=r(37699);Object.defineProperty(t,"TranscodeScoreLevel",{enumerable:!0,get:function(){return g.TranscodeScoreLevel}}),Object.defineProperty(t,"SourceScoreLevel",{enumerable:!0,get:function(){return g.SourceScoreLevel}}),Object.defineProperty(t,"AutoQualityLevel",{enumerable:!0,get:function(){return g.AutoQualityLevel}});var v=r(73146);Object.defineProperty(t,"MediaElementSupervisor",{enumerable:!0,get:function(){return v.MediaElementSupervisor}}),(0,i.configure)({observableRequiresReaction:!1,reactionRequiresObservable:!1,enforceActions:"never"}),(0,a.startMobxDebugging)()},65414:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isSafari=function(e){return"Safari"===e.browserInfo.browserName},t.isAndroidDevice=function(e){let t=!1;return null!=e.userAgent&&(t=/Android/.test(e.userAgent)),t},t.isIosDevice=function(e){return null!=e.platform&&(!("macOS"!==e.platform&&"MacIntel"!==e.platform||!e.isImplements(a.Feature.MULTI_TOUCH))||["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod","iOS"].includes(e.platform))},t.isMobileDevice=function(e){if(e.isImplements(a.Feature.USER_AGENT_DATA)&&null!=e.userAgentData)return e.userAgentData.mobile;if(e.isImplements(a.Feature.MULTI_TOUCH))return!0;if(null!=e.userAgent){const t=i.default.getParser(e.userAgent).getPlatform().type;if(null!=t)return"mobile"===t;if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(e.userAgent))return!0}return!1},t.isFirefox=function(e){return"Firefox"===e.browserInfo.browserName},t.isChrome=function(e){var t,r;if(e.isImplements(a.Feature.USER_AGENT_DATA)&&null!=(null===(t=e.userAgentData)||void 0===t?void 0:t.brands)){const t=e=>["Google Chrome"].includes(e.brand);return null===(r=e.userAgentData)||void 0===r?void 0:r.brands.some(t)}return null!=e.browserInfo.browserName&&"Chrome"===e.browserInfo.browserName},t.supportsModernChrome=function(e){var t;if(e.isImplements(a.Feature.USER_AGENT_DATA)&&null!=(null===(t=e.highEntropyValues)||void 0===t?void 0:t.fullVersionList)){const t=e=>["Google Chrome"].includes(e.brand),r=e.highEntropyValues.fullVersionList.find(t),n=o.default.coerce(null==r?void 0:r.version);if(n)return o.default.gte(n,"14.3.0")}if(null!=e.appVersion&&e.isChrome){const t=o.default.coerce(e.appVersion);if(t)return o.default.gte(t,"14.3.0")}return!1},t.isEdge=function(e){var t,r;if(e.isImplements(a.Feature.USER_AGENT_DATA)&&null!=(null===(t=e.userAgentData)||void 0===t?void 0:t.brands)){const t=e=>["Edge"].includes(e.brand);return null===(r=e.userAgentData)||void 0===r?void 0:r.brands.some(t)}return null!=e.browserInfo.browserName&&("Microsoft Edge"===e.browserInfo.browserName||"Edge"===e.browserInfo.browserName)},t.isIE=function(e){return"Internet Explorer"===e.browserInfo.browserName},t.oldWindowsChrome=function(e){var t;if(!e.isWindows||!e.isChrome)return!1;if(e.isImplements(a.Feature.USER_AGENT_DATA)&&null!=(null===(t=e.highEntropyValues)||void 0===t?void 0:t.fullVersionList)){const t=e=>["Google Chrome"].includes(e.brand),r=e.highEntropyValues.fullVersionList.find(t),n=o.default.coerce(null==r?void 0:r.version);if(n)return o.default.lt(n,"52.0.0")}if(null!=e.appVersion){const t=o.default.coerce(e.appVersion);if(t)return o.default.lt(t,"52.0.0")}return!1},t.isWindows=function(e){return"Windows"===e.browserInfo.platform},t.chromeWithoutMp4Support=function(e){var t;if(!e.isChrome)return!1;if(e.isImplements(a.Feature.USER_AGENT_DATA)&&null!=(null===(t=e.highEntropyValues)||void 0===t?void 0:t.fullVersionList)){const t=e=>["Google Chrome"].includes(e.brand),r=e.highEntropyValues.fullVersionList.find(t),n=o.default.coerce(null==r?void 0:r.version);if(n)return o.default.lte(n,"49.0.0")}if(null!=e.appVersion){const t=o.default.coerce(e.appVersion);if(t)return o.default.lte(t,"49.0.0")}return!1},t.safariWithoutMp4Support=function(e){if(!e.isSafari)return!1;if(null!=e.appVersion){const t=o.default.coerce(e.appVersion);if(t)return o.default.lt(t,"10.0.0")}return!1},t.safariLessThan14=function(e){if(null!=e.appVersion&&e.isSafari){const t=o.default.coerce(e.appVersion);if(t)return o.default.lt(t,"14.0.0")}return!1},t.hasPermissionsChangeSupport=function(e){if(e.isIE)return!1;if(null!=e.appVersion&&e.isSafari){const t=o.default.coerce(e.appVersion);if(t)return o.default.gte(t,"16.4.0")}if(null!=e.appVersion&&e.isEdge){const t=o.default.coerce(e.appVersion);if(t)return o.default.gte(t,"79.0.0")}if(null!=e.appVersion&&e.isChrome){const t=o.default.coerce(e.appVersion);if(t)return o.default.gte(t,"43.0.0")}return!0};const n=r(31635),i=n.__importDefault(r(46880)),o=n.__importDefault(r(99589)),a=r(51327)},79852:(e,t,r)=>{"use strict";var n,i,o,a=r(65606);Object.defineProperty(t,"__esModule",{value:!0}),t.WebDevice=void 0;const s=r(31635),l=r(82837),c=s.__importDefault(r(46880)),u=r(51327),d=r(80769),h=r(42615),p=r(65414),f=null!==(n=globalThis)&&void 0!==n?n:function(){return this}(),m=null!==(i=a.env.HLSJS_URL)&&void 0!==i?i:"https://cdnjs.cloudflare.com/ajax/libs/hls.js/1.4.14/hls.min.js";"false"!==a.env.HLSJS_BUNDLED&&(f.Hls=r(39473));const g=null!==(o=a.env.MPEGTS_URL)&&void 0!==o?o:"https://cdn-us.threadsafesystems.com/mpegts.min.js";if("false"!==a.env.MPEGTS_BUNDLED)try{f.mpegts=r(28579)}catch(e){}class v extends Error{constructor(e,t){super(`${e} is not supported. ${t||""}`)}}class y{constructor(){var e,t;this.hadUserInteraction=!1,this.canvasElement=null,this.highEntropyValues=null,this.platform=null,this.appVersion=null,this.browserName=null,this.setTimeout=setTimeout.bind(f),this.clearTimeout=clearTimeout.bind(f),this.clearInterval=clearInterval.bind(f);const r=null===(t=null===(e=null==f?void 0:f.navigator)||void 0===e?void 0:e.storage)||void 0===t?void 0:t.estimate;"function"==typeof r&&(this.storageEstimate=r.bind(f.navigator.storage)),this.logger=new l.LoggerCore("VDC-core").setLoggerMeta("client","VDC").appendChain(y),f||this.logger.error("globalScope is undefined"),(null==f?void 0:f.navigator)||this.logger.info("globalScope navigator is undefined"),"object"!=typeof f.__VDC_VARS__&&(f.__VDC_VARS__=new Map),this.globals=f.__VDC_VARS__,this.isImplements(u.Feature.CREATE_CANVAS_ELEMENT)&&(this.canvasElement=this.createCanvasElement()),this.getUserAgentInfo()}applyUserInteractionHook(){const e=new h.UserInteraction({silentAudio:{playSilentAudio:!0,infiniteLoop:!1}});f.document.addEventListener("beforeunload",e.dispose)}toggleCameraVisibility(e){if(this.isIosDevice)e.videoPaused=!e.videoPaused;else{if("placeholder"===e.videoDisabled)return;e.videoDisabled=!e.videoDisabled}}processRtpCapabilities(e,t){return t}get userAgent(){var e,t;return null!==(t=null===(e=null==f?void 0:f.navigator)||void 0===e?void 0:e.userAgent)&&void 0!==t?t:""}get userAgentData(){var e;return null===(e=null==f?void 0:f.navigator)||void 0===e?void 0:e.userAgentData}async getUserAgentInfo(){var e;const t=c.default.getParser(this.userAgent);if(this.platform=null==t?void 0:t.getOSName(),this.appVersion=null==t?void 0:t.getBrowserVersion(),this.browserName=null==t?void 0:t.getBrowserName(),null!=this.userAgentData)try{this.highEntropyValues=await this.userAgentData.getHighEntropyValues(["brands","mobile","model","platform","platformVersion","fullVersionList"]),this.platform=null!==(e=this.highEntropyValues.platform)&&void 0!==e?e:null==t?void 0:t.getOSName()}catch(e){}this.isIosDevice=(0,p.isIosDevice)(this),this.isAndroidDevice=(0,p.isAndroidDevice)(this),this.isMobileDevice=(0,p.isMobileDevice)(this),this.isSafari=(0,p.isSafari)(this),this.isFirefox=(0,p.isFirefox)(this),this.isChrome=(0,p.isChrome)(this),this.isEdge=(0,p.isEdge)(this),this.isIE=(0,p.isIE)(this),this.isWindows=(0,p.isWindows)(this)}get browserInfo(){return{highEntropyValues:this.highEntropyValues,platform:this.platform,appVersion:this.appVersion,browserName:this.browserName,isIosDevice:this.isIosDevice,isAndroidDevice:this.isAndroidDevice,isMobileDevice:this.isMobileDevice,isSafari:this.isSafari,isFirefox:this.isFirefox,isChrome:this.isChrome,isEdge:this.isEdge,isIE:this.isIE,isWindows:this.isWindows}}get hidden(){var e;return null!==(e=f.document.hidden)&&void 0!==e&&e}get supportFullscreen(){const e=f.document.createElement("video"),t=f.document;return!0===f.document.fullscreenEnabled||!0===t.mozFullScreenEnabled||!0===t.msFullscreenEnabled||!0===t.webkitSupportsFullscreen||!0===t.webkitFullscreenEnabled||null!=e.webkitRequestFullScreen||null!=e.webkitEnterFullScreen}get onLine(){var e,t;return null===(t=null===(e=null==f?void 0:f.navigator)||void 0===e?void 0:e.onLine)||void 0===t||t}get location(){return(null==f?void 0:f.location)||null}get permissions(){var e;return null===(e=null==f?void 0:f.navigator)||void 0===e?void 0:e.permissions}get userActivation(){var e;return(null===(e=null==f?void 0:f.navigator)||void 0===e?void 0:e.userActivation)||null}get maxTouchPoints(){var e;return(null===(e=null==f?void 0:f.navigator)||void 0===e?void 0:e.maxTouchPoints)||null}addEventListener(e,t){null!=f.addEventListener&&f.addEventListener(e,t)}removeEventListener(e,t){null!=f.removeEventListener&&f.removeEventListener(e,t)}setInterval(e,t){return f.setInterval(e,t)}get console(){return f.console}fetch(e,t){return f.fetch(e,t)}get URLSearchParams(){return f.URLSearchParams}get AudioContext(){var e;return null!==(e=f.AudioContext)&&void 0!==e?e:f.webkitAudioContext}get MediaRecorder(){return f.MediaRecorder}get MediaStream(){return f.MediaStream}get WebSocketClient(){return f.WebSocketClient}get RTCRtpReceiver(){return f.RTCRtpReceiver}get RTCRtpSender(){return f.RTCRtpSender}get Uint8Array(){return f.Uint8Array}matchMedia(e){return null==f?void 0:f.matchMedia(e)}get mediaDevices(){var e;return null===(e=null==f?void 0:f.navigator)||void 0===e?void 0:e.mediaDevices}get connection(){var e,t,r,n,i;return null!==(n=null!==(t=null===(e=null==f?void 0:f.navigator)||void 0===e?void 0:e.connection)&&void 0!==t?t:null===(r=null==f?void 0:f.navigator)||void 0===r?void 0:r.mozConnection)&&void 0!==n?n:null===(i=null==f?void 0:f.navigator)||void 0===i?void 0:i.webkitConnection}get localStorage(){return f.localStorage}get performance(){return f.performance}get screenOrientation(){var e,t,r;const n=f.screen;return null!==(r=null!==(t=(null!==(e=n.orientation)&&void 0!==e?e:{}).type)&&void 0!==t?t:n.mozOrientation)&&void 0!==r?r:n.msOrientation}get MediaSource(){return f.MediaSource||f.WebKitMediaSource}get WebSocket(){return f.WebSocket}get SourceBuffer(){return f.SourceBuffer||f.WebKitSourceBuffer}get Hls(){return f.Hls}applyConstraints(e,t){return e.applyConstraints(t)}createVideoElement(){const e=f.document.createElement("video");e.autoplay=!0,e.setAttribute("webkit-playsinline","true"),e.setAttribute("playsinline","true");const t=f.document.createTextNode("Sorry, your browser doesn't support embedded videos.");return e.appendChild(t),e}createAudioElement(){return f.document.createElement("audio")}createCanvasElement(){return f.document.createElement("canvas")}createScreenshot(e){const t=this.canvasElement;return null==t?"":(t.width=e.videoWidth,t.height=e.videoHeight,t.getContext("2d").drawImage(e,0,0,t.width,t.height),t.toDataURL())}supportsMediaStreamCapture(e){const t=null!=(null==e?void 0:e.mozCaptureStream)||null!=(null==e?void 0:e.captureStream);return t||this.logger.debug("mediaStreamCapture not supported"),t}captureStream(e,t){return null!=e.captureStream?(0,d.isHTMLCanvasElement)(e)?e.captureStream(t):e.captureStream():null!=e.mozCaptureStream?(0,d.isHTMLCanvasElement)(e)?e.mozCaptureStream(t):e.mozCaptureStream():(this.logger.debug("mediaStreamCapture not supported"),null)}createVideoStub(){throw new Error("not implemented")}disableCpuStats(){}enableCpuStats(){}averageCpuUsage(e){return 0}isCodecSupported(e){return!1}isHlsLoaded(){try{return null!=this.Hls}catch(e){return!1}}loadHlsScript(e){if(null!=this.hlsPromise)return this.hlsPromise;if(this.isHlsLoaded())return Promise.resolve();const t=null!=e?e:m;return this.hlsPromise=new Promise(((e,r)=>{if(this.isHlsLoaded())return void e();const n=f.document.createElement("script");n.setAttribute("src",null!=t?t:""),n.onload=()=>{this.isHlsLoaded()?e():r(new Error("hlsjs not loaded"))},n.onerror=e=>{r(new Error(`hlsjs not loaded: ${e}`))},f.document.body.appendChild(n)})),this.hlsPromise}get mpegts(){return f.mpegts}isMpegtsLoaded(){try{return null!=this.mpegts}catch(e){return!1}}loadMpegtsScript(e){if(null!=this.mpegtsPromise)return this.mpegtsPromise;if(this.isMpegtsLoaded())return Promise.resolve();const t=null!=e?e:g;return this.mpegtsPromise=new Promise(((e,r)=>{if(this.isMpegtsLoaded())return void e();const n=f.document.createElement("script");n.setAttribute("src",null!=t?t:""),n.onload=()=>{this.isMpegtsLoaded()?e():r(new Error("mpegts not loaded"))},n.onerror=e=>{r(new Error(`mpegts not loaded: ${e}`))},f.document.body.appendChild(n)})),this.mpegtsPromise}showSaveFilePicker(e){return null==f?void 0:f.showSaveFilePicker(e)}confirmMessage(e){null==f||f.confirm(e)}get document(){return f.document}isImplements(e){var t,r;try{switch(e){case u.Feature.NETWORK_INFORMATION:return null!=this.location;case u.Feature.CREATE_VIDEO_ELEMENT:return null!=f.document&&null!=this.createVideoElement;case u.Feature.CREATE_AUDIO_ELEMENT:return null!=f.document&&null!=this.createAudioElement;case u.Feature.CREATE_CANVAS_ELEMENT:return null!=f.document&&null!=this.createCanvasElement;case u.Feature.CREATE_SCREENSHOT:return null!=(null===(t=this.canvasElement)||void 0===t?void 0:t.getContext);case u.Feature.DEBUGGING:return null!=this.console&&null!=this.performance;case u.Feature.DOCUMENT:return null!=this.document;case u.Feature.SCREEN_ORIENTATION:return null!=this.screenOrientation;case u.Feature.MEDIA_RECORDER:return null!=this.MediaRecorder;case u.Feature.APPLY_CONSTRAINTS:return!0;case u.Feature.MEDIA_DEVICE:return null!=this.mediaDevices;case u.Feature.MATCH_MEDIA:return null!=this.matchMedia;case u.Feature.MEDIA_STREAM:return null!=this.MediaStream;case u.Feature.MEDIA_SOURCE:return null!=this.MediaSource&&null!=this.SourceBuffer;case u.Feature.WEB_SOCKET:case u.Feature.WEB_SOCKET_CLIENT:return null!=this.WebSocket;case u.Feature.LOCAL_STORAGE:try{return null!=this.localStorage}catch(e){return!1}case u.Feature.AUDIO_CONTEXT:return null!=this.AudioContext;case u.Feature.URL_LOCATION:return null!=this.location;case u.Feature.URL_SEARCHPARAMS:return null!=this.URLSearchParams;case u.Feature.CPU_USAGE:return!1;case u.Feature.HLSJS:return!0;case u.Feature.PERMISSIONS:return null!=this.permissions;case u.Feature.USER_ACTIVATION:return null!=this.userActivation;case u.Feature.USER_AGENT_DATA:return null!=this.userAgentData;case u.Feature.MULTI_TOUCH:return null!=this.maxTouchPoints&&this.maxTouchPoints>1;case u.Feature.WEBRTC:return null!=(null===(r=this.RTCRtpReceiver)||void 0===r?void 0:r.getCapabilities)&&null!=this.RTCRtpSender;case u.Feature.MPEGTS:return!0;default:return!1}}catch(e){if(e instanceof v)return!1;throw e}}}t.WebDevice=y,y.displayName="WebDevice"},46329:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Broadcast=void 0;const n=r(43375),i=r(70076),o=r(27813),a=r(98645),s=r(93503),l=r(45831);class c extends l.ObservableEventEmitter{constructor(e,t,r,n,i){var l;super(),this.state="active",this.lastTrafficTS=0,this.lastTrafficBitrate=[],(0,o.makeObservable)(this,{state:o.observable});const c=null==r?void 0:r.streams[i.streamName];if(null==r||null==c)throw new a.StreamNotFoundError("stream not found",{call:t,broadcast:this});this.ctx=e,this.ctrl=n,this.call=t,this.pvcCall=r,this.stream=c,this.options=i,this.options.simulcast&&(this.options.videoProducerOptions=null!==(l=this.options.videoProducerOptions)&&void 0!==l?l:{},this.options.videoProducerOptions.simulcast=this.options.simulcast),this.call.isOwner&&(this.lastTrafficTS=Date.now()),n.on("audioDeviceChanged",this.onAudioDeviceChanged),n.on("videoDeviceChanged",this.onVideoDeviceChanged),n.on("audioMuted",this.onAudioMuted),n.on("videoPaused",this.onVideoPaused),e.logger.attachObject(this),e.logger.trace("constructor()"),this.sourceUpdate().catch((e=>{this.emitErrorDeprecated(new a.UpdateBroadcastError("initial source update error",{broadcast:this,call:this.call,inner:(0,a.wrapNativeError)(e)}))})),(0,s.onceCanceled)(e).then((e=>this.dispose(`Broadcast Class Context Cancelled: ${e}`))),this.addInnerDisposer((()=>{try{this.stop()}catch(e){this.ctx.logger.warn("unable to stop broadcast while disposing",{err:`${e}`})}this.options.disposeController&&this.ctrl.dispose("Broadcast options are set to disposeController")}))}get streamName(){return this.options.streamName}get audioMuted(){return this.ctrl.audioMuted}set audioMuted(e){this.ctrl.audioMuted=e}get videoHidden(){return this.ctrl.videoPaused}set videoHidden(e){this.ctrl.videoPaused=e}pause(){null!=this.ctrl.audioDeviceId&&this.stream.pauseAudio(),null!=this.ctrl.videoDeviceId&&this.stream.pauseVideo(),this.state="paused"}get controller(){return this.ctrl}replaceController(e){this.ctrl=e}resume(){null!=this.ctrl.audioDeviceId&&this.stream.enableAudio(this.options.audioProducerOptions).then((()=>{this.state="active"})).catch((e=>{this.emitErrorDeprecated(new a.UpdateBroadcastError("unable to resume audio device",{broadcast:this,call:this.call,inner:(0,a.wrapNativeError)(e)}))})),null!=this.ctrl.videoDeviceId&&this.stream.enableVideo(this.options.videoProducerOptions).then((()=>{this.state="active"})).catch((e=>{this.emitErrorDeprecated(new a.UpdateBroadcastError("unable to resume video device",{broadcast:this,call:this.call,inner:(0,a.wrapNativeError)(e)}))}))}stop(){this.ctx.logger.debug("stop()"),this.state="closed",this.stream.close(),this.ctrl.off("source",this.sourceUpdate),this.ctrl.off("audioDeviceChanged",this.onAudioDeviceChanged),this.ctrl.off("videoDeviceChanged",this.onVideoDeviceChanged),this.ctrl.off("audioMuted",this.onAudioMuted),this.ctrl.off("videoPaused",this.onVideoPaused),this.pvcCall.removeStream(this.stream.streamName)}async sourceUpdate(){var e,t;if(this.ctx.logger.debug("sourceUpdate()",{audio:this.ctrl.audioDeviceId,video:this.ctrl.videoDeviceId}),null==this.ctrl.videoDeviceId||this.ctrl.videoPaused||this.options.audioOnly||this.ctrl.videoDisabled)this.options.audioOnly&&this.ctx.logger.debug("Broadcast is set to audioOnly, video not produced",{options:this.options});else{const r=this.pvcCall._closed||(null===(e=this.pvcCall.peer)||void 0===e?void 0:e._closed);try{await this.pvcCall.enableVideo(this.stream.streamName,!0,!1,this.options.videoProducerOptions)}catch(e){const n=this.pvcCall._closed||(null===(t=this.pvcCall.peer)||void 0===t?void 0:t._closed);if(!r&&n)return;this.emitErrorDeprecated(new a.EnableVideoError("unable to enable video on `source` event",{inner:(0,a.wrapNativeError)(e),broadcast:this,call:this.call}))}}if(null==this.ctrl.audioDeviceId||this.ctrl.audioMuted||this.options.videoOnly)this.options.videoOnly&&this.ctx.logger.debug("Broadcast is set to videoOnly, audio not produced",{options:this.options});else try{await this.pvcCall.enableAudio(this.stream.streamName,!0,!1,this.options.audioProducerOptions)}catch(e){this.emitErrorDeprecated(new a.EnableAudioError("unable to enable audio on `source` event",{inner:(0,a.wrapNativeError)(e),broadcast:this,call:this.call}))}}async onAudioDeviceChanged(e){if(this.ctx.logger.debug("audioDeviceChanged()",{device:e}),null==e)try{await this.pvcCall.disableAudio(this.stream.streamName)}catch(e){if(e instanceof i.types.InvalidStateError&&"track ended"===e.message)return void this.ctx.logger.warn("broadcast has not been updated because the audio track is ended");const t=e instanceof Error?e:null;this.emitErrorDeprecated(new a.DisableAudioError("unable to disable audio on `audioDeviceChanged` event",{inner:t,broadcast:this,call:this.call}))}else try{await this.pvcCall.enableAudio(this.stream.streamName,!0,!1,this.options.audioProducerOptions)}catch(e){if(e instanceof i.types.InvalidStateError&&"track ended"===e.message)return void this.ctx.logger.warn("broadcast has not been updated because the audio track is ended");const t=e instanceof Error?e:null;this.emitErrorDeprecated(new a.EnableAudioError("unable to enable audio on `audioDeviceChanged` event",{inner:t,broadcast:this,call:this.call}))}}async onVideoDeviceChanged(e){if(this.ctx.logger.debug("videoDeviceChanged()",{device:e}),null==e)try{await this.pvcCall.disableVideo(this.stream.streamName)}catch(e){if(e instanceof i.types.InvalidStateError&&"track ended"===e.message)return void this.ctx.logger.warn("broadcast has not been updated because the video track is ended");const t=e instanceof Error?e:null;this.emitErrorDeprecated(new a.DisableVideoError("unable to disable video on `videoDeviceChanged` event",{inner:t,broadcast:this,call:this.call}))}else try{await this.pvcCall.enableVideo(this.stream.streamName,!0,!1,this.options.videoProducerOptions)}catch(e){if(e instanceof i.types.InvalidStateError&&"track ended"===e.message)return void this.ctx.logger.warn("broadcast has not been updated because the video track is ended");this.emitErrorDeprecated(new a.EnableVideoError("unable to enable video on `videoDeviceChanged` event",{inner:(0,a.wrapNativeError)(e),broadcast:this,call:this.call}))}}async onAudioMuted(e){if(this.ctx.logger.debug("audioMuted()",{value:e}),this.ctrl.hasActiveAudioTrack())if(e)try{await this.pvcCall.muteAudio(this.stream.streamName)}catch(e){this.emitErrorDeprecated(new a.EnableAudioError("unable to mute audio on `audioMuted` event",{inner:(0,a.wrapNativeError)(e),broadcast:this,call:this.call}))}else try{await this.pvcCall.unmuteAudio(this.stream.streamName,this.options.audioProducerOptions)}catch(e){this.emitErrorDeprecated(new a.DisableAudioError("unable to unmute audio on `audioMuted` event",{inner:(0,a.wrapNativeError)(e),broadcast:this,call:this.call}))}}async onVideoPaused(e){if(this.ctx.logger.debug("videoPaused()",{value:e}),this.ctrl.hasActiveVideoTrack())if(e)try{await this.pvcCall.pauseVideo(this.stream.streamName)}catch(e){const t=e instanceof Error?e:null;this.emitErrorDeprecated(new a.DisableVideoError("unable to pause video on `videoPaused` event",{inner:t,broadcast:this,call:this.call}))}else try{await this.pvcCall.unpauseVideo(this.stream.streamName,this.options.videoProducerOptions)}catch(e){const t=e instanceof Error?e:null;this.emitErrorDeprecated(new a.EnableVideoError("unable to unpause video on `videoPaused` event",{inner:t,broadcast:this,call:this.call}))}}async hotswapProducer(e,t){this.ctx.logger.debug("hotswapProducer()",{kind:e,producerOptions:t}),await this.pvcCall.hotswapProducer(e,this.streamName,t)}toJSON(){return{msc:this.controller,stream:this.stream,options:this.options,aggregates:{...(0,n.extractAggregates)(this.stream,"support"),support:this.ctx.support.hash,state:this.state}}}}t.Broadcast=c,c.displayName="Broadcast"},22604:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Call=void 0;const n=r(31635),i=r(14223),o=r(27813),a=r(80769),s=r(46329),l=r(92491),c=r(98645),u=r(58636),d=n.__importDefault(r(98755)),h=r(54873),p=r(93503),f=r(45831),m=r(80366),g=r(31755),v=n.__importDefault(r(45799)),y=r(54442),b=n.__importDefault(r(18741)),_="v2",S=new g.EventsHandler;class w extends f.ObservableEventEmitter{constructor(e,t,r,n){super(!1),this.state="active",this.failover=[],this.failoverCallUrls=[],this.region=null,this.auth=void 0,this.pvcCall=null,this.connectedPeers=[],this.joinUrl=null,this.failoverJoinUrls=[],this.broadcasts=new Map,this.isOwner=!1,(0,o.makeObservable)(this,{broadcasts:o.observable}),this.ctx=e,(0,p.onceCanceled)(e).then((e=>this.dispose(`VideoClient Context Cancelled: ${e}`)));const i=(0,h.makeBounded)(new Proxy(this,S));return i.init(t,r,n),e.logger.attachObject(i),e.logger.trace("constructor()"),i}init(e,t,r){var n,i,o,s,c,u;if(this.isOwner=e,this.options=t,0===(null!==(i=null===(n=t.backendEndpoints)||void 0===n?void 0:n.length)&&void 0!==i?i:0)&&null==this.options.sfu.joinUrl&&this.throwError((0,l.createError)(a.ErrorCode.NoBackendEndpoints,"backendEndpoints or joinUrl are required",{})),this.joinUrl=null!==(o=this.options.sfu.joinUrl)&&void 0!==o?o:null,null!=t.backendEndpoints){const[e,...r]=t.backendEndpoints;this.backendEndpoint=e,this.failover=r,this.callUrl=`${e}/lb/calls`,this.failoverCallUrls=r.map((e=>`${e}/lb/calls`)),null==this.joinUrl&&(this.joinUrl=`${this.backendEndpoint}/lb/${_}/calls/${this.options.callId}/join`,this.failoverJoinUrls=this.failover.map((e=>`${e}/lb/${_}/calls/${this.options.callId}/join`)))}"string"==typeof t.token?this.token=t.token:this.tokenRefresher=t.token,null!=t.callId&&this.emit("callId",{callId:t.callId,user:null!==(c=null===(s=this.pvcCall)||void 0===s?void 0:s.user)&&void 0!==c?c:null}),this.auth=new b.default({bootstrap:{token:this.token,refreshToken:this.tokenRefresher}});const{callId:d}=this.options,h=null!==(u=t.sfu)&&void 0!==u?u:{};this.readyPromise=(async()=>{const e=await(0,y.retry)(0,1e3,this.createInternalCall.bind(this,d,t,r,h),this.ctx.logger);this.pvcCall=e})(),this.addInnerDisposer(this.close)}async createInternalCall(e,t,r,n,i){var o,s;let c;if(null==e)null==this.callUrl&&this.throwError((0,l.createError)(a.ErrorCode.NoBackendEndpoints,"backendEndpoints or joinUrl are required",{})),c=await this.createCallAndJoin(t,n);else{const a=null===(o=t.playerOptions)||void 0===o?void 0:o.retryCall;i>0&&a&&(null==r||delete r.call),c=await this.joinCall(e,r,n)}return c.on("error",(e=>{this.emit("error",e)})),this.emit("callId",{callId:c.call.id,user:null!==(s=c.user)&&void 0!==s?s:null}),c.on("CALL_ADD_PEER",this.handleAddPeer),c.on("CALL_REMOVE_PEER",this.handleRemovePeer),c.on("CALL_SFU_CONNECTION",(()=>this.emit("sfuConnection"))),c.on("CALL_DOMINANT_SPEAKER",(e=>{this.emit("dominantSpeaker",e)})),this[g.addProxy](c),c.on("CALL_PRODUCER_KICKED",(()=>{this.emit("viewerKicked")})),c.on("CALL_PEER_AT_CAPACITY",(e=>{this.emit("peerAtCapacity",e)})),c.on("CALL_ACCESS_DENIED",(e=>{this.emit("accessDenied",e)})),c.on("CALL_PRODUCER_STATS",(e=>{this.emit("producerStats",e)})),c.on("CALL_CONNECTING",(e=>{this.emit("isConnecting",e)})),c.on("CALL_SET_CONNECTED",(({connected:e})=>{this.emit("isConnected",e)})),c.on("CALL_WEBSOCKET_RECONNECT",(()=>{this.emit("websocketReconnect")})),c.on("CALL_ENDED",(()=>{this.emit("callEnded")})),new Promise(((e,t)=>{c.start().catch((e=>{t((0,l.createError)(a.ErrorCode.UnableJoinCall,"Unable to start call",{},e)),c.dispose(`Join call error: ${String(e)}`)})),c.once("CALL_READY",(()=>{e(c)}))}))}get id(){var e,t,r;return null!==(r=null===(t=null===(e=this.pvcCall)||void 0===e?void 0:e.call)||void 0===t?void 0:t.id)&&void 0!==r?r:""}get peers(){return this.connectedPeers}handleAddPeer({peer:e}){var t,r,n,i,o,a;if(null==this.pvcCall)return void this.ctx.logger.warn("handleAddPeer() call is null",{aggregates:{peerId:null!==(t=e.peerId)&&void 0!==t?t:"",displayName:null!==(r=e.displayName)&&void 0!==r?r:"",scope:null!==(n=e.scope)&&void 0!==n?n:""}});if(this.connectedPeers.some((t=>t.peerId===e.id)))return void this.ctx.logger.debug("handleAddPeer() peer already exists",{aggregates:{peerId:null!==(i=e.peerId)&&void 0!==i?i:"",displayName:null!==(o=e.displayName)&&void 0!==o?o:"",scope:null!==(a=e.scope)&&void 0!==a?a:""}});const s=new u.Peer((0,m.extendContext)(this.ctx,u.Peer),this,this.pvcCall,e,this.options.playerOptions);this.connectedPeers.push(s),s.on("videoConsumer",(()=>{this.emit("videoConsumer")})),this[g.addProxy](s),this.ctx.logger.debug("handleAddPeer() peer added",s),this.emit("peerAdded",{call:this,peer:s})}handleRemovePeer({peerId:e}){const t=this.connectedPeers.findIndex((t=>t.peerId===e));if(-1!==t){const e=this.peers.splice(t,1)[0];e instanceof u.Peer&&(this.ctx.logger.debug("handleRemovePeer() peer removed",e),e.dispose("removing peer")),this.emit("peerRemoved",{call:this,peer:e})}}async ready(){return await this.readyPromise,this}async createCall(e){var t;null==this.callUrl&&this.throwErrorDeprecated(new c.ValidationError("callUrl is null",{critical:!0}));const r={mode:"broadcast",region:null!==(t=this.region)&&void 0!==t?t:"",msVersion:[3]};Object.assign(r,e),this.ctx.logger.info("call creation",{callUrl:this.callUrl,auth:{token:this.token,hasRefreshToken:null!=this.tokenRefresher},body:r});const n=await(0,v.default)(this.ctx,this.callUrl,{auth:this.auth,method:"post",body:JSON.stringify(r),failoverUrls:this.failoverCallUrls});return null!=n?n.body:(this.ctx.logger.error("response is null",{callUrl:this.callUrl,auth:{token:this.token,hasRefreshToken:null!=this.tokenRefresher},...r}),null)}async createCallAndJoin(e,t={}){var r,n;null!=(null===(r=this.options)||void 0===r?void 0:r.clientReferrer)&&(e.clientReferrer=this.options.clientReferrer);const i=await this.createCall(e),o=null!==(n=null==i?void 0:i.id)&&void 0!==n?n:"";return(0,d.default)(this.ctx,o,`${this.backendEndpoint}/lb/${_}/calls/${o}/join`,{auth:this.auth,failoverUrls:this.failover.map((e=>`${e}/lb/${_}/calls/${o}/join`)),...t},this)}async joinCall(e,t=null,r={}){null==this.joinUrl&&this.throwErrorDeprecated(new c.ValidationError("joinUrl is null",{}));const n={...this.options.sfu,...r};return(0,d.default)(this.ctx,e,this.joinUrl,{auth:this.auth,failoverUrls:this.failoverJoinUrls,...n},this,t)}async broadcast(e,t){var r;null==this.pvcCall&&this.throwErrorDeprecated(new c.InternalCallError("call is not started; pvcCall is null",{})),(null!=this.pvcCall.streams[t.streamName]||this.broadcasts.has(t.streamName))&&this.throwErrorDeprecated(new c.StreamExistsError("stream name already exists",{broadcast:null!==(r=this.broadcasts.get(t.streamName))&&void 0!==r?r:{},call:this})),this.ctx.logger.debug("starting broadcast",{hasAudio:e.hasActiveAudioTrack(),hasVideo:e.hasActiveVideoTrack(),broadcastOptions:t}),this.pvcCall.setStream(t.streamName,{audio:{streamProvider:e},video:{streamProvider:e}});const n=new s.Broadcast((0,m.extendContext)(this.ctx,s.Broadcast),this,this.pvcCall,e,t);return this[g.addProxy](n),n.once("disposed",(()=>{this.broadcasts.delete(t.streamName),this[g.removeProxy](n)})),this.broadcasts.set(t.streamName,n),n}close(e="Implementer did not pass debugString"){var t,r,n;if(null!=this.auth&&this.auth.destroy(),"closed"!==this.state){null===(t=this.pvcCall)||void 0===t||t.off("CALL_ADD_PEER",this.handleAddPeer),null===(r=this.pvcCall)||void 0===r||r.off("CALL_REMOVE_PEER",this.handleRemovePeer);try{null===(n=this.pvcCall)||void 0===n||n.close(e)}catch(e){}this.connectedPeers.splice(0,this.connectedPeers.length),(0,p.cancel)(this.ctx,"Call has been closed"),this.emit("callClosed",{callId:this.id}),this.state="closed"}}async kickViewer(e,t,r=!1){var n;return null===(n=this.pvcCall)||void 0===n?void 0:n.kickViewer(e,t,r)}async kickPeer(e,t,r){var n;return null===(n=this.pvcCall)||void 0===n?void 0:n.kickPeer(e,t,r)}async promoteViewer(e,t,r=!1){var n;return null===(n=this.pvcCall)||void 0===n?void 0:n.promoteViewer(e,t,r)}async demoteViewer(e,t,r=!1){var n;return null===(n=this.pvcCall)||void 0===n?void 0:n.demoteViewer(e,t,r)}toJSON(){var e,t,r,n;return{callUrl:this.callUrl,joinUrl:this.joinUrl,backendEndpoint:this.backendEndpoint,peersIds:this.connectedPeers.map((e=>e.peerId)),options:{callId:null===(e=this.options)||void 0===e?void 0:e.callId,backendEndpoints:null===(t=this.options)||void 0===t?void 0:t.backendEndpoints,playerOptions:null===(r=this.options)||void 0===r?void 0:r.playerOptions,sfu:null===(n=this.options)||void 0===n?void 0:n.sfu},aggregates:{...(0,i.extractAggregates)(this.pvcCall,"support"),support:this.ctx.support.hash,state:this.state}}}}t.Call=w,w.displayName="Call"},98645:(e,t,r)=>{"use strict";var n,i;Object.defineProperty(t,"__esModule",{value:!0}),t.LayerNotFoundError=t.HlsjsNotLoadedError=t.InvalidBitrateError=t.UserRequiredError=t.UnrecognizedDriverError=t.UnknownError=t.UnknownDriverError=t.PlaybackError=t.NoDriversError=t.WSNetworkError=t.InvalidElementError=t.InvalidPopoutURLError=t.InvalidMediaURLError=t.InvalidControlsError=t.ManifestNotFoundError=t.ManifestInternalError=t.ManifestForbiddenError=t.ManifestUnauthorizedError=t.ManifestUnexpectedResponseError=t.GetUserMediaFailedError=t.EmbedSWFFailedError=t.ElementRequiredError=t.DriverNotSupportedError=t.ManifestBadInputError=t.ManifestError=t.DisableAudioError=t.DisableVideoError=t.EnableAudioError=t.EnableVideoError=t.StreamNotFoundError=t.StreamExistsError=t.UpdateBroadcastError=t.StartBroadcastError=t.BroadcastError=t.JoinCallError=t.CallError=t.TrackEndedError=t.CapturableStreamError=t.DeviceNotFoundError=t.ConstraintsError=t.NetworkError=t.PermissionsError=t.InternalCallError=t.ValidationError=t.NotSupportedError=t.NotInitializedError=t.InternalError=t.NativeError=t.VideoClientErrorDeprecated=t.ErrorCode=void 0,t.HandleHlsJsError=t.Mp4BufferError=t.ChangeMSCDeviceError=t.UpdateMSCError=t.MediaRecorderError=t.TransportStateError=t.MediaError=t.MediasoupSetupError=t.WSRequestError=t.SFUProducerResumedEventError=t.SFUProducerPausedEventError=t.SFUProducerClosedEventError=t.SFUConsumerLayersChangedEventError=t.SFUConsumerScoreEventError=t.SFUConsumerResumedEventError=t.SFUConsumerPausedEventError=t.SFUConsumerClosedEventError=t.SFUSwitchConsumerTrackEventError=t.SFUPeerClosedEventError=t.SFUNewConsumerEventError=t.SFUConsumerSourcesEventError=t.SFUNewPeersEventError=t.RetrievingMediaStreamError=t.DisposedObjectError=t.MeowDriverError=t.PlayingIssueError=t.ConsumerNotFoundError=void 0,t.wrapNativeError=function(e){return e instanceof Error?new m(e.message,{native:e}):new m(String(e),{})};const o=r(31635),a=r(43375),s=r(80769),l=r(31818);var c=r(80769);Object.defineProperty(t,"ErrorCode",{enumerable:!0,get:function(){return c.ErrorCode}});const u=new Set(["toJSON","ppStack","stack","detailed","handled","inner","aggregates"]);function d(e){var t;return null==e?null:"toJSON"in e&&"function"==typeof e.toJSON?e:{err:null!==(t=e.name)&&void 0!==t?t:e.constructor.name,message:e.message,stack:e.stack}}const h="Video Client Error: ";function p(e){return null==e||"object"!=typeof e||"string"!=typeof e.message?"":`${null==e.code?"; ":`; [${String(e.code)} `}${e.message}${p(e.inner)}`}class f extends Error{constructor(e,t){super(),this.inner=null,n.set(this,void 0),i.set(this,null),this.handled=!1,o.__classPrivateFieldSet(this,n,e,"f");const{inner:r,critical:a,...s}=t;this.inner=r,this.critical=null!=a?a:r instanceof f&&r.critical;for(const[e,t]of Object.entries(s))this[e]=t}get message(){var e;let t=null===(e=this.inner)||void 0===e?void 0:e.message;return null!=t?(t.startsWith(h)&&(t=t.slice(20)),`${h}[${this.code}] ${o.__classPrivateFieldGet(this,n,"f")}; ${t}`):Reflect.has(this,"err")?`${h}[${this.code}] ${o.__classPrivateFieldGet(this,n,"f")}${p(Reflect.get(this,"err"))}`:`${h}[${this.code}] ${o.__classPrivateFieldGet(this,n,"f")}`}static async loadPrettyPrintStacktrace(e){return Promise.resolve()}static log(e,t){f.loadPrettyPrintStacktrace(e).finally((()=>{t.error(e.message,{err:e})}))}toJSON(){var e,t;const r={message:this.message,stack:null!==(t=null!==(e=o.__classPrivateFieldGet(this,i,"f"))&&void 0!==e?e:this.stack)&&void 0!==t?t:null,inner:d(this.inner),aggregates:this.aggregates()};for(const e of Object.keys(this))u.has(e)||(r[e.toString()]=this[e]);return r}aggregates(){var e,t;return this.inner instanceof f?{...this.inner.aggregates(),errCode:this.code,errCritical:null!==(e=this.critical)&&void 0!==e&&e,errHandled:this.handled}:{errCode:this.code,errCritical:null!==(t=this.critical)&&void 0!==t&&t,errHandled:this.handled}}}t.VideoClientErrorDeprecated=f,n=new WeakMap,i=new WeakMap;class m extends f{constructor(){super(...arguments),this.code=s.ErrorCode.NativeError}}t.NativeError=m,t.InternalError=class extends f{constructor(){super(...arguments),this.code=s.ErrorCode.InternalError}},t.NotInitializedError=class extends f{constructor(){super(...arguments),this.code=s.ErrorCode.NotInitialized}},t.NotSupportedError=class extends f{constructor(){super(...arguments),this.code=s.ErrorCode.NotSupported}},t.ValidationError=class extends f{constructor(){super(...arguments),this.code=s.ErrorCode.ValidationError}},t.InternalCallError=class extends f{constructor(){super(...arguments),this.code=s.ErrorCode.InternalCallError}aggregates(){return{...super.aggregates(),...(0,a.extractAggregates)(this.internalCall)}}},t.PermissionsError=class extends f{constructor(){super(...arguments),this.code=s.ErrorCode.Permission}aggregates(){return{...super.aggregates(),...(0,a.extractAggregates)(this.stream)}}},t.NetworkError=class extends f{constructor(){super(...arguments),this.code=s.ErrorCode.NetworkError}aggregates(){var e;return{...super.aggregates(),errStatus:null!==(e=this.status)&&void 0!==e?e:0}}},t.ConstraintsError=class extends f{constructor(e,t){super(e,t),this.code=s.ErrorCode.Constraints;const{inner:r}=t;this.failedConstraint=null!=r&&(0,l.isOverconstrainedError)(r)?r.constraint:"NA"}},t.DeviceNotFoundError=class extends f{constructor(){super(...arguments),this.code=s.ErrorCode.DeviceNotFound}},t.CapturableStreamError=class extends f{constructor(){super(...arguments),this.code=s.ErrorCode.CapturableStreamError}},t.TrackEndedError=class extends f{constructor(){super(...arguments),this.code=s.ErrorCode.TrackEnded}},t.CallError=class extends f{constructor(){super(...arguments),this.code=s.ErrorCode.CallError}aggregates(){return{...super.aggregates(),reason:this.reason}}},t.JoinCallError=class extends f{constructor(){super(...arguments),this.code=s.ErrorCode.JoinCallError}aggregates(){return{...super.aggregates(),...(0,a.extractAggregates)(this.call)}}};class g extends f{aggregates(){return{...super.aggregates(),...(0,a.extractAggregates)(this.broadcast)}}}t.BroadcastError=g,t.StartBroadcastError=class extends g{constructor(){super(...arguments),this.code=s.ErrorCode.StartBroadcastError}},t.UpdateBroadcastError=class extends g{constructor(){super(...arguments),this.code=s.ErrorCode.UpdateBroadcastError}},t.StreamExistsError=class extends g{constructor(){super(...arguments),this.code=s.ErrorCode.StreamExists}},t.StreamNotFoundError=class extends g{constructor(){super(...arguments),this.code=s.ErrorCode.StreamNotFound}},t.EnableVideoError=class extends g{constructor(){super(...arguments),this.code=s.ErrorCode.EnableVideoError}},t.EnableAudioError=class extends g{constructor(){super(...arguments),this.code=s.ErrorCode.EnableAudioError}},t.DisableVideoError=class extends g{constructor(){super(...arguments),this.code=s.ErrorCode.DisableVideoError}},t.DisableAudioError=class extends g{constructor(){super(...arguments),this.code=s.ErrorCode.DisableAudioError}},t.ManifestError=class extends f{constructor(){super(...arguments),this.code=s.ErrorCode.ManifestError}aggregates(){return{...super.aggregates(),...(0,a.extractAggregates)(this.loader)}}},t.ManifestBadInputError=class extends f{constructor(){super(...arguments),this.code=s.ErrorCode.BadInput}},t.DriverNotSupportedError=class extends f{constructor(){super(...arguments),this.code=s.ErrorCode.DriverNotSupported}aggregates(){return{...super.aggregates(),...(0,a.extractAggregates)(this.loader)}}},t.ElementRequiredError=class extends f{constructor(){super(...arguments),this.code=s.ErrorCode.ElementRequired}},t.EmbedSWFFailedError=class extends f{constructor(){super(...arguments),this.code=s.ErrorCode.EmbedSWFFailed}},t.GetUserMediaFailedError=class extends f{constructor(){super(...arguments),this.code=s.ErrorCode.GetUserMediaFailed}},t.ManifestUnexpectedResponseError=class extends f{constructor(){super(...arguments),this.code=s.ErrorCode.ManifestUnexpectedResponse}},t.ManifestUnauthorizedError=class extends f{constructor(){super(...arguments),this.code=s.ErrorCode.ManifestUnauthorized}},t.ManifestForbiddenError=class extends f{constructor(){super(...arguments),this.code=s.ErrorCode.ManifestForbidden}},t.ManifestInternalError=class extends f{constructor(){super(...arguments),this.code=s.ErrorCode.ManifestInternalError}},t.ManifestNotFoundError=class extends f{constructor(){super(...arguments),this.code=s.ErrorCode.ManifestNotFound}},t.InvalidControlsError=class extends f{constructor(){super(...arguments),this.code=s.ErrorCode.InvalidControls}},t.InvalidMediaURLError=class extends f{constructor(){super(...arguments),this.code=s.ErrorCode.InvalidMediaURL}},t.InvalidPopoutURLError=class extends f{constructor(){super(...arguments),this.code=s.ErrorCode.InvalidPopoutURL}},t.InvalidElementError=class extends f{constructor(){super(...arguments),this.code=s.ErrorCode.InvalidElement}},t.WSNetworkError=class extends f{constructor(){super(...arguments),this.code=s.ErrorCode.WSNetworkError}},t.NoDriversError=class extends f{constructor(){super(...arguments),this.code=s.ErrorCode.NoDrivers}},t.PlaybackError=class extends f{constructor(){super(...arguments),this.code=s.ErrorCode.PlaybackError}aggregates(){return{...super.aggregates(),...(0,a.extractAggregates)(this.loader)}}},t.UnknownDriverError=class extends f{constructor(){super(...arguments),this.code=s.ErrorCode.UnknownDriver}},t.UnknownError=class extends f{constructor(){super(...arguments),this.code=s.ErrorCode.UnknownError}},t.UnrecognizedDriverError=class extends f{constructor(){super(...arguments),this.code=s.ErrorCode.UnrecognizedDriver}},t.UserRequiredError=class extends f{constructor(){super(...arguments),this.code=s.ErrorCode.UserRequired}},t.InvalidBitrateError=class extends f{constructor(){super(...arguments),this.code=s.ErrorCode.InvalidBitrate}},t.HlsjsNotLoadedError=class extends f{constructor(){super(...arguments),this.code=s.ErrorCode.HlsjsNotLoaded}},t.LayerNotFoundError=class extends f{constructor(){super(...arguments),this.code=s.ErrorCode.LayerNotFound}},t.ConsumerNotFoundError=class extends f{constructor(){super(...arguments),this.code=s.ErrorCode.ConsumerNotFound}},t.PlayingIssueError=class extends f{constructor(){super(...arguments),this.code=s.ErrorCode.PlayingIssue}aggregates(){return{...super.aggregates(),...(0,a.extractAggregates)(this.player)}}},t.MeowDriverError=class extends f{constructor(){super(...arguments),this.code=s.ErrorCode.MeowDriverError}},t.DisposedObjectError=class extends f{constructor(){super(...arguments),this.code=s.ErrorCode.DisposedObject}},t.RetrievingMediaStreamError=class extends f{constructor(){super(...arguments),this.code=s.ErrorCode.RetrievingMediaStreamError}aggregates(){return{...super.aggregates(),streamName:this.streamName,mediaKind:this.mediaKind}}},t.SFUNewPeersEventError=class extends f{constructor(){super(...arguments),this.code=s.ErrorCode.SFUNewPeersEvent}aggregates(){return{...super.aggregates(),...(0,a.extractAggregates)(this.peer)}}},t.SFUConsumerSourcesEventError=class extends f{constructor(){super(...arguments),this.code=s.ErrorCode.SFUConsumerSourcesEvent}aggregates(){return{...super.aggregates(),...(0,a.extractAggregates)(this.peer)}}},t.SFUNewConsumerEventError=class extends f{constructor(){super(...arguments),this.code=s.ErrorCode.SFUNewConsumerEvent}aggregates(){return{...super.aggregates(),...(0,a.extractAggregates)(this.peer)}}},t.SFUPeerClosedEventError=class extends f{constructor(){super(...arguments),this.code=s.ErrorCode.SFUPeerClosedEvent}aggregates(){return{...super.aggregates(),...(0,a.extractAggregates)(this.peer)}}},t.SFUSwitchConsumerTrackEventError=class extends f{constructor(){super(...arguments),this.code=s.ErrorCode.SFUSwitchConsumerTrackEvent}aggregates(){return{...super.aggregates(),...(0,a.extractAggregates)(this.peer)}}},t.SFUConsumerClosedEventError=class extends f{constructor(){super(...arguments),this.code=s.ErrorCode.SFUConsumerClosedEvent}aggregates(){return{...super.aggregates(),...(0,a.extractAggregates)(this.peer)}}},t.SFUConsumerPausedEventError=class extends f{constructor(){super(...arguments),this.code=s.ErrorCode.SFUConsumerPausedEvent}aggregates(){return{...super.aggregates(),...(0,a.extractAggregates)(this.peer)}}},t.SFUConsumerResumedEventError=class extends f{constructor(){super(...arguments),this.code=s.ErrorCode.SFUConsumerResumedEvent}aggregates(){return{...super.aggregates(),...(0,a.extractAggregates)(this.peer)}}},t.SFUConsumerScoreEventError=class extends f{constructor(){super(...arguments),this.code=s.ErrorCode.SFUConsumerScoreEvent}aggregates(){return{...super.aggregates(),...(0,a.extractAggregates)(this.peer)}}},t.SFUConsumerLayersChangedEventError=class extends f{constructor(){super(...arguments),this.code=s.ErrorCode.SFUConsumerLayersChangedEvent}aggregates(){return{...super.aggregates(),...(0,a.extractAggregates)(this.peer)}}},t.SFUProducerClosedEventError=class extends f{constructor(){super(...arguments),this.code=s.ErrorCode.SFUProducerClosedEvent}aggregates(){return{...super.aggregates(),...(0,a.extractAggregates)(this.peer)}}},t.SFUProducerPausedEventError=class extends f{constructor(){super(...arguments),this.code=s.ErrorCode.SFUProducerPausedEvent}aggregates(){return{...super.aggregates(),...(0,a.extractAggregates)(this.peer)}}},t.SFUProducerResumedEventError=class extends f{constructor(){super(...arguments),this.code=s.ErrorCode.SFUProducerResumedEvent}aggregates(){return{...super.aggregates(),...(0,a.extractAggregates)(this.peer)}}},t.WSRequestError=class extends f{constructor(){super(...arguments),this.code=s.ErrorCode.WSRequestError}aggregates(){return{...super.aggregates(),...(0,a.extractAggregates)(this.internalCall)}}},t.MediasoupSetupError=class extends f{constructor(){super(...arguments),this.code=s.ErrorCode.MediasoupSetupError}},t.MediaError=class extends f{constructor(){super(...arguments),this.code=s.ErrorCode.MediaError}},t.TransportStateError=class extends f{constructor(){super(...arguments),this.code=s.ErrorCode.TransportStateError}},t.MediaRecorderError=class extends f{constructor(){super(...arguments),this.code=s.ErrorCode.MediaRecorderError}},t.UpdateMSCError=class extends f{constructor(){super(...arguments),this.code=s.ErrorCode.UpdateMSCError}aggregates(){return{...super.aggregates(),...(0,a.extractAggregates)(this.msc)}}},t.ChangeMSCDeviceError=class extends f{constructor(){super(...arguments),this.code=s.ErrorCode.UpdateMSCError}aggregates(){var e,t,r,n,i,o,s,l;return{...super.aggregates(),...(0,a.extractAggregates)(this.msc),prevVideoDeviceId:null!==(e=this.prevVideoDeviceId)&&void 0!==e?e:"",prevVideoDeviceLabel:null!==(t=this.prevVideoDeviceLabel)&&void 0!==t?t:"",failedVideoDeviceId:null!==(r=this.failedVideoDeviceId)&&void 0!==r?r:"",failedVideoDeviceLabel:null!==(n=this.failedVideoDeviceLabel)&&void 0!==n?n:"",prevAudioDeviceId:null!==(i=this.prevAudioDeviceId)&&void 0!==i?i:"",prevAudioDeviceLabel:null!==(o=this.prevAudioDeviceLabel)&&void 0!==o?o:"",failedAudioDeviceId:null!==(s=this.failedAudioDeviceId)&&void 0!==s?s:"",failedAudioDeviceLabel:null!==(l=this.failedAudioDeviceLabel)&&void 0!==l?l:""}}},t.Mp4BufferError=class extends f{constructor(){super(...arguments),this.code=s.ErrorCode.Mp4BufferError}},t.HandleHlsJsError=class extends f{constructor(){super(...arguments),this.code=s.ErrorCode.HandleHlsJsError}}},92491:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VideoClientError=t.ErrorCode=void 0,t.wrapError=l,t.createError=c;const n=r(80769),i=r(36147);var o=r(80769);Object.defineProperty(t,"ErrorCode",{enumerable:!0,get:function(){return o.ErrorCode}});const a=new Set(["toJSON","stack","detailed","handled","inner","aggregates"]);function s(e){var t;return null==e?null:"toJSON"in e&&"function"==typeof e.toJSON?e:{err:null!==(t=e.name)&&void 0!==t?t:e.constructor.name,message:e.message,stack:e.stack}}function l(e){return null==e?null:(0,i.isVideoClientError)(e)?e:e instanceof Error?c(n.ErrorCode.NativeError,e.message,{type:e.name}):e instanceof ErrorEvent?c(n.ErrorCode.NativeError,e.message,{type:e.type}):c(n.ErrorCode.NativeError,String(e),{type:"unknown"})}function c(e,t,r,n=null){return new u(e,t,r,n)}class u extends Error{constructor(e,t,r={},n=null){super(function(e,t,r){let n=null==t?`[${e}]`:`[${e}] ${t}`;for(;null!=r;)n+=`; [${r.code}] ${r.message}`,r=r.inner;return n}(e,t,l(n))),this.inner=null,this.innerCodes=new Set,this.muted=!1,this.code=e,this.inner=l(n);for(const[e,t]of Object.entries(null!=r?r:{}))this[e]=t}static log(e,t){t.error(e.message,{err:e})}get isMuted(){return this.muted}toJSON(){var e;const t={message:this.message,stack:null!==(e=this.stack)&&void 0!==e?e:null,inner:s(this.inner),aggregates:this.aggregates()};for(const e of Object.keys(this))a.has(e)||(t[e.toString()]=this[e]);return t}aggregates(){return this.inner instanceof u?{...this.inner.aggregates(),errCode:this.code}:{errCode:this.code}}mute(){this.muted=!0}}t.VideoClientError=u},64691:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MediaStreamController=t.optionsKey=t.mediaController=t.CONSTRAINTS_SCREENCAPTURE_OPTIMAL_WEAK=t.CONSTRAINTS_VIDEO_OPTIMAL_WEAK=t.CONSTRAINTS_VIDEO_OPTIMAL_STRICT=t.CONSTRAINTS_AUDIO_OPTIMAL_WEAK=t.CONSTRAINTS_AUDIO_OPTIMAL_STRICT=t.VIDEO_DEVICE_CAPTURABLE=t.VIDEO_DEVICE_SCREENCAPTURE=void 0;const n=r(31635),i=r(82837),o=n.__importDefault(r(58024)),a=r(63637),s=r(27813),l=r(80769),c=r(86729),u=r(31818),d=n.__importDefault(r(28441)),h=r(59703),p=r(92491),f=r(54873),m=r(45831),g=r(65414);t.VIDEO_DEVICE_SCREENCAPTURE={deviceId:"screencapture",groupId:"screencapture",label:"Screen Capture",kind:"videoinput",virtual:!0,toJSON(){return{deviceId:this.deviceId,groupId:this.groupId,label:this.label,kind:this.kind}}},t.VIDEO_DEVICE_CAPTURABLE={deviceId:"capturable",groupId:"capturable",label:"Capturable",kind:"videoinput",virtual:!0,toJSON(){return{deviceId:this.deviceId,groupId:this.groupId,label:this.label,kind:this.kind}}},t.CONSTRAINTS_AUDIO_OPTIMAL_STRICT={autoGainControl:{exact:!0},channelCount:{min:1,ideal:2},echoCancellation:{exact:!0},latency:{ideal:0},noiseSuppression:{exact:!0},sampleRate:{min:8e3,ideal:48e3,max:48e3},sampleSize:{min:16,ideal:32}},t.CONSTRAINTS_AUDIO_OPTIMAL_WEAK={autoGainControl:{ideal:!0},channelCount:{min:1,ideal:2},echoCancellation:{ideal:!0},latency:{ideal:0},noiseSuppression:{ideal:!0},sampleRate:{min:8e3,ideal:48e3,max:48e3},sampleSize:{min:16,ideal:32}},t.CONSTRAINTS_VIDEO_OPTIMAL_STRICT={facingMode:{ideal:"user"},aspectRatio:{exact:16/9},height:c.device.isAndroidDevice?{min:240,max:720}:{min:240,ideal:c.device.isIosDevice?720:1080,max:c.device.isIosDevice?720:1080},frameRate:{ideal:24}},t.CONSTRAINTS_VIDEO_OPTIMAL_WEAK={facingMode:{ideal:"user"},aspectRatio:{ideal:16/9},height:c.device.isAndroidDevice?{min:240,max:720}:{min:240,ideal:c.device.isIosDevice?720:1080,max:c.device.isIosDevice?720:1080},frameRate:{ideal:24}},t.CONSTRAINTS_SCREENCAPTURE_OPTIMAL_WEAK={frameRate:{ideal:24}};const v=s.observable.array([],{name:"mediaDevicesList"}),y=new Proxy({},{get:(e,r)=>{var n;return r===t.VIDEO_DEVICE_SCREENCAPTURE.deviceId?t.VIDEO_DEVICE_SCREENCAPTURE:r===t.VIDEO_DEVICE_CAPTURABLE.deviceId?t.VIDEO_DEVICE_CAPTURABLE:null!==(n=v.find((e=>e.deviceId===r&&"videoinput"===e.kind)))&&void 0!==n?n:null}}),b=new Proxy({},{get:(e,t)=>{var r;return null!==(r=v.find((e=>e.deviceId===t&&"audioinput"===e.kind)))&&void 0!==r?r:null}}),_=new Proxy({},{get:(e,r)=>{var n;return r===t.VIDEO_DEVICE_SCREENCAPTURE.deviceId?t.VIDEO_DEVICE_SCREENCAPTURE:r===t.VIDEO_DEVICE_CAPTURABLE.deviceId?t.VIDEO_DEVICE_CAPTURABLE:null!==(n=v.find((e=>e.deviceId===r)))&&void 0!==n?n:null}}),S=[4320,2160,1440,1080,720,480,360,240,180],w=new WeakMap,E={};let C=0,O=null;const P={defaultConstraints:{audio:t.CONSTRAINTS_AUDIO_OPTIMAL_STRICT,video:t.CONSTRAINTS_VIDEO_OPTIMAL_STRICT,screencapture:t.CONSTRAINTS_SCREENCAPTURE_OPTIMAL_WEAK},fallbackConstraints:{audio:t.CONSTRAINTS_AUDIO_OPTIMAL_WEAK,video:t.CONSTRAINTS_VIDEO_OPTIMAL_WEAK,screencapture:{}},replaceTracks:!0,waitingDelay:100,defaultLockPolicy:l.ExistsStreamPolicy.wait,noEchoGainAmplifier:c.device.isIosDevice,requestAudioPermission:!0};function T({stream:e,audio:t=!0,video:r=!0,removeEventListenerCb:n}){var i;if(null!=e)for(const o of e.getTracks()){if("audio"===o.kind&&!t||"video"===o.kind&&!r)continue;null!=n&&n(o);const a=w.get(o);null!=a&&(null!=n&&null!=a.originalTrack&&n(a.originalTrack),null===(i=a.originalTrack)||void 0===i||i.stop()),o.stop(),e.removeTrack(o)}}function k(e){var t;let r;try{r=null===(t=e.getSettings)||void 0===t?void 0:t.call(e)}catch(e){r={}}return r}function R(e){var t;let r;try{r=null===(t=e.getConstraints)||void 0===t?void 0:t.call(e)}catch(e){r={}}return r}function A(e,t,r){const n=JSON.parse(JSON.stringify(e));if(null!=r.aspectRatio)if("number"==typeof r.aspectRatio)n.aspectRatio={exact:r.aspectRatio};else{const[e,t]=r.aspectRatio;n.aspectRatio={min:e,max:t}}if(null!=r.autoGainControl&&(n.autoGainControl={exact:r.autoGainControl}),null!=r.echoCancellation&&(n.echoCancellation={exact:r.echoCancellation}),null!=r.facingMode&&(n.facingMode={exact:r.facingMode}),null!=r.frameRate)if("number"==typeof r.frameRate)n.frameRate={exact:r.frameRate};else if(Array.isArray(r.frameRate)){const[e,t]=r.frameRate;n.frameRate={min:e,max:t}}else n.frameRate=r.frameRate;if(null!=r.resolution)if("number"==typeof r.resolution)n.height={exact:r.resolution};else if(Array.isArray(r.resolution)){const[e,t]=r.resolution;n.height={min:e,max:t}}else n.height={min:r.resolution.min,ideal:r.resolution.ideal,max:r.resolution.max};var i;return n.deviceId=null==t||null!=(i=_[t])&&i.virtual?void 0:{exact:t},n}function D({defaults:e,audioDeviceInfo:r,videoDeviceInfo:n,overrides:i}){const{echoCancellation:o,autoGainControl:a,noiseSuppression:s,frameRate:l,resolution:c,aspectRatio:u,facingMode:d}=i,h=(null==n?void 0:n.deviceId)===(null===t.VIDEO_DEVICE_SCREENCAPTURE||void 0===t.VIDEO_DEVICE_SCREENCAPTURE?void 0:t.VIDEO_DEVICE_SCREENCAPTURE.deviceId)?e.screencapture:e.video,{audio:p}=e;return{audio:null!=r&&A(p,null==r?void 0:r.deviceId,{echoCancellation:o,autoGainControl:a,noiseSuppression:s}),video:null!=n&&A(h,null==n?void 0:n.deviceId,{resolution:c,frameRate:l,aspectRatio:u,facingMode:d})}}function I(e){return`deviceResolution:1.0:[${e}]`}class x extends m.ObservableEventEmitter{constructor(){var e,t;super(),this.isInitialized=!1,this.initialized=null,this._supportSharedDevices=null,this.camPermission=null,this.micPermission=null,this.safariPermissionStatusInterval=void 0,this.deviceInUseInterval=void 0,this.devicesInUse=[],this.logger=new i.LoggerCore(h.PACKAGE_NAME).setLoggerMeta("client","VDC").setLoggerMeta("release",d.default.version).appendChain(x).setMessageAggregate("contextId",null!==(e=(0,h.contextId)())&&void 0!==e?e:void 0).setMessageAggregate("instanceId",null!==(t=(0,h.instanceId)())&&void 0!==t?t:void 0),(0,f.makeBounded)(this),(0,s.makeObservable)(this,{requestController:s.action,devicesInUse:s.observable})}audioDevices(){return this.isInitialized?v.filter((e=>"audioinput"===e.kind)):(this.logger.warn("init() must be called on the media-controller singleton",{}),[])}videoDevices(){return this.isInitialized?v.filter((e=>"videoinput"===e.kind)):(this.logger.warn("init() must be called on the media-controller singleton",{}),[])}get devices(){return Object.fromEntries(v.entries())}get supportSharedDevices(){return null!=this._supportSharedDevices&&this._supportSharedDevices}async checkSupportSharedDevices(e,t){var r,n,i,o,a;if((a=c.device).isAndroidDevice&&"ReactNative"===a.platform||c.device.isAndroidDevice)return void(this._supportSharedDevices=!1);if(!c.device.isImplements(c.Feature.MEDIA_DEVICE))return void(this._supportSharedDevices=!1);if(!1===e&&!1===t)return this.logger.warn("video and audio device permissions denied"),void(this._supportSharedDevices=!1);if(c.device.isImplements(c.Feature.LOCAL_STORAGE)){const e=c.device.localStorage.getItem("supportSharedDevices");if(null!=e)return void(this._supportSharedDevices=JSON.parse(e))}let s=null,l=null;try{const t=e?{video:{deviceId:"default"}}:{audio:{deviceId:"default"}};s=await c.device.mediaDevices.getUserMedia(t);const a=null===(n=null===(r=s.getTracks()[0])||void 0===r?void 0:r.getSettings())||void 0===n?void 0:n.deviceId,u=e?{video:{deviceId:a}}:{audio:{deviceId:a}};l=await c.device.mediaDevices.getUserMedia(u);const d=null===(o=null===(i=l.getTracks()[0])||void 0===i?void 0:i.getSettings())||void 0===o?void 0:o.deviceId;this._supportSharedDevices=a===d}catch{this._supportSharedDevices=!1}finally{T({stream:s}),T({stream:l}),c.device.isImplements(c.Feature.LOCAL_STORAGE)&&c.device.localStorage.setItem("supportSharedDevices",JSON.stringify(this._supportSharedDevices))}}async init(e){if(this.mediaControllerOptions=e,null!=this.initialized)return e&&this.setOptions(e),this.initialized;this.initialized=this._init(),e&&this.setOptions(e);try{await this.initialized}catch(e){throw this.initialized=null,e}return this.isInitialized=!0,this.initialized}setOptions(e){var t;clearInterval(C),null!=e.updateByTimer&&(C=c.device.setInterval(this.enumerateDevices,e.updateByTimer)),null!=e.logger&&(null===(t=this.logger)||void 0===t||t.destroy(),this.logger=e.logger)}handleDeviceChange(){this.enumerateDevices(!1)}async _init(){return c.device.isImplements(c.Feature.MEDIA_DEVICE)||this.throwError((0,p.createError)(l.ErrorCode.MediaDeviceNotSupported,"media device is not supported",{})),c.device.mediaDevices.removeEventListener("devicechange",this.handleDeviceChange),c.device.mediaDevices.addEventListener("devicechange",this.handleDeviceChange),this.enumerateDevices(!0).then(this.observePerms)}async observePerms(){var e,t;if(c.device.isImplements(c.Feature.PERMISSIONS)){if((0,g.hasPermissionsChangeSupport)(c.device))try{this.camPermission=await c.device.permissions.query({name:"camera"}),this.camPermission.addEventListener("change",this.handlePermissionStatusChange),this.micPermission=await c.device.permissions.query({name:"microphone"}),this.micPermission.addEventListener("change",this.handlePermissionStatusChange)}catch(e){let t={};e instanceof Error&&(t={errName:e.name,errMsg:e.message}),this.logger.debug("Unable to query device permissions",t)}finally{this.addInnerDisposer((()=>{var e,t;null===(e=this.camPermission)||void 0===e||e.removeEventListener("change",this.handlePermissionStatusChange),null===(t=this.micPermission)||void 0===t||t.removeEventListener("change",this.handlePermissionStatusChange)}))}else this.safariPermissionChangePolyfill();this.logger.debug("observePerms()",{cam:null===(e=this.camPermission)||void 0===e?void 0:e.state,mic:null===(t=this.micPermission)||void 0===t?void 0:t.state})}}handlePermissionStatusChange(e){var t,r,n,i;"camera"===e.target.name&&(this.camPermission=e.target),"microphone"===e.target.name&&(this.micPermission=e.target);const o=e.target;this.enumerateDevices("prompt"===o.state),this.emit("permissionsChanged",{name:null===(t=e.target)||void 0===t?void 0:t.name,state:null===(r=e.target)||void 0===r?void 0:r.state}),this.logger.debug("permissionsChanged",{name:null===(n=e.target)||void 0===n?void 0:n.name,state:null===(i=e.target)||void 0===i?void 0:i.state})}safariPermissionChangePolyfill(){this.logger.debug("Setting safariPermissionStatusInterval"),c.device.clearInterval(this.safariPermissionStatusInterval),this.safariPermissionStatusInterval=c.device.setInterval((async()=>{var e,t,r,n;if(!c.device.isImplements(c.Feature.PERMISSIONS))return;const i=await c.device.permissions.query({name:"camera"}),o=await c.device.permissions.query({name:"microphone"});i.state===(null===(e=this.camPermission)||void 0===e?void 0:e.state)&&o.state===(null===(t=this.micPermission)||void 0===t?void 0:t.state)||(i.state!==(null===(r=this.camPermission)||void 0===r?void 0:r.state)&&this.handlePermissionStatusChange({target:i}),o.state!==(null===(n=this.micPermission)||void 0===n?void 0:n.state)&&this.handlePermissionStatusChange({target:o}))}),1e3),this.addInnerDisposer((()=>c.device.clearInterval(this.safariPermissionStatusInterval)))}requestController(e=P){var t,r;const n={...P,replaceTracks:this.supportSharedDevices,requestAudioPermission:null===(r=null===(t=this.mediaControllerOptions)||void 0===t?void 0:t.requestAudioPermission)||void 0===r||r,...e};return this.logger.info("request new MediaStreamController",{options:{defaultConstraints:JSON.stringify(n.defaultConstraints),fallbackConstraints:JSON.stringify(n.fallbackConstraints),defaultLockPolicy:n.defaultLockPolicy,replaceTracks:n.replaceTracks,waitingDelay:n.waitingDelay,displayName:n.displayName,requestAudioPermission:n.requestAudioPermission}}),this.isInitialized||this.throwError((0,p.createError)(l.ErrorCode.MediaControllerNotInitialized,"init() must be called on the media-controller singleton",{})),Promise.resolve(new M(n))}async enumerateDevices(e=!1){var t,r;let n={audio:!1,video:!1};c.device.isImplements(c.Feature.MEDIA_DEVICE)&&null!=c.device.mediaDevices.enumerateDevices||this.throwError((0,p.createError)(l.ErrorCode.MediaDeviceNotSupported,"media device is not supported",{}));let i=[];if(c.device.isFirefox||e){const{audio:e,video:t,streams:r}=await this.requestPermissions();n={...n,audio:e,video:t},i=r}try{const e=await c.device.mediaDevices.enumerateDevices();let i=[];for(const t of e)""===t.deviceId||""===t.label||i.some((e=>e.deviceId===t.deviceId&&e.kind===t.kind))||i.push(t);c.device.isImplements(c.Feature.PERMISSIONS)&&(c.device.isSafari&&"denied"===(null===(t=this.camPermission)||void 0===t?void 0:t.state)&&(i=i.filter((e=>"videoinput"!==e.kind))),c.device.isSafari&&"denied"===(null===(r=this.micPermission)||void 0===r?void 0:r.state)&&(i=i.filter((e=>"audioinput"!==e.kind)))),(n.video||n.audio)&&await this.handleDeviceInUse(n,i),(v.length!==i.length||v.some(((e,t)=>e.deviceId!==i[t].deviceId||e.groupId!==i[t].groupId||e.label!==i[t].label||e.kind!==i[t].kind)))&&((0,s.runInAction)((function(){v.replace(i)})),this.emit("deviceListChanged",v.slice()))}catch{this.throwError((0,p.createError)(l.ErrorCode.EnumeratingDevices,"error enumerating devices",{}))}finally{if(c.device.isFirefox||c.device.isAndroidDevice)for(const e of i)T({stream:e})}}checkDevicesInUse(){c.device.clearInterval(this.deviceInUseInterval),this.logger.debug("setting checkDevicesInUse() interval"),this.deviceInUseInterval=c.device.setInterval((async()=>{if(0!==this.devicesInUse.length)for await(const e of this.devicesInUse){let t;if(t="videoinput"===e.kind?{audio:!1,video:{deviceId:e.deviceId}}:{audio:{deviceId:e.deviceId},video:!1},c.device.isImplements(c.Feature.MEDIA_DEVICE)){let r;try{r=await c.device.mediaDevices.getUserMedia(t),this.logger.debug(`device no longer in use: ${e.kind}`,e);const n=this.devicesInUse.indexOf(e);n>-1&&(0,s.runInAction)((()=>{this.devicesInUse.splice(n,1)})),this.emit("devicesInUse",this.devicesInUse)}catch(e){if(e instanceof Error&&"NotReadableError"===e.name)return}finally{null!=r&&T({stream:r})}}}else c.device.clearInterval(this.deviceInUseInterval)}),3e3),this.addInnerDisposer((()=>c.device.clearInterval(this.deviceInUseInterval)))}async handleDeviceInUse(e,t){if(e.video)for await(const e of t)if("videoinput"===e.kind&&c.device.isImplements(c.Feature.MEDIA_DEVICE)){let t;try{t=await c.device.mediaDevices.getUserMedia({audio:!1,video:{deviceId:e.deviceId}})}catch(t){t instanceof Error&&"NotReadableError"===t.name&&(this.logger.debug("deviceInUse: video",e),this.devicesInUse.push(e))}finally{null!=t&&T({stream:t})}}if(e.audio)for await(const e of t)if("audioinput"===e.kind&&c.device.isImplements(c.Feature.MEDIA_DEVICE)){let t;try{t=await c.device.mediaDevices.getUserMedia({audio:{deviceId:e.deviceId},video:!1})}catch(t){t instanceof Error&&"NotReadableError"===t.name&&(this.logger.debug("deviceInUse: audio",e),(0,s.runInAction)((()=>{this.devicesInUse.push(e)})))}finally{null!=t&&T({stream:t})}}this.checkDevicesInUse(),this.emit("devicesInUse",this.devicesInUse)}async requestPermissions(){var e,t;const r={audio:!1,video:!1};c.device.isImplements(c.Feature.MEDIA_DEVICE)&&null!=c.device.mediaDevices.enumerateDevices||this.throwError((0,p.createError)(l.ErrorCode.MediaDeviceNotSupported,"media device is not supported",{}));const n=[];let i=!1,o=!1;const a=null===(t=null===(e=this.mediaControllerOptions)||void 0===e?void 0:e.requestAudioPermission)||void 0===t||t;try{n.push(await c.device.mediaDevices.getUserMedia({audio:a,video:!0})),i=a,o=!0}catch(e){try{a&&(n.push(await c.device.mediaDevices.getUserMedia({audio:!0,video:!1})),i=!0)}catch(e){e instanceof Error&&("NotFoundError"===e.name?(this.logger.warn("no audio devices found",{err:(0,p.wrapError)(e)}),this.emit("audioNotFound")):"NotAllowedError"===e.name?(this.logger.warn("audio device permission denied",{err:(0,p.wrapError)(e)}),this.emit("audioNotAllowed")):"NotReadableError"===e.name?r.audio=!0:this.logger.warn("Audio device error",{err:(0,p.wrapError)(e)}))}try{n.push(await c.device.mediaDevices.getUserMedia({audio:!1,video:!0})),o=!0}catch(e){e instanceof Error&&("NotFoundError"===e.name?(this.logger.warn("no video devices found",{err:(0,p.wrapError)(e)}),this.emit("videoNotFound")):"NotAllowedError"===e.name?(this.logger.warn("video device permission denied",{err:(0,p.wrapError)(e)}),this.emit("videoNotAllowed")):"NotReadableError"===e.name?r.video=!0:this.logger.warn("Video device error",{err:(0,p.wrapError)(e)}))}}finally{if(!c.device.isFirefox)for(const e of n)T({stream:e})}return await this.checkSupportSharedDevices(o,i),{...r,streams:n}}}x.displayName="MediaController",t.mediaController=new x,t.optionsKey=Symbol("options");class M extends m.ObservableEventEmitter{get[t.optionsKey](){return this.optionsAtom.reportObserved(),this.options}get settings(){var e,t,r,n,i,o,a;this.applyConstraintsAtom.reportObserved();const s={};if(this.hasActiveAudioTrack()){const o=null===(e=this.source)||void 0===e?void 0:e.getAudioTracks()[0],a=w.get(o);null!=o&&null!=a?(s.audioCtx={gain:null===(t=a.gainNode)||void 0===t?void 0:t.gain.value,internallyEnded:a.internallyEnded,track:o.getSettings()},s.audio=null===(r=a.originalTrack)||void 0===r?void 0:r.getSettings()):s.audio=null===(i=null===(n=this.source)||void 0===n?void 0:n.getAudioTracks()[0])||void 0===i?void 0:i.getSettings()}return this.hasActiveVideoTrack()&&(s.video=null===(a=null===(o=this.source)||void 0===o?void 0:o.getVideoTracks()[0])||void 0===a?void 0:a.getSettings()),s}get sourceUrl(){return URL.createObjectURL(o.default)}get audioDeviceId(){var e,t,r,n;return!0===this.audioDisabled||"placeholder"===this.audioDisabled?null!==(t=null===(e=this.audioDeviceChanging)||void 0===e?void 0:e.deviceId)&&void 0!==t?t:null:null!==(n=null===(r=this.audioDeviceChanged)||void 0===r?void 0:r.deviceId)&&void 0!==n?n:null}set audioDeviceId(e){var t,r;null!=e?(null==b[e]&&this.emitError((0,p.createError)(l.ErrorCode.MediaDeviceNotAvailable,"audio device not found or not available",{deviceId:e,deviceLabel:null,prevDeviceId:this.audioDeviceId,prevDeviceLabel:null!==(r=null===(t=this.audioDeviceChanged)||void 0===t?void 0:t.label)&&void 0!==r?r:null,kind:"audio"})),this.audioDeviceChanging=this.options.requestAudioPermission?b[e]:null):this.audioDeviceChanging=null}get inVideoDeviceTransition(){return null!=this.sync&&this.videoDeviceChanging!==this.videoDeviceChanged}get inAudioDeviceTransition(){return null!=this.sync&&this.audioDeviceChanging!==this.audioDeviceChanged}get videoDeviceId(){var e,t,r,n;return!0===this.videoDisabled||"placeholder"===this.videoDisabled?null!==(t=null===(e=this.videoDeviceChanging)||void 0===e?void 0:e.deviceId)&&void 0!==t?t:null:null!==(n=null===(r=this.videoDeviceChanged)||void 0===r?void 0:r.deviceId)&&void 0!==n?n:null}set videoDeviceId(e){var t,r;null!=e?(null==y[e]&&this.emitError((0,p.createError)(l.ErrorCode.MediaDeviceNotAvailable,"video device not found or not available",{deviceId:e,deviceLabel:null,prevDeviceId:this.videoDeviceId,prevDeviceLabel:null!==(r=null===(t=this.videoDeviceChanged)||void 0===t?void 0:t.label)&&void 0!==r?r:null,kind:"video"})),this.videoDeviceChanging=y[e]):this.videoDeviceChanging=null}get isScreenCaptured(){var e;return(null===(e=this.videoDeviceChanged)||void 0===e?void 0:e.deviceId)===t.VIDEO_DEVICE_SCREENCAPTURE.deviceId}constructor(e){var r,n,o,a;super(),this.sync=null,this.audioCtx=null,this.optionsAtom=(0,s.createAtom)("options"),this.applyConstraintsAtom=(0,s.createAtom)("applyConstraints"),this.capturable=null,this.batchUpdates={timeout:null,changes:[],videoDevice:!1,audioDevice:!1,gain:!1,videoPaused:!1,audioMuted:!1,constraints:!1},this.audioDeviceChanged=null,this.videoDeviceChanged=null,this.audioDeviceChanging=null,this.videoDeviceChanging=null,this.videoDeviceRemoved=null,this.audioDeviceRemoved=null,this.audioMuted=!1,this.availableResolutions=[],this.maxWidth=null,this.maxHeight=null,this.videoPaused=!1,this.videoDisabled=!1,this.audioDisabled=!1,this.facingMode=null,this.gain=1,this.noEchoGainAmplifier=!1,this.resolution=null,this.frameRate=null,this.aspectRatio=null,this.echoCancellation=null,this.noiseSuppression=null,this.autoGainControl=null,c.device.isImplements(c.Feature.MEDIA_STREAM)||this.throwError((0,p.createError)(l.ErrorCode.MediaStreamNotSupported,"MediaStream is not supported",{})),this.source=new c.device.MediaStream,this.logger=new i.LoggerCore(h.PACKAGE_NAME).setLoggerMeta("package","VDC-core").setLoggerMeta("client","VDC").setLoggerMeta("release",d.default.version).setLoggerMeta("commitHash",d.default.commit).setLoggerMeta("contextId",null!==(r=(0,h.contextId)())&&void 0!==r?r:"").setLoggerMeta("instanceId",null!==(n=(0,h.instanceId)())&&void 0!==n?n:"").setMessageAggregate("displayName",null==e?void 0:e.displayName).appendChain(M).attachObject(this),this.logger.trace("constructor()",this),this.on("error",(e=>{this.logger.error(e.message)})),(0,s.makeObservable)(this,{audioDeviceChanged:s.observable.ref,videoDeviceChanged:s.observable.ref,audioDeviceChanging:s.observable.ref,videoDeviceChanging:s.observable.ref,audioMuted:s.observable,availableResolutions:s.observable,maxWidth:s.observable,maxHeight:s.observable,videoPaused:s.observable,videoDisabled:s.observable,audioDisabled:s.observable,facingMode:s.observable,gain:s.observable,resolution:s.observable,frameRate:s.observable,aspectRatio:s.observable,echoCancellation:s.observable,noiseSuppression:s.observable,autoGainControl:s.observable,source:s.observable.ref,audioDeviceId:s.computed,videoDeviceId:s.computed,isScreenCaptured:s.computed,sourceUrl:s.computed,settings:s.computed,toggleCamera:s.action,toggleMic:s.action,onDeviceListChanged:s.action}),this.options=JSON.parse(JSON.stringify(P)),null!=e&&(this.setOptions({...P,...e}),null!=(null===(o=null==e?void 0:e.capturable)||void 0===o?void 0:o.element)&&c.device.supportsMediaStreamCapture(null===(a=null==e?void 0:e.capturable)||void 0===a?void 0:a.element)&&(this.capturable=e.capturable,this.videoDeviceId=t.VIDEO_DEVICE_CAPTURABLE.deviceId,this.applyNewDevices())),this.options.noEchoGainAmplifier&&(this.noEchoGainAmplifier=!0),this.setupMobxBatching(),t.mediaController.on("deviceListChanged",this.onDeviceListChanged),this.addInnerDisposer((()=>{this.close()}))}hasActiveStream(){const e=this.hasActiveAudioTrack(),t=this.hasActiveAudioTrack();return e||t}hasActiveVideoTrack(){const{videoDeviceChanged:e,videoDisabled:t}=this;return null!=e&&!1===t}hasActiveAudioTrack(){return null!=this.audioDeviceChanged&&!1===this.audioDisabled}toggleCamera(){this.videoPaused=!this.videoPaused}toggleMic(){this.audioMuted=!this.audioMuted}onDeviceListChanged(e){if(null!=this.videoDeviceChanged&&!e.some((e=>{var t;return e.deviceId===(null===(t=this.videoDeviceChanged)||void 0===t?void 0:t.deviceId)}))){const t=e.filter((e=>"videoinput"===e.kind));t.length>0?[this.videoDeviceChanging]=t:this.videoDeviceChanging=null}if(null!=this.audioDeviceChanged&&!e.some((e=>{var t;return e.deviceId===(null===(t=this.audioDeviceChanged)||void 0===t?void 0:t.deviceId)}))){const t=e.filter((e=>"audioinput"===e.kind));t.length>0?[this.audioDeviceChanging]=t:this.audioDeviceChanging=null}}setupMobxBatching(){const e={scheduler:this.batchUpdatesScheduler,name:"MediaStreamController(batch update)"};this.addInnerDisposer((0,s.reaction)((()=>this.videoDeviceChanging),(()=>{this.batchUpdates.videoDevice=!0}),e)),this.addInnerDisposer((0,s.reaction)((()=>this.audioDeviceChanging),(()=>{this.batchUpdates.audioDevice=!0}),e)),this.addInnerDisposer((0,s.reaction)((()=>this.videoDisabled),(()=>{this.batchUpdates.videoDevice=!0}),e)),this.addInnerDisposer((0,s.reaction)((()=>this.audioDisabled),(()=>{this.batchUpdates.audioDevice=!0}),e)),this.addInnerDisposer((0,s.reaction)((()=>this.gain),(()=>{this.batchUpdates.gain=!0}),e)),this.addInnerDisposer((0,s.reaction)((()=>this.videoPaused),(()=>{this.batchUpdates.videoPaused=!0}),e)),this.addInnerDisposer((0,s.reaction)((()=>this.audioMuted),(()=>{this.batchUpdates.audioMuted=!0}),e)),this.addInnerDisposer((0,s.reaction)((()=>[this.facingMode,this.aspectRatio,this.frameRate,this.resolution,this.noiseSuppression,this.autoGainControl,this.echoCancellation]),(()=>{this.batchUpdates.constraints=!0}),e))}batchUpdatesScheduler(e,...t){this.batchUpdates.changes.push(e),null==this.batchUpdates.timeout&&(this.batchUpdates.timeout=c.device.setInterval((()=>{var e;if(null!=this.sync)return;c.device.clearInterval(null!==(e=this.batchUpdates.timeout)&&void 0!==e?e:void 0),this.batchUpdates.changes.forEach((e=>e()));const t=this.batchUpdates;this.batchUpdates={timeout:null,changes:[],videoDevice:!1,audioDevice:!1,gain:!1,videoPaused:!1,audioMuted:!1,constraints:!1},t.audioDevice||t.videoDevice?this.applyNewDevices():!t.constraints||c.device.isImplements(c.Feature.APPLY_CONSTRAINTS)?(t.audioMuted&&this.applyAudioMute(),t.videoPaused&&this.applyVideoPause(),t.gain&&this.applyGain(),t.constraints&&this.applyConstraints()):this.applyConstraints()}),10))}setOptions(e){let t=!1;null!=e.replaceTracks&&(this.options.replaceTracks=e.replaceTracks),null!=e.requestAudioPermission&&(this.options.requestAudioPermission=e.requestAudioPermission),null!=e.defaultConstraints&&(this.options.defaultConstraints={...e.defaultConstraints},t=!0),void 0!==e.fallbackConstraints&&(this.options.fallbackConstraints=null==e.fallbackConstraints?null:{...e.fallbackConstraints},t=!0),void 0!==e.capturable&&(this.capturable=e.capturable),t&&this.applyConstraints(),this.optionsAtom.reportChanged()}constraints({withAudio:e=!0,withVideo:t=!0}){return D({defaults:this.options.defaultConstraints,audioDeviceInfo:this.options.requestAudioPermission&&e&&!0!==this.audioDisabled?this.audioDeviceChanging:null,videoDeviceInfo:!0!==this.videoDisabled&&t?this.videoDeviceChanging:null,overrides:{aspectRatio:this.aspectRatio,autoGainControl:this.autoGainControl,echoCancellation:this.echoCancellation,facingMode:this.facingMode,frameRate:this.frameRate,noiseSuppression:this.noiseSuppression,resolution:null!=this.maxHeight&&0!==this.maxHeight&&null==this.resolution?{min:240,ideal:this.maxHeight,max:this.maxHeight}:this.resolution}})}fallbackConstraints({withAudio:e=!0,withVideo:t=!0}){return null==this.options.fallbackConstraints?null:D({defaults:this.options.fallbackConstraints,audioDeviceInfo:this.options.requestAudioPermission&&e&&!0!==this.audioDisabled?this.audioDeviceChanging:null,videoDeviceInfo:!0!==this.videoDisabled&&t?this.videoDeviceChanging:null,overrides:{aspectRatio:this.aspectRatio,autoGainControl:this.autoGainControl,echoCancellation:this.echoCancellation,facingMode:this.facingMode,frameRate:this.frameRate,noiseSuppression:this.noiseSuppression,resolution:null!=this.maxHeight&&0!==this.maxHeight&&null==this.resolution?{min:240,ideal:this.maxHeight,max:this.maxHeight}:this.resolution}})}activeConstraints(){var e,t,r,n,i,o;this.applyConstraintsAtom.reportObserved();const a={};try{if(this.hasActiveVideoTrack()&&(a.video=null===(r=null===(t=null===(e=this.source)||void 0===e?void 0:e.getVideoTracks())||void 0===t?void 0:t[0])||void 0===r?void 0:r.getConstraints()),this.hasActiveAudioTrack()){const e=null===(i=null===(n=this.source)||void 0===n?void 0:n.getAudioTracks())||void 0===i?void 0:i[0];if(null!=e){const t=null===(o=w.get(e))||void 0===o?void 0:o.originalTrack;a.audio=null!=t?t.getConstraints():e.getConstraints()}}}catch(e){this.logger.warn("unable to detect active constaints")}return a}activeCapabilities(){var e,t,r,n,i,o;const a={};try{if(this.hasActiveVideoTrack()&&(a.video=null===(r=null===(t=null===(e=this.source)||void 0===e?void 0:e.getVideoTracks())||void 0===t?void 0:t[0])||void 0===r?void 0:r.getCapabilities()),this.hasActiveAudioTrack()){const e=null===(i=null===(n=this.source)||void 0===n?void 0:n.getAudioTracks())||void 0===i?void 0:i[0];if(null!=e){const t=null===(o=w.get(e))||void 0===o?void 0:o.originalTrack;a.audio=null!=t?t.getCapabilities():e.getCapabilities()}}}catch(e){this.logger.warn("unable to detect active capabilities")}return a}stopTracksInternal({stream:e,audio:t,video:r}){T({stream:e,audio:t,video:r,removeEventListenerCb:e=>{"audio"===e.kind?e.removeEventListener("ended",this.handleAudioTrackEnded):e.removeEventListener("ended",this.handleVideoTrackEnded)}})}applyVideoPause(){var e;const{videoPaused:r}=this;(null===(e=this.videoDeviceChanged)||void 0===e?void 0:e.deviceId)!==t.VIDEO_DEVICE_SCREENCAPTURE.deviceId&&this.source.getVideoTracks().forEach((e=>{r?this.logger.debug("pause video track",{trackId:e.id}):this.logger.debug("unpause video track",{trackId:e.id}),e.enabled=!r}))}applyAudioMute(){const{audioMuted:e}=this;this.source.getAudioTracks().forEach((t=>{e?this.logger.debug("disable audio track",{trackId:t.id}):this.logger.debug("enable audio track",{trackId:t.id}),t.enabled=!e}))}getVideoDevice(){return"placeholder"===this.videoDisabled?t.VIDEO_DEVICE_CAPTURABLE:this.videoDisabled?null:this.videoDeviceChanging}async applyNewDevices(){const{replaceTracks:e}=this.options,t=this.getVideoDevice(),r=!0===this.audioDisabled||"placeholder"===this.audioDisabled?null:this.audioDeviceChanging,n=this.videoDeviceChanged,i=this.audioDeviceChanged,o=t!==this.videoDeviceChanged,a=this.audioDeviceChanging!==this.audioDeviceChanged;if(null==t&&null==r)return void(0,s.action)("applyNewDevices",(()=>{c.device.isImplements(c.Feature.MEDIA_STREAM)&&(this.audioDeviceChanged=r,this.videoDeviceChanged=t,this.stopTracksInternal({stream:this.source}),this.source=new c.device.MediaStream)}))();this.logger.debug("preparing new devices",{videoDevice:t,audioDevice:r,videoChanged:o,audioChanged:a,replaceTracks:e});let l=null;const u=this.source;if(e)try{await this.handleUpdateResolutions({videoDevice:t,videoChanged:o,videoDeviceOld:n}),l=await this.lockAndPrepareStream(t,this.options.defaultLockPolicy,this.constraints({withAudio:a,withVideo:o}),this.fallbackConstraints({withAudio:a,withVideo:o})),this.stopTracksInternal({stream:u,audio:a,video:o})}catch(e){return void this.handleNewStreamError({newStream:l,err:e,deviceState:{videoDevice:t,audioDevice:r,videoDeviceOld:n,audioDeviceOld:i,videoChanged:o,audioChanged:a}})}else try{this.stopTracksInternal({stream:u,audio:a,video:o}),await this.handleUpdateResolutions({videoDevice:t,videoChanged:o,videoDeviceOld:n}),l=await this.lockAndPrepareStream(t,this.options.defaultLockPolicy,this.constraints({withAudio:a,withVideo:o}),this.fallbackConstraints({withAudio:a,withVideo:o}))}catch(e){return void this.handleNewStreamError({newStream:l,err:e,deviceState:{videoDevice:t,audioDevice:r,videoDeviceOld:n,audioDeviceOld:i,videoChanged:o,audioChanged:a}})}for(const e of u.getTracks())u.removeTrack(e),l.addTrack(e);const d=l;(0,s.action)("applyNewDevices",(()=>{this.audioDeviceChanged=r,this.videoDeviceChanged=t,this.source=d,this.logger.info("applied new devices",{videoDevice:t,audioDevice:r})}))()}async handleNewStreamError({newStream:e,err:r,deviceState:n}){var i,o,a,c,u,d,h,f;const{videoDevice:m,audioDevice:g,videoDeviceOld:y,audioDeviceOld:b,videoChanged:_,audioChanged:S}=n;if(this.stopTracksInternal({stream:e}),r instanceof Error&&"NotReadableError"===r.name)return await t.mediaController.handleDeviceInUse({audio:!0,video:!0},v),this.emitError((0,p.createError)(l.ErrorCode.DeviceInUse,"device(s) already in use",r)),void(null==this.sync&&(0,s.action)("rollbackDevices",(()=>{this.videoDeviceChanging=y,this.audioDeviceChanging=b}))());_&&this.emitError((0,p.createError)(l.ErrorCode.MediaDeviceChangingFailed,"unable to change video device",{deviceId:null!==(i=null==m?void 0:m.deviceId)&&void 0!==i?i:null,deviceLabel:null!==(o=null==m?void 0:m.label)&&void 0!==o?o:null,prevDeviceId:null!==(a=null==y?void 0:y.deviceId)&&void 0!==a?a:null,prevDeviceLabel:null!==(c=null==y?void 0:y.label)&&void 0!==c?c:null,kind:"video"},r)),S&&this.emitError((0,p.createError)(l.ErrorCode.MediaDeviceChangingFailed,"unable to change audio device",{deviceId:null!==(u=null==g?void 0:g.deviceId)&&void 0!==u?u:null,deviceLabel:null!==(d=null==g?void 0:g.label)&&void 0!==d?d:null,prevDeviceId:null!==(h=null==b?void 0:b.deviceId)&&void 0!==h?h:null,prevDeviceLabel:null!==(f=null==b?void 0:b.label)&&void 0!==f?f:null,kind:"audio"},r)),this.emit("changeDevicesError",{err:r,audio:{old:b,new:g},video:{old:y,new:m}}),null==this.sync&&(0,s.action)("rollbackDevices",(()=>{this.videoDeviceChanging=y,this.audioDeviceChanging=b}))()}async handleUpdateResolutions(e){var r,n,i,o;const{videoDevice:a,videoDeviceOld:s,videoChanged:c}=e;if(c&&a!==t.VIDEO_DEVICE_SCREENCAPTURE&&a!==t.VIDEO_DEVICE_CAPTURABLE)try{await this.updateResolutions(a)}catch(e){this.emitError((0,p.createError)(l.ErrorCode.UpdateResolutionsFailed,"unable to update available resolutions",{kind:"video",deviceId:null!==(r=null==a?void 0:a.deviceId)&&void 0!==r?r:null,deviceLabel:null!==(n=null==a?void 0:a.label)&&void 0!==n?n:null,prevDeviceId:null!==(i=null==s?void 0:s.deviceId)&&void 0!==i?i:null,prevDeviceLabel:null!==(o=null==s?void 0:s.label)&&void 0!==o?o:null},e))}}async getDeviceResolutions({videoDevice:e,deviceInUse:t}){const r="number"==typeof this.aspectRatio?this.aspectRatio:16/9;let n=null,i=null,o=null,a=!1;if(null==(null==e?void 0:e.deviceId))return this.logger.debug("Unable to get best resolution stream, deviceId undefined"),{maxHeight:i,maxWidth:n,availableResolutions:[],resolutionsInUse:a};this.logger.debug(`Getting best resolution stream for ${e.deviceId}`,{newVersion:"1.0"});let s={deviceId:{exact:e.deviceId}};c.device.isFirefox&&(s={...s,height:{ideal:4e3}});const u=await this.lockAndPrepareStream(e,l.ExistsStreamPolicy.error,{video:s});o=function({stream:e,logger:t,deviceInUse:r=!1}){var n,i,o,a;const s=e.getVideoTracks()[0];if(null==s)return[null,null];const l=function(e,t){var r,n;let i;try{i=null!==(n=null===(r=null==e?void 0:e.getCapabilities)||void 0===r?void 0:r.call(e))&&void 0!==n?n:{},null==t||t.debug("videoTrack capabilities",{capabilities:i})}catch(e){i={}}return i}(s,t),u=k(s),d=r||null==(null===(n=null==l?void 0:l.width)||void 0===n?void 0:n.max)?null==u?void 0:u.width:null===(i=null==l?void 0:l.width)||void 0===i?void 0:i.max;let h=r||null==(null===(o=null==l?void 0:l.height)||void 0===o?void 0:o.max)?null==u?void 0:u.height:null===(a=null==l?void 0:l.height)||void 0===a?void 0:a.max;const p=c.device.isMobileDevice?1080:2160;return null!=h&&h>p&&(h=p),null==h||null==d?[null,null]:(null==t||t.debug("adjusted maxHeight",{adjustedMaxHeight:h}),[d,h])}({stream:u,logger:this.logger,deviceInUse:t}),this.stopTracksInternal({stream:u}),[n,i]=null!=E[e.deviceId]&&t?E[e.deviceId]:o;const d=S.filter((e=>null!=n&&null!=i&&e<=i&&e*r<=n));if(t){const[t,n]=o,i=S.filter((e=>null!=t&&null!=n&&e<=n&&e*r<=t));i.length"live"===e.readyState)))throw new Error("attempt to get resolutions with replaceTracks enabled and running stream");if(null==t)return this.logger.debug("Unable to get best resolution stream, deviceId undefined"),void(0,s.runInAction)((()=>{this.maxWidth=0,this.maxHeight=0,this.availableResolutions=[]}));if(c.device.isImplements(c.Feature.LOCAL_STORAGE)){let e;const r=c.device.localStorage.getItem(I(t));if(null!=r)try{e=JSON.parse(r),Array.isArray(e)&&(E[t]=e)}catch(e){const t=e instanceof Error?e.message:"unknown error";this.logger.error("unable to parse device resolution settings",{data:r,err:t})}}const{maxWidth:r,maxHeight:n,availableResolutions:i,deviceResolutions:o}=await this.getDeviceResolutions({videoDevice:e,deviceInUse:!1});null==E[t]&&null!=o&&(E[t]=o,c.device.isImplements(c.Feature.LOCAL_STORAGE)&&c.device.localStorage.setItem(I(t),JSON.stringify(E[t]))),(0,s.runInAction)((()=>{this.maxWidth=r,this.maxHeight=n,this.availableResolutions=i}))}async applyConstraintsVideo(e,t,r){var n;if(c.device.isImplements(c.Feature.APPLY_CONSTRAINTS)){this.logger.debug("apply video constraints",{defaultVideo:r,fallbackVideo:t}),c.device.isSafari&&delete r.deviceId;try{await c.device.applyConstraints(e,r)}catch(i){this.logger.warn("unable to apply video constraints",{defaultVideo:r});const o=i instanceof Error||(0,u.isErrorLike)(i)?i:null,s=this.activeConstraints(),l=(0,a.diff)(r,null!==(n=s.video)&&void 0!==n?n:{});this.emit("videoConstraintsError",{diff:l,isFallback:!1,constraints:r,err:(0,p.wrapError)(o)}),null!=t&&"boolean"!=typeof t&&(this.logger.debug("trying fallback video constraints",{fallbackVideo:t}),c.device.applyConstraints(e,t).catch((n=>{var i;const o=n instanceof Error||(0,u.isErrorLike)(n)?n:null,s=this.activeConstraints(),l=(0,a.diff)(t,null!==(i=s.video)&&void 0!==i?i:{});null!=o&&(0,u.isOverconstrainedError)(o)&&"height"===o.constraint?(this.logger.error("Unable to apply selected resolution, please select a resolution supported by your current video device.",{fallbackConstraints:t,defaultConstraints:r,trackId:e.id,trackType:e.kind,err:(0,p.wrapError)(o)}),this.emit("videoConstraintsError",{diff:l,isFallback:!0,constraints:t,err:(0,p.wrapError)(o)}),this.getDeviceResolutions({videoDevice:this.getVideoDevice(),deviceInUse:!0})):(this.logger.error("Unable to apply video constraints. Try restarting the stream.",{fallbackConstraints:t,defaultConstraints:r,trackId:e.id,trackType:e.kind,err:(0,p.wrapError)(o)}),this.emit("videoConstraintsError",{diff:l,isFallback:!0,constraints:t,err:(0,p.wrapError)(o)}))})))}}}async applyConstraintsAudio(e,t,r){var n,i;if(c.device.isImplements(c.Feature.APPLY_CONSTRAINTS))try{c.device.isSafari&&delete t.deviceId,await c.device.applyConstraints(e,t)}catch(o){this.logger.warn("unable to apply constraints",{defaultAudio:t});const s=o instanceof Error||(0,u.isErrorLike)(o)?o:null,l=this.activeConstraints(),d=(0,a.diff)(t,null!==(n=l.audio)&&void 0!==n?n:{});if(this.emit("audioConstraintsError",{diff:d,isFallback:!1,constraints:t,err:(0,p.wrapError)(s)}),null!=r&&"boolean"!=typeof r){this.logger.debug("trying fallback apply constraints",{fallbackAudio:r});const n=this.activeConstraints(),o=(0,a.diff)(r,null!==(i=n.audio)&&void 0!==i?i:{});c.device.applyConstraints(e,r).catch((n=>{const i=n instanceof Error||(0,u.isErrorLike)(n)?n:null;this.logger.error("unable to apply audio constraints. restart stream",{fallbackConstraints:r,defaultConstraints:t,trackId:e.id,trackType:e.kind,err:(0,p.wrapError)(i)}),this.emit("audioConstraintsError",{diff:o,isFallback:!0,constraints:r,err:(0,p.wrapError)(i)})}))}}}async applyConstraints(){if(null==this.audioDeviceChanging&&null==this.videoDeviceChanging)return;if(!c.device.isImplements(c.Feature.APPLY_CONSTRAINTS)){this.stopTracksInternal({stream:this.source});try{this.source=await this.lockAndPrepareStream(this.videoDeviceChanging,this.options.defaultLockPolicy,this.constraints({withAudio:!0,withVideo:!0}),this.fallbackConstraints({withAudio:!0,withVideo:!0}))}catch(e){this.emitError((0,p.createError)(l.ErrorCode.ApplyingConstraintsFailed,"applying constraints failed",{constraints:this.constraints({withAudio:!0,withVideo:!0}),fallbackConstraints:this.fallbackConstraints({withAudio:!0,withVideo:!0})},e))}return}const e=this.source,t=this.constraints({withAudio:!0,withVideo:!0}),r=this.fallbackConstraints({withAudio:!0,withVideo:!0}),n=[],i=t.video,o=null==r?void 0:r.video,a=t.audio,s=null==r?void 0:r.audio;null!=i&&"boolean"!=typeof i&&n.push(...e.getVideoTracks().filter((e=>"ended"!==e.readyState)).map((e=>this.applyConstraintsVideo(e,o,i)))),null!=a&&"boolean"!=typeof a&&n.push(...e.getAudioTracks().map((e=>{var t;return null!=(null===(t=w.get(e))||void 0===t?void 0:t.originalTrack)?w.get(e).originalTrack:e})).filter((e=>e)).map((e=>this.applyConstraintsAudio(e,a,s)))),await Promise.all(n),this.applyConstraintsAtom.reportChanged()}supportsNoiseSuppression(){var e;if(c.device.isImplements(c.Feature.MEDIA_DEVICE))try{return null!==(e=c.device.mediaDevices.getSupportedConstraints().noiseSuppression)&&void 0!==e&&e}catch(e){return!1}return!1}supportsEchoCancellation(){var e;if(c.device.isImplements(c.Feature.MEDIA_DEVICE))try{return null!==(e=c.device.mediaDevices.getSupportedConstraints().echoCancellation)&&void 0!==e&&e}catch(e){return!1}return!1}async applyGain(){const e=this.source.getAudioTracks()[0],t=w.get(e);if(null!=(null==t?void 0:t.gainNode)){const r=R(e);this.noEchoGainAmplifier&&!1===r.echoCancellation?t.gainNode.gain.value=10*this.gain:t.gainNode.gain.value=this.gain,this.applyConstraintsAtom.reportChanged()}}async lockAndPrepareStream(e,r,n,i){const o=e===t.VIDEO_DEVICE_SCREENCAPTURE?"screencapture":e===t.VIDEO_DEVICE_CAPTURABLE?"captureable":"media";if(!1===n.audio&&!1===n.video&&c.device.isImplements(c.Feature.MEDIA_STREAM))return new c.device.MediaStream;if(this.logger.trace("lockAndPrepareStream()",{policy:l.ExistsStreamPolicy[r],constraints:n}),null!=this.sync)switch(r){case l.ExistsStreamPolicy.error:this.throwError((0,p.createError)(l.ErrorCode.MediaStreamPreparingConflict,"MediaStream is preparing already",{}));break;case l.ExistsStreamPolicy.stale:return this.logger.debug("stream is preparing already, waiting"),this.sync;case l.ExistsStreamPolicy.wait:return await this.sync,new Promise(((t,o)=>{c.device.setTimeout((()=>{this.lockAndPrepareStream(e,r,n,i).then(t).catch(o)}),this.options.waitingDelay)}));case l.ExistsStreamPolicy.ignore:this.sync.then((e=>{this.stopTracksInternal({stream:e})}));break;default:throw new Error(`Unknown policy MediaStream ${r}`)}return this.sync=this.prepareStream(o,n).catch((e=>{if(null!=i&&"media"===o)return this.logger.warn("constraints failed. using fallback constraints",{constraints:n,fallbackConstraints:i,err:e}),this.prepareStream(o,i);throw e})),this.sync.finally((()=>{this.sync=null}))}async prepareStream(e,t){var r,n;this.logger.trace("prepareStream() start",{constraints:t});let i=null;if(i="screencapture"===e?await this.prepareScreenCaptureStream({audio:t.audio,video:this.options.defaultConstraints.screencapture}):"captureable"===e?await this.prepareCapturableStream({audio:t.audio}):await this.prepareMediaStream(t),"media"===e&&i.getVideoTracks().forEach((e=>{e.addEventListener("ended",this.handleVideoTrackEnded)})),i.getAudioTracks().forEach((e=>{e.addEventListener("ended",this.handleAudioTrackEnded)})),!1!==t.audio){const e=this.noEchoGainAmplifier&&"boolean"!=typeof t.audio&&!1===(null===(r=t.audio)||void 0===r?void 0:r.echoCancellation)?10*this.gain:this.gain;i=function(e,t,r){if(!c.device.isImplements(c.Feature.AUDIO_CONTEXT))return t;if(!t.getAudioTracks().length)return t;if(e.debug("attach gain controller to stream"),null==O&&(O=new c.device.AudioContext),null==O.createAnalyser||null==O.createGain||null==O.createMediaStreamSource||null==O.createMediaStreamDestination)return t;const n=O.createGain(),i=O.createMediaStreamSource(t),o=O.createMediaStreamDestination(),a=o.stream;i.connect(n),n.connect(o),n.gain.value=r;const s=t.getAudioTracks()[0],l=a.getAudioTracks()[0];if(null==s||null==l)throw new Error("no audio tracks");const u=function(e){var t,r,n;const i=w.get(e);if(null!=(null==i?void 0:i.deviceId))return i.deviceId;const o=k(e),a=R(e),s=null!==(t=null==o?void 0:o.deviceId)&&void 0!==t?t:"object"==typeof(null==a?void 0:a.deviceId)?a.deviceId.exact:Array.isArray(a.deviceId)?a.deviceId[0]:a.deviceId;return null!=s?s.toString():null!==(n=null===(r=v.find((t=>t.label===e.label)))||void 0===r?void 0:r.deviceId)&&void 0!==n?n:null}(s);null!=u&&w.set(l,{deviceId:u,originalTrack:s,gainNode:n}),t.getVideoTracks().forEach((e=>{a.addTrack(e)}));const d=()=>{e.debug("modified audio track is ended. stopping original one",{originalTrack:s.id}),s.stop(),l.removeEventListener("ended",d)};return l.addEventListener("ended",d),a}(this.logger,i,e)}for(const e of null!==(n=null==i?void 0:i.getTracks())&&void 0!==n?n:[])"ended"===e.readyState&&this.throwError((0,p.createError)(l.ErrorCode.MediaTrackEnded,"track ended unexpectedly",{trackId:e.id,kind:e.kind})),"video"===e.kind&&(e.enabled=!this.videoPaused),"audio"===e.kind&&(e.enabled=!this.audioMuted);return this.logger.trace("prepareStream() finished"),i}async handleAudioTrackEnded(){var e;"denied"!==(null===(e=t.mediaController.micPermission)||void 0===e?void 0:e.state)&&(await t.mediaController.enumerateDevices(),(null==v?void 0:v.some((e=>"audioinput"===e.kind&&e.deviceId===this.audioDeviceId)))||(this.logger.warn("Audio device no longer exists in list of available devices, check to see if device was removed"),this.emit("audioDeviceRemoved",this.audioDeviceId),this.audioDeviceId=null))}async handleVideoTrackEnded(){var e;"denied"!==(null===(e=t.mediaController.camPermission)||void 0===e?void 0:e.state)&&(this.logger.warn("video track has ended unexpectedly (perm revoked?)"),await t.mediaController.enumerateDevices(),(null==v?void 0:v.some((e=>"videoinput"===e.kind&&e.deviceId===this.videoDeviceId)))||(this.logger.warn("Video device no longer exists in list of available devices, check to see if device was removed"),this.emit("videoDeviceRemoved",this.videoDeviceId),this.videoDeviceId=null))}async prepareMediaStream(e){return this.logger.trace("prepareMediaStream()"),c.device.isImplements(c.Feature.MEDIA_DEVICE)&&null!=c.device.mediaDevices.getUserMedia||this.throwError((0,p.createError)(l.ErrorCode.MediaDeviceNotSupported,"MediaDevices not supported",{})),this.logger.debug("using constraints",{constraints:e}),c.device.mediaDevices.getUserMedia(e)}async prepareScreenCaptureStream(e){var r,n;this.logger.trace("prepareScreenCaptureStream()",{constraints:e});let i=null,o=null;if(c.device.isImplements(c.Feature.MEDIA_STREAM)&&c.device.isImplements(c.Feature.MEDIA_DEVICE)&&"function"==typeof c.device.mediaDevices.getDisplayMedia){const t=null===(n=null===(r=c.device.mediaDevices)||void 0===r?void 0:r.getDisplayMedia)||void 0===n?void 0:n.call(r,{video:e.video});if(null!=t)try{i=await t}catch(e){throw this.videoDeviceChanging=null,e}o=!1!==e.audio?await this.prepareMediaStream({audio:e.audio}):new c.device.MediaStream}if(null==i||null==o)throw new Error("unable to capture screen");return i.getTracks().forEach((e=>{w.set(e,{deviceId:t.VIDEO_DEVICE_SCREENCAPTURE.deviceId}),null==o||o.addTrack(e)})),o}async prepareCapturableStream(e){var r,n;this.logger.trace("prepareCapturableStream()",{constraints:e});let i=null,o=null;if(c.device.isImplements(c.Feature.MEDIA_STREAM)&&null!=(null===(r=this.capturable)||void 0===r?void 0:r.element)&&c.device.supportsMediaStreamCapture(null===(n=this.capturable)||void 0===n?void 0:n.element)?i=c.device.captureStream(this.capturable.element,this.capturable.framerate):this.logger.warn("unable to support stream capture"),c.device.isImplements(c.Feature.MEDIA_DEVICE)&&c.device.isImplements(c.Feature.MEDIA_STREAM)&&(o=!1===e.audio||null==e.audio?new c.device.MediaStream:await this.prepareMediaStream({audio:e.audio})),null==i||null==o)throw new Error(`prepareCapturableStream(): unable to generate MediaStream from provided inputs. CapturableStream is null: ${null==i}. Base MediaStream is null: ${null==o}`);return i.getTracks().forEach((e=>{w.set(e,{deviceId:t.VIDEO_DEVICE_CAPTURABLE.deviceId}),null==o||o.addTrack(e)})),o}close(e="not provided"){var t;try{this.stopTracksInternal({stream:this.source}),this.audioDeviceChanging=null,this.videoDeviceChanging=null,this.logger.info("MediaController Class close()",{aggregates:{reason:e}})}catch(t){this.emitError((0,p.createError)(l.ErrorCode.DisposingError,"unable to dispose media stream controller",{className:M.displayName,reason:e},t))}null===(t=this.audioCtx)||void 0===t||t.close().catch((()=>{}))}toJSON(){var e,t,r;return{audioMuted:this.audioMuted,videoPaused:this.videoPaused,videoDisabled:this.videoDisabled,audioDisabled:this.audioDisabled,inAudioDeviceTransition:this.inAudioDeviceTransition,inVideoDeviceTransition:this.inVideoDeviceTransition,hasSync:null!=this.sync,mscOptions:{replaceTracks:null===(e=this.options)||void 0===e?void 0:e.replaceTracks,waitingDelay:null===(t=this.options)||void 0===t?void 0:t.waitingDelay,defaultLockPolicy:null===(r=this.options)||void 0===r?void 0:r.defaultLockPolicy},aggregates:{audioDeviceId:this.audioDeviceId,videoDeviceId:this.videoDeviceId}}}}t.MediaStreamController=M,M.displayName="MediaStreamController"},26428:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=r(27813),o=r(80769),a=r(86729),s=r(92491),l=r(93503),c=r(45831),u=r(59703),d=n.__importDefault(r(18741)),h=n.__importDefault(r(45799)),p=["aac"];var f;!function(e){e.SBP="sbp",e.IMG="img",e.VDC="vdc",e.SUBSTITUTE="substitute"}(f||(f={}));class m extends c.ObservableEventEmitter{constructor(e,t,r){if(super(),this.source=null,this.currentState="offline",this.formats={},this.uri=null,this.originalAuthToken=null,this.viewCount=0,this.pingUri=null,this.destroyed=!1,this.shouldBePolling=!1,this.manifest=null,this.type=null,this.pollingTimeout=null,this.noLongerUnauthorizedPolling=!1,this.unauthorizedRecoveryTimout=null,this.ctx=e,(0,l.onceCanceled)(e).then((e=>this.dispose(`MediaLoader Class Context Closed: ${e}`))),(0,i.makeObservable)(this,{source:i.observable.ref}),this.currentState="offline",this.formats={},this.pingUri=null,this.destroyed=!1,this.options=r,this.setManifest(t),this.setUri(t),this.shouldBePolling=!1,e.logger.attachObject(this),null!=this.ctx.token){const e="string"==typeof this.ctx.token?{token:this.ctx.token}:{refreshToken:this.ctx.token};this.auth=new d.default({bootstrap:e})}e.logger.trace("constructor()",{manifest:t,auth:{token:"string"===this.ctx.token?this.ctx.token:void 0,hasRefreshToken:!(null==this.ctx.token||"string"===this.ctx.token)}}),this.addInnerDisposer((()=>{var e;null!=this.auth&&this.auth.destroy(),this.destroyed=!0,clearInterval(null!==(e=this.pollingTimeout)&&void 0!==e?e:0)}))}static modifyFormats(e){for(const t of Object.keys(e))if("mp4-ws"===t){const r=e[t];null!=(null==r?void 0:r.origin)&&p.includes(r.audioCodec)&&(r.origin=void 0)}return e}async load(e=!1){var t,r,n,i,a,l,c,d,p,g,v,y,b,_,S;if(null!=this.manifest||this.vod)return this.emit("manifest",{state:this.currentState,formats:this.formats}),void(null!=this.manifest&&"string"!=typeof this.manifest&&(this.source=this.manifest));if(null==this.uri)return;this.ctx.logger.debug("loading manifest",{uri:this.uri});let w,E=null,C=null;const O=this.uri.split("?");let P;P=O[1]?`&${O[1]}`:"",P=(0,u.removeSearchParameterFromUrl)(P,f.IMG),P=`${P}&${f.IMG}=${e.toString()}`,P=(0,u.removeSearchParameterFromUrl)(P,f.VDC),(null==(null===(r=null===(t=this.options)||void 0===t?void 0:t.urlParams)||void 0===r?void 0:r.vdc)||(null===(i=null===(n=this.options)||void 0===n?void 0:n.urlParams)||void 0===i?void 0:i.vdc))&&(P=`${P}&${f.VDC}=true`),P=(0,u.removeSearchParameterFromUrl)(P,f.SBP),(null==(null===(l=null===(a=this.options)||void 0===a?void 0:a.urlParams)||void 0===l?void 0:l.sbp)||(null===(d=null===(c=this.options)||void 0===c?void 0:c.urlParams)||void 0===d?void 0:d.sbp))&&(P=`${P}&${f.SBP}=true`),P=(0,u.removeSearchParameterFromUrl)(P,f.SUBSTITUTE),(null==(null===(g=null===(p=this.options)||void 0===p?void 0:p.urlParams)||void 0===g?void 0:g.substitute)||(null===(y=null===(v=this.options)||void 0===v?void 0:v.urlParams)||void 0===y?void 0:y.substitute))&&(P=`${P}&${f.SUBSTITUTE}=true`);const T=`${O[0]}?${P}`;try{E=await(0,h.default)(this.ctx,T,{auth:this.auth,method:"get",headers:this.options.requestHeaders}),w=null!==(b=null==E?void 0:E.status)&&void 0!==b?b:0}catch(e){w=null!==(_=null==E?void 0:E.status)&&void 0!==_?_:0,C=(0,s.createError)(o.ErrorCode.NetworkError,"Internal Error",{status:w})}if(this.isDisposed)return;w>499?C=(0,s.createError)(o.ErrorCode.NetworkError,"Internal Error",{status:w}):404===w?C=(0,s.createError)(o.ErrorCode.NetworkError,"Not Found",{status:w}):403===w?C=(0,s.createError)(o.ErrorCode.NetworkError,"Forbidden",{status:w}):401===w&&(C=(0,s.createError)(o.ErrorCode.NetworkError,"Unauthorized",{status:w}));let k=null;C||null==(null==E?void 0:E.body)||(k=this.validateResponse(null==E?void 0:E.body)?null==E?void 0:E.body:null),C||null!=k||(C=(0,s.createError)(o.ErrorCode.NetworkError,"Unexpected Response",{status:w})),null!=C&&(404===w?this.ctx.logger.debug("manifest not found"):this.emitError(C)),this.ctx.logger.debug("manifest received",{body:k,code:w,uri:this.uri});let R=null;if(404===w||null==k||null==k.formats)R="offline";else if(200===w&&null!=k.self){let{self:e}=k;if(!e.includes("://")&&this.uri.includes("://")){const t=/(\w*:\/\/[^/]+)/.exec(this.uri);(null!==(S=null==t?void 0:t.length)&&void 0!==S?S:0)>1&&(e=`${null==t?void 0:t[1]}/${e}`)}this.uri=e}if(null==R&&null!=(null==k?void 0:k.formats)&&(this.formats=m.modifyFormats(k.formats),R=0===Object.keys(this.formats).length?"offline":"online"),"online"===R&&null!=(null==k?void 0:k.viewCount)&&(this.viewCount=k.viewCount),null==R){const e=w>=400?"Network error while retrieving manifest":"Invalid manifest";this.throwError((0,s.createError)(o.ErrorCode.ManifestError,e,{url:this.uri},C))}R!==this.currentState&&this.emit(R),this.currentState=R,this.pingUri=null!=(null==k?void 0:k.ping)?k.ping:null,this.type=null!=(null==k?void 0:k.type)?k.type:"live",this.emit("manifest",{state:this.currentState,code:w,formats:this.formats,viewCount:this.viewCount}),null!=k&&(this.source=k),"recorded"!==(null==k?void 0:k.type)&&this.setNextPoll(w)}setNextPoll(e){var t;if(this.vod)return;a.device.clearTimeout(null!==(t=this.pollingTimeout)&&void 0!==t?t:0);let r=this.options.pollingInterval;switch(e){case 401:case 403:if(this.noLongerUnauthorizedPolling)return this.currentState="forbidden",void this.emit("manifest",{state:this.currentState,code:e,formats:this.formats});r=this.options.unauthorizedPollingInterval,null==this.unauthorizedRecoveryTimout&&(this.unauthorizedRecoveryTimout=a.device.setTimeout((()=>{this.noLongerUnauthorizedPolling=!0}),this.options.unauthorizedRecoveryDuration));break;case 404:r=this.options.notFoundPollingInterval;break;default:this.noLongerUnauthorizedPolling=!1}this.pollingTimeout=a.device.setTimeout((()=>{this.load().catch((e=>this.emit("error",e)))}),r)}setManifest(e){var t,r,n,i;if(this.type=null,this.formats={},"string"==typeof e?this.uri=e:this.validateResponse(e)&&(this.uri=null!==(t=e.self)&&void 0!==t?t:null,this.manifest=e,this.currentState="online",this.type=null!==(r=this.manifest.type)&&void 0!==r?r:null,this.formats=null!==(n=this.manifest.formats)&&void 0!==n?n:{}),null==this.uri)return;const o=this.uri.indexOf("accessToken=");if(o>-1){const e=this.uri.slice(o+12),t=null!==(i=e.indexOf("&"))&&void 0!==i?i:-1;this.originalAuthToken=t>-1?e.slice(0,t):e}}get hasPlayableMedia(){return null!=this.uri||null!=this.manifest}validateResponse(e){var t,r,n;try{const i=null===(t=e.formats)||void 0===t?void 0:t.webrtc;null!=i&&("string"==typeof(null===(r=i.origin)||void 0===r?void 0:r.location)&&(i.origin.location=null===(n=i.origin)||void 0===n?void 0:n.location.replace(/https?:\/\/(https?):?\/\//,"$1://")),"string"==typeof i.origin.rsrc&&(i.origin.rsrc=i.origin.rsrc.replace(/:3000:3000/,":3000")))}catch(e){return this.emitError((0,s.createError)(o.ErrorCode.BadManifest,"bad manifest",{},e)),!1}return!0}setUri(e){return null==e?null!=this.uri:"string"==typeof e?(this.uri=e,!0):this.validateResponse(e)?(this.manifest=e,null!=e.self&&(this.uri=e.self),!0):(this.emitError((0,s.createError)(o.ErrorCode.BadManifest,"Invalid Media URL",{})),!1)}get(e){var t;const r=this.formats[e];if(null==r)return{encodings:[],state:"online",auto:!1,driver:""};let n,i=[];return"origin"in r&&null!=r.origin&&(n=r.origin,n.origin=!0),"encodings"in r&&null!=r.encodings&&(i=r.encodings.sort(((e,t)=>{var r,n,i,o;return(null!==(r=e.videoKbps)&&void 0!==r?r:0)+(null!==(n=e.audioKbps)&&void 0!==n?n:0)>(null!==(i=t.videoKbps)&&void 0!==i?i:0)+(null!==(o=t.audioKbps)&&void 0!==o?o:0)?1:-1}))),{type:null!==(t=this.type)&&void 0!==t?t:void 0,origin:null!=n?n:void 0,encodings:i,audioCodec:"audioCodec"in r?r.audioCodec:void 0,videoCodec:"videoCodec"in r?r.videoCodec:void 0,manifest:"manifest"in r?r.manifest:void 0,state:"online",auto:!1,driver:""}}get vod(){return"recorded"===this.type}startInterval(){null==this.options.pollingInterval||null!=this.manifest||this.vod?this.shouldBePolling=!1:this.shouldBePolling=!0}toJSON(){return{uri:this.uri,options:JSON.stringify(this.options),aggregates:{support:this.ctx.support.hash,state:this.currentState}}}}m.displayName="MediaLoader",t.default=m},88819:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MediasoupSource=void 0;const n=r(43375),i=r(27813),o=r(80769),a=r(86729),s=r(92491),l=r(45820),c=r(45831),u={replaceTracks:!0};class d extends c.ObservableEventEmitter{constructor(e,t,r,n=u){var l;super(),this.consumers={},this.currentQuality=null,this.availableQualities=[],this.ctx=e,(0,i.makeObservable)(this,{currentQuality:i.observable.ref,availableQualities:i.observable.shallow}),a.device.isImplements(a.Feature.MEDIA_STREAM)||this.throwError((0,s.createError)(o.ErrorCode.MediaStreamNotSupported,"MediaStream is not supported by device",{})),this.options=n,this.peer=t,this.streamName=r,this.stream=new a.device.MediaStream,null===(l=this.peer.call)||void 0===l||l.on("accessDenied",this.handlePeerAccessDenied),this.addInnerDisposer((()=>{var e;null===(e=this.peer.call)||void 0===e||e.removeListener("accessDenied",this.handlePeerAccessDenied)})),e.logger.attachObject(this),e.logger.trace("constructor()")}handlePeerAccessDenied(e){this.emit("accessDenied",e)}get source(){return this.stream}get consumerIds(){return Object.keys(this.consumers)}addConsumer(e,t=!0){if(!e.dontAdd){if("video"===e.track.kind&&this.stream.getVideoTracks().length>0&&this.stream.getVideoTracks().forEach((e=>this.stream.removeTrack(e))),"audio"===e.track.kind&&this.stream.getAudioTracks().length>0&&this.stream.getAudioTracks().forEach((e=>this.stream.removeTrack(e))),"video"===e.track.kind){const t=(0,l.fetchManifestQualities)(e.layers,null);(0,i.runInAction)((()=>{this.availableQualities=t;const r=e.activeLayer;if(null!=r){const t=this.availableQualities.find((e=>{var t;return(null===(t=e.layer)||void 0===t?void 0:t.id)===r.id}));null!=t?this.currentQuality=t:this.ctx.logger.warn("Consumer refers to a layer which doesn't exist",{layers:e.layers,activeLayer:e.activeLayer})}}))}this.stream.addTrack(e.track)}this.consumers[e.id]=e,t&&!e.dontAdd&&this.emit("source",this.stream)}removeConsumer(e,t=!0){const r=this.consumers[e];null!=r&&(this.stream.removeTrack(r.track),delete this.consumers[e],this.stream.getTracks().length>0&&t&&this.emit("source",this.stream))}swapConsumers(e,t){t.forEach((e=>{this.stream.removeTrack(e)})),e.forEach((e=>{this.stream.addTrack(e)})),this.emit("source",this.stream)}pauseConsumer(e){const t=this.consumers[e];null!=t&&(t.paused=!0,this.stream.getTracks().some((e=>e.id===t.track.id))&&("video"===t.kind?this.emit("videoPaused",t.paused):this.emit("audioMuted",t.paused)))}resumeConsumer(e){const t=this.consumers[e];null!=t&&(t.paused=!1,this.stream.getTracks().some((e=>e.id===t.track.id))&&("video"===t.kind?this.emit("videoPaused",t.paused):this.emit("audioMuted",t.paused)))}consumerLayersChanged(e){const t=this.availableQualities.find((t=>{var r;return(null===(r=t.layer)||void 0===r?void 0:r.id)===e.id}));null!=t&&(this.currentQuality=t)}consumerSourcesChanged(e){const t=(0,l.fetchManifestQualities)(e,null);this.availableQualities=t}getTracks(){return this.stream.getTracks()}get hasAudio(){return Object.values(this.consumers).some((e=>"audio"===e.kind&&!1===e.dontAdd))}get hasVideo(){return Object.values(this.consumers).some((e=>"video"===e.kind&&!1===e.dontAdd))}get audioMuted(){const e=Object.values(this.consumers).filter((e=>"audio"===e.kind&&!1===e.dontAdd));return 0===e.length||e.some((e=>e.paused))}get videoPaused(){const e=Object.values(this.consumers).filter((e=>"video"===e.kind&&!1===e.dontAdd));return 0===e.length||e.some((e=>e.paused))}toJSON(){return{hasAudio:this.hasAudio,hasVideo:this.hasVideo,audioMuted:this.audioMuted,videoPaused:this.videoPaused,options:this.options,aggregates:{...(0,n.extractAggregates)(this.peer,"support"),support:this.ctx.support.hash,streamName:this.streamName}}}}t.MediasoupSource=d,d.displayName="MediasoupSource"},58636:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Peer=void 0;const n=r(43375),i=r(27813),o=r(36147),a=r(92491),s=r(88819),l=r(46693),c=r(93503),u=r(45831),d=r(80366);class h extends u.ObservableEventEmitter{constructor(e,t,r,n,o){super(),this.remoteSources=new Map,(0,i.makeObservable)(this,{remoteSources:i.observable,streams:i.computed,players:i.computed}),this.ctx=e,this.call=t,this.pvcCall=r,this.playerOptions=null!=o?o:{},this.pvcCall.on("CALL_ADD_CONSUMER",this.addConsumer),this.pvcCall.on("CALL_REMOVE_CONSUMER",this.removeConsumer),this.pvcCall.on("CALL_SWAP_CONSUMERS",this.swapConsumers),this.pvcCall.on("CALL_SET_CONSUMER_PAUSED",this.pauseConsumer),this.pvcCall.on("CALL_SET_CONSUMER_RESUMED",this.resumeConsumer),this.pvcCall.on("CALL_CONSUMER_LAYER_CHANGED",this.layerChanged),this.pvcCall.on("CALL_CONSUMER_SOURCES",this.sourcesChanged),(0,c.onceCanceled)(e).then((e=>this.dispose(`Peer Context Cancelled: ${e}`))),this.peerParams=n,e.logger.attachObject(this),e.logger.trace("constructor()"),this.addInnerDisposer(this.close)}get streams(){return Array.from(this.remoteSources.values()).map((e=>e.provider))}get players(){return Array.from(this.remoteSources.values()).map((e=>e.player))}get peerId(){var e;return null!==(e=this.peerParams.peerId)&&void 0!==e?e:""}get userId(){var e;return null!==(e=this.peerParams.userId)&&void 0!==e?e:""}get appData(){var e;return null!==(e=this.peerParams.appData)&&void 0!==e?e:{}}close(){this.pvcCall.off("CALL_ADD_CONSUMER",this.addConsumer),this.pvcCall.off("CALL_REMOVE_CONSUMER",this.removeConsumer),this.pvcCall.off("CALL_SET_CONSUMER_PAUSED",this.pauseConsumer),this.pvcCall.off("CALL_SET_CONSUMER_RESUMED",this.resumeConsumer),this.pvcCall.off("CALL_CONSUMER_LAYER_CHANGED",this.layerChanged);for(const[e,t]of this.remoteSources.entries())t.provider.consumerIds.forEach((t=>{this.removeConsumer({peerId:this.peerId,streamName:e,consumerId:t})}))}setPreferredEncoding(e){var t;const r=null===(t=e.appData)||void 0===t?void 0:t.consumerId;null!=r&&"string"==typeof r||this.throwError((0,a.createError)(a.ErrorCode.UnableChangeBitrate,"unable to set preferred encoding because consumerId is not provided",{layerId:e.id,peerId:this.peerId})),this.ctx.logger.info("setPreferredEncoding",{layer:e}),this.pvcCall.setPreferredEncoding(r,e.id)}toJSON(){return{call:this.call,aggregates:{...(0,n.extractAggregates)(this.call,"support"),support:this.ctx.support.hash,peerId:this.peerId}}}addConsumer({peerId:e,streamName:t,consumer:r}){var n,i,c;if(e===this.peerParams.peerId){this.ctx.logger.debug("addConsumer()",{streamName:t,consumerId:r.id});try{const e=this.remoteSources.get(t);if(null==e){const e=new s.MediasoupSource((0,d.extendContext)(this.ctx,s.MediasoupSource),this,t);if(this.playerOptions.dontEmitPlayer)this.emit("videoConsumer"),e.addConsumer(r),this.remoteSources.set(t,{player:null,provider:e});else{const o={autoPlay:null===(c=null===(i=null===(n=null==this?void 0:this.ctx)||void 0===n?void 0:n.videoClient)||void 0===i?void 0:i.options)||void 0===c?void 0:c.autoPlay,...this.playerOptions},a=new l.MediasoupPlayer((0,d.extendContext)(this.ctx,l.MediasoupPlayer),e,o);this.emit("videoConsumer"),e.addConsumer(r),this.remoteSources.set(t,{player:a,provider:e}),this.emit("playerAdded",{player:a,streamName:t,peer:this})}this.emit("streamAdded",{stream:e,streamName:t,peer:this})}else e.provider.addConsumer(r)}catch(t){let n="Consumer has not created";(0,o.isVideoClientError)(t)&&t.code===a.ErrorCode.MediaStreamNotSupported&&(n="Consumer has not created because MediaStream is not supported"),this.emitError((0,a.createError)(a.ErrorCode.ConsumerNotCreated,n,{consumerId:r.id,peerId:e},t))}}}removeConsumer({peerId:e,streamName:t,consumerId:r}){if(e!==this.peerParams.peerId)return;this.ctx.logger.trace("removeConsumer()",{peerId:e,streamName:t,consumerId:r});const n=this.remoteSources.get(t);null!=n&&(n.provider.removeConsumer(r),0===n.provider.getTracks().length&&(this.playerOptions.dontEmitPlayer||this.emit("playerRemoved",{player:n.player,streamName:t,peer:this}),this.emit("streamRemoved",{stream:n.provider,streamName:t,peer:this}),this.remoteSources.delete(t)))}swapConsumers({peerId:e,streamName:t,add:r,remove:n}){if(e!==this.peerParams.peerId)return;this.ctx.logger.trace("swapConsumer()",{peerId:e,streamName:t,add:r.map((e=>e.id)),remove:n.map((e=>e.id))});const i=this.remoteSources.get(t);null!=i?i.provider.swapConsumers(r,n):this.ctx.logger.warn("Unable to swap consumer stream not found",{peerId:e,streamName:t})}pauseConsumer({peerId:e,streamName:t,consumerId:r}){if(e!==this.peerParams.peerId)return;this.ctx.logger.debug("CALL_SET_CONSUMER_PAUSED",{streamName:t,consumerId:r});const n=this.remoteSources.get(t);null!=n?n.provider.pauseConsumer(r):this.ctx.logger.warn("Unable to pause consumer stream not found",{peerId:e,streamName:t,consumerId:r})}resumeConsumer({peerId:e,streamName:t,consumerId:r}){if(e!==this.peerParams.peerId)return;this.ctx.logger.debug("CALL_SET_CONSUMER_RESUMED",{streamName:t,consumerId:r});const n=this.remoteSources.get(t);null!=n?n.provider.resumeConsumer(r):this.ctx.logger.warn("Unable to resumeConsumer stream not found",{peerId:e,streamName:t,consumerId:r})}layerChanged(e){if(e.peerId!==this.peerParams.peerId)return;this.ctx.logger.debug("CALL_CONSUMER_LAYER_CHANGED",{ev:e});const t=this.remoteSources.get(e.streamName);null!=t?t.provider.consumerLayersChanged(e):this.ctx.logger.warn("Unable to change layer stream not found",{streamName:e.streamName,ev:e})}sourcesChanged(e){if(e.peerId!==this.peerParams.peerId)return;this.ctx.logger.debug("CALL_CONSUMER_SOURCES",{ev:e});const t=this.remoteSources.get(e.streamName);null!=t?t.provider.consumerSourcesChanged(e.layers):this.ctx.logger.warn("Unable to change source stream not found",{remoteSources:Object.fromEntries(this.remoteSources.entries()),streamName:e.streamName,ev:e})}}t.Peer=h,h.displayName="Peer"},69591:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CorePlayer=t.proxyHandler=t.timeupdateWrapper=void 0;const n=r(31635),i=r(82837),o=r(27813),a=r(80769),s=r(86729),l=r(51327),c=r(37699),u=r(80165),d=r(26156),h=r(92491),p=r(98645),f=r(88819),m=r(93503),g=r(39946),v=r(45831),y=r(93937),b=r(60280),_=r(45820),S=r(73146),w=n.__importDefault(r(18741)),E=r(45799),C=[0,1e3,2e3,5e3,25e3],O={bufferOverflowCount:0,bufferUnderflowCount:0,currentErrorCount:0,downshift:0,fragCounts:0,fragDownloadTime:0,fragDuration:0,fragMaxTime:0,fragMinTime:0,fragFetchTime:0,fragSize:0,lastProgress:0,recentErrorCount:0,restartCount:0,upshift:0};t.timeupdateWrapper=new b.TimeupdateWrapper,t.proxyHandler=new y.SyncHandler({logger:new i.LoggerCore("VDC-core"),methods:{isSupported:"postpone",initVideoEl:"postpone",getClosestQuality:"stub"}});const P={bitrate:null,muted:!1,volume:.75,autoPlay:!0,origin:!1,preset:null,recoverErrorCount:0,timeout:3e4,driverFailover:!0};class T extends v.ObservableEventEmitter{get logger(){return this.ctx.logger}get poster(){return this._poster}set poster(e){null!=e&&null!=this.elementSupervisor&&this.elementSupervisor.setPoster(e),this._poster=e}get activeLayer(){var e,t;return null!==(t=null===(e=this.currentQuality)||void 0===e?void 0:e.layer)&&void 0!==t?t:null}get layers(){return(0,_.getBitrateLayersFromQualities)(this.availableQualities)}constructor(e,t,r){var n,i;if(super(),this.counters=O,this.lockRestart=!1,this.clearRestartCount=0,this.playingPromise=null,this.elementSupervisor=null,this.consumerAudioMuted=void 0,this.consumerVideoPaused=void 0,this.lowPowerMode=!1,this.internalPaused=!1,this.qualityEqual=!1,this.internalMuted=!1,this.internalVolume=1,this.startedPlaying=!1,this.pausedOnUnmount=!1,this.mutedOnHidden=!1,this.autoPlay=!0,this.driverFailover=!0,this.forcedMute=!1,this.source=null,this.errors={},this.availableQualities=[],this.currentQuality=null,this.isConnecting=null,this.isConnected=null,this.blurred=!1,this.qualityHasChanged=!1,this.successfulPlayTimeStamp=null,this._poster=null,this.preferredLevel=c.AutoQualityLevel.Auto,(0,o.makeObservable)(this,{consumerAudioMuted:o.observable,consumerVideoPaused:o.observable,internalPaused:o.observable,internalMuted:o.observable,internalVolume:o.observable,forcedMute:o.observable,source:o.observable.ref,availableQualities:o.observable.shallow,currentQuality:o.observable.shallow,_poster:o.observable,driverFailover:o.observable,blurred:o.observable,preferredLevel:o.observable,lowPowerMode:o.observable,attached:o.computed,localVideoPaused:o.computed,localAudioMuted:o.computed,localAudioVolume:o.computed,poster:o.computed,attachTo:o.action}),this.ctx=e,this.options=null!=r?r:P,null!=this.options.autoPlay&&(this.autoPlay=this.options.autoPlay),this.provider=t,this.internalPaused=!this.autoPlay,null!=(null===(n=this.options)||void 0===n?void 0:n.muted)&&(this.internalMuted=this.options.muted),null!=(null===(i=this.options)||void 0===i?void 0:i.volume)&&(this.localAudioVolume=this.options.volume),null!=this.ctx.token){const e="string"==typeof this.ctx.token?{token:this.ctx.token}:{refreshToken:this.ctx.token};this.auth=new w.default({bootstrap:e})}if(this.addInnerDisposer((0,o.reaction)((()=>[this.availableQualities,this.preferredLevel]),(([t,r])=>{var n,i,o;if(null!=r||1!==(null==t?void 0:t.length)&&"flv-http"!==this.format){if(null==r&&1!==(null==t?void 0:t.length))return void(this.currentQuality=null)}else r=c.TranscodeScoreLevel.Highest;if(null!=r&&null!=t){const a=(0,_.findClosestQuality)(r,t);a!==this.currentQuality&&(this.qualityHasChanged=!0,e.logger.debug("quality change",{format:this.format,oldQuality:null!==(i=null===(n=this.currentQuality)||void 0===n?void 0:n.level)&&void 0!==i?i:null,newQuality:null!==(o=null==a?void 0:a.level)&&void 0!==o?o:null,preferredQuality:r})),this.currentQuality=a,this.qualityHasChanged&&this.updatePosterWithLatestFrame(),null!=this.currentQuality&&null!=this.provider.source&&this.handleSource(this.provider.source)}}),{equals:o.comparer.structural})),e.logger.attachObject(this),e.logger.trace("constructor()",{options:this.options}),(0,m.onceCanceled)(e).then((e=>this.dispose(`Core Player Context Cancelled: ${e}`))),this._handleVisibilityChange=()=>{(s.device.isIosDevice||s.device.isAndroidDevice)&&(s.device.hidden?(this.mutedOnHidden=this.internalMuted,this.localAudioMuted=!0):this.localAudioMuted=this.mutedOnHidden)},s.device.addEventListener("visibilitychange",this._handleVisibilityChange),this.provider.on("source",this.handleSource),this.provider.on("source",this.isSource),this.provider.on("audioMuted",this.handleAudioMuted),this.provider.on("videoPaused",this.handleVideoPaused),this.provider instanceof f.MediasoupSource&&this.provider.on("accessDenied",this.handleProviderAccessDenied),this.addInnerDisposer((()=>{this.provider.off("source",this.handleSource),this.provider.off("source",this.isSource),this.provider.off("audioMuted",this.handleAudioMuted),this.provider.off("videoPaused",this.handleVideoPaused),s.device.removeEventListener("visibilitychange",this._handleVisibilityChange),null!=this.auth&&this.auth.destroy(),this.provider instanceof f.MediasoupSource&&this.provider.off("accessDenied",this.handleProviderAccessDenied)})),null!=this.provider.source){const e=this.provider.source;setTimeout((()=>{this.handleSource(e)}),0)}}updatePosterWithLatestFrame(){null!=this.elementSupervisor&&s.device.isImplements(l.Feature.CREATE_SCREENSHOT)?this.poster=this.elementSupervisor.createScreenshot():this.ctx.logger.warn("Unable to set update poster. Create screenshot is not compatible with device.")}async ready(){if(null==this.source)return this.ctx.logger.debug("no source, not ready"),new Promise(((e,t)=>{let r;const n=(0,o.autorun)((t=>{null!=this.source&&(t.dispose(),s.device.clearTimeout(r),e())}));null!=this.options.timeout&&(r=s.device.setTimeout((()=>{n();const e=new p.PlayingIssueError(`timeout after ${this.options.timeout}ms`,{player:this});this.emitErrorDeprecated(e),this.options.driverFailover&&this.emit("driverFailover",!0),t(e)}),this.options.timeout))}))}handleAudioMuted(e){this.consumerAudioMuted=e}handleVideoPaused(e){this.consumerVideoPaused=e}handleProviderAccessDenied(e){this.emit("playerAccessDenied",e)}isSource(){this.provider instanceof f.MediasoupSource&&(this.consumerVideoPaused=!this.provider.hasVideo||this.provider.videoPaused)}get attached(){return null!=this.elementSupervisor}get localVideoPaused(){return this.internalPaused}set localVideoPaused(e){this.internalPaused=e,null!=this.elementSupervisor&&(this.internalPaused?this.pauseEl():(async()=>{try{await this.play()}catch(e){this.emitErrorDeprecated(new p.PlayingIssueError("VideoElement.play() error",{inner:e instanceof Error?e:null,player:this}))}})())}pauseEl(){var e;null===(e=this.elementSupervisor)||void 0===e||e.pause()}get localAudioMuted(){return this.internalMuted}set localAudioMuted(e){this.internalMuted=e,null!=this.elementSupervisor&&(this.elementSupervisor.muted=e)}get localAudioVolume(){return this.internalVolume}set localAudioVolume(e){e>1||e<0?this.ctx.logger.warn(`Volume level not set. ${e} is not a valid volume value for an HTMLMediaElement. Volume levels must be between 0-1.`):(this.internalVolume=e,null!=this.elementSupervisor&&(this.elementSupervisor.volume=e))}handleElPlay(){this.suspended||(this.internalPaused?(this.ctx.logger.warn("A try to call .play() on HTMLVideoElement outside the Player"),s.device.isSafari?this.localVideoPaused=!0:this.internalPaused=!1):this.ctx.logger.info(".play() called on HTMLVideoElement"))}handleElPause(){if(!this.suspended&&!this.internalPaused&&null!=this.elementSupervisor){if(!this.elementSupervisor.paused)return;this.play().catch((e=>{s.device.setTimeout(this.handleElPause,50),this.ctx.logger.error("An error occured on the play() request",{err:(0,p.wrapNativeError)(e)})}))}}handleElError(){var e,t;if(null==this.elementSupervisor||this.suspended)return;const r=d.MediaErrorCodeConstants[null!==(t=null===(e=this.elementSupervisor.error)||void 0===e?void 0:e.code)&&void 0!==t?t:0];this.ctx.logger.warn(`VideoElement Error: ${r}`)}handleElVolumeChange(){null==this.elementSupervisor||this.suspended||(Math.abs(this.internalVolume-this.elementSupervisor.volume)>.01&&(this.ctx.logger.warn("A try to change volume on HTMLVideoElement outside the Player"),this.elementSupervisor.volume=this.internalVolume),this.elementSupervisor.muted!==this.internalMuted&&(this.elementSupervisor.muted=this.internalMuted))}async attachTo(e){this.ctx.logger.trace("attachTo()",{el:(0,g.dumpVideoElement)(e)}),this.elementSupervisor=S.MediaElementSupervisor.getSupervisor(e).attachToPlayer(this),this.pausedOnUnmount=this.internalPaused,this.ctx.logger.debug("attach to host element",{element:(0,g.dumpVideoElement)(e),options:this.options}),this.initVideoEl(this.elementSupervisor).catch((e=>this.ctx.logger.error(`Unable to initialize VideoElement: ${e}`))),null!=this.source&&(this.emit("hostElementAttached",{el:e}),this.ctx.logger.debug("hostElementAttached",{el:(0,g.dumpVideoElement)(e)}))}async initVideoEl(e,t=!1){e.muted=this.internalMuted,e.volume=this.internalVolume,t&&(this.pausedOnUnmount=this.internalPaused),this.pausedOnUnmount||"flv-http"===this.format?e.autoplay=!1:e.autoplay=!0,this.startedPlaying=!1,null!=this._poster&&e.setPoster(this._poster),this.ctx.logger.debug("host element is initialized",{autoPlay:this.options.autoPlay,internalPaused:this.internalPaused,internalMuted:this.internalMuted}),null==this.source&&"mp4-ws"!==this.format||("string"==typeof this.source?e.updateSrc(this.source):"mp4-ws"===this.format&&""===e.element.src||e.updateSrcObject(this.source)),this.pausedOnUnmount||(this.ctx.logger.info("core: initVideoEl() -> await play()"),await this.play())}handleElProgress(){s.device.isImplements(l.Feature.DEBUGGING)?this.counters.lastProgress=s.device.performance.now():this.counters.lastProgress=Date.now(),this.emit("progress")}handleElTimeupdate(){null!=this.elementSupervisor&&this.elementSupervisor.isVideoPlaying()&&!this.startedPlaying&&(this.startedPlaying=!0,this.successfulPlayTimeStamp=Date.now(),this.emit("videoFirstPlay")),null!=this.successfulPlayTimeStamp&&15===Math.floor((Date.now()-this.successfulPlayTimeStamp)/1e3)&&(this.ctx.logger.debug("Successful playback."),this.successfulPlayTimeStamp=null),this.counters.fragCounts+=1,this.emit("timeupdate")}resetCounts(){this.counters=O}*bufferTimes(){var e,t,r;const n=null!==(r=null===(t=null===(e=this.elementSupervisor)||void 0===e?void 0:e.buffered)||void 0===t?void 0:t.length)&&void 0!==r?r:0;for(let e=0;null!=this.elementSupervisor&&e{this.stop();try{this.play(e).then((()=>{this.lockRestart=!1,t()}))}catch(e){this.ctx.logger.error("An error occured on the play() request",{err:(0,p.wrapNativeError)(e)})}})):(s.device.clearTimeout(null!==(t=this.clearRestartCount)&&void 0!==t?t:0),this.clearRestartCount=s.device.setTimeout((()=>{this.counters.restartCount=0}),2*C[C.length-1]),this.emit("restartDriver",{timeout:C[Math.min(this.counters.restartCount,C.length-1)]}),this.restartTimeout())}async restartTimeout(){return new Promise((e=>{s.device.setTimeout((()=>{if(!this.isDisposed){this.stop();try{this.play().then((()=>{this.lockRestart=!1,e()}))}catch(e){this.ctx.logger.error("An error occured on the play() request",{err:(0,p.wrapNativeError)(e)})}}}),C[Math.min(this.counters.restartCount,C.length-1)])}))}stop(){null!=this.elementSupervisor&&(this.elementSupervisor.updateSrc(""),this.elementSupervisor.updateSrcObject(null))}async play(e=!1){var t;return this.ctx.logger.info("play()",{videoEl:null===(t=this.elementSupervisor)||void 0===t?void 0:t.dumpVideoElement(),aggregates:{debug:"play"}}),await this.ready(),this.ctx.logger.info("ready to play",{aggregates:{debug:"play"}}),null==this.elementSupervisor?(this.ctx.logger.warn("a try to play without host element attached",{aggregates:{debug:"play"}}),!1):this.elementSupervisor.isSourceSet()?(null==this.playingPromise&&(this.ctx.logger.setMessageAggregate("debug","play"),this.ctx.logger.setMessageAggregate("playImmediately",e),this.ctx.logger.setMessageAggregate("hasPlayingPromise",null!=this.playingPromise),this.playingPromise=this.playInternal(this.elementSupervisor,e).then((()=>{var e;return this.ctx.logger.trace("playingPromise.then()"),!(null===(e=this.elementSupervisor)||void 0===e?void 0:e.paused)})).catch((e=>(this.ctx.logger.trace("playingPromise.catch()",{err:(0,p.wrapNativeError)(e)}),e))).finally((()=>{this.ctx.logger.trace("playingPromise.finally()"),this.playingPromise=null,this.ctx.logger.removeMessageAggregate("debug"),this.ctx.logger.removeMessageAggregate("playImmediately"),this.ctx.logger.removeMessageAggregate("hasPlayingPromise")}))),this.playingPromise):(this.ctx.logger.debug("nothing to play",{aggregates:{debug:"play"}}),!1)}async playInternal(e,t=!1){var r;if(this.ctx.logger.trace("playInternal()"),(0,d.isMediaStream)(e.srcObject)&&(null===(r=e.srcObject)||void 0===r?void 0:r.getTracks().length)<=0)return;s.device.isSafari&&"mp4-hls"===this.format&&(this.ctx.logger.info("playInternal safari hls bypassing loadeddata check"),t=!0);const n=t?e.play.bind(e):_.playOncePossible.bind(null,e,this.ctx.logger);try{this.ctx.logger.trace("playInternal() trying playDelegate (first time)"),await n()}catch(e){if(!(e instanceof Error))throw this.ctx.logger.info("playDelegate unknown error type",{errType:typeof e,player:this}),e;{const r={inner:(0,p.wrapNativeError)(e),playImmediately:t,player:this};if("AbortError"!==e.name&&"NotAllowedError"!==e.name||this.localAudioMuted||!this.isImplements(u.Feature.MUTED_AUTOPLAY)){this.ctx.logger.info("bypassed forcedMute autoplay",{errName:e.name,localAudioMuted:this.localAudioMuted,implementsMutedAutoplay:this.isImplements(u.Feature.MUTED_AUTOPLAY)});try{await new Promise((e=>{s.device.setTimeout(e,500)})),await n(),this.ctx.logger.info("playDelegate playing (one more time just in case)",r)}catch(t){t instanceof Error&&(0,_.isInLowPowerMode)(t)?(this.lowPowerMode=!0,this.ctx.logger.info("iOS Device in low power mode, cannot autoplay",{err:(0,p.wrapNativeError)(e),lowPowerMode:this.lowPowerMode})):this.throwErrorDeprecated(new p.PlayingIssueError("playDelegate error after second try",r))}}else{this.ctx.logger.info("attempting forcedMute play",r),this.localAudioMuted=!0,this.forcedMute=!0;try{await n(),this.ctx.logger.info("playDelegate playing muted due to low page engagement",r)}catch(t){t instanceof Error&&(0,_.isInLowPowerMode)(t)?(this.lowPowerMode=!0,this.ctx.logger.info("iOS Device in low power mode, cannot autoplay",{err:(0,p.wrapNativeError)(e),lowPowerMode:this.lowPowerMode})):this.throwErrorDeprecated(new p.PlayingIssueError("playDelegate error after mute play",r))}}}}finally{this.ctx.logger.trace("playInternal() finally"),this.internalPaused=e.paused}}async getAuthHeader(){if(null!=this.auth)try{return{Authorization:`bearer ${await(0,E.getAuthToken)({ctx:this.ctx,auth:this.auth,reauth:!1})}`}}catch(e){const t=e instanceof Error?e.message:"unknown error";throw this.ctx.logger.warn("Authorization error",{err:t}),e}return null}async checkRestart(e){const t=e;if(this.counters.recentErrorCount+=1,s.device.setTimeout((()=>{this.counters.recentErrorCount-=1,this.counters.recentErrorCount=Math.max(this.counters.recentErrorCount,0)}),1e4),this.counters.recentErrorCount>=10&&(t.fatal=!0),this.counters.currentErrorCount>=10&&(t.fatal=!0),t.fatal)return this.restart(!1)}setPreferredLevel(e){this.preferredLevel=e}getClosestQuality(e){return(0,_.findClosestQuality)(e,this.availableQualities)}isImplements(e){return this.implementedFeatures.includes(e)}replaceManifestUrl(e){throw(0,h.createError)(a.ErrorCode.NotSupported)}dispose(e){this.updatePosterWithLatestFrame(),super.dispose(e)}toJSON(){var e;return{availableQualities:(0,o.toJS)(this.availableQualities),currentQuality:(0,o.toJS)(this.currentQuality),attached:this.attached,counters:this.counters,aggregates:{support:this.ctx.support.hash,autoPlay:this.autoPlay,localAudioMuted:this.localAudioMuted,localVideoPaused:this.localVideoPaused,playingPromise:null==this.playingPromise,format:this.format,...null===(e=this.elementSupervisor)||void 0===e?void 0:e.dumpVideoElement()}}}}t.CorePlayer=T},65519:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FlvHttpPlayer=void 0;const n=r(27813),i=r(86729),o=r(80165),a=r(98645),s=r(69591),l=r(45829),c=r(92491);class u extends s.CorePlayer{static async isSupported(e){return(0,l.supportsFlvHttp)(e)}async isSupported(){return u.isSupported()}static get format(){return"flv-http"}get format(){return u.format}constructor(e,t,r){super(e,t,r),this.player=null,this.isFirstLoad=!0,this.isStartingToPlay=!1,this.isPauseQueued=!1,this.addInnerDisposer((0,n.reaction)((()=>{var e;return[null===(e=this.currentQuality)||void 0===e?void 0:e.layer,this.internalPaused]}),(([e,t])=>{null==e||"string"!=typeof e.id||""===e.id||t||this.isStartingToPlay||this.requestUrl(e.id)}))),this.on("hostElementAttached",this.handleElAttached),this.addInnerDisposer((()=>{this.destroyPlayer()}))}async ready(){i.device.isImplements(i.Feature.MPEGTS)&&await i.device.loadMpegtsScript(),await super.ready()}pauseEl(){var e;this.isStartingToPlay?this.isPauseQueued=!0:(super.pauseEl(),null===(e=this.player)||void 0===e||e.pause())}handleSource(e){this.suspended||null==(null==e?void 0:e.formats["flv-http"])&&this.emitErrorDeprecated(new a.DriverNotSupportedError("manifest doesn't contains 'flv-http' format",{manifest:e}))}async requestUrl(e){i.device.isImplements(i.Feature.MPEGTS)||this.throwErrorDeprecated(new a.PlayingIssueError("mpegts library is not loaded",{player:this})),this.destroyPlayer();const t={...await this.getAuthHeader(),...this.options.requestHeaders};this.player=i.device.mpegts.createPlayer({type:"flv",isLive:!0,url:e},{headers:t}),this.player.on(i.device.mpegts.Events.ERROR,this.handleMpegtsError),null!=this.elementSupervisor&&this.handleElAttached({el:Reflect.get(this.elementSupervisor,"element")})}handleElAttached(e){if(null!=this.player){if(this.player.attachMediaElement(e.el),this.player.load(),this.ctx.logger.debug("host element is attached and loaded"),this.isFirstLoad&&!this.options.autoPlay)return void(this.isFirstLoad=!1);try{this.internalPaused?(this.ctx.logger.debug("pause"),this.player.pause()):(this.ctx.logger.debug("play"),this.isPauseQueued=!1,this.isStartingToPlay=!0,(this.player.play()||Promise.resolve()).then((()=>{this.handleStartedToPlay()})))}catch(e){const t=e instanceof Error?e:null;this.emitErrorDeprecated(new a.PlayingIssueError("mpegts call failed in handleElAttached()",{inner:t,player:this}))}}}handleStartedToPlay(){this.isStartingToPlay=!1,this.isPauseQueued&&this.pauseEl()}destroyPlayer(){null!=this.player&&i.device.isImplements(i.Feature.MPEGTS)&&(this.player.pause(),this.player.unload(),this.player.detachMediaElement(),this.player.off(i.device.mpegts.Events.ERROR,this.handleMpegtsError),this.player.destroy(),this.player=null)}handleMpegtsError(e){"NetworkError"===e?this.ctx.logger.error(`FLVHTTP ${e}`):this.throwError((0,c.createError)(c.ErrorCode.PlaybackError,"Unable to play the stream due to an uncaught error",{}))}get implementedFeatures(){return[o.Feature.BITRATE_SWITCHING,o.Feature.MUTED_AUTOPLAY]}}t.FlvHttpPlayer=u,u.displayName="FlvHttpPlayer"},45820:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.lowPowerModeMsg=t.ERRORS=void 0,t.playOncePossible=function(e,t){return t.debug("playOncePossible()",{aggregates:e.dumpVideoElement()}),e.paused||e.ended?e.readyState>2?e.play():new Promise(((r,i)=>{t.debug("playOncePossible() returned Promise",{aggregates:e.dumpVideoElement()});const o=()=>{e.readyState>2&&(e.removeListener("loadeddata",o),e.play().catch(i).then((()=>{if(!e.paused)return void r();let t=20;const o=n.device.setInterval((()=>{e.paused||(n.device.clearInterval(o),r()),0==--t&&(n.device.clearInterval(o),i(new Error("Video element remains paused for 1s after play() call")))}),50)})))};e.addListener("loadeddata",o)})):Promise.resolve()},t.isBitrateLayer=s,t.getBitrateLayersFromQualities=function(e){return e.map((e=>e.layer)).filter((function(e){return null!=e&&void 0!==e}))},t.sortEncodings=l,t.encodingToLayer=c,t.fetchManifestQualities=function(e,t,r){let n;n=Array.isArray(e)?e:null!=e.substitute?[e.substitute]:e.encodings;const s=l(null!=n?n:[]),u=[];if(null!=t)u.push({level:i.SourceScoreLevel.High,layer:{bitrate:0,isSource:!0,id:t}});else{const e=s.map((e=>c(e))).filter((e=>e.isSource));e.sort(((e,t)=>e.bitrate>t.bitrate?1:-1));for(let t=0;tc(e))).filter((e=>!e.isSource));switch(d.length){case 0:break;case 1:u.push({level:i.TranscodeScoreLevel.Medium,layer:c(d[0]),encoding:d[0].encoding});break;case 2:u.push({level:i.TranscodeScoreLevel.Low,layer:c(d[1]),encoding:d[1].encoding}),u.push({level:i.TranscodeScoreLevel.High,layer:c(d[0]),encoding:d[0].encoding});break;case 3:u.push({level:i.TranscodeScoreLevel.Low,layer:c(d[2]),encoding:d[2].encoding}),u.push({level:i.TranscodeScoreLevel.Medium,layer:c(d[1]),encoding:d[1].encoding}),u.push({level:i.TranscodeScoreLevel.High,layer:c(d[0]),encoding:d[0].encoding});break;case 4:u.push({level:i.TranscodeScoreLevel.Low,layer:c(d[3]),encoding:d[3].encoding}),u.push({level:i.TranscodeScoreLevel.MediumLow,layer:c(d[2]),encoding:d[2].encoding}),u.push({level:i.TranscodeScoreLevel.MediumHigh,layer:c(d[1]),encoding:d[1].encoding}),u.push({level:i.TranscodeScoreLevel.High,layer:c(d[0]),encoding:d[0].encoding});break;case 5:u.push({level:i.TranscodeScoreLevel.Low,layer:c(d[4]),encoding:d[4].encoding}),u.push({level:i.TranscodeScoreLevel.MediumLow,layer:c(d[3]),encoding:d[3].encoding}),u.push({level:i.TranscodeScoreLevel.Medium,layer:c(d[2]),encoding:d[2].encoding}),u.push({level:i.TranscodeScoreLevel.MediumHigh,layer:c(d[1]),encoding:d[1].encoding}),u.push({level:i.TranscodeScoreLevel.High,layer:c(d[0]),encoding:d[0].encoding});break;case 6:u.push({level:i.TranscodeScoreLevel.Lowest,layer:c(d[5]),encoding:d[5].encoding}),u.push({level:i.TranscodeScoreLevel.Low,layer:c(d[4]),encoding:d[4].encoding}),u.push({level:i.TranscodeScoreLevel.MediumLow,layer:c(d[3]),encoding:d[3].encoding}),u.push({level:i.TranscodeScoreLevel.MediumHigh,layer:c(d[2]),encoding:d[2].encoding}),u.push({level:i.TranscodeScoreLevel.High,layer:c(d[1]),encoding:d[1].encoding}),u.push({level:i.TranscodeScoreLevel.Highest,layer:c(d[0]),encoding:d[0].encoding});break;default:u.push({level:i.TranscodeScoreLevel.Lowest,layer:c(d[6]),encoding:d[6].encoding}),u.push({level:i.TranscodeScoreLevel.Low,layer:c(d[5]),encoding:d[5].encoding}),u.push({level:i.TranscodeScoreLevel.MediumLow,layer:c(d[4]),encoding:d[4].encoding}),u.push({level:i.TranscodeScoreLevel.Medium,layer:c(d[3]),encoding:d[3].encoding}),u.push({level:i.TranscodeScoreLevel.MediumHigh,layer:c(d[2]),encoding:d[2].encoding}),u.push({level:i.TranscodeScoreLevel.High,layer:c(d[1]),encoding:d[1].encoding}),u.push({level:i.TranscodeScoreLevel.Highest,layer:c(d[0]),encoding:d[0].encoding})}return null!=r&&(r instanceof o.HlsJsPlayer||r instanceof a.NativeHlsPlayer)&&u.push({level:i.AutoQualityLevel.Auto}),u},t.isFatalError=function(e){return!(!e||"object"!=typeof e||!("fatal"in e))&&!0===e.fatal},t.findClosestQuality=function(e,t){if(0===t.length)return null;if(e===i.AutoQualityLevel.Auto)return{level:e};let r;const n=Object.fromEntries(t.map((e=>[e.level,e])));for(r=e;null!=r&&null==n[r];)r=d(r);if(null==r)for(r=e;null!=r&&null==n[r];)r=u(r);return null!=r?n[r]:null},t.equalQualities=function(e,t){if(e.length!==t.length)return!1;for(let r=0;r{var r,n,i,o,a,l;const c=s(e)?null!==(r=e.bitrate)&&void 0!==r?r:e.maxBitrate:(null!==(n=e.audioKbps)&&void 0!==n?n:0)+(null!==(i=e.videoKbps)&&void 0!==i?i:0),u=s(t)?null!==(o=t.bitrate)&&void 0!==o?o:t.maxBitrate:(null!==(a=t.audioKbps)&&void 0!==a?a:0)+(null!==(l=t.videoKbps)&&void 0!==l?l:0);return 0===c?-1:u-c}))}function c(e){var t,r,n,i,o;if(s(e))return{id:e.id,bitrate:null!==(t=e.bitrate)&&void 0!==t?t:e.maxBitrate,isSource:null!==(r=e.isSource)&&void 0!==r&&r,appData:null!==(n=e.appData)&&void 0!==n?n:{}};const a={id:e.location,bitrate:(null!==(i=e.audioKbps)&&void 0!==i?i:0)+(null!==(o=e.videoKbps)&&void 0!==o?o:0),isSource:!1,appData:{},encoding:e};return null!=a.appData&&e.videoWidth&&e.videoHeight&&(a.appData.videoWidth=e.videoWidth,a.appData.videoHeight=e.videoHeight),a}function u(e){switch(e){case i.SourceScoreLevel.Low:return i.SourceScoreLevel.Medium;case i.SourceScoreLevel.Medium:return i.SourceScoreLevel.High;case i.SourceScoreLevel.High:return null;case i.TranscodeScoreLevel.Lowest:return i.TranscodeScoreLevel.Low;case i.TranscodeScoreLevel.Low:return i.TranscodeScoreLevel.MediumLow;case i.TranscodeScoreLevel.MediumLow:return i.TranscodeScoreLevel.Medium;case i.TranscodeScoreLevel.Medium:return i.TranscodeScoreLevel.MediumHigh;case i.TranscodeScoreLevel.MediumHigh:return i.TranscodeScoreLevel.High;case i.TranscodeScoreLevel.High:return i.TranscodeScoreLevel.Highest;default:return null}}function d(e){switch(e){case i.SourceScoreLevel.High:return i.SourceScoreLevel.Medium;case i.SourceScoreLevel.Medium:return i.SourceScoreLevel.Low;case i.SourceScoreLevel.Low:return null;case i.TranscodeScoreLevel.Highest:return i.TranscodeScoreLevel.High;case i.TranscodeScoreLevel.High:return i.TranscodeScoreLevel.MediumHigh;case i.TranscodeScoreLevel.MediumHigh:return i.TranscodeScoreLevel.Medium;case i.TranscodeScoreLevel.Medium:return i.TranscodeScoreLevel.MediumLow;case i.TranscodeScoreLevel.MediumLow:return i.TranscodeScoreLevel.Low;case i.TranscodeScoreLevel.Low:return i.TranscodeScoreLevel.Lowest;default:return null}}t.ERRORS={BAD_INPUT:"bad-input",DRIVER_NOT_SUPPORTED:"driver-not-supported",ELEMENT_REQUIRED:"element-required",EMBED_SWF_FAILED:"embedding-flash-swf-failed",GET_USER_MEDIA_FAILED:"get-user-media-failed",HTTP_SERVER_UNEXPECTED_RESPONSE:"http-server-unexpected-response",HTTP_SERVER_UNAUTHORIZED:"http-server-unauthorized",HTTP_SERVER_FORBIDDEN:"http-server-forbidden",HTTP_SERVER_INTERNAL_ERROR:"http-server-internal-error",HTTP_SERVER_NOT_FOUND:"http-server-not-found",MANIFEST:"http-response",INVALID_CONTROLS:"invalid-controls-parent",INVALID_MEDIA_URL:"invalid-media-url",INVALID_POPOUT_URL:"invalid-popout-url",INVALID_EL:"invalid-element",WS_NETWORK_ERROR:"websocket-network-error",NETWORK_ERROR:"network-error",NO_DRIVERS:"no-valid-drivers",PLAYBACK_ERROR:"playback-error",UNKNOWN_DRIVER:"unknown-driver",UNKNOWN_ERROR:"unknown-error",UNRECOGNIZED_DRIVER:"unrecognized-driver",USER_REQUIRED:"user-required",INVALD_BITRATE:"invalid-bitrate",HLSJS_NOT_LOADED:"hlsjs-not-loaded"},t.lowPowerModeMsg="The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission."},35592:(e,t,r)=>{"use strict";var n=r(65606);Object.defineProperty(t,"__esModule",{value:!0}),t.HlsJsPlayer=void 0;const i=r(86729),o=r(51327),a=r(36147),s=r(37699),l=r(80165),c=r(26156),u=r(92491),d=r(98645),h=r(45829),p=r(39946),f=r(54244),m=r(69591),g=r(45820),v=(...e)=>{};class y extends m.CorePlayer{static async isSupported(e){return(0,h.supportsHlsjs)(e)}get hostEl(){return null==this.elementSupervisor?null:Reflect.get(this.elementSupervisor,"element")}async isSupported(){return y.isSupported()}static get format(){return"mp4-hls"}get format(){return y.format}async ready(){await this.device.loadHlsScript(this.options.hlsjsPath),await super.ready()}async handleSource(e){var t,r,n,o;if(this.suspended)return;const a=null!=(null===(r=null===(t=this.manifestJson)||void 0===t?void 0:t.formats["mp4-hls"])||void 0===r?void 0:r.substitute);if(this.manifestJson=e,null!=(null==e?void 0:e.formats["mp4-hls"])){if(this.source=this.manifest,null!=(null===(n=null==e?void 0:e.formats["mp4-hls"])||void 0===n?void 0:n.substitute)!==a&&!this._firstSourceEv)return this.ctx.logger.debug("Changing stream to/from blurredStream. Restart hlsjs."),void this.restart(!0);if(this._firstSourceEv&&(this._firstSourceEv=!1),null!=this.hostEl&&null!=this.source&&(!this.hostEl.src||null!=this.hostEl.srcObject||this.qualityHasChanged||i.device.isImplements(i.Feature.URL_LOCATION)&&this.hostEl.src===i.device.location)){const e=this.hostEl.currentTime;this.qualityHasChanged=!1,this.hostEl.srcObject=null,"recorded"===(null===(o=this.manifestJson)||void 0===o?void 0:o.type)&&e>0&&(this.hostEl.currentTime=e),this.ctx.logger.debug("hlsjs: await play()",{aggregates:(0,p.dumpVideoElement)(this.hostEl)}),await this.play()}}else this.emitErrorDeprecated(new d.DriverNotSupportedError("Manifest did not receive a 'mp4-hls' format, the driver was not provided.",{manifest:e}))}get implementedFeatures(){return[l.Feature.BITRATE_SWITCHING,l.Feature.MUTED_AUTOPLAY]}get device(){if(null!=this._device)return this._device;if(!i.device.isImplements(o.Feature.HLSJS))throw new Error("Device is not supported");return this._device=i.device,this._device}constructor(e,t,r){if(super(e,t,r),this.lastProgress=0,this.manifestJson=null,this.destroyed=!1,this.m3u8ManifestLoadId=0,this.indexManifestLoadId=0,this.initialFragmentLoadId=0,this.isStarting=!1,this._firstSourceEv=!0,this.lastFrag=null,this.loadingHls=!1,this.loadFailure=null,this.recoverDecodingErrorDate=0,this.recoverSwapAudioCodecDate=0,this.hls=null,this.isAttached=!1,this._device=null,this.inactivePageEventListener=!1,this.chosenLevel=null,this.hlsJsInitId=f.stats.start(f.STATS_EVENTS.HLSJS_INIT),!i.device.isImplements(o.Feature.HLSJS))throw new Error("Device is not supported");this.loadHls(),this.addInnerDisposer(this.destroy),this.on("error",(()=>{}))}get data(){var e,t;return null!==(t=null===(e=this.manifestJson)||void 0===e?void 0:e.formats["mp4-hls"])&&void 0!==t?t:null}get mediaLoader(){return this.provider}get manifest(){var e,t,r,n,i,o,a;const l=this.data;if(null==l)return null;let c;if(c=l.substitute?l.substitute.location:(null===(e=this.currentQuality)||void 0===e?void 0:e.level)!==s.SourceScoreLevel.High&&(null===(t=this.currentQuality)||void 0===t?void 0:t.level)!==s.SourceScoreLevel.Medium&&(null===(r=this.currentQuality)||void 0===r?void 0:r.level)!==s.SourceScoreLevel.Low||null==(null===(n=l.origin)||void 0===n?void 0:n.location)?null!=(null===(a=null===(o=this.currentQuality)||void 0===o?void 0:o.layer)||void 0===a?void 0:a.id)&&""!==this.currentQuality.layer.id?this.currentQuality.layer.id.toString():l.manifest:null===(i=l.origin)||void 0===i?void 0:i.location,null==c)return this.ctx.logger.info("Returning null in manifest getter. Data: ",{format:l}),null;const u=c.includes("?")?"&":"?";c+=u;const d=this.device.globals.get("lv_auto_last_kbps");if(null!=d){const e=c.includes("?")?"&":"?";c+=`${e}kbps=${d}`}return c}async reloadAndRestart(){this.isDisposed||(await this.mediaLoader.load(),"online"===this.mediaLoader.currentState&&await this.restart(!1))}loadHls(e){const t=null!=e?e:v;this.device.loadHlsScript(this.options.hlsjsPath).then((()=>t())).catch((e=>{this.ctx.logger.error("hlsjs not loaded",{path:this.options.hlsjsPath,err:e}),t(e)}))}handleVisibilityChange(){if(this.device.hidden)return;const e=this.manifest;null!=e?this.startIt(e):this.emitErrorDeprecated(new d.ManifestNotFoundError("cannot play, manifest is null",{}))}async startIt(e){if(!this.device.isHlsLoaded())throw new Error(g.ERRORS.HLSJS_NOT_LOADED);if(this.isDisposed||this.isStarting||null==e)return;if(!this.device.isHlsLoaded())throw new Error("Hls.js is not loaded");this.isStarting=!0,this.device.removeEventListener("visibilitychange",this.handleVisibilityChange),this.inactivePageEventListener=!1;const t={...await this.getAuthHeader(),...this.options.requestHeaders},r={debug:this.options.debug,maxBufferLength:this.options.maxBufferLength,maxBufferSize:this.options.maxBufferSize,fragLoadingTimeOut:3900,maxBufferHole:2,backBufferLength:90,progressive:!1,enableWorker:(()=>null!=this.options.enableWorker?this.options.enableWorker:null!=this.options.workerPath||"false"===n.env.HLSJS_BUNDLED)(),workerPath:this.options.workerPath};this.logger.debug("creating new Hls instance",{hlsjsConfig:r});const i=this.hls=new this.device.Hls({...r,...this.options.hlsjsConfig,xhrSetup(e,r){null!=t&&Object.entries(t).forEach((([t,r])=>{e.setRequestHeader(t,r)}))}});this.logger.debug("new hls instance created",{options:r}),this.listen(),i.loadSource(e),i.attachMedia(this.hostEl),this.mediaLoader.vod||i.on(this.device.Hls.Events.BUFFER_APPENDED,(()=>{null==this.hostEl||0===this.hostEl.buffered.length||this.hostEl.paused||this.hostEl.buffered.end(this.hostEl.buffered.length-1)-this.hostEl.currentTime>25&&(this.ctx.logger.warn("player fell behind more than 25s, restarting"),this.reloadAndRestart())})),i.on(this.device.Hls.Events.MEDIA_ATTACHED,this.handleMediaAttached),i.on(this.device.Hls.Events.MEDIA_DETACHED,(()=>{this.isAttached=!1})),i.on(this.device.Hls.Events.MANIFEST_PARSED,(()=>{this.counters.lastProgress=Date.now()})),this.isStarting=!1}async playNow(){this.logger.debug("playNow()");const e=this.manifest;if(!this.device.isHlsLoaded())throw new Error(g.ERRORS.HLSJS_NOT_LOADED);if(null==e&&"online"===this.mediaLoader.currentState)return this.emitErrorDeprecated(new d.DriverNotSupportedError("manifest doesn't contains 'flv-http' format",{manifest:e,loader:this.mediaLoader})),!1;if(null==e)return this.emitErrorDeprecated(new d.ManifestNotFoundError("cannot play, manifest is null",{})),!1;if(null==this.hostEl)return this.emitErrorDeprecated(new d.ElementRequiredError("cannot play, no video element",{})),!1;if(null!=this.hls){if(this.mediaLoader.vod&&e===this.hls.url){try{await super.play()}catch(e){const t=e instanceof Error?e:null;this.emitErrorDeprecated(new d.PlayingIssueError("vod play failed in playNow()",{inner:t,player:this}))}return!0}this.destroyHls()}return this.device.hidden?this.inactivePageEventListener||(this.device.addEventListener("visibilitychange",this.handleVisibilityChange),this.inactivePageEventListener=!0):await this.startIt(e),!this.hostEl.paused}handleMediaAttached(){if(null!=this.hostEl&&!this.localVideoPaused)try{super.play(!0)}catch(e){const t=e instanceof Error?e:null;this.emitErrorDeprecated(new d.PlayingIssueError("play failed in startIt() method",{inner:t,player:this}))}this.isAttached=!0}async play(){if(this.ctx.logger.debug("play()"),null==this.hostEl)return!1;if(null!=this.hls&&!this.localVideoPaused){try{await this.playNow()}catch(e){const t=e instanceof Error?e:null;this.emitErrorDeprecated(new d.PlayingIssueError("playNow() failed",{inner:t,player:this}))}return!0}this.hostEl.onprogress=null,await this.ready();try{await this.playNow()}catch(e){const t=e instanceof Error?e:null;this.emitErrorDeprecated(new d.PlayingIssueError("play failed",{inner:t,player:this}))}return!0}get autoLevelEnabled(){var e,t;return null!==(t=null===(e=this.hls)||void 0===e?void 0:e.autoLevelEnabled)&&void 0!==t&&t}set bitrate(e){if(null!=this.hostEl&&(i.device.isFirefox||this.mediaLoader.vod)){const e=this.hostEl.currentTime;if(this.stop(),this.mediaLoader.vod){const{hostEl:t}=this,r=()=>{var n;null===(n=this.hostEl)||void 0===n||n.removeEventListener("loadedmetadata",r),t.currentTime=e};this.hostEl.addEventListener("loadedmetadata",r)}this.play().catch((e=>{const t=e instanceof Error?e:null;this.emitErrorDeprecated(new d.PlayingIssueError("play failed after changing bitrate",{inner:t,player:this}))}))}}stop(){null!=this.hls&&this.destroyHls()}pause(){var e;null===(e=this.hostEl)||void 0===e||e.pause()}destroy(){this.destroyed=!0,this.destroyHls()}destroyHls(){const{hls:e}=this;null!=e&&(null!=this.hostEl&&this.hostEl.removeEventListener("error",this._handleElError),null==e||e.off(this.device.Hls.Events.ERROR,this._handleHlsErrors),e.off(this.device.Hls.Events.MEDIA_ATTACHED,this.handleMediaAttached),null==e||e.detachMedia(),null==e||e.destroy(),this.hls=null,this.loadFailure=null)}async recoverFromBufferSeekOverHole(){if(null!=this.data){this.stop();try{await this.play()}catch(e){const t=e instanceof Error?e:null;this.emitErrorDeprecated(new d.PlayingIssueError("play failed after recoverFromBufferSeekOverHole()",{inner:t,player:this}))}}}pickEncoding(e){if(null==this.data)return null;if(null!=e&&(this.options.bitrate=e),null==this.options.bitrate)return null;const{encodings:t}=this.data;return 0===t.length||null==this.chosenLevel?null:t[this.chosenLevel]}ifNoProgress(e){const t=this.hostEl;if(null==t)return;const r=t.currentTime;i.device.setTimeout((()=>{t.currentTime<=r&&e()}),250)}emitProgress(){i.device.isImplements(o.Feature.DEBUGGING)?this.lastProgress=i.device.performance.now():this.lastProgress=Date.now(),this.emit("progress")}listen(){var e,t,r,n;const{hls:i}=this,o=this.hostEl;if(null==i)throw new Error(g.ERRORS.HLSJS_NOT_LOADED);if(null==o)throw new Error(g.ERRORS.ELEMENT_REQUIRED);i.on(this.device.Hls.Events.ERROR,this._handleHlsErrors),o.addEventListener("progress",(()=>{this.emitProgress()})),o.addEventListener("ended",(()=>{this.emit("ended")}));const a={driver:this.format,abr:null===(e=this.manifestJson)||void 0===e?void 0:e.abr,aor:null===(t=this.manifestJson)||void 0===t?void 0:t.aor,atr:null===(r=this.manifestJson)||void 0===r?void 0:r.atr,rep:null===(n=this.manifestJson)||void 0===n?void 0:n.rep};m.timeupdateWrapper.wrap(o,(()=>{this.emit("timeupdate"),-1!==this.initialFragmentLoadId&&o.currentTime>0&&!o.paused&&!o.ended&&o.readyState>2&&(this.emit("initialFragmentLoad",f.stats.stop(this.initialFragmentLoadId,a)),this.initialFragmentLoadId=-1)})),o.addEventListener("error",this._handleElError),i.on(this.device.Hls.Events.MANIFEST_LOADING,((e,t)=>{this.emit("hlsJsInit",f.stats.stop(this.hlsJsInitId,a)),this.m3u8ManifestLoadId=f.stats.start(f.STATS_EVENTS.M3U8_MANIFEST_LOAD)})),i.on(this.device.Hls.Events.MANIFEST_LOADED,((e,t)=>{this.emit("m3u8ManifestLoad",f.stats.stop(this.m3u8ManifestLoadId,a)),this.indexManifestLoadId=f.stats.start(f.STATS_EVENTS.INDEX_MANIFEST_LOAD)})),i.once(this.device.Hls.Events.LEVEL_UPDATED,((e,t)=>{this.emit("indexManifestLoad",f.stats.stop(this.indexManifestLoadId,a))})),i.once(this.device.Hls.Events.FRAG_LOADING,(e=>{this.initialFragmentLoadId=f.stats.start(f.STATS_EVENTS.INITIAL_FRAGMENT_LOAD)})),i.on(this.device.Hls.Events.FRAG_LOADED,((e,t)=>{this.loadedFrag(t.frag)}))}_handleHlsErrors(e,t){var r;let n=0;const o=this.hostEl;try{switch(t.details){case this.device.Hls.ErrorDetails.LEVEL_LOAD_ERROR:case this.device.Hls.ErrorDetails.FRAG_LOAD_TIMEOUT:if(this.mediaLoader.vod){const e=(0,g.dataProperties)(t);return void this.emitErrorDeprecated(new d.PlaybackError("hlsjs playback error",{...e,loader:this.mediaLoader}))}if("offline"===this.mediaLoader.currentState)return void this.stop();if(this.ctx.logger.warn("level load reload and restart",{type:String(e)}),this.reloadAndRestart().catch((e=>{const t=(0,a.isVideoClientError)(e)&&e.code===d.ErrorCode.ManifestNotLoaded?"hlsjs restart failed because manifest has not loaded":"hlsjs restart failed";this.emitError((0,u.createError)(d.ErrorCode.PlayerLoadingFailed,t,{player:y.displayName,format:this.format},e))})),null!=o)return n=o.currentTime,void i.device.setTimeout((()=>{o.currentTime<=n&&(this.ctx.logger.warn("level load reload and restart",{type:String(e)}),this.reloadAndRestart().catch((e=>{const t=(0,a.isVideoClientError)(e)&&e.code===d.ErrorCode.ManifestNotLoaded?"hlsjs restart failed because manifest has not loaded":"hlsjs restart failed";this.emitError((0,u.createError)(d.ErrorCode.PlayerLoadingFailed,t,{player:y.displayName,format:this.format},e))})))}),100);break;case this.device.Hls.ErrorDetails.BUFFER_SEEK_OVER_HOLE:return void this.ifNoProgress((()=>{this.recoverFromBufferSeekOverHole()}));case this.device.Hls.ErrorDetails.BUFFER_APPEND_ERROR:case this.device.Hls.ErrorDetails.BUFFER_FULL_ERROR:this.counters.bufferOverflowCount++;break;case this.device.Hls.ErrorDetails.FRAG_LOAD_ERROR:case this.device.Hls.ErrorDetails.FRAG_DECRYPT_ERROR:case this.device.Hls.ErrorDetails.FRAG_PARSING_ERROR:case this.device.Hls.ErrorDetails.BUFFER_APPENDING_ERROR:case this.device.Hls.ErrorDetails.BUFFER_STALLED_ERROR:this.counters.bufferUnderflowCount++;break;case this.device.Hls.ErrorDetails.MANIFEST_LOAD_ERROR:return this.ctx.logger.error("unable to load m3u8 manifest",{url:t.url}),void this.setPreferredLevel(s.TranscodeScoreLevel.Highest)}switch(t.type){case this.device.Hls.ErrorTypes.NETWORK_ERROR:t.details!==this.device.Hls.ErrorDetails.FRAG_LOAD_TIMEOUT?this.counters.currentErrorCount++:this.counters.currentErrorCount=null!==(r=this.options.recoverErrorCount)&&void 0!==r?r:0,this.emitErrorDeprecated(new d.NetworkError("hlsjs playback error",{data:(0,g.dataProperties)(t)}));break;case this.device.Hls.ErrorTypes.MEDIA_ERROR:if(t.fatal)return void this.handleMediaError();if(t.details===this.device.Hls.ErrorDetails.BUFFER_STALLED_ERROR)return void this.emitErrorDeprecated(new d.PlaybackError("hlsjs media error",{data:(0,g.dataProperties)(t),loader:this.mediaLoader}));t.details===this.device.Hls.ErrorDetails.FRAG_LOAD_ERROR&&this.counters.currentErrorCount++,this.emitErrorDeprecated(new d.PlaybackError("hlsjs media error",{data:(0,g.dataProperties)(t),loader:this.mediaLoader}));break;case this.device.Hls.ErrorTypes.OTHER_ERROR:this.counters.currentErrorCount++,this.ctx.logger.warn("hlsjs other error",(0,g.dataProperties)(t));break;default:return void this.ctx.logger.error("unhandled hlsjs error",(0,g.dataProperties)(t))}this.checkRestart(t);const l=(0,g.dataProperties)(t);this.ctx.logger.warn(`${e}`,l)}catch(e){const t=e instanceof Error?e:null;this.emitErrorDeprecated(new d.HandleHlsJsError("error handling error from hlsjs library",{inner:t}))}}_handleElError(e){var t;if((0,c.isVideoElement)(e.target)&&null!=e.target.error){switch(e.target.error.code){case c.MediaErrorCodeConstants.MEDIA_ERR_DECODE:this.handleMediaError();break;case c.MediaErrorCodeConstants.MEDIA_ERR_SRC_NOT_SUPPORTED:this.emitErrorDeprecated(new d.DriverNotSupportedError("hlsjs src not supported",{manifest:this.manifest,loader:this.mediaLoader}))}this.autoPlay&&(null===(t=this.hostEl)||void 0===t||t.play())}}handleMediaError(){const e=this.device.isImplements(o.Feature.DEBUGGING)?this.device.performance.now():Date.now(),{hls:t}=this;if(null==t){if(this.destroyed||this.isDisposed)return;throw new Error(g.ERRORS.HLSJS_NOT_LOADED)}null!=this.recoverDecodingErrorDate||e-this.recoverDecodingErrorDate>3e3?(this.recoverDecodingErrorDate=e,t.recoverMediaError()):(null!=this.recoverSwapAudioCodecDate||e-this.recoverSwapAudioCodecDate>3e3)&&(this.recoverSwapAudioCodecDate=e,t.swapAudioCodec(),t.recoverMediaError()),this.ifNoProgress((()=>{this.recoverFromBufferSeekOverHole()}))}get currentLevel(){const{hls:e}=this;return null==e||null==e.abrController.fragCurrent?null:e.abrController.fragCurrent.level}get nextLevel(){const{hls:e}=this;if(null==e)throw new Error(g.ERRORS.HLSJS_NOT_LOADED);return e.abrController.nextAutoLevel}bitrateSwitch(e){var t;null!=this.hls&&(e>(null!==(t=this.currentLevel)&&void 0!==t?t:0)?this.counters.upshift++:this.counters.downshift++,this.emit("bitrate-switch"))}loadedFrag(e){var t,r,n;const i=e;this.counters.fragCounts++,i.request=null!=this.lastFrag?i.trequest-(null!==(r=null===(t=this.lastFrag)||void 0===t?void 0:t.trequest)&&void 0!==r?r:0):i.trequest,this.lastFrag=i,this.counters.fragSize+=i.loaded,this.counters.fragDuration+=i.duration,this.counters.fragDownloadTime+=i.request,this.counters.fragMaxTime=Math.max(this.counters.fragMaxTime,i.request),this.counters.fragMinTime=Math.min(null!==(n=this.counters.fragMinTime)&&void 0!==n?n:i.request,i.request)}}t.HlsJsPlayer=y,y.displayName="HlsJsPlayer"},50585:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ManifestPlayer=void 0;const n=r(43375),i=r(27813),o=r(80769),a=r(86729),s=r(36147),l=r(84368),c=r(72416),u=r(80165),d=r(51327),h=r(92491),p=r(98645),f=r(54873),m=r(93503),g=r(45831),v=r(80366),y=r(93937),b=r(54244),_=r(69591),S=r(45820),w=r(73146);class E extends g.ObservableEventEmitter{attachTo(e){this.elementSupervisor=w.MediaElementSupervisor.getSupervisor(e).attachToPlayer(this);const t=this.currentPlayer;null!=t&&null!=this.elementSupervisor&&t.initVideoEl(this.elementSupervisor,!0).catch((e=>this.ctx.logger.error(e)))}setPreferredLevel(e){this.preferredLevel=e}get noConsumerAudioAndVideo(){var e;return!!(null===(e=this.currentPlayer)||void 0===e?void 0:e.isImplements(u.Feature.CONSUMER))&&!this.currentPlayer.consumerAudioEnabled&&!this.currentPlayer.consumerVideoEnabled}get webrtcConnecting(){var e;return!!(null===(e=this.currentPlayer)||void 0===e?void 0:e.isImplements(u.Feature.BROADCAST))&&this.currentPlayer.isConnecting}get currentPlayer(){return this[y.implementation]}set currentPlayer(e){this[y.implementation]=e}get lowLatency(){var e;return!!this.isImplements(u.Feature.BITRATE_SWITCHING)&&"webrtc"===(null===(e=this.currentPlayer)||void 0===e?void 0:e.format)}set lowLatency(e){var t,r;this.supportsLowLatency?e?("webrtc"!==(null===(t=this.currentPlayer)||void 0===t?void 0:t.format)&&this.selectWebrtcPlayer(),this.preferredLevel=o.SourceScoreLevel.High):("webrtc"===(null===(r=this.currentPlayer)||void 0===r?void 0:r.format)&&this.nextPlayer(),this.preferredLevel=o.TranscodeScoreLevel.Highest):this.logger.warn("unable to set low latency. player does not support low latency.")}selectWebrtcPlayer(){const e=this.availablePlayers.findIndex((e=>"webrtc"===e.id));this.selectPlayer(e)}isImplements(e){var t;const r=this[y.implementation];return e===u.Feature.PLAYER_SELECTOR||null!==(t=null==r?void 0:r.isImplements(e))&&void 0!==t&&t}get supportsLowLatency(){return this.availablePlayers.some((e=>"webrtc"===e.id))}get logger(){return this.ctx.logger}constructor(e,t,r){var n;super(!1),this.driverFailover=!1,this.lastTimeUpdate=Date.now()+5e3,this.manifest=null,this.availablePlayers=[],this.providedPlayers=[],this.currentPlayerIndex=null,this.allPlayers=[],this.manifestLoadId=0,this.blurred=!1,this.firstLoadId=b.stats.start(b.STATS_EVENTS.FIRST_LOAD),this.ctx=e,this.options={displayPoster:"preview",...r,driverFailoverSeconds:null!==(n=r.driverFailoverSeconds)&&void 0!==n?n:10},(0,i.makeObservable)(this,{blurred:i.observable}),this.provider=t,(0,m.onceCanceled)(e).then((e=>this.dispose(`ManifestPlayer Context Cancelled: ${e}`)));const o=(0,f.makeBounded)(new Proxy(this,_.proxyHandler));return o.init(),e.logger.attachObject(o),e.logger.trace("constructor()",{options:JSON.stringify(r)}),o}handleTimeUpdate(){this.lastTimeUpdate=Date.now()}handleWebsocketReconnect(){this.selectWebrtcPlayer()}init(){this.provider.on("manifest",this.updateManifest),this.on("timeupdate",this.handleTimeUpdate),this.addInnerDisposer((()=>this.off("timeupdate",this.handleTimeUpdate)));const e={autoPlay:this.options.autoPlay,muted:this.options.muted,volume:this.options.volume};this.allPlayers=this.parsePlayerSpecs(this.options.players,e),this.validatePlayers(this.allPlayers).then((()=>{this.provider.once("source",(e=>{var t,r,n,i,o;this.manifest=e,this.emit("manifestLoadTime",b.stats.stop(this.manifestLoadId,{driver:(null===(t=this.currentPlayer)||void 0===t?void 0:t.format)||void 0,abr:null===(r=this.manifest)||void 0===r?void 0:r.abr,aor:null===(n=this.manifest)||void 0===n?void 0:n.aor,atr:null===(i=this.manifest)||void 0===i?void 0:i.atr,rep:null===(o=this.manifest)||void 0===o?void 0:o.rep}))})),this.manifestLoadId=b.stats.start(b.STATS_EVENTS.MANIFEST_LOAD),this.provider.load("preview"===this.options.displayPoster).then(this.firstLoad).catch((e=>this.emitError((0,h.createError)(s.ErrorCode.PlayerLoadingFailed,"unable to start playing because of manifest loading error",{},e))))})),this.driverFailoverInterval(),this.on("localVideoPaused",(e=>{e?this.currentPlayer?this.currentPlayer.updatePosterWithLatestFrame():this.poster=this.selectPoster():this.driverFailoverInterval()})),this.on("implementation",(()=>this.emit("currentPlayer",this)))}driverFailoverInterval(){null!=this.options.driverFailoverSeconds&&!0!==this.localVideoPaused&&(a.device.clearInterval(this.driverFailInterval),this.driverFailInterval=a.device.setInterval((()=>{null!=this.options.driverFailoverSeconds&&(!0!==this.localVideoPaused?this.driverFailoverCheck(this.options.driverFailoverSeconds):a.device.clearInterval(this.driverFailInterval))}),1e3),this.addInnerDisposer((()=>a.device.clearInterval(this.driverFailInterval))))}driverFailoverCheck(e){"online"!==this.provider.currentState||this.noConsumerAudioAndVideo||a.device.hidden||this.webrtcConnecting?this.lastTimeUpdate=Date.now():Date.now()-this.lastTimeUpdate>1e3*e&&(this.logger.warn(`driver failover check: no timeupdate for ${e} seconds`),this.lastTimeUpdate=Date.now()+5e3,this.nextPlayer())}firstLoad(){var e;(null===(e=this.elementSupervisor)||void 0===e?void 0:e.hasPoster())||(this.poster=this.selectPoster())}selectPoster(){var e,t,r,n,i;const o=this.options.displayPoster,a=null===(e=this.manifest)||void 0===e?void 0:e.formats.jpeg;if(null==o||!1===o||null==a)return this.ctx.logger.debug("no posters",{displayPoster:o,manifest:this.manifest}),null;if("preview"===o&&null!=(null===(t=this.manifest)||void 0===t?void 0:t.previewImg))return this.ctx.logger.debug("select previewImg poster"),null===(r=this.manifest)||void 0===r?void 0:r.previewImg;let s,l;"object"==typeof o?(s=o.videoHeight,l=o.videoWidth):null!=(null===(i=null===(n=this.currentQuality)||void 0===n?void 0:n.layer)||void 0===i?void 0:i.appData)&&(s=this.currentQuality.layer.appData.videoHeight,l=this.currentQuality.layer.appData.videoWidth);const c=a.encodings.find((e=>e.videoHeight===s&&e.videoWidth===l));return null!=c?(this.ctx.logger.debug(`select ${l}x${s} poster`),c.location):a.encodings.length>0?(this.ctx.logger.debug("select first poster"),a.encodings[0].location):(this.ctx.logger.debug("poster not found"),null)}updatePosterWithLatestFrame(){null!=this.elementSupervisor&&a.device.isImplements(d.Feature.CREATE_SCREENSHOT)?this.poster=this.elementSupervisor.createScreenshot():this.ctx.logger.warn("Unable to set update poster. Create screenshot is not compatible with device.")}parsePlayerSpecs(e,t){return e.map((e=>{var r;if("string"==typeof e)return{id:e,options:t};const n=null!==(r=e.options)&&void 0!==r?r:{};return{...e,options:{...t,...n}}}))}async validatePlayers(e){const t=await Promise.all(e.map((e=>c.players[e.id].isSupported(this.logger)))),r=e.map(((e,r)=>({...e,supported:t[r]})));this.providedPlayers=r.filter((e=>e.supported)),this.emit("availablePlayers",{players:this.providedPlayers}),0===this.providedPlayers.length&&this.noDrivers()}updateManifest(e){var t;this.emit("manifest",e);const r={401:"MANIFEST_UNAUTHORIZED",403:"MANIFEST_FORBIDDEN",404:"MANIFEST_NOT_FOUND"};if(this.manifest=e,"forbidden"===e.state){const e=`manifest is forbidden after polling it for '${this.provider.options.unauthorizedRecoveryDuration}' ms`;return this.emitErrorDeprecated(new p.ManifestError(e,{loader:this.provider})),void this.dispose(e)}if("online"!==e.state)return 401!==e.code&&403!==e.code||(this.options.refetch?this.emit("info",{code:r[e.code]}):(this.emitErrorDeprecated(new p.ManifestError(`manifest error: ${r[e.code]}`,{loader:this.provider})),this.dispose(r[e.code]))),void(404!==e.code&&403!==e.code||(null===(t=this.currentPlayer)||void 0===t||t.dispose(),this.currentPlayer=null,this.emit("info",{code:r[e.code]})));this.availablePlayers=this.providedPlayers.filter((t=>{const r=e.formats[c.players[t.id].format];return null!=r&&(0,l.isValidFormat)(r)})),this.emit("availablePlayers",{players:this.availablePlayers}),null==this.currentPlayer&&(0===this.availablePlayers.length?this.noDrivers():(this.ctx.logger.debug("Select the first player"),this.selectPlayer(0)));const n=this.currentPlayer,i=e.formats[null==n?void 0:n.format];this.updateQualities(i)}updateQualities(e){var t,r,n,i;const a=this.currentPlayer;if(null!=a&&(0,o.isGenericFormat)(e)){const o=null!==(n=(0,S.fetchManifestQualities)(e,null!==(r=null===(t=e.origin)||void 0===t?void 0:t.location)&&void 0!==r?r:null,a))&&void 0!==n?n:[];(0,S.equalQualities)(o,null!==(i=this.availableQualities)&&void 0!==i?i:[])||(this.availableQualities=o),this.blurred=null!=e.substitute}}noDrivers(){"online"===this.provider.currentState&&(this.emit("noPlayers",!0),this.emitErrorDeprecated(new p.NoDriversError("no drivers",{})))}nextPlayer(){var e;1!==this.availablePlayers.length?null==this.currentPlayerIndex||this.currentPlayerIndex>=this.availablePlayers.length-1?this.selectPlayer(0):this.selectPlayer(this.currentPlayerIndex+1):null===(e=this.restart)||void 0===e||e.call(this,!1)}selectPlayer(e){var t;if(this.suspended=!0,this.ctx.logger.debug("selectPlayer()",{index:e}),e>=this.availablePlayers.length)return void this.noDrivers();const r=this.availablePlayers[e];this.emit("driver",r.id);const n=c.players[r.id];if(null==n)return void this.noDrivers();if(null!=this.currentPlayer){const e=this.currentPlayer;this.currentPlayer=null,e.removeAllListeners("error"),e.dispose("replacing current player")}if(null!=n.format){const e=null===(t=this.manifest)||void 0===t?void 0:t.formats[n.format];this.updateQualities(e)}const i=new n((0,v.extendContext)(this.ctx,n),this.provider,r.options);this.currentPlayer=i,this.currentPlayerIndex=e,this.ctx.logger.debug("set manifest player",{player:this.currentPlayer,format:i.format,name:r}),i.on("error",(e=>{switch(e.code){case s.ErrorCode.EmbedSWFFailed:case s.ErrorCode.NotSupported:case s.ErrorCode.HandleHlsJsError:case s.ErrorCode.JoinCallError:case s.ErrorCode.UnableJoinCall:this.ctx.logger.debug(`Select next player because ${e.code}`),this.nextPlayer();break;default:e.critical&&(this.ctx.logger.debug("Select next player because the error is critical"),this.nextPlayer())}})),i.on("videoFirstPlay",(()=>{var e,t,r,n,i;this.emit("initialLoadTime",b.stats.stop(this.firstLoadId,{driver:(null===(e=this.currentPlayer)||void 0===e?void 0:e.format)||void 0,abr:null===(t=this.manifest)||void 0===t?void 0:t.abr,aor:null===(r=this.manifest)||void 0===r?void 0:r.aor,atr:null===(n=this.manifest)||void 0===n?void 0:n.atr,rep:null===(i=this.manifest)||void 0===i?void 0:i.rep}))})),i.isImplements(u.Feature.BROADCAST)&&(i.on("websocketReconnect",this.handleWebsocketReconnect),i.addInnerDisposer((()=>this.off("websocketReconnect",this.handleWebsocketReconnect)))),null!=this.elementSupervisor&&i.initVideoEl(this.elementSupervisor,!0).catch((e=>this.ctx.logger.error(e))),this.suspended=!1}handlePlayerAccessDenied(e){this.dispose(e.message)}toJSON(){var e,t,r;const i=null===(e=this[y.implementation])||void 0===e?void 0:e.toJSON();if(null==i||"object"!=typeof i||Array.isArray(i)||(0,n.isSerializableObject)(i))return{};const o=null!==(t=i.aggregates)&&void 0!==t?t:{};return null==o||"object"!=typeof o||Array.isArray(o)||(0,n.isSerializableObject)(o)?i:(delete i.aggregates,{...i,options:this.options,playersSpecs:this.availablePlayers,currentPlayerIndex:this.currentPlayerIndex,uri:null===(r=this.provider)||void 0===r?void 0:r.uri,aggregates:{...o,...(0,n.extractAggregates)(this.provider,"support"),support:this.ctx.support.hash}})}replaceManifestUrl(e){return Promise.resolve(void 0)}}t.ManifestPlayer=E,E.displayName="ManifestPlayer"},73146:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MediaElementSupervisor=void 0;const n=r(86729),i=r(39946),o=r(45831),a=r(69591),s=new WeakMap;class l extends o.ObservableEventEmitter{constructor(e){super(),this.element=e,this.activePlayer=null,this.debugSuspendTimeupdate=!1,e.setAttribute("playsinline","true"),e.setAttribute("webkit-playsinline","true"),this.startListenEvent("play","handleElPlay"),this.startListenEvent("pause","handleElPause"),this.startListenEvent("volumechange","handleElVolumeChange"),this.startListenEvent("error","handleElError"),this.startListenEvent("progress","handleElProgress"),a.timeupdateWrapper.wrap(e,this.createEventHandler("handleElTimeupdate")),a.timeupdateWrapper.wrap(e,this.createEventHandler("handleElTimeupdate")),this.element.addEventListener("loadeddata",(()=>{this.emit("loadeddata")}))}get muted(){return this.element.muted}set muted(e){this.element.muted=e}get paused(){return this.element.paused}get volume(){return this.element.volume}set volume(e){this.element.volume=e}get error(){return this.element.error}get autoplay(){return this.element.autoplay}set autoplay(e){this.element.autoplay=e}get buffered(){return this.element.buffered}get ended(){return this.element.ended}get readyState(){return this.element.readyState}get currentTime(){return this.element.currentTime}set currentTime(e){this.element.currentTime=e}get playbackRate(){return this.element.playbackRate}set playbackRate(e){this.element.playbackRate=e}get sourceKind(){const e=n.device.isImplements(n.Feature.URL_LOCATION)?n.device.location:"";return null!=this.element.srcObject?"srcObject":null!=this.element.src&&""!==this.element.src&&this.element.src!==e?"src":null}get srcObject(){return this.element.srcObject}static getSupervisor(e){return s.has(e)||s.set(e,new l(e)),s.get(e)}attachToPlayer(e){return this.element.src="",this.element.srcObject=null,this.activePlayer=e,this}isVideoPlaying(){return this.element.currentTime>0&&!this.element.paused&&!this.element.ended&&this.element.readyState>2}setPoster(e){this.element.setAttribute("poster",e)}hasPoster(){return null!=this.element.getAttribute("poster")}createScreenshot(){try{return n.device.isImplements(n.Feature.CREATE_SCREENSHOT)?n.device.createScreenshot(this.element):null}catch(e){return null}}pause(){this.element.pause()}updateSrc(e){this.element.src=e,this.element.srcObject=null}updateSrcObject(e){this.element.src="",this.element.srcObject=e}dumpVideoElement(){return(0,i.dumpVideoElement)(this.element)}isSourceSet(){const e=n.device.isImplements(n.Feature.URL_LOCATION)?n.device.location:"";return null!=this.element.src&&""!==this.element.src&&this.element.src!==e||null!=this.element.srcObject}play(){return this.element.play()}createEventHandler(e){return()=>{var t,r;null==this.activePlayer||this.activePlayer.isDisposed||"handleElTimeupdate"===e&&this.debugSuspendTimeupdate||null===(r=null===(t=this.activePlayer)||void 0===t?void 0:t[e])||void 0===r||r.call(t)}}startListenEvent(e,t){const r=this.createEventHandler(t);this.element.addEventListener(e,r),this.addInnerDisposer(this.stopListenEvent.bind(this,e,r))}stopListenEvent(e,t){this.element.removeEventListener(e,t)}}t.MediaElementSupervisor=l},46693:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MediasoupPlayer=void 0;const n=r(43375),i=r(27813),o=r(80165),a=r(92491),s=r(98645),l=r(88819),c=r(58636),u=r(75477),d=r(69591),h=r(45820);class p extends d.CorePlayer{get displayName(){return p.displayName}static async isSupported(e){return(0,u.supportsMediasoupWebrtc)("Mediasoup Player",e)}async isSupported(){return p.isSupported()}static get format(){return"webrtc"}get format(){return p.format}get implementedFeatures(){return this.isManifestPlayer?[o.Feature.CONSUMER,o.Feature.BITRATE_SWITCHING,o.Feature.MUTED_AUTOPLAY]:[o.Feature.CONSUMER,o.Feature.BITRATE_SWITCHING]}constructor(e,t,r){super(e,t,r),this.preferredSource=null,this.hasAudio=!1,this.hasVideo=!1,this.isManifestPlayer=!1,(0,i.makeObservable)(this,{hasAudio:i.observable,hasVideo:i.observable,consumerAudioEnabled:i.computed,consumerVideoEnabled:i.computed,noConsumerAudioAndVideo:i.computed}),this.playerOptions=r,this.playerOptions.mutedAutoplayFallback&&(this.isManifestPlayer=!0),this.addInnerDisposer((0,i.reaction)((()=>this.availableQualities),(e=>{this.emit("layers",(0,h.getBitrateLayersFromQualities)(e))}),{equals:i.comparer.structural})),this.addInnerDisposer((0,i.reaction)((()=>this.currentQuality),(e=>{var t;if(this.emit("activeLayer",null!==(t=null==e?void 0:e.layer)&&void 0!==t?t:null),this.provider instanceof l.MediasoupSource&&this.provider.peer instanceof c.Peer&&null!=(null==e?void 0:e.layer))try{this.provider.peer.setPreferredEncoding(e.layer)}catch(t){this.emitError((0,a.createError)(s.ErrorCode.UnableSwitchQuality,"Failed to change quality for webrtc consumer after currentQuality is changed",{player:this.displayName,format:this.format,preferredLevel:e.level}))}}),{equals:i.comparer.structural})),this.provider instanceof l.MediasoupSource&&(this.provider.on("availableQualities",this.handleAvailableQualities),this.provider.on("accessDenied",this.handleAccessDenied)),this.addInnerDisposer((()=>{this.provider instanceof l.MediasoupSource&&(this.provider.off("availableQualities",this.handleAvailableQualities),this.provider.off("accessDenied",this.handleAccessDenied))})),this.ctx.logger.trace("constructor()",{options:r})}async handleSource(e){this.suspended||(this.ctx.logger.trace("handleSource()"),this.source=e,null!=this.elementSupervisor&&(this.autoPlay||!this.internalPaused?(await this.playingPromise,this.ctx.logger.trace("handleSource() -> await this.playingPromise"),this.elementSupervisor.updateSrcObject(e),await this.play(),this.ctx.logger.trace("handleSource() -> await play()")):this.elementSupervisor.updateSrcObject(e),this.ctx.logger.debug("srcObject set")),this.provider instanceof l.MediasoupSource&&(this.hasAudio=this.provider.hasAudio,this.hasVideo=this.provider.hasVideo,this.consumerAudioMuted=!this.hasAudio||this.provider.audioMuted,this.consumerVideoPaused=!this.hasVideo||this.provider.videoPaused,this.availableQualities=this.provider.availableQualities))}handleAccessDenied(e){var t;this.provider instanceof l.MediasoupSource&&(null===(t=this.provider.peer.call)||void 0===t||t.dispose(e.message))}handleAvailableQualities(e){this.availableQualities=e}get consumerAudioEnabled(){const{consumerAudioMuted:e,hasAudio:t}=this;return this.provider instanceof l.MediasoupSource&&t&&!1===e}get consumerVideoEnabled(){const{consumerVideoPaused:e,hasVideo:t}=this;return this.provider instanceof l.MediasoupSource&&t&&!1===e}get noConsumerAudioAndVideo(){const{consumerAudioMuted:e,hasAudio:t,consumerVideoPaused:r,hasVideo:n}=this;return!(t&&!1===e||n&&!1===r)}get streamName(){return this.provider instanceof l.MediasoupSource?this.provider.streamName:""}get peerId(){var e,t;return this.provider instanceof l.MediasoupSource&&null!==(t=null===(e=this.provider.peer)||void 0===e?void 0:e.peerId)&&void 0!==t?t:""}get callId(){var e,t,r;return this.provider instanceof l.MediasoupSource&&null!==(r=null===(t=null===(e=this.provider.peer)||void 0===e?void 0:e.call)||void 0===t?void 0:t.id)&&void 0!==r?r:""}get userId(){var e,t;return this.provider instanceof l.MediasoupSource&&null!==(t=null===(e=this.provider.peer)||void 0===e?void 0:e.userId)&&void 0!==t?t:""}toJSON(){var e;const t=super.toJSON();if(null==t||"object"!=typeof t||Array.isArray(t)||(0,n.isSerializableObject)(t))return{};const r=null!==(e=t.aggregates)&&void 0!==e?e:{};return null==r||"object"!=typeof r||Array.isArray(r)||(0,n.isSerializableObject)(r)?t:(delete t.aggregates,{...t,options:this.options,aggregates:{...r,...(0,n.extractAggregates)(this.provider,"support"),support:this.ctx.support.hash,consumerAudioEnabled:this.consumerAudioEnabled,consumerVideoEnabled:this.consumerVideoEnabled,noConsumerAudioAndVideo:this.noConsumerAudioAndVideo,preferredSource:this.preferredSource,currentQuality:this.currentQuality,isManifestPlayer:this.isManifestPlayer,peerId:this.peerId,userId:this.userId}})}}t.MediasoupPlayer=p,p.displayName="MediasoupPlayer"},50610:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MeowPlayer=void 0;const n=r(82837),i=r(86729),o=r(59703),a=r(98645),s=r(93503),l=r(30799),c=r(45831),u=r(80366),d=r(45820),h=r(3824),p="lv_origin",f=new WeakMap;class m extends c.ObservableEventEmitter{constructor(e,t,r,n){var o,a;if(super(),this.manifest=null,this.buffering=!1,this.queue=[],this.sourceBuffers=[],this.receivedSegments=0,this.abrController=null,this.encoding=null,this.transport=null,this.version=null,this.ms=null,this.mediaSourceTime=null,this.lastMessageReceived=null,this.logInterval=void 0,this.gcInterval=void 0,this.destroyed=!1,this.ctx=e,(0,s.onceCanceled)(e).then((e=>this.dispose(`Mp4ws Context Cancelled: ${e}`))),this.addInnerDisposer(this.destroy),!i.device.isImplements(i.Feature.DEBUGGING)||!i.device.isImplements(i.Feature.MEDIA_SOURCE)||!i.device.isImplements(i.Feature.LOCAL_STORAGE))throw new Error("Device is not supported");if(this.device=i.device,this.videoPlayer=t,this.options=r,this.el=n,null==this.options.bitrate){const t=null!==(o=this.device.localStorage.getItem(p))&&void 0!==o?o:"normal",r=new S((0,u.extendContext)(e,S),this,this.videoPlayer,t,!1,null!==(a=this.options.maxShifts)&&void 0!==a?a:1/0,this.options);this.abrController=r,r.on("profile",(e=>{this.device.localStorage.setItem("lv_estimated_kbps",e.estimatedKbps.toString()),this.device.localStorage.setItem(p,e.profile.key)})),this.abrController.on("upshift",(()=>{this.emit("upshift")})),this.abrController.on("downshift",(()=>{this.emit("downshift")}))}let l;l=this.options.origin&&null!=this.videoPlayer.data?this.videoPlayer.data.origin:this.videoPlayer.pickEncoding(),null==l&&null!=this.videoPlayer.data&&this.videoPlayer.data.encodings.length>0&&([l]=this.videoPlayer.data.encodings),null!=l&&(this.encoding=l),this.setupMSE()}get readyState(){var e;if(null==this.ms)return null;const{encoding:t}=this;return null==t||(null===(e=t.channels)||void 0===e?void 0:e.length)!==this.sourceBuffers.length?null:this.ms.readyState}appendBuffer(){if(this.buffering)return;const e=()=>{this.buffering=!0,i.device.setTimeout((()=>{this.buffering=!1,this.appendBuffer()}),20)};if("open"!==this.readyState)return void e();const t=this.queue.shift();if(null!=t)if(this.buffering=!0,"remove"===t.type){if(null==t.sb)return this.buffering=!1,void this.appendBuffer();this.ctx.logger.debug("remove buffer",{buffer:`${t.start}-${t.end} buffered until ${t.sb.buffered.end(0)}`}),t.sb.remove(t.start,t.end)}else t.blob.arrayBuffer().then((r=>{if(null==this.transport)throw new Error("Transport is not defined");const n=this.transport.getSegmentInfo(r);1===this.version&&(n.contentTag=0);const i=this.sourceBuffers[n.contentTag];if(this.emit("fragment",{size:t.blob.size,time:t.time,duration:300}),"open"!==this.readyState)return this.ctx.logger.debug("meow mse not ready",{readyState:this.readyState}),this.queue.unshift(t),void e();if(null==i)return this.queue.unshift(t),void e();try{i.appendBuffer(r)}catch(e){this.emitErrorDeprecated(new a.Mp4BufferError("failed to append source buffer in appendBuffer()",{inner:(0,a.wrapNativeError)(e)}))}}));else e()}checkSourceBuffers(){var e,t,r;for(const t of this.sourceBuffers)if(0===(null!==(e=null==t?void 0:t.buffered.length)&&void 0!==e?e:0))return!1;return 0!==(null!==(r=null===(t=this.el)||void 0===t?void 0:t.buffered.length)&&void 0!==r?r:0)}newSourceBuffer(e){if(null==e||!this.device.MediaSource.isTypeSupported(e))return void this.sourceBuffers.push(null);if(null==this.ms)return;const t=this.ms.addSourceBuffer(e);this.ctx.logger.debug("meow adding sourcebuffer",{mimetype:e}),f.set(t,{mimetype:e}),t.addEventListener("error",(e=>{this.emitErrorDeprecated(new a.Mp4BufferError("failed to append source buffer in newSourceBffer()",{inner:e})),this.buffering=!1,this.appendBuffer()})),t.addEventListener("updateend",(()=>{var e,t,r;this.buffering=!1,this.appendBuffer();const{el:n}=this;if(null==n)return;if(n.buffered.length>0){const i=n.buffered.end(n.buffered.length-1)-n.currentTime;if(0===n.currentTime){if(n.buffered.end(n.buffered.length-1)-n.buffered.start(0)>(null!==(e=this.options.requiredBuffer)&&void 0!==e?e:0)){const e=Math.max(n.buffered.end(n.buffered.length-1)-(null!==(t=this.options.requiredBuffer)&&void 0!==t?t:0),n.buffered.start(0));n.currentTime=e,this.ctx.logger.debug("meow attempting to start",{startTime:e}),this.play()}}else if(i>25){const e=n.currentTime,t=Math.max(n.buffered.end(n.buffered.length-1)-(null!==(r=this.options.requiredBuffer)&&void 0!==r?r:0),n.buffered.start(0));n.currentTime=t,this.ctx.logger.warn("meow buffer max reached, moving to playback head",{max:25,ct:e,nt:t})}}if(this.receivedSegments++,this.receivedSegments>60&&!this.checkSourceBuffers())return this.ctx.logger.error("no buffer after 60 segments"),void this.emit("error",{message:"media-error",fatal:!0,notSupported:!0});const i=[];this.sourceBuffers.forEach(((e,t)=>{if(null!=e&&"open"===this.readyState)for(let r=0;r{this.ctx.logger.error("meow mediasource dom error"),this.emit("error",{message:"media-error",fatal:!0})})),this.ms.addEventListener("abort",(()=>{this.ctx.logger.error("meow mediasource dom abort"),this.emit("error",{message:"media-error",fatal:!0})})),this.ms.addEventListener("sourceended",(()=>{this.ctx.logger.debug("meow mediasource source ended")})),this.ms.addEventListener("sourceclose",(()=>{this.ctx.logger.debug("meow mediasource source closed")})),this.ms.addEventListener("sourceopen",this.onSourceOpen),this.ctx.logger.debug("meow attempting to create media source"),this.mediaSourceTime=this.device.performance.now(),null!=this.el&&(this.videoPlayer instanceof h.Mp4WsPlayer?(this.videoPlayer.source=URL.createObjectURL(this.ms),this.el.src=this.videoPlayer.source):this.el.src=URL.createObjectURL(this.ms))}onSourceOpen(){this.ms.removeEventListener("sourceopen",this.onSourceOpen),this.ctx.logger.debug("meow media source opened");const{encoding:e}=this;if(null!=e)try{if(null!=(null==e?void 0:e.channels)){if(0===e.channels.length)return void this.emit("error",{message:"media-error",fatal:!0,notSupported:!0});this.version=2;for(const t of e.channels)this.newSourceBuffer(t)}else{this.version=1;const{origin:e}=this.videoPlayer.data;let t;t=null!=this.options.origin&&null!=e&&"aac"!==e.audioCodec||!this.options.origin&&"aac"!==this.videoPlayer.data.audioCodec?'video/mp4; codecs="avc1.4d4028"':'video/mp4; codecs="avc1.4d4028, mp4a.40.2"',this.ctx.logger.debug("meow adding sourcebuffer",{mimetype:t}),this.newSourceBuffer(t)}}catch(e){const t=e instanceof Error?e:null;this.emitErrorDeprecated(new a.MeowDriverError("meow error in newSourceBuffer(). restarting player",{inner:t})),this.destroy(),this.videoPlayer instanceof h.Mp4WsPlayer&&(this.videoPlayer.player=null,this.videoPlayer.restart(!1))}else this.emit("error",{message:"media-error",fatal:!0})}setupTransport(){var e,t,r,n,i,o;const a=(null!==(r=null===(t=null===(e=this.encoding)||void 0===e?void 0:e.channels)||void 0===t?void 0:t.length)&&void 0!==r?r:0)>0?null!==(o=null===(i=null===(n=this.encoding)||void 0===n?void 0:n.channels)||void 0===i?void 0:i.length)&&void 0!==o?o:0:1,{manifest:s}=this.videoPlayer;this.manifest=s,null!=s?(null!=this.transport&&(this.transport.removeAllListeners(),this.transport.destroy()),this.transport=new b((0,u.extendContext)(this.ctx,b),s,this.options.backFill,this.options.maxGap,this.options.retry,this.options.mode,this.options.download,this.options.segmentDuration,a),this.transport.on("error",(()=>{var e;(null===(e=this.transport)||void 0===e?void 0:e.disconnected)?this.emit("error",{message:d.ERRORS.WS_NETWORK_ERROR,fatal:!1}):this.emit("error",{message:"websocket-connection",notSupported:!0})})),this.transport.on("destroy",(()=>{this.emit("error",{message:"websocket-connection",fatal:!0})})),this.transport.on("message",(e=>{this.lastMessageReceived=this.device.performance.now(),this.queue.push({type:"append",blob:e.data,time:e.fetchTime}),this.appendBuffer()}))):this.emit("error",{message:d.ERRORS.INVALID_MEDIA_URL,fatal:!0})}switchBitrate(e){var t;this.ctx.logger.debug("meow switching bitrate to ",{name:e}),null===(t=this.transport)||void 0===t||t.switchBitrate(e)}async play(){return new Promise(((e,t)=>{const{el:r}=this;null!=r?(this.queue=[],null==this.transport&&this.setupTransport(),this.lastMessageReceived=this.device.performance.now(),clearInterval(this.logInterval),this.logInterval=i.device.setInterval((()=>{var e;const t=this.device.performance.now()-(null!==(e=this.lastMessageReceived)&&void 0!==e?e:0);t>2e3&&this.emit("error",{message:"stall",timeSinceLastFrag:t})}),1e3),clearInterval(this.gcInterval),this.gcInterval=i.device.setInterval((()=>{if(null!=(null==r?void 0:r.currentTime))for(const e of this.sourceBuffers)this.queue.push({type:"remove",sb:null!=e?e:void 0,start:0,end:r.currentTime-15})}),3e4),this.videoPlayer instanceof h.Mp4WsPlayer?(this.ctx.logger.info("meow player play attempted"),this.videoPlayer.corePlay().then((()=>e())).catch((e=>{this.ctx.logger.warn("meow player play attempt failed",{errName:e.name,errMessage:e.message}),this.stop(),t()}))):r.play().then(e).catch(t)):t(new Error(d.ERRORS.ELEMENT_REQUIRED))}))}stop(){var e;const{el:t}=this;if(null==t)throw new Error(d.ERRORS.ELEMENT_REQUIRED);this.ctx.logger.debug("meow player stop"),clearInterval(this.gcInterval),clearInterval(this.logInterval),null===(e=this.transport)||void 0===e||e.removeAllListeners("message"),this.buffering=!1,t.pause(),""!==t.src&&(this.ctx.logger.debug("meow revoking media source url"),URL.revokeObjectURL(t.src),t.src=""),this.emit("stop")}destroy(){var e;this.destroyed=!0,null!=this.transport&&(this.transport.removeAllListeners("destroy"),this.transport.removeAllListeners("message"),this.transport.destroy()),null===(e=this.abrController)||void 0===e||e.destroy(),this.stop()}}t.MeowPlayer=m,m.displayName="Mp4WsPlayer";const g=["moof","mfhd"];function v(e,t){return String.fromCharCode(e.getUint8(t))}class y{constructor(){this.lastTime=i.device.isImplements(i.Feature.DEBUGGING)?i.device.performance.now():Date.now(),this.lastSegmentTime=i.device.isImplements(i.Feature.DEBUGGING)?i.device.performance.now():Date.now(),this.lastSegmentDuration=0}}class b extends c.ObservableEventEmitter{constructor(e,t,r=0,n=500,o=20,a="B",c=!1,u=300,d=1){if(super(),this.downloadedSegments=[],this.introFrag={},this.channelTracker=0,this.channelLatency=[],this.pingInterval=void 0,this.ctx=e,(0,s.onceCanceled)(e).then((e=>this.dispose(`Transport Class Context Cancelled: ${e}`))),this.addInnerDisposer(this.destroy),!i.device.isImplements(i.Feature.DEBUGGING)||!i.device.isImplements(i.Feature.MEDIA_SOURCE)||!i.device.isImplements(i.Feature.LOCAL_STORAGE))throw new Error("Device is not supported");this.device=i.device,this.uri=t,this.backFill=r,this.maxGap=n,this.retry=o,this.mode=a,this.segmentDuration=u,this.saveToDownload=c,this.introFrag={};const h=`${this.uri}&bckfil=${this.backFill}`;this.ws=new WebSocket(h),l.InstanceCollector.reportNewInstance("websocket",this.ws,{file:"player/mp4-ws.ts"}),this.channelLatency=[];for(let e=0;e{this.ctx.logger.debug("meow ws open")},this.ws.onmessage=e=>{var t;if("object"==typeof e.data)return this.emit("message",{...e,data:e.data,fetchTime:this.device.performance.now()-this.lastTime+10,segmentDuration:null!==(t=this.lastSegmentDuration)&&void 0!==t?t:this.segmentDuration}),this.lastSegmentTime=this.device.performance.now(),this.saveToDownload&&this.downloadedSegments.push(e.data),void this.nextChannel();const r=e.data.split(/\s/g),n=parseInt(r[0],10);if(Number.isNaN(n))try{this.introFrag=JSON.parse(e.data)}catch(t){this.ctx.logger.error("unhandled websocket frame - attempted to parse and failed",{event:e.data})}else this.lastTime=this.device.performance.now(),this.lastSegmentDuration=n<2e3&&n>0?n:this.segmentDuration},this.ws.onclose=e=>{this.ctx.logger.debug("meow ws closing",{reason:e.reason,code:e.code}),l.InstanceCollector.disposeInstance("websocket",this.ws),this.emit("close",{code:e}),this.emit("destroy")},this.ws.onerror=()=>{this.emit("error")},e.logger.attachObject(this),e.logger.trace("constructor()")}get lastTime(){return this.channelLatency[this.channelTracker].lastTime}set lastTime(e){this.channelLatency[this.channelTracker].lastTime=e}get lastSegmentTime(){return this.channelLatency[this.channelTracker].lastSegmentTime}set lastSegmentTime(e){this.channelLatency[this.channelTracker].lastSegmentTime=e}get lastSegmentDuration(){return this.channelLatency[this.channelTracker].lastSegmentDuration}set lastSegmentDuration(e){this.channelLatency[this.channelTracker].lastSegmentDuration=e}get disconnected(){return this.ws.readyState>1}nextChannel(){this.channelTracker++,this.channelLatency.length>=this.channelTracker&&(this.channelTracker=0)}download(){}getSegmentInfo(e){const t=new DataView(e),r=function(e,t){return e.byteLength<9||1936419184!==t.getUint32(e.byteLength-5)?1:t.getUint8(e.byteLength-1)}(e,t);let n=0,i=0,o=0,a=e.byteLength,s=0,l=!1;for("ftyp"==`${v(t,4)}${v(t,5)}${v(t,6)}${v(t,7)}`&&(l=!0),i=0;iMath.min(e,e-(.01*e+Math.log(e*e)/Math.log(2))),resistUpshift:(e,t)=>2.5*t+Math.log(2*t)**3.2>2*e,resistDownshift:(e,t)=>2*e+Math.log(2*e)**3.2>2*t},normal:{key:"normal",bwModifier:e=>Math.min(e,e-(.06*e+Math.log(e*e)/Math.log(2))),resistUpshift:(e,t)=>2.5*t+Math.log(2*t)**3.4>2*e,resistDownshift:(e,t)=>2*e+Math.log(2*e)**3.4>2*t},uncertain:{key:"uncertain",bwModifier:e=>Math.min(e,e-(.3*e+Math.log(e*e)/Math.log(2))),resistUpshift:(e,t)=>2.5*t+Math.log(2*t)**3.6>2*e,resistDownshift:(e,t)=>2*e+Math.log(2*e)**3.4>2*t},sporadic:{key:"sporadic",bwModifier:e=>Math.min(e,e-(.5*e+Math.log(e*e)/Math.log(2))),resistUpshift:(e,t)=>2.5*t+Math.log(2*t)**4>2*e,resistDownshift:(e,t)=>2*e+Math.log(2*e)**3.4>2*t}};class S extends c.ObservableEventEmitter{constructor(e,t,r,a,l,c,u){var d,h,p;if(super(),this.switchThreshold=8e3,this.count=0,this.dropCount=0,this.totalShifts=0,this.rawKbps=[],this.recentKbps=[],this.sampleBws=[],this.selectedEncoding=null,this.emergencyModifier=1,this.releaseEmergencyTimeout=void 0,this.profileInterval=void 0,this.trackRecentKbpsInterval=void 0,this.estimatedKbpsInterval=void 0,this.destroyed=!1,this.spinTimeout=void 0,this.ctx=e,(0,s.onceCanceled)(e).then((e=>this.dispose(`AbrController Class Context Cancelled: ${e}`))),this.addInnerDisposer(this.destroy),!i.device.isImplements(i.Feature.DEBUGGING)||!i.device.isImplements(i.Feature.MEDIA_SOURCE)||!i.device.isImplements(i.Feature.LOCAL_STORAGE))throw new Error("Device is not supported");this.logger=new n.LoggerCore(o.PACKAGE_NAME).extend(e.logger),this.device=i.device,this.options=u,this.player=t,this.driver=r,this.switchImmediately=l,this.profile=null!==(d=_[a])&&void 0!==d?d:_.normal,this.maxShifts=null!=c?c:1/0,this.currentKbps=null!==(h=this.options.bitrate)&&void 0!==h?h:Math.max(null!==(p=this.options.estimatedKbps)&&void 0!==p?p:0,244),this.lastMessageTime=this.device.performance.now(),this.lastSwitch=-8e3,this.init()}init(){this.player.on("fragment",this.onMessage),this.profileInterval=i.device.setInterval(this.profileStream.bind(this),1e4),this.trackRecentKbpsInterval=i.device.setInterval((()=>{let e=0;for(let t=0;t{this.emit("profile",{estimatedKbps:this.currentKbps,profile:this.profile}),null!=this.selectedEncoding?this.logger.debug("meow abr estimated",{KBPS:this.currentKbps,modifier:this.emergencyModifier,lastSwitch:this.lastSwitch,shiftable:this.shiftable,profile:this.profile.key,encoding:this.selectedEncoding}):this.logger.debug("meow abr estimated",{KBPS:this.currentKbps,modifier:this.emergencyModifier,lastSwitch:this.lastSwitch,shiftable:this.shiftable,profile:this.profile.key})}),4e3)}get shiftable(){return this.totalShifts25&&this.device.performance.now()-this.lastSwitch>this.switchThreshold}handleEmergencyDrop(e,t){this.dropCount++,this.dropCount<2||(this.dropCount=0,this.emergencyModifier=e,this.sampleBws.splice(t),i.device.clearTimeout(this.releaseEmergencyTimeout),i.device.setTimeout((()=>{this.emergencyModifier=1}),900))}profileStream(){const e=[];e.push(...this.recentKbps),e.sort(((e,t)=>e>t?1:-1));const t=Math.floor(e.length/4),r=(e[2*t]-e[t])/e[2*t]+(e[3*t]-e[2*t])/e[3*t];this.profile=r>1?_.sporadic:r>.65?_.uncertain:r>.3?_.normal:_.stable}onMessage(e){if(this.destroyed)return;this.lastMessageTime=this.device.performance.now(),e.time>2.5*e.duration?(this.dropCount++,this.handleEmergencyDrop(.6,72)):e.time>2.25*e.duration?this.handleEmergencyDrop(.7,Math.max(24,Math.floor(150))):e.time>2*e.duration?this.handleEmergencyDrop(.8,Math.max(24,Math.floor(210))):e.time>1.75*e.duration?this.handleEmergencyDrop(.9,Math.max(24,Math.floor(240))):this.dropCount=0;const t=this.profile.bwModifier(8*e.size)*this.emergencyModifier/e.time;this.rawKbps.push(8*e.size/e.time),e.time<2&&(e.time=2),e.size<2e3?this.count>0&&(this.count=Math.floor(0)):(this.count++,!Number.isNaN(t)&&this.count>0&&t<4e5&&(this.sampleBws.unshift(t),this.sampleBws.splice(300),this.currentKbps=this.calculateCurrentKbps()),this.shiftable&&this.shiftIfNecessary())}shiftIfNecessary(){var e,t,r,n,o,a,s,l,c,u,d,p;if(!(this.driver instanceof h.Mp4WsPlayer))return;if(null==this.driver.currentLevel||i.device.isSafari)return;const{activeLayer:f}=this.driver,m=this.driver.data.encodings.filter((e=>{var t,r,n;return null==f||(null!==(t=e.videoKbps)&&void 0!==t?t:0)+(null!==(r=e.audioKbps)&&void 0!==r?r:0)<(null!==(n=f.bitrate)&&void 0!==n?n:0)+1e-4})),g=m[this.driver.currentLevel];let v=m[0],y=0;for(let r=0;rg.kbps){for(;this.profile.resistUpshift(this.currentKbps,null!==(s=v.kbps)&&void 0!==s?s:0)&&(null!==(l=v.kbps)&&void 0!==l?l:0)>g.kbps;)if(v=m[--y],null==v||(null!==(c=v.kbps)&&void 0!==c?c:0)g.kbps)return;this.emit("downshift")}g.videoKbps!==v.videoKbps&&(this.logger.debug("meow switching bitrate",{currentEncoding:g,suggestedEncoding:g,currentKbps:this.currentKbps}),this.lastSwitch=this.device.performance.now(),this.selectedEncoding=v,this.switchBitrate(v),this.totalShifts++)}}switchBitrate(e){this.driver instanceof h.Mp4WsPlayer&&(this.emit("meow profile",{estimatedKbps:this.currentKbps,profile:this.profile}),this.driver.setEncoding(e))}calculateCurrentKbps(){let e=0;for(let t=0;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Mp4WsPlayer=void 0;const n=r(27813),i=r(86729),o=r(80165),a=r(98645),s=r(45829),l=r(93503),c=r(63725),u=r(69591),d=r(45820),h=r(50610),p=r(65414),f=["A","B","N"];let m=0;class g extends u.CorePlayer{constructor(e,t,r){var o;if(super(e,t,r),this.data={encodings:[],audioCodec:"",videoCodec:""},this.player=null,this.sessionKey=(0,c.uuidv4)(),this.origin=null,this.currentManifest=null,this.seekingOverHole=!1,this.activeEncoding=null,this.estimatedKbps=null,this.playbackLock=!1,this.nudgeInterval=void 0,this.nudgeTime=null,this.lastBufferEnd=null,this.fragFetchTime=0,!i.device.isImplements(i.Feature.DEBUGGING)||!i.device.isImplements(i.Feature.MEDIA_DEVICE))throw new Error("Device is not supported");(0,l.onceCanceled)(this.ctx).then((e=>this.dispose(`Mp4Ws Player Context Cancelled: ${e}`))),this.addInnerDisposer(this.stop),this.device=i.device;const a=this.options;(null==a.backFill||Number.isNaN(a.backFill)||a.backFill<0||a.backFill>10)&&(a.backFill=2),(null==a.maxGap||Number.isNaN(a.maxGap)||a.maxGap<0||a.maxGap>1e4)&&(a.maxGap=500),(null==a.retry||Number.isNaN(a.retry)||a.retry<0||a.retry>30)&&(a.retry=20),(null==a.requiredBuffer||Number.isNaN(a.requiredBuffer)||a.requiredBuffer<0||a.requiredBuffer>10)&&(a.requiredBuffer=1),(i.device.isEdge||i.device.isIE)&&(a.backFill=Math.max(a.backFill,4),a.requiredBuffer=Math.max(a.requiredBuffer,3)),(null==a.initFailTimeout||Number.isNaN(a.initFailTimeout)||a.initFailTimeout<0)&&(a.initFailTimeout=3e4),(null==a.playbackFailTimeout||Number.isNaN(a.playbackFailTimeout)||a.playbackFailTimeout<0)&&(a.playbackFailTimeout=6e4),null!=a.mode&&f.includes(a.mode)||(a.mode="B"),a.requiredBufferBeforeRemove=a.requiredBuffer,a.skipWatchInterval=Math.floor(400*a.requiredBuffer),a.skipForwardThreshold=25,Number.isNaN(null!==(o=a.maxShifts)&&void 0!==o?o:NaN)&&(a.maxShifts=1/0),this.mse=this.options,this.logger.debug("meow constructor",{mse:a,meowMse:this.mse}),this.on("currentQuality",(e=>{var t;this.setQuality(e),null===(t=this.player)||void 0===t||t.setupTransport()})),(0,n.autorun)((e=>{const t=this.elementSupervisor,r=this.provider.source;null!=t&&null!=r&&(e.dispose(),this.handleSource(r),this.initSource(t))}))}static get format(){return"mp4-ws"}get format(){return g.format}get currentLevel(){var e,t,r,n,i;return null!=this.options.bitrate?this.getLevelForBitrate(this.options.bitrate):null==this.activeEncoding?this.getLevelForBitrate(null!==(e=this.options.estimatedKbps)&&void 0!==e?e:0):this.getLevelForBitrate((null!==(r=null===(t=this.activeEncoding)||void 0===t?void 0:t.videoKbps)&&void 0!==r?r:0)+(null!==(i=null===(n=this.activeEncoding)||void 0===n?void 0:n.audioKbps)&&void 0!==i?i:0))}get originLocation(){const e=this.origin;return null==e?null:this.addSessionKey(e.location)}get manifest(){var e,t;let r;if(this.options.origin){if(r=this.originLocation,null==r)return this.options.origin=!1,this.manifest}else{if(0===this.data.encodings.length){const e=this.originLocation;return null!=e&&(this.options.origin=!0),e}const n=this.pickEncoding(null!==(t=null!==(e=this.options.bitrate)&&void 0!==e?e:this.estimatedKbps)&&void 0!==t?t:this.options.estimatedKbps);if(null==n)return null;r=n.location}return null==r?null:this.addSessionKey(r)}get location(){return null==this.player?null:this.player.manifest}set location(e){}get implementedFeatures(){return[o.Feature.BITRATE_SWITCHING,o.Feature.MUTED_AUTOPLAY]}static async isSupported(e){return(0,s.supportsMp4)(e)}async isSupported(){return g.isSupported()}handleElTimeupdate(){var e;super.handleElTimeupdate();const t=this.elementSupervisor,r=null===(e=this.elementSupervisor)||void 0===e?void 0:e.buffered;null!=t&&null!=r&&0!==r.length&&(r.end(r.length-1)-t.currentTime>this.mse.requiredBuffer?i.device.isSafari?t.playbackRate=1.01:t.playbackRate=1.05:t.playbackRate=1)}handleElError(){var e,t,r;super.handleElError();const n=null===(t=null===(e=this.elementSupervisor)||void 0===e?void 0:e.error)||void 0===t?void 0:t.code;if(null!=n)switch(n){case 1:this.emitErrorDeprecated(new a.MediaError("MEDIA_ERR_ABORTED",{critical:!0,eventTargetCode:n}));break;case 2:this.emitErrorDeprecated(new a.MediaError("MEDIA_ERR_NETWORK",{critical:!0,eventTargetCode:n}));break;case 3:this.emitErrorDeprecated(new a.DriverNotSupportedError("MEDIA_ERR_DECODE",{critical:!0,eventTargetCode:n}));break;case 4:this.emitErrorDeprecated(new a.DriverNotSupportedError("MEDIA_ERR_SRC_NOT_SUPPORTED",{critical:!0,eventTargetCode:n}));break;default:(null===(r=this.elementSupervisor)||void 0===r?void 0:r.isSourceSet())||this.ctx.logger.error("meow unknown element error",{manifest:this.manifest}),this.localVideoPaused||this.isDisposed||this.restart(!1)}}handleElPause(){super.handleElPause(),"offline"===this.provider.currentState&&this.stop()}getLevelForBitrate(e){var t,r;const{encodings:n}=this.data;if(0===n.length)return null;let i;for(i=0;ie)break}return i=Math.max(i-1,0),i}pickEncoding(e){var t;const r=null!=e?e:this.options.bitrate;let{encodings:n}=this.data;if(0===n.length)return null;if(null==r)return n[0];n=n.sort(((e,t)=>{var r,n,i,o;return(null!==(r=e.audioKbps)&&void 0!==r?r:0)+(null!==(n=e.videoKbps)&&void 0!==n?n:0)<(null!==(i=t.audioKbps)&&void 0!==i?i:0)+(null!==(o=t.videoKbps)&&void 0!==o?o:0)?1:-1}));const i=n.find((e=>{var t,n;return(null!==(t=e.audioKbps)&&void 0!==t?t:0)+(null!==(n=e.videoKbps)&&void 0!==n?n:0)<=r}));return null!=i?i:n[null!==(t=this.currentLevel)&&void 0!==t?t:0]}setQuality(e){null!=(null==e?void 0:e.encoding)?this.setEncoding(e.encoding):this.ctx.logger.warn("encoding not found",{qty:e})}setEncoding(e){var t,r,n,o,s;if(null==e||(null===(t=this.activeEncoding)||void 0===t?void 0:t.videoKbps)===e.videoKbps&&(null===(r=this.activeEncoding)||void 0===r?void 0:r.audioKbps)===e.audioKbps)return;if(this.activeEncoding=e,this.estimatedKbps=(null!==(n=e.videoKbps)&&void 0!==n?n:0)+(null!==(o=e.audioKbps)&&void 0!==o?o:0),(0,p.safariLessThan14)(i.device)){this.stop();try{this.play().then((()=>{this.emit("bitrate-switch")}))}catch(e){const t=e instanceof Error?e:null;this.emitErrorDeprecated(new a.PlayingIssueError("play failed after setEncoding()",{inner:t,player:this}))}return}const l=e.location.split("/");null===(s=this.player)||void 0===s||s.switchBitrate(l[l.length-1]),this.emit("bitrate-switch")}switchBitrate(e){this.ctx.logger.debug("meow switch bitrate",{bitrate:e}),this.options.origin=!1,this.options.bitrate=e,this.emit("bitrate-switch"),this.stop();try{this.play().then((()=>{this.emit("bitrate-switch")}))}catch(e){const t=e instanceof Error?e:null;this.emitErrorDeprecated(new a.PlayingIssueError("play failed after switchBitrate()",{inner:t,player:this}))}}addSessionKey(e){if(e.includes("sid"))return e;m++;const t=e.includes("?")?"&":"?";return`${e}${t}sid=${this.sessionKey}&c=${m}`}pause(){this.stop()}stop(){this.playbackLock=!1,clearInterval(this.nudgeInterval),null!=this.player&&this.player.once("disposed",(()=>{this.player=null}))}async corePlay(){return super.play(!0)}async play(){const e=this.elementSupervisor;if(null==e)throw new Error(d.ERRORS.ELEMENT_REQUIRED);return this.playbackLock?!e.paused:(this.playbackLock=!0,this.options.autoPlay&&this.localVideoPaused&&setTimeout((()=>{this.localVideoPaused=!1})),null!=this.player?this.player.play().then((()=>!e.paused)):(this.ctx.logger.debug("meow driver play received"),!this.localVideoPaused))}handleSource(e){this.ctx.logger.debug("mp4-ws: handleSource()");const t=null==e?void 0:e.formats["mp4-ws"];null!=t?0===this.data.encodings.length&&(this.data=t):this.emitErrorDeprecated(new a.DriverNotSupportedError("manifest doesn't contains 'mp4-hls' format",{manifest:e}))}initSource(e){if(null!=this.player)return;clearInterval(this.nudgeInterval),this.nudgeTime=null;let t=0;this.nudgeInterval=i.device.setInterval((()=>{if(!this.localVideoPaused&&0!==e.currentTime){if(null!=this.nudgeTime&&e.currentTime===this.nudgeTime&&(null==this.lastBufferEnd||e.currentTime{}))}else t=0,this.nudgeTime=e.currentTime;t>29&&(clearInterval(this.nudgeInterval),this.ctx.logger.debug("meow too many halt nudges, restart"),this.restart(!1))}}),500);const r=this.provider.source;if(null!=r&&setTimeout((()=>{var e;null===(e=this.provider)||void 0===e||e.emit("source",r)})),this.ctx.logger.debug("meow manifest verified, player created"),null==this.elementSupervisor)throw new Error(d.ERRORS.ELEMENT_REQUIRED);if(this.player=new h.MeowPlayer(this.ctx,this,this.options,Reflect.get(this.elementSupervisor,"element")),this.counters.upshift=0,this.counters.downshift=0,this.counters.currentErrorCount=0,this.counters.fragCounts=0,this.counters.fragSize=0,this.counters.fragFetchTime=0,this.counters.fragMaxTime=0,this.counters.fragMinTime=0,this.player.on("stop",(()=>{this.stop()})),this.player.on("no-audio",(()=>{this.emit("no-audio")})),this.player.on("upshift",(()=>{this.counters.upshift++})),this.player.on("downshift",(()=>{this.counters.downshift++})),this.player.on("fragment",(e=>{var t;this.counters.fragCounts++,this.counters.fragSize+=e.size,this.counters.fragFetchTime+=e.time,this.counters.fragMaxTime=Math.max(this.counters.fragMaxTime,e.time),this.counters.fragMinTime=Math.min(null!==(t=this.counters.fragMinTime)&&void 0!==t?t:e.time,e.time)})),this.player.on("error",(e=>{this.counters.currentErrorCount++,e.notSupported?this.emitErrorDeprecated(new a.DriverNotSupportedError("player error",{data:{fatal:e.fatal,message:e.message,notSupported:e.notSupported,err:(0,a.wrapNativeError)(e.err)}})):e.fatal&&(this.ctx.logger.debug("meow player fatal error, restarting"),this.restart(!1))})),this.device.hidden)this.device.addEventListener("visibilitychange",(()=>{var e;try{null===(e=this.player)||void 0===e||e.play()}catch(e){const t=e instanceof Error?e:null;this.emitErrorDeprecated(new a.PlayingIssueError("play failed after visibilitychange event triggered",{inner:t,player:this}))}}));else try{this.pausedOnUnmount||this.player.play()}catch(e){const t=e instanceof Error?e:null;this.emitErrorDeprecated(new a.PlayingIssueError("play failed",{inner:t,player:this}))}}}t.Mp4WsPlayer=g,g.displayName="Mp4WsPlayer"},56255:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NativeHlsPlayer=void 0;const n=r(86729),i=r(80165),o=r(98645),a=r(75477),s=r(69591);class l extends s.CorePlayer{constructor(e,t,r){super(e,t,r),this.srcReset=!1,this.manifestJson=null,this.on("currentQuality",this.handleCurrentQuality),this.addInnerDisposer((()=>{this.off("currentQuality",this.handleCurrentQuality)}))}handleCurrentQuality(){this.srcReset=!1,this.handleSource(this.manifestJson)}static async isSupported(e){return(0,a.supportsNativeHls)(e)}async isSupported(){return l.isSupported()}static get format(){return"mp4-hls"}get format(){return l.format}async handleSource(e){var t,r,i,a,s;if(this.suspended)return;this.ctx.logger.debug("native-hls: handleSource()");const l=null==e?void 0:e.formats["mp4-hls"];if(null!=l){if(null!=e&&(this.manifestJson=e),null!=(null===(r=null===(t=this.currentQuality)||void 0===t?void 0:t.layer)||void 0===r?void 0:r.id)&&""!==this.currentQuality.layer.id?this.source=this.currentQuality.layer.id.toString():null!=(null===(i=null==l?void 0:l.substitute)||void 0===i?void 0:i.location)?this.source=l.substitute.location:this.source=l.manifest,n.device.isImplements(n.Feature.URL_LOCATION)&&null!=this.elementSupervisor&&"src"!==this.elementSupervisor.sourceKind&&(this.srcReset=!0),null!=this.elementSupervisor&&"src"!==this.elementSupervisor.sourceKind||null!=this.elementSupervisor&&!this.srcReset){const e=this.elementSupervisor.currentTime;if(this.srcReset=!0,null===(a=this.elementSupervisor)||void 0===a||a.updateSrc(this.source),"recorded"===(null===(s=this.manifestJson)||void 0===s?void 0:s.type)&&e>0&&(this.elementSupervisor.currentTime=e),!this.internalPaused||this.options.autoPlay&&!this.internalPaused)try{await this.play(!0)}catch(e){const t=e instanceof Error?e:null;this.emitErrorDeprecated(new o.PlayingIssueError("autoplay call failed after handleSource()",{inner:t,player:this}))}}}else this.emitErrorDeprecated(new o.DriverNotSupportedError("manifest doesn't contains 'mp4-hls' format",{manifest:e,loader:this.provider}))}async attachTo(e){if(await super.attachTo(e),this.options.autoPlay)try{await this.play(!0)}catch(e){const t=e instanceof Error?e:null;this.emitErrorDeprecated(new o.PlayingIssueError("autoplay call failed after attachTo()",{inner:t,player:this}))}}get implementedFeatures(){return[i.Feature.BITRATE_SWITCHING,i.Feature.MUTED_AUTOPLAY]}}t.NativeHlsPlayer=l,l.displayName="NativeHlsPlayer"},98469:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WebrtcPlayer=void 0;const n=r(27813),i=r(80769),o=r(86729),a=r(51327),s=r(80165),l=r(92491),c=r(98645),u=r(54873),d=r(75477),h=r(93503),p=r(45831),f=r(80366),m=r(93937),g=r(54244),v=r(18409),y=r(69591),b=r(45820),_=r(46693);class S extends p.ObservableEventEmitter{attachTo(e){this.hostEl=(0,b.attachVideoElement)(e)}setPreferredLevel(e){this.preferredLevel=e}get canBroadcast(){return null!=this.call}get callBroadcast(){return this.call}get currentPlayer(){return this[m.implementation]}set currentPlayer(e){this[m.implementation]=e}get logger(){return this.ctx.logger}static async isSupported(e){return(0,d.supportsMediasoupWebrtc)("Webrtc",e)}isImplements(e){switch(e){case s.Feature.MUTED_AUTOPLAY:case s.Feature.CONSUMER:case s.Feature.BROADCAST:case s.Feature.BITRATE_SWITCHING:return!0;default:return!1}}static get format(){return"webrtc"}get format(){return S.format}constructor(e,t,r){super(!1),this.driverFailover=!1,this.blurred=!1,this.isConnecting=!1,this.isConnected=!1,this.call=null,this.manifestJson=null,this.videoEl=null,this.callStreamName=null,this.callId=null,this.isJoiningCall=!1,this.sfuConnectionLoadId=0,this.videoConsumerLoadId=0,this.firstTimeUpdateLoadId=0,this.joinCallEndpointLoadId=g.stats.start(g.STATS_EVENTS.JOIN_CALL_ENDPOINT),this.ctx=e,this.mediaLoader=t,this.options=r,this.autoPlay=null==r.autoPlay||r.autoPlay,(0,n.makeObservable)(this,{isConnected:n.observable,isConnecting:n.observable}),(0,h.onceCanceled)(e).then((e=>this.dispose(`WebrtcPlayer Context Cancelled: ${e}`)));const i=(0,u.makeBounded)(new Proxy(this,y.proxyHandler));return i.init(),e.logger.attachObject(i),e.logger.trace("constructor()",{}),i}init(){this.mediaLoader.on("source",this.handleSource),this.addInnerDisposer((e=>{this.mediaLoader.off("source",this.handleSource)})),null!=this.mediaLoader.source&&this.handleSource(this.mediaLoader.source)}async handleSource(e){if(!this.suspended)if(this.ctx.logger.debug("webrtc: handleSource()"),this.manifestJson=e,null==e)this.stopCall();else{const{webrtc:t}=e.formats;if(null==t)return void this.emitErrorDeprecated(new c.NotSupportedError("manifest doesn't contains webrtc format",{}));this.isJoiningCall&&this.callId===t.origin.callId&&this.callStreamName===t.origin.streamNames[0]||(this.isJoiningCall=!0,this.callId=t.origin.callId,this.callStreamName=t.origin.streamNames[0],this.stopCall(),await this.joinCall(this.callId,t.origin.streamNames[0],t.origin.token,{rsrc:t.origin.rsrc,xkey:t.origin.publicKey,bpeerId:t.origin.peerId,joinUrl:t.origin.location}))}}stopCall(){var e;null!=this.call&&(null===(e=this.call)||void 0===e||e.removeAllListeners("playerAdded"),this.call=null)}get sfuJoinParams(){var e,t;const{webrtc:r}=null!==(t=null===(e=this.manifestJson)||void 0===e?void 0:e.formats)&&void 0!==t?t:{};return null==(null==r?void 0:r.origin.uri)?null:{call:{id:r.origin.callId,sfu:{uri:r.origin.uri,httpUri:r.origin.httpUri,region:r.origin.region,version:r.origin.version},turn:r.origin.turn,support:"ovh"},user:{userId:r.origin.token,scope:"viewer",displayName:"",authorizeToken:r.origin.token}}}async joinCall(e,t,r,n){var o,a,s,c,u;const d={driver:this.format,abr:null===(o=this.manifestJson)||void 0===o?void 0:o.abr,aor:null===(a=this.manifestJson)||void 0===a?void 0:a.aor,atr:null===(s=this.manifestJson)||void 0===s?void 0:s.atr,rep:null===(c=this.manifestJson)||void 0===c?void 0:c.rep},h={token:r,onCallJoinEndpoint:()=>{this.emit("joinCallEndpoint",g.stats.stop(this.joinCallEndpointLoadId,d)),this.sfuConnectionLoadId=g.stats.start(g.STATS_EVENTS.SFU_CONNECTION)},onSFUConnection:()=>{this.emit("sfuConnection",g.stats.stop(this.sfuConnectionLoadId,d)),this.videoConsumerLoadId=g.stats.start(g.STATS_EVENTS.VIDEO_CONSUMER)},playerOptions:this.options};try{this.call=await this.ctx.videoClient.internalJoinCall(e,this.sfuJoinParams,{...n,...h},(0,f.extendContext)(this.ctx,v.VideoClient)),this.emit("joinedCall",{call:this.call}),this.call.once("videoConsumer",(()=>{this.emit("videoConsumer",g.stats.stop(this.videoConsumerLoadId,d)),this.firstTimeUpdateLoadId=g.stats.start(g.STATS_EVENTS.FIRST_TIME_UPDATE)})),this.call.on("playerAdded",(e=>{this.ctx.logger.debug("got a player",{ev:e}),t===e.streamName&&(this.ctx.logger.debug("set currentPlayer",{old:this.currentPlayer}),e.player instanceof _.MediasoupPlayer&&(e.player.isManifestPlayer=!0),this.currentPlayer=e.player,this.currentPlayer.once("videoFirstPlay",(()=>{this.emit("firstTimeUpdate",g.stats.stop(this.firstTimeUpdateLoadId,d))})))})),this.call.on("peerAtCapacity",(e=>{this.emit("peerAtCapacity",e)})),this.call.on("callEnded",(()=>{this.emit("callEnded")})),this.call.on("isConnected",(e=>{this.isConnected=e})),this.call.on("isConnecting",(e=>{this.isConnecting=e})),this.call.on("playerRemoved",(e=>{var r;t===e.streamName&&(null===(r=this.currentPlayer)||void 0===r||r.dispose("peer player removed due to call.on('playerRemoved') event"))})),this.call.on("websocketReconnect",(()=>{this.emit("websocketReconnect")})),this.call.on("error",(e=>{this.emitErrorDeprecated(e)}))}catch(e){this.emit("error",null!==(u=(0,l.wrapError)(e))&&void 0!==u?u:(0,l.createError)(i.ErrorCode.CallError,"unknown error",{}))}}updatePosterWithLatestFrame(){null!=this.hostEl&&o.device.isImplements(a.Feature.CREATE_SCREENSHOT)?this.poster=o.device.createScreenshot(this.hostEl):this.ctx.logger.warn("Unable to set update poster. Create screenshot is not compatible with device.")}replaceManifestUrl(e){throw(0,l.createError)(i.ErrorCode.NotSupported)}toJSON(){var e,t;return null!==(t=null===(e=this.currentPlayer)||void 0===e?void 0:e.toJSON())&&void 0!==t?t:{}}}t.WebrtcPlayer=S,S.displayName="WebrtcPlayer"},98755:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Call=void 0;const n=r(31635),i=r(50543),o=r(70076),a=n.__importDefault(r(18638)),s=r(80769),l=r(86729),c=r(92491),u=r(98645),d=r(93503),h=r(80366),p=n.__importDefault(r(45799)),f=r(43414),m=r(65136),g=r(70431),v=n.__importDefault(r(1011)),y=n.__importStar(r(18741)),b=r(59703),_=n.__importDefault(r(28441)),S=r(7333),w=r(54873),E=()=>{var e,t,r,n,i,o;const a=l.device.isMobileDevice?"mobile":"desktop";return l.device.isImplements(l.Feature.USER_AGENT_DATA)&&null!=(null===(e=l.device.highEntropyValues)||void 0===e?void 0:e.brands)?[(null!==(n=null===(r=null===(t=l.device.highEntropyValues)||void 0===t?void 0:t.brands.map((e=>e.brand)))||void 0===r?void 0:r.join("_"))&&void 0!==n?n:"browser-name-not-available").replace(/[\W]+/g,""),l.device.platform,a].join("-"):[null!==(i=l.device.browserInfo.browserName)&&void 0!==i?i:"brand-not-available",null!==(o=l.device.platform)&&void 0!==o?o:"platform-not-available",a].join("-")};class C extends i.EventEmitter{emit(e,...t){return super.emit(e,...t)}get peer(){return this._peer}get _iceServers(){return this.__iceServers}get _edgeIceServers(){return this.__edgeIceServers}get _iceTransportPolicy(){return this.__iceTransportPolicy}get maxBitrate(){return this._maxBitrate}get _requireRecv(){return this.__requireRecv}get _requireSend(){return this.__requireSend}get _closed(){return this.__closed}get streams(){return this._streams}get permissions(){return this._permissions}get peerId(){return this._localPeerId}get behaviours(){return this._behaviours}userShould(e){return!!this.hasPermission(e)&&this._behaviours.includes(e)}constructor(e,t,r,n={}){var i,o,a,s;super(),this.setPreferredEncodingProcessing=!1,this.callResolve=Promise.resolve,this.callReject=Promise.reject,this._startPromise=null,this._iceTransportPolicyUsed=null,this.isDisposed=!1,(0,w.makeBounded)(this),this.ctx=e,(0,d.onceCanceled)(e).then((e=>this.dispose(`VideoClient Context Cancelled: ${e}`))),e.logger.trace("constructor()",{options:n});const{maxProducingViewers:c,auth:u}=n;if(this.options={call:{maxProducingViewers:c},auth:u},this.gwTransport=new S.GwTransport(e),this.gwTransport.options({maxRetries:null!==(i=n.retries)&&void 0!==i?i:1/0}),this.gwTransport.on("message:prepare-rejoin-call",this.onMessagePrepareRejoinCall),this.gwTransport.on("message:call-ended",this.onMessageCallEnded),this.gwTransport.on("message:callEnded",this.onMessageCallEnded),this.gwTransport.on("message:callError",this.onMessageCallError),this.gwTransport.on("message:disconnect",this.onMessageDisconnect),this.gwTransport.on("message:need-user",this.onMessageNeedUser),this.gwTransport.on("message:join-refresh",this.onMessageJoinRefresh),this.gwTransport.on("message:join-call-error",this.onMessageJoinCallError),this.gwTransport.on("message:call-rejected",this.onMessageCallRejected),this.gwTransport.on("message:callRejected",this.onMessageCallRejected),this.gwTransport.on("message:Forbidden",this.onMessageForbidden),this.gwTransport.on("message:call-refresh",this.onMessageCallRefresh),this.gwTransport.on("message:peerAtCapacity",this.onMessagePeerAtCapacity),this.gwTransport.on("message:producersKicked",this.onMessageProducersKicked),this.gwTransport.on("message:dominantSpeaker",this.onMessageDominantSpeaker),this.gwTransport.on("message:consumer-stats",this.onMessageConsumerStats),this.gwTransport.on("message:producer-stats",this.onMessageProducerStats),this.gwTransport.on("message:permissions",this.onMessagePermissions),this.gwTransport.on("message:options",this.onMessageOptions),this.gwTransport.on("message:ready",this.onMessageReady),this._maxBitrate=n.maxBitrate,this._messages=new m.MessageList,this._handleOffline=()=>{this.emit("CALL_EMIT_MESSAGES",{messages:m.offlineMessages.messages})},this._handleOnline=()=>{this.emit("CALL_EMIT_MESSAGES",{messages:m.offlineMessages.messages})},l.device.addEventListener("offline",this._handleOffline),l.device.addEventListener("online",this._handleOnline),null==t.call)throw new Error("join.call is undefined");this.call=t.call,this._userOverrides=n.user,this.user={...t.user,...this._userOverrides},this._stunServers=null!==(s=null===(a=null===(o=this.call.stun)||void 0===o?void 0:o.servers)||void 0===a?void 0:a.map((e=>`stun:${e}`)))&&void 0!==s?s:[],this._stunIndex=5,this.__iceServers=()=>{var e,t,r,n;if(0===this._stunIndex||0===this._stunServers.length)return(null===(t=null===(e=this.call.turn)||void 0===e?void 0:e.servers)||void 0===t?void 0:t.length)>0?this.call.turn.servers:[];const i=[{urls:this._stunServers.slice(this._stunIndex-5,this._stunIndex)}];return(null===(n=null===(r=this.call.turn)||void 0===r?void 0:r.servers)||void 0===n?void 0:n.length)>0?this.call.turn.servers.concat(i):i},this.__edgeIceServers=()=>{var e,t;const r=[];return(null===(t=null===(e=this.call.turn)||void 0===e?void 0:e.servers)||void 0===t?void 0:t.length)>0&&this.call.turn.servers.forEach((e=>{if(Array.isArray(e.urls)){const t=e.urls.filter((e=>e.startsWith("turn:")));(null==t?void 0:t.length)>0&&r.push({...e,urls:t.map((e=>{var t;return null!==(t=e.split("?")[0])&&void 0!==t?t:""}))})}})),r},this._joinCall=r,this._localPeerId=null,this.__iceTransportPolicy=n.iceTransportPolicy,this.__requireRecv=!0===n.requireRecv,this.__requireSend=!0===n.requireSend,this._flushLogs=!n.test,this._iceTransportPolicyUsed=null,this._ip=null,this._permissions=[],this._behaviours=[],this._initialRun=!0,this.__closed=!1,this._startResolve=null,this._startPromise=null,this._serverOptions=null,this._stableTimeout=void 0,this._stable=null,this._streams={};const{streams:h}=n;null!=h&&Object.keys(h).length>0?Object.keys(h).forEach((e=>{const t=h[e];this.setStream(e,t)})):this.ctx.logger.debug("Setting stream failed, there are no defined streams",{streams:h}),this.setLogData()}get transport(){return this.gwTransport}networkCheck(e){var t,r,n,i,o,a,s,l,c;null!=this._stable&&"video"===e.mediaType&&(null!==(n=null===(r=null===(t=this._serverOptions)||void 0===t?void 0:t.call)||void 0===r?void 0:r.defaultMinBitrate)&&void 0!==n?n:0)>0&&((null!==(i=e.consumerBitrate)&&void 0!==i?i:0)<(null!==(s=null===(a=null===(o=this._serverOptions)||void 0===o?void 0:o.call)||void 0===a?void 0:a.defaultMinBitrate)&&void 0!==s?s:0)?0===this._stable.consumerBitrate?this._stable.consumerBitrate=Date.now():Date.now()>(null!==(c=null===(l=this._stable)||void 0===l?void 0:l.consumerBitrate)&&void 0!==c?c:0)+1e3&&this._addMessage(m.TROUBLESHOOTING.UNSTABLE_NETWORK):delete this._stable.consumerBitrate)}onMessagePrepareRejoinCall(){for(const e of this.streamsIterator())e.close(!1)}onMessageCallEnded(){this.close("call already ended on websocket",!0).catch(this.ctx.logger.error),this.callResolve(),this.ctx.logger.info("calls-core/call: end"),this.emit("CALL_ENDED")}onMessageCallError(e){var t,r;this.callReject(new u.CallError(null!==(t=e.errorMessage)&&void 0!==t?t:"Unknown call error",{reason:e.reason})),"sfu-busy"===e.reason&&this.emit("error",(0,c.createError)(s.ErrorCode.SFUBusy,null!==(r=e.errorMessage)&&void 0!==r?r:"unknown reason",{})),this.close("call error on websocket",!0,!0).catch(this.ctx.logger.error)}onMessageDisconnect(){this.emit("CALL_CONNECTING",!1)}onMessageNeedUser(){this.gwTransport.send("user",this.user)}onMessageJoinRefresh(e){null!=e.body.call?(this.user={...e.body.user,...this._userOverrides},this.call=e.body.call):this.ctx.logger.error("response.body.call is undefined")}onMessageJoinCallError(e){const t=e.error instanceof Error?e.error:null,r=new u.JoinCallError("WS: Join Call Error",{inner:t});this.emit("error",r),this.callReject(r)}onMessageCallRejected(){this.ctx.logger.info("call rejected");const e=new u.CallError("WS: Call Rejected",{reason:"rejected"});this.emit("error",e),this.callReject(e),this.close("call was rejected by websocket",!0).catch(this.ctx.logger.error)}onMessageForbidden(){this.ctx.logger.info("call ended - kicked"),this.emit("CALL_FORBIDDEN"),this.close("call ended - kicked (Forbidden)",!0)}onMessageCallRefresh(e){this.call=e}onMessagePeerAtCapacity(e){const t=Object.keys(e);this.emit("CALL_PEER_AT_CAPACITY",e[t[0]])}onMessageProducersKicked(){this.ctx.logger.info("Call ended - producers kicked"),this.emit("CALL_PRODUCER_KICKED")}onMessageDominantSpeaker(e){this.ctx.logger.debug("websocket transport dominantSpeaker",{dominantSpeaker:e}),this.emit("CALL_DOMINANT_SPEAKER",{userId:e.userId,displayName:e.displayName,peerId:e.peerId,streamName:e.streamName,producerId:e.producerId})}onMessageConsumerStats(e){this.networkCheck(e),this.emit("CALL_SET_CONSUMER_STATS",{peerId:e.peerId,streamName:e.streamName,consumerId:e.id,stats:e})}onMessageProducerStats(e){this.networkCheck(e),this.emit("CALL_SET_PRODUCER_STATS",{streamName:e.streamName,producerId:e.id,stats:e})}onMessagePermissions(e){this._permissions=e.permissions,this.emit("CALL_PERMISSIONS",{permissions:e.permissions})}onMessageOptions(e){this.ctx.logger.debug("websocket transport options",{options:e}),this._serverOptions=e,this.emit("CALL_OPTIONS",{options:e})}onMessageReady(e){var t,r,n,i,o,a;if(this.emit("CALL_SFU_CONNECTION"),this.__closed)return this.ctx.logger.debug("call: ready event fired after call was closed"),void this.gwTransport.finish();this.ctx.logger.info("websocket transport ready",{readyData:e}),this._ip=e.ip,this._localPeerId=e.peerId,this.ctx.logger.setMessageAggregate("peerId",this._localPeerId),(null===(t=e.permissions)||void 0===t?void 0:t.length)>0&&(this._permissions=e.permissions,this.emit("CALL_PERMISSIONS",{permissions:e.permissions})),(null===(r=e.behaviours)||void 0===r?void 0:r.length)>0&&(this._behaviours=e.behaviours),"v3"===e.version&&null!=this.user&&(this.user.scope=e.scope,null!=e.userId&&(this.user.userId=e.userId),null!=e.displayName&&(this.user.displayName=e.displayName),this.clearLogData(),this.setLogData()),this.emit("CALL_ROOM_DATA",{scope:null!==(i=null===(n=this.user)||void 0===n?void 0:n.scope)&&void 0!==i?i:"",peerId:e.peerId});const s=this._closed||(null===(o=this._peer)||void 0===o?void 0:o._closed);this._request("options",this.options).catch((e=>{var t;const r=this._closed||(null===(t=this._peer)||void 0===t?void 0:t._closed);if(s||!r){const t=e instanceof Error?e:null;this.emit("error",new u.WSRequestError("ws request error",{inner:t,request:"options",args:this.options,internalCall:this}))}})),null===(a=this._peer)||void 0===a||a.dispose("Create a new peer after ws reconnection"),this._peer=new g.Peer((0,h.extendContext)(this.ctx,g.Peer),this),this._peer.on("error",(e=>{e.critical?(this.ctx.logger.error(`Peer error: ${e.code}; ${e.message}`,{err:e,call:this}),this.close("peer error",!0),this.callReject(e)):this.ctx.logger.warn(`Peer error: ${e.code}; ${e.message}`,{err:e,call:this})})),this._peer._setup(e.rtpCapabilities).then((()=>{this.ctx.logger.debug("websocket ready",{rtpCapabilities:e.rtpCapabilities}),this.emit("CALL_READY")}))}dispose(e){this.close(`disposed: ${e}`),this.isDisposed=!0}hasPermission(e){var t;return null===(t=this._permissions)||void 0===t?void 0:t.includes(e)}get streamNames(){return Object.keys(this._streams)}setStream(e,t){this._streams[e]=new v.default((0,h.extendContext)(this.ctx,v.default),e,this,t)}getStream(e){return this._streams[e]}removeStream(e){delete this._streams[e]}forEachStream(e){null!=this._streams&&Object.keys(this._streams).length>0?Object.keys(this._streams).forEach((t=>{e(this._streams[t],t)})):this.ctx.logger.debug("Stream close() failed, there are no defined streams to close",{streams:this._streams})}*streamsIterator(){for(const e of Object.keys(this._streams))yield this._streams[e]}setLogData(){var e;this.ctx.logger.setMessageAggregate("callId",this.call.id),this.ctx.logger.setMessageAggregate("userId",this.user.userId),this.ctx.logger.setMessageAggregate("scope",null!==(e=this.user.scope)&&void 0!==e?e:"no scope"),this.ctx.logger.setMessageAggregate("displayName",this.user.displayName)}clearLogData(){this.ctx.logger.removeMessageAggregate("callId"),this.ctx.logger.removeMessageAggregate("peerId"),this.ctx.logger.removeMessageAggregate("userId"),this.ctx.logger.removeMessageAggregate("scope"),this.ctx.logger.removeMessageAggregate("displayName"),this.ctx.logger.removeMessageAggregate("recvTransportId"),this.ctx.logger.removeMessageAggregate("recvTransportState"),this.ctx.logger.removeMessageAggregate("sendTransportId"),this.ctx.logger.removeMessageAggregate("sendTransportState")}_addMessage(e){this._messages.addMessage(e),this.emit("CALL_EMIT_MESSAGES",{messages:m.offlineMessages.messages})}_removeMessage(e){this._messages.removeMessage(e),this.emit("CALL_EMIT_MESSAGES",{messages:m.offlineMessages.messages})}get messages(){return this._messages.messages}async close(e="Implementer did not pass debugString",t=!1,r=!1){return this.__closed?null:(this.ctx.logger.info("Call Class, call closed()",{aggregates:{internal:t,reason:e}}),this._flushLogs&&this.ctx.logger.flush(),null!=this._peer&&await this._peer.close(e),l.device.removeEventListener("offline",this._handleOffline),l.device.removeEventListener("online",this._handleOnline),this.__closed=!0,this.forEachStream((e=>e.close())),l.device.clearTimeout(this._stableTimeout),this._stable=null,this._cleanup(r),Promise.resolve())}_cleanup(e=!1){e||null==this._startResolve||this._startResolve(),this.gwTransport.finish(),this.emit("CALL_SET_ROOM_DONE"),this.clearLogData()}async updateMaxBitrate(e){const t={bitrate:e};try{await this._request("updateMaxBitrate",t),this._maxBitrate=e}catch(e){const r=e instanceof Error?e:null;this.emit("error",new u.WSRequestError("ws request error",{inner:r,request:"updateMaxBitrate",args:t,internalCall:this}))}}setDisplayName(e){this.ctx.logger.info("updating displayName",{displayName:e}),this.user.displayName=e,this.gwTransport.send("options",{peer:{displayName:e}})}setMaxProducingViewers(e){this.ctx.logger.info("updating maxProducingViewers",{maxProducingViewers:e}),this.gwTransport.send("options",{call:{maxProducingViewers:e}})}getViewers(){throw new Error("getViewers is deprecated")}async promoteViewer(e,t,r=!1){var n;if(!this.hasPermission(f.PERMISSIONS.CHANGE_PEER_SCOPE))throw this.ctx.logger.warn("viewer does not have permission to promote other viewers"),new Error("no admin change scope permissions");let i;const o={userId:e,permissions:t,webhook:r};try{i=await this._request("promote",o)}catch(e){const t=e instanceof Error?e:null;return void this.emit("error",new u.WSRequestError("ws request error",{inner:t,request:"promote",args:o,internalCall:this}))}this.emit("CALL_VIEWERS",{viewers:null!==(n=i.viewers)&&void 0!==n?n:[]})}async demoteViewer(e,t,r=!1){var n;if(!this.hasPermission(f.PERMISSIONS.CHANGE_PEER_SCOPE))throw this.ctx.logger.warn("viewer does not have permission to demote other viewers"),new Error("no admin change scope permissions");let i;const o={userId:e,webhook:r,permissions:t};try{i=await this._request("demote",o)}catch(e){const t=e instanceof Error?e:null;return void this.emit("error",new u.WSRequestError("ws request error",{inner:t,request:"demote",args:o,internalCall:this}))}this.emit("CALL_VIEWERS",{viewers:null!==(n=i.viewers)&&void 0!==n?n:[]})}async kickViewer(e,t,r=!1){var n;if(!this.hasPermission(f.PERMISSIONS.CHANGE_PEER_SCOPE))throw this.ctx.logger.warn("viewer does not have permission to kick other viewers"),new Error("no admin change scope permissions");let i;const o={userId:e};try{i=await this._request("kick",o)}catch(e){const t=e instanceof Error?e:null;return void this.emit("error",new u.WSRequestError("ws request error",{inner:t,request:"kick",args:o,internalCall:this}))}this.emit("CALL_VIEWERS",{viewers:null!==(n=i.viewers)&&void 0!==n?n:[]})}async kickPeer(e,t,r=!1){var n;if(!this.hasPermission(f.PERMISSIONS.CHANGE_PEER_SCOPE))throw this.ctx.logger.warn("viewer does not have permission to kick other peers"),new Error("no admin change scope permissions");let i;const o={peerId:e};try{i=await this._request("kick",o)}catch(e){const t=e instanceof Error?e:null;return void this.emit("error",new u.WSRequestError("ws request error",{inner:t,request:"kick",args:o,internalCall:this}))}this.emit("CALL_VIEWERS",{viewers:null!==(n=i.viewers)&&void 0!==n?n:[]})}async connect(){var e,t;return this.emit("CALL_CONNECTING",!0),this.gwTransport.finish(),null===(e=this._peer)||void 0===e||e.peers.forEach((e=>{var t;null===(t=this._peer)||void 0===t||t._onPeerClosed(e)})),await(null===(t=this._peer)||void 0===t?void 0:t.dispose("Reconnecting")),this._peer=void 0,new Promise((async(e,t)=>{if(null==this.call.callUri)throw this.emit("CALL_CONNECTING",!1),new Error("callUri is undefined");this.callResolve=e,this.callReject=t;const[r,n]=await this.authJwt(this.options.auth),i={jwt:null!=n?n:void 0};if(!r)return this.emit("CALL_FORBIDDEN"),void this.close("call ended - jwt auth failed",!0);this.gwTransport.connect(this.call.callUri,i).then((()=>{this.emit("CALL_CONNECTING",!1),this.emit("CALL_SET_CONNECTED",{connected:!0})})).catch(t)}))}async authJwt(e){if(null==e)return[!0,null];try{const[t,r]=await e.requestAsync();return r?[!0,t]:[!0,null]}catch(e){return[!1,null]}}start(){return this.ctx.logger.info("calls-core/call: start",{}),null!=this._startPromise?(this.ctx.logger.info("call: start has already been called"),this._startPromise):(this._startPromise=new Promise(((e,t)=>{this.ctx.support.any?(this._startResolve=e,this._initialRun||(this.emit("CALL_SET_CONNECTED",{connected:!1}),this.emit("CALL_EMIT_MESSAGES",{messages:m.disconnectedMessages.messages})),null!=this.call.callUri?this.connect().then((()=>{var e;this._messages=new m.MessageList,this.emit("CALL_EMIT_MESSAGES",{messages:null!==(e=this._messages.messages)&&void 0!==e?e:[]}),this._initialRun=!1})).catch(t):t(new Error("Call URI is undefined"))):t(new Error("Device is not supported"))})),this._startPromise)}_setup(e,t){this.ctx.logger.debug("call setup")}async createProducer(e,t,r){var n,i;if(null==this._peer){const e="creating a producer on a room which has not been set up";throw this.ctx.logger.warn(e),new Error(e)}const a=this._closed||(null===(n=this._peer)||void 0===n?void 0:n._closed);try{return await this._peer.produce(e,t,r)}catch(e){const t=this._closed||(null===(i=this._peer)||void 0===i?void 0:i._closed);throw!a&&t||(e instanceof o.types.InvalidStateError&&"track ended"===e.message?this.ctx.logger.warn("createProducer: track ended"):this.ctx.logger.error(new u.MediasoupSetupError("createProducer: error creating producer",{inner:(0,u.wrapNativeError)(e)}))),e}}get _localSettings(){if(!l.device.isImplements(l.Feature.LOCAL_STORAGE))return{};const e=l.device.localStorage.getItem(`pvc:${this._ip}:settings`);if(null==e)return{};let t;try{t=JSON.parse(e)}catch(t){const r=t instanceof Error?t.message:"unknown error";return this.ctx.logger.error("unable to parse settings",{data:e,err:r}),{}}return t}set _localSettings(e){l.device.isImplements(l.Feature.LOCAL_STORAGE)&&"false"!==l.device.localStorage.getItem("debug")&&l.device.localStorage.setItem(`pvc:${this._ip}:settings`,JSON.stringify(e))}async _request(e,t){const r=await this.gwTransport.request(e,t);if(null==r){const e=new Error("response is null");throw this.ctx.logger.warn("call _request",{err:null==e?void 0:e.message}),e}return r}async requestSources(e,t){const r={streamName:e,peerId:t};return this._request("consumerSources",r).catch((e=>{const t=e instanceof Error?e:null;return e instanceof Error&&"request error: peer-closed"!==e.message&&this.emit("error",new u.WSRequestError("ws request error",{inner:t,request:"consumerSources",args:r,internalCall:this})),e}))}setPreferredEncoding(e,t){var r;if(!(null===(r=this.peer)||void 0===r?void 0:r.hasConsumerId(e)))return void this.emit("error",new u.ConsumerNotFoundError("consumer not found for consumer event",{consumerId:e}));if(this.setPreferredEncodingProcessing)return void this.ctx.logger.warn("setPreferredEncoding already processing",{consumerId:e,id:t});const n={consumerId:e,id:t};this.setPreferredEncodingProcessing=!0,this._request("setPreferredEncoding",n).catch((t=>{var r;const i=t instanceof Error?t:null;this._consumerNotFoundError(e,i)?(null===(r=this.peer)||void 0===r?void 0:r.hasConsumerId(e))&&this.ctx.logger.warn("consumer does not exist on server, but still exists in videoclient",{err:null==t?void 0:t.message,consumerId:e}):this.emit("error",new u.WSRequestError("ws request error",{inner:i,request:"setPreferredEncoding",args:n,internalCall:this}))})).finally((()=>{this.setPreferredEncodingProcessing=!1}))}_consumerNotFoundError(e,t){return null!=t&&"request error: consumer not found"===(null==t?void 0:t.message)}async setVideoStreamProvider(e,t,r,n,i=!1){if(null==this._streams[e]){const e="setVideoStreamRetriever on invalid stream";throw this.ctx.logger.error(e),new Error(e)}return this._streams[e].setVideoStreamProvider(t,r,n,i)}async setAudioStreamProvider(e,t,r,n,i=!1){if(null==this._streams[e]){const e="setAudioStreamRetriever on invalid stream";throw this.ctx.logger.error(e),new Error(e)}return this._streams[e].setAudioStreamProvider(t,r,n,i)}muteAudio(e){if(null==this._streams[e]){const t="muteAudio on invalid stream";throw this.ctx.logger.error(t,{streamName:e}),new Error(t)}this._streams[e].pauseAudio()}async unmuteAudio(e,t={}){if(null==this._streams[e]){const t="unmuteAudio on invalid stream";throw this.ctx.logger.error(t,{streamName:e}),new Error(t)}return this._streams[e].enableAudio(t,!1)}disableAudio(e){if(null==this._streams[e]){const t="disableAudio on invalid stream";throw this.ctx.logger.error(t,{streamName:e}),new Error(t)}this._streams[e].disableAudio()}async enableAudio(e,t,r=!1,n={}){if(this.ctx.logger.debug("enable audio",{streamName:e,refresh:t}),null==this._streams[e]){const t="enableAudio on invalid stream";throw this.ctx.logger.error(t,{streamName:e}),new Error(t)}return this._streams[e].enableAudio(n,t,r)}async enableVideo(e,t,r=!1,n={}){if(!n.audioOnly){if(this.ctx.logger.debug("enable video",{streamName:e,refresh:t}),null==this._streams[e]){const t="enableVideo on invalid stream";throw this.ctx.logger.error(t,{streamName:e}),new Error(t)}return this._streams[e].enableVideo(n,t,r)}this.ctx.logger.debug("enable video",{streamName:e,refresh:t})}disableVideo(e){if(null==this._streams[e]){const t="disableVideo on invalid stream";throw this.ctx.logger.error(t,{streamName:e}),new Error(t)}this._streams[e].disableVideo()}async unpauseVideo(e,t={}){if(null==this._streams[e]){const t="unpauseVideo on invalid stream";throw this.ctx.logger.error(t,{streamName:e}),new Error(t)}return this._streams[e].enableVideo(t,!1)}pauseVideo(e){if(this.ctx.logger.debug("calls-core/call: pause video"),null==this._streams[e]){const t="pauseVideo on invalid stream";throw this.ctx.logger.error(t,{streamName:e}),new Error(t)}return this._streams[e].pauseVideo()}_pauseProducer(e,t){this.gwTransport.request("pauseProducer",{producerId:e}).catch((e=>{this.ctx.logger.warn("call.pauseProducer: error pausing server producer",e)})),this.emit("CALL_SET_PRODUCER_PAUSED",{streamName:t,producerId:e,originator:"client"})}_resumeProducer(e,t){this.gwTransport.request("resumeProducer",{producerId:e}).catch((e=>{this.ctx.logger.warn("call.resumeProducer: error resuming server producer",e)})),this.emit("CALL_SET_PRODUCER_RESUMED",{streamName:t,producerId:e,originator:"client"})}_closeProducer(e,t){this.gwTransport.request("closeProducer",{producerId:e}).catch((t=>{this.ctx.logger.warn("call.closeProducer: error closing server producer",{err:`${t}`,producerId:e})})),this.emit("CALL_REMOVE_PRODUCER",{streamName:t,producerId:e,originator:"client"})}async hotswapProducer(e,t,r){if(this.ctx.logger.debug("calls-core/call: hotswwap producer"),null==this._streams[t]){const e="hotswapProducer on invalid stream";throw this.ctx.logger.error(e,{streamName:t}),new Error(e)}await this._streams[t].hotswapProducer(e,r)}toJSON(){return{streamNames:this.streamNames,peer:this._peer,aggregates:{support:this.ctx.support.hash,url:this.call.callUri,callId:this.call.id,userId:this.user.userId,peerId:this.peerId,isConnected:this.gwTransport.isConnected}}}}t.Call=C,C.displayName="PvcCall";const O=(e,t,r,n)=>{var i;const o={support:e.support.hash,client_name:E(),client_version:null!==(i=l.device.appVersion)&&void 0!==i?i:"",vdcVersion:_.default.version};return!!l.device.isImplements(l.Feature.LOCAL_STORAGE)&&"true"===l.device.localStorage.getItem("pvc:debug")&&(o.debug=!0),"string"==typeof r&&r.length>0&&!(0,y.isJwtToken)(r)&&(o.t=r),n.test&&(o.t="test"),null!=n.displayName&&(o.displayName=n.displayName),!1===n.sendAudio&&!1!==n.sendVideo?o.videoOnly=!0:!1!==n.sendAudio&&!1===n.sendVideo&&(o.audioOnly=!0),null!=n.rsrc&&(o.rsrc=n.rsrc),null!=n.xkey&&(o.xkey=n.xkey),null!=n.bpeerId&&(o.bpeerId=n.bpeerId),n.suspendPlay&&(o.sp=!0),null!=n.user&&(o.udata=!0),`${t.sfu.uri}/v3/${t.id}?${a.default.stringify(o)}`};t.default=async(e,t,r,n,i,o=null)=>{var a,s,l,c,u,d,f,m;e.logger.debug("joining call",{id:t,options:n});const g={...n},v={method:"post",callId:t,failoverUrls:n.failoverUrls};null!=g.auth&&(v.auth=g.auth),null!=g.authOptions&&(v.auth=new y.default(g.authOptions)),v.query={};const _=(0,b.contextId)();null!=_&&(v.query.contextId=_);const S=(0,b.instanceId)();null!=S&&(v.query.instanceId=S),null!=(null===(a=g.sfu)||void 0===a?void 0:a.id)&&(v.query.id=null===(s=g.sfu)||void 0===s?void 0:s.id),null!=(null===(l=g.sfu)||void 0===l?void 0:l.region)&&(v.query.region=null===(c=g.sfu)||void 0===c?void 0:c.region),null!=(null===(u=g.sfu)||void 0===u?void 0:u.version)&&(v.query.version=null===(d=g.sfu)||void 0===d?void 0:d.version),null!=(null===(f=g.sfu)||void 0===f?void 0:f.pool)&&(v.query.pool=null===(m=g.sfu)||void 0===m?void 0:m.pool);const w={sfu:{msVersion:[3]}};null!=g.sfu&&(w.sfu={...g.sfu,msVersion:[3]}),v.body=JSON.stringify(w);const E=async(n={})=>{var o;e.logger.debug("calls-core/call:joinCall");try{const t=await(0,p.default)(e,r,{...v,...n,warnStatuses:[404,422]});if(null==(null===(o=null==t?void 0:t.body)||void 0===o?void 0:o.call))throw new Error("response is null or incorrect");return t.body.call.callUri=O(e,t.body.call,t.authToken,g),e.logger.debug("joinCall() response",{response:t}),i.emit("callJoinEndpoint"),t}catch(n){const i=n instanceof Error?n.message:"unknown error";throw n instanceof Response?404===n.status?e.logger.warn("sfu unavailable",{id:t,joinUrl:r,err:i}):503===n.status&&e.logger.error("unable to join a call - no sfus available",{id:t,joinUrl:r,err:i}):e.logger.warn("unable to get sfu uri",{id:t,joinUrl:r,err:i}),n}};let P;return null!=(null==o?void 0:o.call)?(o.call.callUri=O(e,o.call,o.user.authorizeToken,g),P=o,setTimeout((()=>i.emit("callJoinEndpoint")),0)):P=(await E()).body,new C((0,h.extendContext)(e,C),P,E,g)}},43414:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CUSTOM_STREAM_TYPE=t.PERMISSIONS=void 0,t.PERMISSIONS={STREAM_VIDEO:"produceVideo",STREAM_AUDIO:"produceAudio",CHANGE_PEER_SCOPE:"changePeerScope"},t.CUSTOM_STREAM_TYPE="custom"},41041:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtendedDevice=void 0;const n=r(70076);class i extends n.types.Device{constructor(e,t={}){super(t),this.device=e,this.directionContext=null,this.originalRtpCapabilities=Reflect.get(this,"_extendedRtpCapabilities"),this.originalCreateTransport=Reflect.get(this,"createTransport"),Reflect.defineProperty(this,"_extendedRtpCapabilities",{get:this.getterRtpCapabilities.bind(this),set:this.setterRtpCapabilities.bind(this),enumerable:!0}),Reflect.defineProperty(this,"_createTransport",{value:this.wrapperCreateTransport.bind(this),enumerable:!1})}getterRtpCapabilities(){return null==this.directionContext||null==this.originalRtpCapabilities?this.originalRtpCapabilities:this.device.processRtpCapabilities(this.directionContext,this.originalRtpCapabilities)}setterRtpCapabilities(e){this.originalRtpCapabilities=e}wrapperCreateTransport(e){try{return this.directionContext=e.direction,this.originalCreateTransport(e)}finally{this.directionContext=null}}}t.ExtendedDevice=i},61934:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(50543),i=r(86729),o=r(51327);class a extends n.EventEmitter{constructor(e){if(super(),this.total=0,this.echo=!1,this._history=[],this._currBucket=0,!i.device.isImplements(o.Feature.AUDIO_CONTEXT))throw new Error("Audio management is not supported");if(this._audioContext=new i.device.AudioContext,this._analyserNode=this._audioContext.createAnalyser(),this._processorNode=this._audioContext.createScriptProcessor(),this._dataArray=new i.device.Uint8Array(this._analyserNode.fftSize),this._analyserNode.smoothingTimeConstant=.4,this._analyserNode.fftSize=64,this._processorNode.onaudioprocess=()=>{var e;this._analyserNode.getByteTimeDomainData(this._dataArray);const t=Date.now(),r=Math.floor(t/1e3);this._currBucket!==r&&(this._history.length>2&&(this._history=this._history.slice(1,this._history.length),this.runAnalysis()),this._history.push([]),this._currBucket=r),null===(e=this._history[this._history.length-1])||void 0===e||e.push(this.dataResult()),this.total+=1},!i.device.isImplements(o.Feature.MEDIA_STREAM))throw new Error("media stream is not implemented");this._mediaStream=new i.device.MediaStream,this._mediaStream.addTrack(e),this._mediaStreamSource=this._audioContext.createMediaStreamSource(this._mediaStream),this._mediaStreamSource.connect(this._analyserNode),this._analyserNode.connect(this._processorNode)}close(){this._audioContext.close()}dataResult(){let e=null,t=null,r=0;for(let n=0;nt)&&(t=i),r+=i}return{lowest:e,highest:t,total:this._dataArray.length,sum:r,average:r/this._dataArray.length}}runAnalysis(){var e,t,r;let n=0,a=0,s=0;const l=[];for(const[i,o]of this._history.entries())for(const[c,u]of o.entries()){const d=this._history[i-1];if(null!=d){const i=null!==(e=o[c-1])&&void 0!==e?e:d[d.length-1];if(null!=i){const e=null!==(t=u.highest)&&void 0!==t?t:0,o=null!==(r=i.highest)&&void 0!==r?r:0;e>=o-.09*Math.abs(o)?e<=o+.09*Math.abs(o)?(s+=1,l.push("s")):(n+=1,l.push("i")):(a+=1,l.push("d"))}}}const c=n+a,u=c+s;c/u>.4?this.echo||(this.echo=!0,this.emit("echo")):this.echo&&(this.echo=!1,this.emit("noecho")),((...e)=>{!0===i.device.globals.get("printOutput")&&i.device.isImplements(o.Feature.DEBUGGING)&&i.device.console.log(...e)})(`${l.join("")} - (${n}/${a}/${s}) (${c})/${u})`)}}a.displayName="EchoDetector",t.default=a},65136:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.disconnectedMessages=t.offlineMessages=t.PEER_MESSAGES=t.TROUBLESHOOTING=t.MessageList=void 0;class r{constructor(){this._messages={}}addMessage(e){this._messages[e.code]=e}removeMessage(e){delete this._messages[e.code]}get messages(){return Object.keys(this._messages).map((e=>this._messages[parseInt(e,10)])).sort(((e,t)=>e.code-t.code))}}t.MessageList=r,r.displayName="MessageList";const n=new r;t.offlineMessages=n,n.addMessage({code:1001,type:"network",level:"error",message:"Internet disconnected",explanation:"Check your internet connection and reconnect to the network"});const i=new r;t.disconnectedMessages=i,i.addMessage({code:1002,type:"network",level:"error",message:"Call disconnected",explanation:"Please wait while the call reconnects"}),t.TROUBLESHOOTING={NO_WEBCAM:{code:1003,type:"webcam",level:"warn",message:"No webcam found",explanation:"Make sure your webcam is connected and your browser has permission to use it"},NO_MIC:{code:1004,type:"microphone",level:"warn",message:"No microphone found",explanation:"Make sure your microphone is connected and your browser has permission to use it"},NETWORK_FIREWALLED:{code:1005,type:"network",level:"error",message:"Connection blocked by firewall",explanation:"Disable firewall"},UNSTABLE_NETWORK:{code:1006,type:"network",level:"warn",message:"Unstable connection",explanation:"If on wifi, try connecting to a stronger network"},WEBRTC_RECV_DISCONNECTED:{code:1007,type:"network",level:"error",message:"Unable to receive stream",explanation:"If on wifi, try connecting to a stronger network"},WEBRTC_SEND_DISCONNECTED:{code:1008,type:"network",level:"warn",message:"Unable to send stream",explanation:"If on wifi, try connecting to a stronger network"},ONE_TO_ONE_PEER_DISCONNECTED:{code:1009,type:"network",level:"error",message:"Peer disconnected",explanation:"Please wait for the other user to come back online"}},t.PEER_MESSAGES={UNSTABLE_PEER:{code:2001,type:"network",level:"error",message:"This user's connection is unstable"}}},70431:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Peer=void 0;const n=r(70076),i=r(86729),o=r(51327),a=r(36147),s=r(92491),l=r(98645),c=r(45820),u=r(93503),d=r(45831),h=r(43414),p=r(41041),f=r(65136);class m extends d.ObservableEventEmitter{constructor(e,t){super(),this._closed=!1,this._iceTimeouts=new Map,this._mediasoupDevice=null,this._sendTransport=null,this._recvTransport=null,this._producers=new Map,this._consumerStatIntervals=new Map,this._delayVideoStart=!1,this.peers=new Map,this.sendLock=null,this.recvLock=null,this.ctx=e,this.call=t,(0,u.onceCanceled)(e).then(this.dispose),e.logger.attachObject(this),e.logger.trace("constructor()");const r=this.call.transport;r.on("message:newPeers",this._handleNewPeers),r.on("message:consumerSources",this._handleConsumerSources),r.on("message:kicked",this._handleAccessDenied),r.on("message:producerstats",this._handleProducerStats),this.addInnerDisposer((()=>{r.off("message:newPeers",this._handleNewPeers),r.off("message:consumerSources",this._handleConsumerSources),r.off("message:kicked",this._handleAccessDenied),r.off("message:producerstats",this._handleProducerStats)})),this._peerEvent("newConsumer",this._onNewConsumer.bind(this),((e,t)=>{this.emitErrorDeprecated(new l.SFUNewConsumerEventError("unable to handle `newConsumer` peer event",{peer:this,request:{id:t.id,kind:t.kind,producerPaused:t.producerPaused,producerId:t.producerId,rtpParameters:t.rtpParameters},inner:e instanceof Error?e:null}))})),this._peerEvent("peerClosed",this._onPeerClosed.bind(this),((e,t)=>{this.emitErrorDeprecated(new l.SFUPeerClosedEventError("unable to handle `peerClosed` peer event",{peer:this,request:t,inner:e instanceof Error?e:null}))})),this._peerEvent("switchConsumerTrack",this._onSwitchConsumerTrack.bind(this),((e,t)=>{this.emitErrorDeprecated(new l.SFUSwitchConsumerTrackEventError("unable to handle `switchConsumerTrack` peer event",{peer:this,request:t,inner:e instanceof Error?e:null}))})),this._consumerEvent("consumerClosed",this._onConsumerClosed.bind(this),((e,t)=>{this.emitErrorDeprecated(new l.SFUConsumerClosedEventError("unable to handle `consumerClosed` consumer event",{peer:this,request:t,inner:e instanceof Error?e:null}))})),this._consumerEvent("consumerPaused",this._onConsumerPaused.bind(this),((e,t)=>{this.emitErrorDeprecated(new l.SFUConsumerPausedEventError("unable to handle `consumerPaused` consumer event",{peer:this,request:t,inner:e instanceof Error?e:null}))})),this._consumerEvent("consumerResumed",this._onConsumerResumed.bind(this),((e,t)=>{this.emitErrorDeprecated(new l.SFUConsumerResumedEventError("unable to handle `consumerResumed` consumer event",{peer:this,request:t,inner:e instanceof Error?e:null}))})),this._consumerEvent("consumerScore",this._onConsumerScore.bind(this),((e,t)=>{this.emitErrorDeprecated(new l.SFUConsumerScoreEventError("unable to handle `consumerScore` consumer event",{peer:this,request:t,inner:e instanceof Error?e:null}))})),this._consumerEvent("consumerLayersChanged",this._onConsumerLayersChanged.bind(this),((e,t)=>{this.emitErrorDeprecated(new l.SFUConsumerLayersChangedEventError("unable to handle `consumerLayersChanged` consumer event",{peer:this,request:t,inner:e instanceof Error?e:null}))})),this._producerEvent("producerClosed",this._onProducerClosed.bind(this),((e,t)=>{this.emitErrorDeprecated(new l.SFUProducerClosedEventError("unable to handle `producerClosed` producer event",{peer:this,request:t,inner:e instanceof Error?e:null}))})),this._producerEvent("producerPaused",this._onProducerPaused.bind(this),((e,t)=>{this.emitErrorDeprecated(new l.SFUProducerPausedEventError("unable to handle `producerPaused` producer event",{peer:this,request:t,inner:e instanceof Error?e:null}))})),this._producerEvent("producerResumed",this._onProducerResumed.bind(this),((e,t)=>{this.emitErrorDeprecated(new l.SFUProducerResumedEventError("unable to handle `producerResumed` producer event",{peer:this,request:t,inner:e instanceof Error?e:null}))})),this.call.transport.on("message:createSendWebRtcTransport",this.handleCreateSendTransport),this.call.transport.on("message:createReceiveWebRtcTransport",this.handleCreateReceiveTransport),this.addInnerDisposer((()=>{this.call.transport.off("message:createSendWebRtcTransport",this.handleCreateSendTransport),this.call.transport.off("message:createReceiveWebRtcTransport",this.handleCreateReceiveTransport)})),this.addInnerDisposer(this.clear)}_handleConsumerSources(e){try{this._onConsumerSources(e)}catch(t){this.emitErrorDeprecated(new l.SFUConsumerSourcesEventError("unable to handle `newPeers` peer event",{peer:this,request:e,inner:t instanceof Error?t:null}))}}async _handleAccessDenied(e){this.call.emit("CALL_ACCESS_DENIED",e)}_handleProducerStats(e){this.call.emit("CALL_PRODUCER_STATS",e.producerStats)}_handleNewPeers(e){try{this._onNewPeers(e)}catch(t){this.emitErrorDeprecated(new l.SFUNewPeersEventError("unable to handle `newPeers` peer event",{peer:this,request:e,inner:t instanceof Error?t:null}))}}async _setup(e){this._mediasoupDevice=new p.ExtendedDevice(i.device),await this._mediasoupDevice.load({routerRtpCapabilities:e});let t=[];Object.keys(this.call.streams).length>0&&t.push(this._createSendTransport()),t.push(this._createReceiveTransport()),await Promise.all(t),this.call.emit("CALL_SET_MEDIA_CAPABILITIES",{canSendMic:this._mediasoupDevice.canProduce("audio"),canSendWebcam:this._mediasoupDevice.canProduce("video")}),t=[];for(const e of this.call.streamsIterator())e.hasVideoStreamTrack&&!this._delayVideoStart&&this.call.hasPermission(h.PERMISSIONS.STREAM_VIDEO)&&t.push((async()=>{var t;try{(null===(t=this._mediasoupDevice)||void 0===t?void 0:t.canProduce("video"))&&await e.enableVideo()}catch(e){const t=e instanceof Error?e.message:"unknown error";this.ctx.logger.warn("Unable to set video producer",{err:t}),this.call._addMessage(f.TROUBLESHOOTING.NO_WEBCAM)}})()),e.hasAudioStreamTrack&&this.call.hasPermission(h.PERMISSIONS.STREAM_AUDIO)&&t.push((async()=>{var t;try{(null===(t=this._mediasoupDevice)||void 0===t?void 0:t.canProduce("audio"))&&await e.enableAudio()}catch(e){const t=e instanceof Error?e.message:"unknown error";this.ctx.logger.warn("Unable to set audio producer",{err:t}),this.call._addMessage(f.TROUBLESHOOTING.NO_MIC)}})());await Promise.all(t)}async _createSendTransport(){if(null==this._mediasoupDevice)throw new Error("Peer._mediasoupDevice is null");let e;this.sendLock=this._initLock();const t={producing:!0,consuming:!1,rtpCapabilities:this._mediasoupDevice.rtpCapabilities,maxBitrate:this.call.maxBitrate,appData:{producerStats:!0}};try{e=await this.call._request("createWebRtcTransport",t)}catch(e){const r=e instanceof Error?e:null,n=new l.WSRequestError("createSendTransport: ws request error",{inner:r,request:"createWebRtcTransport",args:t,internalCall:this.call});throw this.call.emit("error",n),n}this._sendTransport=this._mediasoupDevice.createSendTransport({id:e.id,iceParameters:e.iceParameters,iceCandidates:e.iceCandidates,dtlsParameters:e.dtlsParameters,...this._transportOptions()}),this.sendLock.resolve(),this.ctx.logger.debug("ms3._createSendTransport: created",{transportInfo:e,deviceCapabilities:this._mediasoupDevice.rtpCapabilities}),this._handleTransportEvents(this._sendTransport,"send")}handleCreateSendTransport(e){if(null==this._mediasoupDevice)throw new Error("Peer._mediasoupDevice is null");this._sendTransport=this._mediasoupDevice.createSendTransport({id:e.id,iceParameters:e.iceParameters,iceCandidates:e.iceCandidates,dtlsParameters:e.dtlsParameters,...this._transportOptions()}),this.ctx.logger.debug("ms3._createSendTransport: created",{transportInfo:e,deviceCapabilities:this._mediasoupDevice.rtpCapabilities}),this._handleTransportEvents(this._sendTransport,"send")}async _createReceiveTransport(){if(null==this._mediasoupDevice)throw new Error("Peer._mediasoupDevice is null");let e;this.recvLock=this._initLock();const t={forceTcp:this._forceRecvTcp,producing:!1,consuming:!0,rtpCapabilities:this._mediasoupDevice.rtpCapabilities},r=this._closed||this.call._closed;try{e=await this.call._request("createWebRtcTransport",t)}catch(e){const n=this._closed||this.call._closed;if(!r&&n)return;const i=e instanceof Error?e:null,o=new l.WSRequestError("createReceiveTransport: ws request error",{inner:i,request:"createWebRtcTransport",args:t,internalCall:this.call});throw this.call.emit("error",o),o}e={...e,...this._transportOptions()},this._recvTransport=this._mediasoupDevice.createRecvTransport(e),this.recvLock.resolve(),this.ctx.logger.debug("ms3._createReceiveTransport: created",{transportInfo:e}),this._handleTransportEvents(this._recvTransport,"recv")}handleCreateReceiveTransport(e){if(null==this._mediasoupDevice)throw new Error("Peer._mediasoupDevice is null");e={...e,...this._transportOptions()},this._recvTransport=this._mediasoupDevice.createRecvTransport(e),this.ctx.logger.debug("ms3._createReceiveTransport: created",{transportInfo:e}),this._handleTransportEvents(this._recvTransport,"recv")}_transportOptions(){var e,t;const r=i.device.isEdge?this.call._edgeIceServers():this.call._iceServers();return this.call._iceTransportPolicyUsed=null!==(t=null!==(e=this.call._iceTransportPolicy)&&void 0!==e?e:this.call._localSettings.iceTransportPolicy)&&void 0!==t?t:"all",{iceServers:r,iceTransportPolicy:this.call._iceTransportPolicyUsed}}_handleTransportEvents(e,t){let r;("send"===t&&this.call._requireSend||"recv"===t&&this.call._requireRecv)&&(r=i.device.setTimeout((()=>{"new"===e.connectionState&&this.emitErrorDeprecated(new l.TransportStateError("Transport failed to change connection state",{critical:!0}))}),2e4));const n=t.toUpperCase();let a=null;e.on("connectionstatechange",(s=>{i.device.clearTimeout(r),"SEND"===n?this.call.emit("CALL_SET_SENDING_ICE_STATE",{state:s}):this.call.emit("CALL_SET_RECEIVING_ICE_STATE",{state:s}),this.ctx.logger.setMessageAggregate(`${t}TransportId`,e.id),this.ctx.logger.setMessageAggregate(`${t}TransportState`,s);const c=i.device.isImplements(o.Feature.NETWORK_INFORMATION)?i.device.connection:null;switch(this.ctx.logger.info(`${t} transport connection state change`,{state:s,transportType:t,prevState:a,connection:c}),a=s,"completed"===s&&(s="connected"),s){case"connected":e.appData.onceConnected=!0,this.call._removeMessage(f.TROUBLESHOOTING.NETWORK_FIREWALLED),this.call._removeMessage(f.TROUBLESHOOTING["SEND"===n?"WEBRTC_SEND_DISCONNECTED":"WEBRTC_RECV_DISCONNECTED"]),i.device.clearTimeout(this._iceTimeouts.get(t)),this._iceTimeouts.delete(t),this.ctx.logger.info(`${t} transport entered connected state`),this.emit("webrtc-transport-connected",t);break;case"disconnected":this.call._addMessage(f.TROUBLESHOOTING["SEND"===n?"WEBRTC_SEND_DISCONNECTED":"WEBRTC_RECV_DISCONNECTED"]),this._restartIce(t),this.ctx.logger.warn(`${t} transport entered disconnected state`),this.emit("webrtc-transport-disconnected",t);break;case"failed":if(this.ctx.logger.warn(`${t} transport entered failed state`),this.emit("webrtc-transport-failed",t),"SEND"===n&&this.call._requireSend)this.emitErrorDeprecated(new l.TransportStateError("Send transport failed",{critical:!0}));else if("RECV"===n&&this.call._requireRecv){const e=new Error("Receive transport failed");null!=this.recvLock&&this.recvLock.reject(e),this.emitErrorDeprecated(new l.TransportStateError("Receive transport failed",{critical:!0}))}else this.call._removeMessage(f.TROUBLESHOOTING["SEND"===n?"WEBRTC_SEND_DISCONNECTED":"WEBRTC_RECV_DISCONNECTED"]),this._restartIce(t),e.appData.onceConnected||this.call._addMessage(f.TROUBLESHOOTING.NETWORK_FIREWALLED);break;case"closed":"send"===n?null!=this.sendLock&&this.sendLock.reject(new Error("send transport closed")):null!=this.recvLock&&this.recvLock.reject(new Error("recv transport closed")),this._closed||this.emitErrorDeprecated(new l.TransportStateError(`${t} transport closed prematurely`,{critical:!0})),this.ctx.logger.warn(`${t} transport entered closed state`),this.emit("webrtc-transport-closed",t)}})),e.observer.on("close",(()=>{this.ctx.logger.info(`${t} transport.observer.closed state`),this.emit("webrtc-transport-closed",t)}));const s=this._closed||this.call._closed;e.on("connect",(({dtlsParameters:r},n,i)=>{const o={transportId:e.id,dtlsParameters:r};this.call._request("connectWebRtcTransport",o).then((()=>{var e;n(),null===(e=this.recvLock)||void 0===e||e.resolve(),this.ctx.logger.debug("ms3._handleTransportEvents connected",{transportType:t})})).catch((e=>{const t=this._closed||this.call._closed;if(!s&&t)return;const r=e instanceof Error?e:null,n=new l.WSRequestError("handleTransportEvents: ws request error",{inner:r,request:"connectWebRtcTransport",args:o,internalCall:this.call});this.call.emit("error",n),i(n)}))})),e.on("produce",(({kind:t,rtpParameters:r,appData:n},i,o)=>{const a={transportId:e.id,kind:t,rtpParameters:r,appData:n};this.call._request("produce",a).then((e=>{i(e),this.ctx.logger.debug("ms3._handleTransportEvents: produce",{kind:t,appData:n})})).catch((e=>{const t=e instanceof Error?e:null,r=new l.WSRequestError("handleTransportEvents: ws request error",{inner:t,request:"produce",args:a,internalCall:this.call});this.call.emit("error",r),o(r)}))}))}_addPeers(e){e.forEach((e=>{null!=e.id?(this.peers.set(e.id,e),this.call.emit("CALL_ADD_PEER",{peer:e}),this.call.emit("PEER_CHANGE",{peer:e,action:"added"})):this.emitErrorDeprecated(new l.InternalError("peerId is undefined",{}))}))}_restartIce(e){if(!this.call.transport.isConnected)return void this.call.transport.once("connected",(()=>{this._restartIce(e)}));if(null!=this._iceTimeouts.get(e))return;const t=async()=>{if(!this._closed){if(this.ctx.logger.throttledLog("debug",15e3,"ice restart",{online:i.device.onLine}),!i.device.onLine)return i.device.clearTimeout(this._iceTimeouts.get(e)),void this._iceTimeouts.set(e,i.device.setTimeout(t.bind(this),500));try{const t={dir:e};let r;try{r=await this.call._request("restartIce",t)}catch(e){const r=e instanceof Error?e:null,n=new l.WSRequestError("restartIce: ws request error",{inner:r,request:"restartIce",args:t,internalCall:this.call});throw this.call.emit("error",n),n}if("send"===e){if(null==this._sendTransport)return void this.ctx.logger.error("call: restartIce error",{err:"_sendTransport is null"});await this._sendTransport.restartIce(r)}else{if(null==this._recvTransport)return void this.ctx.logger.error("call: restartIce error",{err:"_recvTransport is null"});await this._recvTransport.restartIce(r)}return void this._iceTimeouts.delete(e)}catch(e){const t=e instanceof Error?e.message:"unknown error";this.ctx.logger.warn("call: restartIce error",{err:t})}i.device.clearTimeout(this._iceTimeouts.get(e)),this._iceTimeouts.set(e,i.device.setTimeout(t.bind(this),5e3))}};t().catch(this.ctx.logger.error)}_onNewPeers(e){this._addPeers(e.peers)}_onConsumerSources(e){var t,r,n;const i={};for(const o of e.consumers){const e=null!==(t=i[`${o.peerId}-${o.streamName}`])&&void 0!==t?t:{peerId:o.peerId,streamName:o.streamName,layers:[]};for(const t of o.encodings)e.layers.push({id:t.id,bitrate:null!==(n=null!==(r=t.bitrate)&&void 0!==r?r:t.maxBitrate)&&void 0!==n?n:0,isSource:!o.xcode,appData:{consumerId:o.consumerId}});i[`${o.peerId}-${o.streamName}`]=e}for(const e of Object.values(i))this.call.emit("CALL_CONSUMER_SOURCES",e)}async getLayers(e,t){var r,n;let i=[],o=null,a=null;const s=this._closed||this.call._closed;try{a=await this.call.requestSources(e,t),this.ctx.logger.debug("request consumerSources from ws",{sources:a});for(const e of a.consumers)for(const t of e.encodings){const a={id:t.id,bitrate:null!==(n=null!==(r=t.bitrate)&&void 0!==r?r:t.maxBitrate)&&void 0!==n?n:0,isSource:!e.xcode,appData:{consumerId:e.consumerId}};i.push(a),t.active&&(o=a)}}catch(e){const t=this._closed||this.call._closed;if(!s&&t)return[null,[]];this.ctx.logger.error(`unable to get consumer sources: ${e}`,{sources:a})}return i=(0,c.sortEncodings)(i),[o,i]}async _onNewConsumer(e,t,r){var i,o,a,s,c,u,d;if(this.ctx.logger.info("call: _onNewConsumer"),null!=this.recvLock?await this.recvLock.ready():await this._createReceiveTransport(),null==this._recvTransport)return this.ctx.logger.error("call: _onNewConsumer error",{err:"_recvTransport is null"}),void r(null,"_recvTransport is null");if(this._recvTransport.closed)return await this._createReceiveTransport(),await(null===(i=this.recvLock)||void 0===i?void 0:i.ready()),void r(null,"_recvTransport closed");const h=await this._recvTransport.consume(t);!1!==(null===(o=t.appData)||void 0===o?void 0:o.trackEnabled)&&!t.producerPaused||h.paused||h.pause(),null===(a=e.consumers)||void 0===a||a.push(h),h.on("transportclose",(()=>{this.ctx.logger.debug("consumer event",{event:"transportclose",kind:t.kind}),this._deleteConsumers(e,[h.id])})),h.on("trackended",(()=>{this.ctx.logger.debug("consumer event",{event:"trackended",kind:t.kind}),this._deleteConsumers(e,[h.id])}));const{encodings:p}=h.rtpParameters;if(null==p||0===(null==p?void 0:p.length))return this.ctx.logger.error("call: _onNewConsumer error",{err:"consumer doesn't have any encodings"}),void r(null,"consumer doesn't have any encodings");const{spatialLayers:f,temporalLayers:m}=(0,n.parseScalabilityMode)(null!==(c=null===(s=p[0])||void 0===s?void 0:s.scalabilityMode)&&void 0!==c?c:""),{streamName:g}=h.appData;if("string"!=typeof g)return this.ctx.logger.error("call: _onNewConsumer error",{err:"consumer.appData doesn't have a proper stream name"}),void r(null,"consumer.appData doesn't have a proper stream name");if(null==e.id)return this.ctx.logger.error("call: _onNewConsumer error",{err:"peer.id is null"}),void r(null,"peer.id is null");const v="object"==typeof t&&t.dontAdd;let[y,b]=[null,[]];if(!v){const t=this._closed||this.call._closed;if("video"===h.kind)try{[y,b]=await this.getLayers(g,e.id)}catch(e){const r=this._closed||this.call._closed;if(!t&&r)return;throw e}}const _={peerId:e.id,streamName:g,consumer:{id:h.id,peerId:e.id,kind:h.kind,streamName:String(h.appData.streamName),supported:!0,locallyPaused:!1,paused:h.paused,track:h.track,codec:null!==(d=null===(u=h.rtpParameters.codecs[0])||void 0===u?void 0:u.mimeType.split("/")[1])&&void 0!==d?d:"",pause:()=>{h.pause();const e={consumerId:h.id};this.call._request("pauseConsumer",e).catch((t=>{const r=t instanceof Error?t:null,n=new l.WSRequestError("pause: ws request error",{inner:r,request:"pauseConsumer",args:e,internalCall:this.call});this.call.emit("error",n)}))},resume:()=>{h.resume();const e={consumerId:h.id};this.call._request("resumeConsumer",e).catch((t=>{const r=t instanceof Error?t:null,n=new l.WSRequestError("resume: ws request error",{inner:r,request:"resumeConsumer",args:e,internalCall:this.call});return this.call.emit("error",n),n}))},layers:b,activeLayer:y,preferredSpatialLayer:f-1,preferredTemporalLayer:m-1,rtpParameters:h.rtpParameters,dontAdd:v}};this.call.emit("CALL_ADD_CONSUMER",_),v||(this.call.emit("CALL_SET_CONSUMER_TRACK",{peerId:e.id,streamName:g,consumerId:h.id,track:h.track}),this.call.emit("PEER_CHANGE",{peer:e,action:"consumer_added"})),r({})}hasConsumerId(e){return Array.from(this.peers.values()).some((t=>{var r;return null===(r=t.consumers)||void 0===r?void 0:r.some((t=>t.id===e))}))}_peerEvent(e,t,r){const n=this.call.transport,i=async(n,i)=>{if(null==n.peerId||""===n.peerId)return this.ctx.logger.warn("invalid peer event request: no peerId",{event:e,req:n}),void i(null,"invalid peer event request: no peerId");const o=this.peers.get(n.peerId);if(null==o)return this.ctx.logger.warn("peer not found for peer event",{event:e,req:n}),void i(null,"peer not found for peer event");this.ctx.logger.debug("peer event",{event:e,req:n});try{await t(o,n,i)}catch(t){r(t instanceof Error?t:null,n),"function"==typeof i?t instanceof Error?i(null,`peer event error: ${t.message}`):i(null,"peer event error: undefined error"):this.ctx.logger.debug(`BUG: check '${e}' event in PvcTransport, it doesn't provide 'resp' callback`,{aggregates:{bug:!0}})}};n.on(`request:${e}`,i),n.on(`message:${e}`,i),this.addInnerDisposer((()=>{n.off(`request:${e}`,i),n.off(`message:${e}`,i)}))}async _onPeerClosed(e){var t,r;if(null!=e.id){if(this.peers.has(e.id)){this.peers.delete(e.id);const n=null===(t=e.consumers)||void 0===t?void 0:t.map((e=>e.id));if(await this._deleteConsumers(e,null!=n?n:[]),this.call._closed)return;this.call.emit("CALL_REMOVE_PEER",{peerId:null!==(r=e.id)&&void 0!==r?r:""}),this.call.emit("PEER_CHANGE",{peer:e,action:"removed"})}}else this.emitErrorDeprecated(new l.InternalError("peerId is undefined",{}))}_producerEvent(e,t,r){const n=this.call.transport,i=async n=>{if(n.peerId!==this.call.peerId)return void this.ctx.logger.debug("wrong peer ID for producer event",{event:e,req:n});const i=this._producers.get(n.producerId);if(null!=i)try{await t(i,n)}catch(e){r(e instanceof Error?e:null,n)}else console.trace("producer not found for producer event",{event:e,req:n})};n.on(`message:${e}`,i),this.addInnerDisposer((()=>{n.off(`message:${e}`,i)}))}_consumerEvent(e,t,r){const n=this.call.transport,i=async n=>{var i;const o=this.peers.get(n.peerId);if(null==o)return void this.ctx.logger.debug("peer not found for consumer event",{event:e,req:n});const a=null===(i=o.consumers)||void 0===i?void 0:i.find((e=>e.id===n.consumerId));if(null!=a){this.ctx.logger.debug("consumer event",{event:e,req:n});try{await t(a,o,n)}catch(e){r(e instanceof Error?e:null,n)}}else"consumerClosed"!==e&&this.ctx.logger.debug("consumer not found for consumer event",{event:e,req:n})};n.on(`message:${e}`,i),this.addInnerDisposer((()=>{n.off(`message:${e}`,i)}))}_deleteConsumers(e,t){return t.forEach((t=>{var r,n,i,o;const a=null===(r=e.consumers)||void 0===r?void 0:r.find((e=>e.id===t));if(null==a)return;this.call.emit("CALL_REMOVE_CONSUMER",{peerId:null!==(n=e.id)&&void 0!==n?n:"",streamName:String(a.appData.streamName),consumerId:a.id}),this.call.emit("PEER_CHANGE",{peer:e,action:"consumer_removed"});const s=null===(i=e.consumers)||void 0===i?void 0:i.indexOf(a);null===(o=e.consumers)||void 0===o||o.splice(null!=s?s:0,1)})),Promise.resolve()}async _onConsumerClosed(e,t){e.close();const r=this._consumerStatIntervals.get(e.id);clearInterval(r),this._consumerStatIntervals.delete(e.id),await this._deleteConsumers(t,[e.id])}_onConsumerPaused(e,t){var r;return e.pause(),this.call.emit("CALL_SET_CONSUMER_PAUSED",{peerId:null!==(r=t.id)&&void 0!==r?r:"",streamName:String(e.appData.streamName),consumerId:e.id,originator:"peer"}),Promise.resolve()}_onConsumerResumed(e,t){var r;return e.resume(),this.call.emit("CALL_SET_CONSUMER_RESUMED",{peerId:null!==(r=t.id)&&void 0!==r?r:"",streamName:String(e.appData.streamName),consumerId:e.id,originator:"peer"}),Promise.resolve()}async _onConsumerScore(e,t){}async _onConsumerLayersChanged(e,t,r){return this.call.emit("CALL_CONSUMER_LAYER_CHANGED",r),Promise.resolve()}async _onSwitchConsumerTrack(e,t,r){var n,i,o,a;const s=e.id;if(null==s)return;const c=new Map;for(const r of t.add){const o=null===(n=e.consumers)||void 0===n?void 0:n.find((e=>e.id===r.consumerId));if(!o){const e=new l.SFUSwitchConsumerTrackEventError("unable to switch tracks: consumer not found",{consumerId:r.consumerId,peer:this,request:t});return void this.emitErrorDeprecated(e)}const a=String(o.appData.streamName);c.has(a)||c.set(a,{add:[],remove:[]}),null===(i=c.get(a))||void 0===i||i.add.push(o.track)}for(const r of t.remove){const n=null===(o=e.consumers)||void 0===o?void 0:o.find((e=>e.id===r.consumerId));if(!n){const e=new l.SFUSwitchConsumerTrackEventError("unable to switch tracks: consumer not found",{consumerId:r.consumerId,peer:this,request:t});return void this.emitErrorDeprecated(e)}const i=String(n.appData.streamName);c.has(i)||c.set(i,{add:[],remove:[]}),null===(a=c.get(i))||void 0===a||a.remove.push(n.track)}for(const[e,r]of c.entries()){if(0===r.add.length||0===r.remove.length){const e=new l.SFUSwitchConsumerTrackEventError("unable to switch tracks: consumers have different stream names",{peer:this,request:t});return void this.emitErrorDeprecated(e)}this.call.emit("CALL_SWAP_CONSUMERS",{peerId:s,streamName:e,add:r.add,remove:r.remove})}r({})}_onProducerClosed(e,t){return e.closed||(this.call.emit("CALL_REMOVE_PRODUCER",{streamName:t.streamName,producerId:t.producerId,originator:"client"}),e.close()),Promise.resolve()}_onProducerPaused(e){return e.pause(),Promise.resolve()}_onProducerResumed(e){return e.resume(),Promise.resolve()}async produce(e,t,r){if(null!=this.sendLock)try{await this.sendLock.ready()}catch(e){throw new Error("unable to acquire a lock")}else try{await this._createSendTransport()}catch(e){const t=e instanceof Error?e.message:"unknown error";throw this.ctx.logger.error("unable to create send transport",{err:t}),e}if(null==this._sendTransport){const e=new Error("_sendTransport is null");throw this.ctx.logger.error("ms3.produce error",{err:e.message}),e}let n;const{simulcast:{maxBitrates:o}={}}=t;if(o&&"video"===e.kind){const i={...t,track:e,appData:r,encodings:[{maxBitrate:o[0],dtx:!0},{maxBitrate:o[1],dtx:!0}],stopTracks:!1};t.audioOnly&&(i.appData.audioOnly=t.audioOnly),t.videoOnly&&(i.appData.videoOnly=t.videoOnly),i.appData.trackEnabled=i.track.enabled,i.appData.userId=this.call.user.userId,i.appData.displayName=this.call.user.displayName,this.ctx.logger.debug("create maxBitrates producer",{...i,track:null,appData:null}),n=await this._sendTransport.produce(i)}else{const o={...t,track:e,appData:r,stopTracks:!1};t.audioOnly&&(o.appData.audioOnly=t.audioOnly),t.videoOnly&&(o.appData.videoOnly=t.videoOnly),o.appData.trackEnabled=o.track.enabled,o.appData.userId=this.call.user.userId,o.appData.displayName=this.call.user.displayName,this.ctx.logger.debug("create basic producer",{...o,track:null,appData:null}),o.encodings&&o.encodings.length>1&&i.device.isIosDevice&&i.device.isChrome&&(o.encodings=[{maxBitrate:25e5}],this.emitError((0,s.createError)(a.ErrorCode.SimulcastDisabled,"simulcast is disabled due to ios chrome limitations",{}))),n=await this._sendTransport.produce(o)}return this._producers.set(n.id,n),this.ctx.logger.debug("ms3.produce",{appData:r,trackLabel:e.label}),n.on("transportclose",(()=>{this.ctx.logger.debug("ms3.produce: transport closed",{trackLabel:e.label,appData:r})})),n.on("trackended",(()=>{this.ctx.logger.debug("ms3.produce: track ended",{trackLabel:e.label,appData:r})})),n}clear(e){this._iceTimeouts.forEach((e=>{i.device.clearTimeout(e)})),this._iceTimeouts.clear(),null!=this._recvTransport&&this._recvTransport.close(),null!=this._sendTransport&&this._sendTransport.close()}async close(e="Implementer did not pass debugString",t=!1){if(this._closed)return;this.clear(e),this._closed=!0;let r="Reason for close not given";if(e){const t=e.indexOf("PlayerUiState inner disposer:");r=-1!==t?e.substring(t+29).trim():e}try{await this.call.transport.request("closePeer",{internal:t,reason:r})}catch(r){const n=r instanceof Error?r.toString():"unknown error";this.ctx.logger.info("ms3.close: error closing peer on the server",{aggregates:{err:n,internal:t,reason:e}})}}_initLock(){const e={};return e.promise=new Promise(((t,r)=>{e.resolve=()=>{e.resolved=!0,t()},e.reject=t=>{e.resolved?e.promise=Promise.reject(t):r(t)}})),e.ready=()=>e.promise,e}toJSON(){return{peers:Array.from(this.peers.values()).map((e=>({id:e.id,name:e.name,peerId:e.peerId,userId:e.userId,displayName:e.displayName,scope:e.scope,permissions:e.permissions,behaviours:e.behaviours}))),aggregates:{support:this.ctx.support.hash,localPeerId:this.call._localPeerId}}}}t.Peer=m,m.displayName="PvcPeer"},1011:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=r(43375),o=r(86729),a=r(51327),s=r(98645),l=r(93503),c=r(45831),u=r(43414),d=n.__importDefault(r(61934)),h=r(65136);let p=null;o.onceDeviceReady.then((e=>{e.isImplements(a.Feature.AUDIO_CONTEXT)&&(p=new e.AudioContext)}));const f="video",m="audio";class g extends c.ObservableEventEmitter{constructor(e,t,r,n){var i,o,a,s,c,d,h,p;super(),(0,l.onceCanceled)(e).then((e=>this.dispose(`Stream Context Cancelled: ${e}`))),this.ctx=e,this.streamName=t,this.call=r;const f=null!=n?n:{};this._audioOptions=null!==(i=f.audio)&&void 0!==i?i:{},null!=this._audioOptions.streamProvider?(this._audioStreamProvider=null!==(o=this._audioOptions.streamProvider)&&void 0!==o?o:null,this._audioStreamProviderType=null!==(a=this._audioOptions.streamProviderType)&&void 0!==a?a:u.CUSTOM_STREAM_TYPE):(this._audioStreamProvider=null,this._audioStreamProviderType=null),this._useEchoDetection=null!==(s=this._audioOptions.echoDetection)&&void 0!==s&&s,this._videoOptions=null!==(c=f.video)&&void 0!==c?c:{},null!=this._videoOptions.streamProvider?(this._videoStreamProvider=null!==(d=this._videoOptions.streamProvider)&&void 0!==d?d:null,this._videoStreamProviderType=null!==(h=this._videoOptions.streamProviderType)&&void 0!==h?h:u.CUSTOM_STREAM_TYPE):(this._videoStreamProvider=null,this._videoStreamProviderType=null),this._videoProducer=null,this._audioProducer=null,this._statsInterval=null!==(p=f.statsInterval)&&void 0!==p?p:5e3,e.logger.attachObject(this),e.logger.trace("constructor()",this),this.addInnerDisposer((()=>{this.close()}))}get logData(){return{streamName:this.streamName}}get audioProducer(){return this._audioProducer}get videoProducer(){return this._videoProducer}get hasVideoStreamTrack(){var e;const t=null===(e=this._videoStreamProvider)||void 0===e?void 0:e.source;return null!=t&&t.getVideoTracks().length>0}get hasAudioStreamTrack(){var e;const t=null===(e=this._audioStreamProvider)||void 0===e?void 0:e.source;return null!=t&&t.getAudioTracks().length>0}async setVideoStreamProvider(e,t,r,n){return this._setMediaStreamProvider(f,e,t,r,!1,n)}async setAudioStreamProvider(e,t,r,n){return this._setMediaStreamProvider(m,e,t,r,!1,n)}checkPermissions(e){e&&!this.call.hasPermission(u.PERMISSIONS.STREAM_VIDEO)?this.throwErrorDeprecated(new s.PermissionsError("no permission to stream video",{stream:this,permissions:this.call.permissions})):e||this.call.hasPermission(u.PERMISSIONS.STREAM_AUDIO)||this.throwErrorDeprecated(new s.PermissionsError("no permission to stream audio",{stream:this,permissions:this.call.permissions}))}async _setMediaStreamProvider(e,t,r,n,i,o){var a,l,c;this.ctx.logger.debug("setMediaStreamRetriever",{...this.logData,kind:e});const d=e===f;let h,p=null,m=null;if(d?(m=this._videoStreamProvider,h=this._videoStreamProviderType,this._videoStreamProvider=t,this._videoStreamProviderType=null!==(a=r.streamType)&&void 0!==a?a:u.CUSTOM_STREAM_TYPE,p=this._videoProducer):(m=this._audioStreamProvider,h=this._audioStreamProviderType,this._audioStreamProvider=t,this._audioStreamProviderType=null!==(l=r.streamType)&&void 0!==l?l:u.CUSTOM_STREAM_TYPE,p=this._audioProducer),!n)return null;if(this.checkPermissions(d),null!=p&&!p.closed){let n,o;null!=p.track&&p.track.stop();try{if(n=t.source,null==n)return this.ctx.logger.error("Stream provider returned null",{...this.logData,kind:e}),null}catch(t){const n=t instanceof Error?t.message:"unknown error";if(this.ctx.logger.warn("Unable to get media stream",{err:n,...this.logData,kind:e}),!i&&null!=m)try{const t={...r,streamType:null!=h?h:u.CUSTOM_STREAM_TYPE};await this._setMediaStreamProvider(e,m,t,!0,!0,!1)}catch(t){this.emitErrorDeprecated(new s.InternalError(`Unable to revert media stream: ${e}`,{}))}throw t}if([o]=d?n.getVideoTracks():n.getAudioTracks(),this.ctx.logger.info("replacing producer track",{...this.logData,kind:e,trackLabel:null==o?void 0:o.label,trackState:null==o?void 0:o.readyState,settings:null!=(null==o?void 0:o.getSettings)?o.getSettings():null,capabilities:null!=(null==o?void 0:o.getCapabilities)?o.getCapabilities():null,constraints:null!=(null==o?void 0:o.getConstraints)?o.getConstraints():null}),null==o)throw this.ctx.logger.error("stream has no tracks of this kind",{...this.logData,kind:e,stream:n}),new Error("Unable to get track");return await p.replaceTrack({track:o}),p.paused&&(p.resume(),this.call._resumeProducer(p.id,this.streamName)),this.call.emit("CALL_SET_PRODUCER_TRACK",{streamName:this.streamName,streamType:null!==(c=r.streamType)&&void 0!==c?c:u.CUSTOM_STREAM_TYPE,producerId:p.id,track:o}),p}this.ctx.logger.info("cannot replaceTrack, so resetting producer",{...this.logData});try{p=await this._setProducer(e,r,o)}catch(t){this.ctx.logger.warn("unable to set new producer",{...this.logData,kind:e})}return p}async _setProducer(e,t,r=!1,n=!1){var i,l,c,g,v,y,b,_,S,w,E,C;const O=e===f;let P;this.checkPermissions(O);try{if(O){n||null==(null===(i=this._videoProducer)||void 0===i?void 0:i.track)||this._videoProducer.track.stop(),null==this._videoStreamProvider&&this.throwErrorDeprecated(new s.RetrievingMediaStreamError("videoStreamProvider is not provided",{streamName:this.logData.streamName,mediaKind:e}));const t=this._videoStreamProvider.source;null==t&&this.throwErrorDeprecated(new s.RetrievingMediaStreamError("videoStreamProvider returned null",{streamName:this.logData.streamName,mediaKind:e})),P=t,this.ctx.logger.debug("retrieve a new video stream",{stream:P})}else{n||null==(null===(l=this._audioProducer)||void 0===l?void 0:l.track)||this._audioProducer.track.stop(),null==this._audioStreamProvider&&this.throwErrorDeprecated(new s.RetrievingMediaStreamError("audioStreamProvider is not provided",{streamName:this.logData.streamName,mediaKind:e}));const t=this._audioStreamProvider.source;null==t&&this.throwErrorDeprecated(new s.RetrievingMediaStreamError("audioStreamProvider returned null",{streamName:this.logData.streamName,mediaKind:e})),P=t,this.ctx.logger.debug("retrieve a new audio stream",{stream:P})}}catch(t){const r=t instanceof Error?t.message:"unknown error";throw this.ctx.logger.warn("Unable to get media stream",{err:r,...this.logData,kind:e}),t}let T,k,R=!1;if(O){[T]=P.getVideoTracks();const r={streamName:this.streamName,userId:this.call.user.userId,trackEnabled:null==T?void 0:T.enabled,displayName:this.call.user.displayName};if(O&&o.device.isImplements(a.Feature.SCREEN_ORIENTATION)&&(r.orientation=o.device.screenOrientation),null==T){const t=new Error("stream.getVideoTracks()[0] is undefined");throw this.ctx.logger.warn("Unable to get media track",{err:null==t?void 0:t.message,...this.logData,kind:e}),t}if(!this._videoProducer||n||o.device.isIosDevice)k=await this.call.createProducer(T,t,r);else try{await this._videoProducer.replaceTrack({track:T}),k=this._videoProducer,R=!0}catch(n){const i=n instanceof Error?n.message:"unknown error";this.ctx.logger.warn("Unable to replace track",{err:i,...this.logData,kind:e}),k=await this.call.createProducer(T,t,r)}}else{const r={streamName:this.streamName,userId:this.call.user.userId,displayName:this.call.user.displayName};let i;if(this._useEchoDetection&&null!=(null==p?void 0:p.createMediaStreamSource)&&null!=(null==p?void 0:p.createMediaStreamDestination)&&null!=this._gainNode){p.createMediaStreamSource(P).connect(this._gainNode);const e=p.createMediaStreamDestination();this._gainNode.connect(e),[T]=e.stream.getAudioTracks(),[i]=P.getAudioTracks()}else[T]=P.getAudioTracks();if(null==T){const t=new Error("stream.getAudioTracks()[0] is undefined");throw this.ctx.logger.warn("Unable to get media track",{err:null==t?void 0:t.message,...this.logData,kind:e}),t}if(this._audioProducer&&!n)try{await this._audioProducer.replaceTrack({track:T}),k=this._audioProducer,R=!0}catch(n){const o=n instanceof Error?n.message:"unknown error";this.ctx.logger.warn("Unable to replace track",{err:o,...this.logData,kind:e}),k=await this.call.createProducer(T,t,r),k.appData.parallelTrack=i}else k=await this.call.createProducer(T,t,r),k.appData.parallelTrack=i}let A=null;if(O)R||(A=this._videoProducer,this._videoProducer=k);else if(R||(A=this._audioProducer,this._audioProducer=k),this._useEchoDetection)try{this._echoDetector=new d.default(k.track),null===(c=this._echoDetector)||void 0===c||c.on("echo",(()=>{var e;this.ctx.logger.debug(`echo detected at ${Date.now()}. Gain at ${null===(e=this._gainNode)||void 0===e?void 0:e.gain.value}`,{...this.logData}),this._reduceGain()})),null===(g=this._echoDetector)||void 0===g||g.on("noecho",(()=>{var e;this.ctx.logger.debug(`echo stopped at ${Date.now()}. Gain at ${null===(e=this._gainNode)||void 0===e?void 0:e.gain.value}`,{...this.logData}),this._restoreGain()}))}catch(e){const t=e instanceof Error?e.message:"unknown error";this.ctx.logger.error("unable to set up echo detector",{err:t,...this.logData})}const D=e=>{this.ctx.logger.debug(e,{...this.logData}),null!=k.appData.parallelTrack&&k.appData.parallelTrack.stop();let t="";O&&null!=this._videoProducer?(t=this._videoProducer.id,this._videoProducer=null):null!=this._audioProducer&&(t=this._audioProducer.id,this._audioProducer=null),this.call._closeProducer(t,this.streamName)};return null==k||k.once("transportclose",(()=>D("producer transportclose"))),null==k||k.once("trackended",(()=>D("producer trackended"))),this.call._closed||(O?(this.call._removeMessage(h.TROUBLESHOOTING.NO_WEBCAM),this.call.emit("CALL_ADD_PRODUCER",{streamerName:this.streamName,producer:{id:k.id,kind:f,streamName:this.streamName,streamType:null!==(v=t.streamType)&&void 0!==v?v:u.CUSTOM_STREAM_TYPE,paused:k.paused,track:k.track,codec:null!==(_=null===(b=null===(y=k.rtpParameters)||void 0===y?void 0:y.codecs[0])||void 0===b?void 0:b.mimeType.split("/")[1])&&void 0!==_?_:"",preview:r}})):(this.call._removeMessage(h.TROUBLESHOOTING.NO_MIC),this.call.emit("CALL_ADD_PRODUCER",{streamerName:this.streamName,producer:{id:k.id,kind:m,streamName:this.streamName,streamType:null!==(S=t.streamType)&&void 0!==S?S:u.CUSTOM_STREAM_TYPE,paused:k.paused,track:k.track,codec:null!==(C=null===(E=null===(w=k.rtpParameters)||void 0===w?void 0:w.codecs[0])||void 0===E?void 0:E.mimeType.split("/")[1])&&void 0!==C?C:"",preview:r}})),this.ctx.logger.debug("producer set",{...this.logData,kind:e,producerId:k.id})),null==A||A.closed||(A.close(),this.call._closeProducer(A.id,this.streamName)),k}disableAudio(){if(null!=this._audioProducer){this.ctx.logger.debug("disableAudio",{...this.logData});try{this._audioProducer.close()}catch(e){const t=e instanceof Error?e.message:"unknown error";throw this.ctx.logger.error("unable to close audio producer",{err:t,...this.logData}),e}this.call._closeProducer(this._audioProducer.id,this.streamName),this._audioProducer=null}else this.ctx.logger.warn("stream.disableAudio: calling disableAudio without an audio producer",{...this.logData})}pauseAudio(){null!=this._audioProducer?(this.ctx.logger.debug("pauseAudio",{...this.logData}),this._audioProducer.pause(),this.call._pauseProducer(this._audioProducer.id,this.streamName)):this.ctx.logger.warn("stream.pauseAudio: calling pauseAudio without an audio producer",{...this.logData})}async enableAudio(e={},t=!1,r=!1){var n,i,o;if(this.ctx.logger.debug("enableAudio",{...this.logData}),null==this._audioProducer||this._audioProducer.closed||t){if(null==this._audioStreamProvider){const e="no default audio stream retriever";throw this.ctx.logger.error(e,{...this.logData}),new Error(e)}try{const t={...e,streamType:null!==(n=this._videoStreamProviderType)&&void 0!==n?n:u.CUSTOM_STREAM_TYPE};await this._setProducer(m,t,r)}catch(e){const t=e instanceof Error?e.message:"unknown error";throw this.ctx.logger.warn("unable to set up audio producer",{err:t,...this.logData}),e}(null===(o=null===(i=this._audioProducer)||void 0===i?void 0:i.track)||void 0===o?void 0:o.enabled)||this.pauseAudio()}else this._audioProducer.resume(),this.call._resumeProducer(this._audioProducer.id,this.streamName)}async enableVideo(e={},t=!1,r=!1){var n,i,o;if(this.ctx.logger.debug("enableVideo",{...this.logData,options:e,refresh:t,preview:r}),null==this._videoProducer||this._videoProducer.closed||t){if(null==this._videoStreamProvider){const e="no default video stream retriever";throw this.ctx.logger.error(e,{...this.logData}),new Error(e)}try{const t={...e,streamType:null!==(n=this._videoStreamProviderType)&&void 0!==n?n:u.CUSTOM_STREAM_TYPE};await this._setProducer(f,t,r)}catch(e){const t=e instanceof Error?e.message:"unknown error";throw this.ctx.logger.warn("unable to set up video producer",{err:t,...this.logData}),e}(null===(o=null===(i=this._videoProducer)||void 0===i?void 0:i.track)||void 0===o?void 0:o.enabled)||this.pauseVideo()}else this._videoProducer.resume(),this.call._resumeProducer(this._videoProducer.id,this.streamName)}disableVideo(){if(null!=this._videoProducer){this.ctx.logger.debug("disableVideo",{...this.logData});try{this._videoProducer.close()}catch(e){const t=e instanceof Error?e.message:"unknown error";throw this.ctx.logger.error("unable to close video producer",{err:t,...this.logData}),e}this.call._closeProducer(this._videoProducer.id,this.streamName),this._videoProducer=null}else this.ctx.logger.warn("stream.disableVideo: calling disable video without a video producer",{...this.logData})}pauseVideo(){null!=this._videoProducer?(this.ctx.logger.debug("pauseVideo",{...this.logData}),this._videoProducer.pause(),this.call._pauseProducer(this._videoProducer.id,this.streamName)):this.ctx.logger.warn("stream.pauseVideo: calling pause video without a video producer",{...this.logData})}async hotswapProducer(e,t){var r,n;try{null==t.streamType&&(t.streamType="video"===e?null!==(r=this._videoStreamProviderType)&&void 0!==r?r:u.CUSTOM_STREAM_TYPE:null!==(n=this._audioStreamProviderType)&&void 0!==n?n:u.CUSTOM_STREAM_TYPE),await this._setProducer(f,t,!1,!0)}catch(r){const n=r instanceof Error?r.message:"unknown error";throw this.ctx.logger.warn("unable to hotswap producer",{kind:e,producerOptions:t,err:n,...this.logData}),r}}_reduceGain(){var e,t;null!=this._gainNode&&(this._gainNode.gain.cancelScheduledValues(null!==(e=null==p?void 0:p.currentTime)&&void 0!==e?e:0),this._gainNode.gain.exponentialRampToValueAtTime(.5,null!==(t=null==p?void 0:p.currentTime)&&void 0!==t?t:0))}_restoreGain(){var e,t;null!=this._gainNode&&null!=this._baseGainValue&&(this._gainNode.gain.cancelScheduledValues(null!==(e=null==p?void 0:p.currentTime)&&void 0!==e?e:0),this._gainNode.gain.exponentialRampToValueAtTime(this._baseGainValue,(null!==(t=null==p?void 0:p.currentTime)&&void 0!==t?t:0)+30))}close(e=!0){null!=this._audioProducer&&(e&&this.call._closeProducer(this._audioProducer.id,this.streamName),this._audioProducer.close(),this._audioProducer=null),null!=this._videoProducer&&(e&&this.call._closeProducer(this._videoProducer.id,this.streamName),this._videoProducer.close(),this._videoProducer=null),null!=this._echoDetector&&(this._echoDetector.close(),this._echoDetector=null)}toJSON(){var e,t;return{audioProducer:null==this.audioProducer?null:{id:this.audioProducer.id,closed:this.audioProducer.closed,paused:this.audioProducer.paused,trackId:null===(e=this.audioProducer.track)||void 0===e?void 0:e.id},videoProducer:null==this.videoProducer?null:{id:this.videoProducer.id,closed:this.videoProducer.closed,paused:this.videoProducer.paused,trackId:null===(t=this.videoProducer.track)||void 0===t?void 0:t.id},aggregates:{support:this.ctx.support.hash,...(0,i.extractAggregates)(this.call),streamName:this.streamName}}}}g.displayName="PvcStream",t.default=g},18741:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultOptions=void 0,t.isJwtToken=d;const n=r(31635),i=n.__importDefault(r(37007)),o=n.__importDefault(r(14744)),a=r(82837),s=r(41278),l=n.__importDefault(r(28441)),c=r(86729),u=r(59703);function d(e){try{return(0,s.jwtDecode)(e),!0}catch(e){return!1}}t.defaultOptions={timeout:3e4,headers:{Accept:"application/json"}};class h extends i.default{constructor(e){var r,n,i,s,d,p,f,m;super(),this._stopped=!1,this._fatalError=null,this._token=null,this._retry=0,this._retries=[0,200,1e3,3e3],this._autorefresh=null,this._url=null;const g=null!==(r=null==e?void 0:e.logger)&&void 0!==r?r:new a.LoggerCore("VDC-core");null==e||delete e.logger;const v=null!==(i=null===(n=null==e?void 0:e.loggerConfig)||void 0===n?void 0:n.clientName)&&void 0!==i?i:"VDC",y=g.getLoggerMeta("client"),b=g.getLoggerMeta("release"),_=g.getLoggerMeta("package");if(g.setLoggerMeta("package",null!=_&&"VDC-core"!==_?`${_}/VDC-core`:"VDC-core").setLoggerMeta("client",null!=y?`${y}/${v}`:v).setLoggerMeta("release",null!=b?`${b}/${l.default.version}`:l.default.version).setLoggerMeta("commitHash",l.default.commit).setLoggerMeta("contextId",null!==(s=(0,u.contextId)())&&void 0!==s?s:"").setLoggerMeta("instanceId",null!==(d=(0,u.instanceId)())&&void 0!==d?d:"").appendChain(h),this.logger=g,this.options=(0,o.default)(t.defaultOptions,e),null!=e.endpoint||null!=(null==e?void 0:e.bootstrap)){if(null!=(null===(p=this.options.bootstrap)||void 0===p?void 0:p.token)&&(this._token=this.options.bootstrap.token,this.logger.setMessageAggregate("token",null!==(f=this._token)&&void 0!==f?f:"undefined"),this.logger.info("auth token set from bootstrap value")),this._headers=this.options.headers,null==this._token)this._retryRequest();else if(null!=(null===(m=this.options.bootstrap)||void 0===m?void 0:m.expire)){const e=this.options.bootstrap.expire.getTime()-Date.now()-6e4;this._autorefresh=c.device.setTimeout((()=>{this._autorefresh=null,this._stopped||this._retryRequest()}),e)}}else this.validationError("endpoint or bootstrap must be configured for auth")}async requestAsync(){return new Promise(((e,t)=>{this.request(((r,n,i)=>{null==r?e([null!=n?n:null,null!=i&&i]):t(r)}))}))}validationError(e){const t=new Error(e);this._fatalError=t,this._stopped=!0,this.logger.error(e,{errName:null==t?void 0:t.name,errStack:null==t?void 0:t.stack})}destroy(){this.logger.info("destroy()"),this._stopped=!0}request(e){if(this._fatalError)return void e(this._fatalError);if(null!=this._token)return this.logger.debug("existing token returned on token request"),void e(null,this._token,d(this._token));const t=()=>{this.removeListener("fatal",r),c.device.clearTimeout(n),this.logger.debug("new token returned on token request"),e(null,this._token,d(this._token))},r=()=>{this.removeListener("token",t),c.device.clearTimeout(n),this.logger.debug("new token returned on token request"),e(this._fatalError)},n=c.device.setTimeout((()=>{this.removeListener("token",t),this.removeListener("fatal",r),this.logger.info("token request timeout"),e(new Error("authorization: timeout"))}),this.options.timeout);this.once("token",t),this.once("fatal",r)}refreshToken(e){var t;return this.logger.debug("refreshToken called",{token:e}),null==e&&null==this._token?(this.logger.debug("no token to refresh"),!1):null!=e?(this._token=e,this.logger.setMessageAggregate("token",null!==(t=this._token)&&void 0!==t?t:"undefined"),this.logger.info("token manually set from refreshToken"),this._fatalError=null,null!=this._autorefresh&&(c.device.clearTimeout(this._autorefresh),this._autorefresh=null),!0):!this._fatalError&&(null!=this._token&&(null!=this._autorefresh&&(c.device.clearTimeout(this._autorefresh),this._autorefresh=null),this._token=null,this.logger.removeMessageAggregate("token"),(()=>{this._retryRequest()})()),!0)}ensureToken(e){null!=this._token?e():this.once("token",(()=>{e()}))}_parseJSON(e){return e.text().then((e=>{if(e)try{return JSON.parse(e)}catch(e){}return{}}))}_retryRequest(){const e=this._retries[this._retry];e?setTimeout((()=>{this._makeRequest()}),e):this._makeRequest()}toJSON(){return{}}_tokenSuccess(e){this._token=e,this.logger.setMessageAggregate("token",this._token),this._retry=0,setTimeout((()=>{this.emit("token",{token:e})}))}async _makeRequest(){var e,t,r;if(null!=(null===(t=null===(e=this.options)||void 0===e?void 0:e.bootstrap)||void 0===t?void 0:t.refreshToken))try{const e=await this.options.bootstrap.refreshToken();return this._tokenSuccess(e),void this.logger.info("token set from async bootstrap refreshToken")}catch(e){return void(e instanceof Error&&(this._fatalError=e,this.logger.warn("unable to refresh token from bootstrap function",{errName:null==e?void 0:e.name,errStack:null==e?void 0:e.stack}),this.emit("fatal")))}if(null==(null===(r=this.options)||void 0===r?void 0:r.endpoint))throw new Error("authorization: no ability to refresh token (boostrap or endpoint)");-1===this.options.endpoint.uri.indexOf("?")?this._url=`${this.options.endpoint.uri}?scope=${this.options.endpoint.scope}`:this._url=`${this.options.endpoint.uri}&scope=${this.options.endpoint.scope}`,this._handleFetch()}async _handleFetch(){if(null!=this._url)try{const e=await c.device.fetch(this._url,{credentials:"same-origin",headers:this._headers});this._handleFetchResponse(e)}catch(e){if(this._token=null,this.logger.removeMessageAggregate("token"),e instanceof TypeError)return this._fatalError=e,this.logger.error(e.message,{errName:null==e?void 0:e.name,errStack:null==e?void 0:e.stack}),void this.emit("fatal");this.logger.network("unable to refresh token from endpoint",{}),this._retryRequest(),this._retry=200&&e.status<300)){var t;if(401===e.status)throw new Error("authorization: unauthorized");if(403===e.status)throw new Error("authorization: forbidden");throw new Error("authorization: non-200 response code from auth server")}{const r=this._parseJSON(e);if((void 0!==(t=r).token||void 0!==t.expire)&&(null!=(null==r?void 0:r.token)&&(this._tokenSuccess(r.token),this.logger.info("token set from request response")),null!=(null==r?void 0:r.expire))){const e=new Date(r.expire).getTime()-Date.now()-6e4;this._autorefresh=c.device.setTimeout((()=>{this._autorefresh=null,this._stopped||(this.logger.info("refreshing token before expiration"),this._retryRequest())}),e)}}}}h.displayName="Authorization",t.default=h},54873:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.makeBounded=function(e,t=[],r=!1){var n,i,o;if(null==e||"object"!=typeof e)throw new Error("bindMethods works only on objects");const a=function(e){let t={},r=e;for(;null!=r&&r!==Object.prototype;)t={...Object.getOwnPropertyDescriptors(r),...t},r=Object.getPrototypeOf(r);return t}(e),c=Object.keys(a).filter((e=>!t.includes(e)));for(const t of c){const c=Object.getOwnPropertyDescriptor(e,t),d=a[t].value;if("function"==typeof d&&"constructor"!==t&&(null==c||c.configurable)){let a=d.bind(e);Reflect.defineProperty(a,"name",{configurable:!0,value:(u=e,String("displayName"in u.constructor?u.constructor.displayName:u.constructor.name)+"."+d.name)}),r&&(a="dispose"===t?l(e,d):s(e,d)),Object.defineProperty(e,t,{value:a,configurable:null===(n=null==c?void 0:c.configurable)||void 0===n||n,enumerable:null!==(i=null==c?void 0:c.writable)&&void 0!==i&&i,writable:null!==(o=null==c?void 0:c.writable)&&void 0!==o&&o})}}var u;return e};const n=r(31635).__importStar(r(8139)),i=r(98645),o=r(66543),a=new WeakMap;function s(e,t){return function(...r){var n;if("object"==typeof e&&e.isDisposed){const r=a.get(e),s=null==r?"":(0,o.formatStacktrace)(r),l=new i.DisposedObjectError("call on the disposed object",{className:null!==(n=e.constructor.displayName)&&void 0!==n?n:e.constructor.name,method:t.name});if("object"!=typeof e.ctx||"object"!=typeof e.ctx.logger||"function"!=typeof e.ctx.logger.error)throw l;e.ctx.logger.error(l.message,{err:l,target:e.name,method:t.name,stacktrace:s})}return t.apply(e,r)}}function l(e,t){return function(...r){return n.get().then((t=>{a.set(e,t)})),t.apply(e,r)}}},75477:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.supportsMediasoupWebrtc=t.supportsFlvHttp=t.supportsNativeHls=t.supportsMp4=t.supportsHlsjs=t.H264_CAPABILITY=t.OPUS_CAPABILITY=t.VP8_CAPABILITY=void 0,t.getNetworkConnectionType=function(){var e,t;let r="information unavailable",n="information unavailable";return i.device.isImplements(i.Feature.NETWORK_INFORMATION)&&((null===(e=null===i.device||void 0===i.device?void 0:i.device.connection)||void 0===e?void 0:e.type)&&(r=i.device.connection.type),(null===(t=null===i.device||void 0===i.device?void 0:i.device.connection)||void 0===t?void 0:t.effectiveType)&&(n=i.device.connection.effectiveType)),[r,n]};const n=r(82837),i=r(86729),o=r(6640),a=r(99670),s=r(65414);t.VP8_CAPABILITY={clockRate:9e4,kind:"video",mimeType:"video/VP8"},t.OPUS_CAPABILITY={channels:2,clockRate:48e3,kind:"audio",mimeType:"audio/opus"},t.H264_CAPABILITY={clockRate:9e4,kind:"video",mimeType:"video/H264",parameters:{"packetization-mode":1}},t.supportsHlsjs=e=>{var t;return i.device.isImplements(i.Feature.HLSJS)?i.device.isSafari?(null==e||e.info("HlsJsPlayer is NOT supported in Safari, use Native Hls player instead",{...i.device.browserInfo,platform:i.device.platform}),!1):(0,s.oldWindowsChrome)(i.device)?(null==e||e.info("HlsJsPlayer is NOT supported",{...i.device.browserInfo}),!1):i.device.isImplements(i.Feature.MEDIA_SOURCE)&&(null===(t=i.device.MediaSource)||void 0===t?void 0:t.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'))?(null==e||e.debug("HlsJsPlayer is supported",{...i.device.browserInfo,platform:i.device.platform}),!0):(null==e||e.info("HlsJsPlayer is NOT supported",{...i.device.browserInfo,platform:i.device.platform}),!1):(null==e||e.info("HlsJsPlayer is NOT supported"),!1)},t.supportsMp4=e=>{var t;return(0,s.safariWithoutMp4Support)(i.device)||i.device.isIE||(0,s.chromeWithoutMp4Support)(i.device)?(null==e||e.info("MP4Player is NOT supported",{...i.device.browserInfo,platform:i.device.platform}),!1):i.device.isImplements(i.Feature.WEB_SOCKET)&&i.device.isImplements(i.Feature.MEDIA_SOURCE)&&i.device.isImplements(i.Feature.MEDIA_DEVICE)&&i.device.isImplements(i.Feature.LOCAL_STORAGE)&&i.device.isImplements(i.Feature.DEBUGGING)&&(null===(t=i.device.MediaSource)||void 0===t?void 0:t.isTypeSupported('video/mp4; codecs="avc1.4d4028,mp4a.40.2"'))?(null==e||e.debug("MP4Player is supported",{...i.device.browserInfo,platform:i.device.platform}),!0):(null==e||e.info("MP4Player is NOT supported",{...i.device.browserInfo,platform:i.device.platform}),!1)},t.supportsNativeHls=e=>{if(null==i.device.isIosDevice||!i.device.isIosDevice&&!i.device.isSafari)return null==e||e.debug("NativeHlsPlayer is NOT supported on non Safari browsers outside of iOS"),!1;if(!i.device.isImplements(i.Feature.CREATE_VIDEO_ELEMENT))return null==e||e.info("NativeHlsPlayer is NOT supported"),!1;const t=i.device.createVideoElement();return!(e=>"canPlayType"in e&&"function"==typeof e.canPlayType)(t)||"probably"!==t.canPlayType("application/vnd.apple.mpegURL")&&"maybe"!==t.canPlayType("application/vnd.apple.mpegURL")?(null==e||e.info("NativeHlsPlayer is NOT supported",{...i.device.browserInfo}),!1):(null==e||e.debug("NativeHlsPlayer is supported",{...i.device.browserInfo,platform:i.device.platform}),!0)},t.supportsFlvHttp=async e=>{var t,r;if(i.device.isSafari)return null==e||e.debug("FlvHttpPlayer is NOT supported on non Safari browsers"),!1;if(i.device.isImplements(i.Feature.MPEGTS)){await i.device.loadMpegtsScript();const n=null!==(r=null===(t=i.device.mpegts)||void 0===t?void 0:t.isSupported())&&void 0!==r&&r;return n||null==e||e.info("FlvHttpPlayer is NOT supported"),n}return null==e||e.debug("NativeHlsPlayer is supported",{...i.device.browserInfo}),!0},t.supportsMediasoupWebrtc=async(e,r)=>{const s=new o.Support(r?new n.LoggerCore("VDC-core").extend(r):new n.LoggerCore("VDC-core"));if(await s.ready,!s.supports("h264"))return!1;if(!i.device.isImplements(i.Feature.MEDIA_STREAM))return null==r||r.info(`${e} is NOT supported`),!1;const l=[t.OPUS_CAPABILITY];i.device.isAndroidDevice?l.push(t.VP8_CAPABILITY):l.push(t.H264_CAPABILITY);try{const t=(0,a.createMediasoupDevice)();await t.load({routerRtpCapabilities:{codecs:l}});const n={audio:t.canProduce("audio"),video:t.canProduce("video")};return t.canProduce("audio")&&t.canProduce("video")?(null==r||r.debug(`${e} is supported`,{browserInfo:i.device.browserInfo,avSupport:n}),!0):(null==r||r.info(`${e} is NOT supported`,{browserInfo:i.device.browserInfo,avSupport:n}),!1)}catch(t){return null==r||r.info(`${e} is NOT supported`,{...i.device.browserInfo}),!1}}},45829:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),r(31635).__exportStar(r(75477),t)},93503:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NullContext=t.cancelFuncKey=t.cancelPromiseKey=t.canceledKey=t.childrenKey=t.idKey=void 0,t.context=function(e,r=t.NullContext){const n=r===t.NullContext?{}:r,o={...n,...e,[t.idKey]:i++,[t.childrenKey]:[],[t.canceledKey]:!1,[t.cancelFuncKey]:()=>{}};return o[t.cancelPromiseKey]=new Promise((e=>{o[t.cancelFuncKey]=e})).then((e=>(o[t.canceledKey]=!0,e))),null!=n[t.childrenKey]&&(n[t.childrenKey].push(o),n[t.canceledKey]&&o[t.cancelFuncKey]("parent context is canceled")),o},t.walk=o,t.cancel=function(e,r="not specified"){if(e[t.canceledKey])return;const i=o(e,[],!0);for(const e of i)n.device.setTimeout((()=>{e[t.cancelFuncKey](r),e[t.canceledKey]=!0}),0)},t.onceCanceled=function(e){return e[t.cancelPromiseKey]};const n=r(86729);t.idKey=Symbol("id"),t.childrenKey=Symbol("children"),t.canceledKey=Symbol("canceled"),t.cancelPromiseKey=Symbol("cancelPromise"),t.cancelFuncKey=Symbol("cancelFunc");let i=1;function o(e,r=[],n=!1){for(const i of e[t.childrenKey])o(i,r,n);return n&&e[t.childrenKey].splice(0,e[t.childrenKey].length),r.push(e),r}t.NullContext={[t.idKey]:0,[t.childrenKey]:[],[t.canceledKey]:!1,[t.cancelPromiseKey]:Promise.resolve("null context"),[t.cancelFuncKey]:()=>{}}},20379:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hasVcContext=function(e){if("object"!=typeof e||!("ctx"in e))return!1;const t=e.ctx;return"object"==typeof t&&"object"==typeof t.logger&&"object"==typeof t.support&&"object"==typeof t.videoClient}},66543:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.filterStacktrace=s,t.formatStacktrace=function(e,t=!0){return t?s(e).map((e=>`\tat ${e.functionName} (${e.fileName}:${e.lineNumber})`)).join("\n"):e.map((e=>`\tat ${e.functionName}`)).join("\n")},t.startMobxDebugging=function(){const e=i.device.isImplements(i.Feature.LOCAL_STORAGE)?i.device.localStorage.getItem("mobxDebug"):"";if("true"===e||"flat"===e){const t="flat"!==e,r=i.device.globals.get("mobxSpyDisposer");"function"==typeof r&&r();const o=(0,n.spy)((e=>{var r,n;let i=e.type,o=null!==(r=e.name)&&void 0!==r?r:"";switch(i){case"action":"object"==typeof e.object&&(o=`${e.object.constructor.name}.${o}`);break;case"add":case"delete":case"create":case"remove":case"splice":case"update":o=null!==(n=null==e.name?e.debugObjectName:`${e.debugObjectName}.${e.name}`)&&void 0!==n?n:""}o.startsWith("event:")&&(i=`event ${i}`,o=o.slice(6)),e.observableKind&&(o=`${e.observableKind} ${o}`);const a=Object.entries(e).filter((([e,t])=>!l.includes(e)));if(e.spyReportStart)t?(console.groupCollapsed(i,o),console.groupCollapsed("stacktrace"),console.trace(),console.groupEnd()):console.log(`%c${e.type}`,"font-weight: bold",o,Object.fromEntries(a));else{if("report-end"===e.type)return void(t&&console.groupEnd());console.log(`%c${e.type}`,"font-weight: bold",o)}t&&a.length>0&&console.log(Object.fromEntries(a))}));i.device.globals.set("mobxSpyDisposer",o)}};const n=r(27813),i=r(86729),o=/.*(bootstrap.*|node_modules.*|disposable\.ts)$/;function a(e){var t;const r=e.split("/");let n=null;for(;"src"!==n&&r.length>1;)n=null!==(t=r.shift())&&void 0!==t?t:null;return"src"===n&&r.unshift(n),`/${r.join("/")}`}function s(e){return e.filter((e=>{var t;return!o.test(null!==(t=e.fileName)&&void 0!==t?t:"")})).map((e=>{var t;return{...e,fileName:a(null!==(t=e.fileName)&&void 0!==t?t:"")}}))}const l=["name","type","spyReportStart","debugObjectName","observableKind"]},30799:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InstanceCollector=void 0;const n=r(50543);class i extends n.EventEmitter{constructor(e){super(),this.options=e,this.objects=new Map,this.metas=new WeakMap,this.isDisposed=!1,i.instances.add(this);for(const t of e.classes)this.objects.set(t,new Set)}doesCollect(e){return this.options.classes.includes(e)}insertObject(e,t,r){this.objects.get(e).add(t),null!=r&&this.metas.set(t,r),t instanceof n.EventEmitter&&t.once("disposed",(()=>this.objects.get(e).delete(t)))}removeObject(e,t){var r;null===(r=this.objects.get(e))||void 0===r||r.delete(t),this.metas.delete(t)}static reportNewInstance(e,t,r){for(const n of i.instances.values())n.doesCollect(e)&&n.insertObject(e,t,r)}static disposeInstance(e,t){for(const r of i.instances.values())r.removeObject(e,t)}getObjects(e){return this.objects.has(e)?Array.from(this.objects.get(e).values()).map((e=>{var t;return[e,null!==(t=this.metas.get(e))&&void 0!==t?t:{}]})):[]}dispose(e){this.isDisposed=!0,i.instances.delete(this),this.emit("disposed")}}t.InstanceCollector=i,i.instances=new Set,"object"==typeof r.g&&null!=r.g&&(r.g._VDC_InstanceCollector=i)},39946:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dumpVideoElement=function(e){var t,r,i,o;if(null==e)return{};const a={playDebugHasSrcObject:null!=e.srcObject,playDebugMuted:e.muted,playDebugPaused:e.paused,playDebugHeight:e.videoHeight,playDebugWidth:e.videoWidth,playDebugAutoplay:e.autoplay,playDebugReadyState:e.readyState,playDebugPlaysInLineAttr:null!==(t=e.getAttribute("playsinline"))&&void 0!==t?t:"undefined",playDebugWebkitPlaysInLineAttr:null!==(r=e.getAttribute("webkit-playsinline"))&&void 0!==r?r:"undefined"};return(0,n.isMediaStream)(e.srcObject)&&(a.playDebugHasAudioTrack=(null===(i=e.srcObject)||void 0===i?void 0:i.getAudioTracks().length)>0,a.playDebugHasVideoTrack=(null===(o=e.srcObject)||void 0===o?void 0:o.getVideoTracks().length)>0),a};const n=r(26156)},28993:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.disposeObjects=function(e,t,r){var a;const s=e.constructor,l=null!==(a=null==s?void 0:s.displayName)&&void 0!==a?a:s.name;e.isDisposed||((0,o.hasVcContext)(e)&&(e.ctx.logger.trace(`dispose() ${r}`,{aggregates:{reason:r}}),(0,i.cancel)(e.ctx,`${l} disposed: ${r}`)),t.forEach((t=>{try{t(`${l} inner disposer: ${r}`)}catch(t){(0,o.hasVcContext)(e)&&e.ctx.logger.error("error in dispose logic",{object:(0,n.isSerializableObject)(e)?e:`${e}`,className:l,err:`${t}`,reason:r})}})),t.splice(0,t.length))};const n=r(43375),i=r(93503),o=r(20379)},45831:(e,t,r)=>{"use strict";var n,i;Object.defineProperty(t,"__esModule",{value:!0}),t.ObservableEventEmitter=void 0;const o=r(50543),a=r(27813),s=r(86729),l=r(98645),c=r(54873),u=r(93503),d=r(20379),h=r(28993);function p(e,t){return(0,a.isObservableProp)(e,t)||(0,a.isComputedProp)(e,t)}const f=Symbol("Emitter"),m=Symbol("Observers");t.ObservableEventEmitter=class{constructor(e=!0){this[n]=new o.EventEmitter,this[i]=new Map,this.disposers=[],this.disposed=!1,this.disposing=!1,e&&(0,c.makeBounded)(this,[],!1)}startEmitting(e){if(this[m].has(e))return;const t=this[f].emit.bind(this[f],e),r=(0,a.reaction)(function(e,t){return()=>e[t]}(this,e),t,{name:`event:${this.constructor.name}.${String(e)}`});this[m].set(e,r)}stopEmitting(e){var t;null===(t=this[m].get(e))||void 0===t||t(),this[m].delete(e)}setMaxListeners(e){return this[f].setMaxListeners(e),this}getMaxListeners(){return this[f].getMaxListeners()}addListener(e,t){return this[f].addListener(e,t),p(this,e)&&this.startEmitting(e),this}emit(e,t,...r){return this[f].emit(e,t,...r)}off(e,t){return this[f].off(e,t),0===o.EventEmitter.listenerCount(this[f],e)&&this.stopEmitting(e),this}on(e,t){return this[f].on(e,t),p(this,e)&&this.startEmitting(e),this}once(e,t){return this[f].once(e,t),p(this,e)&&this.startEmitting(e),this}prependListener(e,t){return this[f].prependListener(e,t),p(this,e)&&this.startEmitting(e),this}prependOnceListener(e,t){return this[f].prependOnceListener(e,t),p(this,e)&&this.startEmitting(e),this}removeAllListeners(e){this[f].removeAllListeners(e);for(const e of this[m].keys())this.stopEmitting(e);return this}removeListener(e,t){return this[f].removeListener(e,t),0===o.EventEmitter.listenerCount(this[f],e)&&this.stopEmitting(e),this}addInnerDisposer(...e){for(const t of e)"function"==typeof t?this.disposers.unshift(t):this.disposers.unshift(t.dispose.bind(t))}autorun(e){this.addInnerDisposer((0,a.autorun)(e))}get isDisposed(){return this.disposed}emitError(e){this[f].emit("error",e),!e.isMuted&&(0,d.hasVcContext)(this)&&l.VideoClientErrorDeprecated.log(e,this.ctx.logger)}throwError(e){throw this.emitError(e),e}throwErrorDeprecated(e){throw this.emitErrorDeprecated(e),e}emitErrorDeprecated(e){try{this[f].emit("error",e),e.critical&&this.dispose(`due error: ${e.code}`)}catch(t){(0,d.hasVcContext)(this)?this.ctx.logger.error("error handler throws another error",{err:e,handlerErr:(0,l.wrapNativeError)(t)}):s.device.isImplements(s.Feature.DEBUGGING)&&s.device.console.error("error handler throws another error",{err:e,handlerErr:t})}}dispose(e="not provided"){this.disposed||this.disposing||(this.disposing=!0,(0,h.disposeObjects)(this,this.disposers,e),this.removeAllListeners(),(0,d.hasVcContext)(this)&&(0,u.cancel)(this.ctx),this.disposed=!0,this.emit("disposed"))}},n=f,i=m},75440:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSilentAudioTrack=t.uuidv4=void 0;var n=r(63725);Object.defineProperty(t,"uuidv4",{enumerable:!0,get:function(){return n.uuidv4}});var i=r(81179);Object.defineProperty(t,"createSilentAudioTrack",{enumerable:!0,get:function(){return i.createSilentAudioTrack}})},80366:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNamedClass=function(e){return"string"==typeof Reflect.get(e,"displayName")},t.extendContext=function(e,t){return(0,o.context)({logger:new n.LoggerCore(i.PACKAGE_NAME).extend(e.logger).appendChain(t),chain:`${e.chain}:${t.displayName}`},e)};const n=r(82837),i=r(59703),o=r(93503)},99670:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMediasoupDevice=function(){return new n.Device};const n=r(70076)},31755:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EventsHandler=t.originalTarget=t.removeProxy=t.addProxy=t.emitterMethods=void 0;const r=["disposed"];function n(e){return"setMaxListeners"in e&&"getMaxListeners"in e}t.emitterMethods=new Map(Object.entries({addListener:"addListener",on:"addListener",prependListener:"prependListener",removeListener:"removeListener",off:"removeListener"})),t.addProxy=Symbol("AddProxy"),t.removeProxy=Symbol("RemoveProxy"),t.originalTarget=Symbol("originalTarget"),t.EventsHandler=class{constructor(){this.proxies=new WeakMap,this.proxyEvents=new WeakMap}getOrCreateEvent(e){let t=this.proxyEvents.get(e);return null==t&&(t=[],this.proxyEvents.set(e,t)),t}addProxy(e,t){var r,i;if(n(e)&&n(t)){const r=e.getMaxListeners();t.getMaxListeners(){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SyncHandler=t.implementation=void 0;const n=r(50543),i=r(82837),o=r(27813),a=r(80366),s=r(31755);class l{constructor(e,t){this.key=e,this._fn=t,this.stack=[]}get wrapper(){const e=this,t=function(...t){return e.apply(this,t)};return Object.defineProperty(t,"name",{value:`${String(this.key)}SyncWrapper`}),t}get fn(){return this._fn}set fn(e){this._fn=e,null!=e&&(this.stack.forEach((([t,r,n,i])=>{e.apply(t,r).then(n,i)})),this.stack.splice(0,this.stack.length))}postpone(e,t){return new Promise(((r,n)=>{this.stack.push([e,t,r,n])}))}apply(e,t){return null!=this.fn?this.fn.apply(e,t):this.postpone(e,t)}}t.implementation=Symbol("implementation");class c extends s.EventsHandler{constructor(e={}){var t;super(),this.options=e,this.implementation=new WeakMap,this.syncProperties=new WeakMap,this.logger=null!==(t=e.logger)&&void 0!==t?t:new i.LoggerCore("SyncHandler")}sync(e,t,r,n){var i;if(null!=n&&"postpone"===Reflect.get(null!==(i=this.options.methods)&&void 0!==i?i:{},r))return void(t.method.fn=Reflect.get(n,r));null!=n&&t.changed&&Reflect.set(n,r,t.val),this.updateReaction(e,t,r,n);const o=null==n?void 0:Reflect.get(n,r);t.changed||t.val===o||(t.val=o,t.atom.reportChanged())}updateReaction(e,t,r,n){var i;null===(i=t.disposer)||void 0===i||i.call(t),delete t.disposer,null!=n&&(t.disposer=(0,o.reaction)((()=>Reflect.get(n,r)),(e=>{t.val=e,t.atom.reportChanged()}),{name:`proxy:${String(r)}`}))}propBecomeObservable(e,t){var r,n;const i=this.getOrCrateMeta(e,t);this.updateReaction(e,i,t,null!==(n=null===(r=this.implementation.get(e))||void 0===r?void 0:r.impl)&&void 0!==n?n:null)}propBecomeUnobservable(e,t){var r;const n=this.getOrCrateMeta(e,t);null===(r=n.disposer)||void 0===r||r.call(n),delete n.disposer}getOrCrateMeta(e,t){var r,n,i;this.syncProperties.has(e)||this.syncProperties.set(e,new Map);let a=null===(r=this.syncProperties.get(e))||void 0===r?void 0:r.get(t);if(null==a){const r=null===(n=this.implementation.get(e))||void 0===n?void 0:n.impl,s=null==r?void 0:(0,o.untracked)((()=>Reflect.get(r,t)));a={val:s,atom:(0,o.createAtom)(`proxy:${String(t)}`,this.propBecomeObservable.bind(this,e,t),this.propBecomeUnobservable.bind(this,e,t)),changed:!1,method:new l(t,null!=s?s:null)},null===(i=this.syncProperties.get(e))||void 0===i||i.set(t,a)}return a}getObservedProp(e,t){const r=this.getOrCrateMeta(e,t);return r.atom.reportObserved(),r.val}deleteObservedProp(e,t){var r;const n=this.getOrCrateMeta(e,t),i=null===(r=this.implementation.get(e))||void 0===r?void 0:r.impl;return n.val=null==i?void 0:Reflect.get(i,t),n.changed=!1,n.atom.reportObserved(),n.val}reportObservedProp(e,t,r){const n=this.getOrCrateMeta(e,t);n.val=r,n.changed=!0,n.atom.reportChanged()}getObservableImplementation(e){let t=this.implementation.get(e);return null==t&&(t={atom:(0,o.createAtom)("proxy:implementation"),impl:null,sentWarn:!1},this.implementation.set(e,t)),t.atom.reportObserved()||0!==n.EventEmitter.listenerCount(e,"implementation")||t.sentWarn||(t.sentWarn=!0),t.impl}setImplementation(e,t){var r,n,i;for(const[i,o]of null!==(n=null===(r=this.syncProperties.get(e))||void 0===r?void 0:r.entries())&&void 0!==n?n:[])this.sync(e,o,i,t);let a=this.implementation.get(e);null==a&&(a={impl:null,atom:(0,o.createAtom)("proxy:implementation"),sentWarn:!1},this.implementation.set(e,a)),null!=a.impl&&(null===(i=a.impl)||void 0===i||i.emit("detached"),super.removeProxy(e,a.impl)),null!=t&&super.addProxy(e,t),a.impl=t,a.atom.reportChanged(),e.emit("implementation"),null!=t&&(null==t||t.emit("attached"))}getImplMethod(e,t){var r;const n=null===(r=this.implementation.get(e))||void 0===r?void 0:r.impl;if(null!=n){const e=Reflect.get(n,t);if(null!=e&&"function"==typeof e)return e}}get(e,r,n){if(r===s.originalTarget)return e;if(r===t.implementation)return this.getObservableImplementation(e);if(s.emitterMethods.has(r)){const t=s.emitterMethods.get(r);if(null!=t)return this[t].bind(this,e)}if(null!=this.options.methods&&r in this.options.methods){const t=this.getImplMethod(e,r);switch(this.options.methods[r]){case"stub":return null!=t?t:()=>{};case"optional":return t;case"strict":if(null==t)throw new Error(`No implementations of method '${String(r)}' found`);return t;case"postpone":return this.getOrCrateMeta(e,r).method.wrapper}}return Reflect.has(e,r)?Reflect.get(e,r,n):this.getObservedProp(e,r)}set(e,r,n,i){if(r===t.implementation)return(0,o.runInAction)((()=>{this.setImplementation(e,n)})),!0;if(Reflect.has(e,r)){if(!Reflect.set(e,r,n,i)){const t=(0,a.isNamedClass)(e.constructor)?e.constructor.displayName:e.constructor.name;this.logger.warn(`Property '${String(r)}' of class '${t}' is not writable`)}return!0}this.reportObservedProp(e,r,n);const s=this.implementation.get(e);if(null!=(null==s?void 0:s.impl)){if(!Reflect.set(s.impl,r,n)){const e=(0,a.isNamedClass)(s.impl.constructor)?s.impl.constructor.displayName:s.impl.constructor.name;this.logger.warn(`Property '${String(r)}' of class '${e}' is not writable`)}return!0}return!0}deleteProperty(e,r){return r===t.implementation?(this.setImplementation(e,null),!0):Reflect.has(e,r)?Reflect.deleteProperty(e,r):(this.deleteObservedProp(e,r),!0)}}t.SyncHandler=c},78338:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=e=>new Promise(((t,r)=>{e.request(((e,n)=>{null==e&&null!=n?t(n):r(e)}))}))},45799:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getAuthToken=u;const n=r(31635),i=n.__importDefault(r(18638)),o=r(98645),a=n.__importDefault(r(78338)),s=r(86729),l={Accept:"application/json","Content-Type":"application/json"},c={headers:{},failoverUrls:[],reauth:!1,method:"get",warnStatuses:[],callId:""};async function u({auth:e,ctx:t,reauth:r}){let n;r&&e.refreshToken();try{return n=await(0,a.default)(e),n}catch(e){const r=e instanceof Error?e.message:"unknown error";throw t.logger.warn("Authorization error",{err:r}),e}}t.default=async(e,t,r)=>{var n,a,d,h;const p={...c,...r};if(null!=r.auth&&"function"!=typeof r.auth.refreshToken)throw e.logger.error("auth must be a Authorization object"),new Error("auth must be a Authorization object");const f=null!==(n=p.auth)&&void 0!==n?n:null,m=null!==(a=p.headers)&&void 0!==a?a:{},g={...l,...m};let v=t,y=null!==(h=null===(d=p.failoverUrls)||void 0===d?void 0:d.slice())&&void 0!==h?h:[],b=y.length>0;const _=()=>{if(null==y[0])throw new Error("Failover URL is undefined");[v]=y,y=y.slice(1),b=y.length>0},S=async(t=!1)=>{var n,a;let l=null;if(null!=f)try{l=await u({ctx:e,auth:f,reauth:r.reauth})}catch(t){const r=t instanceof Error?t.message:"unknown error";throw e.logger.warn("Authorization error",{err:r}),t}const c={method:null!==(n=r.method)&&void 0!==n?n:"get",headers:null!=l?{...g,Authorization:`bearer ${l}`}:g};if(null!=r.body&&(c.body=r.body),null!=r.query){const e=i.default.stringify(r.query);v=v.includes("?")?`${v}&${e}`:`${v}?${e}`}let d,h;try{d=await s.device.fetch(v,c)}catch(r){const n=r instanceof Error?r.message:"unknown error";if(e.logger.warn("Unable to reach server",{useUrl:v,err:n}),!t&&b)return _(),S(0===y.length);throw r}if(204===d.status)return null;try{h=await d.json()}catch(r){let n;try{n=await d.text()}catch(e){}if(e.logger.warn("Unexpected non-json response from server",{useUrl:v,body:n,statusCode:d.status}),!t&&b)return _(),S(0===y.length);throw r}if(401===d.status||403===d.status){if(null!=f&&!t)try{if(f.refreshToken())return S(!0)}catch(e){throw new Error(`Token may be invalid or expired, status code: ${d.status} error: ${e}`)}throw e.logger.warn("Authorization error from server",{useUrl:v,status:d.status,reasons:null==h?void 0:h.reasons}),new o.NetworkError("Authorization error from server",{status:d.status})}if(null!=r.expectedStatus&&d.status!==r.expectedStatus||200!==d.status){b||(null===(a=r.warnStatuses)||void 0===a?void 0:a.includes(d.status))?e.logger.warn("Unexpected response code from server",{useUrl:v,status:d.status,reasons:null==h?void 0:h.reasons}):e.logger.error("Unexpected response code from server",{useUrl:v,status:d.status,reasons:null==h?void 0:h.reasons});const n=new o.NetworkError("Unexpected response code from server",{status:d.status});if(!t&&b)return _(),S(0===y.length);throw n}return{authToken:l,body:h,status:d.status}};return S()}},54442:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.retry=function(e,t,r,o){return new Promise(((a,s)=>{let l=0;const c=()=>{r(l).then(a).catch((r=>{++l{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSilentAudioTrack=function(e){const t=function(e){const t=e.createBufferSource(),r=e.createBuffer(1,1,e.sampleRate),n=r.getChannelData(0);for(let e=0;e{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={AUTOPLAY_PROGRESS:"autoplay-first-progress",FIRST_LOAD:"first-load",MANIFEST_LOAD:"manifest-load",HLSJS_INIT:"hlsjs-init",M3U8_MANIFEST_LOAD:"m3u8-manifest-load",INDEX_MANIFEST_LOAD:"index-manifest-load",INITIAL_FRAGMENT_LOAD:"initial-fragment-load",JOIN_CALL_ENDPOINT:"join-call-endpoint",SFU_CONNECTION:"sfu-connection",VIDEO_CONSUMER:"video-consumer",FIRST_TIME_UPDATE:"first-time-update"}},54244:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.STATS_EVENTS=t.stats=void 0;const n=r(31635).__importDefault(r(71615));t.STATS_EVENTS=n.default;const i=new(r(9351).Stats);t.stats=i},9351:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Stats=void 0,t.Stats=class{constructor(){this.eventCounter=0,this.timings={}}start(e){this.eventCounter+=1;const t=this.eventCounter;return this.timings[t]={ms:Date.now(),name:e},t}stop(e,t){var r,n;const i=null===(r=this.timings[e])||void 0===r?void 0:r.ms;if(null==i)return{};const o=null!==(n={...t})&&void 0!==n?n:{};return o.ms=Date.now()-i,delete this.timings[e],o}}},61677:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hasH264=t.hasVP8=t.getGlobalDocument=t.hasOpus=t.hasH264Capability=t.hasVP8Capability=t.hasOpusCapability=void 0,t.checkCapabilitiesForRoom=s;const n=r(86729),i=r(51327),o=r(45829),a=r(99670);async function s(e){try{const t=(0,a.createMediasoupDevice)();return await t.load({routerRtpCapabilities:e}),{audio:t.canProduce("audio"),video:t.canProduce("video")}}catch(e){throw new Error(`current browser/device not supported: ${e}`)}}t.hasOpusCapability=async e=>{let t;try{t=await s({codecs:[o.OPUS_CAPABILITY]})}catch(t){const r=t instanceof Error?t.message:"unknown error";return null==e||e.warn("support: no opus capabilities support",{...n.device.browserInfo,err:r}),!1}return t.audio?(null==e||e.debug("support: have opus capabilities support",{...n.device.browserInfo}),!0):(null==e||e.warn("support: no opus capabilities support",{...n.device.browserInfo}),!1)},t.hasVP8Capability=async e=>{let t;try{t=await s({codecs:[o.VP8_CAPABILITY]})}catch(t){const r=t instanceof Error?t.message:"unknown error";return null==e||e.warn("support: no vp8 capabilities support",{...n.device.browserInfo,err:r}),!1}return t.video?(null==e||e.debug("support: have vp8 capabilities support",{...n.device.browserInfo}),!0):(null==e||e.warn("support: no vp8 capabilities support",{...n.device.browserInfo}),!1)},t.hasH264Capability=async e=>{let t;try{t=await s({codecs:[o.H264_CAPABILITY]})}catch(t){const r=t instanceof Error?t.message:"unknown error";return null==e||e.warn("support: no h264 capabilities support",{...n.device.browserInfo,err:r}),!1}return t.video?(null==e||e.debug("support: have h264 capabilities support",{...n.device.browserInfo}),!0):(null==e||e.warn("support: no h264 capabilities support",{...n.device.browserInfo}),!1)},t.hasOpus=()=>!0,t.getGlobalDocument=()=>globalThis.document,t.hasVP8=()=>{try{if(null==(0,t.getGlobalDocument)())return!0}catch(e){return!0}return!n.device.isIosDevice&&!n.device.isSafari&&!n.device.isEdge},t.hasH264=e=>{try{if(null==(0,t.getGlobalDocument)())return!0}catch(e){return!0}if(n.device.isChrome){if(!n.device.isImplements(i.Feature.MEDIA_RECORDER))return null==e||e.flush(),!1;if(n.device.MediaRecorder.isTypeSupported("video/webm; codecs=h264"))return null==e||e.debug("support: h264 support: chrome"),!0;null==e||e.warn("support: no h264 support",{reason:"chrome without h264",...n.device.browserInfo})}return n.device.isAndroidDevice?(null==e||e.warn("support: no h264 support",{reason:"android device",...n.device.browserInfo}),!1):n.device.isImplements(i.Feature.MEDIA_DEVICE)&&n.device.isCodecSupported("h264")}},6640:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Support=t.Codecs=void 0,t.videoSupported=function(){return o.device.isImplements(a.Feature.MEDIA_DEVICE)};const n=r(31635),i=r(70076),o=r(86729),a=r(51327),s=n.__importStar(r(61677)),l=r(65414);var c;!function(e){e.H264="h264",e.VP8="vp8",e.OPUS="opus"}(c||(t.Codecs=c={}));class u{constructor(e,t){this.supportChecks=async()=>{let e=[];const t=await s.hasH264Capability(),r=await s.hasVP8Capability(),n=await s.hasOpusCapability();return t&&(e=[c.H264]),r&&(e=[...e,c.VP8]),n&&(e=[...e,c.OPUS]),this.log.info("The following codecs are supported",{supported:e}),e},this.log=e,null!=t&&this.log.setMessageAggregate("create",t),this.supportTags={opus:!1,vp8:!1,h264:!1};const r=null!=t?t:this.buildLocalSupportHashSync();r.includes("o")&&(this.supportTags.opus=!0),r.includes("v")&&(this.supportTags.vp8=!0),r.includes("h")&&(this.supportTags.h264=!0),this.ready=this.buildLocalSupportHashAsync().then((e=>{e.includes("o")&&(this.supportTags.opus=!0),e.includes("v")&&(this.supportTags.vp8=!0),e.includes("h")&&(this.supportTags.h264=!0)}))}supports(e){return!!this.supportTags[e]}get any(){return Object.keys(this.supportTags).some((e=>this.supportTags[e]))}get audio(){return this.supportTags.opus}get video(){return this.supportTags.vp8||this.supportTags.h264}get hash(){let e="";return this.supportTags.opus&&(e+="o"),this.supportTags.vp8&&(e+="v"),this.supportTags.h264&&(e+="h"),e}shared(e){if(!this.any)return this;if(!e.any)return e;const t=this.hash;let r="";return e.hash.split("").forEach((e=>{t.includes(e)&&(r+=e)})),new u(this.log,r)}basicSupport(){var e;if("ReactNative"===o.device.platform)return!0;if(null==(0,i.detectDevice)())return this.log.warn("support: mediasoups says device is unsupported",{...o.device.browserInfo}),this.log.flush(),!1;if(!o.device.isImplements(a.Feature.MEDIA_DEVICE))return this.log.warn("support: no RTCPeerConnection",{...o.device.browserInfo}),this.log.flush(),!1;if(o.device.isIosDevice&&!o.device.isSafari){if(o.device.isChrome){if((0,l.supportsModernChrome)(o.device))return o.device.isImplements(a.Feature.MEDIA_DEVICE);this.log.warn("support: ios chrome support is only available on versions >= 14.3",{...o.device.browserInfo})}else this.log.warn("support: non-safari ios",{...o.device.browserInfo});return this.log.flush(),!1}return o.device.isEdge&&!o.device.isImplements(a.Feature.WEBRTC)?(this.log.warn("support: msedge with missing webrtc api",{hasRTCRtpReceiver:null==(null===o.device||void 0===o.device?void 0:o.device.RTCRtpReceiver)?"false":"true",hasRTCRtpSender:null==(null===o.device||void 0===o.device?void 0:o.device.RTCRtpSender)?"false":"true",hasRTCRtpReceiverGetCapabilities:null!=(null===(e=null===o.device||void 0===o.device?void 0:o.device.RTCRtpReceiver)||void 0===e?void 0:e.getCapabilities)?"true":"false",...o.device.browserInfo}),this.log.flush(),!1):o.device.isImplements(a.Feature.MEDIA_DEVICE)}buildLocalSupportHashSync(){if(!this.basicSupport())return"";let e="";return s.hasOpus()&&(e=e.concat("o")),s.hasVP8()&&(e=e.concat("v")),s.hasH264(this.log)&&(e=e.concat("h")),this.log.setLoggerAggregate("supportHash",e),this.log.debug("support: support hash generated",{...o.device.browserInfo}),e}async buildLocalSupportHashAsync(){if(!this.basicSupport())return"";let e="";return await s.hasOpusCapability(this.log)&&(e=e.concat("o")),await s.hasVP8Capability(this.log)&&(e=e.concat("v")),await s.hasH264Capability(this.log)&&(e=e.concat("h")),""!==e&&this.log.setLoggerAggregate("supportHash",e),this.log.debug("support: support hash generated",{...o.device.browserInfo}),e}}t.Support=u,u.displayName="Support"},68783:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setTimeout=function(e,t){o(e);const r=n.device.setTimeout(e,t);return i.set(e,r),r},t.removeTimeout=o,t.setInterval=function(e,t){a(e);const r=n.device.setInterval(e,t);return i.set(e,r),r},t.removeInterval=a;const n=r(86729),i=new WeakMap;function o(e){const t=i.get(e);return null!=t?(n.device.clearTimeout(t),t):null}function a(e){const t=i.get(e);null!=t&&n.device.clearInterval(t)}},60280:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TimeupdateWrapper=void 0,t.TimeupdateWrapper=class{constructor(){this.paused=!1,this.handlersMap=new WeakMap,this.pauseUpdates=()=>{this.paused=!0},this.resumeUpdates=()=>{this.paused=!1}}wrap(e,t){var r;null==this.handlersMap.get(e)&&this.handlersMap.set(e,[]);const n=this.handle.bind(this,t);null===(r=this.handlersMap.get(e))||void 0===r||r.push(n),e.addEventListener("timeupdate",n),e.addEventListener("vdc:timeupdatePause",this.pauseUpdates),e.addEventListener("vdc:timeupdateResume",this.resumeUpdates)}handle(e){this.paused||e()}unwrap(e){var t;for(const r of null!==(t=this.handlersMap.get(e))&&void 0!==t?t:[])e.removeEventListener("timeupdate",r),e.removeEventListener("vdc:timeupdatePause",this.pauseUpdates),e.removeEventListener("vdc:timeupdateResume",this.resumeUpdates)}}},42615:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UserInteraction=void 0;const n=r(27813),i=r(82837),o=r(45831),a=r(86729),s=r(27291),l=r(75440);class c extends o.ObservableEventEmitter{constructor(e){super(),this.hadInteraction=!1,this.audioCtx=null,this.audioEl=null,this.audioTrack=null,this.logError=e=>{var t,r;null===(r=(t=this.logger).info)||void 0===r||r.call(t,`silentAudio: ${e}`)},(0,n.makeObservable)(this,{hadInteraction:n.observable}),this.logger=new i.LoggerCore("VDC-core").setLoggerMeta("client","VDC").appendChain(c),this.logger.info("constructor()",e),this.options=e,this.options.silentAudio.playSilentAudio&&this.once("hadInteraction",this.playSilentAudio),this.init(),this.addInnerDisposer((()=>{this.stopSilentAudio(),s.userActivationEvents.forEach((e=>{a.device.isImplements(a.Feature.DOCUMENT)&&a.device.document.body.removeEventListener(e,this.handleUserInteractionDOMEvent)}))}))}async init(){if(this.logger.info("init()"),a.device.isImplements(a.Feature.DOCUMENT)){if(a.device.isImplements(a.Feature.USER_ACTIVATION)&&a.device.userActivation.hasBeenActive)return this.hadInteraction=a.device.userActivation.hasBeenActive,void this.logger.info(`hasBeenActive: ${a.device.userActivation.hasBeenActive}`);try{this.logger.info("trying to play audio to determine if user has interacted with page"),await this.playSilentAudio(),this.hadInteraction=!0}catch(e){this.stopSilentAudio(),this.logger.info("unable to play audio, attaching userActivation event listeners"),s.userActivationEvents.forEach((e=>{a.device.isImplements(a.Feature.DOCUMENT)&&a.device.document.body.addEventListener(e,this.handleUserInteractionDOMEvent)})),this.once("hadInteraction",(()=>{s.userActivationEvents.forEach((e=>{a.device.isImplements(a.Feature.DOCUMENT)&&a.device.document.body.removeEventListener(e,this.handleUserInteractionDOMEvent)}))}))}}else this.logger.warn("device does not support UserActivationFeature")}async playSilentAudio(){var e,t;if(this.logger.info("playSilentAudio()",this.options),!(a.device.isImplements(a.Feature.AUDIO_CONTEXT)&&a.device.isImplements(a.Feature.MEDIA_STREAM)&&a.device.isImplements(a.Feature.CREATE_AUDIO_ELEMENT)&&a.device.isImplements(a.Feature.DOCUMENT)))return;this.audioCtx=new a.device.AudioContext,this.audioTrack=(0,l.createSilentAudioTrack)(this.audioCtx);const r=new a.device.MediaStream([this.audioTrack]),n=a.device.createAudioElement();n.srcObject=r,this.audioEl=a.device.document.body.appendChild(n),null===(e=this.audioEl)||void 0===e||e.setAttribute("data-silent","true");try{await(null===(t=this.audioEl)||void 0===t?void 0:t.play()),!1!==this.options.silentAudio.infiniteLoop&&!1!==this.options.silentAudio.playSilentAudio||setTimeout((()=>{this.stopSilentAudio()}),100)}catch(e){throw this.logError(e),e}}stopSilentAudio(){var e,t,r;this.logger.info("stopSilentAudio()",this.options),null===(e=this.audioTrack)||void 0===e||e.stop(),null===(t=this.audioCtx)||void 0===t||t.close().catch(this.logError),null===(r=this.audioEl)||void 0===r||r.remove(),this.audioCtx=null,this.audioEl=null,this.audioTrack=null}isValidInteractionEvent(e){return!((0,s.isKeyboardEvent)(e)&&"keydown"===e.type&&27===e.keyCode||(0,s.isPointerEvent)(e)&&"pointerup"===e.type&&"mouse"===e.pointerType||(0,s.isPointerEvent)(e)&&"pointerdown"===e.type&&"mouse"!==e.pointerType||"touchend"===e.type)}handleUserInteractionDOMEvent(e){this.isValidInteractionEvent(e)&&!this.hadInteraction&&(this.hadInteraction=!0,this.logger.info(`user interacted with page via ${e.type}`))}}t.UserInteraction=c,c.displayName="UserInteraction"},63725:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.uuidv4=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}},18409:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VideoClient=void 0;const n=r(31635),i=r(82837),o=r(27813),a=r(86729),s=r(84368),l=n.__importDefault(r(28441)),c=r(59703),u=r(10227),d=r(22604),h=r(92491),p=r(98645),f=r(64691),m=n.__importDefault(r(26428)),g=r(88819),v=r(50585),y=r(46693),b=r(54873),_=r(45829),S=r(93503),w=r(45831),E=r(80366),C=r(31755),O=r(6640),P={autoPlay:!0,refetch:!1,displayPoster:"preview",players:[{id:"webrtc"},{id:"native-hls"},{id:"hlsjs"}],muted:!1,volume:.5,driverFailoverSeconds:10,pollingInterval:5e3,unauthorizedPollingInterval:2e3,notFoundPollingInterval:1e4,unauthorizedRecoveryDuration:1e4,retryCall:!0,urlParams:{vdc:!0,substitute:!1}},T=new C.EventsHandler;class k extends w.ObservableEventEmitter{constructor(e){var t,r,n,s,u,d;super(!1),this.options={backendEndpoints:[],userId:""},this.setMaxListeners(20);const p=null!==(t=null==e?void 0:e.logger)&&void 0!==t?t:new i.LoggerCore("VDC-core");null==e||delete e.logger;const f=null!==(n=null===(r=null==e?void 0:e.loggerConfig)||void 0===r?void 0:r.clientName)&&void 0!==n?n:"VDC",m=p.getLoggerMeta("client"),g=p.getLoggerMeta("release"),v=p.getLoggerMeta("package"),y=a.device.isImplements(a.Feature.NETWORK_INFORMATION)?null===(s=null===a.device||void 0===a.device?void 0:a.device.connection)||void 0===s?void 0:s.type:"information unavailable",[w,E]=(0,_.getNetworkConnectionType)();p.setLoggerMeta("package",null!=v&&"VDC-core"!==v?`${v}/VDC-core`:"VDC-core").setLoggerMeta("client",null!=m?`${m}/${f}`:f).setLoggerMeta("release",null!=g?`${g}/${l.default.version}`:l.default.version).setLoggerMeta("commitHash",l.default.commit).setLoggerMeta("contextId",null!==(u=(0,c.contextId)())&&void 0!==u?u:"").setLoggerMeta("instanceId",null!==(d=(0,c.instanceId)())&&void 0!==d?d:"").appendChain(k).setMessageAggregate("displayName",null==e?void 0:e.displayName).setMessageAggregate("networkConnection",y).setMessageAggregate("networkConnectionType",w).setMessageAggregate("networkConnectionEffectiveType",E);const C=new O.Support(new i.LoggerCore("VDC-core").extend(p).appendChain(O.Support));a.device.isIE&&this.emitError((0,h.createError)(h.ErrorCode.IENotSupported,"IE is not supported",{})),this.ctx=(0,S.context)({logger:p,videoClient:this,support:C,chain:k.displayName,token:e.token}),(0,o.makeObservable)(this,{requestPlayer:o.action});const P=(0,b.makeBounded)(new Proxy(this,T));return P.init(e),p.trace("constructor()",{backendEndpoints:null==e?void 0:e.backendEndpoints}),P}init(e){var t;null!=(null==e?void 0:e.autoPlay)&&null!=(null==e?void 0:e.playerOptions)&&null==(null===(t=null==e?void 0:e.playerOptions)||void 0===t?void 0:t.autoPlay)&&(e.playerOptions.autoPlay=e.autoPlay),this.updateOptions(e),this.on("error",(e=>{h.VideoClientError.log(e,this.ctx.logger)}))}static validateOptions(e){return e}updateOptions(e){if(null==e)return;const t=k.validateOptions(e);null!=t.logger&&(this.ctx.logger.warn("using `logger` in updateOptions() is not allowed"),delete t.logger),this.options={...this.options,...t}}async callSupported(){return await this.ctx.support.ready,this.ctx.support.supports("h264")||this.ctx.support.supports("vp8")}async createCall(e){var t;await this.ctx.support.ready;const{backendEndpoints:r,token:n}=this.options;await this.validateCallOptions();const i={token:n,backendEndpoints:r,sfu:{...null!==(t=e.sfu)&&void 0!==t?t:{}},playerOptions:this.options.playerOptions,clientReferrer:e.clientReferrer,streamKey:e.streamKey},o=this.createSFUJoinParams(),a=new d.Call((0,E.extendContext)(this.ctx,d.Call),!0,i,o);return this[C.addProxy](a),a.ready()}async supportCheck(){return this.ctx.support.supportChecks()}async joinCall(e,t={}){const r=this.createSFUJoinParams();return this.internalJoinCall(e,r,t,this.ctx)}async internalJoinCall(e,t,r={},n=this.ctx){const{playerOptions:i,token:o,...a}=r,{backendEndpoints:s,displayName:l,userId:c}=this.options,{onCallJoinEndpoint:u,onSFUConnection:h}=r;await this.validateCallOptions();const p={token:null!=o?o:this.options.token,backendEndpoints:s,callId:e,sfu:a,playerOptions:null!=i?i:this.options.playerOptions},f={...t,user:{displayName:null!=l?l:c,userId:c,...null==t?void 0:t.user}},m=new d.Call((0,E.extendContext)(n,d.Call),!1,p,f);return m.on("callJoinEndpoint",(()=>{u&&u()})),m.on("sfuConnection",(()=>{h&&h()})),this[C.addProxy](m),m.ready()}requestPlayer(e,t=P){var r;const n={autoPlay:null!=t.autoPlay?t.autoPlay:P.autoPlay,displayPoster:null!=t.displayPoster?t.displayPoster:P.displayPoster,players:null!=t.players?t.players:P.players,refetch:null!=t.refetch?t.refetch:P.refetch,muted:null!=t.muted?t.muted:P.muted,pollingInterval:null!=t.pollingInterval?t.pollingInterval:P.pollingInterval,unauthorizedPollingInterval:null!=t.unauthorizedPollingInterval?t.unauthorizedPollingInterval:P.unauthorizedPollingInterval,notFoundPollingInterval:null!=t.notFoundPollingInterval?t.notFoundPollingInterval:P.notFoundPollingInterval,unauthorizedRecoveryDuration:null!=t.unauthorizedRecoveryDuration?t.unauthorizedRecoveryDuration:P.unauthorizedRecoveryDuration,volume:null!=t.volume?t.volume:P.volume,driverFailoverSeconds:null!=t.driverFailoverSeconds?t.driverFailoverSeconds:P.driverFailoverSeconds,retryCall:null!=t.retryCall?t.retryCall:P.retryCall,urlParams:null!=t.urlParams?t.urlParams:P.urlParams,requestHeaders:null!=t.requestHeaders?t.requestHeaders:P.requestHeaders,experimental:null!==(r=t.experimental)&&void 0!==r&&r},i={muted:t.muted,autoPlay:t.autoPlay,refetch:t.refetch,volume:t.volume};this.ctx.logger.debug("requestPlayer()",{manifest:e,mergedPlayerOptions:JSON.stringify(n),options:i});let o=null;return o=this.internalRequestPlayer(e,n),null==o&&this.throwError((0,h.createError)(h.ErrorCode.NoPlayersAvailable,"No supported players",{},null)),this[C.addProxy](o),o}createSFUJoinParams(){const{displayName:e,userId:t}=this.options;return{user:{displayName:null!=e?e:t,userId:t}}}async validateCallOptions(){const{backendEndpoints:e,userId:t}=this.options;await this.callSupported()||this.throwError((0,h.createError)(h.ErrorCode.H264NotSupported,"h264 is not supported",{})),null==e&&this.throwError((0,h.createError)(h.ErrorCode.NoBackendEndpoints,"backendEndpoints is not provided",{})),null==t&&this.throwError((0,h.createError)(h.ErrorCode.NoUserId,"userId is not provided",{}))}internalRequestPlayer(e,t){if(t.experimental){if("string"!=typeof e)throw new Error("source must be URL");return(0,u.requestPlayer)((0,E.extendContext)(this.ctx,u.Player),e,t)}if((0,s.isManifest)(e)){const r=(0,E.extendContext)(this.ctx,v.ManifestPlayer),n=new m.default((0,E.extendContext)(r,m.default),e,{pollingInterval:t.pollingInterval,notFoundPollingInterval:t.notFoundPollingInterval,unauthorizedPollingInterval:t.unauthorizedPollingInterval,unauthorizedRecoveryDuration:t.unauthorizedRecoveryDuration,urlParams:t.urlParams,requestHeaders:t.requestHeaders});n.on("error",(e=>{this.emit("error",e)}));const i=t.players,o={autoPlay:t.autoPlay,muted:t.muted,volume:t.volume,blurred:t.blurred,retryCall:t.retryCall,requestHeaders:t.requestHeaders};i.forEach((e=>{"string"!=typeof e&&(e.options={...o,...e.options})}));const a=new v.ManifestPlayer(r,n,{...t,players:i});return null!=t.preferredScoreLevel&&(a.preferredLevel=t.preferredScoreLevel),a}if(e instanceof g.MediasoupSource)return new y.MediasoupPlayer((0,E.extendContext)(this.ctx,y.MediasoupPlayer),e,{});if(e instanceof f.MediaStreamController)return new y.MediasoupPlayer((0,E.extendContext)(this.ctx,y.MediasoupPlayer),e,{});throw new p.NotSupportedError("source not supported",{})}}t.VideoClient=k,k.displayName="VideoClient"},28441:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"@video/video-client-core",version:"13.2.0",commit:"79ee25b1fd57cc49823e11b1b9305f4cd0df057c"}},30434:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Recorder=void 0;const n=r(31635),i=r(97389),o=r(86729),a=r(98645),s=r(45831),l=n.__importDefault(r(28441)),c=r(59703);class u extends s.ObservableEventEmitter{constructor(e,t){var r,n,s,d,h,p,f,m,g,v;super(),this.recorder=null,this.locked=!1,this.destroyed=!1,this.localFilePath=null,this.writable=null,this.totalStorageAvailable=0,this.maxRecordingLength=0,this.dataWritten=!1,this.closing=!1,this.saving=!1,this.storageAlertSent=!1,this.userClosedSave=!1,this.dataAggregate=[],o.device.isImplements(o.Feature.MEDIA_RECORDER)||this.throwErrorDeprecated(new a.NotSupportedError("MediaRecorder is not supported",{})),o.device.isImplements(o.Feature.MEDIA_STREAM)&&o.device.isImplements(o.Feature.MEDIA_DEVICE)||this.throwErrorDeprecated(new a.NotSupportedError("MediaStream is not supported",{})),o.device.isImplements(o.Feature.AUDIO_CONTEXT)||this.throwErrorDeprecated(new a.NotSupportedError("AudioContext is not supported",{})),this.device=o.device,this.logger=null!==(r=t.logger)&&void 0!==r?r:new i.LoggerCore(c.PACKAGE_NAME).setLoggerMeta("client","VDC").setLoggerMeta("release",l.default.version).appendChain(u),this.on("error",(e=>{a.VideoClientErrorDeprecated.log(e,this.logger)})),this.stream=null!=e?e:null,this.options=null!=t?t:{},this.options.mimetype=null!==(n=this.options.mimetype)&&void 0!==n?n:o.device.isIosDevice?"video/mp4":"video/webm;codecs=VP8",this.options.startRecordingWhenClicked=null===(s=this.options.startRecordingWhenClicked)||void 0===s||s;const y=null!==(d=this.options.audioBitsPerSecond)&&void 0!==d?d:128e3;this.options.audioBitsPerSecond=y;const b=null!==(h=this.options.videoBitsPerSecond)&&void 0!==h?h:5e6;this.options.videoBitsPerSecond=b,this.options.cursor=null!==(p=this.options.cursor)&&void 0!==p?p:"motion",this.options.displaySurface=null!==(f=this.options.displaySurface)&&void 0!==f?f:"all",this.options.frameRate=null!==(m=this.options.frameRate)&&void 0!==m?m:24,this.options.height=1920,o.device.MediaRecorder.isTypeSupported(this.options.mimetype)||this.throwErrorDeprecated(new a.MediaRecorderError("mimeType is not supported",{mimeType:this.options.mimetype})),null===(v=(g=this.device).storageEstimate)||void 0===v||v.call(g).then((({usage:e,quota:t})=>{const r=Math.round(e/1048576),n=Math.round(t/1048576)-r;this.totalStorageAvailable=n;const i=(y+b)/8/1e6;this.maxRecordingLength=n/(60*i)-1}))}static isSupported(e){return o.device.isImplements(o.Feature.MEDIA_RECORDER)&&o.device.MediaRecorder.isTypeSupported(e)}newMediaRecorder(e,t){const r=new this.device.MediaRecorder(e,t);r.addEventListener("error",(e=>{this.emitErrorDeprecated(new a.MediaRecorderError("media recorder error",{}))}));const n=e.getVideoTracks();return 0!==n.length&&n[0].enabled&&"ended"!==n[0].readyState||this.throwErrorDeprecated(new a.MediaRecorderError("no active video tracks",{})),n[0].addEventListener("ended",(()=>{this.emit("browser-stop")})),r.addEventListener("pause",this.handlePause),r.addEventListener("resume",this.handleResume),r.addEventListener("start",this.handleStart),r.addEventListener("stop",this.handleStop),r.addEventListener("dataavailable",this.handleNewData),r}handlePause(){this.emit("pause")}handleResume(){this.emit("resume")}handleStart(){this.emit("start")}handleStop(){this.emit("stop")}async handleNewData(e){var t,r;if(!this.closing)if(this.saving){const n={suggestedName:`recording.${Date.now()}`,types:[{description:"Video Recording",accept:{"video/x-matroska":[".webm"]},"-use_wallclock_as_timestamps":!0}]};try{this.localFilePath=await this.device.showSaveFilePicker(n),this.writable=await this.localFilePath.createWritable()}catch(t){const r=t instanceof Error?t:null;return this.emitErrorDeprecated(new a.MediaRecorderError("an error occurred on save record",{inner:r})),this.saving=!1,this.dataAggregate.push(e.data),void this.emit("save-canceled")}this.emit("data",e.data);let i=null;this.dataAggregate.length>0?(this.dataAggregate.push(e.data),i=new Blob(this.dataAggregate)):i=new Blob([e.data]);try{await(null===(t=this.writable)||void 0===t?void 0:t.write(i)),this.dataWritten=!0,null===(r=this.writable)||void 0===r||r.close(),this.dataAggregate=[],await this.close()}catch(e){const t=e instanceof Error?e:null;this.emitErrorDeprecated(new a.MediaRecorderError("failed to write to file",{inner:t}))}}else this.dataWritten||this.storageAlertSent||(this.storageAlertSent=!0,this.pause(),this.dataAggregate.push(e.data),this.device.confirmMessage("Your device is nearing its storage capacity. Please return to the app to save your recording."),await this.record())}lock(){this.locked=!0,this.emit("lock")}unlock(){this.locked=!1,this.emit("unlock")}apply(e){if(null!=this.stream){if(this.locked)return this.logger.debug("recorder apply locked"),void o.device.setTimeout((()=>{this.apply(e)}),50);this.lock(),this.logger.info("applying recorder options",{options:e})}}get state(){var e,t;return null!==(t=null===(e=this.recorder)||void 0===e?void 0:e.state)&&void 0!==t?t:"inactive"}get recorderOptions(){return{audioBitsPerSecond:this.options.audioBitsPerSecond,videoBitsPerSecond:this.options.videoBitsPerSecond,mimetype:this.options.mimetype,startRecordingWhenClicked:this.options.startRecordingWhenClicked,frameRate:this.options.frameRate,displaySurface:this.options.displaySurface,cursor:this.options.cursor,height:this.options.height}}async setupRecorder(){let e;return e=null==this.stream?await this.createStream():this.stream,this.dataWritten=!1,this.closing=!1,this.saving=!1,null==this.recorder&&(this.recorder=await this.newMediaRecorder(e,this.recorderOptions)),this.options.startRecordingWhenClicked&&await this.record(),{status:"success"}}async record(){var e,t;return null==this.stream?(this.emitErrorDeprecated(new a.MediaRecorderError("attempting to record without a local stream",{})),{status:"error",message:"No stream provided or created"}):0===this.stream.getTracks().length?(this.emit("stream",null),this.emitErrorDeprecated(new a.MediaRecorderError("attempting to start to record with a local stream that has no tracks",{})),{status:"error",message:"No video tracks from the stream found"}):("inactive"===this.state?null===(e=this.recorder)||void 0===e||e.start(6e4*this.maxRecordingLength):"paused"===this.state&&(null===(t=this.recorder)||void 0===t||t.resume()),{status:"success"})}async save(){return null==this.recorder?(this.emitErrorDeprecated(new a.MediaRecorderError("attempting to pause recorder with no recorder",{})),{status:"error",message:"No recorder found"}):(this.saving=!0,this.pause(),await this.recorder.requestData(),{status:"success"})}pause(){return null==this.recorder?(this.emitErrorDeprecated(new a.MediaRecorderError("attempting to pause recorder with no recorder",{})),{status:"error",message:"No recorder found"}):(this.recorder.pause(),{status:"success"})}async close(){var e;if(null==this.recorder)return this.emitErrorDeprecated(new a.MediaRecorderError("attempting to stop recorder with no recorder",{})),{status:"error",message:"No recorder found"};if("inactive"!==this.recorder.state){this.closing=!0;try{const t=null===(e=this.stream)||void 0===e?void 0:e.getTracks();null==t||t.forEach((e=>{e.stop()})),this.recorder.stop(),this.recorder=null,this.destroyed=!0,this.stream=null,this.localFilePath=null,this.writable=null}catch(e){const t=e instanceof Error?e:null;return this.emitErrorDeprecated(new a.MediaRecorderError("failed to close",{inner:t})),{status:"error",message:"Failed to close"}}}return{status:"success"}}async createStream(){const e={video:{frameRate:this.options.frameRate,height:this.options.height,resizeMode:"crop-and-scale",cursor:this.options.cursor,displaySurface:this.options.displaySurface,logicalSurface:!0},audio:{autoGainControl:!1,echoCancellation:!1,googAutoGainControl:!1,noiseSuppression:!1}},t=await this.device.mediaDevices.getDisplayMedia(e),r=await this.device.mediaDevices.getUserMedia({audio:!0}),n=t.getAudioTracks(),i=t.getVideoTracks(),o=new this.device.AudioContext;let a,s,l;const c=new this.device.MediaStream;let u;return n.length>0?(s=t.getAudioTracks()[0],l=o.createMediaStreamDestination(),u=new this.device.MediaStream([s]),o.createMediaStreamSource(u).connect(l),o.createMediaStreamSource(r).connect(l),c.addTrack(l.stream.getTracks()[0]),c.addTrack(i[0])):(a=r.getAudioTracks(),c.addTrack(a[0]),c.addTrack(i[0])),this.stream=c,c}addAudioTrack(e){var t;null===(t=this.stream)||void 0===t||t.addTrack(e)}removeAudioTrack(e){var t;const r=null===(t=this.stream)||void 0===t?void 0:t.getAudioTracks();null==r||r.forEach((t=>{var r;t.id===e.id&&(null===(r=this.stream)||void 0===r||r.removeTrack(t))}))}}t.Recorder=u,u.displayName="Recorder"},59703:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CONTEXT_ID_KEY=t.INSTANCE_ID_KEY=t.PACKAGE_NAME=void 0,t.instanceId=function(){return n.device.isImplements(n.Feature.LOCAL_STORAGE)?(null==n.device.localStorage.getItem(t.INSTANCE_ID_KEY)&&n.device.localStorage.setItem(t.INSTANCE_ID_KEY,(0,i.uuidv4)()),n.device.localStorage.getItem(t.INSTANCE_ID_KEY)):null},t.contextId=function(){n.device.globals.has(t.CONTEXT_ID_KEY)||n.device.globals.set(t.CONTEXT_ID_KEY,(0,i.uuidv4)());const e=n.device.globals.get(t.CONTEXT_ID_KEY);return"string"==typeof e?e:null},t.applyUserInteractionHook=function(){n.device.applyUserInteractionHook()},t.removeSearchParameterFromUrl=function(e,t){const r=new RegExp(`([?&])${t}=[^&]*`,"g");return e.replace(r,"")};const n=r(86729),i=r(75440);t.PACKAGE_NAME="VDC-core",t.INSTANCE_ID_KEY="vdc:instanceId",t.CONTEXT_ID_KEY="vdc:contextId"},39186:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GwStateFlow=void 0,r(39149);var n=r(79876);Object.defineProperty(t,"GwStateFlow",{enumerable:!0,get:function(){return n.GwStateFlow}})},79876:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GwStateFlow=void 0;const n=r(89695);t.GwStateFlow=new n.StateFlow},39149:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Closed=t.Suspended=t.Connected=t.Connecting=t.NotConnected=t.WebsocketGroup=void 0;const n=r(89695),i=r(7333),o=r(79876);function a(e,t){return t>=e.maxRetries?-1:e.retryDelay.reduce(((e,[r,n])=>t>=r?n:e),500)}function s({websocket:e},r){return"sfu-busy"===r.reason?(0,t.NotConnected)(e):(0,t.Closed)({...e,nextRetry:a(e.options,e.attempt),attempt:e.attempt+1})}function l({websocket:e},r){return(0,t.Connecting)({...e,uri:r.uri})}function c({websocket:e},t){const r=e.requestId+1;return{requestId:r,requestPool:{...e.requestPool,[r]:{resolve:t.resolve,reject:t.reject,type:t.type,timestamp:Date.now()}}}}function u({websocket:e},t){const{[t.id]:r,...n}=e.requestPool;return{requestPool:n}}function d({websocket:e},t){const{[t.id]:r,...n}=e.requestPool;return{requestPool:n}}function h({websocket:e},r){return(0,t.NotConnected)({attempt:0,nextRetry:0,lastPing:0,lastPong:0,uri:"",requestId:0,requestPool:{},options:e.options})}t.WebsocketGroup=o.GwStateFlow.registerGroup("websocket").bootstrap((()=>(0,t.NotConnected)({uri:"",nextRetry:0,attempt:0,lastPing:0,lastPong:0,requestId:0,requestPool:{},options:i.GwTransportOptions.parse({})}))),t.NotConnected=t.WebsocketGroup.registerState("notConnected",{ready:()=>n.Result.reject("invalid state: not connected"),connect:l,options:function({websocket:e},t){return{...e,options:{...t}}}}),t.Connecting=t.WebsocketGroup.registerState("connecting",{ready:function({websocket:e},r){return(0,t.Connected)({...e,nextRetry:0,attempt:0})},requestSend:function(e,t){return"JWT"===t.type?c(e,t):n.Result.reject("Only JWT methods are allowed for auth while in the connecting state")},responseReceive:u,responseTimeout:d,error:s,finish:h}),t.Connected=t.WebsocketGroup.registerState("connected",{networkOffline:function({websocket:e},r){return(0,t.Suspended)({...e})},ping:function({websocket:e},t){return{...e,lastPing:Date.now()}},pong:function({websocket:e},t){return{...e,lastPong:Date.now()}},finish:h,messageSend:function({websocket:e},t){return{requestId:e.requestId+1}},requestSend:c,responseReceive:u,responseTimeout:d,internalClose:function({websocket:e}){return(0,t.Closed)(e)},error:s}),t.Suspended=t.WebsocketGroup.registerState("suspended",{ready:()=>n.Result.reject("invalid state: suspended"),networkOnline:function({websocket:e},r){return(0,t.Connecting)(e)},finish:h,error:s}),t.Closed=t.WebsocketGroup.registerState("closed",{ready:()=>n.Result.reject("invalid state: closed"),connect:l,connectFailed:function({websocket:e}){return(0,t.Closed)({...e,nextRetry:a(e.options,e.attempt),attempt:e.attempt+1})},finish:h,error:s})},7333:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GwTransport=t.GwTransportOptions=void 0;const n=r(31635),i=r(50543),o=r(89695),a=r(21614),s=r(80769),l=r(86729),c=r(92491),u=r(54873),d=r(68783),h=r(39186),p=n.__importStar(r(39149));t.GwTransportOptions=a.z.object({clientPing:a.z.boolean().default(!0).describe("Whether to send a ping message to the server"),pingInterval:a.z.number().min(500).max(6e4).default(5e3).describe("The interval in milliseconds to send a ping message to the server (0 - disabled)"),pingTimeout:a.z.number().min(500).max(6e4).default(5e3).describe("The timeout in milliseconds to wait for a pong message from the server"),responseTimeout:a.z.number().min(500).max(6e4).default(5e3).describe("The timeout in milliseconds to wait for a response from the server"),connectingTimeout:a.z.number().min(500).max(6e4).default(5e3).describe("The timeout in milliseconds to wait for the connection to the server"),maxRetries:a.z.number().min(1).max(1/0).default(1/0).describe("The maximum number of retries to connect to the server"),retryDelay:a.z.array(a.z.tuple([a.z.number().min(0).max(6e4),a.z.number().min(0).max(6e5)])).default([[100,6e5],[15,1e4],[5,1e3],[0,500]]).describe("The delay in milliseconds to wait before retrying to connect to the server after a failed attempt")});class f extends i.EventEmitter{constructor(e){super(),this.ctx=e,this.websocket=null,(0,u.makeBounded)(this),this.sf=h.GwStateFlow.initialize(this),l.device.addEventListener("offline",this.handleOffline),l.device.addEventListener("online",this.handleOnline),l.device.addEventListener("visibilitychange",this.handleVisibilityChange)}get isConnected(){return p.Connected.is(this.sf.websocket)}get isConnecting(){return p.Connecting.is(this.sf.websocket)}initStateFlow(e){e.handleExit(p.Connected,this.onDisconnecting),e.handleEnter(p.Connecting,this.onConnecting),e.handleEnter(p.Connected,this.onConnected),e.onCommit(p.Closed,this.onClosed)}options(e){this.sf.dispatch("options",t.GwTransportOptions.parse(e)).expect(o.ResultKind.OK,o.ResultKind.Ignored)}async connect(e,t){return new Promise((async(r,n)=>{var i;const a=await this.sf.dispatchAsync("connect",{uri:e});a.ok?(this.once("connect",r),this.once("connectError",n),null!=(null==t?void 0:t.jwt)&&await this.request("JWT",{token:t.jwt})):this.sf.dispatch("error",{reason:null!==(i=a.message)&&void 0!==i?i:void 0}).expect(o.ResultKind.OK,o.ResultKind.Ignored)}))}[Symbol.dispose](){l.device.removeEventListener("offline",this.handleOffline),l.device.removeEventListener("online",this.handleOnline),l.device.removeEventListener("visibilitychange",this.handleVisibilityChange),null!=this.websocket&&(this.removeWebsocketListeners(this.websocket),this.websocket=null)}finish(){this.sf.dispatch("finish",{}).expect(o.ResultKind.OK,o.ResultKind.Ignored)}send(e,t){if((0,o.isTransitioning)(this.sf.websocket))throw(0,c.createError)(s.ErrorCode.WebSocketInTransit,"The websocket state is in transit",{uri:this.sf.websocket.uri,event:e});this.sf.dispatch("messageSend",{event:e,data:t},(()=>null==this.websocket?o.Result.reject("no websocket"):(this.websocket.send(JSON.stringify({event:e,data:t})),o.Result.ok()))).expect(o.ResultKind.OK)}async request(e,t){if((0,o.isTransitioning)(this.sf.websocket))throw(0,c.createError)(s.ErrorCode.WebSocketInTransit,"The websocket state is in transit",{uri:this.sf.websocket.uri,event:"request"});return new Promise(((r,n)=>{try{this.sf.dispatch("requestSend",{type:e,payload:t,resolve:r,reject:n},(r=>null==this.websocket?o.Result.reject("no websocket"):(this.websocket.send(JSON.stringify({event:"request",data:{requestId:r.websocket.requestId,type:e,request:t}})),o.Result.ok()))).expect(o.ResultKind.OK)}catch(e){n(e)}}))}onConnecting({websocket:e}){const t=new WebSocket(e.uri);return o.Result.transition(new Promise(((e,r)=>{const n=()=>{t.removeEventListener("open",n),this.websocket=t,this.addWebsocketListeners(t),e(o.Result.ok())};t.addEventListener("open",n);const i=r=>{t.removeEventListener("close",i),e(o.Result.reject(`websocket closed: ${r.code}; attempt: ${this.sf.websocket.attempt}`))};t.addEventListener("close",i)})),e.options.connectingTimeout)}onConnected({websocket:e}){return e.options.clientPing&&(0,d.setInterval)(this.ping,this.sf.websocket.options.pingInterval),this.emit("connect"),o.Result.ok()}onDisconnecting(e){return null==this.websocket?o.Result.ignore("no websocket"):((0,d.removeInterval)(this.ping),this.removeWebsocketListeners(this.websocket),this.websocket.close(3e3),o.Result.ok())}onClosed(e){return e.websocket.nextRetry>0?((0,d.setTimeout)(this.connect.bind(this,e.websocket.uri),e.websocket.nextRetry),o.Result.ok()):o.Result.ignore("no retry")}handleOffline(){this.sf.dispatch("networkOffline",{}).expect(o.ResultKind.OK,o.ResultKind.Ignored)}async handleOnline(){var e;const t=await this.sf.dispatchAsync("networkOnline",{});t.ok||this.sf.dispatch("error",{reason:null!==(e=t.message)&&void 0!==e?e:void 0}).expect(o.ResultKind.OK,o.ResultKind.Ignored)}handleVisibilityChange(){}addWebsocketListeners(e){e.addEventListener("close",this.wsClose),e.addEventListener("message",this.wsMessage),e.addEventListener("error",this.wsError)}removeWebsocketListeners(e){e.removeEventListener("close",this.wsClose),e.removeEventListener("message",this.wsMessage),e.removeEventListener("error",this.wsError)}wsClose(){this.sf.dispatch("internalClose",{reason:"ws close event"}).expect(o.ResultKind.OK,o.ResultKind.Ignored)}wsMessage(e){var t,r,n,i,a,s,c,u,d;if((0,o.isTransitioning)(this.sf))return void l.device.setTimeout(this.wsMessage.bind(this,e),50);if("pong"===e.data)return void this.sf.dispatch("pong",{}).expect(o.ResultKind.OK,o.ResultKind.Ignored);if("ping"===e.data||"0"===e.data)return void(null===(t=this.websocket)||void 0===t||t.send("pong"));let h;try{h=JSON.parse(e.data)}catch(t){const r=t instanceof Error?t.stack:"unknown error";return void this.ctx.logger.error("websocket parse error",{data:null==e?void 0:e.data,uri:this.sf.websocket.uri,err:r})}if("ready"===h.event){const e=this.sf.dispatch("ready",{});if(!e.ok&&e.kind!==o.ResultKind.Ignored)return}if("ping"!==h.event)if("request"!==h.event){if("callError"===h.event){let t,r,l="unknown";try{t=JSON.parse(null==e?void 0:e.data),r=null!==(i=null===(n=null==t?void 0:t.data)||void 0===n?void 0:n.reason)&&void 0!==i?i:"unknown",l=(null===(s=null===(a=null==t?void 0:t.data)||void 0===a?void 0:a.causes)||void 0===s?void 0:s.length)>0?(null!==(c=t.data.causes.map((e=>e.message)))&&void 0!==c?c:[]).join("; "):null!==(d=null===(u=null==t?void 0:t.data)||void 0===u?void 0:u.errorMessage)&&void 0!==d?d:"unknown"}catch(e){}return this.ctx.logger.error(`Call Error: ${l}`,{data:t,uri:this.sf.websocket.uri,event:h.event}),(0,o.isTransitioning)(this.sf.websocket)||this.sf.dispatch("error",{message:l,reason:r}).expect(o.ResultKind.OK,o.ResultKind.Ignored),void this.emit("connectError",l)}var p;String(h.event).startsWith("response-")?this.onServerResponse((p=h.event,Number(String(p).split("-",2)[1])),h):this.emit(`message:${h.event}`,h.data)}else this.onServerRequest(h);else null===(r=this.websocket)||void 0===r||r.send("pong")}wsError(e){this.sf.dispatch("error",{}).expect(o.ResultKind.OK,o.ResultKind.Ignored)}ping(){this.sf.dispatch("ping",{},(()=>null!=this.websocket?(this.websocket.send("ping"),o.Result.ok()):o.Result.ignore("no websocket"))).ok||this.sf.dispatch("internalClose",{reason:"ping failed"}).expect(o.ResultKind.OK,o.ResultKind.Ignored)}onServerResponse(e,t){const r=this.sf.websocket.requestPool[e];null!=r?this.sf.dispatch("responseReceive",{id:e,response:t},(()=>{var e;if(null!=t.reasons&&t.reasons.length>0){const n=null===(e=t.reasons[0])||void 0===e?void 0:e.text,i=new Error(`request error: ${n}`);return r.reject(i),o.Result.ok()}return r.resolve(t.data),o.Result.ok()})).expect(o.ResultKind.OK):this.ctx.logger.error(`transport: Request with id ${e} not found`,{response:t})}onServerRequest(e){const{method:t,requestId:r,request:n}=e.data;Number.isNaN(r)?this.ctx.logger.error("transport: Invalid request from server",{json:e}):this.emit(`request:${t}`,n,((e={},t=null)=>{this.send("response",{requestId:r,response:e,error:t})}))}}t.GwTransport=f},37996:(e,t)=>{"use strict";function r(e){var t,r;return(null!==(t=e.audioKbps)&&void 0!==t?t:0)+(null!==(r=e.videoKbps)&&void 0!==r?r:0)}function n(e,t){return r(e)>r(t)?e:t}Object.defineProperty(t,"__esModule",{value:!0}),t.PreferredLevelSelector=t.HighestBitrateSelector=void 0,t.HighestBitrateSelector=class{select(e){return e.reduce(n)}},t.PreferredLevelSelector=class{constructor(e){this.preferredLevel=e,this.preferredBitrate=0}select(e){if(null===this.preferredLevel)return e.reduce(n);let t=null;for(const n of e)r(n)<=this.preferredBitrate&&(t=n);return null==t&&(t=e[0]),t}}},9269:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseEncodings=function(e){return null!=e.substitute?[e.substitute]:e.encodings},t.elOnPlay=function(e,t){}},40503:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.registeredDrivers=void 0,t.registerVideoDrivers=function(e){t.registeredDrivers.push(e)},t.registeredDrivers=[]},35556:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.optionsCommonSchema=t.optionsDriversSchema=void 0,t.isVideoElement=o,t.getVideoElement=a,t.startPlayingVideoElement=function({host:e}){const t=a(e.element);return n.Result.transition(t.play().then((()=>n.Result.ok())))},t.stopPlayingVideoElement=function({host:e}){return a(e.element).pause(),n.Result.ok()},t.isVolumeChanged=s,t.unmuteVideoElement=function({host:e,audio:t}){const r=a(e.element);return r.muted?(r.muted=!1,r.volume=t.volume,n.Result.ok()):n.Result.ignore()},t.changeVolumeVideoElement=function({host:e,audio:t}){const r=a(e.element);return s(r.volume,t.volume)?(r.volume=t.volume,n.Result.ok()):n.Result.ignore()},t.muteVideoElement=function({host:e}){const t=a(e.element);return t.muted?n.Result.ignore():(t.muted=!0,n.Result.ok())},t.updateSource=function(e,t){"string"==typeof t?function(e,t){if(e.src===t)return;const r=!e.paused;r&&e.pause(),null!=e.srcObject&&(e.srcObject=null),e.src=t,r&&e.play()}(e,t):function(e,t){if(e.srcObject===t)return;const r=!e.paused;r&&e.pause(),null!=e.src&&""!==e.src&&(e.src=""),e.srcObject=t,r&&e.play()}(e,t)};const n=r(89695),i=r(21614);function o(e){return"object"==typeof e&&"[object HTMLVideoElement]"===String(e)}function a(e){if(o(e))return e;throw new Error("host is not a video element")}function s(e,t){return Math.abs(e-t)>1e-4}function l(e){return(t,r)=>r.addIssue({code:i.z.ZodIssueCode.custom,message:`deprecated: ${e}`})}t.optionsDriversSchema=i.z.enum(["webrtc","hlsjs","native-hls","mp4ws","flvhttp"]),t.optionsCommonSchema=i.z.object({timeout:i.z.number().min(1e3).max(3e4).default(1e4).describe("timeout to start player"),bitrate:i.z.number().optional().superRefine(l("use 'preferredLevel' from root options instead")),muted:i.z.boolean().optional().superRefine(l("use 'muted' from root options instead")),volume:i.z.number().optional().superRefine(l("use 'volume' from root options instead")),autoPlay:i.z.boolean().optional().superRefine(l("use 'autoPlay' from root options instead")),preset:i.z.null().optional().superRefine(l("use 'preferredLevel' from root options instead"))})},38114:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FlvHttpDriver=void 0;const n=r(31635),i=r(89695),o=r(86729),a=r(98645),s=r(54873),l=n.__importStar(r(78666)),c=n.__importStar(r(23251)),u=n.__importStar(r(65174)),d=r(37996),h=r(9269),p=r(40503),f=r(35556);function m(e){const t=(t,r)=>u.InUse.is(r.flvHttp)?e(t,r):i.Result.ignore();return Reflect.defineProperty(t,"name",{configurable:!0,value:e.name}),t}class g{constructor(e){this.ctx=e,this.player=null,this.encodingSelector=new d.HighestBitrateSelector,this.availableEncodings=[],(0,s.makeBounded)(this)}static isManifestSupported(e){return null!=(null==e?void 0:e.formats["flv-http"])}static isHostSupported(e){return(0,f.isVideoElement)(e)}static isPlatformSupported(){return o.device.isImplements(o.Feature.MPEGTS)}initStateFlow(e){this.sf=e,e.handleEnter(u.Prepared,this.prepare),e.handleEnter(u.InUse,this.activate),e.handleExit(u.InUse,this.deactivate),e.handleEnter(c.Playing,m(this.startPlaying)),e.handleExit(c.Playing,m(this.stopPlaying)),e.handleEnter(l.UnMuted,m(this.unmute)),e.handleChanges(l.UnMuted,m(this.changeVolume)),e.handleExit(l.UnMuted,m(this.mute))}changeVolume(e){return(0,f.isVolumeChanged)(this.player.volume,e.audio.volume)?(this.player.volume=e.audio.volume,i.Result.ok()):i.Result.ignore()}mute(e){return this.player.muted?i.Result.ignore():(this.player.muted=!0,i.Result.ok())}unmute(e){const t=(0,f.isVolumeChanged)(this.player.volume,e.audio.volume);return this.player.muted||t?(this.player.muted&&(this.player.muted=!1),t&&(this.player.volume=e.audio.volume),i.Result.ok()):i.Result.ignore()}prepare(e){return o.device.isImplements(o.Feature.MPEGTS)?i.Result.transition(o.device.loadMpegtsScript().then((()=>i.Result.ok()))):i.Result.reject("mpegts is not supported")}activate({host:e,manifest:t,audio:r,flvHttp:n}){const s=(0,f.getVideoElement)(e.element);if(null==t.json)throw new Error("manifest is null");if(!o.device.isImplements(o.Feature.MPEGTS))throw new Error("mpegts is not supported");const c=t.json.formats["flv-http"],u=this.encodingSelector.select((0,h.parseEncodings)(c));if(null==(null==u?void 0:u.location)||""===u.location)throw new a.DriverNotSupportedError("invalid encoding",{});return this.player=o.device.mpegts.createPlayer({type:"flv",isLive:!0,url:u.location}),this.player.attachMediaElement(s),this.player.load(),this.player.volume=r.volume,this.player.muted=!l.UnMuted.is(r),i.Result.ok()}deactivate({host:e}){var t;const r=(0,f.getVideoElement)(e.element);return console.log("did we get here?"),null===(t=this.player)||void 0===t||t.destroy(),this.player=null,r.src="",i.Result.ok()}startPlaying(e,t){const r=this.player.play();return r instanceof Promise?i.Result.transition(r.then((()=>i.Result.ok()))):i.Result.ok()}stopPlaying(e,t){return this.player.pause(),i.Result.ok()}async[Symbol.dispose](){var e;null===(e=this.player)||void 0===e||e.destroy()}}t.FlvHttpDriver=g,g.displayName="FlvHttpDriver",g.driverName="flvhttp",(0,p.registerVideoDrivers)(g)},39647:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HlsJSDriver=void 0;const n=r(31635),i=r(89695),o=n.__importDefault(r(39473)),a=r(98645),s=r(54873),l=n.__importStar(r(78666)),c=n.__importStar(r(23251)),u=n.__importStar(r(98259)),d=r(37996),h=r(9269),p=r(40503),f=r(35556);function m(e){const t=(t,r)=>u.InUse.is(r.hlsJs)?e(t,r):i.Result.ignore();return Reflect.defineProperty(t,"name",{configurable:!0,value:e.name}),t}class g{constructor(e){this.ctx=e,this.encodingSelector=new d.HighestBitrateSelector,this.availableEncodings=[],(0,s.makeBounded)(this),this.hls=new o.default}static isManifestSupported(e){return null!=(null==e?void 0:e.formats["mp4-hls"])}static isHostSupported(e){return(0,f.isVideoElement)(e)}static isPlatformSupported(){return o.default.isSupported()}initStateFlow(e){e.handleEnter(u.Prepared,this.prepare),e.handleEnter(u.InUse,this.activate),e.handleExit(u.InUse,this.deactivate),e.handleEnter(c.Playing,m(f.startPlayingVideoElement)),e.handleExit(c.Playing,m(f.stopPlayingVideoElement)),e.handleEnter(l.UnMuted,m(f.unmuteVideoElement)),e.handleChanges(l.UnMuted,m(f.changeVolumeVideoElement)),e.handleExit(l.UnMuted,m(f.muteVideoElement))}prepare(e){return i.Result.ok()}activate({host:e,manifest:t}){const r=(0,f.getVideoElement)(e.element);if(null==t.json)throw Error("manifest is null");const n=t.json.formats["mp4-hls"],o=this.encodingSelector.select((0,h.parseEncodings)(n));if(null==(null==o?void 0:o.location)||""===o.location)throw new a.DriverNotSupportedError("invalid encoding",{});return this.hls.attachMedia(r),this.hls.loadSource(o.location),i.Result.ok()}deactivate({host:e}){const t=(0,f.getVideoElement)(e.element);return this.hls.stopLoad(),this.hls.detachMedia(),t.src="",i.Result.ok()}async[Symbol.dispose](){this.hls.destroy()}}t.HlsJSDriver=g,g.displayName="HlsJSDriver",g.driverName="hlsjs",(0,p.registerVideoDrivers)(g)},8053:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Mp4WsDriver=void 0;const n=r(31635),i=r(89695),o=r(86729),a=r(98645),s=r(50610),l=r(54873),c=n.__importStar(r(78666)),u=n.__importStar(r(23251)),d=n.__importStar(r(46073)),h=r(37996),p=r(9269),f=r(40503),m=r(35556);function g(e){const t=(t,r)=>d.InUse.is(r.mp4ws)?e(t,r):i.Result.ignore();return Reflect.defineProperty(t,"name",{configurable:!0,value:e.name}),t}class v{constructor(e){this.ctx=e,this.player=null,this.encodingSelector=new h.HighestBitrateSelector,this.availableEncodings=[],(0,l.makeBounded)(this)}get data(){var e,t;return null!==(t=null===(e=this.sf.manifest.json)||void 0===e?void 0:e.formats["mp4-ws"])&&void 0!==t?t:null}get manifest(){var e,t;const r=null===(e=this.sf.manifest.json)||void 0===e?void 0:e.formats["mp4-ws"];return null==r?null:null!=(null===(t=r.origin)||void 0===t?void 0:t.location)?r.origin.location:r.encodings.length>0?r.encodings[0].location:null}static isManifestSupported(e){return null!=(null==e?void 0:e.formats["mp4-ws"])}static isHostSupported(e){return(0,m.isVideoElement)(e)}static isPlatformSupported(){return o.device.isImplements(o.Feature.MPEGTS)}initStateFlow(e){this.sf=e,e.handleEnter(d.Prepared,this.prepare),e.handleEnter(d.InUse,this.activate),e.handleExit(d.InUse,this.deactivate),e.handleEnter(u.Playing,g(this.startPlaying)),e.handleExit(u.Playing,g(this.stopPlaying)),e.handleEnter(c.UnMuted,g(m.unmuteVideoElement)),e.handleChanges(c.UnMuted,g(m.changeVolumeVideoElement)),e.handleExit(c.UnMuted,g(m.muteVideoElement))}prepare(e){return o.device.isImplements(o.Feature.MPEGTS)?i.Result.transition(o.device.loadMpegtsScript().then((()=>i.Result.ok()))):i.Result.reject("mpegts is not supported")}activate({host:e,manifest:t}){const r=(0,m.getVideoElement)(e.element);if(null==t.json)throw new Error("manifest is null");if(!o.device.isImplements(o.Feature.MPEGTS))throw new Error("mpegts is not supported");const n=t.json.formats["mp4-ws"],l=this.encodingSelector.select((0,p.parseEncodings)(n));if(null==(null==l?void 0:l.location)||""===l.location)throw new a.DriverNotSupportedError("invalid encoding",{});return this.player=new s.MeowPlayer(this.ctx,this,{},r),i.Result.ok()}deactivate({host:e}){var t;const r=(0,m.getVideoElement)(e.element);return null===(t=this.player)||void 0===t||t.destroy(),this.player=null,r.src="",i.Result.ok()}startPlaying(e,t){return i.Result.transition(this.player.play().then((()=>i.Result.ok())))}stopPlaying(e,t){return(0,m.getVideoElement)(e.host.element).pause(),i.Result.ok()}pickEncoding(){var e,t;return null!==(t=null===(e=this.data)||void 0===e?void 0:e.encodings[0])&&void 0!==t?t:null}async[Symbol.dispose](){var e;null===(e=this.player)||void 0===e||e.destroy()}}t.Mp4WsDriver=v,v.displayName="Mp4WsDriver",v.driverName="mp4ws",(0,f.registerVideoDrivers)(v)},5746:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NativeHlsDriver=void 0;const n=r(31635),i=r(89695),o=r(98645),a=r(54873),s=r(45829),l=n.__importStar(r(78666)),c=n.__importStar(r(23251)),u=n.__importStar(r(26678)),d=r(37996),h=r(9269),p=r(40503),f=r(35556);function m(e){const t=(t,r)=>u.InUse.is(r.nativeHls)?e(t,r):i.Result.ignore();return Reflect.defineProperty(t,"name",{configurable:!0,value:e.name}),t}class g{constructor(e){this.ctx=e,this.encodingSelector=new d.HighestBitrateSelector,this.availableEncodings=[],(0,a.makeBounded)(this)}static isManifestSupported(e){return null!=(null==e?void 0:e.formats["mp4-hls"])}static isHostSupported(e){return(0,f.isVideoElement)(e)}static isPlatformSupported(){return(0,s.supportsNativeHls)()}initStateFlow(e){e.handleEnter(u.Prepared,this.prepare),e.handleEnter(u.InUse,this.activate),e.handleExit(u.InUse,this.deactivate),e.handleEnter(c.Playing,m(f.startPlayingVideoElement)),e.handleExit(c.Playing,m(f.stopPlayingVideoElement)),e.handleEnter(l.UnMuted,m(f.unmuteVideoElement)),e.handleChanges(l.UnMuted,m(f.changeVolumeVideoElement)),e.handleExit(l.UnMuted,m(f.muteVideoElement))}prepare(e){return i.Result.ok()}activate({host:e,manifest:t}){const r=(0,f.getVideoElement)(e.element);if(null==t.json)throw Error("manifest is null");const n=t.json.formats["mp4-hls"],a=this.encodingSelector.select((0,h.parseEncodings)(n));if(null==(null==a?void 0:a.location)||""===a.location)throw new o.DriverNotSupportedError("invalid encoding",{});return(0,f.updateSource)(r,a.location),i.Result.ok()}deactivate({host:e}){return(0,f.getVideoElement)(e.element).src="",i.Result.ok()}async[Symbol.dispose](){}}t.NativeHlsDriver=g,g.displayName="NativeHlsDriver",g.driverName="native-hls",(0,p.registerVideoDrivers)(g)},74748:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WebRtcDriver=void 0;const n=r(31635),i=r(89695),o=r(21614),a=r(54873),s=r(45829),l=r(80366),c=r(18409),u=n.__importStar(r(78666)),d=n.__importStar(r(23251)),h=n.__importStar(r(11352)),p=r(37996),f=r(40503),m=r(35556);m.optionsCommonSchema.extend({id:o.z.literal("webrtc")}).readonly();let g=!1;function v(e){const t=(t,r)=>h.InUse.is(r.webRtc)?e(t,r):i.Result.ignore();return Reflect.defineProperty(t,"name",{configurable:!0,value:e.name}),t}async function y(e){return null!=e.source?e.source:new Promise(((t,r)=>{e.once("source",(e=>{t(e)}))}))}(0,s.supportsMediasoupWebrtc)("WebRTC").then((e=>{g=e}));class b{constructor(e){this.ctx=e,this.encodingSelector=new p.HighestBitrateSelector,this.availableEncodings=[],(0,a.makeBounded)(this),this.vc=e.videoClient}static isManifestSupported(e){return null!=(null==e?void 0:e.formats.webrtc)}static isHostSupported(e){return(0,m.isVideoElement)(e)}static isPlatformSupported(){return g}initStateFlow(e){e.handleEnter(h.Prepared,this.prepare),e.handleEnter(h.InUse,this.activate),e.handleExit(h.InUse,this.deactivate),e.handleEnter(d.Playing,v(m.startPlayingVideoElement)),e.handleExit(d.Playing,v(m.stopPlayingVideoElement)),e.handleEnter(u.UnMuted,v(m.unmuteVideoElement)),e.handleChanges(u.UnMuted,v(m.changeVolumeVideoElement)),e.handleExit(u.UnMuted,v(m.muteVideoElement))}prepare(e){return i.Result.ok()}activate({host:e,manifest:t,webRtc:r}){const n=(0,m.getVideoElement)(e.element);if(null==t.json)throw Error("manifest is null");const o=t.json.formats.webrtc;return i.Result.transition(this.joinCall(o,n,r.options.timeout))}deactivate({host:e}){var t;const r=(0,m.getVideoElement)(e.element);return null===(t=this.call)||void 0===t||t.dispose("driver is deactivated"),r.srcObject=null,i.Result.ok()}async[Symbol.dispose](){var e;null===(e=this.call)||void 0===e||e.dispose("driver is disposed")}async joinCall(e,t,r){if(null==e.origin.uri)return i.Result.reject("invalid sfu uri");const n={call:{id:e.origin.callId,sfu:{uri:e.origin.uri,httpUri:e.origin.httpUri,region:e.origin.region,version:e.origin.version},turn:e.origin.turn,support:"ovh"},user:{userId:e.origin.token,scope:"viewer",displayName:"",authorizeToken:e.origin.token}},o={rsrc:e.origin.rsrc,xkey:e.origin.publicKey,bpeerId:e.origin.peerId,joinUrl:e.origin.location},a={token:e.origin.token,playerOptions:{dontEmitPlayer:!0}};if(0===e.origin.streamNames.length)return i.Result.reject("no stream names in manifest");const s=e.origin.streamNames[0];e.origin.streamNames.length>1&&this.ctx.logger.warn("multiple stream names in manifest. use first one");const u=this.call=await this.vc.internalJoinCall(e.origin.callId,n,{...o,...a},(0,l.extendContext)(this.ctx,c.VideoClient));return new Promise(((e,n)=>{u.once("error",(e=>{n(e)})),u.on("streamAdded",(async r=>{r.streamName===s&&((0,m.updateSource)(t,await y(r.stream)),t.srcObject=await y(r.stream),r.stream.on("source",m.updateSource.bind(null,t)),e(i.Result.ok()))})),setTimeout((()=>e(i.Result.reject("timeout"))),5*r)}))}}t.WebRtcDriver=b,b.displayName="WebRtcDriver",b.driverName="webrtc",(0,f.registerVideoDrivers)(b)},92139:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HostSupervisor=void 0;const n=r(31635),i=r(89695),o=r(54873),a=r(35556),s=n.__importStar(r(87165)),l=n.__importStar(r(23251)),c=new WeakSet,u=new Map([["play","onPlay"],["pause","onPause"],["loadeddata","onLoadedData"],["loadedmetadata","onLoadedMetaData"],["canplay","onCanPlay"],["error","onError"],["suspend","onSuspend"],["volumechange","onVolumeChange"],["abort","onAbort"],["emptied","onEmptied"],["ended","onEnded"],["playing","onPlaying"],["stalled","onStalled"],["waiting","onWaiting"]]);class d{constructor(e){this.ctx=e,(0,o.makeBounded)(this),this.init()}init(){}initStateFlow(e){this.sf=e,e.handleEnter(s.Attached,this.hostAttached),e.handleExit(s.Attached,this.hostDetached)}hostAttached(e){const t=e.host.element;if(!(0,a.isVideoElement)(t))return i.Result.ignore("not a video element");if(c.has(t))return i.Result.reject("video element is already attached to another player");c.add(t);for(const[e,r]of u.entries())t.addEventListener(e,this[r]);return i.Result.ok()}onWaiting(){}onStalled(){}onPlaying(){console.log("!!! el playing")}onEnded(){}onEmptied(){}onAbort(){console.log("!!! el abort")}onVolumeChange(){const e=(0,a.getVideoElement)(this.sf.host.element);(0,a.isVolumeChanged)(e.volume,this.sf.audio.volume)&&!(0,i.isTransitioning)(this.sf)&&this.sf.dispatch("uncontrolledVolumeChange",{volume:e.volume})}onSuspend(){}onError(){console.log("!!! el error")}onCanPlay(){}onLoadedMetaData(){}onLoadedData(){}onPause(){l.Playing.is(this.sf.playback)&&!(0,i.isTransitioning)(this.sf)&&this.sf.dispatch("uncontrolledPause",{})}onPlay(){l.Playing.is(this.sf.playback)||(0,i.isTransitioning)(this.sf)||this.sf.dispatch("uncontrolledPlay",{})}hostDetached({host:e}){const t=e.element;return(0,a.isVideoElement)(t)?(this.removeElListeners(t),c.delete(e.element),i.Result.ok()):i.Result.ignore("not a video element")}[Symbol.dispose](){const e=this.sf.host.element;(0,a.isVideoElement)(e)&&(this.removeElListeners(e),c.delete(e))}initElListeners(){}removeElListeners(e){for(const[t,r]of u.entries())e.removeEventListener(t,this[r])}}t.HostSupervisor=d,d.displayName="HostSupervisor"},7722:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MediaLoader=void 0;const n=r(31635),i=r(89695),o=r(86729),a=r(54873),s=n.__importStar(r(35094));class l{constructor(e){this.ctx=e,this.enabled=!1,this.timeoutId=0,(0,a.makeBounded)(this)}initStateFlow(e){this.sf=e,e.handleEnter(s.Fetching,this.startPolling),e.onCommit(s.Fetching,this.restart),e.handleEnter(s.NotFound,this.stopPolling),e.handleEnter(s.Forbidden,this.stopPolling),e.handleEnter(s.InternalError,this.stopPolling)}start(){this.enabled||(this.enabled=!0,this.timeoutId=o.device.setTimeout(this.process,0))}stop(){this.enabled=!1}[Symbol.dispose](){this.stop()}async process(){if(!this.enabled)return;if(null!=this.sf.manifest.deadline&&Date.now()>this.sf.manifest.deadline)return void this.sf.dispatch("manifestDeadline",{});const e=function(e,t){const r=new URL(e);for(const[e,n]of Object.entries(t))r.searchParams.set(e,n);return r.toString()}(this.sf.manifest.url,this.sf.manifest.options.params),[t,r]=await async function(e){try{const t=await fetch(e,{method:"GET"});return t.ok?[await t.json(),t.status]:[null,t.status]}catch(e){return[null,-1]}}(e),n=await this.sf.dispatchAsync("manifestUpdate",{manifest:t,status:r});n.ok||n.kind===i.ResultKind.Ignored||this.ctx.logger.error(`Signal manifestUpdate: ${String(n)}`,{signal:"manifestUpdate",result:String(n)}),this.timeoutId=o.device.setTimeout(this.process,this.sf.manifest.nextUpdate)}startPolling(e){return this.enabled?i.Result.ignore("media loader is already started"):(this.start(),i.Result.ok())}restart(e){o.device.clearTimeout(this.timeoutId),this.timeoutId=o.device.setTimeout(this.process,e.manifest.nextUpdate)}stopPolling(e){return this.enabled?(this.stop(),i.Result.ok()):i.Result.ignore("media loader is already stopped")}}t.MediaLoader=l,l.displayName="MediaLoader"},10227:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Player=void 0,t.requestPlayer=function(e,t,r){const i={stack:[],error:void 0,hasError:!1};try{e=(0,d.extendContext)(e,E);const a=n.__addDisposableResource(i,new DisposableStack,!1),l=s.PlayerOptions.parse(r),c=h.registeredDrivers.map((t=>new t((0,d.extendContext)(e,t)))),g=a.use(new E(e)),v=a.use(new f.MediaLoader((0,d.extendContext)(e,f.MediaLoader))),y=a.use(new p.HostSupervisor((0,d.extendContext)(e,p.HostSupervisor))),b=a.use(m.PlayerStateFlow.initialize(g,v,y,...c));b.dispatch("optionsApply",{options:l}).expect(o.ResultKind.OK),b.dispatch("manifestReplaceUrl",{url:t}).expect(o.ResultKind.OK);const _=a.move();return(0,u.onceCanceled)(e).finally((()=>_.dispose())),g}catch(e){i.error=e,i.hasError=!0}finally{n.__disposeResources(i)}};const n=r(31635),i=r(50543),o=r(89695),a=r(80769),s=r(97403),l=r(92491),c=r(54873),u=r(93503),d=r(80366),h=r(40503),p=r(92139),f=r(7722),m=r(55517),g=n.__importStar(r(78666)),v=n.__importStar(r(23251)),y=n.__importStar(r(84745)),b=n.__importStar(r(64979)),_=r(59704),S=n.__importStar(r(87165)),w=n.__importStar(r(35094));class E extends i.EventEmitter{constructor(e){super(),this.ctx=e,this.isDisposed=!1,(0,c.makeBounded)(this),(0,u.onceCanceled)(e).finally(this[Symbol.dispose])}get logger(){return this.ctx.logger}set logger(e){throw(0,l.createError)(a.ErrorCode.NotAllowed)}get supportsLowLatency(){return!1}set supportsLowLatency(e){throw(0,l.createError)(a.ErrorCode.NotAllowed)}get lowLatency(){return!1}set lowLatency(e){}get currentQuality(){return null}get currentPlayer(){return this}set currentPlayer(e){throw(0,l.createError)(a.ErrorCode.NotAllowed)}get availablePlayers(){throw(0,l.createError)(a.ErrorCode.NotAllowed)}set availablePlayers(e){throw(0,l.createError)(a.ErrorCode.NotAllowed)}get attached(){return!S.Detached.is(this.sf.host)}get autoPlay(){return this.sf.playback.autoPlay}set autoPlay(e){this.sf.dispatch(e?"requestEnableAutoPlay":"requestDisableAutoPlay",{}).expect(o.ResultKind.OK)}get blurred(){return y.Blurred.is(this.sf.quality)}set blurred(e){throw(0,l.createError)(a.ErrorCode.NotAllowed)}get driverFailover(){const[e,t]=(0,_.getCurrentDriver)(this.sf);return 0===t.timeout}set driverFailover(e){throw(0,l.createError)(a.ErrorCode.NotAllowed)}get forcedMute(){return g.ForcedMute.is(this.sf.audio)}set forceMute(e){throw(0,l.createError)(a.ErrorCode.NotAllowed)}get format(){const[e,t]=(0,_.getCurrentDriver)(this.sf);return t.driverFormat}get localAudioMuted(){return g.Muted.is(this.sf.audio)}set localAudioMuted(e){this.sf.dispatch(e?"requestMute":"requestUnMute",{}).expect(o.ResultKind.OK)}get localAudioVolume(){return this.sf.audio.volume}set localAudioVolume(e){this.sf.dispatch("requestVolumeChange",{volume:e}).expect(o.ResultKind.OK)}get localVideoPaused(){return b.Paused.is(this.sf.video)}set localVideoPaused(e){this.sf.dispatchAsync(e?"requestPause":"requestPlay",{})}get lowPowerMode(){return!1}set lowPowerMode(e){throw(0,l.createError)(a.ErrorCode.NotAllowed)}get poster(){var e,t;return null!==(t=null===(e=this.sf.manifest.json)||void 0===e?void 0:e.previewImg)&&void 0!==t?t:null}set poster(e){this.sf.dispatch("requestOverridePoster",{url:e}).expect(o.ResultKind.OK)}set preferredLevel(e){this.sf.dispatch("requestForcedQuality",{quality:e}).expect(o.ResultKind.OK)}initStateFlow(e){this.sf=e,e.onCommit(S.Attached,this.onHostAttached),e.onCommit(w.Online,this.onManifestOnline)}onHostAttached(e){}async onManifestOnline(e){const[t,r]=(0,_.getSupportedDrivers)(e);if(-1===r&&t.length>0){let e=o.Result.ignore(),n=r>=t.length-1?0:r+1;for(;e.kind!==o.ResultKind.OK;)e=await this.sf.dispatchAsync("driverSwitch",{driver:t[n]}),n=n>=t.length-1?0:n+1;this.sf.playback.autoPlay&&(await this.sf.dispatchAsync("internalPlay",{})).expect(o.ResultKind.OK)}}attachTo(e){this.sf.dispatch("hostElementAttach",{host:e}).expect(o.ResultKind.OK)}isImplements(e){return!0}isSupported(){return Promise.resolve(!0)}updatePosterWithLatestFrame(){this.sf.dispatch("requestUpdatePosterFrame",{}).expect(o.ResultKind.OK)}toJSON(){return{}}getClosestQuality(e){return null}async nextDriver(){if((0,o.isTransitioning)(this.sf))throw new Error("cannot switch player while state is in transition");const[e,t]=(0,_.getSupportedDrivers)(this.sf),r=v.Playing.is(this.sf.playback);r&&this.sf.dispatch("internalPause",{}).expect(o.ResultKind.OK);let n=o.Result.ignore(),i=t>=e.length-1?0:t+1;for(;n.kind===o.ResultKind.Error||n.kind===o.ResultKind.Ignored;)n=await this.sf.dispatchAsync("driverSwitch",{driver:e[i]}),i=i>=e.length-1?0:i+1;r&&(await this.sf.dispatchAsync("internalPlay",{})).expect(o.ResultKind.OK)}async nextPlayer(){return this.nextDriver()}selectPlayer(e){throw(0,l.createError)(a.ErrorCode.NotAllowed)}setPreferredLevel(e){this.preferredLevel=e}async replaceManifestUrl(e){if((0,o.isTransitioning)(this.sf))throw new Error("cannot switch player while state is in transition");this.sf.dispatch("internalPause",{}).expect(o.ResultKind.OK,o.ResultKind.Ignored),(await this.sf.dispatchAsync("manifestReplaceUrl",{url:e})).expect(o.ResultKind.OK)}[Symbol.dispose](){this.dispose()}dispose(e){(0,u.cancel)(this.ctx,null!=e?e:"player is disposed"),this.isDisposed=!0}}t.Player=E,E.displayName="Player"},78666:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Silent=t.UnMuted=t.Muted=t.ForcedMute=t.NotApplicable=t.AudioGroup=void 0;const n=r(4521);function i({audio:e},r){return(0,t.Muted)(e)}function o({audio:e},r){return(0,t.UnMuted)(e)}function a({audio:e},r){const n=Math.min(Math.max(r.volume,0),1);return n>0?(0,t.UnMuted)({...e,volume:n}):(0,t.Muted)({...e,volume:n})}t.AudioGroup=n.PlayerStateFlow.registerGroup("audio").bootstrap((()=>(0,t.NotApplicable)({volume:.5}))),t.NotApplicable=t.AudioGroup.registerState("NotApplicable",{hostElementAttach:(e,r)=>(0,t.UnMuted)(e.audio)}),t.ForcedMute=t.AudioGroup.registerState("ForcedMute",{hostElementDetach:(e,r)=>(0,t.NotApplicable)(e.audio),requestGesture:function({audio:e},r){return 0===e.volume?(0,t.Muted)(e):(0,t.UnMuted)(e)},requestMute:i,requestUnMute:o}),t.Muted=t.AudioGroup.registerState("Muted",{hostElementDetach:(e,r)=>(0,t.NotApplicable)(e.audio),requestUnMute:o,requestVolumeChange:a}),t.UnMuted=t.AudioGroup.registerState("UnMuted",{hostElementDetach:(e,r)=>(0,t.NotApplicable)(e.audio),requestMute:i,requestVolumeChange:a}),t.Silent=t.AudioGroup.registerState("Silent",{hostElementDetach:(e,r)=>(0,t.NotApplicable)(e.audio),requestMute:i,requestUnMute:o,requestVolumeChange:a})},23251:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TemporaryPlaing=t.TemporaryPaused=t.Paused=t.Playing=t.NotApplicable=t.PlaybackGroup=t.UncontrolledPlaybackPolicy=void 0;const n=r(31635),i=r(89695),o=n.__importStar(r(87165)),a=n.__importStar(r(35094)),s=r(4521);var l;function c(e,r){switch(e.playback.uncontrolledPlaybackPolicy){case l.Apply:return d(e);case l.Reject:return i.Result.reject("uncontrolled play() calls are not allowed");case l.RollbackWithDelay:return(0,t.TemporaryPlaing)({...e.playback,delay:50})}return i.Result.ignore("ignored by policy")}function u(e,r){switch(e.playback.uncontrolledPlaybackPolicy){case l.Apply:return h(e);case l.Reject:return i.Result.reject("uncontrolled pause() calls are not allowed");case l.RollbackWithDelay:return(0,t.TemporaryPaused)({...e.playback,delay:50})}return i.Result.ignore("ignored by policy")}function d(e,r){return o.Attached.is(e.host)?a.Online.is(e.manifest)?(0,t.Playing)(e.playback):i.Result.reject("manifest must be online to playing media"):i.Result.reject("host is not attached")}function h(e,r){return o.Attached.is(e.host)?a.Online.is(e.manifest)?(0,t.Paused)(e.playback):i.Result.reject("manifest must be online to playing media"):i.Result.reject("host is not attached")}!function(e){e[e.Ignore=0]="Ignore",e[e.Apply=1]="Apply",e[e.Reject=2]="Reject",e[e.RollbackWithDelay=3]="RollbackWithDelay"}(l||(t.UncontrolledPlaybackPolicy=l={})),t.PlaybackGroup=s.PlayerStateFlow.registerGroup("playback").bootstrap((()=>(0,t.NotApplicable)({position:null,autoPlay:!0,uncontrolledPlaybackPolicy:l.RollbackWithDelay,delay:0}))),t.NotApplicable=t.PlaybackGroup.registerState("NotApplicable",{hostElementAttach:(e,r)=>(0,t.Paused)(e.playback)}),t.Playing=t.PlaybackGroup.registerState("Playing",{hostElementDetach:e=>(0,t.NotApplicable)(e.playback),requestPause:h,internalPause:h,uncontrolledPause:u}),t.Paused=t.PlaybackGroup.registerState("Paused",{hostElementDetach:e=>(0,t.NotApplicable)(e.playback),requestPlay:d,internalPlay:d,uncontrolledPlay:c}),t.TemporaryPaused=t.PlaybackGroup.registerState("ExternalPaused",{hostElementDetach:e=>(0,t.NotApplicable)(e.playback),uncontrolledPlay:c}),t.TemporaryPlaing=t.PlaybackGroup.registerState("ExternalPaused",{hostElementDetach:e=>(0,t.NotApplicable)(e.playback),uncontrolledPause:u})},84745:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Auto=t.Forced=t.Blurred=t.Default=t.QualityGroup=void 0;const n=r(89695),i=r(37996),o=r(59704),a=r(4521);t.QualityGroup=a.PlayerStateFlow.registerGroup("quality").bootstrap((()=>(0,t.Default)({availableQualities:[],preferredQuality:null,currentQuality:null,encodingSelector:new i.HighestBitrateSelector}))),t.Default=t.QualityGroup.registerState("Highest",{requestForcedQuality:function(e,r){const[i,a]=(0,o.getCurrentDriver)(e),s=r.quality;return null===i?n.Result.reject("no driver selected"):null==s?(0,t.Default)({...e.quality,preferredQuality:null}):s.startsWith("source:")&&a.features.sourceQuality?n.Result.reject("source quality is only supported for WebRTC driver"):a.features.forcedQuality?(0,t.Forced)({...e.quality,preferredQuality:s}):n.Result.reject("driver does not support forced quality")}}),t.Blurred=t.QualityGroup.registerState("Blurred",{}),t.Forced=t.QualityGroup.registerState("Forced",{}),t.Auto=t.QualityGroup.registerState("Auto",{})},64979:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VideoError=t.BlankScreen=t.Playing=t.Paused=t.NotApplicable=t.VideoGroup=void 0;const n=r(4521);t.VideoGroup=n.PlayerStateFlow.registerGroup("video").bootstrap((()=>(0,t.NotApplicable)({filter:null,poster:null}))),t.NotApplicable=t.VideoGroup.registerState("NotApplicable",{}),t.Paused=t.VideoGroup.registerState("Disabled",{}),t.Playing=t.VideoGroup.registerState("Enabled",{}),t.BlankScreen=t.VideoGroup.registerState("BlankScreen",{}),t.VideoError=t.VideoGroup.registerState("VideoError",{})},62400:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.findDriver=function(e,t){const[r,n]=t.reduce(((t,r,n)=>r.id===e.driverName?[n,r]:[t[0],t[1]]),[-1,null]);return[t.length-r,n]},t.checkDriverSupport=function(e,t,r){return(e.isHostSupported(t)?"h":"")+(e.isManifestSupported(r)?"m":"")+(e.isPlatformSupported()?"p":"")},t.checkDriverSwitchRestrictions=function(e){return(0,i.isTransitioning)(e.playback)?i.Result.reject("playing state is in transition"):o.Playing.is(e.playback)?i.Result.reject("driver is in playing state"):i.Result.ignore()};const n=r(31635),i=r(89695),o=n.__importStar(r(23251))},65174:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Failed=t.InUse=t.Stopped=t.Prepared=t.NotSupported=t.NotRequested=t.FlvHttpGroup=void 0;const n=r(89695),i=r(38114),o=r(4521),a=r(62400);function s(e,r){const[o,s]=(0,a.findDriver)(i.FlvHttpDriver,r.options.drivers);return-1!==o?n.Result.ignore():(0,t.NotRequested)({...e.flvHttp,priority:o})}function l(e,r){const n=(0,a.checkDriverSupport)(i.FlvHttpDriver,r.host,e.manifest.json);return"hmp"===n?(0,t.Prepared)({...e.flvHttp,support:n}):(0,t.NotSupported)({...e.flvHttp,support:n})}function c(e,r){const n=(0,a.checkDriverSupport)(i.FlvHttpDriver,e.host.element,r.manifest);return"hmp"===n?(0,t.Prepared)({...e.flvHttp,support:n}):(0,t.NotSupported)({...e.flvHttp,support:n})}t.FlvHttpGroup=o.PlayerStateFlow.registerGroup("flvHttp").bootstrap((()=>(0,t.NotRequested)({driverFormat:"flv-http",priority:-1,support:"",timeout:0,features:{sourceQuality:!1,forcedQuality:!0,autoBitrate:!1}}))),t.NotRequested=t.FlvHttpGroup.registerState("NotRequested",{optionsApply:function(e,r){const[o,s]=(0,a.findDriver)(i.FlvHttpDriver,r.options.drivers);if(-1===o)return n.Result.ignore();const l=(0,a.checkDriverSupport)(i.FlvHttpDriver,e.host.element,e.manifest.json);return"hmp"===l?(0,t.Prepared)({...e.flvHttp,priority:o,support:l,timeout:s.timeout}):(0,t.NotSupported)({...e.flvHttp,priority:o,support:l})}}),t.NotSupported=t.FlvHttpGroup.registerState("NotSupported",{optionsApply:s,manifestUpdate:c,hostElementAttach:l}),t.Prepared=t.FlvHttpGroup.registerState("Prepared",{optionsApply:s,manifestUpdate:c,hostElementAttach:l,driverSwitch:(e,r)=>{const i=(0,a.checkDriverSwitchRestrictions)(e);return i.kind===n.ResultKind.Rejected?i:r.driver===t.FlvHttpGroup.name?(0,t.InUse)(e.flvHttp):e.flvHttp}}),t.Stopped=t.FlvHttpGroup.registerState("Stopped",{optionsApply:s,hostElementAttach:l,driverSwitch:(e,r)=>{const i=(0,a.checkDriverSwitchRestrictions)(e);return i.kind===n.ResultKind.Rejected?i:r.driver===t.FlvHttpGroup.name?(0,t.InUse)(e.flvHttp):e.flvHttp}}),t.InUse=t.FlvHttpGroup.registerState("InUse",{optionsApply:()=>n.Result.reject("driver is in use"),hostElementDetach:()=>n.Result.reject("host element is in use of FlvHttp"),driverSwitch:(e,r)=>{const i=(0,a.checkDriverSwitchRestrictions)(e);return i.kind===n.ResultKind.Rejected?i:r.driver===t.FlvHttpGroup.name?e.flvHttp:(0,t.Stopped)(e.flvHttp)},manifestReplaceUrl:(e,r)=>{const i=(0,a.checkDriverSwitchRestrictions)(e);return i.kind===n.ResultKind.Rejected?i:(0,t.Prepared)(e.flvHttp)}}),t.Failed=t.FlvHttpGroup.registerState("Failed",{optionsApply:s})},98259:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Failed=t.InUse=t.Stopped=t.Prepared=t.NotSupported=t.NotRequested=t.HlsJSGroup=void 0;const n=r(89695),i=r(39647),o=r(4521),a=r(62400);function s(e,r){const[o,s]=(0,a.findDriver)(i.HlsJSDriver,r.options.drivers);return-1!==o?n.Result.ignore():(0,t.NotRequested)({...e.hlsJs,priority:o})}function l(e,r){const n=(0,a.checkDriverSupport)(i.HlsJSDriver,r.host,e.manifest.json);return"hmp"===n?(0,t.Prepared)({...e.hlsJs,support:n}):(0,t.NotSupported)({...e.hlsJs,support:n})}function c(e,r){const n=(0,a.checkDriverSupport)(i.HlsJSDriver,e.host.element,r.manifest);return"hmp"===n?(0,t.Prepared)({...e.hlsJs,support:n}):(0,t.NotSupported)({...e.hlsJs,support:n})}t.HlsJSGroup=o.PlayerStateFlow.registerGroup("hlsJs").bootstrap((()=>(0,t.NotRequested)({driverFormat:"mp4-hls",priority:-1,support:"",timeout:0,features:{sourceQuality:!1,forcedQuality:!0,autoBitrate:!0}}))),t.NotRequested=t.HlsJSGroup.registerState("NotRequested",{optionsApply:function(e,r){const[o,s]=(0,a.findDriver)(i.HlsJSDriver,r.options.drivers);if(-1===o)return n.Result.ignore();const l=(0,a.checkDriverSupport)(i.HlsJSDriver,e.host.element,e.manifest.json);return"hmp"===l?(0,t.Prepared)({...e.hlsJs,priority:o,support:l,timeout:s.timeout,hlsjsConfig:s.hlsjsConfig}):(0,t.NotSupported)({...e.hlsJs,priority:o,support:l})}}),t.NotSupported=t.HlsJSGroup.registerState("NotSupported",{optionsApply:s,manifestUpdate:c,hostElementAttach:l}),t.Prepared=t.HlsJSGroup.registerState("Prepared",{optionsApply:s,manifestUpdate:c,hostElementAttach:l,driverSwitch:(e,r)=>{const i=(0,a.checkDriverSwitchRestrictions)(e);return i.kind===n.ResultKind.Rejected?i:r.driver===t.HlsJSGroup.name?(0,t.InUse)(e.hlsJs):e.hlsJs}}),t.Stopped=t.HlsJSGroup.registerState("Stopped",{optionsApply:s,hostElementAttach:l,driverSwitch:(e,r)=>{const i=(0,a.checkDriverSwitchRestrictions)(e);return i.kind===n.ResultKind.Rejected?i:r.driver===t.HlsJSGroup.name?(0,t.InUse)(e.hlsJs):e.hlsJs}}),t.InUse=t.HlsJSGroup.registerState("InUse",{optionsApply:()=>n.Result.reject("driver is in use"),hostElementDetach:()=>n.Result.reject("host element is in use of HlsJs"),driverSwitch:(e,r)=>{const i=(0,a.checkDriverSwitchRestrictions)(e);return i.kind===n.ResultKind.Rejected?i:r.driver===t.HlsJSGroup.name?e.hlsJs:(0,t.Stopped)(e.hlsJs)}}),t.Failed=t.HlsJSGroup.registerState("Failed",{optionsApply:s})},46073:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Failed=t.InUse=t.Stopped=t.Prepared=t.NotSupported=t.NotRequested=t.Mp4WsGroup=void 0;const n=r(89695),i=r(8053),o=r(4521),a=r(62400);function s(e,r){const[o,s]=(0,a.findDriver)(i.Mp4WsDriver,r.options.drivers);return-1!==o?n.Result.ignore():(0,t.NotRequested)({...e.mp4ws,priority:o})}function l(e,r){const n=(0,a.checkDriverSupport)(i.Mp4WsDriver,r.host,e.manifest.json);return"hmp"===n?(0,t.Prepared)({...e.mp4ws,support:n}):(0,t.NotSupported)({...e.mp4ws,support:n})}function c(e,r){const n=(0,a.checkDriverSupport)(i.Mp4WsDriver,e.host.element,r.manifest);return"hmp"===n?(0,t.Prepared)({...e.mp4ws,support:n}):(0,t.NotSupported)({...e.mp4ws,support:n})}t.Mp4WsGroup=o.PlayerStateFlow.registerGroup("mp4ws").bootstrap((()=>(0,t.NotRequested)({driverFormat:"mp4-ws",priority:-1,support:"",timeout:0,features:{sourceQuality:!1,forcedQuality:!0,autoBitrate:!1}}))),t.NotRequested=t.Mp4WsGroup.registerState("NotRequested",{optionsApply:function(e,r){const[o,s]=(0,a.findDriver)(i.Mp4WsDriver,r.options.drivers);if(-1===o)return n.Result.ignore();const l=(0,a.checkDriverSupport)(i.Mp4WsDriver,e.host.element,e.manifest.json);return"hmp"===l?(0,t.Prepared)({...e.mp4ws,priority:o,support:l,timeout:s.timeout}):(0,t.NotSupported)({...e.mp4ws,priority:o,support:l})}}),t.NotSupported=t.Mp4WsGroup.registerState("NotSupported",{optionsApply:s,manifestUpdate:c,hostElementAttach:l}),t.Prepared=t.Mp4WsGroup.registerState("Prepared",{optionsApply:s,manifestUpdate:c,hostElementAttach:l,driverSwitch:(e,r)=>{const i=(0,a.checkDriverSwitchRestrictions)(e);return i.kind===n.ResultKind.Rejected?i:r.driver===t.Mp4WsGroup.name?(0,t.InUse)(e.mp4ws):e.mp4ws}}),t.Stopped=t.Mp4WsGroup.registerState("Stopped",{optionsApply:s,hostElementAttach:l,driverSwitch:(e,r)=>{const i=(0,a.checkDriverSwitchRestrictions)(e);return i.kind===n.ResultKind.Rejected?i:r.driver===t.Mp4WsGroup.name?(0,t.InUse)(e.mp4ws):e.mp4ws}}),t.InUse=t.Mp4WsGroup.registerState("InUse",{optionsApply:()=>n.Result.reject("driver is in use"),hostElementDetach:()=>n.Result.reject("host element is in use of Mp4Ws"),driverSwitch:(e,r)=>{const i=(0,a.checkDriverSwitchRestrictions)(e);return i.kind===n.ResultKind.Rejected?i:r.driver===t.Mp4WsGroup.name?e.mp4ws:(0,t.Stopped)(e.mp4ws)}}),t.Failed=t.Mp4WsGroup.registerState("Failed",{optionsApply:s})},26678:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Failed=t.InUse=t.Stopped=t.Prepared=t.NotSupported=t.NotRequested=t.NativeHlsGroup=void 0;const n=r(89695),i=r(5746),o=r(4521),a=r(62400);function s(e,r){const[o,s]=(0,a.findDriver)(i.NativeHlsDriver,r.options.drivers);return-1!==o?n.Result.ignore():(0,t.NotRequested)({...e.nativeHls,priority:o})}function l(e,r){const n=(0,a.checkDriverSupport)(i.NativeHlsDriver,r.host,e.manifest.json);return"hmp"===n?(0,t.Prepared)({...e.nativeHls,support:n}):(0,t.NotSupported)({...e.nativeHls,support:n})}function c(e,r){const n=(0,a.checkDriverSupport)(i.NativeHlsDriver,e.host.element,r.manifest);return"hmp"===n?(0,t.Prepared)({...e.nativeHls,support:n}):(0,t.NotSupported)({...e.nativeHls,support:n})}t.NativeHlsGroup=o.PlayerStateFlow.registerGroup("nativeHls").bootstrap((()=>(0,t.NotRequested)({driverFormat:"mp4-hls",priority:-1,support:"",timeout:0,features:{sourceQuality:!1,forcedQuality:!0,autoBitrate:!0}}))),t.NotRequested=t.NativeHlsGroup.registerState("NotRequested",{optionsApply:function(e,r){const[o,s]=(0,a.findDriver)(i.NativeHlsDriver,r.options.drivers);if(-1===o)return n.Result.ignore();const l=(0,a.checkDriverSupport)(i.NativeHlsDriver,e.host.element,e.manifest.json);return"hmp"===l?(0,t.Prepared)({...e.nativeHls,priority:o,support:l,timeout:s.timeout}):(0,t.NotSupported)({...e.nativeHls,priority:o,support:l})}}),t.NotSupported=t.NativeHlsGroup.registerState("NotSupported",{optionsApply:s,manifestUpdate:c,hostElementAttach:l}),t.Prepared=t.NativeHlsGroup.registerState("Prepared",{optionsApply:s,manifestUpdate:c,hostElementAttach:l,driverSwitch:(e,r)=>{const i=(0,a.checkDriverSwitchRestrictions)(e);return i.kind===n.ResultKind.Rejected?i:r.driver===t.NativeHlsGroup.name?(0,t.InUse)(e.nativeHls):e.nativeHls}}),t.Stopped=t.NativeHlsGroup.registerState("Stopped",{optionsApply:s,hostElementAttach:l,driverSwitch:(e,r)=>{const i=(0,a.checkDriverSwitchRestrictions)(e);return i.kind===n.ResultKind.Rejected?i:r.driver===t.NativeHlsGroup.name?(0,t.InUse)(e.nativeHls):e.nativeHls}}),t.InUse=t.NativeHlsGroup.registerState("InUse",{optionsApply:()=>n.Result.reject("driver is in use"),hostElementDetach:()=>n.Result.reject("host element is in use of NativeHlsDriver"),driverSwitch:(e,r)=>{const i=(0,a.checkDriverSwitchRestrictions)(e);return i.kind===n.ResultKind.Rejected?i:r.driver===t.NativeHlsGroup.name?e.nativeHls:(0,t.Stopped)(e.nativeHls)}}),t.Failed=t.NativeHlsGroup.registerState("Failed",{optionsApply:s})},11352:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Failed=t.InUse=t.Stopped=t.Prepared=t.NotSupported=t.NotRequested=t.WebRtcGroup=void 0;const n=r(89695),i=r(97403),o=r(74748),a=r(4521),s=r(62400);function l(e,r){const[i,a]=(0,s.findDriver)(o.WebRtcDriver,r.options.drivers);return-1!==i?n.Result.ignore():(0,t.NotRequested)({...e.webRtc,priority:i})}function c(e,r){const n=(0,s.checkDriverSupport)(o.WebRtcDriver,r.host,e.manifest.json);return"hmp"===n?(0,t.Prepared)({...e.webRtc,support:n}):(0,t.NotSupported)({...e.webRtc,support:n})}function u(e,r){const n=(0,s.checkDriverSupport)(o.WebRtcDriver,e.host.element,r.manifest);return"hmp"===n?(0,t.Prepared)({...e.webRtc,support:n}):(0,t.NotSupported)({...e.webRtc,support:n})}t.WebRtcGroup=a.PlayerStateFlow.registerGroup("webRtc").bootstrap((()=>(0,t.NotRequested)({driverFormat:"webrtc",priority:-1,support:"",timeout:0,options:i.WebrtcDriverOptions.parse({id:"webrtc"}),features:{sourceQuality:!0,forcedQuality:!1,autoBitrate:!0}}))),t.NotRequested=t.WebRtcGroup.registerState("NotRequested",{optionsApply:function(e,r){const[i,a]=(0,s.findDriver)(o.WebRtcDriver,r.options.drivers);if(-1===i)return n.Result.ignore();const l=(0,s.checkDriverSupport)(o.WebRtcDriver,e.host.element,e.manifest.json);return"hmp"===l?(0,t.Prepared)({...e.webRtc,priority:i,support:l,options:a,timeout:a.timeout}):(0,t.NotSupported)({...e.webRtc,priority:i,support:l,options:a})}}),t.NotSupported=t.WebRtcGroup.registerState("NotSupported",{optionsApply:l,manifestUpdate:u,hostElementAttach:c}),t.Prepared=t.WebRtcGroup.registerState("Prepared",{optionsApply:l,manifestUpdate:u,hostElementAttach:c,driverSwitch:(e,r)=>{const i=(0,s.checkDriverSwitchRestrictions)(e);return i.kind===n.ResultKind.Rejected?i:r.driver===t.WebRtcGroup.name?(0,t.InUse)(e.webRtc):e.webRtc}}),t.Stopped=t.WebRtcGroup.registerState("Stopped",{optionsApply:l,hostElementAttach:c,driverSwitch:(e,r)=>{const i=(0,s.checkDriverSwitchRestrictions)(e);return i.kind===n.ResultKind.Rejected?i:r.driver===t.WebRtcGroup.name?(0,t.InUse)(e.webRtc):e.webRtc}}),t.InUse=t.WebRtcGroup.registerState("InUse",{optionsApply:()=>n.Result.reject("driver is in use"),hostElementDetach:()=>n.Result.reject("host element is in use of WebRtc"),driverSwitch:(e,r)=>{const i=(0,s.checkDriverSwitchRestrictions)(e);return i.kind===n.ResultKind.Rejected?i:r.driver===t.WebRtcGroup.name?e.webRtc:(0,t.Stopped)(e.webRtc)}}),t.Failed=t.WebRtcGroup.registerState("Failed",{optionsApply:l})},59704:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSupportedDrivers=o,t.getCurrentDriver=function(e){for(const t in e){const r=e[t];if(i(r)&&"InUse"===(0,n.getStateName)(r))return[t,r]}return[null,{driverFormat:"",timeout:0,priority:0,support:"",features:{autoBitrate:!1,forcedQuality:!1,sourceQuality:!1}}]},t.getNextDriver=function(e){const[t,r]=o(e);return-1===r?null:t[(r+1)%t.length]};const n=r(89695);function i(e){return"object"==typeof e&&null!==e&&"driverFormat"in e&&"priority"in e}function o(e){let t="";const r=Object.keys(e).reduce(((r,o)=>{const a=e[o];if(!i(a))return r;switch((0,n.getStateName)(a)){case"Prepared":case"Stopped":r.push([o,a.priority]);break;case"InUse":r.push([o,a.priority]),t=o}return r}),[]).sort(((e,t)=>t[1]-e[1])).map((e=>e[0]));return[r,r.indexOf(t)]}},55517:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PlayerStateFlow=void 0,r(78666),r(23251),r(84745),r(64979),r(65174),r(98259),r(46073),r(26678),r(11352),r(87165),r(35094);var n=r(4521);Object.defineProperty(t,"PlayerStateFlow",{enumerable:!0,get:function(){return n.PlayerStateFlow}})},87165:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Ready=t.HaveMetadata=t.Attached=t.Detached=t.HostGroup=void 0;const n=r(89695),i=r(4521);t.HostGroup=i.PlayerStateFlow.registerGroup("host").bootstrap((()=>(0,t.Detached)({element:null}))),t.Detached=t.HostGroup.registerState("Detached",{hostElementAttach:function({host:e},r){return null==typeof r.host||"object"!=typeof r.host?n.Result.reject(`Invalid host element: ${String(r.host)}`):(0,t.Attached)({...e,element:r.host})}}),t.Attached=t.HostGroup.registerState("Attached",{hostElementDetach:function({host:e},r){return(0,t.Detached)({...e,element:null})},hostElementAttach:()=>n.Result.reject("host is already attached")}),t.HaveMetadata=t.HostGroup.registerState("HaveMetadata",{}),t.Ready=t.HostGroup.registerState("Ready",{})},35094:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Online=t.InternalError=t.NotFound=t.Forbidden=t.Fetching=t.Offline=t.ManifestGroup=void 0;const n=r(89695),i=r(97403),o=r(4521);function a({manifest:e},r){try{return new URL(r.url),(0,t.Fetching)({...e,nextUpdate:0,json:null,url:r.url})}catch(e){return n.Result.reject(`invalid URL: ${r.url}`)}}function s(e,r){var i,o,a;const s=e.manifest;if(401===r.status||403===r.status)return 0===s.options.refetch?(0,t.Forbidden)({...s,json:null}):(0,t.Fetching)({...s,nextUpdate:s.options.polling.unauthorized,deadline:Date.now()+s.options.refetch,json:null});if(404===r.status)return(0,t.Fetching)({...s,nextUpdate:s.options.polling.notfound,deadline:null,json:null});if(r.status>=500||null==r.manifest)return(0,t.InternalError)({...s,json:null});const l=new Set(Object.keys(null!==(o=null===(i=s.json)||void 0===i?void 0:i.formats)&&void 0!==o?o:[])),c=Object.keys(r.manifest.formats),u=null!==(a=r.manifest.self)&&void 0!==a?a:s.url;return l.size!==c.length||c.some((e=>!l.has(e)))||u!==s.url?(0,t.Online)({...s,json:r.manifest,url:u,nextUpdate:s.options.polling.default,deadline:null}):n.Result.ignore("no changes in manifest")}function l({manifest:e},t){return{options:t.options.manifest}}t.ManifestGroup=o.PlayerStateFlow.registerGroup("manifest").bootstrap((()=>(0,t.Offline)({url:"",json:null,nextUpdate:0,deadline:null,options:i.ManifestOptions.parse({})}))),t.Offline=t.ManifestGroup.registerState("Offline",{optionsApply:l,manifestReplaceUrl:a,manifestUpdate:s}),t.Fetching=t.ManifestGroup.registerState("Fetching",{optionsApply:l,manifestReplaceUrl:a,manifestUpdate:s,manifestDeadline:e=>(0,t.Forbidden)(e.manifest)}),t.Forbidden=t.ManifestGroup.registerState("Forbidden",{optionsApply:l,manifestReplaceUrl:a}),t.NotFound=t.ManifestGroup.registerState("NotFound",{optionsApply:l,manifestReplaceUrl:a,manifestUpdate:s}),t.InternalError=t.ManifestGroup.registerState("InternalError",{optionsApply:l,manifestReplaceUrl:a}),t.Online=t.ManifestGroup.registerState("Online",{optionsApply:l,manifestReplaceUrl:a,manifestUpdate:s})},4521:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PlayerStateFlow=void 0;const n=r(89695);t.PlayerStateFlow=new n.StateFlow},43375:(e,t,r)=>{"use strict";e.exports=r(14223)},14223:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PackageMetaKeys=t.LEVELS=t.isSerializableObject=t.isPlainRecord=t.GlobalMetaKeys=t.extractAggregates=void 0;var n=r(43428);Object.defineProperty(t,"extractAggregates",{enumerable:!0,get:function(){return n.extractAggregates}}),Object.defineProperty(t,"GlobalMetaKeys",{enumerable:!0,get:function(){return n.GlobalMetaKeys}}),Object.defineProperty(t,"isPlainRecord",{enumerable:!0,get:function(){return n.isPlainRecord}}),Object.defineProperty(t,"isSerializableObject",{enumerable:!0,get:function(){return n.isSerializableObject}}),Object.defineProperty(t,"LEVELS",{enumerable:!0,get:function(){return n.LEVELS}}),Object.defineProperty(t,"PackageMetaKeys",{enumerable:!0,get:function(){return n.PackageMetaKeys}})},43428:(e,t)=>{"use strict";function r(e){return null!=e&&"object"==typeof e&&!Array.isArray(e)&&"toJSON"in e&&"function"==typeof e.toJSON}function n(e){return null!=e&&"object"==typeof e&&!Array.isArray(e)&&!r(e)&&!Object.values(e).some((e=>null!=e&&!["number","string","boolean"].includes(typeof e)))}Object.defineProperty(t,"__esModule",{value:!0}),t.extractAggregates=t.isPlainRecord=t.isSerializableObject=t.PackageMetaKeys=t.GlobalMetaKeys=t.LEVELS=void 0,t.LEVELS=["trace","debug","network","timing","local","info","warn","notice","deprecated","error","fatal"],t.GlobalMetaKeys=["source","logId","userAgent","referrer","loggerVer"],t.PackageMetaKeys=["package","component","service","release","chain","client","contextId","instanceId","commitHash"],t.isSerializableObject=r,t.isPlainRecord=n,t.extractAggregates=function(e,...t){if(!r(e))return{};const i=e.toJSON();if(null==i||"object"!=typeof i||Array.isArray(i)||r(i))return{};const o=i.aggregates;if(!n(o))return{};for(const e of t)delete o[e];return o}},52874:(e,t,r)=>{"use strict";var n=String.prototype.replace,i=/%20/g,o=r(34431),a={RFC1738:"RFC1738",RFC3986:"RFC3986"};e.exports=o.assign({default:a.RFC3986,formatters:{RFC1738:function(e){return n.call(e,i,"+")},RFC3986:function(e){return String(e)}}},a)},18638:(e,t,r)=>{"use strict";var n=r(2643),i=r(50813),o=r(52874);e.exports={formats:o,parse:i,stringify:n}},50813:(e,t,r)=>{"use strict";var n=r(34431),i=Object.prototype.hasOwnProperty,o=Array.isArray,a={allowDots:!1,allowPrototypes:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:n.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},s=function(e){return e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(parseInt(t,10))}))},l=function(e,t){return e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},c=function(e,t,r,n){if(e){var o=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,a=/(\[[^[\]]*])/g,s=r.depth>0&&/(\[[^[\]]*])/.exec(o),c=s?o.slice(0,s.index):o,u=[];if(c){if(!r.plainObjects&&i.call(Object.prototype,c)&&!r.allowPrototypes)return;u.push(c)}for(var d=0;r.depth>0&&null!==(s=a.exec(o))&&d=0;--o){var a,s=e[o];if("[]"===s&&r.parseArrays)a=[].concat(i);else{a=r.plainObjects?Object.create(null):{};var c="["===s.charAt(0)&&"]"===s.charAt(s.length-1)?s.slice(1,-1):s,u=parseInt(c,10);r.parseArrays||""!==c?!isNaN(u)&&s!==c&&String(u)===c&&u>=0&&r.parseArrays&&u<=r.arrayLimit?(a=[])[u]=i:a[c]=i:a={0:i}}i=a}return i}(u,t,r,n)}};e.exports=function(e,t){var r=function(e){if(!e)return a;if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=void 0===e.charset?a.charset:e.charset;return{allowDots:void 0===e.allowDots?a.allowDots:!!e.allowDots,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:a.allowPrototypes,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:a.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:a.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:a.comma,decoder:"function"==typeof e.decoder?e.decoder:a.decoder,delimiter:"string"==typeof e.delimiter||n.isRegExp(e.delimiter)?e.delimiter:a.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:a.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:a.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:a.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:a.plainObjects,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:a.strictNullHandling}}(t);if(""===e||null==e)return r.plainObjects?Object.create(null):{};for(var u="string"==typeof e?function(e,t){var r,c={},u=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,d=t.parameterLimit===1/0?void 0:t.parameterLimit,h=u.split(t.delimiter,d),p=-1,f=t.charset;if(t.charsetSentinel)for(r=0;r-1&&(g=o(g)?[g]:g),i.call(c,m)?c[m]=n.combine(c[m],g):c[m]=g}return c}(e,r):e,d=r.plainObjects?Object.create(null):{},h=Object.keys(u),p=0;p{"use strict";var n=r(34431),i=r(52874),o=Object.prototype.hasOwnProperty,a={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},s=Array.isArray,l=Array.prototype.push,c=function(e,t){l.apply(e,s(t)?t:[t])},u=Date.prototype.toISOString,d=i.default,h={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:n.encode,encodeValuesOnly:!1,format:d,formatter:i.formatters[d],indices:!1,serializeDate:function(e){return u.call(e)},skipNulls:!1,strictNullHandling:!1},p=function e(t,r,i,o,a,l,u,d,p,f,m,g,v){var y,b=t;if("function"==typeof u?b=u(r,b):b instanceof Date?b=f(b):"comma"===i&&s(b)&&(b=n.maybeMap(b,(function(e){return e instanceof Date?f(e):e})).join(",")),null===b){if(o)return l&&!g?l(r,h.encoder,v,"key"):r;b=""}if("string"==typeof(y=b)||"number"==typeof y||"boolean"==typeof y||"symbol"==typeof y||"bigint"==typeof y||n.isBuffer(b))return l?[m(g?r:l(r,h.encoder,v,"key"))+"="+m(l(b,h.encoder,v,"value"))]:[m(r)+"="+m(String(b))];var _,S=[];if(void 0===b)return S;if(s(u))_=u;else{var w=Object.keys(b);_=d?w.sort(d):w}for(var E=0;E<_.length;++E){var C=_[E],O=b[C];if(!a||null!==O){var P=s(b)?"function"==typeof i?i(r,C):r:r+(p?"."+C:"["+C+"]");c(S,e(O,P,i,o,a,l,u,d,p,f,m,g,v))}}return S};e.exports=function(e,t){var r,n=e,l=function(e){if(!e)return h;if(null!==e.encoder&&void 0!==e.encoder&&"function"!=typeof e.encoder)throw new TypeError("Encoder has to be a function.");var t=e.charset||h.charset;if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=i.default;if(void 0!==e.format){if(!o.call(i.formatters,e.format))throw new TypeError("Unknown format option provided.");r=e.format}var n=i.formatters[r],a=h.filter;return("function"==typeof e.filter||s(e.filter))&&(a=e.filter),{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:h.addQueryPrefix,allowDots:void 0===e.allowDots?h.allowDots:!!e.allowDots,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:h.charsetSentinel,delimiter:void 0===e.delimiter?h.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:h.encode,encoder:"function"==typeof e.encoder?e.encoder:h.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:h.encodeValuesOnly,filter:a,formatter:n,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:h.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:h.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:h.strictNullHandling}}(t);"function"==typeof l.filter?n=(0,l.filter)("",n):s(l.filter)&&(r=l.filter);var u,d=[];if("object"!=typeof n||null===n)return"";u=t&&t.arrayFormat in a?t.arrayFormat:t&&"indices"in t?t.indices?"indices":"repeat":"indices";var f=a[u];r||(r=Object.keys(n)),l.sort&&r.sort(l.sort);for(var m=0;m0?y+v:""}},34431:e=>{"use strict";var t=Object.prototype.hasOwnProperty,r=Array.isArray,n=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),i=function(e,t){for(var r=t&&t.plainObjects?Object.create(null):{},n=0;n1;){var t=e.pop(),n=t.obj[t.prop];if(r(n)){for(var i=[],o=0;o=48&&s<=57||s>=65&&s<=90||s>=97&&s<=122?o+=i.charAt(a):s<128?o+=n[s]:s<2048?o+=n[192|s>>6]+n[128|63&s]:s<55296||s>=57344?o+=n[224|s>>12]+n[128|s>>6&63]+n[128|63&s]:(a+=1,s=65536+((1023&s)<<10|1023&i.charCodeAt(a)),o+=n[240|s>>18]+n[128|s>>12&63]+n[128|s>>6&63]+n[128|63&s])}return o},isBuffer:function(e){return!(!e||"object"!=typeof e||!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e)))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(r(e)){for(var n=[],i=0;i{"use strict";e.exports=r(12013)},55238:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ResolutionsInUseManager=void 0;const n=r(13592);t.ResolutionsInUseManager=n.ResolutionsInUseManager},12013:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.selectStyles=t.styles=void 0;const n=r(31635);n.__exportStar(r(28046),t),n.__exportStar(r(48923),t),n.__exportStar(r(55238),t),n.__exportStar(r(32),t),t.styles=n.__importStar(r(46287)),t.selectStyles=n.__importStar(r(28056))},60724:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"@video/video-client-web",version:"13.2.0"}},28056:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Inputs=void 0;const n=r(31635);t.Inputs=n.__importStar(r(68685))},49050:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(28046),i=r(27813),o=r(49278),a=r(54979);class s extends n.ObservableEventEmitter{get broadcastPaused(){return this.pausedBroadcast}constructor(e){if(super(),this.call=null,this.broadcast=null,this.pausedBroadcast=!1,this.activePlaceholder=null,this.zeroBitrateHandler=[],(0,i.makeObservable)(this,{call:i.observable,broadcast:i.observable,pausedBroadcast:i.observable,broadcastPaused:i.computed,pauseBroadcast:i.action}),null!=(null==e?void 0:e.activePlaceholder)){const{pauseBehaviour:t,options:r}=e.activePlaceholder;"video"===t&&a.VideoPlaceholder.isSupported()?this.activePlaceholder=new a.VideoPlaceholder(r):"canvas"===t&&o.CanvasPlaceholder.isSupported()&&(this.activePlaceholder=new o.CanvasPlaceholder(r))}this.addInnerDisposer((0,i.reaction)((()=>this.call),((e,t)=>{null!=t&&t.off("zeroBitrate",this.onZeroBitrate),null!=e&&e.on("zeroBitrate",this.onZeroBitrate)}))),null!=this.activePlaceholder&&this.addInnerDisposer(this.activePlaceholder)}onZeroBitrate(e){this.zeroBitrateHandler.forEach((t=>t(e)))}get isBroadcasting(){var e;return"active"===(null===(e=this.broadcast)||void 0===e?void 0:e.state)}async toggleBroadcast(e,t,r,n){return this.isBroadcasting?this.stopBroadcast():"string"==typeof e?this.startBroadcastOnExistingCall(e,t,r,n):this.startBroadcastOnNewCall(e,t,r,n)}async startBroadcastOnNewCall(e,t,r,n){if(null!=this.call)throw new Error("Cannot start broadcast on a call that is already active");return this.call=await n.createCall(e),this.startBroadcastOnExistingCall(this.call.id,t,r,n)}async startBroadcastOnExistingCall(e,t,r,n){if(null!=this.broadcast)throw new Error("Broadcast is already active");null!=this.call&&"active"===this.call.state||(this.call=await n.joinCall(e)),this.call.on("viewerKicked",(()=>this.stopBroadcast())),this.broadcast=await this.call.broadcast(r,t)}async stopBroadcast(){var e,t,r,n;(null===(e=this.call)||void 0===e?void 0:e.isOwner)?(null===(t=this.call)||void 0===t||t.dispose("call disposed via callState stopBroadcast()"),null===(r=this.call)||void 0===r||r.close("Closing via callState stopBroadcast()"),this.call=null):null===(n=this.broadcast)||void 0===n||n.dispose("broadcast disposed via callState stopBroadcast()"),this.broadcast=null}async pauseBroadcast(e){this.isBroadcasting&&null!=this.broadcast&&null!=this.activePlaceholder&&!this.pausedBroadcast&&(await this.activePlaceholder.start(),null!=this.activePlaceholder.element&&(e.capturable={element:this.activePlaceholder.element},e.videoDisabled="placeholder",e.audioDisabled="placeholder",this.pausedBroadcast=!0))}unpauseBroadcast(e){this.isBroadcasting&&null!=this.broadcast&&null!=this.activePlaceholder&&this.pausedBroadcast&&(this.activePlaceholder.stop(),e.capturable=null,e.videoDisabled=!1,e.audioDisabled=!1,this.pausedBroadcast=!1)}async togglePauseBroadcast(e){this.isBroadcasting&&null!=this.broadcast&&null!=this.activePlaceholder&&(this.pausedBroadcast?this.unpauseBroadcast(e):await this.pauseBroadcast(e))}}t.default=s},61680:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CallState=void 0;const n=r(31635).__importDefault(r(49050));t.CallState=n.default},18280:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EncoderUiState=void 0;const n=r(31635).__importDefault(r(78212));t.EncoderUiState=n.default},5300:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.withSilenceBackground=void 0;const n=r(28046),i=new WeakMap;t.withSilenceBackground=function(e,t){if(null==t)return null;const r=i.get(t);if(null!=r)return r;const o=t.getVideoTracks();if(0===o.length)return t;const a=function(e,t){const r=n.utils.createSilentAudioTrack(e),i=new MediaStream;return t.forEach((e=>{i.addTrack(e),e.addEventListener("ended",(()=>{r.stop()}),{once:!0})})),i.addTrack(r),i}(e,o);return i.set(t,a),a}},78212:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=r(28046),o=r(27813),a=r(30055),s=n.__importDefault(r(16183)),l=r(55238);class c extends s.default{constructor(e,t={}){var r;super(),this.resolutionsInUseManager=null,this.audioCtx=new AudioContext,this.prevVideoDeviceId=null,this.testMic=!1,(0,i.makeBounded)(this),this.mediaStreamController=e,this.logger=null!==(r=t.logger)&&void 0!==r?r:this.mediaStreamController.logger,this.init(t),(0,o.makeObservable)(this,{mediaStreamController:o.observable.ref,prevVideoDeviceId:o.observable,testMic:o.observable,resolutionsInUseManager:o.observable.ref,aspectRatioPadding:o.computed,currentAvailableResolutions:o.computed,handleScreenCapture:o.action,toggleVideoCallSlider:o.action,handleResolutionsInUseError:o.action}),this.logger.trace("constructor()")}init(e={}){if(!this.mediaStreamController.inVideoDeviceTransition)if(void 0===e.videoDevice){if(i.mediaController.videoDevices().length>0){const[e]=i.mediaController.videoDevices();this.mediaStreamController.videoDeviceId=e.deviceId}}else this.mediaStreamController.videoDeviceId=e.videoDevice;if(!this.mediaStreamController.inAudioDeviceTransition)if(void 0===e.audioDevice){if(i.mediaController.audioDevices().length>0){const[e]=i.mediaController.audioDevices();this.mediaStreamController.audioDeviceId=e.deviceId}}else this.mediaStreamController.audioDeviceId=e.audioDevice;this.mediaStreamController.on("error",this.handleMscError),this.addInnerDisposer((0,a.onlineWatcher)(this.logger),(()=>this.audioCtx.close()),(()=>this.mediaStreamController.off("error",this.handleMscError)),this.mediaStreamController)}get muted(){var e,t;return null!==(t=null===(e=this.videoElement.current)||void 0===e?void 0:e.muted)&&void 0!==t?t:null}get aspectRatioPadding(){var e,t,r;const n=null===(r=null===(t=null===(e=this.mediaStreamController)||void 0===e?void 0:e.settings)||void 0===t?void 0:t.video)||void 0===r?void 0:r.aspectRatio;return null==n?null:`${(1/n*100).toFixed(2)}%`}toggleMute(){null!=this.videoElement.current&&(this.videoElement.current.muted=!this.videoElement.current.muted)}handleMscError(e){e.code===i.types.ErrorCode.ResolutionsInUse&&this.handleResolutionsInUseError(e)}handleResolutionsInUseError(e){var t;if(this.logger.debug("handleResolutionsInUseError()",{err:e}),null!=this.mediaStreamController){null==this.resolutionsInUseManager&&(0,o.runInAction)((()=>{this.resolutionsInUseManager=new l.ResolutionsInUseManager({msc:this.mediaStreamController})}));const{videoDevice:r,allAvailableResolutions:n,currentAvailableResolutions:i}=e;null===(t=this.resolutionsInUseManager)||void 0===t||t.addDeviceInUse({videoDevice:r,allAvailableResolutions:n,currentAvailableResolutions:i})}}handleScreenCapture(){var e,t;null!=(null===(e=this.mediaStreamController)||void 0===e?void 0:e.videoDeviceId)&&("screencapture"!==(null===(t=this.mediaStreamController)||void 0===t?void 0:t.videoDeviceId)?(this.prevVideoDeviceId=this.mediaStreamController.videoDeviceId,this.mediaStreamController.videoDeviceId="screencapture"):this.mediaStreamController.videoDeviceId=this.prevVideoDeviceId)}get currentAvailableResolutions(){var e,t;return null!==(t=null===(e=this.resolutionsInUseManager)||void 0===e?void 0:e.currentAvailableResolutions)&&void 0!==t?t:this.mediaStreamController.availableResolutions}toggleVideoCallSlider(){this.viewVideoCallSlider=!this.viewVideoCallSlider}}c.displayName="EncoderUiState",t.default=c},48923:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635);n.__exportStar(r(61680),t),n.__exportStar(r(18280),t),n.__exportStar(r(87085),t),n.__exportStar(r(93554),t),n.__exportStar(r(65024),t),n.__exportStar(r(31453),t)},31453:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MultistreamState=void 0;const n=r(31635).__importDefault(r(43231));t.MultistreamState=n.default},43231:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(27813),i=r(28046),o=r(89926),a=r(87085),s={muted:!0,autoPlay:!0,displayPoster:!0,players:[{id:"hlsjs"},{id:"native-hls"},{id:"mp4ws"}],preferredScoreLevel:i.types.SourceScoreLevel.High};class l extends i.ObservableEventEmitter{constructor(e){super(),this.streams={},this.activePublicKeys=[],this.isInitialLoadDone=!1,this.currentUnmutedStream=null,this.playersWrapperElement=(0,o.createRef)(),this.manifestPollingInterval=null,this.playerOptions={};const{publicKeys:t,maxPlayingStreams:r,manifestHost:a,videoClientOptions:l,playerOptions:c,muteOnFirstPlay:u}=e;this.publicKeys=t,this.manifestHost=a,this.maxPlayingStreams=r,this.videoClient=new i.VideoClient(l),this.playerOptions=null!=c?c:s,this.muteOnFirstPlay=null!=u&&u,(0,n.makeObservable)(this,{publicKeys:n.observable,streams:n.observable,activePublicKeys:n.observable.ref,isInitialLoadDone:n.observable,setManifestUrls:n.action,startPlayer:n.action,stopPlayer:n.action,updatePublicKeys:n.action}),(0,n.reaction)((()=>this.publicKeys),(e=>{this.emit("publicKeys",e);const t=e.filter((e=>!this.activePublicKeys.includes(e)));this.setManifestUrls(t),null!=this.manifestPollingInterval&&i.adapter.device.clearInterval(this.manifestPollingInterval),this.manifestPollingInterval=i.adapter.device.setInterval((()=>{this.setManifestUrls(t)}),2e4)})),(0,n.reaction)((()=>this.streams),(()=>{0!==this.activePublicKeys.length||this.isInitialLoadDone||(this.isInitialLoadDone=!0,this.emit("isInitialLoadDone",!0))})),(0,n.reaction)((()=>this.activePublicKeys),(e=>{let t;this.emit("activePublicKeys",e),null!=this.manifestPollingInterval&&clearInterval(this.manifestPollingInterval),t=e.length>0?this.publicKeys.filter((t=>!e.includes(t))):this.publicKeys,this.manifestPollingInterval=i.adapter.device.setInterval((()=>{this.setManifestUrls(t)}),2e4)})),this.addInnerDisposer((()=>{null!=this.manifestPollingInterval&&i.adapter.device.clearInterval(this.manifestPollingInterval),Object.values(this.streams).forEach((({playerUi:e})=>{e&&e.dispose()})),this.videoClient.dispose(),this.activePublicKeys=[],this.publicKeys=[],this.streams={}})),this.setManifestUrls(t)}async setManifestUrls(e){const t={};for(const r of e){const e=`https://${this.manifestHost}/live/${r}.json`;try{const n=await this.fetchManifestAndSelectPoster({manifestUrl:e,publicKey:r});if(null==n)t[r]={manifestUrl:e,posterUrl:null,playerUi:null,disconnected:!0};else{const{posterUrl:i,viewCount:o}=n;t[r]={manifestUrl:e,posterUrl:i,playerUi:null,disconnected:!1,viewCount:o}}}catch(e){}}this.streams={...this.streams,...t}}startPlayer(e){var t;const r=null===(t=this.streams[e])||void 0===t?void 0:t.manifestUrl;if(r)if(null!=this.streams[e]){if(!this.activePublicKeys.includes(e))try{const t=this.videoClient.requestPlayer(r,this.playerOptions),n=new a.PlayerUiState(t,{...this.playerOptions,multistreamPlayerPublicKey:e});this.activePublicKeys.length>=this.maxPlayingStreams&&this.stopPlayer(this.activePublicKeys[this.activePublicKeys.length-1]),this.muteOnFirstPlay||0!==this.activePublicKeys.length?n.player.localAudioMuted=!0:(n.player.localAudioMuted=!1,this.currentUnmutedStream=e),t.on("localAudioMuted",(t=>{if(!t)if(null!=this.currentUnmutedStream){if(this.currentUnmutedStream!==e){const t=this.streams[this.currentUnmutedStream].playerUi;t&&(t.player.localAudioMuted=!0),this.currentUnmutedStream=e}}else this.currentUnmutedStream=e})),t.on("manifest",(t=>{const{viewCount:r}=t;this.streams={...this.streams,[e]:{...this.streams[e],viewCount:r}},"offline"===t.state&&(this.stopPlayer(e),this.streams={...this.streams,[e]:{...this.streams[e],disconnected:!0}})})),this.activePublicKeys=[...this.activePublicKeys,e],this.streams={...this.streams,[e]:{...this.streams[e],playerUi:n}}}catch(e){console.error("Error initializing player.",e)}}else console.error(`Stream with the public key ${e} does not exist`);else console.error("Error starting player. Invalid manifestUrl.")}stopPlayer(e,t=!1){const r=this.streams[e];if(null!=r&&null!=r.playerUi)if(this.activePublicKeys=this.activePublicKeys.filter((t=>t!==e)),this.currentUnmutedStream===e&&(this.currentUnmutedStream=null),r.playerUi.dispose(),t){const{[e]:t,...r}=this.streams;this.streams=r}else this.streams={...this.streams,[e]:{...this.streams[e],playerUi:null}};else console.error(`Stream with the key ${e} is not playing`)}async fetchManifestAndSelectPoster({manifestUrl:e,publicKey:t}){var r,n,i;try{const o=await fetch(e);if(200!==o.status)return this.emit("manifest-fetch-error",{response:o,publicKey:t}),null;const a=await o.json(),{encodings:s}=null!==(r=a.formats.jpeg)&&void 0!==r?r:{};return s?{posterUrl:null!==(i=null===(n=s.sort(((e,t)=>t.videoHeight-e.videoHeight))[0])||void 0===n?void 0:n.location)&&void 0!==i?i:null,viewCount:a.viewCount}:{posterUrl:null,viewCount:a.viewCount}}catch(e){return console.error("Error fetching manifestUrl.",e),null}}updatePublicKeys(e){null!=this.manifestPollingInterval&&clearInterval(this.manifestPollingInterval),this.activePublicKeys.filter((t=>!e.includes(t))).forEach((e=>this.stopPlayer(e,!0)));const t={};e.forEach((e=>{const r=this.streams[e];t[e]=null!=r?r:{manifestUrl:"",posterUrl:null,playerUi:null,disconnected:!0}})),this.streams=t,this.publicKeys=e}}l.displayName="MultistreamState",t.default=l},87085:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PlayerUiState=void 0;const n=r(31635).__importDefault(r(64015));t.PlayerUiState=n.default},64015:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=r(82837),o=r(28046),a=r(27813),s=n.__importDefault(r(60724)),l=r(30055),c=n.__importDefault(r(16183)),u=r(85784);class d extends c.default{constructor(e,t){var r,n,c;super(),this.viewGetSound=!0,this.qualityMouseOver=!1,this.multistreamPlayerPublicKey=null,(0,a.makeObservable)(this,{viewGetSound:a.observable,qualityMouseOver:a.observable,encoderMuted:a.computed,encoderNoVideo:a.computed,availableBitrates:a.computed}),this._options=t,this.player=e,this.multistreamPlayerPublicKey=null!==(r=null==t?void 0:t.multistreamPlayerPublicKey)&&void 0!==r?r:null,null!=this.player.logger?this.logger=new i.LoggerCore("VDC-web").extend(this.player.logger).setMessageAggregate("chain",`Player:${d.displayName}`):this.logger=new i.LoggerCore("VDC-web").setLoggerMeta("client","VDC").setLoggerMeta("chain","PlayerUiState").setLoggerMeta("release",s.default.version).setMessageAggregate("contextId",null!==(n=(0,o.contextId)())&&void 0!==n?n:void 0).setMessageAggregate("instanceId",null!==(c=(0,o.instanceId)())&&void 0!==c?c:void 0),this.player.on("consumerVideoEnabled",(e=>this.emit("encoderNoVideo",!e))),this.player.on("consumerAudioEnabled",(e=>this.emit("encoderMuted",!e))),this.addInnerDisposer(this.player),this.addInnerDisposer((0,l.onlineWatcher)(this.logger))}get availableQualities(){var e;return this.player.isImplements(o.player.Feature.BITRATE_SWITCHING)&&null!==(e=this.player.availableQualities)&&void 0!==e?e:[]}get availableBitrates(){return this.player.isImplements(o.player.Feature.BITRATE_SWITCHING)&&null!=this.player.availableQualities?(0,u.availableBitrateHelper)(this.player.availableQualities):[]}get availablePlayers(){var e;return this.player.isImplements(o.player.Feature.PLAYER_SELECTOR)&&null!==(e=this.player.availablePlayers)&&void 0!==e?e:[]}get currentPlayer(){return this.player}get encoderMuted(){return this.player.isImplements(o.player.Feature.CONSUMER)?!this.player.consumerAudioEnabled:null}get encoderNoVideo(){return this.player.isImplements(o.player.Feature.CONSUMER)?!this.player.consumerVideoEnabled:null}get showToolbar(){const e=this.videoMouseOver,t=this.qualityMouseOver;return e||t}}d.displayName="PlayerUiState",t.default=d},85784:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.availableBitrateHelper=void 0;const n=r(28046);function i(e,t=""){var r;return null==e.layer?t:((null!==(r=e.layer.bitrate)&&void 0!==r?r:0)/1e3).toFixed(2)}function o(e,t,r){let n=null,o=null;for(const r of t){const t=e.find((e=>e.level===r));if(null!=t){n=r,o=i(t);break}}return{score:n,name:r,formattedBitrate:o}}t.availableBitrateHelper=e=>null==e?[]:[o(e,[n.AutoQualityLevel.Auto],"Auto"),o(e,[n.SourceScoreLevel.Low,n.SourceScoreLevel.Medium,n.SourceScoreLevel.High],"Source"),o(e,[n.TranscodeScoreLevel.Low,n.TranscodeScoreLevel.Lowest],"Low"),o(e,[n.TranscodeScoreLevel.Medium,n.TranscodeScoreLevel.MediumHigh,n.TranscodeScoreLevel.MediumLow],"Medium"),o(e,[n.TranscodeScoreLevel.High,n.TranscodeScoreLevel.Highest],"High")].filter((e=>null!=e.score))},93554:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RecorderUiState=void 0;const n=r(31635).__importDefault(r(56666));t.RecorderUiState=n.default},56666:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=r(27813),o=n.__importDefault(r(16183));class a extends o.default{constructor(){super(),this.recordingReady=!1,this.recording=!1,(0,i.makeObservable)(this,{recordingReady:i.observable,recording:i.observable,setRecorder:i.action,removeRecorder:i.action,setupRecorder:i.action,record:i.action,pauseRecording:i.action,browserStopEvent:i.action,closeRecording:i.action,saveRecording:i.action,resetRecorder:i.action,setRecordingReady:i.action}),this.recorder=null,this.recordingReady=!1,this.recording=!1,this.resumeDisabled=!1}setRecorder(e){this.recorder=e}removeRecorder(){this.recorder=null}async setupRecorder(e=!0){var t;"error"===(await(null===(t=this.recorder)||void 0===t?void 0:t.setupRecorder())).status&&(0,i.runInAction)((()=>{this.recording=!1,this.recordingReady=!1})),e?(0,i.runInAction)((()=>{this.recording=!0,this.recordingReady=!0})):(0,i.runInAction)((()=>{this.recordingReady=!0}))}async record(){var e;"error"===(await(null===(e=this.recorder)||void 0===e?void 0:e.record())).status&&(0,i.runInAction)((()=>{this.recording=!1})),(0,i.runInAction)((()=>{this.recording=!0}))}pauseRecording(){var e;(0,i.runInAction)((()=>{this.recording=!1})),null===(e=this.recorder)||void 0===e||e.pause()}browserStopEvent(){var e;(0,i.runInAction)((()=>{this.recording=!1,this.resumeDisabled=!0})),null===(e=this.recorder)||void 0===e||e.pause()}async closeRecording(){var e,t;(null===(e=this.recorder)||void 0===e?void 0:e.stream)&&await(null===(t=this.recorder)||void 0===t?void 0:t.close()),(0,i.runInAction)((()=>{this.recording=!1,this.recordingReady=!1,this.recorder=null}))}async saveRecording(){var e;(0,i.runInAction)((()=>{this.recording=!1})),await(null===(e=this.recorder)||void 0===e?void 0:e.save()),(0,i.runInAction)((()=>{this.recordingReady=!1}))}async resetRecorder(){(0,i.runInAction)((()=>{this.recording=!1,this.recordingReady=!1,this.recorder=null}))}async setRecordingReady(){(0,i.runInAction)((()=>{this.recordingReady=!0}))}}a.displayName="RecorderUiState",t.default=a},96108:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultOptions=void 0,t.defaultOptions={width:600,height:400}},49278:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CanvasPlaceholder=void 0;const n=r(28046),i=r(96108);class o extends n.ObservableEventEmitter{static isSupported(){return null!=document.createElement("canvas")&&n.adapter.device.supportsMediaStreamCapture(document.createElement("canvas"))}constructor(e){super(),this.canvasInterval=null,this.element=null,this.options=null!=e?e:i.defaultOptions,this.addInnerDisposer((()=>{this.stop()}))}async start(){this.stop(),this.element=document.createElement("canvas"),this.element.setAttribute("width",`${this.options.width}px`),this.element.setAttribute("height",`${this.options.height}px`);const e=this.element.getContext("2d"),t=this.element.width,r=this.element.height;this.canvasInterval=setInterval((function(){null!=e&&(e.clearRect(0,0,t,r),null!=e&&(e.fillStyle="black"),e.fillRect(0,0,t,r),e.fill())}),1e3)}stop(){null!=this.canvasInterval&&(clearInterval(this.canvasInterval),this.canvasInterval=null,this.element=null)}}t.CanvasPlaceholder=o},54979:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VideoPlaceholder=void 0;const n=r(28046),i=r(96108);class o extends n.ObservableEventEmitter{static isSupported(){return null!=document.createElement("video")&&n.adapter.device.supportsMediaStreamCapture(document.createElement("video"))}constructor(e){super(),this.element=null,this.options=null!=e?e:i.defaultOptions,this.addInnerDisposer((()=>{this.stop()}))}async start(){const e=document.createElement("video");e.setAttribute("width",`${this.options.width}px`),e.setAttribute("height",`${this.options.height}px`),e.setAttribute("muted","true"),e.setAttribute("autoplay","false"),e.setAttribute("loop","true"),e.setAttribute("src","data:video/mp4;base64,AAAAIGZ0eXBpc29tAAACAGlzb21pc28yYXZjMW1wNDEAAAAIZnJlZQAAAwBtZGF0AAACuwYF//+33EXpvebZSLeWLNgg2SPu73gyNjQgLSBjb3JlIDE2NCByMzA5NSBiYWVlNDAwIC0gSC4yNjQvTVBFRy00IEFWQyBjb2RlYyAtIENvcHlsZWZ0IDIwMDMtMjAyMiAtIGh0dHA6Ly93d3cudmlkZW9sYW4ub3JnL3gyNjQuaHRtbCAtIG9wdGlvbnM6IGNhYmFjPTEgcmVmPTMgZGVibG9jaz0xOjA6MCBhbmFseXNlPTB4MzoweDExMyBtZT1oZXggc3VibWU9NyBwc3k9MSBwc3lfcmQ9MS4wMDowLjAwIG1peGVkX3JlZj0xIG1lX3JhbmdlPTE2IGNocm9tYV9tZT0xIHRyZWxsaXM9MSA4eDhkY3Q9MSBjcW09MCBkZWFkem9uZT0yMSwxMSBmYXN0X3Bza2lwPTEgY2hyb21hX3FwX29mZnNldD0tMiB0aHJlYWRzPTQgbG9va2FoZWFkX3RocmVhZHM9MSBzbGljZWRfdGhyZWFkcz0wIG5yPTAgZGVjaW1hdGU9MSBpbnRlcmxhY2VkPTAgYmx1cmF5X2NvbXBhdD0wIGNvbnN0cmFpbmVkX2ludHJhPTAgYmZyYW1lcz0zIGJfcHlyYW1pZD0yIGJfYWRhcHQ9MSBiX2JpYXM9MCBkaXJlY3Q9MSB3ZWlnaHRiPTEgb3Blbl9nb3A9MCB3ZWlnaHRwPTIga2V5aW50PTI1MCBrZXlpbnRfbWluPTEgc2NlbmVjdXQ9NDAgaW50cmFfcmVmcmVzaD0wIHJjX2xvb2thaGVhZD00MCByYz1hYnIgbWJ0cmVlPTEgYml0cmF0ZT0xMCByYXRldG9sPTEuMCBxY29tcD0wLjYwIHFwbWluPTAgcXBtYXg9NjkgcXBzdGVwPTQgaXBfcmF0aW89MS40MCBhcT0xOjEuMDAAgAAAADVliIQAFP/+94gfMstvnGrXchHnrS6tH1DuRnFepL4BOMHboWekdFflhIaAAACzAQRxVZ3hwQAAAxVtb292AAAAbG12aGQAAAAAAAAAAAAAAAAAAAPoAAAD6AABAAABAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAACQHRyYWsAAABcdGtoZAAAAAMAAAAAAAAAAAAAAAEAAAAAAAAD6AAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAABAAAAAJAAAAAAACRlZHRzAAAAHGVsc3QAAAAAAAAAAQAAA+gAAAAAAAEAAAAAAbhtZGlhAAAAIG1kaGQAAAAAAAAAAAAAAAAAAEAAAABAAFXEAAAAAAAtaGRscgAAAAAAAAAAdmlkZQAAAAAAAAAAAAAAAFZpZGVvSGFuZGxlcgAAAAFjbWluZgAAABR2bWhkAAAAAQAAAAAAAAAAAAAAJGRpbmYAAAAcZHJlZgAAAAAAAAABAAAADHVybCAAAAABAAABI3N0YmwAAAC/c3RzZAAAAAAAAAABAAAAr2F2YzEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAABAACQAEgAAABIAAAAAAAAAAEUTGF2YzYwLjMuMTAwIGxpYngyNjQAAAAAAAAAAAAAAAAY//8AAAA1YXZjQwFkAAv/4QAZZ2QAC6zZQQE7ARAAAAMAEAAAAwAg8UKZYAEABWjr7LIs/fj4AAAAABBwYXNwAAAAAQAAAAEAAAAUYnRydAAAAAAAACcQAAAXwAAAABhzdHRzAAAAAAAAAAEAAAABAABAAAAAABxzdHNjAAAAAAAAAAEAAAABAAAAAQAAAAEAAAAUc3RzegAAAAAAAAL4AAAAAQAAABRzdGNvAAAAAAAAAAEAAAAwAAAAYXVkdGEAAABZbWV0YQAAAAAAAAAhaGRscgAAAAAAAAAAbWRpcmFwcGwAAAAAAAAAAAAAAAAsaWxzdAAAACSpdG9vAAAAHGRhdGEAAAABAAAAAExhdmY2MC4zLjEwMA=="),await e.play(),this.element=e}stop(){var e;null===(e=this.element)||void 0===e||e.pause(),this.element=null}}t.VideoPlaceholder=o},27976:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fullscreenElement=t.exitFullscreen=t.requestFullscreen=void 0;const n=r(28046);let i=null;function o(e){var t;return null==e||e instanceof HTMLVideoElement?e:null!==(t=e.querySelector("video"))&&void 0!==t?t:null}function a(e){const t=o(e);return n.adapter.device.isIosDevice&&"function"==typeof(null==t?void 0:t.webkitEnterFullscreen)}t.requestFullscreen=function(e){let t;return t=a(e)?function(e){var t;const r=o(e);if(null==r)return Promise.reject(new Error("video element not found"));const n=null===(t=r.webkitEnterFullscreen)||void 0===t?void 0:t.call(r);return i=r,r.addEventListener("webkitendfullscreen",(()=>{i=null,document.dispatchEvent(new Event("fullscreenchange")),setTimeout((()=>{r.play().catch((()=>{}))}),1e3)}),{once:!0}),document.dispatchEvent(new Event("fullscreenchange")),null!=n?n:Promise.resolve()}(e):"function"==typeof e.requestFullscreen?e.requestFullscreen():"function"==typeof e.webkitRequestFullScreen?e.webkitRequestFullScreen():Promise.reject(new Error("requestFullscreen not supported")),null!=t?t:Promise.resolve()},t.exitFullscreen=function(){let e;return e=a(i)?function(){var e;const t=null===(e=null==i?void 0:i.webkitCancelFullScreen)||void 0===e?void 0:e.call(i);return null!=t?t:Promise.resolve()}():"function"==typeof document.exitFullscreen?document.exitFullscreen():"function"==typeof document.webkitCancelFullScreen?document.webkitCancelFullScreen():Promise.reject(new Error("exitFullscreen not supported")),null!=e?e:Promise.resolve()},t.fullscreenElement=function(){var e,t,r;return null!==(r=null!==(t=null!==(e=document.fullscreenElement)&&void 0!==e?e:document.webkitFullscreenElement)&&void 0!==t?t:document.webkitCurrentFullScreenElement)&&void 0!==r?r:i}},65024:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.videoStylesNamespace=t.getDevices=t.createVideoElement=void 0,t.createVideoElement=(e=!0)=>{const t=document.createElement("video");t.autoplay=e,t.muted=!0;const r=document.createTextNode("Sorry, your browser doesn't support embedded videos.");return t.appendChild(r),t},t.getDevices=(e,t)=>!Array.isArray(e)||"audio"!==t&&"video"!==t?null:e.filter((e=>e.kind===`${t}input`)),t.videoStylesNamespace="video"},30055:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.onlineWatcher=void 0,t.onlineWatcher=function(e){const t=t=>{const r=JSON.stringify(t);e.warn("user online",{eventJson:r})},r=t=>{const r=JSON.stringify(t);e.warn("user offline",{eventJson:r})};return window.addEventListener("online",t),window.addEventListener("offline",r),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}},13592:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ResolutionsInUseManager=void 0;const n=r(27813),i=r(82837),o=r(28046);class a extends o.ObservableEventEmitter{get devicesInUseSize(){return this.devicesInUse.size}constructor(e){super(),this.devicesInUse=n.observable.map(),(0,o.makeBounded)(this),this.mediaStreamController=e.msc,this.logger=new i.LoggerCore("VDC-core").setLoggerMeta("client","VDC").appendChain(a),this.logger.info("constructor()",e),this.mediaStreamController.on("videoDeviceChanged",this.checkResolutionsInUse),this.mediaStreamController.on("disposed",(()=>this.dispose("MediaStreamController disposed"))),(0,n.makeObservable)(this,{devicesInUse:n.observable.deep,mediaStreamController:n.observable.ref,currentAvailableResolutions:n.computed,devicesInUseSize:n.computed,addDeviceInUse:n.action}),this.addInnerDisposer((()=>this.mediaStreamController.off("videoDeviceChanged",this.checkResolutionsInUse))),this.addInnerDisposer((0,n.autorun)((()=>{0!==this.devicesInUse.size&&1!==this.devicesInUse.size||this.mediaStreamController.off("videoDeviceChanged",this.checkResolutionsInUse),1===this.devicesInUse.size&&this.mediaStreamController.on("videoDeviceChanged",this.checkResolutionsInUse)})))}addDeviceInUse(e){!1===(0,n.has)(this.devicesInUse,e.videoDevice.deviceId)&&(this.logger.info("adding new deviceInUse",e),(0,n.set)(this.devicesInUse,{[e.videoDevice.deviceId]:e}))}get currentAvailableResolutions(){var e;if(null!=(null===(e=this.mediaStreamController)||void 0===e?void 0:e.videoDeviceId)){const e=(0,n.get)(this.devicesInUse,this.mediaStreamController.videoDeviceId);return e?e.currentAvailableResolutions:null}return null}async checkResolutionsInUse(e){if(this.logger.debug("checkResolutionsInUse()",{videoDevice:e}),null!=e&&null!=(0,n.get)(this.devicesInUse,e.deviceId))try{const{resolutionsInUse:t}=await this.mediaStreamController.getDeviceResolutions({videoDevice:e,deviceInUse:!0});t||((0,n.remove)(this.devicesInUse,e.deviceId),this.logger.debug("device no longer in use",e),this.emit("deviceAvailable",{videoDevice:e,available:!0}))}catch(e){}}}t.ResolutionsInUseManager=a,a.displayName="ResolutionsInUse"},16183:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(28046),i=r(27813),o=r(89926),a=r(27976);class s extends n.ObservableEventEmitter{constructor(){super(),this.videoElement=(0,o.createRef)(),this.videoWrapperElement=(0,o.createRef)(),this.isFullscreen=!1,this.newWindow=null,this.newWindowElement=null,this.portal=!1,this.portalElement=null,this.viewSettings=!1,this.viewVideoCallSlider=!1,this.videoMouseOver=n.adapter.device.isMobileDevice,this.mobileDevice=n.adapter.device.isMobileDevice,this.iosDevice=n.adapter.device.isIosDevice,this.screenShareSupported=!n.adapter.device.isMobileDevice,this.volumeRangeSupported=!n.adapter.device.isIosDevice,(0,i.makeObservable)(this,{videoWrapperElement:i.observable.ref,isFullscreen:i.observable,newWindow:i.observable,newWindowElement:i.observable.ref,portal:i.observable,portalElement:i.observable.ref,viewSettings:i.observable,viewVideoCallSlider:i.observable,videoMouseOver:i.observable,toggleFullscreen:i.action,onFullscreenChange:i.action}),document.addEventListener("fullscreenchange",this.onFullscreenChange),document.addEventListener("webkitfullscreenchange",this.onFullscreenChange),this.addInnerDisposer((()=>{document.removeEventListener("fullscreenchange",this.onFullscreenChange),document.removeEventListener("webkitfullscreenchange",this.onFullscreenChange)}))}onFullscreenChange(){this.isFullscreen=null!=(0,a.fullscreenElement)()}async toggleFullscreen(){null!=this.videoWrapperElement.current&&(this.isFullscreen?await(0,a.exitFullscreen)():await(0,a.requestFullscreen)(this.videoWrapperElement.current))}}t.default=s},46287:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CallControl=t.VideoWrapper=t.SlidingShelf=t.Inputs=t.ButtonsIcon=t.InputsPlayer=void 0;const n=r(31635);t.InputsPlayer=n.__importStar(r(20368)),t.ButtonsIcon=n.__importStar(r(49055)),t.Inputs=n.__importStar(r(96565)),t.SlidingShelf=n.__importStar(r(30552)),t.VideoWrapper=n.__importStar(r(7308)),t.CallControl=n.__importStar(r(90288))},45894:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useUIEventError=t.useUndefinedStoreError=t.ErrorBoundary=void 0;const n=r(89926);class i extends n.Component{constructor(e){super(e),this.state={error:null}}componentDidCatch(e){this.setState({error:e})}render(){const{children:e,render:t}=this.props,{error:r}=this.state;return r?t():e}}t.ErrorBoundary=i,t.useUndefinedStoreError=function(e,t){if(!e)throw new Error(`[Video]: Undefined store observable(s) and/or method(s) at ${t}`)},t.useUIEventError=function(e,t){const[r,i]=(0,n.useState)(null);return(0,n.useEffect)((()=>{if(r instanceof Error&&null!=e){const n=e.name||"undefined function";throw new Error(`[Video]: ${r.name} ${r.message} in ${n} at ${t}.`)}}),[t,r,e]),(...t)=>{if(null!=e)try{e(...t)}catch(e){i(e)}}}},64536:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=r(12809),o=n.__importStar(r(89926)),a=n.__importDefault(r(97878)),s={root:{backgroundColor:"#f54248",color:"#00000"}},l=(0,i.observer)((({error:e,children:t,classes:r,...n})=>{const[i,l]=(0,o.useState)(!1);return(0,o.useEffect)((()=>{null!=e&&l(!0)}),[e]),null==e?null:o.default.createElement(a.default,{classes:r||s,...n,active:i,setActive:l},null!=t?t:o.default.createElement((function(){return o.default.createElement("p",{style:{margin:0}}," Error: ",null==e?void 0:e.code," ")}),null))}));t.default=l},71962:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=r(28046),o=r(12809),a=n.__importStar(r(89926)),s=r(57004),l=n.__importDefault(r(18261)),c=r(45894),u=(0,o.observer)((({icon:e,muted:t,...r})=>{var n;const o=(0,a.useContext)(s.PlayerUiContext);return(0,c.useUndefinedStoreError)(null!=o,""),o.player.isImplements(i.player.Feature.CONSUMER)?a.default.createElement(l.default,{muted:null!==(n=null!=t?t:!o.player.consumerAudioEnabled)&&void 0!==n&&n,icon:e,...r}):null}));t.default=({...e})=>a.default.createElement(c.ErrorBoundary,{render:()=>null},a.default.createElement(u,{...e}))},6334:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=r(12809),o=n.__importStar(r(89926)),a=r(28046),s=r(57004),l=n.__importDefault(r(62717)),c=n.__importDefault(r(75372)),u=r(45894),d=(0,i.observer)((({icon:e,onClick:t,active:r,classes:n={root:{},icon:{}},screenReaderText:i,label:d="Toggle camera",...h})=>{const p="",f=(0,o.useContext)(s.EncoderUiContext);(0,u.useUndefinedStoreError)(null!=(null==f?void 0:f.mediaStreamController),p);const m=null!=t?t:(0,u.useUIEventError)((()=>a.adapter.device.toggleCameraVisibility(f.mediaStreamController)),p),g=(null!=r?r:a.adapter.device.isIosDevice)?!f.mediaStreamController.videoPaused:!0!==f.mediaStreamController.videoDisabled,v=g?o.default.createElement(c.default,{iconName:"camera",classes:null==n?void 0:n.icon}):o.default.createElement(c.default,{iconName:"cameraoff",classes:null==n?void 0:n.icon});return o.default.createElement(l.default,{active:g,"data-selenium":"camera-toggle-button",icon:null!=e?e:v,onClick:m,classes:n,label:d,disabled:null==f.mediaStreamController.videoDeviceId||"placeholder"===f.mediaStreamController.videoDisabled,...h},null!=i?i:"Click to turn Camera Stream "+(g?"Off":"On"))}));t.default=function({icon:e,classes:t,label:r="Toggle camera",screenReaderText:n,...i}){const a=null!=e?e:o.default.createElement(c.default,{iconName:"camera",classes:null==t?void 0:t.icon});return o.default.createElement(u.ErrorBoundary,{render:()=>o.default.createElement(l.default,{"data-selenium":"camera-toggle-button",disabled:!0,classes:t,icon:a,label:r,onClick:void 0,active:!1,...i},null!=n?n:"Click to turn Camera Stream On")},o.default.createElement(d,{classes:t,icon:e,label:r,screenReaderText:n,...i}))}},28334:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=r(27813),o=r(12809),a=n.__importStar(r(89926)),s=r(57004),l=n.__importDefault(r(75659)),c=n.__importDefault(r(75372)),u=r(45894),d=(0,o.observer)((({icon:e,onClick:t,broadcastOptions:r,onZeroBitrate:n,active:o,classes:d={root:{},icon:{}},label:h="Stream Broadcast Toggle Button",setCallId:p,callId:f,setOwnerCall:m,setCall:g,streamKey:v,clientReferrer:y,sfuOptions:b,videoUserId:_,...S})=>{var w,E;const C="",O=(0,a.useContext)(s.EncoderUiContext),P=(0,a.useContext)(s.CallContext),T=(0,a.useContext)(s.VideoClientContext),k=(0,a.useRef)(!1);(0,u.useUndefinedStoreError)(null!=(null==O?void 0:O.mediaStreamController)&&null!=T&&null!=P,C),(0,a.useEffect)((()=>(n&&P.zeroBitrateHandler.push(n),()=>{P.zeroBitrateHandler=P.zeroBitrateHandler.filter((e=>e!==n))})),[P,n]),(0,a.useEffect)((()=>{(0,i.reaction)((()=>P.call),((e,t)=>{var r;null==g||g(e),null==p||p(null!==(r=null==e?void 0:e.id)&&void 0!==r?r:null),(null==e?void 0:e.isOwner)&&(null==m||m(e))}))}),[P,g,p,m]);const R=null!=o?o:P.isBroadcasting,A={userId:_,clientReferrer:y,sfu:b,streamKey:v},D=null!=t?t:(0,u.useUIEventError)((async function(){O&&T&&P&&!k.current&&(k.current=!0,await P.toggleBroadcast(null!=f?f:A,r,O.mediaStreamController,T),k.current=!1)}),C),I={root:{height:15,...null!==(E=null===(w=null==d?void 0:d.icon)||void 0===w?void 0:w.root)&&void 0!==E?E:{}}},x=null!=e?e:a.default.createElement(c.default,{iconName:"broadcast",classes:I});return a.default.createElement(l.default,{active:R,activeClass:"video-button--active lv-button--active",classes:d,inactiveClass:null,"data-selenium":"broadcast-stream-button",icon:x,onClick:D,disabled:null==O.mediaStreamController.videoDeviceId&&null==O.mediaStreamController.audioDeviceId,label:h,...S})}));t.default=({icon:e,label:t="Stream Broadcast Toggle Button",broadcastOptions:r,classes:n,...i})=>{const o=a.default.createElement(c.default,{iconName:"broadcast",classes:null==n?void 0:n.icon});return a.default.createElement(u.ErrorBoundary,{render:()=>a.default.createElement(l.default,{"data-selenium":"broadcast-stream-button",disabled:!0,classes:n,icon:null!=e?e:o,label:t,onClick:void 0,active:!1,...i})},a.default.createElement(d,{classes:n,label:t,broadcastOptions:r,...i}))}},98242:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=r(12809),o=n.__importStar(r(89926)),a=r(57004),s=n.__importDefault(r(62717)),l=n.__importDefault(r(75372)),c=r(45894),u=(0,i.observer)((({onClick:e,classes:t={root:{},icon:{}},icon:r,screenReaderText:n,label:i="Toggle mute",active:u,...d})=>{const h="",p=(0,o.useContext)(a.EncoderUiContext);(0,c.useUndefinedStoreError)(null!=(null==p?void 0:p.mediaStreamController),h);const f=e||(0,c.useUIEventError)((()=>{p.mediaStreamController.audioMuted=!p.mediaStreamController.audioMuted}),h),m=null!=u?u:!p.mediaStreamController.audioMuted,g=m?o.default.createElement(l.default,{title:i,iconName:"microphone",classes:null==t?void 0:t.icon}):o.default.createElement(l.default,{title:i,iconName:"microphoneoff",classes:null==t?void 0:t.icon});return o.default.createElement(s.default,{active:m,classes:t,"data-selenium":"mic-toggle-button",icon:r||g,onClick:f,label:i,disabled:null==p.mediaStreamController.audioDeviceId||"placeholder"===p.mediaStreamController.audioDisabled,...d},null!=n?n:`Click to ${u?"Stop":"Start"} Audio Stream`)}));t.default=function({icon:e,classes:t,label:r="Toggle mute",screenReaderText:n,style:i={},...a}){const d=e||o.default.createElement(l.default,{iconName:"microphoneoff",classes:null==t?void 0:t.icon});return o.default.createElement(c.ErrorBoundary,{render:()=>o.default.createElement(s.default,{"data-selenium":"mic-toggle-button",disabled:!0,label:r,icon:d,classes:t,onClick:void 0,active:!1,...a},null!=n?n:"Click to Start Audio Stream")},o.default.createElement(u,{classes:t,icon:e,label:r,screenReaderText:n,style:i,...a}))}},8544:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=r(12809),o=n.__importStar(r(89926)),a=r(57004),s=n.__importDefault(r(62717)),l=n.__importDefault(r(75372)),c=r(45894),u=(0,i.observer)((({icon:e,onClick:t,screenReaderText:r,active:n,classes:i={root:{},icon:{}},label:u="Pause Broadcast Toggle Button",...d})=>{const h="",p=(0,o.useContext)(a.EncoderUiContext),f=(0,o.useContext)(a.CallContext),m=(0,o.useContext)(a.VideoClientContext);(0,c.useUndefinedStoreError)(null!=(null==p?void 0:p.mediaStreamController)&&null!=m&&null!=f,h);const g=f.broadcastPaused,v=null!=t?t:(0,c.useUIEventError)((async function(){null!=f&&(null==p?void 0:p.mediaStreamController)&&await f.togglePauseBroadcast(p.mediaStreamController)}),h),y=g?o.default.createElement(l.default,{iconName:"play",classes:null==i?void 0:i.icon}):o.default.createElement(l.default,{iconName:"pause",classes:null==i?void 0:i.icon}),b=null!=e?e:y;return null==f.activePlaceholder?null:o.default.createElement(s.default,{active:g,classes:i,inactiveClass:null,"data-selenium":"broadcast-stream-button",icon:b,onClick:v,disabled:!f.isBroadcasting,label:u,...d},null!=r?r:`Click to ${g?"Resume":"Pause"} Broadcast`)}));t.default=function({icon:e,label:t="Pause Broadcast Toggle Button",screenReaderText:r,classes:n,...i}){const a=o.default.createElement(l.default,{iconName:"pause",classes:null==n?void 0:n.icon});return o.default.createElement(c.ErrorBoundary,{render:()=>o.default.createElement(s.default,{"data-selenium":"pause-broadcast-button",disabled:!0,classes:n,icon:null!=e?e:a,label:t,onClick:void 0,active:!1,...i},null!=r?r:"Click to pauseBroadcast")},o.default.createElement(u,{icon:e,classes:n,label:t,screenReaderText:r,...i}))}},95543:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=r(12809),o=n.__importStar(r(89926)),a=r(57004),s=n.__importDefault(r(62717)),l=n.__importDefault(r(75372)),c=r(45894),u=(0,i.observer)((({icon:e,onClick:t,active:r,label:n="Toggle screenshare",screenReaderText:i,classes:u={root:{},icon:{}},...d})=>{var h;const p="",f=(0,o.useContext)(a.EncoderUiContext);(0,c.useUndefinedStoreError)(null!=(null==f?void 0:f.mediaStreamController),p);const m=t||(0,c.useUIEventError)(null==f?void 0:f.handleScreenCapture,p),g=null!=r?r:"screencapture"===(null===(h=null==f?void 0:f.mediaStreamController)||void 0===h?void 0:h.videoDeviceId),v=o.default.createElement(l.default,{iconName:"screencapture",classes:null==u?void 0:u.icon});return(null==f?void 0:f.screenShareSupported)?o.default.createElement(s.default,{active:g,"data-selenium":"screencapture-toggle-button",icon:e||v,label:n,onClick:m,activeClass:"video-button--active lv-button--active",inactiveClass:null,classes:u,...d},null!=i?i:`Click to ${r?"Unshare":"Share"} Screen`):null}));t.default=function({icon:e,label:t="Toggle screenshare",screenReaderText:r,classes:n,...i}){const a=e||o.default.createElement(l.default,{iconName:"screencapture",classes:null==n?void 0:n.icon});return o.default.createElement(c.ErrorBoundary,{render:()=>o.default.createElement(s.default,{"data-selenium":"screencapture-toggle-button",disabled:!0,icon:a,label:t,classes:n,onClick:void 0,active:!1,...i},null!=r?r:"Click to Share Screen")},o.default.createElement(u,{icon:e,label:t,screenReaderText:r,classes:n,...i}))}},26654:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=r(12809),o=n.__importStar(r(89926)),a=r(57004),s=n.__importDefault(r(82111)),l=r(45894),c=(0,i.observer)((({buttonRequestText:e,isFirstAttempt:t,classes:r,hideOnAcceptedCall:n=!1,label:i="Request call button",onRequestButtonClick:c,...u})=>{const{store:d,sendCallRequest:h,cancelCallRequest:p}=(0,o.useContext)(a.EncoderUiContext),f=c||(0,l.useUIEventError)((()=>{d.requestingCall?p():h()}),"");if(n&&(null==d?void 0:d.callAccepted))return null;const m=null==d?void 0:d.requestingCall;let g;g=m?"Cancel":t?null!=e?e:"Send video call request":"Try again";const v=!d||d&&!d.cameraOn&&!d.micOn||(null==d?void 0:d.disconnectingCall);return o.default.createElement(s.default,{active:m,classNames:"video-button--send-call-request lv-button--send-call-request","data-selenium":"video-button--send-call-request-button",disabled:v,label:i,onClick:f,...u},g)}));t.default=({active:e,classes:t,buttonRequestText:r="Send video call request",label:n="Request call button",...i})=>o.default.createElement(l.ErrorBoundary,{render:()=>o.default.createElement(s.default,{classNames:"video-button--send-call-request lv-button--send-call-request",classes:t,"data-selenium":"video-button--send-call-request-button",disabled:!0,label:n,onClick:void 0,...i},r)},o.default.createElement(c,{classes:t,buttonRequestText:r,label:n,active:e,...i}))},13144:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=r(12809),o=n.__importStar(r(89926)),a=r(57004),s=n.__importDefault(r(62717)),l=n.__importDefault(r(75372)),c=r(45894),u=(0,i.observer)((({active:e,icon:t,label:r="Options",onClick:n,screenReaderText:i,classes:u={root:{},icon:{}},...d})=>{var h;const p="",f=(0,o.useContext)(a.EncoderUiContext);(0,c.useUndefinedStoreError)(null!=(null==f?void 0:f.viewSettings),p);const m=n||(0,c.useUIEventError)((()=>{f.viewSettings=!f.viewSettings}),p),g=null!==(h=null!=e?e:f.viewSettings)&&void 0!==h&&h,v=o.default.createElement(l.default,{iconName:"settings",classes:null==u?void 0:u.icon});return o.default.createElement(s.default,{"data-selenium":"settings-button",active:g,activeClass:null,inactiveClass:null,icon:null!=t?t:v,label:r,onClick:m,classes:u,...d},null!=i?i:`Click to ${g?"Hide":"Show"} Settings`)}));t.default=function({icon:e,classes:t,label:r="Options",screenReaderText:n,style:i={},...a}){const d=e||o.default.createElement(l.default,{iconName:"settings",classes:null==t?void 0:t.icon});return o.default.createElement(c.ErrorBoundary,{render:()=>o.default.createElement(s.default,{"data-selenium":"settings-button",disabled:!0,icon:d,label:r,classes:t,onClick:void 0,active:!1,...a},null!=n?n:"Click to Show Settings")},o.default.createElement(u,{icon:e,label:r,screenReaderText:n,classes:t,...a}))}},39890:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=r(12809),o=n.__importStar(r(89926)),a=r(57004),s=n.__importDefault(r(82111)),l=r(45894),c=n.__importDefault(r(40705)),u=n.__importDefault(r(67835)),d={low:"test-mic-level-low",mid:"test-mic-level-mid",midHigh:"test-mic-level-mid-high",high:"test-mic-level-high"},h=(0,i.observer)((({active:e,children:t,classes:r,label:n="Test Sound",onClick:i,...h})=>{var p,f;const m="",g=(0,o.useContext)(a.EncoderUiContext);(0,u.default)({mediaStream:null==g?void 0:g.mediaStreamController.source,computeLevels:null!==(p=null==g?void 0:g.testMic)&&void 0!==p&&p,elementIds:d}),(0,l.useUndefinedStoreError)(null!=(null==g?void 0:g.mediaStreamController)&&null!=g.videoElement,m);const v=i||(0,l.useUIEventError)((()=>{g.testMic=!g.testMic}),m);return(0,o.useEffect)((()=>()=>{null!=g&&(g.testMic=!1)}),[]),o.default.createElement(s.default,{classNames:"video-button--get-sound lv-button--get-sound","data-selenium":"test-mic-button",label:n,classes:{root:{minHeight:43,display:"flex",gap:"0.375rem",alignItems:"center",padding:"0.5rem 0.75rem",...null!==(f=null==r?void 0:r.root)&&void 0!==f?f:{}}},onClick:v,...h},o.default.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%",gap:"0.15rem",alignSelf:"center"}},o.default.createElement(c.default,{id:d.low}),o.default.createElement(c.default,{id:d.mid}),o.default.createElement(c.default,{id:d.midHigh}),o.default.createElement(c.default,{id:d.high})),null!=t?t:g.testMic?"Testing":"Test")}));t.default=({label:e="Test Sounds",buttonText:t,classes:r,...n})=>o.default.createElement(l.ErrorBoundary,{render:()=>o.default.createElement(s.default,{classNames:"video-button--get-sound lv-button--get-sound","data-selenium":"test-mic-button",onClick:void 0,disabled:!0,label:e,...n},null!=t?t:"Test Unavailable")},o.default.createElement(h,{label:e,classes:r,...n}))},8556:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=r(12809),o=n.__importStar(r(89926)),a=r(57004),s=n.__importDefault(r(62717)),l=n.__importDefault(r(75372)),c=r(45894),u=(0,i.observer)((({active:e=!1,icon:t,onClick:r,screenReaderText:n,classes:i={root:{},icon:{}},label:u="Toggle mute",...d})=>{var h;const p="",f=(0,o.useContext)(a.PlayerUiContext);(0,c.useUndefinedStoreError)(null!=(null==f?void 0:f.player),p);const m=null!=r?r:(0,c.useUIEventError)((()=>{f.player.localAudioMuted=!f.player.localAudioMuted}),p),g=null!==(h=e&&!f.player.localAudioMuted)&&void 0!==h&&h,v=f.player.localAudioMuted?o.default.createElement(l.default,{title:u,iconName:"soundoff",classes:null==i?void 0:i.icon}):o.default.createElement(l.default,{title:u,iconName:"sound",classes:null==i?void 0:i.icon});return o.default.createElement(s.default,{classes:i,active:g,inactiveClass:null,label:u,"data-selenium":"audio-stream-button",icon:t||v,onClick:m,...d},null!=n?n:`Click to ${e?"Stop":"Start"} Audio Stream`)}));t.default=function({icon:e,classes:t,label:r="Toggle mute",screenReaderText:n,style:i={},ref:a,...d}){const h=e||o.default.createElement(l.default,{iconName:"sound",classes:null==t?void 0:t.icon});return o.default.createElement(c.ErrorBoundary,{render:()=>o.default.createElement(s.default,{classes:t,"data-selenium":"audio-stream-button",disabled:!0,icon:h,label:r,onClick:void 0,active:!1,...d},null!=n?n:"Click to Start Audio Stream")},o.default.createElement(u,{ref:a,icon:e,label:r,screenReaderText:n,classes:t,...d}))}},29715:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=r(27813),o=r(12809),a=n.__importStar(r(89926)),s=r(57004),l=n.__importDefault(r(62717)),c=n.__importDefault(r(75372)),u=r(45894),d=n.__importDefault(r(99234)),h=n.__importDefault(r(41709)),p=n.__importDefault(r(80354)),f=(0,o.observer)((({active:e,classNames:t,label:r="Quality",icon:n,screenReaderText:o,classes:f={root:{},icon:{}},disableToggle:m,disableSelect:g,showBitrate:v,...y})=>{const b=(0,a.useContext)(s.PlayerUiContext),[_,S]=(0,a.useState)(!1),w=a.default.createElement(c.default,{iconName:"settings",classes:null==f?void 0:f.icon});return(0,u.useUndefinedStoreError)(null!=(null==b?void 0:b.player),""),(0,a.useEffect)((()=>(0,i.reaction)((()=>b.showToolbar),(e=>{e||S(!1)}))),[b]),a.default.createElement("div",null,a.default.createElement(p.default,{active:_},a.default.createElement(h.default,{disableSelect:g,showBitrate:v}),a.default.createElement(d.default,{disabledOff:m})),a.default.createElement(l.default,{active:_,inactiveClass:null,"data-selenium":"settings-button",icon:null!=n?n:w,onClick:()=>{S(!_)},classes:f,label:r,...y},null!=o?o:`Click to ${e?"Hide":"Show"} Settings`))}));t.default=function({classes:e,icon:t,label:r="Quality",screenReaderText:n,active:i,disableToggle:o,disableSelect:s,showBitrate:d,...h}){const p=null!=t?t:a.default.createElement(c.default,{iconName:"settings",classes:null==e?void 0:e.icon});return a.default.createElement(u.ErrorBoundary,{render:()=>a.default.createElement(l.default,{classes:e,"data-selenium":"bitrate-button",disabled:!0,icon:p,label:r,onClick:void 0,active:!1,...h},null!=n?n:"Click to Show Settings")},a.default.createElement(f,{"data-selenium":"bitrate-button",icon:t,label:r,screenReaderText:n,classes:e,active:i,showBitrate:d,disableSelect:s,disableToggle:o,...h}))}},75:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=r(28046),o=r(12809),a=n.__importStar(r(89926)),s=r(57004),l=n.__importDefault(r(62717)),c=n.__importDefault(r(75372)),u=r(45894),d=(0,o.observer)((({active:e=!1,icon:t,label:r="Get sound",onClick:n,screenReaderText:o,classes:d={root:{},icon:{}},...h})=>{const p="",f=(0,a.useContext)(s.PlayerUiContext);(0,u.useUndefinedStoreError)(null!=(null==f?void 0:f.player),p);const m=null!=n?n:(0,u.useUIEventError)((()=>{f.player.localAudioMuted=!1,f.player.forcedMute=!1}),p),g=e?a.default.createElement(c.default,{iconName:"sound",classes:null==d?void 0:d.icon}):a.default.createElement(c.default,{iconName:"soundoff",classes:null==d?void 0:d.icon});return f.player.isImplements(i.player.Feature.MUTED_AUTOPLAY)&&f.player.forcedMute&&f.player.localAudioMuted?a.default.createElement(l.default,{classes:d,"data-selenium":"audio-stream-button",classNames:"video-button--get-sound lv-button--get-sound",icon:t||g,label:r,active:null!=e&&e,onClick:m,...h},null!=o?o:`Click to ${e?"Stop":"Start"} Audio Stream`):null}));t.default=function({icon:e,label:t="Get sound",screenReaderText:r,active:n,classes:i,...o}){const s=null!=e?e:a.default.createElement(c.default,{iconName:"soundoff",classes:null==i?void 0:i.icon});return a.default.createElement(u.ErrorBoundary,{render:()=>a.default.createElement(l.default,{classes:i,"data-selenium":"audio-stream-button",disabled:!0,icon:s,label:t,onClick:void 0,active:!1,...o},null!=r?r:"Click to Start Audio Stream")},a.default.createElement(d,{icon:e,label:t,screenReaderText:r,classes:i,active:n,...o}))}},24536:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=r(12809),o=n.__importStar(r(89926)),a=r(57004),s=n.__importDefault(r(62717)),l=n.__importDefault(r(75372)),c=r(45894),u=(0,i.observer)((({active:e=!1,icon:t,classes:r={root:{},icon:{}},label:n="Open in a new window Button",onClick:i,screenReaderText:u,...d})=>{const h="",p=(0,o.useContext)(a.PlayerUiContext);(0,c.useUndefinedStoreError)(null!=(null==p?void 0:p.newWindow),h);const f=null!=i?i:(0,c.useUIEventError)((()=>{}),h),m=o.default.createElement(l.default,{iconName:"launchopen",classes:null==r?void 0:r.icon});return o.default.createElement(s.default,{active:e,"data-selenium":"new-window-button",icon:null!=t?t:m,label:n,classes:r,onClick:f,...d},null!=u?u:`Click to ${e?"Collapse from ":"Expand to "} Fullscreen`)}));t.default=function({icon:e,label:t="Open in a new window Button",screenReaderText:r,classes:n,active:i,...a}){const d=null!=e?e:o.default.createElement(l.default,{iconName:"launchopen",classes:null==n?void 0:n.icon});return o.default.createElement(c.ErrorBoundary,{render:()=>o.default.createElement(s.default,{classes:n,"data-selenium":"new-window-button",disabled:!0,icon:d,label:t,onClick:void 0,active:!1,...a},null!=r?r:"Click to Expand to Fullscreen")},o.default.createElement(u,{icon:e,label:t,screenReaderText:r,classes:n,active:i,...a}))}},15274:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=r(12809),o=n.__importStar(r(89926)),a=r(57004),s=n.__importDefault(r(62717)),l=r(45894),c=n.__importDefault(r(75372)),u=(0,i.observer)((({active:e,classes:t={root:{},icon:{}},onClick:r,icon:n,label:i="Play Pause Toggle Button",screenReaderText:u,...d})=>{const h="",p=(0,o.useContext)(a.PlayerUiContext);(0,l.useUndefinedStoreError)(null!=(null==p?void 0:p.player),h);const f=null!=r?r:(0,l.useUIEventError)((()=>{p.player.localVideoPaused=!p.player.localVideoPaused}),h),m=null!=e?e:!p.player.localVideoPaused,g=m?o.default.createElement(c.default,{iconName:"pause",classes:null==t?void 0:t.icon}):o.default.createElement(c.default,{iconName:"play",classes:null==t?void 0:t.icon});return o.default.createElement(s.default,{classes:t,active:m,inactiveClass:null,label:i,icon:null!=n?n:g,onClick:f,"data-selenium":"play-pause-button",...d},null!=u?u:`Click to ${m?"Pause":"Play"} Stream`)}));t.default=({icon:e,label:t="Play Pause Toggle Button",screenReaderText:r,classes:n,active:i,...a})=>{const d=e||o.default.createElement(c.default,{iconName:"play",classes:null==n?void 0:n.icon});return o.default.createElement(l.ErrorBoundary,{render:()=>o.default.createElement(s.default,{classes:n,"data-selenium":"play-pause-button",disabled:!0,icon:d,label:t,onClick:void 0,active:!1,...a},null!=r?r:"Click to Play Stream")},o.default.createElement(u,{icon:e,label:t,screenReaderText:r,classes:n,active:i,...a}))}},90133:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=r(12809),o=n.__importStar(r(89926)),a=r(57004),s=n.__importDefault(r(62717)),l=n.__importDefault(r(75372)),c=r(45894),u=(0,i.observer)((({active:e,classes:t={root:{},icon:{}},icon:r,label:n="Toggle fullscreen",onClick:i,screenReaderText:u,...d})=>{var h;const p="",f=null!=(0,o.useContext)(a.EncoderUiContext)?(0,o.useContext)(a.EncoderUiContext):(0,o.useContext)(a.PlayerUiContext);(0,c.useUndefinedStoreError)(null!=(null==f?void 0:f.toggleFullscreen),p);const m=null!=i?i:(0,c.useUIEventError)(f.toggleFullscreen,p),g=null!==(h=null!=e?e:f.isFullscreen)&&void 0!==h&&h,v=g?o.default.createElement(l.default,{iconName:"fullscreenexit",classes:null==t?void 0:t.icon}):o.default.createElement(l.default,{iconName:"fullscreen",classes:null==t?void 0:t.icon});return o.default.createElement(s.default,{active:g,inactiveClass:null,classes:t,"data-selenium":"fullscreen-button",icon:null!=r?r:v,label:n,onClick:m,...d},null!=u?u:`Click to ${g?"Collapse from ":"Expand to "} Fullscreen`)}));t.default=({classes:e,icon:t,label:r="Toggle fullscreen",screenReaderText:n,style:i={},...a})=>{const d=null!=t?t:o.default.createElement(l.default,{iconName:"fullscreen",classes:null==e?void 0:e.icon});return o.default.createElement(c.ErrorBoundary,{render:()=>o.default.createElement(s.default,{classes:e,"data-selenium":"fullscreen-button",disabled:!0,label:r,icon:d,onClick:void 0,active:!1,...a},null!=n?n:"Click to Expand to Fullscreen")},o.default.createElement(u,{icon:t,label:r,screenReaderText:n,classes:e,...a}))}},43756:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=n.__importDefault(r(89926)),o=n.__importDefault(r(25884)),a=n.__importDefault(r(67028));t.default=function({attachToRef:e,isCallInProgress:t,renderCustomControls:r,renderCallMetaDisplay:n,classes:s}){return null!=e&&t?o.default.createPortal(i.default.createElement(a.default,{classes:s,renderCustomControls:r,renderCallMetaDisplay:n}),e):null}},63937:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=r(12809),o=n.__importDefault(r(89926)),a=n.__importDefault(r(37596)),s=r(45894),l=(0,i.observer)((({...e})=>o.default.createElement(o.default.Fragment,null)));t.default=({...e})=>o.default.createElement(s.ErrorBoundary,{render:()=>o.default.createElement(a.default,{...e},"Duration Unavailable")},o.default.createElement(l,{...e}))},67835:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(89926),i=(e,t)=>{Object.entries(e).forEach((([e,r])=>{const n=document.getElementById(t[e]);n&&(n.style.height=(r<.05?5:40*r)+"px")}))};t.default=({mediaStream:e,computeLevels:t=!0,elementIds:r})=>{const o=(0,n.useRef)(0);(0,n.useEffect)((()=>{const n=null==e?void 0:e.getAudioTracks();if(!e||!n||!t)return()=>{};const a=new AudioContext,s=a.createAnalyser();s.fftSize=2048;const l=a.createMediaStreamSource(e);if(n.length){l.connect(s);const e=s.frequencyBinCount,t=new Uint8Array(e),n=()=>{s.getByteFrequencyData(t);let l=0,c=0,u=0,d=0,h=0,p=0,f=0,m=0;const g=Math.min(100,e);for(let r=0;r{l.disconnect(s),a.close(),s.disconnect(),cancelAnimationFrame(o.current),i({low:0,mid:0,midHigh:0,high:0},r)}}return()=>{}}),[t,r,e])}},43620:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=r(12809),o=n.__importStar(r(89926)),a=r(57004),s=r(14353),l=r(66652),c=n.__importDefault(r(12255)),u=r(45894);var d;function h(e){if(null==e)return null;const t=Array.isArray(e)?e[0]:e;for(const e of Object.keys(d))if(Math.abs(d[e]-t)<.001)return e;return null}!function(e){e[e["3:2"]=1.5]="3:2",e[e["4:3"]=1.3333333333333333]="4:3",e[e["16:9"]=1.7777777777777777]="16:9",e[e["8:5"]=1.6]="8:5"}(d||(d={}));const p=(0,i.observer)((({classes:e={},...t})=>{var r;const n="",i=Object.keys(d),p=(0,s.useStyles)({source:e,target:{}},"select"),f=(0,l.mergeStylesObjects)(e,{}),m=(0,o.useContext)(a.EncoderUiContext);(0,u.useUndefinedStoreError)(null!=(null==m?void 0:m.mediaStreamController),n);const g=(0,u.useUIEventError)((e=>{const t=d[e.target.value];if(null==t)throw new Error(`${n}: Invalid aspect ratio: ${e.target.value}`);m.mediaStreamController.aspectRatio=t}),n);return o.default.createElement(c.default,{classes:f,label:`Aspect Ratio: ${h(m.mediaStreamController.aspectRatio)}`,onChange:g,value:null!==(r=h(m.mediaStreamController.aspectRatio))&&void 0!==r?r:void 0},o.default.createElement("option",{disabled:!0,value:""},"Select an aspect ratio"),i.map((e=>o.default.createElement("option",{key:e,value:e,className:p.options},e))))}));t.default=({classes:e={},...t})=>{const r=(0,s.useStyles)({source:e,target:{}},"select"),n=(0,l.mergeStylesObjects)(e,{});return o.default.createElement(u.ErrorBoundary,{render:()=>{var e;return o.default.createElement(c.default,{...t,value:"",classes:n,disabled:!0},o.default.createElement("option",{value:"",className:null==r?void 0:r.options},null!==(e=t.fallbackText)&&void 0!==e?e:"Aspect Ratio Unavailable"))}},o.default.createElement(p,{classes:e,...t}))}},86711:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=r(28046),o=r(12809),a=n.__importStar(r(89926)),s=r(57004),l=r(14353),c=r(66652),u=n.__importDefault(r(12255)),d=r(45894),h=(0,o.observer)((({classes:e={},...t})=>{var r;const{label:n}=t,o="",h=(0,a.useContext)(s.EncoderUiContext);(0,d.useUndefinedStoreError)(null!=(null==h?void 0:h.mediaStreamController),o);const p=(0,l.useStyles)({source:e,target:{}},"select"),f=(0,c.mergeStylesObjects)(e,{}),m=(0,d.useUIEventError)((e=>{h.mediaStreamController.audioDeviceId=e.target.value}),o);return a.default.createElement(u.default,{classes:f,onChange:m,value:null!==(r=h.mediaStreamController.audioDeviceId)&&void 0!==r?r:"",label:null!=n?n:"Mic",...t},a.default.createElement("option",{disabled:!0,value:"",className:p.options},"Select a microphone"),i.mediaController.audioDevices().map(((e,t)=>{var r;return a.default.createElement("option",{key:e.deviceId,value:e.deviceId,className:null==p?void 0:p.options},null!==(r=e.label)&&void 0!==r?r:`Microphone ${t+1}`)})))}));t.default=({classes:e={},...t})=>{const r=(0,l.useStyles)({source:e,target:{}},"select"),n=(0,c.mergeStylesObjects)(e,{});return a.default.createElement(d.ErrorBoundary,{render:()=>{var e;return a.default.createElement(u.default,{...t,value:"",classes:n,disabled:!0,label:"Audio Device: Unavailable"},a.default.createElement("option",{value:"",className:null==r?void 0:r.options},null!==(e=t.fallbackText)&&void 0!==e?e:"Audio Devices Unavailable"))}},a.default.createElement(h,{classes:e,...t}))}},91816:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=r(12809),o=n.__importStar(r(89926)),a=r(57004),s=n.__importDefault(r(15554)),l=r(45894),c=(0,i.observer)((({classes:e,...t})=>{const r="",n=(0,o.useContext)(a.EncoderUiContext);(0,l.useUndefinedStoreError)(null!=(null==n?void 0:n.mediaStreamController),r);const i=(0,l.useUIEventError)((()=>{n.mediaStreamController.echoCancellation=!n.mediaStreamController.echoCancellation}),r);return o.default.createElement(s.default,{...t,classes:null==e?void 0:e.echoCancellationCheckbox,label:"Echo Cancellation",disabled:!n.mediaStreamController.supportsEchoCancellation(),checked:!0===n.mediaStreamController.echoCancellation,onChange:i,title:n.mediaStreamController.supportsEchoCancellation()?void 0:"Your browser does not support echo cancellation"})}));t.default=({classes:e,...t})=>o.default.createElement(l.ErrorBoundary,{render:()=>o.default.createElement(s.default,{...t,disabled:!0,classes:null==e?void 0:e.echoCancellationCheckbox,label:"Echo Cancellation Unavailable"})},o.default.createElement(c,{classes:e,...t}))},87051:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=r(12809),o=n.__importStar(r(89926)),a=r(57004),s=n.__importDefault(r(15554)),l=r(45894),c=(0,i.observer)((({classes:e,...t})=>{const r="",n=(0,o.useContext)(a.EncoderUiContext);(0,l.useUndefinedStoreError)(null!=(null==n?void 0:n.mediaStreamController),r);const i=(0,l.useUIEventError)((()=>{n.mediaStreamController.noiseSuppression=!n.mediaStreamController.noiseSuppression}),r);return o.default.createElement(s.default,{...t,classes:null==e?void 0:e.noiseSuppressionCheckbox,label:"Noise Suppression",disabled:!n.mediaStreamController.supportsNoiseSuppression(),checked:!0===n.mediaStreamController.noiseSuppression,onChange:i,title:n.mediaStreamController.supportsNoiseSuppression()?void 0:"Your browser does not support noise suppression"})}));t.default=({classes:e,...t})=>o.default.createElement(l.ErrorBoundary,{render:()=>o.default.createElement(s.default,{...t,classes:null==e?void 0:e.noiseSuppressionCheckbox,disabled:!0,label:"Noise Suppression Unavailable"})},o.default.createElement(c,{classes:e,...t}))},53561:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=r(12809),o=n.__importStar(r(89926)),a=r(57004),s=r(14353),l=r(66652),c=n.__importDefault(r(12255)),u=r(45894);function d(e){var t,r;if(null!=(null===(r=null===(t=e.settings)||void 0===t?void 0:t.video)||void 0===r?void 0:r.height))return e.settings.video.height;const n=e.resolution;return null==n?null:Array.isArray(n)?n[0]:"number"==typeof n?n:n.ideal}const h=(0,i.observer)((({classes:e={},maxResolutionHeight:t,...r})=>{var n,i;const h="",p=(0,o.useContext)(a.EncoderUiContext);(0,u.useUndefinedStoreError)(null!=(null==p?void 0:p.mediaStreamController),h);const f=p.currentAvailableResolutions.filter((e=>null==t||e<=t)),m=(0,s.useStyles)({source:e,target:{}},"select"),g=(0,l.mergeStylesObjects)(e,{}),v=(0,u.useUIEventError)((e=>{p.mediaStreamController.resolution=Number(e.target.value)}),h);return o.default.createElement(c.default,{...r,classes:g,label:"Quality",onChange:v,value:null!==(i=null===(n=d(p.mediaStreamController))||void 0===n?void 0:n.toString())&&void 0!==i?i:void 0},o.default.createElement("option",{disabled:!0,value:"",className:m.options},"Select a Resolution"),f.map((e=>o.default.createElement("option",{key:e,value:e,className:m.options},`${e}p`))))}));t.default=({classes:e={},maxResolutionHeight:t,...r})=>{const n=(0,s.useStyles)({source:e,target:{}},"select"),i=(0,l.mergeStylesObjects)(e,{});return o.default.createElement(u.ErrorBoundary,{render:()=>{var e;return o.default.createElement(c.default,{...r,value:"",disabled:!0,classes:i,label:"Resolution: Unavailable"},o.default.createElement("option",{value:"",className:null==n?void 0:n.options},null!==(e=r.fallbackText)&&void 0!==e?e:" Resolution Unavailable"))}},o.default.createElement(h,{maxResolutionHeight:t,classes:e,...r}))}},45030:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=r(28046),o=r(12809),a=n.__importStar(r(89926)),s=r(57004),l=r(14353),c=r(66652),u=n.__importDefault(r(12255)),d=r(45894),h=(0,o.observer)((({classes:e={},...t})=>{var r;const{label:n}=t,o="",h=(0,l.useStyles)({source:e,target:{}},"select"),p=(0,c.mergeStylesObjects)(e,{}),f=(0,a.useContext)(s.EncoderUiContext);(0,d.useUndefinedStoreError)(null!=(null==f?void 0:f.mediaStreamController),o);const m=(0,a.createRef)(),g=(0,d.useUIEventError)((e=>{f.mediaStreamController.resolution=null,f.mediaStreamController.videoDeviceId=e.target.value}),o),v=e=>i.mediaController.devicesInUse.some((t=>t.deviceId===e));return a.default.createElement(u.default,{classes:p,ref:m,onChange:g,value:null!==(r=f.mediaStreamController.videoDeviceId)&&void 0!==r?r:"",label:null!=n?n:"Camera",...t},a.default.createElement("option",{disabled:!0,value:""},"Select a camera"),i.mediaController.videoDevices().map(((e,t)=>{var r;return a.default.createElement("option",{key:e.deviceId,value:e.deviceId,className:h.options,disabled:v(e.deviceId)},null!==(r=e.label)&&void 0!==r?r:`Camera ${t+1}`," ",v(e.deviceId)&&"In Use")})))}));t.default=function({classes:e={},...t}){const r=(0,l.useStyles)({source:e,target:{}},"select"),n=(0,c.mergeStylesObjects)(e,{});return a.default.createElement(d.ErrorBoundary,{render:()=>{var e;return a.default.createElement(u.default,{...t,disabled:!0,classes:n,label:"Video device unavailable"},a.default.createElement("option",{value:"",className:null==r?void 0:r.options},null!==(e=t.fallbackText)&&void 0!==e?e:"Video Devices Unavailable"))}},a.default.createElement(h,{classes:e,...t}))}},99234:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=r(12809),o=r(28046),a=n.__importStar(r(89926)),s=r(57004),l=n.__importDefault(r(48788)),c=r(45894),u=(0,i.observer)((({classes:e={},disableToggle:t,active:r,...n})=>{const i=(0,a.useContext)(s.PlayerUiContext);return(0,c.useUndefinedStoreError)(null!=(null==i?void 0:i.player),""),!i.player.isImplements(o.player.Feature.PLAYER_SELECTOR)||i.player.isImplements(o.player.Feature.PLAYER_SELECTOR)&&!(null===(u=i.player)||void 0===u?void 0:u.supportsLowLatency)||i.player.isImplements(o.player.Feature.PLAYER_SELECTOR)&&(null===(d=i.player)||void 0===d?void 0:d.supportsLowLatency)&&i.player.availablePlayers.length<=1?null:a.default.createElement(l.default,{isActive:i.player.isImplements(o.player.Feature.PLAYER_SELECTOR)&&i.player.lowLatency,label:"Low-latency:",handleClick:()=>{i.player.isImplements(o.player.Feature.PLAYER_SELECTOR)&&(i.player.lowLatency=!i.player.lowLatency)},...n});var u,d}));t.default=function({classes:e,...t}){return a.default.createElement(c.ErrorBoundary,{render:()=>a.default.createElement(l.default,{isActive:!1,disabled:!0,...t})},a.default.createElement(u,{...t}))}},41709:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=r(28046),o=r(12809),a=n.__importStar(r(89926)),s=r(57004),l=r(55776),c=n.__importDefault(r(77247)),u=r(45894),d=n.__importDefault(r(20368)),h=(0,o.observer)((({classes:e={},disableSelect:t,showBitrate:r,...n})=>{var o;const h=(0,a.useContext)(s.PlayerUiContext),p=(0,l.useStyles)({source:e,target:d.default},"quality-select");function f(e){(null==h?void 0:h.player.isImplements(i.player.Feature.BITRATE_SWITCHING))&&(h.player.preferredLevel=e)}return(0,u.useUndefinedStoreError)(null!=(null==h?void 0:h.player),""),(null===(o=null==h?void 0:h.player)||void 0===o?void 0:o.isImplements(i.player.Feature.BITRATE_SWITCHING))?a.default.createElement(c.default,{...n,className:p.root},h.availableBitrates.map((e=>{return a.default.createElement("div",{role:"button",tabIndex:0,onKeyDown:t=>"Enter"===t.key&&void 0!==e.score&&f(e.score),key:e.score,id:e.score,onClick:()=>f(e.score),className:(n=e.score,(null==h?void 0:h.player.isImplements(i.player.Feature.BITRATE_SWITCHING))&&n===h.player.preferredLevel?p.activeOption:p.option)},a.default.createElement("label",{htmlFor:"layer.score"},e.name," ",(t=e.formattedBitrate,r&&null!=t&&""!==t?t:"")));var t,n}))):null}));t.default=function({classes:e,...t}){const r=(0,l.useStyles)({source:null!=e?e:{},target:d.default},"select");return a.default.createElement(u.ErrorBoundary,{render:()=>a.default.createElement(c.default,{...t,className:r.root},a.default.createElement("div",{key:"",id:"disabled-select",className:r.disabledOption},"Qualities Unavailable"))},a.default.createElement(h,{...t}))}},38268:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=r(12809),o=n.__importDefault(r(89926)),a=n.__importDefault(r(99234)),s=n.__importDefault(r(41709)),l=n.__importDefault(r(80354)),c=(0,i.observer)((({classes:e={},disableToggle:t,disableSelect:r,showBitrate:n,active:i,...c})=>o.default.createElement(l.default,{active:i},o.default.createElement(s.default,{disableSelect:r,showBitrate:n}),o.default.createElement(a.default,{disabledOff:t}))));t.default=c},71439:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=r(12809),o=n.__importStar(r(89926)),a=r(57004),s=n.__importDefault(r(95966)),l=r(45894),c=(0,i.observer)((({classes:e,...t})=>{var r;const n="",i=(0,o.useContext)(a.PlayerUiContext);(0,l.useUndefinedStoreError)(null!=(null==i?void 0:i.player),n);const c=(0,l.useUIEventError)((e=>{i.player.localAudioMuted=!1,i.player.localAudioVolume=Number(e.currentTarget.value)}),n);return(null==i?void 0:i.volumeRangeSupported)?o.default.createElement(s.default,{...t,classes:e,onInput:c,onChange:c,value:null!==(r=i.player.localAudioVolume)&&void 0!==r?r:.5}):null}));t.default=({classes:e,...t})=>o.default.createElement(l.ErrorBoundary,{render:()=>o.default.createElement(s.default,{classes:e,...t,disabled:!0})},o.default.createElement(c,{classes:e,...t}))},20368:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={wrapper:{position:"absolute",bottom:50},root:{position:"relative",overflow:"auto","@media only screen and (max-width: 1000px)":{maxHeight:112}},option:{width:120,background:"#ffffff",fontSize:12,color:"#374151",fontFamily:"sans-serif",padding:5,paddingLeft:10,paddingRight:10,display:"flex",cursor:"pointer",transition:"all 0.3s ease-in-out","&:hover":{background:"#f3f4f6"}},activeOption:{background:"#d1d5db",fontSize:12,color:"#374151",fontFamily:"sans-serif",padding:5,paddingLeft:10,paddingRight:10,display:"flex",cursor:"pointer"},disabledOption:{cursor:"not-allowed",background:"#313131",fontSize:12,color:"#a0a0a0",fontFamily:"sans-serif",padding:5,paddingLeft:10,paddingRight:10,display:"flex"}}},54323:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=r(12809),o=n.__importStar(r(89926)),a=r(57004),s=n.__importDefault(r(72429)),l=r(45894),c=(0,i.observer)((({children:e,classes:t,...r})=>{const n=null!=(0,o.useContext)(a.EncoderUiContext)?(0,o.useContext)(a.EncoderUiContext):(0,o.useContext)(a.PlayerUiContext);return(0,l.useUndefinedStoreError)(null!=n,""),o.default.createElement(s.default,{ref:n.videoWrapperElement,classes:t,isFullscreen:n.isFullscreen,...r},e)}));t.default=({classes:e,...t})=>o.default.createElement(l.ErrorBoundary,{render:()=>o.default.createElement(s.default,{classes:e,...t})},o.default.createElement(c,{classes:e,...t}))},86568:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StatelessSettingsModal=void 0;const n=r(31635),i=r(12809),o=n.__importStar(r(89926)),a=r(57004),s=r(45894),l=n.__importDefault(r(66463));t.StatelessSettingsModal=l.default;const c=(0,i.observer)((({children:e,open:t,onCloseButtonClick:r,...n})=>{const i="",c=null!=(0,o.useContext)(a.EncoderUiContext)?(0,o.useContext)(a.EncoderUiContext):(0,o.useContext)(a.PlayerUiContext);(0,s.useUndefinedStoreError)(null!=c,i);const u=(0,s.useUIEventError)((()=>{c.viewSettings=!c.viewSettings}),i);return o.default.createElement(l.default,{...n,open:null!=t?t:c.viewSettings,onCloseButtonClick:null!=r?r:u,title:"Settings"},e)}));t.default=({children:e,...t})=>o.default.createElement(s.ErrorBoundary,{render:()=>o.default.createElement(l.default,{...t})},o.default.createElement(c,{...t},e))},79937:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=r(12809),o=n.__importStar(r(89926)),a=r(57004),s=n.__importDefault(r(29347)),l=r(45894),c=n.__importDefault(r(49360)),u=n.__importDefault(r(54277)),d=(0,i.observer)((({itemsPerSlide:e=6})=>{const t=(0,u.default)("screen and (max-width: 1023px)"),r=(0,u.default)("screen and (max-width: 768px)"),n=(0,o.useContext)(a.MultistreamContext);(0,l.useUndefinedStoreError)(null!=n,"");const{isInitialLoadDone:i,publicKeys:d}=n;return o.default.createElement("div",null,i&&o.default.createElement(s.default,{itemsPerSlide:t?e/2:e,gap:10,vertical:!r},d.map((e=>o.default.createElement(c.default,{key:e,publicKey:e,isMobile:r})))))}));t.default=d},49360:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=n.__importStar(r(89926)),o=r(12809),a=r(61294),s=r(14353),l=n.__importDefault(r(24420)),c=r(57004),u=r(45894),d=n.__importDefault(r(5737)),h=n.__importDefault(r(69381)),p=(0,o.observer)((({publicKey:e,classes:t,isMobile:r})=>{var n,o;const[p,f]=(0,i.useState)(!1),m=(0,s.useStyles)({target:null!=t?t:{},source:a.carouselSlideStyles},"multistream-carousel-slide"),g=(0,i.useContext)(c.MultistreamContext);(0,u.useUndefinedStoreError)(null!=g,"");const{activePublicKeys:v,startPlayer:y,streams:b}=g,_=(0,i.useMemo)((()=>{var t;return`${null===(t=b[e])||void 0===t?void 0:t.posterUrl}&hash=${Date.now()}`}),[b,e]),S=null===(n=b[e])||void 0===n?void 0:n.disconnected,w=null===(o=b[e])||void 0===o?void 0:o.viewCount,E=v.includes(e);if((0,i.useEffect)((()=>{let e=null;return p&&(e=setInterval((()=>{const t=new Image;t.onload=()=>{f(!1),document.body.removeChild(t),null!=e&&clearInterval(e)},t.src=null!=_?_:"",t.style.display="none",document.body.appendChild(t)}),2e3)),()=>{e&&clearInterval(e)}}),[p,_]),S)return i.default.createElement("div",{className:m.disconnectedWrapper},i.default.createElement("h2",{className:m.disconnected},"OFFLINE"));const C=null!=_&&!p;return i.default.createElement("div",{className:C?m.root:m.disconnectedWrapper,onClick:()=>r&&y(e),onKeyDown:t=>"Enter"===t.key&&r&&y(e),tabIndex:0,role:"button",style:{cursor:r?"pointer":"default"}},1==!E&&i.default.createElement("button",{type:"button",onClick:()=>y(e),className:m.addButton},i.default.createElement(l.default,{weight:"normal",style:{width:"15px",transform:"rotateZ(45deg)",marginLeft:"3px"}})),C?i.default.createElement("img",{className:m.image,src:_,alt:"video-poster",onError:()=>f(!0)}):i.default.createElement("div",{className:m.stockImageWrapper},i.default.createElement(h.default,{style:{width:"30%"},outline:!0})),E&&i.default.createElement("div",{className:m.playingOverlay}),null!=w&&w>0&&i.default.createElement("div",{className:m.viewCount},i.default.createElement(d.default,{style:{width:"15px",marginRight:"3px",height:"11px"}}),i.default.createElement("span",null,w)))}));t.default=p},40906:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=n.__importStar(r(89926)),o=r(12809),a=r(57004),s=n.__importDefault(r(54323)),l=n.__importDefault(r(17921)),c=r(79020),u=n.__importDefault(r(42168)),d=r(14353),h=n.__importDefault(r(24420)),p=r(45894),f=r(61294),m=n.__importDefault(r(5737)),g=(0,o.observer)((({classes:e,publicKey:t,useDefaultStyles:r=!0,reRender:n})=>{var o;const g=(0,d.useStyles)({target:null!=e?e:{},source:f.playerStyles},"multistream"),v=(0,i.useContext)(a.MultistreamContext);(0,p.useUndefinedStoreError)(null!=v,"");const{playersWrapperElement:y,activePublicKeys:b,stopPlayer:_,streams:S}=v,w=S[t],{offsetHeight:E,offsetWidth:C}=null!==(o=y.current)&&void 0!==o?o:{offsetHeight:0,offsetWidth:0},O=(0,i.useMemo)((()=>(0,f.getVideoElementStyles)({containerHeight:E,containerWidth:C,playersCount:b.length})),[b.length,E,C]),P=null==w?void 0:w.viewCount;return i.default.createElement(s.default,{classes:r?{root:{...O.root,...null==e?void 0:e.root}}:e},1!==b.length&&i.default.createElement("button",{type:"button",onClick:()=>_(t),className:g.closeButton},i.default.createElement(h.default,{weight:"normal",style:{width:"15px",marginLeft:"3px"}})),i.default.createElement(l.default,{pillarBox:!1}),i.default.createElement(u.default,{variant:"player",classes:{root:{bottom:"0 !important"},controls:{backgroundImage:"transparent",justifyContent:"flex-start"}}},i.default.createElement(c.PlayerPlayButton,null),i.default.createElement(c.PlayerAudioButton,null)),null!=P&&P>0&&i.default.createElement("div",{className:g.viewCount},i.default.createElement(m.default,{style:{width:"15px",marginRight:"3px",height:"11px"}}),i.default.createElement("span",null,P)))}));t.default=g},35777:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=r(12809),o=n.__importStar(r(89926)),a=r(86729),s=r(57004),l=r(45894),c=n.__importDefault(r(40906)),u=r(14353),d=r(61294),h=r(44105),p=(0,i.observer)((({classes:e})=>{const t=(0,u.useStyles)({target:null!=e?e:{},source:d.playersWrapperStyles},"multistream-players-grid"),r=(0,o.useContext)(s.MultistreamContext),[n,i]=(0,o.useState)(!1);(0,l.useUndefinedStoreError)(null!=r,"");const{width:p,height:f}=(0,h.useRefDimensions)(r.playersWrapperElement);(0,o.useEffect)((()=>{const e=()=>{i((e=>!e))};return a.device.addEventListener("resize",e),e(),()=>a.device.removeEventListener("resize",e)}),[p,f]);const{playersWrapperElement:m,activePublicKeys:g,streams:v}=r;return o.default.createElement("div",{ref:m,className:t.root},g.map((e=>{var t;return o.default.createElement(s.PlayerUiContext.Provider,{key:e,value:null===(t=v[e])||void 0===t?void 0:t.playerUi},o.default.createElement(c.default,{publicKey:e,reRender:n}))})))}));t.default=p},2898:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MultistreamCarousel=t.MultistreamPlayersGrid=t.MultistreamCarouselSlide=t.MultistreamPlayer=void 0;const n=r(31635),i=n.__importDefault(r(40906));t.MultistreamPlayer=i.default;const o=n.__importDefault(r(49360));t.MultistreamCarouselSlide=o.default;const a=n.__importDefault(r(35777));t.MultistreamPlayersGrid=a.default;const s=n.__importDefault(r(79937));t.MultistreamCarousel=s.default},61294:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getVideoElementStyles=t.carouselSlideStyles=t.playersWrapperStyles=t.playerStyles=t.VIDEO_SPACING=void 0;const r={position:"absolute",top:0,right:0,width:"1.5rem",height:"1.5rem",color:"#fff",display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:"rgba(220, 175, 15, 0.7)",borderBottomLeftRadius:"15px",border:"1px solid #fff",paddingBottom:"0.15rem",zIndex:1},n={position:"absolute",padding:"0.2rem 0.8rem",color:"#fff",display:"flex",gap:"0.7rem",justifyContent:"space-between",alignItems:"center",background:"rgba(29, 29, 29, 0.4)",backdropFilter:"blur(3.40008px)",border:"1px solid #fff",borderRadius:"1.36px"};t.VIDEO_SPACING=16,t.playerStyles={root:{},closeButton:r,viewCount:{...n,bottom:11,right:10}},t.playersWrapperStyles={root:{display:"flex",justifyContent:"center",alignItems:"center",flexWrap:"wrap",gap:`${t.VIDEO_SPACING}px`,"@media only screen and (min-width: 769px)":{width:"100%",height:"inherit"},"@media only screen and (max-width: 770px)":{width:"inherit",height:"100%"}}},t.carouselSlideStyles={root:{height:"inherit",width:"100%",position:"relative"},disconnectedWrapper:{height:"inherit",width:"100%",position:"relative",background:"rgba(29, 29, 29, 0.4)",backdropFilter:"blur(3.40008px)"},addButton:r,image:{height:"inherit",width:"100%",objectFit:"cover"},playingOverlay:{position:"absolute",top:0,left:0,height:"inherit",width:"100%",border:"solid 3px #E5B711"},disconnected:{display:"flex",justifyContent:"center",alignItems:"center",height:"inherit",width:"100%",color:"#fff"},stockImageWrapper:{height:"inherit",width:"100%",display:"flex",justifyContent:"center",alignItems:"center"},viewCount:{...n,bottom:5,right:5}},t.getVideoElementStyles=({containerHeight:e,containerWidth:r,playersCount:n})=>0===e||0===r?{root:{width:"100%",height:"100%"}}:1===n?{root:{width:"100%",height:`${e}px`,"@media only screen and (max-width: 768px)":{width:"100%",height:"auto"}}}:{root:{width:(r-t.VIDEO_SPACING-2)/2+"px",height:(e-t.VIDEO_SPACING-2)/2+"px","@media only screen and (max-width: 768px)":{width:"100%",height:"auto"}}}},77325:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=r(12809),o=r(28046),a=n.__importStar(r(89926)),s=r(57004),l=r(45894),c=n.__importDefault(r(15343)),u=(0,i.observer)((({classes:e,children:t,publicKey:r})=>{const n=(0,a.useContext)(s.MultistreamContext);return(0,l.useUndefinedStoreError)(null!=n,""),a.default.createElement(c.default,{classes:e,onClick:()=>{o.adapter.device.isMobileDevice&&null!=r&&n.startPlayer(r)},onKeydown:e=>{o.adapter.device.isMobileDevice&&"Enter"===e.key&&null!=r&&n.startPlayer(r)}},t)}));t.default=({classes:e,...t})=>a.default.createElement(l.ErrorBoundary,{render:()=>a.default.createElement(c.default,{classes:e,onClick:void 0,onKeydown:void 0,...t})},a.default.createElement(u,{classes:e,...t}))},82042:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=r(12809),o=n.__importStar(r(89926)),a=r(57004),s=n.__importDefault(r(29347)),l=r(45894),c=n.__importDefault(r(54277)),u=(0,i.observer)((({itemsPerSlide:e=6,children:t,gap:r,vertical:n,classes:i})=>{const u=(0,c.default)("screen and (max-width: 1023px)"),d=(0,c.default)("screen and (max-width: 768px)"),h=(0,o.useContext)(a.MultistreamContext);(0,l.useUndefinedStoreError)(null!=h,"");const p=u?3:6;return o.default.createElement("div",null,(null==h?void 0:h.isInitialLoadDone)&&o.default.createElement(s.default,{itemsPerSlide:null!=e?e:p,gap:null!=r?r:10,vertical:null!=n?n:!d,classes:i},t))}));t.default=({classes:e,...t})=>o.default.createElement(l.ErrorBoundary,{render:()=>o.default.createElement(s.default,{classes:e,...t})},o.default.createElement(u,{classes:e,...t}))},35840:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=n.__importStar(r(89926)),o=r(57004),a=n.__importDefault(r(54323)),s=r(37999),l=r(45894),c=n.__importDefault(r(72429));function u({classes:e,children:t}){var r;const n=(0,i.useContext)(o.MultistreamContext),{offsetHeight:l,offsetWidth:c}=null!==(r=null==n?void 0:n.playersWrapperElement.current)&&void 0!==r?r:{offsetHeight:0,offsetWidth:0},u=(0,i.useMemo)((()=>{var e;return(0,s.getVideoElementStyles)({containerHeight:l,containerWidth:c,playersCount:null!==(e=null==n?void 0:n.activePublicKeys.length)&&void 0!==e?e:0})}),[null==n?void 0:n.activePublicKeys.length,l,c]);return i.default.createElement(a.default,{classes:{root:{...u.root,...null==e?void 0:e.root}}},t)}t.default=({classes:e,...t})=>i.default.createElement(l.ErrorBoundary,{render:()=>i.default.createElement(c.default,{classes:e,...t})},i.default.createElement(u,{classes:e,...t}))},97713:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=n.__importStar(r(89926)),o=r(12809),a=r(57004),s=r(45894),l=n.__importDefault(r(40262)),c=(0,o.observer)((({classes:e,publicKey:t})=>{const r=(0,i.useContext)(a.MultistreamContext);(0,s.useUndefinedStoreError)(null!=r,"");const n=(0,i.useMemo)((()=>{var e;return null!=t?`${null===(e=null==r?void 0:r.streams[t])||void 0===e?void 0:e.posterUrl}&hash=${Date.now()}`:null}),[null==r?void 0:r.streams,t]);return i.default.createElement(l.default,{posterUrl:n,classes:e})}));t.default=({classes:e,...t})=>i.default.createElement(s.ErrorBoundary,{render:()=>i.default.createElement(l.default,{classes:e,posterUrl:null,...t})},i.default.createElement(c,{classes:e,...t}))},5998:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=r(12809),o=n.__importStar(r(89926)),a=r(57004),s=r(45894),l=n.__importDefault(r(96755)),c=(0,i.observer)((({classes:e,children:t})=>{const r=(0,o.useContext)(a.MultistreamContext);(0,s.useUndefinedStoreError)(null!=r,"");const{playersWrapperElement:n}=r;return o.default.createElement(l.default,{ref:n,classes:e},t)}));t.default=({classes:e,...t})=>o.default.createElement(s.ErrorBoundary,{render:()=>o.default.createElement(l.default,{classes:e,...t})},o.default.createElement(c,{classes:e,...t}))},67439:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=n.__importStar(r(89926)),o=r(12809),a=r(57004),s=r(45894),l=n.__importDefault(r(21639)),c=(0,o.observer)((({classes:e,publicKey:t})=>{const r=(0,i.useContext)(a.MultistreamContext);return(0,s.useUndefinedStoreError)(null!=r,""),null==r||null==t||(null==r?void 0:r.activePublicKeys.includes(t))?null:i.default.createElement(l.default,{onClick:()=>r.startPlayer(t),classes:e})}));t.default=({classes:e,...t})=>i.default.createElement(s.ErrorBoundary,{render:()=>i.default.createElement(l.default,{classes:e,onClick:void 0,...t})},i.default.createElement(c,{classes:e,...t}))},21493:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=n.__importStar(r(89926)),o=r(12809),a=r(57004),s=r(45894),l=n.__importDefault(r(83004)),c=(0,o.observer)((({classes:e})=>{const t=(0,i.useContext)(a.MultistreamContext),r=(0,i.useContext)(a.PlayerUiContext),n=null==r?void 0:r.multistreamPlayerPublicKey;return(0,s.useUndefinedStoreError)(null!=t||null!=r,""),null==t||null==r?null:1!==t.activePublicKeys.length&&null!=n?i.default.createElement(l.default,{onClick:()=>t.stopPlayer(n),classes:e}):null}));t.default=({classes:e,...t})=>i.default.createElement(s.ErrorBoundary,{render:()=>i.default.createElement(l.default,{classes:e,onClick:void 0,...t})},i.default.createElement(c,{classes:e,...t}))},7246:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=n.__importStar(r(89926)),o=r(12809),a=r(57004),s=r(45894),l=n.__importDefault(r(18185)),c=(0,o.observer)((({classes:e,publicKey:t})=>{const r=(0,i.useContext)(a.MultistreamContext),n=(0,i.useContext)(a.PlayerUiContext);return(0,s.useUndefinedStoreError)(null!=r,""),i.default.createElement(l.default,{classes:e,viewCount:(()=>{var e;const i=null!=t?t:null!=(null==n?void 0:n.multistreamPlayerPublicKey)?n.multistreamPlayerPublicKey:null;return"string"==typeof i&&null!=r.streams[i].viewCount&&null!==(e=r.streams[i].viewCount)&&void 0!==e?e:"unavailable"})()})}));t.default=({classes:e,...t})=>i.default.createElement(s.ErrorBoundary,{render:()=>i.default.createElement(l.default,{classes:e,viewCount:"unavailable",...t})},i.default.createElement(c,{classes:e,...t}))},19610:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MultistreamCarouselSlideWrapper=t.MultistreamPosterImage=t.MultistreamStartPlayerButton=t.MultistreamCarouselWrapper=t.MultistreamMediaContainer=t.MultistreamPlayersGridWrapper=t.MultistreamViewCount=t.MultistreamStopPlayerButton=void 0;const n=r(31635),i=n.__importDefault(r(21493));t.MultistreamStopPlayerButton=i.default;const o=n.__importDefault(r(7246));t.MultistreamViewCount=o.default;const a=n.__importDefault(r(5998));t.MultistreamPlayersGridWrapper=a.default;const s=n.__importDefault(r(35840));t.MultistreamMediaContainer=s.default;const l=n.__importDefault(r(82042));t.MultistreamCarouselWrapper=l.default;const c=n.__importDefault(r(67439));t.MultistreamStartPlayerButton=c.default;const u=n.__importDefault(r(97713));t.MultistreamPosterImage=u.default;const d=n.__importDefault(r(77325));t.MultistreamCarouselSlideWrapper=d.default},55163:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=r(12809),o=n.__importStar(r(89926)),a=r(57004),s=n.__importDefault(r(24957)),l=r(45894),c=(0,i.observer)((({children:e,onClick:t,...r})=>{const n="",i=(0,o.useContext)(a.PlayerUiContext);(0,l.useUndefinedStoreError)(null!=(null==i?void 0:i.player),n);const c=(0,l.useUIEventError)(null!=t?t:()=>{i.logger.info("PlayerOverlayButton clicked"),i.player.localVideoPaused=!1},n);return i.player.localVideoPaused?o.default.createElement(s.default,{onMouseEnter:()=>{i.mobileDevice||(i.videoMouseOver=!0)},onMouseLeave:()=>{i.mobileDevice||(i.videoMouseOver=!1)},...r,onClick:c},e):null}));t.default=({...e})=>o.default.createElement(l.ErrorBoundary,{render:()=>o.default.createElement(s.default,{...e,disabled:!0})},o.default.createElement(c,{...e}))},95895:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=n.__importStar(r(89926)),o=n.__importDefault(r(25884)),a=r(79020),s=r(14353),l=r(66652),c=n.__importDefault(r(16312)),u=n.__importDefault(r(87132)),d=n.__importDefault(r(26654)),h=n.__importDefault(r(78533));t.default=({attachToRef:e,classes:t={},ref:r,children:n,open:p=!1,renderTitle:f,title:m,onRequestButtonClick:g,buttonRequestText:v,onCloseButtonClick:y,renderButton:b,..._})=>{if(!e)return console.warn("VideoCallSidebar was not provided the attachToRef prop. This is used to attach to a DOM element and display the sidebar."),null;const[S,w]=(0,i.useState)(p);(0,i.useEffect)((()=>{w((e=>e!=p?p:e))}),[p]);const E=(0,s.useStyles)({source:t,target:h.default},"callRequestSidebar"),C=(0,l.mergeStylesObjects)(t,{});return o.default.createPortal(i.default.createElement(u.default,{classes:null==t?void 0:t.slideSidebar,open:S},i.default.createElement("div",{className:E.headerContainer},i.default.createElement(c.default,{onClick:()=>{w(!1),y&&y()},open:S,classes:C.closeButton}),f?f(_):i.default.createElement("span",{className:E.renderTitleSpan},m)),i.default.createElement("div",{className:E.callRequestContainer},i.default.createElement("div",{className:E.encoderContainer},i.default.createElement(a.EncoderVideo,{classes:C.videoWrapper})),i.default.createElement("div",{className:E.deviceSelectContainer},i.default.createElement("p",{className:E.settingsText},"Settings"),i.default.createElement(a.EncoderVideoDeviceSelect,{ariaLabel:"Video device select",classes:C.videoDeviceSelect}),i.default.createElement(a.EncoderAudioDeviceSelect,{ariaLabel:"Audio device select",classes:C.audioDeviceSelect})),b?b(_):i.default.createElement("div",{className:E.buttonContainer},i.default.createElement(d.default,{ref:r,buttonRequestText:null!=v?v:void 0,onRequestButtonClick:g,active:!1,disabled:!1,isFirstAttempt:!0})))),e)}},60277:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StatelessSettingsSidebar=void 0;const n=r(31635),i=r(12809),o=n.__importStar(r(89926)),a=r(57004),s=n.__importDefault(r(87132));t.StatelessSettingsSidebar=s.default;const l=r(45894),c=(0,i.observer)((({children:e,open:t,onCloseButtonClick:r,...n})=>{const i="",c=null!=(0,o.useContext)(a.EncoderUiContext)?(0,o.useContext)(a.EncoderUiContext):(0,o.useContext)(a.PlayerUiContext);(0,l.useUndefinedStoreError)(null!=c,i);const u=(0,l.useUIEventError)((()=>{c.viewSettings=!c.viewSettings}),i);return o.default.createElement(s.default,{...n,open:null!=t?t:c.viewSettings,onCloseButtonClick:null!=r?r:u},e)}));t.default=({children:e,...t})=>o.default.createElement(l.ErrorBoundary,{render:()=>o.default.createElement(s.default,{...t})},o.default.createElement(c,{...t},e))},38925:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=r(12809),o=n.__importStar(r(89926)),a=r(57004),s=n.__importDefault(r(87132)),l=r(45894),c=(0,i.observer)((({children:e,onCloseButtonClick:t,open:r,...n})=>{const i="",c=(0,o.useContext)(a.EncoderUiContext);(0,l.useUndefinedStoreError)(null!=c,i);const u=(0,l.useUIEventError)((()=>{c.viewVideoCallSlider=!c.viewVideoCallSlider}),i);return o.default.createElement(s.default,{...n,onCloseButtonClick:null!=t?t:u,open:null!=r?r:null==c?void 0:c.viewVideoCallSlider,variant:"dark"},e)}));t.default=({children:e,...t})=>o.default.createElement(l.ErrorBoundary,{render:()=>o.default.createElement(s.default,{...t})},o.default.createElement(c,{...t},e))},78533:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={buttonContainer:{},callRequestContainer:{display:"flex",flexDirection:"column",justifyContent:"space-evenly",height:"100%"},deviceSelectContainer:{display:"flex",flexDirection:"column",justifyContent:"space-between",width:"12rem"},encoderContainer:{},headerContainer:{alignItems:"center",display:"flex",height:"2rem",width:"100%"},renderTitleSpan:{color:"#000",fontFamily:"sans-serif",marginLeft:"0.2rem"},settingsText:{fontFamily:"sans-serif"}}},40622:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=r(12809),o=n.__importStar(r(89926)),a=r(5300),s=r(57004),l=r(14353),c=n.__importDefault(r(24957)),u=n.__importDefault(r(51080)),d=r(7308),h=r(45894),p=r(39960),f=(0,i.observer)((({classes:e,backgroundAudio:t,...r})=>{var n;const i=(0,o.useContext)(s.EncoderUiContext);(0,h.useUndefinedStoreError)(null!=(null==i?void 0:i.videoElement),"");const c=(0,d.videoWrapperStyles)({pillarBox:null!==(n=r.pillarBox)&&void 0!==n&&n,fullScreen:r.isFullScreen,mirror:r.mirror,elementBlur:r.elementBlur,blurPixels:r.blurPixels}),f=(0,l.useStyles)({source:null!=e?e:{},target:c},"videoWrapper"),m=t&&!i.testMic?(0,a.withSilenceBackground)(i.audioCtx,i.mediaStreamController.source):i.mediaStreamController.source;return o.default.createElement(u.default,{classes:e,isFullScreen:i.isFullscreen,ref:i.videoWrapperElement,...r},o.default.createElement(p.TempVideo,{muted:!i.testMic,ref:i.videoElement,playsInline:!0,source:m,className:f.videoElement}))}));t.default=({classes:e,...t})=>{var r;const n=(0,d.videoWrapperStyles)({pillarBox:null!==(r=t.pillarBox)&&void 0!==r&&r,fullScreen:t.isFullScreen,mirror:t.mirror,elementBlur:t.elementBlur,blurPixels:t.blurPixels}),i=(0,l.useStyles)({source:null!=e?e:{},target:n},"videoWrapper");return o.default.createElement(h.ErrorBoundary,{render:()=>o.default.createElement(u.default,{classes:e,...t},o.default.createElement("div",{className:i.videoElement,style:{display:"inline-block",aspectRatio:"16/9"}},o.default.createElement("p",null,"Video is not working"),o.default.createElement(c.default,{classes:null==e?void 0:e.playerOverlayButton,...t,disabled:!0})))},o.default.createElement(f,{classes:e,...t}))}},17921:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=r(28046),o=r(12809),a=n.__importStar(r(89926)),s=r(57004),l=r(14353),c=r(44105),u=n.__importDefault(r(51080)),d=r(7308),h=r(45894),p=r(2018),f=(0,o.observer)((({classes:e,adaptiveBlur:t,adaptiveBlurValues:r,elementBlur:n,blurPixels:o,...f})=>{var m;const g=(0,a.useContext)(s.PlayerUiContext);(0,h.useUndefinedStoreError)(null!=(null==g?void 0:g.videoElement),"");const v=t||n||g.player.isImplements(i.player.Feature.BITRATE_SWITCHING)&&g.player.blurred,{width:y}=(0,c.useRefDimensions)(null==g?void 0:g.videoElement);o=t?(e=>{var t,n;const i=null!==(t=null==r?void 0:r.min)&&void 0!==t?t:9;return((null!==(n=null==r?void 0:r.max)&&void 0!==n?n:15)-i)*(e-360)/1560+i})(y):o;const b=(0,d.videoWrapperStyles)({pillarBox:null!==(m=f.pillarBox)&&void 0!==m&&m,fullScreen:f.isFullScreen,mirror:f.mirror,elementBlur:v,blurPixels:o}),_=(0,l.useStyles)({source:null!=e?e:{},target:b},"videoWrapper");return a.default.createElement(u.default,{isFullScreen:null==g?void 0:g.isFullscreen,classes:e,ref:g.videoWrapperElement,elementBlur:v,blurPixels:o,...f},a.default.createElement(p.Video,{source:g.player,autoPlay:!1,className:_.videoElement,ref:g.videoElement,id:f.id}))}));t.default=({classes:e,...t})=>a.default.createElement(h.ErrorBoundary,{render:()=>a.default.createElement("div",{style:{height:"600px",width:"100%"}},a.default.createElement("p",null,"Video is not working"))},a.default.createElement(f,{classes:e,...t}))},39960:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TempVideo=void 0;const n=r(31635).__importStar(r(89926));t.TempVideo=(0,n.forwardRef)(((e,t)=>{const r=(0,n.useRef)(null),{source:i,...o}=e;return(0,n.useImperativeHandle)(t,(()=>r.current)),(0,n.useEffect)((()=>{const e=r.current;null!=e&&null!=i&&e.srcObject!==i&&(i instanceof MediaStream?(e.srcObject=i,e.play().catch((e=>{}))):i.attachTo(e))}),[i]),(0,n.useEffect)((()=>{null!=r.current&&(i instanceof MediaStream||(null==i?void 0:i.localVideoPaused)||r.current.paused&&!r.current.ended&&r.current.play())})),n.default.createElement("video",{...o,ref:r})}))},2018:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Video=void 0;const n=r(31635).__importStar(r(89926));t.Video=(0,n.forwardRef)(((e,t)=>{const r=(0,n.useRef)(null),{source:i,...o}=e;return(0,n.useImperativeHandle)(t,(()=>r.current)),(0,n.useEffect)((()=>{const e=r.current;null!=e&&null!=i&&e.srcObject!==i&&(i instanceof MediaStream?(e.srcObject=i,e.play().catch((e=>{}))):i.attachTo(e))}),[i]),n.default.createElement("video",{...o,ref:r})}))},79020:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PlayerVideo=t.EncoderVideo=t.VideoCall=t.SettingsSidebar=t.MediaContainer=t.Checkbox=t.PlayerVolumeRange=t.ErrorAlert=t.EncoderVideoDeviceSelect=t.EncoderResolutionSelect=t.EncoderNoiseSuppressionCheckbox=t.EncoderEchoCancellationCheckbox=t.EncoderAudioDeviceSelect=t.EncoderAspectRatioSelect=t.DurationLabel=t.ControlBarSection=t.ControlBar=t.PlayerOverlayButton=t.PlayerQualitySettings=t.PlayerPlayButton=t.PlayerNewWindowButton=t.PlayerGetSoundButton=t.PlayerFullscreenButton=t.PlayerBitrateButton=t.PlayerAudioButton=t.TestMicButton=t.SettingsButton=t.PauseBroadcastButton=t.ScreenCaptureButton=t.MicrophoneButton=t.FullscreenButton=t.CameraButton=t.CallRequestSidebar=t.CallControl=t.JoinBroadcastButton=t.MultistreamCarouselSlideWrapper=t.CarouselPlayingOverlay=t.MultistreamPosterImage=t.MultistreamStartPlayerButton=t.MultistreamCarouselWrapper=t.MultistreamMediaContainer=t.MultistreamPlayersGridWrapper=t.MultistreamViewCount=t.MultistreamStopPlayerButton=t.useRefDimensions=t.useGridRerender=t.MultistreamCarousel=t.MultistreamPlayersGrid=t.MultistreamCarouselSlide=t.MultistreamPlayer=void 0,t.SettingsModal=t.StatelessSettingsSidebar=t.PeerMutedBadge=void 0;const n=r(31635),i=n.__importDefault(r(64536));t.ErrorAlert=i.default;const o=r(9644);Object.defineProperty(t,"useGridRerender",{enumerable:!0,get:function(){return o.useGridRerender}});const a=r(44105);Object.defineProperty(t,"useRefDimensions",{enumerable:!0,get:function(){return a.useRefDimensions}});const s=n.__importDefault(r(59537));t.CarouselPlayingOverlay=s.default;const l=n.__importDefault(r(42168));t.ControlBar=l.default;const c=n.__importDefault(r(47939));t.ControlBarSection=c.default;const u=n.__importDefault(r(15554));t.Checkbox=u.default;const d=n.__importDefault(r(71962));t.PeerMutedBadge=d.default;const h=n.__importDefault(r(6334));t.CameraButton=h.default;const p=n.__importDefault(r(28334));t.JoinBroadcastButton=p.default;const f=n.__importDefault(r(8544));t.PauseBroadcastButton=f.default;const m=n.__importDefault(r(98242));t.MicrophoneButton=m.default;const g=n.__importDefault(r(95543));t.ScreenCaptureButton=g.default;const v=n.__importDefault(r(13144));t.SettingsButton=v.default;const y=n.__importDefault(r(39890));t.TestMicButton=y.default;const b=n.__importDefault(r(8556));t.PlayerAudioButton=b.default;const _=n.__importDefault(r(29715));t.PlayerBitrateButton=_.default;const S=n.__importDefault(r(75));t.PlayerGetSoundButton=S.default;const w=n.__importDefault(r(24536));t.PlayerNewWindowButton=w.default;const E=n.__importDefault(r(15274));t.PlayerPlayButton=E.default;const C=n.__importDefault(r(90133));Object.defineProperty(t,"FullscreenButton",{enumerable:!0,get:function(){return C.default}}),Object.defineProperty(t,"PlayerFullscreenButton",{enumerable:!0,get:function(){return C.default}});const O=n.__importDefault(r(43756));t.CallControl=O.default;const P=n.__importDefault(r(63937));t.DurationLabel=P.default;const T=n.__importDefault(r(43620));t.EncoderAspectRatioSelect=T.default;const k=n.__importDefault(r(86711));t.EncoderAudioDeviceSelect=k.default;const R=n.__importDefault(r(91816));t.EncoderEchoCancellationCheckbox=R.default;const A=n.__importDefault(r(87051));t.EncoderNoiseSuppressionCheckbox=A.default;const D=n.__importDefault(r(53561));t.EncoderResolutionSelect=D.default;const I=n.__importDefault(r(45030));t.EncoderVideoDeviceSelect=I.default;const x=n.__importDefault(r(38268));t.PlayerQualitySettings=x.default;const M=n.__importDefault(r(71439));t.PlayerVolumeRange=M.default;const L=n.__importDefault(r(54323));t.MediaContainer=L.default;const j=n.__importDefault(r(55163));t.PlayerOverlayButton=j.default;const N=n.__importDefault(r(95895));t.CallRequestSidebar=N.default;const F=n.__importStar(r(60277));t.SettingsSidebar=F.default,Object.defineProperty(t,"StatelessSettingsSidebar",{enumerable:!0,get:function(){return F.StatelessSettingsSidebar}});const B=n.__importDefault(r(38925));t.VideoCall=B.default;const U=n.__importDefault(r(40622));t.EncoderVideo=U.default;const V=n.__importDefault(r(17921));t.PlayerVideo=V.default;const H=n.__importDefault(r(86568));t.SettingsModal=H.default;const G=r(2898);Object.defineProperty(t,"MultistreamPlayer",{enumerable:!0,get:function(){return G.MultistreamPlayer}}),Object.defineProperty(t,"MultistreamCarouselSlide",{enumerable:!0,get:function(){return G.MultistreamCarouselSlide}}),Object.defineProperty(t,"MultistreamPlayersGrid",{enumerable:!0,get:function(){return G.MultistreamPlayersGrid}}),Object.defineProperty(t,"MultistreamCarousel",{enumerable:!0,get:function(){return G.MultistreamCarousel}});const W=r(19610);Object.defineProperty(t,"MultistreamStopPlayerButton",{enumerable:!0,get:function(){return W.MultistreamStopPlayerButton}}),Object.defineProperty(t,"MultistreamViewCount",{enumerable:!0,get:function(){return W.MultistreamViewCount}}),Object.defineProperty(t,"MultistreamPlayersGridWrapper",{enumerable:!0,get:function(){return W.MultistreamPlayersGridWrapper}}),Object.defineProperty(t,"MultistreamMediaContainer",{enumerable:!0,get:function(){return W.MultistreamMediaContainer}}),Object.defineProperty(t,"MultistreamCarouselWrapper",{enumerable:!0,get:function(){return W.MultistreamCarouselWrapper}}),Object.defineProperty(t,"MultistreamStartPlayerButton",{enumerable:!0,get:function(){return W.MultistreamStartPlayerButton}}),Object.defineProperty(t,"MultistreamPosterImage",{enumerable:!0,get:function(){return W.MultistreamPosterImage}}),Object.defineProperty(t,"MultistreamCarouselSlideWrapper",{enumerable:!0,get:function(){return W.MultistreamCarouselSlideWrapper}})},30511:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MultistreamContext=t.VideoClientContext=t.RecorderUiContext=t.PlayerUiContext=t.CallContext=t.EncoderUiContext=void 0;const n=r(89926),i=(0,n.createContext)(null);t.EncoderUiContext=i;const o=(0,n.createContext)(null);t.PlayerUiContext=o;const a=(0,n.createContext)(null);t.RecorderUiContext=a;const s=(0,n.createContext)(null);t.VideoClientContext=s;const l=(0,n.createContext)(null);t.CallContext=l;const c=(0,n.createContext)(null);t.MultistreamContext=c},57004:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),r(31635).__exportStar(r(30511),t)},32:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635);n.__exportStar(r(79020),t),n.__exportStar(r(57004),t),n.__exportStar(r(14353),t)},14353:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.makeStyles=t.mergeStyles=t.useStyles=void 0;var n=r(55776);Object.defineProperty(t,"useStyles",{enumerable:!0,get:function(){return n.useStyles}}),Object.defineProperty(t,"mergeStyles",{enumerable:!0,get:function(){return n.mergeStyles}}),Object.defineProperty(t,"makeStyles",{enumerable:!0,get:function(){return n.makeStyles}})},66652:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeStylesObjects=void 0,t.mergeStylesObjects=(e,r)=>{const n={...e};return Object.keys(r).forEach((i=>{var o;null==(o=r[i])||"object"!=typeof o||Array.isArray(o)?Object.assign(n,{[i]:r[i]}):i in e?n[i]=(0,t.mergeStylesObjects)(e[i],r[i]):Object.assign(n,{[i]:r[i]})})),n}},55776:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.makeStyles=t.mergeStyles=t.useStyles=void 0;const n=r(31635),i=r(6344),o=n.__importDefault(r(29545)),a=n.__importDefault(r(18483)),s=n.__importDefault(r(589)),l=r(89926),c=r(66652),u=r(48923),d=(0,i.create)({plugins:[(0,o.default)(),(0,s.default)(),(0,a.default)()]});t.useStyles=({target:e,source:t},r)=>{const n=(0,c.mergeStylesObjects)(null!=e?e:{},null!=t?t:{}),i=d.createStyleSheet(n,{classNamePrefix:`${u.videoStylesNamespace}-${r}-`});return(0,l.useLayoutEffect)((()=>(i.attach(),()=>{i.detach()})),[i]),Object.keys(i.classes).reduce(((e,t)=>({...e,[t]:`${i.classes[t]}`})),{})},t.mergeStyles=t.useStyles,t.makeStyles=(e,r)=>(0,t.useStyles)({target:e,source:{}},r.classNamePrefix)},97878:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=n.__importDefault(r(89926)),o=r(14353),a=r(66652),s=n.__importDefault(r(85331)),l=n.__importDefault(r(16312));t.default=({children:e,classes:t={},active:r,setActive:n,...c})=>{const u=(0,o.useStyles)({source:t,target:s.default},"alertBase"),d=(0,a.mergeStylesObjects)(t,s.default);return i.default.createElement("div",{className:`${u.root} ${r&&"open"}`,...c},i.default.createElement("div",{className:u.inner},e),i.default.createElement(l.default,{onClick:()=>n(!1),open:r,classes:{root:d.closeButton}}))}},85331:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={root:{alignItems:"center",backgroundColor:"#F8FA8F",display:"flex",flexWrap:"wrap",justifyContent:"center",margin:"0.5rem auto",width:"100%",position:"absolute",borderRadius:"4px",fontFamily:"sans-serif",fontSize:"1.5rem",overflow:"hidden",transition:"all .5s ease-in-out",height:"0","&.open":{height:"auto",zIndex:"200"}},inner:{padding:"1rem"},closeButton:{width:"10px",position:"absolute",right:"0",top:"0",margin:"10px"}}},18261:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=n.__importDefault(r(89926)),o=r(55776),a=n.__importDefault(r(75372)),s=n.__importDefault(r(69206));t.default=function({classes:e={root:{},icon:{}},muted:t,icon:r=(t?i.default.createElement(a.default,{iconName:"microphoneoff",title:"Muted",classes:e.icon}):i.default.createElement(a.default,{iconName:"microphone",title:"Unmuted",classes:e.icon})),classNames:n,render:l,style:c,color:u="black",height:d,width:h,activeColor:p="red"}){(null==e?void 0:e.root)&&(e.root["& svg"]={color:t?p:null!=u?u:"",height:null!=d?d:"1.5rem",width:null!=h?h:"1.5rem"}),null!=(null==e?void 0:e.root)&&(e.root["&.muted & svg"]={color:p});const f=(0,o.useStyles)({source:e,target:s.default},"peerMutedBadge");return i.default.createElement("span",{className:`${f.root} ${t&&"muted"} ${n}`,style:c},l?l(t):r)}},69206:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={root:{alignContent:"center",backgroundColor:"transparent",color:"#f5f5f5",border:"none",cursor:"none",display:"flex",flex:"initial",height:"2rem",justifyContent:"center",marginLeft:".5rem",marginRight:".5rem",padding:"0",position:"absolute",transitionDuration:".15s",transitionProperty:"color, background-color, border",transitionTimingFunction:"linear",width:"2rem"}}},16312:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=n.__importStar(r(89926)),o=r(55776),a=n.__importDefault(r(75372)),s=n.__importDefault(r(77116));t.default=function({onClick:e,active:t=null,classes:r={},icon:n,open:l,iconColor:c,label:u,id:d,activeId:h,inActiveId:p,...f}){const m=(0,o.useStyles)({source:r,target:s.default},"closeButton"),g=n||i.default.createElement(a.default,{iconName:"close",classes:r.icon,style:{height:"16px"}});return(0,i.useEffect)((()=>{const t=t=>{"Escape"===t.key&&!0===l&&null!=e&&e()};return window.addEventListener("keydown",t,!1),()=>{window.removeEventListener("keydown",t,!1)}}),[e,l]),i.default.createElement("button",{title:null!=u?u:"close button",className:`${m.root} close`,onClick:null!=e?e:void 0,"data-selenium":"close-button",id:d,"data-active-id":null!=t&&h,"data-inactive-id":null==t&&p,...f},g)}},77116:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={root:{alignContent:"center",backgroundColor:"#f5f5f5",color:e=>e||"#525252",cursor:"pointer",justifyContent:"center",padding:"0",transitionDuration:".15s",transitionProperty:"color, background-color, border",transitionTimingFunction:"linear","&.close":{background:"none",border:"none",display:"inline-block",textDecoration:"none","-webkit-appearance":"none"},"& svg":{width:"15px"}}}},62717:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=n.__importStar(r(89926)),o=r(57004),a=r(55776),s=n.__importDefault(r(49055)),l=(0,i.forwardRef)((({active:e=!0,children:t,activeClass:r="video-button--on lv-button--on",inactiveClass:n="video-button--off lv-button--off",classes:l={},classNames:c="",disabled:u=!1,icon:d,label:h="Default Button",onClick:p,style:f={},id:m,activeId:g,inActiveId:v,...y},b)=>{var _,S,w,E;const C=(0,i.useContext)(o.PlayerUiContext),O=(0,i.useContext)(o.EncoderUiContext);let P;P=O?(0,s.default)(null!==(_=null==O?void 0:O.mobileDevice)&&void 0!==_&&_):(0,s.default)(null!==(S=null==C?void 0:C.mobileDevice)&&void 0!==S&&S);const T=(0,a.useStyles)({source:l,target:P},"videoIconButton");let k;return void 0!==h&&(k=h.replace(/\s+/g,"-").toLowerCase()),i.default.createElement("button",{"aria-label":h,className:`${T.root} ${e?null!=r?r:"":null!=n?n:""} ${c&&c}`,"data-icon-button":null!==(E=null===(w=null==d?void 0:d.props)||void 0===w?void 0:w.iconName)&&void 0!==E?E:"","data-selenium":`${h&&k}-button`,disabled:u,onClick:null!=p?p:void 0,ref:b,type:"button",title:h,id:m,"data-active-state-id":e?g:v,...y},null!=d&&d)}));l.displayName="ButtonIcon",t.default=l},49055:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=e=>({root:{display:"flex!important",justifyContent:"center",alignItems:"center",backgroundColor:"transparent",borderRadius:"7px",color:"#344054",cursor:"pointer",height:"40px",width:"40px",marginLeft:e?5:"none",marginRight:e?5:"none",outline:"none",transitionDuration:".15s",transitionProperty:"color, background-color, border",transitionTimingFunction:"linear",border:"1px solid #D0D5DD",boxShadow:"0px 1px 2px rgba(16, 24, 40, 0.05)",padding:"0.375rem","&:disabled":{color:"#ff6565",opacity:.5,cursor:"not-allowed"},"&.custom":{backgroundColor:"transparent"},"&.video-button--on":{color:"#344054"},"&.video-button--off":{color:"#ff6565"},"&.video-button--active":{backgroundColor:"#ff6565",color:"#344054"},"&.video-button--get-sound":{position:"absolute",zIndex:130,left:0},"&.video-push-left":{marginLeft:"auto"},"&.video-push-right":{marginRight:"auto"},"&.lv-button--on":{color:"#344054"},"&.lv-button--off":{color:"#ff6565"},"&.lv-button--active":{backgroundColor:"#ff6565",color:"#344054"},"&.lv-button--get-sound":{position:"absolute",zIndex:130,left:0},"&.lv-push-left":{marginLeft:"auto"},"&.lv-push-right":{marginRight:"auto"}}})},75659:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=n.__importStar(r(89926)),o=r(55776),a=n.__importDefault(r(30837)),s=n.__importDefault(r(75372)),l=(0,i.forwardRef)((({active:e=!0,activeClass:t="video-button--on lv-button--on",inactiveClass:r="video-button--off lv-button--off",classes:n={root:{},icon:{}},classNames:l="",disabled:c=!1,label:u="Default Button",icon:d,onClick:h,style:p={},id:f,activeId:m,inActiveId:g,...v},y)=>{const b=(0,o.useStyles)({source:n,target:a.default},"videoJoinBroadcastButton");let _;void 0!==u&&(_=u.replace(/\s+/g,"-").toLowerCase());const S=null!=d?d:i.default.createElement(s.default,{iconName:"broadcast",classes:n.icon});return i.default.createElement("button",{"aria-label":u,className:`${b.root} ${e?null!=t?t:"":null!=r?r:""} ${l&&l}`,"data-selenium":`${u&&_}-button`,disabled:c,onClick:null!=h?h:void 0,ref:y,type:"button",title:u,id:f,"data-active-state-id":e?m:g,"data-icon-button":"broadcast",...v},e?"End Broadcast":i.default.createElement(i.default.Fragment,null,S,i.default.createElement("span",null,"Broadcast")))}));l.displayName="JoinBroadcastButton",t.default=l},30837:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={root:{display:"flex !important",justifyContent:"center",alignItems:"center",gap:"0.5rem",fontSize:"12px",fontWeight:600,borderRadius:"7px",color:"#ffffff",background:"#175CD3",cursor:"pointer",outline:"none",transitionDuration:".15s",transitionProperty:"color, background-color, border",transitionTimingFunction:"linear",border:"1px solid #D0D5DD",boxShadow:"0px 1px 2px rgba(16, 24, 40, 0.05)",padding:"0.375rem 1rem","&:disabled":{opacity:.5,cursor:"not-allowed"},"&.custom":{backgroundColor:"transparent"},"&.video-button--on":{color:"#B42318"},"&.video-button--off":{color:"#ff6565"},"&.video-button--active":{color:"#B42318"},"&.video-button--get-sound":{position:"absolute",zIndex:130,left:0},"&.video-push-left":{marginLeft:"auto"},"&.video-push-right":{marginRight:"auto"},"&.lv-button--on":{color:"#B42318"},"&.lv-button--off":{color:"#ff6565"},"&.lv-button--active":{backgroundColor:"#D31717",color:"#ffffff",border:"1px solid #D31717"},"&.lv-push-left":{marginLeft:"auto"},"&.lv-push-right":{marginRight:"auto"}}}},82111:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=n.__importStar(r(89926)),o=r(55776),a=n.__importDefault(r(89249)),s=(0,i.forwardRef)((({active:e,buttonText:t="",children:r,classes:n={},classNames:s="",disabled:l=!1,label:c="Default Button",onClick:u,style:d={},id:h,activeId:p,inActiveId:f,...m},g)=>{const v=(0,o.useStyles)({source:n,target:a.default},"button-text");let y;return void 0!==c&&(y=c.replace(/\s+/g,"-").toLowerCase()),i.default.createElement("button",{title:c,"aria-label":c,className:`${v.root} ${e||""} ${s&&s}`,"data-selenium":`${c&&y}-button`,disabled:l,onClick:u,ref:g,style:d,type:"button",id:h,"data-active-state-id":e?p:f,...m},r)}));s.displayName="ButtonText",t.default=s},89249:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={root:{borderRadius:"0.375rem",backgroundColor:"#F9FAFB",border:"1px solid #D0D5DD",color:"#344054",cursor:"pointer",fontSize:"14px",height:"auto",padding:"10px 20px",fontWeight:600,width:"100%"}}},67028:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=n.__importStar(r(89926)),o=r(12013),a=n.__importDefault(r(86711)),s=n.__importDefault(r(45030)),l=r(14353),c=r(66652),u=n.__importDefault(r(90288));t.default=function({classes:e={screenCaptureButton:{},settingsButton:{},cameraButton:{},microphoneButton:{}},renderCustomControls:t,renderCallMetaDisplay:r}){const[n,d]=(0,i.useState)(!1),[h,p]=(0,i.useState)(!1),f=(0,c.mergeStylesObjects)(u.default,e),m=(0,l.useStyles)({source:e,target:u.default},"callControlUi");return i.default.createElement("div",{className:m.root,onBlur:()=>{d(!1),p(!1)},onFocus:()=>{d(!0)},onMouseOver:()=>{d(!0)},onMouseLeave:()=>{d(!1),p(!1)}},i.default.createElement("div",{className:m.videoContainer,style:{height:n?"100%":void 0}},i.default.createElement(o.EncoderVideo,{classes:f.videoWrapper})),i.default.createElement("div",{className:m.controlsContainer,style:{display:!0===n?"block":"none"}},null==t?void 0:t(),!t&&i.default.createElement("div",{className:m.buttonsContainer},i.default.createElement(o.ScreenCaptureButton,{classes:f.screenCaptureButton}),i.default.createElement(o.SettingsButton,{classes:f.settingsButton,onClick:()=>{p(!h)}}),i.default.createElement(o.CameraButton,{classes:f.cameraButton}),i.default.createElement(o.MicrophoneButton,{classes:f.microphoneButton})),null==r?void 0:r(),h&&i.default.createElement("div",{className:m.settingsContainer},i.default.createElement(s.default,{classes:f.videoDeviceSelect}),i.default.createElement(a.default,{classes:f.audioDeviceSelect}))))}},90288:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r={root:{color:"white",height:"32px",width:"32px",display:"inline",marginRight:"0",background:"#357793",backgroundColor:"#357793",border:"none",borderRadius:"5px !important"},svg:{height:"32px",width:"32px"}},n={root:{height:"25%",width:"25%",position:"absolute",top:0,right:0},controlsContainer:{backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)",boxSizing:"border-box",justifyContent:"space-between",background:"rgba(0, 0, 0, 0.73)",borderBottomLeftRadius:"20px",borderBottomRightRadius:"20px",position:"absolute",top:"110px",left:"5px",maxWidth:"190px",padding:"25px 10px",width:"95%",zIndex:0,transition:"all .225s"},settingsButton:r,cameraButton:r,microphoneButton:r,screenCaptureButton:{...r,svg:{height:"20px",width:"20px",verticalAlign:"sub"}},audioDeviceSelect:{root:{color:"white",height:"60px"},select:{fontSize:"12px"},label:{fontFamily:"sans-serif"}},videoDeviceSelect:{root:{color:"white",height:"60px"},select:{fontSize:"12px"},label:{fontFamily:"sans-serif"}},settingsContainer:{root:{display:"flex",marginTop:"25%",flexDirection:"column",padding:"0 10px"}},buttonsContainer:{display:"flex",justifyContent:"space-between",marginBottom:"15px"},videoContainer:{width:"100%",borderRadius:"20px",overflow:"hidden",position:"relative",zIndex:2,maxWidth:"190px",left:"5px",top:"3px",transition:"all .225s"}};t.default=n},29347:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=n.__importStar(r(89926)),o=r(14353),a=n.__importStar(r(40141)),s=n.__importDefault(r(8575)),l=n.__importDefault(r(54277));t.default=function({classes:e,itemsPerSlide:t=3,gap:r=10,children:n,vertical:c=!0}){const u=(0,o.useStyles)({target:null!=e?e:{},source:a.default},"carousel"),d=(0,i.useRef)(null),[h,p]=(0,i.useState)(0),[f,m]=(0,i.useState)(0),[g,v]=(0,i.useState)(!0),y=(0,l.default)("screen and (max-width: 1023px)")?t/2:t,b=!Array.isArray(n)||n.length-y<0?0:n.length-y,_=b===h,S=0===h,w=Array.isArray(n)&&n.length>y;b{if(!d.current)return;const e=d.current.offsetHeight,t=d.current.offsetWidth;if(c){if(0===e)return;m((e-r*(y-1))/y)}else{if(0===t)return void console.error("Carousel component must be placed inside a fixed width container.");m((t-r*(y-1))/y)}}),[c,y,r]);return(0,i.useEffect)((()=>{if(!d.current)return()=>{};E();const e=new ResizeObserver(E);return e.observe(d.current),()=>{e.disconnect()}}),[E]),(0,i.useEffect)((()=>{setTimeout((()=>v(!1)),10)}),[f]),i.default.createElement("div",{className:u.root,style:(0,a.getRootStyles)(c)},i.default.createElement("button",{type:"button",className:u.carouselButton,onClick:()=>{p((e=>{const t=e-1;return t<0?e:t}))},style:(0,a.getButtonStyles)(c,S,w)},i.default.createElement(s.default,{style:(0,a.getChevronStyles)(c,w,"up")})),i.default.createElement("div",{ref:d,className:u.slidesWrapper},i.default.createElement("div",{className:u.carouselSlidesWrapper,style:(0,a.getCarouselSlidesWrapperStyles)(c,r)},i.Children.map(n,((e,t)=>i.default.createElement("div",{className:u.carouselItem,style:(0,a.getCarouselSlideStyles)({carouselDrivingDimension:f,currentIndex:h,isVertical:c,gap:r,isLoading:g})},e))))),i.default.createElement("button",{type:"button",className:u.carouselButton,onClick:()=>{Array.isArray(n)&&p((e=>{const t=e+1;return t>n.length-y?e:t}))},style:(0,a.getButtonStyles)(c,_,w)},i.default.createElement(s.default,{style:(0,a.getChevronStyles)(c,w,"down")})))}},40141:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getCarouselSlideStyles=t.getCarouselSlidesWrapperStyles=t.getChevronStyles=t.getButtonStyles=t.getRootStyles=void 0,t.getRootStyles=e=>({...e&&{gridTemplateRows:"auto 1fr auto"},...!e&&{gridTemplateColumns:"auto 1fr auto"}}),t.getButtonStyles=(e,t,r)=>({...t&&{backgroundColor:"rgba(0,0,0, 0.6)",pointerEvents:"none",color:"#aeafaf"},...!e&&{height:"100%",width:"1.5rem"},...!r&&{height:"0px",width:"0px"}}),t.getChevronStyles=(e,t,r)=>({width:"1rem",...e&&"up"===r&&{transform:"rotateZ(180deg)"},...!e&&"up"===r&&{transform:"rotateZ(90deg)"},...!e&&"down"===r&&{transform:"rotateZ(-90deg)"},...!t&&{display:"none"}}),t.getCarouselSlidesWrapperStyles=(e,t)=>({gap:`${t}px`,...e&&{width:"100%",flexDirection:"column"},...!e&&{height:"100%",flexDirection:"row"}}),t.getCarouselSlideStyles=({isVertical:e,isLoading:t,carouselDrivingDimension:r,gap:n,currentIndex:i})=>({position:"relative",...!t&&{transition:"0.5s ease-in-out"},...e&&{transform:`translate3d(0px, -${i*r+n*i}px, 0px)`,height:`${r}px`},...!e&&{transform:`translate3d(-${i*r+n*i}px, 0px, 0px)`,width:`${r}px`,height:"100%"}}),t.default={root:{display:"grid",height:"100%"},slidesWrapper:{position:"relative",overflow:"hidden",width:"100%"},carouselSlidesWrapper:{position:"absolute",top:0,left:0,display:"flex"},carouselItem:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%"},carouselButton:{zIndex:10,width:"100%",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(0,0,0, 0.3)",color:"#fff",height:"1.5rem"}}},59537:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635).__importDefault(r(89926)),i=r(12809),o=r(84603),a=r(14353),s=(0,i.observer)((({classes:e})=>{const t=(0,a.useStyles)({target:null!=e?e:{},source:o.carouselPlayingOverlayStyles},"carousel-playing-overlay");return n.default.createElement("div",{className:t.root})}));t.default=s},84603:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.carouselPlayingOverlayStyles=void 0,t.carouselPlayingOverlayStyles={root:{position:"absolute",top:0,left:0,height:"inherit",width:"100%",border:"solid 3px #E5B711"}}},21639:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=n.__importDefault(r(89926)),o=r(12809),a=r(14353),s=r(91433),l=n.__importDefault(r(24420)),c=(0,o.observer)((({classes:e,onClick:t})=>{const r=(0,a.useStyles)({target:null!=e?e:{},source:s.carouselAddButtonStyles},"carousel-add-button");return i.default.createElement("button",{type:"button",onClick:t,className:r.root},i.default.createElement(l.default,{weight:"normal",className:r.icon}))}));t.default=c},91433:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.carouselAddButtonStyles=t.buttonStyles=void 0,t.buttonStyles={position:"absolute",top:0,right:0,width:"1.5rem",height:"1.5rem",color:"#fff",display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:"rgba(220, 175, 15, 0.7)",borderBottomLeftRadius:"15px",border:"1px solid #fff",paddingBottom:"0.15rem",zIndex:1},t.carouselAddButtonStyles={root:t.buttonStyles,icon:{width:"15px",transform:"rotateZ(45deg)",marginLeft:"3px"}}},40262:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=n.__importDefault(r(89926)),o=r(12809),a=r(52570),s=r(14353),l=n.__importDefault(r(69381)),c=r(53315),u=(0,o.observer)((({classes:e,posterUrl:t})=>{const[r,n]=(0,c.usePosterImage)(null!=t?t:""),o=(0,s.useStyles)({target:null!=e?e:{},source:a.posterImageStyles},"carousel-poster-image");return null==t||r?i.default.createElement("div",{className:o.stockImageWrapper},i.default.createElement(l.default,{className:o.cameraIcon,outline:!0})):i.default.createElement("img",{className:o.image,src:t,alt:"video-poster",onError:()=>n(!0)})}));t.default=u},52570:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.posterImageStyles=void 0,t.posterImageStyles={image:{height:"inherit",width:"100%",objectFit:"cover"},stockImageWrapper:{height:"inherit",width:"100%",display:"flex",justifyContent:"center",alignItems:"center"},cameraIcon:{width:"30%"}}},83004:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=n.__importDefault(r(89926)),o=r(12809),a=r(14353),s=r(96984),l=n.__importDefault(r(24420)),c=(0,o.observer)((({classes:e,onClick:t})=>{const r=(0,a.useStyles)({target:null!=e?e:{},source:s.carouselRemoveButtonStyles},"carousel-remove-button");return i.default.createElement("button",{type:"button",onClick:t,className:r.root},i.default.createElement(l.default,{weight:"normal",className:r.icon}))}));t.default=c},96984:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.carouselRemoveButtonStyles=void 0;const n=r(91433);t.carouselRemoveButtonStyles={root:n.buttonStyles,icon:{width:"15px",marginLeft:"3px"}}},15343:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635).__importDefault(r(89926)),i=r(12809),o=r(28046),a=r(99185),s=r(14353),l=(0,i.observer)((({onClick:e,onKeydown:t,children:r,classes:i})=>{const l=(0,s.useStyles)({target:null!=i?i:{},source:a.carouselSlideWrapperStyles},"carousel-slide-wrapper");return n.default.createElement("div",{className:l.root,onClick:e,onKeyDown:t,tabIndex:0,role:"button",style:{cursor:o.adapter.device.isMobileDevice?"pointer":"default"}},r)}));t.default=l},99185:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.carouselSlideWrapperStyles=void 0,t.carouselSlideWrapperStyles={root:{height:"inherit",width:"100%",position:"relative"}}},18185:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=n.__importDefault(r(89926)),o=r(12809),a=r(71539),s=r(14353),l=n.__importDefault(r(5737)),c=(0,o.observer)((({classes:e,viewCount:t})=>{const r=(0,s.useStyles)({target:null!=e?e:{},source:a.viewCountStyles},"view-count");return i.default.createElement("div",{className:r.root},i.default.createElement(l.default,{className:r.eyeIcon}),i.default.createElement("span",null,t))}));t.default=c},71539:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.viewCountStyles=void 0,t.viewCountStyles={root:{position:"absolute",padding:"0.2rem 0.8rem",color:"#fff",display:"flex",gap:"0.7rem",justifyContent:"space-between",alignItems:"center",background:"rgba(29, 29, 29, 0.4)",backdropFilter:"blur(3.40008px)",border:"1px solid #fff",borderRadius:"1.36px",bottom:5,right:5},eyeIcon:{width:"15px",marginRight:"3px",height:"11px"}}},42168:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=r(12809),o=n.__importDefault(r(89926)),a=r(55776),s=n.__importDefault(r(89948)),l=(0,i.observer)((({children:e,classes:t={},variant:r,...n})=>{const i=(0,a.useStyles)({source:t,target:s.default},"controlBar"),l={player:i["controls--player"],encoder:i["controls--encoder"],mini:i["controls--mini"]};return o.default.createElement("div",{className:`${i.root} ${l[r]}`},o.default.createElement("div",{className:i.controls},e))}));t.default=l},89948:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={root:{width:"100%",zIndex:130,position:"relative"},controls:{display:"flex",flexWrap:"wrap",justifyContent:"space-between",height:"fit-content",gap:"0.25rem",alignItems:"center",backgroundColor:"#ffffff",opacity:1,padding:"0.5rem",border:"1px solid #D0D5DD",borderRadius:"0 0 7px 7px","& button":{display:"block"},"&.video-controls--hidden":{opacity:0,transitionDelay:"500ms"},"&.lv-controls--hidden":{opacity:0,transitionDelay:"500ms"}},"video::-webkit-media-controls":{display:"none!important","-webkit-appearance":"none"},"video::-moz-media-controls":{display:"none!important","-webkit-appearance":"none"}}},47939:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=r(12809),o=n.__importDefault(r(89926)),a=r(55776),s=n.__importDefault(r(10093)),l=(0,i.observer)((({children:e,classes:t={}})=>{const r=(0,a.useStyles)({source:t,target:s.default},"controlBarSection");return o.default.createElement("div",{className:r.root},e)}));t.default=l},10093:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={root:{display:"flex",flex:1,gap:"0.5rem",height:"100%",alignItems:"center",justifyContent:"flex-start"}}},37596:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=n.__importDefault(r(89926)),o=r(55776),a=n.__importDefault(r(74890)),s=n.__importDefault(r(76312));t.default=({children:e,classes:t={},...r})=>{const n=(0,o.useStyles)({source:t,target:s.default},"durationLabel");return i.default.createElement("div",{className:n.root},i.default.createElement(a.default,null))}},76312:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={"svg:not(:root)":{overflow:"hidden"},root:{borderRadius:"10rem",color:"#fff",display:"flex",flexDirection:"row",position:"absolute",left:"50%",top:"3rem",backgroundColor:"rgba(0, 0, 0, 0.66)",padding:".375rem .625rem",transform:"translate(-50%, -50%)",zIndex:130,"&.video-icon":{display:"block",width:"14px",height:"14px",marginRight:"0.5rem"},"&.video-time":{lineHeight:1.1,fontSize:".75rem"},"&.lv-icon":{display:"block",width:"14px",height:"14px",marginRight:"0.5rem"},"&.lv-time":{lineHeight:1.1,fontSize:".75rem"}}}},9644:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useGridRerender=void 0;const n=r(89926),i=r(86729),o=r(57004),a=r(44105);t.useGridRerender=()=>{const e=(0,n.useContext)(o.MultistreamContext),[t,r]=(0,n.useState)(!1),{width:s,height:l}=(0,a.useRefDimensions)(null==e?void 0:e.playersWrapperElement);return(0,n.useEffect)((()=>{const e=()=>{r((e=>!e))};return i.device.addEventListener("resize",e),e(),()=>i.device.removeEventListener("resize",e)}),[s,l]),t}},54277:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(86729),i=r(89926);t.default=e=>{const[t,r]=(0,i.useState)((()=>!1));return(0,i.useEffect)((()=>{if(n.device.isImplements(n.Feature.MATCH_MEDIA)){const t=n.device.matchMedia(e),i=e=>{r(e.matches)};return t.addEventListener("change",i),r(t.matches),()=>{t.removeEventListener("change",i)}}return()=>{}}),[e]),t}},53315:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.usePosterImage=void 0;const n=r(89926);t.usePosterImage=e=>{const[t,r]=(0,n.useState)(!1);return(0,n.useEffect)((()=>{let n=null;return t&&(n=setInterval((()=>{const t=new Image;t.onload=()=>{r(!1),document.body.removeChild(t),null!=n&&clearInterval(n)},t.src=null!=e?e:"",t.style.display="none",document.body.appendChild(t)}),2e3)),()=>{n&&clearInterval(n)}}),[t,e]),[t,r]}},44105:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useRefDimensions=void 0;const n=r(89926);t.useRefDimensions=e=>{const[t,r]=(0,n.useState)({width:0,height:0});return(0,n.useEffect)((()=>{const t=e,n=new ResizeObserver((e=>{const{width:t,height:n}=e[0].contentRect;r({width:Math.round(t),height:Math.round(n)})}));return(null==t?void 0:t.current)&&n.observe(t.current),()=>{(null==t?void 0:t.current)&&n.unobserve(t.current)}}),[e]),t}},77095:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635).__importDefault(r(89926));t.default=function({className:e,...t}){return n.default.createElement("svg",{"aria-hidden":"true",className:`${null!=e&&e}`,"data-icon":"broadcast",focusable:"false",role:"img",viewBox:"0 0 18 13",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},n.default.createElement("path",{d:"M12.3941 3.19999C14.2686 5.02253 14.2686 7.97744 12.3941 9.79997M5.60589 9.79994C3.73137 7.97741 3.73137 5.0225 5.60589 3.19997M3.34315 12C0.218951 8.96241 0.218951 4.03756 3.34315 1M14.6569 1.00004C17.781 4.03759 17.781 8.96244 14.6569 12M10.6 6.49998C10.6 7.35913 9.88366 8.05561 9 8.05561C8.11634 8.05561 7.4 7.35913 7.4 6.49998C7.4 5.64083 8.11634 4.94435 9 4.94435C9.88366 4.94435 10.6 5.64083 10.6 6.49998Z",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))}},69381:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635).__importDefault(r(89926));t.default=function({className:e,...t}){return n.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",className:`${null!=e&&e}`,fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,"data-icon":"camera-on",stroke:"currentColor","aria-hidden":"true","data-slot":"icon",role:"img",...t},n.default.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m15.75 10.5 4.72-4.72a.75.75 0 0 1 1.28.53v11.38a.75.75 0 0 1-1.28.53l-4.72-4.72M4.5 18.75h9a2.25 2.25 0 0 0 2.25-2.25v-9a2.25 2.25 0 0 0-2.25-2.25h-9A2.25 2.25 0 0 0 2.25 7.5v9a2.25 2.25 0 0 0 2.25 2.25Z"}))}},84108:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635).__importDefault(r(89926));t.default=function({className:e,...t}){return n.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",className:`${null!=e&&e}`,fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",focusable:"false","data-icon":"camera-off","data-slot":"icon",role:"img",...t},n.default.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m15.75 10.5 4.72-4.72a.75.75 0 0 1 1.28.53v11.38a.75.75 0 0 1-1.28.53l-4.72-4.72M12 18.75H4.5a2.25 2.25 0 0 1-2.25-2.25V9m12.841 9.091L16.5 19.5m-1.409-1.409c.407-.407.659-.97.659-1.591v-9a2.25 2.25 0 0 0-2.25-2.25h-9c-.621 0-1.184.252-1.591.659m12.182 12.182L2.909 5.909M1.5 4.5l1.409 1.409"}))}},8575:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635).__importDefault(r(89926));t.default=function(e){return n.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","data-icon":"chevron-down",...e},n.default.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"}))}},74890:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635).__importDefault(r(89926));t.default=function({className:e}){return n.default.createElement("svg",{"aria-hidden":"true",className:`${null!=e&&e}`,"data-icon":"clock",focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 200 200"},n.default.createElement("path",{fill:"currentColor",d:"M99 3.09375C46.0195 3.09375 3.09375 46.0195 3.09375 99C3.09375 151.98 46.0195 194.906 99 194.906C151.98 194.906 194.906 151.98 194.906 99C194.906 46.0195 151.98 3.09375 99 3.09375ZM99 176.344C56.2676 176.344 21.6562 141.732 21.6562 99C21.6562 56.2676 56.2676 21.6562 99 21.6562C141.732 21.6562 176.344 56.2676 176.344 99C176.344 141.732 141.732 176.344 99 176.344ZM122.899 135.97L90.0668 112.11C88.868 111.22 88.1719 109.828 88.1719 108.359V44.8594C88.1719 42.307 90.2602 40.2188 92.8125 40.2188H105.188C107.74 40.2188 109.828 42.307 109.828 44.8594V99.6574L135.661 118.452C137.749 119.96 138.175 122.861 136.666 124.949L129.396 134.965C127.888 137.014 124.987 137.479 122.899 135.97Z"}))}},24420:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635).__importDefault(r(89926));t.default=function({className:e,style:t,weight:r,...i}){return"normal"===r?n.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:`${null!=e&&e}`,"data-icon":"close",role:"img",style:{...t}},n.default.createElement("path",{fillRule:"evenodd",d:"M5.47 5.47a.75.75 0 011.06 0L12 10.94l5.47-5.47a.75.75 0 111.06 1.06L13.06 12l5.47 5.47a.75.75 0 11-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 01-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 010-1.06z",clipRule:"evenodd"})):n.default.createElement("svg",{"aria-hidden":"true",className:`${null!=e&&e}`,focusable:"false",role:"img","data-icon":"close",style:{...t},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 352 512",...i},n.default.createElement("path",{fill:"currentColor",d:"M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"}))}},50837:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635).__importDefault(r(89926));t.default=function({className:e,...t}){return n.default.createElement("svg",{"aria-hidden":"true",className:`${null!=e&&e}`,"data-icon":"collapse",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 200 200",...t},n.default.createElement("path",{fill:"currentColor",d:"M166.25 79.6875H127.5C123.344 79.6875 120 76.3646 120 72.2344V33.7266C120 31.677 121.688 30 123.75 30H136.25C138.312 30 140 31.677 140 33.7266V59.8125H166.25C168.312 59.8125 170 61.4895 170 63.5391V75.9609C170 78.0105 168.312 79.6875 166.25 79.6875ZM80 72.2344V33.7266C80 31.677 78.3125 30 76.25 30H63.75C61.6875 30 60 31.677 60 33.7266V59.8125H33.75C31.6875 59.8125 30 61.4895 30 63.5391V75.9609C30 78.0105 31.6875 79.6875 33.75 79.6875H72.5C76.6563 79.6875 80 76.3646 80 72.2344ZM80 165.398V126.891C80 122.76 76.6563 119.438 72.5 119.438H33.75C31.6875 119.438 30 121.114 30 123.164V135.586C30 137.636 31.6875 139.312 33.75 139.312H60V165.398C60 167.448 61.6875 169.125 63.75 169.125H76.25C78.3125 169.125 80 167.448 80 165.398ZM140 165.398V139.312H166.25C168.312 139.312 170 137.636 170 135.586V123.164C170 121.114 168.312 119.438 166.25 119.438H127.5C123.344 119.438 120 122.76 120 126.891V165.398C120 167.448 121.688 169.125 123.75 169.125H136.25C138.312 169.125 140 167.448 140 165.398Z"}))}},91998:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635).__importDefault(r(89926));t.default=function({className:e,...t}){return n.default.createElement("svg",{"aria-hidden":"true",className:`${null!=e&&e}`,"data-icon":"configuration",focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 200 200",...t},n.default.createElement("path",{fill:"currentColor",d:"M164.525 134.286H74.75V130C74.75 127.643 72.8262 125.714 70.475 125.714H61.925C59.5737 125.714 57.65 127.643 57.65 130V134.286H36.275C33.9237 134.286 32 136.214 32 138.571V147.143C32 149.5 33.9237 151.429 36.275 151.429H57.65V155.714C57.65 158.071 59.5737 160 61.925 160H70.475C72.8262 160 74.75 158.071 74.75 155.714V151.429H164.525C166.876 151.429 168.8 149.5 168.8 147.143V138.571C168.8 136.214 166.876 134.286 164.525 134.286ZM164.525 91.4286H143.15V87.1429C143.15 84.7857 141.226 82.8571 138.875 82.8571H130.325C127.974 82.8571 126.05 84.7857 126.05 87.1429V91.4286L36.275 91.4286C33.9237 91.4286 32 93.3571 32 95.7143V104.286C32 106.643 33.9237 108.571 36.275 108.571L126.05 108.571V112.857C126.05 115.214 127.974 117.143 130.325 117.143H138.875C141.226 117.143 143.15 115.214 143.15 112.857V108.571H164.525C166.876 108.571 168.8 106.643 168.8 104.286V95.7143C168.8 93.3571 166.876 91.4286 164.525 91.4286ZM164.525 48.5714L108.95 48.5714V44.2857C108.95 41.9286 107.026 40 104.675 40L96.125 40C93.7737 40 91.85 41.9286 91.85 44.2857V48.5714L36.275 48.5714C33.9237 48.5714 32 50.5 32 52.8571V61.4286C32 63.7857 33.9237 65.7143 36.275 65.7143L91.85 65.7143V70C91.85 72.3571 93.7737 74.2857 96.125 74.2857L104.675 74.2857C107.026 74.2857 108.95 72.3571 108.95 70V65.7143L164.525 65.7143C166.876 65.7143 168.8 63.7857 168.8 61.4286V52.8571C168.8 50.5 166.876 48.5714 164.525 48.5714Z"}))}},26022:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635).__importDefault(r(89926));t.default=function({className:e,...t}){return n.default.createElement("svg",{"aria-hidden":"true",className:`${null!=e&&e}`,"data-icon":"expand",focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 200 200",...t},n.default.createElement("path",{fill:"currentColor",d:"M30 75.9609V37.4531C30 33.3229 33.3437 30 37.5 30H76.25C78.3125 30 80 31.677 80 33.7266V46.1484C80 48.198 78.3125 49.875 76.25 49.875H50V75.9609C50 78.0105 48.3125 79.6875 46.25 79.6875H33.75C31.6875 79.6875 30 78.0105 30 75.9609ZM120 33.7266V46.1484C120 48.198 121.688 49.875 123.75 49.875H150V75.9609C150 78.0105 151.688 79.6875 153.75 79.6875H166.25C168.312 79.6875 170 78.0105 170 75.9609V37.4531C170 33.3229 166.656 30 162.5 30H123.75C121.688 30 120 31.677 120 33.7266ZM166.25 119.438H153.75C151.688 119.438 150 121.114 150 123.164V149.25H123.75C121.688 149.25 120 150.927 120 152.977V165.398C120 167.448 121.688 169.125 123.75 169.125H162.5C166.656 169.125 170 165.802 170 161.672V123.164C170 121.114 168.312 119.438 166.25 119.438ZM80 165.398V152.977C80 150.927 78.3125 149.25 76.25 149.25H50V123.164C50 121.114 48.3125 119.438 46.25 119.438H33.75C31.6875 119.438 30 121.114 30 123.164V161.672C30 165.802 33.3437 169.125 37.5 169.125H76.25C78.3125 169.125 80 167.448 80 165.398Z"}))}},5737:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635).__importStar(r(89926));t.default=e=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none","data-icon":"eye",...e},n.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.295,d:"M1.622 6.046c-.088-.14-.132-.21-.157-.318a.76.76 0 0 1 0-.289c.025-.108.069-.177.157-.317C2.351 3.968 4.52 1.05 7.826 1.05c3.306 0 5.476 2.918 6.205 4.072.088.14.132.21.157.317a.761.761 0 0 1 0 .29c-.025.107-.07.177-.157.317-.73 1.154-2.899 4.071-6.205 4.071S2.351 7.2 1.622 6.046Z"}),n.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.295,d:"M7.826 7.527a1.943 1.943 0 1 0 0-3.886 1.943 1.943 0 0 0 0 3.886Z"}))},79571:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635).__importDefault(r(89926));t.default=function({className:e,...t}){return n.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:`${null!=e&&e}`,"data-icon":"fullscreen",focusable:"false",role:"img"},n.default.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15"}))}},85955:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635).__importDefault(r(89926));t.default=function({className:e,...t}){return n.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:`${null!=e&&e}`,"data-icon":"fullscreen-exit",focusable:"false",role:"img"},n.default.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 9V4.5M9 9H4.5M9 9 3.75 3.75M9 15v4.5M9 15H4.5M9 15l-5.25 5.25M15 9h4.5M15 9V4.5M15 9l5.25-5.25M15 15h4.5M15 15v4.5m0-4.5 5.25 5.25"}))}},39197:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635).__importDefault(r(89926));t.default=function({className:e}){return n.default.createElement("svg",{className:`${null!=e&&e}`,"data-icon":"launch-open",focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48"},n.default.createElement("path",{fill:"currentColor",d:"M28.031 6h13.969v13.969h-4.031v-7.125l-19.594 19.594-2.813-2.813 19.594-19.594h-7.125v-4.031zM37.969 37.969v-13.969h4.031v13.969q0 1.594-1.219 2.813t-2.813 1.219h-27.938q-1.688 0-2.859-1.172t-1.172-2.859v-27.938q0-1.688 1.172-2.859t2.859-1.172h13.969v4.031h-13.969v27.938h27.938z"}))}},1166:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635).__importDefault(r(89926));t.default=function({className:e,...t}){return n.default.createElement("svg",{"aria-hidden":"true","data-icon":"microphone-on",focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",className:`${null!=e&&e}`,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,...t},n.default.createElement("title",null,t.title),n.default.createElement("path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z"}),n.default.createElement("path",{d:"M19 10v2a7 7 0 0 1-14 0v-2"}),n.default.createElement("line",{x1:"12",x2:"12",y1:"19",y2:"22"}))}},84485:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635).__importDefault(r(89926));t.default=function({className:e,...t}){return n.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",className:`${null!=e&&e}`,"data-icon":"microphone-off",focusable:"false",role:"img",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"},n.default.createElement("title",null,t.title),n.default.createElement("line",{x1:"2",x2:"22",y1:"2",y2:"22"}),n.default.createElement("path",{d:"M18.89 13.23A7.12 7.12 0 0 0 19 12v-2"}),n.default.createElement("path",{d:"M5 10v2a7 7 0 0 0 12 5"}),n.default.createElement("path",{d:"M15 9.34V5a3 3 0 0 0-5.68-1.33"}),n.default.createElement("path",{d:"M9 9v3a3 3 0 0 0 5.12 2.12"}),n.default.createElement("line",{x1:"12",x2:"12",y1:"19",y2:"22"}))}},43770:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635).__importDefault(r(89926));t.default=function({className:e,...t}){return n.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",className:`${null!=e&&e}`,viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","data-icon":"pause",focusable:"false",role:"img",...t},n.default.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 5.25v13.5m-7.5-13.5v13.5"}))}},91908:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635).__importDefault(r(89926));t.default=function({className:e,...t}){return n.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","data-icon":"play",focusable:"false",role:"img",className:`${null!=e&&e}`,...t},n.default.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5.25 5.653c0-.856.917-1.398 1.667-.986l11.54 6.347a1.125 1.125 0 0 1 0 1.972l-11.54 6.347a1.125 1.125 0 0 1-1.667-.986V5.653Z"}))}},66554:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635).__importDefault(r(89926));t.default=function({className:e,...t}){return n.default.createElement("svg",{viewBox:"0 0 19 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",className:`${null!=e&&e}`,"data-icon":"screen-capture",focusable:"false",role:"img"},n.default.createElement("rect",{width:"17.7778",height:"1.77778",rx:"0.888889",transform:"matrix(1 0 0 -1 0.09375 16)",fill:"#344054"}),n.default.createElement("mask",{id:"path-2-inside-1_3740_3617",fill:"white"},n.default.createElement("path",{d:"M0.09375 1.57377C0.09375 0.704599 0.798349 0 1.66752 0H16.7057C17.5749 0 18.2795 0.704599 18.2795 1.57377V10.8256C18.2795 11.6948 17.5749 12.3994 16.7057 12.3994H1.66751C0.798348 12.3994 0.09375 11.6948 0.09375 10.8256V1.57377Z"})),n.default.createElement("path",{d:"M1.66752 1.3H16.7057V-1.3H1.66752V1.3ZM16.9795 1.57377V10.8256H19.5795V1.57377H16.9795ZM16.7057 11.0994H1.66751V13.6994H16.7057V11.0994ZM1.39375 10.8256V1.57377H-1.20625V10.8256H1.39375ZM1.66751 11.0994C1.51632 11.0994 1.39375 10.9768 1.39375 10.8256H-1.20625C-1.20625 12.4127 0.0803776 13.6994 1.66751 13.6994V11.0994ZM16.9795 10.8256C16.9795 10.9768 16.8569 11.0994 16.7057 11.0994V13.6994C18.2929 13.6994 19.5795 12.4127 19.5795 10.8256H16.9795ZM16.7057 1.3C16.8569 1.3 16.9795 1.42257 16.9795 1.57377H19.5795C19.5795 -0.0133709 18.2929 -1.3 16.7057 -1.3V1.3ZM1.66752 -1.3C0.0803774 -1.3 -1.20625 -0.0133697 -1.20625 1.57377H1.39375C1.39375 1.42257 1.51632 1.3 1.66752 1.3V-1.3Z",fill:"#344054",mask:"url(#path-2-inside-1_3740_3617)"}),n.default.createElement("path",{d:"M9.28066 2.72041L13.1213 5.93073C13.232 6.02325 13.2873 6.06951 13.3076 6.12456C13.3254 6.17288 13.3254 6.22573 13.3076 6.27404C13.2873 6.32909 13.232 6.37535 13.1213 6.46787L9.28066 9.6782C9.09012 9.83746 8.99486 9.91709 8.9142 9.91904C8.84411 9.92074 8.77715 9.89071 8.73285 9.8377C8.68188 9.77671 8.68188 9.65435 8.68188 9.40963V7.55695C8.02827 7.60019 7.3882 7.76428 6.79608 8.04129C6.12449 8.35548 5.53046 8.80752 5.05469 9.36645V9.09585C5.05525 8.04572 5.45224 7.03255 6.16992 6.24965C6.8282 5.53154 7.71402 5.05327 8.68188 4.88815V2.98897C8.68188 2.74425 8.68188 2.62189 8.73285 2.5609C8.77715 2.5079 8.84411 2.47786 8.9142 2.47956C8.99486 2.48151 9.09012 2.56114 9.28066 2.72041Z",stroke:"#344054",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"}))}},81827:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635).__importDefault(r(89926));t.default=function({className:e,...t}){return n.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",className:`${null!=e&&e}`,role:"img","data-icon":"settings",focusable:"false"},n.default.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.343 3.94c.09-.542.56-.94 1.11-.94h1.093c.55 0 1.02.398 1.11.94l.149.894c.07.424.384.764.78.93.398.164.855.142 1.205-.108l.737-.527a1.125 1.125 0 011.45.12l.773.774c.39.389.44 1.002.12 1.45l-.527.737c-.25.35-.272.806-.107 1.204.165.397.505.71.93.78l.893.15c.543.09.94.56.94 1.109v1.094c0 .55-.397 1.02-.94 1.11l-.893.149c-.425.07-.765.383-.93.78-.165.398-.143.854.107 1.204l.527.738c.32.447.269 1.06-.12 1.45l-.774.773a1.125 1.125 0 01-1.449.12l-.738-.527c-.35-.25-.806-.272-1.203-.107-.397.165-.71.505-.781.929l-.149.894c-.09.542-.56.94-1.11.94h-1.094c-.55 0-1.019-.398-1.11-.94l-.148-.894c-.071-.424-.384-.764-.781-.93-.398-.164-.854-.142-1.204.108l-.738.527c-.447.32-1.06.269-1.45-.12l-.773-.774a1.125 1.125 0 01-.12-1.45l.527-.737c.25-.35.273-.806.108-1.204-.165-.397-.505-.71-.93-.78l-.894-.15c-.542-.09-.94-.56-.94-1.109v-1.094c0-.55.398-1.02.94-1.11l.894-.149c.424-.07.765-.383.93-.78.165-.398.143-.854-.107-1.204l-.527-.738a1.125 1.125 0 01.12-1.45l.773-.773a1.125 1.125 0 011.45-.12l.737.527c.35.25.807.272 1.204.107.397-.165.71-.505.78-.929l.15-.894z"}),n.default.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}))}},59335:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635).__importDefault(r(89926));t.default=function({className:e,...t}){return n.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:`${null!=e&&e}`,"data-icon":"sound-on",focusable:"false",role:"img"},n.default.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.114 5.636a9 9 0 0 1 0 12.728M16.463 8.288a5.25 5.25 0 0 1 0 7.424M6.75 8.25l4.72-4.72a.75.75 0 0 1 1.28.53v15.88a.75.75 0 0 1-1.28.53l-4.72-4.72H4.51c-.88 0-1.704-.507-1.938-1.354A9.009 9.009 0 0 1 2.25 12c0-.83.112-1.633.322-2.396C2.806 8.756 3.63 8.25 4.51 8.25H6.75Z"}))}},38366:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635).__importDefault(r(89926));t.default=function({className:e,...t}){return n.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:`${null!=e&&e}`,"data-icon":"sound-off",focusable:"false",role:"img"},n.default.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17.25 9.75 19.5 12m0 0 2.25 2.25M19.5 12l2.25-2.25M19.5 12l-2.25 2.25m-10.5-6 4.72-4.72a.75.75 0 0 1 1.28.53v15.88a.75.75 0 0 1-1.28.53l-4.72-4.72H4.51c-.88 0-1.704-.507-1.938-1.354A9.009 9.009 0 0 1 2.25 12c0-.83.112-1.633.322-2.396C2.806 8.756 3.63 8.25 4.51 8.25H6.75Z"}))}},75372:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=n.__importDefault(r(89926)),o=r(55776),a=n.__importDefault(r(77095)),s=n.__importDefault(r(69381)),l=n.__importDefault(r(84108)),c=n.__importDefault(r(74890)),u=n.__importDefault(r(24420)),d=n.__importDefault(r(50837)),h=n.__importDefault(r(91998)),p=n.__importDefault(r(26022)),f=n.__importDefault(r(1166)),m=n.__importDefault(r(84485)),g=n.__importDefault(r(43770)),v=n.__importDefault(r(91908)),y=n.__importDefault(r(66554)),b=n.__importDefault(r(81827)),_=n.__importDefault(r(59335)),S=n.__importDefault(r(38366)),w=n.__importDefault(r(79571)),E=n.__importDefault(r(85955)),C=n.__importDefault(r(39197)),O=n.__importDefault(r(44968));t.default=function({classes:e={},title:t,iconName:r}){const n={broadcast:a.default,camera:s.default,cameraoff:l.default,clock:c.default,close:u.default,configuration:h.default,collapse:d.default,expand:p.default,fullscreen:w.default,fullscreenexit:E.default,launchopen:C.default,microphone:f.default,microphoneoff:m.default,play:v.default,pause:g.default,screencapture:y.default,settings:b.default,sound:_.default,soundoff:S.default}[r],P=r.toLowerCase(),T=(0,o.useStyles)({source:e,target:O.default},"icons");return i.default.createElement("span",{className:`${T.root}`},i.default.createElement(n,{title:t,className:`${T.icon} ${P}`}))}},44968:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={root:{display:"flex",fill:"currentColor",transition:"fill 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",userSelect:"none",alignItems:"center",width:"100%",height:"100%",justifyContent:"center"},"svg:not(:root)":{overflow:"hidden"},icon:{height:"100%"}}},15554:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=n.__importStar(r(89926)),o=r(27102),a=r(55776),s=n.__importDefault(r(96565));t.default=({classes:e={},label:t,checked:r,id:n,title:l,disabled:c,...u})=>{var d;const[h,p]=(0,i.useState)(r),f=(0,a.useStyles)({source:e,target:s.default},"checkbox"),m=(0,o.useUID)();return i.default.createElement("div",{className:`${f.root} ${f.fields} ${f.checkbox}`},i.default.createElement("label",{htmlFor:m,className:c?`${f.label} ${f.labelDisabled}`:f.label,title:l},i.default.createElement("input",{type:"checkbox",className:`${f.input}`,id:m,"data-selenium":null!==(d=null==u?void 0:u.tag)&&void 0!==d?d:"checkbox-input",onChange:()=>{void 0!==u.onChange&&u.onChange(),p(r)},checked:h,title:l,disabled:c,...u}),t))}},48788:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635).__importStar(r(89926)),i=r(55776),o={pillWrapper:{width:120,position:"relative",borderTop:"1px solid #d1d5db",display:"flex",alignItems:"center",paddingTop:5,paddingRight:10,paddingLeft:10,paddingBottom:5,background:"#ffffff"},pill:{marginLeft:10,position:"relative",display:"flex",alignItems:"center",width:40,height:20,borderRadius:20,background:"#e5e7eb",border:"solid 1px #d1d5db",transition:"all 0.3s ease-in-out"},pillBall:{position:"absolute",height:14,width:14,left:3,borderRadius:100,background:"#ffffff",transition:"all 0.3s ease-in-out",transform:"translate(0px, 0px)"},label:{cursor:"default",fontSize:12,color:"#374151",fontFamily:"Lato, Arial, sans-serif"},activePill:{background:"#175cd3",border:"solid 1px #d1d5db"},activePillBall:{height:14,width:14,borderColor:"#111111",transform:"translate(12px, 0px)",background:"#ffffff"},disabled:{height:"100%",width:"100%",zIndex:999,background:"rgba(81, 81, 81, 0.5)",cursor:"not-allowed",position:"absolute"}};t.default=function({disabled:e,classes:t={},className:r="",label:a,handleClick:s,disabledOff:l,disabledOn:c,isActive:u,...d}){const[h,p]=(0,n.useState)(u),f=(0,i.useStyles)({source:t,target:o},"radio");return(0,n.useEffect)((()=>{void 0!==u&&p(u)}),[u]),n.default.createElement("div",{className:`${f.pillWrapper} ${r}`,style:{cursor:c||l?"not-allowed":"pointer"}},e&&n.default.createElement("div",{className:f.disabled}),n.default.createElement("div",{className:`${f.label} ${r}`}," ",a," "),n.default.createElement("div",{role:"button",tabIndex:e?-1:0,onKeyDown:e=>"Enter"===e.key&&!c&&!l&&(p(!h),s),onClick:()=>{c||l||(p(!h),null==s||s())},className:`${f.pill} ${r} ${h&&f.activePill}`},n.default.createElement("div",{className:`${f.pillBall} ${r} ${h&&f.activePillBall}`})))}},95966:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=n.__importStar(r(89926)),o=r(55776),a={...n.__importDefault(r(96565)).default,root:{height:"auto",display:"flex",justifyContent:"center"}},s=(0,i.forwardRef)((({classes:e={},min:t=0,max:r=1,step:n=.1,label:s,variant:l,classNames:c="",value:u,...d},h)=>{var p;const f=(0,o.useStyles)({source:e,target:a},"range");return i.default.createElement("div",{className:f.root},i.default.createElement("input",{type:"range",ref:h,min:t,max:r,step:n,value:u,className:`${f.range} ${c}`,"data-selenium":null!==(p=d.tag)&&void 0!==p?p:"range-input",onInput:d.onInput,onChange:d.onChange,...d}))}));t.default=s},12255:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=n.__importStar(r(89926)),o=r(27102),a=r(55776),s=n.__importDefault(r(68685)),l=n.__importDefault(r(8575)),c=(0,i.forwardRef)((({ariaLabel:e,classes:t={root:{},select:{},label:{}},label:r,children:n,onChange:c,value:u,tag:d,...h},p)=>{const{root:f,select:m,label:g,selectContainer:v,icon:y}=(0,a.useStyles)({source:t,target:s.default},"select"),b=(0,o.useUID)();return i.default.createElement("div",{className:f},null!=r?i.default.createElement("label",{htmlFor:b,className:g},r):null,i.default.createElement("div",{className:v},i.default.createElement("select",{ref:p,id:b,className:m,"aria-label":null!=r?r:"Default select","data-selenium":null!=d?d:"select-input",onChange:c,value:u},n),i.default.createElement(l.default,{className:y})))}));t.default=c},77247:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635).__importDefault(r(89926));t.default=({className:e,classes:t,children:r})=>n.default.createElement("div",{className:`${e}`},r)},68685:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={root:{},label:{fontSize:"0.75rem",fontWeight:500,marginBottom:0,color:"#344054",".dark-shelf &":{color:"white"}},select:{appearance:"none",position:"relative",borderRadius:".375rem",color:"#2b2b2b",padding:"0.625rem 0.875rem",paddingRight:"2.25rem",border:"1px solid #D0D5DD",fontWeight:500,fontSize:"0.875rem",width:"100%",".dark-shelf &":{color:"#f5f5f5",borderBottom:"1px solid #f5f5f5 !important"}},selectContainer:{position:"relative",width:"100%"},icon:{position:"absolute",top:"50%",transform:"translateY(-50%)",right:"0.75rem",pointerEvents:"none",color:"#667085",width:"1rem"}}},96565:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={root:{background:"none",border:"none",color:"#2b2b2b",display:"inline-block",height:"2.5rem",padding:"0.5rem 1rem",verticalAlign:"middle",width:"100%"},label:{fontSize:"0.75rem",marginBottom:0,".dark-shelf &":{color:"white"}},labelDisabled:{cursor:"not-allowed"},checkbox:{height:"auto",marginRight:".625rem",padding:0,width:"auto","& $label":{display:"flex",flex:"1 1 auto",alignItems:"center"}},radio:{padding:0,display:"inline-block",border:"1px solid #fff",appearance:"none",width:"0.5rem",height:"0.5rem",marginRight:".625rem",borderRadius:"1rem","&:checked":{border:"1px solid #f5f5f5",background:"#f5f5f5"},"& $label":{display:"flex",flex:"1 1 auto",alignItems:"center"}},range:{width:"auto",padding:"none",height:"auto"},fields:{display:"block",marginBottom:"0.625rem",".video-tippy-popper &":{padding:"0.5rem",marginBottom:0,"&:hover":{backgroundColor:"rgba(255, 255, 255, 0.25)"}},".lv-tippy-popper &":{padding:"0.5rem",marginBottom:0,"&:hover":{backgroundColor:"rgba(255, 255, 255, 0.25)"}}},input:{"&:disabled":{color:"#6b6b6b",opacity:.5,cursor:"not-allowed"}}}},40705:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=n.__importDefault(r(89926)),o=n.__importDefault(r(40619)),a=r(14353);t.default=function({level:e,classes:t,id:r}){const n=(0,a.useStyles)({source:null!=t?t:{},target:o.default},"level-pip");return i.default.createElement("div",{id:r,className:n.root})}},40619:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getLevelPipStyles=void 0,t.getLevelPipStyles=function(e){return{height:(e<.05?5:40*e)+"px"}},t.default={root:{maxHeight:25,minHeight:5,width:5,backgroundColor:"black",transition:"height",transitionTimingFunction:"cubic-bezier(.4,0,.2,1)",transitionDuration:"80ms",borderRadius:"1000px"}}},72429:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=n.__importStar(r(89926)),o=r(55776),a=n.__importDefault(r(37999)),s=(0,i.forwardRef)((({classes:e,...t},r)=>{const{children:n,isFullscreen:s}=t,l=(0,o.useStyles)({source:null!=e?e:{},target:a.default},"mediaWrapper");return i.default.createElement("div",{className:`\n ${l.root?l.root:""}\n ${s?"video-fullscreen-mode lv-fullscreen-mode":""}\n `,ref:r},n)}));t.default=s},37999:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getVideoElementStyles=t.VIDEO_SPACING=void 0,t.VIDEO_SPACING=16,t.getVideoElementStyles=({containerHeight:e,containerWidth:r,playersCount:n})=>0===e||0===r?{root:{width:"100%",height:"100%"}}:1===n?{root:{width:"100%",height:`${e}px`,"@media only screen and (max-width: 768px)":{width:"100%",height:"auto"}}}:{root:{width:(r-t.VIDEO_SPACING-2)/2+"px",height:(e-t.VIDEO_SPACING-2)/2+"px","@media only screen and (max-width: 768px)":{width:"100%",height:"auto"}}},t.default={root:{height:"inherit",position:"relative",width:"100%",display:"grid",gridTemplateRows:"minmax(0, 1fr) auto"}}},66463:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=n.__importStar(r(89926)),o=r(14353),a=n.__importStar(r(60833)),s=n.__importDefault(r(24420)),l=n.__importDefault(r(63643));t.default=function({open:e,onCloseButtonClick:t,children:r,classes:n,title:c,className:u=""}){const[d,h]=(0,i.useState)(0),[p,f]=(0,i.useState)(e),m=(0,o.useStyles)({source:null!=n?n:{},target:a.default},"modal"),g=(0,a.getOpacityRelatedStyles)(d);return(0,i.useEffect)((()=>{e?(f(!0),setTimeout((()=>h(1)),120)):(h(0),setTimeout((()=>f(!1)),120))}),[e]),i.default.createElement(l.default,null,p&&i.default.createElement("div",{className:null==m?void 0:m.overlay,onClick:t,onKeyDown:t,role:"button",tabIndex:0,style:g.overlay},i.default.createElement("div",{className:`${m.root} ${u}`,style:g.root,onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:"button",tabIndex:0},i.default.createElement("div",{className:m.header},i.default.createElement("div",{className:m.title},c),i.default.createElement("button",{type:"button","aria-label":"Close",onClick:t},i.default.createElement(s.default,{weight:"normal",className:m.closeIcon}))),r)))}},60833:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getOpacityRelatedStyles=void 0,t.getOpacityRelatedStyles=function(e){const t=1===e;return{overlay:{opacity:e},root:{opacity:e,scale:t?1:.7,transitionDelay:t?"0.05s":"0s"}}},t.default={overlay:{position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:1e3,cursor:"default",backgroundColor:"#6b7280bf",transitionProperty:"opacity",transitionTimingFunction:"ease-in",transitionDuration:".15s",display:"flex",justifyContent:"center",alignItems:"center",padding:"1rem"},root:{cursor:"default",backgroundColor:"#fff",borderRadius:"0.5rem",overflow:"hidden",position:"relative",padding:"1.25rem",paddingBottom:"2.5em",transitionProperty:"all",transitionTimingFunction:"ease-in",transitionDuration:".15s",maxWidth:"600px","@media only screen and (min-width: 598px)":{width:"600px"},"@media only screen and (max-width: 600px)":{width:"100%"}},header:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"1rem"},closeIcon:{height:"20px",width:"20px",color:"#98A2B3"},title:{fontSize:"18px",fontWeight:600}}},96755:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635).__importStar(r(89926)),i=r(55776),o=r(29469),a=(0,n.forwardRef)((({children:e,classes:t},r)=>{const a=(0,i.useStyles)({source:null!=t?t:{},target:o.playerGridWrapperStyles},"multistream-players-grid");return n.default.createElement("div",{ref:r,className:a.root},e)}));t.default=a},29469:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.playerGridWrapperStyles=t.VIDEO_SPACING=void 0,t.VIDEO_SPACING=16,t.playerGridWrapperStyles={root:{display:"flex",justifyContent:"center",alignItems:"center",flexWrap:"wrap",gap:`${t.VIDEO_SPACING}px`,"@media only screen and (min-width: 769px)":{width:"100%",height:"inherit"},"@media only screen and (max-width: 770px)":{width:"inherit",height:"100%"}}}},24957:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=n.__importDefault(r(89926)),o=r(14353),a=r(66652),s=n.__importDefault(r(28639)),l=n.__importDefault(r(75372));t.default=function({classes:e={root:{}},children:t,...r}){const n=(0,o.useStyles)({source:e,target:s.default},"playerOverlayButton"),c=(0,a.mergeStylesObjects)(e,s.default);return i.default.createElement("div",{...r,className:`${r.disabled?n.rootDisabled:""} ${n.root}`},null!=t?t:i.default.createElement(l.default,{iconName:"play",classes:c.overlayPlayIcon}))}},28639:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={root:{backgroundColor:"rgba(0, 0, 0, 0.33)",display:"flex",position:"absolute",top:0,bottom:0,width:"100%",zIndex:"120","&:before":{backgroundSize:"25%",backgroundRepeat:"no-repeat",backgroundPosition:"center center",content:"''",cursor:"pointer",position:"absolute",top:0,right:0,bottom:0,left:0}},rootDisabled:{"&::before":{cursor:"default"}},overlayPlayIcon:{icon:{width:"30%",color:"white"}}}},63643:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=r(89926),o=n.__importDefault(r(25884)),a="video-portal-root";t.default=function({children:e}){const[t,r]=(0,i.useState)(null);return(0,i.useLayoutEffect)((()=>{var e;const t=window.top,n=null==t?void 0:t.document.querySelector(`#${a}`),i=null!==(e=null!=n?n:null==t?void 0:t.document.createElement("div"))&&void 0!==e?e:null;r(i),i&&!n?(i.setAttribute("id",a),null==t||t.document.body.appendChild(i)):i||console.error("Failed to create portal root")}),[]),o.default.createPortal(e,null!=t?t:document.body)}},87132:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=n.__importDefault(r(89926)),o=r(14353),a=r(66652),s=n.__importDefault(r(16312)),l=n.__importDefault(r(30552));t.default=function({className:e="",classes:t={root:{}},onCloseButtonClick:r,open:n,children:c,variant:u="light",height:d,style:h,...p}){const f=(0,o.useStyles)({source:t,target:l.default},"slidingShelf"),m=(0,a.mergeStylesObjects)(t,l.default);return i.default.createElement("div",{className:`${f.root} ${"dark"===u&&"dark-shelf"} ${n&&"open"} ${e}`,...p},i.default.createElement(s.default,{onClick:r,open:n,classes:{root:m.closeButton}}),c)}},30552:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(28046),i={root:{backgroundColor:"rgba(255, 255, 255, 0.90)","backdrop-filter":"blur(10px)",boxShadow:"6px 0px 12px 0px rgba(43,43,43,0.33)",fontFamily:"sans-serif",height:"auto",overflow:n.adapter.device.isMobileDevice?"auto":"hidden",transition:"left 1s",transitionProperty:"opacity, left, top",transitionDuration:".33s",transitionTimingFunction:"ease-out",width:"40%",zIndex:140,bottom:0,left:"-100vw",padding:n.adapter.device.isMobileDevice?"15px":"0 1.5rem",position:"absolute",top:0,display:"grid",gap:"10px 0px",gridAutoColumns:"1fr",gridTemplateRows:"1fr 10fr 1fr","@media only screen and (max-width: 768px)":{width:"initial"},"@media only screen and (min-width: 1200px)":{top:0,left:"-100vw",width:"40%","&.open":{left:0}},"&.open":{left:0},"&.dark-shelf":{backgroundColor:"rgba(0, 0, 0, 0.9)"}},closeButton:{width:"15px"}};t.default=i},80354:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635),i=n.__importDefault(r(89926)),o=r(14353),a=n.__importDefault(r(27275));t.default=function({classes:e={},children:t,active:r}){const n=(0,o.useStyles)({source:e,target:a.default},"tooltip");return i.default.createElement("div",{className:`${n.root} ${r?"active":"inactive"}`},t)}},27275:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={root:{transition:"opacity 0.3s ease-in-out, transform 0.5s ease-in-out",position:"absolute",bottom:"50px",borderRadius:".375rem",overflow:"auto",border:"1px solid #e5e7eb","&.active":{opacity:1},"&.inactive":{transform:"translateY(50px)",opacity:0,visibility:"hidden"}}}},51080:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31635).__importStar(r(89926)),i=r(57004),o=r(55776),a=r(7308),s=(0,n.forwardRef)((({onClick:e,variant:t,children:r,isFullScreen:s,classes:l,style:c,pillarBox:u=!1,elementBlur:d=!1,blurPixels:h=11,mirror:p},f)=>{const m=(0,n.useContext)(i.PlayerUiContext),g=(0,n.useContext)(i.EncoderUiContext),v=null!=m?m:g,y=(0,a.videoWrapperStyles)({pillarBox:u,fullScreen:s,mirror:p,elementBlur:d,blurPixels:h}),b=(0,o.useStyles)({source:null!=l?l:{},target:y},"videoWrapper");return n.default.createElement("div",{onMouseEnter:()=>{null!=v&&(v.videoMouseOver=!0)},onMouseLeave:()=>{null!=v&&(v.videoMouseOver=!1)},className:`\n ${b.root?b.root:""}\n ${null!=t?`video-${t} lv-${t}`:""}\n `,"data-selenium":"video-element",onClick:e,onKeyDown:void 0,style:c,role:"button",tabIndex:0,ref:f},r)}));s.displayName="VideoWrapper",t.default=s},7308:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.videoWrapperStyles=void 0,t.videoWrapperStyles=({pillarBox:e,fullScreen:t,mirror:r,elementBlur:n,blurPixels:i})=>{let o={width:"100%",lineHeight:0},a={width:"100%",height:"100%",backgroundColor:"black",filter:n?`blur(${i}px)`:null};const s={position:"absolute",transform:r?"rotateY(180deg)":"rotateY(0deg)","&:before":{display:"block",content:'""',paddingTop:"0",paddingRight:"0",paddingLeft:"0"},"&::-webkit-media-controls":{display:"none","-webkit-appearance":"none"},"&::-webkit-media-controls-play-button":{display:"none","-webkit-appearance":"none"},"&::-webkit-media-controls-start-playback-button":{display:"none","-webkit-appearance":"none"},"&::-webkit-media-controls-container":{display:"none","-webkit-appearance":"none"}},l={objectFit:"cover",top:0,left:"50%",position:"relative",transform:r?"rotateY(180deg) translate(50%, 0)":"rotateY(0deg) translate(-50%, 0)",transition:"all 0.3s ease-in-out"};a=e?{...a,...s}:{...a,...l};return o=t?{...o,overflow:"hidden"}:{...o,height:"100%",backgroundColor:"black","&.preview":{position:"relative",zIndex:130,"@media only screen and (min-width: 600px)":{position:"absolute","&.right":{top:"1rem",right:"1rem",width:"25%"},"&.left":{top:"1rem",left:"1rem",width:"25%"}}}},{root:o,videoElement:a}};const r=(0,t.videoWrapperStyles)({pillarBox:!1,fullScreen:!1,mirror:!1,elementBlur:!1,blurPixels:11});t.default=r},8274:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Logger=void 0;const n=r(41814),i="awaitqueue";t.Logger=class{constructor(e){e?(this._debug=(0,n.default)(`${i}:${e}`),this._warn=(0,n.default)(`${i}:WARN:${e}`),this._error=(0,n.default)(`${i}:ERROR:${e}`)):(this._debug=(0,n.default)(i),this._warn=(0,n.default)(`${i}:WARN`),this._error=(0,n.default)(`${i}:ERROR`)),this._debug.log=console.info.bind(console),this._warn.log=console.warn.bind(console),this._error.log=console.error.bind(console)}get debug(){return this._debug}get warn(){return this._warn}get error(){return this._error}}},18876:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AwaitQueue=t.AwaitQueueRemovedTaskError=t.AwaitQueueStoppedError=void 0;const n=new(r(8274).Logger);class i extends Error{constructor(e){super(e??"AwaitQueue stopped"),this.name="AwaitQueueStoppedError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,i)}}t.AwaitQueueStoppedError=i;class o extends Error{constructor(e){super(e??"AwaitQueue task removed"),this.name="AwaitQueueRemovedTaskError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,o)}}t.AwaitQueueRemovedTaskError=o,t.AwaitQueue=class{constructor(){this.pendingTasks=new Map,this.nextTaskId=0,this.stopping=!1}get size(){return this.pendingTasks.size}async push(e,t){if(t=t??e.name,n.debug(`push() [name:${t}]`),"function"!=typeof e)throw new TypeError("given task is not a function");if(t)try{Object.defineProperty(e,"name",{value:t})}catch(e){}return new Promise(((r,i)=>{const o={id:this.nextTaskId++,task:e,name:t,enqueuedAt:Date.now(),executedAt:void 0,completed:!1,resolve:e=>{if(o.completed)return;o.completed=!0,this.pendingTasks.delete(o.id),n.debug(`resolving task [name:${o.name}]`),r(e);const[t]=this.pendingTasks.values();t&&!t.executedAt&&this.execute(t)},reject:e=>{if(!o.completed&&(o.completed=!0,this.pendingTasks.delete(o.id),n.debug(`rejecting task [name:${o.name}]: %s`,String(e)),i(e),!this.stopping)){const[e]=this.pendingTasks.values();e&&!e.executedAt&&this.execute(e)}}};this.pendingTasks.set(o.id,o),1===this.pendingTasks.size&&this.execute(o)}))}stop(){n.debug("stop()"),this.stopping=!0;for(const e of this.pendingTasks.values())n.debug(`stop() | stopping task [name:${e.name}]`),e.reject(new i);this.stopping=!1}remove(e){n.debug(`remove() [taskIdx:${e}]`);const t=Array.from(this.pendingTasks.values())[e];t?t.reject(new o):n.debug(`stop() | no task with given idx [taskIdx:${e}]`)}dump(){const e=Date.now();let t=0;return Array.from(this.pendingTasks.values()).map((r=>({idx:t++,task:r.task,name:r.name,enqueuedTime:r.executedAt?r.executedAt-r.enqueuedAt:e-r.enqueuedAt,executionTime:r.executedAt?e-r.executedAt:0})))}async execute(e){if(n.debug(`execute() [name:${e.name}]`),e.executedAt)throw new Error("task already being executed");e.executedAt=Date.now();try{const t=await e.task();e.resolve(t)}catch(t){e.reject(t)}}}},41814:(e,t,r)=>{var n=r(65606);t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;t.splice(1,0,r,"color: inherit");let n=0,i=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(n++,"%c"===e&&(i=n))})),t.splice(i,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&void 0!==n&&"env"in n&&(e=n.env.DEBUG),e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=r(54057)(t);const{formatters:i}=e.exports;i.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},54057:(e,t,r)=>{e.exports=function(e){function t(e){let r,i,o,a=null;function s(...e){if(!s.enabled)return;const n=s,i=Number(new Date),o=i-(r||i);n.diff=o,n.prev=r,n.curr=i,r=i,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((r,i)=>{if("%%"===r)return"%";a++;const o=t.formatters[i];if("function"==typeof o){const t=e[a];r=o.call(n,t),e.splice(a,1),a--}return r})),t.formatArgs.call(n,e),(n.log||t.log).apply(n,e)}return s.namespace=e,s.useColors=t.useColors(),s.color=t.selectColor(e),s.extend=n,s.destroy=t.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==a?a:(i!==t.namespaces&&(i=t.namespaces,o=t.enabled(e)),o),set:e=>{a=e}}),"function"==typeof t.init&&t.init(s),s}function n(e,r){const n=t(this.namespace+(void 0===r?":":r)+e);return n.log=this.log,n}function i(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){const e=[...t.names.map(i),...t.skips.map(i).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let r;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const n=("string"==typeof e?e:"").split(/[\s,]+/),i=n.length;for(r=0;r{t[r]=e[r]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let r=0;for(let t=0;t{var t=1e3,r=60*t,n=60*r,i=24*n,o=7*i;function a(e,t,r,n){var i=t>=1.5*r;return Math.round(e/r)+" "+n+(i?"s":"")}e.exports=function(e,s){s=s||{};var l,c,u=typeof e;if("string"===u&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var a=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(a){var s=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*s;case"weeks":case"week":case"w":return s*o;case"days":case"day":case"d":return s*i;case"hours":case"hour":case"hrs":case"hr":case"h":return s*n;case"minutes":case"minute":case"mins":case"min":case"m":return s*r;case"seconds":case"second":case"secs":case"sec":case"s":return s*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}(e);if("number"===u&&isFinite(e))return s.long?(l=e,(c=Math.abs(l))>=i?a(l,c,i,"day"):c>=n?a(l,c,n,"hour"):c>=r?a(l,c,r,"minute"):c>=t?a(l,c,t,"second"):l+" ms"):function(e){var o=Math.abs(e);return o>=i?Math.round(e/i)+"d":o>=n?Math.round(e/n)+"h":o>=r?Math.round(e/r)+"m":o>=t?Math.round(e/t)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},46880:function(e){e.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=90)}({17:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n=r(18),i=function(){function e(){}return e.getFirstMatch=function(e,t){var r=t.match(e);return r&&r.length>0&&r[1]||""},e.getSecondMatch=function(e,t){var r=t.match(e);return r&&r.length>1&&r[2]||""},e.matchAndReturnConst=function(e,t,r){if(e.test(t))return r},e.getWindowsVersionName=function(e){switch(e){case"NT":return"NT";case"XP":case"NT 5.1":return"XP";case"NT 5.0":return"2000";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}},e.getMacOSVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),10===t[0])switch(t[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}},e.getAndroidVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),!(1===t[0]&&t[1]<5))return 1===t[0]&&t[1]<6?"Cupcake":1===t[0]&&t[1]>=6?"Donut":2===t[0]&&t[1]<2?"Eclair":2===t[0]&&2===t[1]?"Froyo":2===t[0]&&t[1]>2?"Gingerbread":3===t[0]?"Honeycomb":4===t[0]&&t[1]<1?"Ice Cream Sandwich":4===t[0]&&t[1]<4?"Jelly Bean":4===t[0]&&t[1]>=4?"KitKat":5===t[0]?"Lollipop":6===t[0]?"Marshmallow":7===t[0]?"Nougat":8===t[0]?"Oreo":9===t[0]?"Pie":void 0},e.getVersionPrecision=function(e){return e.split(".").length},e.compareVersions=function(t,r,n){void 0===n&&(n=!1);var i=e.getVersionPrecision(t),o=e.getVersionPrecision(r),a=Math.max(i,o),s=0,l=e.map([t,r],(function(t){var r=a-e.getVersionPrecision(t),n=t+new Array(r+1).join(".0");return e.map(n.split("."),(function(e){return new Array(20-e.length).join("0")+e})).reverse()}));for(n&&(s=a-Math.min(i,o)),a-=1;a>=s;){if(l[0][a]>l[1][a])return 1;if(l[0][a]===l[1][a]){if(a===s)return 0;a-=1}else if(l[0][a]1?i-1:0),a=1;a0){var a=Object.keys(r),l=s.default.find(a,(function(e){return t.isOS(e)}));if(l){var c=this.satisfies(r[l]);if(void 0!==c)return c}var u=s.default.find(a,(function(e){return t.isPlatform(e)}));if(u){var d=this.satisfies(r[u]);if(void 0!==d)return d}}if(o>0){var h=Object.keys(i),p=s.default.find(h,(function(e){return t.isBrowser(e,!0)}));if(void 0!==p)return this.compareVersion(i[p])}},t.isBrowser=function(e,t){void 0===t&&(t=!1);var r=this.getBrowserName().toLowerCase(),n=e.toLowerCase(),i=s.default.getBrowserTypeByAlias(n);return t&&i&&(n=i.toLowerCase()),n===r},t.compareVersion=function(e){var t=[0],r=e,n=!1,i=this.getBrowserVersion();if("string"==typeof i)return">"===e[0]||"<"===e[0]?(r=e.substr(1),"="===e[1]?(n=!0,r=e.substr(2)):t=[],">"===e[0]?t.push(1):t.push(-1)):"="===e[0]?r=e.substr(1):"~"===e[0]&&(n=!0,r=e.substr(1)),t.indexOf(s.default.compareVersions(i,r,n))>-1},t.isOS=function(e){return this.getOSName(!0)===String(e).toLowerCase()},t.isPlatform=function(e){return this.getPlatformType(!0)===String(e).toLowerCase()},t.isEngine=function(e){return this.getEngineName(!0)===String(e).toLowerCase()},t.is=function(e,t){return void 0===t&&(t=!1),this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)},t.some=function(e){var t=this;return void 0===e&&(e=[]),e.some((function(e){return t.is(e)}))},e}();t.default=c,e.exports=t.default},92:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n,i=(n=r(17))&&n.__esModule?n:{default:n},o=/version\/(\d+(\.?_?\d+)+)/i,a=[{test:[/googlebot/i],describe:function(e){var t={name:"Googlebot"},r=i.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/opera/i],describe:function(e){var t={name:"Opera"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/opr\/|opios/i],describe:function(e){var t={name:"Opera"},r=i.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/SamsungBrowser/i],describe:function(e){var t={name:"Samsung Internet for Android"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/Whale/i],describe:function(e){var t={name:"NAVER Whale Browser"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/MZBrowser/i],describe:function(e){var t={name:"MZ Browser"},r=i.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/focus/i],describe:function(e){var t={name:"Focus"},r=i.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/swing/i],describe:function(e){var t={name:"Swing"},r=i.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/coast/i],describe:function(e){var t={name:"Opera Coast"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(e){var t={name:"Opera Touch"},r=i.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/yabrowser/i],describe:function(e){var t={name:"Yandex Browser"},r=i.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/ucbrowser/i],describe:function(e){var t={name:"UC Browser"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/Maxthon|mxios/i],describe:function(e){var t={name:"Maxthon"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/epiphany/i],describe:function(e){var t={name:"Epiphany"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/puffin/i],describe:function(e){var t={name:"Puffin"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/sleipnir/i],describe:function(e){var t={name:"Sleipnir"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/k-meleon/i],describe:function(e){var t={name:"K-Meleon"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/micromessenger/i],describe:function(e){var t={name:"WeChat"},r=i.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/qqbrowser/i],describe:function(e){var t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},r=i.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/msie|trident/i],describe:function(e){var t={name:"Internet Explorer"},r=i.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/\sedg\//i],describe:function(e){var t={name:"Microsoft Edge"},r=i.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/edg([ea]|ios)/i],describe:function(e){var t={name:"Microsoft Edge"},r=i.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/vivaldi/i],describe:function(e){var t={name:"Vivaldi"},r=i.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/seamonkey/i],describe:function(e){var t={name:"SeaMonkey"},r=i.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/sailfish/i],describe:function(e){var t={name:"Sailfish"},r=i.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return r&&(t.version=r),t}},{test:[/silk/i],describe:function(e){var t={name:"Amazon Silk"},r=i.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/phantom/i],describe:function(e){var t={name:"PhantomJS"},r=i.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/slimerjs/i],describe:function(e){var t={name:"SlimerJS"},r=i.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t={name:"BlackBerry"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t={name:"WebOS Browser"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/bada/i],describe:function(e){var t={name:"Bada"},r=i.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/tizen/i],describe:function(e){var t={name:"Tizen"},r=i.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/qupzilla/i],describe:function(e){var t={name:"QupZilla"},r=i.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/firefox|iceweasel|fxios/i],describe:function(e){var t={name:"Firefox"},r=i.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/electron/i],describe:function(e){var t={name:"Electron"},r=i.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/MiuiBrowser/i],describe:function(e){var t={name:"Miui"},r=i.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/chromium/i],describe:function(e){var t={name:"Chromium"},r=i.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/chrome|crios|crmo/i],describe:function(e){var t={name:"Chrome"},r=i.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/GSA/i],describe:function(e){var t={name:"Google Search"},r=i.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:function(e){var t=!e.test(/like android/i),r=e.test(/android/i);return t&&r},describe:function(e){var t={name:"Android Browser"},r=i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/playstation 4/i],describe:function(e){var t={name:"PlayStation 4"},r=i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/safari|applewebkit/i],describe:function(e){var t={name:"Safari"},r=i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/.*/i],describe:function(e){var t=-1!==e.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:i.default.getFirstMatch(t,e),version:i.default.getSecondMatch(t,e)}}}];t.default=a,e.exports=t.default},93:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n,i=(n=r(17))&&n.__esModule?n:{default:n},o=r(18),a=[{test:[/Roku\/DVP/],describe:function(e){var t=i.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:o.OS_MAP.Roku,version:t}}},{test:[/windows phone/i],describe:function(e){var t=i.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.WindowsPhone,version:t}}},{test:[/windows /i],describe:function(e){var t=i.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),r=i.default.getWindowsVersionName(t);return{name:o.OS_MAP.Windows,version:t,versionName:r}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(e){var t={name:o.OS_MAP.iOS},r=i.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return r&&(t.version=r),t}},{test:[/macintosh/i],describe:function(e){var t=i.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),r=i.default.getMacOSVersionName(t),n={name:o.OS_MAP.MacOS,version:t};return r&&(n.versionName=r),n}},{test:[/(ipod|iphone|ipad)/i],describe:function(e){var t=i.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:o.OS_MAP.iOS,version:t}}},{test:function(e){var t=!e.test(/like android/i),r=e.test(/android/i);return t&&r},describe:function(e){var t=i.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),r=i.default.getAndroidVersionName(t),n={name:o.OS_MAP.Android,version:t};return r&&(n.versionName=r),n}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t=i.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),r={name:o.OS_MAP.WebOS};return t&&t.length&&(r.version=t),r}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t=i.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||i.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||i.default.getFirstMatch(/\bbb(\d+)/i,e);return{name:o.OS_MAP.BlackBerry,version:t}}},{test:[/bada/i],describe:function(e){var t=i.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.Bada,version:t}}},{test:[/tizen/i],describe:function(e){var t=i.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.Tizen,version:t}}},{test:[/linux/i],describe:function(){return{name:o.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:o.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(e){var t=i.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.PlayStation4,version:t}}}];t.default=a,e.exports=t.default},94:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n,i=(n=r(17))&&n.__esModule?n:{default:n},o=r(18),a=[{test:[/googlebot/i],describe:function(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe:function(e){var t=i.default.getFirstMatch(/(can-l01)/i,e)&&"Nova",r={type:o.PLATFORMS_MAP.mobile,vendor:"Huawei"};return t&&(r.model=t),r}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet}}},{test:function(e){var t=e.test(/ipod|iphone/i),r=e.test(/like (ipod|iphone)/i);return t&&!r},describe:function(e){var t=i.default.getFirstMatch(/(ipod|iphone)/i,e);return{type:o.PLATFORMS_MAP.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(e){return"blackberry"===e.getBrowserName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(e){return"bada"===e.getBrowserName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(e){return"windows phone"===e.getBrowserName()},describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(e){var t=Number(String(e.getOSVersion()).split(".")[0]);return"android"===e.getOSName(!0)&&t>=3},describe:function(){return{type:o.PLATFORMS_MAP.tablet}}},{test:function(e){return"android"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(e){return"macos"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(e){return"windows"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop}}},{test:function(e){return"linux"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop}}},{test:function(e){return"playstation 4"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.tv}}},{test:function(e){return"roku"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.tv}}}];t.default=a,e.exports=t.default},95:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n,i=(n=r(17))&&n.__esModule?n:{default:n},o=r(18),a=[{test:function(e){return"microsoft edge"===e.getBrowserName(!0)},describe:function(e){if(/\sedg\//i.test(e))return{name:o.ENGINE_MAP.Blink};var t=i.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:o.ENGINE_MAP.EdgeHTML,version:t}}},{test:[/trident/i],describe:function(e){var t={name:o.ENGINE_MAP.Trident},r=i.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:function(e){return e.test(/presto/i)},describe:function(e){var t={name:o.ENGINE_MAP.Presto},r=i.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:function(e){var t=e.test(/gecko/i),r=e.test(/like gecko/i);return t&&!r},describe:function(e){var t={name:o.ENGINE_MAP.Gecko},r=i.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:o.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(e){var t={name:o.ENGINE_MAP.WebKit},r=i.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}}];t.default=a,e.exports=t.default}})},14744:e=>{"use strict";var t=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===r}(e)}(e)},r="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function n(e,t){return!1!==t.clone&&t.isMergeableObject(e)?s((r=e,Array.isArray(r)?[]:{}),e,t):e;var r}function i(e,t,r){return e.concat(t).map((function(e){return n(e,r)}))}function o(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return Object.propertyIsEnumerable.call(e,t)})):[]}(e))}function a(e,t){try{return t in e}catch(e){return!1}}function s(e,r,l){(l=l||{}).arrayMerge=l.arrayMerge||i,l.isMergeableObject=l.isMergeableObject||t,l.cloneUnlessOtherwiseSpecified=n;var c=Array.isArray(r);return c===Array.isArray(e)?c?l.arrayMerge(e,r,l):function(e,t,r){var i={};return r.isMergeableObject(e)&&o(e).forEach((function(t){i[t]=n(e[t],r)})),o(t).forEach((function(o){(function(e,t){return a(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,o)||(a(e,o)&&r.isMergeableObject(t[o])?i[o]=function(e,t){if(!t.customMerge)return s;var r=t.customMerge(e);return"function"==typeof r?r:s}(o,r)(e[o],t[o],r):i[o]=n(t[o],r))})),i}(e,r,l):n(r,l)}s.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,r){return s(e,r,t)}),{})};var l=s;e.exports=l},14263:function(e,t,r){var n,i,o;!function(a,s){"use strict";i=[r(40343)],void 0===(o="function"==typeof(n=function(e){var t=/(^|@)\S+:\d+/,r=/^\s*at .*(\S+:\d+|\(native\))/m,n=/^(eval@)?(\[native code])?$/;return{parse:function(e){if(void 0!==e.stacktrace||void 0!==e["opera#sourceloc"])return this.parseOpera(e);if(e.stack&&e.stack.match(r))return this.parseV8OrIE(e);if(e.stack)return this.parseFFOrSafari(e);throw new Error("Cannot parse given Error object")},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(t){return t.stack.split("\n").filter((function(e){return!!e.match(r)}),this).map((function(t){t.indexOf("(eval ")>-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));var r=t.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,""),n=r.match(/ (\(.+\)$)/);r=n?r.replace(n[0],""):r;var i=this.extractLocation(n?n[1]:r),o=n&&r||void 0,a=["eval",""].indexOf(i[0])>-1?void 0:i[0];return new e({functionName:o,fileName:a,lineNumber:i[1],columnNumber:i[2],source:t})}),this)},parseFFOrSafari:function(t){return t.stack.split("\n").filter((function(e){return!e.match(n)}),this).map((function(t){if(t.indexOf(" > eval")>-1&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===t.indexOf("@")&&-1===t.indexOf(":"))return new e({functionName:t});var r=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=t.match(r),i=n&&n[1]?n[1]:void 0,o=this.extractLocation(t.replace(r,""));return new e({functionName:i,fileName:o[0],lineNumber:o[1],columnNumber:o[2],source:t})}),this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(t){for(var r=/Line (\d+).*script (?:in )?(\S+)/i,n=t.message.split("\n"),i=[],o=2,a=n.length;o/,"$2").replace(/\([^)]*\)/g,"")||void 0;o.match(/\(([^)]*)\)/)&&(r=o.replace(/^[^(]+\(([^)]*)\)$/,"$1"));var s=void 0===r||"[arguments not available]"===r?void 0:r.split(",");return new e({functionName:a,args:s,fileName:i[0],lineNumber:i[1],columnNumber:i[2],source:t})}),this)}}})?n.apply(t,i):n)||(e.exports=o)}()},37007:e=>{"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise((function(r,n){function i(r){e.removeListener(t,o),n(r)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}m(e,t,o,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&m(e,"error",t,{once:!0})}(e,i)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var a=10;function s(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function c(e,t,r,n){var i,o,a,c;if(s(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),a=o[t]),void 0===a)a=o[t]=r,++e._eventsCount;else if("function"==typeof a?a=o[t]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),(i=l(e))>0&&a.length>i&&!a.warned){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=a.length,c=u,console&&console.warn&&console.warn(c)}return e}function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=u.bind(n);return i.listener=r,n.wrapFn=i,i}function h(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var l=o[e];if(void 0===l)return!1;if("function"==typeof l)n(l,this,t);else{var c=l.length,u=f(l,c);for(r=0;r=0;o--)if(r[o]===t||r[o].listener===t){a=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1=0;n--)this.removeListener(e,t[n]);return this},o.prototype.listeners=function(e){return h(this,e,!0)},o.prototype.rawListeners=function(e){return h(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},o.prototype.listenerCount=p,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},29252:e=>{"use strict";e.exports=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;var n,i,o;if(Array.isArray(t)){if((n=t.length)!=r.length)return!1;for(i=n;0!=i--;)if(!e(t[i],r[i]))return!1;return!0}if(t instanceof Map&&r instanceof Map){if(t.size!==r.size)return!1;for(i of t.entries())if(!r.has(i[0]))return!1;for(i of t.entries())if(!e(i[1],r.get(i[0])))return!1;return!0}if(t instanceof Set&&r instanceof Set){if(t.size!==r.size)return!1;for(i of t.entries())if(!r.has(i[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(r)){if((n=t.length)!=r.length)return!1;for(i=n;0!=i--;)if(t[i]!==r[i])return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((n=(o=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(i=n;0!=i--;)if(!Object.prototype.hasOwnProperty.call(r,o[i]))return!1;for(i=n;0!=i--;){var a=o[i];if(!e(t[a],r[a]))return!1}return!0}return t!=t&&r!=r}},83572:(e,t,r)=>{const n=r(11970)("h264-profile-level-id"),i=r(11970)("h264-profile-level-id:WARN");n.log=console.info.bind(console),i.log=console.warn.bind(console),t.ProfileConstrainedBaseline=1,t.ProfileBaseline=2,t.ProfileMain=3,t.ProfileConstrainedHigh=4,t.ProfileHigh=5,t.ProfilePredictiveHigh444=6;t.Level1_b=0,t.Level1=10,t.Level1_1=11,t.Level1_2=12,t.Level1_3=13,t.Level2=20,t.Level2_1=21,t.Level2_2=22,t.Level3=30,t.Level3_1=31,t.Level3_2=32,t.Level4=40,t.Level4_1=41,t.Level4_2=42,t.Level5=50,t.Level5_1=51,t.Level5_2=52;class o{constructor(e,t){this.profile=e,this.level=t}}t.ProfileLevelId=o;class a{constructor(e){this._mask=~c("x",e),this._maskedValue=c("1",e)}isMatch(e){return this._maskedValue===(e&this._mask)}}class s{constructor(e,t,r){this.profile_idc=e,this.profile_iop=t,this.profile=r}}const l=[new s(66,new a("x1xx0000"),1),new s(77,new a("1xxx0000"),1),new s(88,new a("11xx0000"),1),new s(66,new a("x0xx0000"),2),new s(88,new a("10xx0000"),2),new s(77,new a("0x0x0000"),3),new s(100,new a("00000000"),5),new s(100,new a("00001100"),4),new s(244,new a("00000000"),6)];function c(e,t){return(t[0]===e)<<7|(t[1]===e)<<6|(t[2]===e)<<5|(t[3]===e)<<4|(t[4]===e)<<3|(t[5]===e)<<2|(t[6]===e)<<1|t[7]===e}function u(e={}){const t=e["level-asymmetry-allowed"];return 1===t||"1"===t}t.parseProfileLevelId=function(e){if("string"!=typeof e||6!==e.length)return null;const t=parseInt(e,16);if(0===t)return null;const r=255&t,n=t>>8&255,a=t>>16&255;let s;switch(r){case 11:s=16&n?0:11;break;case 10:case 12:case 13:case 20:case 21:case 22:case 30:case 31:case 32:case 40:case 41:case 42:case 50:case 51:case 52:s=r;break;default:return i(`parseProfileLevelId() | unrecognized level_idc [str:${e}, level_idc:${r}]`),null}for(const e of l)if(a===e.profile_idc&&e.profile_iop.isMatch(n))return new o(e.profile,s);return i(`parseProfileLevelId() | unrecognized profile_idc/profile_iop combination [str:${e}, profile_idc:${a}, profile_iop:${n}]`),null},t.profileLevelIdToString=function(e){if(0==e.level)switch(e.profile){case 1:return"42f00b";case 2:return"42100b";case 3:return"4d100b";default:return i(`profileLevelIdToString() | Level 1_b not is allowed for profile ${e.profile}`),null}let t;switch(e.profile){case 1:t="42e0";break;case 2:t="4200";break;case 3:t="4d00";break;case 4:t="640c";break;case 5:t="6400";break;case 6:t="f400";break;default:return i(`profileLevelIdToString() | unrecognized profile ${e.profile}`),null}let r=e.level.toString(16);return 1===r.length&&(r=`0${r}`),`${t}${r}`},t.profileToString=function(e){switch(e){case 1:return"ConstrainedBaseline";case 2:return"Baseline";case 3:return"Main";case 4:return"ConstrainedHigh";case 5:return"High";case 6:return"PredictiveHigh444";default:return i(`profileToString() | unrecognized profile ${e}`),null}},t.levelToString=function(e){switch(e){case 0:return"1b";case 10:return"1";case 11:return"1.1";case 12:return"1.2";case 13:return"1.3";case 20:return"2";case 21:return"2.1";case 22:return"2.2";case 30:return"3";case 31:return"3.1";case 32:return"3.2";case 40:return"4";case 41:return"4.1";case 42:return"4.2";case 50:return"5";case 51:return"5.1";case 52:return"5.2";default:return i(`levelToString() | unrecognized level ${e}`),null}},t.parseSdpProfileLevelId=function(e={}){const r=new o(1,31),n=e["profile-level-id"];return n?t.parseProfileLevelId(n):r},t.isSameProfile=function(e={},r={}){const n=t.parseSdpProfileLevelId(e),i=t.parseSdpProfileLevelId(r);return Boolean(n&&i&&n.profile===i.profile)},t.generateProfileLevelIdForAnswer=function(e={},r={}){if(!e["profile-level-id"]&&!r["profile-level-id"])return i("generateProfileLevelIdForAnswer() | profile-level-id missing in local and remote params"),null;const a=t.parseSdpProfileLevelId(e),s=t.parseSdpProfileLevelId(r);if(!a)throw new TypeError("invalid local_profile_level_id");if(!s)throw new TypeError("invalid remote_profile_level_id");if(a.profile!==s.profile)throw new TypeError("H264 Profile mismatch");const l=u(e)&&u(r),c=a.level,d=function(e,t){return 0===e?10!==t&&0!==t:0===t?10!==e:e{var n=r(65606);t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;t.splice(1,0,r,"color: inherit");let n=0,i=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(n++,"%c"===e&&(i=n))})),t.splice(i,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&void 0!==n&&"env"in n&&(e=n.env.DEBUG),e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=r(16749)(t);const{formatters:i}=e.exports;i.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},16749:(e,t,r)=>{e.exports=function(e){function t(e){let r,i,o,a=null;function s(...e){if(!s.enabled)return;const n=s,i=Number(new Date),o=i-(r||i);n.diff=o,n.prev=r,n.curr=i,r=i,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((r,i)=>{if("%%"===r)return"%";a++;const o=t.formatters[i];if("function"==typeof o){const t=e[a];r=o.call(n,t),e.splice(a,1),a--}return r})),t.formatArgs.call(n,e),(n.log||t.log).apply(n,e)}return s.namespace=e,s.useColors=t.useColors(),s.color=t.selectColor(e),s.extend=n,s.destroy=t.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==a?a:(i!==t.namespaces&&(i=t.namespaces,o=t.enabled(e)),o),set:e=>{a=e}}),"function"==typeof t.init&&t.init(s),s}function n(e,r){const n=t(this.namespace+(void 0===r?":":r)+e);return n.log=this.log,n}function i(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){const e=[...t.names.map(i),...t.skips.map(i).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let r;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const n=("string"==typeof e?e:"").split(/[\s,]+/),i=n.length;for(r=0;r{t[r]=e[r]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let r=0;for(let t=0;t{var t=1e3,r=60*t,n=60*r,i=24*n,o=7*i;function a(e,t,r,n){var i=t>=1.5*r;return Math.round(e/r)+" "+n+(i?"s":"")}e.exports=function(e,s){s=s||{};var l,c,u=typeof e;if("string"===u&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var a=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(a){var s=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*s;case"weeks":case"week":case"w":return s*o;case"days":case"day":case"d":return s*i;case"hours":case"hour":case"hrs":case"hr":case"h":return s*n;case"minutes":case"minute":case"mins":case"min":case"m":return s*r;case"seconds":case"second":case"secs":case"sec":case"s":return s*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}(e);if("number"===u&&isFinite(e))return s.long?(l=e,(c=Math.abs(l))>=i?a(l,c,i,"day"):c>=n?a(l,c,n,"hour"):c>=r?a(l,c,r,"minute"):c>=t?a(l,c,t,"second"):l+" ms"):function(e){var o=Math.abs(e);return o>=i?Math.round(e/i)+"d":o>=n?Math.round(e/n)+"h":o>=r?Math.round(e/r)+"m":o>=t?Math.round(e/t)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},17929:(e,t,r)=>{"use strict";r.d(t,{zR:()=>O,TM:()=>D,yJ:()=>v,sC:()=>x,AO:()=>g,Fu:()=>y});var n=r(58168);function i(e){return"/"===e.charAt(0)}function o(e,t){for(var r=t,n=r+1,i=e.length;n=0;h--){var p=a[h];"."===p?o(a,h):".."===p?(o(a,h),d++):d&&(o(a,h),d--)}if(!c)for(;d--;d)a.unshift("..");!c||""===a[0]||a[0]&&i(a[0])||a.unshift("");var f=a.join("/");return r&&"/"!==f.substr(-1)&&(f+="/"),f};function s(e){return e.valueOf?e.valueOf():Object.prototype.valueOf.call(e)}const l=function e(t,r){if(t===r)return!0;if(null==t||null==r)return!1;if(Array.isArray(t))return Array.isArray(r)&&t.length===r.length&&t.every((function(t,n){return e(t,r[n])}));if("object"==typeof t||"object"==typeof r){var n=s(t),i=s(r);return n!==t||i!==r?e(n,i):Object.keys(Object.assign({},t,r)).every((function(n){return e(t[n],r[n])}))}return!1};var c=r(57573),u=r(11561);function d(e){return"/"===e.charAt(0)?e:"/"+e}function h(e){return"/"===e.charAt(0)?e.substr(1):e}function p(e,t){return 0===e.toLowerCase().indexOf(t.toLowerCase())&&-1!=="/?#".indexOf(e.charAt(t.length))}function f(e,t){return p(e,t)?e.substr(t.length):e}function m(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function g(e){var t=e.pathname,r=e.search,n=e.hash,i=t||"/";return r&&"?"!==r&&(i+="?"===r.charAt(0)?r:"?"+r),n&&"#"!==n&&(i+="#"===n.charAt(0)?n:"#"+n),i}function v(e,t,r,i){var o;"string"==typeof e?(o=function(e){var t=e||"/",r="",n="",i=t.indexOf("#");-1!==i&&(n=t.substr(i),t=t.substr(0,i));var o=t.indexOf("?");return-1!==o&&(r=t.substr(o),t=t.substr(0,o)),{pathname:t,search:"?"===r?"":r,hash:"#"===n?"":n}}(e),o.state=t):(void 0===(o=(0,n.A)({},e)).pathname&&(o.pathname=""),o.search?"?"!==o.search.charAt(0)&&(o.search="?"+o.search):o.search="",o.hash?"#"!==o.hash.charAt(0)&&(o.hash="#"+o.hash):o.hash="",void 0!==t&&void 0===o.state&&(o.state=t));try{o.pathname=decodeURI(o.pathname)}catch(e){throw e instanceof URIError?new URIError('Pathname "'+o.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):e}return r&&(o.key=r),i?o.pathname?"/"!==o.pathname.charAt(0)&&(o.pathname=a(o.pathname,i.pathname)):o.pathname=i.pathname:o.pathname||(o.pathname="/"),o}function y(e,t){return e.pathname===t.pathname&&e.search===t.search&&e.hash===t.hash&&e.key===t.key&&l(e.state,t.state)}function b(){var e=null,t=[];return{setPrompt:function(t){return(0,c.A)(null==e,"A history supports only one prompt at a time"),e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,r,n,i){if(null!=e){var o="function"==typeof e?e(t,r):e;"string"==typeof o?"function"==typeof n?n(o,i):((0,c.A)(!1,"A history needs a getUserConfirmation function in order to use a prompt message"),i(!0)):i(!1!==o)}else i(!0)},appendListener:function(e){var r=!0;function n(){r&&e.apply(void 0,arguments)}return t.push(n),function(){r=!1,t=t.filter((function(e){return e!==n}))}},notifyListeners:function(){for(var e=arguments.length,r=new Array(e),n=0;nt?r.splice(t,r.length-t,i):r.push(i),h({action:n,location:i,index:t,entries:r})}}))},replace:function(e,t){(0,c.A)(!("object"==typeof e&&void 0!==e.state&&void 0!==t),"You should avoid providing a 2nd state argument to replace when the 1st argument is a location-like object that already has state; it is ignored");var n="REPLACE",i=v(e,t,p(),S.location);d.confirmTransitionTo(i,n,r,(function(e){e&&(S.entries[S.index]=i,h({action:n,location:i}))}))},go:_,goBack:function(){_(-1)},goForward:function(){_(1)},canGo:function(e){var t=S.index+e;return t>=0&&t{!function t(r){e.exports=function(){"use strict";function e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function n(t){for(var r=1;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function m(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}function g(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var v={exports:{}};!function(e,t){var r,n,i,o,a;r=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,n=/^(?=([^\/?#]*))\1([^]*)$/,i=/(?:\/|^)\.(?=\/)/g,o=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,a={buildAbsoluteURL:function(e,t,r){if(r=r||{},e=e.trim(),!(t=t.trim())){if(!r.alwaysNormalize)return e;var i=a.parseURL(e);if(!i)throw new Error("Error trying to parse base URL.");return i.path=a.normalizePath(i.path),a.buildURLFromParts(i)}var o=a.parseURL(t);if(!o)throw new Error("Error trying to parse relative URL.");if(o.scheme)return r.alwaysNormalize?(o.path=a.normalizePath(o.path),a.buildURLFromParts(o)):t;var s=a.parseURL(e);if(!s)throw new Error("Error trying to parse base URL.");if(!s.netLoc&&s.path&&"/"!==s.path[0]){var l=n.exec(s.path);s.netLoc=l[1],s.path=l[2]}s.netLoc&&!s.path&&(s.path="/");var c={scheme:s.scheme,netLoc:o.netLoc,path:null,params:o.params,query:o.query,fragment:o.fragment};if(!o.netLoc&&(c.netLoc=s.netLoc,"/"!==o.path[0]))if(o.path){var u=s.path,d=u.substring(0,u.lastIndexOf("/")+1)+o.path;c.path=a.normalizePath(d)}else c.path=s.path,o.params||(c.params=s.params,o.query||(c.query=s.query));return null===c.path&&(c.path=r.alwaysNormalize?a.normalizePath(o.path):o.path),a.buildURLFromParts(c)},parseURL:function(e){var t=r.exec(e);return t?{scheme:t[1]||"",netLoc:t[2]||"",path:t[3]||"",params:t[4]||"",query:t[5]||"",fragment:t[6]||""}:null},normalizePath:function(e){for(e=e.split("").reverse().join("").replace(i,"");e.length!==(e=e.replace(o,"")).length;);return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}},e.exports=a}(v);var y=v.exports,b=Number.isFinite||function(e){return"number"==typeof e&&isFinite(e)},_=Number.isSafeInteger||function(e){return"number"==typeof e&&Math.abs(e)<=S},S=Number.MAX_SAFE_INTEGER||9007199254740991,w=function(e){return e.MEDIA_ATTACHING="hlsMediaAttaching",e.MEDIA_ATTACHED="hlsMediaAttached",e.MEDIA_DETACHING="hlsMediaDetaching",e.MEDIA_DETACHED="hlsMediaDetached",e.BUFFER_RESET="hlsBufferReset",e.BUFFER_CODECS="hlsBufferCodecs",e.BUFFER_CREATED="hlsBufferCreated",e.BUFFER_APPENDING="hlsBufferAppending",e.BUFFER_APPENDED="hlsBufferAppended",e.BUFFER_EOS="hlsBufferEos",e.BUFFER_FLUSHING="hlsBufferFlushing",e.BUFFER_FLUSHED="hlsBufferFlushed",e.MANIFEST_LOADING="hlsManifestLoading",e.MANIFEST_LOADED="hlsManifestLoaded",e.MANIFEST_PARSED="hlsManifestParsed",e.LEVEL_SWITCHING="hlsLevelSwitching",e.LEVEL_SWITCHED="hlsLevelSwitched",e.LEVEL_LOADING="hlsLevelLoading",e.LEVEL_LOADED="hlsLevelLoaded",e.LEVEL_UPDATED="hlsLevelUpdated",e.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",e.LEVELS_UPDATED="hlsLevelsUpdated",e.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",e.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",e.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",e.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",e.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",e.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",e.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",e.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",e.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",e.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",e.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",e.CUES_PARSED="hlsCuesParsed",e.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",e.INIT_PTS_FOUND="hlsInitPtsFound",e.FRAG_LOADING="hlsFragLoading",e.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",e.FRAG_LOADED="hlsFragLoaded",e.FRAG_DECRYPTED="hlsFragDecrypted",e.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",e.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",e.FRAG_PARSING_METADATA="hlsFragParsingMetadata",e.FRAG_PARSED="hlsFragParsed",e.FRAG_BUFFERED="hlsFragBuffered",e.FRAG_CHANGED="hlsFragChanged",e.FPS_DROP="hlsFpsDrop",e.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",e.ERROR="hlsError",e.DESTROYING="hlsDestroying",e.KEY_LOADING="hlsKeyLoading",e.KEY_LOADED="hlsKeyLoaded",e.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",e.BACK_BUFFER_REACHED="hlsBackBufferReached",e}({}),E=function(e){return e.NETWORK_ERROR="networkError",e.MEDIA_ERROR="mediaError",e.KEY_SYSTEM_ERROR="keySystemError",e.MUX_ERROR="muxError",e.OTHER_ERROR="otherError",e}({}),C=function(e){return e.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",e.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",e.KEY_SYSTEM_NO_SESSION="keySystemNoSession",e.KEY_SYSTEM_NO_CONFIGURED_LICENSE="keySystemNoConfiguredLicense",e.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",e.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED="keySystemServerCertificateRequestFailed",e.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED="keySystemServerCertificateUpdateFailed",e.KEY_SYSTEM_SESSION_UPDATE_FAILED="keySystemSessionUpdateFailed",e.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED="keySystemStatusOutputRestricted",e.KEY_SYSTEM_STATUS_INTERNAL_ERROR="keySystemStatusInternalError",e.MANIFEST_LOAD_ERROR="manifestLoadError",e.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",e.MANIFEST_PARSING_ERROR="manifestParsingError",e.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",e.LEVEL_EMPTY_ERROR="levelEmptyError",e.LEVEL_LOAD_ERROR="levelLoadError",e.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",e.LEVEL_PARSING_ERROR="levelParsingError",e.LEVEL_SWITCH_ERROR="levelSwitchError",e.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",e.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",e.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",e.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",e.FRAG_LOAD_ERROR="fragLoadError",e.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",e.FRAG_DECRYPT_ERROR="fragDecryptError",e.FRAG_PARSING_ERROR="fragParsingError",e.FRAG_GAP="fragGap",e.REMUX_ALLOC_ERROR="remuxAllocError",e.KEY_LOAD_ERROR="keyLoadError",e.KEY_LOAD_TIMEOUT="keyLoadTimeOut",e.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",e.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",e.BUFFER_APPEND_ERROR="bufferAppendError",e.BUFFER_APPENDING_ERROR="bufferAppendingError",e.BUFFER_STALLED_ERROR="bufferStalledError",e.BUFFER_FULL_ERROR="bufferFullError",e.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",e.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",e.INTERNAL_EXCEPTION="internalException",e.INTERNAL_ABORTED="aborted",e.UNKNOWN="unknown",e}({}),O=function(){},P={trace:O,debug:O,log:O,warn:O,info:O,error:O},T=P;function k(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n"):O}(t)}))}function R(e,t){if(self.console&&!0===e||"object"==typeof e){k(e,"debug","log","info","warn","error");try{T.log('Debug logs enabled for "'+t+'" in hls.js version 1.4.14')}catch(e){T=P}}else T=P}var A=T,D=/^(\d+)x(\d+)$/,I=/(.+?)=(".*?"|.*?)(?:,|$)/g,x=function(){function e(t){for(var r in"string"==typeof t&&(t=e.parseAttrList(t)),t)t.hasOwnProperty(r)&&("X-"===r.substring(0,2)&&(this.clientAttrs=this.clientAttrs||[],this.clientAttrs.push(r)),this[r]=t[r])}var t=e.prototype;return t.decimalInteger=function(e){var t=parseInt(this[e],10);return t>Number.MAX_SAFE_INTEGER?1/0:t},t.hexadecimalInteger=function(e){if(this[e]){var t=(this[e]||"0x").slice(2);t=(1&t.length?"0":"")+t;for(var r=new Uint8Array(t.length/2),n=0;nNumber.MAX_SAFE_INTEGER?1/0:t},t.decimalFloatingPoint=function(e){return parseFloat(this[e])},t.optionalFloat=function(e,t){var r=this[e];return r?parseFloat(r):t},t.enumeratedString=function(e){return this[e]},t.bool=function(e){return"YES"===this[e]},t.decimalResolution=function(e){var t=D.exec(this[e]);if(null!==t)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}},e.parseAttrList=function(e){var t,r={};for(I.lastIndex=0;null!==(t=I.exec(e));){var n=t[2];0===n.indexOf('"')&&n.lastIndexOf('"')===n.length-1&&(n=n.slice(1,-1)),r[t[1].trim()]=n}return r},e}();function M(e){return"SCTE35-OUT"===e||"SCTE35-IN"===e}var L=function(){function e(e,t){if(this.attr=void 0,this._startDate=void 0,this._endDate=void 0,this._badValueForSameId=void 0,t){var r=t.attr;for(var n in r)if(Object.prototype.hasOwnProperty.call(e,n)&&e[n]!==r[n]){A.warn('DATERANGE tag attribute: "'+n+'" does not match for tags with ID: "'+e.ID+'"'),this._badValueForSameId=n;break}e=s(new x({}),r,e)}if(this.attr=e,this._startDate=new Date(e["START-DATE"]),"END-DATE"in this.attr){var i=new Date(this.attr["END-DATE"]);b(i.getTime())&&(this._endDate=i)}}return o(e,[{key:"id",get:function(){return this.attr.ID}},{key:"class",get:function(){return this.attr.CLASS}},{key:"startDate",get:function(){return this._startDate}},{key:"endDate",get:function(){if(this._endDate)return this._endDate;var e=this.duration;return null!==e?new Date(this._startDate.getTime()+1e3*e):null}},{key:"duration",get:function(){if("DURATION"in this.attr){var e=this.attr.decimalFloatingPoint("DURATION");if(b(e))return e}else if(this._endDate)return(this._endDate.getTime()-this._startDate.getTime())/1e3;return null}},{key:"plannedDuration",get:function(){return"PLANNED-DURATION"in this.attr?this.attr.decimalFloatingPoint("PLANNED-DURATION"):null}},{key:"endOnNext",get:function(){return this.attr.bool("END-ON-NEXT")}},{key:"isValid",get:function(){return!!this.id&&!this._badValueForSameId&&b(this.startDate.getTime())&&(null===this.duration||this.duration>=0)&&(!this.endOnNext||!!this.class)}}]),e}(),j=function(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}},N="audio",F="video",B="audiovideo",U=function(){function e(e){var t;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=((t={})[N]=null,t[F]=null,t[B]=null,t),this.baseurl=e}return e.prototype.setByteRange=function(e,t){var r=e.split("@",2),n=[];1===r.length?n[0]=t?t.byteRangeEndOffset:0:n[0]=parseInt(r[1]),n[1]=parseInt(r[0])+n[0],this._byteRange=n},o(e,[{key:"byteRange",get:function(){return this._byteRange?this._byteRange:[]}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"url",get:function(){return!this._url&&this.baseurl&&this.relurl&&(this._url=y.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(e){this._url=e}}]),e}(),V=function(e){function t(t,r){var n;return(n=e.call(this,r)||this)._decryptdata=null,n.rawProgramDateTime=null,n.programDateTime=null,n.tagList=[],n.duration=0,n.sn=0,n.levelkeys=void 0,n.type=void 0,n.loader=null,n.keyLoader=null,n.level=-1,n.cc=0,n.startPTS=void 0,n.endPTS=void 0,n.startDTS=void 0,n.endDTS=void 0,n.start=0,n.deltaPTS=void 0,n.maxStartPTS=void 0,n.minEndPTS=void 0,n.stats=new j,n.urlId=0,n.data=void 0,n.bitrateTest=!1,n.title=null,n.initSegment=null,n.endList=void 0,n.gap=void 0,n.type=t,n}l(t,e);var r=t.prototype;return r.setKeyFormat=function(e){if(this.levelkeys){var t=this.levelkeys[e];t&&!this._decryptdata&&(this._decryptdata=t.getDecryptData(this.sn))}},r.abortRequests=function(){var e,t;null==(e=this.loader)||e.abort(),null==(t=this.keyLoader)||t.abort()},r.setElementaryStreamInfo=function(e,t,r,n,i,o){void 0===o&&(o=!1);var a=this.elementaryStreams,s=a[e];s?(s.startPTS=Math.min(s.startPTS,t),s.endPTS=Math.max(s.endPTS,r),s.startDTS=Math.min(s.startDTS,n),s.endDTS=Math.max(s.endDTS,i)):a[e]={startPTS:t,endPTS:r,startDTS:n,endDTS:i,partial:o}},r.clearElementaryStreamInfo=function(){var e=this.elementaryStreams;e[N]=null,e[F]=null,e[B]=null},o(t,[{key:"decryptdata",get:function(){if(!this.levelkeys&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkeys&&!this.levelkeys.NONE){var e=this.levelkeys.identity;if(e)this._decryptdata=e.getDecryptData(this.sn);else{var t=Object.keys(this.levelkeys);if(1===t.length)return this._decryptdata=this.levelkeys[t[0]].getDecryptData(this.sn)}}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(null===this.programDateTime)return null;if(!b(this.programDateTime))return null;var e=b(this.duration)?this.duration:0;return this.programDateTime+1e3*e}},{key:"encrypted",get:function(){var e;if(null!=(e=this._decryptdata)&&e.encrypted)return!0;if(this.levelkeys){var t=Object.keys(this.levelkeys),r=t.length;if(r>1||1===r&&this.levelkeys[t[0]].encrypted)return!0}return!1}}]),t}(U),H=function(e){function t(t,r,n,i,o){var a;(a=e.call(this,n)||this).fragOffset=0,a.duration=0,a.gap=!1,a.independent=!1,a.relurl=void 0,a.fragment=void 0,a.index=void 0,a.stats=new j,a.duration=t.decimalFloatingPoint("DURATION"),a.gap=t.bool("GAP"),a.independent=t.bool("INDEPENDENT"),a.relurl=t.enumeratedString("URI"),a.fragment=r,a.index=i;var s=t.enumeratedString("BYTERANGE");return s&&a.setByteRange(s,o),o&&(a.fragOffset=o.fragOffset+o.duration),a}return l(t,e),o(t,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var e=this.elementaryStreams;return!!(e.audio||e.video||e.audiovideo)}}]),t}(U),G=function(){function e(e){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.dateRanges=void 0,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.encryptedFragments=void 0,this.playlistParsingError=null,this.variableList=null,this.hasVariableRefs=!1,this.fragments=[],this.encryptedFragments=[],this.dateRanges={},this.url=e}return e.prototype.reloaded=function(e){if(!e)return this.advanced=!0,void(this.updated=!0);var t=this.lastPartSn-e.lastPartSn,r=this.lastPartIndex-e.lastPartIndex;this.updated=this.endSN!==e.endSN||!!r||!!t||!this.live,this.advanced=this.endSN>e.endSN||t>0||0===t&&r>0,this.updated||this.advanced?this.misses=Math.floor(.6*e.misses):this.misses=e.misses+1,this.availabilityDelay=e.availabilityDelay},o(e,[{key:"hasProgramDateTime",get:function(){return!!this.fragments.length&&b(this.fragments[this.fragments.length-1].programDateTime)}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||10}},{key:"drift",get:function(){var e=this.driftEndTime-this.driftStartTime;return e>0?1e3*(this.driftEnd-this.driftStart)/e:1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var e;return null!=(e=this.partList)&&e.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var e;return null!=(e=this.fragments)&&e.length?this.fragments[this.fragments.length-1].end:0}},{key:"age",get:function(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}},{key:"lastPartIndex",get:function(){var e;return null!=(e=this.partList)&&e.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var e;return null!=(e=this.partList)&&e.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),e}();function W(e){return Uint8Array.from(atob(e),(function(e){return e.charCodeAt(0)}))}function z(e){var t,r,n=e.split(":"),i=null;if("data"===n[0]&&2===n.length){var o=n[1].split(";"),a=o[o.length-1].split(",");if(2===a.length){var s="base64"===a[0],l=a[1];s?(o.splice(-1,1),i=W(l)):(t=K(l).subarray(0,16),(r=new Uint8Array(16)).set(t,16-t.length),i=r)}}return i}function K(e){return Uint8Array.from(unescape(encodeURIComponent(e)),(function(e){return e.charCodeAt(0)}))}var $={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},q="org.w3.clearkey",Z="com.apple.streamingkeydelivery",Y="com.microsoft.playready",J="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed";function Q(e){switch(e){case Z:return $.FAIRPLAY;case Y:return $.PLAYREADY;case J:return $.WIDEVINE;case q:return $.CLEARKEY}}var X="edef8ba979d64acea3c827dcd51d21ed";function ee(e){switch(e){case $.FAIRPLAY:return Z;case $.PLAYREADY:return Y;case $.WIDEVINE:return J;case $.CLEARKEY:return q}}function te(e){var t=e.drmSystems,r=e.widevineLicenseUrl,n=t?[$.FAIRPLAY,$.WIDEVINE,$.PLAYREADY,$.CLEARKEY].filter((function(e){return!!t[e]})):[];return!n[$.WIDEVINE]&&r&&n.push($.WIDEVINE),n}var re="undefined"!=typeof self&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null;function ne(e,t,r){return Uint8Array.prototype.slice?e.slice(t,r):new Uint8Array(Array.prototype.slice.call(e,t,r))}var ie,oe=function(e,t){return t+10<=e.length&&73===e[t]&&68===e[t+1]&&51===e[t+2]&&e[t+3]<255&&e[t+4]<255&&e[t+6]<128&&e[t+7]<128&&e[t+8]<128&&e[t+9]<128},ae=function(e,t){return t+10<=e.length&&51===e[t]&&68===e[t+1]&&73===e[t+2]&&e[t+3]<255&&e[t+4]<255&&e[t+6]<128&&e[t+7]<128&&e[t+8]<128&&e[t+9]<128},se=function(e,t){for(var r=t,n=0;oe(e,t);)n+=10,n+=le(e,t+6),ae(e,t+10)&&(n+=10),t+=n;if(n>0)return e.subarray(r,r+n)},le=function(e,t){var r=0;return r=(127&e[t])<<21,r|=(127&e[t+1])<<14,(r|=(127&e[t+2])<<7)|127&e[t+3]},ce=function(e,t){return oe(e,t)&&le(e,t+6)+10<=e.length-t},ue=function(e){return e&&"PRIV"===e.key&&"com.apple.streaming.transportStreamTimestamp"===e.info},de=function(e){var t=String.fromCharCode(e[0],e[1],e[2],e[3]),r=le(e,4);return{type:t,size:r,data:e.subarray(10,10+r)}},he=function(e){for(var t=0,r=[];oe(e,t);){for(var n=le(e,t+6),i=(t+=10)+n;t+8>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:c+=String.fromCharCode(o);break;case 12:case 13:a=e[u++],c+=String.fromCharCode((31&o)<<6|63&a);break;case 14:a=e[u++],s=e[u++],c+=String.fromCharCode((15&o)<<12|(63&a)<<6|63&s)}}return c};function be(){if(!navigator.userAgent.includes("PlayStation 4"))return ie||void 0===self.TextDecoder||(ie=new self.TextDecoder("utf-8")),ie}var _e=function(e){for(var t="",r=0;r>24,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=255&r}function Re(e,t){var r=[];if(!t.length)return r;for(var n=e.byteLength,i=0;i1?i+o:n;if(Ce(e.subarray(i+4,i+8))===t[0])if(1===t.length)r.push(e.subarray(i+8,a));else{var s=Re(e.subarray(i+8,a),t.slice(1));s.length&&we.apply(r,s)}i=a}return r}function Ae(e){var t=[],r=e[0],n=8,i=Pe(e,n);n+=4;n+=0===r?8:16,n+=2;var o=e.length+0,a=Oe(e,n);n+=2;for(var s=0;s>>31)return A.warn("SIDX has hierarchical references (not supported)"),null;var d=Pe(e,l);l+=4,t.push({referenceSize:u,subsegmentDuration:d,info:{duration:d/i,start:o,end:o+u-1}}),o+=u,n=l+=4}return{earliestPresentationTime:0,timescale:i,version:r,referencesCount:a,references:t}}function De(e){for(var t=[],r=Re(e,["moov","trak"]),n=0;n>1&63;return 39===r||40===r}return 6==(31&t)}function Ne(e,t,r,n){var i=Fe(e),o=0;o+=t;for(var a=0,s=0,l=!1,c=0;o=i.length)break;a+=c=i[o++]}while(255===c);s=0;do{if(o>=i.length)break;s+=c=i[o++]}while(255===c);var u=i.length-o;if(!l&&4===a&&o16){for(var b=[],_=0;_<16;_++){var S=i[o++].toString(16);b.push(1==S.length?"0"+S:S),3!==_&&5!==_&&7!==_&&9!==_||b.push("-")}for(var w=s-16,E=new Uint8Array(w),C=0;Cu)break}}function Fe(e){for(var t=e.byteLength,r=[],n=1;n0?(o=new Uint8Array(4),t.length>0&&new DataView(o.buffer).setUint32(0,t.length,!1)):o=new Uint8Array;var l=new Uint8Array(4);return r&&r.byteLength>0&&new DataView(l.buffer).setUint32(0,r.byteLength,!1),function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n>24&255,s[1]=o>>16&255,s[2]=o>>8&255,s[3]=255&o,s.set(e,4),a=0,o=8;a>8*(15-r)&255;return t}(t);return new e(this.method,this.uri,"identity",this.keyFormatVersions,r)}var n=z(this.uri);if(n)switch(this.keyFormat){case J:this.pssh=n,n.length>=22&&(this.keyId=n.subarray(n.length-22,n.length-6));break;case Y:var i=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=Be(i,null,n);var o=new Uint16Array(n.buffer,n.byteOffset,n.byteLength/2),a=String.fromCharCode.apply(null,Array.from(o)),s=a.substring(a.indexOf("<"),a.length),l=(new DOMParser).parseFromString(s,"text/xml").getElementsByTagName("KID")[0];if(l){var c=l.childNodes[0]?l.childNodes[0].nodeValue:l.getAttribute("VALUE");if(c){var u=W(c).subarray(0,16);(function(e){var t=function(e,t,r){var n=e[t];e[t]=e[r],e[r]=n};t(e,0,3),t(e,1,2),t(e,4,5),t(e,6,7)})(u),this.keyId=u}}break;default:var d=n.subarray(0,16);if(16!==d.length){var h=new Uint8Array(16);h.set(d,16-d.length),d=h}this.keyId=d}if(!this.keyId||16!==this.keyId.byteLength){var p=Ue[this.uri];if(!p){var f=Object.keys(Ue).length%Number.MAX_SAFE_INTEGER;p=new Uint8Array(16),new DataView(p.buffer,12,4).setUint32(0,f),Ue[this.uri]=p}this.keyId=p}return this},e}();var He=/\{\$([a-zA-Z0-9-_]+)\}/g;function Ge(e){return He.test(e)}function We(e,t,r){if(null!==e.variableList||e.hasVariableRefs)for(var n=r.length;n--;){var i=r[n],o=t[i];o&&(t[i]=ze(e,o))}}function ze(e,t){if(null!==e.variableList||e.hasVariableRefs){var r=e.variableList;return t.replace(He,(function(t){var n=t.substring(2,t.length-1),i=null==r?void 0:r[n];return void 0===i?(e.playlistParsingError||(e.playlistParsingError=new Error('Missing preceding EXT-X-DEFINE tag for Variable Reference: "'+n+'"')),t):i}))}return t}function Ke(e,t,r){var n,i,o=e.variableList;if(o||(e.variableList=o={}),"QUERYPARAM"in t){n=t.QUERYPARAM;try{var a=new self.URL(r).searchParams;if(!a.has(n))throw new Error('"'+n+'" does not match any query parameter in URI: "'+r+'"');i=a.get(n)}catch(t){e.playlistParsingError||(e.playlistParsingError=new Error("EXT-X-DEFINE QUERYPARAM: "+t.message))}}else n=t.NAME,i=t.VALUE;n in o?e.playlistParsingError||(e.playlistParsingError=new Error('EXT-X-DEFINE duplicate Variable Name declarations: "'+n+'"')):o[n]=i||""}function $e(e,t,r){var n=t.IMPORT;if(r&&n in r){var i=e.variableList;i||(e.variableList=i={}),i[n]=r[n]}else e.playlistParsingError||(e.playlistParsingError=new Error('EXT-X-DEFINE IMPORT attribute not found in Multivariant Playlist: "'+n+'"'))}function qe(){if("undefined"!=typeof self)return self.MediaSource||self.WebKitMediaSource}var Ze={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,av01:!0,drac:!0,dva1:!0,dvav:!0,dvh1:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0},text:{stpp:!0,wvtt:!0}},Ye=qe();function Je(e,t){var r;return null!=(r=null==Ye?void 0:Ye.isTypeSupported((t||"video")+'/mp4;codecs="'+e+'"'))&&r}var Qe=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-(SESSION-DATA|SESSION-KEY|DEFINE|CONTENT-STEERING|START):([^\r\n]*)[\r\n]+/g,Xe=/#EXT-X-MEDIA:(.*)/g,et=/^#EXT(?:INF|-X-TARGETDURATION):/m,tt=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),rt=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(DATERANGE|DEFINE|KEY|MAP|PART|PART-INF|PLAYLIST-TYPE|PRELOAD-HINT|RENDITION-REPORT|SERVER-CONTROL|SKIP|START):(.+)/.source,/#EXT-X-(BITRATE|DISCONTINUITY-SEQUENCE|MEDIA-SEQUENCE|TARGETDURATION|VERSION): *(\d+)/.source,/#EXT-X-(DISCONTINUITY|ENDLIST|GAP)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),nt=function(){function e(){}return e.findGroup=function(e,t){for(var r=0;r2){var r=t.shift()+".";return(r+=parseInt(t.shift()).toString(16))+("000"+parseInt(t.shift()).toString(16)).slice(-4)}return e},e.resolve=function(e,t){return y.buildAbsoluteURL(t,e,{alwaysNormalize:!0})},e.isMediaPlaylist=function(e){return et.test(e)},e.parseMasterPlaylist=function(t,r){var n,i={contentSteering:null,levels:[],playlistParsingError:null,sessionData:null,sessionKeys:null,startTimeOffset:null,variableList:null,hasVariableRefs:Ge(t)},o=[];for(Qe.lastIndex=0;null!=(n=Qe.exec(t));)if(n[1]){var a,s=new x(n[1]);We(i,s,["CODECS","SUPPLEMENTAL-CODECS","ALLOWED-CPC","PATHWAY-ID","STABLE-VARIANT-ID","AUDIO","VIDEO","SUBTITLES","CLOSED-CAPTIONS","NAME"]);var l=ze(i,n[2]),c={attrs:s,bitrate:s.decimalInteger("AVERAGE-BANDWIDTH")||s.decimalInteger("BANDWIDTH"),name:s.NAME,url:e.resolve(l,r)},u=s.decimalResolution("RESOLUTION");u&&(c.width=u.width,c.height=u.height),at((s.CODECS||"").split(/[ ,]+/).filter((function(e){return e})),c),c.videoCodec&&-1!==c.videoCodec.indexOf("avc1")&&(c.videoCodec=e.convertAVC1ToAVCOTI(c.videoCodec)),null!=(a=c.unknownCodecs)&&a.length||o.push(c),i.levels.push(c)}else if(n[3]){var d=n[3],h=n[4];switch(d){case"SESSION-DATA":var p=new x(h);We(i,p,["DATA-ID","LANGUAGE","VALUE","URI"]);var f=p["DATA-ID"];f&&(null===i.sessionData&&(i.sessionData={}),i.sessionData[f]=p);break;case"SESSION-KEY":var m=it(h,r,i);m.encrypted&&m.isSupported()?(null===i.sessionKeys&&(i.sessionKeys=[]),i.sessionKeys.push(m)):A.warn('[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "'+h+'"');break;case"DEFINE":var g=new x(h);We(i,g,["NAME","VALUE","QUERYPARAM"]),Ke(i,g,r);break;case"CONTENT-STEERING":var v=new x(h);We(i,v,["SERVER-URI","PATHWAY-ID"]),i.contentSteering={uri:e.resolve(v["SERVER-URI"],r),pathwayId:v["PATHWAY-ID"]||"."};break;case"START":i.startTimeOffset=ot(h)}}var y=o.length>0&&o.length0&&z.bool("CAN-SKIP-DATERANGES"),u.partHoldBack=z.optionalFloat("PART-HOLD-BACK",0),u.holdBack=z.optionalFloat("HOLD-BACK",0);break;case"PART-INF":var K=new x(T);u.partTarget=K.decimalFloatingPoint("PART-TARGET");break;case"PART":var $=u.partList;$||($=u.partList=[]);var q=f>0?$[$.length-1]:void 0,Z=f++,Y=new x(T);We(u,Y,["BYTERANGE","URI"]);var J=new H(Y,y,t,Z,q);$.push(J),y.duration+=J.duration;break;case"PRELOAD-HINT":var Q=new x(T);We(u,Q,["URI"]),u.preloadHint=Q;break;case"RENDITION-REPORT":var X=new x(T);We(u,X,["URI"]),u.renditionReports=u.renditionReports||[],u.renditionReports.push(X);break;default:A.warn("line parsed but not handled: "+a)}}}v&&!v.relurl?(d.pop(),m-=v.duration,u.partList&&(u.fragmentHint=v)):u.partList&&(lt(y,v),y.cc=g,u.fragmentHint=y,c&&ut(y,c,u));var ee=d.length,te=d[0],re=d[ee-1];if((m+=u.skippedSegments*u.targetduration)>0&&ee&&re){u.averagetargetduration=m/ee;var ne=re.sn;u.endSN="initSegment"!==ne?ne:0,u.live||(re.endList=!0),te&&(u.startCC=te.cc)}else u.endSN=0,u.startCC=0;return u.fragmentHint&&(m+=u.fragmentHint.duration),u.totalduration=m,u.endCC=g,_>0&&function(e,t){for(var r=e[t],n=t;n--;){var i=e[n];if(!i)return;i.programDateTime=r.programDateTime-1e3*i.duration,r=i}}(d,_),u},e}();function it(e,t,r){var n,i,o=new x(e);We(r,o,["KEYFORMAT","KEYFORMATVERSIONS","URI","IV","URI"]);var a=null!=(n=o.METHOD)?n:"",s=o.URI,l=o.hexadecimalInteger("IV"),c=o.KEYFORMATVERSIONS,u=null!=(i=o.KEYFORMAT)?i:"identity";s&&o.IV&&!l&&A.error("Invalid IV: "+o.IV);var d=s?nt.resolve(s,t):"",h=(c||"1").split("/").map(Number).filter(Number.isFinite);return new Ve(a,d,u,h,l)}function ot(e){var t=new x(e).decimalFloatingPoint("TIME-OFFSET");return b(t)?t:null}function at(e,t){["video","audio","text"].forEach((function(r){var n=e.filter((function(e){return function(e,t){var r=Ze[t];return!!r&&!0===r[e.slice(0,4)]}(e,r)}));if(n.length){var i=n.filter((function(e){return 0===e.lastIndexOf("avc1",0)||0===e.lastIndexOf("mp4a",0)}));t[r+"Codec"]=i.length>0?i[0]:n[0],e=e.filter((function(e){return-1===n.indexOf(e)}))}})),t.unknownCodecs=e}function st(e,t,r){var n=t[r];n&&(e[r]=n)}function lt(e,t){e.rawProgramDateTime?e.programDateTime=Date.parse(e.rawProgramDateTime):null!=t&&t.programDateTime&&(e.programDateTime=t.endProgramDateTime),b(e.programDateTime)||(e.programDateTime=null,e.rawProgramDateTime=null)}function ct(e,t,r,n){e.relurl=t.URI,t.BYTERANGE&&e.setByteRange(t.BYTERANGE),e.level=r,e.sn="initSegment",n&&(e.levelkeys=n),e.initSegment=null}function ut(e,t,r){e.levelkeys=t;var n=r.encryptedFragments;n.length&&n[n.length-1].levelkeys===t||!Object.keys(t).some((function(e){return t[e].isCommonEncryption}))||n.push(e)}var dt="manifest",ht="level",pt="audioTrack",ft="subtitleTrack",mt="main",gt="audio",vt="subtitle";function yt(e){switch(e.type){case pt:return gt;case ft:return vt;default:return mt}}function bt(e,t){var r=e.url;return void 0!==r&&0!==r.indexOf("data:")||(r=t.url),r}var _t=function(){function e(e){this.hls=void 0,this.loaders=Object.create(null),this.variableList=null,this.hls=e,this.registerListeners()}var t=e.prototype;return t.startLoad=function(e){},t.stopLoad=function(){this.destroyInternalLoaders()},t.registerListeners=function(){var e=this.hls;e.on(w.MANIFEST_LOADING,this.onManifestLoading,this),e.on(w.LEVEL_LOADING,this.onLevelLoading,this),e.on(w.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(w.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},t.unregisterListeners=function(){var e=this.hls;e.off(w.MANIFEST_LOADING,this.onManifestLoading,this),e.off(w.LEVEL_LOADING,this.onLevelLoading,this),e.off(w.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(w.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},t.createInternalLoader=function(e){var t=this.hls.config,r=t.pLoader,n=t.loader,i=new(r||n)(t);return this.loaders[e.type]=i,i},t.getInternalLoader=function(e){return this.loaders[e.type]},t.resetInternalLoader=function(e){this.loaders[e]&&delete this.loaders[e]},t.destroyInternalLoaders=function(){for(var e in this.loaders){var t=this.loaders[e];t&&t.destroy(),this.resetInternalLoader(e)}},t.destroy=function(){this.variableList=null,this.unregisterListeners(),this.destroyInternalLoaders()},t.onManifestLoading=function(e,t){var r=t.url;this.variableList=null,this.load({id:null,level:0,responseType:"text",type:dt,url:r,deliveryDirectives:null})},t.onLevelLoading=function(e,t){var r=t.id,n=t.level,i=t.url,o=t.deliveryDirectives;this.load({id:r,level:n,responseType:"text",type:ht,url:i,deliveryDirectives:o})},t.onAudioTrackLoading=function(e,t){var r=t.id,n=t.groupId,i=t.url,o=t.deliveryDirectives;this.load({id:r,groupId:n,level:null,responseType:"text",type:pt,url:i,deliveryDirectives:o})},t.onSubtitleTrackLoading=function(e,t){var r=t.id,n=t.groupId,i=t.url,o=t.deliveryDirectives;this.load({id:r,groupId:n,level:null,responseType:"text",type:ft,url:i,deliveryDirectives:o})},t.load=function(e){var t,r,n,i=this,o=this.hls.config,a=this.getInternalLoader(e);if(a){var l=a.context;if(l&&l.url===e.url)return void A.trace("[playlist-loader]: playlist request ongoing");A.log("[playlist-loader]: aborting previous loader for type: "+e.type),a.abort()}if(r=e.type===dt?o.manifestLoadPolicy.default:s({},o.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),a=this.createInternalLoader(e),null!=(t=e.deliveryDirectives)&&t.part&&(e.type===ht&&null!==e.level?n=this.hls.levels[e.level].details:e.type===pt&&null!==e.id?n=this.hls.audioTracks[e.id].details:e.type===ft&&null!==e.id&&(n=this.hls.subtitleTracks[e.id].details),n)){var c=n.partTarget,u=n.targetduration;if(c&&u){var d=1e3*Math.max(3*c,.8*u);r=s({},r,{maxTimeToFirstByteMs:Math.min(d,r.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(d,r.maxTimeToFirstByteMs)})}}var h=r.errorRetry||r.timeoutRetry||{},p={loadPolicy:r,timeout:r.maxLoadTimeMs,maxRetry:h.maxNumRetry||0,retryDelay:h.retryDelayMs||0,maxRetryDelay:h.maxRetryDelayMs||0},f={onSuccess:function(e,t,r,n){var o=i.getInternalLoader(r);i.resetInternalLoader(r.type);var a=e.data;0===a.indexOf("#EXTM3U")?(t.parsing.start=performance.now(),nt.isMediaPlaylist(a)?i.handleTrackOrLevelPlaylist(e,t,r,n||null,o):i.handleMasterPlaylist(e,t,r,n)):i.handleManifestParsingError(e,r,new Error("no EXTM3U delimiter"),n||null,t)},onError:function(e,t,r,n){i.handleNetworkError(t,r,!1,e,n)},onTimeout:function(e,t,r){i.handleNetworkError(t,r,!0,void 0,e)}};a.load(e,p,f)},t.handleMasterPlaylist=function(e,t,r,n){var i=this.hls,o=e.data,a=bt(e,r),s=nt.parseMasterPlaylist(o,a);if(s.playlistParsingError)this.handleManifestParsingError(e,r,s.playlistParsingError,n,t);else{var l=s.contentSteering,c=s.levels,u=s.sessionData,d=s.sessionKeys,h=s.startTimeOffset,p=s.variableList;this.variableList=p;var f=nt.parseMasterPlaylistMedia(o,a,s),m=f.AUDIO,g=void 0===m?[]:m,v=f.SUBTITLES,y=f["CLOSED-CAPTIONS"];g.length&&(g.some((function(e){return!e.url}))||!c[0].audioCodec||c[0].attrs.AUDIO||(A.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),g.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new x({}),bitrate:0,url:""}))),i.trigger(w.MANIFEST_LOADED,{levels:c,audioTracks:g,subtitles:v,captions:y,contentSteering:l,url:a,stats:t,networkDetails:n,sessionData:u,sessionKeys:d,startTimeOffset:h,variableList:p})}},t.handleTrackOrLevelPlaylist=function(e,t,r,n,i){var o=this.hls,a=r.id,s=r.level,l=r.type,c=bt(e,r),u=b(a)?a:0,d=b(s)?s:u,h=yt(r),p=nt.parseLevelPlaylist(e.data,c,d,h,u,this.variableList);if(l===dt){var f={attrs:new x({}),bitrate:0,details:p,name:"",url:c};o.trigger(w.MANIFEST_LOADED,{levels:[f],audioTracks:[],url:c,stats:t,networkDetails:n,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}t.parsing.end=performance.now(),r.levelDetails=p,this.handlePlaylistLoaded(p,e,t,r,n,i)},t.handleManifestParsingError=function(e,t,r,n,i){this.hls.trigger(w.ERROR,{type:E.NETWORK_ERROR,details:C.MANIFEST_PARSING_ERROR,fatal:t.type===dt,url:e.url,err:r,error:r,reason:r.message,response:e,context:t,networkDetails:n,stats:i})},t.handleNetworkError=function(e,t,r,i,o){void 0===r&&(r=!1);var a="A network "+(r?"timeout":"error"+(i?" (status "+i.code+")":""))+" occurred while loading "+e.type;e.type===ht?a+=": "+e.level+" id: "+e.id:e.type!==pt&&e.type!==ft||(a+=" id: "+e.id+' group-id: "'+e.groupId+'"');var s=new Error(a);A.warn("[playlist-loader]: "+a);var l=C.UNKNOWN,c=!1,u=this.getInternalLoader(e);switch(e.type){case dt:l=r?C.MANIFEST_LOAD_TIMEOUT:C.MANIFEST_LOAD_ERROR,c=!0;break;case ht:l=r?C.LEVEL_LOAD_TIMEOUT:C.LEVEL_LOAD_ERROR,c=!1;break;case pt:l=r?C.AUDIO_TRACK_LOAD_TIMEOUT:C.AUDIO_TRACK_LOAD_ERROR,c=!1;break;case ft:l=r?C.SUBTITLE_TRACK_LOAD_TIMEOUT:C.SUBTITLE_LOAD_ERROR,c=!1}u&&this.resetInternalLoader(e.type);var d={type:E.NETWORK_ERROR,details:l,fatal:c,url:e.url,loader:u,context:e,error:s,networkDetails:t,stats:o};if(i){var h=(null==t?void 0:t.url)||e.url;d.response=n({url:h,data:void 0},i)}this.hls.trigger(w.ERROR,d)},t.handlePlaylistLoaded=function(e,t,r,n,i,o){var a=this.hls,s=n.type,l=n.level,c=n.id,u=n.groupId,d=n.deliveryDirectives,h=bt(t,n),p=yt(n),f="number"==typeof n.level&&p===mt?l:void 0;if(e.fragments.length){e.targetduration||(e.playlistParsingError=new Error("Missing Target Duration"));var m=e.playlistParsingError;if(m)a.trigger(w.ERROR,{type:E.NETWORK_ERROR,details:C.LEVEL_PARSING_ERROR,fatal:!1,url:h,error:m,reason:m.message,response:t,context:n,level:f,parent:p,networkDetails:i,stats:r});else switch(e.live&&o&&(o.getCacheAge&&(e.ageHeader=o.getCacheAge()||0),o.getCacheAge&&!isNaN(e.ageHeader)||(e.ageHeader=0)),s){case dt:case ht:a.trigger(w.LEVEL_LOADED,{details:e,level:f||0,id:c||0,stats:r,networkDetails:i,deliveryDirectives:d});break;case pt:a.trigger(w.AUDIO_TRACK_LOADED,{details:e,id:c||0,groupId:u||"",stats:r,networkDetails:i,deliveryDirectives:d});break;case ft:a.trigger(w.SUBTITLE_TRACK_LOADED,{details:e,id:c||0,groupId:u||"",stats:r,networkDetails:i,deliveryDirectives:d})}}else{var g=new Error("No Segments found in Playlist");a.trigger(w.ERROR,{type:E.NETWORK_ERROR,details:C.LEVEL_EMPTY_ERROR,fatal:!1,url:h,error:g,reason:g.message,response:t,context:n,level:f,parent:p,networkDetails:i,stats:r})}},e}();function St(e,t){var r;try{r=new Event("addtrack")}catch(e){(r=document.createEvent("Event")).initEvent("addtrack",!1,!1)}r.track=e,t.dispatchEvent(r)}function wt(e,t){var r=e.mode;if("disabled"===r&&(e.mode="hidden"),e.cues&&!e.cues.getCueById(t.id))try{if(e.addCue(t),!e.cues.getCueById(t.id))throw new Error("addCue is failed for: "+t)}catch(r){A.debug("[texttrack-utils]: "+r);try{var n=new self.TextTrackCue(t.startTime,t.endTime,t.text);n.id=t.id,e.addCue(n)}catch(e){A.debug("[texttrack-utils]: Legacy TextTrackCue fallback failed: "+e)}}"disabled"===r&&(e.mode=r)}function Et(e){var t=e.mode;if("disabled"===t&&(e.mode="hidden"),e.cues)for(var r=e.cues.length;r--;)e.removeCue(e.cues[r]);"disabled"===t&&(e.mode=t)}function Ct(e,t,r,n){var i=e.mode;if("disabled"===i&&(e.mode="hidden"),e.cues&&e.cues.length>0)for(var o=function(e,t,r){var n=[],i=function(e,t){if(te[r].endTime)return-1;for(var n=0,i=r;n<=i;){var o=Math.floor((i+n)/2);if(te[o].startTime&&n-1)for(var o=i,a=e.length;o=t&&s.endTime<=r)n.push(s);else if(s.startTime>r)return n}return n}(e.cues,t,r),a=0;aAt&&(d=At),d-u<=0&&(d=u+.25);for(var h=0;ho.startDate&&e.push(r),e}),[]).sort((function(e,t){return e.startDate.getTime()-t.startDate.getTime()}))[0];v&&(f=Dt(v.startDate,h),u=!0)}for(var y=Object.keys(o.attr),b=0;b.05&&this.forwardBufferLength>1){var c=Math.min(2,Math.max(1,o)),u=Math.round(2/(1+Math.exp(-.75*s-this.edgeStalled))*20)/20;e.playbackRate=Math.min(c,Math.max(1,u))}else 1!==e.playbackRate&&0!==e.playbackRate&&(e.playbackRate=1)}}}}},t.estimateLiveEdge=function(){var e=this.levelDetails;return null===e?null:e.edge+e.age},t.computeLatency=function(){var e=this.estimateLiveEdge();return null===e?null:e-this.currentTime},o(e,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var e=this.config,t=this.levelDetails;return void 0!==e.liveMaxLatencyDuration?e.liveMaxLatencyDuration:t?e.liveMaxLatencyDurationCount*t.targetduration:0}},{key:"targetLatency",get:function(){var e=this.levelDetails;if(null===e)return null;var t=e.holdBack,r=e.partHoldBack,n=e.targetduration,i=this.config,o=i.liveSyncDuration,a=i.liveSyncDurationCount,s=i.lowLatencyMode,l=this.hls.userConfig,c=s&&r||t;(l.liveSyncDuration||l.liveSyncDurationCount||0===c)&&(c=void 0!==o?o:a*n);var u=n;return c+Math.min(1*this.stallCount,u)}},{key:"liveSyncPosition",get:function(){var e=this.estimateLiveEdge(),t=this.targetLatency,r=this.levelDetails;if(null===e||null===t||null===r)return null;var n=r.edge,i=e-t-this.edgeStalled,o=n-r.totalduration,a=n-(this.config.lowLatencyMode&&r.partTarget||r.targetduration);return Math.min(Math.max(o,i),a)}},{key:"drift",get:function(){var e=this.levelDetails;return null===e?1:e.drift}},{key:"edgeStalled",get:function(){var e=this.levelDetails;if(null===e)return 0;var t=3*(this.config.lowLatencyMode&&e.partTarget||e.targetduration);return Math.max(e.age-t,0)}},{key:"forwardBufferLength",get:function(){var e=this.media,t=this.levelDetails;if(!e||!t)return 0;var r=e.buffered.length;return(r?e.buffered.end(r-1):t.edge)-this.currentTime}}]),e}(),Mt=["NONE","TYPE-0","TYPE-1",null],Lt="",jt="YES",Nt="v2";var Ft=function(){function e(e,t,r){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=e,this.part=t,this.skip=r}return e.prototype.addDirectives=function(e){var t=new self.URL(e);return void 0!==this.msn&&t.searchParams.set("_HLS_msn",this.msn.toString()),void 0!==this.part&&t.searchParams.set("_HLS_part",this.part.toString()),this.skip&&t.searchParams.set("_HLS_skip",this.skip),t.href},e}(),Bt=function(){function e(e){this._attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.unknownCodecs=void 0,this.audioGroupIds=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.textGroupIds=void 0,this.url=void 0,this._urlId=0,this.url=[e.url],this._attrs=[e.attrs],this.bitrate=e.bitrate,e.details&&(this.details=e.details),this.id=e.id||0,this.name=e.name,this.width=e.width||0,this.height=e.height||0,this.audioCodec=e.audioCodec,this.videoCodec=e.videoCodec,this.unknownCodecs=e.unknownCodecs,this.codecSet=[e.videoCodec,e.audioCodec].filter((function(e){return e})).join(",").replace(/\.[^.,]+/g,"")}return e.prototype.addFallback=function(e){this.url.push(e.url),this._attrs.push(e.attrs)},o(e,[{key:"maxBitrate",get:function(){return Math.max(this.realBitrate,this.bitrate)}},{key:"attrs",get:function(){return this._attrs[this._urlId]}},{key:"pathwayId",get:function(){return this.attrs["PATHWAY-ID"]||"."}},{key:"uri",get:function(){return this.url[this._urlId]||""}},{key:"urlId",get:function(){return this._urlId},set:function(e){var t=e%this.url.length;this._urlId!==t&&(this.fragmentError=0,this.loadError=0,this.details=void 0,this._urlId=t)}},{key:"audioGroupId",get:function(){var e;return null==(e=this.audioGroupIds)?void 0:e[this.urlId]}},{key:"textGroupId",get:function(){var e;return null==(e=this.textGroupIds)?void 0:e[this.urlId]}}]),e}();function Ut(e,t){var r=t.startPTS;if(b(r)){var n,i=0;t.sn>e.sn?(i=r-e.start,n=e):(i=e.start-r,n=t),n.duration!==i&&(n.duration=i)}else t.sn>e.sn?e.cc===t.cc&&e.minEndPTS?t.start=e.start+(e.minEndPTS-e.start):t.start=e.start+e.duration:t.start=Math.max(e.start-t.duration,0)}function Vt(e,t,r,n,i,o){n-r<=0&&(A.warn("Fragment should have a positive duration",t),n=r+t.duration,o=i+t.duration);var a=r,s=n,l=t.startPTS,c=t.endPTS;if(b(l)){var u=Math.abs(l-r);b(t.deltaPTS)?t.deltaPTS=Math.max(u,t.deltaPTS):t.deltaPTS=u,a=Math.max(r,l),r=Math.min(r,l),i=Math.min(i,t.startDTS),s=Math.min(n,c),n=Math.max(n,c),o=Math.max(o,t.endDTS)}var d=r-t.start;0!==t.start&&(t.start=r),t.duration=n-t.start,t.startPTS=r,t.maxStartPTS=a,t.startDTS=i,t.endPTS=n,t.minEndPTS=s,t.endDTS=o;var h,p=t.sn;if(!e||pe.endSN)return 0;var f=p-e.startSN,m=e.fragments;for(m[f]=t,h=f;h>0;h--)Ut(m[h],m[h-1]);for(h=f;h=0;i--){var o=n[i].initSegment;if(o){r=o;break}}e.fragmentHint&&delete e.fragmentHint.endPTS;var a,l,c,u,d,h=0;if(function(e,t,r){for(var n=t.skippedSegments,i=Math.max(e.startSN,t.startSN)-t.startSN,o=(e.fragmentHint?1:0)+(n?t.endSN:Math.min(e.endSN,t.endSN))-t.startSN,a=t.startSN-e.startSN,s=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments,l=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments,c=i;c<=o;c++){var u=l[a+c],d=s[c];n&&!d&&c=n.length||Wt(t,n[r].start)}function Wt(e,t){if(t){for(var r=e.fragments,n=e.skippedSegments;n499)}(n)||!!r)}var Qt={search:function(e,t){for(var r=0,n=e.length-1,i=null,o=null;r<=n;){var a=t(o=e[i=(r+n)/2|0]);if(a>0)r=i+1;else{if(!(a<0))return o;n=i-1}}return null}};function Xt(e,t,r,n){void 0===r&&(r=0),void 0===n&&(n=0);var i=null;if(e?i=t[e.sn-t[0].sn+1]||null:0===r&&0===t[0].start&&(i=t[0]),i&&0===er(r,n,i))return i;var o=Qt.search(t,er.bind(null,r,n));return!o||o===e&&i?i:o}function er(e,t,r){if(void 0===e&&(e=0),void 0===t&&(t=0),r.start<=e&&r.start+r.duration>e)return 0;var n=Math.min(t,r.duration+(r.deltaPTS?r.deltaPTS:0));return r.start+r.duration-n<=e?1:r.start-n>e&&r.start?-1:0}function tr(e,t,r){var n=1e3*Math.min(t,r.duration+(r.deltaPTS?r.deltaPTS:0));return(r.endProgramDateTime||0)-n>e}var rr=3e5,nr=0,ir=2,or=5,ar=0,sr=1,lr=2,cr=function(){function e(e){this.hls=void 0,this.playlistError=0,this.penalizedRenditions={},this.log=void 0,this.warn=void 0,this.error=void 0,this.hls=e,this.log=A.log.bind(A,"[info]:"),this.warn=A.warn.bind(A,"[warning]:"),this.error=A.error.bind(A,"[error]:"),this.registerListeners()}var t=e.prototype;return t.registerListeners=function(){var e=this.hls;e.on(w.ERROR,this.onError,this),e.on(w.MANIFEST_LOADING,this.onManifestLoading,this),e.on(w.LEVEL_UPDATED,this.onLevelUpdated,this)},t.unregisterListeners=function(){var e=this.hls;e&&(e.off(w.ERROR,this.onError,this),e.off(w.ERROR,this.onErrorOut,this),e.off(w.MANIFEST_LOADING,this.onManifestLoading,this),e.off(w.LEVEL_UPDATED,this.onLevelUpdated,this))},t.destroy=function(){this.unregisterListeners(),this.hls=null,this.penalizedRenditions={}},t.startLoad=function(e){this.playlistError=0},t.stopLoad=function(){},t.getVariantLevelIndex=function(e){return(null==e?void 0:e.type)===mt?e.level:this.hls.loadLevel},t.onManifestLoading=function(){this.playlistError=0,this.penalizedRenditions={}},t.onLevelUpdated=function(){this.playlistError=0},t.onError=function(e,t){var r,n;if(!t.fatal){var i=this.hls,o=t.context;switch(t.details){case C.FRAG_LOAD_ERROR:case C.FRAG_LOAD_TIMEOUT:case C.KEY_LOAD_ERROR:case C.KEY_LOAD_TIMEOUT:return void(t.errorAction=this.getFragRetryOrSwitchAction(t));case C.FRAG_PARSING_ERROR:if(null!=(r=t.frag)&&r.gap)return void(t.errorAction={action:nr,flags:ar});case C.FRAG_GAP:case C.FRAG_DECRYPT_ERROR:return t.errorAction=this.getFragRetryOrSwitchAction(t),void(t.errorAction.action=ir);case C.LEVEL_EMPTY_ERROR:case C.LEVEL_PARSING_ERROR:var a,s,l=t.parent===mt?t.level:i.loadLevel;return void(t.details===C.LEVEL_EMPTY_ERROR&&null!=(a=t.context)&&null!=(s=a.levelDetails)&&s.live?t.errorAction=this.getPlaylistRetryOrSwitchAction(t,l):(t.levelRetry=!1,t.errorAction=this.getLevelSwitchAction(t,l)));case C.LEVEL_LOAD_ERROR:case C.LEVEL_LOAD_TIMEOUT:return void("number"==typeof(null==o?void 0:o.level)&&(t.errorAction=this.getPlaylistRetryOrSwitchAction(t,o.level)));case C.AUDIO_TRACK_LOAD_ERROR:case C.AUDIO_TRACK_LOAD_TIMEOUT:case C.SUBTITLE_LOAD_ERROR:case C.SUBTITLE_TRACK_LOAD_TIMEOUT:if(o){var c=i.levels[i.loadLevel];if(c&&(o.type===pt&&o.groupId===c.audioGroupId||o.type===ft&&o.groupId===c.textGroupId))return t.errorAction=this.getPlaylistRetryOrSwitchAction(t,i.loadLevel),t.errorAction.action=ir,void(t.errorAction.flags=sr)}return;case C.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:var u=i.levels[i.loadLevel],d=null==u?void 0:u.attrs["HDCP-LEVEL"];return void(d&&(t.errorAction={action:ir,flags:lr,hdcpLevel:d}));case C.BUFFER_ADD_CODEC_ERROR:case C.REMUX_ALLOC_ERROR:return void(t.errorAction=this.getLevelSwitchAction(t,null!=(n=t.level)?n:i.loadLevel));case C.INTERNAL_EXCEPTION:case C.BUFFER_APPENDING_ERROR:case C.BUFFER_APPEND_ERROR:case C.BUFFER_FULL_ERROR:case C.LEVEL_SWITCH_ERROR:case C.BUFFER_STALLED_ERROR:case C.BUFFER_SEEK_OVER_HOLE:case C.BUFFER_NUDGE_ON_STALL:return void(t.errorAction={action:nr,flags:ar})}if(t.type===E.KEY_SYSTEM_ERROR){var h=this.getVariantLevelIndex(t.frag);return t.levelRetry=!1,void(t.errorAction=this.getLevelSwitchAction(t,h))}}},t.getPlaylistRetryOrSwitchAction=function(e,t){var r,n=qt(this.hls.config.playlistLoadPolicy,e),i=this.playlistError++,o=null==(r=e.response)?void 0:r.code;if(Jt(n,i,$t(e),o))return{action:or,flags:ar,retryConfig:n,retryCount:i};var a=this.getLevelSwitchAction(e,t);return n&&(a.retryConfig=n,a.retryCount=i),a},t.getFragRetryOrSwitchAction=function(e){var t=this.hls,r=this.getVariantLevelIndex(e.frag),n=t.levels[r],i=t.config,o=i.fragLoadPolicy,a=i.keyLoadPolicy,s=qt(e.details.startsWith("key")?a:o,e),l=t.levels.reduce((function(e,t){return e+t.fragmentError}),0);if(n){var c;e.details!==C.FRAG_GAP&&n.fragmentError++;var u=null==(c=e.response)?void 0:c.code;if(Jt(s,l,$t(e),u))return{action:or,flags:ar,retryConfig:s,retryCount:l}}var d=this.getLevelSwitchAction(e,r);return s&&(d.retryConfig=s,d.retryCount=l),d},t.getLevelSwitchAction=function(e,t){var r=this.hls;null==t&&(t=r.loadLevel);var n=this.hls.levels[t];if(n&&(n.loadError++,r.autoLevelEnabled)){for(var i,o,a=-1,s=r.levels,l=r.loadLevel,c=r.minAutoLevel,u=r.maxAutoLevel,d=null==(i=e.frag)?void 0:i.type,h=null!=(o=e.context)?o:{},p=h.type,f=h.groupId,m=s.length;m--;){var g=(m+l)%s.length;if(g!==l&&g>=c&&g<=u&&0===s[g].loadError){var v=s[g];if(e.details===C.FRAG_GAP&&e.frag){var y=s[g].details;if(y){var b=Xt(e.frag,y.fragments,e.frag.start);if(null!=b&&b.gap)continue}}else{if(p===pt&&f===v.audioGroupId||p===ft&&f===v.textGroupId)continue;if(d===gt&&n.audioGroupId===v.audioGroupId||d===vt&&n.textGroupId===v.textGroupId)continue}a=g;break}}if(a>-1&&r.loadLevel!==a)return e.levelRetry=!0,this.playlistError=0,{action:ir,flags:ar,nextAutoLevel:a}}return{action:ir,flags:sr}},t.onErrorOut=function(e,t){var r;switch(null==(r=t.errorAction)?void 0:r.action){case nr:break;case ir:this.sendAlternateToPenaltyBox(t),t.errorAction.resolved||t.details===C.FRAG_GAP||(t.fatal=!0)}t.fatal&&this.hls.stopLoad()},t.sendAlternateToPenaltyBox=function(e){var t=this.hls,r=e.errorAction;if(r){var n=r.flags,i=r.hdcpLevel,o=r.nextAutoLevel;switch(n){case ar:this.switchLevel(e,o);break;case sr:r.resolved||(r.resolved=this.redundantFailover(e));break;case lr:i&&(t.maxHdcpLevel=Mt[Mt.indexOf(i)-1],r.resolved=!0),this.warn('Restricting playback to HDCP-LEVEL of "'+t.maxHdcpLevel+'" or lower')}r.resolved||this.switchLevel(e,o)}},t.switchLevel=function(e,t){void 0!==t&&e.errorAction&&(this.warn("switching to level "+t+" after "+e.details),this.hls.nextAutoLevel=t,e.errorAction.resolved=!0,this.hls.nextLoadLevel=this.hls.nextAutoLevel)},t.redundantFailover=function(e){var t=this,r=this.hls,n=this.penalizedRenditions,i=e.parent===mt?e.level:r.loadLevel,o=r.levels[i],a=o.url.length,s=e.frag?e.frag.urlId:o.urlId;o.urlId!==s||e.frag&&!o.details||this.penalizeRendition(o,e);for(var l=function(){var l=(s+c)%a,u=n[l];if(!u||function(e,t,r){if(performance.now()-e.lastErrorPerfMs>rr)return!0;var n=e.details;if(t.details===C.FRAG_GAP&&n&&t.frag){var i=t.frag.start,o=Xt(null,n.fragments,i);if(o&&!o.gap)return!0}if(r&&e.errors.length3*n.targetduration)return!0}return!1}(u,e,n[s]))return t.warn("Switching to Redundant Stream "+(l+1)+"/"+a+': "'+o.url[l]+'" after '+e.details),t.playlistError=0,r.levels.forEach((function(e){e.urlId=l})),r.nextLoadLevel=i,{v:!0}},c=1;c=0&&u>t.partTarget&&(c+=1)}return new Ft(l,c>=0?c:void 0,Lt)}}},t.loadPlaylist=function(e){-1===this.requestScheduled&&(this.requestScheduled=self.performance.now())},t.shouldLoadPlaylist=function(e){return this.canLoad&&!!e&&!!e.url&&(!e.details||e.details.live)},t.shouldReloadPlaylist=function(e){return-1===this.timer&&-1===this.requestScheduled&&this.shouldLoadPlaylist(e)},t.playlistLoaded=function(e,t,r){var n=this,i=t.details,o=t.stats,a=self.performance.now(),s=o.loading.first?Math.max(0,a-o.loading.first):0;if(i.advancedDateTime=Date.now()-s,i.live||null!=r&&r.live){if(i.reloaded(r),r&&this.log("live playlist "+e+" "+(i.advanced?"REFRESHED "+i.lastPartSn+"-"+i.lastPartIndex:i.updated?"UPDATED":"MISSED")),r&&i.fragments.length>0&&Ht(r,i),!this.canLoad||!i.live)return;var l,c=void 0,u=void 0;if(i.canBlockReload&&i.endSN&&i.advanced){var d=this.hls.config.lowLatencyMode,h=i.lastPartSn,p=i.endSN,f=i.lastPartIndex,m=h===p;-1!==f?(c=m?p+1:h,u=m?d?0:f:f+1):c=p+1;var g=i.age,v=g+i.ageHeader,y=Math.min(v-i.partTarget,1.5*i.targetduration);if(y>0){if(r&&y>r.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+r.tuneInGoal+" to: "+y+" with playlist age: "+i.age),y=0;else{var b=Math.floor(y/i.targetduration);c+=b,void 0!==u&&(u+=Math.round(y%i.targetduration/i.partTarget)),this.log("CDN Tune-in age: "+i.ageHeader+"s last advanced "+g.toFixed(2)+"s goal: "+y+" skip sn "+b+" to part "+u)}i.tuneInGoal=y}if(l=this.getDeliveryDirectives(i,t.deliveryDirectives,c,u),d||!m)return void this.loadPlaylist(l)}else(i.canBlockReload||i.canSkipUntil)&&(l=this.getDeliveryDirectives(i,t.deliveryDirectives,c,u));var _=this.hls.mainForwardBufferInfo,S=_?_.end-_.len:0,w=function(e,t){void 0===t&&(t=1/0);var r=1e3*e.targetduration;if(e.updated){var n=e.fragments;if(n.length&&4*r>t){var i=1e3*n[n.length-1].duration;ithis.requestScheduled+w&&(this.requestScheduled=o.loading.start),void 0!==c&&i.canBlockReload?this.requestScheduled=o.loading.first+w-(1e3*i.partTarget||1e3):-1===this.requestScheduled||this.requestScheduled+w=c.maxNumRetry)return!1;if(n&&null!=(d=e.context)&&d.deliveryDirectives)this.warn("Retrying playlist loading "+(l+1)+"/"+c.maxNumRetry+' after "'+r+'" without delivery-directives'),this.loadPlaylist();else{var h=Zt(c,l);this.timer=self.setTimeout((function(){return t.loadPlaylist()}),h),this.warn("Retrying playlist loading "+(l+1)+"/"+c.maxNumRetry+' after "'+r+'" in '+h+"ms")}e.levelRetry=!0,i.resolved=!0}return u},e}(),hr=function(e){function t(t,r){var n;return(n=e.call(this,t,"[level-controller]")||this)._levels=[],n._firstLevel=-1,n._startLevel=void 0,n.currentLevel=null,n.currentLevelIndex=-1,n.manualLevelIndex=-1,n.steering=void 0,n.onParsedComplete=void 0,n.steering=r,n._registerListeners(),n}l(t,e);var r=t.prototype;return r._registerListeners=function(){var e=this.hls;e.on(w.MANIFEST_LOADING,this.onManifestLoading,this),e.on(w.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(w.LEVEL_LOADED,this.onLevelLoaded,this),e.on(w.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(w.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.on(w.FRAG_LOADED,this.onFragLoaded,this),e.on(w.ERROR,this.onError,this)},r._unregisterListeners=function(){var e=this.hls;e.off(w.MANIFEST_LOADING,this.onManifestLoading,this),e.off(w.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(w.LEVEL_LOADED,this.onLevelLoaded,this),e.off(w.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(w.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.off(w.FRAG_LOADED,this.onFragLoaded,this),e.off(w.ERROR,this.onError,this)},r.destroy=function(){this._unregisterListeners(),this.steering=null,this.resetLevels(),e.prototype.destroy.call(this)},r.startLoad=function(){this._levels.forEach((function(e){e.loadError=0,e.fragmentError=0})),e.prototype.startLoad.call(this)},r.resetLevels=function(){this._startLevel=void 0,this.manualLevelIndex=-1,this.currentLevelIndex=-1,this.currentLevel=null,this._levels=[]},r.onManifestLoading=function(e,t){this.resetLevels()},r.onManifestLoaded=function(e,t){var r,n=[],i={};t.levels.forEach((function(e){var t,o=e.attrs;-1!==(null==(t=e.audioCodec)?void 0:t.indexOf("mp4a.40.34"))&&(ur||(ur=/chrome|firefox/i.test(navigator.userAgent)),ur&&(e.audioCodec=void 0));var a=o.AUDIO,s=o.CODECS,l=o["FRAME-RATE"],c=o["PATHWAY-ID"],u=o.RESOLUTION,d=o.SUBTITLES,h=(c||".")+"-"+e.bitrate+"-"+u+"-"+l+"-"+s;(r=i[h])?r.addFallback(e):(r=new Bt(e),i[h]=r,n.push(r)),pr(r,"audio",a),pr(r,"text",d)})),this.filterAndSortMediaOptions(n,t)},r.filterAndSortMediaOptions=function(e,t){var r=this,n=[],i=[],o=!1,a=!1,s=!1,l=e.filter((function(e){var t=e.audioCodec,r=e.videoCodec,n=e.width,i=e.height,l=e.unknownCodecs;return o||(o=!(!n||!i)),a||(a=!!r),s||(s=!!t),!(null!=l&&l.length)&&(!t||Je(t,"audio"))&&(!r||Je(r,"video"))}));if((o||a)&&s&&(l=l.filter((function(e){var t=e.videoCodec,r=e.width,n=e.height;return!!t||!(!r||!n)}))),0!==l.length){t.audioTracks&&fr(n=t.audioTracks.filter((function(e){return!e.audioCodec||Je(e.audioCodec,"audio")}))),t.subtitles&&fr(i=t.subtitles);var c=l.slice(0);l.sort((function(e,t){return e.attrs["HDCP-LEVEL"]!==t.attrs["HDCP-LEVEL"]?(e.attrs["HDCP-LEVEL"]||"")>(t.attrs["HDCP-LEVEL"]||"")?1:-1:e.bitrate!==t.bitrate?e.bitrate-t.bitrate:e.attrs["FRAME-RATE"]!==t.attrs["FRAME-RATE"]?e.attrs.decimalFloatingPoint("FRAME-RATE")-t.attrs.decimalFloatingPoint("FRAME-RATE"):e.attrs.SCORE!==t.attrs.SCORE?e.attrs.decimalFloatingPoint("SCORE")-t.attrs.decimalFloatingPoint("SCORE"):o&&e.height!==t.height?e.height-t.height:0}));var u=c[0];if(this.steering&&(l=this.steering.filterParsedLevels(l)).length!==c.length)for(var d=0;d1&&void 0!==t?(i.url=i.url.filter(n),i.audioGroupIds&&(i.audioGroupIds=i.audioGroupIds.filter(n)),i.textGroupIds&&(i.textGroupIds=i.textGroupIds.filter(n)),i.urlId=0,!0):(r.steering&&r.steering.removeLevel(i),!1))}));this.hls.trigger(w.LEVELS_UPDATED,{levels:i})},r.onLevelsUpdated=function(e,t){var r=t.levels;r.forEach((function(e,t){var r=e.details;null!=r&&r.fragments&&r.fragments.forEach((function(e){e.level=t}))})),this._levels=r},o(t,[{key:"levels",get:function(){return 0===this._levels.length?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(e){var t=this._levels;if(0!==t.length){if(e<0||e>=t.length){var r=new Error("invalid level idx"),n=e<0;if(this.hls.trigger(w.ERROR,{type:E.OTHER_ERROR,details:C.LEVEL_SWITCH_ERROR,level:e,fatal:n,error:r,reason:r.message}),n)return;e=Math.min(e,t.length-1)}var i=this.currentLevelIndex,o=this.currentLevel,a=o?o.attrs["PATHWAY-ID"]:void 0,l=t[e],c=l.attrs["PATHWAY-ID"];if(this.currentLevelIndex=e,this.currentLevel=l,i!==e||!l.details||!o||a!==c){this.log("Switching to level "+e+(c?" with Pathway "+c:"")+" from level "+i+(a?" with Pathway "+a:""));var u=s({},l,{level:e,maxBitrate:l.maxBitrate,attrs:l.attrs,uri:l.uri,urlId:l.urlId});delete u._attrs,delete u._urlId,this.hls.trigger(w.LEVEL_SWITCHING,u);var d=l.details;if(!d||d.live){var h=this.switchParams(l.uri,null==o?void 0:o.details);this.loadPlaylist(h)}}}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(e){this.manualLevelIndex=e,void 0===this._startLevel&&(this._startLevel=e),-1!==e&&(this.level=e)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(e){this._firstLevel=e}},{key:"startLevel",get:function(){if(void 0===this._startLevel){var e=this.hls.config.startLevel;return void 0!==e?e:this._firstLevel}return this._startLevel},set:function(e){this._startLevel=e}},{key:"nextLoadLevel",get:function(){return-1!==this.manualLevelIndex?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(e){this.level=e,-1===this.manualLevelIndex&&(this.hls.nextAutoLevel=e)}}]),t}(dr);function pr(e,t,r){r&&("audio"===t?(e.audioGroupIds||(e.audioGroupIds=[]),e.audioGroupIds[e.url.length-1]=r):"text"===t&&(e.textGroupIds||(e.textGroupIds=[]),e.textGroupIds[e.url.length-1]=r))}function fr(e){var t={};e.forEach((function(e){var r=e.groupId||"";e.id=t[r]=t[r]||0,t[r]++}))}var mr="NOT_LOADED",gr="APPENDING",vr="PARTIAL",yr="OK",br=function(){function e(e){this.activePartLists=Object.create(null),this.endListFragments=Object.create(null),this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hasGaps=!1,this.hls=e,this._registerListeners()}var t=e.prototype;return t._registerListeners=function(){var e=this.hls;e.on(w.BUFFER_APPENDED,this.onBufferAppended,this),e.on(w.FRAG_BUFFERED,this.onFragBuffered,this),e.on(w.FRAG_LOADED,this.onFragLoaded,this)},t._unregisterListeners=function(){var e=this.hls;e.off(w.BUFFER_APPENDED,this.onBufferAppended,this),e.off(w.FRAG_BUFFERED,this.onFragBuffered,this),e.off(w.FRAG_LOADED,this.onFragLoaded,this)},t.destroy=function(){this._unregisterListeners(),this.fragments=this.activePartLists=this.endListFragments=this.timeRanges=null},t.getAppendedFrag=function(e,t){var r=this.activePartLists[t];if(r)for(var n=r.length;n--;){var i=r[n];if(!i)break;var o=i.end;if(i.start<=e&&null!==o&&e<=o)return i}return this.getBufferedFrag(e,t)},t.getBufferedFrag=function(e,t){for(var r=this.fragments,n=Object.keys(r),i=n.length;i--;){var o=r[n[i]];if((null==o?void 0:o.body.type)===t&&o.buffered){var a=o.body;if(a.start<=e&&e<=a.end)return a}}return null},t.detectEvictedFragments=function(e,t,r,n){var i=this;this.timeRanges&&(this.timeRanges[e]=t);var o=(null==n?void 0:n.fragment.sn)||-1;Object.keys(this.fragments).forEach((function(n){var a=i.fragments[n];if(a&&!(o>=a.body.sn))if(a.buffered||a.loaded){var s=a.range[e];s&&s.time.some((function(e){var r=!i.isTimeBuffered(e.startPTS,e.endPTS,t);return r&&i.removeFragment(a.body),r}))}else a.body.type===r&&i.removeFragment(a.body)}))},t.detectPartialFragments=function(e){var t=this,r=this.timeRanges,n=e.frag,i=e.part;if(r&&"initSegment"!==n.sn){var o=Sr(n),a=this.fragments[o];if(!(!a||a.buffered&&n.gap)){var s=!n.relurl;Object.keys(r).forEach((function(e){var o=n.elementaryStreams[e];if(o){var l=r[e],c=s||!0===o.partial;a.range[e]=t.getBufferedTimes(n,i,c,l)}})),a.loaded=null,Object.keys(a.range).length?(a.buffered=!0,(a.body.endList=n.endList||a.body.endList)&&(this.endListFragments[a.body.type]=a),_r(a)||this.removeParts(n.sn-1,n.type)):this.removeFragment(a.body)}}},t.removeParts=function(e,t){var r=this.activePartLists[t];r&&(this.activePartLists[t]=r.filter((function(t){return t.fragment.sn>=e})))},t.fragBuffered=function(e,t){var r=Sr(e),n=this.fragments[r];!n&&t&&(n=this.fragments[r]={body:e,appendedPTS:null,loaded:null,buffered:!1,range:Object.create(null)},e.gap&&(this.hasGaps=!0)),n&&(n.loaded=null,n.buffered=!0)},t.getBufferedTimes=function(e,t,r,n){for(var i={time:[],partial:r},o=e.start,a=e.end,s=e.minEndPTS||a,l=e.maxStartPTS||o,c=0;c=u&&s<=d){i.time.push({startPTS:Math.max(o,n.start(c)),endPTS:Math.min(a,n.end(c))});break}if(ou)i.partial=!0,i.time.push({startPTS:Math.max(o,n.start(c)),endPTS:Math.min(a,n.end(c))});else if(a<=u)break}return i},t.getPartialFragment=function(e){var t,r,n,i=null,o=0,a=this.bufferPadding,s=this.fragments;return Object.keys(s).forEach((function(l){var c=s[l];c&&_r(c)&&(r=c.body.start-a,n=c.body.end+a,e>=r&&e<=n&&(t=Math.min(e-r,n-e),o<=t&&(i=c.body,o=t)))})),i},t.isEndListAppended=function(e){var t=this.endListFragments[e];return void 0!==t&&(t.buffered||_r(t))},t.getState=function(e){var t=Sr(e),r=this.fragments[t];return r?r.buffered?_r(r)?vr:yr:gr:mr},t.isTimeBuffered=function(e,t,r){for(var n,i,o=0;o=n&&t<=i)return!0;if(t<=n)return!1}return!1},t.onFragLoaded=function(e,t){var r=t.frag,n=t.part;if("initSegment"!==r.sn&&!r.bitrateTest){var i=n?null:t,o=Sr(r);this.fragments[o]={body:r,appendedPTS:null,loaded:i,buffered:!1,range:Object.create(null)}}},t.onBufferAppended=function(e,t){var r=this,n=t.frag,i=t.part,o=t.timeRanges;if("initSegment"!==n.sn){var a=n.type;if(i){var s=this.activePartLists[a];s||(this.activePartLists[a]=s=[]),s.push(i)}this.timeRanges=o,Object.keys(o).forEach((function(e){var t=o[e];r.detectEvictedFragments(e,t,a,i)}))}},t.onFragBuffered=function(e,t){this.detectPartialFragments(t)},t.hasFragment=function(e){var t=Sr(e);return!!this.fragments[t]},t.hasParts=function(e){var t;return!(null==(t=this.activePartLists[e])||!t.length)},t.removeFragmentsInRange=function(e,t,r,n,i){var o=this;n&&!this.hasGaps||Object.keys(this.fragments).forEach((function(a){var s=o.fragments[a];if(s){var l=s.body;l.type!==r||n&&!l.gap||l.starte&&(s.buffered||i)&&o.removeFragment(l)}}))},t.removeFragment=function(e){var t=Sr(e);e.stats.loaded=0,e.clearElementaryStreamInfo();var r=this.activePartLists[e.type];if(r){var n=e.sn;this.activePartLists[e.type]=r.filter((function(e){return e.fragment.sn!==n}))}delete this.fragments[t],e.endList&&delete this.endListFragments[e.type]},t.removeAllFragments=function(){this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activePartLists=Object.create(null),this.hasGaps=!1},e}();function _r(e){var t,r,n;return e.buffered&&(e.body.gap||(null==(t=e.range.video)?void 0:t.partial)||(null==(r=e.range.audio)?void 0:r.partial)||(null==(n=e.range.audiovideo)?void 0:n.partial))}function Sr(e){return e.type+"_"+e.level+"_"+e.urlId+"_"+e.sn}var wr=Math.pow(2,17),Er=function(){function e(e){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=e}var t=e.prototype;return t.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},t.abort=function(){this.loader&&this.loader.abort()},t.load=function(e,t){var r=this,i=e.url;if(!i)return Promise.reject(new Pr({type:E.NETWORK_ERROR,details:C.FRAG_LOAD_ERROR,fatal:!1,frag:e,error:new Error("Fragment does not have a "+(i?"part list":"url")),networkDetails:null}));this.abort();var o=this.config,a=o.fLoader,s=o.loader;return new Promise((function(l,c){if(r.loader&&r.loader.destroy(),e.gap){if(e.tagList.some((function(e){return"GAP"===e[0]})))return void c(Or(e));e.gap=!1}var u=r.loader=e.loader=a?new a(o):new s(o),d=Cr(e),h=Yt(o.fragLoadPolicy.default),p={loadPolicy:h,timeout:h.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:"initSegment"===e.sn?1/0:wr};e.stats=u.stats,u.load(d,p,{onSuccess:function(t,n,i,o){r.resetLoader(e,u);var a=t.data;i.resetIV&&e.decryptdata&&(e.decryptdata.iv=new Uint8Array(a.slice(0,16)),a=a.slice(16)),l({frag:e,part:null,payload:a,networkDetails:o})},onError:function(t,o,a,s){r.resetLoader(e,u),c(new Pr({type:E.NETWORK_ERROR,details:C.FRAG_LOAD_ERROR,fatal:!1,frag:e,response:n({url:i,data:void 0},t),error:new Error("HTTP Error "+t.code+" "+t.text),networkDetails:a,stats:s}))},onAbort:function(t,n,i){r.resetLoader(e,u),c(new Pr({type:E.NETWORK_ERROR,details:C.INTERNAL_ABORTED,fatal:!1,frag:e,error:new Error("Aborted"),networkDetails:i,stats:t}))},onTimeout:function(t,n,i){r.resetLoader(e,u),c(new Pr({type:E.NETWORK_ERROR,details:C.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,error:new Error("Timeout after "+p.timeout+"ms"),networkDetails:i,stats:t}))},onProgress:function(r,n,i,o){t&&t({frag:e,part:null,payload:i,networkDetails:o})}})}))},t.loadPart=function(e,t,r){var i=this;this.abort();var o=this.config,a=o.fLoader,s=o.loader;return new Promise((function(l,c){if(i.loader&&i.loader.destroy(),e.gap||t.gap)c(Or(e,t));else{var u=i.loader=e.loader=a?new a(o):new s(o),d=Cr(e,t),h=Yt(o.fragLoadPolicy.default),p={loadPolicy:h,timeout:h.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:wr};t.stats=u.stats,u.load(d,p,{onSuccess:function(n,o,a,s){i.resetLoader(e,u),i.updateStatsFromPart(e,t);var c={frag:e,part:t,payload:n.data,networkDetails:s};r(c),l(c)},onError:function(r,o,a,s){i.resetLoader(e,u),c(new Pr({type:E.NETWORK_ERROR,details:C.FRAG_LOAD_ERROR,fatal:!1,frag:e,part:t,response:n({url:d.url,data:void 0},r),error:new Error("HTTP Error "+r.code+" "+r.text),networkDetails:a,stats:s}))},onAbort:function(r,n,o){e.stats.aborted=t.stats.aborted,i.resetLoader(e,u),c(new Pr({type:E.NETWORK_ERROR,details:C.INTERNAL_ABORTED,fatal:!1,frag:e,part:t,error:new Error("Aborted"),networkDetails:o,stats:r}))},onTimeout:function(r,n,o){i.resetLoader(e,u),c(new Pr({type:E.NETWORK_ERROR,details:C.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,part:t,error:new Error("Timeout after "+p.timeout+"ms"),networkDetails:o,stats:r}))}})}}))},t.updateStatsFromPart=function(e,t){var r=e.stats,n=t.stats,i=n.total;if(r.loaded+=n.loaded,i){var o=Math.round(e.duration/t.duration),a=Math.min(Math.round(r.loaded/i),o),s=(o-a)*Math.round(r.loaded/a);r.total=r.loaded+s}else r.total=Math.max(r.loaded,r.total);var l=r.loading,c=n.loading;l.start?l.first+=c.first-c.start:(l.start=c.start,l.first=c.first),l.end=c.end},t.resetLoader=function(e,t){e.loader=null,this.loader===t&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),t.destroy()},e}();function Cr(e,t){void 0===t&&(t=null);var r=t||e,n={frag:e,part:t,responseType:"arraybuffer",url:r.url,headers:{},rangeStart:0,rangeEnd:0},i=r.byteRangeStartOffset,o=r.byteRangeEndOffset;if(b(i)&&b(o)){var a,s=i,l=o;if("initSegment"===e.sn&&"AES-128"===(null==(a=e.decryptdata)?void 0:a.method)){var c=o-i;c%16&&(l=o+(16-c%16)),0!==i&&(n.resetIV=!0,s=i-16)}n.rangeStart=s,n.rangeEnd=l}return n}function Or(e,t){var r=new Error("GAP "+(e.gap?"tag":"attribute")+" found"),n={type:E.MEDIA_ERROR,details:C.FRAG_GAP,fatal:!1,frag:e,error:r,networkDetails:null};return t&&(n.part=t),(t||e).stats.aborted=!0,new Pr(n)}var Pr=function(e){function t(t){var r;return(r=e.call(this,t.error.message)||this).data=void 0,r.data=t,r}return l(t,e),t}(h(Error)),Tr=function(){function e(e){this.config=void 0,this.keyUriToKeyInfo={},this.emeController=null,this.config=e}var t=e.prototype;return t.abort=function(e){for(var t in this.keyUriToKeyInfo){var r=this.keyUriToKeyInfo[t].loader;if(r){if(e&&e!==r.context.frag.type)return;r.abort()}}},t.detach=function(){for(var e in this.keyUriToKeyInfo){var t=this.keyUriToKeyInfo[e];(t.mediaKeySessionContext||t.decryptdata.isCommonEncryption)&&delete this.keyUriToKeyInfo[e]}},t.destroy=function(){for(var e in this.detach(),this.keyUriToKeyInfo){var t=this.keyUriToKeyInfo[e].loader;t&&t.destroy()}this.keyUriToKeyInfo={}},t.createKeyLoadError=function(e,t,r,n,i){return void 0===t&&(t=C.KEY_LOAD_ERROR),new Pr({type:E.NETWORK_ERROR,details:t,fatal:!1,frag:e,response:i,error:r,networkDetails:n})},t.loadClear=function(e,t){var r=this;if(this.emeController&&this.config.emeEnabled)for(var n=e.sn,i=e.cc,o=function(){var e=t[a];if(i<=e.cc&&("initSegment"===n||"initSegment"===e.sn||n1&&this.tickImmediate(),this._tickCallCount=0)},t.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},t.doTick=function(){},e}(),Rr={length:0,start:function(){return 0},end:function(){return 0}},Ar=function(){function e(){}return e.isBuffered=function(t,r){try{if(t)for(var n=e.getBuffered(t),i=0;i=n.start(i)&&r<=n.end(i))return!0}catch(e){}return!1},e.bufferInfo=function(t,r,n){try{if(t){var i,o=e.getBuffered(t),a=[];for(i=0;ia&&(n[o-1].end=e[i].end):n.push(e[i])}else n.push(e[i])}else n=e;for(var s,l=0,c=t,u=t,d=0;d=h&&tr.startCC||e&&e.cc>>8^255&g^99,e[p]=g,t[g]=p;var v=h[p],y=h[v],b=h[y],_=257*h[g]^16843008*g;n[p]=_<<24|_>>>8,i[p]=_<<16|_>>>16,o[p]=_<<8|_>>>24,a[p]=_,_=16843009*b^65537*y^257*v^16843008*p,l[g]=_<<24|_>>>8,c[g]=_<<16|_>>>16,u[g]=_<<8|_>>>24,d[g]=_,p?(p=v^h[h[h[b^v]]],f^=h[h[f]]):p=f=1}},t.expandKey=function(e){for(var t=this.uint8ArrayToUint32Array_(e),r=!0,n=0;na.end){var u=o>c;(o0&&o&&o.key&&o.iv&&"AES-128"===o.method){var a=self.performance.now();return r.decrypter.decrypt(new Uint8Array(i),o.key.buffer,o.iv.buffer).catch((function(t){throw n.trigger(w.ERROR,{type:E.MEDIA_ERROR,details:C.FRAG_DECRYPT_ERROR,fatal:!1,error:t,reason:t.message,frag:e}),t})).then((function(r){var i=self.performance.now();return n.trigger(w.FRAG_DECRYPTED,{frag:e,payload:r,stats:{tstart:a,tdecrypt:i}}),t.payload=r,t}))}return t})).then((function(n){var i=r.fragCurrent,o=r.hls;if(!r.levels)throw new Error("init load aborted, missing levels");var a=e.stats;r.state=Gr,t.fragmentError=0,e.data=new Uint8Array(n.payload),a.parsing.start=a.buffering.start=self.performance.now(),a.parsing.end=a.buffering.end=self.performance.now(),n.frag===i&&o.trigger(w.FRAG_BUFFERED,{stats:a,frag:i,part:null,id:e.type}),r.tick()})).catch((function(t){r.state!==Hr&&r.state!==Jr&&(r.warn(t),r.resetFragmentLoading(e))}))},r.fragContextChanged=function(e){var t=this.fragCurrent;return!e||!t||e.level!==t.level||e.sn!==t.sn||e.urlId!==t.urlId},r.fragBufferedComplete=function(e,t){var r,n,i,o,a=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+e.type+" sn: "+e.sn+(t?" part: "+t.index:"")+" of "+(this.playlistType===mt?"level":"track")+" "+e.level+" (frag:["+(null!=(r=e.startPTS)?r:NaN).toFixed(3)+"-"+(null!=(n=e.endPTS)?n:NaN).toFixed(3)+"] > buffer:"+(a?Vr(Ar.getBuffered(a)):"(detached)")+")"),this.state=Gr,a&&(!this.loadedmetadata&&e.type==mt&&a.buffered.length&&(null==(i=this.fragCurrent)?void 0:i.sn)===(null==(o=this.fragPrevious)?void 0:o.sn)&&(this.loadedmetadata=!0,this.seekToStartPos()),this.tick())},r.seekToStartPos=function(){},r._handleFragmentLoadComplete=function(e){var t=this.transmuxer;if(t){var r=e.frag,n=e.part,i=e.partsLoaded,o=!i||0===i.length||i.some((function(e){return!e})),a=new Dr(r.level,r.sn,r.stats.chunkCount+1,0,n?n.index:-1,!o);t.flush(a)}},r._handleFragmentLoadProgress=function(e){},r._doFragLoad=function(e,t,r,n){var i,o=this;void 0===r&&(r=null);var a=null==t?void 0:t.details;if(!this.levels||!a)throw new Error("frag load aborted, missing level"+(a?"":" detail")+"s");var s=null;if(!e.encrypted||null!=(i=e.decryptdata)&&i.key?!e.encrypted&&a.encryptedFragments.length&&this.keyLoader.loadClear(e,a.encryptedFragments):(this.log("Loading key for "+e.sn+" of ["+a.startSN+"-"+a.endSN+"], "+("[stream-controller]"===this.logPrefix?"level":"track")+" "+e.level),this.state=Wr,this.fragCurrent=e,s=this.keyLoader.load(e).then((function(e){if(!o.fragContextChanged(e.frag))return o.hls.trigger(w.KEY_LOADED,e),o.state===Wr&&(o.state=Gr),e})),this.hls.trigger(w.KEY_LOADING,{frag:e}),null===this.fragCurrent&&(s=Promise.reject(new Error("frag load aborted, context changed in KEY_LOADING")))),r=Math.max(e.start,r||0),this.config.lowLatencyMode&&"initSegment"!==e.sn){var l=a.partList;if(l&&n){r>e.end&&a.fragmentHint&&(e=a.fragmentHint);var c=this.getNextPart(l,e,r);if(c>-1){var u,d=l[c];return this.log("Loading part sn: "+e.sn+" p: "+d.index+" cc: "+e.cc+" of playlist ["+a.startSN+"-"+a.endSN+"] parts [0-"+c+"-"+(l.length-1)+"] "+("[stream-controller]"===this.logPrefix?"level":"track")+": "+e.level+", target: "+parseFloat(r.toFixed(3))),this.nextLoadPosition=d.start+d.duration,this.state=zr,u=s?s.then((function(r){return!r||o.fragContextChanged(r.frag)?null:o.doFragPartsLoad(e,d,t,n)})).catch((function(e){return o.handleFragLoadError(e)})):this.doFragPartsLoad(e,d,t,n).catch((function(e){return o.handleFragLoadError(e)})),this.hls.trigger(w.FRAG_LOADING,{frag:e,part:d,targetBufferTime:r}),null===this.fragCurrent?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):u}if(!e.url||this.loadedEndOfParts(l,r))return Promise.resolve(null)}}this.log("Loading fragment "+e.sn+" cc: "+e.cc+" "+(a?"of ["+a.startSN+"-"+a.endSN+"] ":"")+("[stream-controller]"===this.logPrefix?"level":"track")+": "+e.level+", target: "+parseFloat(r.toFixed(3))),b(e.sn)&&!this.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),this.state=zr;var h,p=this.config.progressive;return h=p&&s?s.then((function(t){return!t||o.fragContextChanged(null==t?void 0:t.frag)?null:o.fragmentLoader.load(e,n)})).catch((function(e){return o.handleFragLoadError(e)})):Promise.all([this.fragmentLoader.load(e,p?n:void 0),s]).then((function(e){var t=e[0];return!p&&t&&n&&n(t),t})).catch((function(e){return o.handleFragLoadError(e)})),this.hls.trigger(w.FRAG_LOADING,{frag:e,targetBufferTime:r}),null===this.fragCurrent?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING")):h},r.doFragPartsLoad=function(e,t,r,n){var i=this;return new Promise((function(o,a){var s,l=[],c=null==(s=r.details)?void 0:s.partList;!function t(s){i.fragmentLoader.loadPart(e,s,n).then((function(n){l[s.index]=n;var a=n.part;i.hls.trigger(w.FRAG_LOADED,n);var u=zt(r,e.sn,s.index+1)||Kt(c,e.sn,s.index+1);if(!u)return o({frag:e,part:a,partsLoaded:l});t(u)})).catch(a)}(t)}))},r.handleFragLoadError=function(e){if("data"in e){var t=e.data;e.data&&t.details===C.INTERNAL_ABORTED?this.handleFragLoadAborted(t.frag,t.part):this.hls.trigger(w.ERROR,t)}else this.hls.trigger(w.ERROR,{type:E.OTHER_ERROR,details:C.INTERNAL_EXCEPTION,err:e,error:e,fatal:!0});return null},r._handleTransmuxerFlush=function(e){var t=this.getCurrentContext(e);if(t&&this.state===qr){var r=t.frag,n=t.part,i=t.level,o=self.performance.now();r.stats.parsing.end=o,n&&(n.stats.parsing.end=o),this.updateLevelTiming(r,n,i,e.partial)}else this.fragCurrent||this.state===Hr||this.state===Jr||(this.state=Gr)},r.getCurrentContext=function(e){var t=this.levels,r=this.fragCurrent,n=e.level,i=e.sn,o=e.part;if(null==t||!t[n])return this.warn("Levels object was unset while buffering fragment "+i+" of level "+n+". The current chunk will not be buffered."),null;var a=t[n],s=o>-1?zt(a,i,o):null,l=s?s.fragment:function(e,t,r){if(null==e||!e.details)return null;var n=e.details,i=n.fragments[t-n.startSN];return i||((i=n.fragmentHint)&&i.sn===t?i:to&&this.flushMainBuffer(a,e.start)}else this.flushMainBuffer(0,e.start)},r.getFwdBufferInfo=function(e,t){var r=this.getLoadPosition();return b(r)?this.getFwdBufferInfoAtPos(e,r,t):null},r.getFwdBufferInfoAtPos=function(e,t,r){var n=this.config.maxBufferHole,i=Ar.bufferInfo(e,t,n);if(0===i.len&&void 0!==i.nextStart){var o=this.fragmentTracker.getBufferedFrag(t,r);if(o&&i.nextStart=r&&(t.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+t.maxMaxBufferLength+"s"),!0)},r.getAppendedFrag=function(e,t){var r=this.fragmentTracker.getAppendedFrag(e,mt);return r&&"fragment"in r?r.fragment:r},r.getNextFragment=function(e,t){var r=t.fragments,n=r.length;if(!n)return null;var i,o=this.config,a=r[0].start;if(t.live){var s=o.initialLiveManifestSize;if(nt},r.getNextFragmentLoopLoading=function(e,t,r,n,i){var o=e.gap,a=this.getNextFragment(this.nextLoadPosition,t);if(null===a)return a;if(e=a,o&&e&&!e.gap&&r.nextStart){var s=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,r.nextStart,n);if(null!==s&&r.len+s.len>=i)return this.log('buffer full after gaps in "'+n+'" playlist starting at sn: '+e.sn),null}return e},r.mapToInitFragWhenRequired=function(e){return null==e||!e.initSegment||null!=e&&e.initSegment.data||this.bitrateTest?e:e.initSegment},r.getNextPart=function(e,t,r){for(var n=-1,i=!1,o=!0,a=0,s=e.length;a-1&&rr.start&&r.loaded},r.getInitialLiveFragment=function(e,t){var r=this.fragPrevious,n=null;if(r){if(e.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+r.programDateTime),n=function(e,t,r){if(null===t||!Array.isArray(e)||!e.length||!b(t))return null;if(t<(e[0].programDateTime||0))return null;if(t>=(e[e.length-1].endProgramDateTime||0))return null;r=r||0;for(var n=0;n=e.startSN&&i<=e.endSN){var o=t[i-e.startSN];r.cc===o.cc&&(n=o,this.log("Live playlist, switching playlist, load frag with next SN: "+n.sn))}n||(n=function(e,t){return Qt.search(e,(function(e){return e.cct?-1:0}))}(t,r.cc))&&this.log("Live playlist, switching playlist, load frag with same CC: "+n.sn)}}else{var a=this.hls.liveSyncPosition;null!==a&&(n=this.getFragmentAtPosition(a,this.bitrateTest?e.fragmentEnd:e.edge,e))}return n},r.getFragmentAtPosition=function(e,t,r){var n,i=this.config,o=this.fragPrevious,a=r.fragments,s=r.endSN,l=r.fragmentHint,c=i.maxFragLookUpTolerance,u=r.partList,d=!!(i.lowLatencyMode&&null!=u&&u.length&&l);if(d&&l&&!this.bitrateTest&&(a=a.concat(l),s=l.sn),n=et-c?0:c):a[a.length-1]){var h=n.sn-r.startSN,p=this.fragmentTracker.getState(n);if((p===yr||p===vr&&n.gap)&&(o=n),o&&n.sn===o.sn&&(!d||u[0].fragment.sn>n.sn)&&o&&n.level===o.level){var f=a[h+1];n=n.sn=o-t.maxFragLookUpTolerance&&i<=a;if(null!==n&&r.duration>n&&(i"+e.startSN+" prev-sn: "+(i?i.sn:"na")+" fragments: "+a),u}return s},r.waitForCdnTuneIn=function(e){return e.live&&e.canBlockReload&&e.partTarget&&e.tuneInGoal>Math.max(e.partHoldBack,3*e.partTarget)},r.setStartPosition=function(e,t){var r=this.startPosition;if(r "+(null==(i=this.fragCurrent)?void 0:i.url))}else{var o=t.details===C.FRAG_GAP;o&&this.fragmentTracker.fragBuffered(n,!0);var a=t.errorAction,s=a||{},l=s.action,c=s.retryCount,u=void 0===c?0:c,d=s.retryConfig;if(a&&l===or&&d){var h;this.resetStartWhenNotLoaded(null!=(h=this.levelLastLoaded)?h:n.level);var p=Zt(d,u);this.warn("Fragment "+n.sn+" of "+e+" "+n.level+" errored with "+t.details+", retrying loading "+(u+1)+"/"+d.maxNumRetry+" in "+p+"ms"),a.resolved=!0,this.retryDate=self.performance.now()+p,this.state=Kr}else d&&a?(this.resetFragmentErrors(e),u.5;n&&this.reduceMaxBufferLength(r.len);var i=!n;return i&&this.warn("Buffer full error while media.currentTime is not buffered, flush "+t+" buffer"),e.frag&&(this.fragmentTracker.removeFragment(e.frag),this.nextLoadPosition=e.frag.start),this.resetLoadingState(),i}return!1},r.resetFragmentErrors=function(e){e===gt&&(this.fragCurrent=null),this.loadedmetadata||(this.startFragRequested=!1),this.state!==Hr&&(this.state=Gr)},r.afterBufferFlushed=function(e,t,r){if(e){var n=Ar.getBuffered(e);this.fragmentTracker.detectEvictedFragments(t,n,r),this.state===Yr&&this.resetLoadingState()}},r.resetLoadingState=function(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state=Gr},r.resetStartWhenNotLoaded=function(e){if(!this.loadedmetadata){this.startFragRequested=!1;var t=this.levels?this.levels[e].details:null;null!=t&&t.live?(this.startPosition=-1,this.setStartPosition(t,0),this.resetLoadingState()):this.nextLoadPosition=this.startPosition}},r.resetWhenMissingContext=function(e){var t;this.warn("The loading context changed while buffering fragment "+e.sn+" of level "+e.level+". This chunk will not be buffered."),this.removeUnbufferedFrags(),this.resetStartWhenNotLoaded(null!=(t=this.levelLastLoaded)?t:e.level),this.resetLoadingState()},r.removeUnbufferedFrags=function(e){void 0===e&&(e=0),this.fragmentTracker.removeFragmentsInRange(e,1/0,this.playlistType,!1,!0)},r.updateLevelTiming=function(e,t,r,n){var i,o=this,a=r.details;if(a){if(Object.keys(e.elementaryStreams).reduce((function(t,i){var s=e.elementaryStreams[i];if(s){var l=s.endPTS-s.startPTS;if(l<=0)return o.warn("Could not parse fragment "+e.sn+" "+i+" duration reliably ("+l+")"),t||!1;var c=n?0:Vt(a,e,s.startPTS,s.endPTS,s.startDTS,s.endDTS);return o.hls.trigger(w.LEVEL_PTS_UPDATED,{details:a,level:r,drift:c,type:i,frag:e,start:s.startPTS,end:s.endPTS}),!0}return t}),!1))r.fragmentError=0;else if(null===(null==(i=this.transmuxer)?void 0:i.error)){var s=new Error("Found no media in fragment "+e.sn+" of level "+e.level+" resetting transmuxer to fallback to playlist timing");if(0===r.fragmentError&&(r.fragmentError++,e.gap=!0,this.fragmentTracker.removeFragment(e),this.fragmentTracker.fragBuffered(e,!0)),this.warn(s.message),this.hls.trigger(w.ERROR,{type:E.MEDIA_ERROR,details:C.FRAG_PARSING_ERROR,fatal:!1,error:s,frag:e,reason:"Found no media in msn "+e.sn+' of level "'+r.url+'"'}),!this.hls)return;this.resetTransmuxer()}this.state=Zr,this.hls.trigger(w.FRAG_PARSED,{frag:e,part:t})}else this.warn("level.details undefined")},r.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},r.recoverWorkerError=function(e){var t,r,n;"demuxerWorker"===e.event&&(this.fragmentTracker.removeAllFragments(),this.resetTransmuxer(),this.resetStartWhenNotLoaded(null!=(t=null!=(r=this.levelLastLoaded)?r:null==(n=this.fragCurrent)?void 0:n.level)?t:0),this.resetLoadingState())},o(t,[{key:"state",get:function(){return this._state},set:function(e){var t=this._state;t!==e&&(this._state=e,this.log(t+"->"+e))}}]),t}(kr);function tn(){return self.SourceBuffer||self.WebKitSourceBuffer}function rn(e,t){return void 0===e&&(e=""),void 0===t&&(t=9e4),{type:e,id:-1,pid:-1,inputTimeScale:t,sequenceNumber:-1,samples:[],dropped:0}}var nn=function(){function e(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.basePTS=null,this.initPTS=null,this.lastPTS=null}var t=e.prototype;return t.resetInitSegment=function(e,t,r,n){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},t.resetTimeStamp=function(e){this.initPTS=e,this.resetContiguity()},t.resetContiguity=function(){this.basePTS=null,this.lastPTS=null,this.frameIndex=0},t.canParse=function(e,t){return!1},t.appendFrame=function(e,t,r){},t.demux=function(e,t){this.cachedData&&(e=Me(this.cachedData,e),this.cachedData=null);var r,n=se(e,0),i=n?n.length:0,o=this._audioTrack,a=this._id3Track,s=n?function(e){for(var t=he(e),r=0;r0&&a.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:n,type:Ot,duration:Number.POSITIVE_INFINITY});i>>5}function cn(e,t){return t+1=e.length)return!1;var n=ln(e,t);if(n<=r)return!1;var i=t+n;return i===e.length||cn(e,i)}return!1}function dn(e,t,r,n,i){if(!e.samplerate){var o=function(e,t,r,n){var i,o,a,s,l=navigator.userAgent.toLowerCase(),c=n,u=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];i=1+((192&t[r+2])>>>6);var d=(60&t[r+2])>>>2;if(!(d>u.length-1))return a=(1&t[r+2])<<2,a|=(192&t[r+3])>>>6,A.log("manifest codec:"+n+", ADTS type:"+i+", samplingIndex:"+d),/firefox/i.test(l)?d>=6?(i=5,s=new Array(4),o=d-3):(i=2,s=new Array(2),o=d):-1!==l.indexOf("android")?(i=2,s=new Array(2),o=d):(i=5,s=new Array(4),n&&(-1!==n.indexOf("mp4a.40.29")||-1!==n.indexOf("mp4a.40.5"))||!n&&d>=6?o=d-3:((n&&-1!==n.indexOf("mp4a.40.2")&&(d>=6&&1===a||/vivaldi/i.test(l))||!n&&1===a)&&(i=2,s=new Array(2)),o=d)),s[0]=i<<3,s[0]|=(14&d)>>1,s[1]|=(1&d)<<7,s[1]|=a<<3,5===i&&(s[1]|=(14&o)>>1,s[2]=(1&o)<<7,s[2]|=8,s[3]=0),{config:s,samplerate:u[d],channelCount:a,codec:"mp4a.40."+i,manifestCodec:c};e.trigger(w.ERROR,{type:E.MEDIA_ERROR,details:C.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+d})}(t,r,n,i);if(!o)return;e.config=o.config,e.samplerate=o.samplerate,e.channelCount=o.channelCount,e.codec=o.codec,e.manifestCodec=o.manifestCodec,A.log("parsed codec:"+e.codec+", rate:"+o.samplerate+", channels:"+o.channelCount)}}function hn(e){return 9216e4/e}function pn(e,t,r,n,i){var o,a=n+i*hn(e.samplerate),s=function(e,t){var r=sn(e,t);if(t+r<=e.length){var n=ln(e,t)-r;if(n>0)return{headerLength:r,frameLength:n}}}(t,r);if(s){var l=s.frameLength,c=s.headerLength,u=c+l,d=Math.max(0,r+u-t.length);d?(o=new Uint8Array(u-c)).set(t.subarray(r+c,t.length),0):o=t.subarray(r+c,r+u);var h={unit:o,pts:a};return d||e.samples.push(h),{sample:h,length:u,missing:d}}var p=t.length-r;return(o=new Uint8Array(p)).set(t.subarray(r,t.length),0),{sample:{unit:o,pts:a},length:p,missing:-1}}var fn=function(e){function t(t,r){var n;return(n=e.call(this)||this).observer=void 0,n.config=void 0,n.observer=t,n.config=r,n}l(t,e);var r=t.prototype;return r.resetInitSegment=function(t,r,n,i){e.prototype.resetInitSegment.call(this,t,r,n,i),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"aac",samples:[],manifestCodec:r,duration:i,inputTimeScale:9e4,dropped:0}},t.probe=function(e){if(!e)return!1;for(var t=(se(e,0)||[]).length,r=e.length;t16384?e.subarray(0,16384):e,["moof"]).length>0},t.demux=function(e,t){this.timeOffset=t;var r=e,n=this.videoTrack,i=this.txtTrack;if(this.config.progressive){this.remainderData&&(r=Me(this.remainderData,e));var o=function(e){var t={valid:null,remainder:null},r=Re(e,["moof"]);if(!r)return t;if(r.length<2)return t.remainder=e,t;var n=r[r.length-1];return t.valid=ne(e,0,n.byteOffset-8),t.remainder=ne(e,n.byteOffset-8),t}(r);this.remainderData=o.remainder,n.samples=o.valid||new Uint8Array}else n.samples=r;var a=this.extractID3Track(n,t);return i.samples=Le(t,n),{videoTrack:n,audioTrack:this.audioTrack,id3Track:a,textTrack:this.txtTrack}},t.flush=function(){var e=this.timeOffset,t=this.videoTrack,r=this.txtTrack;t.samples=this.remainderData||new Uint8Array,this.remainderData=null;var n=this.extractID3Track(t,this.timeOffset);return r.samples=Le(e,t),{videoTrack:t,audioTrack:rn(),id3Track:n,textTrack:rn()}},t.extractID3Track=function(e,t){var r=this.id3Track;if(e.samples.length){var n=Re(e.samples,["emsg"]);n&&n.forEach((function(e){var n=function(e){var t=e[0],r="",n="",i=0,o=0,a=0,s=0,l=0,c=0;if(0===t){for(;"\0"!==Ce(e.subarray(c,c+1));)r+=Ce(e.subarray(c,c+1)),c+=1;for(r+=Ce(e.subarray(c,c+1)),c+=1;"\0"!==Ce(e.subarray(c,c+1));)n+=Ce(e.subarray(c,c+1)),c+=1;n+=Ce(e.subarray(c,c+1)),c+=1,i=Pe(e,12),o=Pe(e,16),s=Pe(e,20),l=Pe(e,24),c=28}else if(1===t){i=Pe(e,c+=4);var u=Pe(e,c+=4),d=Pe(e,c+=4);for(c+=4,a=Math.pow(2,32)*u+d,_(a)||(a=Number.MAX_SAFE_INTEGER,A.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),s=Pe(e,c),l=Pe(e,c+=4),c+=4;"\0"!==Ce(e.subarray(c,c+1));)r+=Ce(e.subarray(c,c+1)),c+=1;for(r+=Ce(e.subarray(c,c+1)),c+=1;"\0"!==Ce(e.subarray(c,c+1));)n+=Ce(e.subarray(c,c+1)),c+=1;n+=Ce(e.subarray(c,c+1)),c+=1}return{schemeIdUri:r,value:n,timeScale:i,presentationTime:a,presentationTimeDelta:o,eventDuration:s,id:l,payload:e.subarray(c,e.byteLength)}}(e);if(mn.test(n.schemeIdUri)){var i=b(n.presentationTime)?n.presentationTime/n.timeScale:t+n.presentationTimeDelta/n.timeScale,o=4294967295===n.eventDuration?Number.POSITIVE_INFINITY:n.eventDuration/n.timeScale;o<=.001&&(o=Number.POSITIVE_INFINITY);var a=n.payload;r.samples.push({data:a,len:a.byteLength,dts:i,pts:i,type:Tt,duration:o})}}))}return r},t.demuxSampleAes=function(e,t,r){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},t.destroy=function(){},e}(),vn=null,yn=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],bn=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],_n=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],Sn=[0,1,1,4];function wn(e,t,r,n,i){if(!(r+24>t.length)){var o=En(t,r);if(o&&r+o.frameLength<=t.length){var a=n+i*(9e4*o.samplesPerFrame/o.sampleRate),s={unit:t.subarray(r,r+o.frameLength),pts:a,dts:a};return e.config=[],e.channelCount=o.channelCount,e.samplerate=o.sampleRate,e.samples.push(s),{sample:s,length:o.frameLength,missing:0}}}}function En(e,t){var r=e[t+1]>>3&3,n=e[t+1]>>1&3,i=e[t+2]>>4&15,o=e[t+2]>>2&3;if(1!==r&&0!==i&&15!==i&&3!==o){var a=e[t+2]>>1&1,s=e[t+3]>>6,l=1e3*yn[14*(3===r?3-n:3===n?3:4)+i-1],c=bn[3*(3===r?0:2===r?1:2)+o],u=3===s?1:2,d=_n[r][n],h=Sn[n],p=8*d*h,f=Math.floor(d*l/c+a)*h;if(null===vn){var m=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);vn=m?parseInt(m[1]):0}return!!vn&&vn<=87&&2===n&&l>=224e3&&0===s&&(e[t+3]=128|e[t+3]),{sampleRate:c,channelCount:u,frameLength:f,samplesPerFrame:p}}}function Cn(e,t){return!(255!==e[t]||224&~e[t+1]||!(6&e[t+1]))}function On(e,t){return t+1e?(this.word<<=e,this.bitsAvailable-=e):(e-=this.bitsAvailable,e-=(t=e>>3)<<3,this.bytesAvailable-=t,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)},t.readBits=function(e){var t=Math.min(this.bitsAvailable,e),r=this.word>>>32-t;if(e>32&&A.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=t,this.bitsAvailable>0)this.word<<=t;else{if(!(this.bytesAvailable>0))throw new Error("no bits available");this.loadWord()}return(t=e-t)>0&&this.bitsAvailable?r<>>e)return this.word<<=e,this.bitsAvailable-=e,e;return this.loadWord(),e+this.skipLZ()},t.skipUEG=function(){this.skipBits(1+this.skipLZ())},t.skipEG=function(){this.skipBits(1+this.skipLZ())},t.readUEG=function(){var e=this.skipLZ();return this.readBits(e+1)-1},t.readEG=function(){var e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)},t.readBoolean=function(){return 1===this.readBits(1)},t.readUByte=function(){return this.readBits(8)},t.readUShort=function(){return this.readBits(16)},t.readUInt=function(){return this.readBits(32)},t.skipScalingList=function(e){for(var t=8,r=8,n=0;n=e.length)return void r();if(!(e[t].unit.length<32||(this.decryptAacSample(e,t,r),this.decrypter.isSync())))return}},t.getAvcEncryptedData=function(e){for(var t=16*Math.floor((e.length-48)/160)+16,r=new Int8Array(t),n=0,i=32;i=e.length)return void n();for(var i=e[t].units;!(r>=i.length);r++){var o=i[r];if(!(o.data.length<=48||1!==o.type&&5!==o.type||(this.decryptAvcSample(e,t,r,n,o),this.decrypter.isSync())))return}}},e}(),Rn=188,An=function(){function e(e,t,r){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=e,this.config=t,this.typeSupported=r}e.probe=function(t){var r=e.syncOffset(t);return r>0&&A.warn("MPEG2-TS detected but first sync word found @ offset "+r),-1!==r},e.syncOffset=function(e){for(var t=e.length,r=Math.min(940,e.length-Rn)+1,n=0;n1&&(0===o&&a>2||s+Rn>r))return o}n++}return-1},e.createTrack=function(e,t){return{container:"video"===e||"audio"===e?"video/mp2t":void 0,type:e,id:Ee[e],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:"audio"===e?t:void 0}};var t=e.prototype;return t.resetInitSegment=function(t,r,n,i){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=e.createTrack("video"),this._audioTrack=e.createTrack("audio",i),this._id3Track=e.createTrack("id3"),this._txtTrack=e.createTrack("text"),this._audioTrack.segmentCodec="aac",this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.audioCodec=r,this.videoCodec=n,this._duration=i},t.resetTimeStamp=function(){},t.resetContiguity=function(){var e=this._audioTrack,t=this._avcTrack,r=this._id3Track;e&&(e.pesData=null),t&&(t.pesData=null),r&&(r.pesData=null),this.aacOverFlow=null,this.avcSample=null,this.remainderData=null},t.demux=function(t,r,n,i){var o;void 0===n&&(n=!1),void 0===i&&(i=!1),n||(this.sampleAes=null);var a=this._avcTrack,s=this._audioTrack,l=this._id3Track,c=this._txtTrack,u=a.pid,d=a.pesData,h=s.pid,p=l.pid,f=s.pesData,m=l.pesData,g=null,v=this.pmtParsed,y=this._pmtId,b=t.length;if(this.remainderData&&(b=(t=Me(this.remainderData,t)).length,this.remainderData=null),b>4>1){if((k=O+5+t[O+4])===O+Rn)continue}else k=O+4;switch(T){case u:P&&(d&&(o=Ln(d))&&this.parseAVCPES(a,c,o,!1),d={data:[],size:0}),d&&(d.data.push(t.subarray(k,O+Rn)),d.size+=O+Rn-k);break;case h:if(P){if(f&&(o=Ln(f)))switch(s.segmentCodec){case"aac":this.parseAACPES(s,o);break;case"mp3":this.parseMPEGPES(s,o)}f={data:[],size:0}}f&&(f.data.push(t.subarray(k,O+Rn)),f.size+=O+Rn-k);break;case p:P&&(m&&(o=Ln(m))&&this.parseID3PES(l,o),m={data:[],size:0}),m&&(m.data.push(t.subarray(k,O+Rn)),m.size+=O+Rn-k);break;case 0:P&&(k+=t[k]+1),y=this._pmtId=xn(t,k);break;case y:P&&(k+=t[k]+1);var R=Mn(t,k,this.typeSupported,n);(u=R.avc)>0&&(a.pid=u),(h=R.audio)>0&&(s.pid=h,s.segmentCodec=R.segmentCodec),(p=R.id3)>0&&(l.pid=p),null===g||v||(A.warn("MPEG-TS PMT found at "+O+" after unknown PID '"+g+"'. Backtracking to sync byte @"+_+" to parse all TS packets."),g=null,O=_-188),v=this.pmtParsed=!0;break;case 17:case 8191:break;default:g=T}}else S++;if(S>0){var D=new Error("Found "+S+" TS packet/s that do not start with 0x47");this.observer.emit(w.ERROR,w.ERROR,{type:E.MEDIA_ERROR,details:C.FRAG_PARSING_ERROR,fatal:!1,error:D,reason:D.message})}a.pesData=d,s.pesData=f,l.pesData=m;var I={audioTrack:s,videoTrack:a,id3Track:l,textTrack:c};return i&&this.extractRemainingSamples(I),I},t.flush=function(){var e,t=this.remainderData;return this.remainderData=null,e=t?this.demux(t,-1,!1,!0):{videoTrack:this._avcTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(e),this.sampleAes?this.decrypt(e,this.sampleAes):e},t.extractRemainingSamples=function(e){var t,r=e.audioTrack,n=e.videoTrack,i=e.id3Track,o=e.textTrack,a=n.pesData,s=r.pesData,l=i.pesData;if(a&&(t=Ln(a))?(this.parseAVCPES(n,o,t,!0),n.pesData=null):n.pesData=a,s&&(t=Ln(s))){switch(r.segmentCodec){case"aac":this.parseAACPES(r,t);break;case"mp3":this.parseMPEGPES(r,t)}r.pesData=null}else null!=s&&s.size&&A.log("last AAC PES packet truncated,might overlap between fragments"),r.pesData=s;l&&(t=Ln(l))?(this.parseID3PES(i,t),i.pesData=null):i.pesData=l},t.demuxSampleAes=function(e,t,r){var n=this.demux(e,r,!0,!this.config.progressive),i=this.sampleAes=new kn(this.observer,this.config,t);return this.decrypt(n,i)},t.decrypt=function(e,t){return new Promise((function(r){var n=e.audioTrack,i=e.videoTrack;n.samples&&"aac"===n.segmentCodec?t.decryptAacSamples(n.samples,0,(function(){i.samples?t.decryptAvcSamples(i.samples,0,0,(function(){r(e)})):r(e)})):i.samples&&t.decryptAvcSamples(i.samples,0,0,(function(){r(e)}))}))},t.destroy=function(){this._duration=0},t.parseAVCPES=function(e,t,r,n){var i,o=this,a=this.parseAVCNALu(e,r.data),s=this.avcSample,l=!1;r.data=null,s&&a.length&&!e.audFound&&(jn(s,e),s=this.avcSample=Dn(!1,r.pts,r.dts,"")),a.forEach((function(n){var a;switch(n.type){case 1:var c=!1;i=!0;var u,d=n.data;if(l&&d.length>4){var h=new Tn(d).readSliceType();2!==h&&4!==h&&7!==h&&9!==h||(c=!0)}c&&null!=(u=s)&&u.frame&&!s.key&&(jn(s,e),s=o.avcSample=null),s||(s=o.avcSample=Dn(!0,r.pts,r.dts,"")),s.frame=!0,s.key=c;break;case 5:i=!0,null!=(a=s)&&a.frame&&!s.key&&(jn(s,e),s=o.avcSample=null),s||(s=o.avcSample=Dn(!0,r.pts,r.dts,"")),s.key=!0,s.frame=!0;break;case 6:i=!0,Ne(n.data,1,r.pts,t.samples);break;case 7:if(i=!0,l=!0,!e.sps){var p=n.data,f=new Tn(p).readSPS();e.width=f.width,e.height=f.height,e.pixelRatio=f.pixelRatio,e.sps=[p],e.duration=o._duration;for(var m=p.subarray(1,4),g="avc1.",v=0;v<3;v++){var y=m[v].toString(16);y.length<2&&(y="0"+y),g+=y}e.codec=g}break;case 8:i=!0,e.pps||(e.pps=[n.data]);break;case 9:i=!1,e.audFound=!0,s&&jn(s,e),s=o.avcSample=Dn(!1,r.pts,r.dts,"");break;case 12:i=!0;break;default:i=!1,s&&(s.debug+="unknown NAL "+n.type+" ")}s&&i&&s.units.push(n)})),n&&s&&(jn(s,e),this.avcSample=null)},t.getLastNalUnit=function(e){var t,r,n=this.avcSample;if(n&&0!==n.units.length||(n=e[e.length-1]),null!=(t=n)&&t.units){var i=n.units;r=i[i.length-1]}return r},t.parseAVCNALu=function(e,t){var r,n,i=t.byteLength,o=e.naluState||0,a=o,s=[],l=0,c=-1,u=0;for(-1===o&&(c=0,u=31&t[0],o=0,l=1);l=0){var d={data:t.subarray(c,l-o-1),type:u};s.push(d)}else{var h=this.getLastNalUnit(e.samples);if(h&&(a&&l<=4-a&&h.state&&(h.data=h.data.subarray(0,h.data.byteLength-a)),(n=l-o-1)>0)){var p=new Uint8Array(h.data.byteLength+n);p.set(h.data,0),p.set(t.subarray(0,n),h.data.byteLength),h.data=p,h.state=0}}l=0&&o>=0){var f={data:t.subarray(c,i),type:u,state:o};s.push(f)}if(0===s.length){var m=this.getLastNalUnit(e.samples);if(m){var g=new Uint8Array(m.data.byteLength+t.byteLength);g.set(m.data,0),g.set(t,m.data.byteLength),m.data=g}}return e.naluState=o,s},t.parseAACPES=function(e,t){var r,n,i,o=0,a=this.aacOverFlow,s=t.data;if(a){this.aacOverFlow=null;var l=a.missing,c=a.sample.unit.byteLength;if(-1===l){var u=new Uint8Array(c+s.byteLength);u.set(a.sample.unit,0),u.set(s,c),s=u}else{var d=c-l;a.sample.unit.set(s.subarray(0,l),d),e.samples.push(a.sample),o=a.missing}}for(r=o,n=s.length;r1;){var l=new Uint8Array(s[0].length+s[1].length);l.set(s[0]),l.set(s[1],s[0].length),s[0]=l,s.splice(1,1)}if(1===((t=s[0])[0]<<16)+(t[1]<<8)+t[2]){if((r=(t[4]<<8)+t[5])&&r>e.size-6)return null;var c=t[7];192&c&&(i=536870912*(14&t[9])+4194304*(255&t[10])+16384*(254&t[11])+128*(255&t[12])+(254&t[13])/2,64&c?i-(o=536870912*(14&t[14])+4194304*(255&t[15])+16384*(254&t[16])+128*(255&t[17])+(254&t[18])/2)>54e5&&(A.warn(Math.round((i-o)/9e4)+"s delta between PTS and DTS, align them"),i=o):o=i);var u=(n=t[8])+9;if(e.size<=u)return null;e.size-=u;for(var d=new Uint8Array(e.size),h=0,p=s.length;hf){u-=f;continue}t=t.subarray(u),f-=u,u=0}d.set(t,a),a+=f}return r&&(r-=n+3),{data:d,pts:i,dts:o,len:r}}return null}function jn(e,t){if(e.units.length&&e.frame){if(void 0===e.pts){var r=t.samples,n=r.length;if(!n)return void t.dropped++;var i=r[n-1];e.pts=i.pts,e.dts=i.dts}t.samples.push(e)}e.debug.length&&A.log(e.pts+"/"+e.dts+":"+e.debug)}var Nn=function(e){function t(){return e.apply(this,arguments)||this}l(t,e);var r=t.prototype;return r.resetInitSegment=function(t,r,n,i){e.prototype.resetInitSegment.call(this,t,r,n,i),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"mp3",samples:[],manifestCodec:r,duration:i,inputTimeScale:9e4,dropped:0}},t.probe=function(e){if(!e)return!1;for(var t=(se(e,0)||[]).length,r=e.length;t1?r-1:0),i=1;i>24&255,s[1]=t>>16&255,s[2]=t>>8&255,s[3]=255&t,s.set(e,4),o=0,t=8;o>24&255,t>>16&255,t>>8&255,255&t,n>>24,n>>16&255,n>>8&255,255&n,i>>24,i>>16&255,i>>8&255,255&i,85,196,0,0]))},e.mdia=function(t){return e.box(e.types.mdia,e.mdhd(t.timescale,t.duration),e.hdlr(t.type),e.minf(t))},e.mfhd=function(t){return e.box(e.types.mfhd,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t]))},e.minf=function(t){return"audio"===t.type?e.box(e.types.minf,e.box(e.types.smhd,e.SMHD),e.DINF,e.stbl(t)):e.box(e.types.minf,e.box(e.types.vmhd,e.VMHD),e.DINF,e.stbl(t))},e.moof=function(t,r,n){return e.box(e.types.moof,e.mfhd(t),e.traf(n,r))},e.moov=function(t){for(var r=t.length,n=[];r--;)n[r]=e.trak(t[r]);return e.box.apply(null,[e.types.moov,e.mvhd(t[0].timescale,t[0].duration)].concat(n).concat(e.mvex(t)))},e.mvex=function(t){for(var r=t.length,n=[];r--;)n[r]=e.trex(t[r]);return e.box.apply(null,[e.types.mvex].concat(n))},e.mvhd=function(t,r){r*=t;var n=Math.floor(r/(Bn+1)),i=Math.floor(r%(Bn+1)),o=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,255&t,n>>24,n>>16&255,n>>8&255,255&n,i>>24,i>>16&255,i>>8&255,255&i,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return e.box(e.types.mvhd,o)},e.sdtp=function(t){var r,n,i=t.samples||[],o=new Uint8Array(4+i.length);for(r=0;r>>8&255),o.push(255&i),o=o.concat(Array.prototype.slice.call(n));for(r=0;r>>8&255),a.push(255&i),a=a.concat(Array.prototype.slice.call(n));var s=e.box(e.types.avcC,new Uint8Array([1,o[3],o[4],o[5],255,224|t.sps.length].concat(o).concat([t.pps.length]).concat(a))),l=t.width,c=t.height,u=t.pixelRatio[0],d=t.pixelRatio[1];return e.box(e.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,l>>8&255,255&l,c>>8&255,255&c,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),s,e.box(e.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),e.box(e.types.pasp,new Uint8Array([u>>24,u>>16&255,u>>8&255,255&u,d>>24,d>>16&255,d>>8&255,255&d])))},e.esds=function(e){var t=e.config.length;return new Uint8Array([0,0,0,0,3,23+t,0,1,0,4,15+t,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([t]).concat(e.config).concat([6,1,2]))},e.mp4a=function(t){var r=t.samplerate;return e.box(e.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t.channelCount,0,16,0,0,0,0,r>>8&255,255&r,0,0]),e.box(e.types.esds,e.esds(t)))},e.mp3=function(t){var r=t.samplerate;return e.box(e.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t.channelCount,0,16,0,0,0,0,r>>8&255,255&r,0,0]))},e.stsd=function(t){return"audio"===t.type?"mp3"===t.segmentCodec&&"mp3"===t.codec?e.box(e.types.stsd,e.STSD,e.mp3(t)):e.box(e.types.stsd,e.STSD,e.mp4a(t)):e.box(e.types.stsd,e.STSD,e.avc1(t))},e.tkhd=function(t){var r=t.id,n=t.duration*t.timescale,i=t.width,o=t.height,a=Math.floor(n/(Bn+1)),s=Math.floor(n%(Bn+1));return e.box(e.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,r>>24&255,r>>16&255,r>>8&255,255&r,0,0,0,0,a>>24,a>>16&255,a>>8&255,255&a,s>>24,s>>16&255,s>>8&255,255&s,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,i>>8&255,255&i,0,0,o>>8&255,255&o,0,0]))},e.traf=function(t,r){var n=e.sdtp(t),i=t.id,o=Math.floor(r/(Bn+1)),a=Math.floor(r%(Bn+1));return e.box(e.types.traf,e.box(e.types.tfhd,new Uint8Array([0,0,0,0,i>>24,i>>16&255,i>>8&255,255&i])),e.box(e.types.tfdt,new Uint8Array([1,0,0,0,o>>24,o>>16&255,o>>8&255,255&o,a>>24,a>>16&255,a>>8&255,255&a])),e.trun(t,n.length+16+20+8+16+8+8),n)},e.trak=function(t){return t.duration=t.duration||4294967295,e.box(e.types.trak,e.tkhd(t),e.mdia(t))},e.trex=function(t){var r=t.id;return e.box(e.types.trex,new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},e.trun=function(t,r){var n,i,o,a,s,l,c=t.samples||[],u=c.length,d=12+16*u,h=new Uint8Array(d);for(r+=8+d,h.set(["video"===t.type?1:0,0,15,1,u>>>24&255,u>>>16&255,u>>>8&255,255&u,r>>>24&255,r>>>16&255,r>>>8&255,255&r],0),n=0;n>>24&255,o>>>16&255,o>>>8&255,255&o,a>>>24&255,a>>>16&255,a>>>8&255,255&a,s.isLeading<<2|s.dependsOn,s.isDependedOn<<6|s.hasRedundancy<<4|s.paddingValue<<1|s.isNonSync,61440&s.degradPrio,15&s.degradPrio,l>>>24&255,l>>>16&255,l>>>8&255,255&l],12+16*n);return e.box(e.types.trun,h)},e.initSegment=function(t){e.types||e.init();var r=e.moov(t),n=new Uint8Array(e.FTYP.byteLength+r.byteLength);return n.set(e.FTYP),n.set(r,e.FTYP.byteLength),n},e}();Un.types=void 0,Un.HDLR_TYPES=void 0,Un.STTS=void 0,Un.STSC=void 0,Un.STCO=void 0,Un.STSZ=void 0,Un.VMHD=void 0,Un.SMHD=void 0,Un.STSD=void 0,Un.FTYP=void 0,Un.DINF=void 0;var Vn=9e4;function Hn(e,t,r,n){void 0===r&&(r=1),void 0===n&&(n=!1);var i=e*t*r;return n?Math.round(i):i}function Gn(e,t){return void 0===t&&(t=!1),Hn(e,1e3,1/Vn,t)}var Wn=null,zn=null,Kn=function(){function e(e,t,r,n){if(this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=null,this._initDTS=null,this.nextAvcDts=null,this.nextAudioPts=null,this.videoSampleDuration=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.observer=e,this.config=t,this.typeSupported=r,this.ISGenerated=!1,null===Wn){var i=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);Wn=i?parseInt(i[1]):0}if(null===zn){var o=navigator.userAgent.match(/Safari\/(\d+)/i);zn=o?parseInt(o[1]):0}}var t=e.prototype;return t.destroy=function(){},t.resetTimeStamp=function(e){A.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=e},t.resetNextTimestamp=function(){A.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},t.resetInitSegment=function(){A.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},t.getVideoStartPts=function(e){var t=!1,r=e.reduce((function(e,r){var n=r.pts-e;return n<-4294967296?(t=!0,$n(e,r.pts)):n>0?e:r.pts}),e[0].pts);return t&&A.debug("PTS rollover detected"),r},t.remux=function(e,t,r,n,i,o,a,s){var l,c,u,d,h,p,f=i,m=i,g=e.pid>-1,v=t.pid>-1,y=t.samples.length,b=e.samples.length>0,_=a&&y>0||y>1;if((!g||b)&&(!v||_)||this.ISGenerated||a){this.ISGenerated||(u=this.generateIS(e,t,i,o));var S,w=this.isVideoContiguous,E=-1;if(_&&(E=function(e){for(var t=0;t0){A.warn("[mp4-remuxer]: Dropped "+E+" out of "+y+" video samples due to a missing keyframe");var C=this.getVideoStartPts(t.samples);t.samples=t.samples.slice(E),t.dropped+=E,S=m+=(t.samples[0].pts-C)/t.inputTimeScale}else-1===E&&(A.warn("[mp4-remuxer]: No keyframe found out of "+y+" video samples"),p=!1);if(this.ISGenerated){if(b&&_){var O=this.getVideoStartPts(t.samples),P=($n(e.samples[0].pts,O)-O)/t.inputTimeScale;f+=Math.max(0,P),m+=Math.max(0,-P)}if(b){if(e.samplerate||(A.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),u=this.generateIS(e,t,i,o)),c=this.remuxAudio(e,f,this.isAudioContiguous,o,v||_||s===gt?m:void 0),_){var T=c?c.endPTS-c.startPTS:0;t.inputTimeScale||(A.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),u=this.generateIS(e,t,i,o)),l=this.remuxVideo(t,m,w,T)}}else _&&(l=this.remuxVideo(t,m,w,0));l&&(l.firstKeyFrame=E,l.independent=-1!==E,l.firstKeyFramePTS=S)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(r.samples.length&&(h=qn(r,i,this._initPTS,this._initDTS)),n.samples.length&&(d=Zn(n,i,this._initPTS))),{audio:c,video:l,initSegment:u,independent:p,text:d,id3:h}},t.generateIS=function(e,t,r,n){var i,o,a,s=e.samples,l=t.samples,c=this.typeSupported,u={},d=this._initPTS,h=!d||n,p="audio/mp4";if(h&&(i=o=1/0),e.config&&s.length&&(e.timescale=e.samplerate,"mp3"===e.segmentCodec&&(c.mpeg?(p="audio/mpeg",e.codec=""):c.mp3&&(e.codec="mp3")),u.audio={id:"audio",container:p,codec:e.codec,initSegment:"mp3"===e.segmentCodec&&c.mpeg?new Uint8Array(0):Un.initSegment([e]),metadata:{channelCount:e.channelCount}},h&&(a=e.inputTimeScale,d&&a===d.timescale?h=!1:i=o=s[0].pts-Math.round(a*r))),t.sps&&t.pps&&l.length&&(t.timescale=t.inputTimeScale,u.video={id:"main",container:"video/mp4",codec:t.codec,initSegment:Un.initSegment([t]),metadata:{width:t.width,height:t.height}},h))if(a=t.inputTimeScale,d&&a===d.timescale)h=!1;else{var f=this.getVideoStartPts(l),m=Math.round(a*r);o=Math.min(o,$n(l[0].dts,f)-m),i=Math.min(i,f-m)}if(Object.keys(u).length)return this.ISGenerated=!0,h?(this._initPTS={baseTime:i,timescale:a},this._initDTS={baseTime:o,timescale:a}):i=a=void 0,{tracks:u,initPTS:i,timescale:a}},t.remuxVideo=function(e,t,r,n){var i,o,a=e.inputTimeScale,l=e.samples,c=[],u=l.length,d=this._initPTS,h=this.nextAvcDts,p=8,f=this.videoSampleDuration,m=Number.POSITIVE_INFINITY,g=Number.NEGATIVE_INFINITY,v=!1;r&&null!==h||(h=t*a-(l[0].pts-$n(l[0].dts,l[0].pts)));for(var y=d.baseTime*a/d.timescale,b=0;b0?b-1:b].dts&&(v=!0)}v&&l.sort((function(e,t){var r=e.dts-t.dts,n=e.pts-t.pts;return r||n})),i=l[0].dts;var S=l[l.length-1].dts-i,O=S?Math.round(S/(u-1)):f||e.inputTimeScale/30;if(r){var P=i-h,T=P>O,k=P<-1;if((T||k)&&(T?A.warn("AVC: "+Gn(P,!0)+" ms ("+P+"dts) hole between fragments detected, filling it"):A.warn("AVC: "+Gn(-P,!0)+" ms ("+P+"dts) overlapping between fragments detected"),!k||h>=l[0].pts)){i=h;var R=l[0].pts-P;l[0].dts=i,l[0].pts=R,A.log("Video: First PTS/DTS adjusted: "+Gn(R,!0)+"/"+Gn(i,!0)+", delta: "+Gn(P,!0)+" ms")}}i=Math.max(0,i);for(var D=0,I=0,x=0;x0?q.dts-l[$-1].dts:O;if(re=$>0?q.pts-l[$-1].pts:O,ne.stretchShortVideoTrack&&null!==this.nextAudioPts){var oe=Math.floor(ne.maxBufferHole*a),ae=(n?m+n*a:this.nextAudioPts)-q.pts;ae>oe?((f=ae-ie)<0?f=ie:H=!0,A.log("[mp4-remuxer]: It is approximately "+ae/90+" ms to the next segment; using duration "+f/90+" ms for the last video frame.")):f=ie}else f=ie}var se=Math.round(q.pts-q.dts);G=Math.min(G,f),z=Math.max(z,f),W=Math.min(W,re),K=Math.max(K,re),c.push(new Jn(q.key,f,Y,se))}if(c.length)if(Wn){if(Wn<70){var le=c[0].flags;le.dependsOn=2,le.isNonSync=0}}else if(zn&&K-W0&&(n&&Math.abs(v-g)<9e3||Math.abs($n(f[0].pts-y,v)-g)<20*c),f.forEach((function(e){e.pts=$n(e.pts-y,v)})),!r||g<0){if(f=f.filter((function(e){return e.pts>=0})),!f.length)return;g=0===i?0:n&&!p?Math.max(0,v):f[0].pts}if("aac"===e.segmentCodec)for(var b=this.config.maxAudioFramesDrift,_=0,S=g;_=b*c&&k<1e4&&p){var R=Math.round(T/c);(S=P-R*c)<0&&(R--,S+=c),0===_&&(this.nextAudioPts=g=S),A.warn("[mp4-remuxer]: Injecting "+R+" audio frame @ "+(S/o).toFixed(3)+"s due to "+Math.round(1e3*T/o)+" ms gap.");for(var D=0;D0))return;N+=m;try{M=new Uint8Array(N)}catch(e){return void this.observer.emit(w.ERROR,w.ERROR,{type:E.MUX_ERROR,details:C.REMUX_ALLOC_ERROR,fatal:!1,error:e,bytes:N,reason:"fail allocating audio mdat "+N})}d||(new DataView(M.buffer).setUint32(0,N),M.set(Un.types.mdat,4))}M.set(H,m);var W=H.byteLength;m+=W,h.push(new Jn(!0,l,W,0)),j=G}var z=h.length;if(z){var K=h[h.length-1];this.nextAudioPts=g=j+a*K.duration;var $=d?new Uint8Array(0):Un.moof(e.sequenceNumber++,L/a,s({},e,{samples:h}));e.samples=[];var q=L/o,Z=g/o,Y={data1:$,data2:M,startPTS:q,endPTS:Z,startDTS:q,endDTS:Z,type:"audio",hasAudio:!0,hasVideo:!1,nb:z};return this.isAudioContiguous=!0,Y}},t.remuxEmptyAudio=function(e,t,r,n){var i=e.inputTimeScale,o=i/(e.samplerate?e.samplerate:i),a=this.nextAudioPts,s=this._initDTS,l=9e4*s.baseTime/s.timescale,c=(null!==a?a:n.startDTS*i)+l,u=n.endDTS*i+l,d=1024*o,h=Math.ceil((u-c)/d),p=Fn.getSilentFrame(e.manifestCodec||e.codec,e.channelCount);if(A.warn("[mp4-remuxer]: remux empty Audio"),p){for(var f=[],m=0;m4294967296;)e+=r;return e}function qn(e,t,r,n){var i=e.samples.length;if(i){for(var o=e.inputTimeScale,a=0;a0;i||(n=Re(t,["encv"])),n.forEach((function(e){Re(i?e.subarray(28):e.subarray(78),["sinf"]).forEach((function(e){var t=Ie(e);if(t){var n=t.subarray(8,24);n.some((function(e){return 0!==e}))||(A.log("[eme] Patching keyId in 'enc"+(i?"a":"v")+">sinf>>tenc' box: "+_e(n)+" -> "+_e(r)),t.set(r,8))}}))}))})),e}(e,n)),this.emitInitSegment=!0},t.generateInitSegment=function(e){var t=this.audioCodec,r=this.videoCodec;if(null==e||!e.byteLength)return this.initTracks=void 0,void(this.initData=void 0);var n=this.initData=De(e);t||(t=ei(n.audio,N)),r||(r=ei(n.video,F));var i={};n.audio&&n.video?i.audiovideo={container:"video/mp4",codec:t+","+r,initSegment:e,id:"main"}:n.audio?i.audio={container:"audio/mp4",codec:t,initSegment:e,id:"audio"}:n.video?i.video={container:"video/mp4",codec:r,initSegment:e,id:"main"}:A.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=i},t.remux=function(e,t,r,n,i,o){var a,s,l=this.initPTS,c=this.lastEndTime,u={audio:void 0,video:void 0,text:n,id3:r,initSegment:void 0};b(c)||(c=this.lastEndTime=i||0);var d=t.samples;if(null==d||!d.length)return u;var h={initPTS:void 0,timescale:1},p=this.initData;if(null!=(a=p)&&a.length||(this.generateInitSegment(d),p=this.initData),null==(s=p)||!s.length)return A.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),u;this.emitInitSegment&&(h.tracks=this.initTracks,this.emitInitSegment=!1);var f=function(e,t){for(var r=0,n=0,i=0,o=Re(e,["moof","traf"]),a=0;ai}(l,g,i,f)||h.timescale!==l.timescale&&o)&&(h.initPTS=g-i,l&&1===l.timescale&&A.warn("Adjusting initPTS by "+(h.initPTS-l.baseTime)),this.initPTS=l={baseTime:h.initPTS,timescale:1});var v=e?g-l.baseTime/l.timescale:c,y=v+f;(function(e,t,r){Re(t,["moof","traf"]).forEach((function(t){Re(t,["tfhd"]).forEach((function(n){var i=Pe(n,4),o=e[i];if(o){var a=o.timescale||9e4;Re(t,["tfdt"]).forEach((function(e){var t=e[0],n=Pe(e,4);if(0===t)n-=r*a,ke(e,4,n=Math.max(n,0));else{n*=Math.pow(2,32),n+=Pe(e,8),n-=r*a,n=Math.max(n,0);var i=Math.floor(n/(Se+1)),o=Math.floor(n%(Se+1));ke(e,4,i),ke(e,8,o)}}))}}))}))})(p,d,l.baseTime/l.timescale),f>0?this.lastEndTime=y:(A.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var _=!!p.audio,S=!!p.video,w="";_&&(w+="audio"),S&&(w+="video");var E={data1:d,startPTS:v,startDTS:v,endPTS:y,endDTS:y,type:w,hasAudio:_,hasVideo:S,nb:1,dropped:0};return u.audio="audio"===E.type?E:void 0,u.video="audio"!==E.type?E:void 0,u.initSegment=h,u.id3=qn(r,i,l,l),n.samples.length&&(u.text=Zn(n,i,l)),u},e}();function ei(e,t){var r=null==e?void 0:e.codec;return r&&r.length>4?r:"hvc1"===r||"hev1"===r?"hvc1.1.6.L120.90":"av01"===r?"av01.0.04M.08":"avc1"===r||t===F?"avc1.42e01e":"mp4a.40.5"}try{Yn=self.performance.now.bind(self.performance)}catch(e){A.debug("Unable to use Performance API on this environment"),Yn="undefined"!=typeof self&&self.Date.now}var ti=[{demux:gn,remux:Xn},{demux:An,remux:Kn},{demux:fn,remux:Kn},{demux:Nn,remux:Kn}],ri=function(){function e(e,t,r,n,i){this.async=!1,this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.observer=e,this.typeSupported=t,this.config=r,this.vendor=n,this.id=i}var t=e.prototype;return t.configure=function(e){this.transmuxConfig=e,this.decrypter&&this.decrypter.reset()},t.push=function(e,t,r,n){var i=this,o=r.transmuxing;o.executeStart=Yn();var a=new Uint8Array(e),s=this.currentTransmuxState,l=this.transmuxConfig;n&&(this.currentTransmuxState=n);var c=n||s,u=c.contiguous,d=c.discontinuity,h=c.trackSwitch,p=c.accurateTimeOffset,f=c.timeOffset,m=c.initSegmentChange,g=l.audioCodec,v=l.videoCodec,y=l.defaultInitPts,b=l.duration,_=l.initSegmentData,S=function(e,t){var r=null;return e.byteLength>0&&null!=t&&null!=t.key&&null!==t.iv&&null!=t.method&&(r=t),r}(a,t);if(S&&"AES-128"===S.method){var O=this.getDecrypter();if(!O.isSync())return this.decryptionPromise=O.webCryptoDecrypt(a,S.key.buffer,S.iv.buffer).then((function(e){var t=i.push(e,null,r);return i.decryptionPromise=null,t})),this.decryptionPromise;var P=O.softwareDecrypt(a,S.key.buffer,S.iv.buffer);if(r.part>-1&&(P=O.flush()),!P)return o.executeEnd=Yn(),ni(r);a=new Uint8Array(P)}var T=this.needsProbing(d,h);if(T){var k=this.configureTransmuxer(a);if(k)return A.warn("[transmuxer] "+k.message),this.observer.emit(w.ERROR,w.ERROR,{type:E.MEDIA_ERROR,details:C.FRAG_PARSING_ERROR,fatal:!1,error:k,reason:k.message}),o.executeEnd=Yn(),ni(r)}(d||h||m||T)&&this.resetInitSegment(_,g,v,b,t),(d||m||T)&&this.resetInitialTimestamp(y),u||this.resetContiguity();var R=this.transmux(a,S,f,p,r),D=this.currentTransmuxState;return D.contiguous=!0,D.discontinuity=!1,D.trackSwitch=!1,o.executeEnd=Yn(),R},t.flush=function(e){var t=this,r=e.transmuxing;r.executeStart=Yn();var n=this.decrypter,i=this.currentTransmuxState,o=this.decryptionPromise;if(o)return o.then((function(){return t.flush(e)}));var a=[],s=i.timeOffset;if(n){var l=n.flush();l&&a.push(this.push(l,null,e))}var c=this.demuxer,u=this.remuxer;if(!c||!u)return r.executeEnd=Yn(),[ni(e)];var d=c.flush(s);return ii(d)?d.then((function(r){return t.flushRemux(a,r,e),a})):(this.flushRemux(a,d,e),a)},t.flushRemux=function(e,t,r){var n=t.audioTrack,i=t.videoTrack,o=t.id3Track,a=t.textTrack,s=this.currentTransmuxState,l=s.accurateTimeOffset,c=s.timeOffset;A.log("[transmuxer.ts]: Flushed fragment "+r.sn+(r.part>-1?" p: "+r.part:"")+" of level "+r.level);var u=this.remuxer.remux(n,i,o,a,c,l,!0,this.id);e.push({remuxResult:u,chunkMeta:r}),r.transmuxing.executeEnd=Yn()},t.resetInitialTimestamp=function(e){var t=this.demuxer,r=this.remuxer;t&&r&&(t.resetTimeStamp(e),r.resetTimeStamp(e))},t.resetContiguity=function(){var e=this.demuxer,t=this.remuxer;e&&t&&(e.resetContiguity(),t.resetNextTimestamp())},t.resetInitSegment=function(e,t,r,n,i){var o=this.demuxer,a=this.remuxer;o&&a&&(o.resetInitSegment(e,t,r,n),a.resetInitSegment(e,t,r,i))},t.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},t.transmux=function(e,t,r,n,i){return t&&"SAMPLE-AES"===t.method?this.transmuxSampleAes(e,t,r,n,i):this.transmuxUnencrypted(e,r,n,i)},t.transmuxUnencrypted=function(e,t,r,n){var i=this.demuxer.demux(e,t,!1,!this.config.progressive),o=i.audioTrack,a=i.videoTrack,s=i.id3Track,l=i.textTrack;return{remuxResult:this.remuxer.remux(o,a,s,l,t,r,!1,this.id),chunkMeta:n}},t.transmuxSampleAes=function(e,t,r,n,i){var o=this;return this.demuxer.demuxSampleAes(e,t,r).then((function(e){return{remuxResult:o.remuxer.remux(e.audioTrack,e.videoTrack,e.id3Track,e.textTrack,r,n,!1,o.id),chunkMeta:i}}))},t.configureTransmuxer=function(e){for(var t,r=this.config,n=this.observer,i=this.typeSupported,o=this.vendor,a=0,s=ti.length;a1&&l.id===(null==g?void 0:g.stats.chunkCount),w=!y&&(1===b||0===b&&(1===_||S&&_<=0)),E=self.performance.now();(y||b||0===i.stats.parsing.start)&&(i.stats.parsing.start=E),!o||!_&&w||(o.stats.parsing.start=E);var C=!(g&&(null==(u=i.initSegment)?void 0:u.url)===(null==(d=g.initSegment)?void 0:d.url)),O=new ai(v,w,s,y,f,C);if(!w||v||C){A.log("[transmuxer-interface, "+i.type+"]: Starting new transmux session for sn: "+l.sn+" p: "+l.part+" level: "+l.level+" id: "+l.id+"\n discontinuity: "+v+"\n trackSwitch: "+y+"\n contiguous: "+w+"\n accurateTimeOffset: "+s+"\n timeOffset: "+f+"\n initSegmentChange: "+C);var P=new oi(r,n,t,a,c);this.configureTransmuxer(P)}if(this.frag=i,this.part=o,this.workerContext)this.workerContext.worker.postMessage({cmd:"demux",data:e,decryptdata:m,chunkMeta:l,state:O},e instanceof ArrayBuffer?[e]:[]);else if(p){var T=p.push(e,m,l,O);ii(T)?(p.async=!0,T.then((function(e){h.handleTransmuxComplete(e)})).catch((function(e){h.transmuxerError(e,l,"transmuxer-interface push error")}))):(p.async=!1,this.handleTransmuxComplete(T))}},r.flush=function(e){var t=this;e.transmuxing.start=self.performance.now();var r=this.transmuxer;if(this.workerContext)this.workerContext.worker.postMessage({cmd:"flush",chunkMeta:e});else if(r){var n=r.flush(e);ii(n)||r.async?(ii(n)||(n=Promise.resolve(n)),n.then((function(r){t.handleFlushResult(r,e)})).catch((function(r){t.transmuxerError(r,e,"transmuxer-interface flush error")}))):this.handleFlushResult(n,e)}},r.transmuxerError=function(e,t,r){this.hls&&(this.error=e,this.hls.trigger(w.ERROR,{type:E.MEDIA_ERROR,details:C.FRAG_PARSING_ERROR,chunkMeta:t,fatal:!1,error:e,err:e,reason:r}))},r.handleFlushResult=function(e,t){var r=this;e.forEach((function(e){r.handleTransmuxComplete(e)})),this.onFlush(t)},r.onWorkerMessage=function(e){var t=e.data,r=this.hls;switch(t.event){case"init":var n,i=null==(n=this.workerContext)?void 0:n.objectURL;i&&self.URL.revokeObjectURL(i);break;case"transmuxComplete":this.handleTransmuxComplete(t.data);break;case"flush":this.onFlush(t.data);break;case"workerLog":A[t.data.logType]&&A[t.data.logType](t.data.message);break;default:t.data=t.data||{},t.data.frag=this.frag,t.data.id=this.id,r.trigger(t.event,t.data)}},r.configureTransmuxer=function(e){var t=this.transmuxer;this.workerContext?this.workerContext.worker.postMessage({cmd:"configure",config:e}):t&&t.configure(e)},r.handleTransmuxComplete=function(e){e.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(e)},e}(),fi=function(){function e(e,t,r,n){this.config=void 0,this.media=null,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=e,this.media=t,this.fragmentTracker=r,this.hls=n}var t=e.prototype;return t.destroy=function(){this.media=null,this.hls=this.fragmentTracker=null},t.poll=function(e,t){var r=this.config,n=this.media,i=this.stalled;if(null!==n){var o=n.currentTime,a=n.seeking,s=this.seeking&&!a,l=!this.seeking&&a;if(this.seeking=a,o===e){if(l||s)this.stalled=null;else if(!(n.paused&&!a||n.ended||0===n.playbackRate)&&Ar.getBuffered(n).length){var c=Ar.bufferInfo(n,o,0),u=c.len>0,d=c.nextStart||0;if(u||d){if(a){var h=c.len>2,p=!d||t&&t.start<=o||d-o>2&&!this.fragmentTracker.getPartialFragment(o);if(h||p)return;this.moved=!1}if(!this.moved&&null!==this.stalled){var f,m=Math.max(d,c.start||0)-o,g=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,v=(null==g||null==(f=g.details)?void 0:f.live)?2*g.details.targetduration:2,y=this.fragmentTracker.getPartialFragment(o);if(m>0&&(m<=v||y))return void this._trySkipBufferHole(y)}var b=self.performance.now();if(null!==i){var _=b-i;if(a||!(_>=250)||(this._reportStall(c),this.media)){var S=Ar.bufferInfo(n,o,r.maxBufferHole);this._tryFixBufferStall(S,_)}}else this.stalled=b}}}else if(this.moved=!0,null!==i){if(this.stallReported){var w=self.performance.now()-i;A.warn("playback not stuck anymore @"+o+", after "+Math.round(w)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}}},t._tryFixBufferStall=function(e,t){var r=this.config,n=this.fragmentTracker,i=this.media;if(null!==i){var o=i.currentTime,a=n.getPartialFragment(o);if(a&&(this._trySkipBufferHole(a)||!this.media))return;(e.len>r.maxBufferHole||e.nextStart&&e.nextStart-o1e3*r.highBufferWatchdogPeriod&&(A.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())}},t._reportStall=function(e){var t=this.hls,r=this.media;if(!this.stallReported&&r){this.stallReported=!0;var n=new Error("Playback stalling at @"+r.currentTime+" due to low buffer ("+JSON.stringify(e)+")");A.warn(n.message),t.trigger(w.ERROR,{type:E.MEDIA_ERROR,details:C.BUFFER_STALLED_ERROR,fatal:!1,error:n,buffer:e.len})}},t._trySkipBufferHole=function(e){var t=this.config,r=this.hls,n=this.media;if(null===n)return 0;var i=n.currentTime,o=Ar.bufferInfo(n,i,0),a=i0&&o.len<1&&n.readyState<3,c=a-i;if(c>0&&(s||l)){if(c>t.maxBufferHole){var u=this.fragmentTracker,d=!1;if(0===i){var h=u.getAppendedFrag(0,mt);h&&a1?(n=0,this.bitrateTest=!0):n=r.nextAutoLevel),this.level=r.nextLoadLevel=n,this.loadedmetadata=!1}t>0&&-1===e&&(this.log("Override startPosition with lastCurrentTime @"+t.toFixed(3)),e=t),this.state=Gr,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}else this._forceStartLoad=!0,this.state=Hr},r.stopLoad=function(){this._forceStartLoad=!1,e.prototype.stopLoad.call(this)},r.doTick=function(){switch(this.state){case Xr:var e,t=this.levels,r=this.level,n=null==t||null==(e=t[r])?void 0:e.details;if(n&&(!n.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(n))break;this.state=Gr;break}if(this.hls.nextLoadLevel!==this.level){this.state=Gr;break}break;case Kr:var i,o=self.performance.now(),a=this.retryDate;(!a||o>=a||null!=(i=this.media)&&i.seeking)&&(this.resetStartWhenNotLoaded(this.level),this.state=Gr)}this.state===Gr&&this.doTickIdle(),this.onTickEnd()},r.onTickEnd=function(){e.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},r.doTickIdle=function(){var e=this.hls,t=this.levelLastLoaded,r=this.levels,n=this.media,i=e.config,o=e.nextLoadLevel;if(null!==t&&(n||!this.startFragRequested&&i.startFragPrefetch)&&(!this.altAudio||!this.audioOnly)&&null!=r&&r[o]){var a=r[o],s=this.getMainFwdBufferInfo();if(null!==s){var l=this.getLevelDetails();if(l&&this._streamEnded(s,l)){var c={};return this.altAudio&&(c.type="video"),this.hls.trigger(w.BUFFER_EOS,c),void(this.state=Yr)}e.loadLevel!==o&&-1===e.manualLevel&&this.log("Adapting to level "+o+" from level "+this.level),this.level=e.nextLoadLevel=o;var u=a.details;if(!u||this.state===Xr||u.live&&this.levelLastLoaded!==o)return this.level=o,void(this.state=Xr);var d=s.len,h=this.getMaxBufferLength(a.maxBitrate);if(!(d>=h)){this.backtrackFragment&&this.backtrackFragment.start>s.end&&(this.backtrackFragment=null);var p=this.backtrackFragment?this.backtrackFragment.start:s.end,f=this.getNextFragment(p,u);if(this.couldBacktrack&&!this.fragPrevious&&f&&"initSegment"!==f.sn&&this.fragmentTracker.getState(f)!==yr){var m,g=(null!=(m=this.backtrackFragment)?m:f).sn-u.startSN,v=u.fragments[g-1];v&&f.cc===v.cc&&(f=v,this.fragmentTracker.removeFragment(v))}else this.backtrackFragment&&s.len&&(this.backtrackFragment=null);if(f&&this.isLoopLoading(f,p)){if(!f.gap){var y=this.audioOnly&&!this.altAudio?N:F,b=(y===F?this.videoBuffer:this.mediaBuffer)||this.media;b&&this.afterBufferFlushed(b,y,mt)}f=this.getNextFragmentLoopLoading(f,u,s,mt,h)}f&&(!f.initSegment||f.initSegment.data||this.bitrateTest||(f=f.initSegment),this.loadFragment(f,a,p))}}}},r.loadFragment=function(t,r,n){var i=this.fragmentTracker.getState(t);this.fragCurrent=t,i===mr||i===vr?"initSegment"===t.sn?this._loadInitSegment(t,r):this.bitrateTest?(this.log("Fragment "+t.sn+" of level "+t.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(t,r)):(this.startFragRequested=!0,e.prototype.loadFragment.call(this,t,r,n)):this.clearTrackerIfNeeded(t)},r.getBufferedFrag=function(e){return this.fragmentTracker.getBufferedFrag(e,mt)},r.followingBufferedFrag=function(e){return e?this.getBufferedFrag(e.end+.5):null},r.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},r.nextLevelSwitch=function(){var e=this.levels,t=this.media;if(null!=t&&t.readyState){var r,n=this.getAppendedFrag(t.currentTime);n&&n.start>1&&this.flushMainBuffer(0,n.start-1);var i=this.getLevelDetails();if(null!=i&&i.live){var o=this.getMainFwdBufferInfo();if(!o||o.len<2*i.targetduration)return}if(!t.paused&&e){var a=e[this.hls.nextLoadLevel],s=this.fragLastKbps;r=s&&this.fragCurrent?this.fragCurrent.duration*a.maxBitrate/(1e3*s)+1:0}else r=0;var l=this.getBufferedFrag(t.currentTime+r);if(l){var c=this.followingBufferedFrag(l);if(c){this.abortCurrentFrag();var u=c.maxStartPTS?c.maxStartPTS:c.start,d=c.duration,h=Math.max(l.end,u+Math.min(Math.max(d-this.config.maxFragLookUpTolerance,.5*d),.75*d));this.flushMainBuffer(h,Number.POSITIVE_INFINITY)}}}},r.abortCurrentFrag=function(){var e=this.fragCurrent;switch(this.fragCurrent=null,this.backtrackFragment=null,e&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.state){case Wr:case zr:case Kr:case qr:case Zr:this.state=Gr}this.nextLoadPosition=this.getLoadPosition()},r.flushMainBuffer=function(t,r){e.prototype.flushMainBuffer.call(this,t,r,this.altAudio?"video":null)},r.onMediaAttached=function(t,r){e.prototype.onMediaAttached.call(this,t,r);var n=r.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),n.addEventListener("playing",this.onvplaying),n.addEventListener("seeked",this.onvseeked),this.gapController=new fi(this.config,n,this.fragmentTracker,this.hls)},r.onMediaDetaching=function(){var t=this.media;t&&this.onvplaying&&this.onvseeked&&(t.removeEventListener("playing",this.onvplaying),t.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),e.prototype.onMediaDetaching.call(this)},r.onMediaPlaying=function(){this.tick()},r.onMediaSeeked=function(){var e=this.media,t=e?e.currentTime:null;b(t)&&this.log("Media seeked to "+t.toFixed(3));var r=this.getMainFwdBufferInfo();null!==r&&0!==r.len?this.tick():this.warn('Main forward buffer length on "seeked" event '+(r?r.len:"empty")+")")},r.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(w.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=!1,this.startPosition=this.lastCurrentTime=0,this.levels=this.fragPlaying=this.backtrackFragment=null,this.altAudio=this.audioOnly=!1},r.onManifestParsed=function(e,t){var r,n,i,o=!1,a=!1;t.levels.forEach((function(e){(r=e.audioCodec)&&(-1!==r.indexOf("mp4a.40.2")&&(o=!0),-1!==r.indexOf("mp4a.40.5")&&(a=!0))})),this.audioCodecSwitch=o&&a&&!("function"==typeof(null==(i=tn())||null==(n=i.prototype)?void 0:n.changeType)),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=t.levels,this.startFragRequested=!1},r.onLevelLoading=function(e,t){var r=this.levels;if(r&&this.state===Gr){var n=r[t.level];(!n.details||n.details.live&&this.levelLastLoaded!==t.level||this.waitForCdnTuneIn(n.details))&&(this.state=Xr)}},r.onLevelLoaded=function(e,t){var r,n=this.levels,i=t.level,o=t.details,a=o.totalduration;if(n){this.log("Level "+i+" loaded ["+o.startSN+","+o.endSN+"]"+(o.lastPartSn?"[part-"+o.lastPartSn+"-"+o.lastPartIndex+"]":"")+", cc ["+o.startCC+", "+o.endCC+"] duration:"+a);var s=n[i],l=this.fragCurrent;!l||this.state!==zr&&this.state!==Kr||l.level===t.level&&l.urlId===s.urlId||!l.loader||this.abortCurrentFrag();var c=0;if(o.live||null!=(r=s.details)&&r.live){if(this.checkLiveUpdate(o),o.deltaUpdateFailed)return;c=this.alignPlaylists(o,s.details)}if(s.details=o,this.levelLastLoaded=i,this.hls.trigger(w.LEVEL_UPDATED,{details:o,level:i}),this.state===Xr){if(this.waitForCdnTuneIn(o))return;this.state=Gr}this.startFragRequested?o.live&&this.synchronizeToLiveEdge(o):this.setStartPosition(o,c),this.tick()}else this.warn("Levels were reset while loading level "+i)},r._handleFragmentLoadProgress=function(e){var t,r=e.frag,n=e.part,i=e.payload,o=this.levels;if(o){var a=o[r.level],s=a.details;if(!s)return this.warn("Dropping fragment "+r.sn+" of level "+r.level+" after level details were reset"),void this.fragmentTracker.removeFragment(r);var l=a.videoCodec,c=s.PTSKnown||!s.live,u=null==(t=r.initSegment)?void 0:t.data,d=this._getAudioCodec(a),h=this.transmuxer=this.transmuxer||new pi(this.hls,mt,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),p=n?n.index:-1,f=-1!==p,m=new Dr(r.level,r.sn,r.stats.chunkCount,i.byteLength,p,f),g=this.initPTS[r.cc];h.push(i,u,d,l,r,n,s.totalduration,c,m,g)}else this.warn("Levels were reset while fragment load was in progress. Fragment "+r.sn+" of level "+r.level+" will not be buffered")},r.onAudioTrackSwitching=function(e,t){var r=this.altAudio;if(!t.url){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var n=this.fragCurrent;n&&(this.log("Switching to main audio track, cancel main fragment load"),n.abortRequests(),this.fragmentTracker.removeFragment(n)),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var i=this.hls;r&&(i.trigger(w.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null}),this.fragmentTracker.removeAllFragments()),i.trigger(w.AUDIO_TRACK_SWITCHED,t)}},r.onAudioTrackSwitched=function(e,t){var r=t.id,n=!!this.hls.audioTracks[r].url;if(n){var i=this.videoBuffer;i&&this.mediaBuffer!==i&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=i)}this.altAudio=n,this.tick()},r.onBufferCreated=function(e,t){var r,n,i=t.tracks,o=!1;for(var a in i){var s=i[a];if("main"===s.id){if(n=a,r=s,"video"===a){var l=i[a];l&&(this.videoBuffer=l.buffer)}}else o=!0}o&&r?(this.log("Alternate track found, use "+n+".buffered to schedule main fragment loading"),this.mediaBuffer=r.buffer):this.mediaBuffer=this.media},r.onFragBuffered=function(e,t){var r=t.frag,n=t.part;if(!r||r.type===mt){if(this.fragContextChanged(r))return this.warn("Fragment "+r.sn+(n?" p: "+n.index:"")+" of level "+r.level+" finished buffering, but was aborted. state: "+this.state),void(this.state===Zr&&(this.state=Gr));var i=n?n.stats:r.stats;this.fragLastKbps=Math.round(8*i.total/(i.buffering.end-i.loading.first)),"initSegment"!==r.sn&&(this.fragPrevious=r),this.fragBufferedComplete(r,n)}},r.onError=function(e,t){var r;if(t.fatal)this.state=Jr;else switch(t.details){case C.FRAG_GAP:case C.FRAG_PARSING_ERROR:case C.FRAG_DECRYPT_ERROR:case C.FRAG_LOAD_ERROR:case C.FRAG_LOAD_TIMEOUT:case C.KEY_LOAD_ERROR:case C.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(mt,t);break;case C.LEVEL_LOAD_ERROR:case C.LEVEL_LOAD_TIMEOUT:case C.LEVEL_PARSING_ERROR:t.levelRetry||this.state!==Xr||(null==(r=t.context)?void 0:r.type)!==ht||(this.state=Gr);break;case C.BUFFER_FULL_ERROR:if(!t.parent||"main"!==t.parent)return;this.reduceLengthAndFlushBuffer(t)&&this.flushMainBuffer(0,Number.POSITIVE_INFINITY);break;case C.INTERNAL_EXCEPTION:this.recoverWorkerError(t)}},r.checkBuffer=function(){var e=this.media,t=this.gapController;if(e&&t&&e.readyState){if(this.loadedmetadata||!Ar.getBuffered(e).length){var r=this.state!==Gr?this.fragCurrent:null;t.poll(this.lastCurrentTime,r)}this.lastCurrentTime=e.currentTime}},r.onFragLoadEmergencyAborted=function(){this.state=Gr,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},r.onBufferFlushed=function(e,t){var r=t.type;if(r!==N||this.audioOnly&&!this.altAudio){var n=(r===F?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(n,r,mt)}},r.onLevelsUpdated=function(e,t){this.levels=t.levels},r.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},r.seekToStartPos=function(){var e=this.media;if(e){var t=e.currentTime,r=this.startPosition;if(r>=0&&t0&&(i_.cc;if(!1!==i.independent){var C=u.startPTS,O=u.endPTS,P=u.startDTS,T=u.endDTS;if(l)l.elementaryStreams[u.type]={startPTS:C,endPTS:O,startDTS:P,endDTS:T};else if(u.firstKeyFrame&&u.independent&&1===o.id&&!E&&(this.couldBacktrack=!0),u.dropped&&u.independent){var k=this.getMainFwdBufferInfo(),R=(k?k.end:this.getLoadPosition())+this.config.maxBufferHole,A=u.firstKeyFramePTS?u.firstKeyFramePTS:C;if(!S&&R1&&!1===e.seeking){var r=e.currentTime;if(Ar.isBuffered(e,r)?t=this.getAppendedFrag(r):Ar.isBuffered(e,r+.1)&&(t=this.getAppendedFrag(r+.1)),t){this.backtrackFragment=null;var n=this.fragPlaying,i=t.level;n&&t.sn===n.sn&&n.level===i&&t.urlId===n.urlId||(this.fragPlaying=t,this.hls.trigger(w.FRAG_CHANGED,{frag:t}),n&&n.level===i||this.hls.trigger(w.LEVEL_SWITCHED,{level:i}))}}},o(t,[{key:"nextLevel",get:function(){var e=this.nextBufferedFrag;return e?e.level:-1}},{key:"currentFrag",get:function(){var e=this.media;return e?this.fragPlaying||this.getAppendedFrag(e.currentTime):null}},{key:"currentProgramDateTime",get:function(){var e=this.media;if(e){var t=e.currentTime,r=this.currentFrag;if(r&&b(t)&&b(r.programDateTime)){var n=r.programDateTime+1e3*(t-r.start);return new Date(n)}}return null}},{key:"currentLevel",get:function(){var e=this.currentFrag;return e?e.level:-1}},{key:"nextBufferedFrag",get:function(){var e=this.currentFrag;return e?this.followingBufferedFrag(e):null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),t}(en),gi=function(){function e(e,t,r){void 0===t&&(t=0),void 0===r&&(r=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=e,this.alpha_=e?Math.exp(Math.log(.5)/e):0,this.estimate_=t,this.totalWeight_=r}var t=e.prototype;return t.sample=function(e,t){var r=Math.pow(this.alpha_,e);this.estimate_=t*(1-r)+r*this.estimate_,this.totalWeight_+=e},t.getTotalWeight=function(){return this.totalWeight_},t.getEstimate=function(){if(this.alpha_){var e=1-Math.pow(this.alpha_,this.totalWeight_);if(e)return this.estimate_/e}return this.estimate_},e}(),vi=function(){function e(e,t,r,n){void 0===n&&(n=100),this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultTTFB_=void 0,this.ttfb_=void 0,this.defaultEstimate_=r,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new gi(e),this.fast_=new gi(t),this.defaultTTFB_=n,this.ttfb_=new gi(e)}var t=e.prototype;return t.update=function(e,t){var r=this.slow_,n=this.fast_,i=this.ttfb_;r.halfLife!==e&&(this.slow_=new gi(e,r.getEstimate(),r.getTotalWeight())),n.halfLife!==t&&(this.fast_=new gi(t,n.getEstimate(),n.getTotalWeight())),i.halfLife!==e&&(this.ttfb_=new gi(e,i.getEstimate(),i.getTotalWeight()))},t.sample=function(e,t){var r=(e=Math.max(e,this.minDelayMs_))/1e3,n=8*t/r;this.fast_.sample(r,n),this.slow_.sample(r,n)},t.sampleTTFB=function(e){var t=e/1e3,r=Math.sqrt(2)*Math.exp(-Math.pow(t,2)/2);this.ttfb_.sample(r,Math.max(e,5))},t.canEstimate=function(){return this.fast_.getTotalWeight()>=this.minWeight_},t.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},t.getEstimateTTFB=function(){return this.ttfb_.getTotalWeight()>=this.minWeight_?this.ttfb_.getEstimate():this.defaultTTFB_},t.destroy=function(){},e}(),yi=function(){function e(e){this.hls=void 0,this.lastLevelLoadSec=0,this.lastLoadedFragLevel=0,this._nextAutoLevel=-1,this.timer=-1,this.onCheck=this._abandonRulesCheck.bind(this),this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this.hls=e;var t=e.config;this.bwEstimator=new vi(t.abrEwmaSlowVoD,t.abrEwmaFastVoD,t.abrEwmaDefaultEstimate),this.registerListeners()}var t=e.prototype;return t.registerListeners=function(){var e=this.hls;e.on(w.FRAG_LOADING,this.onFragLoading,this),e.on(w.FRAG_LOADED,this.onFragLoaded,this),e.on(w.FRAG_BUFFERED,this.onFragBuffered,this),e.on(w.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(w.LEVEL_LOADED,this.onLevelLoaded,this)},t.unregisterListeners=function(){var e=this.hls;e.off(w.FRAG_LOADING,this.onFragLoading,this),e.off(w.FRAG_LOADED,this.onFragLoaded,this),e.off(w.FRAG_BUFFERED,this.onFragBuffered,this),e.off(w.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(w.LEVEL_LOADED,this.onLevelLoaded,this)},t.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},t.onFragLoading=function(e,t){var r,n=t.frag;this.ignoreFragment(n)||(this.fragCurrent=n,this.partCurrent=null!=(r=t.part)?r:null,this.clearTimer(),this.timer=self.setInterval(this.onCheck,100))},t.onLevelSwitching=function(e,t){this.clearTimer()},t.getTimeToLoadFrag=function(e,t,r,n){return e+r/t+(n?this.lastLevelLoadSec:0)},t.onLevelLoaded=function(e,t){var r=this.hls.config,n=t.stats,i=n.total,o=n.bwEstimate;b(i)&&b(o)&&(this.lastLevelLoadSec=8*i/o),t.details.live?this.bwEstimator.update(r.abrEwmaSlowLive,r.abrEwmaFastLive):this.bwEstimator.update(r.abrEwmaSlowVoD,r.abrEwmaFastVoD)},t._abandonRulesCheck=function(){var e=this.fragCurrent,t=this.partCurrent,r=this.hls,n=r.autoLevelEnabled,i=r.media;if(e&&i){var o=performance.now(),a=t?t.stats:e.stats,s=t?t.duration:e.duration,l=o-a.loading.start;if(a.aborted||a.loaded&&a.loaded===a.total||0===e.level)return this.clearTimer(),void(this._nextAutoLevel=-1);if(n&&!i.paused&&i.playbackRate&&i.readyState){var c=r.mainForwardBufferInfo;if(null!==c){var u=this.bwEstimator.getEstimateTTFB(),d=Math.abs(i.playbackRate);if(!(l<=Math.max(u,s/(2*d)*1e3))){var h=c.len/d;if(!(h>=2*s/d)){var p=a.loading.first?a.loading.first-a.loading.start:-1,f=a.loaded&&p>-1,m=this.bwEstimator.getEstimate(),g=r.levels,v=r.minAutoLevel,y=g[e.level],_=a.total||Math.max(a.loaded,Math.round(s*y.maxBitrate/8)),S=l-p;S<1&&f&&(S=Math.min(l,8*a.loaded/m));var E=f?1e3*a.loaded/S:0,C=E?(_-a.loaded)/E:8*_/m+u/1e3;if(!(C<=h)){var O,P=E?8*E:m,T=Number.POSITIVE_INFINITY;for(O=e.level-1;O>v;O--){var k=g[O].maxBitrate;if((T=this.getTimeToLoadFrag(u/1e3,P,s*k,!g[O].details))=C||T>10*s||(r.nextLoadLevel=O,f?this.bwEstimator.sample(l-Math.min(u,p),a.loaded):this.bwEstimator.sampleTTFB(l),this.clearTimer(),A.warn("[abr] Fragment "+e.sn+(t?" part "+t.index:"")+" of level "+e.level+" is loading too slowly;\n Time to underbuffer: "+h.toFixed(3)+" s\n Estimated load time for current fragment: "+C.toFixed(3)+" s\n Estimated load time for down switch fragment: "+T.toFixed(3)+" s\n TTFB estimate: "+p+"\n Current BW estimate: "+(b(m)?(m/1024).toFixed(3):"Unknown")+" Kb/s\n New BW estimate: "+(this.bwEstimator.getEstimate()/1024).toFixed(3)+" Kb/s\n Aborting and switching to level "+O),e.loader&&(this.fragCurrent=this.partCurrent=null,e.abortRequests()),r.trigger(w.FRAG_LOAD_EMERGENCY_ABORTED,{frag:e,part:t,stats:a}))}}}}}}},t.onFragLoaded=function(e,t){var r=t.frag,n=t.part,i=n?n.stats:r.stats;if(r.type===mt&&this.bwEstimator.sampleTTFB(i.loading.first-i.loading.start),!this.ignoreFragment(r)){if(this.clearTimer(),this.lastLoadedFragLevel=r.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var o=n?n.duration:r.duration,a=this.hls.levels[r.level],s=(a.loaded?a.loaded.bytes:0)+i.loaded,l=(a.loaded?a.loaded.duration:0)+o;a.loaded={bytes:s,duration:l},a.realBitrate=Math.round(8*s/l)}if(r.bitrateTest){var c={stats:i,frag:r,part:n,id:r.type};this.onFragBuffered(w.FRAG_BUFFERED,c),r.bitrateTest=!1}}},t.onFragBuffered=function(e,t){var r=t.frag,n=t.part,i=null!=n&&n.stats.loaded?n.stats:r.stats;if(!i.aborted&&!this.ignoreFragment(r)){var o=i.parsing.end-i.loading.start-Math.min(i.loading.first-i.loading.start,this.bwEstimator.getEstimateTTFB());this.bwEstimator.sample(o,i.loaded),i.bwEstimate=this.bwEstimator.getEstimate(),r.bitrateTest?this.bitrateTestDelay=o/1e3:this.bitrateTestDelay=0}},t.ignoreFragment=function(e){return e.type!==mt||"initSegment"===e.sn},t.clearTimer=function(){self.clearInterval(this.timer)},t.getNextABRAutoLevel=function(){var e=this.fragCurrent,t=this.partCurrent,r=this.hls,n=r.maxAutoLevel,i=r.config,o=r.minAutoLevel,a=r.media,s=t?t.duration:e?e.duration:0,l=a&&0!==a.playbackRate?Math.abs(a.playbackRate):1,c=this.bwEstimator?this.bwEstimator.getEstimate():i.abrEwmaDefaultEstimate,u=r.mainForwardBufferInfo,d=(u?u.len:0)/l,h=this.findBestLevel(c,o,n,d,i.abrBandWidthFactor,i.abrBandWidthUpFactor);if(h>=0)return h;A.trace("[abr] "+(d?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var p=s?Math.min(s,i.maxStarvationDelay):i.maxStarvationDelay,f=i.abrBandWidthFactor,m=i.abrBandWidthUpFactor;if(!d){var g=this.bitrateTestDelay;g&&(p=(s?Math.min(s,i.maxLoadingDelay):i.maxLoadingDelay)-g,A.trace("[abr] bitrate test took "+Math.round(1e3*g)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*p)+" ms"),f=m=1)}return h=this.findBestLevel(c,o,n,d+p,f,m),Math.max(h,0)},t.findBestLevel=function(e,t,r,n,i,o){for(var a,s=this.fragCurrent,l=this.partCurrent,c=this.lastLoadedFragLevel,u=this.hls.levels,d=u[c],h=!(null==d||null==(a=d.details)||!a.live),p=null==d?void 0:d.codecSet,f=l?l.duration:s?s.duration:0,m=this.bwEstimator.getEstimateTTFB()/1e3,g=t,v=-1,y=r;y>=t;y--){var _=u[y];if(!_||p&&_.codecSet!==p)_&&(g=Math.min(y,g),v=Math.max(y,v));else{-1!==v&&A.trace("[abr] Skipped level(s) "+g+"-"+v+' with CODECS:"'+u[v].attrs.CODECS+'"; not compatible with "'+d.attrs.CODECS+'"');var S,w=_.details,E=(l?null==w?void 0:w.partTarget:null==w?void 0:w.averagetargetduration)||f;S=y<=c?i*e:o*e;var C=u[y].maxBitrate,O=this.getTimeToLoadFrag(m,S,C*E,void 0===w);if(A.trace("[abr] level:"+y+" adjustedbw-bitrate:"+Math.round(S-C)+" avgDuration:"+E.toFixed(1)+" maxFetchDuration:"+n.toFixed(1)+" fetchDuration:"+O.toFixed(1)),S>C&&(0===O||!b(O)||h&&!this.bitrateTestDelay||OMath.max(e,r)&&n[e].loadError<=n[r].loadError)return e}return-1!==e&&(r=Math.min(e,r)),r},set:function(e){this._nextAutoLevel=e}}]),e}(),bi=function(){function e(){this.chunks=[],this.dataLength=0}var t=e.prototype;return t.push=function(e){this.chunks.push(e),this.dataLength+=e.length},t.flush=function(){var e,t=this.chunks,r=this.dataLength;return t.length?(e=1===t.length?t[0]:function(e,t){for(var r=new Uint8Array(t),n=0,i=0;i0&&-1===e?(this.log("Override startPosition with lastCurrentTime @"+t.toFixed(3)),e=t,this.state=Gr):(this.loadedmetadata=!1,this.state=$r),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()},r.doTick=function(){switch(this.state){case Gr:this.doTickIdle();break;case $r:var t,r=this.levels,n=this.trackId,i=null==r||null==(t=r[n])?void 0:t.details;if(i){if(this.waitForCdnTuneIn(i))break;this.state=Qr}break;case Kr:var o,a=performance.now(),s=this.retryDate;(!s||a>=s||null!=(o=this.media)&&o.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded(this.trackId),this.state=Gr);break;case Qr:var l=this.waitingData;if(l){var c=l.frag,u=l.part,d=l.cache,h=l.complete;if(void 0!==this.initPTS[c.cc]){this.waitingData=null,this.waitingVideoCC=-1,this.state=zr;var p={frag:c,part:u,payload:d.flush(),networkDetails:null};this._handleFragmentLoadProgress(p),h&&e.prototype._handleFragmentLoadComplete.call(this,p)}else if(this.videoTrackCC!==this.waitingVideoCC)this.log("Waiting fragment cc ("+c.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var f=this.getLoadPosition(),m=Ar.bufferInfo(this.mediaBuffer,f,this.config.maxBufferHole);er(m.end,this.config.maxFragLookUpTolerance,c)<0&&(this.log("Waiting fragment cc ("+c.cc+") @ "+c.start+" cancelled because another fragment at "+m.end+" is needed"),this.clearWaitingFragment())}}else this.state=Gr}this.onTickEnd()},r.clearWaitingFragment=function(){var e=this.waitingData;e&&(this.fragmentTracker.removeFragment(e.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=Gr)},r.resetLoadingState=function(){this.clearWaitingFragment(),e.prototype.resetLoadingState.call(this)},r.onTickEnd=function(){var e=this.media;null!=e&&e.readyState&&(this.lastCurrentTime=e.currentTime)},r.doTickIdle=function(){var e=this.hls,t=this.levels,r=this.media,n=this.trackId,i=e.config;if(null!=t&&t[n]&&(r||!this.startFragRequested&&i.startFragPrefetch)){var o=t[n],a=o.details;if(!a||a.live&&this.levelLastLoaded!==n||this.waitForCdnTuneIn(a))this.state=$r;else{var s=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&s&&(this.bufferFlushed=!1,this.afterBufferFlushed(s,N,gt));var l=this.getFwdBufferInfo(s,gt);if(null!==l){var c=this.bufferedTrack,u=this.switchingTrack;if(!u&&this._streamEnded(l,a))return e.trigger(w.BUFFER_EOS,{type:"audio"}),void(this.state=Yr);var d=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,mt),h=l.len,p=this.getMaxBufferLength(null==d?void 0:d.len);if(!(h>=p)||u){var f=a.fragments[0].start,m=l.end;if(u&&r){var g=this.getLoadPosition();c&&u.attrs!==c.attrs&&(m=g),a.PTSKnown&&gf||l.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),r.currentTime=f+.05)}var v=this.getNextFragment(m,a),y=!1;if(v&&this.isLoopLoading(v,m)&&(y=!!v.gap,v=this.getNextFragmentLoopLoading(v,a,l,mt,p)),v){var b=d&&v.start>d.end+a.targetduration;if(b||(null==d||!d.len)&&l.len){var _=this.getAppendedFrag(v.start,mt);if(null===_)return;if(y||(y=!!_.gap||!!b&&0===d.len),b&&!y||y&&l.nextStart&&l.nextStart<_.end)return}this.loadFragment(v,o,m)}else this.bufferFlushed=!0}}}}},r.getMaxBufferLength=function(t){var r=e.prototype.getMaxBufferLength.call(this);return t?Math.min(Math.max(r,t),this.config.maxMaxBufferLength):r},r.onMediaDetaching=function(){this.videoBuffer=null,e.prototype.onMediaDetaching.call(this)},r.onAudioTracksUpdated=function(e,t){var r=t.audioTracks;this.resetTransmuxer(),this.levels=r.map((function(e){return new Bt(e)}))},r.onAudioTrackSwitching=function(e,t){var r=!!t.url;this.trackId=t.id;var n=this.fragCurrent;n&&(n.abortRequests(),this.removeUnbufferedFrags(n.start)),this.resetLoadingState(),r?this.setInterval(100):this.resetTransmuxer(),r?(this.switchingTrack=t,this.state=Gr):(this.switchingTrack=null,this.bufferedTrack=t,this.state=Hr),this.tick()},r.onManifestLoading=function(){this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1,this.levels=this.mainDetails=this.waitingData=this.bufferedTrack=this.cachedTrackLoadedData=this.switchingTrack=null,this.startFragRequested=!1,this.trackId=this.videoTrackCC=this.waitingVideoCC=-1},r.onLevelLoaded=function(e,t){this.mainDetails=t.details,null!==this.cachedTrackLoadedData&&(this.hls.trigger(w.AUDIO_TRACK_LOADED,this.cachedTrackLoadedData),this.cachedTrackLoadedData=null)},r.onAudioTrackLoaded=function(e,t){var r;if(null!=this.mainDetails){var n=this.levels,i=t.details,o=t.id;if(n){this.log("Track "+o+" loaded ["+i.startSN+","+i.endSN+"]"+(i.lastPartSn?"[part-"+i.lastPartSn+"-"+i.lastPartIndex+"]":"")+",duration:"+i.totalduration);var a=n[o],s=0;if(i.live||null!=(r=a.details)&&r.live){this.checkLiveUpdate(i);var l=this.mainDetails;if(i.deltaUpdateFailed||!l)return;!a.details&&i.hasProgramDateTime&&l.hasProgramDateTime?(jr(i,l),s=i.fragments[0].start):s=this.alignPlaylists(i,a.details)}a.details=i,this.levelLastLoaded=o,this.startFragRequested||!this.mainDetails&&i.live||this.setStartPosition(a.details,s),this.state!==$r||this.waitForCdnTuneIn(i)||(this.state=Gr),this.tick()}else this.warn("Audio tracks were reset while loading level "+o)}else this.cachedTrackLoadedData=t},r._handleFragmentLoadProgress=function(e){var t,r=e.frag,n=e.part,i=e.payload,o=this.config,a=this.trackId,s=this.levels;if(s){var l=s[a];if(l){var c=l.details;if(!c)return this.warn("Audio track details undefined on fragment load progress"),void this.removeUnbufferedFrags(r.start);var u=o.defaultAudioCodec||l.audioCodec||"mp4a.40.2",d=this.transmuxer;d||(d=this.transmuxer=new pi(this.hls,gt,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var h=this.initPTS[r.cc],p=null==(t=r.initSegment)?void 0:t.data;if(void 0!==h){var f=n?n.index:-1,m=-1!==f,g=new Dr(r.level,r.sn,r.stats.chunkCount,i.byteLength,f,m);d.push(i,p,u,"",r,n,c.totalduration,!1,g,h)}else this.log("Unknown video PTS for cc "+r.cc+", waiting for video PTS before demuxing audio frag "+r.sn+" of ["+c.startSN+" ,"+c.endSN+"],track "+a),(this.waitingData=this.waitingData||{frag:r,part:n,cache:new bi,complete:!1}).cache.push(new Uint8Array(i)),this.waitingVideoCC=this.videoTrackCC,this.state=Qr}else this.warn("Audio track is undefined on fragment load progress")}else this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+r.sn+" of level "+r.level+" will not be buffered")},r._handleFragmentLoadComplete=function(t){this.waitingData?this.waitingData.complete=!0:e.prototype._handleFragmentLoadComplete.call(this,t)},r.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},r.onBufferCreated=function(e,t){var r=t.tracks.audio;r&&(this.mediaBuffer=r.buffer||null),t.tracks.video&&(this.videoBuffer=t.tracks.video.buffer||null)},r.onFragBuffered=function(e,t){var r=t.frag,i=t.part;if(r.type===gt)if(this.fragContextChanged(r))this.warn("Fragment "+r.sn+(i?" p: "+i.index:"")+" of level "+r.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+(this.switchingTrack?this.switchingTrack.name:"false"));else{if("initSegment"!==r.sn){this.fragPrevious=r;var o=this.switchingTrack;o&&(this.bufferedTrack=o,this.switchingTrack=null,this.hls.trigger(w.AUDIO_TRACK_SWITCHED,n({},o)))}this.fragBufferedComplete(r,i)}else if(!this.loadedmetadata&&r.type===mt){var a=this.videoBuffer||this.media;a&&Ar.getBuffered(a).length&&(this.loadedmetadata=!0)}},r.onError=function(t,r){var n;if(r.fatal)this.state=Jr;else switch(r.details){case C.FRAG_GAP:case C.FRAG_PARSING_ERROR:case C.FRAG_DECRYPT_ERROR:case C.FRAG_LOAD_ERROR:case C.FRAG_LOAD_TIMEOUT:case C.KEY_LOAD_ERROR:case C.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(gt,r);break;case C.AUDIO_TRACK_LOAD_ERROR:case C.AUDIO_TRACK_LOAD_TIMEOUT:case C.LEVEL_PARSING_ERROR:r.levelRetry||this.state!==$r||(null==(n=r.context)?void 0:n.type)!==pt||(this.state=Gr);break;case C.BUFFER_FULL_ERROR:if(!r.parent||"audio"!==r.parent)return;this.reduceLengthAndFlushBuffer(r)&&(this.bufferedTrack=null,e.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio"));break;case C.INTERNAL_EXCEPTION:this.recoverWorkerError(r)}},r.onBufferFlushed=function(e,t){t.type===N&&(this.bufferFlushed=!0,this.state===Yr&&(this.state=Gr))},r._handleTransmuxComplete=function(e){var t,r="audio",n=this.hls,i=e.remuxResult,o=e.chunkMeta,a=this.getCurrentContext(o);if(a){var l=a.frag,c=a.part,u=a.level.details,d=i.audio,h=i.text,p=i.id3,f=i.initSegment;if(!this.fragContextChanged(l)&&u){if(this.state=qr,this.switchingTrack&&d&&this.completeAudioSwitch(this.switchingTrack),null!=f&&f.tracks){var m=l.initSegment||l;this._bufferInitSegment(f.tracks,m,o),n.trigger(w.FRAG_PARSING_INIT_SEGMENT,{frag:m,id:r,tracks:f.tracks})}if(d){var g=d.startPTS,v=d.endPTS,y=d.startDTS,b=d.endDTS;c&&(c.elementaryStreams[N]={startPTS:g,endPTS:v,startDTS:y,endDTS:b}),l.setElementaryStreamInfo(N,g,v,y,b),this.bufferFragmentData(d,l,c,o)}if(null!=p&&null!=(t=p.samples)&&t.length){var _=s({id:r,frag:l,details:u},p);n.trigger(w.FRAG_PARSING_METADATA,_)}if(h){var S=s({id:r,frag:l,details:u},h);n.trigger(w.FRAG_PARSING_USERDATA,S)}}else this.fragmentTracker.removeFragment(l)}else this.resetWhenMissingContext(o)},r._bufferInitSegment=function(e,t,r){if(this.state===qr){e.video&&delete e.video;var n=e.audio;if(n){n.levelCodec=n.codec,n.id="audio",this.log("Init audio buffer, container:"+n.container+", codecs[parsed]=["+n.codec+"]"),this.hls.trigger(w.BUFFER_CODECS,e);var i=n.initSegment;if(null!=i&&i.byteLength){var o={type:"audio",frag:t,part:null,chunkMeta:r,parent:t.type,data:i};this.hls.trigger(w.BUFFER_APPENDING,o)}this.tick()}}},r.loadFragment=function(t,r,n){var i,o=this.fragmentTracker.getState(t);this.fragCurrent=t,this.switchingTrack||o===mr||o===vr?"initSegment"===t.sn?this._loadInitSegment(t,r):null!=(i=r.details)&&i.live&&!this.initPTS[t.cc]?(this.log("Waiting for video PTS in continuity counter "+t.cc+" of live stream before loading audio fragment "+t.sn+" of level "+this.trackId),this.state=Qr):(this.startFragRequested=!0,e.prototype.loadFragment.call(this,t,r,n)):this.clearTrackerIfNeeded(t)},r.completeAudioSwitch=function(t){var r=this.hls,i=this.media,o=this.bufferedTrack,a=null==o?void 0:o.attrs,s=t.attrs;i&&a&&(a.CHANNELS!==s.CHANNELS||a.NAME!==s.NAME||a.LANGUAGE!==s.LANGUAGE)&&(this.log("Switching audio track : flushing all audio"),e.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.bufferedTrack=t,this.switchingTrack=null,r.trigger(w.AUDIO_TRACK_SWITCHED,n({},t))},t}(en),Si=function(e){function t(t){var r;return(r=e.call(this,t,"[audio-track-controller]")||this).tracks=[],r.groupId=null,r.tracksInGroup=[],r.trackId=-1,r.currentTrack=null,r.selectDefaultTrack=!0,r.registerListeners(),r}l(t,e);var r=t.prototype;return r.registerListeners=function(){var e=this.hls;e.on(w.MANIFEST_LOADING,this.onManifestLoading,this),e.on(w.MANIFEST_PARSED,this.onManifestParsed,this),e.on(w.LEVEL_LOADING,this.onLevelLoading,this),e.on(w.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(w.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(w.ERROR,this.onError,this)},r.unregisterListeners=function(){var e=this.hls;e.off(w.MANIFEST_LOADING,this.onManifestLoading,this),e.off(w.MANIFEST_PARSED,this.onManifestParsed,this),e.off(w.LEVEL_LOADING,this.onLevelLoading,this),e.off(w.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(w.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(w.ERROR,this.onError,this)},r.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,e.prototype.destroy.call(this)},r.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0},r.onManifestParsed=function(e,t){this.tracks=t.audioTracks||[]},r.onAudioTrackLoaded=function(e,t){var r=t.id,n=t.groupId,i=t.details,o=this.tracksInGroup[r];if(o&&o.groupId===n){var a=o.details;o.details=t.details,this.log("audio-track "+r+' "'+o.name+'" lang:'+o.lang+" group:"+n+" loaded ["+i.startSN+"-"+i.endSN+"]"),r===this.trackId&&this.playlistLoaded(r,t,a)}else this.warn("Track with id:"+r+" and group:"+n+" not found in active group "+o.groupId)},r.onLevelLoading=function(e,t){this.switchLevel(t.level)},r.onLevelSwitching=function(e,t){this.switchLevel(t.level)},r.switchLevel=function(e){var t=this.hls.levels[e];if(null!=t&&t.audioGroupIds){var r=t.audioGroupIds[t.urlId];if(this.groupId!==r){this.groupId=r||null;var n=this.tracks.filter((function(e){return!r||e.groupId===r}));this.selectDefaultTrack&&!n.some((function(e){return e.default}))&&(this.selectDefaultTrack=!1),this.tracksInGroup=n;var i={audioTracks:n};this.log("Updating audio tracks, "+n.length+" track(s) found in group:"+r),this.hls.trigger(w.AUDIO_TRACKS_UPDATED,i),this.selectInitialTrack()}else this.shouldReloadPlaylist(this.currentTrack)&&this.setAudioTrack(this.trackId)}},r.onError=function(e,t){!t.fatal&&t.context&&t.context.type===pt&&t.context.id===this.trackId&&t.context.groupId===this.groupId&&(this.requestScheduled=-1,this.checkRetry(t))},r.setAudioTrack=function(e){var t=this.tracksInGroup;if(e<0||e>=t.length)this.warn("Invalid id passed to audio-track controller");else{this.clearTimer();var r=this.currentTrack;t[this.trackId];var i=t[e],o=i.groupId,a=i.name;if(this.log("Switching to audio-track "+e+' "'+a+'" lang:'+i.lang+" group:"+o),this.trackId=e,this.currentTrack=i,this.selectDefaultTrack=!1,this.hls.trigger(w.AUDIO_TRACK_SWITCHING,n({},i)),!i.details||i.details.live){var s=this.switchParams(i.url,null==r?void 0:r.details);this.loadPlaylist(s)}}},r.selectInitialTrack=function(){var e=this.tracksInGroup,t=this.findTrackId(this.currentTrack)|this.findTrackId(null);if(-1!==t)this.setAudioTrack(t);else{var r=new Error("No track found for running audio group-ID: "+this.groupId+" track count: "+e.length);this.warn(r.message),this.hls.trigger(w.ERROR,{type:E.MEDIA_ERROR,details:C.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:r})}},r.findTrackId=function(e){for(var t=this.tracksInGroup,r=0;r=i[s].start&&a<=i[s].end){o=i[s];break}var l=r.start+r.duration;o?o.end=l:(o={start:a,end:l},i.push(o)),this.fragmentTracker.fragBuffered(r)}}},r.onBufferFlushing=function(e,t){var r=t.startOffset,n=t.endOffset;if(0===r&&n!==Number.POSITIVE_INFINITY){var i=n-1;if(i<=0)return;t.endOffsetSubtitles=Math.max(0,i),this.tracksBuffered.forEach((function(e){for(var t=0;t=a.length||i!==o)&&s){this.mediaBuffer=this.mediaBufferTimeRanges;var l=0;if(n.live||null!=(r=s.details)&&r.live){var c=this.mainDetails;if(n.deltaUpdateFailed||!c)return;var u=c.fragments[0];s.details?0===(l=this.alignPlaylists(n,s.details))&&u&&Wt(n,l=u.start):n.hasProgramDateTime&&c.hasProgramDateTime?(jr(n,c),l=n.fragments[0].start):u&&Wt(n,l=u.start)}s.details=n,this.levelLastLoaded=i,this.startFragRequested||!this.mainDetails&&n.live||this.setStartPosition(s.details,l),this.tick(),n.live&&!this.fragCurrent&&this.media&&this.state===Gr&&(Xt(null,n.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),s.details=void 0))}}},r._handleFragmentLoadComplete=function(e){var t=this,r=e.frag,n=e.payload,i=r.decryptdata,o=this.hls;if(!this.fragContextChanged(r)&&n&&n.byteLength>0&&i&&i.key&&i.iv&&"AES-128"===i.method){var a=performance.now();this.decrypter.decrypt(new Uint8Array(n),i.key.buffer,i.iv.buffer).catch((function(e){throw o.trigger(w.ERROR,{type:E.MEDIA_ERROR,details:C.FRAG_DECRYPT_ERROR,fatal:!1,error:e,reason:e.message,frag:r}),e})).then((function(e){var t=performance.now();o.trigger(w.FRAG_DECRYPTED,{frag:r,payload:e,stats:{tstart:a,tdecrypt:t}})})).catch((function(e){t.warn(e.name+": "+e.message),t.state=Gr}))}},r.doTick=function(){if(this.media){if(this.state===Gr){var e=this.currentTrackId,t=this.levels,r=t[e];if(!t.length||!r||!r.details)return;var n=this.config,i=this.getLoadPosition(),o=Ar.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],i,n.maxBufferHole),a=o.end,s=o.len,l=this.getFwdBufferInfo(this.media,mt),c=r.details;if(s>this.getMaxBufferLength(null==l?void 0:l.len)+c.levelTargetDuration)return;var u=c.fragments,d=u.length,h=c.edge,p=null,f=this.fragPrevious;if(ah-m?0:m;!(p=Xt(f,u,Math.max(u[0].start,a),g))&&f&&f.start>>=0)>n-1)throw new DOMException("Failed to execute '"+t+"' on 'TimeRanges': The index provided ("+r+") is greater than the maximum bound ("+n+")");return e[r][t]};this.buffered={get length(){return e.length},end:function(r){return t("end",r,e.length)},start:function(r){return t("start",r,e.length)}}},Pi=function(e){function t(t){var r;return(r=e.call(this,t,"[subtitle-track-controller]")||this).media=null,r.tracks=[],r.groupId=null,r.tracksInGroup=[],r.trackId=-1,r.selectDefaultTrack=!0,r.queuedDefaultTrack=-1,r.trackChangeListener=function(){return r.onTextTracksChanged()},r.asyncPollTrackChange=function(){return r.pollTrackChange(0)},r.useTextTrackPolling=!1,r.subtitlePollingInterval=-1,r._subtitleDisplay=!0,r.registerListeners(),r}l(t,e);var r=t.prototype;return r.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,e.prototype.destroy.call(this)},r.registerListeners=function(){var e=this.hls;e.on(w.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(w.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(w.MANIFEST_LOADING,this.onManifestLoading,this),e.on(w.MANIFEST_PARSED,this.onManifestParsed,this),e.on(w.LEVEL_LOADING,this.onLevelLoading,this),e.on(w.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(w.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(w.ERROR,this.onError,this)},r.unregisterListeners=function(){var e=this.hls;e.off(w.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(w.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(w.MANIFEST_LOADING,this.onManifestLoading,this),e.off(w.MANIFEST_PARSED,this.onManifestParsed,this),e.off(w.LEVEL_LOADING,this.onLevelLoading,this),e.off(w.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(w.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(w.ERROR,this.onError,this)},r.onMediaAttached=function(e,t){this.media=t.media,this.media&&(this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange))},r.pollTrackChange=function(e){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,e)},r.onMediaDetaching=function(){this.media&&(self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),Ti(this.media.textTracks).forEach((function(e){Et(e)})),this.subtitleTrack=-1,this.media=null)},r.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},r.onManifestParsed=function(e,t){this.tracks=t.subtitleTracks},r.onSubtitleTrackLoaded=function(e,t){var r=t.id,n=t.details,i=this.trackId,o=this.tracksInGroup[i];if(o){var a=o.details;o.details=t.details,this.log("subtitle track "+r+" loaded ["+n.startSN+"-"+n.endSN+"]"),r===this.trackId&&this.playlistLoaded(r,t,a)}else this.warn("Invalid subtitle track id "+r)},r.onLevelLoading=function(e,t){this.switchLevel(t.level)},r.onLevelSwitching=function(e,t){this.switchLevel(t.level)},r.switchLevel=function(e){var t=this.hls.levels[e];if(null!=t&&t.textGroupIds){var r=t.textGroupIds[t.urlId],n=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;if(this.groupId!==r){var i=this.tracks.filter((function(e){return!r||e.groupId===r}));this.tracksInGroup=i;var o=this.findTrackId(null==n?void 0:n.name)||this.findTrackId();this.groupId=r||null;var a={subtitleTracks:i};this.log("Updating subtitle tracks, "+i.length+' track(s) found in "'+r+'" group-id'),this.hls.trigger(w.SUBTITLE_TRACKS_UPDATED,a),-1!==o&&this.setSubtitleTrack(o,n)}else this.shouldReloadPlaylist(n)&&this.setSubtitleTrack(this.trackId,n)}},r.findTrackId=function(e){for(var t=this.tracksInGroup,r=0;r=n.length)){this.clearTimer();var i=n[e];if(this.log("Switching to subtitle-track "+e+(i?' "'+i.name+'" lang:'+i.lang+" group:"+i.groupId:"")),this.trackId=e,i){var o=i.id,a=i.groupId,s=void 0===a?"":a,l=i.name,c=i.type,u=i.url;this.hls.trigger(w.SUBTITLE_TRACK_SWITCH,{id:o,groupId:s,name:l,type:c,url:u});var d=this.switchParams(i.url,null==t?void 0:t.details);this.loadPlaylist(d)}else this.hls.trigger(w.SUBTITLE_TRACK_SWITCH,{id:e})}}else this.queuedDefaultTrack=e},r.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),this.media&&this.hls.config.renderTextTracksNatively){for(var e=-1,t=Ti(this.media.textTracks),r=0;r-1&&this.toggleTrackModes(this.trackId)}},{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(e){this.selectDefaultTrack=!1;var t=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(e,t)}}]),t}(dr);function Ti(e){for(var t=[],r=0;r "+e.src+")")},this.hls=e,this._initSourceBuffer(),this.registerListeners()}var t=e.prototype;return t.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},t.destroy=function(){this.unregisterListeners(),this.details=null,this.lastMpegAudioChunk=null},t.registerListeners=function(){var e=this.hls;e.on(w.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(w.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(w.MANIFEST_LOADING,this.onManifestLoading,this),e.on(w.MANIFEST_PARSED,this.onManifestParsed,this),e.on(w.BUFFER_RESET,this.onBufferReset,this),e.on(w.BUFFER_APPENDING,this.onBufferAppending,this),e.on(w.BUFFER_CODECS,this.onBufferCodecs,this),e.on(w.BUFFER_EOS,this.onBufferEos,this),e.on(w.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(w.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(w.FRAG_PARSED,this.onFragParsed,this),e.on(w.FRAG_CHANGED,this.onFragChanged,this)},t.unregisterListeners=function(){var e=this.hls;e.off(w.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(w.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(w.MANIFEST_LOADING,this.onManifestLoading,this),e.off(w.MANIFEST_PARSED,this.onManifestParsed,this),e.off(w.BUFFER_RESET,this.onBufferReset,this),e.off(w.BUFFER_APPENDING,this.onBufferAppending,this),e.off(w.BUFFER_CODECS,this.onBufferCodecs,this),e.off(w.BUFFER_EOS,this.onBufferEos,this),e.off(w.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(w.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(w.FRAG_PARSED,this.onFragParsed,this),e.off(w.FRAG_CHANGED,this.onFragChanged,this)},t._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new ki(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]},this.lastMpegAudioChunk=null},t.onManifestLoading=function(){this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=0,this.details=null},t.onManifestParsed=function(e,t){var r=2;(t.audio&&!t.video||!t.altAudio)&&(r=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=r,A.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},t.onMediaAttaching=function(e,t){var r=this.media=t.media;if(r&&Ri){var n=this.mediaSource=new Ri;n.addEventListener("sourceopen",this._onMediaSourceOpen),n.addEventListener("sourceended",this._onMediaSourceEnded),n.addEventListener("sourceclose",this._onMediaSourceClose),r.src=self.URL.createObjectURL(n),this._objectUrl=r.src,r.addEventListener("emptied",this._onMediaEmptied)}},t.onMediaDetaching=function(){var e=this.media,t=this.mediaSource,r=this._objectUrl;if(t){if(A.log("[buffer-controller]: media source detaching"),"open"===t.readyState)try{t.endOfStream()}catch(e){A.warn("[buffer-controller]: onMediaDetaching: "+e.message+" while calling endOfStream")}this.onBufferReset(),t.removeEventListener("sourceopen",this._onMediaSourceOpen),t.removeEventListener("sourceended",this._onMediaSourceEnded),t.removeEventListener("sourceclose",this._onMediaSourceClose),e&&(e.removeEventListener("emptied",this._onMediaEmptied),r&&self.URL.revokeObjectURL(r),e.src===r?(e.removeAttribute("src"),e.load()):A.warn("[buffer-controller]: media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(w.MEDIA_DETACHED,void 0)},t.onBufferReset=function(){var e=this;this.getSourceBufferTypes().forEach((function(t){var r=e.sourceBuffer[t];try{r&&(e.removeBufferListeners(t),e.mediaSource&&e.mediaSource.removeSourceBuffer(r),e.sourceBuffer[t]=void 0)}catch(e){A.warn("[buffer-controller]: Failed to reset the "+t+" buffer",e)}})),this._initSourceBuffer()},t.onBufferCodecs=function(e,t){var r=this,n=this.getSourceBufferTypes().length;Object.keys(t).forEach((function(e){if(n){var i=r.tracks[e];if(i&&"function"==typeof i.buffer.changeType){var o=t[e],a=o.id,s=o.codec,l=o.levelCodec,c=o.container,u=o.metadata,d=(i.levelCodec||i.codec).replace(Ai,"$1"),h=(l||s).replace(Ai,"$1");if(d!==h){var p=c+";codecs="+(l||s);r.appendChangeType(e,p),A.log("[buffer-controller]: switching codec "+d+" to "+h),r.tracks[e]={buffer:i.buffer,codec:s,container:c,levelCodec:l,metadata:u,id:a}}}}else r.pendingTracks[e]=t[e]})),n||(this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&"open"===this.mediaSource.readyState&&this.checkPendingTracks())},t.appendChangeType=function(e,t){var r=this,n=this.operationQueue,i={execute:function(){var i=r.sourceBuffer[e];i&&(A.log("[buffer-controller]: changing "+e+" sourceBuffer type to "+t),i.changeType(t)),n.shiftAndExecuteNext(e)},onStart:function(){},onComplete:function(){},onError:function(t){A.warn("[buffer-controller]: Failed to change "+e+" SourceBuffer type",t)}};n.append(i,e)},t.onBufferAppending=function(e,t){var r=this,n=this.hls,i=this.operationQueue,o=this.tracks,a=t.data,s=t.type,l=t.frag,c=t.part,u=t.chunkMeta,d=u.buffering[s],h=self.performance.now();d.start=h;var p=l.stats.buffering,f=c?c.stats.buffering:null;0===p.start&&(p.start=h),f&&0===f.start&&(f.start=h);var m=o.audio,g=!1;"audio"===s&&"audio/mpeg"===(null==m?void 0:m.container)&&(g=!this.lastMpegAudioChunk||1===u.id||this.lastMpegAudioChunk.sn!==u.sn,this.lastMpegAudioChunk=u);var v=l.start,y={execute:function(){if(d.executeStart=self.performance.now(),g){var e=r.sourceBuffer[s];if(e){var t=v-e.timestampOffset;Math.abs(t)>=.1&&(A.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+v+" (delta: "+t+") sn: "+l.sn+")"),e.timestampOffset=v)}}r.appendExecutor(a,s)},onStart:function(){},onComplete:function(){var e=self.performance.now();d.executeEnd=d.end=e,0===p.first&&(p.first=e),f&&0===f.first&&(f.first=e);var t=r.sourceBuffer,n={};for(var i in t)n[i]=Ar.getBuffered(t[i]);r.appendError=0,r.hls.trigger(w.BUFFER_APPENDED,{type:s,frag:l,part:c,chunkMeta:u,parent:l.type,timeRanges:n})},onError:function(e){A.error("[buffer-controller]: Error encountered while trying to append to the "+s+" SourceBuffer",e);var t={type:E.MEDIA_ERROR,parent:l.type,details:C.BUFFER_APPEND_ERROR,frag:l,part:c,chunkMeta:u,error:e,err:e,fatal:!1};e.code===DOMException.QUOTA_EXCEEDED_ERR?t.details=C.BUFFER_FULL_ERROR:(r.appendError++,t.details=C.BUFFER_APPEND_ERROR,r.appendError>n.config.appendErrorMaxRetry&&(A.error("[buffer-controller]: Failed "+n.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),t.fatal=!0)),n.trigger(w.ERROR,t)}};i.append(y,s)},t.onBufferFlushing=function(e,t){var r=this,n=this.operationQueue,i=function(e){return{execute:r.removeExecutor.bind(r,e,t.startOffset,t.endOffset),onStart:function(){},onComplete:function(){r.hls.trigger(w.BUFFER_FLUSHED,{type:e})},onError:function(t){A.warn("[buffer-controller]: Failed to remove from "+e+" SourceBuffer",t)}}};t.type?n.append(i(t.type),t.type):this.getSourceBufferTypes().forEach((function(e){n.append(i(e),e)}))},t.onFragParsed=function(e,t){var r=this,n=t.frag,i=t.part,o=[],a=i?i.elementaryStreams:n.elementaryStreams;a[B]?o.push("audiovideo"):(a[N]&&o.push("audio"),a[F]&&o.push("video"));0===o.length&&A.warn("Fragments must have at least one ElementaryStreamType set. type: "+n.type+" level: "+n.level+" sn: "+n.sn),this.blockBuffers((function(){var e=self.performance.now();n.stats.buffering.end=e,i&&(i.stats.buffering.end=e);var t=i?i.stats:n.stats;r.hls.trigger(w.FRAG_BUFFERED,{frag:n,part:i,stats:t,id:n.type})}),o)},t.onFragChanged=function(e,t){this.flushBackBuffer()},t.onBufferEos=function(e,t){var r=this;this.getSourceBufferTypes().reduce((function(e,n){var i=r.sourceBuffer[n];return!i||t.type&&t.type!==n||(i.ending=!0,i.ended||(i.ended=!0,A.log("[buffer-controller]: "+n+" sourceBuffer now EOS"))),e&&!(i&&!i.ended)}),!0)&&(A.log("[buffer-controller]: Queueing mediaSource.endOfStream()"),this.blockBuffers((function(){r.getSourceBufferTypes().forEach((function(e){var t=r.sourceBuffer[e];t&&(t.ending=!1)}));var e=r.mediaSource;e&&"open"===e.readyState?(A.log("[buffer-controller]: Calling mediaSource.endOfStream()"),e.endOfStream()):e&&A.info("[buffer-controller]: Could not call mediaSource.endOfStream(). mediaSource.readyState: "+e.readyState)})))},t.onLevelUpdated=function(e,t){var r=t.details;r.fragments.length&&(this.details=r,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration())},t.flushBackBuffer=function(){var e=this.hls,t=this.details,r=this.media,n=this.sourceBuffer;if(r&&null!==t){var i=this.getSourceBufferTypes();if(i.length){var o=t.live&&null!==e.config.liveBackBufferLength?e.config.liveBackBufferLength:e.config.backBufferLength;if(b(o)&&!(o<0)){var a=r.currentTime,s=t.levelTargetDuration,l=Math.max(o,s),c=Math.floor(a/s)*s-l;i.forEach((function(r){var i=n[r];if(i){var o=Ar.getBuffered(i);if(o.length>0&&c>o.start(0)){if(e.trigger(w.BACK_BUFFER_REACHED,{bufferEnd:c}),t.live)e.trigger(w.LIVE_BACK_BUFFER_REACHED,{bufferEnd:c});else if(i.ended&&o.end(o.length-1)-a<2*s)return void A.info("[buffer-controller]: Cannot flush "+r+" back buffer while SourceBuffer is in ended state");e.trigger(w.BUFFER_FLUSHING,{startOffset:0,endOffset:c,type:r})}}}))}}}},t.updateMediaElementDuration=function(){if(this.details&&this.media&&this.mediaSource&&"open"===this.mediaSource.readyState){var e=this.details,t=this.hls,r=this.media,n=this.mediaSource,i=e.fragments[0].start+e.totalduration,o=r.duration,a=b(n.duration)?n.duration:0;e.live&&t.config.liveDurationInfinity?(A.log("[buffer-controller]: Media Source duration is set to Infinity"),n.duration=1/0,this.updateSeekableRange(e)):(i>a&&i>o||!b(o))&&(A.log("[buffer-controller]: Updating Media Source duration to "+i.toFixed(3)),n.duration=i)}},t.updateSeekableRange=function(e){var t=this.mediaSource,r=e.fragments;if(r.length&&e.live&&null!=t&&t.setLiveSeekableRange){var n=Math.max(0,r[0].start),i=Math.max(n,n+e.totalduration);t.setLiveSeekableRange(n,i)}},t.checkPendingTracks=function(){var e=this.bufferCodecEventsExpected,t=this.operationQueue,r=this.pendingTracks,n=Object.keys(r).length;if(n&&!e||2===n){this.createSourceBuffers(r),this.pendingTracks={};var i=this.getSourceBufferTypes();if(i.length)this.hls.trigger(w.BUFFER_CREATED,{tracks:this.tracks}),i.forEach((function(e){t.executeNext(e)}));else{var o=new Error("could not create source buffer for media codec(s)");this.hls.trigger(w.ERROR,{type:E.MEDIA_ERROR,details:C.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,error:o,reason:o.message})}}},t.createSourceBuffers=function(e){var t=this.sourceBuffer,r=this.mediaSource;if(!r)throw Error("createSourceBuffers called when mediaSource was null");for(var n in e)if(!t[n]){var i=e[n];if(!i)throw Error("source buffer exists for track "+n+", however track does not");var o=i.levelCodec||i.codec,a=i.container+";codecs="+o;A.log("[buffer-controller]: creating sourceBuffer("+a+")");try{var s=t[n]=r.addSourceBuffer(a),l=n;this.addBufferListener(l,"updatestart",this._onSBUpdateStart),this.addBufferListener(l,"updateend",this._onSBUpdateEnd),this.addBufferListener(l,"error",this._onSBUpdateError),this.tracks[n]={buffer:s,codec:o,container:i.container,levelCodec:i.levelCodec,metadata:i.metadata,id:i.id}}catch(e){A.error("[buffer-controller]: error while trying to add sourceBuffer: "+e.message),this.hls.trigger(w.ERROR,{type:E.MEDIA_ERROR,details:C.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:e,mimeType:a})}}},t._onSBUpdateStart=function(e){this.operationQueue.current(e).onStart()},t._onSBUpdateEnd=function(e){var t=this.operationQueue;t.current(e).onComplete(),t.shiftAndExecuteNext(e)},t._onSBUpdateError=function(e,t){var r=new Error(e+" SourceBuffer error");A.error("[buffer-controller]: "+r,t),this.hls.trigger(w.ERROR,{type:E.MEDIA_ERROR,details:C.BUFFER_APPENDING_ERROR,error:r,fatal:!1});var n=this.operationQueue.current(e);n&&n.onError(t)},t.removeExecutor=function(e,t,r){var n=this.media,i=this.mediaSource,o=this.operationQueue,a=this.sourceBuffer[e];if(!n||!i||!a)return A.warn("[buffer-controller]: Attempting to remove from the "+e+" SourceBuffer, but it does not exist"),void o.shiftAndExecuteNext(e);var s=b(n.duration)?n.duration:1/0,l=b(i.duration)?i.duration:1/0,c=Math.max(0,t),u=Math.min(r,s,l);u>c&&!a.ending?(a.ended=!1,A.log("[buffer-controller]: Removing ["+c+","+u+"] from the "+e+" SourceBuffer"),a.remove(c,u)):o.shiftAndExecuteNext(e)},t.appendExecutor=function(e,t){var r=this.operationQueue,n=this.sourceBuffer[t];if(!n)return A.warn("[buffer-controller]: Attempting to append to the "+t+" SourceBuffer, but it does not exist"),void r.shiftAndExecuteNext(t);n.ended=!1,n.appendBuffer(e)},t.blockBuffers=function(e,t){var r=this;if(void 0===t&&(t=this.getSourceBufferTypes()),!t.length)return A.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),void Promise.resolve().then(e);var n=this.operationQueue,i=t.map((function(e){return n.appendBlocker(e)}));Promise.all(i).then((function(){e(),t.forEach((function(e){var t=r.sourceBuffer[e];null!=t&&t.updating||n.shiftAndExecuteNext(e)}))}))},t.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},t.addBufferListener=function(e,t,r){var n=this.sourceBuffer[e];if(n){var i=r.bind(this,e);this.listeners[e].push({event:t,listener:i}),n.addEventListener(t,i)}},t.removeBufferListeners=function(e){var t=this.sourceBuffer[e];t&&this.listeners[e].forEach((function(e){t.removeEventListener(e.event,e.listener)}))},e}(),Ii={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},xi=function(e){var t=e;return Ii.hasOwnProperty(e)&&(t=Ii[e]),String.fromCharCode(t)},Mi=15,Li=100,ji={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},Ni={17:2,18:4,21:6,22:8,23:10,19:13,20:15},Fi={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},Bi={25:2,26:4,29:6,30:8,31:10,27:13,28:15},Ui=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],Vi=function(){function e(){this.time=null,this.verboseLevel=0}return e.prototype.log=function(e,t){if(this.verboseLevel>=e){var r="function"==typeof t?t():t;A.log(this.time+" ["+e+"] "+r)}},e}(),Hi=function(e){for(var t=[],r=0;rLi&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=Li)},t.moveCursor=function(e){var t=this.pos+e;if(e>1)for(var r=this.pos+1;r=144&&this.backSpace();var r=xi(e);this.pos>=Li?this.logger.log(0,(function(){return"Cannot insert "+e.toString(16)+" ("+r+") at position "+t.pos+". Skipping it!"})):(this.chars[this.pos].setChar(r,this.currPenState),this.moveCursor(1))},t.clearFromPos=function(e){var t;for(t=e;t0&&(r=e?"["+t.join(" | ")+"]":t.join("\n")),r},t.getTextAndFormat=function(){return this.rows},e}(),$i=function(){function e(e,t,r){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=e,this.outputFilter=t,this.mode=null,this.verbose=0,this.displayedMemory=new Ki(r),this.nonDisplayedMemory=new Ki(r),this.lastOutputScreen=new Ki(r),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=r}var t=e.prototype;return t.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},t.getHandler=function(){return this.outputFilter},t.setHandler=function(e){this.outputFilter=e},t.setPAC=function(e){this.writeScreen.setPAC(e)},t.setBkgData=function(e){this.writeScreen.setBkgData(e)},t.setMode=function(e){e!==this.mode&&(this.mode=e,this.logger.log(2,(function(){return"MODE="+e})),"MODE_POP-ON"===this.mode?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),"MODE_ROLL-UP"!==this.mode&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=e)},t.insertChars=function(e){for(var t=this,r=0;r=46,t.italics)t.foreground="white";else{var r=Math.floor(e/2)-16;t.foreground=["white","green","blue","cyan","red","yellow","magenta"][r]}this.logger.log(2,"MIDROW: "+JSON.stringify(t)),this.writeScreen.setPen(t)},t.outputDataUpdate=function(e){void 0===e&&(e=!1);var t=this.logger.time;null!==t&&this.outputFilter&&(null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,t,this.lastOutputScreen),e&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:t):this.cueStartTime=t,this.lastOutputScreen.copy(this.displayedMemory))},t.cueSplitAtTime=function(e){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e))},e}(),qi=function(){function e(e,t,r){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var n=new Vi;this.channels=[null,new $i(e,t,n),new $i(e+1,r,n)],this.cmdHistory={a:null,b:null},this.logger=n}var t=e.prototype;return t.getHandler=function(e){return this.channels[e].getHandler()},t.setHandler=function(e,t){this.channels[e].setHandler(t)},t.addData=function(e,t){var r,n,i,o=!1;this.logger.time=e;for(var a=0;a ("+Hi([n,i])+")"),(r=this.parseCmd(n,i))||(r=this.parseMidrow(n,i)),r||(r=this.parsePAC(n,i)),r||(r=this.parseBackgroundAttributes(n,i)),!r&&(o=this.parseChars(n,i))){var s=this.currentChannel;s&&s>0?this.channels[s].insertChars(o):this.logger.log(2,"No channel found yet. TEXT-MODE?")}r||o||this.logger.log(2,"Couldn't parse cleaned data "+Hi([n,i])+" orig: "+Hi([t[a],t[a+1]]))}},t.parseCmd=function(e,t){var r=this.cmdHistory;if(!((20===e||28===e||21===e||29===e)&&t>=32&&t<=47||(23===e||31===e)&&t>=33&&t<=35))return!1;if(Yi(e,t,r))return Zi(null,null,r),this.logger.log(3,"Repeated command ("+Hi([e,t])+") is dropped"),!0;var n=20===e||21===e||23===e?1:2,i=this.channels[n];return 20===e||21===e||28===e||29===e?32===t?i.ccRCL():33===t?i.ccBS():34===t?i.ccAOF():35===t?i.ccAON():36===t?i.ccDER():37===t?i.ccRU(2):38===t?i.ccRU(3):39===t?i.ccRU(4):40===t?i.ccFON():41===t?i.ccRDC():42===t?i.ccTR():43===t?i.ccRTD():44===t?i.ccEDM():45===t?i.ccCR():46===t?i.ccENM():47===t&&i.ccEOC():i.ccTO(t-32),Zi(e,t,r),this.currentChannel=n,!0},t.parseMidrow=function(e,t){var r=0;if((17===e||25===e)&&t>=32&&t<=47){if((r=17===e?1:2)!==this.currentChannel)return this.logger.log(0,"Mismatch channel in midrow parsing"),!1;var n=this.channels[r];return!!n&&(n.ccMIDROW(t),this.logger.log(3,"MIDROW ("+Hi([e,t])+")"),!0)}return!1},t.parsePAC=function(e,t){var r,n=this.cmdHistory;if(!((e>=17&&e<=23||e>=25&&e<=31)&&t>=64&&t<=127||(16===e||24===e)&&t>=64&&t<=95))return!1;if(Yi(e,t,n))return Zi(null,null,n),!0;var i=e<=23?1:2;r=t>=64&&t<=95?1===i?ji[e]:Fi[e]:1===i?Ni[e]:Bi[e];var o=this.channels[i];return!!o&&(o.setPAC(this.interpretPAC(r,t)),Zi(e,t,n),this.currentChannel=i,!0)},t.interpretPAC=function(e,t){var r,n={color:null,italics:!1,indent:null,underline:!1,row:e};return r=t>95?t-96:t-64,n.underline=!(1&~r),r<=13?n.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(r/2)]:r<=15?(n.italics=!0,n.color="white"):n.indent=4*Math.floor((r-16)/2),n},t.parseChars=function(e,t){var r,n,i=null,o=null;if(e>=25?(r=2,o=e-8):(r=1,o=e),o>=17&&o<=19?(n=17===o?t+80:18===o?t+112:t+144,this.logger.log(2,"Special char '"+xi(n)+"' in channel "+r),i=[n]):e>=32&&e<=127&&(i=0===t?[e]:[e,t]),i){var a=Hi(i);this.logger.log(3,"Char codes = "+a.join(",")),Zi(e,t,this.cmdHistory)}return i},t.parseBackgroundAttributes=function(e,t){var r;if(!((16===e||24===e)&&t>=32&&t<=47||(23===e||31===e)&&t>=45&&t<=47))return!1;var n={};16===e||24===e?(r=Math.floor((t-32)/2),n.background=Ui[r],t%2==1&&(n.background=n.background+"_semi")):45===t?n.background="transparent":(n.foreground="black",47===t&&(n.underline=!0));var i=e<=23?1:2;return this.channels[i].setBkgData(n),Zi(e,t,this.cmdHistory),!0},t.reset=function(){for(var e=0;ee)&&(this.startTime=e),this.endTime=t,this.screen=r,this.timelineController.createCaptionsTrack(this.trackName)},t.reset=function(){this.cueRanges=[],this.startTime=null},e}(),Qi=function(){if("undefined"!=typeof self&&self.VTTCue)return self.VTTCue;var e=["","lr","rl"],t=["start","middle","end","left","right"];function r(e,t){if("string"!=typeof t)return!1;if(!Array.isArray(e))return!1;var r=t.toLowerCase();return!!~e.indexOf(r)&&r}function n(e){return r(t,e)}function i(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n100)throw new Error("Position must be between 0 and 100.");b=e,this.hasBeenReset=!0}})),Object.defineProperty(s,"positionAlign",i({},l,{get:function(){return _},set:function(e){var t=n(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");_=t,this.hasBeenReset=!0}})),Object.defineProperty(s,"size",i({},l,{get:function(){return S},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");S=e,this.hasBeenReset=!0}})),Object.defineProperty(s,"align",i({},l,{get:function(){return w},set:function(e){var t=n(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");w=t,this.hasBeenReset=!0}})),s.displayState=void 0}return o.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},o}(),Xi=function(){function e(){}return e.prototype.decode=function(e,t){if(!e)return"";if("string"!=typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))},e}();function eo(e){function t(e,t,r,n){return 3600*(0|e)+60*(0|t)+(0|r)+parseFloat(n||0)}var r=e.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return r?parseFloat(r[2])>59?t(r[2],r[3],0,r[4]):t(r[1],r[2],r[3],r[4]):null}var to=function(){function e(){this.values=Object.create(null)}var t=e.prototype;return t.set=function(e,t){this.get(e)||""===t||(this.values[e]=t)},t.get=function(e,t,r){return r?this.has(e)?this.values[e]:t[r]:this.has(e)?this.values[e]:t},t.has=function(e){return e in this.values},t.alt=function(e,t,r){for(var n=0;n=0&&r<=100)return this.set(e,r),!0}return!1},e}();function ro(e,t,r,n){var i=n?e.split(n):[e];for(var o in i)if("string"==typeof i[o]){var a=i[o].split(r);2===a.length&&t(a[0],a[1])}}var no=new Qi(0,0,""),io="middle"===no.align?"middle":"center";function oo(e,t,r){var n=e;function i(){var t=eo(e);if(null===t)throw new Error("Malformed timestamp: "+n);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function o(){e=e.replace(/^\s+/,"")}if(o(),t.startTime=i(),o(),"--\x3e"!==e.slice(0,3))throw new Error("Malformed time stamp (time stamps must be separated by '--\x3e'): "+n);e=e.slice(3),o(),t.endTime=i(),o(),function(e,t){var n=new to;ro(e,(function(e,t){var i;switch(e){case"region":for(var o=r.length-1;o>=0;o--)if(r[o].id===t){n.set(e,r[o].region);break}break;case"vertical":n.alt(e,t,["rl","lr"]);break;case"line":i=t.split(","),n.integer(e,i[0]),n.percent(e,i[0])&&n.set("snapToLines",!1),n.alt(e,i[0],["auto"]),2===i.length&&n.alt("lineAlign",i[1],["start",io,"end"]);break;case"position":i=t.split(","),n.percent(e,i[0]),2===i.length&&n.alt("positionAlign",i[1],["start",io,"end","line-left","line-right","auto"]);break;case"size":n.percent(e,t);break;case"align":n.alt(e,t,["start",io,"end","left","right"])}}),/:/,/\s/),t.region=n.get("region",null),t.vertical=n.get("vertical","");var i=n.get("line","auto");"auto"===i&&-1===no.line&&(i=-1),t.line=i,t.lineAlign=n.get("lineAlign","start"),t.snapToLines=n.get("snapToLines",!0),t.size=n.get("size",100),t.align=n.get("align",io);var o=n.get("position","auto");"auto"===o&&50===no.position&&(o="start"===t.align||"left"===t.align?0:"end"===t.align||"right"===t.align?100:50),t.position=o}(e,t)}function ao(e){return e.replace(//gi,"\n")}var so=function(){function e(){this.state="INITIAL",this.buffer="",this.decoder=new Xi,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var t=e.prototype;return t.parse=function(e){var t=this;function r(){var e=t.buffer,r=0;for(e=ao(e);r>>0).toString()};function ho(e,t,r){return uo(e.toString())+uo(t.toString())+uo(r)}function po(e,t,r,n,i,o,a){var s,l,c,u=new so,d=ye(new Uint8Array(e)).trim().replace(lo,"\n").split("\n"),h=[],p=t?(l=t.baseTime,void 0===(c=t.timescale)&&(c=1),Hn(l,Vn,1/c)):0,f="00:00.000",m=0,g=0,v=!0;u.oncue=function(e){var o=r[n],a=r.ccOffset,l=(m-p)/9e4;if(null!=o&&o.new&&(void 0!==g?a=r.ccOffset=o.start:function(e,t,r){var n=e[t],i=e[n.prevCC];if(!i||!i.new&&n.new)return e.ccOffset=e.presentationOffset=n.start,void(n.new=!1);for(;null!=(o=i)&&o.new;){var o;e.ccOffset+=n.start-i.start,n.new=!1,i=e[(n=i).prevCC]}e.presentationOffset=r}(r,n,l)),l){if(!t)return void(s=new Error("Missing initPTS for VTT MPEGTS"));a=l-r.presentationOffset}var c=e.endTime-e.startTime,u=$n(9e4*(e.startTime+a-g),9e4*i)/9e4;e.startTime=Math.max(u,0),e.endTime=Math.max(u+c,0);var d=e.text.trim();e.text=decodeURIComponent(encodeURIComponent(d)),e.id||(e.id=ho(e.startTime,e.endTime,d)),e.endTime>0&&h.push(e)},u.onparsingerror=function(e){s=e},u.onflush=function(){s?a(s):o(h)},d.forEach((function(e){if(v){if(co(e,"X-TIMESTAMP-MAP=")){v=!1,e.slice(16).split(",").forEach((function(e){co(e,"LOCAL:")?f=e.slice(6):co(e,"MPEGTS:")&&(m=parseInt(e.slice(7)))}));try{g=function(e){var t=parseInt(e.slice(-3)),r=parseInt(e.slice(-6,-4)),n=parseInt(e.slice(-9,-7)),i=e.length>9?parseInt(e.substring(0,e.indexOf(":"))):0;if(!(b(t)&&b(r)&&b(n)&&b(i)))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+e);return t+=1e3*r,(t+=6e4*n)+36e5*i}(f)/1e3}catch(e){s=e}return}""===e&&(v=!1)}u.parse(e+"\n")})),u.flush()}var fo="stpp.ttml.im1t",mo=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,go=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,vo={left:"start",center:"center",right:"end",start:"start",end:"end"};function yo(e,t,r,n){var i,o,a,l,c=Re(new Uint8Array(e),["mdat"]);if(0!==c.length){var u=c.map((function(e){return ye(e)})),d=(i=t.baseTime,o=1,void 0===(a=t.timescale)&&(a=1),void 0===l&&(l=!1),Hn(i,o,1/a,l));try{u.forEach((function(e){return r(function(e,t){var r=(new DOMParser).parseFromString(e,"text/xml").getElementsByTagName("tt")[0];if(!r)throw new Error("Invalid ttml");var n={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},i=Object.keys(n).reduce((function(e,t){return e[t]=r.getAttribute("ttp:"+t)||n[t],e}),{}),o="preserve"!==r.getAttribute("xml:space"),a=_o(bo(r,"styling","style")),l=_o(bo(r,"layout","region")),c=bo(r,"body","[begin]");return[].map.call(c,(function(e){var r=So(e,o);if(!r||!e.hasAttribute("begin"))return null;var n=Co(e.getAttribute("begin"),i),c=Co(e.getAttribute("dur"),i),u=Co(e.getAttribute("end"),i);if(null===n)throw Eo(e);if(null===u){if(null===c)throw Eo(e);u=n+c}var d=new Qi(n-t,u-t,r);d.id=ho(d.startTime,d.endTime,d.text);var h=function(e,t,r){var n="http://www.w3.org/ns/ttml#styling",i=null,o=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],a=null!=e&&e.hasAttribute("style")?e.getAttribute("style"):null;return a&&r.hasOwnProperty(a)&&(i=r[a]),o.reduce((function(r,o){var a=wo(t,n,o)||wo(e,n,o)||wo(i,n,o);return a&&(r[o]=a),r}),{})}(l[e.getAttribute("region")],a[e.getAttribute("style")],a),p=h.textAlign;if(p){var f=vo[p];f&&(d.lineAlign=f),d.align=p}return s(d,h),d})).filter((function(e){return null!==e}))}(e,d))}))}catch(e){n(e)}}else n(new Error("Could not parse IMSC1 mdat"))}function bo(e,t,r){var n=e.getElementsByTagName(t)[0];return n?[].slice.call(n.querySelectorAll(r)):[]}function _o(e){return e.reduce((function(e,t){var r=t.getAttribute("xml:id");return r&&(e[r]=t),e}),{})}function So(e,t){return[].slice.call(e.childNodes).reduce((function(e,r,n){var i;return"br"===r.nodeName&&n?e+"\n":null!=(i=r.childNodes)&&i.length?So(r,t):t?e+r.textContent.trim().replace(/\s+/g," "):e+r.textContent}),"")}function wo(e,t,r){return e&&e.hasAttributeNS(t,r)?e.getAttributeNS(t,r):null}function Eo(e){return new Error("Could not parse ttml timestamp "+e)}function Co(e,t){if(!e)return null;var r=eo(e);return null===r&&(mo.test(e)?r=function(e,t){var r=mo.exec(e),n=(0|r[4])+(0|r[5])/t.subFrameRate;return 3600*(0|r[1])+60*(0|r[2])+(0|r[3])+n/t.frameRate}(e,t):go.test(e)&&(r=function(e,t){var r=go.exec(e),n=Number(r[1]);switch(r[2]){case"h":return 3600*n;case"m":return 60*n;case"ms":return 1e3*n;case"f":return n/t.frameRate;case"t":return n/t.tickRate}return n}(e,t))),r}var Oo=function(){function e(e){if(this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs={ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}},this.captionsProperties=void 0,this.hls=e,this.config=e.config,this.Cues=e.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){var t=new Ji(this,"textTrack1"),r=new Ji(this,"textTrack2"),n=new Ji(this,"textTrack3"),i=new Ji(this,"textTrack4");this.cea608Parser1=new qi(1,t,r),this.cea608Parser2=new qi(3,n,i)}e.on(w.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(w.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(w.MANIFEST_LOADING,this.onManifestLoading,this),e.on(w.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(w.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(w.FRAG_LOADING,this.onFragLoading,this),e.on(w.FRAG_LOADED,this.onFragLoaded,this),e.on(w.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.on(w.FRAG_DECRYPTED,this.onFragDecrypted,this),e.on(w.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(w.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.on(w.BUFFER_FLUSHING,this.onBufferFlushing,this)}var t=e.prototype;return t.destroy=function(){var e=this.hls;e.off(w.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(w.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(w.MANIFEST_LOADING,this.onManifestLoading,this),e.off(w.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(w.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(w.FRAG_LOADING,this.onFragLoading,this),e.off(w.FRAG_LOADED,this.onFragLoaded,this),e.off(w.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.off(w.FRAG_DECRYPTED,this.onFragDecrypted,this),e.off(w.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(w.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.off(w.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},t.addCues=function(e,t,r,n,i){for(var o=!1,a=i.length;a--;){var s=i[a],l=(c=s[0],u=s[1],d=t,h=r,Math.min(u,h)-Math.max(c,d));if(l>=0&&(s[0]=Math.min(s[0],t),s[1]=Math.max(s[1],r),o=!0,l/(r-t)>.5))return}var c,u,d,h;if(o||i.push([t,r]),this.config.renderTextTracksNatively){var p=this.captionsTracks[e];this.Cues.newCue(p,t,r,n)}else{var f=this.Cues.newCue(null,t,r,n);this.hls.trigger(w.CUES_PARSED,{type:"captions",cues:f,track:e})}},t.onInitPtsFound=function(e,t){var r=this,n=t.frag,i=t.id,o=t.initPTS,a=t.timescale,s=this.unparsedVttFrags;"main"===i&&(this.initPTS[n.cc]={baseTime:o,timescale:a}),s.length&&(this.unparsedVttFrags=[],s.forEach((function(e){r.onFragLoaded(w.FRAG_LOADED,e)})))},t.getExistingTrack=function(e){var t=this.media;if(t)for(var r=0;rn.cc||l.trigger(w.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:t})}))}else a.push(e)},t._fallbackToIMSC1=function(e,t){var r=this,n=this.tracks[e.level];n.textCodec||yo(t,this.initPTS[e.cc],(function(){n.textCodec=fo,r._parseIMSC1(e,t)}),(function(){n.textCodec="wvtt"}))},t._appendCues=function(e,t){var r=this.hls;if(this.config.renderTextTracksNatively){var n=this.textTracks[t];if(!n||"disabled"===n.mode)return;e.forEach((function(e){return wt(n,e)}))}else{var i=this.tracks[t];if(!i)return;var o=i.default?"default":"subtitles"+t;r.trigger(w.CUES_PARSED,{type:"subtitles",cues:e,track:o})}},t.onFragDecrypted=function(e,t){t.frag.type===vt&&this.onFragLoaded(w.FRAG_LOADED,t)},t.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},t.onFragParsingUserdata=function(e,t){var r=this.cea608Parser1,n=this.cea608Parser2;if(this.enabled&&r&&n){var i=t.frag,o=t.samples;if(i.type!==mt||"NONE"!==this.closedCaptionsForLevel(i))for(var a=0;a0&&this.mediaWidth>0){var e=this.hls.levels;if(e.length){var t=this.hls;t.autoLevelCapping=this.getMaxLevel(e.length-1),t.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=t.autoLevelCapping}}},t.getMaxLevel=function(t){var r=this,n=this.hls.levels;if(!n.length)return-1;var i=n.filter((function(e,n){return r.isLevelAllowed(e)&&n<=t}));return this.clientRect=null,e.getMaxLevelByMediaSize(i,this.mediaWidth,this.mediaHeight)},t.startCapping=function(){this.timer||(this.autoLevelCapping=Number.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())},t.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},t.getDimensions=function(){if(this.clientRect)return this.clientRect;var e=this.media,t={width:0,height:0};if(e){var r=e.getBoundingClientRect();t.width=r.width,t.height=r.height,t.width||t.height||(t.width=r.right-r.left||e.width||0,t.height=r.bottom-r.top||e.height||0)}return this.clientRect=t,t},t.isLevelAllowed=function(e){return!this.restrictedLevels.some((function(t){return e.bitrate===t.bitrate&&e.width===t.width&&e.height===t.height}))},e.getMaxLevelByMediaSize=function(e,t,r){if(null==e||!e.length)return-1;for(var n=e.length-1,i=0;i=t||o.height>=r)&&(a=o,!(s=e[i+1])||a.width!==s.width||a.height!==s.height)){n=i;break}}var a,s;return n},o(e,[{key:"mediaWidth",get:function(){return this.getDimensions().width*this.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*this.contentScaleFactor}},{key:"contentScaleFactor",get:function(){var e=1;if(!this.hls.config.ignoreDevicePixelRatio)try{e=self.devicePixelRatio}catch(e){}return e}}]),e}(),ko=function(){function e(e){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=e,this.registerListeners()}var t=e.prototype;return t.setStreamController=function(e){this.streamController=e},t.registerListeners=function(){this.hls.on(w.MEDIA_ATTACHING,this.onMediaAttaching,this)},t.unregisterListeners=function(){this.hls.off(w.MEDIA_ATTACHING,this.onMediaAttaching,this)},t.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},t.onMediaAttaching=function(e,t){var r=this.hls.config;if(r.capLevelOnFPSDrop){var n=t.media instanceof self.HTMLVideoElement?t.media:null;this.media=n,n&&"function"==typeof n.getVideoPlaybackQuality&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),r.fpsDroppedMonitoringPeriod)}},t.checkFPS=function(e,t,r){var n=performance.now();if(t){if(this.lastTime){var i=n-this.lastTime,o=r-this.lastDroppedFrames,a=t-this.lastDecodedFrames,s=1e3*o/i,l=this.hls;if(l.trigger(w.FPS_DROP,{currentDropped:o,currentDecoded:a,totalDroppedFrames:r}),s>0&&o>l.config.fpsDroppedMonitoringThreshold*a){var c=l.currentLevel;A.warn("drop FPS ratio greater than max allowed value for currentLevel: "+c),c>0&&(-1===l.autoLevelCapping||l.autoLevelCapping>=c)&&(c-=1,l.trigger(w.FPS_DROP_LEVEL_CAPPING,{level:c,droppedLevel:l.currentLevel}),l.autoLevelCapping=c,this.streamController.nextLevelSwitch())}}this.lastTime=n,this.lastDroppedFrames=r,this.lastDecodedFrames=t}},t.checkFPSInterval=function(){var e=this.media;if(e)if(this.isVideoPlaybackQualityAvailable){var t=e.getVideoPlaybackQuality();this.checkFPS(e,t.totalVideoFrames,t.droppedVideoFrames)}else this.checkFPS(e,e.webkitDecodedFrameCount,e.webkitDroppedFrameCount)},e}(),Ro="[eme]",Ao=function(){function e(t){this.hls=void 0,this.config=void 0,this.media=null,this.keyFormatPromise=null,this.keySystemAccessPromises={},this._requestLicenseFailureCount=0,this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},this.setMediaKeysQueue=e.CDMCleanupPromise?[e.CDMCleanupPromise]:[],this.onMediaEncrypted=this._onMediaEncrypted.bind(this),this.onWaitingForKey=this._onWaitingForKey.bind(this),this.debug=A.debug.bind(A,Ro),this.log=A.log.bind(A,Ro),this.warn=A.warn.bind(A,Ro),this.error=A.error.bind(A,Ro),this.hls=t,this.config=t.config,this.registerListeners()}var t=e.prototype;return t.destroy=function(){this.unregisterListeners(),this.onMediaDetached();var e=this.config;e.requestMediaKeySystemAccessFunc=null,e.licenseXhrSetup=e.licenseResponseCallback=void 0,e.drmSystems=e.drmSystemOptions={},this.hls=this.onMediaEncrypted=this.onWaitingForKey=this.keyIdToKeySessionPromise=null,this.config=null},t.registerListeners=function(){this.hls.on(w.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(w.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(w.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(w.MANIFEST_LOADED,this.onManifestLoaded,this)},t.unregisterListeners=function(){this.hls.off(w.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(w.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(w.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(w.MANIFEST_LOADED,this.onManifestLoaded,this)},t.getLicenseServerUrl=function(e){var t=this.config,r=t.drmSystems,n=t.widevineLicenseUrl,i=r[e];if(i)return i.licenseUrl;if(e===$.WIDEVINE&&n)return n;throw new Error('no license server URL configured for key-system "'+e+'"')},t.getServerCertificateUrl=function(e){var t=this.config.drmSystems[e];if(t)return t.serverCertificateUrl;this.log('No Server Certificate in config.drmSystems["'+e+'"]')},t.attemptKeySystemAccess=function(e){var t=this,r=this.hls.levels,n=function(e,t,r){return!!e&&r.indexOf(e)===t},i=r.map((function(e){return e.audioCodec})).filter(n),o=r.map((function(e){return e.videoCodec})).filter(n);return i.length+o.length===0&&o.push("avc1.42e01e"),new Promise((function(r,n){!function e(a){var s=a.shift();t.getMediaKeysPromise(s,i,o).then((function(e){return r({keySystem:s,mediaKeys:e})})).catch((function(t){a.length?e(a):n(t instanceof Do?t:new Do({type:E.KEY_SYSTEM_ERROR,details:C.KEY_SYSTEM_NO_ACCESS,error:t,fatal:!0},t.message))}))}(e)}))},t.requestMediaKeySystemAccess=function(e,t){var r=this.config.requestMediaKeySystemAccessFunc;if("function"!=typeof r){var n="Configured requestMediaKeySystemAccess is not a function "+r;return null===re&&"http:"===self.location.protocol&&(n="navigator.requestMediaKeySystemAccess is not available over insecure protocol "+location.protocol),Promise.reject(new Error(n))}return r(e,t)},t.getMediaKeysPromise=function(e,t,r){var n=this,i=function(e,t,r,n){var i;switch(e){case $.FAIRPLAY:i=["cenc","sinf"];break;case $.WIDEVINE:case $.PLAYREADY:i=["cenc"];break;case $.CLEARKEY:i=["cenc","keyids"];break;default:throw new Error("Unknown key-system: "+e)}return function(e,t,r,n){return[{initDataTypes:e,persistentState:n.persistentState||"not-allowed",distinctiveIdentifier:n.distinctiveIdentifier||"not-allowed",sessionTypes:n.sessionTypes||[n.sessionType||"temporary"],audioCapabilities:t.map((function(e){return{contentType:'audio/mp4; codecs="'+e+'"',robustness:n.audioRobustness||"",encryptionScheme:n.audioEncryptionScheme||null}})),videoCapabilities:r.map((function(e){return{contentType:'video/mp4; codecs="'+e+'"',robustness:n.videoRobustness||"",encryptionScheme:n.videoEncryptionScheme||null}}))}]}(i,t,r,n)}(e,t,r,this.config.drmSystemOptions),o=this.keySystemAccessPromises[e],a=null==o?void 0:o.keySystemAccess;if(!a){this.log('Requesting encrypted media "'+e+'" key-system access with config: '+JSON.stringify(i)),a=this.requestMediaKeySystemAccess(e,i);var s=this.keySystemAccessPromises[e]={keySystemAccess:a};return a.catch((function(t){n.log('Failed to obtain access to key-system "'+e+'": '+t)})),a.then((function(t){n.log('Access for key-system "'+t.keySystem+'" obtained');var r=n.fetchServerCertificate(e);return n.log('Create media-keys for "'+e+'"'),s.mediaKeys=t.createMediaKeys().then((function(t){return n.log('Media-keys created for "'+e+'"'),r.then((function(r){return r?n.setMediaKeysServerCertificate(t,e,r):t}))})),s.mediaKeys.catch((function(t){n.error('Failed to create media-keys for "'+e+'"}: '+t)})),s.mediaKeys}))}return a.then((function(){return o.mediaKeys}))},t.createMediaKeySessionContext=function(e){var t=e.decryptdata,r=e.keySystem,n=e.mediaKeys;this.log('Creating key-system session "'+r+'" keyId: '+_e(t.keyId||[]));var i=n.createSession(),o={decryptdata:t,keySystem:r,mediaKeys:n,mediaKeysSession:i,keyStatus:"status-pending"};return this.mediaKeySessions.push(o),o},t.renewKeySession=function(e){var t=e.decryptdata;if(t.pssh){var r=this.createMediaKeySessionContext(e),n=this.getKeyIdString(t);this.keyIdToKeySessionPromise[n]=this.generateRequestWithPreferredKeySession(r,"cenc",t.pssh,"expired")}else this.warn("Could not renew expired session. Missing pssh initData.");this.removeSession(e)},t.getKeyIdString=function(e){if(!e)throw new Error("Could not read keyId of undefined decryptdata");if(null===e.keyId)throw new Error("keyId is null");return _e(e.keyId)},t.updateKeySession=function(e,t){var r,n=e.mediaKeysSession;return this.log('Updating key-session "'+n.sessionId+'" for keyID '+_e((null==(r=e.decryptdata)?void 0:r.keyId)||[])+"\n } (data length: "+(t?t.byteLength:t)+")"),n.update(t)},t.selectKeySystemFormat=function(e){var t=Object.keys(e.levelkeys||{});return this.keyFormatPromise||(this.log("Selecting key-system from fragment (sn: "+e.sn+" "+e.type+": "+e.level+") key formats "+t.join(", ")),this.keyFormatPromise=this.getKeyFormatPromise(t)),this.keyFormatPromise},t.getKeyFormatPromise=function(e){var t=this;return new Promise((function(r,n){var i=te(t.config),o=e.map(Q).filter((function(e){return!!e&&-1!==i.indexOf(e)}));return t.getKeySystemSelectionPromise(o).then((function(e){var t=e.keySystem,i=ee(t);i?r(i):n(new Error('Unable to find format for key-system "'+t+'"'))})).catch(n)}))},t.loadKey=function(e){var t=this,r=e.keyInfo.decryptdata,n=this.getKeyIdString(r),i="(keyId: "+n+' format: "'+r.keyFormat+'" method: '+r.method+" uri: "+r.uri+")";this.log("Starting session for key "+i);var o=this.keyIdToKeySessionPromise[n];return o||(o=this.keyIdToKeySessionPromise[n]=this.getKeySystemForKeyPromise(r).then((function(n){var o=n.keySystem,a=n.mediaKeys;return t.throwIfDestroyed(),t.log("Handle encrypted media sn: "+e.frag.sn+" "+e.frag.type+": "+e.frag.level+" using key "+i),t.attemptSetMediaKeys(o,a).then((function(){t.throwIfDestroyed();var e=t.createMediaKeySessionContext({keySystem:o,mediaKeys:a,decryptdata:r});return t.generateRequestWithPreferredKeySession(e,"cenc",r.pssh,"playlist-key")}))}))).catch((function(e){return t.handleError(e)})),o},t.throwIfDestroyed=function(e){if(!this.hls)throw new Error("invalid state")},t.handleError=function(e){this.hls&&(this.error(e.message),e instanceof Do?this.hls.trigger(w.ERROR,e.data):this.hls.trigger(w.ERROR,{type:E.KEY_SYSTEM_ERROR,details:C.KEY_SYSTEM_NO_KEYS,error:e,fatal:!0}))},t.getKeySystemForKeyPromise=function(e){var t=this.getKeyIdString(e),r=this.keyIdToKeySessionPromise[t];if(!r){var n=Q(e.keyFormat),i=n?[n]:te(this.config);return this.attemptKeySystemAccess(i)}return r},t.getKeySystemSelectionPromise=function(e){if(e.length||(e=te(this.config)),0===e.length)throw new Do({type:E.KEY_SYSTEM_ERROR,details:C.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},"Missing key-system license configuration options "+JSON.stringify({drmSystems:this.config.drmSystems}));return this.attemptKeySystemAccess(e)},t._onMediaEncrypted=function(e){var t=this,r=e.initDataType,n=e.initData;if(this.debug('"'+e.type+'" event: init data type: "'+r+'"'),null!==n){var i,o;if("sinf"===r&&this.config.drmSystems[$.FAIRPLAY]){var a=Ce(new Uint8Array(n));try{var s=W(JSON.parse(a).sinf),l=Ie(new Uint8Array(s));if(!l)return;i=l.subarray(8,24),o=$.FAIRPLAY}catch(e){return void this.warn('Failed to parse sinf "encrypted" event message initData')}}else{var c=function(e){if(!(e instanceof ArrayBuffer)||e.byteLength<32)return null;var t={version:0,systemId:"",kids:null,data:null},r=new DataView(e),n=r.getUint32(0);if(e.byteLength!==n&&n>44)return null;if(1886614376!==r.getUint32(4))return null;if(t.version=r.getUint32(8)>>>24,t.version>1)return null;t.systemId=_e(new Uint8Array(e,12,16));var i=r.getUint32(28);if(0===t.version){if(n-32d||s.status>=400&&s.status<500)o(new Do({type:E.KEY_SYSTEM_ERROR,details:C.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0,networkDetails:s,response:{url:a,data:void 0,code:s.status,text:s.statusText}},"License Request XHR failed ("+a+"). Status: "+s.status+" ("+s.statusText+")"));else{var h=d-r._requestLicenseFailureCount+1;r.warn("Retrying license request, "+h+" attempts left"),r.requestLicense(e,t).then(i,o)}}},e.licenseXhr&&e.licenseXhr.readyState!==XMLHttpRequest.DONE&&e.licenseXhr.abort(),e.licenseXhr=s,r.setupLicenseXHR(s,a,e,t).then((function(e){var t=e.xhr,r=e.licenseChallenge;t.send(r)}))}))},t.onMediaAttached=function(e,t){if(this.config.emeEnabled){var r=t.media;this.media=r,r.addEventListener("encrypted",this.onMediaEncrypted),r.addEventListener("waitingforkey",this.onWaitingForKey)}},t.onMediaDetached=function(){var t=this,r=this.media,n=this.mediaKeySessions;r&&(r.removeEventListener("encrypted",this.onMediaEncrypted),r.removeEventListener("waitingforkey",this.onWaitingForKey),this.media=null),this._requestLicenseFailureCount=0,this.setMediaKeysQueue=[],this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},Ve.clearKeyUriToKeyIdMap();var i=n.length;e.CDMCleanupPromise=Promise.all(n.map((function(e){return t.removeSession(e)})).concat(null==r?void 0:r.setMediaKeys(null).catch((function(e){t.log("Could not clear media keys: "+e+". media.src: "+(null==r?void 0:r.src))})))).then((function(){i&&(t.log("finished closing key sessions and clearing media keys"),n.length=0)})).catch((function(e){t.log("Could not close sessions and clear media keys: "+e+". media.src: "+(null==r?void 0:r.src))}))},t.onManifestLoading=function(){this.keyFormatPromise=null},t.onManifestLoaded=function(e,t){var r=t.sessionKeys;if(r&&this.config.emeEnabled&&!this.keyFormatPromise){var n=r.reduce((function(e,t){return-1===e.indexOf(t.keyFormat)&&e.push(t.keyFormat),e}),[]);this.log("Selecting key-system from session-keys "+n.join(", ")),this.keyFormatPromise=this.getKeyFormatPromise(n)}},t.removeSession=function(e){var t=this,r=e.mediaKeysSession,n=e.licenseXhr;if(r){this.log("Remove licenses and keys and close session "+r.sessionId),r.onmessage=null,r.onkeystatuseschange=null,n&&n.readyState!==XMLHttpRequest.DONE&&n.abort(),e.mediaKeysSession=e.decryptdata=e.licenseXhr=void 0;var i=this.mediaKeySessions.indexOf(e);return i>-1&&this.mediaKeySessions.splice(i,1),r.remove().catch((function(e){t.log("Could not remove session: "+e)})).then((function(){return r.close()})).catch((function(e){t.log("Could not close session: "+e)}))}},e}();Ao.CDMCleanupPromise=void 0;var Do=function(e){function t(t,r){var n;return(n=e.call(this,r)||this).data=void 0,t.error||(t.error=new Error(r)),n.data=t,t.err=t.error,n}return l(t,e),t}(h(Error)),Io="m",xo="a",Mo="v",Lo="av",jo="i",No="tt",Fo=function(){function e(t){var r=this;this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=function(){r.initialized&&(r.starved=!0),r.buffering=!0},this.onPlaying=function(){r.initialized||(r.initialized=!0),r.buffering=!1},this.applyPlaylistData=function(e){try{r.apply(e,{ot:Io,su:!r.initialized})}catch(e){A.warn("Could not generate manifest CMCD data.",e)}},this.applyFragmentData=function(e){try{var t=e.frag,n=r.hls.levels[t.level],i=r.getObjectType(t),o={d:1e3*t.duration,ot:i};i!==Mo&&i!==xo&&i!=Lo||(o.br=n.bitrate/1e3,o.tb=r.getTopBandwidth(i)/1e3,o.bl=r.getBufferLength(i)),r.apply(e,o)}catch(e){A.warn("Could not generate segment CMCD data.",e)}},this.hls=t;var n=this.config=t.config,i=n.cmcd;null!=i&&(n.pLoader=this.createPlaylistLoader(),n.fLoader=this.createFragmentLoader(),this.sid=i.sessionId||e.uuid(),this.cid=i.contentId,this.useHeaders=!0===i.useHeaders,this.registerListeners())}var t=e.prototype;return t.registerListeners=function(){var e=this.hls;e.on(w.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(w.MEDIA_DETACHED,this.onMediaDetached,this),e.on(w.BUFFER_CREATED,this.onBufferCreated,this)},t.unregisterListeners=function(){var e=this.hls;e.off(w.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(w.MEDIA_DETACHED,this.onMediaDetached,this),e.off(w.BUFFER_CREATED,this.onBufferCreated,this)},t.destroy=function(){this.unregisterListeners(),this.onMediaDetached(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},t.onMediaAttached=function(e,t){this.media=t.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},t.onMediaDetached=function(){this.media&&(this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null)},t.onBufferCreated=function(e,t){var r,n;this.audioBuffer=null==(r=t.tracks.audio)?void 0:r.buffer,this.videoBuffer=null==(n=t.tracks.video)?void 0:n.buffer},t.createData=function(){var e;return{v:1,sf:"h",sid:this.sid,cid:this.cid,pr:null==(e=this.media)?void 0:e.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},t.apply=function(t,r){void 0===r&&(r={}),s(r,this.createData());var n=r.ot===jo||r.ot===Mo||r.ot===Lo;if(this.starved&&n&&(r.bs=!0,r.su=!0,this.starved=!1),null==r.su&&(r.su=this.buffering),this.useHeaders){var i=e.toHeaders(r);if(!Object.keys(i).length)return;t.headers||(t.headers={}),s(t.headers,i)}else{var o=e.toQuery(r);if(!o)return;t.url=e.appendQueryToUri(t.url,o)}},t.getObjectType=function(e){var t=e.type;return"subtitle"===t?No:"initSegment"===e.sn?jo:"audio"===t?xo:"main"===t?this.hls.audioTracks.length?Mo:Lo:void 0},t.getTopBandwidth=function(e){var t,r=0,n=this.hls;if(e===xo)t=n.audioTracks;else{var i=n.maxAutoLevel,o=i>-1?i+1:n.levels.length;t=n.levels.slice(0,o)}for(var a,s=f(t);!(a=s()).done;){var l=a.value;l.bitrate>r&&(r=l.bitrate)}return r>0?r:NaN},t.getBufferLength=function(e){var t=this.hls.media,r=e===xo?this.audioBuffer:this.videoBuffer;return r&&t?1e3*Ar.bufferInfo(r,t.currentTime,this.config.maxBufferHole).len:NaN},t.createPlaylistLoader=function(){var e=this.config.pLoader,t=this.applyPlaylistData,r=e||this.config.loader;return function(){function e(e){this.loader=void 0,this.loader=new r(e)}var n=e.prototype;return n.destroy=function(){this.loader.destroy()},n.abort=function(){this.loader.abort()},n.load=function(e,r,n){t(e),this.loader.load(e,r,n)},o(e,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),e}()},t.createFragmentLoader=function(){var e=this.config.fLoader,t=this.applyFragmentData,r=e||this.config.loader;return function(){function e(e){this.loader=void 0,this.loader=new r(e)}var n=e.prototype;return n.destroy=function(){this.loader.destroy()},n.abort=function(){this.loader.abort()},n.load=function(e,r,n){t(e),this.loader.load(e,r,n)},o(e,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),e}()},e.uuid=function(){var e=URL.createObjectURL(new Blob),t=e.toString();return URL.revokeObjectURL(e),t.slice(t.lastIndexOf("/")+1)},e.serialize=function(e){for(var t,r=[],n=function(e){return!Number.isNaN(e)&&null!=e&&""!==e&&!1!==e},i=function(e){return Math.round(e)},o=function(e){return 100*i(e/100)},a={br:i,d:i,bl:o,dl:o,mtp:o,nor:function(e){return encodeURIComponent(e)},rtp:o,tb:i},s=f(Object.keys(e||{}).sort());!(t=s()).done;){var l=t.value,c=e[l];if(n(c)&&!("v"===l&&1===c||"pr"==l&&1===c)){var u=a[l];u&&(c=u(c));var d,h=typeof c;d="ot"===l||"sf"===l||"st"===l?l+"="+c:"boolean"===h?l:"number"===h?l+"="+c:l+"="+JSON.stringify(c),r.push(d)}}return r.join(",")},e.toHeaders=function(t){for(var r={},n=["Object","Request","Session","Status"],i=[{},{},{},{}],o={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3},a=0,s=Object.keys(t);a1&&(this.updatePathwayPriority(n),r.resolved=this.pathwayId!==i)}},t.filterParsedLevels=function(e){this.levels=e;var t=this.getLevelsForPathway(this.pathwayId);if(0===t.length){var r=e[0].pathwayId;this.log("No levels found in Pathway "+this.pathwayId+'. Setting initial Pathway to "'+r+'"'),t=this.getLevelsForPathway(r),this.pathwayId=r}return t.length!==e.length?(this.log("Found "+t.length+"/"+e.length+' levels in Pathway "'+this.pathwayId+'"'),t):e},t.getLevelsForPathway=function(e){return null===this.levels?[]:this.levels.filter((function(t){return e===t.pathwayId}))},t.updatePathwayPriority=function(e){var t;this.pathwayPriority=e;var r=this.penalizedPathways,n=performance.now();Object.keys(r).forEach((function(e){n-r[e]>3e5&&delete r[e]}));for(var i=0;i0){this.log('Setting Pathway to "'+o+'"'),this.pathwayId=o,this.hls.trigger(w.LEVELS_UPDATED,{levels:t});var l=this.hls.levels[a];s&&l&&this.levels&&(l.attrs["STABLE-VARIANT-ID"]!==s.attrs["STABLE-VARIANT-ID"]&&l.bitrate!==s.bitrate&&this.log("Unstable Pathways change from bitrate "+s.bitrate+" to "+l.bitrate),this.hls.nextLoadLevel=a);break}}}},t.clonePathways=function(e){var t=this,r=this.levels;if(r){var n={},i={};e.forEach((function(e){var o=e.ID,a=e["BASE-ID"],l=e["URI-REPLACEMENT"];if(!r.some((function(e){return e.pathwayId===o}))){var c=t.getLevelsForPathway(a).map((function(e){var t=s({},e);t.details=void 0,t.url=Vo(e.uri,e.attrs["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",l);var r=new x(e.attrs);r["PATHWAY-ID"]=o;var a=r.AUDIO&&r.AUDIO+"_clone_"+o,c=r.SUBTITLES&&r.SUBTITLES+"_clone_"+o;a&&(n[r.AUDIO]=a,r.AUDIO=a),c&&(i[r.SUBTITLES]=c,r.SUBTITLES=c),t.attrs=r;var u=new Bt(t);return pr(u,"audio",a),pr(u,"text",c),u}));r.push.apply(r,c),Uo(t.audioTracks,n,l,o),Uo(t.subtitleTracks,i,l,o)}}))}},t.loadSteeringManifest=function(e){var t,r=this,n=this.hls.config,i=n.loader;this.loader&&this.loader.destroy(),this.loader=new i(n);try{t=new self.URL(e)}catch(t){return this.enabled=!1,void this.log("Failed to parse Steering Manifest URI: "+e)}if("data:"!==t.protocol){var o=0|(this.hls.bandwidthEstimate||n.abrEwmaDefaultEstimate);t.searchParams.set("_HLS_pathway",this.pathwayId),t.searchParams.set("_HLS_throughput",""+o)}var a={responseType:"json",url:t.href},s=n.steeringManifestLoadPolicy.default,l=s.errorRetry||s.timeoutRetry||{},c={loadPolicy:s,timeout:s.maxLoadTimeMs,maxRetry:l.maxNumRetry||0,retryDelay:l.retryDelayMs||0,maxRetryDelay:l.maxRetryDelayMs||0},u={onSuccess:function(e,n,i,o){r.log('Loaded steering manifest: "'+t+'"');var a=e.data;if(1===a.VERSION){r.updated=performance.now(),r.timeToLoad=a.TTL;var s=a["RELOAD-URI"],l=a["PATHWAY-CLONES"],c=a["PATHWAY-PRIORITY"];if(s)try{r.uri=new self.URL(s,t).href}catch(e){return r.enabled=!1,void r.log("Failed to parse Steering Manifest RELOAD-URI: "+s)}r.scheduleRefresh(r.uri||i.url),l&&r.clonePathways(l),c&&r.updatePathwayPriority(c)}else r.log("Steering VERSION "+a.VERSION+" not supported!")},onError:function(e,t,n,i){if(r.log("Error loading steering manifest: "+e.code+" "+e.text+" ("+t.url+")"),r.stopLoad(),410===e.code)return r.enabled=!1,void r.log("Steering manifest "+t.url+" no longer available");var o=1e3*r.timeToLoad;if(429!==e.code)r.scheduleRefresh(r.uri||t.url,o);else{var a=r.loader;if("function"==typeof(null==a?void 0:a.getResponseHeader)){var s=a.getResponseHeader("Retry-After");s&&(o=1e3*parseFloat(s))}r.log("Steering manifest "+t.url+" rate limited")}},onTimeout:function(e,t,n){r.log("Timeout loading steering manifest ("+t.url+")"),r.scheduleRefresh(r.uri||t.url)}};this.log("Requesting steering manifest: "+t),this.loader.load(a,c,u)},t.scheduleRefresh=function(e,t){var r=this;void 0===t&&(t=1e3*this.timeToLoad),self.clearTimeout(this.reloadTimer),this.reloadTimer=self.setTimeout((function(){r.loadSteeringManifest(e)}),t)},e}();function Uo(e,t,r,n){e&&Object.keys(t).forEach((function(i){var o=e.filter((function(e){return e.groupId===i})).map((function(e){var o=s({},e);return o.details=void 0,o.attrs=new x(o.attrs),o.url=o.attrs.URI=Vo(e.url,e.attrs["STABLE-RENDITION-ID"],"PER-RENDITION-URIS",r),o.groupId=o.attrs["GROUP-ID"]=t[i],o.attrs["PATHWAY-ID"]=n,o}));e.push.apply(e,o)}))}function Vo(e,t,r,n){var i,o=n.HOST,a=n.PARAMS,s=n[r];t&&(i=null==s?void 0:s[t])&&(e=i);var l=new self.URL(e);return o&&!i&&(l.host=o),a&&Object.keys(a).sort().forEach((function(e){e&&l.searchParams.set(e,a[e])})),l.href}var Ho=/^age:\s*[\d.]+\s*$/im,Go=function(){function e(e){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=void 0,this.loader=null,this.stats=void 0,this.xhrSetup=e&&e.xhrSetup||null,this.stats=new j,this.retryDelay=0}var t=e.prototype;return t.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},t.abortInternal=function(){var e=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),e&&(e.onreadystatechange=null,e.onprogress=null,4!==e.readyState&&(this.stats.aborted=!0,e.abort()))},t.abort=function(){var e;this.abortInternal(),null!=(e=this.callbacks)&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},t.load=function(e,t,r){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=e,this.config=t,this.callbacks=r,this.loadInternal()},t.loadInternal=function(){var e=this,t=this.config,r=this.context;if(t){var n=this.loader=new self.XMLHttpRequest,i=this.stats;i.loading.first=0,i.loaded=0,i.aborted=!1;var o=this.xhrSetup;o?Promise.resolve().then((function(){if(!e.stats.aborted)return o(n,r.url)})).catch((function(e){return n.open("GET",r.url,!0),o(n,r.url)})).then((function(){e.stats.aborted||e.openAndSendXhr(n,r,t)})).catch((function(t){e.callbacks.onError({code:n.status,text:t.message},r,n,i)})):this.openAndSendXhr(n,r,t)}},t.openAndSendXhr=function(e,t,r){e.readyState||e.open("GET",t.url,!0);var n=this.context.headers,i=r.loadPolicy,o=i.maxTimeToFirstByteMs,a=i.maxLoadTimeMs;if(n)for(var s in n)e.setRequestHeader(s,n[s]);t.rangeEnd&&e.setRequestHeader("Range","bytes="+t.rangeStart+"-"+(t.rangeEnd-1)),e.onreadystatechange=this.readystatechange.bind(this),e.onprogress=this.loadprogress.bind(this),e.responseType=t.responseType,self.clearTimeout(this.requestTimeout),r.timeout=o&&b(o)?o:a,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),r.timeout),e.send()},t.readystatechange=function(){var e=this.context,t=this.loader,r=this.stats;if(e&&t){var n=t.readyState,i=this.config;if(!r.aborted&&n>=2&&(0===r.loading.first&&(r.loading.first=Math.max(self.performance.now(),r.loading.start),i.timeout!==i.loadPolicy.maxLoadTimeMs&&(self.clearTimeout(this.requestTimeout),i.timeout=i.loadPolicy.maxLoadTimeMs,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),i.loadPolicy.maxLoadTimeMs-(r.loading.first-r.loading.start)))),4===n)){self.clearTimeout(this.requestTimeout),t.onreadystatechange=null,t.onprogress=null;var o=t.status,a="text"!==t.responseType;if(o>=200&&o<300&&(a&&t.response||null!==t.responseText)){r.loading.end=Math.max(self.performance.now(),r.loading.first);var s=a?t.response:t.responseText,l="arraybuffer"===t.responseType?s.byteLength:s.length;if(r.loaded=r.total=l,r.bwEstimate=8e3*r.total/(r.loading.end-r.loading.first),!this.callbacks)return;var c=this.callbacks.onProgress;if(c&&c(r,e,s,t),!this.callbacks)return;var u={url:t.responseURL,data:s,code:o};this.callbacks.onSuccess(u,r,e,t)}else{var d=i.loadPolicy.errorRetry;Jt(d,r.retry,!1,o)?this.retry(d):(A.error(o+" while loading "+e.url),this.callbacks.onError({code:o,text:t.statusText},e,t,r))}}}},t.loadtimeout=function(){var e,t=null==(e=this.config)?void 0:e.loadPolicy.timeoutRetry;if(Jt(t,this.stats.retry,!0))this.retry(t);else{A.warn("timeout while loading "+this.context.url);var r=this.callbacks;r&&(this.abortInternal(),r.onTimeout(this.stats,this.context,this.loader))}},t.retry=function(e){var t=this.context,r=this.stats;this.retryDelay=Zt(e,r.retry),r.retry++,A.warn((status?"HTTP Status "+status:"Timeout")+" while loading "+t.url+", retrying "+r.retry+"/"+e.maxNumRetry+" in "+this.retryDelay+"ms"),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay)},t.loadprogress=function(e){var t=this.stats;t.loaded=e.loaded,e.lengthComputable&&(t.total=e.total)},t.getCacheAge=function(){var e=null;if(this.loader&&Ho.test(this.loader.getAllResponseHeaders())){var t=this.loader.getResponseHeader("age");e=t?parseFloat(t):null}return e},t.getResponseHeader=function(e){return this.loader&&new RegExp("^"+e+":\\s*[\\d.]+\\s*$","im").test(this.loader.getAllResponseHeaders())?this.loader.getResponseHeader(e):null},e}();var Wo=/(\d+)-(\d+)\/(\d+)/,zo=function(){function e(e){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=void 0,this.response=void 0,this.controller=void 0,this.context=void 0,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=e.fetchSetup||Ko,this.controller=new self.AbortController,this.stats=new j}var t=e.prototype;return t.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},t.abortInternal=function(){var e=this.response;null!=e&&e.ok||(this.stats.aborted=!0,this.controller.abort())},t.abort=function(){var e;this.abortInternal(),null!=(e=this.callbacks)&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},t.load=function(e,t,r){var n=this,i=this.stats;if(i.loading.start)throw new Error("Loader can only be used once.");i.loading.start=self.performance.now();var o=function(e,t){var r={method:"GET",mode:"cors",credentials:"same-origin",signal:t,headers:new self.Headers(s({},e.headers))};return e.rangeEnd&&r.headers.set("Range","bytes="+e.rangeStart+"-"+String(e.rangeEnd-1)),r}(e,this.controller.signal),a=r.onProgress,l="arraybuffer"===e.responseType,c=l?"byteLength":"length",u=t.loadPolicy,d=u.maxTimeToFirstByteMs,h=u.maxLoadTimeMs;this.context=e,this.config=t,this.callbacks=r,this.request=this.fetchSetup(e,o),self.clearTimeout(this.requestTimeout),t.timeout=d&&b(d)?d:h,this.requestTimeout=self.setTimeout((function(){n.abortInternal(),r.onTimeout(i,e,n.response)}),t.timeout),self.fetch(this.request).then((function(o){n.response=n.loader=o;var s=Math.max(self.performance.now(),i.loading.start);if(self.clearTimeout(n.requestTimeout),t.timeout=h,n.requestTimeout=self.setTimeout((function(){n.abortInternal(),r.onTimeout(i,e,n.response)}),h-(s-i.loading.start)),!o.ok){var c=o.status,u=o.statusText;throw new $o(u||"fetch, bad network response",c,o)}return i.loading.first=s,i.total=function(e){var t=e.get("Content-Range");if(t){var r=function(e){var t=Wo.exec(e);if(t)return parseInt(t[2])-parseInt(t[1])+1}(t);if(b(r))return r}var n=e.get("Content-Length");if(n)return parseInt(n)}(o.headers)||i.total,a&&b(t.highWaterMark)?n.loadProgressively(o,i,e,t.highWaterMark,a):l?o.arrayBuffer():"json"===e.responseType?o.json():o.text()})).then((function(o){var s=n.response;self.clearTimeout(n.requestTimeout),i.loading.end=Math.max(self.performance.now(),i.loading.first);var l=o[c];l&&(i.loaded=i.total=l);var u={url:s.url,data:o,code:s.status};a&&!b(t.highWaterMark)&&a(i,e,o,s),r.onSuccess(u,i,e,s)})).catch((function(t){if(self.clearTimeout(n.requestTimeout),!i.aborted){var o=t&&t.code||0,a=t?t.message:null;r.onError({code:o,text:a},e,t?t.details:null,i)}}))},t.getCacheAge=function(){var e=null;if(this.response){var t=this.response.headers.get("age");e=t?parseFloat(t):null}return e},t.getResponseHeader=function(e){return this.response?this.response.headers.get(e):null},t.loadProgressively=function(e,t,r,n,i){void 0===n&&(n=0);var o=new bi,a=e.body.getReader();return function s(){return a.read().then((function(a){if(a.done)return o.dataLength&&i(t,r,o.flush(),e),Promise.resolve(new ArrayBuffer(0));var l=a.value,c=l.length;return t.loaded+=c,c=n&&i(t,r,o.flush(),e)):i(t,r,l,e),s()})).catch((function(){return Promise.reject()}))}()},e}();function Ko(e,t){return new self.Request(e.url,t)}var $o=function(e){function t(t,r,n){var i;return(i=e.call(this,t)||this).code=void 0,i.details=void 0,i.code=r,i.details=n,i}return l(t,e),t}(h(Error)),qo=/\s/,Zo=n(n({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,maxBufferSize:6e7,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,workerPath:null,enableSoftwareAES:!0,startLevel:void 0,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:Go,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:yi,bufferController:Di,capLevelController:To,errorController:cr,fpsController:ko,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystems:{},drmSystemOptions:{},requestMediaKeySystemAccessFunc:re,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableID3MetadataCues:!0,certLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null}},keyLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"},errorRetry:{maxNumRetry:8,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"}}},manifestLoadPolicy:{default:{maxTimeToFirstByteMs:1/0,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},playlistLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:2,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},fragLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:12e4,timeoutRetry:{maxNumRetry:4,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:6,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},steeringManifestLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3},{cueHandler:{newCue:function(e,t,r,n){for(var i,o,a,s,l,c=[],u=self.VTTCue||self.TextTrackCue,d=0;d=16?s--:s++;var f=ao(l.trim()),m=ho(t,r,f);null!=e&&null!=(h=e.cues)&&h.getCueById(m)||((o=new u(t,r,f)).id=m,o.line=d+1,o.align="left",o.position=10+Math.min(80,10*Math.floor(8*s/32)),c.push(o))}return e&&c.length&&(c.sort((function(e,t){return"auto"===e.line||"auto"===t.line?0:e.line>8&&t.line>8?t.line-e.line:e.line-t.line})),c.forEach((function(t){return wt(e,t)}))),c}},enableWebVTT:!0,enableIMSC1:!0,enableCEA708Captions:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}),{},{subtitleStreamController:Ci,subtitleTrackController:Pi,timelineController:Oo,audioStreamController:_i,audioTrackController:Si,emeController:Ao,cmcdController:Fo,contentSteeringController:Bo});function Yo(e){return e&&"object"==typeof e?Array.isArray(e)?e.map(Yo):Object.keys(e).reduce((function(t,r){return t[r]=Yo(e[r]),t}),{}):e}function Jo(e){var t=e.loader;t!==zo&&t!==Go?(A.log("[config]: Custom loader detected, cannot enable progressive streaming"),e.progressive=!1):function(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(e){}return!1}()&&(e.loader=zo,e.progressive=!0,e.enableSoftwareAES=!0,A.log("[config]: Progressive streaming enabled, using FetchLoader"))}var Qo=function(){function e(t){void 0===t&&(t={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new li,this._autoLevelCapping=void 0,this._maxHdcpLevel=null,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null,R(t.debug||!1,"Hls instance");var r=this.config=function(e,t){if((t.liveSyncDurationCount||t.liveMaxLatencyDurationCount)&&(t.liveSyncDuration||t.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(void 0!==t.liveMaxLatencyDurationCount&&(void 0===t.liveSyncDurationCount||t.liveMaxLatencyDurationCount<=t.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(void 0!==t.liveMaxLatencyDuration&&(void 0===t.liveSyncDuration||t.liveMaxLatencyDuration<=t.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');var r=Yo(e),i=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return["manifest","level","frag"].forEach((function(e){var n=("level"===e?"playlist":e)+"LoadPolicy",o=void 0===t[n],a=[];i.forEach((function(i){var s=e+"Loading"+i,l=t[s];if(void 0!==l&&o){a.push(s);var c=r[n].default;switch(t[n]={default:c},i){case"TimeOut":c.maxLoadTimeMs=l,c.maxTimeToFirstByteMs=l;break;case"MaxRetry":c.errorRetry.maxNumRetry=l,c.timeoutRetry.maxNumRetry=l;break;case"RetryDelay":c.errorRetry.retryDelayMs=l,c.timeoutRetry.retryDelayMs=l;break;case"MaxRetryTimeout":c.errorRetry.maxRetryDelayMs=l,c.timeoutRetry.maxRetryDelayMs=l}}})),a.length&&A.warn('hls.js config: "'+a.join('", "')+'" setting(s) are deprecated, use "'+n+'": '+JSON.stringify(t[n]))})),n(n({},r),t)}(e.DefaultConfig,t);this.userConfig=t,this._autoLevelCapping=-1,r.progressive&&Jo(r);var i=r.abrController,o=r.bufferController,a=r.capLevelController,s=r.errorController,l=r.fpsController,c=new s(this),u=this.abrController=new i(this),d=this.bufferController=new o(this),h=this.capLevelController=new a(this),p=new l(this),f=new _t(this),m=new It(this),g=r.contentSteeringController,v=g?new g(this):null,y=this.levelController=new hr(this,v),b=new br(this),_=new Tr(this.config),S=this.streamController=new mi(this,b,_);h.setStreamController(S),p.setStreamController(S);var E=[f,y,S];v&&E.splice(1,0,v),this.networkControllers=E;var C=[u,d,h,p,m,b];this.audioTrackController=this.createController(r.audioTrackController,E);var O=r.audioStreamController;O&&E.push(new O(this,b,_)),this.subtitleTrackController=this.createController(r.subtitleTrackController,E);var P=r.subtitleStreamController;P&&E.push(new P(this,b,_)),this.createController(r.timelineController,C),_.emeController=this.emeController=this.createController(r.emeController,C),this.cmcdController=this.createController(r.cmcdController,C),this.latencyController=this.createController(xt,C),this.coreComponents=C,E.push(c);var T=c.onErrorOut;"function"==typeof T&&this.on(w.ERROR,T,c)}e.isSupported=function(){return function(){var e=qe();if(!e)return!1;var t=tn(),r=e&&"function"==typeof e.isTypeSupported&&e.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),n=!t||t.prototype&&"function"==typeof t.prototype.appendBuffer&&"function"==typeof t.prototype.remove;return!!r&&!!n}()};var t=e.prototype;return t.createController=function(e,t){if(e){var r=new e(this);return t&&t.push(r),r}return null},t.on=function(e,t,r){void 0===r&&(r=this),this._emitter.on(e,t,r)},t.once=function(e,t,r){void 0===r&&(r=this),this._emitter.once(e,t,r)},t.removeAllListeners=function(e){this._emitter.removeAllListeners(e)},t.off=function(e,t,r,n){void 0===r&&(r=this),this._emitter.off(e,t,r,n)},t.listeners=function(e){return this._emitter.listeners(e)},t.emit=function(e,t,r){return this._emitter.emit(e,t,r)},t.trigger=function(e,t){if(this.config.debug)return this.emit(e,e,t);try{return this.emit(e,e,t)}catch(t){A.error("An internal error happened while handling event "+e+'. Error message: "'+t.message+'". Here is a stacktrace:',t),this.trigger(w.ERROR,{type:E.OTHER_ERROR,details:C.INTERNAL_EXCEPTION,fatal:!1,event:e,error:t})}return!1},t.listenerCount=function(e){return this._emitter.listenerCount(e)},t.destroy=function(){A.log("destroy"),this.trigger(w.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach((function(e){return e.destroy()})),this.networkControllers.length=0,this.coreComponents.forEach((function(e){return e.destroy()})),this.coreComponents.length=0;var e=this.config;e.xhrSetup=e.fetchSetup=void 0,this.userConfig=null},t.attachMedia=function(e){A.log("attachMedia"),this._media=e,this.trigger(w.MEDIA_ATTACHING,{media:e})},t.detachMedia=function(){A.log("detachMedia"),this.trigger(w.MEDIA_DETACHING,void 0),this._media=null},t.loadSource=function(e){this.stopLoad();var t=this.media,r=this.url,n=this.url=y.buildAbsoluteURL(self.location.href,e,{alwaysNormalize:!0});A.log("loadSource:"+n),t&&r&&(r!==n||this.bufferController.hasSourceTypes())&&(this.detachMedia(),this.attachMedia(t)),this.trigger(w.MANIFEST_LOADING,{url:e})},t.startLoad=function(e){void 0===e&&(e=-1),A.log("startLoad("+e+")"),this.networkControllers.forEach((function(t){t.startLoad(e)}))},t.stopLoad=function(){A.log("stopLoad"),this.networkControllers.forEach((function(e){e.stopLoad()}))},t.swapAudioCodec=function(){A.log("swapAudioCodec"),this.streamController.swapAudioCodec()},t.recoverMediaError=function(){A.log("recoverMediaError");var e=this._media;this.detachMedia(),e&&this.attachMedia(e)},t.removeLevel=function(e,t){void 0===t&&(t=0),this.levelController.removeLevel(e,t)},o(e,[{key:"levels",get:function(){return this.levelController.levels||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(e){A.log("set currentLevel:"+e),this.loadLevel=e,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(e){A.log("set nextLevel:"+e),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(e){A.log("set loadLevel:"+e),this.levelController.manualLevel=e}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(e){this.levelController.nextLoadLevel=e}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(e){A.log("set firstLevel:"+e),this.levelController.firstLevel=e}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(e){A.log("set startLevel:"+e),-1!==e&&(e=Math.max(e,this.minAutoLevel)),this.levelController.startLevel=e}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(e){var t=!!e;t!==this.config.capLevelToPlayerSize&&(t?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=t)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(e){this._autoLevelCapping!==e&&(A.log("set autoLevelCapping:"+e),this._autoLevelCapping=e)}},{key:"bandwidthEstimate",get:function(){var e=this.abrController.bwEstimator;return e?e.getEstimate():NaN}},{key:"ttfbEstimate",get:function(){var e=this.abrController.bwEstimator;return e?e.getEstimateTTFB():NaN}},{key:"maxHdcpLevel",get:function(){return this._maxHdcpLevel},set:function(e){Mt.indexOf(e)>-1&&(this._maxHdcpLevel=e)}},{key:"autoLevelEnabled",get:function(){return-1===this.levelController.manualLevel}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var e=this.levels,t=this.config.minAutoBitrate;if(!e)return 0;for(var r=e.length,n=0;n=t)return n;return 0}},{key:"maxAutoLevel",get:function(){var e,t=this.levels,r=this.autoLevelCapping,n=this.maxHdcpLevel;if(e=-1===r&&t&&t.length?t.length-1:r,n)for(var i=e;i--;){var o=t[i].attrs["HDCP-LEVEL"];if(o&&o<=n)return i}return e}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(e){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,e)}},{key:"playingDate",get:function(){return this.streamController.currentProgramDateTime}},{key:"mainForwardBufferInfo",get:function(){return this.streamController.getMainFwdBufferInfo()}},{key:"audioTracks",get:function(){var e=this.audioTrackController;return e?e.audioTracks:[]}},{key:"audioTrack",get:function(){var e=this.audioTrackController;return e?e.audioTrack:-1},set:function(e){var t=this.audioTrackController;t&&(t.audioTrack=e)}},{key:"subtitleTracks",get:function(){var e=this.subtitleTrackController;return e?e.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var e=this.subtitleTrackController;return e?e.subtitleTrack:-1},set:function(e){var t=this.subtitleTrackController;t&&(t.subtitleTrack=e)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var e=this.subtitleTrackController;return!!e&&e.subtitleDisplay},set:function(e){var t=this.subtitleTrackController;t&&(t.subtitleDisplay=e)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(e){this.config.lowLatencyMode=e}},{key:"liveSyncPosition",get:function(){return this.latencyController.liveSyncPosition}},{key:"latency",get:function(){return this.latencyController.latency}},{key:"maxLatency",get:function(){return this.latencyController.maxLatency}},{key:"targetLatency",get:function(){return this.latencyController.targetLatency}},{key:"drift",get:function(){return this.latencyController.drift}},{key:"forceStartLoad",get:function(){return this.streamController.forceStartLoad}}],[{key:"version",get:function(){return"1.4.14"}},{key:"Events",get:function(){return w}},{key:"ErrorTypes",get:function(){return E}},{key:"ErrorDetails",get:function(){return C}},{key:"DefaultConfig",get:function(){return e.defaultConfig?e.defaultConfig:Zo},set:function(t){e.defaultConfig=t}}]),e}();return Qo.defaultConfig=void 0,Qo}()}(!1)},20181:(e,t,r)=>{var n=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,a=/^0o[0-7]+$/i,s=parseInt,l="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,c="object"==typeof self&&self&&self.Object===Object&&self,u=l||c||Function("return this")(),d=Object.prototype.toString,h=Math.max,p=Math.min,f=function(){return u.Date.now()};function m(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function g(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==d.call(e)}(e))return NaN;if(m(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=m(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(n,"");var r=o.test(e);return r||a.test(e)?s(e.slice(2),r?2:8):i.test(e)?NaN:+e}e.exports=function(e,t,r){var n,i,o,a,s,l,c=0,u=!1,d=!1,v=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function y(t){var r=n,o=i;return n=i=void 0,c=t,a=e.apply(o,r)}function b(e){var r=e-l;return void 0===l||r>=t||r<0||d&&e-c>=o}function _(){var e=f();if(b(e))return S(e);s=setTimeout(_,function(e){var r=t-(e-l);return d?p(r,o-(e-c)):r}(e))}function S(e){return s=void 0,v&&n?y(e):(n=i=void 0,a)}function w(){var e=f(),r=b(e);if(n=arguments,i=this,l=e,r){if(void 0===s)return function(e){return c=e,s=setTimeout(_,t),u?y(e):a}(l);if(d)return s=setTimeout(_,t),y(l)}return void 0===s&&(s=setTimeout(_,t)),a}return t=g(t)||0,m(r)&&(u=!!r.leading,o=(d="maxWait"in r)?h(g(r.maxWait)||0,t):o,v="trailing"in r?!!r.trailing:v),w.cancel=function(){void 0!==s&&clearTimeout(s),c=0,n=l=i=s=void 0},w.flush=function(){return void 0===s?a:S(f())},w}},25858:(e,t,r)=>{var n="Expected a function",i=NaN,o="[object Symbol]",a=/^\s+|\s+$/g,s=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,c=/^0o[0-7]+$/i,u=parseInt,d="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,h="object"==typeof self&&self&&self.Object===Object&&self,p=d||h||Function("return this")(),f=Object.prototype.toString,m=Math.max,g=Math.min,v=function(){return p.Date.now()};function y(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function b(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&f.call(e)==o}(e))return i;if(y(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=y(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(a,"");var r=l.test(e);return r||c.test(e)?u(e.slice(2),r?2:8):s.test(e)?i:+e}e.exports=function(e,t,r){var i=!0,o=!0;if("function"!=typeof e)throw new TypeError(n);return y(r)&&(i="leading"in r?!!r.leading:i,o="trailing"in r?!!r.trailing:o),function(e,t,r){var i,o,a,s,l,c,u=0,d=!1,h=!1,p=!0;if("function"!=typeof e)throw new TypeError(n);function f(t){var r=i,n=o;return i=o=void 0,u=t,s=e.apply(n,r)}function _(e){var r=e-c;return void 0===c||r>=t||r<0||h&&e-u>=a}function S(){var e=v();if(_(e))return w(e);l=setTimeout(S,function(e){var r=t-(e-c);return h?g(r,a-(e-u)):r}(e))}function w(e){return l=void 0,p&&i?f(e):(i=o=void 0,s)}function E(){var e=v(),r=_(e);if(i=arguments,o=this,c=e,r){if(void 0===l)return function(e){return u=e,l=setTimeout(S,t),d?f(e):s}(c);if(h)return l=setTimeout(S,t),f(c)}return void 0===l&&(l=setTimeout(S,t)),s}return t=b(t)||0,y(r)&&(d=!!r.leading,a=(h="maxWait"in r)?m(b(r.maxWait)||0,t):a,p="trailing"in r?!!r.trailing:p),E.cancel=function(){void 0!==l&&clearTimeout(l),u=0,i=c=o=l=void 0},E.flush=function(){return void 0===l?s:w(v())},E}(e,t,{leading:i,maxWait:t,trailing:o})}},76001:(e,t,r)=>{var n=r(97420),i=r(80631);e.exports=function(e,t){return n(e,t,(function(t,r){return i(e,r)}))}},97420:(e,t,r)=>{var n=r(47422),i=r(73170),o=r(31769);e.exports=function(e,t,r){for(var a=-1,s=t.length,l={};++a{var n=r(16547),i=r(31769),o=r(30361),a=r(23805),s=r(77797);e.exports=function(e,t,r,l){if(!a(e))return e;for(var c=-1,u=(t=i(t,e)).length,d=u-1,h=e;null!=h&&++c{var n=r(79920)("pick",r(44383));n.placeholder=r(2874),e.exports=n},44383:(e,t,r)=>{var n=r(76001),i=r(38816)((function(e,t){return null==e?{}:n(e,t)}));e.exports=i},69749:(e,t,r)=>{"use strict";const n=r(28799),i=Symbol("max"),o=Symbol("length"),a=Symbol("lengthCalculator"),s=Symbol("allowStale"),l=Symbol("maxAge"),c=Symbol("dispose"),u=Symbol("noDisposeOnSet"),d=Symbol("lruList"),h=Symbol("cache"),p=Symbol("updateAgeOnGet"),f=()=>1,m=(e,t,r)=>{const n=e[h].get(t);if(n){const t=n.value;if(g(e,t)){if(y(e,n),!e[s])return}else r&&(e[p]&&(n.value.now=Date.now()),e[d].unshiftNode(n));return t.value}},g=(e,t)=>{if(!t||!t.maxAge&&!e[l])return!1;const r=Date.now()-t.now;return t.maxAge?r>t.maxAge:e[l]&&r>e[l]},v=e=>{if(e[o]>e[i])for(let t=e[d].tail;e[o]>e[i]&&null!==t;){const r=t.prev;y(e,t),t=r}},y=(e,t)=>{if(t){const r=t.value;e[c]&&e[c](r.key,r.value),e[o]-=r.length,e[h].delete(r.key),e[d].removeNode(t)}};class b{constructor(e,t,r,n,i){this.key=e,this.value=t,this.length=r,this.now=n,this.maxAge=i||0}}const _=(e,t,r,n)=>{let i=r.value;g(e,i)&&(y(e,r),e[s]||(i=void 0)),i&&t.call(n,i.value,i.key,e)};e.exports=class{constructor(e){if("number"==typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!=typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[i]=e.max||1/0;const t=e.length||f;if(this[a]="function"!=typeof t?f:t,this[s]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[l]=e.maxAge||0,this[c]=e.dispose,this[u]=e.noDisposeOnSet||!1,this[p]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[i]=e||1/0,v(this)}get max(){return this[i]}set allowStale(e){this[s]=!!e}get allowStale(){return this[s]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[l]=e,v(this)}get maxAge(){return this[l]}set lengthCalculator(e){"function"!=typeof e&&(e=f),e!==this[a]&&(this[a]=e,this[o]=0,this[d].forEach((e=>{e.length=this[a](e.value,e.key),this[o]+=e.length}))),v(this)}get lengthCalculator(){return this[a]}get length(){return this[o]}get itemCount(){return this[d].length}rforEach(e,t){t=t||this;for(let r=this[d].tail;null!==r;){const n=r.prev;_(this,e,r,t),r=n}}forEach(e,t){t=t||this;for(let r=this[d].head;null!==r;){const n=r.next;_(this,e,r,t),r=n}}keys(){return this[d].toArray().map((e=>e.key))}values(){return this[d].toArray().map((e=>e.value))}reset(){this[c]&&this[d]&&this[d].length&&this[d].forEach((e=>this[c](e.key,e.value))),this[h]=new Map,this[d]=new n,this[o]=0}dump(){return this[d].map((e=>!g(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)})).toArray().filter((e=>e))}dumpLru(){return this[d]}set(e,t,r){if((r=r||this[l])&&"number"!=typeof r)throw new TypeError("maxAge must be a number");const n=r?Date.now():0,s=this[a](t,e);if(this[h].has(e)){if(s>this[i])return y(this,this[h].get(e)),!1;const a=this[h].get(e).value;return this[c]&&(this[u]||this[c](e,a.value)),a.now=n,a.maxAge=r,a.value=t,this[o]+=s-a.length,a.length=s,this.get(e),v(this),!0}const p=new b(e,t,s,n,r);return p.length>this[i]?(this[c]&&this[c](e,t),!1):(this[o]+=p.length,this[d].unshift(p),this[h].set(e,this[d].head),v(this),!0)}has(e){if(!this[h].has(e))return!1;const t=this[h].get(e).value;return!g(this,t)}get(e){return m(this,e,!0)}peek(e){return m(this,e,!1)}pop(){const e=this[d].tail;return e?(y(this,e),e.value):null}del(e){y(this,this[h].get(e))}load(e){this.reset();const t=Date.now();for(let r=e.length-1;r>=0;r--){const n=e[r],i=n.e||0;if(0===i)this.set(n.k,n.v);else{const e=i-t;e>0&&this.set(n.k,n.v,e)}}}prune(){this[h].forEach(((e,t)=>m(this,t,!1)))}}},83518:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Consumer=void 0;const n=r(82994),i=r(22010),o=r(34893),a=new n.Logger("Consumer");class s extends i.EnhancedEventEmitter{constructor({id:e,localId:t,producerId:r,rtpReceiver:n,track:o,rtpParameters:s,appData:l}){super(),this._closed=!1,this._observer=new i.EnhancedEventEmitter,a.debug("constructor()"),this._id=e,this._localId=t,this._producerId=r,this._rtpReceiver=n,this._track=o,this._rtpParameters=s,this._paused=!o.enabled,this._appData=l||{},this.onTrackEnded=this.onTrackEnded.bind(this),this.handleTrack()}get id(){return this._id}get localId(){return this._localId}get producerId(){return this._producerId}get closed(){return this._closed}get kind(){return this._track.kind}get rtpReceiver(){return this._rtpReceiver}get track(){return this._track}get rtpParameters(){return this._rtpParameters}get paused(){return this._paused}get appData(){return this._appData}set appData(e){this._appData=e}get observer(){return this._observer}close(){this._closed||(a.debug("close()"),this._closed=!0,this.destroyTrack(),this.emit("@close"),this._observer.safeEmit("close"))}transportClosed(){this._closed||(a.debug("transportClosed()"),this._closed=!0,this.destroyTrack(),this.safeEmit("transportclose"),this._observer.safeEmit("close"))}async getStats(){if(this._closed)throw new o.InvalidStateError("closed");return new Promise(((e,t)=>{this.safeEmit("@getstats",e,t)}))}pause(){a.debug("pause()"),this._closed?a.error("pause() | Consumer closed"):this._paused?a.debug("pause() | Consumer is already paused"):(this._paused=!0,this._track.enabled=!1,this.emit("@pause"),this._observer.safeEmit("pause"))}resume(){a.debug("resume()"),this._closed?a.error("resume() | Consumer closed"):this._paused?(this._paused=!1,this._track.enabled=!0,this.emit("@resume"),this._observer.safeEmit("resume")):a.debug("resume() | Consumer is already resumed")}onTrackEnded(){a.debug('track "ended" event'),this.safeEmit("trackended"),this._observer.safeEmit("trackended")}handleTrack(){this._track.addEventListener("ended",this.onTrackEnded)}destroyTrack(){try{this._track.removeEventListener("ended",this.onTrackEnded),this._track.stop()}catch(e){}}}t.Consumer=s},99166:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DataConsumer=void 0;const n=r(82994),i=r(22010),o=new n.Logger("DataConsumer");class a extends i.EnhancedEventEmitter{constructor({id:e,dataProducerId:t,dataChannel:r,sctpStreamParameters:n,appData:a}){super(),this._closed=!1,this._observer=new i.EnhancedEventEmitter,o.debug("constructor()"),this._id=e,this._dataProducerId=t,this._dataChannel=r,this._sctpStreamParameters=n,this._appData=a||{},this.handleDataChannel()}get id(){return this._id}get dataProducerId(){return this._dataProducerId}get closed(){return this._closed}get sctpStreamParameters(){return this._sctpStreamParameters}get readyState(){return this._dataChannel.readyState}get label(){return this._dataChannel.label}get protocol(){return this._dataChannel.protocol}get binaryType(){return this._dataChannel.binaryType}set binaryType(e){this._dataChannel.binaryType=e}get appData(){return this._appData}set appData(e){this._appData=e}get observer(){return this._observer}close(){this._closed||(o.debug("close()"),this._closed=!0,this._dataChannel.close(),this.emit("@close"),this._observer.safeEmit("close"))}transportClosed(){this._closed||(o.debug("transportClosed()"),this._closed=!0,this._dataChannel.close(),this.safeEmit("transportclose"),this._observer.safeEmit("close"))}handleDataChannel(){this._dataChannel.addEventListener("open",(()=>{this._closed||(o.debug('DataChannel "open" event'),this.safeEmit("open"))})),this._dataChannel.addEventListener("error",(e=>{if(this._closed)return;let{error:t}=e;t||(t=new Error("unknown DataChannel error")),"sctp-failure"===t.errorDetail?o.error("DataChannel SCTP error [sctpCauseCode:%s]: %s",t.sctpCauseCode,t.message):o.error('DataChannel "error" event: %o',t),this.safeEmit("error",t)})),this._dataChannel.addEventListener("close",(()=>{this._closed||(o.warn('DataChannel "close" event'),this._closed=!0,this.emit("@close"),this.safeEmit("close"),this._observer.safeEmit("close"))})),this._dataChannel.addEventListener("message",(e=>{this._closed||this.safeEmit("message",e.data)}))}}t.DataConsumer=a},77504:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DataProducer=void 0;const n=r(82994),i=r(22010),o=r(34893),a=new n.Logger("DataProducer");class s extends i.EnhancedEventEmitter{constructor({id:e,dataChannel:t,sctpStreamParameters:r,appData:n}){super(),this._closed=!1,this._observer=new i.EnhancedEventEmitter,a.debug("constructor()"),this._id=e,this._dataChannel=t,this._sctpStreamParameters=r,this._appData=n||{},this.handleDataChannel()}get id(){return this._id}get closed(){return this._closed}get sctpStreamParameters(){return this._sctpStreamParameters}get readyState(){return this._dataChannel.readyState}get label(){return this._dataChannel.label}get protocol(){return this._dataChannel.protocol}get bufferedAmount(){return this._dataChannel.bufferedAmount}get bufferedAmountLowThreshold(){return this._dataChannel.bufferedAmountLowThreshold}set bufferedAmountLowThreshold(e){this._dataChannel.bufferedAmountLowThreshold=e}get appData(){return this._appData}set appData(e){this._appData=e}get observer(){return this._observer}close(){this._closed||(a.debug("close()"),this._closed=!0,this._dataChannel.close(),this.emit("@close"),this._observer.safeEmit("close"))}transportClosed(){this._closed||(a.debug("transportClosed()"),this._closed=!0,this._dataChannel.close(),this.safeEmit("transportclose"),this._observer.safeEmit("close"))}send(e){if(a.debug("send()"),this._closed)throw new o.InvalidStateError("closed");this._dataChannel.send(e)}handleDataChannel(){this._dataChannel.addEventListener("open",(()=>{this._closed||(a.debug('DataChannel "open" event'),this.safeEmit("open"))})),this._dataChannel.addEventListener("error",(e=>{if(this._closed)return;let{error:t}=e;t||(t=new Error("unknown DataChannel error")),"sctp-failure"===t.errorDetail?a.error("DataChannel SCTP error [sctpCauseCode:%s]: %s",t.sctpCauseCode,t.message):a.error('DataChannel "error" event: %o',t),this.safeEmit("error",t)})),this._dataChannel.addEventListener("close",(()=>{this._closed||(a.warn('DataChannel "close" event'),this._closed=!0,this.emit("@close"),this.safeEmit("close"),this._observer.safeEmit("close"))})),this._dataChannel.addEventListener("message",(()=>{this._closed||a.warn('DataChannel "message" event in a DataProducer, message discarded')})),this._dataChannel.addEventListener("bufferedamountlow",(()=>{this._closed||this.safeEmit("bufferedamountlow")}))}}t.DataProducer=s},76004:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Device=t.detectDevice=void 0;const s=a(r(46880)),l=r(82994),c=r(22010),u=r(34893),d=o(r(31765)),h=o(r(38046)),p=r(35601),f=r(62183),m=r(90011),g=r(85535),v=r(78155),y=r(47402),b=r(51767),_=r(28146),S=r(59676),w=r(58633),E=r(34039),C=r(59352),O=new l.Logger("Device");function P(){if("object"==typeof navigator&&"ReactNative"===navigator.product)return"undefined"==typeof RTCPeerConnection?void O.warn("this._detectDevice() | unsupported react-native-webrtc without RTCPeerConnection, forgot to call registerGlobals()?"):"undefined"!=typeof RTCRtpTransceiver?(O.debug("this._detectDevice() | ReactNative UnifiedPlan handler chosen"),"ReactNativeUnifiedPlan"):(O.debug("this._detectDevice() | ReactNative PlanB handler chosen"),"ReactNative");if("object"!=typeof navigator||"string"!=typeof navigator.userAgent)O.warn("this._detectDevice() | unknown device");else{const e=navigator.userAgent,t=s.default.getParser(e),r=t.getEngine();if(t.satisfies({chrome:">=111",chromium:">=111","microsoft edge":">=111"}))return"Chrome111";if(t.satisfies({chrome:">=74",chromium:">=74","microsoft edge":">=88"}))return"Chrome74";if(t.satisfies({chrome:">=70",chromium:">=70"}))return"Chrome70";if(t.satisfies({chrome:">=67",chromium:">=67"}))return"Chrome67";if(t.satisfies({chrome:">=55",chromium:">=55"}))return"Chrome55";if(t.satisfies({firefox:">=60"}))return"Firefox60";if(t.satisfies({ios:{OS:">=14.3",firefox:">=30.0"}}))return"Safari12";if(t.satisfies({safari:">=12.0"})&&"undefined"!=typeof RTCRtpTransceiver&&RTCRtpTransceiver.prototype.hasOwnProperty("currentDirection"))return"Safari12";if(t.satisfies({safari:">=11"}))return"Safari11";if(t.satisfies({"microsoft edge":">=11"})&&t.satisfies({"microsoft edge":"<=18"}))return"Edge11";if(r.name&&"blink"===r.name.toLowerCase()){const t=e.match(/(?:(?:Chrome|Chromium))[ /](\w+)/i);if(t){const e=Number(t[1]);return e>=111?"Chrome111":e>=74?"Chrome74":e>=70?"Chrome70":e>=67?"Chrome67":"Chrome55"}return"Chrome111"}O.warn("this._detectDevice() | browser not supported [name:%s, version:%s]",t.getBrowserName(),t.getBrowserVersion())}}t.detectDevice=P,t.Device=class{constructor({handlerName:e,handlerFactory:t,Handler:r}={}){if(this._loaded=!1,this._observer=new c.EnhancedEventEmitter,O.debug("constructor()"),r){if(O.warn("constructor() | Handler option is DEPRECATED, use handlerName or handlerFactory instead"),"string"!=typeof r)throw new TypeError("non string Handler option no longer supported, use handlerFactory instead");e=r}if(e&&t)throw new TypeError("just one of handlerName or handlerInterface can be given");if(t)this._handlerFactory=t;else{if(e)O.debug("constructor() | handler given: %s",e);else{if(!(e=P()))throw new u.UnsupportedError("device not supported");O.debug("constructor() | detected handler: %s",e)}switch(e){case"Chrome111":this._handlerFactory=f.Chrome111.createFactory();break;case"Chrome74":this._handlerFactory=m.Chrome74.createFactory();break;case"Chrome70":this._handlerFactory=g.Chrome70.createFactory();break;case"Chrome67":this._handlerFactory=v.Chrome67.createFactory();break;case"Chrome55":this._handlerFactory=y.Chrome55.createFactory();break;case"Firefox60":this._handlerFactory=b.Firefox60.createFactory();break;case"Safari12":this._handlerFactory=_.Safari12.createFactory();break;case"Safari11":this._handlerFactory=S.Safari11.createFactory();break;case"Edge11":this._handlerFactory=w.Edge11.createFactory();break;case"ReactNativeUnifiedPlan":this._handlerFactory=E.ReactNativeUnifiedPlan.createFactory();break;case"ReactNative":this._handlerFactory=C.ReactNative.createFactory();break;default:throw new TypeError(`unknown handlerName "${e}"`)}}const n=this._handlerFactory();this._handlerName=n.name,n.close(),this._extendedRtpCapabilities=void 0,this._recvRtpCapabilities=void 0,this._canProduceByKind={audio:!1,video:!1},this._sctpCapabilities=void 0}get handlerName(){return this._handlerName}get loaded(){return this._loaded}get rtpCapabilities(){if(!this._loaded)throw new u.InvalidStateError("not loaded");return this._recvRtpCapabilities}get sctpCapabilities(){if(!this._loaded)throw new u.InvalidStateError("not loaded");return this._sctpCapabilities}get observer(){return this._observer}async load({routerRtpCapabilities:e}){let t;O.debug("load() [routerRtpCapabilities:%o]",e),e=d.clone(e,void 0);try{if(this._loaded)throw new u.InvalidStateError("already loaded");h.validateRtpCapabilities(e),t=this._handlerFactory();const r=await t.getNativeRtpCapabilities();O.debug("load() | got native RTP capabilities:%o",r),h.validateRtpCapabilities(r),this._extendedRtpCapabilities=h.getExtendedRtpCapabilities(r,e),O.debug("load() | got extended RTP capabilities:%o",this._extendedRtpCapabilities),this._canProduceByKind.audio=h.canSend("audio",this._extendedRtpCapabilities),this._canProduceByKind.video=h.canSend("video",this._extendedRtpCapabilities),this._recvRtpCapabilities=h.getRecvRtpCapabilities(this._extendedRtpCapabilities),h.validateRtpCapabilities(this._recvRtpCapabilities),O.debug("load() | got receiving RTP capabilities:%o",this._recvRtpCapabilities),this._sctpCapabilities=await t.getNativeSctpCapabilities(),O.debug("load() | got native SCTP capabilities:%o",this._sctpCapabilities),h.validateSctpCapabilities(this._sctpCapabilities),O.debug("load() succeeded"),this._loaded=!0,t.close()}catch(e){throw t&&t.close(),e}}canProduce(e){if(!this._loaded)throw new u.InvalidStateError("not loaded");if("audio"!==e&&"video"!==e)throw new TypeError(`invalid kind "${e}"`);return this._canProduceByKind[e]}createSendTransport({id:e,iceParameters:t,iceCandidates:r,dtlsParameters:n,sctpParameters:i,iceServers:o,iceTransportPolicy:a,additionalSettings:s,proprietaryConstraints:l,appData:c}){return O.debug("createSendTransport()"),this.createTransport({direction:"send",id:e,iceParameters:t,iceCandidates:r,dtlsParameters:n,sctpParameters:i,iceServers:o,iceTransportPolicy:a,additionalSettings:s,proprietaryConstraints:l,appData:c})}createRecvTransport({id:e,iceParameters:t,iceCandidates:r,dtlsParameters:n,sctpParameters:i,iceServers:o,iceTransportPolicy:a,additionalSettings:s,proprietaryConstraints:l,appData:c}){return O.debug("createRecvTransport()"),this.createTransport({direction:"recv",id:e,iceParameters:t,iceCandidates:r,dtlsParameters:n,sctpParameters:i,iceServers:o,iceTransportPolicy:a,additionalSettings:s,proprietaryConstraints:l,appData:c})}createTransport({direction:e,id:t,iceParameters:r,iceCandidates:n,dtlsParameters:i,sctpParameters:o,iceServers:a,iceTransportPolicy:s,additionalSettings:l,proprietaryConstraints:c,appData:d}){if(!this._loaded)throw new u.InvalidStateError("not loaded");if("string"!=typeof t)throw new TypeError("missing id");if("object"!=typeof r)throw new TypeError("missing iceParameters");if(!Array.isArray(n))throw new TypeError("missing iceCandidates");if("object"!=typeof i)throw new TypeError("missing dtlsParameters");if(o&&"object"!=typeof o)throw new TypeError("wrong sctpParameters");if(d&&"object"!=typeof d)throw new TypeError("if given, appData must be an object");const h=new p.Transport({direction:e,id:t,iceParameters:r,iceCandidates:n,dtlsParameters:i,sctpParameters:o,iceServers:a,iceTransportPolicy:s,additionalSettings:l,proprietaryConstraints:c,appData:d,handlerFactory:this._handlerFactory,extendedRtpCapabilities:this._extendedRtpCapabilities,canProduceByKind:this._canProduceByKind});return this._observer.safeEmit("newtransport",h),h}}},22010:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EnhancedEventEmitter=void 0;const n=r(37007),i=new(r(82994).Logger)("EnhancedEventEmitter");class o extends n.EventEmitter{constructor(){super(),this.setMaxListeners(1/0)}emit(e,...t){return super.emit(e,...t)}safeEmit(e,...t){const r=super.listenerCount(e);try{return super.emit(e,...t)}catch(t){return i.error("safeEmit() | event listener threw an error [eventName:%s]:%o",e,t),Boolean(r)}}on(e,t){return super.on(e,t),this}off(e,t){return super.off(e,t),this}addListener(e,t){return super.on(e,t),this}prependListener(e,t){return super.prependListener(e,t),this}once(e,t){return super.once(e,t),this}prependOnceListener(e,t){return super.prependOnceListener(e,t),this}removeListener(e,t){return super.off(e,t),this}removeAllListeners(e){return super.removeAllListeners(e),this}listenerCount(e){return super.listenerCount(e)}listeners(e){return super.listeners(e)}rawListeners(e){return super.rawListeners(e)}}t.EnhancedEventEmitter=o},82994:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Logger=void 0;const i=n(r(94646)),o="mediasoup-client";t.Logger=class{constructor(e){e?(this._debug=(0,i.default)(`${o}:${e}`),this._warn=(0,i.default)(`${o}:WARN:${e}`),this._error=(0,i.default)(`${o}:ERROR:${e}`)):(this._debug=(0,i.default)(o),this._warn=(0,i.default)(`${o}:WARN`),this._error=(0,i.default)(`${o}:ERROR`)),this._debug.log=console.info.bind(console),this._warn.log=console.warn.bind(console),this._error.log=console.error.bind(console)}get debug(){return this._debug}get warn(){return this._warn}get error(){return this._error}}},29792:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Producer=void 0;const n=r(82994),i=r(22010),o=r(34893),a=new n.Logger("Producer");class s extends i.EnhancedEventEmitter{constructor({id:e,localId:t,rtpSender:r,track:n,rtpParameters:o,stopTracks:s,disableTrackOnPause:l,zeroRtpOnPause:c,appData:u}){super(),this._closed=!1,this._observer=new i.EnhancedEventEmitter,a.debug("constructor()"),this._id=e,this._localId=t,this._rtpSender=r,this._track=n,this._kind=n.kind,this._rtpParameters=o,this._paused=!!l&&!n.enabled,this._maxSpatialLayer=void 0,this._stopTracks=s,this._disableTrackOnPause=l,this._zeroRtpOnPause=c,this._appData=u||{},this.onTrackEnded=this.onTrackEnded.bind(this),this.handleTrack()}get id(){return this._id}get localId(){return this._localId}get closed(){return this._closed}get kind(){return this._kind}get rtpSender(){return this._rtpSender}get track(){return this._track}get rtpParameters(){return this._rtpParameters}get paused(){return this._paused}get maxSpatialLayer(){return this._maxSpatialLayer}get appData(){return this._appData}set appData(e){this._appData=e}get observer(){return this._observer}close(){this._closed||(a.debug("close()"),this._closed=!0,this.destroyTrack(),this.emit("@close"),this._observer.safeEmit("close"))}transportClosed(){this._closed||(a.debug("transportClosed()"),this._closed=!0,this.destroyTrack(),this.safeEmit("transportclose"),this._observer.safeEmit("close"))}async getStats(){if(this._closed)throw new o.InvalidStateError("closed");return new Promise(((e,t)=>{this.safeEmit("@getstats",e,t)}))}pause(){a.debug("pause()"),this._closed?a.error("pause() | Producer closed"):(this._paused=!0,this._track&&this._disableTrackOnPause&&(this._track.enabled=!1),this._zeroRtpOnPause&&new Promise(((e,t)=>{this.safeEmit("@pause",e,t)})).catch((()=>{})),this._observer.safeEmit("pause"))}resume(){a.debug("resume()"),this._closed?a.error("resume() | Producer closed"):(this._paused=!1,this._track&&this._disableTrackOnPause&&(this._track.enabled=!0),this._zeroRtpOnPause&&new Promise(((e,t)=>{this.safeEmit("@resume",e,t)})).catch((()=>{})),this._observer.safeEmit("resume"))}async replaceTrack({track:e}){if(a.debug("replaceTrack() [track:%o]",e),this._closed){if(e&&this._stopTracks)try{e.stop()}catch(e){}throw new o.InvalidStateError("closed")}if(e&&"ended"===e.readyState)throw new o.InvalidStateError("track ended");e!==this._track?(await new Promise(((t,r)=>{this.safeEmit("@replacetrack",e,t,r)})),this.destroyTrack(),this._track=e,this._track&&this._disableTrackOnPause&&(this._paused?this._paused&&(this._track.enabled=!1):this._track.enabled=!0),this.handleTrack()):a.debug("replaceTrack() | same track, ignored")}async setMaxSpatialLayer(e){if(this._closed)throw new o.InvalidStateError("closed");if("video"!==this._kind)throw new o.UnsupportedError("not a video Producer");if("number"!=typeof e)throw new TypeError("invalid spatialLayer");e!==this._maxSpatialLayer&&(await new Promise(((t,r)=>{this.safeEmit("@setmaxspatiallayer",e,t,r)})).catch((()=>{})),this._maxSpatialLayer=e)}async setRtpEncodingParameters(e){if(this._closed)throw new o.InvalidStateError("closed");if("object"!=typeof e)throw new TypeError("invalid params");await new Promise(((t,r)=>{this.safeEmit("@setrtpencodingparameters",e,t,r)}))}onTrackEnded(){a.debug('track "ended" event'),this.safeEmit("trackended"),this._observer.safeEmit("trackended")}handleTrack(){this._track&&this._track.addEventListener("ended",this.onTrackEnded)}destroyTrack(){if(this._track)try{this._track.removeEventListener("ended",this.onTrackEnded),this._stopTracks&&this._track.stop()}catch(e){}}}t.Producer=s},5370:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},84160:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},35601:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Transport=void 0;const s=r(18876),l=a(r(79596)),c=r(82994),u=r(22010),d=r(34893),h=o(r(31765)),p=o(r(38046)),f=r(29792),m=r(83518),g=r(77504),v=r(99166),y=new c.Logger("Transport");class b{constructor(e){this.consumerOptions=e,this.promise=new Promise(((e,t)=>{this.resolve=e,this.reject=t}))}}class _ extends u.EnhancedEventEmitter{constructor({direction:e,id:t,iceParameters:r,iceCandidates:n,dtlsParameters:i,sctpParameters:o,iceServers:a,iceTransportPolicy:l,additionalSettings:c,proprietaryConstraints:d,appData:p,handlerFactory:f,extendedRtpCapabilities:m,canProduceByKind:g}){super(),this._closed=!1,this._connectionState="new",this._producers=new Map,this._consumers=new Map,this._dataProducers=new Map,this._dataConsumers=new Map,this._probatorConsumerCreated=!1,this._awaitQueue=new s.AwaitQueue,this._pendingConsumerTasks=[],this._consumerCreationInProgress=!1,this._pendingPauseConsumers=new Map,this._consumerPauseInProgress=!1,this._pendingResumeConsumers=new Map,this._consumerResumeInProgress=!1,this._pendingCloseConsumers=new Map,this._consumerCloseInProgress=!1,this._observer=new u.EnhancedEventEmitter,y.debug("constructor() [id:%s, direction:%s]",t,e),this._id=t,this._direction=e,this._extendedRtpCapabilities=m,this._canProduceByKind=g,this._maxSctpMessageSize=o?o.maxMessageSize:null,delete(c=h.clone(c,{})).iceServers,delete c.iceTransportPolicy,delete c.bundlePolicy,delete c.rtcpMuxPolicy,delete c.sdpSemantics,this._handler=f(),this._handler.run({direction:e,iceParameters:r,iceCandidates:n,dtlsParameters:i,sctpParameters:o,iceServers:a,iceTransportPolicy:l,additionalSettings:c,proprietaryConstraints:d,extendedRtpCapabilities:m}),this._appData=p||{},this.handleHandler()}get id(){return this._id}get closed(){return this._closed}get direction(){return this._direction}get handler(){return this._handler}get connectionState(){return this._connectionState}get appData(){return this._appData}set appData(e){this._appData=e}get observer(){return this._observer}close(){if(!this._closed){y.debug("close()"),this._closed=!0,this._awaitQueue.stop(),this._handler.close();for(const e of this._producers.values())e.transportClosed();this._producers.clear();for(const e of this._consumers.values())e.transportClosed();this._consumers.clear();for(const e of this._dataProducers.values())e.transportClosed();this._dataProducers.clear();for(const e of this._dataConsumers.values())e.transportClosed();this._dataConsumers.clear(),this._observer.safeEmit("close")}}async getStats(){if(this._closed)throw new d.InvalidStateError("closed");return this._handler.getTransportStats()}async restartIce({iceParameters:e}){if(y.debug("restartIce()"),this._closed)throw new d.InvalidStateError("closed");if(!e)throw new TypeError("missing iceParameters");return this._awaitQueue.push((async()=>this._handler.restartIce(e)),"transport.restartIce()")}async updateIceServers({iceServers:e}={}){if(y.debug("updateIceServers()"),this._closed)throw new d.InvalidStateError("closed");if(!Array.isArray(e))throw new TypeError("missing iceServers");return this._awaitQueue.push((async()=>this._handler.updateIceServers(e)),"transport.updateIceServers()")}async produce({track:e,encodings:t,codecOptions:r,codec:n,stopTracks:i=!0,disableTrackOnPause:o=!0,zeroRtpOnPause:a=!1,appData:s={}}={}){if(y.debug("produce() [track:%o]",e),this._closed)throw new d.InvalidStateError("closed");if(!e)throw new TypeError("missing track");if("send"!==this._direction)throw new d.UnsupportedError("not a sending Transport");if(!this._canProduceByKind[e.kind])throw new d.UnsupportedError(`cannot produce ${e.kind}`);if("ended"===e.readyState)throw new d.InvalidStateError("track ended");if(0===this.listenerCount("connect")&&"new"===this._connectionState)throw new TypeError('no "connect" listener set into this transport');if(0===this.listenerCount("produce"))throw new TypeError('no "produce" listener set into this transport');if(s&&"object"!=typeof s)throw new TypeError("if given, appData must be an object");return this._awaitQueue.push((async()=>{let l;if(t&&!Array.isArray(t))throw TypeError("encodings must be an array");t&&0===t.length?l=void 0:t&&(l=t.map((e=>{const t={active:!0};return!1===e.active&&(t.active=!1),"boolean"==typeof e.dtx&&(t.dtx=e.dtx),"string"==typeof e.scalabilityMode&&(t.scalabilityMode=e.scalabilityMode),"number"==typeof e.scaleResolutionDownBy&&(t.scaleResolutionDownBy=e.scaleResolutionDownBy),"number"==typeof e.maxBitrate&&(t.maxBitrate=e.maxBitrate),"number"==typeof e.maxFramerate&&(t.maxFramerate=e.maxFramerate),"boolean"==typeof e.adaptivePtime&&(t.adaptivePtime=e.adaptivePtime),"string"==typeof e.priority&&(t.priority=e.priority),"string"==typeof e.networkPriority&&(t.networkPriority=e.networkPriority),t})));const{localId:c,rtpParameters:u,rtpSender:d}=await this._handler.send({track:e,encodings:l,codecOptions:r,codec:n});try{p.validateRtpParameters(u);const{id:t}=await new Promise(((t,r)=>{this.safeEmit("produce",{kind:e.kind,rtpParameters:u,appData:s},t,r)})),r=new f.Producer({id:t,localId:c,rtpSender:d,track:e,rtpParameters:u,stopTracks:i,disableTrackOnPause:o,zeroRtpOnPause:a,appData:s});return this._producers.set(r.id,r),this.handleProducer(r),this._observer.safeEmit("newproducer",r),r}catch(e){throw this._handler.stopSending(c).catch((()=>{})),e}}),"transport.produce()").catch((t=>{if(i)try{e.stop()}catch(e){}throw t}))}async consume({id:e,producerId:t,kind:r,rtpParameters:n,streamId:i,appData:o={}}){if(y.debug("consume()"),n=h.clone(n,void 0),this._closed)throw new d.InvalidStateError("closed");if("recv"!==this._direction)throw new d.UnsupportedError("not a receiving Transport");if("string"!=typeof e)throw new TypeError("missing id");if("string"!=typeof t)throw new TypeError("missing producerId");if("audio"!==r&&"video"!==r)throw new TypeError(`invalid kind '${r}'`);if(0===this.listenerCount("connect")&&"new"===this._connectionState)throw new TypeError('no "connect" listener set into this transport');if(o&&"object"!=typeof o)throw new TypeError("if given, appData must be an object");if(!p.canReceive(n,this._extendedRtpCapabilities))throw new d.UnsupportedError("cannot consume this Producer");const a=new b({id:e,producerId:t,kind:r,rtpParameters:n,streamId:i,appData:o});return this._pendingConsumerTasks.push(a),(0,l.default)((()=>{this._closed||!1===this._consumerCreationInProgress&&this.createPendingConsumers()})),a.promise}async produceData({ordered:e=!0,maxPacketLifeTime:t,maxRetransmits:r,label:n="",protocol:i="",appData:o={}}={}){if(y.debug("produceData()"),this._closed)throw new d.InvalidStateError("closed");if("send"!==this._direction)throw new d.UnsupportedError("not a sending Transport");if(!this._maxSctpMessageSize)throw new d.UnsupportedError("SCTP not enabled by remote Transport");if(0===this.listenerCount("connect")&&"new"===this._connectionState)throw new TypeError('no "connect" listener set into this transport');if(0===this.listenerCount("producedata"))throw new TypeError('no "producedata" listener set into this transport');if(o&&"object"!=typeof o)throw new TypeError("if given, appData must be an object");return(t||r)&&(e=!1),this._awaitQueue.push((async()=>{const{dataChannel:a,sctpStreamParameters:s}=await this._handler.sendDataChannel({ordered:e,maxPacketLifeTime:t,maxRetransmits:r,label:n,protocol:i});p.validateSctpStreamParameters(s);const{id:l}=await new Promise(((e,t)=>{this.safeEmit("producedata",{sctpStreamParameters:s,label:n,protocol:i,appData:o},e,t)})),c=new g.DataProducer({id:l,dataChannel:a,sctpStreamParameters:s,appData:o});return this._dataProducers.set(c.id,c),this.handleDataProducer(c),this._observer.safeEmit("newdataproducer",c),c}),"transport.produceData()")}async consumeData({id:e,dataProducerId:t,sctpStreamParameters:r,label:n="",protocol:i="",appData:o={}}){if(y.debug("consumeData()"),r=h.clone(r,void 0),this._closed)throw new d.InvalidStateError("closed");if("recv"!==this._direction)throw new d.UnsupportedError("not a receiving Transport");if(!this._maxSctpMessageSize)throw new d.UnsupportedError("SCTP not enabled by remote Transport");if("string"!=typeof e)throw new TypeError("missing id");if("string"!=typeof t)throw new TypeError("missing dataProducerId");if(0===this.listenerCount("connect")&&"new"===this._connectionState)throw new TypeError('no "connect" listener set into this transport');if(o&&"object"!=typeof o)throw new TypeError("if given, appData must be an object");return p.validateSctpStreamParameters(r),this._awaitQueue.push((async()=>{const{dataChannel:a}=await this._handler.receiveDataChannel({sctpStreamParameters:r,label:n,protocol:i}),s=new v.DataConsumer({id:e,dataProducerId:t,dataChannel:a,sctpStreamParameters:r,appData:o});return this._dataConsumers.set(s.id,s),this.handleDataConsumer(s),this._observer.safeEmit("newdataconsumer",s),s}),"transport.consumeData()")}async createPendingConsumers(){this._consumerCreationInProgress=!0,this._awaitQueue.push((async()=>{if(0===this._pendingConsumerTasks.length)return void y.debug("createPendingConsumers() | there is no Consumer to be created");const e=[...this._pendingConsumerTasks];let t;this._pendingConsumerTasks=[];const r=[];for(const t of e){const{id:e,kind:n,rtpParameters:i,streamId:o}=t.consumerOptions;r.push({trackId:e,kind:n,rtpParameters:i,streamId:o})}try{const n=await this._handler.receive(r);for(let r=0;r{this._consumerCreationInProgress=!1,this._pendingConsumerTasks.length>0&&this.createPendingConsumers()})).catch((()=>{}))}pausePendingConsumers(){this._consumerPauseInProgress=!0,this._awaitQueue.push((async()=>{if(0===this._pendingPauseConsumers.size)return void y.debug("pausePendingConsumers() | there is no Consumer to be paused");const e=Array.from(this._pendingPauseConsumers.values());this._pendingPauseConsumers.clear();try{const t=e.map((e=>e.localId));await this._handler.pauseReceiving(t)}catch(e){y.error("pausePendingConsumers() | failed to pause Consumers:",e)}}),"transport.pausePendingConsumers").then((()=>{this._consumerPauseInProgress=!1,this._pendingPauseConsumers.size>0&&this.pausePendingConsumers()})).catch((()=>{}))}resumePendingConsumers(){this._consumerResumeInProgress=!0,this._awaitQueue.push((async()=>{if(0===this._pendingResumeConsumers.size)return void y.debug("resumePendingConsumers() | there is no Consumer to be resumed");const e=Array.from(this._pendingResumeConsumers.values());this._pendingResumeConsumers.clear();try{const t=e.map((e=>e.localId));await this._handler.resumeReceiving(t)}catch(e){y.error("resumePendingConsumers() | failed to resume Consumers:",e)}}),"transport.resumePendingConsumers").then((()=>{this._consumerResumeInProgress=!1,this._pendingResumeConsumers.size>0&&this.resumePendingConsumers()})).catch((()=>{}))}closePendingConsumers(){this._consumerCloseInProgress=!0,this._awaitQueue.push((async()=>{if(0===this._pendingCloseConsumers.size)return void y.debug("closePendingConsumers() | there is no Consumer to be closed");const e=Array.from(this._pendingCloseConsumers.values());this._pendingCloseConsumers.clear();try{await this._handler.stopReceiving(e.map((e=>e.localId)))}catch(e){y.error("closePendingConsumers() | failed to close Consumers:",e)}}),"transport.closePendingConsumers").then((()=>{this._consumerCloseInProgress=!1,this._pendingCloseConsumers.size>0&&this.closePendingConsumers()})).catch((()=>{}))}handleHandler(){const e=this._handler;e.on("@connect",(({dtlsParameters:e},t,r)=>{this._closed?r(new d.InvalidStateError("closed")):this.safeEmit("connect",{dtlsParameters:e},t,r)})),e.on("@connectionstatechange",(e=>{e!==this._connectionState&&(y.debug("connection state changed to %s",e),this._connectionState=e,this._closed||this.safeEmit("connectionstatechange",e))}))}handleProducer(e){e.on("@close",(()=>{this._producers.delete(e.id),this._closed||this._awaitQueue.push((async()=>this._handler.stopSending(e.localId)),"producer @close event").catch((e=>y.warn("producer.close() failed:%o",e)))})),e.on("@pause",((t,r)=>{this._awaitQueue.push((async()=>this._handler.pauseSending(e.localId)),"producer @pause event").then(t).catch(r)})),e.on("@resume",((t,r)=>{this._awaitQueue.push((async()=>this._handler.resumeSending(e.localId)),"producer @resume event").then(t).catch(r)})),e.on("@replacetrack",((t,r,n)=>{this._awaitQueue.push((async()=>this._handler.replaceTrack(e.localId,t)),"producer @replacetrack event").then(r).catch(n)})),e.on("@setmaxspatiallayer",((t,r,n)=>{this._awaitQueue.push((async()=>this._handler.setMaxSpatialLayer(e.localId,t)),"producer @setmaxspatiallayer event").then(r).catch(n)})),e.on("@setrtpencodingparameters",((t,r,n)=>{this._awaitQueue.push((async()=>this._handler.setRtpEncodingParameters(e.localId,t)),"producer @setrtpencodingparameters event").then(r).catch(n)})),e.on("@getstats",((t,r)=>{if(this._closed)return r(new d.InvalidStateError("closed"));this._handler.getSenderStats(e.localId).then(t).catch(r)}))}handleConsumer(e){e.on("@close",(()=>{this._consumers.delete(e.id),this._pendingPauseConsumers.delete(e.id),this._pendingResumeConsumers.delete(e.id),this._closed||(this._pendingCloseConsumers.set(e.id,e),!1===this._consumerCloseInProgress&&this.closePendingConsumers())})),e.on("@pause",(()=>{this._pendingResumeConsumers.has(e.id)&&this._pendingResumeConsumers.delete(e.id),this._pendingPauseConsumers.set(e.id,e),(0,l.default)((()=>{this._closed||!1===this._consumerPauseInProgress&&this.pausePendingConsumers()}))})),e.on("@resume",(()=>{this._pendingPauseConsumers.has(e.id)&&this._pendingPauseConsumers.delete(e.id),this._pendingResumeConsumers.set(e.id,e),(0,l.default)((()=>{this._closed||!1===this._consumerResumeInProgress&&this.resumePendingConsumers()}))})),e.on("@getstats",((t,r)=>{if(this._closed)return r(new d.InvalidStateError("closed"));this._handler.getReceiverStats(e.localId).then(t).catch(r)}))}handleDataProducer(e){e.on("@close",(()=>{this._dataProducers.delete(e.id)}))}handleDataConsumer(e){e.on("@close",(()=>{this._dataConsumers.delete(e.id)}))}}t.Transport=_},34893:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InvalidStateError=t.UnsupportedError=void 0;class r extends Error{constructor(e){super(e),this.name="UnsupportedError",Error.hasOwnProperty("captureStackTrace")?Error.captureStackTrace(this,r):this.stack=new Error(e).stack}}t.UnsupportedError=r;class n extends Error{constructor(e){super(e),this.name="InvalidStateError",Error.hasOwnProperty("captureStackTrace")?Error.captureStackTrace(this,n):this.stack=new Error(e).stack}}t.InvalidStateError=n},62183:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.Chrome111=void 0;const a=o(r(17363)),s=r(82994),l=o(r(31765)),c=o(r(38046)),u=o(r(75544)),d=o(r(5938)),h=o(r(34256)),p=r(2902),f=r(41305),m=r(43303),g=new s.Logger("Chrome111"),v={OS:1024,MIS:1024};class y extends p.HandlerInterface{static createFactory(){return()=>new y}constructor(){super(),this._mapMidTransceiver=new Map,this._sendStream=new MediaStream,this._hasDataChannelMediaSection=!1,this._nextSendSctpStreamId=0,this._transportReady=!1}get name(){return"Chrome111"}close(){if(g.debug("close()"),this._pc)try{this._pc.close()}catch(e){}this.emit("@close")}async getNativeRtpCapabilities(){g.debug("getNativeRtpCapabilities()");const e=new RTCPeerConnection({iceServers:[],iceTransportPolicy:"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require",sdpSemantics:"unified-plan"});try{e.addTransceiver("audio"),e.addTransceiver("video");const t=await e.createOffer();try{e.close()}catch(e){}const r=a.parse(t.sdp),n=u.extractRtpCapabilities({sdpObject:r});return h.addNackSuppportForOpus(n),n}catch(t){try{e.close()}catch(e){}throw t}}async getNativeSctpCapabilities(){return g.debug("getNativeSctpCapabilities()"),{numStreams:v}}run({direction:e,iceParameters:t,iceCandidates:r,dtlsParameters:n,sctpParameters:i,iceServers:o,iceTransportPolicy:a,additionalSettings:s,proprietaryConstraints:l,extendedRtpCapabilities:u}){g.debug("run()"),this._direction=e,this._remoteSdp=new f.RemoteSdp({iceParameters:t,iceCandidates:r,dtlsParameters:n,sctpParameters:i}),this._sendingRtpParametersByKind={audio:c.getSendingRtpParameters("audio",u),video:c.getSendingRtpParameters("video",u)},this._sendingRemoteRtpParametersByKind={audio:c.getSendingRemoteRtpParameters("audio",u),video:c.getSendingRemoteRtpParameters("video",u)},n.role&&"auto"!==n.role&&(this._forcedLocalDtlsRole="server"===n.role?"client":"server"),this._pc=new RTCPeerConnection({iceServers:o||[],iceTransportPolicy:a||"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require",sdpSemantics:"unified-plan",...s},l),this._pc.connectionState?this._pc.addEventListener("connectionstatechange",(()=>{this.emit("@connectionstatechange",this._pc.connectionState)})):(g.warn("run() | pc.connectionState not supported, using pc.iceConnectionState"),this._pc.addEventListener("iceconnectionstatechange",(()=>{switch(this._pc.iceConnectionState){case"checking":this.emit("@connectionstatechange","connecting");break;case"connected":case"completed":this.emit("@connectionstatechange","connected");break;case"failed":this.emit("@connectionstatechange","failed");break;case"disconnected":this.emit("@connectionstatechange","disconnected");break;case"closed":this.emit("@connectionstatechange","closed")}})))}async updateIceServers(e){g.debug("updateIceServers()");const t=this._pc.getConfiguration();t.iceServers=e,this._pc.setConfiguration(t)}async restartIce(e){if(g.debug("restartIce()"),this._remoteSdp.updateIceParameters(e),this._transportReady)if("send"===this._direction){const e=await this._pc.createOffer({iceRestart:!0});g.debug("restartIce() | calling pc.setLocalDescription() [offer:%o]",e),await this._pc.setLocalDescription(e);const t={type:"answer",sdp:this._remoteSdp.getSdp()};g.debug("restartIce() | calling pc.setRemoteDescription() [answer:%o]",t),await this._pc.setRemoteDescription(t)}else{const e={type:"offer",sdp:this._remoteSdp.getSdp()};g.debug("restartIce() | calling pc.setRemoteDescription() [offer:%o]",e),await this._pc.setRemoteDescription(e);const t=await this._pc.createAnswer();g.debug("restartIce() | calling pc.setLocalDescription() [answer:%o]",t),await this._pc.setLocalDescription(t)}}async getTransportStats(){return this._pc.getStats()}async send({track:e,encodings:t,codecOptions:r,codec:n}){var i;if(this.assertSendDirection(),g.debug("send() [kind:%s, track.id:%s]",e.kind,e.id),t&&t.length>1){t.forEach(((e,t)=>{e.rid=`r${t}`}));let e=1,r=1;for(const e of t){const t=e.scalabilityMode?(0,m.parse)(e.scalabilityMode).temporalLayers:3;t>r&&(r=t)}for(const n of t)n.rid="r"+e++,n.scalabilityMode=`L1T${r}`}const o=l.clone(this._sendingRtpParametersByKind[e.kind],{});o.codecs=c.reduceCodecs(o.codecs,n);const s=l.clone(this._sendingRemoteRtpParametersByKind[e.kind],{});s.codecs=c.reduceCodecs(s.codecs,n);const h=this._remoteSdp.getNextMediaSectionIdx(),p=this._pc.addTransceiver(e,{direction:"sendonly",streams:[this._sendStream],sendEncodings:t}),f=await this._pc.createOffer();let v=a.parse(f.sdp);this._transportReady||await this.setupTransport({localDtlsRole:null!==(i=this._forcedLocalDtlsRole)&&void 0!==i?i:"client",localSdpObject:v}),g.debug("send() | calling pc.setLocalDescription() [offer:%o]",f),await this._pc.setLocalDescription(f);const y=p.mid;o.mid=y,v=a.parse(this._pc.localDescription.sdp);const b=v.media[h.idx];if(o.rtcp.cname=u.getCname({offerMediaObject:b}),t)if(1===t.length){const e=d.getRtpEncodings({offerMediaObject:b});Object.assign(e[0],t[0]),o.encodings=e}else o.encodings=t;else o.encodings=d.getRtpEncodings({offerMediaObject:b});this._remoteSdp.send({offerMediaObject:b,reuseMid:h.reuseMid,offerRtpParameters:o,answerRtpParameters:s,codecOptions:r,extmapAllowMixed:!0});const _={type:"answer",sdp:this._remoteSdp.getSdp()};return g.debug("send() | calling pc.setRemoteDescription() [answer:%o]",_),await this._pc.setRemoteDescription(_),this._mapMidTransceiver.set(y,p),{localId:y,rtpParameters:o,rtpSender:p.sender}}async stopSending(e){this.assertSendDirection(),g.debug("stopSending() [localId:%s]",e);const t=this._mapMidTransceiver.get(e);if(!t)throw new Error("associated RTCRtpTransceiver not found");if(t.sender.replaceTrack(null),this._pc.removeTrack(t.sender),this._remoteSdp.closeMediaSection(t.mid))try{t.stop()}catch(e){}const r=await this._pc.createOffer();g.debug("stopSending() | calling pc.setLocalDescription() [offer:%o]",r),await this._pc.setLocalDescription(r);const n={type:"answer",sdp:this._remoteSdp.getSdp()};g.debug("stopSending() | calling pc.setRemoteDescription() [answer:%o]",n),await this._pc.setRemoteDescription(n),this._mapMidTransceiver.delete(e)}async pauseSending(e){this.assertSendDirection(),g.debug("pauseSending() [localId:%s]",e);const t=this._mapMidTransceiver.get(e);if(!t)throw new Error("associated RTCRtpTransceiver not found");t.direction="inactive",this._remoteSdp.pauseMediaSection(e);const r=await this._pc.createOffer();g.debug("pauseSending() | calling pc.setLocalDescription() [offer:%o]",r),await this._pc.setLocalDescription(r);const n={type:"answer",sdp:this._remoteSdp.getSdp()};g.debug("pauseSending() | calling pc.setRemoteDescription() [answer:%o]",n),await this._pc.setRemoteDescription(n)}async resumeSending(e){this.assertSendDirection(),g.debug("resumeSending() [localId:%s]",e);const t=this._mapMidTransceiver.get(e);if(this._remoteSdp.resumeSendingMediaSection(e),!t)throw new Error("associated RTCRtpTransceiver not found");t.direction="sendonly";const r=await this._pc.createOffer();g.debug("resumeSending() | calling pc.setLocalDescription() [offer:%o]",r),await this._pc.setLocalDescription(r);const n={type:"answer",sdp:this._remoteSdp.getSdp()};g.debug("resumeSending() | calling pc.setRemoteDescription() [answer:%o]",n),await this._pc.setRemoteDescription(n)}async replaceTrack(e,t){this.assertSendDirection(),t?g.debug("replaceTrack() [localId:%s, track.id:%s]",e,t.id):g.debug("replaceTrack() [localId:%s, no track]",e);const r=this._mapMidTransceiver.get(e);if(!r)throw new Error("associated RTCRtpTransceiver not found");await r.sender.replaceTrack(t)}async setMaxSpatialLayer(e,t){this.assertSendDirection(),g.debug("setMaxSpatialLayer() [localId:%s, spatialLayer:%s]",e,t);const r=this._mapMidTransceiver.get(e);if(!r)throw new Error("associated RTCRtpTransceiver not found");const n=r.sender.getParameters();n.encodings.forEach(((e,r)=>{e.active=r<=t})),await r.sender.setParameters(n),this._remoteSdp.muxMediaSectionSimulcast(e,n.encodings);const i=await this._pc.createOffer();g.debug("setMaxSpatialLayer() | calling pc.setLocalDescription() [offer:%o]",i),await this._pc.setLocalDescription(i);const o={type:"answer",sdp:this._remoteSdp.getSdp()};g.debug("setMaxSpatialLayer() | calling pc.setRemoteDescription() [answer:%o]",o),await this._pc.setRemoteDescription(o)}async setRtpEncodingParameters(e,t){this.assertSendDirection(),g.debug("setRtpEncodingParameters() [localId:%s, params:%o]",e,t);const r=this._mapMidTransceiver.get(e);if(!r)throw new Error("associated RTCRtpTransceiver not found");const n=r.sender.getParameters();n.encodings.forEach(((e,r)=>{n.encodings[r]={...e,...t}})),await r.sender.setParameters(n),this._remoteSdp.muxMediaSectionSimulcast(e,n.encodings);const i=await this._pc.createOffer();g.debug("setRtpEncodingParameters() | calling pc.setLocalDescription() [offer:%o]",i),await this._pc.setLocalDescription(i);const o={type:"answer",sdp:this._remoteSdp.getSdp()};g.debug("setRtpEncodingParameters() | calling pc.setRemoteDescription() [answer:%o]",o),await this._pc.setRemoteDescription(o)}async getSenderStats(e){this.assertSendDirection();const t=this._mapMidTransceiver.get(e);if(!t)throw new Error("associated RTCRtpTransceiver not found");return t.sender.getStats()}async sendDataChannel({ordered:e,maxPacketLifeTime:t,maxRetransmits:r,label:n,protocol:i}){var o;this.assertSendDirection();const s={negotiated:!0,id:this._nextSendSctpStreamId,ordered:e,maxPacketLifeTime:t,maxRetransmits:r,protocol:i};g.debug("sendDataChannel() [options:%o]",s);const l=this._pc.createDataChannel(n,s);if(this._nextSendSctpStreamId=++this._nextSendSctpStreamId%v.MIS,!this._hasDataChannelMediaSection){const e=await this._pc.createOffer(),t=a.parse(e.sdp),r=t.media.find((e=>"application"===e.type));this._transportReady||await this.setupTransport({localDtlsRole:null!==(o=this._forcedLocalDtlsRole)&&void 0!==o?o:"client",localSdpObject:t}),g.debug("sendDataChannel() | calling pc.setLocalDescription() [offer:%o]",e),await this._pc.setLocalDescription(e),this._remoteSdp.sendSctpAssociation({offerMediaObject:r});const n={type:"answer",sdp:this._remoteSdp.getSdp()};g.debug("sendDataChannel() | calling pc.setRemoteDescription() [answer:%o]",n),await this._pc.setRemoteDescription(n),this._hasDataChannelMediaSection=!0}return{dataChannel:l,sctpStreamParameters:{streamId:s.id,ordered:s.ordered,maxPacketLifeTime:s.maxPacketLifeTime,maxRetransmits:s.maxRetransmits}}}async receive(e){var t;this.assertRecvDirection();const r=[],n=new Map;for(const t of e){const{trackId:e,kind:r,rtpParameters:i,streamId:o}=t;g.debug("receive() [trackId:%s, kind:%s]",e,r);const a=i.mid||String(this._mapMidTransceiver.size);n.set(e,a),this._remoteSdp.receive({mid:a,kind:r,offerRtpParameters:i,streamId:o||i.rtcp.cname,trackId:e})}const i={type:"offer",sdp:this._remoteSdp.getSdp()};g.debug("receive() | calling pc.setRemoteDescription() [offer:%o]",i),await this._pc.setRemoteDescription(i);let o=await this._pc.createAnswer();const s=a.parse(o.sdp);for(const t of e){const{trackId:e,rtpParameters:r}=t,i=n.get(e),o=s.media.find((e=>String(e.mid)===i));u.applyCodecParameters({offerRtpParameters:r,answerMediaObject:o})}o={type:"answer",sdp:a.write(s)},this._transportReady||await this.setupTransport({localDtlsRole:null!==(t=this._forcedLocalDtlsRole)&&void 0!==t?t:"client",localSdpObject:s}),g.debug("receive() | calling pc.setLocalDescription() [answer:%o]",o),await this._pc.setLocalDescription(o);for(const t of e){const{trackId:e}=t,i=n.get(e),o=this._pc.getTransceivers().find((e=>e.mid===i));if(!o)throw new Error("new RTCRtpTransceiver not found");this._mapMidTransceiver.set(i,o),r.push({localId:i,track:o.receiver.track,rtpReceiver:o.receiver})}return r}async stopReceiving(e){this.assertRecvDirection();for(const t of e){g.debug("stopReceiving() [localId:%s]",t);const e=this._mapMidTransceiver.get(t);if(!e)throw new Error("associated RTCRtpTransceiver not found");this._remoteSdp.closeMediaSection(e.mid)}const t={type:"offer",sdp:this._remoteSdp.getSdp()};g.debug("stopReceiving() | calling pc.setRemoteDescription() [offer:%o]",t),await this._pc.setRemoteDescription(t);const r=await this._pc.createAnswer();g.debug("stopReceiving() | calling pc.setLocalDescription() [answer:%o]",r),await this._pc.setLocalDescription(r);for(const t of e)this._mapMidTransceiver.delete(t)}async pauseReceiving(e){this.assertRecvDirection();for(const t of e){g.debug("pauseReceiving() [localId:%s]",t);const e=this._mapMidTransceiver.get(t);if(!e)throw new Error("associated RTCRtpTransceiver not found");e.direction="inactive",this._remoteSdp.pauseMediaSection(t)}const t={type:"offer",sdp:this._remoteSdp.getSdp()};g.debug("pauseReceiving() | calling pc.setRemoteDescription() [offer:%o]",t),await this._pc.setRemoteDescription(t);const r=await this._pc.createAnswer();g.debug("pauseReceiving() | calling pc.setLocalDescription() [answer:%o]",r),await this._pc.setLocalDescription(r)}async resumeReceiving(e){this.assertRecvDirection();for(const t of e){g.debug("resumeReceiving() [localId:%s]",t);const e=this._mapMidTransceiver.get(t);if(!e)throw new Error("associated RTCRtpTransceiver not found");e.direction="recvonly",this._remoteSdp.resumeReceivingMediaSection(t)}const t={type:"offer",sdp:this._remoteSdp.getSdp()};g.debug("resumeReceiving() | calling pc.setRemoteDescription() [offer:%o]",t),await this._pc.setRemoteDescription(t);const r=await this._pc.createAnswer();g.debug("resumeReceiving() | calling pc.setLocalDescription() [answer:%o]",r),await this._pc.setLocalDescription(r)}async getReceiverStats(e){this.assertRecvDirection();const t=this._mapMidTransceiver.get(e);if(!t)throw new Error("associated RTCRtpTransceiver not found");return t.receiver.getStats()}async receiveDataChannel({sctpStreamParameters:e,label:t,protocol:r}){var n;this.assertRecvDirection();const{streamId:i,ordered:o,maxPacketLifeTime:s,maxRetransmits:l}=e,c={negotiated:!0,id:i,ordered:o,maxPacketLifeTime:s,maxRetransmits:l,protocol:r};g.debug("receiveDataChannel() [options:%o]",c);const u=this._pc.createDataChannel(t,c);if(!this._hasDataChannelMediaSection){this._remoteSdp.receiveSctpAssociation();const e={type:"offer",sdp:this._remoteSdp.getSdp()};g.debug("receiveDataChannel() | calling pc.setRemoteDescription() [offer:%o]",e),await this._pc.setRemoteDescription(e);const t=await this._pc.createAnswer();if(!this._transportReady){const e=a.parse(t.sdp);await this.setupTransport({localDtlsRole:null!==(n=this._forcedLocalDtlsRole)&&void 0!==n?n:"client",localSdpObject:e})}g.debug("receiveDataChannel() | calling pc.setRemoteDescription() [answer:%o]",t),await this._pc.setLocalDescription(t),this._hasDataChannelMediaSection=!0}return{dataChannel:u}}async setupTransport({localDtlsRole:e,localSdpObject:t}){t||(t=a.parse(this._pc.localDescription.sdp));const r=u.extractDtlsParameters({sdpObject:t});r.role=e,this._remoteSdp.updateDtlsRole("client"===e?"server":"client"),await new Promise(((e,t)=>{this.safeEmit("@connect",{dtlsParameters:r},e,t)})),this._transportReady=!0}assertSendDirection(){if("send"!==this._direction)throw new Error('method can just be called for handlers with "send" direction')}assertRecvDirection(){if("recv"!==this._direction)throw new Error('method can just be called for handlers with "recv" direction')}}t.Chrome111=y},47402:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.Chrome55=void 0;const a=o(r(17363)),s=r(82994),l=r(34893),c=o(r(31765)),u=o(r(38046)),d=o(r(75544)),h=o(r(54496)),p=r(2902),f=r(41305),m=new s.Logger("Chrome55"),g={OS:1024,MIS:1024};class v extends p.HandlerInterface{static createFactory(){return()=>new v}constructor(){super(),this._sendStream=new MediaStream,this._mapSendLocalIdTrack=new Map,this._nextSendLocalId=0,this._mapRecvLocalIdInfo=new Map,this._hasDataChannelMediaSection=!1,this._nextSendSctpStreamId=0,this._transportReady=!1}get name(){return"Chrome55"}close(){if(m.debug("close()"),this._pc)try{this._pc.close()}catch(e){}this.emit("@close")}async getNativeRtpCapabilities(){m.debug("getNativeRtpCapabilities()");const e=new RTCPeerConnection({iceServers:[],iceTransportPolicy:"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require",sdpSemantics:"plan-b"});try{const t=await e.createOffer({offerToReceiveAudio:!0,offerToReceiveVideo:!0});try{e.close()}catch(e){}const r=a.parse(t.sdp);return d.extractRtpCapabilities({sdpObject:r})}catch(t){try{e.close()}catch(e){}throw t}}async getNativeSctpCapabilities(){return m.debug("getNativeSctpCapabilities()"),{numStreams:g}}run({direction:e,iceParameters:t,iceCandidates:r,dtlsParameters:n,sctpParameters:i,iceServers:o,iceTransportPolicy:a,additionalSettings:s,proprietaryConstraints:l,extendedRtpCapabilities:c}){m.debug("run()"),this._direction=e,this._remoteSdp=new f.RemoteSdp({iceParameters:t,iceCandidates:r,dtlsParameters:n,sctpParameters:i,planB:!0}),this._sendingRtpParametersByKind={audio:u.getSendingRtpParameters("audio",c),video:u.getSendingRtpParameters("video",c)},this._sendingRemoteRtpParametersByKind={audio:u.getSendingRemoteRtpParameters("audio",c),video:u.getSendingRemoteRtpParameters("video",c)},n.role&&"auto"!==n.role&&(this._forcedLocalDtlsRole="server"===n.role?"client":"server"),this._pc=new RTCPeerConnection({iceServers:o||[],iceTransportPolicy:a||"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require",sdpSemantics:"plan-b",...s},l),this._pc.connectionState?this._pc.addEventListener("connectionstatechange",(()=>{this.emit("@connectionstatechange",this._pc.connectionState)})):this._pc.addEventListener("iceconnectionstatechange",(()=>{switch(m.warn("run() | pc.connectionState not supported, using pc.iceConnectionState"),this._pc.iceConnectionState){case"checking":this.emit("@connectionstatechange","connecting");break;case"connected":case"completed":this.emit("@connectionstatechange","connected");break;case"failed":this.emit("@connectionstatechange","failed");break;case"disconnected":this.emit("@connectionstatechange","disconnected");break;case"closed":this.emit("@connectionstatechange","closed")}}))}async updateIceServers(e){m.debug("updateIceServers()");const t=this._pc.getConfiguration();t.iceServers=e,this._pc.setConfiguration(t)}async restartIce(e){if(m.debug("restartIce()"),this._remoteSdp.updateIceParameters(e),this._transportReady)if("send"===this._direction){const e=await this._pc.createOffer({iceRestart:!0});m.debug("restartIce() | calling pc.setLocalDescription() [offer:%o]",e),await this._pc.setLocalDescription(e);const t={type:"answer",sdp:this._remoteSdp.getSdp()};m.debug("restartIce() | calling pc.setRemoteDescription() [answer:%o]",t),await this._pc.setRemoteDescription(t)}else{const e={type:"offer",sdp:this._remoteSdp.getSdp()};m.debug("restartIce() | calling pc.setRemoteDescription() [offer:%o]",e),await this._pc.setRemoteDescription(e);const t=await this._pc.createAnswer();m.debug("restartIce() | calling pc.setLocalDescription() [answer:%o]",t),await this._pc.setLocalDescription(t)}}async getTransportStats(){return this._pc.getStats()}async send({track:e,encodings:t,codecOptions:r,codec:n}){var i;this.assertSendDirection(),m.debug("send() [kind:%s, track.id:%s]",e.kind,e.id),n&&m.warn("send() | codec selection is not available in %s handler",this.name),this._sendStream.addTrack(e),this._pc.addStream(this._sendStream);let o,s=await this._pc.createOffer(),l=a.parse(s.sdp);const p=c.clone(this._sendingRtpParametersByKind[e.kind],{});p.codecs=u.reduceCodecs(p.codecs);const f=c.clone(this._sendingRemoteRtpParametersByKind[e.kind],{});if(f.codecs=u.reduceCodecs(f.codecs),this._transportReady||await this.setupTransport({localDtlsRole:null!==(i=this._forcedLocalDtlsRole)&&void 0!==i?i:"client",localSdpObject:l}),"video"===e.kind&&t&&t.length>1&&(m.debug("send() | enabling simulcast"),l=a.parse(s.sdp),o=l.media.find((e=>"video"===e.type)),h.addLegacySimulcast({offerMediaObject:o,track:e,numStreams:t.length}),s={type:"offer",sdp:a.write(l)}),m.debug("send() | calling pc.setLocalDescription() [offer:%o]",s),await this._pc.setLocalDescription(s),l=a.parse(this._pc.localDescription.sdp),o=l.media.find((t=>t.type===e.kind)),p.rtcp.cname=d.getCname({offerMediaObject:o}),p.encodings=h.getRtpEncodings({offerMediaObject:o,track:e}),t)for(let e=0;e1&&"video/vp8"===p.codecs[0].mimeType.toLowerCase())for(const e of p.encodings)e.scalabilityMode="L1T3";this._remoteSdp.send({offerMediaObject:o,offerRtpParameters:p,answerRtpParameters:f,codecOptions:r});const g={type:"answer",sdp:this._remoteSdp.getSdp()};m.debug("send() | calling pc.setRemoteDescription() [answer:%o]",g),await this._pc.setRemoteDescription(g);const v=String(this._nextSendLocalId);return this._nextSendLocalId++,this._mapSendLocalIdTrack.set(v,e),{localId:v,rtpParameters:p}}async stopSending(e){this.assertSendDirection(),m.debug("stopSending() [localId:%s]",e);const t=this._mapSendLocalIdTrack.get(e);if(!t)throw new Error("track not found");this._mapSendLocalIdTrack.delete(e),this._sendStream.removeTrack(t),this._pc.addStream(this._sendStream);const r=await this._pc.createOffer();m.debug("stopSending() | calling pc.setLocalDescription() [offer:%o]",r);try{await this._pc.setLocalDescription(r)}catch(e){if(0===this._sendStream.getTracks().length)return void m.warn("stopSending() | ignoring expected error due no sending tracks: %s",e.toString());throw e}if("stable"===this._pc.signalingState)return;const n={type:"answer",sdp:this._remoteSdp.getSdp()};m.debug("stopSending() | calling pc.setRemoteDescription() [answer:%o]",n),await this._pc.setRemoteDescription(n)}async pauseSending(e){}async resumeSending(e){}async replaceTrack(e,t){throw new l.UnsupportedError("not implemented")}async setMaxSpatialLayer(e,t){throw new l.UnsupportedError(" not implemented")}async setRtpEncodingParameters(e,t){throw new l.UnsupportedError("not supported")}async getSenderStats(e){throw new l.UnsupportedError("not implemented")}async sendDataChannel({ordered:e,maxPacketLifeTime:t,maxRetransmits:r,label:n,protocol:i}){var o;this.assertSendDirection();const s={negotiated:!0,id:this._nextSendSctpStreamId,ordered:e,maxPacketLifeTime:t,maxRetransmitTime:t,maxRetransmits:r,protocol:i};m.debug("sendDataChannel() [options:%o]",s);const l=this._pc.createDataChannel(n,s);if(this._nextSendSctpStreamId=++this._nextSendSctpStreamId%g.MIS,!this._hasDataChannelMediaSection){const e=await this._pc.createOffer(),t=a.parse(e.sdp),r=t.media.find((e=>"application"===e.type));this._transportReady||await this.setupTransport({localDtlsRole:null!==(o=this._forcedLocalDtlsRole)&&void 0!==o?o:"client",localSdpObject:t}),m.debug("sendDataChannel() | calling pc.setLocalDescription() [offer:%o]",e),await this._pc.setLocalDescription(e),this._remoteSdp.sendSctpAssociation({offerMediaObject:r});const n={type:"answer",sdp:this._remoteSdp.getSdp()};m.debug("sendDataChannel() | calling pc.setRemoteDescription() [answer:%o]",n),await this._pc.setRemoteDescription(n),this._hasDataChannelMediaSection=!0}return{dataChannel:l,sctpStreamParameters:{streamId:s.id,ordered:s.ordered,maxPacketLifeTime:s.maxPacketLifeTime,maxRetransmits:s.maxRetransmits}}}async receive(e){var t;this.assertRecvDirection();const r=[];for(const t of e){const{trackId:e,kind:r,rtpParameters:n,streamId:i}=t;m.debug("receive() [trackId:%s, kind:%s]",e,r);const o=r;this._remoteSdp.receive({mid:o,kind:r,offerRtpParameters:n,streamId:i||n.rtcp.cname,trackId:e})}const n={type:"offer",sdp:this._remoteSdp.getSdp()};m.debug("receive() | calling pc.setRemoteDescription() [offer:%o]",n),await this._pc.setRemoteDescription(n);let i=await this._pc.createAnswer();const o=a.parse(i.sdp);for(const t of e){const{kind:e,rtpParameters:r}=t,n=e,i=o.media.find((e=>String(e.mid)===n));d.applyCodecParameters({offerRtpParameters:r,answerMediaObject:i})}i={type:"answer",sdp:a.write(o)},this._transportReady||await this.setupTransport({localDtlsRole:null!==(t=this._forcedLocalDtlsRole)&&void 0!==t?t:"client",localSdpObject:o}),m.debug("receive() | calling pc.setLocalDescription() [answer:%o]",i),await this._pc.setLocalDescription(i);for(const t of e){const{kind:e,trackId:n,rtpParameters:i}=t,o=e,a=n,s=t.streamId||i.rtcp.cname,l=this._pc.getRemoteStreams().find((e=>e.id===s)).getTrackById(a);if(!l)throw new Error("remote track not found");this._mapRecvLocalIdInfo.set(a,{mid:o,rtpParameters:i}),r.push({localId:a,track:l})}return r}async stopReceiving(e){this.assertRecvDirection();for(const t of e){m.debug("stopReceiving() [localId:%s]",t);const{mid:e,rtpParameters:r}=this._mapRecvLocalIdInfo.get(t)||{};this._mapRecvLocalIdInfo.delete(t),this._remoteSdp.planBStopReceiving({mid:e,offerRtpParameters:r})}const t={type:"offer",sdp:this._remoteSdp.getSdp()};m.debug("stopReceiving() | calling pc.setRemoteDescription() [offer:%o]",t),await this._pc.setRemoteDescription(t);const r=await this._pc.createAnswer();m.debug("stopReceiving() | calling pc.setLocalDescription() [answer:%o]",r),await this._pc.setLocalDescription(r)}async pauseReceiving(e){}async resumeReceiving(e){}async getReceiverStats(e){throw new l.UnsupportedError("not implemented")}async receiveDataChannel({sctpStreamParameters:e,label:t,protocol:r}){var n;this.assertRecvDirection();const{streamId:i,ordered:o,maxPacketLifeTime:s,maxRetransmits:l}=e,c={negotiated:!0,id:i,ordered:o,maxPacketLifeTime:s,maxRetransmitTime:s,maxRetransmits:l,protocol:r};m.debug("receiveDataChannel() [options:%o]",c);const u=this._pc.createDataChannel(t,c);if(!this._hasDataChannelMediaSection){this._remoteSdp.receiveSctpAssociation({oldDataChannelSpec:!0});const e={type:"offer",sdp:this._remoteSdp.getSdp()};m.debug("receiveDataChannel() | calling pc.setRemoteDescription() [offer:%o]",e),await this._pc.setRemoteDescription(e);const t=await this._pc.createAnswer();if(!this._transportReady){const e=a.parse(t.sdp);await this.setupTransport({localDtlsRole:null!==(n=this._forcedLocalDtlsRole)&&void 0!==n?n:"client",localSdpObject:e})}m.debug("receiveDataChannel() | calling pc.setRemoteDescription() [answer:%o]",t),await this._pc.setLocalDescription(t),this._hasDataChannelMediaSection=!0}return{dataChannel:u}}async setupTransport({localDtlsRole:e,localSdpObject:t}){t||(t=a.parse(this._pc.localDescription.sdp));const r=d.extractDtlsParameters({sdpObject:t});r.role=e,this._remoteSdp.updateDtlsRole("client"===e?"server":"client"),await new Promise(((e,t)=>{this.safeEmit("@connect",{dtlsParameters:r},e,t)})),this._transportReady=!0}assertSendDirection(){if("send"!==this._direction)throw new Error('method can just be called for handlers with "send" direction')}assertRecvDirection(){if("recv"!==this._direction)throw new Error('method can just be called for handlers with "recv" direction')}}t.Chrome55=v},78155:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.Chrome67=void 0;const a=o(r(17363)),s=r(82994),l=o(r(31765)),c=o(r(38046)),u=o(r(75544)),d=o(r(54496)),h=r(2902),p=r(41305),f=new s.Logger("Chrome67"),m={OS:1024,MIS:1024};class g extends h.HandlerInterface{static createFactory(){return()=>new g}constructor(){super(),this._sendStream=new MediaStream,this._mapSendLocalIdRtpSender=new Map,this._nextSendLocalId=0,this._mapRecvLocalIdInfo=new Map,this._hasDataChannelMediaSection=!1,this._nextSendSctpStreamId=0,this._transportReady=!1}get name(){return"Chrome67"}close(){if(f.debug("close()"),this._pc)try{this._pc.close()}catch(e){}this.emit("@close")}async getNativeRtpCapabilities(){f.debug("getNativeRtpCapabilities()");const e=new RTCPeerConnection({iceServers:[],iceTransportPolicy:"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require",sdpSemantics:"plan-b"});try{const t=await e.createOffer({offerToReceiveAudio:!0,offerToReceiveVideo:!0});try{e.close()}catch(e){}const r=a.parse(t.sdp);return u.extractRtpCapabilities({sdpObject:r})}catch(t){try{e.close()}catch(e){}throw t}}async getNativeSctpCapabilities(){return f.debug("getNativeSctpCapabilities()"),{numStreams:m}}run({direction:e,iceParameters:t,iceCandidates:r,dtlsParameters:n,sctpParameters:i,iceServers:o,iceTransportPolicy:a,additionalSettings:s,proprietaryConstraints:l,extendedRtpCapabilities:u}){f.debug("run()"),this._direction=e,this._remoteSdp=new p.RemoteSdp({iceParameters:t,iceCandidates:r,dtlsParameters:n,sctpParameters:i,planB:!0}),this._sendingRtpParametersByKind={audio:c.getSendingRtpParameters("audio",u),video:c.getSendingRtpParameters("video",u)},this._sendingRemoteRtpParametersByKind={audio:c.getSendingRemoteRtpParameters("audio",u),video:c.getSendingRemoteRtpParameters("video",u)},n.role&&"auto"!==n.role&&(this._forcedLocalDtlsRole="server"===n.role?"client":"server"),this._pc=new RTCPeerConnection({iceServers:o||[],iceTransportPolicy:a||"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require",sdpSemantics:"plan-b",...s},l),this._pc.connectionState?this._pc.addEventListener("connectionstatechange",(()=>{this.emit("@connectionstatechange",this._pc.connectionState)})):this._pc.addEventListener("iceconnectionstatechange",(()=>{switch(f.warn("run() | pc.connectionState not supported, using pc.iceConnectionState"),this._pc.iceConnectionState){case"checking":this.emit("@connectionstatechange","connecting");break;case"connected":case"completed":this.emit("@connectionstatechange","connected");break;case"failed":this.emit("@connectionstatechange","failed");break;case"disconnected":this.emit("@connectionstatechange","disconnected");break;case"closed":this.emit("@connectionstatechange","closed")}}))}async updateIceServers(e){f.debug("updateIceServers()");const t=this._pc.getConfiguration();t.iceServers=e,this._pc.setConfiguration(t)}async restartIce(e){if(f.debug("restartIce()"),this._remoteSdp.updateIceParameters(e),this._transportReady)if("send"===this._direction){const e=await this._pc.createOffer({iceRestart:!0});f.debug("restartIce() | calling pc.setLocalDescription() [offer:%o]",e),await this._pc.setLocalDescription(e);const t={type:"answer",sdp:this._remoteSdp.getSdp()};f.debug("restartIce() | calling pc.setRemoteDescription() [answer:%o]",t),await this._pc.setRemoteDescription(t)}else{const e={type:"offer",sdp:this._remoteSdp.getSdp()};f.debug("restartIce() | calling pc.setRemoteDescription() [offer:%o]",e),await this._pc.setRemoteDescription(e);const t=await this._pc.createAnswer();f.debug("restartIce() | calling pc.setLocalDescription() [answer:%o]",t),await this._pc.setLocalDescription(t)}}async getTransportStats(){return this._pc.getStats()}async send({track:e,encodings:t,codecOptions:r,codec:n}){var i;this.assertSendDirection(),f.debug("send() [kind:%s, track.id:%s]",e.kind,e.id),n&&f.warn("send() | codec selection is not available in %s handler",this.name),this._sendStream.addTrack(e),this._pc.addTrack(e,this._sendStream);let o,s=await this._pc.createOffer(),h=a.parse(s.sdp);const p=l.clone(this._sendingRtpParametersByKind[e.kind],{});p.codecs=c.reduceCodecs(p.codecs);const m=l.clone(this._sendingRemoteRtpParametersByKind[e.kind],{});if(m.codecs=c.reduceCodecs(m.codecs),this._transportReady||await this.setupTransport({localDtlsRole:null!==(i=this._forcedLocalDtlsRole)&&void 0!==i?i:"client",localSdpObject:h}),"video"===e.kind&&t&&t.length>1&&(f.debug("send() | enabling simulcast"),h=a.parse(s.sdp),o=h.media.find((e=>"video"===e.type)),d.addLegacySimulcast({offerMediaObject:o,track:e,numStreams:t.length}),s={type:"offer",sdp:a.write(h)}),f.debug("send() | calling pc.setLocalDescription() [offer:%o]",s),await this._pc.setLocalDescription(s),h=a.parse(this._pc.localDescription.sdp),o=h.media.find((t=>t.type===e.kind)),p.rtcp.cname=u.getCname({offerMediaObject:o}),p.encodings=d.getRtpEncodings({offerMediaObject:o,track:e}),t)for(let e=0;e1&&"video/vp8"===p.codecs[0].mimeType.toLowerCase())for(const e of p.encodings)e.scalabilityMode="L1T3";this._remoteSdp.send({offerMediaObject:o,offerRtpParameters:p,answerRtpParameters:m,codecOptions:r});const g={type:"answer",sdp:this._remoteSdp.getSdp()};f.debug("send() | calling pc.setRemoteDescription() [answer:%o]",g),await this._pc.setRemoteDescription(g);const v=String(this._nextSendLocalId);this._nextSendLocalId++;const y=this._pc.getSenders().find((t=>t.track===e));return this._mapSendLocalIdRtpSender.set(v,y),{localId:v,rtpParameters:p,rtpSender:y}}async stopSending(e){this.assertSendDirection(),f.debug("stopSending() [localId:%s]",e);const t=this._mapSendLocalIdRtpSender.get(e);if(!t)throw new Error("associated RTCRtpSender not found");this._pc.removeTrack(t),t.track&&this._sendStream.removeTrack(t.track),this._mapSendLocalIdRtpSender.delete(e);const r=await this._pc.createOffer();f.debug("stopSending() | calling pc.setLocalDescription() [offer:%o]",r);try{await this._pc.setLocalDescription(r)}catch(e){if(0===this._sendStream.getTracks().length)return void f.warn("stopSending() | ignoring expected error due no sending tracks: %s",e.toString());throw e}if("stable"===this._pc.signalingState)return;const n={type:"answer",sdp:this._remoteSdp.getSdp()};f.debug("stopSending() | calling pc.setRemoteDescription() [answer:%o]",n),await this._pc.setRemoteDescription(n)}async pauseSending(e){}async resumeSending(e){}async replaceTrack(e,t){this.assertSendDirection(),t?f.debug("replaceTrack() [localId:%s, track.id:%s]",e,t.id):f.debug("replaceTrack() [localId:%s, no track]",e);const r=this._mapSendLocalIdRtpSender.get(e);if(!r)throw new Error("associated RTCRtpSender not found");const n=r.track;await r.replaceTrack(t),n&&this._sendStream.removeTrack(n),t&&this._sendStream.addTrack(t)}async setMaxSpatialLayer(e,t){this.assertSendDirection(),f.debug("setMaxSpatialLayer() [localId:%s, spatialLayer:%s]",e,t);const r=this._mapSendLocalIdRtpSender.get(e);if(!r)throw new Error("associated RTCRtpSender not found");const n=r.getParameters();n.encodings.forEach(((e,r)=>{e.active=r<=t})),await r.setParameters(n)}async setRtpEncodingParameters(e,t){this.assertSendDirection(),f.debug("setRtpEncodingParameters() [localId:%s, params:%o]",e,t);const r=this._mapSendLocalIdRtpSender.get(e);if(!r)throw new Error("associated RTCRtpSender not found");const n=r.getParameters();n.encodings.forEach(((e,r)=>{n.encodings[r]={...e,...t}})),await r.setParameters(n)}async getSenderStats(e){this.assertSendDirection();const t=this._mapSendLocalIdRtpSender.get(e);if(!t)throw new Error("associated RTCRtpSender not found");return t.getStats()}async sendDataChannel({ordered:e,maxPacketLifeTime:t,maxRetransmits:r,label:n,protocol:i}){var o;this.assertSendDirection();const s={negotiated:!0,id:this._nextSendSctpStreamId,ordered:e,maxPacketLifeTime:t,maxRetransmitTime:t,maxRetransmits:r,protocol:i};f.debug("sendDataChannel() [options:%o]",s);const l=this._pc.createDataChannel(n,s);if(this._nextSendSctpStreamId=++this._nextSendSctpStreamId%m.MIS,!this._hasDataChannelMediaSection){const e=await this._pc.createOffer(),t=a.parse(e.sdp),r=t.media.find((e=>"application"===e.type));this._transportReady||await this.setupTransport({localDtlsRole:null!==(o=this._forcedLocalDtlsRole)&&void 0!==o?o:"client",localSdpObject:t}),f.debug("sendDataChannel() | calling pc.setLocalDescription() [offer:%o]",e),await this._pc.setLocalDescription(e),this._remoteSdp.sendSctpAssociation({offerMediaObject:r});const n={type:"answer",sdp:this._remoteSdp.getSdp()};f.debug("sendDataChannel() | calling pc.setRemoteDescription() [answer:%o]",n),await this._pc.setRemoteDescription(n),this._hasDataChannelMediaSection=!0}return{dataChannel:l,sctpStreamParameters:{streamId:s.id,ordered:s.ordered,maxPacketLifeTime:s.maxPacketLifeTime,maxRetransmits:s.maxRetransmits}}}async receive(e){var t;this.assertRecvDirection();const r=[];for(const t of e){const{trackId:e,kind:r,rtpParameters:n,streamId:i}=t;f.debug("receive() [trackId:%s, kind:%s]",e,r);const o=r;this._remoteSdp.receive({mid:o,kind:r,offerRtpParameters:n,streamId:i||n.rtcp.cname,trackId:e})}const n={type:"offer",sdp:this._remoteSdp.getSdp()};f.debug("receive() | calling pc.setRemoteDescription() [offer:%o]",n),await this._pc.setRemoteDescription(n);let i=await this._pc.createAnswer();const o=a.parse(i.sdp);for(const t of e){const{kind:e,rtpParameters:r}=t,n=e,i=o.media.find((e=>String(e.mid)===n));u.applyCodecParameters({offerRtpParameters:r,answerMediaObject:i})}i={type:"answer",sdp:a.write(o)},this._transportReady||await this.setupTransport({localDtlsRole:null!==(t=this._forcedLocalDtlsRole)&&void 0!==t?t:"client",localSdpObject:o}),f.debug("receive() | calling pc.setLocalDescription() [answer:%o]",i),await this._pc.setLocalDescription(i);for(const t of e){const{kind:e,trackId:n,rtpParameters:i}=t,o=n,a=e,s=this._pc.getReceivers().find((e=>e.track&&e.track.id===o));if(!s)throw new Error("new RTCRtpReceiver not");this._mapRecvLocalIdInfo.set(o,{mid:a,rtpParameters:i,rtpReceiver:s}),r.push({localId:o,track:s.track,rtpReceiver:s})}return r}async stopReceiving(e){this.assertRecvDirection();for(const t of e){f.debug("stopReceiving() [localId:%s]",t);const{mid:e,rtpParameters:r}=this._mapRecvLocalIdInfo.get(t)||{};this._mapRecvLocalIdInfo.delete(t),this._remoteSdp.planBStopReceiving({mid:e,offerRtpParameters:r})}const t={type:"offer",sdp:this._remoteSdp.getSdp()};f.debug("stopReceiving() | calling pc.setRemoteDescription() [offer:%o]",t),await this._pc.setRemoteDescription(t);const r=await this._pc.createAnswer();f.debug("stopReceiving() | calling pc.setLocalDescription() [answer:%o]",r),await this._pc.setLocalDescription(r)}async pauseReceiving(e){}async resumeReceiving(e){}async getReceiverStats(e){this.assertRecvDirection();const{rtpReceiver:t}=this._mapRecvLocalIdInfo.get(e)||{};if(!t)throw new Error("associated RTCRtpReceiver not found");return t.getStats()}async receiveDataChannel({sctpStreamParameters:e,label:t,protocol:r}){var n;this.assertRecvDirection();const{streamId:i,ordered:o,maxPacketLifeTime:s,maxRetransmits:l}=e,c={negotiated:!0,id:i,ordered:o,maxPacketLifeTime:s,maxRetransmitTime:s,maxRetransmits:l,protocol:r};f.debug("receiveDataChannel() [options:%o]",c);const u=this._pc.createDataChannel(t,c);if(!this._hasDataChannelMediaSection){this._remoteSdp.receiveSctpAssociation({oldDataChannelSpec:!0});const e={type:"offer",sdp:this._remoteSdp.getSdp()};f.debug("receiveDataChannel() | calling pc.setRemoteDescription() [offer:%o]",e),await this._pc.setRemoteDescription(e);const t=await this._pc.createAnswer();if(!this._transportReady){const e=a.parse(t.sdp);await this.setupTransport({localDtlsRole:null!==(n=this._forcedLocalDtlsRole)&&void 0!==n?n:"client",localSdpObject:e})}f.debug("receiveDataChannel() | calling pc.setRemoteDescription() [answer:%o]",t),await this._pc.setLocalDescription(t),this._hasDataChannelMediaSection=!0}return{dataChannel:u}}async setupTransport({localDtlsRole:e,localSdpObject:t}){t||(t=a.parse(this._pc.localDescription.sdp));const r=u.extractDtlsParameters({sdpObject:t});r.role=e,this._remoteSdp.updateDtlsRole("client"===e?"server":"client"),await new Promise(((e,t)=>{this.safeEmit("@connect",{dtlsParameters:r},e,t)})),this._transportReady=!0}assertSendDirection(){if("send"!==this._direction)throw new Error('method can just be called for handlers with "send" direction')}assertRecvDirection(){if("recv"!==this._direction)throw new Error('method can just be called for handlers with "recv" direction')}}t.Chrome67=g},85535:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.Chrome70=void 0;const a=o(r(17363)),s=r(82994),l=o(r(31765)),c=o(r(38046)),u=o(r(75544)),d=o(r(5938)),h=r(2902),p=r(41305),f=r(43303),m=new s.Logger("Chrome70"),g={OS:1024,MIS:1024};class v extends h.HandlerInterface{static createFactory(){return()=>new v}constructor(){super(),this._mapMidTransceiver=new Map,this._sendStream=new MediaStream,this._hasDataChannelMediaSection=!1,this._nextSendSctpStreamId=0,this._transportReady=!1}get name(){return"Chrome70"}close(){if(m.debug("close()"),this._pc)try{this._pc.close()}catch(e){}this.emit("@close")}async getNativeRtpCapabilities(){m.debug("getNativeRtpCapabilities()");const e=new RTCPeerConnection({iceServers:[],iceTransportPolicy:"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require",sdpSemantics:"unified-plan"});try{e.addTransceiver("audio"),e.addTransceiver("video");const t=await e.createOffer();try{e.close()}catch(e){}const r=a.parse(t.sdp);return u.extractRtpCapabilities({sdpObject:r})}catch(t){try{e.close()}catch(e){}throw t}}async getNativeSctpCapabilities(){return m.debug("getNativeSctpCapabilities()"),{numStreams:g}}run({direction:e,iceParameters:t,iceCandidates:r,dtlsParameters:n,sctpParameters:i,iceServers:o,iceTransportPolicy:a,additionalSettings:s,proprietaryConstraints:l,extendedRtpCapabilities:u}){m.debug("run()"),this._direction=e,this._remoteSdp=new p.RemoteSdp({iceParameters:t,iceCandidates:r,dtlsParameters:n,sctpParameters:i}),this._sendingRtpParametersByKind={audio:c.getSendingRtpParameters("audio",u),video:c.getSendingRtpParameters("video",u)},this._sendingRemoteRtpParametersByKind={audio:c.getSendingRemoteRtpParameters("audio",u),video:c.getSendingRemoteRtpParameters("video",u)},n.role&&"auto"!==n.role&&(this._forcedLocalDtlsRole="server"===n.role?"client":"server"),this._pc=new RTCPeerConnection({iceServers:o||[],iceTransportPolicy:a||"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require",sdpSemantics:"unified-plan",...s},l),this._pc.connectionState?this._pc.addEventListener("connectionstatechange",(()=>{this.emit("@connectionstatechange",this._pc.connectionState)})):this._pc.addEventListener("iceconnectionstatechange",(()=>{switch(m.warn("run() | pc.connectionState not supported, using pc.iceConnectionState"),this._pc.iceConnectionState){case"checking":this.emit("@connectionstatechange","connecting");break;case"connected":case"completed":this.emit("@connectionstatechange","connected");break;case"failed":this.emit("@connectionstatechange","failed");break;case"disconnected":this.emit("@connectionstatechange","disconnected");break;case"closed":this.emit("@connectionstatechange","closed")}}))}async updateIceServers(e){m.debug("updateIceServers()");const t=this._pc.getConfiguration();t.iceServers=e,this._pc.setConfiguration(t)}async restartIce(e){if(m.debug("restartIce()"),this._remoteSdp.updateIceParameters(e),this._transportReady)if("send"===this._direction){const e=await this._pc.createOffer({iceRestart:!0});m.debug("restartIce() | calling pc.setLocalDescription() [offer:%o]",e),await this._pc.setLocalDescription(e);const t={type:"answer",sdp:this._remoteSdp.getSdp()};m.debug("restartIce() | calling pc.setRemoteDescription() [answer:%o]",t),await this._pc.setRemoteDescription(t)}else{const e={type:"offer",sdp:this._remoteSdp.getSdp()};m.debug("restartIce() | calling pc.setRemoteDescription() [offer:%o]",e),await this._pc.setRemoteDescription(e);const t=await this._pc.createAnswer();m.debug("restartIce() | calling pc.setLocalDescription() [answer:%o]",t),await this._pc.setLocalDescription(t)}}async getTransportStats(){return this._pc.getStats()}async send({track:e,encodings:t,codecOptions:r,codec:n}){var i;this.assertSendDirection(),m.debug("send() [kind:%s, track.id:%s]",e.kind,e.id);const o=l.clone(this._sendingRtpParametersByKind[e.kind],{});o.codecs=c.reduceCodecs(o.codecs,n);const s=l.clone(this._sendingRemoteRtpParametersByKind[e.kind],{});s.codecs=c.reduceCodecs(s.codecs,n);const h=this._remoteSdp.getNextMediaSectionIdx(),p=this._pc.addTransceiver(e,{direction:"sendonly",streams:[this._sendStream]});let g,v=await this._pc.createOffer(),y=a.parse(v.sdp);this._transportReady||await this.setupTransport({localDtlsRole:null!==(i=this._forcedLocalDtlsRole)&&void 0!==i?i:"client",localSdpObject:y}),t&&t.length>1&&(m.debug("send() | enabling legacy simulcast"),y=a.parse(v.sdp),g=y.media[h.idx],d.addLegacySimulcast({offerMediaObject:g,numStreams:t.length}),v={type:"offer",sdp:a.write(y)});let b=!1;const _=(0,f.parse)((t||[{}])[0].scalabilityMode);if(t&&1===t.length&&_.spatialLayers>1&&"video/vp9"===o.codecs[0].mimeType.toLowerCase()&&(m.debug("send() | enabling legacy simulcast for VP9 SVC"),b=!0,y=a.parse(v.sdp),g=y.media[h.idx],d.addLegacySimulcast({offerMediaObject:g,numStreams:_.spatialLayers}),v={type:"offer",sdp:a.write(y)}),m.debug("send() | calling pc.setLocalDescription() [offer:%o]",v),await this._pc.setLocalDescription(v),t){m.debug("send() | applying given encodings");const e=p.sender.getParameters();for(let r=0;r<(e.encodings||[]).length;++r){const n=e.encodings[r],i=t[r];if(!i)break;e.encodings[r]=Object.assign(n,i)}await p.sender.setParameters(e)}const S=p.mid;if(o.mid=S,y=a.parse(this._pc.localDescription.sdp),g=y.media[h.idx],o.rtcp.cname=u.getCname({offerMediaObject:g}),o.encodings=d.getRtpEncodings({offerMediaObject:g}),t)for(let e=0;e1&&("video/vp8"===o.codecs[0].mimeType.toLowerCase()||"video/h264"===o.codecs[0].mimeType.toLowerCase()))for(const e of o.encodings)e.scalabilityMode="L1T3";this._remoteSdp.send({offerMediaObject:g,reuseMid:h.reuseMid,offerRtpParameters:o,answerRtpParameters:s,codecOptions:r});const w={type:"answer",sdp:this._remoteSdp.getSdp()};return m.debug("send() | calling pc.setRemoteDescription() [answer:%o]",w),await this._pc.setRemoteDescription(w),this._mapMidTransceiver.set(S,p),{localId:S,rtpParameters:o,rtpSender:p.sender}}async stopSending(e){this.assertSendDirection(),m.debug("stopSending() [localId:%s]",e);const t=this._mapMidTransceiver.get(e);if(!t)throw new Error("associated RTCRtpTransceiver not found");if(t.sender.replaceTrack(null),this._pc.removeTrack(t.sender),this._remoteSdp.closeMediaSection(t.mid))try{t.stop()}catch(e){}const r=await this._pc.createOffer();m.debug("stopSending() | calling pc.setLocalDescription() [offer:%o]",r),await this._pc.setLocalDescription(r);const n={type:"answer",sdp:this._remoteSdp.getSdp()};m.debug("stopSending() | calling pc.setRemoteDescription() [answer:%o]",n),await this._pc.setRemoteDescription(n),this._mapMidTransceiver.delete(e)}async pauseSending(e){}async resumeSending(e){}async replaceTrack(e,t){this.assertSendDirection(),t?m.debug("replaceTrack() [localId:%s, track.id:%s]",e,t.id):m.debug("replaceTrack() [localId:%s, no track]",e);const r=this._mapMidTransceiver.get(e);if(!r)throw new Error("associated RTCRtpTransceiver not found");await r.sender.replaceTrack(t)}async setMaxSpatialLayer(e,t){this.assertSendDirection(),m.debug("setMaxSpatialLayer() [localId:%s, spatialLayer:%s]",e,t);const r=this._mapMidTransceiver.get(e);if(!r)throw new Error("associated RTCRtpTransceiver not found");const n=r.sender.getParameters();n.encodings.forEach(((e,r)=>{e.active=r<=t})),await r.sender.setParameters(n),this._remoteSdp.muxMediaSectionSimulcast(e,n.encodings);const i=await this._pc.createOffer();m.debug("setMaxSpatialLayer() | calling pc.setLocalDescription() [offer:%o]",i),await this._pc.setLocalDescription(i);const o={type:"answer",sdp:this._remoteSdp.getSdp()};m.debug("setMaxSpatialLayer() | calling pc.setRemoteDescription() [answer:%o]",o),await this._pc.setRemoteDescription(o)}async setRtpEncodingParameters(e,t){this.assertSendDirection(),m.debug("setRtpEncodingParameters() [localId:%s, params:%o]",e,t);const r=this._mapMidTransceiver.get(e);if(!r)throw new Error("associated RTCRtpTransceiver not found");const n=r.sender.getParameters();n.encodings.forEach(((e,r)=>{n.encodings[r]={...e,...t}})),await r.sender.setParameters(n),this._remoteSdp.muxMediaSectionSimulcast(e,n.encodings);const i=await this._pc.createOffer();m.debug("setRtpEncodingParameters() | calling pc.setLocalDescription() [offer:%o]",i),await this._pc.setLocalDescription(i);const o={type:"answer",sdp:this._remoteSdp.getSdp()};m.debug("setRtpEncodingParameters() | calling pc.setRemoteDescription() [answer:%o]",o),await this._pc.setRemoteDescription(o)}async getSenderStats(e){this.assertSendDirection();const t=this._mapMidTransceiver.get(e);if(!t)throw new Error("associated RTCRtpTransceiver not found");return t.sender.getStats()}async sendDataChannel({ordered:e,maxPacketLifeTime:t,maxRetransmits:r,label:n,protocol:i}){var o;this.assertSendDirection();const s={negotiated:!0,id:this._nextSendSctpStreamId,ordered:e,maxPacketLifeTime:t,maxRetransmitTime:t,maxRetransmits:r,protocol:i};m.debug("sendDataChannel() [options:%o]",s);const l=this._pc.createDataChannel(n,s);if(this._nextSendSctpStreamId=++this._nextSendSctpStreamId%g.MIS,!this._hasDataChannelMediaSection){const e=await this._pc.createOffer(),t=a.parse(e.sdp),r=t.media.find((e=>"application"===e.type));this._transportReady||await this.setupTransport({localDtlsRole:null!==(o=this._forcedLocalDtlsRole)&&void 0!==o?o:"client",localSdpObject:t}),m.debug("sendDataChannel() | calling pc.setLocalDescription() [offer:%o]",e),await this._pc.setLocalDescription(e),this._remoteSdp.sendSctpAssociation({offerMediaObject:r});const n={type:"answer",sdp:this._remoteSdp.getSdp()};m.debug("sendDataChannel() | calling pc.setRemoteDescription() [answer:%o]",n),await this._pc.setRemoteDescription(n),this._hasDataChannelMediaSection=!0}return{dataChannel:l,sctpStreamParameters:{streamId:s.id,ordered:s.ordered,maxPacketLifeTime:s.maxPacketLifeTime,maxRetransmits:s.maxRetransmits}}}async receive(e){var t;this.assertRecvDirection();const r=[],n=new Map;for(const t of e){const{trackId:e,kind:r,rtpParameters:i,streamId:o}=t;m.debug("receive() [trackId:%s, kind:%s]",e,r);const a=i.mid||String(this._mapMidTransceiver.size);n.set(e,a),this._remoteSdp.receive({mid:a,kind:r,offerRtpParameters:i,streamId:o||i.rtcp.cname,trackId:e})}const i={type:"offer",sdp:this._remoteSdp.getSdp()};m.debug("receive() | calling pc.setRemoteDescription() [offer:%o]",i),await this._pc.setRemoteDescription(i);let o=await this._pc.createAnswer();const s=a.parse(o.sdp);for(const t of e){const{trackId:e,rtpParameters:r}=t,i=n.get(e),o=s.media.find((e=>String(e.mid)===i));u.applyCodecParameters({offerRtpParameters:r,answerMediaObject:o})}o={type:"answer",sdp:a.write(s)},this._transportReady||await this.setupTransport({localDtlsRole:null!==(t=this._forcedLocalDtlsRole)&&void 0!==t?t:"client",localSdpObject:s}),m.debug("receive() | calling pc.setLocalDescription() [answer:%o]",o),await this._pc.setLocalDescription(o);for(const t of e){const{trackId:e}=t,i=n.get(e),o=this._pc.getTransceivers().find((e=>e.mid===i));if(!o)throw new Error("new RTCRtpTransceiver not found");this._mapMidTransceiver.set(i,o),r.push({localId:i,track:o.receiver.track,rtpReceiver:o.receiver})}return r}async stopReceiving(e){this.assertRecvDirection();for(const t of e){m.debug("stopReceiving() [localId:%s]",t);const e=this._mapMidTransceiver.get(t);if(!e)throw new Error("associated RTCRtpTransceiver not found");this._remoteSdp.closeMediaSection(e.mid)}const t={type:"offer",sdp:this._remoteSdp.getSdp()};m.debug("stopReceiving() | calling pc.setRemoteDescription() [offer:%o]",t),await this._pc.setRemoteDescription(t);const r=await this._pc.createAnswer();m.debug("stopReceiving() | calling pc.setLocalDescription() [answer:%o]",r),await this._pc.setLocalDescription(r);for(const t of e)this._mapMidTransceiver.delete(t)}async pauseReceiving(e){}async resumeReceiving(e){}async getReceiverStats(e){this.assertRecvDirection();const t=this._mapMidTransceiver.get(e);if(!t)throw new Error("associated RTCRtpTransceiver not found");return t.receiver.getStats()}async receiveDataChannel({sctpStreamParameters:e,label:t,protocol:r}){var n;this.assertRecvDirection();const{streamId:i,ordered:o,maxPacketLifeTime:s,maxRetransmits:l}=e,c={negotiated:!0,id:i,ordered:o,maxPacketLifeTime:s,maxRetransmitTime:s,maxRetransmits:l,protocol:r};m.debug("receiveDataChannel() [options:%o]",c);const u=this._pc.createDataChannel(t,c);if(!this._hasDataChannelMediaSection){this._remoteSdp.receiveSctpAssociation();const e={type:"offer",sdp:this._remoteSdp.getSdp()};m.debug("receiveDataChannel() | calling pc.setRemoteDescription() [offer:%o]",e),await this._pc.setRemoteDescription(e);const t=await this._pc.createAnswer();if(!this._transportReady){const e=a.parse(t.sdp);await this.setupTransport({localDtlsRole:null!==(n=this._forcedLocalDtlsRole)&&void 0!==n?n:"client",localSdpObject:e})}m.debug("receiveDataChannel() | calling pc.setRemoteDescription() [answer:%o]",t),await this._pc.setLocalDescription(t),this._hasDataChannelMediaSection=!0}return{dataChannel:u}}async setupTransport({localDtlsRole:e,localSdpObject:t}){t||(t=a.parse(this._pc.localDescription.sdp));const r=u.extractDtlsParameters({sdpObject:t});r.role=e,this._remoteSdp.updateDtlsRole("client"===e?"server":"client"),await new Promise(((e,t)=>{this.safeEmit("@connect",{dtlsParameters:r},e,t)})),this._transportReady=!0}assertSendDirection(){if("send"!==this._direction)throw new Error('method can just be called for handlers with "send" direction')}assertRecvDirection(){if("recv"!==this._direction)throw new Error('method can just be called for handlers with "recv" direction')}}t.Chrome70=v},90011:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.Chrome74=void 0;const a=o(r(17363)),s=r(82994),l=o(r(31765)),c=o(r(38046)),u=o(r(75544)),d=o(r(5938)),h=o(r(34256)),p=r(2902),f=r(41305),m=r(43303),g=new s.Logger("Chrome74"),v={OS:1024,MIS:1024};class y extends p.HandlerInterface{static createFactory(){return()=>new y}constructor(){super(),this._mapMidTransceiver=new Map,this._sendStream=new MediaStream,this._hasDataChannelMediaSection=!1,this._nextSendSctpStreamId=0,this._transportReady=!1}get name(){return"Chrome74"}close(){if(g.debug("close()"),this._pc)try{this._pc.close()}catch(e){}this.emit("@close")}async getNativeRtpCapabilities(){g.debug("getNativeRtpCapabilities()");const e=new RTCPeerConnection({iceServers:[],iceTransportPolicy:"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require",sdpSemantics:"unified-plan"});try{e.addTransceiver("audio"),e.addTransceiver("video");const t=await e.createOffer();try{e.close()}catch(e){}const r=a.parse(t.sdp),n=u.extractRtpCapabilities({sdpObject:r});return h.addNackSuppportForOpus(n),n}catch(t){try{e.close()}catch(e){}throw t}}async getNativeSctpCapabilities(){return g.debug("getNativeSctpCapabilities()"),{numStreams:v}}run({direction:e,iceParameters:t,iceCandidates:r,dtlsParameters:n,sctpParameters:i,iceServers:o,iceTransportPolicy:a,additionalSettings:s,proprietaryConstraints:l,extendedRtpCapabilities:u}){g.debug("run()"),this._direction=e,this._remoteSdp=new f.RemoteSdp({iceParameters:t,iceCandidates:r,dtlsParameters:n,sctpParameters:i}),this._sendingRtpParametersByKind={audio:c.getSendingRtpParameters("audio",u),video:c.getSendingRtpParameters("video",u)},this._sendingRemoteRtpParametersByKind={audio:c.getSendingRemoteRtpParameters("audio",u),video:c.getSendingRemoteRtpParameters("video",u)},n.role&&"auto"!==n.role&&(this._forcedLocalDtlsRole="server"===n.role?"client":"server"),this._pc=new RTCPeerConnection({iceServers:o||[],iceTransportPolicy:a||"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require",sdpSemantics:"unified-plan",...s},l),this._pc.connectionState?this._pc.addEventListener("connectionstatechange",(()=>{this.emit("@connectionstatechange",this._pc.connectionState)})):(g.warn("run() | pc.connectionState not supported, using pc.iceConnectionState"),this._pc.addEventListener("iceconnectionstatechange",(()=>{switch(this._pc.iceConnectionState){case"checking":this.emit("@connectionstatechange","connecting");break;case"connected":case"completed":this.emit("@connectionstatechange","connected");break;case"failed":this.emit("@connectionstatechange","failed");break;case"disconnected":this.emit("@connectionstatechange","disconnected");break;case"closed":this.emit("@connectionstatechange","closed")}})))}async updateIceServers(e){g.debug("updateIceServers()");const t=this._pc.getConfiguration();t.iceServers=e,this._pc.setConfiguration(t)}async restartIce(e){if(g.debug("restartIce()"),this._remoteSdp.updateIceParameters(e),this._transportReady)if("send"===this._direction){const e=await this._pc.createOffer({iceRestart:!0});g.debug("restartIce() | calling pc.setLocalDescription() [offer:%o]",e),await this._pc.setLocalDescription(e);const t={type:"answer",sdp:this._remoteSdp.getSdp()};g.debug("restartIce() | calling pc.setRemoteDescription() [answer:%o]",t),await this._pc.setRemoteDescription(t)}else{const e={type:"offer",sdp:this._remoteSdp.getSdp()};g.debug("restartIce() | calling pc.setRemoteDescription() [offer:%o]",e),await this._pc.setRemoteDescription(e);const t=await this._pc.createAnswer();g.debug("restartIce() | calling pc.setLocalDescription() [answer:%o]",t),await this._pc.setLocalDescription(t)}}async getTransportStats(){return this._pc.getStats()}async send({track:e,encodings:t,codecOptions:r,codec:n}){var i;this.assertSendDirection(),g.debug("send() [kind:%s, track.id:%s]",e.kind,e.id),t&&t.length>1&&t.forEach(((e,t)=>{e.rid=`r${t}`}));const o=l.clone(this._sendingRtpParametersByKind[e.kind],{});o.codecs=c.reduceCodecs(o.codecs,n);const s=l.clone(this._sendingRemoteRtpParametersByKind[e.kind],{});s.codecs=c.reduceCodecs(s.codecs,n);const h=this._remoteSdp.getNextMediaSectionIdx(),p=this._pc.addTransceiver(e,{direction:"sendonly",streams:[this._sendStream],sendEncodings:t});let f,v=await this._pc.createOffer(),y=a.parse(v.sdp);this._transportReady||await this.setupTransport({localDtlsRole:null!==(i=this._forcedLocalDtlsRole)&&void 0!==i?i:"client",localSdpObject:y});let b=!1;const _=(0,m.parse)((t||[{}])[0].scalabilityMode);t&&1===t.length&&_.spatialLayers>1&&"video/vp9"===o.codecs[0].mimeType.toLowerCase()&&(g.debug("send() | enabling legacy simulcast for VP9 SVC"),b=!0,y=a.parse(v.sdp),f=y.media[h.idx],d.addLegacySimulcast({offerMediaObject:f,numStreams:_.spatialLayers}),v={type:"offer",sdp:a.write(y)}),g.debug("send() | calling pc.setLocalDescription() [offer:%o]",v),await this._pc.setLocalDescription(v);const S=p.mid;if(o.mid=S,y=a.parse(this._pc.localDescription.sdp),f=y.media[h.idx],o.rtcp.cname=u.getCname({offerMediaObject:f}),t)if(1===t.length){let e=d.getRtpEncodings({offerMediaObject:f});Object.assign(e[0],t[0]),b&&(e=[e[0]]),o.encodings=e}else o.encodings=t;else o.encodings=d.getRtpEncodings({offerMediaObject:f});if(o.encodings.length>1&&("video/vp8"===o.codecs[0].mimeType.toLowerCase()||"video/h264"===o.codecs[0].mimeType.toLowerCase()))for(const e of o.encodings)e.scalabilityMode?e.scalabilityMode=`L1T${_.temporalLayers}`:e.scalabilityMode="L1T3";this._remoteSdp.send({offerMediaObject:f,reuseMid:h.reuseMid,offerRtpParameters:o,answerRtpParameters:s,codecOptions:r,extmapAllowMixed:!0});const w={type:"answer",sdp:this._remoteSdp.getSdp()};return g.debug("send() | calling pc.setRemoteDescription() [answer:%o]",w),await this._pc.setRemoteDescription(w),this._mapMidTransceiver.set(S,p),{localId:S,rtpParameters:o,rtpSender:p.sender}}async stopSending(e){this.assertSendDirection(),g.debug("stopSending() [localId:%s]",e);const t=this._mapMidTransceiver.get(e);if(!t)throw new Error("associated RTCRtpTransceiver not found");if(t.sender.replaceTrack(null),this._pc.removeTrack(t.sender),this._remoteSdp.closeMediaSection(t.mid))try{t.stop()}catch(e){}const r=await this._pc.createOffer();g.debug("stopSending() | calling pc.setLocalDescription() [offer:%o]",r),await this._pc.setLocalDescription(r);const n={type:"answer",sdp:this._remoteSdp.getSdp()};g.debug("stopSending() | calling pc.setRemoteDescription() [answer:%o]",n),await this._pc.setRemoteDescription(n),this._mapMidTransceiver.delete(e)}async pauseSending(e){this.assertSendDirection(),g.debug("pauseSending() [localId:%s]",e);const t=this._mapMidTransceiver.get(e);if(!t)throw new Error("associated RTCRtpTransceiver not found");t.direction="inactive",this._remoteSdp.pauseMediaSection(e);const r=await this._pc.createOffer();g.debug("pauseSending() | calling pc.setLocalDescription() [offer:%o]",r),await this._pc.setLocalDescription(r);const n={type:"answer",sdp:this._remoteSdp.getSdp()};g.debug("pauseSending() | calling pc.setRemoteDescription() [answer:%o]",n),await this._pc.setRemoteDescription(n)}async resumeSending(e){this.assertSendDirection(),g.debug("resumeSending() [localId:%s]",e);const t=this._mapMidTransceiver.get(e);if(this._remoteSdp.resumeSendingMediaSection(e),!t)throw new Error("associated RTCRtpTransceiver not found");t.direction="sendonly";const r=await this._pc.createOffer();g.debug("resumeSending() | calling pc.setLocalDescription() [offer:%o]",r),await this._pc.setLocalDescription(r);const n={type:"answer",sdp:this._remoteSdp.getSdp()};g.debug("resumeSending() | calling pc.setRemoteDescription() [answer:%o]",n),await this._pc.setRemoteDescription(n)}async replaceTrack(e,t){this.assertSendDirection(),t?g.debug("replaceTrack() [localId:%s, track.id:%s]",e,t.id):g.debug("replaceTrack() [localId:%s, no track]",e);const r=this._mapMidTransceiver.get(e);if(!r)throw new Error("associated RTCRtpTransceiver not found");await r.sender.replaceTrack(t)}async setMaxSpatialLayer(e,t){this.assertSendDirection(),g.debug("setMaxSpatialLayer() [localId:%s, spatialLayer:%s]",e,t);const r=this._mapMidTransceiver.get(e);if(!r)throw new Error("associated RTCRtpTransceiver not found");const n=r.sender.getParameters();n.encodings.forEach(((e,r)=>{e.active=r<=t})),await r.sender.setParameters(n),this._remoteSdp.muxMediaSectionSimulcast(e,n.encodings);const i=await this._pc.createOffer();g.debug("setMaxSpatialLayer() | calling pc.setLocalDescription() [offer:%o]",i),await this._pc.setLocalDescription(i);const o={type:"answer",sdp:this._remoteSdp.getSdp()};g.debug("setMaxSpatialLayer() | calling pc.setRemoteDescription() [answer:%o]",o),await this._pc.setRemoteDescription(o)}async setRtpEncodingParameters(e,t){this.assertSendDirection(),g.debug("setRtpEncodingParameters() [localId:%s, params:%o]",e,t);const r=this._mapMidTransceiver.get(e);if(!r)throw new Error("associated RTCRtpTransceiver not found");const n=r.sender.getParameters();n.encodings.forEach(((e,r)=>{n.encodings[r]={...e,...t}})),await r.sender.setParameters(n),this._remoteSdp.muxMediaSectionSimulcast(e,n.encodings);const i=await this._pc.createOffer();g.debug("setRtpEncodingParameters() | calling pc.setLocalDescription() [offer:%o]",i),await this._pc.setLocalDescription(i);const o={type:"answer",sdp:this._remoteSdp.getSdp()};g.debug("setRtpEncodingParameters() | calling pc.setRemoteDescription() [answer:%o]",o),await this._pc.setRemoteDescription(o)}async getSenderStats(e){this.assertSendDirection();const t=this._mapMidTransceiver.get(e);if(!t)throw new Error("associated RTCRtpTransceiver not found");return t.sender.getStats()}async sendDataChannel({ordered:e,maxPacketLifeTime:t,maxRetransmits:r,label:n,protocol:i}){var o;this.assertSendDirection();const s={negotiated:!0,id:this._nextSendSctpStreamId,ordered:e,maxPacketLifeTime:t,maxRetransmits:r,protocol:i};g.debug("sendDataChannel() [options:%o]",s);const l=this._pc.createDataChannel(n,s);if(this._nextSendSctpStreamId=++this._nextSendSctpStreamId%v.MIS,!this._hasDataChannelMediaSection){const e=await this._pc.createOffer(),t=a.parse(e.sdp),r=t.media.find((e=>"application"===e.type));this._transportReady||await this.setupTransport({localDtlsRole:null!==(o=this._forcedLocalDtlsRole)&&void 0!==o?o:"client",localSdpObject:t}),g.debug("sendDataChannel() | calling pc.setLocalDescription() [offer:%o]",e),await this._pc.setLocalDescription(e),this._remoteSdp.sendSctpAssociation({offerMediaObject:r});const n={type:"answer",sdp:this._remoteSdp.getSdp()};g.debug("sendDataChannel() | calling pc.setRemoteDescription() [answer:%o]",n),await this._pc.setRemoteDescription(n),this._hasDataChannelMediaSection=!0}return{dataChannel:l,sctpStreamParameters:{streamId:s.id,ordered:s.ordered,maxPacketLifeTime:s.maxPacketLifeTime,maxRetransmits:s.maxRetransmits}}}async receive(e){var t;this.assertRecvDirection();const r=[],n=new Map;for(const t of e){const{trackId:e,kind:r,rtpParameters:i,streamId:o}=t;g.debug("receive() [trackId:%s, kind:%s]",e,r);const a=i.mid||String(this._mapMidTransceiver.size);n.set(e,a),this._remoteSdp.receive({mid:a,kind:r,offerRtpParameters:i,streamId:o||i.rtcp.cname,trackId:e})}const i={type:"offer",sdp:this._remoteSdp.getSdp()};g.debug("receive() | calling pc.setRemoteDescription() [offer:%o]",i),await this._pc.setRemoteDescription(i);let o=await this._pc.createAnswer();const s=a.parse(o.sdp);for(const t of e){const{trackId:e,rtpParameters:r}=t,i=n.get(e),o=s.media.find((e=>String(e.mid)===i));u.applyCodecParameters({offerRtpParameters:r,answerMediaObject:o})}o={type:"answer",sdp:a.write(s)},this._transportReady||await this.setupTransport({localDtlsRole:null!==(t=this._forcedLocalDtlsRole)&&void 0!==t?t:"client",localSdpObject:s}),g.debug("receive() | calling pc.setLocalDescription() [answer:%o]",o),await this._pc.setLocalDescription(o);for(const t of e){const{trackId:e}=t,i=n.get(e),o=this._pc.getTransceivers().find((e=>e.mid===i));if(!o)throw new Error("new RTCRtpTransceiver not found");this._mapMidTransceiver.set(i,o),r.push({localId:i,track:o.receiver.track,rtpReceiver:o.receiver})}return r}async stopReceiving(e){this.assertRecvDirection();for(const t of e){g.debug("stopReceiving() [localId:%s]",t);const e=this._mapMidTransceiver.get(t);if(!e)throw new Error("associated RTCRtpTransceiver not found");this._remoteSdp.closeMediaSection(e.mid)}const t={type:"offer",sdp:this._remoteSdp.getSdp()};g.debug("stopReceiving() | calling pc.setRemoteDescription() [offer:%o]",t),await this._pc.setRemoteDescription(t);const r=await this._pc.createAnswer();g.debug("stopReceiving() | calling pc.setLocalDescription() [answer:%o]",r),await this._pc.setLocalDescription(r);for(const t of e)this._mapMidTransceiver.delete(t)}async pauseReceiving(e){this.assertRecvDirection();for(const t of e){g.debug("pauseReceiving() [localId:%s]",t);const e=this._mapMidTransceiver.get(t);if(!e)throw new Error("associated RTCRtpTransceiver not found");e.direction="inactive",this._remoteSdp.pauseMediaSection(t)}const t={type:"offer",sdp:this._remoteSdp.getSdp()};g.debug("pauseReceiving() | calling pc.setRemoteDescription() [offer:%o]",t),await this._pc.setRemoteDescription(t);const r=await this._pc.createAnswer();g.debug("pauseReceiving() | calling pc.setLocalDescription() [answer:%o]",r),await this._pc.setLocalDescription(r)}async resumeReceiving(e){this.assertRecvDirection();for(const t of e){g.debug("resumeReceiving() [localId:%s]",t);const e=this._mapMidTransceiver.get(t);if(!e)throw new Error("associated RTCRtpTransceiver not found");e.direction="recvonly",this._remoteSdp.resumeReceivingMediaSection(t)}const t={type:"offer",sdp:this._remoteSdp.getSdp()};g.debug("resumeReceiving() | calling pc.setRemoteDescription() [offer:%o]",t),await this._pc.setRemoteDescription(t);const r=await this._pc.createAnswer();g.debug("resumeReceiving() | calling pc.setLocalDescription() [answer:%o]",r),await this._pc.setLocalDescription(r)}async getReceiverStats(e){this.assertRecvDirection();const t=this._mapMidTransceiver.get(e);if(!t)throw new Error("associated RTCRtpTransceiver not found");return t.receiver.getStats()}async receiveDataChannel({sctpStreamParameters:e,label:t,protocol:r}){var n;this.assertRecvDirection();const{streamId:i,ordered:o,maxPacketLifeTime:s,maxRetransmits:l}=e,c={negotiated:!0,id:i,ordered:o,maxPacketLifeTime:s,maxRetransmits:l,protocol:r};g.debug("receiveDataChannel() [options:%o]",c);const u=this._pc.createDataChannel(t,c);if(!this._hasDataChannelMediaSection){this._remoteSdp.receiveSctpAssociation();const e={type:"offer",sdp:this._remoteSdp.getSdp()};g.debug("receiveDataChannel() | calling pc.setRemoteDescription() [offer:%o]",e),await this._pc.setRemoteDescription(e);const t=await this._pc.createAnswer();if(!this._transportReady){const e=a.parse(t.sdp);await this.setupTransport({localDtlsRole:null!==(n=this._forcedLocalDtlsRole)&&void 0!==n?n:"client",localSdpObject:e})}g.debug("receiveDataChannel() | calling pc.setRemoteDescription() [answer:%o]",t),await this._pc.setLocalDescription(t),this._hasDataChannelMediaSection=!0}return{dataChannel:u}}async setupTransport({localDtlsRole:e,localSdpObject:t}){t||(t=a.parse(this._pc.localDescription.sdp));const r=u.extractDtlsParameters({sdpObject:t});r.role=e,this._remoteSdp.updateDtlsRole("client"===e?"server":"client"),await new Promise(((e,t)=>{this.safeEmit("@connect",{dtlsParameters:r},e,t)})),this._transportReady=!0}assertSendDirection(){if("send"!==this._direction)throw new Error('method can just be called for handlers with "send" direction')}assertRecvDirection(){if("recv"!==this._direction)throw new Error('method can just be called for handlers with "recv" direction')}}t.Chrome74=y},58633:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.Edge11=void 0;const a=r(82994),s=r(34893),l=o(r(31765)),c=o(r(38046)),u=o(r(68751)),d=r(2902),h=new a.Logger("Edge11");class p extends d.HandlerInterface{static createFactory(){return()=>new p}constructor(){super(),this._rtpSenders=new Map,this._rtpReceivers=new Map,this._nextSendLocalId=0,this._transportReady=!1}get name(){return"Edge11"}close(){h.debug("close()");try{this._iceGatherer.close()}catch(e){}try{this._iceTransport.stop()}catch(e){}try{this._dtlsTransport.stop()}catch(e){}for(const e of this._rtpSenders.values())try{e.stop()}catch(e){}for(const e of this._rtpReceivers.values())try{e.stop()}catch(e){}this.emit("@close")}async getNativeRtpCapabilities(){return h.debug("getNativeRtpCapabilities()"),u.getCapabilities()}async getNativeSctpCapabilities(){return h.debug("getNativeSctpCapabilities()"),{numStreams:{OS:0,MIS:0}}}run({direction:e,iceParameters:t,iceCandidates:r,dtlsParameters:n,sctpParameters:i,iceServers:o,iceTransportPolicy:a,additionalSettings:s,proprietaryConstraints:u,extendedRtpCapabilities:d}){h.debug("run()"),this._sendingRtpParametersByKind={audio:c.getSendingRtpParameters("audio",d),video:c.getSendingRtpParameters("video",d)},this._remoteIceParameters=t,this._remoteIceCandidates=r,this._remoteDtlsParameters=n,this._cname=`CNAME-${l.generateRandomNumber()}`,this.setIceGatherer({iceServers:o,iceTransportPolicy:a}),this.setIceTransport(),this.setDtlsTransport()}async updateIceServers(e){throw new s.UnsupportedError("not supported")}async restartIce(e){if(h.debug("restartIce()"),this._remoteIceParameters=e,this._transportReady){h.debug("restartIce() | calling iceTransport.start()"),this._iceTransport.start(this._iceGatherer,e,"controlling");for(const e of this._remoteIceCandidates)this._iceTransport.addRemoteCandidate(e);this._iceTransport.addRemoteCandidate({})}}async getTransportStats(){return this._iceTransport.getStats()}async send({track:e,encodings:t,codecOptions:r,codec:n}){h.debug("send() [kind:%s, track.id:%s]",e.kind,e.id),this._transportReady||await this.setupTransport({localDtlsRole:"server"}),h.debug("send() | calling new RTCRtpSender()");const i=new RTCRtpSender(e,this._dtlsTransport),o=l.clone(this._sendingRtpParametersByKind[e.kind],{});o.codecs=c.reduceCodecs(o.codecs,n);const a=o.codecs.some((e=>/.+\/rtx$/i.test(e.mimeType)));t||(t=[{}]);for(const e of t)e.ssrc=l.generateRandomNumber(),a&&(e.rtx={ssrc:l.generateRandomNumber()});o.encodings=t,o.rtcp={cname:this._cname,reducedSize:!0,mux:!0};const s=u.mangleRtpParameters(o);h.debug("send() | calling rtpSender.send() [params:%o]",s),await i.send(s);const d=String(this._nextSendLocalId);return this._nextSendLocalId++,this._rtpSenders.set(d,i),{localId:d,rtpParameters:o,rtpSender:i}}async stopSending(e){h.debug("stopSending() [localId:%s]",e);const t=this._rtpSenders.get(e);if(!t)throw new Error("RTCRtpSender not found");this._rtpSenders.delete(e);try{h.debug("stopSending() | calling rtpSender.stop()"),t.stop()}catch(e){throw h.warn("stopSending() | rtpSender.stop() failed:%o",e),e}}async pauseSending(e){}async resumeSending(e){}async replaceTrack(e,t){t?h.debug("replaceTrack() [localId:%s, track.id:%s]",e,t.id):h.debug("replaceTrack() [localId:%s, no track]",e);const r=this._rtpSenders.get(e);if(!r)throw new Error("RTCRtpSender not found");r.setTrack(t)}async setMaxSpatialLayer(e,t){h.debug("setMaxSpatialLayer() [localId:%s, spatialLayer:%s]",e,t);const r=this._rtpSenders.get(e);if(!r)throw new Error("RTCRtpSender not found");const n=r.getParameters();n.encodings.forEach(((e,r)=>{e.active=r<=t})),await r.setParameters(n)}async setRtpEncodingParameters(e,t){h.debug("setRtpEncodingParameters() [localId:%s, params:%o]",e,t);const r=this._rtpSenders.get(e);if(!r)throw new Error("RTCRtpSender not found");const n=r.getParameters();n.encodings.forEach(((e,r)=>{n.encodings[r]={...e,...t}})),await r.setParameters(n)}async getSenderStats(e){const t=this._rtpSenders.get(e);if(!t)throw new Error("RTCRtpSender not found");return t.getStats()}async sendDataChannel(e){throw new s.UnsupportedError("not implemented")}async receive(e){const t=[];for(const t of e){const{trackId:e,kind:r}=t;h.debug("receive() [trackId:%s, kind:%s]",e,r)}this._transportReady||await this.setupTransport({localDtlsRole:"server"});for(const r of e){const{trackId:e,kind:n,rtpParameters:i}=r;h.debug("receive() | calling new RTCRtpReceiver()");const o=new RTCRtpReceiver(this._dtlsTransport,n);o.addEventListener("error",(e=>{h.error('rtpReceiver "error" event [event:%o]',e)}));const a=u.mangleRtpParameters(i);h.debug("receive() | calling rtpReceiver.receive() [params:%o]",a),await o.receive(a);const s=e;this._rtpReceivers.set(s,o),t.push({localId:s,track:o.track,rtpReceiver:o})}return t}async stopReceiving(e){for(const t of e){h.debug("stopReceiving() [localId:%s]",t);const e=this._rtpReceivers.get(t);if(!e)throw new Error("RTCRtpReceiver not found");this._rtpReceivers.delete(t);try{h.debug("stopReceiving() | calling rtpReceiver.stop()"),e.stop()}catch(e){h.warn("stopReceiving() | rtpReceiver.stop() failed:%o",e)}}}async pauseReceiving(e){}async resumeReceiving(e){}async getReceiverStats(e){const t=this._rtpReceivers.get(e);if(!t)throw new Error("RTCRtpReceiver not found");return t.getStats()}async receiveDataChannel(e){throw new s.UnsupportedError("not implemented")}setIceGatherer({iceServers:e,iceTransportPolicy:t}){const r=new RTCIceGatherer({iceServers:e||[],gatherPolicy:t||"all"});r.addEventListener("error",(e=>{h.error('iceGatherer "error" event [event:%o]',e)}));try{r.gather()}catch(e){h.debug("setIceGatherer() | iceGatherer.gather() failed: %s",e.toString())}this._iceGatherer=r}setIceTransport(){const e=new RTCIceTransport(this._iceGatherer);e.addEventListener("statechange",(()=>{switch(e.state){case"checking":this.emit("@connectionstatechange","connecting");break;case"connected":case"completed":this.emit("@connectionstatechange","connected");break;case"failed":this.emit("@connectionstatechange","failed");break;case"disconnected":this.emit("@connectionstatechange","disconnected");break;case"closed":this.emit("@connectionstatechange","closed")}})),e.addEventListener("icestatechange",(()=>{switch(e.state){case"checking":this.emit("@connectionstatechange","connecting");break;case"connected":case"completed":this.emit("@connectionstatechange","connected");break;case"failed":this.emit("@connectionstatechange","failed");break;case"disconnected":this.emit("@connectionstatechange","disconnected");break;case"closed":this.emit("@connectionstatechange","closed")}})),e.addEventListener("candidatepairchange",(e=>{h.debug('iceTransport "candidatepairchange" event [pair:%o]',e.pair)})),this._iceTransport=e}setDtlsTransport(){const e=new RTCDtlsTransport(this._iceTransport);e.addEventListener("statechange",(()=>{h.debug('dtlsTransport "statechange" event [state:%s]',e.state)})),e.addEventListener("dtlsstatechange",(()=>{h.debug('dtlsTransport "dtlsstatechange" event [state:%s]',e.state),"closed"===e.state&&this.emit("@connectionstatechange","closed")})),e.addEventListener("error",(e=>{h.error('dtlsTransport "error" event [event:%o]',e)})),this._dtlsTransport=e}async setupTransport({localDtlsRole:e}){h.debug("setupTransport()");const t=this._dtlsTransport.getLocalParameters();t.role=e,await new Promise(((e,r)=>{this.safeEmit("@connect",{dtlsParameters:t},e,r)})),this._iceTransport.start(this._iceGatherer,this._remoteIceParameters,"controlling");for(const e of this._remoteIceCandidates)this._iceTransport.addRemoteCandidate(e);this._iceTransport.addRemoteCandidate({}),this._remoteDtlsParameters.fingerprints=this._remoteDtlsParameters.fingerprints.filter((e=>"sha-256"===e.algorithm||"sha-384"===e.algorithm||"sha-512"===e.algorithm)),this._dtlsTransport.start(this._remoteDtlsParameters),this._transportReady=!0}}t.Edge11=p},51767:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.Firefox60=void 0;const a=o(r(17363)),s=r(82994),l=r(34893),c=o(r(31765)),u=o(r(38046)),d=o(r(75544)),h=o(r(5938)),p=r(2902),f=r(41305),m=r(43303),g=new s.Logger("Firefox60"),v={OS:16,MIS:2048};class y extends p.HandlerInterface{static createFactory(){return()=>new y}constructor(){super(),this._mapMidTransceiver=new Map,this._sendStream=new MediaStream,this._hasDataChannelMediaSection=!1,this._nextSendSctpStreamId=0,this._transportReady=!1}get name(){return"Firefox60"}close(){if(g.debug("close()"),this._pc)try{this._pc.close()}catch(e){}this.emit("@close")}async getNativeRtpCapabilities(){g.debug("getNativeRtpCapabilities()");const e=new RTCPeerConnection({iceServers:[],iceTransportPolicy:"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require"}),t=document.createElement("canvas");t.getContext("2d");const r=t.captureStream().getVideoTracks()[0];try{e.addTransceiver("audio",{direction:"sendrecv"});const n=e.addTransceiver(r,{direction:"sendrecv"}),i=n.sender.getParameters(),o=[{rid:"r0",maxBitrate:1e5},{rid:"r1",maxBitrate:5e5}];i.encodings=o,await n.sender.setParameters(i);const s=await e.createOffer();try{t.remove()}catch(e){}try{r.stop()}catch(e){}try{e.close()}catch(e){}const l=a.parse(s.sdp);return d.extractRtpCapabilities({sdpObject:l})}catch(n){try{t.remove()}catch(e){}try{r.stop()}catch(e){}try{e.close()}catch(e){}throw n}}async getNativeSctpCapabilities(){return g.debug("getNativeSctpCapabilities()"),{numStreams:v}}run({direction:e,iceParameters:t,iceCandidates:r,dtlsParameters:n,sctpParameters:i,iceServers:o,iceTransportPolicy:a,additionalSettings:s,proprietaryConstraints:l,extendedRtpCapabilities:c}){g.debug("run()"),this._direction=e,this._remoteSdp=new f.RemoteSdp({iceParameters:t,iceCandidates:r,dtlsParameters:n,sctpParameters:i}),this._sendingRtpParametersByKind={audio:u.getSendingRtpParameters("audio",c),video:u.getSendingRtpParameters("video",c)},this._sendingRemoteRtpParametersByKind={audio:u.getSendingRemoteRtpParameters("audio",c),video:u.getSendingRemoteRtpParameters("video",c)},this._pc=new RTCPeerConnection({iceServers:o||[],iceTransportPolicy:a||"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require",...s},l),this._pc.connectionState?this._pc.addEventListener("connectionstatechange",(()=>{this.emit("@connectionstatechange",this._pc.connectionState)})):this._pc.addEventListener("iceconnectionstatechange",(()=>{switch(g.warn("run() | pc.connectionState not supported, using pc.iceConnectionState"),this._pc.iceConnectionState){case"checking":this.emit("@connectionstatechange","connecting");break;case"connected":case"completed":this.emit("@connectionstatechange","connected");break;case"failed":this.emit("@connectionstatechange","failed");break;case"disconnected":this.emit("@connectionstatechange","disconnected");break;case"closed":this.emit("@connectionstatechange","closed")}}))}async updateIceServers(e){throw new l.UnsupportedError("not supported")}async restartIce(e){if(g.debug("restartIce()"),this._remoteSdp.updateIceParameters(e),this._transportReady)if("send"===this._direction){const e=await this._pc.createOffer({iceRestart:!0});g.debug("restartIce() | calling pc.setLocalDescription() [offer:%o]",e),await this._pc.setLocalDescription(e);const t={type:"answer",sdp:this._remoteSdp.getSdp()};g.debug("restartIce() | calling pc.setRemoteDescription() [answer:%o]",t),await this._pc.setRemoteDescription(t)}else{const e={type:"offer",sdp:this._remoteSdp.getSdp()};g.debug("restartIce() | calling pc.setRemoteDescription() [offer:%o]",e),await this._pc.setRemoteDescription(e);const t=await this._pc.createAnswer();g.debug("restartIce() | calling pc.setLocalDescription() [answer:%o]",t),await this._pc.setLocalDescription(t)}}async getTransportStats(){return this._pc.getStats()}async send({track:e,encodings:t,codecOptions:r,codec:n}){this.assertSendDirection(),g.debug("send() [kind:%s, track.id:%s]",e.kind,e.id),t&&(t=c.clone(t,[])).length>1&&(t.forEach(((e,t)=>{e.rid=`r${t}`})),t.reverse());const i=c.clone(this._sendingRtpParametersByKind[e.kind],{});i.codecs=u.reduceCodecs(i.codecs,n);const o=c.clone(this._sendingRemoteRtpParametersByKind[e.kind],{});o.codecs=u.reduceCodecs(o.codecs,n);const s=this._pc.addTransceiver(e,{direction:"sendonly",streams:[this._sendStream]});if(t){const e=s.sender.getParameters();e.encodings=t,await s.sender.setParameters(e)}const l=await this._pc.createOffer();let p=a.parse(l.sdp);this._transportReady||await this.setupTransport({localDtlsRole:"client",localSdpObject:p});const f=(0,m.parse)((t||[{}])[0].scalabilityMode);g.debug("send() | calling pc.setLocalDescription() [offer:%o]",l),await this._pc.setLocalDescription(l);const v=s.mid;i.mid=v,p=a.parse(this._pc.localDescription.sdp);const y=p.media[p.media.length-1];if(i.rtcp.cname=d.getCname({offerMediaObject:y}),t)if(1===t.length){const e=h.getRtpEncodings({offerMediaObject:y});Object.assign(e[0],t[0]),i.encodings=e}else i.encodings=t.reverse();else i.encodings=h.getRtpEncodings({offerMediaObject:y});if(i.encodings.length>1&&("video/vp8"===i.codecs[0].mimeType.toLowerCase()||"video/h264"===i.codecs[0].mimeType.toLowerCase()))for(const e of i.encodings)e.scalabilityMode?e.scalabilityMode=`L1T${f.temporalLayers}`:e.scalabilityMode="L1T3";this._remoteSdp.send({offerMediaObject:y,offerRtpParameters:i,answerRtpParameters:o,codecOptions:r,extmapAllowMixed:!0});const b={type:"answer",sdp:this._remoteSdp.getSdp()};return g.debug("send() | calling pc.setRemoteDescription() [answer:%o]",b),await this._pc.setRemoteDescription(b),this._mapMidTransceiver.set(v,s),{localId:v,rtpParameters:i,rtpSender:s.sender}}async stopSending(e){g.debug("stopSending() [localId:%s]",e);const t=this._mapMidTransceiver.get(e);if(!t)throw new Error("associated transceiver not found");t.sender.replaceTrack(null),this._pc.removeTrack(t.sender),this._remoteSdp.disableMediaSection(t.mid);const r=await this._pc.createOffer();g.debug("stopSending() | calling pc.setLocalDescription() [offer:%o]",r),await this._pc.setLocalDescription(r);const n={type:"answer",sdp:this._remoteSdp.getSdp()};g.debug("stopSending() | calling pc.setRemoteDescription() [answer:%o]",n),await this._pc.setRemoteDescription(n),this._mapMidTransceiver.delete(e)}async pauseSending(e){this.assertSendDirection(),g.debug("pauseSending() [localId:%s]",e);const t=this._mapMidTransceiver.get(e);if(!t)throw new Error("associated RTCRtpTransceiver not found");t.direction="inactive",this._remoteSdp.pauseMediaSection(e);const r=await this._pc.createOffer();g.debug("pauseSending() | calling pc.setLocalDescription() [offer:%o]",r),await this._pc.setLocalDescription(r);const n={type:"answer",sdp:this._remoteSdp.getSdp()};g.debug("pauseSending() | calling pc.setRemoteDescription() [answer:%o]",n),await this._pc.setRemoteDescription(n)}async resumeSending(e){this.assertSendDirection(),g.debug("resumeSending() [localId:%s]",e);const t=this._mapMidTransceiver.get(e);if(!t)throw new Error("associated RTCRtpTransceiver not found");t.direction="sendonly",this._remoteSdp.resumeSendingMediaSection(e);const r=await this._pc.createOffer();g.debug("resumeSending() | calling pc.setLocalDescription() [offer:%o]",r),await this._pc.setLocalDescription(r);const n={type:"answer",sdp:this._remoteSdp.getSdp()};g.debug("resumeSending() | calling pc.setRemoteDescription() [answer:%o]",n),await this._pc.setRemoteDescription(n)}async replaceTrack(e,t){this.assertSendDirection(),t?g.debug("replaceTrack() [localId:%s, track.id:%s]",e,t.id):g.debug("replaceTrack() [localId:%s, no track]",e);const r=this._mapMidTransceiver.get(e);if(!r)throw new Error("associated RTCRtpTransceiver not found");await r.sender.replaceTrack(t)}async setMaxSpatialLayer(e,t){this.assertSendDirection(),g.debug("setMaxSpatialLayer() [localId:%s, spatialLayer:%s]",e,t);const r=this._mapMidTransceiver.get(e);if(!r)throw new Error("associated transceiver not found");const n=r.sender.getParameters();t=n.encodings.length-1-t,n.encodings.forEach(((e,r)=>{e.active=r>=t})),await r.sender.setParameters(n),this._remoteSdp.muxMediaSectionSimulcast(e,n.encodings);const i=await this._pc.createOffer();g.debug("setMaxSpatialLayer() | calling pc.setLocalDescription() [offer:%o]",i),await this._pc.setLocalDescription(i);const o={type:"answer",sdp:this._remoteSdp.getSdp()};g.debug("setMaxSpatialLayer() | calling pc.setRemoteDescription() [answer:%o]",o),await this._pc.setRemoteDescription(o)}async setRtpEncodingParameters(e,t){this.assertSendDirection(),g.debug("setRtpEncodingParameters() [localId:%s, params:%o]",e,t);const r=this._mapMidTransceiver.get(e);if(!r)throw new Error("associated RTCRtpTransceiver not found");const n=r.sender.getParameters();n.encodings.forEach(((e,r)=>{n.encodings[r]={...e,...t}})),await r.sender.setParameters(n),this._remoteSdp.muxMediaSectionSimulcast(e,n.encodings);const i=await this._pc.createOffer();g.debug("setRtpEncodingParameters() | calling pc.setLocalDescription() [offer:%o]",i),await this._pc.setLocalDescription(i);const o={type:"answer",sdp:this._remoteSdp.getSdp()};g.debug("setRtpEncodingParameters() | calling pc.setRemoteDescription() [answer:%o]",o),await this._pc.setRemoteDescription(o)}async getSenderStats(e){this.assertSendDirection();const t=this._mapMidTransceiver.get(e);if(!t)throw new Error("associated RTCRtpTransceiver not found");return t.sender.getStats()}async sendDataChannel({ordered:e,maxPacketLifeTime:t,maxRetransmits:r,label:n,protocol:i}){this.assertSendDirection();const o={negotiated:!0,id:this._nextSendSctpStreamId,ordered:e,maxPacketLifeTime:t,maxRetransmits:r,protocol:i};g.debug("sendDataChannel() [options:%o]",o);const s=this._pc.createDataChannel(n,o);if(this._nextSendSctpStreamId=++this._nextSendSctpStreamId%v.MIS,!this._hasDataChannelMediaSection){const e=await this._pc.createOffer(),t=a.parse(e.sdp),r=t.media.find((e=>"application"===e.type));this._transportReady||await this.setupTransport({localDtlsRole:"client",localSdpObject:t}),g.debug("sendDataChannel() | calling pc.setLocalDescription() [offer:%o]",e),await this._pc.setLocalDescription(e),this._remoteSdp.sendSctpAssociation({offerMediaObject:r});const n={type:"answer",sdp:this._remoteSdp.getSdp()};g.debug("sendDataChannel() | calling pc.setRemoteDescription() [answer:%o]",n),await this._pc.setRemoteDescription(n),this._hasDataChannelMediaSection=!0}return{dataChannel:s,sctpStreamParameters:{streamId:o.id,ordered:o.ordered,maxPacketLifeTime:o.maxPacketLifeTime,maxRetransmits:o.maxRetransmits}}}async receive(e){this.assertRecvDirection();const t=[],r=new Map;for(const t of e){const{trackId:e,kind:n,rtpParameters:i,streamId:o}=t;g.debug("receive() [trackId:%s, kind:%s]",e,n);const a=i.mid||String(this._mapMidTransceiver.size);r.set(e,a),this._remoteSdp.receive({mid:a,kind:n,offerRtpParameters:i,streamId:o||i.rtcp.cname,trackId:e})}const n={type:"offer",sdp:this._remoteSdp.getSdp()};g.debug("receive() | calling pc.setRemoteDescription() [offer:%o]",n),await this._pc.setRemoteDescription(n);let i=await this._pc.createAnswer();const o=a.parse(i.sdp);for(const t of e){const{trackId:e,rtpParameters:n}=t,s=r.get(e),l=o.media.find((e=>String(e.mid)===s));d.applyCodecParameters({offerRtpParameters:n,answerMediaObject:l}),i={type:"answer",sdp:a.write(o)}}this._transportReady||await this.setupTransport({localDtlsRole:"client",localSdpObject:o}),g.debug("receive() | calling pc.setLocalDescription() [answer:%o]",i),await this._pc.setLocalDescription(i);for(const n of e){const{trackId:e}=n,i=r.get(e),o=this._pc.getTransceivers().find((e=>e.mid===i));if(!o)throw new Error("new RTCRtpTransceiver not found");this._mapMidTransceiver.set(i,o),t.push({localId:i,track:o.receiver.track,rtpReceiver:o.receiver})}return t}async stopReceiving(e){this.assertRecvDirection();for(const t of e){g.debug("stopReceiving() [localId:%s]",t);const e=this._mapMidTransceiver.get(t);if(!e)throw new Error("associated RTCRtpTransceiver not found");this._remoteSdp.closeMediaSection(e.mid)}const t={type:"offer",sdp:this._remoteSdp.getSdp()};g.debug("stopReceiving() | calling pc.setRemoteDescription() [offer:%o]",t),await this._pc.setRemoteDescription(t);const r=await this._pc.createAnswer();g.debug("stopReceiving() | calling pc.setLocalDescription() [answer:%o]",r),await this._pc.setLocalDescription(r);for(const t of e)this._mapMidTransceiver.delete(t)}async pauseReceiving(e){this.assertRecvDirection();for(const t of e){g.debug("pauseReceiving() [localId:%s]",t);const e=this._mapMidTransceiver.get(t);if(!e)throw new Error("associated RTCRtpTransceiver not found");e.direction="inactive",this._remoteSdp.pauseMediaSection(t)}const t={type:"offer",sdp:this._remoteSdp.getSdp()};g.debug("pauseReceiving() | calling pc.setRemoteDescription() [offer:%o]",t),await this._pc.setRemoteDescription(t);const r=await this._pc.createAnswer();g.debug("pauseReceiving() | calling pc.setLocalDescription() [answer:%o]",r),await this._pc.setLocalDescription(r)}async resumeReceiving(e){this.assertRecvDirection();for(const t of e){g.debug("resumeReceiving() [localId:%s]",t);const e=this._mapMidTransceiver.get(t);if(!e)throw new Error("associated RTCRtpTransceiver not found");e.direction="recvonly",this._remoteSdp.resumeReceivingMediaSection(t)}const t={type:"offer",sdp:this._remoteSdp.getSdp()};g.debug("resumeReceiving() | calling pc.setRemoteDescription() [offer:%o]",t),await this._pc.setRemoteDescription(t);const r=await this._pc.createAnswer();g.debug("resumeReceiving() | calling pc.setLocalDescription() [answer:%o]",r),await this._pc.setLocalDescription(r)}async getReceiverStats(e){this.assertRecvDirection();const t=this._mapMidTransceiver.get(e);if(!t)throw new Error("associated RTCRtpTransceiver not found");return t.receiver.getStats()}async receiveDataChannel({sctpStreamParameters:e,label:t,protocol:r}){this.assertRecvDirection();const{streamId:n,ordered:i,maxPacketLifeTime:o,maxRetransmits:s}=e,l={negotiated:!0,id:n,ordered:i,maxPacketLifeTime:o,maxRetransmits:s,protocol:r};g.debug("receiveDataChannel() [options:%o]",l);const c=this._pc.createDataChannel(t,l);if(!this._hasDataChannelMediaSection){this._remoteSdp.receiveSctpAssociation();const e={type:"offer",sdp:this._remoteSdp.getSdp()};g.debug("receiveDataChannel() | calling pc.setRemoteDescription() [offer:%o]",e),await this._pc.setRemoteDescription(e);const t=await this._pc.createAnswer();if(!this._transportReady){const e=a.parse(t.sdp);await this.setupTransport({localDtlsRole:"client",localSdpObject:e})}g.debug("receiveDataChannel() | calling pc.setRemoteDescription() [answer:%o]",t),await this._pc.setLocalDescription(t),this._hasDataChannelMediaSection=!0}return{dataChannel:c}}async setupTransport({localDtlsRole:e,localSdpObject:t}){t||(t=a.parse(this._pc.localDescription.sdp));const r=d.extractDtlsParameters({sdpObject:t});r.role=e,this._remoteSdp.updateDtlsRole("client"===e?"server":"client"),await new Promise(((e,t)=>{this.safeEmit("@connect",{dtlsParameters:r},e,t)})),this._transportReady=!0}assertSendDirection(){if("send"!==this._direction)throw new Error('method can just be called for handlers with "send" direction')}assertRecvDirection(){if("recv"!==this._direction)throw new Error('method can just be called for handlers with "recv" direction')}}t.Firefox60=y},2902:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HandlerInterface=void 0;const n=r(22010);class i extends n.EnhancedEventEmitter{constructor(){super()}}t.HandlerInterface=i},59352:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.ReactNative=void 0;const a=o(r(17363)),s=r(82994),l=r(34893),c=o(r(31765)),u=o(r(38046)),d=o(r(75544)),h=o(r(54496)),p=r(2902),f=r(41305),m=new s.Logger("ReactNative"),g={OS:1024,MIS:1024};class v extends p.HandlerInterface{static createFactory(){return()=>new v}constructor(){super(),this._sendStream=new MediaStream,this._mapSendLocalIdTrack=new Map,this._nextSendLocalId=0,this._mapRecvLocalIdInfo=new Map,this._hasDataChannelMediaSection=!1,this._nextSendSctpStreamId=0,this._transportReady=!1}get name(){return"ReactNative"}close(){if(m.debug("close()"),this._sendStream.release(!1),this._pc)try{this._pc.close()}catch(e){}this.emit("@close")}async getNativeRtpCapabilities(){m.debug("getNativeRtpCapabilities()");const e=new RTCPeerConnection({iceServers:[],iceTransportPolicy:"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require",sdpSemantics:"plan-b"});try{const t=await e.createOffer({offerToReceiveAudio:!0,offerToReceiveVideo:!0});try{e.close()}catch(e){}const r=a.parse(t.sdp);return d.extractRtpCapabilities({sdpObject:r})}catch(t){try{e.close()}catch(e){}throw t}}async getNativeSctpCapabilities(){return m.debug("getNativeSctpCapabilities()"),{numStreams:g}}run({direction:e,iceParameters:t,iceCandidates:r,dtlsParameters:n,sctpParameters:i,iceServers:o,iceTransportPolicy:a,additionalSettings:s,proprietaryConstraints:l,extendedRtpCapabilities:c}){m.debug("run()"),this._direction=e,this._remoteSdp=new f.RemoteSdp({iceParameters:t,iceCandidates:r,dtlsParameters:n,sctpParameters:i,planB:!0}),this._sendingRtpParametersByKind={audio:u.getSendingRtpParameters("audio",c),video:u.getSendingRtpParameters("video",c)},this._sendingRemoteRtpParametersByKind={audio:u.getSendingRemoteRtpParameters("audio",c),video:u.getSendingRemoteRtpParameters("video",c)},n.role&&"auto"!==n.role&&(this._forcedLocalDtlsRole="server"===n.role?"client":"server"),this._pc=new RTCPeerConnection({iceServers:o||[],iceTransportPolicy:a||"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require",sdpSemantics:"plan-b",...s},l),this._pc.connectionState?this._pc.addEventListener("connectionstatechange",(()=>{this.emit("@connectionstatechange",this._pc.connectionState)})):this._pc.addEventListener("iceconnectionstatechange",(()=>{switch(m.warn("run() | pc.connectionState not supported, using pc.iceConnectionState"),this._pc.iceConnectionState){case"checking":this.emit("@connectionstatechange","connecting");break;case"connected":case"completed":this.emit("@connectionstatechange","connected");break;case"failed":this.emit("@connectionstatechange","failed");break;case"disconnected":this.emit("@connectionstatechange","disconnected");break;case"closed":this.emit("@connectionstatechange","closed")}}))}async updateIceServers(e){m.debug("updateIceServers()");const t=this._pc.getConfiguration();t.iceServers=e,this._pc.setConfiguration(t)}async restartIce(e){if(m.debug("restartIce()"),this._remoteSdp.updateIceParameters(e),this._transportReady)if("send"===this._direction){const e=await this._pc.createOffer({iceRestart:!0});m.debug("restartIce() | calling pc.setLocalDescription() [offer:%o]",e),await this._pc.setLocalDescription(e);const t={type:"answer",sdp:this._remoteSdp.getSdp()};m.debug("restartIce() | calling pc.setRemoteDescription() [answer:%o]",t),await this._pc.setRemoteDescription(t)}else{const e={type:"offer",sdp:this._remoteSdp.getSdp()};m.debug("restartIce() | calling pc.setRemoteDescription() [offer:%o]",e),await this._pc.setRemoteDescription(e);const t=await this._pc.createAnswer();m.debug("restartIce() | calling pc.setLocalDescription() [answer:%o]",t),await this._pc.setLocalDescription(t)}}async getTransportStats(){return this._pc.getStats()}async send({track:e,encodings:t,codecOptions:r,codec:n}){var i;this.assertSendDirection(),m.debug("send() [kind:%s, track.id:%s]",e.kind,e.id),n&&m.warn("send() | codec selection is not available in %s handler",this.name),this._sendStream.addTrack(e),this._pc.addStream(this._sendStream);let o,s=await this._pc.createOffer(),l=a.parse(s.sdp);const p=c.clone(this._sendingRtpParametersByKind[e.kind],{});p.codecs=u.reduceCodecs(p.codecs);const f=c.clone(this._sendingRemoteRtpParametersByKind[e.kind],{});if(f.codecs=u.reduceCodecs(f.codecs),this._transportReady||await this.setupTransport({localDtlsRole:null!==(i=this._forcedLocalDtlsRole)&&void 0!==i?i:"client",localSdpObject:l}),"video"===e.kind&&t&&t.length>1&&(m.debug("send() | enabling simulcast"),l=a.parse(s.sdp),o=l.media.find((e=>"video"===e.type)),h.addLegacySimulcast({offerMediaObject:o,track:e,numStreams:t.length}),s={type:"offer",sdp:a.write(l)}),m.debug("send() | calling pc.setLocalDescription() [offer:%o]",s),await this._pc.setLocalDescription(s),l=a.parse(this._pc.localDescription.sdp),o=l.media.find((t=>t.type===e.kind)),p.rtcp.cname=d.getCname({offerMediaObject:o}),p.encodings=h.getRtpEncodings({offerMediaObject:o,track:e}),t)for(let e=0;e1&&("video/vp8"===p.codecs[0].mimeType.toLowerCase()||"video/h264"===p.codecs[0].mimeType.toLowerCase()))for(const e of p.encodings)e.scalabilityMode="L1T3";this._remoteSdp.send({offerMediaObject:o,offerRtpParameters:p,answerRtpParameters:f,codecOptions:r});const g={type:"answer",sdp:this._remoteSdp.getSdp()};m.debug("send() | calling pc.setRemoteDescription() [answer:%o]",g),await this._pc.setRemoteDescription(g);const v=String(this._nextSendLocalId);return this._nextSendLocalId++,this._mapSendLocalIdTrack.set(v,e),{localId:v,rtpParameters:p}}async stopSending(e){this.assertSendDirection(),m.debug("stopSending() [localId:%s]",e);const t=this._mapSendLocalIdTrack.get(e);if(!t)throw new Error("track not found");this._mapSendLocalIdTrack.delete(e),this._sendStream.removeTrack(t),this._pc.addStream(this._sendStream);const r=await this._pc.createOffer();m.debug("stopSending() | calling pc.setLocalDescription() [offer:%o]",r);try{await this._pc.setLocalDescription(r)}catch(e){if(0===this._sendStream.getTracks().length)return void m.warn("stopSending() | ignoring expected error due no sending tracks: %s",e.toString());throw e}if("stable"===this._pc.signalingState)return;const n={type:"answer",sdp:this._remoteSdp.getSdp()};m.debug("stopSending() | calling pc.setRemoteDescription() [answer:%o]",n),await this._pc.setRemoteDescription(n)}async pauseSending(e){}async resumeSending(e){}async replaceTrack(e,t){throw new l.UnsupportedError("not implemented")}async setMaxSpatialLayer(e,t){throw new l.UnsupportedError("not implemented")}async setRtpEncodingParameters(e,t){throw new l.UnsupportedError("not implemented")}async getSenderStats(e){throw new l.UnsupportedError("not implemented")}async sendDataChannel({ordered:e,maxPacketLifeTime:t,maxRetransmits:r,label:n,protocol:i}){var o;this.assertSendDirection();const s={negotiated:!0,id:this._nextSendSctpStreamId,ordered:e,maxPacketLifeTime:t,maxRetransmitTime:t,maxRetransmits:r,protocol:i};m.debug("sendDataChannel() [options:%o]",s);const l=this._pc.createDataChannel(n,s);if(this._nextSendSctpStreamId=++this._nextSendSctpStreamId%g.MIS,!this._hasDataChannelMediaSection){const e=await this._pc.createOffer(),t=a.parse(e.sdp),r=t.media.find((e=>"application"===e.type));this._transportReady||await this.setupTransport({localDtlsRole:null!==(o=this._forcedLocalDtlsRole)&&void 0!==o?o:"client",localSdpObject:t}),m.debug("sendDataChannel() | calling pc.setLocalDescription() [offer:%o]",e),await this._pc.setLocalDescription(e),this._remoteSdp.sendSctpAssociation({offerMediaObject:r});const n={type:"answer",sdp:this._remoteSdp.getSdp()};m.debug("sendDataChannel() | calling pc.setRemoteDescription() [answer:%o]",n),await this._pc.setRemoteDescription(n),this._hasDataChannelMediaSection=!0}return{dataChannel:l,sctpStreamParameters:{streamId:s.id,ordered:s.ordered,maxPacketLifeTime:s.maxPacketLifeTime,maxRetransmits:s.maxRetransmits}}}async receive(e){var t;this.assertRecvDirection();const r=[],n=new Map;for(const t of e){const{trackId:e,kind:r,rtpParameters:i}=t;m.debug("receive() [trackId:%s, kind:%s]",e,r);const o=r;let a=t.streamId||i.rtcp.cname;m.debug("receive() | forcing a random remote streamId to avoid well known bug in react-native-webrtc"),a+=`-hack-${c.generateRandomNumber()}`,n.set(e,a),this._remoteSdp.receive({mid:o,kind:r,offerRtpParameters:i,streamId:a,trackId:e})}const i={type:"offer",sdp:this._remoteSdp.getSdp()};m.debug("receive() | calling pc.setRemoteDescription() [offer:%o]",i),await this._pc.setRemoteDescription(i);let o=await this._pc.createAnswer();const s=a.parse(o.sdp);for(const t of e){const{kind:e,rtpParameters:r}=t,n=e,i=s.media.find((e=>String(e.mid)===n));d.applyCodecParameters({offerRtpParameters:r,answerMediaObject:i})}o={type:"answer",sdp:a.write(s)},this._transportReady||await this.setupTransport({localDtlsRole:null!==(t=this._forcedLocalDtlsRole)&&void 0!==t?t:"client",localSdpObject:s}),m.debug("receive() | calling pc.setLocalDescription() [answer:%o]",o),await this._pc.setLocalDescription(o);for(const t of e){const{kind:e,trackId:i,rtpParameters:o}=t,a=i,s=e,l=n.get(i),c=this._pc.getRemoteStreams().find((e=>e.id===l)).getTrackById(a);if(!c)throw new Error("remote track not found");this._mapRecvLocalIdInfo.set(a,{mid:s,rtpParameters:o}),r.push({localId:a,track:c})}return r}async stopReceiving(e){this.assertRecvDirection();for(const t of e){m.debug("stopReceiving() [localId:%s]",t);const{mid:e,rtpParameters:r}=this._mapRecvLocalIdInfo.get(t)||{};this._mapRecvLocalIdInfo.delete(t),this._remoteSdp.planBStopReceiving({mid:e,offerRtpParameters:r})}const t={type:"offer",sdp:this._remoteSdp.getSdp()};m.debug("stopReceiving() | calling pc.setRemoteDescription() [offer:%o]",t),await this._pc.setRemoteDescription(t);const r=await this._pc.createAnswer();m.debug("stopReceiving() | calling pc.setLocalDescription() [answer:%o]",r),await this._pc.setLocalDescription(r)}async pauseReceiving(e){}async resumeReceiving(e){}async getReceiverStats(e){throw new l.UnsupportedError("not implemented")}async receiveDataChannel({sctpStreamParameters:e,label:t,protocol:r}){var n;this.assertRecvDirection();const{streamId:i,ordered:o,maxPacketLifeTime:s,maxRetransmits:l}=e,c={negotiated:!0,id:i,ordered:o,maxPacketLifeTime:s,maxRetransmitTime:s,maxRetransmits:l,protocol:r};m.debug("receiveDataChannel() [options:%o]",c);const u=this._pc.createDataChannel(t,c);if(!this._hasDataChannelMediaSection){this._remoteSdp.receiveSctpAssociation({oldDataChannelSpec:!0});const e={type:"offer",sdp:this._remoteSdp.getSdp()};m.debug("receiveDataChannel() | calling pc.setRemoteDescription() [offer:%o]",e),await this._pc.setRemoteDescription(e);const t=await this._pc.createAnswer();if(!this._transportReady){const e=a.parse(t.sdp);await this.setupTransport({localDtlsRole:null!==(n=this._forcedLocalDtlsRole)&&void 0!==n?n:"client",localSdpObject:e})}m.debug("receiveDataChannel() | calling pc.setRemoteDescription() [answer:%o]",t),await this._pc.setLocalDescription(t),this._hasDataChannelMediaSection=!0}return{dataChannel:u}}async setupTransport({localDtlsRole:e,localSdpObject:t}){t||(t=a.parse(this._pc.localDescription.sdp));const r=d.extractDtlsParameters({sdpObject:t});r.role=e,this._remoteSdp.updateDtlsRole("client"===e?"server":"client"),await new Promise(((e,t)=>{this.safeEmit("@connect",{dtlsParameters:r},e,t)})),this._transportReady=!0}assertSendDirection(){if("send"!==this._direction)throw new Error('method can just be called for handlers with "send" direction')}assertRecvDirection(){if("recv"!==this._direction)throw new Error('method can just be called for handlers with "recv" direction')}}t.ReactNative=v},34039:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.ReactNativeUnifiedPlan=void 0;const a=o(r(17363)),s=r(82994),l=o(r(31765)),c=o(r(38046)),u=o(r(75544)),d=o(r(5938)),h=o(r(34256)),p=r(2902),f=r(41305),m=r(43303),g=new s.Logger("ReactNativeUnifiedPlan"),v={OS:1024,MIS:1024};class y extends p.HandlerInterface{static createFactory(){return()=>new y}constructor(){super(),this._mapMidTransceiver=new Map,this._sendStream=new MediaStream,this._hasDataChannelMediaSection=!1,this._nextSendSctpStreamId=0,this._transportReady=!1}get name(){return"ReactNativeUnifiedPlan"}close(){if(g.debug("close()"),this._sendStream.release(!1),this._pc)try{this._pc.close()}catch(e){}this.emit("@close")}async getNativeRtpCapabilities(){g.debug("getNativeRtpCapabilities()");const e=new RTCPeerConnection({iceServers:[],iceTransportPolicy:"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require",sdpSemantics:"unified-plan"});try{e.addTransceiver("audio"),e.addTransceiver("video");const t=await e.createOffer();try{e.close()}catch(e){}const r=a.parse(t.sdp),n=u.extractRtpCapabilities({sdpObject:r});return h.addNackSuppportForOpus(n),n}catch(t){try{e.close()}catch(e){}throw t}}async getNativeSctpCapabilities(){return g.debug("getNativeSctpCapabilities()"),{numStreams:v}}run({direction:e,iceParameters:t,iceCandidates:r,dtlsParameters:n,sctpParameters:i,iceServers:o,iceTransportPolicy:a,additionalSettings:s,proprietaryConstraints:l,extendedRtpCapabilities:u}){g.debug("run()"),this._direction=e,this._remoteSdp=new f.RemoteSdp({iceParameters:t,iceCandidates:r,dtlsParameters:n,sctpParameters:i}),this._sendingRtpParametersByKind={audio:c.getSendingRtpParameters("audio",u),video:c.getSendingRtpParameters("video",u)},this._sendingRemoteRtpParametersByKind={audio:c.getSendingRemoteRtpParameters("audio",u),video:c.getSendingRemoteRtpParameters("video",u)},n.role&&"auto"!==n.role&&(this._forcedLocalDtlsRole="server"===n.role?"client":"server"),this._pc=new RTCPeerConnection({iceServers:o||[],iceTransportPolicy:a||"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require",sdpSemantics:"unified-plan",...s},l),this._pc.connectionState?this._pc.addEventListener("connectionstatechange",(()=>{this.emit("@connectionstatechange",this._pc.connectionState)})):this._pc.addEventListener("iceconnectionstatechange",(()=>{switch(g.warn("run() | pc.connectionState not supported, using pc.iceConnectionState"),this._pc.iceConnectionState){case"checking":this.emit("@connectionstatechange","connecting");break;case"connected":case"completed":this.emit("@connectionstatechange","connected");break;case"failed":this.emit("@connectionstatechange","failed");break;case"disconnected":this.emit("@connectionstatechange","disconnected");break;case"closed":this.emit("@connectionstatechange","closed")}}))}async updateIceServers(e){g.debug("updateIceServers()");const t=this._pc.getConfiguration();t.iceServers=e,this._pc.setConfiguration(t)}async restartIce(e){if(g.debug("restartIce()"),this._remoteSdp.updateIceParameters(e),this._transportReady)if("send"===this._direction){const e=await this._pc.createOffer({iceRestart:!0});g.debug("restartIce() | calling pc.setLocalDescription() [offer:%o]",e),await this._pc.setLocalDescription(e);const t={type:"answer",sdp:this._remoteSdp.getSdp()};g.debug("restartIce() | calling pc.setRemoteDescription() [answer:%o]",t),await this._pc.setRemoteDescription(t)}else{const e={type:"offer",sdp:this._remoteSdp.getSdp()};g.debug("restartIce() | calling pc.setRemoteDescription() [offer:%o]",e),await this._pc.setRemoteDescription(e);const t=await this._pc.createAnswer();g.debug("restartIce() | calling pc.setLocalDescription() [answer:%o]",t),await this._pc.setLocalDescription(t)}}async getTransportStats(){return this._pc.getStats()}async send({track:e,encodings:t,codecOptions:r,codec:n}){var i;this.assertSendDirection(),g.debug("send() [kind:%s, track.id:%s]",e.kind,e.id),t&&t.length>1&&t.forEach(((e,t)=>{e.rid=`r${t}`}));const o=l.clone(this._sendingRtpParametersByKind[e.kind],{});o.codecs=c.reduceCodecs(o.codecs,n);const s=l.clone(this._sendingRemoteRtpParametersByKind[e.kind],{});s.codecs=c.reduceCodecs(s.codecs,n);const h=this._remoteSdp.getNextMediaSectionIdx(),p=this._pc.addTransceiver(e,{direction:"sendonly",streams:[this._sendStream],sendEncodings:t});let f,v=await this._pc.createOffer(),y=a.parse(v.sdp);this._transportReady||await this.setupTransport({localDtlsRole:null!==(i=this._forcedLocalDtlsRole)&&void 0!==i?i:"client",localSdpObject:y});let b=!1;const _=(0,m.parse)((t||[{}])[0].scalabilityMode);t&&1===t.length&&_.spatialLayers>1&&"video/vp9"===o.codecs[0].mimeType.toLowerCase()&&(g.debug("send() | enabling legacy simulcast for VP9 SVC"),b=!0,y=a.parse(v.sdp),f=y.media[h.idx],d.addLegacySimulcast({offerMediaObject:f,numStreams:_.spatialLayers}),v={type:"offer",sdp:a.write(y)}),g.debug("send() | calling pc.setLocalDescription() [offer:%o]",v),await this._pc.setLocalDescription(v);const S=p.mid;if(o.mid=S,y=a.parse(this._pc.localDescription.sdp),f=y.media[h.idx],o.rtcp.cname=u.getCname({offerMediaObject:f}),t)if(1===t.length){let e=d.getRtpEncodings({offerMediaObject:f});Object.assign(e[0],t[0]),b&&(e=[e[0]]),o.encodings=e}else o.encodings=t;else o.encodings=d.getRtpEncodings({offerMediaObject:f});if(o.encodings.length>1&&("video/vp8"===o.codecs[0].mimeType.toLowerCase()||"video/h264"===o.codecs[0].mimeType.toLowerCase()))for(const e of o.encodings)e.scalabilityMode?e.scalabilityMode=`L1T${_.temporalLayers}`:e.scalabilityMode="L1T3";this._remoteSdp.send({offerMediaObject:f,reuseMid:h.reuseMid,offerRtpParameters:o,answerRtpParameters:s,codecOptions:r,extmapAllowMixed:!0});const w={type:"answer",sdp:this._remoteSdp.getSdp()};return g.debug("send() | calling pc.setRemoteDescription() [answer:%o]",w),await this._pc.setRemoteDescription(w),this._mapMidTransceiver.set(S,p),{localId:S,rtpParameters:o,rtpSender:p.sender}}async stopSending(e){this.assertSendDirection(),g.debug("stopSending() [localId:%s]",e);const t=this._mapMidTransceiver.get(e);if(!t)throw new Error("associated RTCRtpTransceiver not found");if(t.sender.replaceTrack(null),this._pc.removeTrack(t.sender),this._remoteSdp.closeMediaSection(t.mid))try{t.stop()}catch(e){}const r=await this._pc.createOffer();g.debug("stopSending() | calling pc.setLocalDescription() [offer:%o]",r),await this._pc.setLocalDescription(r);const n={type:"answer",sdp:this._remoteSdp.getSdp()};g.debug("stopSending() | calling pc.setRemoteDescription() [answer:%o]",n),await this._pc.setRemoteDescription(n),this._mapMidTransceiver.delete(e)}async pauseSending(e){this.assertSendDirection(),g.debug("pauseSending() [localId:%s]",e);const t=this._mapMidTransceiver.get(e);if(!t)throw new Error("associated RTCRtpTransceiver not found");t.direction="inactive",this._remoteSdp.pauseMediaSection(e);const r=await this._pc.createOffer();g.debug("pauseSending() | calling pc.setLocalDescription() [offer:%o]",r),await this._pc.setLocalDescription(r);const n={type:"answer",sdp:this._remoteSdp.getSdp()};g.debug("pauseSending() | calling pc.setRemoteDescription() [answer:%o]",n),await this._pc.setRemoteDescription(n)}async resumeSending(e){this.assertSendDirection(),g.debug("resumeSending() [localId:%s]",e);const t=this._mapMidTransceiver.get(e);if(this._remoteSdp.resumeSendingMediaSection(e),!t)throw new Error("associated RTCRtpTransceiver not found");t.direction="sendonly";const r=await this._pc.createOffer();g.debug("resumeSending() | calling pc.setLocalDescription() [offer:%o]",r),await this._pc.setLocalDescription(r);const n={type:"answer",sdp:this._remoteSdp.getSdp()};g.debug("resumeSending() | calling pc.setRemoteDescription() [answer:%o]",n),await this._pc.setRemoteDescription(n)}async replaceTrack(e,t){this.assertSendDirection(),t?g.debug("replaceTrack() [localId:%s, track.id:%s]",e,t.id):g.debug("replaceTrack() [localId:%s, no track]",e);const r=this._mapMidTransceiver.get(e);if(!r)throw new Error("associated RTCRtpTransceiver not found");await r.sender.replaceTrack(t)}async setMaxSpatialLayer(e,t){this.assertSendDirection(),g.debug("setMaxSpatialLayer() [localId:%s, spatialLayer:%s]",e,t);const r=this._mapMidTransceiver.get(e);if(!r)throw new Error("associated RTCRtpTransceiver not found");const n=r.sender.getParameters();n.encodings.forEach(((e,r)=>{e.active=r<=t})),await r.sender.setParameters(n),this._remoteSdp.muxMediaSectionSimulcast(e,n.encodings);const i=await this._pc.createOffer();g.debug("setMaxSpatialLayer() | calling pc.setLocalDescription() [offer:%o]",i),await this._pc.setLocalDescription(i);const o={type:"answer",sdp:this._remoteSdp.getSdp()};g.debug("setMaxSpatialLayer() | calling pc.setRemoteDescription() [answer:%o]",o),await this._pc.setRemoteDescription(o)}async setRtpEncodingParameters(e,t){this.assertSendDirection(),g.debug("setRtpEncodingParameters() [localId:%s, params:%o]",e,t);const r=this._mapMidTransceiver.get(e);if(!r)throw new Error("associated RTCRtpTransceiver not found");const n=r.sender.getParameters();n.encodings.forEach(((e,r)=>{n.encodings[r]={...e,...t}})),await r.sender.setParameters(n),this._remoteSdp.muxMediaSectionSimulcast(e,n.encodings);const i=await this._pc.createOffer();g.debug("setRtpEncodingParameters() | calling pc.setLocalDescription() [offer:%o]",i),await this._pc.setLocalDescription(i);const o={type:"answer",sdp:this._remoteSdp.getSdp()};g.debug("setRtpEncodingParameters() | calling pc.setRemoteDescription() [answer:%o]",o),await this._pc.setRemoteDescription(o)}async getSenderStats(e){this.assertSendDirection();const t=this._mapMidTransceiver.get(e);if(!t)throw new Error("associated RTCRtpTransceiver not found");return t.sender.getStats()}async sendDataChannel({ordered:e,maxPacketLifeTime:t,maxRetransmits:r,label:n,protocol:i}){var o;this.assertSendDirection();const s={negotiated:!0,id:this._nextSendSctpStreamId,ordered:e,maxPacketLifeTime:t,maxRetransmits:r,protocol:i};g.debug("sendDataChannel() [options:%o]",s);const l=this._pc.createDataChannel(n,s);if(this._nextSendSctpStreamId=++this._nextSendSctpStreamId%v.MIS,!this._hasDataChannelMediaSection){const e=await this._pc.createOffer(),t=a.parse(e.sdp),r=t.media.find((e=>"application"===e.type));this._transportReady||await this.setupTransport({localDtlsRole:null!==(o=this._forcedLocalDtlsRole)&&void 0!==o?o:"client",localSdpObject:t}),g.debug("sendDataChannel() | calling pc.setLocalDescription() [offer:%o]",e),await this._pc.setLocalDescription(e),this._remoteSdp.sendSctpAssociation({offerMediaObject:r});const n={type:"answer",sdp:this._remoteSdp.getSdp()};g.debug("sendDataChannel() | calling pc.setRemoteDescription() [answer:%o]",n),await this._pc.setRemoteDescription(n),this._hasDataChannelMediaSection=!0}return{dataChannel:l,sctpStreamParameters:{streamId:s.id,ordered:s.ordered,maxPacketLifeTime:s.maxPacketLifeTime,maxRetransmits:s.maxRetransmits}}}async receive(e){var t;this.assertRecvDirection();const r=[],n=new Map;for(const t of e){const{trackId:e,kind:r,rtpParameters:i,streamId:o}=t;g.debug("receive() [trackId:%s, kind:%s]",e,r);const a=i.mid||String(this._mapMidTransceiver.size);n.set(e,a),this._remoteSdp.receive({mid:a,kind:r,offerRtpParameters:i,streamId:o||i.rtcp.cname,trackId:e})}const i={type:"offer",sdp:this._remoteSdp.getSdp()};g.debug("receive() | calling pc.setRemoteDescription() [offer:%o]",i),await this._pc.setRemoteDescription(i);let o=await this._pc.createAnswer();const s=a.parse(o.sdp);for(const t of e){const{trackId:e,rtpParameters:r}=t,i=n.get(e),o=s.media.find((e=>String(e.mid)===i));u.applyCodecParameters({offerRtpParameters:r,answerMediaObject:o})}o={type:"answer",sdp:a.write(s)},this._transportReady||await this.setupTransport({localDtlsRole:null!==(t=this._forcedLocalDtlsRole)&&void 0!==t?t:"client",localSdpObject:s}),g.debug("receive() | calling pc.setLocalDescription() [answer:%o]",o),await this._pc.setLocalDescription(o);for(const t of e){const{trackId:e}=t,i=n.get(e),o=this._pc.getTransceivers().find((e=>e.mid===i));if(!o)throw new Error("new RTCRtpTransceiver not found");this._mapMidTransceiver.set(i,o),r.push({localId:i,track:o.receiver.track,rtpReceiver:o.receiver})}return r}async stopReceiving(e){this.assertRecvDirection();for(const t of e){g.debug("stopReceiving() [localId:%s]",t);const e=this._mapMidTransceiver.get(t);if(!e)throw new Error("associated RTCRtpTransceiver not found");this._remoteSdp.closeMediaSection(e.mid)}const t={type:"offer",sdp:this._remoteSdp.getSdp()};g.debug("stopReceiving() | calling pc.setRemoteDescription() [offer:%o]",t),await this._pc.setRemoteDescription(t);const r=await this._pc.createAnswer();g.debug("stopReceiving() | calling pc.setLocalDescription() [answer:%o]",r),await this._pc.setLocalDescription(r);for(const t of e)this._mapMidTransceiver.delete(t)}async pauseReceiving(e){this.assertRecvDirection();for(const t of e){g.debug("pauseReceiving() [localId:%s]",t);const e=this._mapMidTransceiver.get(t);if(!e)throw new Error("associated RTCRtpTransceiver not found");e.direction="inactive",this._remoteSdp.pauseMediaSection(t)}const t={type:"offer",sdp:this._remoteSdp.getSdp()};g.debug("pauseReceiving() | calling pc.setRemoteDescription() [offer:%o]",t),await this._pc.setRemoteDescription(t);const r=await this._pc.createAnswer();g.debug("pauseReceiving() | calling pc.setLocalDescription() [answer:%o]",r),await this._pc.setLocalDescription(r)}async resumeReceiving(e){this.assertRecvDirection();for(const t of e){g.debug("resumeReceiving() [localId:%s]",t);const e=this._mapMidTransceiver.get(t);if(!e)throw new Error("associated RTCRtpTransceiver not found");e.direction="recvonly",this._remoteSdp.resumeReceivingMediaSection(t)}const t={type:"offer",sdp:this._remoteSdp.getSdp()};g.debug("resumeReceiving() | calling pc.setRemoteDescription() [offer:%o]",t),await this._pc.setRemoteDescription(t);const r=await this._pc.createAnswer();g.debug("resumeReceiving() | calling pc.setLocalDescription() [answer:%o]",r),await this._pc.setLocalDescription(r)}async getReceiverStats(e){this.assertRecvDirection();const t=this._mapMidTransceiver.get(e);if(!t)throw new Error("associated RTCRtpTransceiver not found");return t.receiver.getStats()}async receiveDataChannel({sctpStreamParameters:e,label:t,protocol:r}){var n;this.assertRecvDirection();const{streamId:i,ordered:o,maxPacketLifeTime:s,maxRetransmits:l}=e,c={negotiated:!0,id:i,ordered:o,maxPacketLifeTime:s,maxRetransmits:l,protocol:r};g.debug("receiveDataChannel() [options:%o]",c);const u=this._pc.createDataChannel(t,c);if(!this._hasDataChannelMediaSection){this._remoteSdp.receiveSctpAssociation();const e={type:"offer",sdp:this._remoteSdp.getSdp()};g.debug("receiveDataChannel() | calling pc.setRemoteDescription() [offer:%o]",e),await this._pc.setRemoteDescription(e);const t=await this._pc.createAnswer();if(!this._transportReady){const e=a.parse(t.sdp);await this.setupTransport({localDtlsRole:null!==(n=this._forcedLocalDtlsRole)&&void 0!==n?n:"client",localSdpObject:e})}g.debug("receiveDataChannel() | calling pc.setRemoteDescription() [answer:%o]",t),await this._pc.setLocalDescription(t),this._hasDataChannelMediaSection=!0}return{dataChannel:u}}async setupTransport({localDtlsRole:e,localSdpObject:t}){t||(t=a.parse(this._pc.localDescription.sdp));const r=u.extractDtlsParameters({sdpObject:t});r.role=e,this._remoteSdp.updateDtlsRole("client"===e?"server":"client"),await new Promise(((e,t)=>{this.safeEmit("@connect",{dtlsParameters:r},e,t)})),this._transportReady=!0}assertSendDirection(){if("send"!==this._direction)throw new Error('method can just be called for handlers with "send" direction')}assertRecvDirection(){if("recv"!==this._direction)throw new Error('method can just be called for handlers with "recv" direction')}}t.ReactNativeUnifiedPlan=y},59676:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.Safari11=void 0;const a=o(r(17363)),s=r(82994),l=o(r(31765)),c=o(r(38046)),u=o(r(75544)),d=o(r(54496)),h=r(2902),p=r(41305),f=new s.Logger("Safari11"),m={OS:1024,MIS:1024};class g extends h.HandlerInterface{static createFactory(){return()=>new g}constructor(){super(),this._sendStream=new MediaStream,this._mapSendLocalIdRtpSender=new Map,this._nextSendLocalId=0,this._mapRecvLocalIdInfo=new Map,this._hasDataChannelMediaSection=!1,this._nextSendSctpStreamId=0,this._transportReady=!1}get name(){return"Safari11"}close(){if(f.debug("close()"),this._pc)try{this._pc.close()}catch(e){}this.emit("@close")}async getNativeRtpCapabilities(){f.debug("getNativeRtpCapabilities()");const e=new RTCPeerConnection({iceServers:[],iceTransportPolicy:"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require",sdpSemantics:"plan-b"});try{const t=await e.createOffer({offerToReceiveAudio:!0,offerToReceiveVideo:!0});try{e.close()}catch(e){}const r=a.parse(t.sdp);return u.extractRtpCapabilities({sdpObject:r})}catch(t){try{e.close()}catch(e){}throw t}}async getNativeSctpCapabilities(){return f.debug("getNativeSctpCapabilities()"),{numStreams:m}}run({direction:e,iceParameters:t,iceCandidates:r,dtlsParameters:n,sctpParameters:i,iceServers:o,iceTransportPolicy:a,additionalSettings:s,proprietaryConstraints:l,extendedRtpCapabilities:u}){f.debug("run()"),this._direction=e,this._remoteSdp=new p.RemoteSdp({iceParameters:t,iceCandidates:r,dtlsParameters:n,sctpParameters:i,planB:!0}),this._sendingRtpParametersByKind={audio:c.getSendingRtpParameters("audio",u),video:c.getSendingRtpParameters("video",u)},this._sendingRemoteRtpParametersByKind={audio:c.getSendingRemoteRtpParameters("audio",u),video:c.getSendingRemoteRtpParameters("video",u)},n.role&&"auto"!==n.role&&(this._forcedLocalDtlsRole="server"===n.role?"client":"server"),this._pc=new RTCPeerConnection({iceServers:o||[],iceTransportPolicy:a||"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require",...s},l),this._pc.connectionState?this._pc.addEventListener("connectionstatechange",(()=>{this.emit("@connectionstatechange",this._pc.connectionState)})):this._pc.addEventListener("iceconnectionstatechange",(()=>{switch(f.warn("run() | pc.connectionState not supported, using pc.iceConnectionState"),this._pc.iceConnectionState){case"checking":this.emit("@connectionstatechange","connecting");break;case"connected":case"completed":this.emit("@connectionstatechange","connected");break;case"failed":this.emit("@connectionstatechange","failed");break;case"disconnected":this.emit("@connectionstatechange","disconnected");break;case"closed":this.emit("@connectionstatechange","closed")}}))}async updateIceServers(e){f.debug("updateIceServers()");const t=this._pc.getConfiguration();t.iceServers=e,this._pc.setConfiguration(t)}async restartIce(e){if(f.debug("restartIce()"),this._remoteSdp.updateIceParameters(e),this._transportReady)if("send"===this._direction){const e=await this._pc.createOffer({iceRestart:!0});f.debug("restartIce() | calling pc.setLocalDescription() [offer:%o]",e),await this._pc.setLocalDescription(e);const t={type:"answer",sdp:this._remoteSdp.getSdp()};f.debug("restartIce() | calling pc.setRemoteDescription() [answer:%o]",t),await this._pc.setRemoteDescription(t)}else{const e={type:"offer",sdp:this._remoteSdp.getSdp()};f.debug("restartIce() | calling pc.setRemoteDescription() [offer:%o]",e),await this._pc.setRemoteDescription(e);const t=await this._pc.createAnswer();f.debug("restartIce() | calling pc.setLocalDescription() [answer:%o]",t),await this._pc.setLocalDescription(t)}}async getTransportStats(){return this._pc.getStats()}async send({track:e,encodings:t,codecOptions:r,codec:n}){var i;this.assertSendDirection(),f.debug("send() [kind:%s, track.id:%s]",e.kind,e.id),n&&f.warn("send() | codec selection is not available in %s handler",this.name),this._sendStream.addTrack(e),this._pc.addTrack(e,this._sendStream);let o,s=await this._pc.createOffer(),h=a.parse(s.sdp);const p=l.clone(this._sendingRtpParametersByKind[e.kind],{});p.codecs=c.reduceCodecs(p.codecs);const m=l.clone(this._sendingRemoteRtpParametersByKind[e.kind],{});if(m.codecs=c.reduceCodecs(m.codecs),this._transportReady||await this.setupTransport({localDtlsRole:null!==(i=this._forcedLocalDtlsRole)&&void 0!==i?i:"client",localSdpObject:h}),"video"===e.kind&&t&&t.length>1&&(f.debug("send() | enabling simulcast"),h=a.parse(s.sdp),o=h.media.find((e=>"video"===e.type)),d.addLegacySimulcast({offerMediaObject:o,track:e,numStreams:t.length}),s={type:"offer",sdp:a.write(h)}),f.debug("send() | calling pc.setLocalDescription() [offer:%o]",s),await this._pc.setLocalDescription(s),h=a.parse(this._pc.localDescription.sdp),o=h.media.find((t=>t.type===e.kind)),p.rtcp.cname=u.getCname({offerMediaObject:o}),p.encodings=d.getRtpEncodings({offerMediaObject:o,track:e}),t)for(let e=0;e1&&"video/vp8"===p.codecs[0].mimeType.toLowerCase())for(const e of p.encodings)e.scalabilityMode="L1T3";this._remoteSdp.send({offerMediaObject:o,offerRtpParameters:p,answerRtpParameters:m,codecOptions:r});const g={type:"answer",sdp:this._remoteSdp.getSdp()};f.debug("send() | calling pc.setRemoteDescription() [answer:%o]",g),await this._pc.setRemoteDescription(g);const v=String(this._nextSendLocalId);this._nextSendLocalId++;const y=this._pc.getSenders().find((t=>t.track===e));return this._mapSendLocalIdRtpSender.set(v,y),{localId:v,rtpParameters:p,rtpSender:y}}async stopSending(e){this.assertSendDirection();const t=this._mapSendLocalIdRtpSender.get(e);if(!t)throw new Error("associated RTCRtpSender not found");t.track&&this._sendStream.removeTrack(t.track),this._mapSendLocalIdRtpSender.delete(e);const r=await this._pc.createOffer();f.debug("stopSending() | calling pc.setLocalDescription() [offer:%o]",r);try{await this._pc.setLocalDescription(r)}catch(e){if(0===this._sendStream.getTracks().length)return void f.warn("stopSending() | ignoring expected error due no sending tracks: %s",e.toString());throw e}if("stable"===this._pc.signalingState)return;const n={type:"answer",sdp:this._remoteSdp.getSdp()};f.debug("stopSending() | calling pc.setRemoteDescription() [answer:%o]",n),await this._pc.setRemoteDescription(n)}async pauseSending(e){}async resumeSending(e){}async replaceTrack(e,t){this.assertSendDirection(),t?f.debug("replaceTrack() [localId:%s, track.id:%s]",e,t.id):f.debug("replaceTrack() [localId:%s, no track]",e);const r=this._mapSendLocalIdRtpSender.get(e);if(!r)throw new Error("associated RTCRtpSender not found");const n=r.track;await r.replaceTrack(t),n&&this._sendStream.removeTrack(n),t&&this._sendStream.addTrack(t)}async setMaxSpatialLayer(e,t){this.assertSendDirection(),f.debug("setMaxSpatialLayer() [localId:%s, spatialLayer:%s]",e,t);const r=this._mapSendLocalIdRtpSender.get(e);if(!r)throw new Error("associated RTCRtpSender not found");const n=r.getParameters();n.encodings.forEach(((e,r)=>{e.active=r<=t})),await r.setParameters(n)}async setRtpEncodingParameters(e,t){this.assertSendDirection(),f.debug("setRtpEncodingParameters() [localId:%s, params:%o]",e,t);const r=this._mapSendLocalIdRtpSender.get(e);if(!r)throw new Error("associated RTCRtpSender not found");const n=r.getParameters();n.encodings.forEach(((e,r)=>{n.encodings[r]={...e,...t}})),await r.setParameters(n)}async getSenderStats(e){this.assertSendDirection();const t=this._mapSendLocalIdRtpSender.get(e);if(!t)throw new Error("associated RTCRtpSender not found");return t.getStats()}async sendDataChannel({ordered:e,maxPacketLifeTime:t,maxRetransmits:r,label:n,protocol:i}){var o;this.assertSendDirection();const s={negotiated:!0,id:this._nextSendSctpStreamId,ordered:e,maxPacketLifeTime:t,maxRetransmits:r,protocol:i};f.debug("sendDataChannel() [options:%o]",s);const l=this._pc.createDataChannel(n,s);if(this._nextSendSctpStreamId=++this._nextSendSctpStreamId%m.MIS,!this._hasDataChannelMediaSection){const e=await this._pc.createOffer(),t=a.parse(e.sdp),r=t.media.find((e=>"application"===e.type));this._transportReady||await this.setupTransport({localDtlsRole:null!==(o=this._forcedLocalDtlsRole)&&void 0!==o?o:"client",localSdpObject:t}),f.debug("sendDataChannel() | calling pc.setLocalDescription() [offer:%o]",e),await this._pc.setLocalDescription(e),this._remoteSdp.sendSctpAssociation({offerMediaObject:r});const n={type:"answer",sdp:this._remoteSdp.getSdp()};f.debug("sendDataChannel() | calling pc.setRemoteDescription() [answer:%o]",n),await this._pc.setRemoteDescription(n),this._hasDataChannelMediaSection=!0}return{dataChannel:l,sctpStreamParameters:{streamId:s.id,ordered:s.ordered,maxPacketLifeTime:s.maxPacketLifeTime,maxRetransmits:s.maxRetransmits}}}async receive(e){var t;this.assertRecvDirection();const r=[];for(const t of e){const{trackId:e,kind:r,rtpParameters:n,streamId:i}=t;f.debug("receive() [trackId:%s, kind:%s]",e,r);const o=r;this._remoteSdp.receive({mid:o,kind:r,offerRtpParameters:n,streamId:i||n.rtcp.cname,trackId:e})}const n={type:"offer",sdp:this._remoteSdp.getSdp()};f.debug("receive() | calling pc.setRemoteDescription() [offer:%o]",n),await this._pc.setRemoteDescription(n);let i=await this._pc.createAnswer();const o=a.parse(i.sdp);for(const t of e){const{kind:e,rtpParameters:r}=t,n=e,i=o.media.find((e=>String(e.mid)===n));u.applyCodecParameters({offerRtpParameters:r,answerMediaObject:i})}i={type:"answer",sdp:a.write(o)},this._transportReady||await this.setupTransport({localDtlsRole:null!==(t=this._forcedLocalDtlsRole)&&void 0!==t?t:"client",localSdpObject:o}),f.debug("receive() | calling pc.setLocalDescription() [answer:%o]",i),await this._pc.setLocalDescription(i);for(const t of e){const{kind:e,trackId:n,rtpParameters:i}=t,o=e,a=n,s=this._pc.getReceivers().find((e=>e.track&&e.track.id===a));if(!s)throw new Error("new RTCRtpReceiver not");this._mapRecvLocalIdInfo.set(a,{mid:o,rtpParameters:i,rtpReceiver:s}),r.push({localId:a,track:s.track,rtpReceiver:s})}return r}async stopReceiving(e){this.assertRecvDirection();for(const t of e){f.debug("stopReceiving() [localId:%s]",t);const{mid:e,rtpParameters:r}=this._mapRecvLocalIdInfo.get(t)||{};this._mapRecvLocalIdInfo.delete(t),this._remoteSdp.planBStopReceiving({mid:e,offerRtpParameters:r})}const t={type:"offer",sdp:this._remoteSdp.getSdp()};f.debug("stopReceiving() | calling pc.setRemoteDescription() [offer:%o]",t),await this._pc.setRemoteDescription(t);const r=await this._pc.createAnswer();f.debug("stopReceiving() | calling pc.setLocalDescription() [answer:%o]",r),await this._pc.setLocalDescription(r)}async getReceiverStats(e){this.assertRecvDirection();const{rtpReceiver:t}=this._mapRecvLocalIdInfo.get(e)||{};if(!t)throw new Error("associated RTCRtpReceiver not found");return t.getStats()}async pauseReceiving(e){}async resumeReceiving(e){}async receiveDataChannel({sctpStreamParameters:e,label:t,protocol:r}){var n;this.assertRecvDirection();const{streamId:i,ordered:o,maxPacketLifeTime:s,maxRetransmits:l}=e,c={negotiated:!0,id:i,ordered:o,maxPacketLifeTime:s,maxRetransmits:l,protocol:r};f.debug("receiveDataChannel() [options:%o]",c);const u=this._pc.createDataChannel(t,c);if(!this._hasDataChannelMediaSection){this._remoteSdp.receiveSctpAssociation({oldDataChannelSpec:!0});const e={type:"offer",sdp:this._remoteSdp.getSdp()};f.debug("receiveDataChannel() | calling pc.setRemoteDescription() [offer:%o]",e),await this._pc.setRemoteDescription(e);const t=await this._pc.createAnswer();if(!this._transportReady){const e=a.parse(t.sdp);await this.setupTransport({localDtlsRole:null!==(n=this._forcedLocalDtlsRole)&&void 0!==n?n:"client",localSdpObject:e})}f.debug("receiveDataChannel() | calling pc.setRemoteDescription() [answer:%o]",t),await this._pc.setLocalDescription(t),this._hasDataChannelMediaSection=!0}return{dataChannel:u}}async setupTransport({localDtlsRole:e,localSdpObject:t}){t||(t=a.parse(this._pc.localDescription.sdp));const r=u.extractDtlsParameters({sdpObject:t});r.role=e,this._remoteSdp.updateDtlsRole("client"===e?"server":"client"),await new Promise(((e,t)=>{this.safeEmit("@connect",{dtlsParameters:r},e,t)})),this._transportReady=!0}assertSendDirection(){if("send"!==this._direction)throw new Error('method can just be called for handlers with "send" direction')}assertRecvDirection(){if("recv"!==this._direction)throw new Error('method can just be called for handlers with "recv" direction')}}t.Safari11=g},28146:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.Safari12=void 0;const a=o(r(17363)),s=r(82994),l=o(r(31765)),c=o(r(38046)),u=o(r(75544)),d=o(r(5938)),h=o(r(34256)),p=r(2902),f=r(41305),m=r(43303),g=new s.Logger("Safari12"),v={OS:1024,MIS:1024};class y extends p.HandlerInterface{static createFactory(){return()=>new y}constructor(){super(),this._mapMidTransceiver=new Map,this._sendStream=new MediaStream,this._hasDataChannelMediaSection=!1,this._nextSendSctpStreamId=0,this._transportReady=!1}get name(){return"Safari12"}close(){if(g.debug("close()"),this._pc)try{this._pc.close()}catch(e){}this.emit("@close")}async getNativeRtpCapabilities(){g.debug("getNativeRtpCapabilities()");const e=new RTCPeerConnection({iceServers:[],iceTransportPolicy:"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require"});try{e.addTransceiver("audio"),e.addTransceiver("video");const t=await e.createOffer();try{e.close()}catch(e){}const r=a.parse(t.sdp),n=u.extractRtpCapabilities({sdpObject:r});return h.addNackSuppportForOpus(n),n}catch(t){try{e.close()}catch(e){}throw t}}async getNativeSctpCapabilities(){return g.debug("getNativeSctpCapabilities()"),{numStreams:v}}run({direction:e,iceParameters:t,iceCandidates:r,dtlsParameters:n,sctpParameters:i,iceServers:o,iceTransportPolicy:a,additionalSettings:s,proprietaryConstraints:l,extendedRtpCapabilities:u}){g.debug("run()"),this._direction=e,this._remoteSdp=new f.RemoteSdp({iceParameters:t,iceCandidates:r,dtlsParameters:n,sctpParameters:i}),this._sendingRtpParametersByKind={audio:c.getSendingRtpParameters("audio",u),video:c.getSendingRtpParameters("video",u)},this._sendingRemoteRtpParametersByKind={audio:c.getSendingRemoteRtpParameters("audio",u),video:c.getSendingRemoteRtpParameters("video",u)},n.role&&"auto"!==n.role&&(this._forcedLocalDtlsRole="server"===n.role?"client":"server"),this._pc=new RTCPeerConnection({iceServers:o||[],iceTransportPolicy:a||"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require",...s},l),this._pc.connectionState?this._pc.addEventListener("connectionstatechange",(()=>{this.emit("@connectionstatechange",this._pc.connectionState)})):this._pc.addEventListener("iceconnectionstatechange",(()=>{switch(g.warn("run() | pc.connectionState not supported, using pc.iceConnectionState"),this._pc.iceConnectionState){case"checking":this.emit("@connectionstatechange","connecting");break;case"connected":case"completed":this.emit("@connectionstatechange","connected");break;case"failed":this.emit("@connectionstatechange","failed");break;case"disconnected":this.emit("@connectionstatechange","disconnected");break;case"closed":this.emit("@connectionstatechange","closed")}}))}async updateIceServers(e){g.debug("updateIceServers()");const t=this._pc.getConfiguration();t.iceServers=e,this._pc.setConfiguration(t)}async restartIce(e){if(g.debug("restartIce()"),this._remoteSdp.updateIceParameters(e),this._transportReady)if("send"===this._direction){const e=await this._pc.createOffer({iceRestart:!0});g.debug("restartIce() | calling pc.setLocalDescription() [offer:%o]",e),await this._pc.setLocalDescription(e);const t={type:"answer",sdp:this._remoteSdp.getSdp()};g.debug("restartIce() | calling pc.setRemoteDescription() [answer:%o]",t),await this._pc.setRemoteDescription(t)}else{const e={type:"offer",sdp:this._remoteSdp.getSdp()};g.debug("restartIce() | calling pc.setRemoteDescription() [offer:%o]",e),await this._pc.setRemoteDescription(e);const t=await this._pc.createAnswer();g.debug("restartIce() | calling pc.setLocalDescription() [answer:%o]",t),await this._pc.setLocalDescription(t)}}async getTransportStats(){return this._pc.getStats()}async send({track:e,encodings:t,codecOptions:r,codec:n}){var i;this.assertSendDirection(),g.debug("send() [kind:%s, track.id:%s]",e.kind,e.id);const o=l.clone(this._sendingRtpParametersByKind[e.kind],{});o.codecs=c.reduceCodecs(o.codecs,n);const s=l.clone(this._sendingRemoteRtpParametersByKind[e.kind],{});s.codecs=c.reduceCodecs(s.codecs,n);const h=this._remoteSdp.getNextMediaSectionIdx(),p=this._pc.addTransceiver(e,{direction:"sendonly",streams:[this._sendStream]});let f,v=await this._pc.createOffer(),y=a.parse(v.sdp);this._transportReady||await this.setupTransport({localDtlsRole:null!==(i=this._forcedLocalDtlsRole)&&void 0!==i?i:"client",localSdpObject:y});const b=(0,m.parse)((t||[{}])[0].scalabilityMode);t&&t.length>1&&(g.debug("send() | enabling legacy simulcast"),y=a.parse(v.sdp),f=y.media[h.idx],d.addLegacySimulcast({offerMediaObject:f,numStreams:t.length}),v={type:"offer",sdp:a.write(y)}),g.debug("send() | calling pc.setLocalDescription() [offer:%o]",v),await this._pc.setLocalDescription(v);const _=p.mid;if(o.mid=_,y=a.parse(this._pc.localDescription.sdp),f=y.media[h.idx],o.rtcp.cname=u.getCname({offerMediaObject:f}),o.encodings=d.getRtpEncodings({offerMediaObject:f}),t)for(let e=0;e1&&("video/vp8"===o.codecs[0].mimeType.toLowerCase()||"video/h264"===o.codecs[0].mimeType.toLowerCase()))for(const e of o.encodings)e.scalabilityMode?e.scalabilityMode=`L1T${b.temporalLayers}`:e.scalabilityMode="L1T3";this._remoteSdp.send({offerMediaObject:f,reuseMid:h.reuseMid,offerRtpParameters:o,answerRtpParameters:s,codecOptions:r});const S={type:"answer",sdp:this._remoteSdp.getSdp()};return g.debug("send() | calling pc.setRemoteDescription() [answer:%o]",S),await this._pc.setRemoteDescription(S),this._mapMidTransceiver.set(_,p),{localId:_,rtpParameters:o,rtpSender:p.sender}}async stopSending(e){this.assertSendDirection(),g.debug("stopSending() [localId:%s]",e);const t=this._mapMidTransceiver.get(e);if(!t)throw new Error("associated RTCRtpTransceiver not found");if(t.sender.replaceTrack(null),this._pc.removeTrack(t.sender),this._remoteSdp.closeMediaSection(t.mid))try{t.stop()}catch(e){}const r=await this._pc.createOffer();g.debug("stopSending() | calling pc.setLocalDescription() [offer:%o]",r),await this._pc.setLocalDescription(r);const n={type:"answer",sdp:this._remoteSdp.getSdp()};g.debug("stopSending() | calling pc.setRemoteDescription() [answer:%o]",n),await this._pc.setRemoteDescription(n),this._mapMidTransceiver.delete(e)}async pauseSending(e){this.assertSendDirection(),g.debug("pauseSending() [localId:%s]",e);const t=this._mapMidTransceiver.get(e);if(!t)throw new Error("associated RTCRtpTransceiver not found");t.direction="inactive",this._remoteSdp.pauseMediaSection(e);const r=await this._pc.createOffer();g.debug("pauseSending() | calling pc.setLocalDescription() [offer:%o]",r),await this._pc.setLocalDescription(r);const n={type:"answer",sdp:this._remoteSdp.getSdp()};g.debug("pauseSending() | calling pc.setRemoteDescription() [answer:%o]",n),await this._pc.setRemoteDescription(n)}async resumeSending(e){this.assertSendDirection(),g.debug("resumeSending() [localId:%s]",e);const t=this._mapMidTransceiver.get(e);if(!t)throw new Error("associated RTCRtpTransceiver not found");t.direction="sendonly",this._remoteSdp.resumeSendingMediaSection(e);const r=await this._pc.createOffer();g.debug("resumeSending() | calling pc.setLocalDescription() [offer:%o]",r),await this._pc.setLocalDescription(r);const n={type:"answer",sdp:this._remoteSdp.getSdp()};g.debug("resumeSending() | calling pc.setRemoteDescription() [answer:%o]",n),await this._pc.setRemoteDescription(n)}async replaceTrack(e,t){this.assertSendDirection(),t?g.debug("replaceTrack() [localId:%s, track.id:%s]",e,t.id):g.debug("replaceTrack() [localId:%s, no track]",e);const r=this._mapMidTransceiver.get(e);if(!r)throw new Error("associated RTCRtpTransceiver not found");await r.sender.replaceTrack(t)}async setMaxSpatialLayer(e,t){this.assertSendDirection(),g.debug("setMaxSpatialLayer() [localId:%s, spatialLayer:%s]",e,t);const r=this._mapMidTransceiver.get(e);if(!r)throw new Error("associated RTCRtpTransceiver not found");const n=r.sender.getParameters();n.encodings.forEach(((e,r)=>{e.active=r<=t})),await r.sender.setParameters(n),this._remoteSdp.muxMediaSectionSimulcast(e,n.encodings);const i=await this._pc.createOffer();g.debug("setMaxSpatialLayer() | calling pc.setLocalDescription() [offer:%o]",i),await this._pc.setLocalDescription(i);const o={type:"answer",sdp:this._remoteSdp.getSdp()};g.debug("setMaxSpatialLayer() | calling pc.setRemoteDescription() [answer:%o]",o),await this._pc.setRemoteDescription(o)}async setRtpEncodingParameters(e,t){this.assertSendDirection(),g.debug("setRtpEncodingParameters() [localId:%s, params:%o]",e,t);const r=this._mapMidTransceiver.get(e);if(!r)throw new Error("associated RTCRtpTransceiver not found");const n=r.sender.getParameters();n.encodings.forEach(((e,r)=>{n.encodings[r]={...e,...t}})),await r.sender.setParameters(n),this._remoteSdp.muxMediaSectionSimulcast(e,n.encodings);const i=await this._pc.createOffer();g.debug("setRtpEncodingParameters() | calling pc.setLocalDescription() [offer:%o]",i),await this._pc.setLocalDescription(i);const o={type:"answer",sdp:this._remoteSdp.getSdp()};g.debug("setRtpEncodingParameters() | calling pc.setRemoteDescription() [answer:%o]",o),await this._pc.setRemoteDescription(o)}async getSenderStats(e){this.assertSendDirection();const t=this._mapMidTransceiver.get(e);if(!t)throw new Error("associated RTCRtpTransceiver not found");return t.sender.getStats()}async sendDataChannel({ordered:e,maxPacketLifeTime:t,maxRetransmits:r,label:n,protocol:i}){var o;this.assertSendDirection();const s={negotiated:!0,id:this._nextSendSctpStreamId,ordered:e,maxPacketLifeTime:t,maxRetransmits:r,protocol:i};g.debug("sendDataChannel() [options:%o]",s);const l=this._pc.createDataChannel(n,s);if(this._nextSendSctpStreamId=++this._nextSendSctpStreamId%v.MIS,!this._hasDataChannelMediaSection){const e=await this._pc.createOffer(),t=a.parse(e.sdp),r=t.media.find((e=>"application"===e.type));this._transportReady||await this.setupTransport({localDtlsRole:null!==(o=this._forcedLocalDtlsRole)&&void 0!==o?o:"client",localSdpObject:t}),g.debug("sendDataChannel() | calling pc.setLocalDescription() [offer:%o]",e),await this._pc.setLocalDescription(e),this._remoteSdp.sendSctpAssociation({offerMediaObject:r});const n={type:"answer",sdp:this._remoteSdp.getSdp()};g.debug("sendDataChannel() | calling pc.setRemoteDescription() [answer:%o]",n),await this._pc.setRemoteDescription(n),this._hasDataChannelMediaSection=!0}return{dataChannel:l,sctpStreamParameters:{streamId:s.id,ordered:s.ordered,maxPacketLifeTime:s.maxPacketLifeTime,maxRetransmits:s.maxRetransmits}}}async receive(e){var t;this.assertRecvDirection();const r=[],n=new Map;for(const t of e){const{trackId:e,kind:r,rtpParameters:i,streamId:o}=t;g.debug("receive() [trackId:%s, kind:%s]",e,r);const a=i.mid||String(this._mapMidTransceiver.size);n.set(e,a),this._remoteSdp.receive({mid:a,kind:r,offerRtpParameters:i,streamId:o||i.rtcp.cname,trackId:e})}const i={type:"offer",sdp:this._remoteSdp.getSdp()};g.debug("receive() | calling pc.setRemoteDescription() [offer:%o]",i),await this._pc.setRemoteDescription(i);let o=await this._pc.createAnswer();const s=a.parse(o.sdp);for(const t of e){const{trackId:e,rtpParameters:r}=t,i=n.get(e),o=s.media.find((e=>String(e.mid)===i));u.applyCodecParameters({offerRtpParameters:r,answerMediaObject:o})}o={type:"answer",sdp:a.write(s)},this._transportReady||await this.setupTransport({localDtlsRole:null!==(t=this._forcedLocalDtlsRole)&&void 0!==t?t:"client",localSdpObject:s}),g.debug("receive() | calling pc.setLocalDescription() [answer:%o]",o),await this._pc.setLocalDescription(o);for(const t of e){const{trackId:e}=t,i=n.get(e),o=this._pc.getTransceivers().find((e=>e.mid===i));if(!o)throw new Error("new RTCRtpTransceiver not found");this._mapMidTransceiver.set(i,o),r.push({localId:i,track:o.receiver.track,rtpReceiver:o.receiver})}return r}async stopReceiving(e){this.assertRecvDirection();for(const t of e){g.debug("stopReceiving() [localId:%s]",t);const e=this._mapMidTransceiver.get(t);if(!e)throw new Error("associated RTCRtpTransceiver not found");this._remoteSdp.closeMediaSection(e.mid)}const t={type:"offer",sdp:this._remoteSdp.getSdp()};g.debug("stopReceiving() | calling pc.setRemoteDescription() [offer:%o]",t),await this._pc.setRemoteDescription(t);const r=await this._pc.createAnswer();g.debug("stopReceiving() | calling pc.setLocalDescription() [answer:%o]",r),await this._pc.setLocalDescription(r);for(const t of e)this._mapMidTransceiver.delete(t)}async pauseReceiving(e){this.assertRecvDirection();for(const t of e){g.debug("pauseReceiving() [localId:%s]",t);const e=this._mapMidTransceiver.get(t);if(!e)throw new Error("associated RTCRtpTransceiver not found");e.direction="inactive",this._remoteSdp.pauseMediaSection(t)}const t={type:"offer",sdp:this._remoteSdp.getSdp()};g.debug("pauseReceiving() | calling pc.setRemoteDescription() [offer:%o]",t),await this._pc.setRemoteDescription(t);const r=await this._pc.createAnswer();g.debug("pauseReceiving() | calling pc.setLocalDescription() [answer:%o]",r),await this._pc.setLocalDescription(r)}async resumeReceiving(e){this.assertRecvDirection();for(const t of e){g.debug("resumeReceiving() [localId:%s]",t);const e=this._mapMidTransceiver.get(t);if(!e)throw new Error("associated RTCRtpTransceiver not found");e.direction="recvonly",this._remoteSdp.resumeReceivingMediaSection(t)}const t={type:"offer",sdp:this._remoteSdp.getSdp()};g.debug("resumeReceiving() | calling pc.setRemoteDescription() [offer:%o]",t),await this._pc.setRemoteDescription(t);const r=await this._pc.createAnswer();g.debug("resumeReceiving() | calling pc.setLocalDescription() [answer:%o]",r),await this._pc.setLocalDescription(r)}async getReceiverStats(e){this.assertRecvDirection();const t=this._mapMidTransceiver.get(e);if(!t)throw new Error("associated RTCRtpTransceiver not found");return t.receiver.getStats()}async receiveDataChannel({sctpStreamParameters:e,label:t,protocol:r}){var n;this.assertRecvDirection();const{streamId:i,ordered:o,maxPacketLifeTime:s,maxRetransmits:l}=e,c={negotiated:!0,id:i,ordered:o,maxPacketLifeTime:s,maxRetransmits:l,protocol:r};g.debug("receiveDataChannel() [options:%o]",c);const u=this._pc.createDataChannel(t,c);if(!this._hasDataChannelMediaSection){this._remoteSdp.receiveSctpAssociation();const e={type:"offer",sdp:this._remoteSdp.getSdp()};g.debug("receiveDataChannel() | calling pc.setRemoteDescription() [offer:%o]",e),await this._pc.setRemoteDescription(e);const t=await this._pc.createAnswer();if(!this._transportReady){const e=a.parse(t.sdp);await this.setupTransport({localDtlsRole:null!==(n=this._forcedLocalDtlsRole)&&void 0!==n?n:"client",localSdpObject:e})}g.debug("receiveDataChannel() | calling pc.setRemoteDescription() [answer:%o]",t),await this._pc.setLocalDescription(t),this._hasDataChannelMediaSection=!0}return{dataChannel:u}}async setupTransport({localDtlsRole:e,localSdpObject:t}){t||(t=a.parse(this._pc.localDescription.sdp));const r=u.extractDtlsParameters({sdpObject:t});r.role=e,this._remoteSdp.updateDtlsRole("client"===e?"server":"client"),await new Promise(((e,t)=>{this.safeEmit("@connect",{dtlsParameters:r},e,t)})),this._transportReady=!0}assertSendDirection(){if("send"!==this._direction)throw new Error('method can just be called for handlers with "send" direction')}assertRecvDirection(){if("recv"!==this._direction)throw new Error('method can just be called for handlers with "recv" direction')}}t.Safari12=y},68751:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.mangleRtpParameters=t.getCapabilities=void 0;const a=o(r(31765));t.getCapabilities=function(){const e=RTCRtpReceiver.getCapabilities(),t=a.clone(e,{});for(const e of t.codecs){if(e.channels=e.numChannels,delete e.numChannels,e.mimeType=e.mimeType||`${e.kind}/${e.name}`,e.parameters){const t=e.parameters;t.apt&&(t.apt=Number(t.apt)),t["packetization-mode"]&&(t["packetization-mode"]=Number(t["packetization-mode"]))}for(const t of e.rtcpFeedback||[])t.parameter||(t.parameter="")}return t},t.mangleRtpParameters=function(e){const t=a.clone(e,{});t.mid&&(t.muxId=t.mid,delete t.mid);for(const e of t.codecs)e.channels&&(e.numChannels=e.channels,delete e.channels),e.mimeType&&!e.name&&(e.name=e.mimeType.split("/")[1]),delete e.mimeType;return t}},34256:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addNackSuppportForOpus=void 0,t.addNackSuppportForOpus=function(e){var t;for(const r of e.codecs||[])"audio/opus"!==r.mimeType.toLowerCase()&&"audio/multiopus"!==r.mimeType.toLowerCase()||(null===(t=r.rtcpFeedback)||void 0===t?void 0:t.some((e=>"nack"===e.type&&!e.parameter)))||(r.rtcpFeedback||(r.rtcpFeedback=[]),r.rtcpFeedback.push({type:"nack"}))}},3471:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.OfferMediaSection=t.AnswerMediaSection=t.MediaSection=void 0;const a=o(r(17363)),s=o(r(31765));class l{constructor({iceParameters:e,iceCandidates:t,dtlsParameters:r,planB:n=!1}){if(this._mediaObject={},this._planB=n,e&&this.setIceParameters(e),t){this._mediaObject.candidates=[];for(const e of t){const t={component:1};t.foundation=e.foundation,t.ip=e.ip,t.port=e.port,t.priority=e.priority,t.transport=e.protocol,t.type=e.type,e.tcpType&&(t.tcptype=e.tcpType),this._mediaObject.candidates.push(t)}this._mediaObject.endOfCandidates="end-of-candidates",this._mediaObject.iceOptions="renomination"}r&&this.setDtlsRole(r.role)}get mid(){return String(this._mediaObject.mid)}get closed(){return 0===this._mediaObject.port}getObject(){return this._mediaObject}setIceParameters(e){this._mediaObject.iceUfrag=e.usernameFragment,this._mediaObject.icePwd=e.password}pause(){this._mediaObject.direction="inactive"}disable(){this.pause(),delete this._mediaObject.ext,delete this._mediaObject.ssrcs,delete this._mediaObject.ssrcGroups,delete this._mediaObject.simulcast,delete this._mediaObject.simulcast_03,delete this._mediaObject.rids,delete this._mediaObject.extmapAllowMixed}close(){this.disable(),this._mediaObject.port=0}}function c(e){const t=new RegExp("^(audio|video)/(.+)","i").exec(e.mimeType);if(!t)throw new TypeError("invalid codec.mimeType");return t[2]}t.MediaSection=l,t.AnswerMediaSection=class extends l{constructor({iceParameters:e,iceCandidates:t,dtlsParameters:r,sctpParameters:n,plainRtpParameters:i,planB:o=!1,offerMediaObject:a,offerRtpParameters:l,answerRtpParameters:u,codecOptions:d,extmapAllowMixed:h=!1}){switch(super({iceParameters:e,iceCandidates:t,dtlsParameters:r,planB:o}),this._mediaObject.mid=String(a.mid),this._mediaObject.type=a.type,this._mediaObject.protocol=a.protocol,i?(this._mediaObject.connection={ip:i.ip,version:i.ipVersion},this._mediaObject.port=i.port):(this._mediaObject.connection={ip:"127.0.0.1",version:4},this._mediaObject.port=7),a.type){case"audio":case"video":this._mediaObject.direction="recvonly",this._mediaObject.rtp=[],this._mediaObject.rtcpFb=[],this._mediaObject.fmtp=[];for(const e of u.codecs){const t={payload:e.payloadType,codec:c(e),rate:e.clockRate};e.channels>1&&(t.encoding=e.channels),this._mediaObject.rtp.push(t);const r=s.clone(e.parameters,{});let n=s.clone(e.rtcpFeedback,[]);if(d){const{opusStereo:t,opusFec:i,opusDtx:o,opusMaxPlaybackRate:a,opusMaxAverageBitrate:s,opusPtime:c,opusNack:u,videoGoogleStartBitrate:h,videoGoogleMaxBitrate:p,videoGoogleMinBitrate:f}=d,m=l.codecs.find((t=>t.payloadType===e.payloadType));switch(e.mimeType.toLowerCase()){case"audio/opus":case"audio/multiopus":void 0!==t&&(m.parameters["sprop-stereo"]=t?1:0,r.stereo=t?1:0),void 0!==i&&(m.parameters.useinbandfec=i?1:0,r.useinbandfec=i?1:0),void 0!==o&&(m.parameters.usedtx=o?1:0,r.usedtx=o?1:0),void 0!==a&&(r.maxplaybackrate=a),void 0!==s&&(r.maxaveragebitrate=s),void 0!==c&&(m.parameters.ptime=c,r.ptime=c),u||(m.rtcpFeedback=m.rtcpFeedback.filter((e=>"nack"!==e.type||e.parameter)),n=n.filter((e=>"nack"!==e.type||e.parameter)));break;case"video/vp8":case"video/vp9":case"video/h264":case"video/h265":void 0!==h&&(r["x-google-start-bitrate"]=h),void 0!==p&&(r["x-google-max-bitrate"]=p),void 0!==f&&(r["x-google-min-bitrate"]=f)}}const i={payload:e.payloadType,config:""};for(const e of Object.keys(r))i.config&&(i.config+=";"),i.config+=`${e}=${r[e]}`;i.config&&this._mediaObject.fmtp.push(i);for(const t of n)this._mediaObject.rtcpFb.push({payload:e.payloadType,type:t.type,subtype:t.parameter})}this._mediaObject.payloads=u.codecs.map((e=>e.payloadType)).join(" "),this._mediaObject.ext=[];for(const e of u.headerExtensions)(a.ext||[]).some((t=>t.uri===e.uri))&&this._mediaObject.ext.push({uri:e.uri,value:e.id});if(h&&"extmap-allow-mixed"===a.extmapAllowMixed&&(this._mediaObject.extmapAllowMixed="extmap-allow-mixed"),a.simulcast){this._mediaObject.simulcast={dir1:"recv",list1:a.simulcast.list1},this._mediaObject.rids=[];for(const e of a.rids||[])"send"===e.direction&&this._mediaObject.rids.push({id:e.id,direction:"recv"})}else if(a.simulcast_03){this._mediaObject.simulcast_03={value:a.simulcast_03.value.replace(/send/g,"recv")},this._mediaObject.rids=[];for(const e of a.rids||[])"send"===e.direction&&this._mediaObject.rids.push({id:e.id,direction:"recv"})}this._mediaObject.rtcpMux="rtcp-mux",this._mediaObject.rtcpRsize="rtcp-rsize",this._planB&&"video"===this._mediaObject.type&&(this._mediaObject.xGoogleFlag="conference");break;case"application":"number"==typeof a.sctpPort?(this._mediaObject.payloads="webrtc-datachannel",this._mediaObject.sctpPort=n.port,this._mediaObject.maxMessageSize=n.maxMessageSize):a.sctpmap&&(this._mediaObject.payloads=n.port,this._mediaObject.sctpmap={app:"webrtc-datachannel",sctpmapNumber:n.port,maxMessageSize:n.maxMessageSize})}}setDtlsRole(e){switch(e){case"client":this._mediaObject.setup="active";break;case"server":this._mediaObject.setup="passive";break;case"auto":this._mediaObject.setup="actpass"}}resume(){this._mediaObject.direction="recvonly"}muxSimulcastStreams(e){var t;if(!this._mediaObject.simulcast||!this._mediaObject.simulcast.list1)return;const r={};for(const t of e)t.rid&&(r[t.rid]=t);const n=this._mediaObject.simulcast.list1,i=a.parseSimulcastStreamList(n);for(const e of i)for(const n of e)n.paused=!(null===(t=r[n.scid])||void 0===t?void 0:t.active);this._mediaObject.simulcast.list1=i.map((e=>e.map((e=>`${e.paused?"~":""}${e.scid}`)).join(","))).join(";")}},t.OfferMediaSection=class extends l{constructor({iceParameters:e,iceCandidates:t,dtlsParameters:r,sctpParameters:n,plainRtpParameters:i,planB:o=!1,mid:a,kind:s,offerRtpParameters:l,streamId:u,trackId:d,oldDataChannelSpec:h=!1}){switch(super({iceParameters:e,iceCandidates:t,dtlsParameters:r,planB:o}),this._mediaObject.mid=String(a),this._mediaObject.type=s,i?(this._mediaObject.connection={ip:i.ip,version:i.ipVersion},this._mediaObject.protocol="RTP/AVP",this._mediaObject.port=i.port):(this._mediaObject.connection={ip:"127.0.0.1",version:4},this._mediaObject.protocol=n?"UDP/DTLS/SCTP":"UDP/TLS/RTP/SAVPF",this._mediaObject.port=7),s){case"audio":case"video":{this._mediaObject.direction="sendonly",this._mediaObject.rtp=[],this._mediaObject.rtcpFb=[],this._mediaObject.fmtp=[],this._planB||(this._mediaObject.msid=`${u||"-"} ${d}`);for(const e of l.codecs){const t={payload:e.payloadType,codec:c(e),rate:e.clockRate};e.channels>1&&(t.encoding=e.channels),this._mediaObject.rtp.push(t);const r={payload:e.payloadType,config:""};for(const t of Object.keys(e.parameters))r.config&&(r.config+=";"),r.config+=`${t}=${e.parameters[t]}`;r.config&&this._mediaObject.fmtp.push(r);for(const t of e.rtcpFeedback)this._mediaObject.rtcpFb.push({payload:e.payloadType,type:t.type,subtype:t.parameter})}this._mediaObject.payloads=l.codecs.map((e=>e.payloadType)).join(" "),this._mediaObject.ext=[];for(const e of l.headerExtensions)this._mediaObject.ext.push({uri:e.uri,value:e.id});this._mediaObject.rtcpMux="rtcp-mux",this._mediaObject.rtcpRsize="rtcp-rsize";const e=l.encodings[0],t=e.ssrc,r=e.rtx&&e.rtx.ssrc?e.rtx.ssrc:void 0;this._mediaObject.ssrcs=[],this._mediaObject.ssrcGroups=[],l.rtcp.cname&&this._mediaObject.ssrcs.push({id:t,attribute:"cname",value:l.rtcp.cname}),this._planB&&this._mediaObject.ssrcs.push({id:t,attribute:"msid",value:`${u||"-"} ${d}`}),r&&(l.rtcp.cname&&this._mediaObject.ssrcs.push({id:r,attribute:"cname",value:l.rtcp.cname}),this._planB&&this._mediaObject.ssrcs.push({id:r,attribute:"msid",value:`${u||"-"} ${d}`}),this._mediaObject.ssrcGroups.push({semantics:"FID",ssrcs:`${t} ${r}`}));break}case"application":h?(this._mediaObject.payloads=n.port,this._mediaObject.sctpmap={app:"webrtc-datachannel",sctpmapNumber:n.port,maxMessageSize:n.maxMessageSize}):(this._mediaObject.payloads="webrtc-datachannel",this._mediaObject.sctpPort=n.port,this._mediaObject.maxMessageSize=n.maxMessageSize)}}setDtlsRole(e){this._mediaObject.setup="actpass"}resume(){this._mediaObject.direction="sendonly"}planBReceive({offerRtpParameters:e,streamId:t,trackId:r}){const n=e.encodings[0],i=n.ssrc,o=n.rtx&&n.rtx.ssrc?n.rtx.ssrc:void 0,a=this._mediaObject.payloads.split(" ");for(const t of e.codecs){if(a.includes(String(t.payloadType)))continue;const e={payload:t.payloadType,codec:c(t),rate:t.clockRate};t.channels>1&&(e.encoding=t.channels),this._mediaObject.rtp.push(e);const r={payload:t.payloadType,config:""};for(const e of Object.keys(t.parameters))r.config&&(r.config+=";"),r.config+=`${e}=${t.parameters[e]}`;r.config&&this._mediaObject.fmtp.push(r);for(const e of t.rtcpFeedback)this._mediaObject.rtcpFb.push({payload:t.payloadType,type:e.type,subtype:e.parameter})}this._mediaObject.payloads+=` ${e.codecs.filter((e=>!this._mediaObject.payloads.includes(e.payloadType))).map((e=>e.payloadType)).join(" ")}`,this._mediaObject.payloads=this._mediaObject.payloads.trim(),e.rtcp.cname&&this._mediaObject.ssrcs.push({id:i,attribute:"cname",value:e.rtcp.cname}),this._mediaObject.ssrcs.push({id:i,attribute:"msid",value:`${t||"-"} ${r}`}),o&&(e.rtcp.cname&&this._mediaObject.ssrcs.push({id:o,attribute:"cname",value:e.rtcp.cname}),this._mediaObject.ssrcs.push({id:o,attribute:"msid",value:`${t||"-"} ${r}`}),this._mediaObject.ssrcGroups.push({semantics:"FID",ssrcs:`${i} ${o}`}))}planBStopReceiving({offerRtpParameters:e}){const t=e.encodings[0],r=t.ssrc,n=t.rtx&&t.rtx.ssrc?t.rtx.ssrc:void 0;this._mediaObject.ssrcs=this._mediaObject.ssrcs.filter((e=>e.id!==r&&e.id!==n)),n&&(this._mediaObject.ssrcGroups=this._mediaObject.ssrcGroups.filter((e=>e.ssrcs!==`${r} ${n}`)))}}},41305:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.RemoteSdp=void 0;const a=o(r(17363)),s=r(82994),l=r(3471),c=new s.Logger("RemoteSdp");t.RemoteSdp=class{constructor({iceParameters:e,iceCandidates:t,dtlsParameters:r,sctpParameters:n,plainRtpParameters:i,planB:o=!1}){if(this._mediaSections=[],this._midToIndex=new Map,this._iceParameters=e,this._iceCandidates=t,this._dtlsParameters=r,this._sctpParameters=n,this._plainRtpParameters=i,this._planB=o,this._sdpObject={version:0,origin:{address:"0.0.0.0",ipVer:4,netType:"IN",sessionId:1e4,sessionVersion:0,username:"mediasoup-client"},name:"-",timing:{start:0,stop:0},media:[]},e&&e.iceLite&&(this._sdpObject.icelite="ice-lite"),r){this._sdpObject.msidSemantic={semantic:"WMS",token:"*"};const e=this._dtlsParameters.fingerprints.length;this._sdpObject.fingerprint={type:r.fingerprints[e-1].algorithm,hash:r.fingerprints[e-1].value},this._sdpObject.groups=[{type:"BUNDLE",mids:""}]}i&&(this._sdpObject.origin.address=i.ip,this._sdpObject.origin.ipVer=i.ipVersion)}updateIceParameters(e){c.debug("updateIceParameters() [iceParameters:%o]",e),this._iceParameters=e,this._sdpObject.icelite=e.iceLite?"ice-lite":void 0;for(const t of this._mediaSections)t.setIceParameters(e)}updateDtlsRole(e){c.debug("updateDtlsRole() [role:%s]",e),this._dtlsParameters.role=e;for(const t of this._mediaSections)t.setDtlsRole(e)}getNextMediaSectionIdx(){for(let e=0;ee.closed));o?this._replaceMediaSection(a,o.mid):this._addMediaSection(a)}}pauseMediaSection(e){this._findMediaSection(e).pause()}resumeSendingMediaSection(e){this._findMediaSection(e).resume()}resumeReceivingMediaSection(e){this._findMediaSection(e).resume()}disableMediaSection(e){this._findMediaSection(e).disable()}closeMediaSection(e){const t=this._findMediaSection(e);return e===this._firstMid?(c.debug("closeMediaSection() | cannot close first media section, disabling it instead [mid:%s]",e),this.disableMediaSection(e),!1):(t.close(),this._regenerateBundleMids(),!0)}muxMediaSectionSimulcast(e,t){const r=this._findMediaSection(e);r.muxSimulcastStreams(t),this._replaceMediaSection(r)}planBStopReceiving({mid:e,offerRtpParameters:t}){const r=this._findMediaSection(e);r.planBStopReceiving({offerRtpParameters:t}),this._replaceMediaSection(r)}sendSctpAssociation({offerMediaObject:e}){const t=new l.AnswerMediaSection({iceParameters:this._iceParameters,iceCandidates:this._iceCandidates,dtlsParameters:this._dtlsParameters,sctpParameters:this._sctpParameters,plainRtpParameters:this._plainRtpParameters,offerMediaObject:e});this._addMediaSection(t)}receiveSctpAssociation({oldDataChannelSpec:e=!1}={}){const t=new l.OfferMediaSection({iceParameters:this._iceParameters,iceCandidates:this._iceCandidates,dtlsParameters:this._dtlsParameters,sctpParameters:this._sctpParameters,plainRtpParameters:this._plainRtpParameters,mid:"datachannel",kind:"application",oldDataChannelSpec:e});this._addMediaSection(t)}getSdp(){return this._sdpObject.origin.sessionVersion++,a.write(this._sdpObject)}_addMediaSection(e){this._firstMid||(this._firstMid=e.mid),this._mediaSections.push(e),this._midToIndex.set(e.mid,this._mediaSections.length-1),this._sdpObject.media.push(e.getObject()),this._regenerateBundleMids()}_replaceMediaSection(e,t){if("string"==typeof t){const r=this._midToIndex.get(t);if(void 0===r)throw new Error(`no media section found for reuseMid '${t}'`);const n=this._mediaSections[r];this._mediaSections[r]=e,this._midToIndex.delete(n.mid),this._midToIndex.set(e.mid,r),this._sdpObject.media[r]=e.getObject(),this._regenerateBundleMids()}else{const t=this._midToIndex.get(e.mid);if(void 0===t)throw new Error(`no media section found with mid '${e.mid}'`);this._mediaSections[t]=e,this._sdpObject.media[t]=e.getObject()}}_findMediaSection(e){const t=this._midToIndex.get(e);if(void 0===t)throw new Error(`no media section found with mid '${e}'`);return this._mediaSections[t]}_regenerateBundleMids(){this._dtlsParameters&&(this._sdpObject.groups[0].mids=this._mediaSections.filter((e=>!e.closed)).map((e=>e.mid)).join(" "))}}},75544:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.applyCodecParameters=t.getCname=t.extractDtlsParameters=t.extractRtpCapabilities=void 0;const a=o(r(17363));t.extractRtpCapabilities=function({sdpObject:e}){const t=new Map,r=[];let n=!1,i=!1;for(const o of e.media){const e=o.type;switch(e){case"audio":if(n)continue;n=!0;break;case"video":if(i)continue;i=!0;break;default:continue}for(const r of o.rtp){const n={kind:e,mimeType:`${e}/${r.codec}`,preferredPayloadType:r.payload,clockRate:r.rate,channels:r.encoding,parameters:{},rtcpFeedback:[]};t.set(n.preferredPayloadType,n)}for(const e of o.fmtp||[]){const r=a.parseParams(e.config),n=t.get(e.payload);n&&(r&&r.hasOwnProperty("profile-level-id")&&(r["profile-level-id"]=String(r["profile-level-id"])),n.parameters=r)}for(const r of o.rtcpFb||[]){const n={type:r.type,parameter:r.subtype};if(n.parameter||delete n.parameter,"*"!==r.payload){const e=t.get(r.payload);if(!e)continue;e.rtcpFeedback.push(n)}else for(const r of t.values())r.kind!==e||/.+\/rtx$/i.test(r.mimeType)||r.rtcpFeedback.push(n)}for(const t of o.ext||[]){if(t["encrypt-uri"])continue;const n={kind:e,uri:t.uri,preferredId:t.value};r.push(n)}}return{codecs:Array.from(t.values()),headerExtensions:r}},t.extractDtlsParameters=function({sdpObject:e}){const t=(e.media||[]).find((e=>e.iceUfrag&&0!==e.port));if(!t)throw new Error("no active media section found");const r=t.fingerprint||e.fingerprint;let n;switch(t.setup){case"active":n="client";break;case"passive":n="server";break;case"actpass":n="auto"}return{role:n,fingerprints:[{algorithm:r.type,value:r.hash}]}},t.getCname=function({offerMediaObject:e}){const t=(e.ssrcs||[]).find((e=>"cname"===e.attribute));return t?t.value:""},t.applyCodecParameters=function({offerRtpParameters:e,answerMediaObject:t}){for(const r of e.codecs){const e=r.mimeType.toLowerCase();if("audio/opus"!==e)continue;if(!(t.rtp||[]).find((e=>e.payload===r.payloadType)))continue;t.fmtp=t.fmtp||[];let n=t.fmtp.find((e=>e.payload===r.payloadType));n||(n={payload:r.payloadType,config:""},t.fmtp.push(n));const i=a.parseParams(n.config);switch(e){case"audio/opus":{const e=r.parameters["sprop-stereo"];void 0!==e&&(i.stereo=e?1:0);break}}n.config="";for(const e of Object.keys(i))n.config&&(n.config+=";"),n.config+=`${e}=${i[e]}`}}},54496:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addLegacySimulcast=t.getRtpEncodings=void 0,t.getRtpEncodings=function({offerMediaObject:e,track:t}){let r;const n=new Set;for(const i of e.ssrcs||[])if("msid"===i.attribute&&i.value.split(" ")[1]===t.id){const e=i.id;n.add(e),r||(r=e)}if(0===n.size)throw new Error(`a=ssrc line with msid information not found [track.id:${t.id}]`);const i=new Map;for(const t of e.ssrcGroups||[]){if("FID"!==t.semantics)continue;let[e,r]=t.ssrcs.split(/\s+/);e=Number(e),r=Number(r),n.has(e)&&(n.delete(e),n.delete(r),i.set(e,r))}for(const e of n)i.set(e,null);const o=[];for(const[e,t]of i){const r={ssrc:e};t&&(r.rtx={ssrc:t}),o.push(r)}return o},t.addLegacySimulcast=function({offerMediaObject:e,track:t,numStreams:r}){if(r<=1)throw new TypeError("numStreams must be greater than 1");let n,i,o;if(!(e.ssrcs||[]).find((e=>"msid"===e.attribute&&(e.value.split(" ")[1]===t.id&&(n=e.id,o=e.value.split(" ")[0],!0)))))throw new Error(`a=ssrc line with msid information not found [track.id:${t.id}]`);(e.ssrcGroups||[]).some((e=>{if("FID"!==e.semantics)return!1;const t=e.ssrcs.split(/\s+/);return Number(t[0])===n&&(i=Number(t[1]),!0)}));const a=e.ssrcs.find((e=>"cname"===e.attribute&&e.id===n));if(!a)throw new Error(`a=ssrc line with cname information not found [track.id:${t.id}]`);const s=a.value,l=[],c=[];for(let e=0;e{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addLegacySimulcast=t.getRtpEncodings=void 0,t.getRtpEncodings=function({offerMediaObject:e}){const t=new Set;for(const r of e.ssrcs||[]){const e=r.id;t.add(e)}if(0===t.size)throw new Error("no a=ssrc lines found");const r=new Map;for(const n of e.ssrcGroups||[]){if("FID"!==n.semantics)continue;let[e,i]=n.ssrcs.split(/\s+/);e=Number(e),i=Number(i),t.has(e)&&(t.delete(e),t.delete(i),r.set(e,i))}for(const e of t)r.set(e,null);const n=[];for(const[e,t]of r){const r={ssrc:e};t&&(r.rtx={ssrc:t}),n.push(r)}return n},t.addLegacySimulcast=function({offerMediaObject:e,numStreams:t}){if(t<=1)throw new TypeError("numStreams must be greater than 1");const r=(e.ssrcs||[]).find((e=>"msid"===e.attribute));if(!r)throw new Error("a=ssrc line with msid information not found");const[n,i]=r.value.split(" "),o=r.id;let a;(e.ssrcGroups||[]).some((e=>{if("FID"!==e.semantics)return!1;const t=e.ssrcs.split(/\s+/);return Number(t[0])===o&&(a=Number(t[1]),!0)}));const s=e.ssrcs.find((e=>"cname"===e.attribute));if(!s)throw new Error("a=ssrc line with cname information not found");const l=s.value,c=[],u=[];for(let e=0;ee.type===n.type&&(e.parameter===n.parameter||!e.parameter&&!n.parameter)));e&&r.push(e)}return r}t.validateRtpCapabilities=function(e){if("object"!=typeof e)throw new TypeError("caps is not an object");if(e.codecs&&!Array.isArray(e.codecs))throw new TypeError("caps.codecs is not an array");e.codecs||(e.codecs=[]);for(const t of e.codecs)l(t);if(e.headerExtensions&&!Array.isArray(e.headerExtensions))throw new TypeError("caps.headerExtensions is not an array");e.headerExtensions||(e.headerExtensions=[]);for(const t of e.headerExtensions)u(t)},t.validateRtpCodecCapability=l,t.validateRtcpFeedback=c,t.validateRtpHeaderExtension=u,t.validateRtpParameters=d,t.validateRtpCodecParameters=h,t.validateRtpHeaderExtensionParameters=p,t.validateRtpEncodingParameters=f,t.validateRtcpParameters=m,t.validateSctpCapabilities=function(e){if("object"!=typeof e)throw new TypeError("caps is not an object");if(!e.numStreams||"object"!=typeof e.numStreams)throw new TypeError("missing caps.numStreams");g(e.numStreams)},t.validateNumSctpStreams=g,t.validateSctpParameters=function(e){if("object"!=typeof e)throw new TypeError("params is not an object");if("number"!=typeof e.port)throw new TypeError("missing params.port");if("number"!=typeof e.OS)throw new TypeError("missing params.OS");if("number"!=typeof e.MIS)throw new TypeError("missing params.MIS");if("number"!=typeof e.maxMessageSize)throw new TypeError("missing params.maxMessageSize")},t.validateSctpStreamParameters=function(e){if("object"!=typeof e)throw new TypeError("params is not an object");if("number"!=typeof e.streamId)throw new TypeError("missing params.streamId");let t=!1;if("boolean"==typeof e.ordered?t=!0:e.ordered=!0,e.maxPacketLifeTime&&"number"!=typeof e.maxPacketLifeTime)throw new TypeError("invalid params.maxPacketLifeTime");if(e.maxRetransmits&&"number"!=typeof e.maxRetransmits)throw new TypeError("invalid params.maxRetransmits");if(e.maxPacketLifeTime&&e.maxRetransmits)throw new TypeError("cannot provide both maxPacketLifeTime and maxRetransmits");if(t&&e.ordered&&(e.maxPacketLifeTime||e.maxRetransmits))throw new TypeError("cannot be ordered with maxPacketLifeTime or maxRetransmits");if(t||!e.maxPacketLifeTime&&!e.maxRetransmits||(e.ordered=!1),e.label&&"string"!=typeof e.label)throw new TypeError("invalid params.label");if(e.protocol&&"string"!=typeof e.protocol)throw new TypeError("invalid params.protocol")},t.getExtendedRtpCapabilities=function(e,t){const r={codecs:[],headerExtensions:[]};for(const n of t.codecs||[]){if(v(n))continue;const t=(e.codecs||[]).find((e=>y(e,n,{strict:!0,modify:!0})));if(!t)continue;const i={mimeType:t.mimeType,kind:t.kind,clockRate:t.clockRate,channels:t.channels,localPayloadType:t.preferredPayloadType,localRtxPayloadType:void 0,remotePayloadType:n.preferredPayloadType,remoteRtxPayloadType:void 0,localParameters:t.parameters,remoteParameters:n.parameters,rtcpFeedback:b(t,n)};r.codecs.push(i)}for(const n of r.codecs){const r=e.codecs.find((e=>v(e)&&e.parameters.apt===n.localPayloadType)),i=t.codecs.find((e=>v(e)&&e.parameters.apt===n.remotePayloadType));r&&i&&(n.localRtxPayloadType=r.preferredPayloadType,n.remoteRtxPayloadType=i.preferredPayloadType)}for(const n of t.headerExtensions){const t=e.headerExtensions.find((e=>{return r=n,!((t=e).kind&&r.kind&&t.kind!==r.kind||t.uri!==r.uri);var t,r}));if(!t)continue;const i={kind:n.kind,uri:n.uri,sendId:t.preferredId,recvId:n.preferredId,encrypt:t.preferredEncrypt,direction:"sendrecv"};switch(n.direction){case"sendrecv":i.direction="sendrecv";break;case"recvonly":i.direction="sendonly";break;case"sendonly":i.direction="recvonly";break;case"inactive":i.direction="inactive"}r.headerExtensions.push(i)}return r},t.getRecvRtpCapabilities=function(e){const t={codecs:[],headerExtensions:[]};for(const r of e.codecs){const e={mimeType:r.mimeType,kind:r.kind,preferredPayloadType:r.remotePayloadType,clockRate:r.clockRate,channels:r.channels,parameters:r.localParameters,rtcpFeedback:r.rtcpFeedback};if(t.codecs.push(e),!r.remoteRtxPayloadType)continue;const n={mimeType:`${r.kind}/rtx`,kind:r.kind,preferredPayloadType:r.remoteRtxPayloadType,clockRate:r.clockRate,parameters:{apt:r.remotePayloadType},rtcpFeedback:[]};t.codecs.push(n)}for(const r of e.headerExtensions){if("sendrecv"!==r.direction&&"recvonly"!==r.direction)continue;const e={kind:r.kind,uri:r.uri,preferredId:r.recvId,preferredEncrypt:r.encrypt,direction:r.direction};t.headerExtensions.push(e)}return t},t.getSendingRtpParameters=function(e,t){const r={mid:void 0,codecs:[],headerExtensions:[],encodings:[],rtcp:{}};for(const n of t.codecs){if(n.kind!==e)continue;const t={mimeType:n.mimeType,payloadType:n.localPayloadType,clockRate:n.clockRate,channels:n.channels,parameters:n.localParameters,rtcpFeedback:n.rtcpFeedback};if(r.codecs.push(t),n.localRtxPayloadType){const e={mimeType:`${n.kind}/rtx`,payloadType:n.localRtxPayloadType,clockRate:n.clockRate,parameters:{apt:n.localPayloadType},rtcpFeedback:[]};r.codecs.push(e)}}for(const n of t.headerExtensions){if(n.kind&&n.kind!==e||"sendrecv"!==n.direction&&"sendonly"!==n.direction)continue;const t={uri:n.uri,id:n.sendId,encrypt:n.encrypt,parameters:{}};r.headerExtensions.push(t)}return r},t.getSendingRemoteRtpParameters=function(e,t){const r={mid:void 0,codecs:[],headerExtensions:[],encodings:[],rtcp:{}};for(const n of t.codecs){if(n.kind!==e)continue;const t={mimeType:n.mimeType,payloadType:n.localPayloadType,clockRate:n.clockRate,channels:n.channels,parameters:n.remoteParameters,rtcpFeedback:n.rtcpFeedback};if(r.codecs.push(t),n.localRtxPayloadType){const e={mimeType:`${n.kind}/rtx`,payloadType:n.localRtxPayloadType,clockRate:n.clockRate,parameters:{apt:n.localPayloadType},rtcpFeedback:[]};r.codecs.push(e)}}for(const n of t.headerExtensions){if(n.kind&&n.kind!==e||"sendrecv"!==n.direction&&"sendonly"!==n.direction)continue;const t={uri:n.uri,id:n.sendId,encrypt:n.encrypt,parameters:{}};r.headerExtensions.push(t)}if(r.headerExtensions.some((e=>"http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01"===e.uri)))for(const e of r.codecs)e.rtcpFeedback=(e.rtcpFeedback||[]).filter((e=>"goog-remb"!==e.type));else if(r.headerExtensions.some((e=>"http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time"===e.uri)))for(const e of r.codecs)e.rtcpFeedback=(e.rtcpFeedback||[]).filter((e=>"transport-cc"!==e.type));else for(const e of r.codecs)e.rtcpFeedback=(e.rtcpFeedback||[]).filter((e=>"transport-cc"!==e.type&&"goog-remb"!==e.type));return r},t.reduceCodecs=function(e,t){const r=[];if(t){for(let n=0;nt.kind===e))},t.canReceive=function(e,t){if(d(e),0===e.codecs.length)return!1;const r=e.codecs[0];return t.codecs.some((e=>e.remotePayloadType===r.payloadType))}},43303:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parse=void 0;const r=new RegExp("^[LS]([1-9]\\d{0,1})T([1-9]\\d{0,1})");t.parse=function(e){const t=r.exec(e||"");return t?{spatialLayers:Number(t[1]),temporalLayers:Number(t[2])}:{spatialLayers:1,temporalLayers:1}}},68057:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(76004),t),i(r(35601),t),i(r(29792),t),i(r(83518),t),i(r(77504),t),i(r(99166),t),i(r(5370),t),i(r(84160),t),i(r(2902),t),i(r(34893),t)},31765:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.generateRandomNumber=t.clone=void 0,t.clone=function(e,t){return void 0===e?t:JSON.parse(JSON.stringify(e))},t.generateRandomNumber=function(){return Math.round(1e7*Math.random())}},94646:(e,t,r)=>{var n=r(65606);t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;t.splice(1,0,r,"color: inherit");let n=0,i=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(n++,"%c"===e&&(i=n))})),t.splice(i,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&void 0!==n&&"env"in n&&(e=n.env.DEBUG),e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=r(33385)(t);const{formatters:i}=e.exports;i.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},33385:(e,t,r)=>{e.exports=function(e){function t(e){let r,i,o,a=null;function s(...e){if(!s.enabled)return;const n=s,i=Number(new Date),o=i-(r||i);n.diff=o,n.prev=r,n.curr=i,r=i,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((r,i)=>{if("%%"===r)return"%";a++;const o=t.formatters[i];if("function"==typeof o){const t=e[a];r=o.call(n,t),e.splice(a,1),a--}return r})),t.formatArgs.call(n,e),(n.log||t.log).apply(n,e)}return s.namespace=e,s.useColors=t.useColors(),s.color=t.selectColor(e),s.extend=n,s.destroy=t.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==a?a:(i!==t.namespaces&&(i=t.namespaces,o=t.enabled(e)),o),set:e=>{a=e}}),"function"==typeof t.init&&t.init(s),s}function n(e,r){const n=t(this.namespace+(void 0===r?":":r)+e);return n.log=this.log,n}function i(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){const e=[...t.names.map(i),...t.skips.map(i).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let r;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const n=("string"==typeof e?e:"").split(/[\s,]+/),i=n.length;for(r=0;r{t[r]=e[r]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let r=0;for(let t=0;t{var t=1e3,r=60*t,n=60*r,i=24*n,o=7*i;function a(e,t,r,n){var i=t>=1.5*r;return Math.round(e/r)+" "+n+(i?"s":"")}e.exports=function(e,s){s=s||{};var l,c,u=typeof e;if("string"===u&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var a=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(a){var s=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*s;case"weeks":case"week":case"w":return s*o;case"days":case"day":case"d":return s*i;case"hours":case"hour":case"hrs":case"hr":case"h":return s*n;case"minutes":case"minute":case"mins":case"min":case"m":return s*r;case"seconds":case"second":case"secs":case"sec":case"s":return s*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}(e);if("number"===u&&isFinite(e))return s.long?(l=e,(c=Math.abs(l))>=i?a(l,c,i,"day"):c>=n?a(l,c,n,"hour"):c>=r?a(l,c,r,"minute"):c>=t?a(l,c,t,"second"):l+" ms"):function(e){var o=Math.abs(e);return o>=i?Math.round(e/i)+"d":o>=n?Math.round(e/n)+"h":o>=r?Math.round(e/r)+"m":o>=t?Math.round(e/t)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},12809:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Observer:()=>R,clearTimers:()=>j,enableStaticRendering:()=>g,isObserverBatched:()=>c,isUsingStaticRendering:()=>v,observer:()=>T,observerBatching:()=>l,useAsObservableSource:()=>M,useLocalObservable:()=>D,useLocalStore:()=>L,useObserver:()=>N,useStaticRendering:()=>F});var n=r(27813),i=r(93015),o=r.n(i);if(!i.useState)throw new Error("mobx-react-lite requires React with Hooks support");if(!n.makeObservable)throw new Error("mobx-react-lite@3 requires mobx at least version 6 to be available");var a=r(33073);function s(e){e()}function l(e){e||(e=s,console.warn("[MobX] Failed to get unstable_batched updates from react-dom / react-native")),(0,n.configure)({reactionScheduler:e})}var c=function(){return console.warn("[MobX] Deprecated"),!0},u=[];function d(e){u.includes(e)||(u.push(e),console.warn(e))}function h(e){return(0,n.getDependencyTree)(e)}var p=function(){function e(e){var t=this;Object.defineProperty(this,"finalize",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"registrations",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"sweepTimeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sweep",{enumerable:!0,configurable:!0,writable:!0,value:function(e){void 0===e&&(e=1e4),clearTimeout(t.sweepTimeout),t.sweepTimeout=void 0;var r=Date.now();t.registrations.forEach((function(n,i){r-n.registeredAt>=e&&(t.finalize(n.value),t.registrations.delete(i))})),t.registrations.size>0&&t.scheduleSweep()}}),Object.defineProperty(this,"finalizeAllImmediately",{enumerable:!0,configurable:!0,writable:!0,value:function(){t.sweep(0)}})}return Object.defineProperty(e.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){this.registrations.set(r,{value:t,registeredAt:Date.now()}),this.scheduleSweep()}}),Object.defineProperty(e.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.registrations.delete(e)}}),Object.defineProperty(e.prototype,"scheduleSweep",{enumerable:!1,configurable:!0,writable:!0,value:function(){void 0===this.sweepTimeout&&(this.sweepTimeout=setTimeout(this.sweep,1e4))}}),e}(),f=new("undefined"!=typeof FinalizationRegistry?FinalizationRegistry:p)((function(e){var t;null===(t=e.reaction)||void 0===t||t.dispose(),e.reaction=null})),m=!1;function g(e){m=e}function v(){return m}var y=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a};function b(e){return"observer".concat(e)}var _=function(){};function S(){return new _}function w(e,t){if(void 0===t&&(t="observed"),v())return e();var r=y(o().useState(S),1)[0],i=y(o().useState(),2)[1],a=function(){return i([])},s=o().useRef(null);s.current||(s.current={reaction:null,mounted:!1,changedBeforeMount:!1});var l,c,u=s.current;if(u.reaction||(u.reaction=new n.Reaction(b(t),(function(){u.mounted?a():u.changedBeforeMount=!0})),f.register(r,u,u)),o().useDebugValue(u.reaction,h),o().useEffect((function(){return f.unregister(u),u.mounted=!0,u.reaction?u.changedBeforeMount&&(u.changedBeforeMount=!1,a()):(u.reaction=new n.Reaction(b(t),(function(){a()})),a()),function(){u.reaction.dispose(),u.reaction=null,u.mounted=!1,u.changedBeforeMount=!1}}),[]),u.reaction.track((function(){try{l=e()}catch(e){c=e}})),c)throw c;return l}var E=!0,C="function"==typeof Symbol&&Symbol.for,O=C?Symbol.for("react.forward_ref"):"function"==typeof i.forwardRef&&(0,i.forwardRef)((function(e){return null})).$$typeof,P=C?Symbol.for("react.memo"):"function"==typeof i.memo&&(0,i.memo)((function(e){return null})).$$typeof;function T(e,t){var r;if(E&&t&&(E=!1,console.warn("[mobx-react-lite] `observer(fn, { forwardRef: true })` is deprecated, use `observer(React.forwardRef(fn))`")),P&&e.$$typeof===P)throw new Error("[mobx-react-lite] You are trying to use `observer` on a function component wrapped in either another `observer` or `React.memo`. The observer already applies 'React.memo' for you.");if(v())return e;var n=null!==(r=null==t?void 0:t.forwardRef)&&void 0!==r&&r,o=e,a=e.displayName||e.name;if(O&&e.$$typeof===O&&(n=!0,"function"!=typeof(o=e.render)))throw new Error("[mobx-react-lite] `render` property of ForwardRef was not a function");var s,l,c=function(e,t){return w((function(){return o(e,t)}),a)};return""!==a&&(c.displayName=a),e.contextTypes&&(c.contextTypes=e.contextTypes),n&&(c=(0,i.forwardRef)(c)),c=(0,i.memo)(c),s=e,l=c,Object.keys(s).forEach((function(e){k[e]||Object.defineProperty(l,e,Object.getOwnPropertyDescriptor(s,e))})),Object.defineProperty(c,"contextTypes",{set:function(){var e;throw new Error("[mobx-react-lite] `".concat(this.displayName||(null===(e=this.type)||void 0===e?void 0:e.displayName)||"Component",".contextTypes` must be set before applying `observer`."))}}),c}var k={$$typeof:!0,render:!0,compare:!0,type:!0,displayName:!0};function R(e){var t=e.children,r=e.render,n=t||r;return"function"!=typeof n?null:w(n)}function A(e,t,r,n,i){var o="children"===t?"render":"children",a="function"==typeof e[t],s="function"==typeof e[o];return a&&s?new Error("MobX Observer: Do not use children and render in the same time in`"+r):a||s?null:new Error("Invalid prop `"+i+"` of type `"+typeof e[t]+"` supplied to `"+r+"`, expected `function`.")}function D(e,t){return(0,i.useState)((function(){return(0,n.observable)(e(),t,{autoBind:!0})}))[0]}R.propTypes={children:A,render:A},R.displayName="Observer";var I,x=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a};function M(e){d("[mobx-react-lite] 'useAsObservableSource' is deprecated, please store the values directly in an observable, for example by using 'useLocalObservable', and sync future updates using 'useEffect' when needed. See the README for examples.");var t=x((0,i.useState)((function(){return(0,n.observable)(e,{},{deep:!1})})),1)[0];return(0,n.runInAction)((function(){Object.assign(t,e)})),t}function L(e,t){d("[mobx-react-lite] 'useLocalStore' is deprecated, use 'useLocalObservable' instead.");var r=t&&M(t);return(0,i.useState)((function(){return(0,n.observable)(e(r),void 0,{autoBind:!0})}))[0]}l(a.unstable_batchedUpdates);var j=null!==(I=f.finalizeAllImmediately)&&void 0!==I?I:function(){};function N(e,t){return void 0===t&&(t="observed"),d("[mobx-react-lite] 'useObserver(fn)' is deprecated. Use `{fn}` instead, or wrap the entire component in `observer`."),w(e,t)}function F(e){console.warn("[mobx-react-lite] 'useStaticRendering' is deprecated, use 'enableStaticRendering' instead"),g(e)}},27813:(e,t,r)=>{"use strict";r.r(t),r.d(t,{$mobx:()=>J,FlowCancellationError:()=>Rr,ObservableMap:()=>Ln,ObservableSet:()=>Bn,Reaction:()=>Bt,_allowStateChanges:()=>tt,_allowStateChangesInsideComputed:()=>lr,_allowStateReadsEnd:()=>St,_allowStateReadsStart:()=>_t,_autoAction:()=>sr,_endAction:()=>et,_getAdministration:()=>ci,_getGlobalState:()=>kt,_interceptReads:()=>Nr,_isComputingDerivation:()=>pt,_resetGlobalState:()=>Rt,_startAction:()=>Xe,action:()=>ar,autorun:()=>ur,comparer:()=>te,computed:()=>Ke,configure:()=>wr,createAtom:()=>ee,defineProperty:()=>Qr,entries:()=>$r,extendObservable:()=>Er,flow:()=>xr,flowResult:()=>Lr,get:()=>Jr,getAtom:()=>li,getDebugName:()=>ui,getDependencyTree:()=>Cr,getObserverTree:()=>Pr,has:()=>Yr,intercept:()=>Fr,isAction:()=>cr,isBoxedObservable:()=>ot,isComputed:()=>Ur,isComputedProp:()=>Vr,isFlow:()=>jr,isFlowCancellationError:()=>Ar,isObservable:()=>Gr,isObservableArray:()=>Dn,isObservableMap:()=>jn,isObservableObject:()=>qn,isObservableProp:()=>Wr,isObservableSet:()=>Un,keys:()=>zr,makeAutoObservable:()=>bn,makeObservable:()=>vn,observable:()=>He,observe:()=>en,onBecomeObserved:()=>gr,onBecomeUnobserved:()=>vr,onReactionError:()=>Ut,override:()=>oe,ownKeys:()=>Xr,reaction:()=>pr,remove:()=>Zr,runInAction:()=>lr,set:()=>qr,spy:()=>Jt,toJS:()=>nn,trace:()=>on,transaction:()=>an,untracked:()=>vt,values:()=>Kr,when:()=>sn});var n={0:"Invalid value for configuration 'enforceActions', expected 'never', 'always' or 'observed'",1:function(e,t){return"Cannot apply '"+e+"' to '"+t.toString()+"': Field not found."},5:"'keys()' can only be used on observable objects, arrays, sets and maps",6:"'values()' can only be used on observable objects, arrays, sets and maps",7:"'entries()' can only be used on observable objects, arrays and maps",8:"'set()' can only be used on observable objects, arrays and maps",9:"'remove()' can only be used on observable objects, arrays and maps",10:"'has()' can only be used on observable objects, arrays and maps",11:"'get()' can only be used on observable objects, arrays and maps",12:"Invalid annotation",13:"Dynamic observable objects cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)",14:"Intercept handlers should return nothing or a change object",15:"Observable arrays cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)",16:"Modification exception: the internal structure of an observable array was changed.",17:function(e,t){return"[mobx.array] Index out of bounds, "+e+" is larger than "+t},18:"mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js",19:function(e){return"Cannot initialize from classes that inherit from Map: "+e.constructor.name},20:function(e){return"Cannot initialize map from "+e},21:function(e){return"Cannot convert to map from '"+e+"'"},22:"mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js",23:"It is not possible to get index atoms from arrays",24:function(e){return"Cannot obtain administration from "+e},25:function(e,t){return"the entry '"+e+"' does not exist in the observable map '"+t+"'"},26:"please specify a property",27:function(e,t){return"no observable property '"+e.toString()+"' found on the observable object '"+t+"'"},28:function(e){return"Cannot obtain atom from "+e},29:"Expecting some object",30:"invalid action stack. did you forget to finish an action?",31:"missing option for computed: get",32:function(e,t){return"Cycle detected in computation "+e+": "+t},33:function(e){return"The setter of computed value '"+e+"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?"},34:function(e){return"[ComputedValue '"+e+"'] It is not possible to assign a new value to a computed value."},35:"There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`",36:"isolateGlobalState should be called before MobX is running any reactions",37:function(e){return"[mobx] `observableArray."+e+"()` mutates the array in-place, which is not allowed inside a derivation. Use `array.slice()."+e+"()` instead"},38:"'ownKeys()' can only be used on observable objects",39:"'defineProperty()' can only be used on observable objects"};function i(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;ie.length)&&(t=e.length);for(var r=0,n=Array(t);r=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function H(){return H=Object.assign?Object.assign.bind():function(e){for(var t=1;t0;Tt.allowStateChanges||!t&&"always"!==Tt.enforceActions||console.warn("[MobX] "+(Tt.enforceActions?"Since strict-mode is enabled, changing (observed) observable values without using an action is not allowed. Tried to modify: ":"Side effects like changing state are not allowed at this point. Are you trying to modify state from, for example, a computed value or the render function of a React component? You can wrap side effects in 'runInAction' (or decorate functions with 'action') if needed. Tried to modify: ")+e.name_)}function mt(e,t,r){var n=_t(!0);wt(e),e.newObserving_=new Array(0===e.runId_?100:e.observing_.length),e.unboundDepsCount_=0,e.runId_=++Tt.runId;var i,o=Tt.trackingDerivation;if(Tt.trackingDerivation=e,Tt.inBatch++,!0===Tt.disableErrorBoundaries)i=t.call(r);else try{i=t.call(r)}catch(e){i=new ut(e)}return Tt.inBatch--,Tt.trackingDerivation=o,function(e){for(var t=e.observing_,r=e.observing_=e.newObserving_,n=st.UP_TO_DATE_,i=0,o=e.unboundDepsCount_,a=0;an&&(n=s.dependenciesState_)}for(r.length=i,e.newObserving_=null,o=t.length;o--;){var l=t[o];0===l.diffValue&&Dt(l,e),l.diffValue=0}for(;i--;){var c=r[i];1===c.diffValue&&(c.diffValue=0,At(c,e))}n!==st.UP_TO_DATE_&&(e.dependenciesState_=n,e.onBecomeStale_())}(e),function(e){0===e.observing_.length&&("boolean"==typeof e.requiresObservable_?e.requiresObservable_:Tt.reactionRequiresObservable)&&console.warn("[mobx] Derivation '"+e.name_+"' is created/updated without reading any observable value.")}(e),St(n),i}function gt(e){var t=e.observing_;e.observing_=[];for(var r=t.length;r--;)Dt(t[r],e);e.dependenciesState_=st.NOT_TRACKING_}function vt(e){var t=yt();try{return e()}finally{bt(t)}}function yt(){var e=Tt.trackingDerivation;return Tt.trackingDerivation=null,e}function bt(e){Tt.trackingDerivation=e}function _t(e){var t=Tt.allowStateReads;return Tt.allowStateReads=e,t}function St(e){Tt.allowStateReads=e}function wt(e){if(e.dependenciesState_!==st.UP_TO_DATE_){e.dependenciesState_=st.UP_TO_DATE_;for(var t=e.observing_,r=t.length;r--;)t[r].lowestObserverState_=st.UP_TO_DATE_}}var Et=["mobxGuid","spyListeners","enforceActions","computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","allowStateReads","disableErrorBoundaries","runId","UNCHANGED","useProxies"],Ct=function(){this.version=6,this.UNCHANGED={},this.trackingDerivation=null,this.trackingContext=null,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!1,this.allowStateReads=!0,this.enforceActions=!0,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1,this.useProxies=!0,this.verifyProxies=!1,this.safeDescriptors=!0},Ot=!0,Pt=!1,Tt=function(){var e=a();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(Ot=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==(new Ct).version&&(Ot=!1),Ot?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new Ct):(setTimeout((function(){Pt||i(35)}),1),new Ct)}();function kt(){return Tt}function Rt(){var e=new Ct;for(var t in e)-1===Et.indexOf(t)&&(Tt[t]=e[t]);Tt.allowStateChanges=!Tt.enforceActions}function At(e,t){e.observers_.add(t),e.lowestObserverState_>t.dependenciesState_&&(e.lowestObserverState_=t.dependenciesState_)}function Dt(e,t){e.observers_.delete(t),0===e.observers_.size&&It(e)}function It(e){!1===e.isPendingUnobservation&&(e.isPendingUnobservation=!0,Tt.pendingUnobservations.push(e))}function xt(){Tt.inBatch++}function Mt(){if(0==--Tt.inBatch){Gt();for(var e=Tt.pendingUnobservations,t=0;t0&&It(e),!1)}function jt(e){e.lowestObserverState_!==st.STALE_&&(e.lowestObserverState_=st.STALE_,e.observers_.forEach((function(t){t.dependenciesState_===st.UP_TO_DATE_&&(t.isTracing_!==lt.NONE&&Nt(t,e),t.onBecomeStale_()),t.dependenciesState_=st.STALE_})))}function Nt(e,t){if(console.log("[mobx.trace] '"+e.name_+"' is invalidated due to a change in: '"+t.name_+"'"),e.isTracing_===lt.BREAK){var r=[];Ft(Cr(e),r,1),new Function("debugger;\n/*\nTracing '"+e.name_+"'\n\nYou are entering this break point because derivation '"+e.name_+"' is being traced and '"+t.name_+"' is now forcing it to update.\nJust follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update\nThe stackframe you are looking for is at least ~6-8 stack-frames up.\n\n"+(e instanceof at?e.derivation.toString().replace(/[*]\//g,"/"):"")+"\n\nThe dependencies for this derivation are:\n\n"+r.join("\n")+"\n*/\n ")()}}function Ft(e,t,r){t.length>=1e3?t.push("(and many more)"):(t.push(""+"\t".repeat(r-1)+e.name),e.dependencies&&e.dependencies.forEach((function(e){return Ft(e,t,r+1)})))}var Bt=function(){function e(e,t,r,n){void 0===e&&(e="Reaction@"+v()),this.name_=void 0,this.onInvalidate_=void 0,this.errorHandler_=void 0,this.requiresObservable_=void 0,this.observing_=[],this.newObserving_=[],this.dependenciesState_=st.NOT_TRACKING_,this.runId_=0,this.unboundDepsCount_=0,this.flags_=0,this.isTracing_=lt.NONE,this.name_=e,this.onInvalidate_=t,this.errorHandler_=r,this.requiresObservable_=n}var t=e.prototype;return t.onBecomeStale_=function(){this.schedule_()},t.schedule_=function(){this.isScheduled||(this.isScheduled=!0,Tt.pendingReactions.push(this),Gt())},t.runReaction_=function(){if(!this.isDisposed){xt(),this.isScheduled=!1;var e=Tt.trackingContext;if(Tt.trackingContext=this,ht(this)){this.isTrackPending=!0;try{this.onInvalidate_(),this.isTrackPending&&Kt()&&$t({name:this.name_,type:"scheduled-reaction"})}catch(e){this.reportExceptionInDerivation_(e)}}Tt.trackingContext=e,Mt()}},t.track=function(e){if(!this.isDisposed){xt();var t,r=Kt();r&&(t=Date.now(),qt({name:this.name_,type:"reaction"})),this.isRunning=!0;var n=Tt.trackingContext;Tt.trackingContext=this;var i=mt(this,e,void 0);Tt.trackingContext=n,this.isRunning=!1,this.isTrackPending=!1,this.isDisposed&>(this),dt(i)&&this.reportExceptionInDerivation_(i.cause),r&&Yt({time:Date.now()-t}),Mt()}},t.reportExceptionInDerivation_=function(e){var t=this;if(this.errorHandler_)this.errorHandler_(e,this);else{if(Tt.disableErrorBoundaries)throw e;var r="[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this+"'";Tt.suppressReactionErrors?console.warn("[mobx] (error in reaction '"+this.name_+"' suppressed, fix error of causing action below)"):console.error(r,e),Kt()&&$t({type:"error",name:this.name_,message:r,error:""+e}),Tt.globalReactionErrorHandlers.forEach((function(r){return r(e,t)}))}},t.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.isRunning||(xt(),gt(this),Mt()))},t.getDisposer_=function(e){var t=this,r=function r(){t.dispose(),null==e||null==e.removeEventListener||e.removeEventListener("abort",r)};return null==e||null==e.addEventListener||e.addEventListener("abort",r),r[J]=this,r},t.toString=function(){return"Reaction["+this.name_+"]"},t.trace=function(e){void 0===e&&(e=!1),on(this,e)},U(e,[{key:"isDisposed",get:function(){return j(this.flags_,e.isDisposedMask_)},set:function(t){this.flags_=N(this.flags_,e.isDisposedMask_,t)}},{key:"isScheduled",get:function(){return j(this.flags_,e.isScheduledMask_)},set:function(t){this.flags_=N(this.flags_,e.isScheduledMask_,t)}},{key:"isTrackPending",get:function(){return j(this.flags_,e.isTrackPendingMask_)},set:function(t){this.flags_=N(this.flags_,e.isTrackPendingMask_,t)}},{key:"isRunning",get:function(){return j(this.flags_,e.isRunningMask_)},set:function(t){this.flags_=N(this.flags_,e.isRunningMask_,t)}},{key:"diffValue",get:function(){return j(this.flags_,e.diffValueMask_)?1:0},set:function(t){this.flags_=N(this.flags_,e.diffValueMask_,1===t)}}])}();function Ut(e){return Tt.globalReactionErrorHandlers.push(e),function(){var t=Tt.globalReactionErrorHandlers.indexOf(e);t>=0&&Tt.globalReactionErrorHandlers.splice(t,1)}}Bt.isDisposedMask_=1,Bt.isScheduledMask_=2,Bt.isTrackPendingMask_=4,Bt.isRunningMask_=8,Bt.diffValueMask_=16;var Vt=100,Ht=function(e){return e()};function Gt(){Tt.inBatch>0||Tt.isRunningReactions||Ht(Wt)}function Wt(){Tt.isRunningReactions=!0;for(var e=Tt.pendingReactions,t=0;e.length>0;){++t===Vt&&(console.error("Reaction doesn't converge to a stable state after "+Vt+" iterations. Probably there is a cycle in the reactive function: "+e[0]),e.splice(0));for(var r=e.splice(0),n=0,i=r.length;n4&&i("'extendObservable' expected 2-4 arguments"),"object"!=typeof e&&i("'extendObservable' expects an object as first argument"),jn(e)&&i("'extendObservable' should not be used on maps, use map.merge instead"),E(t)||i("'extendObservable' only accepts plain objects as second argument"),(Gr(t)||Gr(r))&&i("Extending an object with another observable (object) is not supported");var o=L(t);return di((function(){var t=zn(e,n)[J];D(o).forEach((function(e){t.extend_(e,o[e],!r||!(e in r)||r[e])}))})),e}function Cr(e,t){return Or(li(e,t))}function Or(e){var t,r={name:e.name_};return e.observing_&&e.observing_.length>0&&(r.dependencies=(t=e.observing_,Array.from(new Set(t))).map(Or)),r}function Pr(e,t){return Tr(li(e,t))}function Tr(e){var t={name:e.name_};return function(e){return e.observers_&&e.observers_.size>0}(e)&&(t.observers=Array.from(function(e){return e.observers_}(e)).map(Tr)),t}var kr=0;function Rr(){this.message="FLOW_CANCELLED"}function Ar(e){return e instanceof Rr}Rr.prototype=Object.create(Error.prototype);var Dr=he("flow"),Ir=he("flow.bound",{bound:!0}),xr=Object.assign((function(e,t){if(Z(t))return Dr.decorate_20223_(e,t);if(S(t))return q(e,t,Dr);1!==arguments.length&&i("Flow expects single argument with generator function");var r=e,n=r.name||"",o=function(){var e,t=arguments,i=++kr,o=ar(n+" - runid: "+i+" - init",r).apply(this,t),a=void 0,s=new Promise((function(t,r){var s=0;function l(e){var t;a=void 0;try{t=ar(n+" - runid: "+i+" - yield "+s++,o.next).call(o,e)}catch(e){return r(e)}u(t)}function c(e){var t;a=void 0;try{t=ar(n+" - runid: "+i+" - yield "+s++,o.throw).call(o,e)}catch(e){return r(e)}u(t)}function u(e){if(!_(null==e?void 0:e.then))return e.done?t(e.value):(a=Promise.resolve(e.value)).then(l,c);e.then(u,r)}e=r,l(void 0)}));return s.cancel=ar(n+" - runid: "+i+" - cancel",(function(){try{a&&Mr(a);var t=o.return(void 0),r=Promise.resolve(t.value);r.then(b,b),Mr(r),e(new Rr)}catch(t){e(t)}})),s};return o.isMobXFlow=!0,o}),Dr);function Mr(e){_(e.cancel)&&e.cancel()}function Lr(e){return e}function jr(e){return!0===(null==e?void 0:e.isMobXFlow)}function Nr(e,t,r){var n;if(jn(e)||Dn(e)||ot(e))n=ci(e);else{if(!qn(e))return i("Expected observable map, object or array as first array");if(!S(t))return i("InterceptReads can only be used with a specific property, not with an object in general");n=ci(e,t)}return void 0!==n.dehancer?i("An intercept reader was already established"):(n.dehancer="function"==typeof t?t:r,function(){n.dehancer=void 0})}function Fr(e,t,r){return _(r)?function(e,t,r){return ci(e,t).intercept_(r)}(e,t,r):function(e,t){return ci(e).intercept_(t)}(e,t)}function Br(e,t){if(void 0===t)return ct(e);if(!1===qn(e))return!1;if(!e[J].values_.has(t))return!1;var r=li(e,t);return ct(r)}function Ur(e){return arguments.length>1?i("isComputed expects only 1 argument. Use isComputedProp to inspect the observability of a property"):Br(e)}function Vr(e,t){return S(t)?Br(e,t):i("isComputed expected a property name as second argument")}function Hr(e,t){return!!e&&(void 0!==t?jn(e)||Dn(e)?i("isObservable(object, propertyName) is not supported for arrays and maps. Use map.has or array.length instead."):!!qn(e)&&e[J].values_.has(t):qn(e)||!!e[J]||X(e)||zt(e)||ct(e))}function Gr(e){return 1!==arguments.length&&i("isObservable expects only 1 argument. Use isObservableProp to inspect the observability of a property"),Hr(e)}function Wr(e,t){return S(t)?Hr(e,t):i("expected a property name as second argument")}function zr(e){return qn(e)?e[J].keys_():jn(e)||Un(e)?Array.from(e.keys()):Dn(e)?e.map((function(e,t){return t})):void i(5)}function Kr(e){return qn(e)?zr(e).map((function(t){return e[t]})):jn(e)?zr(e).map((function(t){return e.get(t)})):Un(e)?Array.from(e.values()):Dn(e)?e.slice():void i(6)}function $r(e){return qn(e)?zr(e).map((function(t){return[t,e[t]]})):jn(e)?zr(e).map((function(t){return[t,e.get(t)]})):Un(e)?Array.from(e.entries()):Dn(e)?e.map((function(e,t){return[t,e]})):void i(7)}function qr(e,t,r){if(2!==arguments.length||Un(e))qn(e)?e[J].set_(t,r):jn(e)?e.set(t,r):Un(e)?e.add(t):Dn(e)?("number"!=typeof t&&(t=parseInt(t,10)),t<0&&i("Invalid index: '"+t+"'"),xt(),t>=e.length&&(e.length=t+1),e[t]=r,Mt()):i(8);else{xt();var n=t;try{for(var o in n)qr(e,o,n[o])}finally{Mt()}}}function Zr(e,t){qn(e)?e[J].delete_(t):jn(e)||Un(e)?e.delete(t):Dn(e)?("number"!=typeof t&&(t=parseInt(t,10)),e.splice(t,1)):i(9)}function Yr(e,t){return qn(e)?e[J].has_(t):jn(e)||Un(e)?e.has(t):Dn(e)?t>=0&&t0}function hn(e,t){var r=e.interceptors_||(e.interceptors_=[]);return r.push(t),y((function(){var e=r.indexOf(t);-1!==e&&r.splice(e,1)}))}function pn(e,t){var r=yt();try{for(var n=[].concat(e.interceptors_||[]),o=0,a=n.length;o0}function mn(e,t){var r=e.changeListeners_||(e.changeListeners_=[]);return r.push(t),y((function(){var e=r.indexOf(t);-1!==e&&r.splice(e,1)}))}function gn(e,t){var r=yt(),n=e.changeListeners_;if(n){for(var i=0,o=(n=n.slice()).length;i0?e.map(this.dehancer):e},t.intercept_=function(e){return hn(this,e)},t.observe_=function(e,t){return void 0===t&&(t=!1),t&&e({observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:"splice",index:0,added:this.values_.slice(),addedCount:this.values_.length,removed:[],removedCount:0}),mn(this,e)},t.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},t.setArrayLength_=function(e){("number"!=typeof e||isNaN(e)||e<0)&&i("Out of range: "+e);var t=this.values_.length;if(e!==t)if(e>t){for(var r=new Array(e-t),n=0;n0&&ai(e+t+1)},t.spliceWithArray_=function(e,t,r){var n=this;ft(this.atom_);var i=this.values_.length;if(void 0===e?e=0:e>i?e=i:e<0&&(e=Math.max(0,i+e)),t=1===arguments.length?i-e:null==t?0:Math.max(0,Math.min(t,i-e)),void 0===r&&(r=d),dn(this)){var o=pn(this,{object:this.proxy_,type:_n,index:e,removedCount:t,added:r});if(!o)return d;t=o.removedCount,r=o.added}r=0===r.length?r:r.map((function(e){return n.enhancer_(e,void 0)})),this.legacyMode_;var a=r.length-t;this.updateArrayLength_(i,a);var s=this.spliceItemsIntoValues_(e,t,r);return 0===t&&0===r.length||this.notifyArraySplice_(e,r,s),this.dehanceValues_(s)},t.spliceItemsIntoValues_=function(e,t,r){var n;if(r.length<1e4)return(n=this.values_).splice.apply(n,[e,t].concat(r));var i=this.values_.slice(e,e+t),o=this.values_.slice(e+t);this.values_.length+=r.length-t;for(var a=0;a=this.values_.length))return this.atom_.reportObserved(),this.dehanceValue_(this.values_[e]);console.warn("[mobx.array] Attempt to read an array index ("+e+") that is out of bounds ("+this.values_.length+"). Please check length first. Out of bound indices will not be tracked by MobX")},t.set_=function(e,t){var r=this.values_;if(this.legacyMode_&&e>r.length&&i(17,e,r.length),e2?r-2:0),i=2;i-1&&(this.splice(r,1),!0)}};function Pn(e,t){"function"==typeof Array.prototype[e]&&(On[e]=t(e))}function Tn(e){return function(){var t=this[J];t.atom_.reportObserved();var r=t.dehanceValues_(t.values_);return r[e].apply(r,arguments)}}function kn(e){return function(t,r){var n=this,i=this[J];return i.atom_.reportObserved(),i.dehanceValues_(i.values_)[e]((function(e,i){return t.call(r,e,i,n)}))}}function Rn(e){return function(){var t=this,r=this[J];r.atom_.reportObserved();var n=r.dehanceValues_(r.values_),i=arguments[0];return arguments[0]=function(e,r,n){return i(e,r,n,t)},n[e].apply(n,arguments)}}Pn("at",Tn),Pn("concat",Tn),Pn("flat",Tn),Pn("includes",Tn),Pn("indexOf",Tn),Pn("join",Tn),Pn("lastIndexOf",Tn),Pn("slice",Tn),Pn("toString",Tn),Pn("toLocaleString",Tn),Pn("toSorted",Tn),Pn("toSpliced",Tn),Pn("with",Tn),Pn("every",kn),Pn("filter",kn),Pn("find",kn),Pn("findIndex",kn),Pn("findLast",kn),Pn("findLastIndex",kn),Pn("flatMap",kn),Pn("forEach",kn),Pn("map",kn),Pn("some",kn),Pn("toReversed",kn),Pn("reduce",Rn),Pn("reduceRight",Rn);var An=T("ObservableArrayAdministration",En);function Dn(e){return w(e)&&An(e[J])}var In={},xn="add",Mn="delete",Ln=function(){function e(e,t,r){var n=this;void 0===t&&(t=re),void 0===r&&(r="ObservableMap@"+v()),this.enhancer_=void 0,this.name_=void 0,this[J]=In,this.data_=void 0,this.hasMap_=void 0,this.keysAtom_=void 0,this.interceptors_=void 0,this.changeListeners_=void 0,this.dehancer=void 0,this.enhancer_=t,this.name_=r,_(Map)||i(18),di((function(){n.keysAtom_=ee(n.name_+".keys()"),n.data_=new Map,n.hasMap_=new Map,e&&n.merge(e)}))}var t=e.prototype;return t.has_=function(e){return this.data_.has(e)},t.has=function(e){var t=this;if(!Tt.trackingDerivation)return this.has_(e);var r=this.hasMap_.get(e);if(!r){var n=r=new it(this.has_(e),ne,this.name_+"."+I(e)+"?",!1);this.hasMap_.set(e,n),vr(n,(function(){return t.hasMap_.delete(e)}))}return r.get()},t.set=function(e,t){var r=this.has_(e);if(dn(this)){var n=pn(this,{type:r?Sn:xn,object:this,newValue:t,name:e});if(!n)return this;t=n.newValue}return r?this.updateValue_(e,t):this.addValue_(e,t),this},t.delete=function(e){var t=this;if(ft(this.keysAtom_),dn(this)&&!pn(this,{type:Mn,object:this,name:e}))return!1;if(this.has_(e)){var r=Kt(),n=fn(this),i=n||r?{observableKind:"map",debugObjectName:this.name_,type:Mn,object:this,oldValue:this.data_.get(e).value_,name:e}:null;return r&&qt(i),an((function(){var r;t.keysAtom_.reportChanged(),null==(r=t.hasMap_.get(e))||r.setNewValue_(!1),t.data_.get(e).setNewValue_(void 0),t.data_.delete(e)})),n&&gn(this,i),r&&Yt(),!0}return!1},t.updateValue_=function(e,t){var r=this.data_.get(e);if((t=r.prepareNewValue_(t))!==Tt.UNCHANGED){var n=Kt(),i=fn(this),o=i||n?{observableKind:"map",debugObjectName:this.name_,type:Sn,object:this,oldValue:r.value_,name:e,newValue:t}:null;n&&qt(o),r.setNewValue_(t),i&&gn(this,o),n&&Yt()}},t.addValue_=function(e,t){var r=this;ft(this.keysAtom_),an((function(){var n,i=new it(t,r.enhancer_,r.name_+"."+I(e),!1);r.data_.set(e,i),t=i.value_,null==(n=r.hasMap_.get(e))||n.setNewValue_(!0),r.keysAtom_.reportChanged()}));var n=Kt(),i=fn(this),o=i||n?{observableKind:"map",debugObjectName:this.name_,type:xn,object:this,name:e,newValue:t}:null;n&&qt(o),i&&gn(this,o),n&&Yt()},t.get=function(e){return this.has(e)?this.dehanceValue_(this.data_.get(e).get()):this.dehanceValue_(void 0)},t.dehanceValue_=function(e){return void 0!==this.dehancer?this.dehancer(e):e},t.keys=function(){return this.keysAtom_.reportObserved(),this.data_.keys()},t.values=function(){var e=this,t=this.keys();return Nn({next:function(){var r=t.next(),n=r.done,i=r.value;return{done:n,value:n?void 0:e.get(i)}}})},t.entries=function(){var e=this,t=this.keys();return Nn({next:function(){var r=t.next(),n=r.done,i=r.value;return{done:n,value:n?void 0:[i,e.get(i)]}}})},t[Symbol.iterator]=function(){return this.entries()},t.forEach=function(e,t){for(var r,n=V(this);!(r=n()).done;){var i=r.value,o=i[0],a=i[1];e.call(t,a,o,this)}},t.merge=function(e){var t=this;return jn(e)&&(e=new Map(e)),an((function(){var r,n,o;E(e)?function(e){var t=Object.keys(e);if(!A)return t;var r=Object.getOwnPropertySymbols(e);return r.length?[].concat(t,r.filter((function(t){return u.propertyIsEnumerable.call(e,t)}))):t}(e).forEach((function(r){return t.set(r,e[r])})):Array.isArray(e)?e.forEach((function(e){var r=e[0],n=e[1];return t.set(r,n)})):k(e)?(r=e,n=Object.getPrototypeOf(r),o=Object.getPrototypeOf(n),null!==Object.getPrototypeOf(o)&&i(19,e),e.forEach((function(e,r){return t.set(r,e)}))):null!=e&&i(20,e)})),this},t.clear=function(){var e=this;an((function(){vt((function(){for(var t,r=V(e.keys());!(t=r()).done;){var n=t.value;e.delete(n)}}))}))},t.replace=function(e){var t=this;return an((function(){for(var r,n=function(e){if(k(e)||jn(e))return e;if(Array.isArray(e))return new Map(e);if(E(e)){var t=new Map;for(var r in e)t.set(r,e[r]);return t}return i(21,e)}(e),o=new Map,a=!1,s=V(t.data_.keys());!(r=s()).done;){var l=r.value;if(!n.has(l))if(t.delete(l))a=!0;else{var c=t.data_.get(l);o.set(l,c)}}for(var u,d=V(n.entries());!(u=d()).done;){var h=u.value,p=h[0],f=h[1],m=t.data_.has(p);if(t.set(p,f),t.data_.has(p)){var g=t.data_.get(p);o.set(p,g),m||(a=!0)}}if(!a)if(t.data_.size!==o.size)t.keysAtom_.reportChanged();else for(var v=t.data_.keys(),y=o.keys(),b=v.next(),_=y.next();!b.done;){if(b.value!==_.value){t.keysAtom_.reportChanged();break}b=v.next(),_=y.next()}t.data_=o})),this},t.toString=function(){return"[object ObservableMap]"},t.toJSON=function(){return Array.from(this)},t.observe_=function(e,t){return!0===t&&i("`observe` doesn't support fireImmediately=true in combination with maps."),mn(this,e)},t.intercept_=function(e){return hn(this,e)},U(e,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Map"}}])}(),jn=T("ObservableMap",Ln);function Nn(e){return e[Symbol.toStringTag]="MapIterator",yi(e)}var Fn={},Bn=function(){function e(e,t,r){var n=this;void 0===t&&(t=re),void 0===r&&(r="ObservableSet@"+v()),this.name_=void 0,this[J]=Fn,this.data_=new Set,this.atom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.dehancer=void 0,this.enhancer_=void 0,this.name_=r,_(Set)||i(22),this.enhancer_=function(e,n){return t(e,n,r)},di((function(){n.atom_=ee(n.name_),e&&n.replace(e)}))}var t=e.prototype;return t.dehanceValue_=function(e){return void 0!==this.dehancer?this.dehancer(e):e},t.clear=function(){var e=this;an((function(){vt((function(){for(var t,r=V(e.data_.values());!(t=r()).done;){var n=t.value;e.delete(n)}}))}))},t.forEach=function(e,t){for(var r,n=V(this);!(r=n()).done;){var i=r.value;e.call(t,i,i,this)}},t.add=function(e){var t=this;if(ft(this.atom_),dn(this)&&!pn(this,{type:xn,object:this,newValue:e}))return this;if(!this.has(e)){an((function(){t.data_.add(t.enhancer_(e,void 0)),t.atom_.reportChanged()}));var r=Kt(),n=fn(this),i=n||r?{observableKind:"set",debugObjectName:this.name_,type:xn,object:this,newValue:e}:null;r&&qt(i),n&&gn(this,i),r&&Yt()}return this},t.delete=function(e){var t=this;if(dn(this)&&!pn(this,{type:Mn,object:this,oldValue:e}))return!1;if(this.has(e)){var r=Kt(),n=fn(this),i=n||r?{observableKind:"set",debugObjectName:this.name_,type:Mn,object:this,oldValue:e}:null;return r&&qt(i),an((function(){t.atom_.reportChanged(),t.data_.delete(e)})),n&&gn(this,i),r&&Yt(),!0}return!1},t.has=function(e){return this.atom_.reportObserved(),this.data_.has(this.dehanceValue_(e))},t.entries=function(){var e=0,t=Array.from(this.keys()),r=Array.from(this.values());return Vn({next:function(){var n=e;return e+=1,nti){for(var t=ti;t=0&&r++}e=gi(e),t=gi(t);var s="[object Array]"===a;if(!s){if("object"!=typeof e||"object"!=typeof t)return!1;var l=e.constructor,c=t.constructor;if(l!==c&&!(_(l)&&l instanceof l&&_(c)&&c instanceof c)&&"constructor"in e&&"constructor"in t)return!1}if(0===r)return!1;r<0&&(r=-1),i=i||[];for(var u=(n=n||[]).length;u--;)if(n[u]===e)return i[u]===t;if(n.push(e),i.push(t),s){if((u=e.length)!==t.length)return!1;for(;u--;)if(!mi(e[u],t[u],r-1,n,i))return!1}else{var d,h=Object.keys(e);if(u=h.length,Object.keys(t).length!==u)return!1;for(;u--;)if(!M(t,d=h[u])||!mi(e[d],t[d],r-1,n,i))return!1}return n.pop(),i.pop(),!0}function gi(e){return Dn(e)?e.slice():k(e)||jn(e)||R(e)||Un(e)?Array.from(e.entries()):e}var vi=(null==(hi=a().Iterator)?void 0:hi.prototype)||{};function yi(e){return e[Symbol.iterator]=bi,Object.assign(Object.create(vi),e)}function bi(){return this}function _i(e){return e instanceof Object&&"string"==typeof e.annotationType_&&_(e.make_)&&_(e.extend_)}["Symbol","Map","Set"].forEach((function(e){void 0===a()[e]&&i("MobX requires global '"+e+"' to be available or polyfilled")})),"object"==typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:Jt,extras:{getDebugName:ui},$mobx:J})},28579:e=>{window,e.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=14)}([function(e,t,r){"use strict";var n=r(6),i=r.n(n),o=function(){function e(){}return e.e=function(t,r){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var n="["+t+"] > "+r;e.ENABLE_CALLBACK&&e.emitter.emit("log","error",n),e.ENABLE_ERROR&&(console.error?console.error(n):console.warn?console.warn(n):console.log(n))},e.i=function(t,r){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var n="["+t+"] > "+r;e.ENABLE_CALLBACK&&e.emitter.emit("log","info",n),e.ENABLE_INFO&&(console.info?console.info(n):console.log(n))},e.w=function(t,r){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var n="["+t+"] > "+r;e.ENABLE_CALLBACK&&e.emitter.emit("log","warn",n),e.ENABLE_WARN&&(console.warn?console.warn(n):console.log(n))},e.d=function(t,r){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var n="["+t+"] > "+r;e.ENABLE_CALLBACK&&e.emitter.emit("log","debug",n),e.ENABLE_DEBUG&&(console.debug?console.debug(n):console.log(n))},e.v=function(t,r){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var n="["+t+"] > "+r;e.ENABLE_CALLBACK&&e.emitter.emit("log","verbose",n),e.ENABLE_VERBOSE&&console.log(n)},e}();o.GLOBAL_TAG="mpegts.js",o.FORCE_GLOBAL_TAG=!1,o.ENABLE_ERROR=!0,o.ENABLE_INFO=!0,o.ENABLE_WARN=!0,o.ENABLE_DEBUG=!0,o.ENABLE_VERBOSE=!0,o.ENABLE_CALLBACK=!1,o.emitter=new i.a,t.a=o},function(e,t,r){"use strict";t.a={IO_ERROR:"io_error",DEMUX_ERROR:"demux_error",INIT_SEGMENT:"init_segment",MEDIA_SEGMENT:"media_segment",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",TIMED_ID3_METADATA_ARRIVED:"timed_id3_metadata_arrived",SMPTE2038_METADATA_ARRIVED:"smpte2038_metadata_arrived",SCTE35_METADATA_ARRIVED:"scte35_metadata_arrived",PES_PRIVATE_DATA_DESCRIPTOR:"pes_private_data_descriptor",PES_PRIVATE_DATA_ARRIVED:"pes_private_data_arrived",STATISTICS_INFO:"statistics_info",RECOMMEND_SEEKPOINT:"recommend_seekpoint"}},function(e,t,r){"use strict";r.d(t,"c",(function(){return i})),r.d(t,"b",(function(){return o})),r.d(t,"a",(function(){return a}));var n=r(3),i={kIdle:0,kConnecting:1,kBuffering:2,kError:3,kComplete:4},o={OK:"OK",EXCEPTION:"Exception",HTTP_STATUS_CODE_INVALID:"HttpStatusCodeInvalid",CONNECTING_TIMEOUT:"ConnectingTimeout",EARLY_EOF:"EarlyEof",UNRECOVERABLE_EARLY_EOF:"UnrecoverableEarlyEof"},a=function(){function e(e){this._type=e||"undefined",this._status=i.kIdle,this._needStash=!1,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}return e.prototype.destroy=function(){this._status=i.kIdle,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null},e.prototype.isWorking=function(){return this._status===i.kConnecting||this._status===i.kBuffering},Object.defineProperty(e.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this._status},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"needStashBuffer",{get:function(){return this._needStash},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onContentLengthKnown",{get:function(){return this._onContentLengthKnown},set:function(e){this._onContentLengthKnown=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onURLRedirect",{get:function(){return this._onURLRedirect},set:function(e){this._onURLRedirect=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onDataArrival",{get:function(){return this._onDataArrival},set:function(e){this._onDataArrival=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onError",{get:function(){return this._onError},set:function(e){this._onError=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onComplete",{get:function(){return this._onComplete},set:function(e){this._onComplete=e},enumerable:!1,configurable:!0}),e.prototype.open=function(e,t){throw new n.c("Unimplemented abstract function!")},e.prototype.abort=function(){throw new n.c("Unimplemented abstract function!")},e}()},function(e,t,r){"use strict";r.d(t,"d",(function(){return o})),r.d(t,"a",(function(){return a})),r.d(t,"b",(function(){return s})),r.d(t,"c",(function(){return l}));var n,i=(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=function(){function e(e){this._message=e}return Object.defineProperty(e.prototype,"name",{get:function(){return"RuntimeException"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"message",{get:function(){return this._message},enumerable:!1,configurable:!0}),e.prototype.toString=function(){return this.name+": "+this.message},e}(),a=function(e){function t(t){return e.call(this,t)||this}return i(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"IllegalStateException"},enumerable:!1,configurable:!0}),t}(o),s=function(e){function t(t){return e.call(this,t)||this}return i(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"InvalidArgumentException"},enumerable:!1,configurable:!0}),t}(o),l=function(e){function t(t){return e.call(this,t)||this}return i(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"NotImplementedException"},enumerable:!1,configurable:!0}),t}(o)},function(e,t,r){"use strict";var n={};!function(){var e=self.navigator.userAgent.toLowerCase(),t=/(edge)\/([\w.]+)/.exec(e)||/(opr)[\/]([\w.]+)/.exec(e)||/(chrome)[ \/]([\w.]+)/.exec(e)||/(iemobile)[\/]([\w.]+)/.exec(e)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(firefox)[ \/]([\w.]+)/.exec(e)||[],r=/(ipad)/.exec(e)||/(ipod)/.exec(e)||/(windows phone)/.exec(e)||/(iphone)/.exec(e)||/(kindle)/.exec(e)||/(android)/.exec(e)||/(windows)/.exec(e)||/(mac)/.exec(e)||/(linux)/.exec(e)||/(cros)/.exec(e)||[],i={browser:t[5]||t[3]||t[1]||"",version:t[2]||t[4]||"0",majorVersion:t[4]||t[2]||"0",platform:r[0]||""},o={};if(i.browser){o[i.browser]=!0;var a=i.majorVersion.split(".");o.version={major:parseInt(i.majorVersion,10),string:i.version},a.length>1&&(o.version.minor=parseInt(a[1],10)),a.length>2&&(o.version.build=parseInt(a[2],10))}for(var s in i.platform&&(o[i.platform]=!0),(o.chrome||o.opr||o.safari)&&(o.webkit=!0),(o.rv||o.iemobile)&&(o.rv&&delete o.rv,i.browser="msie",o.msie=!0),o.edge&&(delete o.edge,i.browser="msedge",o.msedge=!0),o.opr&&(i.browser="opera",o.opera=!0),o.safari&&o.android&&(i.browser="android",o.android=!0),o.name=i.browser,o.platform=i.platform,n)n.hasOwnProperty(s)&&delete n[s];Object.assign(n,o)}(),t.a=n},function(e,t,r){"use strict";t.a={OK:"OK",FORMAT_ERROR:"FormatError",FORMAT_UNSUPPORTED:"FormatUnsupported",CODEC_UNSUPPORTED:"CodecUnsupported"}},function(e,t,r){"use strict";var n,i="object"==typeof Reflect?Reflect:null,o=i&&"function"==typeof i.apply?i.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};n=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var a=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}e.exports=s,e.exports.once=function(e,t){return new Promise((function(r,n){function i(r){e.removeListener(t,o),n(r)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}v(e,t,o,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&v(e,"error",t,{once:!0})}(e,i)}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var l=10;function c(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function d(e,t,r,n){var i,o,a,s;if(c(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),a=o[t]),void 0===a)a=o[t]=r,++e._eventsCount;else if("function"==typeof a?a=o[t]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),(i=u(e))>0&&a.length>i&&!a.warned){a.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=a.length,s=l,console&&console.warn&&console.warn(s)}return e}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=h.bind(n);return i.listener=r,n.wrapFn=i,i}function f(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var l=i[e];if(void 0===l)return!1;if("function"==typeof l)o(l,this,t);else{var c=l.length,u=g(l,c);for(r=0;r=0;o--)if(r[o]===t||r[o].listener===t){a=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1=0;n--)this.removeListener(e,t[n]);return this},s.prototype.listeners=function(e){return f(this,e,!0)},s.prototype.rawListeners=function(e){return f(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):m.call(e,t)},s.prototype.listenerCount=m,s.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},function(e,t,r){"use strict";r.d(t,"d",(function(){return n})),r.d(t,"b",(function(){return i})),r.d(t,"a",(function(){return o})),r.d(t,"c",(function(){return a}));var n=function(e,t,r,n,i){this.dts=e,this.pts=t,this.duration=r,this.originalDts=n,this.isSyncPoint=i,this.fileposition=null},i=function(){function e(){this.beginDts=0,this.endDts=0,this.beginPts=0,this.endPts=0,this.originalBeginDts=0,this.originalEndDts=0,this.syncPoints=[],this.firstSample=null,this.lastSample=null}return e.prototype.appendSyncPoint=function(e){e.isSyncPoint=!0,this.syncPoints.push(e)},e}(),o=function(){function e(){this._list=[]}return e.prototype.clear=function(){this._list=[]},e.prototype.appendArray=function(e){var t=this._list;0!==e.length&&(t.length>0&&e[0].originalDts=t[i].dts&&et[n].lastSample.originalDts&&e=t[n].lastSample.originalDts&&(n===t.length-1||n0&&(i=this._searchNearestSegmentBefore(r.originalBeginDts)+1),this._lastAppendLocation=i,this._list.splice(i,0,r)},e.prototype.getLastSegmentBefore=function(e){var t=this._searchNearestSegmentBefore(e);return t>=0?this._list[t]:null},e.prototype.getLastSampleBefore=function(e){var t=this.getLastSegmentBefore(e);return null!=t?t.lastSample:null},e.prototype.getLastSyncPointBefore=function(e){for(var t=this._searchNearestSegmentBefore(e),r=this._list[t].syncPoints;0===r.length&&t>0;)t--,r=this._list[t].syncPoints;return r.length>0?r[r.length-1]:null},e}()},function(e,t,r){"use strict";var n=function(){function e(){this.mimeType=null,this.duration=null,this.hasAudio=null,this.hasVideo=null,this.audioCodec=null,this.videoCodec=null,this.audioDataRate=null,this.videoDataRate=null,this.audioSampleRate=null,this.audioChannelCount=null,this.width=null,this.height=null,this.fps=null,this.profile=null,this.level=null,this.refFrames=null,this.chromaFormat=null,this.sarNum=null,this.sarDen=null,this.metadata=null,this.segments=null,this.segmentCount=null,this.hasKeyframesIndex=null,this.keyframesIndex=null}return e.prototype.isComplete=function(){var e=!1===this.hasAudio||!0===this.hasAudio&&null!=this.audioCodec&&null!=this.audioSampleRate&&null!=this.audioChannelCount,t=!1===this.hasVideo||!0===this.hasVideo&&null!=this.videoCodec&&null!=this.width&&null!=this.height&&null!=this.fps&&null!=this.profile&&null!=this.level&&null!=this.refFrames&&null!=this.chromaFormat&&null!=this.sarNum&&null!=this.sarDen;return null!=this.mimeType&&e&&t},e.prototype.isSeekable=function(){return!0===this.hasKeyframesIndex},e.prototype.getNearestKeyframe=function(e){if(null==this.keyframesIndex)return null;var t=this.keyframesIndex,r=this._search(t.times,e);return{index:r,milliseconds:t.times[r],fileposition:t.filepositions[r]}},e.prototype._search=function(e,t){var r=0,n=e.length-1,i=0,o=0,a=n;for(t=e[i]&&t0){var r=e.getConfig();t.emit("change",r)}},e.registerListener=function(t){e.emitter.addListener("change",t)},e.removeListener=function(t){e.emitter.removeListener("change",t)},e.addLogListener=function(t){o.a.emitter.addListener("log",t),o.a.emitter.listenerCount("log")>0&&(o.a.ENABLE_CALLBACK=!0,e._notifyChange())},e.removeLogListener=function(t){o.a.emitter.removeListener("log",t),0===o.a.emitter.listenerCount("log")&&(o.a.ENABLE_CALLBACK=!1,e._notifyChange())},e}();a.emitter=new i.a,t.a=a},function(e,t,r){"use strict";var n=r(6),i=r.n(n),o=r(0),a=r(4),s=r(8);function l(e,t,r){var n=e;if(t+r=128){t.push(String.fromCharCode(65535&o)),n+=2;continue}}else if(r[n]<240){if(l(r,n,2)&&(o=(15&r[n])<<12|(63&r[n+1])<<6|63&r[n+2])>=2048&&55296!=(63488&o)){t.push(String.fromCharCode(65535&o)),n+=3;continue}}else if(r[n]<248){var o;if(l(r,n,3)&&(o=(7&r[n])<<18|(63&r[n+1])<<12|(63&r[n+2])<<6|63&r[n+3])>65536&&o<1114112){o-=65536,t.push(String.fromCharCode(o>>>10|55296)),t.push(String.fromCharCode(1023&o|56320)),n+=4;continue}}t.push(String.fromCharCode(65533)),++n}return t.join("")},d=r(3),h=(c=new ArrayBuffer(2),new DataView(c).setInt16(0,256,!0),256===new Int16Array(c)[0]),p=function(){function e(){}return e.parseScriptData=function(t,r,n){var i={};try{var a=e.parseValue(t,r,n),s=e.parseValue(t,r+a.size,n-a.size);i[a.data]=s.data}catch(e){o.a.e("AMF",e.toString())}return i},e.parseObject=function(t,r,n){if(n<3)throw new d.a("Data not enough when parse ScriptDataObject");var i=e.parseString(t,r,n),o=e.parseValue(t,r+i.size,n-i.size),a=o.objectEnd;return{data:{name:i.data,value:o.data},size:i.size+o.size,objectEnd:a}},e.parseVariable=function(t,r,n){return e.parseObject(t,r,n)},e.parseString=function(e,t,r){if(r<2)throw new d.a("Data not enough when parse String");var n=new DataView(e,t,r).getUint16(0,!h);return{data:n>0?u(new Uint8Array(e,t+2,n)):"",size:2+n}},e.parseLongString=function(e,t,r){if(r<4)throw new d.a("Data not enough when parse LongString");var n=new DataView(e,t,r).getUint32(0,!h);return{data:n>0?u(new Uint8Array(e,t+4,n)):"",size:4+n}},e.parseDate=function(e,t,r){if(r<10)throw new d.a("Data size invalid when parse Date");var n=new DataView(e,t,r),i=n.getFloat64(0,!h),o=n.getInt16(8,!h);return{data:new Date(i+=60*o*1e3),size:10}},e.parseValue=function(t,r,n){if(n<1)throw new d.a("Data not enough when parse Value");var i,a=new DataView(t,r,n),s=1,l=a.getUint8(0),c=!1;try{switch(l){case 0:i=a.getFloat64(1,!h),s+=8;break;case 1:i=!!a.getUint8(1),s+=1;break;case 2:var u=e.parseString(t,r+1,n-1);i=u.data,s+=u.size;break;case 3:i={};var p=0;for(9==(16777215&a.getUint32(n-4,!h))&&(p=3);s32)throw new d.b("ExpGolomb: readBits() bits exceeded max 32bits!");if(e<=this._current_word_bits_left){var t=this._current_word>>>32-e;return this._current_word<<=e,this._current_word_bits_left-=e,t}var r=this._current_word_bits_left?this._current_word:0;r>>>=32-this._current_word_bits_left;var n=e-this._current_word_bits_left;this._fillCurrentWord();var i=Math.min(n,this._current_word_bits_left),o=this._current_word>>>32-i;return this._current_word<<=i,this._current_word_bits_left-=i,r<>>e)return this._current_word<<=e,this._current_word_bits_left-=e,e;return this._fillCurrentWord(),e+this._skipLeadingZero()},e.prototype.readUEG=function(){var e=this._skipLeadingZero();return this.readBits(e+1)-1},e.prototype.readSEG=function(){var e=this.readUEG();return 1&e?e+1>>>1:-1*(e>>>1)},e}(),m=function(){function e(){}return e._ebsp2rbsp=function(e){for(var t=e,r=t.byteLength,n=new Uint8Array(r),i=0,o=0;o=2&&3===t[o]&&0===t[o-1]&&0===t[o-2]||(n[i]=t[o],i++);return new Uint8Array(n.buffer,0,i)},e.parseSPS=function(t){for(var r=t.subarray(1,4),n="avc1.",i=0;i<3;i++){var o=r[i].toString(16);o.length<2&&(o="0"+o),n+=o}var a=e._ebsp2rbsp(t),s=new f(a);s.readByte();var l=s.readByte();s.readByte();var c=s.readByte();s.readUEG();var u=e.getProfileString(l),d=e.getLevelString(c),h=1,p=420,m=8,g=8;if((100===l||110===l||122===l||244===l||44===l||83===l||86===l||118===l||128===l||138===l||144===l)&&(3===(h=s.readUEG())&&s.readBits(1),h<=3&&(p=[0,420,422,444][h]),m=s.readUEG()+8,g=s.readUEG()+8,s.readBits(1),s.readBool()))for(var v=3!==h?8:12,y=0;y0&&L<16?(R=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2][L-1],A=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1][L-1]):255===L&&(R=s.readByte()<<8|s.readByte(),A=s.readByte()<<8|s.readByte())}if(s.readBool()&&s.readBool(),s.readBool()&&(s.readBits(4),s.readBool()&&s.readBits(24)),s.readBool()&&(s.readUEG(),s.readUEG()),s.readBool()){var j=s.readBits(32),N=s.readBits(32);I=s.readBool(),D=(x=N)/(M=2*j)}}var F=1;1===R&&1===A||(F=R/A);var B=0,U=0;0===h?(B=1,U=2-C):(B=3===h?1:2,U=(1===h?2:1)*(2-C));var V=16*(w+1),H=16*(E+1)*(2-C);V-=(O+P)*B,H-=(T+k)*U;var G=Math.ceil(V*F);return s.destroy(),s=null,{codec_mimetype:n,profile_idc:l,level_idc:c,profile_string:u,level_string:d,chroma_format_idc:h,bit_depth:m,bit_depth_luma:m,bit_depth_chroma:g,ref_frames:S,chroma_format:p,chroma_format_string:e.getChromaFormatString(p),frame_rate:{fixed:I,fps:D,fps_den:M,fps_num:x},sar_ratio:{width:R,height:A},codec_size:{width:V,height:H},present_size:{width:G,height:H}}},e._skipScalingList=function(e,t){for(var r=8,n=8,i=0;i=2&&3===t[o]&&0===t[o-1]&&0===t[o-2]||(n[i]=t[o],i++);return new Uint8Array(n.buffer,0,i)},e.parseVPS=function(t){var r=e._ebsp2rbsp(t),n=new f(r);return n.readByte(),n.readByte(),n.readBits(4),n.readBits(2),n.readBits(6),{num_temporal_layers:n.readBits(3)+1,temporal_id_nested:n.readBool()}},e.parseSPS=function(t){var r=e._ebsp2rbsp(t),n=new f(r);n.readByte(),n.readByte();for(var i=0,o=0,a=0,s=0,l=(n.readBits(4),n.readBits(3)),c=(n.readBool(),n.readBits(2)),u=n.readBool(),d=n.readBits(5),h=n.readByte(),p=n.readByte(),m=n.readByte(),g=n.readByte(),v=n.readByte(),y=n.readByte(),b=n.readByte(),_=n.readByte(),S=n.readByte(),w=n.readByte(),E=n.readByte(),C=[],O=[],P=0;P0)for(P=l;P<8;P++)n.readBits(2);for(P=0;P1&&n.readSEG(),P=0;P0&&Q<=16?($=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2][Q-1],q=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1][Q-1]):255===Q&&($=n.readBits(16),q=n.readBits(16))}if(n.readBool()&&n.readBool(),n.readBool()&&(n.readBits(3),n.readBool(),n.readBool()&&(n.readByte(),n.readByte(),n.readByte())),n.readBool()&&(n.readUEG(),n.readUEG()),n.readBool(),n.readBool(),n.readBool(),n.readBool()&&(n.readUEG(),n.readUEG(),n.readUEG(),n.readUEG()),n.readBool()&&(Y=n.readBits(32),J=n.readBits(32),n.readBool()&&(n.readUEG(),n.readBool()))){var X,ee,te=!1;for(X=n.readBool(),ee=n.readBool(),(X||ee)&&((te=n.readBool())&&(n.readByte(),n.readBits(5),n.readBool(),n.readBits(5)),n.readBits(4),n.readBits(4),te&&n.readBits(4),n.readBits(5),n.readBits(5),n.readBits(5)),P=0;P<=l;P++){var re=n.readBool();Z=re;var ne=!1,ie=1;re||(ne=n.readBool());var oe=!1;if(ne?n.readSEG():oe=n.readBool(),oe||(ie=n.readUEG()+1),X)for(U=0;U>>2!=0,o=!!(1&t[4]),a=(n=t)[5]<<24|n[6]<<16|n[7]<<8|n[8];return a<9?r:{match:!0,consumed:a,dataOffset:a,hasAudioTrack:i,hasVideoTrack:o}},e.prototype.bindDataSource=function(e){return e.onDataArrival=this.parseChunks.bind(this),this},Object.defineProperty(e.prototype,"onTrackMetadata",{get:function(){return this._onTrackMetadata},set:function(e){this._onTrackMetadata=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onMediaInfo",{get:function(){return this._onMediaInfo},set:function(e){this._onMediaInfo=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onMetaDataArrived",{get:function(){return this._onMetaDataArrived},set:function(e){this._onMetaDataArrived=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onScriptDataArrived",{get:function(){return this._onScriptDataArrived},set:function(e){this._onScriptDataArrived=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onError",{get:function(){return this._onError},set:function(e){this._onError=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onDataAvailable",{get:function(){return this._onDataAvailable},set:function(e){this._onDataAvailable=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"timestampBase",{get:function(){return this._timestampBase},set:function(e){this._timestampBase=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"overridedDuration",{get:function(){return this._duration},set:function(e){this._durationOverrided=!0,this._duration=e,this._mediaInfo.duration=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"overridedHasAudio",{set:function(e){this._hasAudioFlagOverrided=!0,this._hasAudio=e,this._mediaInfo.hasAudio=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"overridedHasVideo",{set:function(e){this._hasVideoFlagOverrided=!0,this._hasVideo=e,this._mediaInfo.hasVideo=e},enumerable:!1,configurable:!0}),e.prototype.resetMediaInfo=function(){this._mediaInfo=new s.a},e.prototype._isInitialMetadataDispatched=function(){return this._hasAudio&&this._hasVideo?this._audioInitialMetadataDispatched&&this._videoInitialMetadataDispatched:this._hasAudio&&!this._hasVideo?this._audioInitialMetadataDispatched:!(this._hasAudio||!this._hasVideo)&&this._videoInitialMetadataDispatched},e.prototype.parseChunks=function(t,r){if(!(this._onError&&this._onMediaInfo&&this._onTrackMetadata&&this._onDataAvailable))throw new d.a("Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");var n=0,i=this._littleEndian;if(0===r){if(!(t.byteLength>13))return 0;n=e.probe(t).dataOffset}for(this._firstParse&&(this._firstParse=!1,r+n!==this._dataOffset&&o.a.w(this.TAG,"First time parsing but chunk byteStart invalid!"),0!==(a=new DataView(t,n)).getUint32(0,!i)&&o.a.w(this.TAG,"PrevTagSize0 !== 0 !!!"),n+=4);nt.byteLength)break;var s=a.getUint8(0),l=16777215&a.getUint32(0,!i);if(n+11+l+4>t.byteLength)break;if(8===s||9===s||18===s){var c=a.getUint8(4),u=a.getUint8(5),h=a.getUint8(6)|u<<8|c<<16|a.getUint8(7)<<24;16777215&a.getUint32(7,!i)&&o.a.w(this.TAG,"Meet tag which has StreamID != 0!");var p=n+11;switch(s){case 8:this._parseAudioData(t,p,l,h);break;case 9:this._parseVideoData(t,p,l,h,r+n);break;case 18:this._parseScriptData(t,p,l)}var f=a.getUint32(11+l,!i);f!==11+l&&o.a.w(this.TAG,"Invalid PrevTagSize "+f),n+=11+l+4}else o.a.w(this.TAG,"Unsupported tag type "+s+", skipped"),n+=11+l+4}return this._isInitialMetadataDispatched()&&this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack),n},e.prototype._parseScriptData=function(e,t,r){var n=p.parseScriptData(e,t,r);if(n.hasOwnProperty("onMetaData")){if(null==n.onMetaData||"object"!=typeof n.onMetaData)return void o.a.w(this.TAG,"Invalid onMetaData structure!");this._metadata&&o.a.w(this.TAG,"Found another onMetaData tag!"),this._metadata=n;var i=this._metadata.onMetaData;if(this._onMetaDataArrived&&this._onMetaDataArrived(Object.assign({},i)),"boolean"==typeof i.hasAudio&&!1===this._hasAudioFlagOverrided&&(this._hasAudio=i.hasAudio,this._mediaInfo.hasAudio=this._hasAudio),"boolean"==typeof i.hasVideo&&!1===this._hasVideoFlagOverrided&&(this._hasVideo=i.hasVideo,this._mediaInfo.hasVideo=this._hasVideo),"number"==typeof i.audiodatarate&&(this._mediaInfo.audioDataRate=i.audiodatarate),"number"==typeof i.videodatarate&&(this._mediaInfo.videoDataRate=i.videodatarate),"number"==typeof i.width&&(this._mediaInfo.width=i.width),"number"==typeof i.height&&(this._mediaInfo.height=i.height),"number"==typeof i.duration){if(!this._durationOverrided){var a=Math.floor(i.duration*this._timescale);this._duration=a,this._mediaInfo.duration=a}}else this._mediaInfo.duration=0;if("number"==typeof i.framerate){var s=Math.floor(1e3*i.framerate);if(s>0){var l=s/1e3;this._referenceFrameRate.fixed=!0,this._referenceFrameRate.fps=l,this._referenceFrameRate.fps_num=s,this._referenceFrameRate.fps_den=1e3,this._mediaInfo.fps=l}}if("object"==typeof i.keyframes){this._mediaInfo.hasKeyframesIndex=!0;var c=i.keyframes;this._mediaInfo.keyframesIndex=this._parseKeyframesIndex(c),i.keyframes=null}else this._mediaInfo.hasKeyframesIndex=!1;this._dispatch=!1,this._mediaInfo.metadata=i,o.a.v(this.TAG,"Parsed onMetaData"),this._mediaInfo.isComplete()&&this._onMediaInfo(this._mediaInfo)}Object.keys(n).length>0&&this._onScriptDataArrived&&this._onScriptDataArrived(Object.assign({},n))},e.prototype._parseKeyframesIndex=function(e){for(var t=[],r=[],n=1;n>>4;if(2===a||10===a){var s=0,l=(12&i)>>>2;if(l>=0&&l<=4){s=this._flvSoundRateTable[l];var c=1&i,u=this._audioMetadata,d=this._audioTrack;if(u||(!1===this._hasAudio&&!1===this._hasAudioFlagOverrided&&(this._hasAudio=!0,this._mediaInfo.hasAudio=!0),(u=this._audioMetadata={}).type="audio",u.id=d.id,u.timescale=this._timescale,u.duration=this._duration,u.audioSampleRate=s,u.channelCount=0===c?1:2),10===a){var h=this._parseAACAudioData(e,t+1,r-1);if(null==h)return;if(0===h.packetType){if(u.config){if(w(h.data.config,u.config))return;o.a.w(this.TAG,"AudioSpecificConfig has been changed, re-generate initialization segment")}var p=h.data;u.audioSampleRate=p.samplingRate,u.channelCount=p.channelCount,u.codec=p.codec,u.originalCodec=p.originalCodec,u.config=p.config,u.refSampleDuration=1024/u.audioSampleRate*u.timescale,o.a.v(this.TAG,"Parsed AudioSpecificConfig"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._audioInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("audio",u),(v=this._mediaInfo).audioCodec=u.originalCodec,v.audioSampleRate=u.audioSampleRate,v.audioChannelCount=u.channelCount,v.hasVideo?null!=v.videoCodec&&(v.mimeType='video/x-flv; codecs="'+v.videoCodec+","+v.audioCodec+'"'):v.mimeType='video/x-flv; codecs="'+v.audioCodec+'"',v.isComplete()&&this._onMediaInfo(v)}else if(1===h.packetType){var f=this._timestampBase+n,m={unit:h.data,length:h.data.byteLength,dts:f,pts:f};d.samples.push(m),d.length+=h.data.length}else o.a.e(this.TAG,"Flv: Unsupported AAC data type "+h.packetType)}else if(2===a){if(!u.codec){var v;if(null==(p=this._parseMP3AudioData(e,t+1,r-1,!0)))return;u.audioSampleRate=p.samplingRate,u.channelCount=p.channelCount,u.codec=p.codec,u.originalCodec=p.originalCodec,u.refSampleDuration=1152/u.audioSampleRate*u.timescale,o.a.v(this.TAG,"Parsed MPEG Audio Frame Header"),this._audioInitialMetadataDispatched=!0,this._onTrackMetadata("audio",u),(v=this._mediaInfo).audioCodec=u.codec,v.audioSampleRate=u.audioSampleRate,v.audioChannelCount=u.channelCount,v.audioDataRate=p.bitRate,v.hasVideo?null!=v.videoCodec&&(v.mimeType='video/x-flv; codecs="'+v.videoCodec+","+v.audioCodec+'"'):v.mimeType='video/x-flv; codecs="'+v.audioCodec+'"',v.isComplete()&&this._onMediaInfo(v)}var y=this._parseMP3AudioData(e,t+1,r-1,!1);if(null==y)return;f=this._timestampBase+n;var b={unit:y,length:y.byteLength,dts:f,pts:f};d.samples.push(b),d.length+=y.length}}else this._onError(g.a.FORMAT_ERROR,"Flv: Invalid audio sample rate idx: "+l)}else this._onError(g.a.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec idx: "+a)}},e.prototype._parseAACAudioData=function(e,t,r){if(!(r<=1)){var n={},i=new Uint8Array(e,t,r);return n.packetType=i[0],0===i[0]?n.data=this._parseAACAudioSpecificConfig(e,t+1,r-1):n.data=i.subarray(1),n}o.a.w(this.TAG,"Flv: Invalid AAC packet, missing AACPacketType or/and Data!")},e.prototype._parseAACAudioSpecificConfig=function(e,t,r){var n,i,o=new Uint8Array(e,t,r),a=null,s=0,l=null;if(s=n=o[0]>>>3,(i=(7&o[0])<<1|o[1]>>>7)<0||i>=this._mpegSamplingRates.length)this._onError(g.a.FORMAT_ERROR,"Flv: AAC invalid sampling frequency index!");else{var c=this._mpegSamplingRates[i],u=(120&o[1])>>>3;if(!(u<0||u>=8)){5===s&&(l=(7&o[1])<<1|o[2]>>>7,o[2]);var d=self.navigator.userAgent.toLowerCase();return-1!==d.indexOf("firefox")?i>=6?(s=5,a=new Array(4),l=i-3):(s=2,a=new Array(2),l=i):-1!==d.indexOf("android")?(s=2,a=new Array(2),l=i):(s=5,l=i,a=new Array(4),i>=6?l=i-3:1===u&&(s=2,a=new Array(2),l=i)),a[0]=s<<3,a[0]|=(15&i)>>>1,a[1]=(15&i)<<7,a[1]|=(15&u)<<3,5===s&&(a[1]|=(15&l)>>>1,a[2]=(1&l)<<7,a[2]|=8,a[3]=0),{config:a,samplingRate:c,channelCount:u,codec:"mp4a.40."+s,originalCodec:"mp4a.40."+n}}this._onError(g.a.FORMAT_ERROR,"Flv: AAC invalid channel configuration")}},e.prototype._parseMP3AudioData=function(e,t,r,n){if(!(r<4)){this._littleEndian;var i=new Uint8Array(e,t,r),a=null;if(n){if(255!==i[0])return;var s=i[1]>>>3&3,l=(6&i[1])>>1,c=(240&i[2])>>>4,u=(12&i[2])>>>2,d=3&~(i[3]>>>6)?2:1,h=0,p=0;switch(s){case 0:h=this._mpegAudioV25SampleRateTable[u];break;case 2:h=this._mpegAudioV20SampleRateTable[u];break;case 3:h=this._mpegAudioV10SampleRateTable[u]}switch(l){case 1:c>>4;if(128&a){var l=15&a,c=String.fromCharCode.apply(String,new Uint8Array(e,t,r).slice(1,5));if("hvc1"!==c)return void this._onError(g.a.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: "+c);this._parseEnhancedHEVCVideoPacket(e,t+5,r-5,n,i,s,l)}else{var u=15&a;if(7===u)this._parseAVCVideoPacket(e,t+1,r-1,n,i,s);else{if(12!==u)return void this._onError(g.a.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: "+u);this._parseHEVCVideoPacket(e,t+1,r-1,n,i,s)}}}},e.prototype._parseAVCVideoPacket=function(e,t,r,n,i,a){if(r<4)o.a.w(this.TAG,"Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");else{var s=this._littleEndian,l=new DataView(e,t,r),c=l.getUint8(0),u=(16777215&l.getUint32(0,!s))<<8>>8;if(0===c)this._parseAVCDecoderConfigurationRecord(e,t+4,r-4);else if(1===c)this._parseAVCVideoData(e,t+4,r-4,n,i,a,u);else if(2!==c)return void this._onError(g.a.FORMAT_ERROR,"Flv: Invalid video packet type "+c)}},e.prototype._parseHEVCVideoPacket=function(e,t,r,n,i,a){if(r<4)o.a.w(this.TAG,"Flv: Invalid HEVC packet, missing HEVCPacketType or/and CompositionTime");else{var s=this._littleEndian,l=new DataView(e,t,r),c=l.getUint8(0),u=(16777215&l.getUint32(0,!s))<<8>>8;if(0===c)this._parseHEVCDecoderConfigurationRecord(e,t+4,r-4);else if(1===c)this._parseHEVCVideoData(e,t+4,r-4,n,i,a,u);else if(2!==c)return void this._onError(g.a.FORMAT_ERROR,"Flv: Invalid video packet type "+c)}},e.prototype._parseEnhancedHEVCVideoPacket=function(e,t,r,n,i,a,s){if(r<4)o.a.w(this.TAG,"Flv: Invalid HEVC packet, missing HEVCPacketType or/and CompositionTime");else{var l=this._littleEndian,c=new DataView(e,t,r);if(0===s)this._parseHEVCDecoderConfigurationRecord(e,t,r);else if(1===s){var u=(4294967040&c.getUint32(0,!l))>>8;this._parseHEVCVideoData(e,t+3,r-3,n,i,a,u)}else if(3===s)this._parseHEVCVideoData(e,t,r,n,i,a,0);else if(2!==s)return void this._onError(g.a.FORMAT_ERROR,"Flv: Invalid video packet type "+s)}},e.prototype._parseAVCDecoderConfigurationRecord=function(e,t,r){if(r<7)o.a.w(this.TAG,"Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");else{var n=this._videoMetadata,i=this._videoTrack,a=this._littleEndian,s=new DataView(e,t,r);if(n){if(void 0!==n.avcc){var l=new Uint8Array(e,t,r);if(w(l,n.avcc))return;o.a.w(this.TAG,"AVCDecoderConfigurationRecord has been changed, re-generate initialization segment")}}else!1===this._hasVideo&&!1===this._hasVideoFlagOverrided&&(this._hasVideo=!0,this._mediaInfo.hasVideo=!0),(n=this._videoMetadata={}).type="video",n.id=i.id,n.timescale=this._timescale,n.duration=this._duration;var c=s.getUint8(0),u=s.getUint8(1);if(s.getUint8(2),s.getUint8(3),1===c&&0!==u)if(this._naluLengthSize=1+(3&s.getUint8(4)),3===this._naluLengthSize||4===this._naluLengthSize){var d=31&s.getUint8(5);if(0!==d){d>1&&o.a.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: SPS Count = "+d);for(var h=6,p=0;p1&&o.a.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: PPS Count = "+T),h++,p=0;p=r){o.a.w(this.TAG,"Malformed Nalu near timestamp "+f+", offset = "+h+", dataSize = "+r);break}var g=c.getUint32(h,!l);if(3===p&&(g>>>=8),g>r-p)return void o.a.w(this.TAG,"Malformed Nalus near timestamp "+f+", NaluSize > DataSize!");var v=31&c.getUint8(h+p);5===v&&(m=!0);var y=new Uint8Array(e,t+h,p+g),b={type:v,data:y};u.push(b),d+=y.byteLength,h+=p+g}if(u.length){var _=this._videoTrack,S={units:u,length:d,isKeyframe:m,dts:f,cts:s,pts:f+s};m&&(S.fileposition=i),_.samples.push(S),_.length+=d}},e.prototype._parseHEVCVideoData=function(e,t,r,n,i,a,s){for(var l=this._littleEndian,c=new DataView(e,t,r),u=[],d=0,h=0,p=this._naluLengthSize,f=this._timestampBase+n,m=1===a;h=r){o.a.w(this.TAG,"Malformed Nalu near timestamp "+f+", offset = "+h+", dataSize = "+r);break}var g=c.getUint32(h,!l);if(3===p&&(g>>>=8),g>r-p)return void o.a.w(this.TAG,"Malformed Nalus near timestamp "+f+", NaluSize > DataSize!");var v=31&c.getUint8(h+p);19!==v&&20!==v||(m=!0);var y=new Uint8Array(e,t+h,p+g),b={type:v,data:y};u.push(b),d+=y.byteLength,h+=p+g}if(u.length){var _=this._videoTrack,S={units:u,length:d,isKeyframe:m,dts:f,cts:s,pts:f+s};m&&(S.fileposition=i),_.samples.push(S),_.length+=d}},e}(),C=function(){function e(){}return e.prototype.destroy=function(){this.onError=null,this.onMediaInfo=null,this.onMetaDataArrived=null,this.onTrackMetadata=null,this.onDataAvailable=null,this.onTimedID3Metadata=null,this.onSMPTE2038Metadata=null,this.onSCTE35Metadata=null,this.onPESPrivateData=null,this.onPESPrivateDataDescriptor=null},e}(),O=function(){this.program_pmt_pid={}};!function(e){e[e.kMPEG1Audio=3]="kMPEG1Audio",e[e.kMPEG2Audio=4]="kMPEG2Audio",e[e.kPESPrivateData=6]="kPESPrivateData",e[e.kADTSAAC=15]="kADTSAAC",e[e.kLOASAAC=17]="kLOASAAC",e[e.kAC3=129]="kAC3",e[e.kID3=21]="kID3",e[e.kSCTE35=134]="kSCTE35",e[e.kH264=27]="kH264",e[e.kH265=36]="kH265"}(S||(S={}));var P,T=function(){this.pid_stream_type={},this.common_pids={h264:void 0,h265:void 0,adts_aac:void 0,loas_aac:void 0,opus:void 0,ac3:void 0,mp3:void 0},this.pes_private_data_pids={},this.timed_id3_pids={},this.scte_35_pids={},this.smpte2038_pids={}},k=function(){},R=function(){},A=function(){this.slices=[],this.total_length=0,this.expected_length=0,this.file_position=0};!function(e){e[e.kUnspecified=0]="kUnspecified",e[e.kSliceNonIDR=1]="kSliceNonIDR",e[e.kSliceDPA=2]="kSliceDPA",e[e.kSliceDPB=3]="kSliceDPB",e[e.kSliceDPC=4]="kSliceDPC",e[e.kSliceIDR=5]="kSliceIDR",e[e.kSliceSEI=6]="kSliceSEI",e[e.kSliceSPS=7]="kSliceSPS",e[e.kSlicePPS=8]="kSlicePPS",e[e.kSliceAUD=9]="kSliceAUD",e[e.kEndOfSequence=10]="kEndOfSequence",e[e.kEndOfStream=11]="kEndOfStream",e[e.kFiller=12]="kFiller",e[e.kSPSExt=13]="kSPSExt",e[e.kReserved0=14]="kReserved0"}(P||(P={}));var D,I,x=function(){},M=function(e){var t=e.data.byteLength;this.type=e.type,this.data=new Uint8Array(4+t),new DataView(this.data.buffer).setUint32(0,t),this.data.set(e.data,4)},L=function(){function e(e){this.TAG="H264AnnexBParser",this.current_startcode_offset_=0,this.eof_flag_=!1,this.data_=e,this.current_startcode_offset_=this.findNextStartCodeOffset(0),this.eof_flag_&&o.a.e(this.TAG,"Could not find H264 startcode until payload end!")}return e.prototype.findNextStartCodeOffset=function(e){for(var t=e,r=this.data_;;){if(t+3>=r.byteLength)return this.eof_flag_=!0,r.byteLength;var n=r[t+0]<<24|r[t+1]<<16|r[t+2]<<8|r[t+3],i=r[t+0]<<16|r[t+1]<<8|r[t+2];if(1===n||1===i)return t;t++}},e.prototype.readNextNaluPayload=function(){for(var e=this.data_,t=null;null==t&&!this.eof_flag_;){var r=this.current_startcode_offset_,n=31&e[r+=1==(e[r]<<24|e[r+1]<<16|e[r+2]<<8|e[r+3])?4:3],i=(128&e[r])>>>7,o=this.findNextStartCodeOffset(r);if(this.current_startcode_offset_=o,!(n>=P.kReserved0)&&0===i){var a=e.subarray(r,o);(t=new x).type=n,t.data=a}}return t},e}(),j=function(){function e(e,t,r){var n=8+e.byteLength+1+2+t.byteLength,i=!1;66!==e[3]&&77!==e[3]&&88!==e[3]&&(i=!0,n+=4);var o=this.data=new Uint8Array(n);o[0]=1,o[1]=e[1],o[2]=e[2],o[3]=e[3],o[4]=255,o[5]=225;var a=e.byteLength;o[6]=a>>>8,o[7]=255&a;var s=8;o.set(e,8),o[s+=a]=1;var l=t.byteLength;o[s+1]=l>>>8,o[s+2]=255&l,o.set(t,s+3),s+=3+l,i&&(o[s]=252|r.chroma_format_idc,o[s+1]=248|r.bit_depth_luma-8,o[s+2]=248|r.bit_depth_chroma-8,o[s+3]=0,s+=4)}return e.prototype.getData=function(){return this.data},e}();!function(e){e[e.kNull=0]="kNull",e[e.kAACMain=1]="kAACMain",e[e.kAAC_LC=2]="kAAC_LC",e[e.kAAC_SSR=3]="kAAC_SSR",e[e.kAAC_LTP=4]="kAAC_LTP",e[e.kAAC_SBR=5]="kAAC_SBR",e[e.kAAC_Scalable=6]="kAAC_Scalable",e[e.kLayer1=32]="kLayer1",e[e.kLayer2=33]="kLayer2",e[e.kLayer3=34]="kLayer3"}(D||(D={})),function(e){e[e.k96000Hz=0]="k96000Hz",e[e.k88200Hz=1]="k88200Hz",e[e.k64000Hz=2]="k64000Hz",e[e.k48000Hz=3]="k48000Hz",e[e.k44100Hz=4]="k44100Hz",e[e.k32000Hz=5]="k32000Hz",e[e.k24000Hz=6]="k24000Hz",e[e.k22050Hz=7]="k22050Hz",e[e.k16000Hz=8]="k16000Hz",e[e.k12000Hz=9]="k12000Hz",e[e.k11025Hz=10]="k11025Hz",e[e.k8000Hz=11]="k8000Hz",e[e.k7350Hz=12]="k7350Hz"}(I||(I={}));var N,F,B=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],U=(N=function(e,t){return(N=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}N(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),V=function(){},H=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return U(t,e),t}(V),G=function(){function e(e){this.TAG="AACADTSParser",this.data_=e,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&o.a.e(this.TAG,"Could not found ADTS syncword until payload end")}return e.prototype.findNextSyncwordOffset=function(e){for(var t=e,r=this.data_;;){if(t+7>=r.byteLength)return this.eof_flag_=!0,r.byteLength;if(4095==(r[t+0]<<8|r[t+1])>>>4)return t;t++}},e.prototype.readNextAACFrame=function(){for(var e=this.data_,t=null;null==t&&!this.eof_flag_;){var r=this.current_syncword_offset_,n=(8&e[r+1])>>>3,i=(6&e[r+1])>>>1,o=1&e[r+1],a=(192&e[r+2])>>>6,s=(60&e[r+2])>>>2,l=(1&e[r+2])<<2|(192&e[r+3])>>>6,c=(3&e[r+3])<<11|e[r+4]<<3|(224&e[r+5])>>>5;if(e[r+6],r+c>this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var u=1===o?7:9,d=c-u;r+=u;var h=this.findNextSyncwordOffset(r+d);if(this.current_syncword_offset_=h,(0===n||1===n)&&0===i){var p=e.subarray(r,r+d);(t=new V).audio_object_type=a+1,t.sampling_freq_index=s,t.sampling_frequency=B[s],t.channel_config=l,t.data=p}}return t},e.prototype.hasIncompleteData=function(){return this.has_last_incomplete_data},e.prototype.getIncompleteData=function(){return this.has_last_incomplete_data?this.data_.subarray(this.current_syncword_offset_):null},e}(),W=function(){function e(e){this.TAG="AACLOASParser",this.data_=e,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&o.a.e(this.TAG,"Could not found LOAS syncword until payload end")}return e.prototype.findNextSyncwordOffset=function(e){for(var t=e,r=this.data_;;){if(t+1>=r.byteLength)return this.eof_flag_=!0,r.byteLength;if(695==(r[t+0]<<3|r[t+1]>>>5))return t;t++}},e.prototype.getLATMValue=function(e){for(var t=e.readBits(2),r=0,n=0;n<=t;n++)r<<=8,r|=e.readByte();return r},e.prototype.readNextAACFrame=function(e){for(var t=this.data_,r=null;null==r&&!this.eof_flag_;){var n=this.current_syncword_offset_,i=(31&t[n+1])<<8|t[n+2];if(n+3+i>=this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var a=new f(t.subarray(n+3,n+3+i)),s=null;if(a.readBool()){if(null==e){o.a.w(this.TAG,"StreamMuxConfig Missing"),this.current_syncword_offset_=this.findNextSyncwordOffset(n+3+i),a.destroy();continue}s=e}else{var l=a.readBool();if(l&&a.readBool()){o.a.e(this.TAG,"audioMuxVersionA is Not Supported"),a.destroy();break}if(l&&this.getLATMValue(a),!a.readBool()){o.a.e(this.TAG,"allStreamsSameTimeFraming zero is Not Supported"),a.destroy();break}if(0!==a.readBits(6)){o.a.e(this.TAG,"more than 2 numSubFrames Not Supported"),a.destroy();break}if(0!==a.readBits(4)){o.a.e(this.TAG,"more than 2 numProgram Not Supported"),a.destroy();break}if(0!==a.readBits(3)){o.a.e(this.TAG,"more than 2 numLayer Not Supported"),a.destroy();break}var c=l?this.getLATMValue(a):0,u=a.readBits(5);c-=5;var d=a.readBits(4);c-=4;var h=a.readBits(4);c-=4,a.readBits(3),(c-=3)>0&&a.readBits(c);var p=a.readBits(3);if(0!==p){o.a.e(this.TAG,"frameLengthType = "+p+". Only frameLengthType = 0 Supported"),a.destroy();break}a.readByte();var m=a.readBool();if(m)if(l)this.getLATMValue(a);else{for(var g=0;;){g<<=8;var v=a.readBool();if(g+=a.readByte(),!v)break}console.log(g)}a.readBool()&&a.readByte(),(s=new H).audio_object_type=u,s.sampling_freq_index=d,s.sampling_frequency=B[s.sampling_freq_index],s.channel_config=h,s.other_data_present=m}for(var y=0;;){var b=a.readByte();if(y+=b,255!==b)break}for(var _=new Uint8Array(y),S=0;S=6?(n=5,t=new Array(4),a=i-3):(n=2,t=new Array(2),a=i):-1!==s.indexOf("android")?(n=2,t=new Array(2),a=i):(n=5,a=i,t=new Array(4),i>=6?a=i-3:1===o&&(n=2,t=new Array(2),a=i)),t[0]=n<<3,t[0]|=(15&i)>>>1,t[1]=(15&i)<<7,t[1]|=(15&o)<<3,5===n&&(t[1]|=(15&a)>>>1,t[2]=(1&a)<<7,t[2]|=8,t[3]=0),this.config=t,this.sampling_rate=B[i],this.channel_count=o,this.codec_mimetype="mp4a.40."+n,this.original_codec_mimetype="mp4a.40."+r},K=function(){},$=function(){};!function(e){e[e.kSpliceNull=0]="kSpliceNull",e[e.kSpliceSchedule=4]="kSpliceSchedule",e[e.kSpliceInsert=5]="kSpliceInsert",e[e.kTimeSignal=6]="kTimeSignal",e[e.kBandwidthReservation=7]="kBandwidthReservation",e[e.kPrivateCommand=255]="kPrivateCommand"}(F||(F={}));var q,Z=function(e){var t=e.readBool();return t?(e.readBits(6),{time_specified_flag:t,pts_time:4*e.readBits(31)+e.readBits(2)}):(e.readBits(7),{time_specified_flag:t})},Y=function(e){var t=e.readBool();return e.readBits(6),{auto_return:t,duration:4*e.readBits(31)+e.readBits(2)}},J=function(e,t){var r=t.readBits(8);return e?{component_tag:r}:{component_tag:r,splice_time:Z(t)}},Q=function(e){return{component_tag:e.readBits(8),utc_splice_time:e.readBits(32)}},X=function(e){var t=e.readBits(32),r=e.readBool();e.readBits(7);var n={splice_event_id:t,splice_event_cancel_indicator:r};if(r)return n;if(n.out_of_network_indicator=e.readBool(),n.program_splice_flag=e.readBool(),n.duration_flag=e.readBool(),e.readBits(5),n.program_splice_flag)n.utc_splice_time=e.readBits(32);else{n.component_count=e.readBits(8),n.components=[];for(var i=0;i=r.byteLength)return this.eof_flag_=!0,r.byteLength;var n=r[t+0]<<24|r[t+1]<<16|r[t+2]<<8|r[t+3],i=r[t+0]<<16|r[t+1]<<8|r[t+2];if(1===n||1===i)return t;t++}},e.prototype.readNextNaluPayload=function(){for(var e=this.data_,t=null;null==t&&!this.eof_flag_;){var r=this.current_startcode_offset_,n=e[r+=1==(e[r]<<24|e[r+1]<<16|e[r+2]<<8|e[r+3])?4:3]>>1&63,i=(128&e[r])>>>7,o=this.findNextStartCodeOffset(r);if(this.current_startcode_offset_=o,0===i){var a=e.subarray(r,o);(t=new se).type=n,t.data=a}}return t},e}(),ue=function(){function e(e,t,r,n){var i=23+(5+e.byteLength)+(5+t.byteLength)+(5+r.byteLength),o=this.data=new Uint8Array(i);o[0]=1,o[1]=(3&n.general_profile_space)<<6|(n.general_tier_flag?1:0)<<5|31&n.general_profile_idc,o[2]=n.general_profile_compatibility_flags_1,o[3]=n.general_profile_compatibility_flags_2,o[4]=n.general_profile_compatibility_flags_3,o[5]=n.general_profile_compatibility_flags_4,o[6]=n.general_constraint_indicator_flags_1,o[7]=n.general_constraint_indicator_flags_2,o[8]=n.general_constraint_indicator_flags_3,o[9]=n.general_constraint_indicator_flags_4,o[10]=n.general_constraint_indicator_flags_5,o[11]=n.general_constraint_indicator_flags_6,o[12]=n.general_level_idc,o[13]=240|(3840&n.min_spatial_segmentation_idc)>>8,o[14]=255&n.min_spatial_segmentation_idc,o[15]=252|3&n.parallelismType,o[16]=252|3&n.chroma_format_idc,o[17]=248|7&n.bit_depth_luma_minus8,o[18]=248|7&n.bit_depth_chroma_minus8,o[19]=0,o[20]=0,o[21]=(3&n.constant_frame_rate)<<6|(7&n.num_temporal_layers)<<3|(n.temporal_id_nested?1:0)<<2|3,o[22]=3,o[23]=128|q.kSliceVPS,o[24]=0,o[25]=1,o[26]=(65280&e.byteLength)>>8,o[27]=255&e.byteLength,o.set(e,28),o[23+(5+e.byteLength)+0]=128|q.kSliceSPS,o[23+(5+e.byteLength)+1]=0,o[23+(5+e.byteLength)+2]=1,o[23+(5+e.byteLength)+3]=(65280&t.byteLength)>>8,o[23+(5+e.byteLength)+4]=255&t.byteLength,o.set(t,23+(5+e.byteLength)+5),o[23+(5+e.byteLength+5+t.byteLength)+0]=128|q.kSlicePPS,o[23+(5+e.byteLength+5+t.byteLength)+1]=0,o[23+(5+e.byteLength+5+t.byteLength)+2]=1,o[23+(5+e.byteLength+5+t.byteLength)+3]=(65280&r.byteLength)>>8,o[23+(5+e.byteLength+5+t.byteLength)+4]=255&r.byteLength,o.set(r,23+(5+e.byteLength+5+t.byteLength)+5)}return e.prototype.getData=function(){return this.data},e}(),de=function(){},he=function(){},pe=function(){},fe=[[64,64,80,80,96,96,112,112,128,128,160,160,192,192,224,224,256,256,320,320,384,384,448,448,512,512,640,640,768,768,896,896,1024,1024,1152,1152,1280,1280],[69,70,87,88,104,105,121,122,139,140,174,175,208,209,243,244,278,279,348,349,417,418,487,488,557,558,696,697,835,836,975,976,1114,1115,1253,1254,1393,1394],[96,96,120,120,144,144,168,168,192,192,240,240,288,288,336,336,384,384,480,480,576,576,672,672,768,768,960,960,1152,1152,1344,1344,1536,1536,1728,1728,1920,1920]],me=function(){function e(e){this.TAG="AC3Parser",this.data_=e,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&o.a.e(this.TAG,"Could not found AC3 syncword until payload end")}return e.prototype.findNextSyncwordOffset=function(e){for(var t=e,r=this.data_;;){if(t+7>=r.byteLength)return this.eof_flag_=!0,r.byteLength;if(2935==(r[t+0]<<8|r[t+1]))return t;t++}},e.prototype.readNextAC3Frame=function(){for(var e=this.data_,t=null;null==t&&!this.eof_flag_;){var r=this.current_syncword_offset_,n=e[r+4]>>6,i=[48e3,44200,33e3][n],o=63&e[r+4],a=2*fe[n][o];if(r+a>this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var s=this.findNextSyncwordOffset(r+a);this.current_syncword_offset_=s;var l=e[r+5]>>3,c=7&e[r+5],u=e[r+6]>>5,d=0;!!(1&u)&&1!==u&&(d+=2),!!(4&u)&&(d+=2),2===u&&(d+=2);var h=(e[r+6]<<8|e[r+7])>>12-d&1,p=[2,1,2,3,3,4,4,5][u]+h;(t=new pe).sampling_frequency=i,t.channel_count=p,t.channel_mode=u,t.bit_stream_identification=l,t.low_frequency_effects_channel_on=h,t.bit_stream_mode=c,t.frame_size_code=o,t.data=e.subarray(r,r+a)}return t},e.prototype.hasIncompleteData=function(){return this.has_last_incomplete_data},e.prototype.getIncompleteData=function(){return this.has_last_incomplete_data?this.data_.subarray(this.current_syncword_offset_):null},e}(),ge=function(e){var t;t=[e.sampling_rate_code<<6|e.bit_stream_identification<<1|e.bit_stream_mode>>2,(3&e.bit_stream_mode)<<6|e.channel_mode<<3|e.low_frequency_effects_channel_on<<2|e.frame_size_code>>4,e.frame_size_code<<4&224],this.config=t,this.sampling_rate=e.sampling_frequency,this.bit_stream_identification=e.bit_stream_identification,this.bit_stream_mode=e.bit_stream_mode,this.low_frequency_effects_channel_on=e.low_frequency_effects_channel_on,this.channel_count=e.channel_count,this.channel_mode=e.channel_mode,this.codec_mimetype="ac-3",this.original_codec_mimetype="ac-3"},ve=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ye=function(){return(ye=Object.assign||function(e){for(var t,r=1,n=arguments.length;r=4?(o.a.v("TSDemuxer","ts_packet_size = 192, m2ts mode"),r-=4):204===n&&o.a.v("TSDemuxer","ts_packet_size = 204, RS encoded MPEG2-TS stream"),{match:!0,consumed:0,ts_packet_size:n,sync_offset:r})},t.prototype.bindDataSource=function(e){return e.onDataArrival=this.parseChunks.bind(this),this},t.prototype.resetMediaInfo=function(){this.media_info_=new s.a},t.prototype.parseChunks=function(e,t){if(!(this.onError&&this.onMediaInfo&&this.onTrackMetadata&&this.onDataAvailable))throw new d.a("onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");var r=0;for(this.first_parse_&&(this.first_parse_=!1,r=this.sync_offset_);r+this.ts_packet_size_<=e.byteLength;){var n=t+r;192===this.ts_packet_size_&&(r+=4);var i=new Uint8Array(e,r,188),a=i[0];if(71!==a){o.a.e(this.TAG,"sync_byte = "+a+", not 0x47");break}var s=(64&i[1])>>>6,l=(i[1],(31&i[1])<<8|i[2]),c=(48&i[3])>>>4,u=15&i[3],h={},p=4;if(2==c||3==c){var f=i[4];if(5+f===188){r+=188,204===this.ts_packet_size_&&(r+=16);continue}f>0&&(h=this.parseAdaptationField(e,r+4,1+f)),p=5+f}if(1==c||3==c)if(0===l||l===this.current_pmt_pid_||null!=this.pmt_&&this.pmt_.pid_stream_type[l]===S.kSCTE35){var m=188-p;this.handleSectionSlice(e,r+p,m,{pid:l,file_position:n,payload_unit_start_indicator:s,continuity_conunter:u,random_access_indicator:h.random_access_indicator})}else if(null!=this.pmt_&&null!=this.pmt_.pid_stream_type[l]){m=188-p;var g=this.pmt_.pid_stream_type[l];l!==this.pmt_.common_pids.h264&&l!==this.pmt_.common_pids.h265&&l!==this.pmt_.common_pids.adts_aac&&l!==this.pmt_.common_pids.loas_aac&&l!==this.pmt_.common_pids.ac3&&l!==this.pmt_.common_pids.opus&&l!==this.pmt_.common_pids.mp3&&!0!==this.pmt_.pes_private_data_pids[l]&&!0!==this.pmt_.timed_id3_pids[l]||this.handlePESSlice(e,r+p,m,{pid:l,stream_type:g,file_position:n,payload_unit_start_indicator:s,continuity_conunter:u,random_access_indicator:h.random_access_indicator})}r+=188,204===this.ts_packet_size_&&(r+=16)}return this.dispatchAudioVideoMediaSegment(),r},t.prototype.parseAdaptationField=function(e,t,r){var n=new Uint8Array(e,t,r),i=n[0];return i>0?i>183?(o.a.w(this.TAG,"Illegal adaptation_field_length: "+i),{}):{discontinuity_indicator:(128&n[1])>>>7,random_access_indicator:(64&n[1])>>>6,elementary_stream_priority_indicator:(32&n[1])>>>5}:{}},t.prototype.handleSectionSlice=function(e,t,r,n){var i=new Uint8Array(e,t,r),o=this.section_slice_queues_[n.pid];if(n.payload_unit_start_indicator){var a=i[0];if(null!=o&&0!==o.total_length){var s=new Uint8Array(e,t+1,Math.min(r,a));o.slices.push(s),o.total_length+=s.byteLength,o.total_length===o.expected_length?this.emitSectionSlices(o,n):this.clearSlices(o,n)}for(var l=1+a;l=o.expected_length&&this.clearSlices(o,n),l+=s.byteLength}}else null!=o&&0!==o.total_length&&(s=new Uint8Array(e,t,Math.min(r,o.expected_length-o.total_length)),o.slices.push(s),o.total_length+=s.byteLength,o.total_length===o.expected_length?this.emitSectionSlices(o,n):o.total_length>=o.expected_length&&this.clearSlices(o,n))},t.prototype.handlePESSlice=function(e,t,r,n){var i=new Uint8Array(e,t,r),a=i[0]<<16|i[1]<<8|i[2],s=(i[3],i[4]<<8|i[5]);if(n.payload_unit_start_indicator){if(1!==a)return void o.a.e(this.TAG,"handlePESSlice: packet_start_code_prefix should be 1 but with value "+a);var l=this.pes_slice_queues_[n.pid];l&&(0===l.expected_length||l.expected_length===l.total_length?this.emitPESSlices(l,n):this.clearSlices(l,n)),this.pes_slice_queues_[n.pid]=new A,this.pes_slice_queues_[n.pid].file_position=n.file_position,this.pes_slice_queues_[n.pid].random_access_indicator=n.random_access_indicator}if(null!=this.pes_slice_queues_[n.pid]){var c=this.pes_slice_queues_[n.pid];c.slices.push(i),n.payload_unit_start_indicator&&(c.expected_length=0===s?0:s+6),c.total_length+=i.byteLength,c.expected_length>0&&c.expected_length===c.total_length?this.emitPESSlices(c,n):c.expected_length>0&&c.expected_length>>6,s=t[8],l=void 0,c=void 0;2!==a&&3!==a||(l=536870912*(14&t[9])+4194304*(255&t[10])+16384*(254&t[11])+128*(255&t[12])+(254&t[13])/2,c=3===a?536870912*(14&t[14])+4194304*(255&t[15])+16384*(254&t[16])+128*(255&t[17])+(254&t[18])/2:l);var u=9+s,d=void 0;if(0!==i){if(i<3+s)return void o.a.v(this.TAG,"Malformed PES: PES_packet_length < 3 + PES_header_data_length");d=i-3-s}else d=t.byteLength-u;var h=t.subarray(u,u+d);switch(e.stream_type){case S.kMPEG1Audio:case S.kMPEG2Audio:this.parseMP3Payload(h,l);break;case S.kPESPrivateData:this.pmt_.common_pids.opus===e.pid?this.parseOpusPayload(h,l):this.pmt_.common_pids.ac3===e.pid?this.parseAC3Payload(h,l):this.pmt_.smpte2038_pids[e.pid]?this.parseSMPTE2038MetadataPayload(h,l,c,e.pid,n):this.parsePESPrivateDataPayload(h,l,c,e.pid,n);break;case S.kADTSAAC:this.parseADTSAACPayload(h,l);break;case S.kLOASAAC:this.parseLOASAACPayload(h,l);break;case S.kAC3:this.parseAC3Payload(h,l);break;case S.kID3:this.parseTimedID3MetadataPayload(h,l,c,e.pid,n);break;case S.kH264:this.parseH264Payload(h,l,c,e.file_position,e.random_access_indicator);break;case S.kH265:this.parseH265Payload(h,l,c,e.file_position,e.random_access_indicator)}}else 188!==n&&191!==n&&240!==n&&241!==n&&255!==n&&242!==n&&248!==n||e.stream_type!==S.kPESPrivateData||(u=6,d=void 0,d=0!==i?i:t.byteLength-u,h=t.subarray(u,u+d),this.parsePESPrivateDataPayload(h,void 0,void 0,e.pid,n));else o.a.e(this.TAG,"parsePES: packet_start_code_prefix should be 1 but with value "+r)},t.prototype.parsePAT=function(e){var t=e[0];if(0===t){var r=(15&e[1])<<8|e[2],n=(e[3],e[4],(62&e[5])>>>1),i=1&e[5],a=e[6],s=(e[7],null);if(1===i&&0===a)(s=new O).version_number=n;else if(null==(s=this.pat_))return;for(var l=r-5-4,c=-1,u=-1,d=8;d<8+l;d+=4){var h=e[d]<<8|e[d+1],p=(31&e[d+2])<<8|e[d+3];0===h?s.network_pid=p:(s.program_pmt_pid[h]=p,-1===c&&(c=h),-1===u&&(u=p))}1===i&&0===a&&(null==this.pat_&&o.a.v(this.TAG,"Parsed first PAT: "+JSON.stringify(s)),this.pat_=s,this.current_program_=c,this.current_pmt_pid_=u)}else o.a.e(this.TAG,"parsePAT: table_id "+t+" is not corresponded to PAT!")},t.prototype.parsePMT=function(e){var t=e[0];if(2===t){var r=(15&e[1])<<8|e[2],n=e[3]<<8|e[4],i=(62&e[5])>>>1,a=1&e[5],s=e[6],l=(e[7],null);if(1===a&&0===s)(l=new T).program_number=n,l.version_number=i,this.program_pmt_map_[n]=l;else if(null==(l=this.program_pmt_map_[n]))return;e[8],e[9];for(var c=(15&e[10])<<8|e[11],u=12+c,d=r-9-c-4,h=u;h0){for(var y=h+5;y1&&(o.a.w(this.TAG,"AAC: Detected pts overlapped, expected: "+a+"ms, PES pts: "+i+"ms"),i=a)}}for(var s,l=new G(e),c=null,u=i;null!=(c=l.readNextAACFrame());){n=1024/c.sampling_frequency*1e3;var d={codec:"aac",data:c};0==this.audio_init_segment_dispatched_?(this.audio_metadata_={codec:"aac",audio_object_type:c.audio_object_type,sampling_freq_index:c.sampling_freq_index,sampling_frequency:c.sampling_frequency,channel_config:c.channel_config},this.dispatchAudioInitSegment(d)):this.detectAudioMetadataChange(d)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(d)),s=u;var h=Math.floor(u),p={unit:c.data,length:c.data.byteLength,pts:h,dts:h};this.audio_track_.samples.push(p),this.audio_track_.length+=c.data.byteLength,u+=n}l.hasIncompleteData()&&(this.aac_last_incomplete_data_=l.getIncompleteData()),s&&(this.aac_last_sample_pts_=s)}},t.prototype.parseLOASAACPayload=function(e,t){var r;if(!this.has_video_||this.video_init_segment_dispatched_){if(this.aac_last_incomplete_data_){var n=new Uint8Array(e.byteLength+this.aac_last_incomplete_data_.byteLength);n.set(this.aac_last_incomplete_data_,0),n.set(e,this.aac_last_incomplete_data_.byteLength),e=n}var i,a;if(null!=t&&(a=t/this.timescale_),"aac"===this.audio_metadata_.codec){if(null==t&&null!=this.aac_last_sample_pts_)i=1024/this.audio_metadata_.sampling_frequency*1e3,a=this.aac_last_sample_pts_+i;else if(null==t)return void o.a.w(this.TAG,"AAC: Unknown pts");if(this.aac_last_incomplete_data_&&this.aac_last_sample_pts_){i=1024/this.audio_metadata_.sampling_frequency*1e3;var s=this.aac_last_sample_pts_+i;Math.abs(s-a)>1&&(o.a.w(this.TAG,"AAC: Detected pts overlapped, expected: "+s+"ms, PES pts: "+a+"ms"),a=s)}}for(var l,c=new W(e),u=null,d=a;null!=(u=c.readNextAACFrame(null!==(r=this.loas_previous_frame)&&void 0!==r?r:void 0));){this.loas_previous_frame=u,i=1024/u.sampling_frequency*1e3;var h={codec:"aac",data:u};0==this.audio_init_segment_dispatched_?(this.audio_metadata_={codec:"aac",audio_object_type:u.audio_object_type,sampling_freq_index:u.sampling_freq_index,sampling_frequency:u.sampling_frequency,channel_config:u.channel_config},this.dispatchAudioInitSegment(h)):this.detectAudioMetadataChange(h)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(h)),l=d;var p=Math.floor(d),f={unit:u.data,length:u.data.byteLength,pts:p,dts:p};this.audio_track_.samples.push(f),this.audio_track_.length+=u.data.byteLength,d+=i}c.hasIncompleteData()&&(this.aac_last_incomplete_data_=c.getIncompleteData()),l&&(this.aac_last_sample_pts_=l)}},t.prototype.parseAC3Payload=function(e,t){if(!this.has_video_||this.video_init_segment_dispatched_){var r,n;if(null!=t&&(n=t/this.timescale_),"ac-3"===this.audio_metadata_.codec)if(null==t&&null!=this.aac_last_sample_pts_)r=1536/this.audio_metadata_.sampling_frequency*1e3,n=this.aac_last_sample_pts_+r;else if(null==t)return void o.a.w(this.TAG,"Opus: Unknown pts");for(var i,a=new me(e),s=null,l=n;null!=(s=a.readNextAC3Frame());){r=1536/s.sampling_frequency*1e3;var c={codec:"ac-3",data:s};0==this.audio_init_segment_dispatched_?(this.audio_metadata_={codec:"ac-3",sampling_frequency:s.sampling_frequency,bit_stream_identification:s.bit_stream_identification,bit_stream_mode:s.bit_stream_mode,low_frequency_effects_channel_on:s.low_frequency_effects_channel_on,channel_mode:s.channel_mode},console.log(JSON.stringify(this.audio_metadata_)),this.dispatchAudioInitSegment(c)):this.detectAudioMetadataChange(c)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(c)),i=l;var u=Math.floor(l),d={unit:s.data,length:s.data.byteLength,pts:u,dts:u};this.audio_track_.samples.push(d),this.audio_track_.length+=s.data.byteLength,l+=r}i&&(this.aac_last_sample_pts_=i)}},t.prototype.parseOpusPayload=function(e,t){if(!this.has_video_||this.video_init_segment_dispatched_){var r,n;if(null!=t&&(n=t/this.timescale_),"opus"===this.audio_metadata_.codec)if(null==t&&null!=this.aac_last_sample_pts_)r=20,n=this.aac_last_sample_pts_+r;else if(null==t)return void o.a.w(this.TAG,"Opus: Unknown pts");for(var i,a=n,s=0;s>>3&3,n=(6&e[1])>>1,i=(e[2],(12&e[2])>>>2),o=3&~(e[3]>>>6)?2:1,a=0,s=34;switch(r){case 0:a=[11025,12e3,8e3,0][i];break;case 2:a=[22050,24e3,16e3,0][i];break;case 3:a=[44100,48e3,32e3,0][i]}switch(n){case 1:s=34;break;case 2:s=33;break;case 3:s=32}var l=new he;l.object_type=s,l.sample_rate=a,l.channel_count=o,l.data=e;var c={codec:"mp3",data:l};0==this.audio_init_segment_dispatched_?(this.audio_metadata_={codec:"mp3",object_type:s,sample_rate:a,channel_count:o},this.dispatchAudioInitSegment(c)):this.detectAudioMetadataChange(c)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(c));var u={unit:e,length:e.byteLength,pts:t/this.timescale_,dts:t/this.timescale_};this.audio_track_.samples.push(u),this.audio_track_.length+=e.byteLength}},t.prototype.detectAudioMetadataChange=function(e){if(e.codec!==this.audio_metadata_.codec)return o.a.v(this.TAG,"Audio: Audio Codecs changed from "+this.audio_metadata_.codec+" to "+e.codec),!0;if("aac"===e.codec&&"aac"===this.audio_metadata_.codec){if((t=e.data).audio_object_type!==this.audio_metadata_.audio_object_type)return o.a.v(this.TAG,"AAC: AudioObjectType changed from "+this.audio_metadata_.audio_object_type+" to "+t.audio_object_type),!0;if(t.sampling_freq_index!==this.audio_metadata_.sampling_freq_index)return o.a.v(this.TAG,"AAC: SamplingFrequencyIndex changed from "+this.audio_metadata_.sampling_freq_index+" to "+t.sampling_freq_index),!0;if(t.channel_config!==this.audio_metadata_.channel_config)return o.a.v(this.TAG,"AAC: Channel configuration changed from "+this.audio_metadata_.channel_config+" to "+t.channel_config),!0}else if("ac-3"===e.codec&&"ac-3"===this.audio_metadata_.codec){var t;if((t=e.data).sampling_frequency!==this.audio_metadata_.sampling_frequency)return o.a.v(this.TAG,"AC3: Sampling Frequency changed from "+this.audio_metadata_.sampling_frequency+" to "+t.sampling_frequency),!0;if(t.bit_stream_identification!==this.audio_metadata_.bit_stream_identification)return o.a.v(this.TAG,"AC3: Bit Stream Identification changed from "+this.audio_metadata_.bit_stream_identification+" to "+t.bit_stream_identification),!0;if(t.bit_stream_mode!==this.audio_metadata_.bit_stream_mode)return o.a.v(this.TAG,"AC3: BitStream Mode changed from "+this.audio_metadata_.bit_stream_mode+" to "+t.bit_stream_mode),!0;if(t.channel_mode!==this.audio_metadata_.channel_mode)return o.a.v(this.TAG,"AC3: Channel Mode changed from "+this.audio_metadata_.channel_mode+" to "+t.channel_mode),!0;if(t.low_frequency_effects_channel_on!==this.audio_metadata_.low_frequency_effects_channel_on)return o.a.v(this.TAG,"AC3: Low Frequency Effects Channel On changed from "+this.audio_metadata_.low_frequency_effects_channel_on+" to "+t.low_frequency_effects_channel_on),!0}else if("opus"===e.codec&&"opus"===this.audio_metadata_.codec){if((r=e.meta).sample_rate!==this.audio_metadata_.sample_rate)return o.a.v(this.TAG,"Opus: SamplingFrequencyIndex changed from "+this.audio_metadata_.sample_rate+" to "+r.sample_rate),!0;if(r.channel_count!==this.audio_metadata_.channel_count)return o.a.v(this.TAG,"Opus: Channel count changed from "+this.audio_metadata_.channel_count+" to "+r.channel_count),!0}else if("mp3"===e.codec&&"mp3"===this.audio_metadata_.codec){var r;if((r=e.data).object_type!==this.audio_metadata_.object_type)return o.a.v(this.TAG,"MP3: AudioObjectType changed from "+this.audio_metadata_.object_type+" to "+r.object_type),!0;if(r.sample_rate!==this.audio_metadata_.sample_rate)return o.a.v(this.TAG,"MP3: SamplingFrequencyIndex changed from "+this.audio_metadata_.sample_rate+" to "+r.sample_rate),!0;if(r.channel_count!==this.audio_metadata_.channel_count)return o.a.v(this.TAG,"MP3: Channel count changed from "+this.audio_metadata_.channel_count+" to "+r.channel_count),!0}return!1},t.prototype.dispatchAudioInitSegment=function(e){var t={type:"audio"};if(t.id=this.audio_track_.id,t.timescale=1e3,t.duration=this.duration_,"aac"===this.audio_metadata_.codec){var r="aac"===e.codec?e.data:null,n=new z(r);t.audioSampleRate=n.sampling_rate,t.channelCount=n.channel_count,t.codec=n.codec_mimetype,t.originalCodec=n.original_codec_mimetype,t.config=n.config,t.refSampleDuration=1024/t.audioSampleRate*t.timescale}else if("ac-3"===this.audio_metadata_.codec){var i="ac-3"===e.codec?e.data:null,a=new ge(i);t.audioSampleRate=a.sampling_rate,t.channelCount=a.channel_count,t.codec=a.codec_mimetype,t.originalCodec=a.original_codec_mimetype,t.config=a.config,t.refSampleDuration=1536/t.audioSampleRate*t.timescale}else"opus"===this.audio_metadata_.codec?(t.audioSampleRate=this.audio_metadata_.sample_rate,t.channelCount=this.audio_metadata_.channel_count,t.channelConfigCode=this.audio_metadata_.channel_config_code,t.codec="opus",t.originalCodec="opus",t.config=void 0,t.refSampleDuration=20):"mp3"===this.audio_metadata_.codec&&(t.audioSampleRate=this.audio_metadata_.sample_rate,t.channelCount=this.audio_metadata_.channel_count,t.codec="mp3",t.originalCodec="mp3",t.config=void 0);0==this.audio_init_segment_dispatched_&&o.a.v(this.TAG,"Generated first AudioSpecificConfig for mimeType: "+t.codec),this.onTrackMetadata("audio",t),this.audio_init_segment_dispatched_=!0,this.video_metadata_changed_=!1;var s=this.media_info_;s.hasAudio=!0,s.audioCodec=t.originalCodec,s.audioSampleRate=t.audioSampleRate,s.audioChannelCount=t.channelCount,s.hasVideo&&s.videoCodec?s.mimeType='video/mp2t; codecs="'+s.videoCodec+","+s.audioCodec+'"':s.mimeType='video/mp2t; codecs="'+s.audioCodec+'"',s.isComplete()&&this.onMediaInfo(s)},t.prototype.dispatchPESPrivateDataDescriptor=function(e,t,r){var n=new $;n.pid=e,n.stream_type=t,n.descriptor=r,this.onPESPrivateDataDescriptor&&this.onPESPrivateDataDescriptor(n)},t.prototype.parsePESPrivateDataPayload=function(e,t,r,n,i){var o=new K;if(o.pid=n,o.stream_id=i,o.len=e.byteLength,o.data=e,null!=t){var a=Math.floor(t/this.timescale_);o.pts=a}else o.nearest_pts=this.aac_last_sample_pts_;if(null!=r){var s=Math.floor(r/this.timescale_);o.dts=s}this.onPESPrivateData&&this.onPESPrivateData(o)},t.prototype.parseTimedID3MetadataPayload=function(e,t,r,n,i){var o=new K;if(o.pid=n,o.stream_id=i,o.len=e.byteLength,o.data=e,null!=t){var a=Math.floor(t/this.timescale_);o.pts=a}if(null!=r){var s=Math.floor(r/this.timescale_);o.dts=s}this.onTimedID3Metadata&&this.onTimedID3Metadata(o)},t.prototype.parseSMPTE2038MetadataPayload=function(e,t,r,n,i){var o=new de;if(o.pid=n,o.stream_id=i,o.len=e.byteLength,o.data=e,null!=t){var a=Math.floor(t/this.timescale_);o.pts=a}if(o.nearest_pts=this.aac_last_sample_pts_,null!=r){var s=Math.floor(r/this.timescale_);o.dts=s}o.ancillaries=function(e){for(var t=new f(e),r=0,n=[];r+=6,0===t.readBits(6);){var i=t.readBool();r+=1;var o=t.readBits(11);r+=11;var a=t.readBits(12);r+=12;var s=255&t.readBits(10);r+=10;var l=255&t.readBits(10);r+=10;var c=255&t.readBits(10);r+=10;for(var u=new Uint8Array(c),d=0;d>>24&255,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=255&t,r.set(e,4);var a=8;for(o=0;o>>24&255,t>>>16&255,t>>>8&255,255&t,r>>>24&255,r>>>16&255,r>>>8&255,255&r,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]))},e.trak=function(t){return e.box(e.types.trak,e.tkhd(t),e.mdia(t))},e.tkhd=function(t){var r=t.id,n=t.duration,i=t.presentWidth,o=t.presentHeight;return e.box(e.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,r>>>24&255,r>>>16&255,r>>>8&255,255&r,0,0,0,0,n>>>24&255,n>>>16&255,n>>>8&255,255&n,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,i>>>8&255,255&i,0,0,o>>>8&255,255&o,0,0]))},e.mdia=function(t){return e.box(e.types.mdia,e.mdhd(t),e.hdlr(t),e.minf(t))},e.mdhd=function(t){var r=t.timescale,n=t.duration;return e.box(e.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,r>>>24&255,r>>>16&255,r>>>8&255,255&r,n>>>24&255,n>>>16&255,n>>>8&255,255&n,85,196,0,0]))},e.hdlr=function(t){var r;return r="audio"===t.type?e.constants.HDLR_AUDIO:e.constants.HDLR_VIDEO,e.box(e.types.hdlr,r)},e.minf=function(t){var r;return r="audio"===t.type?e.box(e.types.smhd,e.constants.SMHD):e.box(e.types.vmhd,e.constants.VMHD),e.box(e.types.minf,r,e.dinf(),e.stbl(t))},e.dinf=function(){return e.box(e.types.dinf,e.box(e.types.dref,e.constants.DREF))},e.stbl=function(t){return e.box(e.types.stbl,e.stsd(t),e.box(e.types.stts,e.constants.STTS),e.box(e.types.stsc,e.constants.STSC),e.box(e.types.stsz,e.constants.STSZ),e.box(e.types.stco,e.constants.STCO))},e.stsd=function(t){return"audio"===t.type?"mp3"===t.codec?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.mp3(t)):"ac-3"===t.codec?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.ac3(t)):"opus"===t.codec?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.Opus(t)):e.box(e.types.stsd,e.constants.STSD_PREFIX,e.mp4a(t)):"video"===t.type&&t.codec.startsWith("hvc1")?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.hvc1(t)):e.box(e.types.stsd,e.constants.STSD_PREFIX,e.avc1(t))},e.mp3=function(t){var r=t.channelCount,n=t.audioSampleRate,i=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,r,0,16,0,0,0,0,n>>>8&255,255&n,0,0]);return e.box(e.types[".mp3"],i)},e.mp4a=function(t){var r=t.channelCount,n=t.audioSampleRate,i=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,r,0,16,0,0,0,0,n>>>8&255,255&n,0,0]);return e.box(e.types.mp4a,i,e.esds(t))},e.ac3=function(t){var r=t.channelCount,n=t.audioSampleRate,i=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,r,0,16,0,0,0,0,n>>>8&255,255&n,0,0]);return e.box(e.types["ac-3"],i,e.box(e.types.dac3,new Uint8Array(t.config)))},e.esds=function(t){var r=t.config||[],n=r.length,i=new Uint8Array([0,0,0,0,3,23+n,0,1,0,4,15+n,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([n]).concat(r).concat([6,1,2]));return e.box(e.types.esds,i)},e.Opus=function(t){var r=t.channelCount,n=t.audioSampleRate,i=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,r,0,16,0,0,0,0,n>>>8&255,255&n,0,0]);return e.box(e.types.Opus,i,e.dOps(t))},e.dOps=function(t){var r=t.channelCount,n=t.channelConfigCode,i=t.audioSampleRate;if(t.config)return e.box(e.types.dOps,a);var o=[];switch(n){case 1:case 2:o=[0];break;case 0:o=[255,1,1,0,1];break;case 128:o=[255,2,0,0,1];break;case 3:o=[1,2,1,0,2,1];break;case 4:o=[1,2,2,0,1,2,3];break;case 5:o=[1,3,2,0,4,1,2,3];break;case 6:o=[1,4,2,0,4,1,2,3,5];break;case 7:o=[1,4,2,0,4,1,2,3,5,6];break;case 8:o=[1,5,3,0,6,1,2,3,4,5,7];break;case 130:o=[1,1,2,0,1];break;case 131:o=[1,1,3,0,1,2];break;case 132:o=[1,1,4,0,1,2,3];break;case 133:o=[1,1,5,0,1,2,3,4];break;case 134:o=[1,1,6,0,1,2,3,4,5];break;case 135:o=[1,1,7,0,1,2,3,4,5,6];break;case 136:o=[1,1,8,0,1,2,3,4,5,6,7]}var a=new Uint8Array(function(){for(var e=0,t=0,r=arguments.length;t>>24&255,i>>>17&255,i>>>8&255,i>>>0&255,0,0],o));return e.box(e.types.dOps,a)},e.avc1=function(t){var r=t.avcc,n=t.codecWidth,i=t.codecHeight,o=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,n>>>8&255,255&n,i>>>8&255,255&i,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,120,113,113,47,102,108,118,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]);return e.box(e.types.avc1,o,e.box(e.types.avcC,r))},e.hvc1=function(t){var r=t.hvcc,n=t.codecWidth,i=t.codecHeight,o=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,n>>>8&255,255&n,i>>>8&255,255&i,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,120,113,113,47,102,108,118,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]);return e.box(e.types.hvc1,o,e.box(e.types.hvcC,r))},e.mvex=function(t){return e.box(e.types.mvex,e.trex(t))},e.trex=function(t){var r=t.id,n=new Uint8Array([0,0,0,0,r>>>24&255,r>>>16&255,r>>>8&255,255&r,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return e.box(e.types.trex,n)},e.moof=function(t,r){return e.box(e.types.moof,e.mfhd(t.sequenceNumber),e.traf(t,r))},e.mfhd=function(t){var r=new Uint8Array([0,0,0,0,t>>>24&255,t>>>16&255,t>>>8&255,255&t]);return e.box(e.types.mfhd,r)},e.traf=function(t,r){var n=t.id,i=e.box(e.types.tfhd,new Uint8Array([0,0,0,0,n>>>24&255,n>>>16&255,n>>>8&255,255&n])),o=e.box(e.types.tfdt,new Uint8Array([0,0,0,0,r>>>24&255,r>>>16&255,r>>>8&255,255&r])),a=e.sdtp(t),s=e.trun(t,a.byteLength+16+16+8+16+8+8);return e.box(e.types.traf,i,o,s,a)},e.sdtp=function(t){for(var r=t.samples||[],n=r.length,i=new Uint8Array(4+n),o=0;o>>24&255,i>>>16&255,i>>>8&255,255&i,r>>>24&255,r>>>16&255,r>>>8&255,255&r],0);for(var s=0;s>>24&255,l>>>16&255,l>>>8&255,255&l,c>>>24&255,c>>>16&255,c>>>8&255,255&c,u.isLeading<<2|u.dependsOn,u.isDependedOn<<6|u.hasRedundancy<<4|u.isNonSync,0,0,d>>>24&255,d>>>16&255,d>>>8&255,255&d],12+16*s)}return e.box(e.types.trun,a)},e.mdat=function(t){return e.box(e.types.mdat,t)},e}();_e.init();var Se=_e,we=function(){function e(){}return e.getSilentFrame=function(e,t){if("mp4a.40.2"===e){if(1===t)return new Uint8Array([0,200,0,128,35,128]);if(2===t)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(6===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224])}else{if(1===t)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(2===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(3===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}return null},e}(),Ee=r(7),Ce=function(){function e(e){this.TAG="MP4Remuxer",this._config=e,this._isLive=!0===e.isLive,this._dtsBase=-1,this._dtsBaseInited=!1,this._audioDtsBase=1/0,this._videoDtsBase=1/0,this._audioNextDts=void 0,this._videoNextDts=void 0,this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList=new Ee.c("audio"),this._videoSegmentInfoList=new Ee.c("video"),this._onInitSegment=null,this._onMediaSegment=null,this._forceFirstIDR=!(!a.a.chrome||!(a.a.version.major<50||50===a.a.version.major&&a.a.version.build<2661)),this._fillSilentAfterSeek=a.a.msedge||a.a.msie,this._mp3UseMpegAudio=!a.a.firefox,this._fillAudioTimestampGap=this._config.fixAudioTimestampGap}return e.prototype.destroy=function(){this._dtsBase=-1,this._dtsBaseInited=!1,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList.clear(),this._audioSegmentInfoList=null,this._videoSegmentInfoList.clear(),this._videoSegmentInfoList=null,this._onInitSegment=null,this._onMediaSegment=null},e.prototype.bindDataSource=function(e){return e.onDataAvailable=this.remux.bind(this),e.onTrackMetadata=this._onTrackMetadataReceived.bind(this),this},Object.defineProperty(e.prototype,"onInitSegment",{get:function(){return this._onInitSegment},set:function(e){this._onInitSegment=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onMediaSegment",{get:function(){return this._onMediaSegment},set:function(e){this._onMediaSegment=e},enumerable:!1,configurable:!0}),e.prototype.insertDiscontinuity=function(){this._audioNextDts=this._videoNextDts=void 0},e.prototype.seek=function(e){this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._videoSegmentInfoList.clear(),this._audioSegmentInfoList.clear()},e.prototype.remux=function(e,t){if(!this._onMediaSegment)throw new d.a("MP4Remuxer: onMediaSegment callback must be specificed!");this._dtsBaseInited||this._calculateDtsBase(e,t),t&&this._remuxVideo(t),e&&this._remuxAudio(e)},e.prototype._onTrackMetadataReceived=function(e,t){var r=null,n="mp4",i=t.codec;if("audio"===e)this._audioMeta=t,"mp3"===t.codec&&this._mp3UseMpegAudio?(n="mpeg",i="",r=new Uint8Array):r=Se.generateInitSegment(t);else{if("video"!==e)return;this._videoMeta=t,r=Se.generateInitSegment(t)}if(!this._onInitSegment)throw new d.a("MP4Remuxer: onInitSegment callback must be specified!");this._onInitSegment(e,{type:e,data:r.buffer,codec:i,container:e+"/"+n,mediaDuration:t.duration})},e.prototype._calculateDtsBase=function(e,t){this._dtsBaseInited||(e&&e.samples&&e.samples.length&&(this._audioDtsBase=e.samples[0].dts),t&&t.samples&&t.samples.length&&(this._videoDtsBase=t.samples[0].dts),this._dtsBase=Math.min(this._audioDtsBase,this._videoDtsBase),this._dtsBaseInited=!0)},e.prototype.getTimestampBase=function(){if(this._dtsBaseInited)return this._dtsBase},e.prototype.flushStashedSamples=function(){var e=this._videoStashedLastSample,t=this._audioStashedLastSample,r={type:"video",id:1,sequenceNumber:0,samples:[],length:0};null!=e&&(r.samples.push(e),r.length=e.length);var n={type:"audio",id:2,sequenceNumber:0,samples:[],length:0};null!=t&&(n.samples.push(t),n.length=t.length),this._videoStashedLastSample=null,this._audioStashedLastSample=null,this._remuxVideo(r,!0),this._remuxAudio(n,!0)},e.prototype._remuxAudio=function(e,t){if(null!=this._audioMeta){var r,n=e,i=n.samples,s=void 0,l=-1,c=this._audioMeta.refSampleDuration,u="mp3"===this._audioMeta.codec&&this._mp3UseMpegAudio,d=this._dtsBaseInited&&void 0===this._audioNextDts,h=!1;if(i&&0!==i.length&&(1!==i.length||t)){var p=0,f=null,m=0;u?(p=0,m=n.length):(p=8,m=8+n.length);var g=null;if(i.length>1&&(m-=(g=i.pop()).length),null!=this._audioStashedLastSample){var v=this._audioStashedLastSample;this._audioStashedLastSample=null,i.unshift(v),m+=v.length}null!=g&&(this._audioStashedLastSample=g);var y=i[0].dts-this._dtsBase;if(this._audioNextDts)s=y-this._audioNextDts;else if(this._audioSegmentInfoList.isEmpty())s=0,this._fillSilentAfterSeek&&!this._videoSegmentInfoList.isEmpty()&&"mp3"!==this._audioMeta.originalCodec&&(h=!0);else{var b=this._audioSegmentInfoList.getLastSampleBefore(y);if(null!=b){var _=y-(b.originalDts+b.duration);_<=3&&(_=0),s=y-(b.dts+b.duration+_)}else s=0}if(h){var S=y-s,w=this._videoSegmentInfoList.getLastSegmentBefore(y);if(null!=w&&w.beginDts=3*c&&this._fillAudioTimestampGap&&!a.a.safari){R=!0;var x,M=Math.floor(s/c);o.a.w(this.TAG,"Large audio timestamp gap detected, may cause AV sync to drift. Silent frames will be generated to avoid unsync.\noriginalDts: "+k+" ms, curRefDts: "+I+" ms, dtsCorrection: "+Math.round(s)+" ms, generate: "+M+" frames"),E=Math.floor(I),D=Math.floor(I+c)-E,null==(x=we.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount))&&(o.a.w(this.TAG,"Unable to generate silent frame for "+this._audioMeta.originalCodec+" with "+this._audioMeta.channelCount+" channels, repeat last frame"),x=T),A=[];for(var L=0;L=1?O[O.length-1].duration:Math.floor(c),this._audioNextDts=E+D;-1===l&&(l=E),O.push({dts:E,pts:E,cts:0,unit:v.unit,size:v.unit.byteLength,duration:D,originalDts:k,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}}),R&&O.push.apply(O,A)}}if(0===O.length)return n.samples=[],void(n.length=0);for(u?f=new Uint8Array(m):((f=new Uint8Array(m))[0]=m>>>24&255,f[1]=m>>>16&255,f[2]=m>>>8&255,f[3]=255&m,f.set(Se.types.mdat,4)),P=0;P1&&(d-=(h=o.pop()).length),null!=this._videoStashedLastSample){var p=this._videoStashedLastSample;this._videoStashedLastSample=null,o.unshift(p),d+=p.length}null!=h&&(this._videoStashedLastSample=h);var f=o[0].dts-this._dtsBase;if(this._videoNextDts)a=f-this._videoNextDts;else if(this._videoSegmentInfoList.isEmpty())a=0;else{var m=this._videoSegmentInfoList.getLastSampleBefore(f);if(null!=m){var g=f-(m.originalDts+m.duration);g<=3&&(g=0),a=f-(m.dts+m.duration+g)}else a=0}for(var v=new Ee.b,y=[],b=0;b=1?y[y.length-1].duration:Math.floor(this._videoMeta.refSampleDuration),S){var P=new Ee.d(w,C,O,p.dts,!0);P.fileposition=p.fileposition,v.appendSyncPoint(P)}y.push({dts:w,pts:C,cts:E,units:p.units,size:p.length,isKeyframe:S,duration:O,originalDts:_,flags:{isLeading:0,dependsOn:S?2:1,isDependedOn:S?1:0,hasRedundancy:0,isNonSync:S?0:1}})}for((u=new Uint8Array(d))[0]=d>>>24&255,u[1]=d>>>16&255,u[2]=d>>>8&255,u[3]=255&d,u.set(Se.types.mdat,4),b=0;b0)this._demuxer.bindDataSource(this._ioctl),this._demuxer.timestampBase=this._mediaDataSource.segments[this._currentSegmentIndex].timestampBase,n=this._demuxer.parseChunks(e,t);else{var i=null;(i=E.probe(e)).match&&(this._setupFLVDemuxerRemuxer(i),n=this._demuxer.parseChunks(e,t)),i.match||i.needMoreData||(i=be.probe(e)).match&&(this._setupTSDemuxerRemuxer(i),n=this._demuxer.parseChunks(e,t)),i.match||i.needMoreData||(i=null,o.a.e(this.TAG,"Non MPEG-TS/FLV, Unsupported media type!"),Promise.resolve().then((function(){r._internalAbort()})),this._emitter.emit(Pe.a.DEMUX_ERROR,g.a.FORMAT_UNSUPPORTED,"Non MPEG-TS/FLV, Unsupported media type!"))}return n},e.prototype._setupFLVDemuxerRemuxer=function(e){this._demuxer=new E(e,this._config),this._remuxer||(this._remuxer=new Ce(this._config));var t=this._mediaDataSource;null==t.duration||isNaN(t.duration)||(this._demuxer.overridedDuration=t.duration),"boolean"==typeof t.hasAudio&&(this._demuxer.overridedHasAudio=t.hasAudio),"boolean"==typeof t.hasVideo&&(this._demuxer.overridedHasVideo=t.hasVideo),this._demuxer.timestampBase=t.segments[this._currentSegmentIndex].timestampBase,this._demuxer.onError=this._onDemuxException.bind(this),this._demuxer.onMediaInfo=this._onMediaInfo.bind(this),this._demuxer.onMetaDataArrived=this._onMetaDataArrived.bind(this),this._demuxer.onScriptDataArrived=this._onScriptDataArrived.bind(this),this._remuxer.bindDataSource(this._demuxer.bindDataSource(this._ioctl)),this._remuxer.onInitSegment=this._onRemuxerInitSegmentArrival.bind(this),this._remuxer.onMediaSegment=this._onRemuxerMediaSegmentArrival.bind(this)},e.prototype._setupTSDemuxerRemuxer=function(e){var t=this._demuxer=new be(e,this._config);this._remuxer||(this._remuxer=new Ce(this._config)),t.onError=this._onDemuxException.bind(this),t.onMediaInfo=this._onMediaInfo.bind(this),t.onMetaDataArrived=this._onMetaDataArrived.bind(this),t.onTimedID3Metadata=this._onTimedID3Metadata.bind(this),t.onSMPTE2038Metadata=this._onSMPTE2038Metadata.bind(this),t.onSCTE35Metadata=this._onSCTE35Metadata.bind(this),t.onPESPrivateDataDescriptor=this._onPESPrivateDataDescriptor.bind(this),t.onPESPrivateData=this._onPESPrivateData.bind(this),this._remuxer.bindDataSource(this._demuxer),this._demuxer.bindDataSource(this._ioctl),this._remuxer.onInitSegment=this._onRemuxerInitSegmentArrival.bind(this),this._remuxer.onMediaSegment=this._onRemuxerMediaSegmentArrival.bind(this)},e.prototype._onMediaInfo=function(e){var t=this;null==this._mediaInfo&&(this._mediaInfo=Object.assign({},e),this._mediaInfo.keyframesIndex=null,this._mediaInfo.segments=[],this._mediaInfo.segmentCount=this._mediaDataSource.segments.length,Object.setPrototypeOf(this._mediaInfo,s.a.prototype));var r=Object.assign({},e);Object.setPrototypeOf(r,s.a.prototype),this._mediaInfo.segments[this._currentSegmentIndex]=r,this._reportSegmentMediaInfo(this._currentSegmentIndex),null!=this._pendingSeekTime&&Promise.resolve().then((function(){var e=t._pendingSeekTime;t._pendingSeekTime=null,t.seek(e)}))},e.prototype._onMetaDataArrived=function(e){this._emitter.emit(Pe.a.METADATA_ARRIVED,e)},e.prototype._onScriptDataArrived=function(e){this._emitter.emit(Pe.a.SCRIPTDATA_ARRIVED,e)},e.prototype._onTimedID3Metadata=function(e){var t=this._remuxer.getTimestampBase();null!=t&&(null!=e.pts&&(e.pts-=t),null!=e.dts&&(e.dts-=t),this._emitter.emit(Pe.a.TIMED_ID3_METADATA_ARRIVED,e))},e.prototype._onSMPTE2038Metadata=function(e){var t=this._remuxer.getTimestampBase();null!=t&&(null!=e.pts&&(e.pts-=t),null!=e.dts&&(e.dts-=t),null!=e.nearest_pts&&(e.nearest_pts-=t),this._emitter.emit(Pe.a.SMPTE2038_METADATA_ARRIVED,e))},e.prototype._onSCTE35Metadata=function(e){var t=this._remuxer.getTimestampBase();null!=t&&(null!=e.pts&&(e.pts-=t),null!=e.nearest_pts&&(e.nearest_pts-=t),this._emitter.emit(Pe.a.SCTE35_METADATA_ARRIVED,e))},e.prototype._onPESPrivateDataDescriptor=function(e){this._emitter.emit(Pe.a.PES_PRIVATE_DATA_DESCRIPTOR,e)},e.prototype._onPESPrivateData=function(e){var t=this._remuxer.getTimestampBase();null!=t&&(null!=e.pts&&(e.pts-=t),null!=e.nearest_pts&&(e.nearest_pts-=t),null!=e.dts&&(e.dts-=t),this._emitter.emit(Pe.a.PES_PRIVATE_DATA_ARRIVED,e))},e.prototype._onIOSeeked=function(){this._remuxer.insertDiscontinuity()},e.prototype._onIOComplete=function(e){var t=e+1;t0&&r[0].originalDts===n&&(n=r[0].pts),this._emitter.emit(Pe.a.RECOMMEND_SEEKPOINT,n)}},e.prototype._enableStatisticsReporter=function(){null==this._statisticsReporter&&(this._statisticsReporter=self.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval))},e.prototype._disableStatisticsReporter=function(){this._statisticsReporter&&(self.clearInterval(this._statisticsReporter),this._statisticsReporter=null)},e.prototype._reportSegmentMediaInfo=function(e){var t=this._mediaInfo.segments[e],r=Object.assign({},t);r.duration=this._mediaInfo.duration,r.segmentCount=this._mediaInfo.segmentCount,delete r.segments,delete r.keyframesIndex,this._emitter.emit(Pe.a.MEDIA_INFO,r)},e.prototype._reportStatisticsInfo=function(){var e={};e.url=this._ioctl.currentURL,e.hasRedirect=this._ioctl.hasRedirect,e.hasRedirect&&(e.redirectedURL=this._ioctl.currentRedirectedURL),e.speed=this._ioctl.currentSpeed,e.loaderType=this._ioctl.loaderType,e.currentSegmentIndex=this._currentSegmentIndex,e.totalSegmentCount=this._mediaDataSource.segments.length,this._emitter.emit(Pe.a.STATISTICS_INFO,e)},e}();t.a=Te},function(e,t,r){"use strict";var n,i=r(0),o=function(){function e(){this._firstCheckpoint=0,this._lastCheckpoint=0,this._intervalBytes=0,this._totalBytes=0,this._lastSecondBytes=0,self.performance&&self.performance.now?this._now=self.performance.now.bind(self.performance):this._now=Date.now}return e.prototype.reset=function(){this._firstCheckpoint=this._lastCheckpoint=0,this._totalBytes=this._intervalBytes=0,this._lastSecondBytes=0},e.prototype.addBytes=function(e){0===this._firstCheckpoint?(this._firstCheckpoint=this._now(),this._lastCheckpoint=this._firstCheckpoint,this._intervalBytes+=e,this._totalBytes+=e):this._now()-this._lastCheckpoint<1e3?(this._intervalBytes+=e,this._totalBytes+=e):(this._lastSecondBytes=this._intervalBytes,this._intervalBytes=e,this._totalBytes+=e,this._lastCheckpoint=this._now())},Object.defineProperty(e.prototype,"currentKBps",{get:function(){this.addBytes(0);var e=(this._now()-this._lastCheckpoint)/1e3;return 0==e&&(e=1),this._intervalBytes/e/1024},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastSecondKBps",{get:function(){return this.addBytes(0),0!==this._lastSecondBytes?this._lastSecondBytes/1024:this._now()-this._lastCheckpoint>=500?this.currentKBps:0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"averageKBps",{get:function(){var e=(this._now()-this._firstCheckpoint)/1e3;return this._totalBytes/e/1024},enumerable:!1,configurable:!0}),e}(),a=r(2),s=r(4),l=r(3),c=(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),u=function(e){function t(t,r){var n=e.call(this,"fetch-stream-loader")||this;return n.TAG="FetchStreamLoader",n._seekHandler=t,n._config=r,n._needStash=!0,n._requestAbort=!1,n._abortController=null,n._contentLength=null,n._receivedLength=0,n}return c(t,e),t.isSupported=function(){try{var e=s.a.msedge&&s.a.version.minor>=15048,t=!s.a.msedge||e;return self.fetch&&self.ReadableStream&&t}catch(e){return!1}},t.prototype.destroy=function(){this.isWorking()&&this.abort(),e.prototype.destroy.call(this)},t.prototype.open=function(e,t){var r=this;this._dataSource=e,this._range=t;var n=e.url;this._config.reuseRedirectedURL&&null!=e.redirectedURL&&(n=e.redirectedURL);var i=this._seekHandler.getConfig(n,t),o=new self.Headers;if("object"==typeof i.headers){var s=i.headers;for(var c in s)s.hasOwnProperty(c)&&o.append(c,s[c])}var u={method:"GET",headers:o,mode:"cors",cache:"default",referrerPolicy:"no-referrer-when-downgrade"};if("object"==typeof this._config.headers)for(var c in this._config.headers)o.append(c,this._config.headers[c]);!1===e.cors&&(u.mode="same-origin"),e.withCredentials&&(u.credentials="include"),e.referrerPolicy&&(u.referrerPolicy=e.referrerPolicy),self.AbortController&&(this._abortController=new self.AbortController,u.signal=this._abortController.signal),this._status=a.c.kConnecting,self.fetch(i.url,u).then((function(e){if(r._requestAbort)return r._status=a.c.kIdle,void e.body.cancel();if(e.ok&&e.status>=200&&e.status<=299){if(e.url!==i.url&&r._onURLRedirect){var t=r._seekHandler.removeURLParameters(e.url);r._onURLRedirect(t)}var n=e.headers.get("Content-Length");return null!=n&&(r._contentLength=parseInt(n),0!==r._contentLength&&r._onContentLengthKnown&&r._onContentLengthKnown(r._contentLength)),r._pump.call(r,e.body.getReader())}if(r._status=a.c.kError,!r._onError)throw new l.d("FetchStreamLoader: Http code invalid, "+e.status+" "+e.statusText);r._onError(a.b.HTTP_STATUS_CODE_INVALID,{code:e.status,msg:e.statusText})})).catch((function(e){if(!r._abortController||!r._abortController.signal.aborted){if(r._status=a.c.kError,!r._onError)throw e;r._onError(a.b.EXCEPTION,{code:-1,msg:e.message})}}))},t.prototype.abort=function(){if(this._requestAbort=!0,(this._status!==a.c.kBuffering||!s.a.chrome)&&this._abortController)try{this._abortController.abort()}catch(e){}},t.prototype._pump=function(e){var t=this;return e.read().then((function(r){if(r.done)if(null!==t._contentLength&&t._receivedLength299)){if(this._status=a.c.kError,!this._onError)throw new l.d("MozChunkedLoader: Http code invalid, "+t.status+" "+t.statusText);this._onError(a.b.HTTP_STATUS_CODE_INVALID,{code:t.status,msg:t.statusText})}else this._status=a.c.kBuffering}},t.prototype._onProgress=function(e){if(this._status!==a.c.kError){null===this._contentLength&&null!==e.total&&0!==e.total&&(this._contentLength=e.total,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength));var t=e.target.response,r=this._range.from+this._receivedLength;this._receivedLength+=t.byteLength,this._onDataArrival&&this._onDataArrival(t,r,this._receivedLength)}},t.prototype._onLoadEnd=function(e){!0!==this._requestAbort?this._status!==a.c.kError&&(this._status=a.c.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1)):this._requestAbort=!1},t.prototype._onXhrError=function(e){this._status=a.c.kError;var t=0,r=null;if(this._contentLength&&e.loaded=this._contentLength&&(r=this._range.from+this._contentLength-1),this._currentRequestRange={from:t,to:r},this._internalOpen(this._dataSource,this._currentRequestRange)},t.prototype._internalOpen=function(e,t){this._lastTimeLoaded=0;var r=e.url;this._config.reuseRedirectedURL&&(null!=this._currentRedirectedURL?r=this._currentRedirectedURL:null!=e.redirectedURL&&(r=e.redirectedURL));var n=this._seekHandler.getConfig(r,t);this._currentRequestURL=n.url;var i=this._xhr=new XMLHttpRequest;if(i.open("GET",n.url,!0),i.responseType="arraybuffer",i.onreadystatechange=this._onReadyStateChange.bind(this),i.onprogress=this._onProgress.bind(this),i.onload=this._onLoad.bind(this),i.onerror=this._onXhrError.bind(this),e.withCredentials&&(i.withCredentials=!0),"object"==typeof n.headers){var o=n.headers;for(var a in o)o.hasOwnProperty(a)&&i.setRequestHeader(a,o[a])}if("object"==typeof this._config.headers)for(var a in o=this._config.headers)o.hasOwnProperty(a)&&i.setRequestHeader(a,o[a]);i.send()},t.prototype.abort=function(){this._requestAbort=!0,this._internalAbort(),this._status=a.c.kComplete},t.prototype._internalAbort=function(){this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr.abort(),this._xhr=null)},t.prototype._onReadyStateChange=function(e){var t=e.target;if(2===t.readyState){if(null!=t.responseURL){var r=this._seekHandler.removeURLParameters(t.responseURL);t.responseURL!==this._currentRequestURL&&r!==this._currentRedirectedURL&&(this._currentRedirectedURL=r,this._onURLRedirect&&this._onURLRedirect(r))}if(t.status>=200&&t.status<=299){if(this._waitForTotalLength)return;this._status=a.c.kBuffering}else{if(this._status=a.c.kError,!this._onError)throw new l.d("RangeLoader: Http code invalid, "+t.status+" "+t.statusText);this._onError(a.b.HTTP_STATUS_CODE_INVALID,{code:t.status,msg:t.statusText})}}},t.prototype._onProgress=function(e){if(this._status!==a.c.kError){if(null===this._contentLength){var t=!1;if(this._waitForTotalLength){this._waitForTotalLength=!1,this._totalLengthReceived=!0,t=!0;var r=e.total;this._internalAbort(),null!=r&0!==r&&(this._totalLength=r)}if(-1===this._range.to?this._contentLength=this._totalLength-this._range.from:this._contentLength=this._range.to-this._range.from+1,t)return void this._openSubRange();this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)}var n=e.loaded-this._lastTimeLoaded;this._lastTimeLoaded=e.loaded,this._speedSampler.addBytes(n)}},t.prototype._normalizeSpeed=function(e){var t=this._chunkSizeKBList,r=t.length-1,n=0,i=0,o=r;if(e=t[n]&&e=3&&(t=this._speedSampler.currentKBps)),0!==t){var r=this._normalizeSpeed(t);this._currentSpeedNormalized!==r&&(this._currentSpeedNormalized=r,this._currentChunkSizeKB=r)}var n=e.target.response,i=this._range.from+this._receivedLength;this._receivedLength+=n.byteLength;var o=!1;null!=this._contentLength&&this._receivedLength0&&this._receivedLength0)for(var o=r.split("&"),a=0;a0;s[0]!==this._startName&&s[0]!==this._endName&&(l&&(i+="&"),i+=o[a])}return 0===i.length?t:t+"?"+i},e}(),b=function(){function e(e,t,r){this.TAG="IOController",this._config=t,this._extraData=r,this._stashInitialSize=65536,null!=t.stashInitialSize&&t.stashInitialSize>0&&(this._stashInitialSize=t.stashInitialSize),this._stashUsed=0,this._stashSize=this._stashInitialSize,this._bufferSize=3145728,this._stashBuffer=new ArrayBuffer(this._bufferSize),this._stashByteStart=0,this._enableStash=!0,!1===t.enableStashBuffer&&(this._enableStash=!1),this._loader=null,this._loaderClass=null,this._seekHandler=null,this._dataSource=e,this._isWebSocketURL=/wss?:\/\/(.+?)/.test(e.url),this._refTotalLength=e.filesize?e.filesize:null,this._totalLength=this._refTotalLength,this._fullRequestFlag=!1,this._currentRange=null,this._redirectedURL=null,this._speedNormalized=0,this._speedSampler=new o,this._speedNormalizeList=[32,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096],this._isEarlyEofReconnecting=!1,this._paused=!1,this._resumeFrom=0,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._selectSeekHandler(),this._selectLoader(),this._createLoader()}return e.prototype.destroy=function(){this._loader.isWorking()&&this._loader.abort(),this._loader.destroy(),this._loader=null,this._loaderClass=null,this._dataSource=null,this._stashBuffer=null,this._stashUsed=this._stashSize=this._bufferSize=this._stashByteStart=0,this._currentRange=null,this._speedSampler=null,this._isEarlyEofReconnecting=!1,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._extraData=null},e.prototype.isWorking=function(){return this._loader&&this._loader.isWorking()&&!this._paused},e.prototype.isPaused=function(){return this._paused},Object.defineProperty(e.prototype,"status",{get:function(){return this._loader.status},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"extraData",{get:function(){return this._extraData},set:function(e){this._extraData=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onDataArrival",{get:function(){return this._onDataArrival},set:function(e){this._onDataArrival=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onSeeked",{get:function(){return this._onSeeked},set:function(e){this._onSeeked=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onError",{get:function(){return this._onError},set:function(e){this._onError=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onComplete",{get:function(){return this._onComplete},set:function(e){this._onComplete=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onRedirect",{get:function(){return this._onRedirect},set:function(e){this._onRedirect=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onRecoveredEarlyEof",{get:function(){return this._onRecoveredEarlyEof},set:function(e){this._onRecoveredEarlyEof=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentURL",{get:function(){return this._dataSource.url},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasRedirect",{get:function(){return null!=this._redirectedURL||null!=this._dataSource.redirectedURL},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentRedirectedURL",{get:function(){return this._redirectedURL||this._dataSource.redirectedURL},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentSpeed",{get:function(){return this._loaderClass===f?this._loader.currentSpeed:this._speedSampler.lastSecondKBps},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"loaderType",{get:function(){return this._loader.type},enumerable:!1,configurable:!0}),e.prototype._selectSeekHandler=function(){var e=this._config;if("range"===e.seekType)this._seekHandler=new v(this._config.rangeLoadZeroStart);else if("param"===e.seekType){var t=e.seekParamStart||"bstart",r=e.seekParamEnd||"bend";this._seekHandler=new y(t,r)}else{if("custom"!==e.seekType)throw new l.b("Invalid seekType in config: "+e.seekType);if("function"!=typeof e.customSeekHandler)throw new l.b("Custom seekType specified in config but invalid customSeekHandler!");this._seekHandler=new e.customSeekHandler}},e.prototype._selectLoader=function(){if(null!=this._config.customLoader)this._loaderClass=this._config.customLoader;else if(this._isWebSocketURL)this._loaderClass=g;else if(u.isSupported())this._loaderClass=u;else if(h.isSupported())this._loaderClass=h;else{if(!f.isSupported())throw new l.d("Your browser doesn't support xhr with arraybuffer responseType!");this._loaderClass=f}},e.prototype._createLoader=function(){this._loader=new this._loaderClass(this._seekHandler,this._config),!1===this._loader.needStashBuffer&&(this._enableStash=!1),this._loader.onContentLengthKnown=this._onContentLengthKnown.bind(this),this._loader.onURLRedirect=this._onURLRedirect.bind(this),this._loader.onDataArrival=this._onLoaderChunkArrival.bind(this),this._loader.onComplete=this._onLoaderComplete.bind(this),this._loader.onError=this._onLoaderError.bind(this)},e.prototype.open=function(e){this._currentRange={from:0,to:-1},e&&(this._currentRange.from=e),this._speedSampler.reset(),e||(this._fullRequestFlag=!0),this._loader.open(this._dataSource,Object.assign({},this._currentRange))},e.prototype.abort=function(){this._loader.abort(),this._paused&&(this._paused=!1,this._resumeFrom=0)},e.prototype.pause=function(){this.isWorking()&&(this._loader.abort(),0!==this._stashUsed?(this._resumeFrom=this._stashByteStart,this._currentRange.to=this._stashByteStart-1):this._resumeFrom=this._currentRange.to+1,this._stashUsed=0,this._stashByteStart=0,this._paused=!0)},e.prototype.resume=function(){if(this._paused){this._paused=!1;var e=this._resumeFrom;this._resumeFrom=0,this._internalSeek(e,!0)}},e.prototype.seek=function(e){this._paused=!1,this._stashUsed=0,this._stashByteStart=0,this._internalSeek(e,!0)},e.prototype._internalSeek=function(e,t){this._loader.isWorking()&&this._loader.abort(),this._flushStashBuffer(t),this._loader.destroy(),this._loader=null;var r={from:e,to:-1};this._currentRange={from:r.from,to:-1},this._speedSampler.reset(),this._stashSize=this._stashInitialSize,this._createLoader(),this._loader.open(this._dataSource,r),this._onSeeked&&this._onSeeked()},e.prototype.updateUrl=function(e){if(!e||"string"!=typeof e||0===e.length)throw new l.b("Url must be a non-empty string!");this._dataSource.url=e},e.prototype._expandBuffer=function(e){for(var t=this._stashSize;t+10485760){var n=new Uint8Array(this._stashBuffer,0,this._stashUsed);new Uint8Array(r,0,t).set(n,0)}this._stashBuffer=r,this._bufferSize=t}},e.prototype._normalizeSpeed=function(e){var t=this._speedNormalizeList,r=t.length-1,n=0,i=0,o=r;if(e=t[n]&&e=512&&e<=1024?Math.floor(1.5*e):2*e)>8192&&(t=8192);var r=1024*t+1048576;this._bufferSize0){var o=this._stashBuffer.slice(0,this._stashUsed);(c=this._dispatchChunks(o,this._stashByteStart))0&&(u=new Uint8Array(o,c),s.set(u,0),this._stashUsed=u.byteLength,this._stashByteStart+=c):(this._stashUsed=0,this._stashByteStart+=c),this._stashUsed+e.byteLength>this._bufferSize&&(this._expandBuffer(this._stashUsed+e.byteLength),s=new Uint8Array(this._stashBuffer,0,this._bufferSize)),s.set(new Uint8Array(e),this._stashUsed),this._stashUsed+=e.byteLength}else(c=this._dispatchChunks(e,t))this._bufferSize&&(this._expandBuffer(a),s=new Uint8Array(this._stashBuffer,0,this._bufferSize)),s.set(new Uint8Array(e,c),0),this._stashUsed+=a,this._stashByteStart=t+c);else if(0===this._stashUsed){var a;(c=this._dispatchChunks(e,t))this._bufferSize&&this._expandBuffer(a),(s=new Uint8Array(this._stashBuffer,0,this._bufferSize)).set(new Uint8Array(e,c),0),this._stashUsed+=a,this._stashByteStart=t+c)}else{var s,c;if(this._stashUsed+e.byteLength>this._bufferSize&&this._expandBuffer(this._stashUsed+e.byteLength),(s=new Uint8Array(this._stashBuffer,0,this._bufferSize)).set(new Uint8Array(e),this._stashUsed),this._stashUsed+=e.byteLength,(c=this._dispatchChunks(this._stashBuffer.slice(0,this._stashUsed),this._stashByteStart))0){var u=new Uint8Array(this._stashBuffer,c);s.set(u,0)}this._stashUsed-=c,this._stashByteStart+=c}}},e.prototype._flushStashBuffer=function(e){if(this._stashUsed>0){var t=this._stashBuffer.slice(0,this._stashUsed),r=this._dispatchChunks(t,this._stashByteStart),n=t.byteLength-r;if(r0){var o=new Uint8Array(this._stashBuffer,0,this._bufferSize),a=new Uint8Array(t,r);o.set(a,0),this._stashUsed=a.byteLength,this._stashByteStart+=r}return 0}i.a.w(this.TAG,n+" bytes unconsumed data remain when flush buffer, dropped")}return this._stashUsed=0,this._stashByteStart=0,n}return 0},e.prototype._onLoaderComplete=function(e,t){this._flushStashBuffer(!0),this._onComplete&&this._onComplete(this._extraData)},e.prototype._onLoaderError=function(e,t){switch(i.a.e(this.TAG,"Loader error, code = "+t.code+", msg = "+t.msg),this._flushStashBuffer(!1),this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,e=a.b.UNRECOVERABLE_EARLY_EOF),e){case a.b.EARLY_EOF:if(!this._config.isLive&&this._totalLength){var r=this._currentRange.to+1;return void(r0}),!1)}e.exports=function(e,t){t=t||{};var i={main:r.m},s=t.all?{main:Object.keys(i.main)}:function(e,t){for(var r={main:[t]},n={main:[]},i={main:{}};a(r);)for(var s=Object.keys(r),l=0;l1)for(var r=1;r0&&(n+=";codecs="+r.codec);var i=!1;if(d.a.v(this.TAG,"Received Initialization Segment, mimeType: "+n),this._lastInitSegments[r.type]=r,n!==this._mimeTypes[r.type]){if(this._mimeTypes[r.type])d.a.v(this.TAG,"Notice: "+r.type+" mimeType changed, origin: "+this._mimeTypes[r.type]+", target: "+n);else{i=!0;try{var o=this._sourceBuffers[r.type]=this._mediaSource.addSourceBuffer(n);o.addEventListener("error",this.e.onSourceBufferError),o.addEventListener("updateend",this.e.onSourceBufferUpdateEnd)}catch(e){return d.a.e(this.TAG,e.message),void this._emitter.emit(S,{code:e.code,msg:e.message})}}this._mimeTypes[r.type]=n}t||this._pendingSegments[r.type].push(r),i||this._sourceBuffers[r.type]&&!this._sourceBuffers[r.type].updating&&this._doAppendSegments(),h.a.safari&&"audio/mpeg"===r.container&&r.mediaDuration>0&&(this._requireSetMediaDuration=!0,this._pendingMediaDuration=r.mediaDuration/1e3,this._updateMediaSourceDuration())},e.prototype.appendMediaSegment=function(e){var t=e;this._pendingSegments[t.type].push(t),this._config.autoCleanupSourceBuffer&&this._needCleanupSourceBuffer()&&this._doCleanupSourceBuffer();var r=this._sourceBuffers[t.type];!r||r.updating||this._hasPendingRemoveRanges()||this._doAppendSegments()},e.prototype.seek=function(e){for(var t in this._sourceBuffers)if(this._sourceBuffers[t]){var r=this._sourceBuffers[t];if("open"===this._mediaSource.readyState)try{r.abort()}catch(e){d.a.e(this.TAG,e.message)}this._idrList.clear();var n=this._pendingSegments[t];if(n.splice(0,n.length),"closed"!==this._mediaSource.readyState){for(var i=0;i=1&&e-n.start(0)>=this._config.autoCleanupMaxBackwardDuration)return!0}}return!1},e.prototype._doCleanupSourceBuffer=function(){var e=this._mediaElement.currentTime;for(var t in this._sourceBuffers){var r=this._sourceBuffers[t];if(r){for(var n=r.buffered,i=!1,o=0;o=this._config.autoCleanupMaxBackwardDuration){i=!0;var l=e-this._config.autoCleanupMinBackwardDuration;this._pendingRemoveRanges[t].push({start:a,end:l})}}else s0&&(isNaN(t)||r>t)&&(d.a.v(this.TAG,"Update MediaSource duration from "+t+" to "+r),this._mediaSource.duration=r),this._requireSetMediaDuration=!1,this._pendingMediaDuration=0}},e.prototype._doRemoveRanges=function(){for(var e in this._pendingRemoveRanges)if(this._sourceBuffers[e]&&!this._sourceBuffers[e].updating)for(var t=this._sourceBuffers[e],r=this._pendingRemoveRanges[e];r.length&&!t.updating;){var n=r.shift();t.remove(n.start,n.end)}},e.prototype._doAppendSegments=function(){var e=this._pendingSegments;for(var t in e)if(this._sourceBuffers[t]&&!this._sourceBuffers[t].updating&&e[t].length>0){var r=e[t].shift();if(r.timestampOffset){var n=this._sourceBuffers[t].timestampOffset,i=r.timestampOffset/1e3;Math.abs(n-i)>.1&&(d.a.v(this.TAG,"Update MPEG audio timestampOffset from "+n+" to "+i),this._sourceBuffers[t].timestampOffset=i),delete r.timestampOffset}if(!r.data||0===r.data.byteLength)continue;try{this._sourceBuffers[t].appendBuffer(r.data),this._isBufferFull=!1,"video"===t&&r.hasOwnProperty("info")&&this._idrList.appendArray(r.info.syncPoints)}catch(e){this._pendingSegments[t].unshift(r),22===e.code?(this._isBufferFull||this._emitter.emit(C),this._isBufferFull=!0):(d.a.e(this.TAG,e.message),this._emitter.emit(S,{code:e.code,msg:e.message}))}}},e.prototype._onSourceOpen=function(){if(d.a.v(this.TAG,"MediaSource onSourceOpen"),this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._pendingSourceBufferInit.length>0)for(var e=this._pendingSourceBufferInit;e.length;){var t=e.shift();this.appendInitSegment(t,!0)}this._hasPendingSegments()&&this._doAppendSegments(),this._emitter.emit(w)},e.prototype._onSourceEnded=function(){d.a.v(this.TAG,"MediaSource onSourceEnded")},e.prototype._onSourceClose=function(){d.a.v(this.TAG,"MediaSource onSourceClose"),this._mediaSource&&null!=this.e&&(this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._mediaSource.removeEventListener("sourceended",this.e.onSourceEnded),this._mediaSource.removeEventListener("sourceclose",this.e.onSourceClose))},e.prototype._hasPendingSegments=function(){var e=this._pendingSegments;return e.video.length>0||e.audio.length>0},e.prototype._hasPendingRemoveRanges=function(){var e=this._pendingRemoveRanges;return e.video.length>0||e.audio.length>0},e.prototype._onSourceBufferUpdateEnd=function(){this._requireSetMediaDuration?this._updateMediaSourceDuration():this._hasPendingRemoveRanges()?this._doRemoveRanges():this._hasPendingSegments()?this._doAppendSegments():this._hasPendingEos&&this.endOfStream(),this._emitter.emit(E)},e.prototype._onSourceBufferError=function(e){d.a.e(this.TAG,"SourceBuffer Error: "+e)},e}(),k=r(5),R={NETWORK_ERROR:"NetworkError",MEDIA_ERROR:"MediaError",OTHER_ERROR:"OtherError"},A={NETWORK_EXCEPTION:l.b.EXCEPTION,NETWORK_STATUS_CODE_INVALID:l.b.HTTP_STATUS_CODE_INVALID,NETWORK_TIMEOUT:l.b.CONNECTING_TIMEOUT,NETWORK_UNRECOVERABLE_EARLY_EOF:l.b.UNRECOVERABLE_EARLY_EOF,MEDIA_MSE_ERROR:"MediaMSEError",MEDIA_FORMAT_ERROR:k.a.FORMAT_ERROR,MEDIA_FORMAT_UNSUPPORTED:k.a.FORMAT_UNSUPPORTED,MEDIA_CODEC_UNSUPPORTED:k.a.CODEC_UNSUPPORTED},D=function(){function e(e,t){this.TAG="MSEPlayer",this._type="MSEPlayer",this._emitter=new u.a,this._config=a(),"object"==typeof t&&Object.assign(this._config,t);var r=e.type.toLowerCase();if("mse"!==r&&"mpegts"!==r&&"m2ts"!==r&&"flv"!==r)throw new P.b("MSEPlayer requires an mpegts/m2ts/flv MediaDataSource input!");!0===e.isLive&&(this._config.isLive=!0),this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this),onvSeeking:this._onvSeeking.bind(this),onvCanPlay:this._onvCanPlay.bind(this),onvStalled:this._onvStalled.bind(this),onvProgress:this._onvProgress.bind(this)},self.performance&&self.performance.now?this._now=self.performance.now.bind(self.performance):this._now=Date.now,this._pendingSeekTime=null,this._requestSetTime=!1,this._seekpointRecord=null,this._progressChecker=null,this._mediaDataSource=e,this._mediaElement=null,this._msectl=null,this._transmuxer=null,this._mseSourceOpened=!1,this._hasPendingLoad=!1,this._receivedCanPlay=!1,this._mediaInfo=null,this._statisticsInfo=null;var n=h.a.chrome&&(h.a.version.major<50||50===h.a.version.major&&h.a.version.build<2661);this._alwaysSeekKeyframe=!!(n||h.a.msedge||h.a.msie),this._alwaysSeekKeyframe&&(this._config.accurateSeek=!1)}return e.prototype.destroy=function(){null!=this._progressChecker&&(window.clearInterval(this._progressChecker),this._progressChecker=null),this._transmuxer&&this.unload(),this._mediaElement&&this.detachMediaElement(),this.e=null,this._mediaDataSource=null,this._emitter.removeAllListeners(),this._emitter=null},e.prototype.on=function(e,t){var r=this;e===p.MEDIA_INFO?null!=this._mediaInfo&&Promise.resolve().then((function(){r._emitter.emit(p.MEDIA_INFO,r.mediaInfo)})):e===p.STATISTICS_INFO&&null!=this._statisticsInfo&&Promise.resolve().then((function(){r._emitter.emit(p.STATISTICS_INFO,r.statisticsInfo)})),this._emitter.addListener(e,t)},e.prototype.off=function(e,t){this._emitter.removeListener(e,t)},e.prototype.attachMediaElement=function(e){var t=this;if(this._mediaElement=e,e.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),e.addEventListener("seeking",this.e.onvSeeking),e.addEventListener("canplay",this.e.onvCanPlay),e.addEventListener("stalled",this.e.onvStalled),e.addEventListener("progress",this.e.onvProgress),this._msectl=new T(this._config),this._msectl.on(E,this._onmseUpdateEnd.bind(this)),this._msectl.on(C,this._onmseBufferFull.bind(this)),this._msectl.on(w,(function(){t._mseSourceOpened=!0,t._hasPendingLoad&&(t._hasPendingLoad=!1,t.load())})),this._msectl.on(S,(function(e){t._emitter.emit(p.ERROR,R.MEDIA_ERROR,A.MEDIA_MSE_ERROR,e)})),this._msectl.attachMediaElement(e),null!=this._pendingSeekTime)try{e.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(e){}},e.prototype.detachMediaElement=function(){this._mediaElement&&(this._msectl.detachMediaElement(),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement.removeEventListener("seeking",this.e.onvSeeking),this._mediaElement.removeEventListener("canplay",this.e.onvCanPlay),this._mediaElement.removeEventListener("stalled",this.e.onvStalled),this._mediaElement.removeEventListener("progress",this.e.onvProgress),this._mediaElement=null),this._msectl&&(this._msectl.destroy(),this._msectl=null)},e.prototype.load=function(){var e=this;if(!this._mediaElement)throw new P.a("HTMLMediaElement must be attached before load()!");if(this._transmuxer)throw new P.a("MSEPlayer.load() has been called, please call unload() first!");this._hasPendingLoad||(this._config.deferLoadAfterSourceOpen&&!1===this._mseSourceOpened?this._hasPendingLoad=!0:(this._mediaElement.readyState>0&&(this._requestSetTime=!0,this._mediaElement.currentTime=0),this._transmuxer=new _(this._mediaDataSource,this._config),this._transmuxer.on(y.a.INIT_SEGMENT,(function(t,r){e._msectl.appendInitSegment(r)})),this._transmuxer.on(y.a.MEDIA_SEGMENT,(function(t,r){if(e._msectl.appendMediaSegment(r),e._config.lazyLoad&&!e._config.isLive){var n=e._mediaElement.currentTime;r.info.endDts>=1e3*(n+e._config.lazyLoadMaxDuration)&&null==e._progressChecker&&(d.a.v(e.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),e._suspendTransmuxer())}})),this._transmuxer.on(y.a.LOADING_COMPLETE,(function(){e._msectl.endOfStream(),e._emitter.emit(p.LOADING_COMPLETE)})),this._transmuxer.on(y.a.RECOVERED_EARLY_EOF,(function(){e._emitter.emit(p.RECOVERED_EARLY_EOF)})),this._transmuxer.on(y.a.IO_ERROR,(function(t,r){e._emitter.emit(p.ERROR,R.NETWORK_ERROR,t,r)})),this._transmuxer.on(y.a.DEMUX_ERROR,(function(t,r){e._emitter.emit(p.ERROR,R.MEDIA_ERROR,t,{code:-1,msg:r})})),this._transmuxer.on(y.a.MEDIA_INFO,(function(t){e._mediaInfo=t,e._emitter.emit(p.MEDIA_INFO,Object.assign({},t))})),this._transmuxer.on(y.a.METADATA_ARRIVED,(function(t){e._emitter.emit(p.METADATA_ARRIVED,t)})),this._transmuxer.on(y.a.SCRIPTDATA_ARRIVED,(function(t){e._emitter.emit(p.SCRIPTDATA_ARRIVED,t)})),this._transmuxer.on(y.a.TIMED_ID3_METADATA_ARRIVED,(function(t){e._emitter.emit(p.TIMED_ID3_METADATA_ARRIVED,t)})),this._transmuxer.on(y.a.SMPTE2038_METADATA_ARRIVED,(function(t){e._emitter.emit(p.SMPTE2038_METADATA_ARRIVED,t)})),this._transmuxer.on(y.a.SCTE35_METADATA_ARRIVED,(function(t){e._emitter.emit(p.SCTE35_METADATA_ARRIVED,t)})),this._transmuxer.on(y.a.PES_PRIVATE_DATA_DESCRIPTOR,(function(t){e._emitter.emit(p.PES_PRIVATE_DATA_DESCRIPTOR,t)})),this._transmuxer.on(y.a.PES_PRIVATE_DATA_ARRIVED,(function(t){e._emitter.emit(p.PES_PRIVATE_DATA_ARRIVED,t)})),this._transmuxer.on(y.a.STATISTICS_INFO,(function(t){e._statisticsInfo=e._fillStatisticsInfo(t),e._emitter.emit(p.STATISTICS_INFO,Object.assign({},e._statisticsInfo))})),this._transmuxer.on(y.a.RECOMMEND_SEEKPOINT,(function(t){e._mediaElement&&!e._config.accurateSeek&&(e._requestSetTime=!0,e._mediaElement.currentTime=t/1e3)})),this._transmuxer.open()))},e.prototype.unload=function(){this._mediaElement&&this._mediaElement.pause(),this._msectl&&this._msectl.seek(0),this._transmuxer&&(this._transmuxer.close(),this._transmuxer.destroy(),this._transmuxer=null)},e.prototype.play=function(){return this._mediaElement.play()},e.prototype.pause=function(){this._mediaElement.pause()},Object.defineProperty(e.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"buffered",{get:function(){return this._mediaElement.buffered},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"duration",{get:function(){return this._mediaElement.duration},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"volume",{get:function(){return this._mediaElement.volume},set:function(e){this._mediaElement.volume=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"muted",{get:function(){return this._mediaElement.muted},set:function(e){this._mediaElement.muted=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentTime",{get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(e){this._mediaElement?this._internalSeek(e):this._pendingSeekTime=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mediaInfo",{get:function(){return Object.assign({},this._mediaInfo)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"statisticsInfo",{get:function(){return null==this._statisticsInfo&&(this._statisticsInfo={}),this._statisticsInfo=this._fillStatisticsInfo(this._statisticsInfo),Object.assign({},this._statisticsInfo)},enumerable:!1,configurable:!0}),e.prototype._fillStatisticsInfo=function(e){if(e.playerType=this._type,!(this._mediaElement instanceof HTMLVideoElement))return e;var t=!0,r=0,n=0;if(this._mediaElement.getVideoPlaybackQuality){var i=this._mediaElement.getVideoPlaybackQuality();r=i.totalVideoFrames,n=i.droppedVideoFrames}else null!=this._mediaElement.webkitDecodedFrameCount?(r=this._mediaElement.webkitDecodedFrameCount,n=this._mediaElement.webkitDroppedFrameCount):t=!1;return t&&(e.decodedFrames=r,e.droppedFrames=n),e},e.prototype._onmseUpdateEnd=function(){var e=this._mediaElement.buffered,t=this._mediaElement.currentTime;if(this._config.isLive&&this._config.liveBufferLatencyChasing&&e.length>0&&!this._mediaElement.paused){var r=e.end(e.length-1);if(r>this._config.liveBufferLatencyMaxLatency&&r-t>this._config.liveBufferLatencyMaxLatency){var n=r-this._config.liveBufferLatencyMinRemain;this.currentTime=n}}if(this._config.lazyLoad&&!this._config.isLive){for(var i=0,o=0;o=t+this._config.lazyLoadMaxDuration&&null==this._progressChecker&&(d.a.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}},e.prototype._onmseBufferFull=function(){d.a.v(this.TAG,"MSE SourceBuffer is full, suspend transmuxing task"),null==this._progressChecker&&this._suspendTransmuxer()},e.prototype._suspendTransmuxer=function(){this._transmuxer&&(this._transmuxer.pause(),null==this._progressChecker&&(this._progressChecker=window.setInterval(this._checkProgressAndResume.bind(this),1e3)))},e.prototype._checkProgressAndResume=function(){for(var e=this._mediaElement.currentTime,t=this._mediaElement.buffered,r=!1,n=0;n=i&&e=o-this._config.lazyLoadRecoverDuration&&(r=!0);break}}r&&(window.clearInterval(this._progressChecker),this._progressChecker=null,r&&(d.a.v(this.TAG,"Continue loading from paused position"),this._transmuxer.resume()))},e.prototype._isTimepointBuffered=function(e){for(var t=this._mediaElement.buffered,r=0;r=n&&e0){var i=this._mediaElement.buffered.start(0);(i<1&&e0&&t.currentTime0){var n=r.start(0);if(n<1&&t0&&(this._mediaElement.currentTime=0),this._mediaElement.preload="auto",this._mediaElement.load(),this._statisticsReporter=window.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval)},e.prototype.unload=function(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src")),null!=this._statisticsReporter&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)},e.prototype.play=function(){return this._mediaElement.play()},e.prototype.pause=function(){this._mediaElement.pause()},Object.defineProperty(e.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"buffered",{get:function(){return this._mediaElement.buffered},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"duration",{get:function(){return this._mediaElement.duration},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"volume",{get:function(){return this._mediaElement.volume},set:function(e){this._mediaElement.volume=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"muted",{get:function(){return this._mediaElement.muted},set:function(e){this._mediaElement.muted=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentTime",{get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(e){this._mediaElement?this._mediaElement.currentTime=e:this._pendingSeekTime=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mediaInfo",{get:function(){var e={mimeType:(this._mediaElement instanceof HTMLAudioElement?"audio/":"video/")+this._mediaDataSource.type};return this._mediaElement&&(e.duration=Math.floor(1e3*this._mediaElement.duration),this._mediaElement instanceof HTMLVideoElement&&(e.width=this._mediaElement.videoWidth,e.height=this._mediaElement.videoHeight)),e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"statisticsInfo",{get:function(){var e={playerType:this._type,url:this._mediaDataSource.url};if(!(this._mediaElement instanceof HTMLVideoElement))return e;var t=!0,r=0,n=0;if(this._mediaElement.getVideoPlaybackQuality){var i=this._mediaElement.getVideoPlaybackQuality();r=i.totalVideoFrames,n=i.droppedVideoFrames}else null!=this._mediaElement.webkitDecodedFrameCount?(r=this._mediaElement.webkitDecodedFrameCount,n=this._mediaElement.webkitDroppedFrameCount):t=!1;return t&&(e.decodedFrames=r,e.droppedFrames=n),e},enumerable:!1,configurable:!0}),e.prototype._onvLoadedMetadata=function(e){null!=this._pendingSeekTime&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null),this._emitter.emit(p.MEDIA_INFO,this.mediaInfo)},e.prototype._reportStatisticsInfo=function(){this._emitter.emit(p.STATISTICS_INFO,this.statisticsInfo)},e}();n.a.install();var x={createPlayer:function(e,t){var r=e;if(null==r||"object"!=typeof r)throw new P.b("MediaDataSource must be an javascript object!");if(!r.hasOwnProperty("type"))throw new P.b("MediaDataSource must has type field to indicate video file type!");switch(r.type){case"mse":case"mpegts":case"m2ts":case"flv":return new D(r,t);default:return new I(r,t)}},isSupported:function(){return s.supportMSEH264Playback()},getFeatureList:function(){return s.getFeatureList()}};x.BaseLoader=l.a,x.LoaderStatus=l.c,x.LoaderErrors=l.b,x.Events=p,x.ErrorTypes=R,x.ErrorDetails=A,x.MSEPlayer=D,x.NativePlayer=I,x.LoggingControl=g.a,Object.defineProperty(x,"version",{enumerable:!0,get:function(){return"1.7.3"}}),t.default=x}])},35302:(e,t,r)=>{var n=r(47291);e.exports=function e(t,r,i){return n(r)||(i=r||i,r=[]),i=i||{},t instanceof RegExp?function(e,t){var r=e.source.match(/\((?!\?)/g);if(r)for(var n=0;n-1?"[^"+c(e)+"]+?":c(t)+"|(?:(?!"+c(t)+")[^"+c(e)+"])+?"}function s(e){return encodeURI(e).replace(/[\/?#]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()}))}function l(e,t){for(var r=new Array(e.length),i=0;i{e.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}},65606:e=>{var t,r,n=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(e){r=o}}();var s,l=[],c=!1,u=-1;function d(){c&&s&&(c=!1,s.length?l=s.concat(l):u=-1,l.length&&h())}function h(){if(!c){var e=a(d);c=!0;for(var t=l.length;t;){for(s=l,l=[];++u1)for(var r=1;r{"use strict";function t(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,r,n,i){r=r||"&",n=n||"=";var o={};if("string"!=typeof e||0===e.length)return o;var a=/\+/g;e=e.split(r);var s=1e3;i&&"number"==typeof i.maxKeys&&(s=i.maxKeys);var l=e.length;s>0&&l>s&&(l=s);for(var c=0;c=0?(u=f.substr(0,m),d=f.substr(m+1)):(u=f,d=""),h=decodeURIComponent(u),p=decodeURIComponent(d),t(o,h)?Array.isArray(o[h])?o[h].push(p):o[h]=[o[h],p]:o[h]=p}return o}},59106:e=>{"use strict";var t=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,r,n,i){return r=r||"&",n=n||"=",null===e&&(e=void 0),"object"==typeof e?Object.keys(e).map((function(i){var o=encodeURIComponent(t(i))+n;return Array.isArray(e[i])?e[i].map((function(e){return o+encodeURIComponent(t(e))})).join(r):o+encodeURIComponent(t(e[i]))})).filter(Boolean).join(r):i?encodeURIComponent(t(i))+n+encodeURIComponent(t(e)):""}},47186:(e,t,r)=>{"use strict";t.decode=t.parse=r(11630),t.encode=t.stringify=r(59106)},79596:(e,t,r)=>{let n;e.exports="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:r.g):e=>(n||(n=Promise.resolve())).then(e).catch((e=>setTimeout((()=>{throw e}),0)))},54625:(e,t,r)=>{"use strict";r.r(t),r.d(t,{BrowserRouter:()=>f,HashRouter:()=>m,Link:()=>S,MemoryRouter:()=>n.MemoryRouter,NavLink:()=>P,Prompt:()=>n.Prompt,Redirect:()=>n.Redirect,Route:()=>n.Route,Router:()=>n.Router,StaticRouter:()=>n.StaticRouter,Switch:()=>n.Switch,generatePath:()=>n.generatePath,matchPath:()=>n.matchPath,useHistory:()=>n.useHistory,useLocation:()=>n.useLocation,useParams:()=>n.useParams,useRouteMatch:()=>n.useRouteMatch,withRouter:()=>n.withRouter});var n=r(24180),i=r(25540),o=r(30668),a=r.n(o),s=r(17929),l=r(5556),c=r.n(l),u=r(57573),d=r(58168),h=r(98587),p=r(11561),f=function(e){function t(){for(var t,r=arguments.length,n=new Array(r),i=0;i ignores the history prop. To use a custom history, use `import { Router }` instead of `import { BrowserRouter as Router }`.")};var m=function(e){function t(){for(var t,r=arguments.length,n=new Array(r),i=0;i ignores the history prop. To use a custom history, use `import { Router }` instead of `import { HashRouter as Router }`.")};var g=function(e,t){return"function"==typeof e?e(t):e},v=function(e,t){return"string"==typeof e?(0,s.yJ)(e,null,null,t):e},y=function(e){return e},b=a().forwardRef;void 0===b&&(b=y);var _=b((function(e,t){var r=e.innerRef,n=e.navigate,i=e.onClick,o=(0,h.A)(e,["innerRef","navigate","onClick"]),s=o.target,l=(0,d.A)({},o,{onClick:function(e){try{i&&i(e)}catch(t){throw e.preventDefault(),t}e.defaultPrevented||0!==e.button||s&&"_self"!==s||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e)||(e.preventDefault(),n())}});return l.ref=y!==b&&t||r,a().createElement("a",l)}));_.displayName="LinkAnchor";var S=b((function(e,t){var r=e.component,i=void 0===r?_:r,o=e.replace,s=e.to,l=e.innerRef,c=(0,h.A)(e,["component","replace","to","innerRef"]);return a().createElement(n.__RouterContext.Consumer,null,(function(e){e||(0,p.A)(!1,"You should not use outside a ");var r=e.history,n=v(g(s,e.location),e.location),u=n?r.createHref(n):"",h=(0,d.A)({},c,{href:u,navigate:function(){var t=g(s,e.location);(o?r.replace:r.push)(t)}});return y!==b?h.ref=t||l:h.innerRef=l,a().createElement(i,h)}))})),w=c().oneOfType([c().string,c().object,c().func]),E=c().oneOfType([c().string,c().func,c().shape({current:c().any})]);S.displayName="Link",S.propTypes={innerRef:E,onClick:c().func,replace:c().bool,target:c().string,to:w.isRequired};var C=function(e){return e},O=a().forwardRef;void 0===O&&(O=C);var P=O((function(e,t){var r=e["aria-current"],i=void 0===r?"page":r,o=e.activeClassName,s=void 0===o?"active":o,l=e.activeStyle,c=e.className,u=e.exact,f=e.isActive,m=e.location,y=e.sensitive,b=e.strict,_=e.style,w=e.to,E=e.innerRef,P=(0,h.A)(e,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return a().createElement(n.__RouterContext.Consumer,null,(function(e){e||(0,p.A)(!1,"You should not use outside a ");var r=m||e.location,o=v(g(w,r),r),h=o.pathname,T=h&&h.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),k=T?(0,n.matchPath)(r.pathname,{path:T,exact:u,sensitive:y,strict:b}):null,R=!!(f?f(k,r):k),A=R?function(){for(var e=arguments.length,t=new Array(e),r=0;r{"use strict";r.r(t),r.d(t,{MemoryRouter:()=>R,Prompt:()=>D,Redirect:()=>N,Route:()=>W,Router:()=>k,StaticRouter:()=>Y,Switch:()=>J,__HistoryContext:()=>O,__RouterContext:()=>T,generatePath:()=>j,matchPath:()=>V,useHistory:()=>ee,useLocation:()=>te,useParams:()=>re,useRouteMatch:()=>ne,withRouter:()=>Q});var n=r(25540),i=r(30668),o=r.n(i),a=r(5556),s=r.n(a),l=r(17929),c=r(57573),u=r(98487),d=r.n(u),h=1073741823,p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==r.g?r.g:{},f=d().createContext||function(e,t){var r,i,o="__create-react-context-"+function(){var e="__global_unique_id__";return p[e]=(p[e]||0)+1}()+"__",a=function(e){function r(){var t,r,n;return(t=e.apply(this,arguments)||this).emitter=(r=t.props.value,n=[],{on:function(e){n.push(e)},off:function(e){n=n.filter((function(t){return t!==e}))},get:function(){return r},set:function(e,t){r=e,n.forEach((function(e){return e(r,t)}))}}),t}(0,n.A)(r,e);var i=r.prototype;return i.getChildContext=function(){var e;return(e={})[o]=this.emitter,e},i.componentWillReceiveProps=function(e){if(this.props.value!==e.value){var r,n=this.props.value,i=e.value;((o=n)===(a=i)?0!==o||1/o==1/a:o!=o&&a!=a)?r=0:(r="function"==typeof t?t(n,i):h,(0,c.A)((r&h)===r,"calculateChangedBits: Expected the return value to be a 31-bit integer. Instead received: "+r),0!=(r|=0)&&this.emitter.set(e.value,r))}var o,a},i.render=function(){return this.props.children},r}(u.Component);a.childContextTypes=((r={})[o]=s().object.isRequired,r);var l=function(t){function r(){var e;return(e=t.apply(this,arguments)||this).state={value:e.getValue()},e.onUpdate=function(t,r){e.observedBits&r&&e.setState({value:e.getValue()})},e}(0,n.A)(r,t);var i=r.prototype;return i.componentWillReceiveProps=function(e){var t=e.observedBits;this.observedBits=null==t?h:t},i.componentDidMount=function(){this.context[o]&&this.context[o].on(this.onUpdate);var e=this.props.observedBits;this.observedBits=null==e?h:e},i.componentWillUnmount=function(){this.context[o]&&this.context[o].off(this.onUpdate)},i.getValue=function(){return this.context[o]?this.context[o].get():e},i.render=function(){return(e=this.props.children,Array.isArray(e)?e[0]:e)(this.state.value);var e},r}(u.Component);return l.contextTypes=((i={})[o]=s().object,i),{Provider:a,Consumer:l}};const m=f;var g=r(11561),v=r(58168),y=r(35302),b=r.n(y),_=r(44363),S=r(98587),w=r(4146),E=r.n(w),C=function(e){var t=m();return t.displayName=e,t},O=C("Router-History"),P=function(e){var t=m();return t.displayName=e,t},T=P("Router"),k=function(e){function t(t){var r;return(r=e.call(this,t)||this).state={location:t.history.location},r._isMounted=!1,r._pendingLocation=null,t.staticContext||(r.unlisten=t.history.listen((function(e){r._isMounted?r.setState({location:e}):r._pendingLocation=e}))),r}(0,n.A)(t,e),t.computeRootMatch=function(e){return{path:"/",url:"/",params:{},isExact:"/"===e}};var r=t.prototype;return r.componentDidMount=function(){this._isMounted=!0,this._pendingLocation&&this.setState({location:this._pendingLocation})},r.componentWillUnmount=function(){this.unlisten&&this.unlisten()},r.render=function(){return o().createElement(T.Provider,{value:{history:this.props.history,location:this.state.location,match:t.computeRootMatch(this.state.location.pathname),staticContext:this.props.staticContext}},o().createElement(O.Provider,{children:this.props.children||null,value:this.props.history}))},t}(o().Component);k.propTypes={children:s().node,history:s().object.isRequired,staticContext:s().object},k.prototype.componentDidUpdate=function(e){(0,c.A)(e.history===this.props.history,"You cannot change ")};var R=function(e){function t(){for(var t,r=arguments.length,n=new Array(r),i=0;i ignores the history prop. To use a custom history, use `import { Router }` instead of `import { MemoryRouter as Router }`.")};var A=function(e){function t(){return e.apply(this,arguments)||this}(0,n.A)(t,e);var r=t.prototype;return r.componentDidMount=function(){this.props.onMount&&this.props.onMount.call(this,this)},r.componentDidUpdate=function(e){this.props.onUpdate&&this.props.onUpdate.call(this,this,e)},r.componentWillUnmount=function(){this.props.onUnmount&&this.props.onUnmount.call(this,this)},r.render=function(){return null},t}(o().Component);function D(e){var t=e.message,r=e.when,n=void 0===r||r;return o().createElement(T.Consumer,null,(function(e){if(e||(0,g.A)(!1,"You should not use outside a "),!n||e.staticContext)return null;var r=e.history.block;return o().createElement(A,{onMount:function(e){e.release=r(t)},onUpdate:function(e,n){n.message!==t&&(e.release(),e.release=r(t))},onUnmount:function(e){e.release()},message:t})}))}var I=s().oneOfType([s().func,s().string]);D.propTypes={when:s().bool,message:I.isRequired};var x={},M=1e4,L=0;function j(e,t){return void 0===e&&(e="/"),void 0===t&&(t={}),"/"===e?e:function(e){if(x[e])return x[e];var t=b().compile(e);return L outside a ");var n=e.history,a=e.staticContext,s=i?n.push:n.replace,c=(0,l.yJ)(t?"string"==typeof r?j(r,t.params):(0,v.A)({},r,{pathname:j(r.pathname,t.params)}):r);return a?(s(c),null):o().createElement(A,{onMount:function(){s(c)},onUpdate:function(e,t){var r=(0,l.yJ)(t.to);(0,l.Fu)(r,(0,v.A)({},c,{key:r.key}))||s(c)},to:r})}))}N.propTypes={push:s().bool,from:s().string,to:s().oneOfType([s().string,s().object]).isRequired};var F={},B=1e4,U=0;function V(e,t){void 0===t&&(t={}),("string"==typeof t||Array.isArray(t))&&(t={path:t});var r=t,n=r.path,i=r.exact,o=void 0!==i&&i,a=r.strict,s=void 0!==a&&a,l=r.sensitive,c=void 0!==l&&l;return[].concat(n).reduce((function(t,r){if(!r&&""!==r)return null;if(t)return t;var n=function(e,t){var r=""+t.end+t.strict+t.sensitive,n=F[r]||(F[r]={});if(n[e])return n[e];var i=[],o={regexp:b()(e,i,t),keys:i};return U, but you should have returned a React element or `null`"),n||null}var W=function(e){function t(){return e.apply(this,arguments)||this}return(0,n.A)(t,e),t.prototype.render=function(){var e=this;return o().createElement(T.Consumer,null,(function(t){t||(0,g.A)(!1,"You should not use outside a ");var r=e.props.location||t.location,n=e.props.computedMatch?e.props.computedMatch:e.props.path?V(r.pathname,e.props):t.match,i=(0,v.A)({},t,{location:r,match:n}),a=e.props,s=a.children,l=a.component,c=a.render;return Array.isArray(s)&&0===s.length&&(s=null),o().createElement(T.Provider,{value:i},i.match?s?"function"==typeof s?G(s,i,e.props.path):s:l?o().createElement(l,i):c?c(i):null:"function"==typeof s?G(s,i,e.props.path):null)}))},t}(o().Component);function z(e){return"/"===e.charAt(0)?e:"/"+e}function K(e,t){if(!e)return t;var r=z(e);return 0!==t.pathname.indexOf(r)?t:(0,v.A)({},t,{pathname:t.pathname.substr(r.length)})}function $(e){return"string"==typeof e?e:(0,l.AO)(e)}function q(e){return function(){(0,g.A)(!1,"You cannot %s with ",e)}}function Z(){}W.propTypes={children:s().oneOfType([s().func,s().node]),component:function(e,t){if(e[t]&&!(0,_.isValidElementType)(e[t]))return new Error("Invalid prop 'component' supplied to 'Route': the prop is not a valid React component")},exact:s().bool,location:s().object,path:s().oneOfType([s().string,s().arrayOf(s().string)]),render:s().func,sensitive:s().bool,strict:s().bool},W.prototype.componentDidMount=function(){(0,c.A)(!(this.props.children&&!H(this.props.children)&&this.props.component),"You should not use and in the same route; will be ignored"),(0,c.A)(!(this.props.children&&!H(this.props.children)&&this.props.render),"You should not use and in the same route; will be ignored"),(0,c.A)(!(this.props.component&&this.props.render),"You should not use and in the same route; will be ignored")},W.prototype.componentDidUpdate=function(e){(0,c.A)(!(this.props.location&&!e.location),' elements should not change from uncontrolled to controlled (or vice versa). You initially used no "location" prop and then provided one on a subsequent render.'),(0,c.A)(!(!this.props.location&&e.location),' elements should not change from controlled to uncontrolled (or vice versa). You provided a "location" prop initially but omitted it on a subsequent render.')};var Y=function(e){function t(){for(var t,r=arguments.length,n=new Array(r),i=0;i ignores the history prop. To use a custom history, use `import { Router }` instead of `import { StaticRouter as Router }`.")};var J=function(e){function t(){return e.apply(this,arguments)||this}return(0,n.A)(t,e),t.prototype.render=function(){var e=this;return o().createElement(T.Consumer,null,(function(t){t||(0,g.A)(!1,"You should not use outside a ");var r,n,i=e.props.location||t.location;return o().Children.forEach(e.props.children,(function(e){if(null==n&&o().isValidElement(e)){r=e;var a=e.props.path||e.props.from;n=a?V(i.pathname,(0,v.A)({},e.props,{path:a})):t.match}})),n?o().cloneElement(r,{location:i,computedMatch:n}):null}))},t}(o().Component);function Q(e){var t="withRouter("+(e.displayName||e.name)+")",r=function(r){var n=r.wrappedComponentRef,i=(0,S.A)(r,["wrappedComponentRef"]);return o().createElement(T.Consumer,null,(function(r){return r||(0,g.A)(!1,"You should not use <"+t+" /> outside a "),o().createElement(e,(0,v.A)({},i,r,{ref:n}))}))};return r.displayName=t,r.WrappedComponent=e,r.propTypes={wrappedComponentRef:s().oneOfType([s().string,s().func,s().object])},E()(r,e)}J.propTypes={children:s().node,location:s().object},J.prototype.componentDidUpdate=function(e){(0,c.A)(!(this.props.location&&!e.location),' elements should not change from uncontrolled to controlled (or vice versa). You initially used no "location" prop and then provided one on a subsequent render.'),(0,c.A)(!(!this.props.location&&e.location),' elements should not change from controlled to uncontrolled (or vice versa). You provided a "location" prop initially but omitted it on a subsequent render.')};var X=o().useContext;function ee(){return"function"!=typeof X&&(0,g.A)(!1,"You must use React >= 16.8 in order to use useHistory()"),X(O)}function te(){return"function"!=typeof X&&(0,g.A)(!1,"You must use React >= 16.8 in order to use useLocation()"),X(T).location}function re(){"function"!=typeof X&&(0,g.A)(!1,"You must use React >= 16.8 in order to use useParams()");var e=X(T).match;return e?e.params:{}}function ne(e){"function"!=typeof X&&(0,g.A)(!1,"You must use React >= 16.8 in order to use useRouteMatch()");var t=te(),r=X(T).match;return e?V(t.pathname,e):r}if("undefined"!=typeof window){var ie=window,oe="__react_router_build__",ae={cjs:"CommonJS",esm:"ES modules",umd:"UMD"};if(ie[oe]&&"esm"!==ie[oe]){var se=ae[ie[oe]];throw new Error("You are loading the "+ae.esm+" build of React Router on a page that is already running the "+se+" build, so things won't work right.")}ie[oe]="esm"}},27102:(e,t,r)=>{"use strict";r.r(t),r.d(t,{UID:()=>f,UIDConsumer:()=>_,UIDFork:()=>b,UIDReset:()=>y,generateUID:()=>o,uid:()=>a,useUID:()=>g,useUIDSeed:()=>v});var n,i=r(81783),o=function(){var e=1,t=new WeakMap,r=function(n,i){return"number"==typeof n||"string"==typeof n?i?"idx-".concat(i):"val-".concat(n):t.has(n)?"uid"+t.get(n):(t.set(n,e++),r(n))};return r},a=o(),s=function(e){return void 0===e&&(e=""),{value:1,prefix:e,uid:o()}},l=s(),c=i.createContext(s()),u=function(e){return e.value++},d=function(e){return e?e.prefix:""},h=(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),p=function(e,t,r){var n=t+e;return String(r?r(n):n)},f=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={quartz:t.props.idSource||l,prefix:d(t.props.idSource),id:u(t.props.idSource||l)},t.uid=function(e){return p(t.state.id+"-"+t.state.quartz.uid(e),t.state.prefix,t.props.name)},t}return h(t,e),t.prototype.render=function(){var e=this.props,t=e.children,r=e.name,n=this.state,i=n.id,o=n.prefix;return t(p(i,o,r),this.uid)},t}(i.Component),m=function(){if(!("useContext"in i))throw new Error("Hooks API requires React 16.8+");var e=(0,i.useContext)(c),t=(0,i.useState)((function(){return function(e){var t=e||l,r=d(t)+u(t);return{uid:r,gen:function(e){return r+t.uid(e)}}}(e)}))[0];return t},g=function(){return m().uid},v=function(){return m().gen},y=function(e){var t=e.children,r=e.prefix,n=void 0===r?"":r,o=(0,i.useState)((function(){return s(n)}))[0];return i.createElement(c.Provider,{value:o},t)},b=function(e){var t=e.children,r=e.prefix,n=void 0===r?"":r,o=g(),a=(0,i.useState)((function(){return s(o+"-"+n)}))[0];return i.createElement(c.Provider,{value:a},t)},_=function(e){var t=e.name,r=e.children;return i.createElement(c.Consumer,null,(function(e){return i.createElement(f,{name:t,idSource:e,children:r})}))}},5602:e=>{var t=e.exports={v:[{name:"version",reg:/^(\d*)$/}],o:[{name:"origin",reg:/^(\S*) (\d*) (\d*) (\S*) IP(\d) (\S*)/,names:["username","sessionId","sessionVersion","netType","ipVer","address"],format:"%s %s %d %s IP%d %s"}],s:[{name:"name"}],i:[{name:"description"}],u:[{name:"uri"}],e:[{name:"email"}],p:[{name:"phone"}],z:[{name:"timezones"}],r:[{name:"repeats"}],t:[{name:"timing",reg:/^(\d*) (\d*)/,names:["start","stop"],format:"%d %d"}],c:[{name:"connection",reg:/^IN IP(\d) (\S*)/,names:["version","ip"],format:"IN IP%d %s"}],b:[{push:"bandwidth",reg:/^(TIAS|AS|CT|RR|RS):(\d*)/,names:["type","limit"],format:"%s:%s"}],m:[{reg:/^(\w*) (\d*) ([\w/]*)(?: (.*))?/,names:["type","port","protocol","payloads"],format:"%s %d %s %s"}],a:[{push:"rtp",reg:/^rtpmap:(\d*) ([\w\-.]*)(?:\s*\/(\d*)(?:\s*\/(\S*))?)?/,names:["payload","codec","rate","encoding"],format:function(e){return e.encoding?"rtpmap:%d %s/%s/%s":e.rate?"rtpmap:%d %s/%s":"rtpmap:%d %s"}},{push:"fmtp",reg:/^fmtp:(\d*) ([\S| ]*)/,names:["payload","config"],format:"fmtp:%d %s"},{name:"control",reg:/^control:(.*)/,format:"control:%s"},{name:"rtcp",reg:/^rtcp:(\d*)(?: (\S*) IP(\d) (\S*))?/,names:["port","netType","ipVer","address"],format:function(e){return null!=e.address?"rtcp:%d %s IP%d %s":"rtcp:%d"}},{push:"rtcpFbTrrInt",reg:/^rtcp-fb:(\*|\d*) trr-int (\d*)/,names:["payload","value"],format:"rtcp-fb:%s trr-int %d"},{push:"rtcpFb",reg:/^rtcp-fb:(\*|\d*) ([\w-_]*)(?: ([\w-_]*))?/,names:["payload","type","subtype"],format:function(e){return null!=e.subtype?"rtcp-fb:%s %s %s":"rtcp-fb:%s %s"}},{push:"ext",reg:/^extmap:(\d+)(?:\/(\w+))?(?: (urn:ietf:params:rtp-hdrext:encrypt))? (\S*)(?: (\S*))?/,names:["value","direction","encrypt-uri","uri","config"],format:function(e){return"extmap:%d"+(e.direction?"/%s":"%v")+(e["encrypt-uri"]?" %s":"%v")+" %s"+(e.config?" %s":"")}},{name:"extmapAllowMixed",reg:/^(extmap-allow-mixed)/},{push:"crypto",reg:/^crypto:(\d*) ([\w_]*) (\S*)(?: (\S*))?/,names:["id","suite","config","sessionConfig"],format:function(e){return null!=e.sessionConfig?"crypto:%d %s %s %s":"crypto:%d %s %s"}},{name:"setup",reg:/^setup:(\w*)/,format:"setup:%s"},{name:"connectionType",reg:/^connection:(new|existing)/,format:"connection:%s"},{name:"mid",reg:/^mid:([^\s]*)/,format:"mid:%s"},{name:"msid",reg:/^msid:(.*)/,format:"msid:%s"},{name:"ptime",reg:/^ptime:(\d*(?:\.\d*)*)/,format:"ptime:%d"},{name:"maxptime",reg:/^maxptime:(\d*(?:\.\d*)*)/,format:"maxptime:%d"},{name:"direction",reg:/^(sendrecv|recvonly|sendonly|inactive)/},{name:"icelite",reg:/^(ice-lite)/},{name:"iceUfrag",reg:/^ice-ufrag:(\S*)/,format:"ice-ufrag:%s"},{name:"icePwd",reg:/^ice-pwd:(\S*)/,format:"ice-pwd:%s"},{name:"fingerprint",reg:/^fingerprint:(\S*) (\S*)/,names:["type","hash"],format:"fingerprint:%s %s"},{push:"candidates",reg:/^candidate:(\S*) (\d*) (\S*) (\d*) (\S*) (\d*) typ (\S*)(?: raddr (\S*) rport (\d*))?(?: tcptype (\S*))?(?: generation (\d*))?(?: network-id (\d*))?(?: network-cost (\d*))?/,names:["foundation","component","transport","priority","ip","port","type","raddr","rport","tcptype","generation","network-id","network-cost"],format:function(e){var t="candidate:%s %d %s %d %s %d typ %s";return t+=null!=e.raddr?" raddr %s rport %d":"%v%v",t+=null!=e.tcptype?" tcptype %s":"%v",null!=e.generation&&(t+=" generation %d"),(t+=null!=e["network-id"]?" network-id %d":"%v")+(null!=e["network-cost"]?" network-cost %d":"%v")}},{name:"endOfCandidates",reg:/^(end-of-candidates)/},{name:"remoteCandidates",reg:/^remote-candidates:(.*)/,format:"remote-candidates:%s"},{name:"iceOptions",reg:/^ice-options:(\S*)/,format:"ice-options:%s"},{push:"ssrcs",reg:/^ssrc:(\d*) ([\w_-]*)(?::(.*))?/,names:["id","attribute","value"],format:function(e){var t="ssrc:%d";return null!=e.attribute&&(t+=" %s",null!=e.value&&(t+=":%s")),t}},{push:"ssrcGroups",reg:/^ssrc-group:([\x21\x23\x24\x25\x26\x27\x2A\x2B\x2D\x2E\w]*) (.*)/,names:["semantics","ssrcs"],format:"ssrc-group:%s %s"},{name:"msidSemantic",reg:/^msid-semantic:\s?(\w*) (\S*)/,names:["semantic","token"],format:"msid-semantic: %s %s"},{push:"groups",reg:/^group:(\w*) (.*)/,names:["type","mids"],format:"group:%s %s"},{name:"rtcpMux",reg:/^(rtcp-mux)/},{name:"rtcpRsize",reg:/^(rtcp-rsize)/},{name:"sctpmap",reg:/^sctpmap:([\w_/]*) (\S*)(?: (\S*))?/,names:["sctpmapNumber","app","maxMessageSize"],format:function(e){return null!=e.maxMessageSize?"sctpmap:%s %s %s":"sctpmap:%s %s"}},{name:"xGoogleFlag",reg:/^x-google-flag:([^\s]*)/,format:"x-google-flag:%s"},{push:"rids",reg:/^rid:([\d\w]+) (\w+)(?: ([\S| ]*))?/,names:["id","direction","params"],format:function(e){return e.params?"rid:%s %s %s":"rid:%s %s"}},{push:"imageattrs",reg:new RegExp("^imageattr:(\\d+|\\*)[\\s\\t]+(send|recv)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*)(?:[\\s\\t]+(recv|send)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*))?"),names:["pt","dir1","attrs1","dir2","attrs2"],format:function(e){return"imageattr:%s %s %s"+(e.dir2?" %s %s":"")}},{name:"simulcast",reg:new RegExp("^simulcast:(send|recv) ([a-zA-Z0-9\\-_~;,]+)(?:\\s?(send|recv) ([a-zA-Z0-9\\-_~;,]+))?$"),names:["dir1","list1","dir2","list2"],format:function(e){return"simulcast:%s %s"+(e.dir2?" %s %s":"")}},{name:"simulcast_03",reg:/^simulcast:[\s\t]+([\S+\s\t]+)$/,names:["value"],format:"simulcast: %s"},{name:"framerate",reg:/^framerate:(\d+(?:$|\.\d+))/,format:"framerate:%s"},{name:"sourceFilter",reg:/^source-filter: *(excl|incl) (\S*) (IP4|IP6|\*) (\S*) (.*)/,names:["filterMode","netType","addressTypes","destAddress","srcList"],format:"source-filter: %s %s %s %s %s"},{name:"bundleOnly",reg:/^(bundle-only)/},{name:"label",reg:/^label:(.+)/,format:"label:%s"},{name:"sctpPort",reg:/^sctp-port:(\d+)$/,format:"sctp-port:%s"},{name:"maxMessageSize",reg:/^max-message-size:(\d+)$/,format:"max-message-size:%s"},{push:"tsRefClocks",reg:/^ts-refclk:([^\s=]*)(?:=(\S*))?/,names:["clksrc","clksrcExt"],format:function(e){return"ts-refclk:%s"+(null!=e.clksrcExt?"=%s":"")}},{name:"mediaClk",reg:/^mediaclk:(?:id=(\S*))? *([^\s=]*)(?:=(\S*))?(?: *rate=(\d+)\/(\d+))?/,names:["id","mediaClockName","mediaClockValue","rateNumerator","rateDenominator"],format:function(e){var t="mediaclk:";return t+=null!=e.id?"id=%s %s":"%v%s",t+=null!=e.mediaClockValue?"=%s":"",(t+=null!=e.rateNumerator?" rate=%s":"")+(null!=e.rateDenominator?"/%s":"")}},{name:"keywords",reg:/^keywds:(.+)$/,format:"keywds:%s"},{name:"content",reg:/^content:(.+)/,format:"content:%s"},{name:"bfcpFloorCtrl",reg:/^floorctrl:(c-only|s-only|c-s)/,format:"floorctrl:%s"},{name:"bfcpConfId",reg:/^confid:(\d+)/,format:"confid:%s"},{name:"bfcpUserId",reg:/^userid:(\d+)/,format:"userid:%s"},{name:"bfcpFloorId",reg:/^floorid:(.+) (?:m-stream|mstrm):(.+)/,names:["id","mStream"],format:"floorid:%s mstrm:%s"},{push:"invalid",names:["value"]}]};Object.keys(t).forEach((function(e){t[e].forEach((function(e){e.reg||(e.reg=/(.*)/),e.format||(e.format="%s")}))}))},17363:(e,t,r)=>{var n=r(25020),i=r(83804),o=r(5602);t.grammar=o,t.write=i,t.parse=n.parse,t.parseParams=n.parseParams,t.parseFmtpConfig=n.parseFmtpConfig,t.parsePayloads=n.parsePayloads,t.parseRemoteCandidates=n.parseRemoteCandidates,t.parseImageAttributes=n.parseImageAttributes,t.parseSimulcastStreamList=n.parseSimulcastStreamList},25020:(e,t,r)=>{var n=function(e){return String(Number(e))===e?Number(e):e},i=function(e,t,r){var i=e.name&&e.names;e.push&&!t[e.push]?t[e.push]=[]:i&&!t[e.name]&&(t[e.name]={});var o=e.push?{}:i?t[e.name]:t;!function(e,t,r,i){if(i&&!r)t[i]=n(e[1]);else for(var o=0;o1&&(e[r[0]]=void 0),e};t.parseParams=function(e){return e.split(/;\s?/).reduce(s,{})},t.parseFmtpConfig=t.parseParams,t.parsePayloads=function(e){return e.toString().split(" ").map(Number)},t.parseRemoteCandidates=function(e){for(var t=[],r=e.split(" ").map(n),i=0;i{var n=r(5602),i=/%[sdv%]/g,o=function(e){var t=1,r=arguments,n=r.length;return e.replace(i,(function(e){if(t>=n)return e;var i=r[t];switch(t+=1,e){case"%%":return"%";case"%s":return String(i);case"%d":return Number(i);case"%v":return""}}))},a=function(e,t,r){var n=[e+"="+(t.format instanceof Function?t.format(t.push?r:r[t.name]):t.format)];if(t.names)for(var i=0;i{const n=Symbol("SemVer ANY");class i{static get ANY(){return n}constructor(e,t){if(t=o(t),e instanceof i){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),c("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===n?this.value="":this.value=this.operator+this.semver.version,c("comp",this)}parse(e){const t=this.options.loose?a[s.COMPARATORLOOSE]:a[s.COMPARATOR],r=e.match(t);if(!r)throw new TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==r[1]?r[1]:"","="===this.operator&&(this.operator=""),r[2]?this.semver=new u(r[2],this.options.loose):this.semver=n}toString(){return this.value}test(e){if(c("Comparator.test",e,this.options.loose),this.semver===n||e===n)return!0;if("string"==typeof e)try{e=new u(e,this.options)}catch(e){return!1}return l(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof i))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new d(e.value,t).test(this.value):""===e.operator?""===e.value||new d(this.value,t).test(e.semver):!((t=o(t)).includePrerelease&&("<0.0.0-0"===this.value||"<0.0.0-0"===e.value)||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))||(!this.operator.startsWith(">")||!e.operator.startsWith(">"))&&(!this.operator.startsWith("<")||!e.operator.startsWith("<"))&&(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))&&!(l(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))&&!(l(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}}e.exports=i;const o=r(20968),{safeRe:a,t:s}=r(99718),l=r(72111),c=r(57272),u=r(53908),d=r(78311)},78311:(e,t,r)=>{class n{constructor(e,t){if(t=o(t),e instanceof n)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new n(e.raw,t);if(e instanceof a)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!g(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&v(e[0])){this.set=[e];break}}this.format()}format(){return this.range=this.set.map((e=>e.join(" ").trim())).join("||").trim(),this.range}toString(){return this.range}parseRange(e){const t=((this.options.includePrerelease&&f)|(this.options.loose&&m))+":"+e,r=i.get(t);if(r)return r;const n=this.options.loose,o=n?c[u.HYPHENRANGELOOSE]:c[u.HYPHENRANGE];e=e.replace(o,R(this.options.includePrerelease)),s("hyphen replace",e),e=e.replace(c[u.COMPARATORTRIM],d),s("comparator trim",e),e=e.replace(c[u.TILDETRIM],h),s("tilde trim",e),e=e.replace(c[u.CARETTRIM],p),s("caret trim",e);let l=e.split(" ").map((e=>b(e,this.options))).join(" ").split(/\s+/).map((e=>k(e,this.options)));n&&(l=l.filter((e=>(s("loose invalid filter",e,this.options),!!e.match(c[u.COMPARATORLOOSE]))))),s("range list",l);const v=new Map,y=l.map((e=>new a(e,this.options)));for(const e of y){if(g(e))return[e];v.set(e.value,e)}v.size>1&&v.has("")&&v.delete("");const _=[...v.values()];return i.set(t,_),_}intersects(e,t){if(!(e instanceof n))throw new TypeError("a Range is required");return this.set.some((r=>y(r,t)&&e.set.some((e=>y(e,t)&&r.every((r=>e.every((e=>r.intersects(e,t)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new l(e,this.options)}catch(e){return!1}for(let t=0;t"<0.0.0-0"===e.value,v=e=>""===e.value,y=(e,t)=>{let r=!0;const n=e.slice();let i=n.pop();for(;r&&n.length;)r=n.every((e=>i.intersects(e,t))),i=n.pop();return r},b=(e,t)=>(s("comp",e,t),e=E(e,t),s("caret",e),e=S(e,t),s("tildes",e),e=O(e,t),s("xrange",e),e=T(e,t),s("stars",e),e),_=e=>!e||"x"===e.toLowerCase()||"*"===e,S=(e,t)=>e.trim().split(/\s+/).map((e=>w(e,t))).join(" "),w=(e,t)=>{const r=t.loose?c[u.TILDELOOSE]:c[u.TILDE];return e.replace(r,((t,r,n,i,o)=>{let a;return s("tilde",e,t,r,n,i,o),_(r)?a="":_(n)?a=`>=${r}.0.0 <${+r+1}.0.0-0`:_(i)?a=`>=${r}.${n}.0 <${r}.${+n+1}.0-0`:o?(s("replaceTilde pr",o),a=`>=${r}.${n}.${i}-${o} <${r}.${+n+1}.0-0`):a=`>=${r}.${n}.${i} <${r}.${+n+1}.0-0`,s("tilde return",a),a}))},E=(e,t)=>e.trim().split(/\s+/).map((e=>C(e,t))).join(" "),C=(e,t)=>{s("caret",e,t);const r=t.loose?c[u.CARETLOOSE]:c[u.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,((t,r,i,o,a)=>{let l;return s("caret",e,t,r,i,o,a),_(r)?l="":_(i)?l=`>=${r}.0.0${n} <${+r+1}.0.0-0`:_(o)?l="0"===r?`>=${r}.${i}.0${n} <${r}.${+i+1}.0-0`:`>=${r}.${i}.0${n} <${+r+1}.0.0-0`:a?(s("replaceCaret pr",a),l="0"===r?"0"===i?`>=${r}.${i}.${o}-${a} <${r}.${i}.${+o+1}-0`:`>=${r}.${i}.${o}-${a} <${r}.${+i+1}.0-0`:`>=${r}.${i}.${o}-${a} <${+r+1}.0.0-0`):(s("no pr"),l="0"===r?"0"===i?`>=${r}.${i}.${o}${n} <${r}.${i}.${+o+1}-0`:`>=${r}.${i}.${o}${n} <${r}.${+i+1}.0-0`:`>=${r}.${i}.${o} <${+r+1}.0.0-0`),s("caret return",l),l}))},O=(e,t)=>(s("replaceXRanges",e,t),e.split(/\s+/).map((e=>P(e,t))).join(" ")),P=(e,t)=>{e=e.trim();const r=t.loose?c[u.XRANGELOOSE]:c[u.XRANGE];return e.replace(r,((r,n,i,o,a,l)=>{s("xRange",e,r,n,i,o,a,l);const c=_(i),u=c||_(o),d=u||_(a),h=d;return"="===n&&h&&(n=""),l=t.includePrerelease?"-0":"",c?r=">"===n||"<"===n?"<0.0.0-0":"*":n&&h?(u&&(o=0),a=0,">"===n?(n=">=",u?(i=+i+1,o=0,a=0):(o=+o+1,a=0)):"<="===n&&(n="<",u?i=+i+1:o=+o+1),"<"===n&&(l="-0"),r=`${n+i}.${o}.${a}${l}`):u?r=`>=${i}.0.0${l} <${+i+1}.0.0-0`:d&&(r=`>=${i}.${o}.0${l} <${i}.${+o+1}.0-0`),s("xRange return",r),r}))},T=(e,t)=>(s("replaceStars",e,t),e.trim().replace(c[u.STAR],"")),k=(e,t)=>(s("replaceGTE0",e,t),e.trim().replace(c[t.includePrerelease?u.GTE0PRE:u.GTE0],"")),R=e=>(t,r,n,i,o,a,s,l,c,u,d,h,p)=>`${r=_(n)?"":_(i)?`>=${n}.0.0${e?"-0":""}`:_(o)?`>=${n}.${i}.0${e?"-0":""}`:a?`>=${r}`:`>=${r}${e?"-0":""}`} ${l=_(c)?"":_(u)?`<${+c+1}.0.0-0`:_(d)?`<${c}.${+u+1}.0-0`:h?`<=${c}.${u}.${d}-${h}`:e?`<${c}.${u}.${+d+1}-0`:`<=${l}`}`.trim(),A=(e,t,r)=>{for(let r=0;r0){const n=e[r].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0}return!1}return!0}},53908:(e,t,r)=>{const n=r(57272),{MAX_LENGTH:i,MAX_SAFE_INTEGER:o}=r(16874),{safeRe:a,t:s}=r(99718),l=r(20968),{compareIdentifiers:c}=r(61123);class u{constructor(e,t){if(t=l(t),e instanceof u){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>i)throw new TypeError(`version is longer than ${i} characters`);n("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const r=e.trim().match(t.loose?a[s.LOOSE]:a[s.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>o||this.major<0)throw new TypeError("Invalid major version");if(this.minor>o||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>o||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);if(-1===n){if(t===this.prerelease.join(".")&&!1===r)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let n=[t,e];!1===r&&(n=[t]),0===c(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=n):this.prerelease=n}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}e.exports=u},57414:(e,t,r)=>{const n=r(30144);e.exports=(e,t)=>{const r=n(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null}},72111:(e,t,r)=>{const n=r(94641),i=r(13999),o=r(35580),a=r(54089),s=r(7059),l=r(25200);e.exports=(e,t,r,c)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e===r;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e!==r;case"":case"=":case"==":return n(e,r,c);case"!=":return i(e,r,c);case">":return o(e,r,c);case">=":return a(e,r,c);case"<":return s(e,r,c);case"<=":return l(e,r,c);default:throw new TypeError(`Invalid operator: ${t}`)}}},46170:(e,t,r)=>{const n=r(53908),i=r(30144),{safeRe:o,t:a}=r(99718);e.exports=(e,t)=>{if(e instanceof n)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let r=null;if((t=t||{}).rtl){let t;for(;(t=o[a.COERCERTL].exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&t.index+t[0].length===r.index+r[0].length||(r=t),o[a.COERCERTL].lastIndex=t.index+t[1].length+t[2].length;o[a.COERCERTL].lastIndex=-1}else r=e.match(o[a.COERCE]);return null===r?null:i(`${r[2]}.${r[3]||"0"}.${r[4]||"0"}`,t)}},40909:(e,t,r)=>{const n=r(53908);e.exports=(e,t,r)=>{const i=new n(e,r),o=new n(t,r);return i.compare(o)||i.compareBuild(o)}},11763:(e,t,r)=>{const n=r(50560);e.exports=(e,t)=>n(e,t,!0)},50560:(e,t,r)=>{const n=r(53908);e.exports=(e,t,r)=>new n(e,r).compare(new n(t,r))},51832:(e,t,r)=>{const n=r(30144);e.exports=(e,t)=>{const r=n(e,null,!0),i=n(t,null,!0),o=r.compare(i);if(0===o)return null;const a=o>0,s=a?r:i,l=a?i:r,c=!!s.prerelease.length;if(l.prerelease.length&&!c)return l.patch||l.minor?s.patch?"patch":s.minor?"minor":"major":"major";const u=c?"pre":"";return r.major!==i.major?u+"major":r.minor!==i.minor?u+"minor":r.patch!==i.patch?u+"patch":"prerelease"}},94641:(e,t,r)=>{const n=r(50560);e.exports=(e,t,r)=>0===n(e,t,r)},35580:(e,t,r)=>{const n=r(50560);e.exports=(e,t,r)=>n(e,t,r)>0},54089:(e,t,r)=>{const n=r(50560);e.exports=(e,t,r)=>n(e,t,r)>=0},93007:(e,t,r)=>{const n=r(53908);e.exports=(e,t,r,i,o)=>{"string"==typeof r&&(o=i,i=r,r=void 0);try{return new n(e instanceof n?e.version:e,r).inc(t,i,o).version}catch(e){return null}}},7059:(e,t,r)=>{const n=r(50560);e.exports=(e,t,r)=>n(e,t,r)<0},25200:(e,t,r)=>{const n=r(50560);e.exports=(e,t,r)=>n(e,t,r)<=0},32938:(e,t,r)=>{const n=r(53908);e.exports=(e,t)=>new n(e,t).major},46254:(e,t,r)=>{const n=r(53908);e.exports=(e,t)=>new n(e,t).minor},13999:(e,t,r)=>{const n=r(50560);e.exports=(e,t,r)=>0!==n(e,t,r)},30144:(e,t,r)=>{const n=r(53908);e.exports=(e,t,r=!1)=>{if(e instanceof n)return e;try{return new n(e,t)}catch(e){if(!r)return null;throw e}}},24493:(e,t,r)=>{const n=r(53908);e.exports=(e,t)=>new n(e,t).patch},31729:(e,t,r)=>{const n=r(30144);e.exports=(e,t)=>{const r=n(e,t);return r&&r.prerelease.length?r.prerelease:null}},9970:(e,t,r)=>{const n=r(50560);e.exports=(e,t,r)=>n(t,e,r)},74277:(e,t,r)=>{const n=r(40909);e.exports=(e,t)=>e.sort(((e,r)=>n(r,e,t)))},97638:(e,t,r)=>{const n=r(78311);e.exports=(e,t,r)=>{try{t=new n(t,r)}catch(e){return!1}return t.test(e)}},43927:(e,t,r)=>{const n=r(40909);e.exports=(e,t)=>e.sort(((e,r)=>n(e,r,t)))},56953:(e,t,r)=>{const n=r(30144);e.exports=(e,t)=>{const r=n(e,t);return r?r.version:null}},99589:(e,t,r)=>{const n=r(99718),i=r(16874),o=r(53908),a=r(61123),s=r(30144),l=r(56953),c=r(57414),u=r(93007),d=r(51832),h=r(32938),p=r(46254),f=r(24493),m=r(31729),g=r(50560),v=r(9970),y=r(11763),b=r(40909),_=r(43927),S=r(74277),w=r(35580),E=r(7059),C=r(94641),O=r(13999),P=r(54089),T=r(25200),k=r(72111),R=r(46170),A=r(93904),D=r(78311),I=r(97638),x=r(77631),M=r(19628),L=r(270),j=r(41261),N=r(13874),F=r(97075),B=r(75571),U=r(5342),V=r(76780),H=r(72525),G=r(75032);e.exports={parse:s,valid:l,clean:c,inc:u,diff:d,major:h,minor:p,patch:f,prerelease:m,compare:g,rcompare:v,compareLoose:y,compareBuild:b,sort:_,rsort:S,gt:w,lt:E,eq:C,neq:O,gte:P,lte:T,cmp:k,coerce:R,Comparator:A,Range:D,satisfies:I,toComparators:x,maxSatisfying:M,minSatisfying:L,minVersion:j,validRange:N,outside:F,gtr:B,ltr:U,intersects:V,simplifyRange:H,subset:G,SemVer:o,re:n.re,src:n.src,tokens:n.t,SEMVER_SPEC_VERSION:i.SEMVER_SPEC_VERSION,RELEASE_TYPES:i.RELEASE_TYPES,compareIdentifiers:a.compareIdentifiers,rcompareIdentifiers:a.rcompareIdentifiers}},16874:e=>{const t=Number.MAX_SAFE_INTEGER||9007199254740991;e.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:t,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},57272:(e,t,r)=>{var n=r(65606);const i="object"==typeof n&&n.env&&n.env.NODE_DEBUG&&/\bsemver\b/i.test(n.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};e.exports=i},61123:e=>{const t=/^[0-9]+$/,r=(e,r)=>{const n=t.test(e),i=t.test(r);return n&&i&&(e=+e,r=+r),e===r?0:n&&!i?-1:i&&!n?1:er(t,e)}},20968:e=>{const t=Object.freeze({loose:!0}),r=Object.freeze({});e.exports=e=>e?"object"!=typeof e?t:e:r},99718:(e,t,r)=>{const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:i,MAX_LENGTH:o}=r(16874),a=r(57272),s=(t=e.exports={}).re=[],l=t.safeRe=[],c=t.src=[],u=t.t={};let d=0;const h="[a-zA-Z0-9-]",p=[["\\s",1],["\\d",o],[h,i]],f=(e,t,r)=>{const n=(e=>{for(const[t,r]of p)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e})(t),i=d++;a(e,i,t),u[e]=i,c[i]=t,s[i]=new RegExp(t,r?"g":void 0),l[i]=new RegExp(n,r?"g":void 0)};f("NUMERICIDENTIFIER","0|[1-9]\\d*"),f("NUMERICIDENTIFIERLOOSE","\\d+"),f("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${h}*`),f("MAINVERSION",`(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`),f("MAINVERSIONLOOSE",`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`),f("PRERELEASEIDENTIFIER",`(?:${c[u.NUMERICIDENTIFIER]}|${c[u.NONNUMERICIDENTIFIER]})`),f("PRERELEASEIDENTIFIERLOOSE",`(?:${c[u.NUMERICIDENTIFIERLOOSE]}|${c[u.NONNUMERICIDENTIFIER]})`),f("PRERELEASE",`(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`),f("PRERELEASELOOSE",`(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`),f("BUILDIDENTIFIER",`${h}+`),f("BUILD",`(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`),f("FULLPLAIN",`v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`),f("FULL",`^${c[u.FULLPLAIN]}$`),f("LOOSEPLAIN",`[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`),f("LOOSE",`^${c[u.LOOSEPLAIN]}$`),f("GTLT","((?:<|>)?=?)"),f("XRANGEIDENTIFIERLOOSE",`${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),f("XRANGEIDENTIFIER",`${c[u.NUMERICIDENTIFIER]}|x|X|\\*`),f("XRANGEPLAIN",`[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`),f("XRANGEPLAINLOOSE",`[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`),f("XRANGE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`),f("XRANGELOOSE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`),f("COERCE",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?(?:$|[^\\d])`),f("COERCERTL",c[u.COERCE],!0),f("LONETILDE","(?:~>?)"),f("TILDETRIM",`(\\s*)${c[u.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",f("TILDE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`),f("TILDELOOSE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`),f("LONECARET","(?:\\^)"),f("CARETTRIM",`(\\s*)${c[u.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",f("CARET",`^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`),f("CARETLOOSE",`^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`),f("COMPARATORLOOSE",`^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`),f("COMPARATOR",`^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`),f("COMPARATORTRIM",`(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",f("HYPHENRANGE",`^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`),f("HYPHENRANGELOOSE",`^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`),f("STAR","(<|>)?=?\\s*\\*"),f("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),f("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},75571:(e,t,r)=>{const n=r(97075);e.exports=(e,t,r)=>n(e,t,">",r)},76780:(e,t,r)=>{const n=r(78311);e.exports=(e,t,r)=>(e=new n(e,r),t=new n(t,r),e.intersects(t,r))},5342:(e,t,r)=>{const n=r(97075);e.exports=(e,t,r)=>n(e,t,"<",r)},19628:(e,t,r)=>{const n=r(53908),i=r(78311);e.exports=(e,t,r)=>{let o=null,a=null,s=null;try{s=new i(t,r)}catch(e){return null}return e.forEach((e=>{s.test(e)&&(o&&-1!==a.compare(e)||(o=e,a=new n(o,r)))})),o}},270:(e,t,r)=>{const n=r(53908),i=r(78311);e.exports=(e,t,r)=>{let o=null,a=null,s=null;try{s=new i(t,r)}catch(e){return null}return e.forEach((e=>{s.test(e)&&(o&&1!==a.compare(e)||(o=e,a=new n(o,r)))})),o}},41261:(e,t,r)=>{const n=r(53908),i=r(78311),o=r(35580);e.exports=(e,t)=>{e=new i(e,t);let r=new n("0.0.0");if(e.test(r))return r;if(r=new n("0.0.0-0"),e.test(r))return r;r=null;for(let t=0;t{const t=new n(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":a&&!o(t,a)||(a=t);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}})),!a||r&&!o(r,a)||(r=a)}return r&&e.test(r)?r:null}},97075:(e,t,r)=>{const n=r(53908),i=r(93904),{ANY:o}=i,a=r(78311),s=r(97638),l=r(35580),c=r(7059),u=r(25200),d=r(54089);e.exports=(e,t,r,h)=>{let p,f,m,g,v;switch(e=new n(e,h),t=new a(t,h),r){case">":p=l,f=u,m=c,g=">",v=">=";break;case"<":p=c,f=d,m=l,g="<",v="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(s(e,t,h))return!1;for(let r=0;r{e.semver===o&&(e=new i(">=0.0.0")),a=a||e,s=s||e,p(e.semver,a.semver,h)?a=e:m(e.semver,s.semver,h)&&(s=e)})),a.operator===g||a.operator===v)return!1;if((!s.operator||s.operator===g)&&f(e,s.semver))return!1;if(s.operator===v&&m(e,s.semver))return!1}return!0}},72525:(e,t,r)=>{const n=r(97638),i=r(50560);e.exports=(e,t,r)=>{const o=[];let a=null,s=null;const l=e.sort(((e,t)=>i(e,t,r)));for(const e of l)n(e,t,r)?(s=e,a||(a=e)):(s&&o.push([a,s]),s=null,a=null);a&&o.push([a,null]);const c=[];for(const[e,t]of o)e===t?c.push(e):t||e!==l[0]?t?e===l[0]?c.push(`<=${t}`):c.push(`${e} - ${t}`):c.push(`>=${e}`):c.push("*");const u=c.join(" || "),d="string"==typeof t.raw?t.raw:String(t);return u.length{const n=r(78311),i=r(93904),{ANY:o}=i,a=r(97638),s=r(50560),l=[new i(">=0.0.0-0")],c=[new i(">=0.0.0")],u=(e,t,r)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===o){if(1===t.length&&t[0].semver===o)return!0;e=r.includePrerelease?l:c}if(1===t.length&&t[0].semver===o){if(r.includePrerelease)return!0;t=c}const n=new Set;let i,u,p,f,m,g,v;for(const t of e)">"===t.operator||">="===t.operator?i=d(i,t,r):"<"===t.operator||"<="===t.operator?u=h(u,t,r):n.add(t.semver);if(n.size>1)return null;if(i&&u){if(p=s(i.semver,u.semver,r),p>0)return null;if(0===p&&(">="!==i.operator||"<="!==u.operator))return null}for(const e of n){if(i&&!a(e,String(i),r))return null;if(u&&!a(e,String(u),r))return null;for(const n of t)if(!a(e,String(n),r))return!1;return!0}let y=!(!u||r.includePrerelease||!u.semver.prerelease.length)&&u.semver,b=!(!i||r.includePrerelease||!i.semver.prerelease.length)&&i.semver;y&&1===y.prerelease.length&&"<"===u.operator&&0===y.prerelease[0]&&(y=!1);for(const e of t){if(v=v||">"===e.operator||">="===e.operator,g=g||"<"===e.operator||"<="===e.operator,i)if(b&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===b.major&&e.semver.minor===b.minor&&e.semver.patch===b.patch&&(b=!1),">"===e.operator||">="===e.operator){if(f=d(i,e,r),f===e&&f!==i)return!1}else if(">="===i.operator&&!a(i.semver,String(e),r))return!1;if(u)if(y&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===y.major&&e.semver.minor===y.minor&&e.semver.patch===y.patch&&(y=!1),"<"===e.operator||"<="===e.operator){if(m=h(u,e,r),m===e&&m!==u)return!1}else if("<="===u.operator&&!a(u.semver,String(e),r))return!1;if(!e.operator&&(u||i)&&0!==p)return!1}return!(i&&g&&!u&&0!==p||u&&v&&!i&&0!==p||b||y)},d=(e,t,r)=>{if(!e)return t;const n=s(e.semver,t.semver,r);return n>0?e:n<0||">"===t.operator&&">="===e.operator?t:e},h=(e,t,r)=>{if(!e)return t;const n=s(e.semver,t.semver,r);return n<0?e:n>0||"<"===t.operator&&"<="===e.operator?t:e};e.exports=(e,t,r={})=>{if(e===t)return!0;e=new n(e,r),t=new n(t,r);let i=!1;e:for(const n of e.set){for(const e of t.set){const t=u(n,e,r);if(i=i||null!==t,t)continue e}if(i)return!1}return!0}},77631:(e,t,r)=>{const n=r(78311);e.exports=(e,t)=>new n(e,t).set.map((e=>e.map((e=>e.value)).join(" ").trim().split(" ")))},13874:(e,t,r)=>{const n=r(78311);e.exports=(e,t)=>{try{return new n(e,t).range||"*"}catch(e){return null}}},58887:function(e,t,r){var n,i,o;!function(a,s){"use strict";i=[r(40343)],n=function(e){return{backtrace:function(t){var r=[],n=10;"object"==typeof t&&"number"==typeof t.maxStackSize&&(n=t.maxStackSize);for(var i=arguments.callee;i&&r.length{var n=r(3835),i=Object.prototype.hasOwnProperty;function o(){this._array=[],this._set=Object.create(null)}o.fromArray=function(e,t){for(var r=new o,n=0,i=e.length;n=0&&e{var n=r(79900);t.encode=function(e){var t,r="",i=function(e){return e<0?1+(-e<<1):0+(e<<1)}(e);do{t=31&i,(i>>>=5)>0&&(t|=32),r+=n.encode(t)}while(i>0);return r},t.decode=function(e,t,r){var i,o,a,s,l=e.length,c=0,u=0;do{if(t>=l)throw new Error("Expected more digits in base 64 VLQ value.");if(-1===(o=n.decode(e.charCodeAt(t++))))throw new Error("Invalid base64 digit: "+e.charAt(t-1));i=!!(32&o),c+=(o&=31)<>1,1&~a?s:-s),r.rest=t}},79900:(e,t)=>{var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");t.encode=function(e){if(0<=e&&e{function r(e,n,i,o,a,s){var l=Math.floor((n-e)/2)+e,c=a(i,o[l],!0);return 0===c?l:c>0?n-l>1?r(l,n,i,o,a,s):s==t.LEAST_UPPER_BOUND?n1?r(e,l,i,o,a,s):s==t.LEAST_UPPER_BOUND?l:e<0?-1:e}t.GREATEST_LOWER_BOUND=1,t.LEAST_UPPER_BOUND=2,t.search=function(e,n,i,o){if(0===n.length)return-1;var a=r(-1,n.length,e,n,i,o||t.GREATEST_LOWER_BOUND);if(a<0)return-1;for(;a-1>=0&&0===i(n[a],n[a-1],!0);)--a;return a}},17238:(e,t,r)=>{var n=r(3835);function i(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}i.prototype.unsortedForEach=function(e,t){this._array.forEach(e,t)},i.prototype.add=function(e){var t,r,i,o,a,s;r=e,i=(t=this._last).generatedLine,o=r.generatedLine,a=t.generatedColumn,s=r.generatedColumn,o>i||o==i&&s>=a||n.compareByGeneratedPositionsInflated(t,r)<=0?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))},i.prototype.toArray=function(){return this._sorted||(this._array.sort(n.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},t.P=i},61737:(e,t)=>{function r(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function n(e,t,i,o){if(i{var n=r(3835),i=r(55035),o=r(50671).C,a=r(11860),s=r(61737).g;function l(e){var t=e;return"string"==typeof e&&(t=JSON.parse(e.replace(/^\)\]\}'/,""))),null!=t.sections?new d(t):new c(t)}function c(e){var t=e;"string"==typeof e&&(t=JSON.parse(e.replace(/^\)\]\}'/,"")));var r=n.getArg(t,"version"),i=n.getArg(t,"sources"),a=n.getArg(t,"names",[]),s=n.getArg(t,"sourceRoot",null),l=n.getArg(t,"sourcesContent",null),c=n.getArg(t,"mappings"),u=n.getArg(t,"file",null);if(r!=this._version)throw new Error("Unsupported version: "+r);i=i.map(String).map(n.normalize).map((function(e){return s&&n.isAbsolute(s)&&n.isAbsolute(e)?n.relative(s,e):e})),this._names=o.fromArray(a.map(String),!0),this._sources=o.fromArray(i,!0),this.sourceRoot=s,this.sourcesContent=l,this._mappings=c,this.file=u}function u(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}function d(e){var t=e;"string"==typeof e&&(t=JSON.parse(e.replace(/^\)\]\}'/,"")));var r=n.getArg(t,"version"),i=n.getArg(t,"sections");if(r!=this._version)throw new Error("Unsupported version: "+r);this._sources=new o,this._names=new o;var a={line:-1,column:0};this._sections=i.map((function(e){if(e.url)throw new Error("Support for url field in sections not implemented.");var t=n.getArg(e,"offset"),r=n.getArg(t,"line"),i=n.getArg(t,"column");if(r=0){var s=this._originalMappings[a];if(void 0===e.column)for(var l=s.originalLine;s&&s.originalLine===l;)o.push({line:n.getArg(s,"generatedLine",null),column:n.getArg(s,"generatedColumn",null),lastColumn:n.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++a];else for(var c=s.originalColumn;s&&s.originalLine===t&&s.originalColumn==c;)o.push({line:n.getArg(s,"generatedLine",null),column:n.getArg(s,"generatedColumn",null),lastColumn:n.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++a]}return o},t.SourceMapConsumer=l,c.prototype=Object.create(l.prototype),c.prototype.consumer=l,c.fromSourceMap=function(e){var t=Object.create(c.prototype),r=t._names=o.fromArray(e._names.toArray(),!0),i=t._sources=o.fromArray(e._sources.toArray(),!0);t.sourceRoot=e._sourceRoot,t.sourcesContent=e._generateSourcesContent(t._sources.toArray(),t.sourceRoot),t.file=e._file;for(var a=e._mappings.toArray().slice(),l=t.__generatedMappings=[],d=t.__originalMappings=[],h=0,p=a.length;h1&&(r.source=m+o[1],m+=o[1],r.originalLine=p+o[2],p=r.originalLine,r.originalLine+=1,r.originalColumn=f+o[3],f=r.originalColumn,o.length>4&&(r.name=g+o[4],g+=o[4])),w.push(r),"number"==typeof r.originalLine&&S.push(r)}s(w,n.compareByGeneratedPositionsDeflated),this.__generatedMappings=w,s(S,n.compareByOriginalPositions),this.__originalMappings=S},c.prototype._findMapping=function(e,t,r,n,o,a){if(e[r]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[r]);if(e[n]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[n]);return i.search(e,t,o,a)},c.prototype.computeColumnSpans=function(){for(var e=0;e=0){var i=this._generatedMappings[r];if(i.generatedLine===t.generatedLine){var o=n.getArg(i,"source",null);null!==o&&(o=this._sources.at(o),null!=this.sourceRoot&&(o=n.join(this.sourceRoot,o)));var a=n.getArg(i,"name",null);return null!==a&&(a=this._names.at(a)),{source:o,line:n.getArg(i,"originalLine",null),column:n.getArg(i,"originalColumn",null),name:a}}}return{source:null,line:null,column:null,name:null}},c.prototype.hasContentsOfAllSources=function(){return!!this.sourcesContent&&this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some((function(e){return null==e}))},c.prototype.sourceContentFor=function(e,t){if(!this.sourcesContent)return null;if(null!=this.sourceRoot&&(e=n.relative(this.sourceRoot,e)),this._sources.has(e))return this.sourcesContent[this._sources.indexOf(e)];var r;if(null!=this.sourceRoot&&(r=n.urlParse(this.sourceRoot))){var i=e.replace(/^file:\/\//,"");if("file"==r.scheme&&this._sources.has(i))return this.sourcesContent[this._sources.indexOf(i)];if((!r.path||"/"==r.path)&&this._sources.has("/"+e))return this.sourcesContent[this._sources.indexOf("/"+e)]}if(t)return null;throw new Error('"'+e+'" is not in the SourceMap.')},c.prototype.generatedPositionFor=function(e){var t=n.getArg(e,"source");if(null!=this.sourceRoot&&(t=n.relative(this.sourceRoot,t)),!this._sources.has(t))return{line:null,column:null,lastColumn:null};var r={source:t=this._sources.indexOf(t),originalLine:n.getArg(e,"line"),originalColumn:n.getArg(e,"column")},i=this._findMapping(r,this._originalMappings,"originalLine","originalColumn",n.compareByOriginalPositions,n.getArg(e,"bias",l.GREATEST_LOWER_BOUND));if(i>=0){var o=this._originalMappings[i];if(o.source===r.source)return{line:n.getArg(o,"generatedLine",null),column:n.getArg(o,"generatedColumn",null),lastColumn:n.getArg(o,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},d.prototype=Object.create(l.prototype),d.prototype.constructor=l,d.prototype._version=3,Object.defineProperty(d.prototype,"sources",{get:function(){for(var e=[],t=0;t{var n=r(11860),i=r(3835),o=r(50671).C,a=r(17238).P;function s(e){e||(e={}),this._file=i.getArg(e,"file",null),this._sourceRoot=i.getArg(e,"sourceRoot",null),this._skipValidation=i.getArg(e,"skipValidation",!1),this._sources=new o,this._names=new o,this._mappings=new a,this._sourcesContents=null}s.prototype._version=3,s.fromSourceMap=function(e){var t=e.sourceRoot,r=new s({file:e.file,sourceRoot:t});return e.eachMapping((function(e){var n={generated:{line:e.generatedLine,column:e.generatedColumn}};null!=e.source&&(n.source=e.source,null!=t&&(n.source=i.relative(t,n.source)),n.original={line:e.originalLine,column:e.originalColumn},null!=e.name&&(n.name=e.name)),r.addMapping(n)})),e.sources.forEach((function(t){var n=e.sourceContentFor(t);null!=n&&r.setSourceContent(t,n)})),r},s.prototype.addMapping=function(e){var t=i.getArg(e,"generated"),r=i.getArg(e,"original",null),n=i.getArg(e,"source",null),o=i.getArg(e,"name",null);this._skipValidation||this._validateMapping(t,r,n,o),null!=n&&(n=String(n),this._sources.has(n)||this._sources.add(n)),null!=o&&(o=String(o),this._names.has(o)||this._names.add(o)),this._mappings.add({generatedLine:t.line,generatedColumn:t.column,originalLine:null!=r&&r.line,originalColumn:null!=r&&r.column,source:n,name:o})},s.prototype.setSourceContent=function(e,t){var r=e;null!=this._sourceRoot&&(r=i.relative(this._sourceRoot,r)),null!=t?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[i.toSetString(r)]=t):this._sourcesContents&&(delete this._sourcesContents[i.toSetString(r)],0===Object.keys(this._sourcesContents).length&&(this._sourcesContents=null))},s.prototype.applySourceMap=function(e,t,r){var n=t;if(null==t){if(null==e.file)throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');n=e.file}var a=this._sourceRoot;null!=a&&(n=i.relative(a,n));var s=new o,l=new o;this._mappings.unsortedForEach((function(t){if(t.source===n&&null!=t.originalLine){var o=e.originalPositionFor({line:t.originalLine,column:t.originalColumn});null!=o.source&&(t.source=o.source,null!=r&&(t.source=i.join(r,t.source)),null!=a&&(t.source=i.relative(a,t.source)),t.originalLine=o.line,t.originalColumn=o.column,null!=o.name&&(t.name=o.name))}var c=t.source;null==c||s.has(c)||s.add(c);var u=t.name;null==u||l.has(u)||l.add(u)}),this),this._sources=s,this._names=l,e.sources.forEach((function(t){var n=e.sourceContentFor(t);null!=n&&(null!=r&&(t=i.join(r,t)),null!=a&&(t=i.relative(a,t)),this.setSourceContent(t,n))}),this)},s.prototype._validateMapping=function(e,t,r,n){if((!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0)||t||r||n)&&!(e&&"line"in e&&"column"in e&&t&&"line"in t&&"column"in t&&e.line>0&&e.column>=0&&t.line>0&&t.column>=0&&r))throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:r,original:t,name:n}))},s.prototype._serializeMappings=function(){for(var e,t,r,o,a=0,s=1,l=0,c=0,u=0,d=0,h="",p=this._mappings.toArray(),f=0,m=p.length;f0){if(!i.compareByGeneratedPositionsInflated(t,p[f-1]))continue;e+=","}e+=n.encode(t.generatedColumn-a),a=t.generatedColumn,null!=t.source&&(o=this._sources.indexOf(t.source),e+=n.encode(o-d),d=o,e+=n.encode(t.originalLine-1-c),c=t.originalLine-1,e+=n.encode(t.originalColumn-l),l=t.originalColumn,null!=t.name&&(r=this._names.indexOf(t.name),e+=n.encode(r-u),u=r)),h+=e}return h},s.prototype._generateSourcesContent=function(e,t){return e.map((function(e){if(!this._sourcesContents)return null;null!=t&&(e=i.relative(t,e));var r=i.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,r)?this._sourcesContents[r]:null}),this)},s.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(e.file=this._file),null!=this._sourceRoot&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e},s.prototype.toString=function(){return JSON.stringify(this.toJSON())},t.SourceMapGenerator=s},51171:(e,t,r)=>{var n=r(51945).SourceMapGenerator,i=r(3835),o=/(\r?\n)/,a="$$$isSourceNode$$$";function s(e,t,r,n,i){this.children=[],this.sourceContents={},this.line=null==e?null:e,this.column=null==t?null:t,this.source=null==r?null:r,this.name=null==i?null:i,this[a]=!0,null!=n&&this.add(n)}s.fromStringWithSourceMap=function(e,t,r){var n=new s,a=e.split(o),l=function(){return a.shift()+(a.shift()||"")},c=1,u=0,d=null;return t.eachMapping((function(e){if(null!==d){if(!(c0&&(d&&h(d,l()),n.add(a.join(""))),t.sources.forEach((function(e){var o=t.sourceContentFor(e);null!=o&&(null!=r&&(e=i.join(r,e)),n.setSourceContent(e,o))})),n;function h(e,t){if(null===e||void 0===e.source)n.add(t);else{var o=r?i.join(r,e.source):e.source;n.add(new s(e.originalLine,e.originalColumn,o,t,e.name))}}},s.prototype.add=function(e){if(Array.isArray(e))e.forEach((function(e){this.add(e)}),this);else{if(!e[a]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);e&&this.children.push(e)}return this},s.prototype.prepend=function(e){if(Array.isArray(e))for(var t=e.length-1;t>=0;t--)this.prepend(e[t]);else{if(!e[a]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);this.children.unshift(e)}return this},s.prototype.walk=function(e){for(var t,r=0,n=this.children.length;r0){for(t=[],r=0;r{t.getArg=function(e,t,r){if(t in e)return e[t];if(3===arguments.length)return r;throw new Error('"'+t+'" is a required argument.')};var r=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/,n=/^data:.+\,.+$/;function i(e){var t=e.match(r);return t?{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}:null}function o(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}function a(e){var r=e,n=i(e);if(n){if(!n.path)return e;r=n.path}for(var a,s=t.isAbsolute(r),l=r.split(/\/+/),c=0,u=l.length-1;u>=0;u--)"."===(a=l[u])?l.splice(u,1):".."===a?c++:c>0&&(""===a?(l.splice(u+1,c),c=0):(l.splice(u,2),c--));return""===(r=l.join("/"))&&(r=s?"/":"."),n?(n.path=r,o(n)):r}t.urlParse=i,t.urlGenerate=o,t.normalize=a,t.join=function(e,t){""===e&&(e="."),""===t&&(t=".");var r=i(t),s=i(e);if(s&&(e=s.path||"/"),r&&!r.scheme)return s&&(r.scheme=s.scheme),o(r);if(r||t.match(n))return t;if(s&&!s.host&&!s.path)return s.host=t,o(s);var l="/"===t.charAt(0)?t:a(e.replace(/\/+$/,"")+"/"+t);return s?(s.path=l,o(s)):l},t.isAbsolute=function(e){return"/"===e.charAt(0)||!!e.match(r)},t.relative=function(e,t){""===e&&(e="."),e=e.replace(/\/$/,"");for(var r=0;0!==t.indexOf(e+"/");){var n=e.lastIndexOf("/");if(n<0)return t;if((e=e.slice(0,n)).match(/^([^\/]+:\/)?\/*$/))return t;++r}return Array(r+1).join("../")+t.substr(e.length+1)};var s=!("__proto__"in Object.create(null));function l(e){return e}function c(e){if(!e)return!1;var t=e.length;if(t<9)return!1;if(95!==e.charCodeAt(t-1)||95!==e.charCodeAt(t-2)||111!==e.charCodeAt(t-3)||116!==e.charCodeAt(t-4)||111!==e.charCodeAt(t-5)||114!==e.charCodeAt(t-6)||112!==e.charCodeAt(t-7)||95!==e.charCodeAt(t-8)||95!==e.charCodeAt(t-9))return!1;for(var r=t-10;r>=0;r--)if(36!==e.charCodeAt(r))return!1;return!0}function u(e,t){return e===t?0:e>t?1:-1}t.toSetString=s?l:function(e){return c(e)?"$"+e:e},t.fromSetString=s?l:function(e){return c(e)?e.slice(1):e},t.compareByOriginalPositions=function(e,t,r){var n=e.source-t.source;return 0!==n||0!=(n=e.originalLine-t.originalLine)||0!=(n=e.originalColumn-t.originalColumn)||r||0!=(n=e.generatedColumn-t.generatedColumn)||0!=(n=e.generatedLine-t.generatedLine)?n:e.name-t.name},t.compareByGeneratedPositionsDeflated=function(e,t,r){var n=e.generatedLine-t.generatedLine;return 0!==n||0!=(n=e.generatedColumn-t.generatedColumn)||r||0!=(n=e.source-t.source)||0!=(n=e.originalLine-t.originalLine)||0!=(n=e.originalColumn-t.originalColumn)?n:e.name-t.name},t.compareByGeneratedPositionsInflated=function(e,t){var r=e.generatedLine-t.generatedLine;return 0!==r||0!=(r=e.generatedColumn-t.generatedColumn)||0!==(r=u(e.source,t.source))||0!=(r=e.originalLine-t.originalLine)||0!=(r=e.originalColumn-t.originalColumn)?r:u(e.name,t.name)}},20065:(e,t,r)=>{t.SourceMapGenerator=r(51945).SourceMapGenerator,t.SourceMapConsumer=r(41606).SourceMapConsumer,t.SourceNode=r(51171).SourceNode},17885:function(e,t,r){var n,i,o;!function(a,s){"use strict";i=[r(20065),r(40343)],void 0===(o="function"==typeof(n=function(e,t){function r(e){return new Promise((function(t,r){var n=new XMLHttpRequest;n.open("get",e),n.onerror=r,n.onreadystatechange=function(){4===n.readyState&&(n.status>=200&&n.status<300||"file://"===e.substr(0,7)&&n.responseText?t(n.responseText):r(new Error("HTTP status: "+n.status+" retrieving "+e)))},n.send()}))}function n(e){if("undefined"!=typeof window&&window.atob)return window.atob(e);throw new Error("You must supply a polyfill for window.atob in this environment")}function i(e){if("object"!=typeof e)throw new TypeError("Given StackFrame is not an object");if("string"!=typeof e.fileName)throw new TypeError("Given file name is not a String");if("number"!=typeof e.lineNumber||e.lineNumber%1!=0||e.lineNumber<1)throw new TypeError("Given line number must be a positive integer");if("number"!=typeof e.columnNumber||e.columnNumber%1!=0||e.columnNumber<0)throw new TypeError("Given column number must be a non-negative integer");return!0}return function o(a){if(!(this instanceof o))return new o(a);a=a||{},this.sourceCache=a.sourceCache||{},this.sourceMapConsumerCache=a.sourceMapConsumerCache||{},this.ajax=a.ajax||r,this._atob=a.atob||n,this._get=function(e){return new Promise(function(t,r){var n="data:"===e.substr(0,5);if(this.sourceCache[e])t(this.sourceCache[e]);else if(a.offline&&!n)r(new Error("Cannot make network requests in offline mode"));else if(n){var i=e.match(/^data:application\/json;([\w=:"-]+;)*base64,/);if(i){var o=i[0].length,s=e.substr(o),l=this._atob(s);this.sourceCache[e]=l,t(l)}else r(new Error("The encoding of the inline sourcemap is not supported"))}else{var c=this.ajax(e,{method:"get"});this.sourceCache[e]=c,c.then(t,r)}}.bind(this))},this._getSourceMapConsumer=function(t,r){return new Promise(function(n){if(this.sourceMapConsumerCache[t])n(this.sourceMapConsumerCache[t]);else{var i=new Promise(function(n,i){return this._get(t).then((function(t){"string"==typeof t&&(t=function(e){if("undefined"!=typeof JSON&&JSON.parse)return JSON.parse(e);throw new Error("You must supply a polyfill for JSON.parse in this environment")}(t.replace(/^\)\]\}'/,""))),void 0===t.sourceRoot&&(t.sourceRoot=r),n(new e.SourceMapConsumer(t))})).catch(i)}.bind(this));this.sourceMapConsumerCache[t]=i,n(i)}}.bind(this))},this.pinpoint=function(e){return new Promise(function(t,r){this.getMappedLocation(e).then(function(e){function r(){t(e)}this.findFunctionName(e).then(t,r).catch(r)}.bind(this),r)}.bind(this))},this.findFunctionName=function(e){return new Promise(function(r,n){i(e),this._get(e.fileName).then((function(n){var i=e.lineNumber,o=e.columnNumber,a=function(e,t){for(var r=[/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*function\b/,/function\s+([^('"`]*?)\s*\(([^)]*)\)/,/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*(?:eval|new Function)\b/,/\b(?!(?:if|for|switch|while|with|catch)\b)(?:(?:static)\s+)?(\S+)\s*\(.*?\)\s*\{/,/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*\(.*?\)\s*=>/],n=e.split("\n"),i="",o=Math.min(t,20),a=0;a=0&&(s=s.substr(0,l)),s){i=s+i;for(var c=r.length,u=0;u=200&&a.status<400?i(a.responseText):o(new Error("POST to "+t+" failed with status: "+a.status)))},a.open("post",t),a.setRequestHeader("Content-Type","application/json"),n&&"object"==typeof n.headers){var s=n.headers;for(var l in s)Object.prototype.hasOwnProperty.call(s,l)&&a.setRequestHeader(l,s[l])}var c={stack:e};null!=r&&(c.message=r),a.send(JSON.stringify(c))}))}}},void 0===(o=n.apply(t,i))||(e.exports=o)}()},65103:(e,t,r)=>{"use strict";var n=r(93015);function i(e){return e&&e.__esModule?e:{default:e}}var o=i(r(20181));function a(e){const[t,r]=n.useState(!!e),i=n.useCallback((()=>{r(!0)}),[]),o=n.useCallback((()=>{r(!1)}),[]),a=n.useCallback((()=>{r((e=>!e))}),[]);return{value:t,setValue:r,setTrue:i,setFalse:o,toggle:a}}var s="undefined"!=typeof window?n.useLayoutEffect:n.useEffect;function l(e,t,r,i){const o=n.useRef(t);s((()=>{o.current=t}),[t]),n.useEffect((()=>{const t=(null==r?void 0:r.current)??window;if(!t||!t.addEventListener)return;const n=e=>{o.current(e)};return t.addEventListener(e,n,i),()=>{t.removeEventListener(e,n,i)}}),[e,r,i])}function c(e){const[t,r]=n.useState(e??0);return{count:t,increment:()=>{r((e=>e+1))},decrement:()=>{r((e=>e-1))},reset:()=>{r(e??0)},setCount:r}}function u(e,t){const r=n.useRef(e);s((()=>{r.current=e}),[e]),n.useEffect((()=>{if(null===t)return;const e=setInterval((()=>{r.current()}),t);return()=>{clearInterval(e)}}),[t])}function d(e){const t=n.useRef((()=>{throw new Error("Cannot call an event handler while rendering.")}));return s((()=>{t.current=e}),[e]),n.useCallback(((...e)=>t.current(...e)),[t])}var h="undefined"==typeof window;function p(e,t,r={}){const{initializeWithValue:i=!0}=r,o=n.useCallback((e=>r.serializer?r.serializer(e):JSON.stringify(e)),[r]),a=n.useCallback((e=>{if(r.deserializer)return r.deserializer(e);if("undefined"===e)return;const n=t instanceof Function?t():t;let i;try{i=JSON.parse(e)}catch(e){return console.error("Error parsing JSON:",e),n}return i}),[r,t]),s=n.useCallback((()=>{const r=t instanceof Function?t():t;if(h)return r;try{const t=window.localStorage.getItem(e);return t?a(t):r}catch(t){return console.warn(`Error reading localStorage key “${e}”:`,t),r}}),[t,e,a]),[c,u]=n.useState((()=>i?s():t instanceof Function?t():t)),p=d((t=>{h&&console.warn(`Tried setting localStorage key “${e}” even though environment is not a client`);try{const r=t instanceof Function?t(s()):t;window.localStorage.setItem(e,o(r)),u(r),window.dispatchEvent(new StorageEvent("local-storage",{key:e}))}catch(t){console.warn(`Error setting localStorage key “${e}”:`,t)}}));n.useEffect((()=>{u(s())}),[e]);const f=n.useCallback((t=>{(null==t?void 0:t.key)&&t.key!==e||u(s())}),[e,s]);return l("storage",f),l("local-storage",f),[c,p]}var f="undefined"==typeof window;function m(e,t){const r="boolean"==typeof t?t:(null==t?void 0:t.defaultValue)??!1,i="boolean"==typeof t?void 0:(null==t?void 0:t.initializeWithValue)??void 0,o=e=>f?r:window.matchMedia(e).matches,[a,l]=n.useState((()=>i?o(e):r));function c(){l(o(e))}return s((()=>{const t=window.matchMedia(e);return c(),t.addListener?t.addListener(c):t.addEventListener("change",c),()=>{t.removeListener?t.removeListener(c):t.removeEventListener("change",c)}}),[e]),a}var g="usehooks-ts-dark-mode";function v(e){const t=n.useRef(e);t.current=e,n.useEffect((()=>()=>{t.current()}),[])}function y(e,t=500,r){const i=n.useRef();v((()=>{i.current&&i.current.cancel()}));const a=n.useMemo((()=>{const n=o.default(e,t,r),a=(...e)=>n(...e);return a.cancel=()=>{n.cancel()},a.isPending=()=>!!i.current,a.flush=()=>n.flush(),a}),[e,t,r]);return n.useEffect((()=>{i.current=o.default(e,t,r)}),[e,t,r]),a}function b(){const e=n.useRef(!0);return e.current?(e.current=!1,!0):e.current}function _(){const e=n.useRef(!1);return n.useEffect((()=>(e.current=!0,()=>{e.current=!1})),[]),n.useCallback((()=>e.current),[])}var S="undefined"==typeof window,w={width:void 0,height:void 0};function E(e,t,r){return e[t]?Array.isArray(e[t])?e[t][0][r]:e[t][r]:"contentBoxSize"===t?e.contentRect["inlineSize"===r?"width":"height"]:void 0}var C="undefined"==typeof window,O=new Map,P="undefined"==typeof window,T="undefined"==typeof window,k="undefined"==typeof window;t.useBoolean=a,t.useClickAnyWhere=function(e){l("click",(t=>{e(t)}))},t.useCopyToClipboard=function(){const[e,t]=n.useState(null);return[e,n.useCallback((async e=>{if(!(null==navigator?void 0:navigator.clipboard))return console.warn("Clipboard not supported"),!1;try{return await navigator.clipboard.writeText(e),t(e),!0}catch(e){return console.warn("Copy failed",e),t(null),!1}}),[])]},t.useCountdown=function(e){let t,r,i,o,s=!1;"seconds"in e?(console.warn("[useCountdown:DEPRECATED] new interface is already available (see https://usehooks-ts.com/react-hook/use-countdown), the old version will retire on usehooks-ts@3."),s=!0,t=e.seconds,r=e.interval,i=e.isIncrement):({countStart:t,intervalMs:r,isIncrement:i,countStop:o}=e),r=r??1e3,i=i??!1,o=o??0;const{count:l,increment:d,decrement:h,reset:p}=c(t),{value:f,setTrue:m,setFalse:g}=a(!1),v=()=>{g(),p()};return u(n.useCallback((()=>{l!==o?i?d():h():g()}),[l,o,h,d,i,g]),f?r:null),s?[l,{start:m,stop:g,reset:v}]:[l,{startCountdown:m,stopCountdown:g,resetCountdown:v}]},t.useCounter=c,t.useDarkMode=function(e,t=g){n.useRef(0).current++;const r="boolean"==typeof e?e:null==e?void 0:e.defaultValue,i="boolean"==typeof e?t??g:(null==e?void 0:e.localStorageKey)??g,o="boolean"==typeof e?void 0:(null==e?void 0:e.initializeWithValue)??void 0,a=m("(prefers-color-scheme: dark)",{initializeWithValue:o,defaultValue:r}),[l,c]=p(i,r??a??!1,{initializeWithValue:o});return s((()=>{a!==l&&c(a)}),[a]),{isDarkMode:l,toggle:()=>{c((e=>!e))},enable:()=>{c(!0)},disable:()=>{c(!1)},set:e=>{c(e)}}},t.useDebounce=function(e,t){const[r,i]=n.useState(e);return n.useEffect((()=>{const r=setTimeout((()=>{i(e)}),t??500);return()=>{clearTimeout(r)}}),[e,t]),r},t.useDebounceCallback=y,t.useDebounceValue=function(e,t,r){const i=(null==r?void 0:r.equalityFn)??((e,t)=>e===t),o=e instanceof Function?e():e,[a,s]=n.useState(o),l=n.useRef(o),c=y(s,t,r);return i(l.current,o)||(c(o),l.current=o),[a,c]},t.useDocumentTitle=function(e,t={}){const{preserveTitleOnUnmount:r=!0}=t,i=n.useRef(null);s((()=>{i.current=window.document.title}),[]),s((()=>{window.document.title=e}),[e]),v((()=>{!r&&i.current&&(window.document.title=i.current)}))},t.useEffectOnce=function(e){n.useEffect(e,[])},t.useElementSize=function(e={}){const{initializeWithValue:t=!0}=e,[r,i]=n.useState(null),o=n.useCallback((()=>({width:(null==r?void 0:r.offsetWidth)??void 0,height:(null==r?void 0:r.offsetHeight)??void 0})),[null==r?void 0:r.offsetHeight,null==r?void 0:r.offsetWidth]),[a,c]=n.useState((()=>t?o():{width:void 0,height:void 0})),u=n.useCallback((()=>{c(o())}),[null==r?void 0:r.offsetHeight,null==r?void 0:r.offsetWidth]);l("resize",u),s((()=>{u()}),[null==r?void 0:r.offsetHeight,null==r?void 0:r.offsetWidth]);const d=[i,a];return d.ref=d[0],d.width=a.width,d.height=a.height,d},t.useEventCallback=d,t.useEventListener=l,t.useFetch=function(e,t){const r=n.useRef({}),i=n.useRef(!1),o={error:void 0,data:void 0},[a,s]=n.useReducer(((e,t)=>{switch(t.type){case"loading":return{...o};case"fetched":return{...o,data:t.payload};case"error":return{...o,error:t.payload};default:return e}}),o);return n.useEffect((()=>{if(e)return i.current=!1,(async()=>{s({type:"loading"});const n=r.current[e];if(n)s({type:"fetched",payload:n});else try{const n=await fetch(e,t);if(!n.ok)throw new Error(n.statusText);const o=await n.json();if(r.current[e]=o,i.current)return;s({type:"fetched",payload:o})}catch(e){if(i.current)return;s({type:"error",payload:e})}})(),()=>{i.current=!0}}),[e]),a},t.useHover=function(e){const[t,r]=n.useState(!1);return l("mouseenter",(()=>{r(!0)}),e),l("mouseleave",(()=>{r(!1)}),e),t},t.useImageOnLoad=function(){const[e,t]=n.useState(!1);return{handleImageOnLoad:()=>{t(!0)},css:{thumbnail:{visibility:e?"hidden":"visible",filter:"blur(8px)",transition:"visibility 0ms ease-out 500ms"},fullSize:{opacity:e?1:0,transition:"opacity 500ms ease-in 0ms"}}}},t.useIntersectionObserver=function(e,t){var r;const i="current"in e,o=i?t:e,{threshold:a=0,root:s=null,rootMargin:l="0%",freezeOnceVisible:c=!1,initialIsIntersecting:u=!1}=o??{},[d,h]=n.useState(null),p=i?e.current:d,[f,m]=n.useState((()=>({isIntersecting:u,entry:void 0}))),g=n.useRef();g.current=null==o?void 0:o.onChange;const v=(null==(r=f.entry)?void 0:r.isIntersecting)&&c;n.useEffect((()=>{if(!p)return;if(!("IntersectionObserver"in window))return;if(v)return;let e;const t=new IntersectionObserver((r=>{const n=Array.isArray(t.thresholds)?t.thresholds:[t.thresholds];r.forEach((t=>{const r=t.isIntersecting&&n.some((e=>t.intersectionRatio>=e));m({isIntersecting:r,entry:t}),g.current&&g.current(r,t),r&&c&&e&&(e(),e=void 0)}))}),{threshold:a,root:s,rootMargin:l});return t.observe(p),()=>{t.disconnect()}}),[p,JSON.stringify(a),s,l,v,c]);const y=n.useRef(null);if(n.useEffect((()=>{var e;p||!(null==(e=f.entry)?void 0:e.target)||c||v||y.current===f.entry.target||(y.current=f.entry.target,m({isIntersecting:u,entry:void 0}))}),[p,f.entry,c,v,u]),i)return f.entry;const b=[h,!!f.isIntersecting,f.entry];return b.ref=b[0],b.isIntersecting=b[1],b.entry=b[2],b},t.useInterval=u,t.useIsClient=function(){const[e,t]=n.useState(!1);return n.useEffect((()=>{t(!0)}),[]),e},t.useIsFirstRender=b,t.useIsMounted=_,t.useIsomorphicLayoutEffect=s,t.useLocalStorage=p,t.useLockedBody=function(e=!1,t="___gatsby"){const[r,i]=n.useState(e);return s((()=>{if(!r)return;const e=document.body.style.overflow,n=document.body.style.paddingRight;document.body.style.overflow="hidden";const i=document.getElementById(t),o=i?i.offsetWidth-i.scrollWidth:0;return o&&(document.body.style.paddingRight=`${o}px`),()=>{document.body.style.overflow=e,o&&(document.body.style.paddingRight=n)}}),[r]),n.useEffect((()=>{r!==e&&i(e)}),[e]),[r,i]},t.useMap=function(e=new Map){const[t,r]=n.useState(new Map(e));return[t,{set:n.useCallback(((e,t)=>{r((r=>{const n=new Map(r);return n.set(e,t),n}))}),[]),setAll:n.useCallback((e=>{r((()=>new Map(e)))}),[]),remove:n.useCallback((e=>{r((t=>{const r=new Map(t);return r.delete(e),r}))}),[]),reset:n.useCallback((()=>{r((()=>new Map))}),[])}]},t.useMediaQuery=m,t.useOnClickOutside=function(e,t,r="mousedown"){l(r,(r=>{const n=r.target;n&&n.isConnected&&(Array.isArray(e)?e.every((e=>e.current&&!e.current.contains(n))):e.current&&!e.current.contains(n))&&t(r)}))},t.useReadLocalStorage=function(e,t={}){let{initializeWithValue:r=!0}=t;S&&(r=!1);const i=n.useCallback((e=>{if(t.deserializer)return t.deserializer(e);if("undefined"===e)return;let r;try{r=JSON.parse(e)}catch(e){return console.error("Error parsing JSON:",e),null}return r}),[t]),o=n.useCallback((()=>{if(S)return null;try{const t=window.localStorage.getItem(e);return t?i(t):null}catch(t){return console.warn(`Error reading localStorage key “${e}”:`,t),null}}),[e,i]),[a,s]=n.useState((()=>{if(r)return o()}));n.useEffect((()=>{s(o())}),[e]);const c=n.useCallback((t=>{(null==t?void 0:t.key)&&t.key!==e||s(o())}),[e,o]);return l("storage",c),l("local-storage",c),a},t.useResizeObserver=function(e){const{ref:t,box:r="content-box"}=e,[{width:i,height:o},a]=n.useState(w),s=_(),l=n.useRef({...w}),c=n.useRef(void 0);return c.current=null==e?void 0:e.onResize,n.useEffect((()=>{if(!(null==t?void 0:t.current))return;if("undefined"==typeof window||!("ResizeObserver"in window))return;const e=new ResizeObserver((([e])=>{const t="border-box"===r?"borderBoxSize":"device-pixel-content-box"===r?"devicePixelContentBoxSize":"contentBoxSize",n=E(e,t,"inlineSize"),i=E(e,t,"blockSize");if(l.current.width!==n||l.current.height!==i){const e={width:n,height:i};l.current.width=n,l.current.height=i,(null==c?void 0:c.current)?c.current(e):s()&&a(e)}}));return e.observe(t.current,{box:r}),()=>{e.disconnect()}}),[r,t,s]),{width:i,height:o}},t.useScreen=function(e={}){let{initializeWithValue:t=!0}=e;C&&(t=!1);const r=()=>{if(!C)return window.screen},[i,o]=n.useState((()=>{if(t)return r()})),a=y(o,null==e?void 0:e.debounceDelay);function c(){const t=r(),n=(null==e?void 0:e.debounceDelay)?a:o;if(t){const{width:e,height:r,availHeight:i,availWidth:o,colorDepth:a,orientation:s,pixelDepth:l}=t;n({width:e,height:r,availHeight:i,availWidth:o,colorDepth:a,orientation:s,pixelDepth:l})}}return l("resize",c),s((()=>{c()}),[]),i},t.useScript=function(e,t){const[r,i]=n.useState((()=>!e||(null==t?void 0:t.shouldPreventLoad)?"idle":"undefined"==typeof window?"loading":O.get(e)??"loading"));return n.useEffect((()=>{if(!e||(null==t?void 0:t.shouldPreventLoad))return;const r=O.get(e);if("ready"===r||"error"===r)return void i(r);const n=function(e){const t=document.querySelector(`script[src="${e}"]`),r=null==t?void 0:t.getAttribute("data-status");return{node:t,status:r}}(e);let o=n.node;if(o)i(n.status??r??"loading");else{o=document.createElement("script"),o.src=e,o.async=!0,(null==t?void 0:t.id)&&(o.id=t.id),o.setAttribute("data-status","loading"),document.body.appendChild(o);const r=e=>{const t="load"===e.type?"ready":"error";null==o||o.setAttribute("data-status",t)};o.addEventListener("load",r),o.addEventListener("error",r)}const a=t=>{const r="load"===t.type?"ready":"error";i(r),O.set(e,r)};return o.addEventListener("load",a),o.addEventListener("error",a),()=>{o&&(o.removeEventListener("load",a),o.removeEventListener("error",a)),o&&(null==t?void 0:t.removeOnUnmount)&&(o.remove(),O.delete(e))}}),[e,null==t?void 0:t.shouldPreventLoad,null==t?void 0:t.removeOnUnmount,null==t?void 0:t.id]),r},t.useScrollLock=function(e={}){const{autoLock:t=!0,lockTarget:r,widthReflow:i=!0}=e,[o,a]=n.useState(!1),l=n.useRef(null),c=n.useRef(null),u=()=>{if(l.current){const{overflow:e,paddingRight:t}=l.current.style;if(c.current={overflow:e,paddingRight:t},i){const e=l.current===document.body?window.innerWidth:l.current.offsetWidth,t=parseInt(window.getComputedStyle(l.current).paddingRight,10)||0,r=e-l.current.scrollWidth;l.current.style.paddingRight=`${r+t}px`}l.current.style.overflow="hidden",a(!0)}},d=()=>{l.current&&c.current&&(l.current.style.overflow=c.current.overflow,i&&(l.current.style.paddingRight=c.current.paddingRight)),a(!1)};return s((()=>{if(!P)return r&&(l.current="string"==typeof r?document.querySelector(r):r),l.current||(l.current=document.body),t&&u(),()=>{d()}}),[t,r,i]),{isLocked:o,lock:u,unlock:d}},t.useSessionStorage=function(e,t,r={}){const{initializeWithValue:i=!0}=r,o=n.useCallback((e=>r.serializer?r.serializer(e):JSON.stringify(e)),[r]),a=n.useCallback((e=>{if(r.deserializer)return r.deserializer(e);if("undefined"===e)return;const n=t instanceof Function?t():t;let i;try{i=JSON.parse(e)}catch(e){return console.error("Error parsing JSON:",e),n}return i}),[r,t]),s=n.useCallback((()=>{const r=t instanceof Function?t():t;if(T)return r;try{const t=window.sessionStorage.getItem(e);return t?a(t):r}catch(t){return console.warn(`Error reading sessionStorage key “${e}”:`,t),r}}),[t,e,a]),[c,u]=n.useState((()=>i?s():t instanceof Function?t():t)),h=d((t=>{T&&console.warn(`Tried setting sessionStorage key “${e}” even though environment is not a client`);try{const r=t instanceof Function?t(s()):t;window.sessionStorage.setItem(e,o(r)),u(r),window.dispatchEvent(new StorageEvent("session-storage",{key:e}))}catch(t){console.warn(`Error setting sessionStorage key “${e}”:`,t)}}));n.useEffect((()=>{u(s())}),[e]);const p=n.useCallback((t=>{(null==t?void 0:t.key)&&t.key!==e||u(s())}),[e,s]);return l("storage",p),l("session-storage",p),[c,h]},t.useSsr=function(){var e;const t="undefined"!=typeof window&&!!(null==(e=null==window?void 0:window.document)?void 0:e.documentElement);return{isBrowser:t,isServer:!t}},t.useStep=function(e){const[t,r]=n.useState(1),i=t+1<=e,o=t-1>0,a=n.useCallback((n=>{const i=n instanceof Function?n(t):n;if(!(i>=1&&i<=e))throw new Error("Step not valid");r(i)}),[e,t]),s=n.useCallback((()=>{i&&r((e=>e+1))}),[i]),l=n.useCallback((()=>{o&&r((e=>e-1))}),[o]),c=n.useCallback((()=>{r(1)}),[]);return[t,{goToNextStep:s,goToPrevStep:l,canGoToNextStep:i,canGoToPrevStep:o,setStep:a,reset:c}]},t.useTernaryDarkMode=function(e){const t="string"==typeof e?"system":(null==e?void 0:e.defaultValue)??"system",r="string"==typeof e?e:(null==e?void 0:e.localStorageKey)??"usehooks-ts-ternary-dark-mode",n="string"==typeof e?void 0:(null==e?void 0:e.initializeWithValue)??void 0,i=m("(prefers-color-scheme: dark)",{initializeWithValue:n}),[o,a]=p(r,t,{initializeWithValue:n});return{isDarkMode:"dark"===o||"system"===o&&i,ternaryDarkMode:o,setTernaryDarkMode:a,toggleTernaryDarkMode:()=>{const e=["light","system","dark"];a((t=>{const r=(e.indexOf(t)+1)%e.length;return e[r]}))}}},t.useTimeout=function(e,t){const r=n.useRef(e);s((()=>{r.current=e}),[e]),n.useEffect((()=>{if(!t&&0!==t)return;const e=setTimeout((()=>{r.current()}),t);return()=>{clearTimeout(e)}}),[t])},t.useToggle=function(e){const[t,r]=n.useState(!!e);return[t,n.useCallback((()=>{r((e=>!e))}),[]),r]},t.useUnmount=v,t.useUpdateEffect=function(e,t){const r=b();n.useEffect((()=>{if(!r)return e()}),t)},t.useWindowSize=function(e={}){let{initializeWithValue:t=!0}=e;k&&(t=!1);const[r,i]=n.useState((()=>t?{width:window.innerWidth,height:window.innerHeight}:{width:void 0,height:void 0})),o=y(i,null==e?void 0:e.debounceDelay);function a(){((null==e?void 0:e.debounceDelay)?o:i)({width:window.innerWidth,height:window.innerHeight})}return l("resize",a),s((()=>{a()}),[]),r}},40259:e=>{"use strict";e.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}},28799:(e,t,r)=>{"use strict";function n(e){var t=this;if(t instanceof n||(t=new n),t.tail=null,t.head=null,t.length=0,e&&"function"==typeof e.forEach)e.forEach((function(e){t.push(e)}));else if(arguments.length>0)for(var r=0,i=arguments.length;r1)r=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");n=this.head.next,r=this.head.value}for(var i=0;null!==n;i++)r=e(r,n.value,i),n=n.next;return r},n.prototype.reduceReverse=function(e,t){var r,n=this.tail;if(arguments.length>1)r=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");n=this.tail.prev,r=this.tail.value}for(var i=this.length-1;null!==n;i--)r=e(r,n.value,i),n=n.prev;return r},n.prototype.toArray=function(){for(var e=new Array(this.length),t=0,r=this.head;null!==r;t++)e[t]=r.value,r=r.next;return e},n.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,r=this.tail;null!==r;t++)e[t]=r.value,r=r.prev;return e},n.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var r=new n;if(tthis.length&&(t=this.length);for(var i=0,o=this.head;null!==o&&ithis.length&&(t=this.length);for(var i=this.length,o=this.tail;null!==o&&i>t;i--)o=o.prev;for(;null!==o&&i>e;i--,o=o.prev)r.push(o.value);return r},n.prototype.splice=function(e,t,...r){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var n=0,o=this.head;null!==o&&n{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ZodError=t.quotelessJson=t.ZodIssueCode=void 0;const n=r(12146);t.ZodIssueCode=n.util.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),t.quotelessJson=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class i extends Error{constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(e){return e.message},r={_errors:[]},n=e=>{for(const i of e.issues)if("invalid_union"===i.code)i.unionErrors.map(n);else if("invalid_return_type"===i.code)n(i.returnTypeError);else if("invalid_arguments"===i.code)n(i.argumentsError);else if(0===i.path.length)r._errors.push(t(i));else{let e=r,n=0;for(;ne.message)){const t={},r=[];for(const n of this.issues)n.path.length>0?(t[n.path[0]]=t[n.path[0]]||[],t[n.path[0]].push(e(n))):r.push(e(n));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}t.ZodError=i,i.create=e=>new i(e)},40627:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorMap=t.setErrorMap=t.defaultErrorMap=void 0;const i=n(r(68227));t.defaultErrorMap=i.default;let o=i.default;t.setErrorMap=function(e){o=e},t.getErrorMap=function(){return o}},96555:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(40627),t),i(r(97231),t),i(r(91892),t),i(r(12146),t),i(r(12739),t),i(r(66837),t)},69750:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.errorUtil=void 0,(r=t.errorUtil||(t.errorUtil={})).errToObj=e=>"string"==typeof e?{message:e}:e||{},r.toString=e=>"string"==typeof e?e:null==e?void 0:e.message},97231:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.isAsync=t.isValid=t.isDirty=t.isAborted=t.OK=t.DIRTY=t.INVALID=t.ParseStatus=t.addIssueToContext=t.EMPTY_PATH=t.makeIssue=void 0;const i=r(40627),o=n(r(68227));t.makeIssue=e=>{const{data:t,path:r,errorMaps:n,issueData:i}=e,o=[...r,...i.path||[]],a={...i,path:o};if(void 0!==i.message)return{...i,path:o,message:i.message};let s="";const l=n.filter((e=>!!e)).slice().reverse();for(const e of l)s=e(a,{data:t,defaultError:s}).message;return{...i,path:o,message:s}},t.EMPTY_PATH=[],t.addIssueToContext=function(e,r){const n=(0,i.getErrorMap)(),a=(0,t.makeIssue)({issueData:r,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===o.default?void 0:o.default].filter((e=>!!e))});e.common.issues.push(a)};class a{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,r){const n=[];for(const i of r){if("aborted"===i.status)return t.INVALID;"dirty"===i.status&&e.dirty(),n.push(i.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const r=[];for(const e of t){const t=await e.key,n=await e.value;r.push({key:t,value:n})}return a.mergeObjectSync(e,r)}static mergeObjectSync(e,r){const n={};for(const i of r){const{key:r,value:o}=i;if("aborted"===r.status)return t.INVALID;if("aborted"===o.status)return t.INVALID;"dirty"===r.status&&e.dirty(),"dirty"===o.status&&e.dirty(),"__proto__"===r.value||void 0===o.value&&!i.alwaysSet||(n[r.value]=o.value)}return{status:e.value,value:n}}}t.ParseStatus=a,t.INVALID=Object.freeze({status:"aborted"}),t.DIRTY=e=>({status:"dirty",value:e}),t.OK=e=>({status:"valid",value:e}),t.isAborted=e=>"aborted"===e.status,t.isDirty=e=>"dirty"===e.status,t.isValid=e=>"valid"===e.status,t.isAsync=e=>"undefined"!=typeof Promise&&e instanceof Promise},91892:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},12146:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.getParsedType=t.ZodParsedType=t.objectUtil=t.util=void 0,function(e){e.assertEqual=e=>e,e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const r of e)t[r]=r;return t},e.getValidEnumValues=t=>{const r=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),n={};for(const e of r)n[e]=t[e];return e.objectValues(n)},e.objectValues=t=>e.objectKeys(t).map((function(e){return t[e]})),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t},e.find=(e,t)=>{for(const r of e)if(t(r))return r},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(r=t.util||(t.util={})),(t.objectUtil||(t.objectUtil={})).mergeShapes=(e,t)=>({...e,...t}),t.ZodParsedType=r.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),t.getParsedType=e=>{switch(typeof e){case"undefined":return t.ZodParsedType.undefined;case"string":return t.ZodParsedType.string;case"number":return isNaN(e)?t.ZodParsedType.nan:t.ZodParsedType.number;case"boolean":return t.ZodParsedType.boolean;case"function":return t.ZodParsedType.function;case"bigint":return t.ZodParsedType.bigint;case"symbol":return t.ZodParsedType.symbol;case"object":return Array.isArray(e)?t.ZodParsedType.array:null===e?t.ZodParsedType.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?t.ZodParsedType.promise:"undefined"!=typeof Map&&e instanceof Map?t.ZodParsedType.map:"undefined"!=typeof Set&&e instanceof Set?t.ZodParsedType.set:"undefined"!=typeof Date&&e instanceof Date?t.ZodParsedType.date:t.ZodParsedType.object;default:return t.ZodParsedType.unknown}}},21614:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},a=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.z=void 0;const s=o(r(96555));t.z=s,a(r(96555),t),t.default=s},68227:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(12146),i=r(66837);t.default=(e,t)=>{let r;switch(e.code){case i.ZodIssueCode.invalid_type:r=e.received===n.ZodParsedType.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case i.ZodIssueCode.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,n.util.jsonStringifyReplacer)}`;break;case i.ZodIssueCode.unrecognized_keys:r=`Unrecognized key(s) in object: ${n.util.joinValues(e.keys,", ")}`;break;case i.ZodIssueCode.invalid_union:r="Invalid input";break;case i.ZodIssueCode.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${n.util.joinValues(e.options)}`;break;case i.ZodIssueCode.invalid_enum_value:r=`Invalid enum value. Expected ${n.util.joinValues(e.options)}, received '${e.received}'`;break;case i.ZodIssueCode.invalid_arguments:r="Invalid function arguments";break;case i.ZodIssueCode.invalid_return_type:r="Invalid function return type";break;case i.ZodIssueCode.invalid_date:r="Invalid date";break;case i.ZodIssueCode.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:n.util.assertNever(e.validation):r="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case i.ZodIssueCode.too_small:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case i.ZodIssueCode.too_big:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case i.ZodIssueCode.custom:r="Invalid input";break;case i.ZodIssueCode.invalid_intersection_types:r="Intersection results could not be merged";break;case i.ZodIssueCode.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case i.ZodIssueCode.not_finite:r="Number must be finite";break;default:r=t.defaultError,n.util.assertNever(e)}return{message:r}}},12739:function(e,t,r){"use strict";var n,i,o=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)},a=this&&this.__classPrivateFieldSet||function(e,t,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(e,r):i?i.value=r:t.set(e,r),r};Object.defineProperty(t,"__esModule",{value:!0}),t.boolean=t.bigint=t.array=t.any=t.coerce=t.ZodFirstPartyTypeKind=t.late=t.ZodSchema=t.Schema=t.custom=t.ZodReadonly=t.ZodPipeline=t.ZodBranded=t.BRAND=t.ZodNaN=t.ZodCatch=t.ZodDefault=t.ZodNullable=t.ZodOptional=t.ZodTransformer=t.ZodEffects=t.ZodPromise=t.ZodNativeEnum=t.ZodEnum=t.ZodLiteral=t.ZodLazy=t.ZodFunction=t.ZodSet=t.ZodMap=t.ZodRecord=t.ZodTuple=t.ZodIntersection=t.ZodDiscriminatedUnion=t.ZodUnion=t.ZodObject=t.ZodArray=t.ZodVoid=t.ZodNever=t.ZodUnknown=t.ZodAny=t.ZodNull=t.ZodUndefined=t.ZodSymbol=t.ZodDate=t.ZodBoolean=t.ZodBigInt=t.ZodNumber=t.ZodString=t.datetimeRegex=t.ZodType=void 0,t.NEVER=t.void=t.unknown=t.union=t.undefined=t.tuple=t.transformer=t.symbol=t.string=t.strictObject=t.set=t.record=t.promise=t.preprocess=t.pipeline=t.ostring=t.optional=t.onumber=t.oboolean=t.object=t.number=t.nullable=t.null=t.never=t.nativeEnum=t.nan=t.map=t.literal=t.lazy=t.intersection=t.instanceof=t.function=t.enum=t.effect=t.discriminatedUnion=t.date=void 0;const s=r(40627),l=r(69750),c=r(97231),u=r(12146),d=r(66837);class h{constructor(e,t,r,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=n}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const p=(e,t)=>{if((0,c.isValid)(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new d.ZodError(e.common.issues);return this._error=t,this._error}}};function f(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:i}=e;if(t&&(r||n))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:i}:{errorMap:(t,i)=>{var o,a;const{message:s}=e;return"invalid_enum_value"===t.code?{message:null!=s?s:i.defaultError}:void 0===i.data?{message:null!==(o=null!=s?s:n)&&void 0!==o?o:i.defaultError}:"invalid_type"!==t.code?{message:i.defaultError}:{message:null!==(a=null!=s?s:r)&&void 0!==a?a:i.defaultError}},description:i}}class m{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return(0,u.getParsedType)(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:(0,u.getParsedType)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new c.ParseStatus,ctx:{common:e.parent.common,data:e.data,parsedType:(0,u.getParsedType)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if((0,c.isAsync)(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){var r;const n={common:{issues:[],async:null!==(r=null==t?void 0:t.async)&&void 0!==r&&r,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,u.getParsedType)(e)},i=this._parseSync({data:e,path:n.path,parent:n});return p(n,i)}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,u.getParsedType)(e)},n=this._parse({data:e,path:r.path,parent:r}),i=await((0,c.isAsync)(n)?n:Promise.resolve(n));return p(r,i)}refine(e,t){const r=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,n)=>{const i=e(t),o=()=>n.addIssue({code:d.ZodIssueCode.custom,...r(t)});return"undefined"!=typeof Promise&&i instanceof Promise?i.then((e=>!!e||(o(),!1))):!!i||(o(),!1)}))}refinement(e,t){return this._refinement(((r,n)=>!!e(r)||(n.addIssue("function"==typeof t?t(r,n):t),!1)))}_refinement(e){return new ce({schema:this,typeName:be.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return ue.create(this,this._def)}nullable(){return de.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return W.create(this,this._def)}promise(){return le.create(this,this._def)}or(e){return $.create([this,e],this._def)}and(e){return J.create(this,e,this._def)}transform(e){return new ce({...f(this._def),schema:this,typeName:be.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new he({...f(this._def),innerType:this,defaultValue:t,typeName:be.ZodDefault})}brand(){return new me({typeName:be.ZodBranded,type:this,...f(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new pe({...f(this._def),innerType:this,catchValue:t,typeName:be.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return ge.create(this,e)}readonly(){return ve.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}t.ZodType=m,t.Schema=m,t.ZodSchema=m;const g=/^c[^\s-]{8,}$/i,v=/^[0-9a-z]+$/,y=/^[0-9A-HJKMNP-TV-Z]{26}$/,b=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,_=/^[a-z0-9_-]{21}$/i,S=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,w=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let E;const C=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,O=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,P=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,T="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",k=new RegExp(`^${T}$`);function R(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`),t}function A(e){let t=`${T}T${R(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}t.datetimeRegex=A;class D extends m{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==u.ZodParsedType.string){const t=this._getOrReturnCtx(e);return(0,c.addIssueToContext)(t,{code:d.ZodIssueCode.invalid_type,expected:u.ZodParsedType.string,received:t.parsedType}),c.INVALID}const t=new c.ParseStatus;let r;for(const o of this._def.checks)if("min"===o.kind)e.data.lengtho.value&&(r=this._getOrReturnCtx(e,r),(0,c.addIssueToContext)(r,{code:d.ZodIssueCode.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),t.dirty());else if("length"===o.kind){const n=e.data.length>o.value,i=e.data.lengthe.test(t)),{validation:t,code:d.ZodIssueCode.invalid_string,...l.errorUtil.errToObj(r)})}_addCheck(e){return new D({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...l.errorUtil.errToObj(e)})}url(e){return this._addCheck({kind:"url",...l.errorUtil.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...l.errorUtil.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...l.errorUtil.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...l.errorUtil.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...l.errorUtil.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...l.errorUtil.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...l.errorUtil.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...l.errorUtil.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...l.errorUtil.errToObj(e)})}datetime(e){var t,r;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,local:null!==(r=null==e?void 0:e.local)&&void 0!==r&&r,...l.errorUtil.errToObj(null==e?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,...l.errorUtil.errToObj(null==e?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...l.errorUtil.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...l.errorUtil.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...l.errorUtil.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...l.errorUtil.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...l.errorUtil.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...l.errorUtil.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...l.errorUtil.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...l.errorUtil.errToObj(t)})}nonempty(e){return this.min(1,l.errorUtil.errToObj(e))}trim(){return new D({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new D({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new D({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isDate(){return!!this._def.checks.find((e=>"date"===e.kind))}get isTime(){return!!this._def.checks.find((e=>"time"===e.kind))}get isDuration(){return!!this._def.checks.find((e=>"duration"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isEmoji(){return!!this._def.checks.find((e=>"emoji"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isNANOID(){return!!this._def.checks.find((e=>"nanoid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get isULID(){return!!this._def.checks.find((e=>"ulid"===e.kind))}get isIP(){return!!this._def.checks.find((e=>"ip"===e.kind))}get isBase64(){return!!this._def.checks.find((e=>"base64"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.valuen?r:n;return parseInt(e.toFixed(i).replace(".",""))%parseInt(t.toFixed(i).replace(".",""))/Math.pow(10,i)}t.ZodString=D,D.create=e=>{var t;return new D({checks:[],typeName:be.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...f(e)})};class x extends m{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==u.ZodParsedType.number){const t=this._getOrReturnCtx(e);return(0,c.addIssueToContext)(t,{code:d.ZodIssueCode.invalid_type,expected:u.ZodParsedType.number,received:t.parsedType}),c.INVALID}let t;const r=new c.ParseStatus;for(const n of this._def.checks)"int"===n.kind?u.util.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),(0,c.addIssueToContext)(t,{code:d.ZodIssueCode.invalid_type,expected:"integer",received:"float",message:n.message}),r.dirty()):"min"===n.kind?(n.inclusive?e.datan.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),(0,c.addIssueToContext)(t,{code:d.ZodIssueCode.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),r.dirty()):"multipleOf"===n.kind?0!==I(e.data,n.value)&&(t=this._getOrReturnCtx(e,t),(0,c.addIssueToContext)(t,{code:d.ZodIssueCode.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):"finite"===n.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),(0,c.addIssueToContext)(t,{code:d.ZodIssueCode.not_finite,message:n.message}),r.dirty()):u.util.assertNever(n);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,l.errorUtil.toString(t))}gt(e,t){return this.setLimit("min",e,!1,l.errorUtil.toString(t))}lte(e,t){return this.setLimit("max",e,!0,l.errorUtil.toString(t))}lt(e,t){return this.setLimit("max",e,!1,l.errorUtil.toString(t))}setLimit(e,t,r,n){return new x({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:l.errorUtil.toString(n)}]})}_addCheck(e){return new x({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:l.errorUtil.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:l.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:l.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:l.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:l.errorUtil.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:l.errorUtil.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:l.errorUtil.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:l.errorUtil.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:l.errorUtil.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value"int"===e.kind||"multipleOf"===e.kind&&u.util.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if("finite"===r.kind||"int"===r.kind||"multipleOf"===r.kind)return!0;"min"===r.kind?(null===t||r.value>t)&&(t=r.value):"max"===r.kind&&(null===e||r.valuenew x({checks:[],typeName:be.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...f(e)});class M extends m{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==u.ZodParsedType.bigint){const t=this._getOrReturnCtx(e);return(0,c.addIssueToContext)(t,{code:d.ZodIssueCode.invalid_type,expected:u.ZodParsedType.bigint,received:t.parsedType}),c.INVALID}let t;const r=new c.ParseStatus;for(const n of this._def.checks)"min"===n.kind?(n.inclusive?e.datan.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),(0,c.addIssueToContext)(t,{code:d.ZodIssueCode.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),r.dirty()):"multipleOf"===n.kind?e.data%n.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),(0,c.addIssueToContext)(t,{code:d.ZodIssueCode.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):u.util.assertNever(n);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,l.errorUtil.toString(t))}gt(e,t){return this.setLimit("min",e,!1,l.errorUtil.toString(t))}lte(e,t){return this.setLimit("max",e,!0,l.errorUtil.toString(t))}lt(e,t){return this.setLimit("max",e,!1,l.errorUtil.toString(t))}setLimit(e,t,r,n){return new M({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:l.errorUtil.toString(n)}]})}_addCheck(e){return new M({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:l.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:l.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:l.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:l.errorUtil.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:l.errorUtil.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value{var t;return new M({checks:[],typeName:be.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...f(e)})};class L extends m{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==u.ZodParsedType.boolean){const t=this._getOrReturnCtx(e);return(0,c.addIssueToContext)(t,{code:d.ZodIssueCode.invalid_type,expected:u.ZodParsedType.boolean,received:t.parsedType}),c.INVALID}return(0,c.OK)(e.data)}}t.ZodBoolean=L,L.create=e=>new L({typeName:be.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...f(e)});class j extends m{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==u.ZodParsedType.date){const t=this._getOrReturnCtx(e);return(0,c.addIssueToContext)(t,{code:d.ZodIssueCode.invalid_type,expected:u.ZodParsedType.date,received:t.parsedType}),c.INVALID}if(isNaN(e.data.getTime())){const t=this._getOrReturnCtx(e);return(0,c.addIssueToContext)(t,{code:d.ZodIssueCode.invalid_date}),c.INVALID}const t=new c.ParseStatus;let r;for(const n of this._def.checks)"min"===n.kind?e.data.getTime()n.value&&(r=this._getOrReturnCtx(e,r),(0,c.addIssueToContext)(r,{code:d.ZodIssueCode.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),t.dirty()):u.util.assertNever(n);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new j({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:l.errorUtil.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:l.errorUtil.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.valuenew j({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:be.ZodDate,...f(e)});class N extends m{_parse(e){if(this._getType(e)!==u.ZodParsedType.symbol){const t=this._getOrReturnCtx(e);return(0,c.addIssueToContext)(t,{code:d.ZodIssueCode.invalid_type,expected:u.ZodParsedType.symbol,received:t.parsedType}),c.INVALID}return(0,c.OK)(e.data)}}t.ZodSymbol=N,N.create=e=>new N({typeName:be.ZodSymbol,...f(e)});class F extends m{_parse(e){if(this._getType(e)!==u.ZodParsedType.undefined){const t=this._getOrReturnCtx(e);return(0,c.addIssueToContext)(t,{code:d.ZodIssueCode.invalid_type,expected:u.ZodParsedType.undefined,received:t.parsedType}),c.INVALID}return(0,c.OK)(e.data)}}t.ZodUndefined=F,F.create=e=>new F({typeName:be.ZodUndefined,...f(e)});class B extends m{_parse(e){if(this._getType(e)!==u.ZodParsedType.null){const t=this._getOrReturnCtx(e);return(0,c.addIssueToContext)(t,{code:d.ZodIssueCode.invalid_type,expected:u.ZodParsedType.null,received:t.parsedType}),c.INVALID}return(0,c.OK)(e.data)}}t.ZodNull=B,B.create=e=>new B({typeName:be.ZodNull,...f(e)});class U extends m{constructor(){super(...arguments),this._any=!0}_parse(e){return(0,c.OK)(e.data)}}t.ZodAny=U,U.create=e=>new U({typeName:be.ZodAny,...f(e)});class V extends m{constructor(){super(...arguments),this._unknown=!0}_parse(e){return(0,c.OK)(e.data)}}t.ZodUnknown=V,V.create=e=>new V({typeName:be.ZodUnknown,...f(e)});class H extends m{_parse(e){const t=this._getOrReturnCtx(e);return(0,c.addIssueToContext)(t,{code:d.ZodIssueCode.invalid_type,expected:u.ZodParsedType.never,received:t.parsedType}),c.INVALID}}t.ZodNever=H,H.create=e=>new H({typeName:be.ZodNever,...f(e)});class G extends m{_parse(e){if(this._getType(e)!==u.ZodParsedType.undefined){const t=this._getOrReturnCtx(e);return(0,c.addIssueToContext)(t,{code:d.ZodIssueCode.invalid_type,expected:u.ZodParsedType.void,received:t.parsedType}),c.INVALID}return(0,c.OK)(e.data)}}t.ZodVoid=G,G.create=e=>new G({typeName:be.ZodVoid,...f(e)});class W extends m{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),n=this._def;if(t.parsedType!==u.ZodParsedType.array)return(0,c.addIssueToContext)(t,{code:d.ZodIssueCode.invalid_type,expected:u.ZodParsedType.array,received:t.parsedType}),c.INVALID;if(null!==n.exactLength){const e=t.data.length>n.exactLength.value,i=t.data.lengthn.maxLength.value&&((0,c.addIssueToContext)(t,{code:d.ZodIssueCode.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map(((e,r)=>n.type._parseAsync(new h(t,e,t.path,r))))).then((e=>c.ParseStatus.mergeArray(r,e)));const i=[...t.data].map(((e,r)=>n.type._parseSync(new h(t,e,t.path,r))));return c.ParseStatus.mergeArray(r,i)}get element(){return this._def.type}min(e,t){return new W({...this._def,minLength:{value:e,message:l.errorUtil.toString(t)}})}max(e,t){return new W({...this._def,maxLength:{value:e,message:l.errorUtil.toString(t)}})}length(e,t){return new W({...this._def,exactLength:{value:e,message:l.errorUtil.toString(t)}})}nonempty(e){return this.min(1,e)}}function z(e){if(e instanceof K){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=ue.create(z(n))}return new K({...e._def,shape:()=>t})}return e instanceof W?new W({...e._def,type:z(e.element)}):e instanceof ue?ue.create(z(e.unwrap())):e instanceof de?de.create(z(e.unwrap())):e instanceof Q?Q.create(e.items.map((e=>z(e)))):e}t.ZodArray=W,W.create=(e,t)=>new W({type:e,minLength:null,maxLength:null,exactLength:null,typeName:be.ZodArray,...f(t)});class K extends m{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=u.util.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==u.ZodParsedType.object){const t=this._getOrReturnCtx(e);return(0,c.addIssueToContext)(t,{code:d.ZodIssueCode.invalid_type,expected:u.ZodParsedType.object,received:t.parsedType}),c.INVALID}const{status:t,ctx:r}=this._processInputParams(e),{shape:n,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof H&&"strip"===this._def.unknownKeys))for(const e in r.data)i.includes(e)||o.push(e);const a=[];for(const e of i){const t=n[e],i=r.data[e];a.push({key:{status:"valid",value:e},value:t._parse(new h(r,i,r.path,e)),alwaysSet:e in r.data})}if(this._def.catchall instanceof H){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of o)a.push({key:{status:"valid",value:e},value:{status:"valid",value:r.data[e]}});else if("strict"===e)o.length>0&&((0,c.addIssueToContext)(r,{code:d.ZodIssueCode.unrecognized_keys,keys:o}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of o){const n=r.data[t];a.push({key:{status:"valid",value:t},value:e._parse(new h(r,n,r.path,t)),alwaysSet:t in r.data})}}return r.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of a){const r=await t.key,n=await t.value;e.push({key:r,value:n,alwaysSet:t.alwaysSet})}return e})).then((e=>c.ParseStatus.mergeObjectSync(t,e))):c.ParseStatus.mergeObjectSync(t,a)}get shape(){return this._def.shape()}strict(e){return l.errorUtil.errToObj,new K({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,r)=>{var n,i,o,a;const s=null!==(o=null===(i=(n=this._def).errorMap)||void 0===i?void 0:i.call(n,t,r).message)&&void 0!==o?o:r.defaultError;return"unrecognized_keys"===t.code?{message:null!==(a=l.errorUtil.errToObj(e).message)&&void 0!==a?a:s}:{message:s}}}:{}})}strip(){return new K({...this._def,unknownKeys:"strip"})}passthrough(){return new K({...this._def,unknownKeys:"passthrough"})}extend(e){return new K({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new K({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:be.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new K({...this._def,catchall:e})}pick(e){const t={};return u.util.objectKeys(e).forEach((r=>{e[r]&&this.shape[r]&&(t[r]=this.shape[r])})),new K({...this._def,shape:()=>t})}omit(e){const t={};return u.util.objectKeys(this.shape).forEach((r=>{e[r]||(t[r]=this.shape[r])})),new K({...this._def,shape:()=>t})}deepPartial(){return z(this)}partial(e){const t={};return u.util.objectKeys(this.shape).forEach((r=>{const n=this.shape[r];e&&!e[r]?t[r]=n:t[r]=n.optional()})),new K({...this._def,shape:()=>t})}required(e){const t={};return u.util.objectKeys(this.shape).forEach((r=>{if(e&&!e[r])t[r]=this.shape[r];else{let e=this.shape[r];for(;e instanceof ue;)e=e._def.innerType;t[r]=e}})),new K({...this._def,shape:()=>t})}keyof(){return oe(u.util.objectKeys(this.shape))}}t.ZodObject=K,K.create=(e,t)=>new K({shape:()=>e,unknownKeys:"strip",catchall:H.create(),typeName:be.ZodObject,...f(t)}),K.strictCreate=(e,t)=>new K({shape:()=>e,unknownKeys:"strict",catchall:H.create(),typeName:be.ZodObject,...f(t)}),K.lazycreate=(e,t)=>new K({shape:e,unknownKeys:"strip",catchall:H.create(),typeName:be.ZodObject,...f(t)});class $ extends m{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;if(t.common.async)return Promise.all(r.map((async e=>{const r={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:r}),ctx:r}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const r of e)if("dirty"===r.result.status)return t.common.issues.push(...r.ctx.common.issues),r.result;const r=e.map((e=>new d.ZodError(e.ctx.common.issues)));return(0,c.addIssueToContext)(t,{code:d.ZodIssueCode.invalid_union,unionErrors:r}),c.INVALID}));{let e;const n=[];for(const i of r){const r={...t,common:{...t.common,issues:[]},parent:null},o=i._parseSync({data:t.data,path:t.path,parent:r});if("valid"===o.status)return o;"dirty"!==o.status||e||(e={result:o,ctx:r}),r.common.issues.length&&n.push(r.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const i=n.map((e=>new d.ZodError(e)));return(0,c.addIssueToContext)(t,{code:d.ZodIssueCode.invalid_union,unionErrors:i}),c.INVALID}}get options(){return this._def.options}}t.ZodUnion=$,$.create=(e,t)=>new $({options:e,typeName:be.ZodUnion,...f(t)});const q=e=>e instanceof ne?q(e.schema):e instanceof ce?q(e.innerType()):e instanceof ie?[e.value]:e instanceof ae?e.options:e instanceof se?u.util.objectValues(e.enum):e instanceof he?q(e._def.innerType):e instanceof F?[void 0]:e instanceof B?[null]:e instanceof ue?[void 0,...q(e.unwrap())]:e instanceof de?[null,...q(e.unwrap())]:e instanceof me||e instanceof ve?q(e.unwrap()):e instanceof pe?q(e._def.innerType):[];class Z extends m{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==u.ZodParsedType.object)return(0,c.addIssueToContext)(t,{code:d.ZodIssueCode.invalid_type,expected:u.ZodParsedType.object,received:t.parsedType}),c.INVALID;const r=this.discriminator,n=t.data[r],i=this.optionsMap.get(n);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):((0,c.addIssueToContext)(t,{code:d.ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),c.INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){const n=new Map;for(const r of t){const t=q(r.shape[e]);if(!t.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const i of t){if(n.has(i))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);n.set(i,r)}}return new Z({typeName:be.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...f(r)})}}function Y(e,t){const r=(0,u.getParsedType)(e),n=(0,u.getParsedType)(t);if(e===t)return{valid:!0,data:e};if(r===u.ZodParsedType.object&&n===u.ZodParsedType.object){const r=u.util.objectKeys(t),n=u.util.objectKeys(e).filter((e=>-1!==r.indexOf(e))),i={...e,...t};for(const r of n){const n=Y(e[r],t[r]);if(!n.valid)return{valid:!1};i[r]=n.data}return{valid:!0,data:i}}if(r===u.ZodParsedType.array&&n===u.ZodParsedType.array){if(e.length!==t.length)return{valid:!1};const r=[];for(let n=0;n{if((0,c.isAborted)(e)||(0,c.isAborted)(n))return c.INVALID;const i=Y(e.value,n.value);return i.valid?(((0,c.isDirty)(e)||(0,c.isDirty)(n))&&t.dirty(),{status:t.value,value:i.data}):((0,c.addIssueToContext)(r,{code:d.ZodIssueCode.invalid_intersection_types}),c.INVALID)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then((([e,t])=>n(e,t))):n(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}t.ZodIntersection=J,J.create=(e,t,r)=>new J({left:e,right:t,typeName:be.ZodIntersection,...f(r)});class Q extends m{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==u.ZodParsedType.array)return(0,c.addIssueToContext)(r,{code:d.ZodIssueCode.invalid_type,expected:u.ZodParsedType.array,received:r.parsedType}),c.INVALID;if(r.data.lengththis._def.items.length&&((0,c.addIssueToContext)(r,{code:d.ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const n=[...r.data].map(((e,t)=>{const n=this._def.items[t]||this._def.rest;return n?n._parse(new h(r,e,r.path,t)):null})).filter((e=>!!e));return r.common.async?Promise.all(n).then((e=>c.ParseStatus.mergeArray(t,e))):c.ParseStatus.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new Q({...this._def,rest:e})}}t.ZodTuple=Q,Q.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Q({items:e,typeName:be.ZodTuple,rest:null,...f(t)})};class X extends m{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==u.ZodParsedType.object)return(0,c.addIssueToContext)(r,{code:d.ZodIssueCode.invalid_type,expected:u.ZodParsedType.object,received:r.parsedType}),c.INVALID;const n=[],i=this._def.keyType,o=this._def.valueType;for(const e in r.data)n.push({key:i._parse(new h(r,e,r.path,e)),value:o._parse(new h(r,r.data[e],r.path,e)),alwaysSet:e in r.data});return r.common.async?c.ParseStatus.mergeObjectAsync(t,n):c.ParseStatus.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,r){return new X(t instanceof m?{keyType:e,valueType:t,typeName:be.ZodRecord,...f(r)}:{keyType:D.create(),valueType:e,typeName:be.ZodRecord,...f(t)})}}t.ZodRecord=X;class ee extends m{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==u.ZodParsedType.map)return(0,c.addIssueToContext)(r,{code:d.ZodIssueCode.invalid_type,expected:u.ZodParsedType.map,received:r.parsedType}),c.INVALID;const n=this._def.keyType,i=this._def.valueType,o=[...r.data.entries()].map((([e,t],o)=>({key:n._parse(new h(r,e,r.path,[o,"key"])),value:i._parse(new h(r,t,r.path,[o,"value"]))})));if(r.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const r of o){const n=await r.key,i=await r.value;if("aborted"===n.status||"aborted"===i.status)return c.INVALID;"dirty"!==n.status&&"dirty"!==i.status||t.dirty(),e.set(n.value,i.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const r of o){const n=r.key,i=r.value;if("aborted"===n.status||"aborted"===i.status)return c.INVALID;"dirty"!==n.status&&"dirty"!==i.status||t.dirty(),e.set(n.value,i.value)}return{status:t.value,value:e}}}}t.ZodMap=ee,ee.create=(e,t,r)=>new ee({valueType:t,keyType:e,typeName:be.ZodMap,...f(r)});class te extends m{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==u.ZodParsedType.set)return(0,c.addIssueToContext)(r,{code:d.ZodIssueCode.invalid_type,expected:u.ZodParsedType.set,received:r.parsedType}),c.INVALID;const n=this._def;null!==n.minSize&&r.data.sizen.maxSize.value&&((0,c.addIssueToContext)(r,{code:d.ZodIssueCode.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const i=this._def.valueType;function o(e){const r=new Set;for(const n of e){if("aborted"===n.status)return c.INVALID;"dirty"===n.status&&t.dirty(),r.add(n.value)}return{status:t.value,value:r}}const a=[...r.data.values()].map(((e,t)=>i._parse(new h(r,e,r.path,t))));return r.common.async?Promise.all(a).then((e=>o(e))):o(a)}min(e,t){return new te({...this._def,minSize:{value:e,message:l.errorUtil.toString(t)}})}max(e,t){return new te({...this._def,maxSize:{value:e,message:l.errorUtil.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}t.ZodSet=te,te.create=(e,t)=>new te({valueType:e,minSize:null,maxSize:null,typeName:be.ZodSet,...f(t)});class re extends m{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==u.ZodParsedType.function)return(0,c.addIssueToContext)(t,{code:d.ZodIssueCode.invalid_type,expected:u.ZodParsedType.function,received:t.parsedType}),c.INVALID;function r(e,r){return(0,c.makeIssue)({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,(0,s.getErrorMap)(),s.defaultErrorMap].filter((e=>!!e)),issueData:{code:d.ZodIssueCode.invalid_arguments,argumentsError:r}})}function n(e,r){return(0,c.makeIssue)({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,(0,s.getErrorMap)(),s.defaultErrorMap].filter((e=>!!e)),issueData:{code:d.ZodIssueCode.invalid_return_type,returnTypeError:r}})}const i={errorMap:t.common.contextualErrorMap},o=t.data;if(this._def.returns instanceof le){const e=this;return(0,c.OK)((async function(...t){const a=new d.ZodError([]),s=await e._def.args.parseAsync(t,i).catch((e=>{throw a.addIssue(r(t,e)),a})),l=await Reflect.apply(o,this,s);return await e._def.returns._def.type.parseAsync(l,i).catch((e=>{throw a.addIssue(n(l,e)),a}))}))}{const e=this;return(0,c.OK)((function(...t){const a=e._def.args.safeParse(t,i);if(!a.success)throw new d.ZodError([r(t,a.error)]);const s=Reflect.apply(o,this,a.data),l=e._def.returns.safeParse(s,i);if(!l.success)throw new d.ZodError([n(s,l.error)]);return l.data}))}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new re({...this._def,args:Q.create(e).rest(V.create())})}returns(e){return new re({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new re({args:e||Q.create([]).rest(V.create()),returns:t||V.create(),typeName:be.ZodFunction,...f(r)})}}t.ZodFunction=re;class ne extends m{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}t.ZodLazy=ne,ne.create=(e,t)=>new ne({getter:e,typeName:be.ZodLazy,...f(t)});class ie extends m{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return(0,c.addIssueToContext)(t,{received:t.data,code:d.ZodIssueCode.invalid_literal,expected:this._def.value}),c.INVALID}return{status:"valid",value:e.data}}get value(){return this._def.value}}function oe(e,t){return new ae({values:e,typeName:be.ZodEnum,...f(t)})}t.ZodLiteral=ie,ie.create=(e,t)=>new ie({value:e,typeName:be.ZodLiteral,...f(t)});class ae extends m{constructor(){super(...arguments),n.set(this,void 0)}_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),r=this._def.values;return(0,c.addIssueToContext)(t,{expected:u.util.joinValues(r),received:t.parsedType,code:d.ZodIssueCode.invalid_type}),c.INVALID}if(o(this,n,"f")||a(this,n,new Set(this._def.values),"f"),!o(this,n,"f").has(e.data)){const t=this._getOrReturnCtx(e),r=this._def.values;return(0,c.addIssueToContext)(t,{received:t.data,code:d.ZodIssueCode.invalid_enum_value,options:r}),c.INVALID}return(0,c.OK)(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return ae.create(e,{...this._def,...t})}exclude(e,t=this._def){return ae.create(this.options.filter((t=>!e.includes(t))),{...this._def,...t})}}t.ZodEnum=ae,n=new WeakMap,ae.create=oe;class se extends m{constructor(){super(...arguments),i.set(this,void 0)}_parse(e){const t=u.util.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==u.ZodParsedType.string&&r.parsedType!==u.ZodParsedType.number){const e=u.util.objectValues(t);return(0,c.addIssueToContext)(r,{expected:u.util.joinValues(e),received:r.parsedType,code:d.ZodIssueCode.invalid_type}),c.INVALID}if(o(this,i,"f")||a(this,i,new Set(u.util.getValidEnumValues(this._def.values)),"f"),!o(this,i,"f").has(e.data)){const e=u.util.objectValues(t);return(0,c.addIssueToContext)(r,{received:r.data,code:d.ZodIssueCode.invalid_enum_value,options:e}),c.INVALID}return(0,c.OK)(e.data)}get enum(){return this._def.values}}t.ZodNativeEnum=se,i=new WeakMap,se.create=(e,t)=>new se({values:e,typeName:be.ZodNativeEnum,...f(t)});class le extends m{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==u.ZodParsedType.promise&&!1===t.common.async)return(0,c.addIssueToContext)(t,{code:d.ZodIssueCode.invalid_type,expected:u.ZodParsedType.promise,received:t.parsedType}),c.INVALID;const r=t.parsedType===u.ZodParsedType.promise?t.data:Promise.resolve(t.data);return(0,c.OK)(r.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}t.ZodPromise=le,le.create=(e,t)=>new le({type:e,typeName:be.ZodPromise,...f(t)});class ce extends m{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===be.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:r}=this._processInputParams(e),n=this._def.effect||null,i={addIssue:e=>{(0,c.addIssueToContext)(r,e),e.fatal?t.abort():t.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),"preprocess"===n.type){const e=n.transform(r.data,i);if(r.common.async)return Promise.resolve(e).then((async e=>{if("aborted"===t.value)return c.INVALID;const n=await this._def.schema._parseAsync({data:e,path:r.path,parent:r});return"aborted"===n.status?c.INVALID:"dirty"===n.status||"dirty"===t.value?(0,c.DIRTY)(n.value):n}));{if("aborted"===t.value)return c.INVALID;const n=this._def.schema._parseSync({data:e,path:r.path,parent:r});return"aborted"===n.status?c.INVALID:"dirty"===n.status||"dirty"===t.value?(0,c.DIRTY)(n.value):n}}if("refinement"===n.type){const e=e=>{const t=n.refinement(e,i);if(r.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===r.common.async){const n=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===n.status?c.INVALID:("dirty"===n.status&&t.dirty(),e(n.value),{status:t.value,value:n.value})}return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((r=>"aborted"===r.status?c.INVALID:("dirty"===r.status&&t.dirty(),e(r.value).then((()=>({status:t.value,value:r.value}))))))}if("transform"===n.type){if(!1===r.common.async){const e=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!(0,c.isValid)(e))return e;const o=n.transform(e.value,i);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((e=>(0,c.isValid)(e)?Promise.resolve(n.transform(e.value,i)).then((e=>({status:t.value,value:e}))):e))}u.util.assertNever(n)}}t.ZodEffects=ce,t.ZodTransformer=ce,ce.create=(e,t,r)=>new ce({schema:e,typeName:be.ZodEffects,effect:t,...f(r)}),ce.createWithPreprocess=(e,t,r)=>new ce({schema:t,effect:{type:"preprocess",transform:e},typeName:be.ZodEffects,...f(r)});class ue extends m{_parse(e){return this._getType(e)===u.ZodParsedType.undefined?(0,c.OK)(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}t.ZodOptional=ue,ue.create=(e,t)=>new ue({innerType:e,typeName:be.ZodOptional,...f(t)});class de extends m{_parse(e){return this._getType(e)===u.ZodParsedType.null?(0,c.OK)(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}t.ZodNullable=de,de.create=(e,t)=>new de({innerType:e,typeName:be.ZodNullable,...f(t)});class he extends m{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===u.ZodParsedType.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}t.ZodDefault=he,he.create=(e,t)=>new he({innerType:e,typeName:be.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...f(t)});class pe extends m{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return(0,c.isAsync)(n)?n.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new d.ZodError(r.common.issues)},input:r.data})}))):{status:"valid",value:"valid"===n.status?n.value:this._def.catchValue({get error(){return new d.ZodError(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}t.ZodCatch=pe,pe.create=(e,t)=>new pe({innerType:e,typeName:be.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...f(t)});class fe extends m{_parse(e){if(this._getType(e)!==u.ZodParsedType.nan){const t=this._getOrReturnCtx(e);return(0,c.addIssueToContext)(t,{code:d.ZodIssueCode.invalid_type,expected:u.ZodParsedType.nan,received:t.parsedType}),c.INVALID}return{status:"valid",value:e.data}}}t.ZodNaN=fe,fe.create=e=>new fe({typeName:be.ZodNaN,...f(e)}),t.BRAND=Symbol("zod_brand");class me extends m{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}t.ZodBranded=me;class ge extends m{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const e=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?c.INVALID:"dirty"===e.status?(t.dirty(),(0,c.DIRTY)(e.value)):this._def.out._parseAsync({data:e.value,path:r.path,parent:r})})();{const e=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?c.INVALID:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:r.path,parent:r})}}static create(e,t){return new ge({in:e,out:t,typeName:be.ZodPipeline})}}t.ZodPipeline=ge;class ve extends m{_parse(e){const t=this._def.innerType._parse(e),r=e=>((0,c.isValid)(e)&&(e.value=Object.freeze(e.value)),e);return(0,c.isAsync)(t)?t.then((e=>r(e))):r(t)}unwrap(){return this._def.innerType}}function ye(e,t={},r){return e?U.create().superRefine(((n,i)=>{var o,a;if(!e(n)){const e="function"==typeof t?t(n):"string"==typeof t?{message:t}:t,s=null===(a=null!==(o=e.fatal)&&void 0!==o?o:r)||void 0===a||a,l="string"==typeof e?{message:e}:e;i.addIssue({code:"custom",...l,fatal:s})}})):U.create()}var be;t.ZodReadonly=ve,ve.create=(e,t)=>new ve({innerType:e,typeName:be.ZodReadonly,...f(t)}),t.custom=ye,t.late={object:K.lazycreate},function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(be=t.ZodFirstPartyTypeKind||(t.ZodFirstPartyTypeKind={})),t.instanceof=(e,t={message:`Input not instance of ${e.name}`})=>ye((t=>t instanceof e),t);const _e=D.create;t.string=_e;const Se=x.create;t.number=Se;const we=fe.create;t.nan=we;const Ee=M.create;t.bigint=Ee;const Ce=L.create;t.boolean=Ce;const Oe=j.create;t.date=Oe;const Pe=N.create;t.symbol=Pe;const Te=F.create;t.undefined=Te;const ke=B.create;t.null=ke;const Re=U.create;t.any=Re;const Ae=V.create;t.unknown=Ae;const De=H.create;t.never=De;const Ie=G.create;t.void=Ie;const xe=W.create;t.array=xe;const Me=K.create;t.object=Me;const Le=K.strictCreate;t.strictObject=Le;const je=$.create;t.union=je;const Ne=Z.create;t.discriminatedUnion=Ne;const Fe=J.create;t.intersection=Fe;const Be=Q.create;t.tuple=Be;const Ue=X.create;t.record=Ue;const Ve=ee.create;t.map=Ve;const He=te.create;t.set=He;const Ge=re.create;t.function=Ge;const We=ne.create;t.lazy=We;const ze=ie.create;t.literal=ze;const Ke=ae.create;t.enum=Ke;const $e=se.create;t.nativeEnum=$e;const qe=le.create;t.promise=qe;const Ze=ce.create;t.effect=Ze,t.transformer=Ze;const Ye=ue.create;t.optional=Ye;const Je=de.create;t.nullable=Je;const Qe=ce.createWithPreprocess;t.preprocess=Qe;const Xe=ge.create;t.pipeline=Xe,t.ostring=()=>_e().optional(),t.onumber=()=>Se().optional(),t.oboolean=()=>Ce().optional(),t.coerce={string:e=>D.create({...e,coerce:!0}),number:e=>x.create({...e,coerce:!0}),boolean:e=>L.create({...e,coerce:!0}),bigint:e=>M.create({...e,coerce:!0}),date:e=>j.create({...e,coerce:!0})},t.NEVER=c.INVALID},72506:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(r(82779)),o=r(18874);t.default=e=>({get:async t=>{if(!t.url)throw Error("Url was not provided to the gatewayCaller. Please provide url in the config.");return t.headers={...t.headers,[o.X_GATEWAY_HEADER]:e},i.default.get(t.url,t)},post:async t=>{if(!t.url)throw Error("Url was not provided to the gatewayCaller. Please provide url in the config.");return t.headers={...t.headers,[o.X_GATEWAY_HEADER]:e},i.default.post(t.url,t.data,t)}})},18874:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HIGH_RISK_COUNTRIES=t.OFAC_COUNTRIES=t.X_GATEWAY_HEADER=void 0,t.X_GATEWAY_HEADER="X-GATEWAY",t.OFAC_COUNTRIES=new Set(["BY","BI","CF","CU","CD","IR","IQ","LB","LY","ML","NI","KP","RU","SO","SS","SD","SY","UA","VE","YE","ZW"]),t.HIGH_RISK_COUNTRIES=new Set(["AM","AZ","BD","BF","BH","BW","BY","CD","CI","CK","CN","CO","CU","DZ","EC","EG","GE","GH","GM","GW","GY","HT","ID","IQ","IR","KE","KG","KH","KP","KZ","LB","LR","LY","MA","MD","MH","MM","MS","MY","NG","NI","NP","PA","PG","PH","PK","PS","RO","RU","SD","SL","SN","SO","SY","TG","TL","TN","TZ","UA","UG","UZ","VN","VU","YE","ZW"])},55934:e=>{var t=function(){"use strict";function e(e,t){return null!=t&&e instanceof t}var t,r,n;try{t=Map}catch(e){t=function(){}}try{r=Set}catch(e){r=function(){}}try{n=Promise}catch(e){n=function(){}}function i(o,s,l,c,u){"object"==typeof s&&(l=s.depth,c=s.prototype,u=s.includeNonEnumerable,s=s.circular);var d=[],h=[],p="undefined"!=typeof Buffer;return void 0===s&&(s=!0),void 0===l&&(l=1/0),function o(l,f){if(null===l)return null;if(0===f)return l;var m,g;if("object"!=typeof l)return l;if(e(l,t))m=new t;else if(e(l,r))m=new r;else if(e(l,n))m=new n((function(e,t){l.then((function(t){e(o(t,f-1))}),(function(e){t(o(e,f-1))}))}));else if(i.__isArray(l))m=[];else if(i.__isRegExp(l))m=new RegExp(l.source,a(l)),l.lastIndex&&(m.lastIndex=l.lastIndex);else if(i.__isDate(l))m=new Date(l.getTime());else{if(p&&Buffer.isBuffer(l))return m=Buffer.allocUnsafe?Buffer.allocUnsafe(l.length):new Buffer(l.length),l.copy(m),m;e(l,Error)?m=Object.create(l):void 0===c?(g=Object.getPrototypeOf(l),m=Object.create(g)):(m=Object.create(c),g=c)}if(s){var v=d.indexOf(l);if(-1!=v)return h[v];d.push(l),h.push(m)}for(var y in e(l,t)&&l.forEach((function(e,t){var r=o(t,f-1),n=o(e,f-1);m.set(r,n)})),e(l,r)&&l.forEach((function(e){var t=o(e,f-1);m.add(t)})),l){var b;g&&(b=Object.getOwnPropertyDescriptor(g,y)),b&&null==b.set||(m[y]=o(l[y],f-1))}if(Object.getOwnPropertySymbols){var _=Object.getOwnPropertySymbols(l);for(y=0;y<_.length;y++){var S=_[y];(!(E=Object.getOwnPropertyDescriptor(l,S))||E.enumerable||u)&&(m[S]=o(l[S],f-1),E.enumerable||Object.defineProperty(m,S,{enumerable:!1}))}}if(u){var w=Object.getOwnPropertyNames(l);for(y=0;y{var t;t=this[e],this[e]=function(...e){var r,n;if(n=e,[...e]=n,[r]=i.call(e,-1),"function"!=typeof r)return t(...e,r);try{r(null,t(...e))}catch(e){r(e)}}}))),this.stats={hits:0,misses:0,keys:0,ksize:0,vsize:0},this.validKeyTypes=["string","number"],this._checkData()}get(t){var r;if(o(this,e),null!=(r=this._isInvalidKey(t)))throw r;return null!=this.data[t]&&this._check(t,this.data[t])?(this.stats.hits++,this._unwrap(this.data[t])):void this.stats.misses++}mget(t){var r,n,i,a,s;if(o(this,e),!Array.isArray(t))throw this._error("EKEYSTYPE");for(s={},n=0,a=t.length;n-1&&this.stats.keys>=this.options.maxKeys)throw this._error("ECACHEFULL");if(this.options.forceString,null==n&&(n=this.options.stdTTL),null!=(i=this._isInvalidKey(t)))throw i;return a=!1,this.data[t]&&(a=!0,this.stats.vsize-=this._getValLength(this._unwrap(this.data[t],!1))),this.data[t]=this._wrap(r,n),this.stats.vsize+=this._getValLength(r),a||(this.stats.ksize+=this._getKeyLength(t),this.stats.keys++),this.emit("set",t,r),!0}mset(t){var r,n,i,a,s,l,c,u,d;if(o(this,e),this.options.maxKeys>-1&&this.stats.keys+t.length>=this.options.maxKeys)throw this._error("ECACHEFULL");for(n=0,l=t.length;n=0?this.data[t]=this._wrap(this.data[t].v,r,!1):this.del(t),0))}getTtl(t){var r;if(o(this,e),t){if(null!=(r=this._isInvalidKey(t)))throw r;return null!=this.data[t]&&this._check(t,this.data[t])?this.data[t].t:void 0}}keys(){return o(this,e),Object.keys(this.data)}has(t){return o(this,e),null!=this.data[t]&&this._check(t,this.data[t])}getStats(){return o(this,e),this.stats}flushAll(t=!0){o(this,e),this.data={},this.stats={hits:0,misses:0,keys:0,ksize:0,vsize:0},this._killCheckPeriod(),this._checkData(t),this.emit("flush")}flushStats(){o(this,e),this.stats={hits:0,misses:0,keys:0,ksize:0,vsize:0},this.emit("flush_stats")}close(){o(this,e),this._killCheckPeriod()}_checkData(t=!0){var r,n,i;for(r in o(this,e),n=this.data)i=n[r],this._check(r,i);t&&this.options.checkperiod>0&&(this.checkTimeout=setTimeout(this._checkData,1e3*this.options.checkperiod,t),null!=this.checkTimeout&&null!=this.checkTimeout.unref&&this.checkTimeout.unref())}_killCheckPeriod(){if(null!=this.checkTimeout)return clearTimeout(this.checkTimeout)}_check(t,r){var n;return o(this,e),n=!0,0!==r.t&&r.t{"use strict";r(96605),r(77667),r(86024),r(1368),r(44350),r(90618);var n=r(92046);e.exports=n.DisposableStack},80193:(e,t,r)=>{"use strict";r(87152);var n=r(80560);e.exports=n.f("dispose")},82159:(e,t,r)=>{"use strict";var n=r(62250),i=r(4640),o=TypeError;e.exports=function(e){if(n(e))return e;throw new o(i(e)+" is not a function")}},10043:(e,t,r)=>{"use strict";var n=r(54018),i=String,o=TypeError;e.exports=function(e){if(n(e))return e;throw new o("Can't set "+i(e)+" as a prototype")}},90534:(e,t,r)=>{"use strict";var n=r(13930),i=r(1907),o=r(28311),a=r(36624),s=r(82159),l=r(87136),c=r(29367),u=r(76264),d=u("asyncDispose"),h=u("dispose"),p=i([].push),f=function(e,t,r){return arguments.length<3&&!l(e)&&(r=s(function(e,t){if("async-dispose"===t){var r=c(e,d);return void 0!==r||void 0===(r=c(e,h))?r:function(){n(r,this)}}return c(e,h)}(a(e),t))),void 0===r?function(){}:o(r,e)};e.exports=function(e,t,r,n){var i;if(arguments.length<4){if(l(t)&&"sync-dispose"===r)return;i=f(t,r)}else i=f(void 0,r,n);p(e.stack,i)}},59596:(e,t,r)=>{"use strict";var n=r(88280),i=TypeError;e.exports=function(e,t){if(n(t,e))return e;throw new i("Incorrect invocation")}},36624:(e,t,r)=>{"use strict";var n=r(46285),i=String,o=TypeError;e.exports=function(e){if(n(e))return e;throw new o(i(e)+" is not an object")}},74436:(e,t,r)=>{"use strict";var n=r(27374),i=r(34849),o=r(20575),a=function(e){return function(t,r,a){var s=n(t),l=o(s);if(0===l)return!e&&-1;var c,u=i(a,l);if(e&&r!=r){for(;l>u;)if((c=s[u++])!=c)return!0}else for(;l>u;u++)if((e||u in s)&&s[u]===r)return e||u||0;return!e&&-1}};e.exports={includes:a(!0),indexOf:a(!1)}},45807:(e,t,r)=>{"use strict";var n=r(1907),i=n({}.toString),o=n("".slice);e.exports=function(e){return o(i(e),8,-1)}},73948:(e,t,r)=>{"use strict";var n=r(52623),i=r(62250),o=r(45807),a=r(76264)("toStringTag"),s=Object,l="Arguments"===o(function(){return arguments}());e.exports=n?o:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(e){}}(t=s(e),a))?r:l?o(t):"Object"===(n=o(t))&&i(t.callee)?"Arguments":n}},19595:(e,t,r)=>{"use strict";var n=r(49724),i=r(11042),o=r(13846),a=r(74284);e.exports=function(e,t,r){for(var s=i(t),l=a.f,c=o.f,u=0;u{"use strict";var n=r(98828);e.exports=!n((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},61626:(e,t,r)=>{"use strict";var n=r(39447),i=r(74284),o=r(75817);e.exports=n?function(e,t,r){return i.f(e,t,o(1,r))}:function(e,t,r){return e[t]=r,e}},75817:e=>{"use strict";e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},89251:(e,t,r)=>{"use strict";var n=r(74284);e.exports=function(e,t,r){return n.f(e,t,r)}},68055:(e,t,r)=>{"use strict";var n=r(61626);e.exports=function(e,t,r,i){return i&&i.enumerable?e[t]=r:n(e,t,r),e}},12802:(e,t,r)=>{"use strict";var n=r(68055);e.exports=function(e,t,r){for(var i in t)r&&r.unsafe&&e[i]?e[i]=t[i]:n(e,i,t[i],r);return e}},2532:(e,t,r)=>{"use strict";var n=r(45951),i=Object.defineProperty;e.exports=function(e,t){try{i(n,e,{value:t,configurable:!0,writable:!0})}catch(r){n[e]=t}return t}},39447:(e,t,r)=>{"use strict";var n=r(98828);e.exports=!n((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))},49552:(e,t,r)=>{"use strict";var n=r(45951),i=r(46285),o=n.document,a=i(o)&&i(o.createElement);e.exports=function(e){return a?o.createElement(e):{}}},80376:e=>{"use strict";e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},96794:(e,t,r)=>{"use strict";var n=r(45951).navigator,i=n&&n.userAgent;e.exports=i?String(i):""},20798:(e,t,r)=>{"use strict";var n,i,o=r(45951),a=r(96794),s=o.process,l=o.Deno,c=s&&s.versions||l&&l.version,u=c&&c.v8;u&&(i=(n=u.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!i&&a&&(!(n=a.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=a.match(/Chrome\/(\d+)/))&&(i=+n[1]),e.exports=i},85762:(e,t,r)=>{"use strict";var n=r(1907),i=Error,o=n("".replace),a=String(new i("zxcasd").stack),s=/\n\s*at [^:]*:[^\n]*/,l=s.test(a);e.exports=function(e,t){if(l&&"string"==typeof e&&!i.prepareStackTrace)for(;t--;)e=o(e,s,"");return e}},85884:(e,t,r)=>{"use strict";var n=r(61626),i=r(85762),o=r(23888),a=Error.captureStackTrace;e.exports=function(e,t,r,s){o&&(a?a(e,t):n(e,"stack",i(r,s)))}},23888:(e,t,r)=>{"use strict";var n=r(98828),i=r(75817);e.exports=!n((function(){var e=new Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",i(1,7)),7!==e.stack)}))},11091:(e,t,r)=>{"use strict";var n=r(45951),i=r(76024),o=r(92361),a=r(62250),s=r(13846).f,l=r(7463),c=r(92046),u=r(28311),d=r(61626),h=r(49724);r(36128);var p=function(e){var t=function(r,n,o){if(this instanceof t){switch(arguments.length){case 0:return new e;case 1:return new e(r);case 2:return new e(r,n)}return new e(r,n,o)}return i(e,this,arguments)};return t.prototype=e.prototype,t};e.exports=function(e,t){var r,i,f,m,g,v,y,b,_,S=e.target,w=e.global,E=e.stat,C=e.proto,O=w?n:E?n[S]:n[S]&&n[S].prototype,P=w?c:c[S]||d(c,S,{})[S],T=P.prototype;for(m in t)i=!(r=l(w?m:S+(E?".":"#")+m,e.forced))&&O&&h(O,m),v=P[m],i&&(y=e.dontCallGetSet?(_=s(O,m))&&_.value:O[m]),g=i&&y?y:t[m],(r||C||typeof v!=typeof g)&&(b=e.bind&&i?u(g,n):e.wrap&&i?p(g):C&&a(g)?o(g):g,(e.sham||g&&g.sham||v&&v.sham)&&d(b,"sham",!0),d(P,m,b),C&&(h(c,f=S+"Prototype")||d(c,f,{}),d(c[f],m,g),e.real&&T&&(r||!T[m])&&d(T,m,g)))}},98828:e=>{"use strict";e.exports=function(e){try{return!!e()}catch(e){return!0}}},76024:(e,t,r)=>{"use strict";var n=r(41505),i=Function.prototype,o=i.apply,a=i.call;e.exports="object"==typeof Reflect&&Reflect.apply||(n?a.bind(o):function(){return a.apply(o,arguments)})},28311:(e,t,r)=>{"use strict";var n=r(92361),i=r(82159),o=r(41505),a=n(n.bind);e.exports=function(e,t){return i(e),void 0===t?e:o?a(e,t):function(){return e.apply(t,arguments)}}},41505:(e,t,r)=>{"use strict";var n=r(98828);e.exports=!n((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},13930:(e,t,r)=>{"use strict";var n=r(41505),i=Function.prototype.call;e.exports=n?i.bind(i):function(){return i.apply(i,arguments)}},51871:(e,t,r)=>{"use strict";var n=r(1907),i=r(82159);e.exports=function(e,t,r){try{return n(i(Object.getOwnPropertyDescriptor(e,t)[r]))}catch(e){}}},92361:(e,t,r)=>{"use strict";var n=r(45807),i=r(1907);e.exports=function(e){if("Function"===n(e))return i(e)}},1907:(e,t,r)=>{"use strict";var n=r(41505),i=Function.prototype,o=i.call,a=n&&i.bind.bind(o,o);e.exports=n?a:function(e){return function(){return o.apply(e,arguments)}}},85582:(e,t,r)=>{"use strict";var n=r(92046),i=r(45951),o=r(62250),a=function(e){return o(e)?e:void 0};e.exports=function(e,t){return arguments.length<2?a(n[e])||a(i[e]):n[e]&&n[e][t]||i[e]&&i[e][t]}},29367:(e,t,r)=>{"use strict";var n=r(82159),i=r(87136);e.exports=function(e,t){var r=e[t];return i(r)?void 0:n(r)}},45951:function(e,t,r){"use strict";var n=function(e){return e&&e.Math===Math&&e};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof r.g&&r.g)||n("object"==typeof this&&this)||function(){return this}()||Function("return this")()},49724:(e,t,r)=>{"use strict";var n=r(1907),i=r(39298),o=n({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return o(i(e),t)}},38530:e=>{"use strict";e.exports={}},62416:(e,t,r)=>{"use strict";var n=r(85582);e.exports=n("document","documentElement")},73648:(e,t,r)=>{"use strict";var n=r(39447),i=r(98828),o=r(49552);e.exports=!n&&!i((function(){return 7!==Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},16946:(e,t,r)=>{"use strict";var n=r(1907),i=r(98828),o=r(45807),a=Object,s=n("".split);e.exports=i((function(){return!a("z").propertyIsEnumerable(0)}))?function(e){return"String"===o(e)?s(e,""):a(e)}:a},34084:(e,t,r)=>{"use strict";var n=r(62250),i=r(46285),o=r(79192);e.exports=function(e,t,r){var a,s;return o&&n(a=t.constructor)&&a!==r&&i(s=a.prototype)&&s!==r.prototype&&o(e,s),e}},39259:(e,t,r)=>{"use strict";var n=r(46285),i=r(61626);e.exports=function(e,t){n(t)&&"cause"in t&&i(e,"cause",t.cause)}},64932:(e,t,r)=>{"use strict";var n,i,o,a=r(40551),s=r(45951),l=r(46285),c=r(61626),u=r(49724),d=r(36128),h=r(92522),p=r(38530),f="Object already initialized",m=s.TypeError,g=s.WeakMap;if(a||d.state){var v=d.state||(d.state=new g);v.get=v.get,v.has=v.has,v.set=v.set,n=function(e,t){if(v.has(e))throw new m(f);return t.facade=e,v.set(e,t),t},i=function(e){return v.get(e)||{}},o=function(e){return v.has(e)}}else{var y=h("state");p[y]=!0,n=function(e,t){if(u(e,y))throw new m(f);return t.facade=e,c(e,y,t),t},i=function(e){return u(e,y)?e[y]:{}},o=function(e){return u(e,y)}}e.exports={set:n,get:i,has:o,enforce:function(e){return o(e)?i(e):n(e,{})},getterFor:function(e){return function(t){var r;if(!l(t)||(r=i(t)).type!==e)throw new m("Incompatible receiver, "+e+" required");return r}}}},62250:e=>{"use strict";var t="object"==typeof document&&document.all;e.exports=void 0===t&&void 0!==t?function(e){return"function"==typeof e||e===t}:function(e){return"function"==typeof e}},7463:(e,t,r)=>{"use strict";var n=r(98828),i=r(62250),o=/#|\.prototype\./,a=function(e,t){var r=l[s(e)];return r===u||r!==c&&(i(t)?n(t):!!t)},s=a.normalize=function(e){return String(e).replace(o,".").toLowerCase()},l=a.data={},c=a.NATIVE="N",u=a.POLYFILL="P";e.exports=a},87136:e=>{"use strict";e.exports=function(e){return null==e}},46285:(e,t,r)=>{"use strict";var n=r(62250);e.exports=function(e){return"object"==typeof e?null!==e:n(e)}},54018:(e,t,r)=>{"use strict";var n=r(46285);e.exports=function(e){return n(e)||null===e}},7376:e=>{"use strict";e.exports=!0},25594:(e,t,r)=>{"use strict";var n=r(85582),i=r(62250),o=r(88280),a=r(51175),s=Object;e.exports=a?function(e){return"symbol"==typeof e}:function(e){var t=n("Symbol");return i(t)&&o(t.prototype,s(e))}},95116:(e,t,r)=>{"use strict";var n,i,o,a=r(98828),s=r(62250),l=r(46285),c=r(58075),u=r(15972),d=r(68055),h=r(76264),p=r(7376),f=h("iterator"),m=!1;[].keys&&("next"in(o=[].keys())?(i=u(u(o)))!==Object.prototype&&(n=i):m=!0),!l(n)||a((function(){var e={};return n[f].call(e)!==e}))?n={}:p&&(n=c(n)),s(n[f])||d(n,f,(function(){return this})),e.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:m}},20575:(e,t,r)=>{"use strict";var n=r(3121);e.exports=function(e){return n(e.length)}},41176:e=>{"use strict";var t=Math.ceil,r=Math.floor;e.exports=Math.trunc||function(e){var n=+e;return(n>0?r:t)(n)}},32096:(e,t,r)=>{"use strict";var n=r(90160);e.exports=function(e,t){return void 0===e?arguments.length<2?"":t:n(e)}},58075:(e,t,r)=>{"use strict";var n,i=r(36624),o=r(42220),a=r(80376),s=r(38530),l=r(62416),c=r(49552),u=r(92522),d="prototype",h="script",p=u("IE_PROTO"),f=function(){},m=function(e){return"<"+h+">"+e+""},g=function(e){e.write(m("")),e.close();var t=e.parentWindow.Object;return e=null,t},v=function(){try{n=new ActiveXObject("htmlfile")}catch(e){}var e,t,r;v="undefined"!=typeof document?document.domain&&n?g(n):(t=c("iframe"),r="java"+h+":",t.style.display="none",l.appendChild(t),t.src=String(r),(e=t.contentWindow.document).open(),e.write(m("document.F=Object")),e.close(),e.F):g(n);for(var i=a.length;i--;)delete v[d][a[i]];return v()};s[p]=!0,e.exports=Object.create||function(e,t){var r;return null!==e?(f[d]=i(e),r=new f,f[d]=null,r[p]=e):r=v(),void 0===t?r:o.f(r,t)}},42220:(e,t,r)=>{"use strict";var n=r(39447),i=r(58661),o=r(74284),a=r(36624),s=r(27374),l=r(2875);t.f=n&&!i?Object.defineProperties:function(e,t){a(e);for(var r,n=s(t),i=l(t),c=i.length,u=0;c>u;)o.f(e,r=i[u++],n[r]);return e}},74284:(e,t,r)=>{"use strict";var n=r(39447),i=r(73648),o=r(58661),a=r(36624),s=r(70470),l=TypeError,c=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d="enumerable",h="configurable",p="writable";t.f=n?o?function(e,t,r){if(a(e),t=s(t),a(r),"function"==typeof e&&"prototype"===t&&"value"in r&&p in r&&!r[p]){var n=u(e,t);n&&n[p]&&(e[t]=r.value,r={configurable:h in r?r[h]:n[h],enumerable:d in r?r[d]:n[d],writable:!1})}return c(e,t,r)}:c:function(e,t,r){if(a(e),t=s(t),a(r),i)try{return c(e,t,r)}catch(e){}if("get"in r||"set"in r)throw new l("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},13846:(e,t,r)=>{"use strict";var n=r(39447),i=r(13930),o=r(22574),a=r(75817),s=r(27374),l=r(70470),c=r(49724),u=r(73648),d=Object.getOwnPropertyDescriptor;t.f=n?d:function(e,t){if(e=s(e),t=l(t),u)try{return d(e,t)}catch(e){}if(c(e,t))return a(!i(o.f,e,t),e[t])}},24443:(e,t,r)=>{"use strict";var n=r(23045),i=r(80376).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return n(e,i)}},87170:(e,t)=>{"use strict";t.f=Object.getOwnPropertySymbols},15972:(e,t,r)=>{"use strict";var n=r(49724),i=r(62250),o=r(39298),a=r(92522),s=r(57382),l=a("IE_PROTO"),c=Object,u=c.prototype;e.exports=s?c.getPrototypeOf:function(e){var t=o(e);if(n(t,l))return t[l];var r=t.constructor;return i(r)&&t instanceof r?r.prototype:t instanceof c?u:null}},88280:(e,t,r)=>{"use strict";var n=r(1907);e.exports=n({}.isPrototypeOf)},23045:(e,t,r)=>{"use strict";var n=r(1907),i=r(49724),o=r(27374),a=r(74436).indexOf,s=r(38530),l=n([].push);e.exports=function(e,t){var r,n=o(e),c=0,u=[];for(r in n)!i(s,r)&&i(n,r)&&l(u,r);for(;t.length>c;)i(n,r=t[c++])&&(~a(u,r)||l(u,r));return u}},2875:(e,t,r)=>{"use strict";var n=r(23045),i=r(80376);e.exports=Object.keys||function(e){return n(e,i)}},22574:(e,t)=>{"use strict";var r={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,i=n&&!r.call({1:2},1);t.f=i?function(e){var t=n(this,e);return!!t&&t.enumerable}:r},79192:(e,t,r)=>{"use strict";var n=r(51871),i=r(46285),o=r(74239),a=r(10043);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=n(Object.prototype,"__proto__","set"))(r,[]),t=r instanceof Array}catch(e){}return function(r,n){return o(r),a(n),i(r)?(t?e(r,n):r.__proto__=n,r):r}}():void 0)},60581:(e,t,r)=>{"use strict";var n=r(13930),i=r(62250),o=r(46285),a=TypeError;e.exports=function(e,t){var r,s;if("string"===t&&i(r=e.toString)&&!o(s=n(r,e)))return s;if(i(r=e.valueOf)&&!o(s=n(r,e)))return s;if("string"!==t&&i(r=e.toString)&&!o(s=n(r,e)))return s;throw new a("Can't convert object to primitive value")}},11042:(e,t,r)=>{"use strict";var n=r(85582),i=r(1907),o=r(24443),a=r(87170),s=r(36624),l=i([].concat);e.exports=n("Reflect","ownKeys")||function(e){var t=o.f(s(e)),r=a.f;return r?l(t,r(e)):t}},92046:e=>{"use strict";e.exports={}},54829:(e,t,r)=>{"use strict";var n=r(74284).f;e.exports=function(e,t,r){r in e||n(e,r,{configurable:!0,get:function(){return t[r]},set:function(e){t[r]=e}})}},74239:(e,t,r)=>{"use strict";var n=r(87136),i=TypeError;e.exports=function(e){if(n(e))throw new i("Can't call method on "+e);return e}},92522:(e,t,r)=>{"use strict";var n=r(85816),i=r(6499),o=n("keys");e.exports=function(e){return o[e]||(o[e]=i(e))}},36128:(e,t,r)=>{"use strict";var n=r(7376),i=r(45951),o=r(2532),a="__core-js_shared__",s=e.exports=i[a]||o(a,{});(s.versions||(s.versions=[])).push({version:"3.39.0",mode:n?"pure":"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.39.0/LICENSE",source:"https://github.com/zloirock/core-js"})},85816:(e,t,r)=>{"use strict";var n=r(36128);e.exports=function(e,t){return n[e]||(n[e]=t||{})}},19846:(e,t,r)=>{"use strict";var n=r(20798),i=r(98828),o=r(45951).String;e.exports=!!Object.getOwnPropertySymbols&&!i((function(){var e=Symbol("symbol detection");return!o(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},34849:(e,t,r)=>{"use strict";var n=r(65482),i=Math.max,o=Math.min;e.exports=function(e,t){var r=n(e);return r<0?i(r+t,0):o(r,t)}},27374:(e,t,r)=>{"use strict";var n=r(16946),i=r(74239);e.exports=function(e){return n(i(e))}},65482:(e,t,r)=>{"use strict";var n=r(41176);e.exports=function(e){var t=+e;return t!=t||0===t?0:n(t)}},3121:(e,t,r)=>{"use strict";var n=r(65482),i=Math.min;e.exports=function(e){var t=n(e);return t>0?i(t,9007199254740991):0}},39298:(e,t,r)=>{"use strict";var n=r(74239),i=Object;e.exports=function(e){return i(n(e))}},46028:(e,t,r)=>{"use strict";var n=r(13930),i=r(46285),o=r(25594),a=r(29367),s=r(60581),l=r(76264),c=TypeError,u=l("toPrimitive");e.exports=function(e,t){if(!i(e)||o(e))return e;var r,l=a(e,u);if(l){if(void 0===t&&(t="default"),r=n(l,e,t),!i(r)||o(r))return r;throw new c("Can't convert object to primitive value")}return void 0===t&&(t="number"),s(e,t)}},70470:(e,t,r)=>{"use strict";var n=r(46028),i=r(25594);e.exports=function(e){var t=n(e,"string");return i(t)?t:t+""}},52623:(e,t,r)=>{"use strict";var n={};n[r(76264)("toStringTag")]="z",e.exports="[object z]"===String(n)},90160:(e,t,r)=>{"use strict";var n=r(73948),i=String;e.exports=function(e){if("Symbol"===n(e))throw new TypeError("Cannot convert a Symbol value to a string");return i(e)}},4640:e=>{"use strict";var t=String;e.exports=function(e){try{return t(e)}catch(e){return"Object"}}},6499:(e,t,r)=>{"use strict";var n=r(1907),i=0,o=Math.random(),a=n(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+a(++i+o,36)}},51175:(e,t,r)=>{"use strict";var n=r(19846);e.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},58661:(e,t,r)=>{"use strict";var n=r(39447),i=r(98828);e.exports=n&&i((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},40551:(e,t,r)=>{"use strict";var n=r(45951),i=r(62250),o=n.WeakMap;e.exports=i(o)&&/native code/.test(String(o))},20366:(e,t,r)=>{"use strict";var n=r(92046),i=r(49724),o=r(80560),a=r(74284).f;e.exports=function(e){var t=n.Symbol||(n.Symbol={});i(t,e)||a(t,e,{value:o.f(e)})}},80560:(e,t,r)=>{"use strict";var n=r(76264);t.f=n},76264:(e,t,r)=>{"use strict";var n=r(45951),i=r(85816),o=r(49724),a=r(6499),s=r(19846),l=r(51175),c=n.Symbol,u=i("wks"),d=l?c.for||c:c&&c.withoutSetter||a;e.exports=function(e){return o(u,e)||(u[e]=s&&o(c,e)?c[e]:d("Symbol."+e)),u[e]}},19358:(e,t,r)=>{"use strict";var n=r(85582),i=r(49724),o=r(61626),a=r(88280),s=r(79192),l=r(19595),c=r(54829),u=r(34084),d=r(32096),h=r(39259),p=r(85884),f=r(39447),m=r(7376);e.exports=function(e,t,r,g){var v="stackTraceLimit",y=g?2:1,b=e.split("."),_=b[b.length-1],S=n.apply(null,b);if(S){var w=S.prototype;if(!m&&i(w,"cause")&&delete w.cause,!r)return S;var E=n("Error"),C=t((function(e,t){var r=d(g?t:e,void 0),n=g?new S(e):new S;return void 0!==r&&o(n,"message",r),p(n,C,n.stack,2),this&&a(w,this)&&u(n,this,C),arguments.length>y&&h(n,arguments[y]),n}));if(C.prototype=w,"Error"!==_?s?s(C,E):l(C,E,{name:!0}):f&&v in S&&(c(C,S,v),c(C,S,"prepareStackTrace")),l(C,S),!m)try{w.name!==_&&o(w,"name",_),w.constructor=C}catch(e){}return C}}},96605:(e,t,r)=>{"use strict";var n=r(11091),i=r(45951),o=r(76024),a=r(19358),s="WebAssembly",l=i[s],c=7!==new Error("e",{cause:7}).cause,u=function(e,t){var r={};r[e]=a(e,t,c),n({global:!0,constructor:!0,arity:1,forced:c},r)},d=function(e,t){if(l&&l[e]){var r={};r[e]=a(s+"."+e,t,c),n({target:s,stat:!0,constructor:!0,arity:1,forced:c},r)}};u("Error",(function(e){return function(t){return o(e,this,arguments)}})),u("EvalError",(function(e){return function(t){return o(e,this,arguments)}})),u("RangeError",(function(e){return function(t){return o(e,this,arguments)}})),u("ReferenceError",(function(e){return function(t){return o(e,this,arguments)}})),u("SyntaxError",(function(e){return function(t){return o(e,this,arguments)}})),u("TypeError",(function(e){return function(t){return o(e,this,arguments)}})),u("URIError",(function(e){return function(t){return o(e,this,arguments)}})),d("CompileError",(function(e){return function(t){return o(e,this,arguments)}})),d("LinkError",(function(e){return function(t){return o(e,this,arguments)}})),d("RuntimeError",(function(e){return function(t){return o(e,this,arguments)}}))},77667:()=>{},86024:()=>{},44350:(e,t,r)=>{"use strict";var n=r(11091),i=r(39447),o=r(85582),a=r(82159),s=r(59596),l=r(68055),c=r(12802),u=r(89251),d=r(76264),h=r(64932),p=r(90534),f=o("SuppressedError"),m=ReferenceError,g=d("dispose"),v=d("toStringTag"),y="DisposableStack",b=h.set,_=h.getterFor(y),S="sync-dispose",w="disposed",E=function(e){var t=_(e);if(t.state===w)throw new m(y+" already disposed");return t},C=function(){b(s(this,O),{type:y,state:"pending",stack:[]}),i||(this.disposed=!1)},O=C.prototype;c(O,{dispose:function(){var e=_(this);if(e.state!==w){e.state=w,i||(this.disposed=!0);for(var t,r=e.stack,n=r.length,o=!1;n;){var a=r[--n];r[n]=null;try{a()}catch(e){o?t=new f(e,t):(o=!0,t=e)}}if(e.stack=null,o)throw t}},use:function(e){return p(E(this),e,S),e},adopt:function(e,t){var r=E(this);return a(t),p(r,void 0,S,(function(){t(e)})),e},defer:function(e){var t=E(this);a(e),p(t,void 0,S,e)},move:function(){var e=E(this),t=new C;return _(t).stack=e.stack,e.stack=[],e.state=w,i||(this.disposed=!0),t}}),i&&u(O,"disposed",{configurable:!0,get:function(){return _(this).state===w}}),l(O,g,O.dispose,{name:"dispose"}),l(O,v,y,{nonWritable:!0}),n({global:!0,constructor:!0},{DisposableStack:C})},90618:(e,t,r)=>{"use strict";var n=r(13930),i=r(68055),o=r(29367),a=r(49724),s=r(76264),l=r(95116).IteratorPrototype,c=s("dispose");a(l,c)||i(l,c,(function(){var e=o(this,"return");e&&n(e,this)}))},1368:(e,t,r)=>{"use strict";var n=r(11091),i=r(45951),o=r(88280),a=r(15972),s=r(79192),l=r(19595),c=r(58075),u=r(61626),d=r(75817),h=r(85884),p=r(32096),f=r(76264),m=r(98828),g=r(7376),v=i.SuppressedError,y=f("toStringTag"),b=Error,_=!!v&&3!==v.length,S=!!v&&m((function(){return 4===new v(1,2,3,{cause:4}).cause})),w=_||S,E=function(e,t,r){var n,i=o(C,this);return s?n=!w||i&&a(this)!==C?s(new b,i?a(this):C):new v:(n=i?this:c(C),u(n,y,"Error")),void 0!==r&&u(n,"message",p(r)),h(n,E,n.stack,1),u(n,"error",e),u(n,"suppressed",t),n};s?s(E,b):l(E,b,{name:!0});var C=E.prototype=w?v.prototype:c(b.prototype,{constructor:d(1,E),message:d(1,""),name:d(1,"SuppressedError")});w&&!g&&(C.constructor=E),n({global:!0,constructor:!0,arity:3,forced:w},{SuppressedError:E})},87152:(e,t,r)=>{"use strict";r(20366)("dispose")},3267:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(13648);const i=(e,t)=>e!==t&&(0,n.isObject)(e)&&(0,n.isObject)(t)?Object.keys(t).reduce(((r,o)=>{if((0,n.hasOwnProperty)(e,o)){const a=i(e[o],t[o]);return(0,n.isObject)(a)&&(0,n.isEmpty)(a)||(r[o]=a),r}return r[o]=t[o],r}),(0,n.makeObjectWithoutPrototype)()):{};var o=i;t.default=o},59684:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(13648);const i=(e,t)=>e!==t&&(0,n.isObject)(e)&&(0,n.isObject)(t)?Object.keys(e).reduce(((r,o)=>{if((0,n.hasOwnProperty)(t,o)){const a=i(e[o],t[o]);return(0,n.isObject)(a)&&(0,n.isEmpty)(a)||(r[o]=a),r}return r[o]=void 0,r}),(0,n.makeObjectWithoutPrototype)()):{};var o=i;t.default=o},53513:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=a(r(3267)),i=a(r(59684)),o=a(r(34546));function a(e){return e&&e.__esModule?e:{default:e}}t.default=(e,t)=>({added:(0,n.default)(e,t),deleted:(0,i.default)(e,t),updated:(0,o.default)(e,t)})},92950:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(13648);const i=(e,t)=>{if(e===t)return{};if(!(0,n.isObject)(e)||!(0,n.isObject)(t))return t;const r=Object.keys(e).reduce(((e,r)=>((0,n.hasOwnProperty)(t,r)||(e[r]=void 0),e)),(0,n.makeObjectWithoutPrototype)());return(0,n.isDate)(e)||(0,n.isDate)(t)?e.valueOf()==t.valueOf()?{}:t:Object.keys(t).reduce(((r,o)=>{if(!(0,n.hasOwnProperty)(e,o))return r[o]=t[o],r;const a=i(e[o],t[o]);return!(0,n.isEmptyObject)(a)||(0,n.isDate)(a)||!(0,n.isEmptyObject)(e[o])&&(0,n.isEmptyObject)(t[o])?(r[o]=a,r):r}),r)};var o=i;t.default=o},63637:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"addedDiff",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"deletedDiff",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"detailedDiff",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"diff",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(t,"updatedDiff",{enumerable:!0,get:function(){return a.default}});var n=l(r(92950)),i=l(r(3267)),o=l(r(59684)),a=l(r(34546)),s=l(r(53513));function l(e){return e&&e.__esModule?e:{default:e}}},34546:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(13648);const i=(e,t)=>e===t?{}:(0,n.isObject)(e)&&(0,n.isObject)(t)?(0,n.isDate)(e)||(0,n.isDate)(t)?e.valueOf()==t.valueOf()?{}:t:Object.keys(t).reduce(((r,o)=>{if((0,n.hasOwnProperty)(e,o)){const a=i(e[o],t[o]);return!(0,n.isEmptyObject)(a)||(0,n.isDate)(a)||!(0,n.isEmptyObject)(e[o])&&(0,n.isEmptyObject)(t[o])?(r[o]=a,r):r}return r}),(0,n.makeObjectWithoutPrototype)()):t;var o=i;t.default=o},13648:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.makeObjectWithoutPrototype=t.isObject=t.isEmptyObject=t.isEmpty=t.isDate=t.hasOwnProperty=void 0,t.isDate=e=>e instanceof Date;const r=e=>0===Object.keys(e).length;t.isEmpty=r;const n=e=>null!=e&&"object"==typeof e;t.isObject=n,t.hasOwnProperty=(e,...t)=>Object.prototype.hasOwnProperty.call(e,...t),t.isEmptyObject=e=>n(e)&&r(e),t.makeObjectWithoutPrototype=()=>Object.create(null)},41278:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.jwtDecode=t.InvalidTokenError=void 0;class r extends Error{}t.InvalidTokenError=r,r.prototype.name="InvalidTokenError",t.jwtDecode=function(e,t){if("string"!=typeof e)throw new r("Invalid token specified: must be a string");t||(t={});const n=!0===t.header?0:1,i=e.split(".")[n];if("string"!=typeof i)throw new r(`Invalid token specified: missing part #${n+1}`);let o;try{o=function(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return function(e){return decodeURIComponent(atob(e).replace(/(.)/g,((e,t)=>{let r=t.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r})))}(t)}catch(e){return atob(t)}}(i)}catch(e){throw new r(`Invalid token specified: invalid base64 for part #${n+1} (${e.message})`)}try{return JSON.parse(o)}catch(e){throw new r(`Invalid token specified: invalid json for part #${n+1} (${e.message})`)}}},11561:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var n=!1,i="Invariant failed";function o(e,t){if(!e){if(n)throw new Error(i);var r="function"==typeof t?t():t,o=r?"".concat(i,": ").concat(r):i;throw new Error(o)}}},31635:(e,t,r)=>{"use strict";r.r(t),r.d(t,{__addDisposableResource:()=>M,__assign:()=>o,__asyncDelegator:()=>O,__asyncGenerator:()=>C,__asyncValues:()=>P,__await:()=>E,__awaiter:()=>f,__classPrivateFieldGet:()=>D,__classPrivateFieldIn:()=>x,__classPrivateFieldSet:()=>I,__createBinding:()=>g,__decorate:()=>s,__disposeResources:()=>j,__esDecorate:()=>c,__exportStar:()=>v,__extends:()=>i,__generator:()=>m,__importDefault:()=>A,__importStar:()=>R,__makeTemplateObject:()=>T,__metadata:()=>p,__param:()=>l,__propKey:()=>d,__read:()=>b,__rest:()=>a,__runInitializers:()=>u,__setFunctionName:()=>h,__spread:()=>_,__spreadArray:()=>w,__spreadArrays:()=>S,__values:()=>y,default:()=>N});var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)};function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var o=function(){return o=Object.assign||function(e){for(var t,r=1,n=arguments.length;r=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a}function l(e,t){return function(r,n){t(r,n,e)}}function c(e,t,r,n,i,o){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var s,l=n.kind,c="getter"===l?"get":"setter"===l?"set":"value",u=!t&&e?n.static?e:e.prototype:null,d=t||(u?Object.getOwnPropertyDescriptor(u,n.name):{}),h=!1,p=r.length-1;p>=0;p--){var f={};for(var m in n)f[m]="access"===m?{}:n[m];for(var m in n.access)f.access[m]=n.access[m];f.addInitializer=function(e){if(h)throw new TypeError("Cannot add initializers after decoration has completed");o.push(a(e||null))};var g=(0,r[p])("accessor"===l?{get:d.get,set:d.set}:d[c],f);if("accessor"===l){if(void 0===g)continue;if(null===g||"object"!=typeof g)throw new TypeError("Object expected");(s=a(g.get))&&(d.get=s),(s=a(g.set))&&(d.set=s),(s=a(g.init))&&i.unshift(s)}else(s=a(g))&&("field"===l?i.unshift(s):d[c]=s)}u&&Object.defineProperty(u,n.name,d),h=!0}function u(e,t,r){for(var n=arguments.length>2,i=0;i0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function b(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a}function _(){for(var e=[],t=0;t1||s(e,t)}))})}function s(e,t){try{(r=i[e](t)).value instanceof E?Promise.resolve(r.value.v).then(l,c):u(o[0][2],r)}catch(e){u(o[0][3],e)}var r}function l(e){s("next",e)}function c(e){s("throw",e)}function u(e,t){e(t),o.shift(),o.length&&s(o[0][0],o[0][1])}}function O(e){var t,r;return t={},n("next"),n("throw",(function(e){throw e})),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,i){t[n]=e[n]?function(t){return(r=!r)?{value:E(e[n](t)),done:!1}:i?i(t):t}:i}}function P(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=y(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise((function(n,i){!function(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)}(n,i,(t=e[r](t)).done,t.value)}))}}}function T(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var k=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function R(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&g(t,e,r);return k(t,e),t}function A(e){return e&&e.__esModule?e:{default:e}}function D(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)}function I(e,t,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(e,r):i?i.value=r:t.set(e,r),r}function x(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}function M(e,t,r){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var n;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose]}if(void 0===n){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose]}if("function"!=typeof n)throw new TypeError("Object not disposable.");e.stack.push({value:t,dispose:n,async:r})}else r&&e.stack.push({async:!0});return t}var L="function"==typeof SuppressedError?SuppressedError:function(e,t,r){var n=new Error(r);return n.name="SuppressedError",n.error=e,n.suppressed=t,n};function j(e){function t(t){e.error=e.hasError?new L(t,e.error,"An error was suppressed during disposal."):t,e.hasError=!0}return function r(){for(;e.stack.length;){var n=e.stack.pop();try{var i=n.dispose&&n.dispose.call(n.value);if(n.async)return Promise.resolve(i).then(r,(function(e){return t(e),r()}))}catch(e){t(e)}}if(e.hasError)throw e.error}()}const N={__extends:i,__assign:o,__rest:a,__decorate:s,__param:l,__metadata:p,__awaiter:f,__generator:m,__createBinding:g,__exportStar:v,__values:y,__read:b,__spread:_,__spreadArrays:S,__spreadArray:w,__await:E,__asyncGenerator:C,__asyncDelegator:O,__asyncValues:P,__makeTemplateObject:T,__importStar:R,__importDefault:A,__classPrivateFieldGet:D,__classPrivateFieldSet:I,__classPrivateFieldIn:x,__addDisposableResource:M,__disposeResources:j}}}]); //# sourceMappingURL=715.4727866a88ce616a045d0f98f9a9de1e.js.map