@snapcall/stream-ui 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +132 -0
- package/dist/stream-ui.esm.js +6695 -0
- package/dist/stream-ui.js +6702 -0
- package/dist/stream-ui.umd.js +1111 -0
- package/dist/types.d.ts +290 -0
- package/package.json +82 -0
|
@@ -0,0 +1,1111 @@
|
|
|
1
|
+
(()=>{function e(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0})}var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{};function r(e){return e&&e.__esModule?e.default:e}var n={},i={},a=t.parcelRequireaab1;null==a&&((a=function(e){if(e in n)return n[e].exports;if(e in i){var t=i[e];delete i[e];var r={id:e,exports:{}};return n[e]=r,t.call(r.exports,r,r.exports),r.exports}var a=new Error("Cannot find module '"+e+"'");throw a.code="MODULE_NOT_FOUND",a}).register=function(e,t){i[e]=t},t.parcelRequireaab1=a),a.register("9Hk4c",(function(t,r){var n,i,s;e(t.exports,"Fragment",(()=>n),(e=>n=e)),e(t.exports,"jsx",(()=>i),(e=>i=e)),e(t.exports,"jsxs",(()=>s),(e=>s=e)),a("kyWRD");var o=a("85Hg2"),c=60103;if(n=60107,"function"==typeof Symbol&&Symbol.for){var l=Symbol.for;c=l("react.element"),n=l("react.fragment")}var d=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,u=Object.prototype.hasOwnProperty,p={key:!0,ref:!0,__self:!0,__source:!0};function f(e,t,r){var n,i={},a=null,s=null;for(n in void 0!==r&&(a=""+r),void 0!==t.key&&(a=""+t.key),void 0!==t.ref&&(s=t.ref),t)u.call(t,n)&&!p.hasOwnProperty(n)&&(i[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps)void 0===i[n]&&(i[n]=t[n]);return{$$typeof:c,type:e,key:a,ref:s,props:i,_owner:d.current}}i=f,s=f})),a.register("kyWRD",(function(e,t){
|
|
2
|
+
/*
|
|
3
|
+
object-assign
|
|
4
|
+
(c) Sindre Sorhus
|
|
5
|
+
@license MIT
|
|
6
|
+
*/
|
|
7
|
+
"use strict";var r=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function a(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var s,o,c=a(e),l=1;l<arguments.length;l++){for(var d in s=Object(arguments[l]))n.call(s,d)&&(c[d]=s[d]);if(r){o=r(s);for(var u=0;u<o.length;u++)i.call(s,o[u])&&(c[o[u]]=s[o[u]])}}return c}})),a.register("85Hg2",(function(e,t){"use strict";e.exports=a("6tvtz")})),a.register("6tvtz",(function(t,r){var n,i,s,o,c,l,d,u,p,f,h,m,g,v,y,w,b,_,x,S,k,E,R,C,P,T,j,M;e(t.exports,"Fragment",(()=>n),(e=>n=e)),e(t.exports,"StrictMode",(()=>i),(e=>i=e)),e(t.exports,"Profiler",(()=>s),(e=>s=e)),e(t.exports,"Suspense",(()=>o),(e=>o=e)),e(t.exports,"Children",(()=>c),(e=>c=e)),e(t.exports,"Component",(()=>l),(e=>l=e)),e(t.exports,"PureComponent",(()=>d),(e=>d=e)),e(t.exports,"__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED",(()=>u),(e=>u=e)),e(t.exports,"cloneElement",(()=>p),(e=>p=e)),e(t.exports,"createContext",(()=>f),(e=>f=e)),e(t.exports,"createElement",(()=>h),(e=>h=e)),e(t.exports,"createFactory",(()=>m),(e=>m=e)),e(t.exports,"createRef",(()=>g),(e=>g=e)),e(t.exports,"forwardRef",(()=>v),(e=>v=e)),e(t.exports,"isValidElement",(()=>y),(e=>y=e)),e(t.exports,"lazy",(()=>w),(e=>w=e)),e(t.exports,"memo",(()=>b),(e=>b=e)),e(t.exports,"useCallback",(()=>_),(e=>_=e)),e(t.exports,"useContext",(()=>x),(e=>x=e)),e(t.exports,"useDebugValue",(()=>S),(e=>S=e)),e(t.exports,"useEffect",(()=>k),(e=>k=e)),e(t.exports,"useImperativeHandle",(()=>E),(e=>E=e)),e(t.exports,"useLayoutEffect",(()=>R),(e=>R=e)),e(t.exports,"useMemo",(()=>C),(e=>C=e)),e(t.exports,"useReducer",(()=>P),(e=>P=e)),e(t.exports,"useRef",(()=>T),(e=>T=e)),e(t.exports,"useState",(()=>j),(e=>j=e)),e(t.exports,"version",(()=>M),(e=>M=e));var D=a("kyWRD"),I=60103,O=60106;n=60107,i=60108,s=60114;var L=60109,A=60110,N=60112;o=60113;var F=60115,B=60116;if("function"==typeof Symbol&&Symbol.for){var z=Symbol.for;I=z("react.element"),O=z("react.portal"),n=z("react.fragment"),i=z("react.strict_mode"),s=z("react.profiler"),L=z("react.provider"),A=z("react.context"),N=z("react.forward_ref"),o=z("react.suspense"),F=z("react.memo"),B=z("react.lazy")}var $="function"==typeof Symbol&&Symbol.iterator;function U(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var V={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},H={};function W(e,t,r){this.props=e,this.context=t,this.refs=H,this.updater=r||V}function q(){}function G(e,t,r){this.props=e,this.context=t,this.refs=H,this.updater=r||V}W.prototype.isReactComponent={},W.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error(U(85));this.updater.enqueueSetState(this,e,t,"setState")},W.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},q.prototype=W.prototype;var Z=G.prototype=new q;Z.constructor=G,D(Z,W.prototype),Z.isPureReactComponent=!0;var K={current:null},Q=Object.prototype.hasOwnProperty,Y={key:!0,ref:!0,__self:!0,__source:!0};function X(e,t,r){var n,i={},a=null,s=null;if(null!=t)for(n in void 0!==t.ref&&(s=t.ref),void 0!==t.key&&(a=""+t.key),t)Q.call(t,n)&&!Y.hasOwnProperty(n)&&(i[n]=t[n]);var o=arguments.length-2;if(1===o)i.children=r;else if(1<o){for(var c=Array(o),l=0;l<o;l++)c[l]=arguments[l+2];i.children=c}if(e&&e.defaultProps)for(n in o=e.defaultProps)void 0===i[n]&&(i[n]=o[n]);return{$$typeof:I,type:e,key:a,ref:s,props:i,_owner:K.current}}function J(e){return"object"==typeof e&&null!==e&&e.$$typeof===I}var ee=/\/+/g;function te(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,(function(e){return t[e]}))}(""+e.key):t.toString(36)}function re(e,t,r,n,i){var a=typeof e;"undefined"!==a&&"boolean"!==a||(e=null);var s,o=!1;if(null===e)o=!0;else switch(a){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case I:case O:o=!0}}if(o)return i=i(o=e),e=""===n?"."+te(o,0):n,Array.isArray(i)?(r="",null!=e&&(r=e.replace(ee,"$&/")+"/"),re(i,t,r,"",(function(e){return e}))):null!=i&&(J(i)&&(i=function(e,t){return{$$typeof:I,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(i,r+(!i.key||o&&o.key===i.key?"":(""+i.key).replace(ee,"$&/")+"/")+e)),t.push(i)),1;if(o=0,n=""===n?".":n+":",Array.isArray(e))for(var c=0;c<e.length;c++){var l=n+te(a=e[c],c);o+=re(a,t,r,l,i)}else if("function"==typeof(l=null===(s=e)||"object"!=typeof s?null:"function"==typeof(s=$&&s[$]||s["@@iterator"])?s:null))for(e=l.call(e),c=0;!(a=e.next()).done;)o+=re(a=a.value,t,r,l=n+te(a,c++),i);else if("object"===a)throw t=""+e,Error(U(31,"[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t));return o}function ne(e,t,r){if(null==e)return e;var n=[],i=0;return re(e,n,"","",(function(e){return t.call(r,e,i++)})),n}function ie(e){if(-1===e._status){var t=e._result;t=t(),e._status=0,e._result=t,t.then((function(t){0===e._status&&(t=t.default,e._status=1,e._result=t)}),(function(t){0===e._status&&(e._status=2,e._result=t)}))}if(1===e._status)return e._result;throw e._result}var ae={current:null};function se(){var e=ae.current;if(null===e)throw Error(U(321));return e}c={map:ne,forEach:function(e,t,r){ne(e,(function(){t.apply(this,arguments)}),r)},count:function(e){var t=0;return ne(e,(function(){t++})),t},toArray:function(e){return ne(e,(function(e){return e}))||[]},only:function(e){if(!J(e))throw Error(U(143));return e}},l=W,d=G,u={ReactCurrentDispatcher:ae,ReactCurrentBatchConfig:{transition:0},ReactCurrentOwner:K,IsSomeRendererActing:{current:!1},assign:D},p=function(e,t,r){if(null==e)throw Error(U(267,e));var n=D({},e.props),i=e.key,a=e.ref,s=e._owner;if(null!=t){if(void 0!==t.ref&&(a=t.ref,s=K.current),void 0!==t.key&&(i=""+t.key),e.type&&e.type.defaultProps)var o=e.type.defaultProps;for(c in t)Q.call(t,c)&&!Y.hasOwnProperty(c)&&(n[c]=void 0===t[c]&&void 0!==o?o[c]:t[c])}var c=arguments.length-2;if(1===c)n.children=r;else if(1<c){o=Array(c);for(var l=0;l<c;l++)o[l]=arguments[l+2];n.children=o}return{$$typeof:I,type:e.type,key:i,ref:a,props:n,_owner:s}},f=function(e,t){return void 0===t&&(t=null),(e={$$typeof:A,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:L,_context:e},e.Consumer=e},h=X,m=function(e){var t=X.bind(null,e);return t.type=e,t},g=function(){return{current:null}},v=function(e){return{$$typeof:N,render:e}},y=J,w=function(e){return{$$typeof:B,_payload:{_status:-1,_result:e},_init:ie}},b=function(e,t){return{$$typeof:F,type:e,compare:void 0===t?null:t}},_=function(e,t){return se().useCallback(e,t)},x=function(e,t){return se().useContext(e,t)},S=function(){},k=function(e,t){return se().useEffect(e,t)},E=function(e,t,r){return se().useImperativeHandle(e,t,r)},R=function(e,t){return se().useLayoutEffect(e,t)},C=function(e,t){return se().useMemo(e,t)},P=function(e,t,r){return se().useReducer(e,t,r)},T=function(e){return se().useRef(e)},j=function(e){return se().useState(e)},M="17.0.2"})),a.register("bU6y3",(function(t,r){var n,i,s,o,c,l,d,u,p,f,h;e(t.exports,"__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED",(()=>n),(e=>n=e)),e(t.exports,"createPortal",(()=>i),(e=>i=e)),e(t.exports,"findDOMNode",(()=>s),(e=>s=e)),e(t.exports,"flushSync",(()=>o),(e=>o=e)),e(t.exports,"hydrate",(()=>c),(e=>c=e)),e(t.exports,"render",(()=>l),(e=>l=e)),e(t.exports,"unmountComponentAtNode",(()=>d),(e=>d=e)),e(t.exports,"unstable_batchedUpdates",(()=>u),(e=>u=e)),e(t.exports,"unstable_createPortal",(()=>p),(e=>p=e)),e(t.exports,"unstable_renderSubtreeIntoContainer",(()=>f),(e=>f=e)),e(t.exports,"version",(()=>h),(e=>h=e));var m=a("85Hg2"),g=a("kyWRD"),v=a("kMsGZ");function y(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}if(!m)throw Error(y(227));var w=new Set,b={};function _(e,t){x(e,t),x(e+"Capture",t)}function x(e,t){for(b[e]=t,e=0;e<t.length;e++)w.add(t[e])}var S=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),k=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,E=Object.prototype.hasOwnProperty,R={},C={};function P(e,t,r,n,i,a,s){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=s}var T={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){T[e]=new P(e,0,!1,e,null,!1,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];T[t]=new P(t,1,!1,e[1],null,!1,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){T[e]=new P(e,2,!1,e.toLowerCase(),null,!1,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){T[e]=new P(e,2,!1,e,null,!1,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){T[e]=new P(e,3,!1,e.toLowerCase(),null,!1,!1)})),["checked","multiple","muted","selected"].forEach((function(e){T[e]=new P(e,3,!0,e,null,!1,!1)})),["capture","download"].forEach((function(e){T[e]=new P(e,4,!1,e,null,!1,!1)})),["cols","rows","size","span"].forEach((function(e){T[e]=new P(e,6,!1,e,null,!1,!1)})),["rowSpan","start"].forEach((function(e){T[e]=new P(e,5,!1,e.toLowerCase(),null,!1,!1)}));var j=/[\-:]([a-z])/g;function M(e){return e[1].toUpperCase()}function D(e,t,r,n){var i=T.hasOwnProperty(t)?T[t]:null;(null!==i?0===i.type:!n&&(2<t.length&&("o"===t[0]||"O"===t[0])&&("n"===t[1]||"N"===t[1])))||(function(e,t,r,n){if(null==t||function(e,t,r,n){if(null!==r&&0===r.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!n&&(null!==r?!r.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,r,n))return!0;if(n)return!1;if(null!==r)switch(r.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,r,i,n)&&(r=null),n||null===i?function(e){return!!E.call(C,e)||!E.call(R,e)&&(k.test(e)?C[e]=!0:(R[e]=!0,!1))}(t)&&(null===r?e.removeAttribute(t):e.setAttribute(t,""+r)):i.mustUseProperty?e[i.propertyName]=null===r?3!==i.type&&"":r:(t=i.attributeName,n=i.attributeNamespace,null===r?e.removeAttribute(t):(r=3===(i=i.type)||4===i&&!0===r?"":""+r,n?e.setAttributeNS(n,t,r):e.setAttribute(t,r))))}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var t=e.replace(j,M);T[t]=new P(t,1,!1,e,null,!1,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(j,M);T[t]=new P(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(j,M);T[t]=new P(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)})),["tabIndex","crossOrigin"].forEach((function(e){T[e]=new P(e,1,!1,e.toLowerCase(),null,!1,!1)})),T.xlinkHref=new P("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach((function(e){T[e]=new P(e,1,!1,e.toLowerCase(),null,!0,!0)}));var I=m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,O=60103,L=60106,A=60107,N=60108,F=60114,B=60109,z=60110,$=60112,U=60113,V=60120,H=60115,W=60116,q=60121,G=60128,Z=60129,K=60130,Q=60131;if("function"==typeof Symbol&&Symbol.for){var Y=Symbol.for;O=Y("react.element"),L=Y("react.portal"),A=Y("react.fragment"),N=Y("react.strict_mode"),F=Y("react.profiler"),B=Y("react.provider"),z=Y("react.context"),$=Y("react.forward_ref"),U=Y("react.suspense"),V=Y("react.suspense_list"),H=Y("react.memo"),W=Y("react.lazy"),q=Y("react.block"),Y("react.scope"),G=Y("react.opaque.id"),Z=Y("react.debug_trace_mode"),K=Y("react.offscreen"),Q=Y("react.legacy_hidden")}var X,J="function"==typeof Symbol&&Symbol.iterator;function ee(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=J&&e[J]||e["@@iterator"])?e:null}function te(e){if(void 0===X)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);X=t&&t[1]||""}return"\n"+X+e}var re=!1;function ne(e,t){if(!e||re)return"";re=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(e){var n=e}Reflect.construct(e,[],t)}else{try{t.call()}catch(e){n=e}e.call(t.prototype)}else{try{throw Error()}catch(e){n=e}e()}}catch(e){if(e&&n&&"string"==typeof e.stack){for(var i=e.stack.split("\n"),a=n.stack.split("\n"),s=i.length-1,o=a.length-1;1<=s&&0<=o&&i[s]!==a[o];)o--;for(;1<=s&&0<=o;s--,o--)if(i[s]!==a[o]){if(1!==s||1!==o)do{if(s--,0>--o||i[s]!==a[o])return"\n"+i[s].replace(" at new "," at ")}while(1<=s&&0<=o);break}}}finally{re=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?te(e):""}function ie(e){switch(e.tag){case 5:return te(e.type);case 16:return te("Lazy");case 13:return te("Suspense");case 19:return te("SuspenseList");case 0:case 2:case 15:return e=ne(e.type,!1);case 11:return e=ne(e.type.render,!1);case 22:return e=ne(e.type._render,!1);case 1:return e=ne(e.type,!0);default:return""}}function ae(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case A:return"Fragment";case L:return"Portal";case F:return"Profiler";case N:return"StrictMode";case U:return"Suspense";case V:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case z:return(e.displayName||"Context")+".Consumer";case B:return(e._context.displayName||"Context")+".Provider";case $:var t=e.render;return t=t.displayName||t.name||"",e.displayName||(""!==t?"ForwardRef("+t+")":"ForwardRef");case H:return ae(e.type);case q:return ae(e._render);case W:t=e._payload,e=e._init;try{return ae(e(t))}catch(e){}}return null}function se(e){switch(typeof e){case"boolean":case"number":case"object":case"string":case"undefined":return e;default:return""}}function oe(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function ce(e){e._valueTracker||(e._valueTracker=function(e){var t=oe(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==r&&"function"==typeof r.get&&"function"==typeof r.set){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=""+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function le(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=oe(e)?e.checked?"true":"false":e.value),(e=n)!==r&&(t.setValue(e),!0)}function de(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function ue(e,t){var r=t.checked;return g({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=r?r:e._wrapperState.initialChecked})}function pe(e,t){var r=null==t.defaultValue?"":t.defaultValue,n=null!=t.checked?t.checked:t.defaultChecked;r=se(null!=t.value?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function fe(e,t){null!=(t=t.checked)&&D(e,"checked",t,!1)}function he(e,t){fe(e,t);var r=se(t.value),n=t.type;if(null!=r)"number"===n?(0===r&&""===e.value||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if("submit"===n||"reset"===n)return void e.removeAttribute("value");t.hasOwnProperty("value")?ge(e,t.type,r):t.hasOwnProperty("defaultValue")&&ge(e,t.type,se(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function me(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!("submit"!==n&&"reset"!==n||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}""!==(r=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==r&&(e.name=r)}function ge(e,t,r){"number"===t&&de(e.ownerDocument)===e||(null==r?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}function ve(e,t){return e=g({children:void 0},t),(t=function(e){var t="";return m.Children.forEach(e,(function(e){null!=e&&(t+=e)})),t}(t.children))&&(e.children=t),e}function ye(e,t,r,n){if(e=e.options,t){t={};for(var i=0;i<r.length;i++)t["$"+r[i]]=!0;for(r=0;r<e.length;r++)i=t.hasOwnProperty("$"+e[r].value),e[r].selected!==i&&(e[r].selected=i),i&&n&&(e[r].defaultSelected=!0)}else{for(r=""+se(r),t=null,i=0;i<e.length;i++){if(e[i].value===r)return e[i].selected=!0,void(n&&(e[i].defaultSelected=!0));null!==t||e[i].disabled||(t=e[i])}null!==t&&(t.selected=!0)}}function we(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(y(91));return g({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function be(e,t){var r=t.value;if(null==r){if(r=t.children,t=t.defaultValue,null!=r){if(null!=t)throw Error(y(92));if(Array.isArray(r)){if(!(1>=r.length))throw Error(y(93));r=r[0]}t=r}null==t&&(t=""),r=t}e._wrapperState={initialValue:se(r)}}function _e(e,t){var r=se(t.value),n=se(t.defaultValue);null!=r&&((r=""+r)!==e.value&&(e.value=r),null==t.defaultValue&&e.defaultValue!==r&&(e.defaultValue=r)),null!=n&&(e.defaultValue=""+n)}function xe(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}var Se="http://www.w3.org/1999/xhtml",ke="http://www.w3.org/2000/svg";function Ee(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Re(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?Ee(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var Ce,Pe,Te=(Pe=function(e,t){if(e.namespaceURI!==ke||"innerHTML"in e)e.innerHTML=t;else{for((Ce=Ce||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Ce.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,r,n){MSApp.execUnsafeLocalFunction((function(){return Pe(e,t)}))}:Pe);function je(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&3===r.nodeType)return void(r.nodeValue=t)}e.textContent=t}var Me={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},De=["Webkit","ms","Moz","O"];function Ie(e,t,r){return null==t||"boolean"==typeof t||""===t?"":r||"number"!=typeof t||0===t||Me.hasOwnProperty(e)&&Me[e]?(""+t).trim():t+"px"}function Oe(e,t){for(var r in e=e.style,t)if(t.hasOwnProperty(r)){var n=0===r.indexOf("--"),i=Ie(r,t[r],n);"float"===r&&(r="cssFloat"),n?e.setProperty(r,i):e[r]=i}}Object.keys(Me).forEach((function(e){De.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Me[t]=Me[e]}))}));var Le=g({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Ae(e,t){if(t){if(Le[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(y(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(y(60));if("object"!=typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(y(61))}if(null!=t.style&&"object"!=typeof t.style)throw Error(y(62))}}function Ne(e,t){if(-1===e.indexOf("-"))return"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}function Fe(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var Be=null,ze=null,$e=null;function Ue(e){if(e=pi(e)){if("function"!=typeof Be)throw Error(y(280));var t=e.stateNode;t&&(t=hi(t),Be(e.stateNode,e.type,t))}}function Ve(e){ze?$e?$e.push(e):$e=[e]:ze=e}function He(){if(ze){var e=ze,t=$e;if($e=ze=null,Ue(e),t)for(e=0;e<t.length;e++)Ue(t[e])}}function We(e,t){return e(t)}function qe(e,t,r,n,i){return e(t,r,n,i)}function Ge(){}var Ze=We,Ke=!1,Qe=!1;function Ye(){null===ze&&null===$e||(Ge(),He())}function Xe(e,t){var r=e.stateNode;if(null===r)return null;var n=hi(r);if(null===n)return null;r=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(n=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!n;break e;default:e=!1}if(e)return null;if(r&&"function"!=typeof r)throw Error(y(231,t,typeof r));return r}var Je=!1;if(S)try{var et={};Object.defineProperty(et,"passive",{get:function(){Je=!0}}),window.addEventListener("test",et,et),window.removeEventListener("test",et,et)}catch(Pe){Je=!1}function tt(e,t,r,n,i,a,s,o,c){var l=Array.prototype.slice.call(arguments,3);try{t.apply(r,l)}catch(e){this.onError(e)}}var rt=!1,nt=null,it=!1,at=null,st={onError:function(e){rt=!0,nt=e}};function ot(e,t,r,n,i,a,s,o,c){rt=!1,nt=null,tt.apply(st,arguments)}function ct(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!=(1026&(t=e).flags)&&(r=t.return),e=t.return}while(e)}return 3===t.tag?r:null}function lt(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function dt(e){if(ct(e)!==e)throw Error(y(188))}function ut(e){if(e=function(e){var t=e.alternate;if(!t){if(null===(t=ct(e)))throw Error(y(188));return t!==e?null:e}for(var r=e,n=t;;){var i=r.return;if(null===i)break;var a=i.alternate;if(null===a){if(null!==(n=i.return)){r=n;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===r)return dt(i),e;if(a===n)return dt(i),t;a=a.sibling}throw Error(y(188))}if(r.return!==n.return)r=i,n=a;else{for(var s=!1,o=i.child;o;){if(o===r){s=!0,r=i,n=a;break}if(o===n){s=!0,n=i,r=a;break}o=o.sibling}if(!s){for(o=a.child;o;){if(o===r){s=!0,r=a,n=i;break}if(o===n){s=!0,n=a,r=i;break}o=o.sibling}if(!s)throw Error(y(189))}}if(r.alternate!==n)throw Error(y(190))}if(3!==r.tag)throw Error(y(188));return r.stateNode.current===r?e:t}(e),!e)return null;for(var t=e;;){if(5===t.tag||6===t.tag)return t;if(t.child)t.child.return=t,t=t.child;else{if(t===e)break;for(;!t.sibling;){if(!t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}}return null}function pt(e,t){for(var r=e.alternate;null!==t;){if(t===e||t===r)return!0;t=t.return}return!1}var ft,ht,mt,gt,vt=!1,yt=[],wt=null,bt=null,_t=null,xt=new Map,St=new Map,kt=[],Et="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Rt(e,t,r,n,i){return{blockedOn:e,domEventName:t,eventSystemFlags:16|r,nativeEvent:i,targetContainers:[n]}}function Ct(e,t){switch(e){case"focusin":case"focusout":wt=null;break;case"dragenter":case"dragleave":bt=null;break;case"mouseover":case"mouseout":_t=null;break;case"pointerover":case"pointerout":xt.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":St.delete(t.pointerId)}}function Pt(e,t,r,n,i,a){return null===e||e.nativeEvent!==a?(e=Rt(t,r,n,i,a),null!==t&&(null!==(t=pi(t))&&ht(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,null!==i&&-1===t.indexOf(i)&&t.push(i),e)}function Tt(e){var t=ui(e.target);if(null!==t){var r=ct(t);if(null!==r)if(13===(t=r.tag)){if(null!==(t=lt(r)))return e.blockedOn=t,void gt(e.lanePriority,(function(){v.unstable_runWithPriority(e.priority,(function(){mt(r)}))}))}else if(3===t&&r.stateNode.hydrate)return void(e.blockedOn=3===r.tag?r.stateNode.containerInfo:null)}e.blockedOn=null}function jt(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var r=ur(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==r)return null!==(t=pi(r))&&ht(t),e.blockedOn=r,!1;t.shift()}return!0}function Mt(e,t,r){jt(e)&&r.delete(t)}function Dt(){for(vt=!1;0<yt.length;){var e=yt[0];if(null!==e.blockedOn){null!==(e=pi(e.blockedOn))&&ft(e);break}for(var t=e.targetContainers;0<t.length;){var r=ur(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==r){e.blockedOn=r;break}t.shift()}null===e.blockedOn&&yt.shift()}null!==wt&&jt(wt)&&(wt=null),null!==bt&&jt(bt)&&(bt=null),null!==_t&&jt(_t)&&(_t=null),xt.forEach(Mt),St.forEach(Mt)}function It(e,t){e.blockedOn===t&&(e.blockedOn=null,vt||(vt=!0,v.unstable_scheduleCallback(v.unstable_NormalPriority,Dt)))}function Ot(e){function t(t){return It(t,e)}if(0<yt.length){It(yt[0],e);for(var r=1;r<yt.length;r++){var n=yt[r];n.blockedOn===e&&(n.blockedOn=null)}}for(null!==wt&&It(wt,e),null!==bt&&It(bt,e),null!==_t&&It(_t,e),xt.forEach(t),St.forEach(t),r=0;r<kt.length;r++)(n=kt[r]).blockedOn===e&&(n.blockedOn=null);for(;0<kt.length&&null===(r=kt[0]).blockedOn;)Tt(r),null===r.blockedOn&&kt.shift()}function Lt(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var At={animationend:Lt("Animation","AnimationEnd"),animationiteration:Lt("Animation","AnimationIteration"),animationstart:Lt("Animation","AnimationStart"),transitionend:Lt("Transition","TransitionEnd")},Nt={},Ft={};function Bt(e){if(Nt[e])return Nt[e];if(!At[e])return e;var t,r=At[e];for(t in r)if(r.hasOwnProperty(t)&&t in Ft)return Nt[e]=r[t];return e}S&&(Ft=document.createElement("div").style,"AnimationEvent"in window||(delete At.animationend.animation,delete At.animationiteration.animation,delete At.animationstart.animation),"TransitionEvent"in window||delete At.transitionend.transition);var zt=Bt("animationend"),$t=Bt("animationiteration"),Ut=Bt("animationstart"),Vt=Bt("transitionend"),Ht=new Map,Wt=new Map,qt=["abort","abort",zt,"animationEnd",$t,"animationIteration",Ut,"animationStart","canplay","canPlay","canplaythrough","canPlayThrough","durationchange","durationChange","emptied","emptied","encrypted","encrypted","ended","ended","error","error","gotpointercapture","gotPointerCapture","load","load","loadeddata","loadedData","loadedmetadata","loadedMetadata","loadstart","loadStart","lostpointercapture","lostPointerCapture","playing","playing","progress","progress","seeking","seeking","stalled","stalled","suspend","suspend","timeupdate","timeUpdate",Vt,"transitionEnd","waiting","waiting"];function Gt(e,t){for(var r=0;r<e.length;r+=2){var n=e[r],i=e[r+1];i="on"+(i[0].toUpperCase()+i.slice(1)),Wt.set(n,t),Ht.set(n,i),_(i,[n])}}(0,v.unstable_now)();var Zt=8;function Kt(e){if(0!=(1&e))return Zt=15,1;if(0!=(2&e))return Zt=14,2;if(0!=(4&e))return Zt=13,4;var t=24&e;return 0!==t?(Zt=12,t):0!=(32&e)?(Zt=11,32):0!==(t=192&e)?(Zt=10,t):0!=(256&e)?(Zt=9,256):0!==(t=3584&e)?(Zt=8,t):0!=(4096&e)?(Zt=7,4096):0!==(t=4186112&e)?(Zt=6,t):0!==(t=62914560&e)?(Zt=5,t):67108864&e?(Zt=4,67108864):0!=(134217728&e)?(Zt=3,134217728):0!==(t=805306368&e)?(Zt=2,t):0!=(1073741824&e)?(Zt=1,1073741824):(Zt=8,e)}function Qt(e,t){var r=e.pendingLanes;if(0===r)return Zt=0;var n=0,i=0,a=e.expiredLanes,s=e.suspendedLanes,o=e.pingedLanes;if(0!==a)n=a,i=Zt=15;else if(0!==(a=134217727&r)){var c=a&~s;0!==c?(n=Kt(c),i=Zt):0!==(o&=a)&&(n=Kt(o),i=Zt)}else 0!==(a=r&~s)?(n=Kt(a),i=Zt):0!==o&&(n=Kt(o),i=Zt);if(0===n)return 0;if(n=r&((0>(n=31-rr(n))?0:1<<n)<<1)-1,0!==t&&t!==n&&0==(t&s)){if(Kt(t),i<=Zt)return t;Zt=i}if(0!==(t=e.entangledLanes))for(e=e.entanglements,t&=n;0<t;)i=1<<(r=31-rr(t)),n|=e[r],t&=~i;return n}function Yt(e){return 0!==(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function Xt(e,t){switch(e){case 15:return 1;case 14:return 2;case 12:return 0===(e=Jt(24&~t))?Xt(10,t):e;case 10:return 0===(e=Jt(192&~t))?Xt(8,t):e;case 8:return 0===(e=Jt(3584&~t))&&(0===(e=Jt(4186112&~t))&&(e=512)),e;case 2:return 0===(t=Jt(805306368&~t))&&(t=268435456),t}throw Error(y(358,e))}function Jt(e){return e&-e}function er(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function tr(e,t,r){e.pendingLanes|=t;var n=t-1;e.suspendedLanes&=n,e.pingedLanes&=n,(e=e.eventTimes)[t=31-rr(t)]=r}var rr=Math.clz32?Math.clz32:function(e){return 0===e?32:31-(nr(e)/ir|0)|0},nr=Math.log,ir=Math.LN2;var ar=v.unstable_UserBlockingPriority,sr=v.unstable_runWithPriority,or=!0;function cr(e,t,r,n){Ke||Ge();var i=dr,a=Ke;Ke=!0;try{qe(i,e,t,r,n)}finally{(Ke=a)||Ye()}}function lr(e,t,r,n){sr(ar,dr.bind(null,e,t,r,n))}function dr(e,t,r,n){var i;if(or)if((i=0==(4&t))&&0<yt.length&&-1<Et.indexOf(e))e=Rt(null,e,t,r,n),yt.push(e);else{var a=ur(e,t,r,n);if(null===a)i&&Ct(e,n);else{if(i){if(-1<Et.indexOf(e))return e=Rt(a,e,t,r,n),void yt.push(e);if(function(e,t,r,n,i){switch(t){case"focusin":return wt=Pt(wt,e,t,r,n,i),!0;case"dragenter":return bt=Pt(bt,e,t,r,n,i),!0;case"mouseover":return _t=Pt(_t,e,t,r,n,i),!0;case"pointerover":var a=i.pointerId;return xt.set(a,Pt(xt.get(a)||null,e,t,r,n,i)),!0;case"gotpointercapture":return a=i.pointerId,St.set(a,Pt(St.get(a)||null,e,t,r,n,i)),!0}return!1}(a,e,t,r,n))return;Ct(e,n)}Hn(e,t,n,null,r)}}}function ur(e,t,r,n){var i=Fe(n);if(null!==(i=ui(i))){var a=ct(i);if(null===a)i=null;else{var s=a.tag;if(13===s){if(null!==(i=lt(a)))return i;i=null}else if(3===s){if(a.stateNode.hydrate)return 3===a.tag?a.stateNode.containerInfo:null;i=null}else a!==i&&(i=null)}}return Hn(e,t,n,i,r),null}var pr=null,fr=null,hr=null;function mr(){if(hr)return hr;var e,t,r=fr,n=r.length,i="value"in pr?pr.value:pr.textContent,a=i.length;for(e=0;e<n&&r[e]===i[e];e++);var s=n-e;for(t=1;t<=s&&r[n-t]===i[a-t];t++);return hr=i.slice(e,1<t?1-t:void 0)}function gr(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function vr(){return!0}function yr(){return!1}function wr(e){function t(t,r,n,i,a){for(var s in this._reactName=t,this._targetInst=n,this.type=r,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(s)&&(t=e[s],this[s]=t?t(i):i[s]);return this.isDefaultPrevented=(null!=i.defaultPrevented?i.defaultPrevented:!1===i.returnValue)?vr:yr,this.isPropagationStopped=yr,this}return g(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=vr)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=vr)},persist:function(){},isPersistent:vr}),t}var br,_r,xr,Sr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},kr=wr(Sr),Er=g({},Sr,{view:0,detail:0}),Rr=wr(Er),Cr=g({},Er,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Fr,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==xr&&(xr&&"mousemove"===e.type?(br=e.screenX-xr.screenX,_r=e.screenY-xr.screenY):_r=br=0,xr=e),br)},movementY:function(e){return"movementY"in e?e.movementY:_r}}),Pr=wr(Cr),Tr=wr(g({},Cr,{dataTransfer:0})),jr=wr(g({},Er,{relatedTarget:0})),Mr=wr(g({},Sr,{animationName:0,elapsedTime:0,pseudoElement:0})),Dr=wr(g({},Sr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}})),Ir=wr(g({},Sr,{data:0})),Or={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Lr={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Ar={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Nr(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=Ar[e])&&!!t[e]}function Fr(){return Nr}var Br=wr(g({},Er,{key:function(e){if(e.key){var t=Or[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=gr(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?Lr[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Fr,charCode:function(e){return"keypress"===e.type?gr(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?gr(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}})),zr=wr(g({},Cr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),$r=wr(g({},Er,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Fr})),Ur=wr(g({},Sr,{propertyName:0,elapsedTime:0,pseudoElement:0})),Vr=wr(g({},Cr,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Hr=[9,13,27,32],Wr=S&&"CompositionEvent"in window,qr=null;S&&"documentMode"in document&&(qr=document.documentMode);var Gr=S&&"TextEvent"in window&&!qr,Zr=S&&(!Wr||qr&&8<qr&&11>=qr),Kr=String.fromCharCode(32),Qr=!1;function Yr(e,t){switch(e){case"keyup":return-1!==Hr.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Xr(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var Jr=!1;var en={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function tn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!en[e.type]:"textarea"===t}function rn(e,t,r,n){Ve(n),0<(t=qn(t,"onChange")).length&&(r=new kr("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var nn=null,an=null;function sn(e){Fn(e,0)}function on(e){if(le(fi(e)))return e}function cn(e,t){if("change"===e)return t}var ln=!1;if(S){var dn;if(S){var un="oninput"in document;if(!un){var pn=document.createElement("div");pn.setAttribute("oninput","return;"),un="function"==typeof pn.oninput}dn=un}else dn=!1;ln=dn&&(!document.documentMode||9<document.documentMode)}function fn(){nn&&(nn.detachEvent("onpropertychange",hn),an=nn=null)}function hn(e){if("value"===e.propertyName&&on(an)){var t=[];if(rn(t,an,e,Fe(e)),e=sn,Ke)e(t);else{Ke=!0;try{We(e,t)}finally{Ke=!1,Ye()}}}}function mn(e,t,r){"focusin"===e?(fn(),an=r,(nn=t).attachEvent("onpropertychange",hn)):"focusout"===e&&fn()}function gn(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return on(an)}function vn(e,t){if("click"===e)return on(t)}function yn(e,t){if("input"===e||"change"===e)return on(t)}var wn="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},bn=Object.prototype.hasOwnProperty;function _n(e,t){if(wn(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++)if(!bn.call(t,r[n])||!wn(e[r[n]],t[r[n]]))return!1;return!0}function xn(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Sn(e,t){var r,n=xn(e);for(e=0;n;){if(3===n.nodeType){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=xn(n)}}function kn(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?kn(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function En(){for(var e=window,t=de();t instanceof e.HTMLIFrameElement;){try{var r="string"==typeof t.contentWindow.location.href}catch(e){r=!1}if(!r)break;t=de((e=t.contentWindow).document)}return t}function Rn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var Cn=S&&"documentMode"in document&&11>=document.documentMode,Pn=null,Tn=null,jn=null,Mn=!1;function Dn(e,t,r){var n=r.window===r?r.document:9===r.nodeType?r:r.ownerDocument;Mn||null==Pn||Pn!==de(n)||("selectionStart"in(n=Pn)&&Rn(n)?n={start:n.selectionStart,end:n.selectionEnd}:n={anchorNode:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset},jn&&_n(jn,n)||(jn=n,0<(n=qn(Tn,"onSelect")).length&&(t=new kr("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=Pn)))}Gt("cancel cancel click click close close contextmenu contextMenu copy copy cut cut auxclick auxClick dblclick doubleClick dragend dragEnd dragstart dragStart drop drop focusin focus focusout blur input input invalid invalid keydown keyDown keypress keyPress keyup keyUp mousedown mouseDown mouseup mouseUp paste paste pause pause play play pointercancel pointerCancel pointerdown pointerDown pointerup pointerUp ratechange rateChange reset reset seeked seeked submit submit touchcancel touchCancel touchend touchEnd touchstart touchStart volumechange volumeChange".split(" "),0),Gt("drag drag dragenter dragEnter dragexit dragExit dragleave dragLeave dragover dragOver mousemove mouseMove mouseout mouseOut mouseover mouseOver pointermove pointerMove pointerout pointerOut pointerover pointerOver scroll scroll toggle toggle touchmove touchMove wheel wheel".split(" "),1),Gt(qt,2);for(var In="change selectionchange textInput compositionstart compositionend compositionupdate".split(" "),On=0;On<In.length;On++)Wt.set(In[On],0);x("onMouseEnter",["mouseout","mouseover"]),x("onMouseLeave",["mouseout","mouseover"]),x("onPointerEnter",["pointerout","pointerover"]),x("onPointerLeave",["pointerout","pointerover"]),_("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),_("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),_("onBeforeInput",["compositionend","keypress","textInput","paste"]),_("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),_("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),_("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ln="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),An=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ln));function Nn(e,t,r){var n=e.type||"unknown-event";e.currentTarget=r,function(e,t,r,n,i,a,s,o,c){if(ot.apply(this,arguments),rt){if(!rt)throw Error(y(198));var l=nt;rt=!1,nt=null,it||(it=!0,at=l)}}(n,t,void 0,e),e.currentTarget=null}function Fn(e,t){t=0!=(4&t);for(var r=0;r<e.length;r++){var n=e[r],i=n.event;n=n.listeners;e:{var a=void 0;if(t)for(var s=n.length-1;0<=s;s--){var o=n[s],c=o.instance,l=o.currentTarget;if(o=o.listener,c!==a&&i.isPropagationStopped())break e;Nn(i,o,l),a=c}else for(s=0;s<n.length;s++){if(c=(o=n[s]).instance,l=o.currentTarget,o=o.listener,c!==a&&i.isPropagationStopped())break e;Nn(i,o,l),a=c}}}if(it)throw e=at,it=!1,at=null,e}function Bn(e,t){var r=mi(t),n=e+"__bubble";r.has(n)||(Vn(t,e,2,!1),r.add(n))}var zn="_reactListening"+Math.random().toString(36).slice(2);function $n(e){e[zn]||(e[zn]=!0,w.forEach((function(t){An.has(t)||Un(t,!1,e,null),Un(t,!0,e,null)})))}function Un(e,t,r,n){var i=4<arguments.length&&void 0!==arguments[4]?arguments[4]:0,a=r;if("selectionchange"===e&&9!==r.nodeType&&(a=r.ownerDocument),null!==n&&!t&&An.has(e)){if("scroll"!==e)return;i|=2,a=n}var s=mi(a),o=e+"__"+(t?"capture":"bubble");s.has(o)||(t&&(i|=4),Vn(a,e,i,t),s.add(o))}function Vn(e,t,r,n){var i=Wt.get(t);switch(void 0===i?2:i){case 0:i=cr;break;case 1:i=lr;break;default:i=dr}r=i.bind(null,t,r,e),i=void 0,!Je||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(i=!0),n?void 0!==i?e.addEventListener(t,r,{capture:!0,passive:i}):e.addEventListener(t,r,!0):void 0!==i?e.addEventListener(t,r,{passive:i}):e.addEventListener(t,r,!1)}function Hn(e,t,r,n,i){var a=n;if(0==(1&t)&&0==(2&t)&&null!==n)e:for(;;){if(null===n)return;var s=n.tag;if(3===s||4===s){var o=n.stateNode.containerInfo;if(o===i||8===o.nodeType&&o.parentNode===i)break;if(4===s)for(s=n.return;null!==s;){var c=s.tag;if((3===c||4===c)&&((c=s.stateNode.containerInfo)===i||8===c.nodeType&&c.parentNode===i))return;s=s.return}for(;null!==o;){if(null===(s=ui(o)))return;if(5===(c=s.tag)||6===c){n=a=s;continue e}o=o.parentNode}}n=n.return}!function(e,t,r){if(Qe)return e(t,r);Qe=!0;try{Ze(e,t,r)}finally{Qe=!1,Ye()}}((function(){var n=a,i=Fe(r),s=[];e:{var o=Ht.get(e);if(void 0!==o){var c=kr,l=e;switch(e){case"keypress":if(0===gr(r))break e;case"keydown":case"keyup":c=Br;break;case"focusin":l="focus",c=jr;break;case"focusout":l="blur",c=jr;break;case"beforeblur":case"afterblur":c=jr;break;case"click":if(2===r.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":c=Pr;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":c=Tr;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":c=$r;break;case zt:case $t:case Ut:c=Mr;break;case Vt:c=Ur;break;case"scroll":c=Rr;break;case"wheel":c=Vr;break;case"copy":case"cut":case"paste":c=Dr;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":c=zr}var d=0!=(4&t),u=!d&&"scroll"===e,p=d?null!==o?o+"Capture":null:o;d=[];for(var f,h=n;null!==h;){var m=(f=h).stateNode;if(5===f.tag&&null!==m&&(f=m,null!==p&&(null!=(m=Xe(h,p))&&d.push(Wn(h,m,f)))),u)break;h=h.return}0<d.length&&(o=new c(o,l,null,r,i),s.push({event:o,listeners:d}))}}if(0==(7&t)){if(c="mouseout"===e||"pointerout"===e,(!(o="mouseover"===e||"pointerover"===e)||0!=(16&t)||!(l=r.relatedTarget||r.fromElement)||!ui(l)&&!l[li])&&(c||o)&&(o=i.window===i?i:(o=i.ownerDocument)?o.defaultView||o.parentWindow:window,c?(c=n,null!==(l=(l=r.relatedTarget||r.toElement)?ui(l):null)&&(l!==(u=ct(l))||5!==l.tag&&6!==l.tag)&&(l=null)):(c=null,l=n),c!==l)){if(d=Pr,m="onMouseLeave",p="onMouseEnter",h="mouse","pointerout"!==e&&"pointerover"!==e||(d=zr,m="onPointerLeave",p="onPointerEnter",h="pointer"),u=null==c?o:fi(c),f=null==l?o:fi(l),(o=new d(m,h+"leave",c,r,i)).target=u,o.relatedTarget=f,m=null,ui(i)===n&&((d=new d(p,h+"enter",l,r,i)).target=f,d.relatedTarget=u,m=d),u=m,c&&l)e:{for(p=l,h=0,f=d=c;f;f=Gn(f))h++;for(f=0,m=p;m;m=Gn(m))f++;for(;0<h-f;)d=Gn(d),h--;for(;0<f-h;)p=Gn(p),f--;for(;h--;){if(d===p||null!==p&&d===p.alternate)break e;d=Gn(d),p=Gn(p)}d=null}else d=null;null!==c&&Zn(s,o,c,d,!1),null!==l&&null!==u&&Zn(s,u,l,d,!0)}if("select"===(c=(o=n?fi(n):window).nodeName&&o.nodeName.toLowerCase())||"input"===c&&"file"===o.type)var g=cn;else if(tn(o))if(ln)g=yn;else{g=gn;var v=mn}else(c=o.nodeName)&&"input"===c.toLowerCase()&&("checkbox"===o.type||"radio"===o.type)&&(g=vn);switch(g&&(g=g(e,n))?rn(s,g,r,i):(v&&v(e,o,n),"focusout"===e&&(v=o._wrapperState)&&v.controlled&&"number"===o.type&&ge(o,"number",o.value)),v=n?fi(n):window,e){case"focusin":(tn(v)||"true"===v.contentEditable)&&(Pn=v,Tn=n,jn=null);break;case"focusout":jn=Tn=Pn=null;break;case"mousedown":Mn=!0;break;case"contextmenu":case"mouseup":case"dragend":Mn=!1,Dn(s,r,i);break;case"selectionchange":if(Cn)break;case"keydown":case"keyup":Dn(s,r,i)}var y;if(Wr)e:{switch(e){case"compositionstart":var w="onCompositionStart";break e;case"compositionend":w="onCompositionEnd";break e;case"compositionupdate":w="onCompositionUpdate";break e}w=void 0}else Jr?Yr(e,r)&&(w="onCompositionEnd"):"keydown"===e&&229===r.keyCode&&(w="onCompositionStart");w&&(Zr&&"ko"!==r.locale&&(Jr||"onCompositionStart"!==w?"onCompositionEnd"===w&&Jr&&(y=mr()):(fr="value"in(pr=i)?pr.value:pr.textContent,Jr=!0)),0<(v=qn(n,w)).length&&(w=new Ir(w,e,null,r,i),s.push({event:w,listeners:v}),y?w.data=y:null!==(y=Xr(r))&&(w.data=y))),(y=Gr?function(e,t){switch(e){case"compositionend":return Xr(t);case"keypress":return 32!==t.which?null:(Qr=!0,Kr);case"textInput":return(e=t.data)===Kr&&Qr?null:e;default:return null}}(e,r):function(e,t){if(Jr)return"compositionend"===e||!Wr&&Yr(e,t)?(e=mr(),hr=fr=pr=null,Jr=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Zr&&"ko"!==t.locale?null:t.data}}(e,r))&&(0<(n=qn(n,"onBeforeInput")).length&&(i=new Ir("onBeforeInput","beforeinput",null,r,i),s.push({event:i,listeners:n}),i.data=y))}Fn(s,t)}))}function Wn(e,t,r){return{instance:e,listener:t,currentTarget:r}}function qn(e,t){for(var r=t+"Capture",n=[];null!==e;){var i=e,a=i.stateNode;5===i.tag&&null!==a&&(i=a,null!=(a=Xe(e,r))&&n.unshift(Wn(e,a,i)),null!=(a=Xe(e,t))&&n.push(Wn(e,a,i))),e=e.return}return n}function Gn(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag);return e||null}function Zn(e,t,r,n,i){for(var a=t._reactName,s=[];null!==r&&r!==n;){var o=r,c=o.alternate,l=o.stateNode;if(null!==c&&c===n)break;5===o.tag&&null!==l&&(o=l,i?null!=(c=Xe(r,a))&&s.unshift(Wn(r,c,o)):i||null!=(c=Xe(r,a))&&s.push(Wn(r,c,o))),r=r.return}0!==s.length&&e.push({event:t,listeners:s})}function Kn(){}var Qn=null,Yn=null;function Xn(e,t){switch(e){case"button":case"input":case"select":case"textarea":return!!t.autoFocus}return!1}function Jn(e,t){return"textarea"===e||"option"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var ei="function"==typeof setTimeout?setTimeout:void 0,ti="function"==typeof clearTimeout?clearTimeout:void 0;function ri(e){1===e.nodeType?e.textContent="":9===e.nodeType&&(null!=(e=e.body)&&(e.textContent=""))}function ni(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break}return e}function ii(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var r=e.data;if("$"===r||"$!"===r||"$?"===r){if(0===t)return e;t--}else"/$"===r&&t++}e=e.previousSibling}return null}var ai=0;var si=Math.random().toString(36).slice(2),oi="__reactFiber$"+si,ci="__reactProps$"+si,li="__reactContainer$"+si,di="__reactEvents$"+si;function ui(e){var t=e[oi];if(t)return t;for(var r=e.parentNode;r;){if(t=r[li]||r[oi]){if(r=t.alternate,null!==t.child||null!==r&&null!==r.child)for(e=ii(e);null!==e;){if(r=e[oi])return r;e=ii(e)}return t}r=(e=r).parentNode}return null}function pi(e){return!(e=e[oi]||e[li])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function fi(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(y(33))}function hi(e){return e[ci]||null}function mi(e){var t=e[di];return void 0===t&&(t=e[di]=new Set),t}var gi=[],vi=-1;function yi(e){return{current:e}}function wi(e){0>vi||(e.current=gi[vi],gi[vi]=null,vi--)}function bi(e,t){vi++,gi[vi]=e.current,e.current=t}var _i={},xi=yi(_i),Si=yi(!1),ki=_i;function Ei(e,t){var r=e.type.contextTypes;if(!r)return _i;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var i,a={};for(i in r)a[i]=t[i];return n&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function Ri(e){return null!=(e=e.childContextTypes)}function Ci(){wi(Si),wi(xi)}function Pi(e,t,r){if(xi.current!==_i)throw Error(y(168));bi(xi,t),bi(Si,r)}function Ti(e,t,r){var n=e.stateNode;if(e=t.childContextTypes,"function"!=typeof n.getChildContext)return r;for(var i in n=n.getChildContext())if(!(i in e))throw Error(y(108,ae(t)||"Unknown",i));return g({},r,n)}function ji(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||_i,ki=xi.current,bi(xi,e),bi(Si,Si.current),!0}function Mi(e,t,r){var n=e.stateNode;if(!n)throw Error(y(169));r?(e=Ti(e,t,ki),n.__reactInternalMemoizedMergedChildContext=e,wi(Si),wi(xi),bi(xi,e)):wi(Si),bi(Si,r)}var Di=null,Ii=null,Oi=v.unstable_runWithPriority,Li=v.unstable_scheduleCallback,Ai=v.unstable_cancelCallback,Ni=v.unstable_shouldYield,Fi=v.unstable_requestPaint,Bi=v.unstable_now,zi=v.unstable_getCurrentPriorityLevel,$i=v.unstable_ImmediatePriority,Ui=v.unstable_UserBlockingPriority,Vi=v.unstable_NormalPriority,Hi=v.unstable_LowPriority,Wi=v.unstable_IdlePriority,qi={},Gi=void 0!==Fi?Fi:function(){},Zi=null,Ki=null,Qi=!1,Yi=Bi(),Xi=1e4>Yi?Bi:function(){return Bi()-Yi};function Ji(){switch(zi()){case $i:return 99;case Ui:return 98;case Vi:return 97;case Hi:return 96;case Wi:return 95;default:throw Error(y(332))}}function ea(e){switch(e){case 99:return $i;case 98:return Ui;case 97:return Vi;case 96:return Hi;case 95:return Wi;default:throw Error(y(332))}}function ta(e,t){return e=ea(e),Oi(e,t)}function ra(e,t,r){return e=ea(e),Li(e,t,r)}function na(){if(null!==Ki){var e=Ki;Ki=null,Ai(e)}ia()}function ia(){if(!Qi&&null!==Zi){Qi=!0;var e=0;try{var t=Zi;ta(99,(function(){for(;e<t.length;e++){var r=t[e];do{r=r(!0)}while(null!==r)}})),Zi=null}catch(t){throw null!==Zi&&(Zi=Zi.slice(e+1)),Li($i,na),t}finally{Qi=!1}}}var aa=I.ReactCurrentBatchConfig;function sa(e,t){if(e&&e.defaultProps){for(var r in t=g({},t),e=e.defaultProps)void 0===t[r]&&(t[r]=e[r]);return t}return t}var oa=yi(null),ca=null,la=null,da=null;function ua(){da=la=ca=null}function pa(e){var t=oa.current;wi(oa),e.type._context._currentValue=t}function fa(e,t){for(;null!==e;){var r=e.alternate;if((e.childLanes&t)===t){if(null===r||(r.childLanes&t)===t)break;r.childLanes|=t}else e.childLanes|=t,null!==r&&(r.childLanes|=t);e=e.return}}function ha(e,t){ca=e,da=la=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(0!=(e.lanes&t)&&(Ws=!0),e.firstContext=null)}function ma(e,t){if(da!==e&&!1!==t&&0!==t)if("number"==typeof t&&1073741823!==t||(da=e,t=1073741823),t={context:e,observedBits:t,next:null},null===la){if(null===ca)throw Error(y(308));la=t,ca.dependencies={lanes:0,firstContext:t,responders:null}}else la=la.next=t;return e._currentValue}var ga=!1;function va(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null},effects:null}}function ya(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function wa(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ba(e,t){if(null!==(e=e.updateQueue)){var r=(e=e.shared).pending;null===r?t.next=t:(t.next=r.next,r.next=t),e.pending=t}}function _a(e,t){var r=e.updateQueue,n=e.alternate;if(null!==n&&r===(n=n.updateQueue)){var i=null,a=null;if(null!==(r=r.firstBaseUpdate)){do{var s={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};null===a?i=a=s:a=a.next=s,r=r.next}while(null!==r);null===a?i=a=t:a=a.next=t}else i=a=t;return r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:n.shared,effects:n.effects},void(e.updateQueue=r)}null===(e=r.lastBaseUpdate)?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function xa(e,t,r,n){var i=e.updateQueue;ga=!1;var a=i.firstBaseUpdate,s=i.lastBaseUpdate,o=i.shared.pending;if(null!==o){i.shared.pending=null;var c=o,l=c.next;c.next=null,null===s?a=l:s.next=l,s=c;var d=e.alternate;if(null!==d){var u=(d=d.updateQueue).lastBaseUpdate;u!==s&&(null===u?d.firstBaseUpdate=l:u.next=l,d.lastBaseUpdate=c)}}if(null!==a){for(u=i.baseState,s=0,d=l=c=null;;){o=a.lane;var p=a.eventTime;if((n&o)===o){null!==d&&(d=d.next={eventTime:p,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var f=e,h=a;switch(o=t,p=r,h.tag){case 1:if("function"==typeof(f=h.payload)){u=f.call(p,u,o);break e}u=f;break e;case 3:f.flags=-4097&f.flags|64;case 0:if(null==(o="function"==typeof(f=h.payload)?f.call(p,u,o):f))break e;u=g({},u,o);break e;case 2:ga=!0}}null!==a.callback&&(e.flags|=32,null===(o=i.effects)?i.effects=[a]:o.push(a))}else p={eventTime:p,lane:o,tag:a.tag,payload:a.payload,callback:a.callback,next:null},null===d?(l=d=p,c=u):d=d.next=p,s|=o;if(null===(a=a.next)){if(null===(o=i.shared.pending))break;a=o.next,o.next=null,i.lastBaseUpdate=o,i.shared.pending=null}}null===d&&(c=u),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=d,Qo|=s,e.lanes=s,e.memoizedState=u}}function Sa(e,t,r){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var n=e[t],i=n.callback;if(null!==i){if(n.callback=null,n=r,"function"!=typeof i)throw Error(y(191,i));i.call(n)}}}var ka=(new m.Component).refs;function Ea(e,t,r,n){r=null==(r=r(n,t=e.memoizedState))?t:g({},t,r),e.memoizedState=r,0===e.lanes&&(e.updateQueue.baseState=r)}var Ra={isMounted:function(e){return!!(e=e._reactInternals)&&ct(e)===e},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=_c(),i=xc(e),a=wa(n,i);a.payload=t,null!=r&&(a.callback=r),ba(e,a),Sc(e,i,n)},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=_c(),i=xc(e),a=wa(n,i);a.tag=1,a.payload=t,null!=r&&(a.callback=r),ba(e,a),Sc(e,i,n)},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=_c(),n=xc(e),i=wa(r,n);i.tag=2,null!=t&&(i.callback=t),ba(e,i),Sc(e,n,r)}};function Ca(e,t,r,n,i,a,s){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(n,a,s):!t.prototype||!t.prototype.isPureReactComponent||(!_n(r,n)||!_n(i,a))}function Pa(e,t,r){var n=!1,i=_i,a=t.contextType;return"object"==typeof a&&null!==a?a=ma(a):(i=Ri(t)?ki:xi.current,a=(n=null!=(n=t.contextTypes))?Ei(e,i):_i),t=new t(r,a),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=Ra,e.stateNode=t,t._reactInternals=e,n&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function Ta(e,t,r,n){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(r,n),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(r,n),t.state!==e&&Ra.enqueueReplaceState(t,t.state,null)}function ja(e,t,r,n){var i=e.stateNode;i.props=r,i.state=e.memoizedState,i.refs=ka,va(e);var a=t.contextType;"object"==typeof a&&null!==a?i.context=ma(a):(a=Ri(t)?ki:xi.current,i.context=Ei(e,a)),xa(e,r,i,n),i.state=e.memoizedState,"function"==typeof(a=t.getDerivedStateFromProps)&&(Ea(e,t,a,r),i.state=e.memoizedState),"function"==typeof t.getDerivedStateFromProps||"function"==typeof i.getSnapshotBeforeUpdate||"function"!=typeof i.UNSAFE_componentWillMount&&"function"!=typeof i.componentWillMount||(t=i.state,"function"==typeof i.componentWillMount&&i.componentWillMount(),"function"==typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount(),t!==i.state&&Ra.enqueueReplaceState(i,i.state,null),xa(e,r,i,n),i.state=e.memoizedState),"function"==typeof i.componentDidMount&&(e.flags|=4)}var Ma=Array.isArray;function Da(e,t,r){if(null!==(e=r.ref)&&"function"!=typeof e&&"object"!=typeof e){if(r._owner){if(r=r._owner){if(1!==r.tag)throw Error(y(309));var n=r.stateNode}if(!n)throw Error(y(147,e));var i=""+e;return null!==t&&null!==t.ref&&"function"==typeof t.ref&&t.ref._stringRef===i?t.ref:((t=function(e){var t=n.refs;t===ka&&(t=n.refs={}),null===e?delete t[i]:t[i]=e})._stringRef=i,t)}if("string"!=typeof e)throw Error(y(284));if(!r._owner)throw Error(y(290,e))}return e}function Ia(e,t){if("textarea"!==e.type)throw Error(y(31,"[object Object]"===Object.prototype.toString.call(t)?"object with keys {"+Object.keys(t).join(", ")+"}":t))}function Oa(e){function t(t,r){if(e){var n=t.lastEffect;null!==n?(n.nextEffect=r,t.lastEffect=r):t.firstEffect=t.lastEffect=r,r.nextEffect=null,r.flags=8}}function r(r,n){if(!e)return null;for(;null!==n;)t(r,n),n=n.sibling;return null}function n(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function i(e,t){return(e=tl(e,t)).index=0,e.sibling=null,e}function a(t,r,n){return t.index=n,e?null!==(n=t.alternate)?(n=n.index)<r?(t.flags=2,r):n:(t.flags=2,r):r}function s(t){return e&&null===t.alternate&&(t.flags=2),t}function o(e,t,r,n){return null===t||6!==t.tag?((t=al(r,e.mode,n)).return=e,t):((t=i(t,r)).return=e,t)}function c(e,t,r,n){return null!==t&&t.elementType===r.type?((n=i(t,r.props)).ref=Da(e,t,r),n.return=e,n):((n=rl(r.type,r.key,r.props,null,e.mode,n)).ref=Da(e,t,r),n.return=e,n)}function l(e,t,r,n){return null===t||4!==t.tag||t.stateNode.containerInfo!==r.containerInfo||t.stateNode.implementation!==r.implementation?((t=sl(r,e.mode,n)).return=e,t):((t=i(t,r.children||[])).return=e,t)}function d(e,t,r,n,a){return null===t||7!==t.tag?((t=nl(r,e.mode,n,a)).return=e,t):((t=i(t,r)).return=e,t)}function u(e,t,r){if("string"==typeof t||"number"==typeof t)return(t=al(""+t,e.mode,r)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case O:return(r=rl(t.type,t.key,t.props,null,e.mode,r)).ref=Da(e,null,t),r.return=e,r;case L:return(t=sl(t,e.mode,r)).return=e,t}if(Ma(t)||ee(t))return(t=nl(t,e.mode,r,null)).return=e,t;Ia(e,t)}return null}function p(e,t,r,n){var i=null!==t?t.key:null;if("string"==typeof r||"number"==typeof r)return null!==i?null:o(e,t,""+r,n);if("object"==typeof r&&null!==r){switch(r.$$typeof){case O:return r.key===i?r.type===A?d(e,t,r.props.children,n,i):c(e,t,r,n):null;case L:return r.key===i?l(e,t,r,n):null}if(Ma(r)||ee(r))return null!==i?null:d(e,t,r,n,null);Ia(e,r)}return null}function f(e,t,r,n,i){if("string"==typeof n||"number"==typeof n)return o(t,e=e.get(r)||null,""+n,i);if("object"==typeof n&&null!==n){switch(n.$$typeof){case O:return e=e.get(null===n.key?r:n.key)||null,n.type===A?d(t,e,n.props.children,i,n.key):c(t,e,n,i);case L:return l(t,e=e.get(null===n.key?r:n.key)||null,n,i)}if(Ma(n)||ee(n))return d(t,e=e.get(r)||null,n,i,null);Ia(t,n)}return null}return function(o,c,l,d){var h="object"==typeof l&&null!==l&&l.type===A&&null===l.key;h&&(l=l.props.children);var m="object"==typeof l&&null!==l;if(m)switch(l.$$typeof){case O:e:{for(m=l.key,h=c;null!==h;){if(h.key===m){if(7===h.tag){if(l.type===A){r(o,h.sibling),(c=i(h,l.props.children)).return=o,o=c;break e}}else if(h.elementType===l.type){r(o,h.sibling),(c=i(h,l.props)).ref=Da(o,h,l),c.return=o,o=c;break e}r(o,h);break}t(o,h),h=h.sibling}l.type===A?((c=nl(l.props.children,o.mode,d,l.key)).return=o,o=c):((d=rl(l.type,l.key,l.props,null,o.mode,d)).ref=Da(o,c,l),d.return=o,o=d)}return s(o);case L:e:{for(h=l.key;null!==c;){if(c.key===h){if(4===c.tag&&c.stateNode.containerInfo===l.containerInfo&&c.stateNode.implementation===l.implementation){r(o,c.sibling),(c=i(c,l.children||[])).return=o,o=c;break e}r(o,c);break}t(o,c),c=c.sibling}(c=sl(l,o.mode,d)).return=o,o=c}return s(o)}if("string"==typeof l||"number"==typeof l)return l=""+l,null!==c&&6===c.tag?(r(o,c.sibling),(c=i(c,l)).return=o,o=c):(r(o,c),(c=al(l,o.mode,d)).return=o,o=c),s(o);if(Ma(l))return function(i,s,o,c){for(var l=null,d=null,h=s,m=s=0,g=null;null!==h&&m<o.length;m++){h.index>m?(g=h,h=null):g=h.sibling;var v=p(i,h,o[m],c);if(null===v){null===h&&(h=g);break}e&&h&&null===v.alternate&&t(i,h),s=a(v,s,m),null===d?l=v:d.sibling=v,d=v,h=g}if(m===o.length)return r(i,h),l;if(null===h){for(;m<o.length;m++)null!==(h=u(i,o[m],c))&&(s=a(h,s,m),null===d?l=h:d.sibling=h,d=h);return l}for(h=n(i,h);m<o.length;m++)null!==(g=f(h,i,m,o[m],c))&&(e&&null!==g.alternate&&h.delete(null===g.key?m:g.key),s=a(g,s,m),null===d?l=g:d.sibling=g,d=g);return e&&h.forEach((function(e){return t(i,e)})),l}(o,c,l,d);if(ee(l))return function(i,s,o,c){var l=ee(o);if("function"!=typeof l)throw Error(y(150));if(null==(o=l.call(o)))throw Error(y(151));for(var d=l=null,h=s,m=s=0,g=null,v=o.next();null!==h&&!v.done;m++,v=o.next()){h.index>m?(g=h,h=null):g=h.sibling;var w=p(i,h,v.value,c);if(null===w){null===h&&(h=g);break}e&&h&&null===w.alternate&&t(i,h),s=a(w,s,m),null===d?l=w:d.sibling=w,d=w,h=g}if(v.done)return r(i,h),l;if(null===h){for(;!v.done;m++,v=o.next())null!==(v=u(i,v.value,c))&&(s=a(v,s,m),null===d?l=v:d.sibling=v,d=v);return l}for(h=n(i,h);!v.done;m++,v=o.next())null!==(v=f(h,i,m,v.value,c))&&(e&&null!==v.alternate&&h.delete(null===v.key?m:v.key),s=a(v,s,m),null===d?l=v:d.sibling=v,d=v);return e&&h.forEach((function(e){return t(i,e)})),l}(o,c,l,d);if(m&&Ia(o,l),void 0===l&&!h)switch(o.tag){case 1:case 22:case 0:case 11:case 15:throw Error(y(152,ae(o.type)||"Component"))}return r(o,c)}}var La=Oa(!0),Aa=Oa(!1),Na={},Fa=yi(Na),Ba=yi(Na),za=yi(Na);function $a(e){if(e===Na)throw Error(y(174));return e}function Ua(e,t){switch(bi(za,t),bi(Ba,e),bi(Fa,Na),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Re(null,"");break;default:t=Re(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}wi(Fa),bi(Fa,t)}function Va(){wi(Fa),wi(Ba),wi(za)}function Ha(e){$a(za.current);var t=$a(Fa.current),r=Re(t,e.type);t!==r&&(bi(Ba,e),bi(Fa,r))}function Wa(e){Ba.current===e&&(wi(Fa),wi(Ba))}var qa=yi(0);function Ga(e){for(var t=e;null!==t;){if(13===t.tag){var r=t.memoizedState;if(null!==r&&(null===(r=r.dehydrated)||"$?"===r.data||"$!"===r.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!=(64&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Za=null,Ka=null,Qa=!1;function Ya(e,t){var r=Jc(5,null,null,0);r.elementType="DELETED",r.type="DELETED",r.stateNode=t,r.return=e,r.flags=8,null!==e.lastEffect?(e.lastEffect.nextEffect=r,e.lastEffect=r):e.firstEffect=e.lastEffect=r}function Xa(e,t){switch(e.tag){case 5:var r=e.type;return null!==(t=1!==t.nodeType||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,!0);default:return!1}}function Ja(e){if(Qa){var t=Ka;if(t){var r=t;if(!Xa(e,t)){if(!(t=ni(r.nextSibling))||!Xa(e,t))return e.flags=-1025&e.flags|2,Qa=!1,void(Za=e);Ya(Za,r)}Za=e,Ka=ni(t.firstChild)}else e.flags=-1025&e.flags|2,Qa=!1,Za=e}}function es(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;Za=e}function ts(e){if(e!==Za)return!1;if(!Qa)return es(e),Qa=!0,!1;var t=e.type;if(5!==e.tag||"head"!==t&&"body"!==t&&!Jn(t,e.memoizedProps))for(t=Ka;t;)Ya(e,t),t=ni(t.nextSibling);if(es(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(y(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var r=e.data;if("/$"===r){if(0===t){Ka=ni(e.nextSibling);break e}t--}else"$"!==r&&"$!"!==r&&"$?"!==r||t++}e=e.nextSibling}Ka=null}}else Ka=Za?ni(e.stateNode.nextSibling):null;return!0}function rs(){Ka=Za=null,Qa=!1}var ns=[];function is(){for(var e=0;e<ns.length;e++)ns[e]._workInProgressVersionPrimary=null;ns.length=0}var as=I.ReactCurrentDispatcher,ss=I.ReactCurrentBatchConfig,os=0,cs=null,ls=null,ds=null,us=!1,ps=!1;function fs(){throw Error(y(321))}function hs(e,t){if(null===t)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!wn(e[r],t[r]))return!1;return!0}function ms(e,t,r,n,i,a){if(os=a,cs=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,as.current=null===e||null===e.memoizedState?$s:Us,e=r(n,i),ps){a=0;do{if(ps=!1,!(25>a))throw Error(y(301));a+=1,ds=ls=null,t.updateQueue=null,as.current=Vs,e=r(n,i)}while(ps)}if(as.current=zs,t=null!==ls&&null!==ls.next,os=0,ds=ls=cs=null,us=!1,t)throw Error(y(300));return e}function gs(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===ds?cs.memoizedState=ds=e:ds=ds.next=e,ds}function vs(){if(null===ls){var e=cs.alternate;e=null!==e?e.memoizedState:null}else e=ls.next;var t=null===ds?cs.memoizedState:ds.next;if(null!==t)ds=t,ls=e;else{if(null===e)throw Error(y(310));e={memoizedState:(ls=e).memoizedState,baseState:ls.baseState,baseQueue:ls.baseQueue,queue:ls.queue,next:null},null===ds?cs.memoizedState=ds=e:ds=ds.next=e}return ds}function ys(e,t){return"function"==typeof t?t(e):t}function ws(e){var t=vs(),r=t.queue;if(null===r)throw Error(y(311));r.lastRenderedReducer=e;var n=ls,i=n.baseQueue,a=r.pending;if(null!==a){if(null!==i){var s=i.next;i.next=a.next,a.next=s}n.baseQueue=i=a,r.pending=null}if(null!==i){i=i.next,n=n.baseState;var o=s=a=null,c=i;do{var l=c.lane;if((os&l)===l)null!==o&&(o=o.next={lane:0,action:c.action,eagerReducer:c.eagerReducer,eagerState:c.eagerState,next:null}),n=c.eagerReducer===e?c.eagerState:e(n,c.action);else{var d={lane:l,action:c.action,eagerReducer:c.eagerReducer,eagerState:c.eagerState,next:null};null===o?(s=o=d,a=n):o=o.next=d,cs.lanes|=l,Qo|=l}c=c.next}while(null!==c&&c!==i);null===o?a=n:o.next=s,wn(n,t.memoizedState)||(Ws=!0),t.memoizedState=n,t.baseState=a,t.baseQueue=o,r.lastRenderedState=n}return[t.memoizedState,r.dispatch]}function bs(e){var t=vs(),r=t.queue;if(null===r)throw Error(y(311));r.lastRenderedReducer=e;var n=r.dispatch,i=r.pending,a=t.memoizedState;if(null!==i){r.pending=null;var s=i=i.next;do{a=e(a,s.action),s=s.next}while(s!==i);wn(a,t.memoizedState)||(Ws=!0),t.memoizedState=a,null===t.baseQueue&&(t.baseState=a),r.lastRenderedState=a}return[a,n]}function _s(e,t,r){var n=t._getVersion;n=n(t._source);var i=t._workInProgressVersionPrimary;if(null!==i?e=i===n:(e=e.mutableReadLanes,(e=(os&e)===e)&&(t._workInProgressVersionPrimary=n,ns.push(t))),e)return r(t._source);throw ns.push(t),Error(y(350))}function xs(e,t,r,n){var i=Uo;if(null===i)throw Error(y(349));var a=t._getVersion,s=a(t._source),o=as.current,c=o.useState((function(){return _s(i,t,r)})),l=c[1],d=c[0];c=ds;var u=e.memoizedState,p=u.refs,f=p.getSnapshot,h=u.source;u=u.subscribe;var m=cs;return e.memoizedState={refs:p,source:t,subscribe:n},o.useEffect((function(){p.getSnapshot=r,p.setSnapshot=l;var e=a(t._source);if(!wn(s,e)){e=r(t._source),wn(d,e)||(l(e),e=xc(m),i.mutableReadLanes|=e&i.pendingLanes),e=i.mutableReadLanes,i.entangledLanes|=e;for(var n=i.entanglements,o=e;0<o;){var c=31-rr(o),u=1<<c;n[c]|=e,o&=~u}}}),[r,t,n]),o.useEffect((function(){return n(t._source,(function(){var e=p.getSnapshot,r=p.setSnapshot;try{r(e(t._source));var n=xc(m);i.mutableReadLanes|=n&i.pendingLanes}catch(e){r((function(){throw e}))}}))}),[t,n]),wn(f,r)&&wn(h,t)&&wn(u,n)||((e={pending:null,dispatch:null,lastRenderedReducer:ys,lastRenderedState:d}).dispatch=l=Bs.bind(null,cs,e),c.queue=e,c.baseQueue=null,d=_s(i,t,r),c.memoizedState=c.baseState=d),d}function Ss(e,t,r){return xs(vs(),e,t,r)}function ks(e){var t=gs();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e=(e=t.queue={pending:null,dispatch:null,lastRenderedReducer:ys,lastRenderedState:e}).dispatch=Bs.bind(null,cs,e),[t.memoizedState,e]}function Es(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},null===(t=cs.updateQueue)?(t={lastEffect:null},cs.updateQueue=t,t.lastEffect=e.next=e):null===(r=t.lastEffect)?t.lastEffect=e.next=e:(n=r.next,r.next=e,e.next=n,t.lastEffect=e),e}function Rs(e){return e={current:e},gs().memoizedState=e}function Cs(){return vs().memoizedState}function Ps(e,t,r,n){var i=gs();cs.flags|=e,i.memoizedState=Es(1|t,r,void 0,void 0===n?null:n)}function Ts(e,t,r,n){var i=vs();n=void 0===n?null:n;var a=void 0;if(null!==ls){var s=ls.memoizedState;if(a=s.destroy,null!==n&&hs(n,s.deps))return void Es(t,r,a,n)}cs.flags|=e,i.memoizedState=Es(1|t,r,a,n)}function js(e,t){return Ps(516,4,e,t)}function Ms(e,t){return Ts(516,4,e,t)}function Ds(e,t){return Ts(4,2,e,t)}function Is(e,t){return"function"==typeof t?(e=e(),t(e),function(){t(null)}):null!=t?(e=e(),t.current=e,function(){t.current=null}):void 0}function Os(e,t,r){return r=null!=r?r.concat([e]):null,Ts(4,2,Is.bind(null,t,e),r)}function Ls(){}function As(e,t){var r=vs();t=void 0===t?null:t;var n=r.memoizedState;return null!==n&&null!==t&&hs(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function Ns(e,t){var r=vs();t=void 0===t?null:t;var n=r.memoizedState;return null!==n&&null!==t&&hs(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function Fs(e,t){var r=Ji();ta(98>r?98:r,(function(){e(!0)})),ta(97<r?97:r,(function(){var r=ss.transition;ss.transition=1;try{e(!1),t()}finally{ss.transition=r}}))}function Bs(e,t,r){var n=_c(),i=xc(e),a={lane:i,action:r,eagerReducer:null,eagerState:null,next:null},s=t.pending;if(null===s?a.next=a:(a.next=s.next,s.next=a),t.pending=a,s=e.alternate,e===cs||null!==s&&s===cs)ps=us=!0;else{if(0===e.lanes&&(null===s||0===s.lanes)&&null!==(s=t.lastRenderedReducer))try{var o=t.lastRenderedState,c=s(o,r);if(a.eagerReducer=s,a.eagerState=c,wn(c,o))return}catch(e){}Sc(e,i,n)}}var zs={readContext:ma,useCallback:fs,useContext:fs,useEffect:fs,useImperativeHandle:fs,useLayoutEffect:fs,useMemo:fs,useReducer:fs,useRef:fs,useState:fs,useDebugValue:fs,useDeferredValue:fs,useTransition:fs,useMutableSource:fs,useOpaqueIdentifier:fs,unstable_isNewReconciler:!1},$s={readContext:ma,useCallback:function(e,t){return gs().memoizedState=[e,void 0===t?null:t],e},useContext:ma,useEffect:js,useImperativeHandle:function(e,t,r){return r=null!=r?r.concat([e]):null,Ps(4,2,Is.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Ps(4,2,e,t)},useMemo:function(e,t){var r=gs();return t=void 0===t?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=gs();return t=void 0!==r?r(t):t,n.memoizedState=n.baseState=t,e=(e=n.queue={pending:null,dispatch:null,lastRenderedReducer:e,lastRenderedState:t}).dispatch=Bs.bind(null,cs,e),[n.memoizedState,e]},useRef:Rs,useState:ks,useDebugValue:Ls,useDeferredValue:function(e){var t=ks(e),r=t[0],n=t[1];return js((function(){var t=ss.transition;ss.transition=1;try{n(e)}finally{ss.transition=t}}),[e]),r},useTransition:function(){var e=ks(!1),t=e[0];return Rs(e=Fs.bind(null,e[1])),[e,t]},useMutableSource:function(e,t,r){var n=gs();return n.memoizedState={refs:{getSnapshot:t,setSnapshot:null},source:e,subscribe:r},xs(n,e,t,r)},useOpaqueIdentifier:function(){if(Qa){var e=!1,t={$$typeof:G,toString:n=function(){throw e||(e=!0,r("r:"+(ai++).toString(36))),Error(y(355))},valueOf:n},r=ks(t)[1];return 0==(2&cs.mode)&&(cs.flags|=516,Es(5,(function(){r("r:"+(ai++).toString(36))}),void 0,null)),t}var n;return ks(t="r:"+(ai++).toString(36)),t},unstable_isNewReconciler:!1},Us={readContext:ma,useCallback:As,useContext:ma,useEffect:Ms,useImperativeHandle:Os,useLayoutEffect:Ds,useMemo:Ns,useReducer:ws,useRef:Cs,useState:function(){return ws(ys)},useDebugValue:Ls,useDeferredValue:function(e){var t=ws(ys),r=t[0],n=t[1];return Ms((function(){var t=ss.transition;ss.transition=1;try{n(e)}finally{ss.transition=t}}),[e]),r},useTransition:function(){var e=ws(ys)[0];return[Cs().current,e]},useMutableSource:Ss,useOpaqueIdentifier:function(){return ws(ys)[0]},unstable_isNewReconciler:!1},Vs={readContext:ma,useCallback:As,useContext:ma,useEffect:Ms,useImperativeHandle:Os,useLayoutEffect:Ds,useMemo:Ns,useReducer:bs,useRef:Cs,useState:function(){return bs(ys)},useDebugValue:Ls,useDeferredValue:function(e){var t=bs(ys),r=t[0],n=t[1];return Ms((function(){var t=ss.transition;ss.transition=1;try{n(e)}finally{ss.transition=t}}),[e]),r},useTransition:function(){var e=bs(ys)[0];return[Cs().current,e]},useMutableSource:Ss,useOpaqueIdentifier:function(){return bs(ys)[0]},unstable_isNewReconciler:!1},Hs=I.ReactCurrentOwner,Ws=!1;function qs(e,t,r,n){t.child=null===e?Aa(t,null,r,n):La(t,e.child,r,n)}function Gs(e,t,r,n,i){r=r.render;var a=t.ref;return ha(t,i),n=ms(e,t,r,n,a,i),null===e||Ws?(t.flags|=1,qs(e,t,n,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-517,e.lanes&=~i,ho(e,t,i))}function Zs(e,t,r,n,i,a){if(null===e){var s=r.type;return"function"!=typeof s||el(s)||void 0!==s.defaultProps||null!==r.compare||void 0!==r.defaultProps?((e=rl(r.type,null,n,t,t.mode,a)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=s,Ks(e,t,s,n,i,a))}return s=e.child,0==(i&a)&&(i=s.memoizedProps,(r=null!==(r=r.compare)?r:_n)(i,n)&&e.ref===t.ref)?ho(e,t,a):(t.flags|=1,(e=tl(s,n)).ref=t.ref,e.return=t,t.child=e)}function Ks(e,t,r,n,i,a){if(null!==e&&_n(e.memoizedProps,n)&&e.ref===t.ref){if(Ws=!1,0==(a&i))return t.lanes=e.lanes,ho(e,t,a);0!=(16384&e.flags)&&(Ws=!0)}return Xs(e,t,r,n,a)}function Qs(e,t,r){var n=t.pendingProps,i=n.children,a=null!==e?e.memoizedState:null;if("hidden"===n.mode||"unstable-defer-without-hiding"===n.mode)if(0==(4&t.mode))t.memoizedState={baseLanes:0},Mc(t,r);else{if(0==(1073741824&r))return e=null!==a?a.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e},Mc(t,e),null;t.memoizedState={baseLanes:0},Mc(t,null!==a?a.baseLanes:r)}else null!==a?(n=a.baseLanes|r,t.memoizedState=null):n=r,Mc(t,n);return qs(e,t,i,r),t.child}function Ys(e,t){var r=t.ref;(null===e&&null!==r||null!==e&&e.ref!==r)&&(t.flags|=128)}function Xs(e,t,r,n,i){var a=Ri(r)?ki:xi.current;return a=Ei(t,a),ha(t,i),r=ms(e,t,r,n,a,i),null===e||Ws?(t.flags|=1,qs(e,t,r,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-517,e.lanes&=~i,ho(e,t,i))}function Js(e,t,r,n,i){if(Ri(r)){var a=!0;ji(t)}else a=!1;if(ha(t,i),null===t.stateNode)null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),Pa(t,r,n),ja(t,r,n,i),n=!0;else if(null===e){var s=t.stateNode,o=t.memoizedProps;s.props=o;var c=s.context,l=r.contextType;"object"==typeof l&&null!==l?l=ma(l):l=Ei(t,l=Ri(r)?ki:xi.current);var d=r.getDerivedStateFromProps,u="function"==typeof d||"function"==typeof s.getSnapshotBeforeUpdate;u||"function"!=typeof s.UNSAFE_componentWillReceiveProps&&"function"!=typeof s.componentWillReceiveProps||(o!==n||c!==l)&&Ta(t,s,n,l),ga=!1;var p=t.memoizedState;s.state=p,xa(t,n,s,i),c=t.memoizedState,o!==n||p!==c||Si.current||ga?("function"==typeof d&&(Ea(t,r,d,n),c=t.memoizedState),(o=ga||Ca(t,r,o,n,p,c,l))?(u||"function"!=typeof s.UNSAFE_componentWillMount&&"function"!=typeof s.componentWillMount||("function"==typeof s.componentWillMount&&s.componentWillMount(),"function"==typeof s.UNSAFE_componentWillMount&&s.UNSAFE_componentWillMount()),"function"==typeof s.componentDidMount&&(t.flags|=4)):("function"==typeof s.componentDidMount&&(t.flags|=4),t.memoizedProps=n,t.memoizedState=c),s.props=n,s.state=c,s.context=l,n=o):("function"==typeof s.componentDidMount&&(t.flags|=4),n=!1)}else{s=t.stateNode,ya(e,t),o=t.memoizedProps,l=t.type===t.elementType?o:sa(t.type,o),s.props=l,u=t.pendingProps,p=s.context,"object"==typeof(c=r.contextType)&&null!==c?c=ma(c):c=Ei(t,c=Ri(r)?ki:xi.current);var f=r.getDerivedStateFromProps;(d="function"==typeof f||"function"==typeof s.getSnapshotBeforeUpdate)||"function"!=typeof s.UNSAFE_componentWillReceiveProps&&"function"!=typeof s.componentWillReceiveProps||(o!==u||p!==c)&&Ta(t,s,n,c),ga=!1,p=t.memoizedState,s.state=p,xa(t,n,s,i);var h=t.memoizedState;o!==u||p!==h||Si.current||ga?("function"==typeof f&&(Ea(t,r,f,n),h=t.memoizedState),(l=ga||Ca(t,r,l,n,p,h,c))?(d||"function"!=typeof s.UNSAFE_componentWillUpdate&&"function"!=typeof s.componentWillUpdate||("function"==typeof s.componentWillUpdate&&s.componentWillUpdate(n,h,c),"function"==typeof s.UNSAFE_componentWillUpdate&&s.UNSAFE_componentWillUpdate(n,h,c)),"function"==typeof s.componentDidUpdate&&(t.flags|=4),"function"==typeof s.getSnapshotBeforeUpdate&&(t.flags|=256)):("function"!=typeof s.componentDidUpdate||o===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),"function"!=typeof s.getSnapshotBeforeUpdate||o===e.memoizedProps&&p===e.memoizedState||(t.flags|=256),t.memoizedProps=n,t.memoizedState=h),s.props=n,s.state=h,s.context=c,n=l):("function"!=typeof s.componentDidUpdate||o===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),"function"!=typeof s.getSnapshotBeforeUpdate||o===e.memoizedProps&&p===e.memoizedState||(t.flags|=256),n=!1)}return eo(e,t,r,n,a,i)}function eo(e,t,r,n,i,a){Ys(e,t);var s=0!=(64&t.flags);if(!n&&!s)return i&&Mi(t,r,!1),ho(e,t,a);n=t.stateNode,Hs.current=t;var o=s&&"function"!=typeof r.getDerivedStateFromError?null:n.render();return t.flags|=1,null!==e&&s?(t.child=La(t,e.child,null,a),t.child=La(t,null,o,a)):qs(e,t,o,a),t.memoizedState=n.state,i&&Mi(t,r,!0),t.child}function to(e){var t=e.stateNode;t.pendingContext?Pi(0,t.pendingContext,t.pendingContext!==t.context):t.context&&Pi(0,t.context,!1),Ua(e,t.containerInfo)}var ro,no,io,ao={dehydrated:null,retryLane:0};function so(e,t,r){var n,i=t.pendingProps,a=qa.current,s=!1;return(n=0!=(64&t.flags))||(n=(null===e||null!==e.memoizedState)&&0!=(2&a)),n?(s=!0,t.flags&=-65):null!==e&&null===e.memoizedState||void 0===i.fallback||!0===i.unstable_avoidThisFallback||(a|=1),bi(qa,1&a),null===e?(void 0!==i.fallback&&Ja(t),e=i.children,a=i.fallback,s?(e=oo(t,e,a,r),t.child.memoizedState={baseLanes:r},t.memoizedState=ao,e):"number"==typeof i.unstable_expectedLoadTime?(e=oo(t,e,a,r),t.child.memoizedState={baseLanes:r},t.memoizedState=ao,t.lanes=33554432,e):((r=il({mode:"visible",children:e},t.mode,r,null)).return=t,t.child=r)):(e.memoizedState,s?(i=lo(e,t,i.children,i.fallback,r),s=t.child,a=e.child.memoizedState,s.memoizedState=null===a?{baseLanes:r}:{baseLanes:a.baseLanes|r},s.childLanes=e.childLanes&~r,t.memoizedState=ao,i):(r=co(e,t,i.children,r),t.memoizedState=null,r))}function oo(e,t,r,n){var i=e.mode,a=e.child;return t={mode:"hidden",children:t},0==(2&i)&&null!==a?(a.childLanes=0,a.pendingProps=t):a=il(t,i,0,null),r=nl(r,i,n,null),a.return=e,r.return=e,a.sibling=r,e.child=a,r}function co(e,t,r,n){var i=e.child;return e=i.sibling,r=tl(i,{mode:"visible",children:r}),0==(2&t.mode)&&(r.lanes=n),r.return=t,r.sibling=null,null!==e&&(e.nextEffect=null,e.flags=8,t.firstEffect=t.lastEffect=e),t.child=r}function lo(e,t,r,n,i){var a=t.mode,s=e.child;e=s.sibling;var o={mode:"hidden",children:r};return 0==(2&a)&&t.child!==s?((r=t.child).childLanes=0,r.pendingProps=o,null!==(s=r.lastEffect)?(t.firstEffect=r.firstEffect,t.lastEffect=s,s.nextEffect=null):t.firstEffect=t.lastEffect=null):r=tl(s,o),null!==e?n=tl(e,n):(n=nl(n,a,i,null)).flags|=2,n.return=t,r.return=t,r.sibling=n,t.child=r,n}function uo(e,t){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t),fa(e.return,t)}function po(e,t,r,n,i,a){var s=e.memoizedState;null===s?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:i,lastEffect:a}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=n,s.tail=r,s.tailMode=i,s.lastEffect=a)}function fo(e,t,r){var n=t.pendingProps,i=n.revealOrder,a=n.tail;if(qs(e,t,n.children,r),0!=(2&(n=qa.current)))n=1&n|2,t.flags|=64;else{if(null!==e&&0!=(64&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&uo(e,r);else if(19===e.tag)uo(e,r);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}if(bi(qa,n),0==(2&t.mode))t.memoizedState=null;else switch(i){case"forwards":for(r=t.child,i=null;null!==r;)null!==(e=r.alternate)&&null===Ga(e)&&(i=r),r=r.sibling;null===(r=i)?(i=t.child,t.child=null):(i=r.sibling,r.sibling=null),po(t,!1,i,r,a,t.lastEffect);break;case"backwards":for(r=null,i=t.child,t.child=null;null!==i;){if(null!==(e=i.alternate)&&null===Ga(e)){t.child=i;break}e=i.sibling,i.sibling=r,r=i,i=e}po(t,!0,r,null,a,t.lastEffect);break;case"together":po(t,!1,null,null,void 0,t.lastEffect);break;default:t.memoizedState=null}return t.child}function ho(e,t,r){if(null!==e&&(t.dependencies=e.dependencies),Qo|=t.lanes,0!=(r&t.childLanes)){if(null!==e&&t.child!==e.child)throw Error(y(153));if(null!==t.child){for(r=tl(e=t.child,e.pendingProps),t.child=r,r.return=t;null!==e.sibling;)e=e.sibling,(r=r.sibling=tl(e,e.pendingProps)).return=t;r.sibling=null}return t.child}return null}function mo(e,t){if(!Qa)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;null!==t;)null!==t.alternate&&(r=t),t=t.sibling;null===r?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;null!==r;)null!==r.alternate&&(n=r),r=r.sibling;null===n?t||null===e.tail?e.tail=null:e.tail.sibling=null:n.sibling=null}}function go(e,t,r){var n=t.pendingProps;switch(t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return null;case 1:case 17:return Ri(t.type)&&Ci(),null;case 3:return Va(),wi(Si),wi(xi),is(),(n=t.stateNode).pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),null!==e&&null!==e.child||(ts(t)?t.flags|=4:n.hydrate||(t.flags|=256)),null;case 5:Wa(t);var i=$a(za.current);if(r=t.type,null!==e&&null!=t.stateNode)no(e,t,r,n),e.ref!==t.ref&&(t.flags|=128);else{if(!n){if(null===t.stateNode)throw Error(y(166));return null}if(e=$a(Fa.current),ts(t)){n=t.stateNode,r=t.type;var a=t.memoizedProps;switch(n[oi]=t,n[ci]=a,r){case"dialog":Bn("cancel",n),Bn("close",n);break;case"iframe":case"object":case"embed":Bn("load",n);break;case"video":case"audio":for(e=0;e<Ln.length;e++)Bn(Ln[e],n);break;case"source":Bn("error",n);break;case"img":case"image":case"link":Bn("error",n),Bn("load",n);break;case"details":Bn("toggle",n);break;case"input":pe(n,a),Bn("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!a.multiple},Bn("invalid",n);break;case"textarea":be(n,a),Bn("invalid",n)}for(var s in Ae(r,a),e=null,a)a.hasOwnProperty(s)&&(i=a[s],"children"===s?"string"==typeof i?n.textContent!==i&&(e=["children",i]):"number"==typeof i&&n.textContent!==""+i&&(e=["children",""+i]):b.hasOwnProperty(s)&&null!=i&&"onScroll"===s&&Bn("scroll",n));switch(r){case"input":ce(n),me(n,a,!0);break;case"textarea":ce(n),xe(n);break;case"select":case"option":break;default:"function"==typeof a.onClick&&(n.onclick=Kn)}n=e,t.updateQueue=n,null!==n&&(t.flags|=4)}else{switch(s=9===i.nodeType?i:i.ownerDocument,e===Se&&(e=Ee(r)),e===Se?"script"===r?((e=s.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"==typeof n.is?e=s.createElement(r,{is:n.is}):(e=s.createElement(r),"select"===r&&(s=e,n.multiple?s.multiple=!0:n.size&&(s.size=n.size))):e=s.createElementNS(e,r),e[oi]=t,e[ci]=n,ro(e,t),t.stateNode=e,s=Ne(r,n),r){case"dialog":Bn("cancel",e),Bn("close",e),i=n;break;case"iframe":case"object":case"embed":Bn("load",e),i=n;break;case"video":case"audio":for(i=0;i<Ln.length;i++)Bn(Ln[i],e);i=n;break;case"source":Bn("error",e),i=n;break;case"img":case"image":case"link":Bn("error",e),Bn("load",e),i=n;break;case"details":Bn("toggle",e),i=n;break;case"input":pe(e,n),i=ue(e,n),Bn("invalid",e);break;case"option":i=ve(e,n);break;case"select":e._wrapperState={wasMultiple:!!n.multiple},i=g({},n,{value:void 0}),Bn("invalid",e);break;case"textarea":be(e,n),i=we(e,n),Bn("invalid",e);break;default:i=n}Ae(r,i);var o=i;for(a in o)if(o.hasOwnProperty(a)){var c=o[a];"style"===a?Oe(e,c):"dangerouslySetInnerHTML"===a?null!=(c=c?c.__html:void 0)&&Te(e,c):"children"===a?"string"==typeof c?("textarea"!==r||""!==c)&&je(e,c):"number"==typeof c&&je(e,""+c):"suppressContentEditableWarning"!==a&&"suppressHydrationWarning"!==a&&"autoFocus"!==a&&(b.hasOwnProperty(a)?null!=c&&"onScroll"===a&&Bn("scroll",e):null!=c&&D(e,a,c,s))}switch(r){case"input":ce(e),me(e,n,!1);break;case"textarea":ce(e),xe(e);break;case"option":null!=n.value&&e.setAttribute("value",""+se(n.value));break;case"select":e.multiple=!!n.multiple,null!=(a=n.value)?ye(e,!!n.multiple,a,!1):null!=n.defaultValue&&ye(e,!!n.multiple,n.defaultValue,!0);break;default:"function"==typeof i.onClick&&(e.onclick=Kn)}Xn(r,n)&&(t.flags|=4)}null!==t.ref&&(t.flags|=128)}return null;case 6:if(e&&null!=t.stateNode)io(0,t,e.memoizedProps,n);else{if("string"!=typeof n&&null===t.stateNode)throw Error(y(166));r=$a(za.current),$a(Fa.current),ts(t)?(n=t.stateNode,r=t.memoizedProps,n[oi]=t,n.nodeValue!==r&&(t.flags|=4)):((n=(9===r.nodeType?r:r.ownerDocument).createTextNode(n))[oi]=t,t.stateNode=n)}return null;case 13:return wi(qa),n=t.memoizedState,0!=(64&t.flags)?(t.lanes=r,t):(n=null!==n,r=!1,null===e?void 0!==t.memoizedProps.fallback&&ts(t):r=null!==e.memoizedState,n&&!r&&0!=(2&t.mode)&&(null===e&&!0!==t.memoizedProps.unstable_avoidThisFallback||0!=(1&qa.current)?0===Go&&(Go=3):(0!==Go&&3!==Go||(Go=4),null===Uo||0==(134217727&Qo)&&0==(134217727&Yo)||Cc(Uo,Ho))),(n||r)&&(t.flags|=4),null);case 4:return Va(),null===e&&$n(t.stateNode.containerInfo),null;case 10:return pa(t),null;case 19:if(wi(qa),null===(n=t.memoizedState))return null;if(a=0!=(64&t.flags),null===(s=n.rendering))if(a)mo(n,!1);else{if(0!==Go||null!==e&&0!=(64&e.flags))for(e=t.child;null!==e;){if(null!==(s=Ga(e))){for(t.flags|=64,mo(n,!1),null!==(a=s.updateQueue)&&(t.updateQueue=a,t.flags|=4),null===n.lastEffect&&(t.firstEffect=null),t.lastEffect=n.lastEffect,n=r,r=t.child;null!==r;)e=n,(a=r).flags&=2,a.nextEffect=null,a.firstEffect=null,a.lastEffect=null,null===(s=a.alternate)?(a.childLanes=0,a.lanes=e,a.child=null,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=s.childLanes,a.lanes=s.lanes,a.child=s.child,a.memoizedProps=s.memoizedProps,a.memoizedState=s.memoizedState,a.updateQueue=s.updateQueue,a.type=s.type,e=s.dependencies,a.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return bi(qa,1&qa.current|2),t.child}e=e.sibling}null!==n.tail&&Xi()>tc&&(t.flags|=64,a=!0,mo(n,!1),t.lanes=33554432)}else{if(!a)if(null!==(e=Ga(s))){if(t.flags|=64,a=!0,null!==(r=e.updateQueue)&&(t.updateQueue=r,t.flags|=4),mo(n,!0),null===n.tail&&"hidden"===n.tailMode&&!s.alternate&&!Qa)return null!==(t=t.lastEffect=n.lastEffect)&&(t.nextEffect=null),null}else 2*Xi()-n.renderingStartTime>tc&&1073741824!==r&&(t.flags|=64,a=!0,mo(n,!1),t.lanes=33554432);n.isBackwards?(s.sibling=t.child,t.child=s):(null!==(r=n.last)?r.sibling=s:t.child=s,n.last=s)}return null!==n.tail?(r=n.tail,n.rendering=r,n.tail=r.sibling,n.lastEffect=t.lastEffect,n.renderingStartTime=Xi(),r.sibling=null,t=qa.current,bi(qa,a?1&t|2:1&t),r):null;case 23:case 24:return Dc(),null!==e&&null!==e.memoizedState!=(null!==t.memoizedState)&&"unstable-defer-without-hiding"!==n.mode&&(t.flags|=4),null}throw Error(y(156,t.tag))}function vo(e){switch(e.tag){case 1:Ri(e.type)&&Ci();var t=e.flags;return 4096&t?(e.flags=-4097&t|64,e):null;case 3:if(Va(),wi(Si),wi(xi),is(),0!=(64&(t=e.flags)))throw Error(y(285));return e.flags=-4097&t|64,e;case 5:return Wa(e),null;case 13:return wi(qa),4096&(t=e.flags)?(e.flags=-4097&t|64,e):null;case 19:return wi(qa),null;case 4:return Va(),null;case 10:return pa(e),null;case 23:case 24:return Dc(),null;default:return null}}function yo(e,t){try{var r="",n=t;do{r+=ie(n),n=n.return}while(n);var i=r}catch(e){i="\nError generating stack: "+e.message+"\n"+e.stack}return{value:e,source:t,stack:i}}function wo(e,t){try{console.error(t.value)}catch(e){setTimeout((function(){throw e}))}}ro=function(e,t){for(var r=t.child;null!==r;){if(5===r.tag||6===r.tag)e.appendChild(r.stateNode);else if(4!==r.tag&&null!==r.child){r.child.return=r,r=r.child;continue}if(r===t)break;for(;null===r.sibling;){if(null===r.return||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}},no=function(e,t,r,n){var i=e.memoizedProps;if(i!==n){e=t.stateNode,$a(Fa.current);var a,s=null;switch(r){case"input":i=ue(e,i),n=ue(e,n),s=[];break;case"option":i=ve(e,i),n=ve(e,n),s=[];break;case"select":i=g({},i,{value:void 0}),n=g({},n,{value:void 0}),s=[];break;case"textarea":i=we(e,i),n=we(e,n),s=[];break;default:"function"!=typeof i.onClick&&"function"==typeof n.onClick&&(e.onclick=Kn)}for(l in Ae(r,n),r=null,i)if(!n.hasOwnProperty(l)&&i.hasOwnProperty(l)&&null!=i[l])if("style"===l){var o=i[l];for(a in o)o.hasOwnProperty(a)&&(r||(r={}),r[a]="")}else"dangerouslySetInnerHTML"!==l&&"children"!==l&&"suppressContentEditableWarning"!==l&&"suppressHydrationWarning"!==l&&"autoFocus"!==l&&(b.hasOwnProperty(l)?s||(s=[]):(s=s||[]).push(l,null));for(l in n){var c=n[l];if(o=null!=i?i[l]:void 0,n.hasOwnProperty(l)&&c!==o&&(null!=c||null!=o))if("style"===l)if(o){for(a in o)!o.hasOwnProperty(a)||c&&c.hasOwnProperty(a)||(r||(r={}),r[a]="");for(a in c)c.hasOwnProperty(a)&&o[a]!==c[a]&&(r||(r={}),r[a]=c[a])}else r||(s||(s=[]),s.push(l,r)),r=c;else"dangerouslySetInnerHTML"===l?(c=c?c.__html:void 0,o=o?o.__html:void 0,null!=c&&o!==c&&(s=s||[]).push(l,c)):"children"===l?"string"!=typeof c&&"number"!=typeof c||(s=s||[]).push(l,""+c):"suppressContentEditableWarning"!==l&&"suppressHydrationWarning"!==l&&(b.hasOwnProperty(l)?(null!=c&&"onScroll"===l&&Bn("scroll",e),s||o===c||(s=[])):"object"==typeof c&&null!==c&&c.$$typeof===G?c.toString():(s=s||[]).push(l,c))}r&&(s=s||[]).push("style",r);var l=s;(t.updateQueue=l)&&(t.flags|=4)}},io=function(e,t,r,n){r!==n&&(t.flags|=4)};var bo="function"==typeof WeakMap?WeakMap:Map;function _o(e,t,r){(r=wa(-1,r)).tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){ac||(ac=!0,sc=n),wo(0,t)},r}function xo(e,t,r){(r=wa(-1,r)).tag=3;var n=e.type.getDerivedStateFromError;if("function"==typeof n){var i=t.value;r.payload=function(){return wo(0,t),n(i)}}var a=e.stateNode;return null!==a&&"function"==typeof a.componentDidCatch&&(r.callback=function(){"function"!=typeof n&&(null===oc?oc=new Set([this]):oc.add(this),wo(0,t));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),r}var So="function"==typeof WeakSet?WeakSet:Set;function ko(e){var t=e.ref;if(null!==t)if("function"==typeof t)try{t(null)}catch(t){Kc(e,t)}else t.current=null}function Eo(e,t){switch(t.tag){case 0:case 11:case 15:case 22:case 5:case 6:case 4:case 17:return;case 1:if(256&t.flags&&null!==e){var r=e.memoizedProps,n=e.memoizedState;t=(e=t.stateNode).getSnapshotBeforeUpdate(t.elementType===t.type?r:sa(t.type,r),n),e.__reactInternalSnapshotBeforeUpdate=t}return;case 3:return void(256&t.flags&&ri(t.stateNode.containerInfo))}throw Error(y(163))}function Ro(e,t,r){switch(r.tag){case 0:case 11:case 15:case 22:if(null!==(t=null!==(t=r.updateQueue)?t.lastEffect:null)){e=t=t.next;do{if(3==(3&e.tag)){var n=e.create;e.destroy=n()}e=e.next}while(e!==t)}if(null!==(t=null!==(t=r.updateQueue)?t.lastEffect:null)){e=t=t.next;do{var i=e;n=i.next,0!=(4&(i=i.tag))&&0!=(1&i)&&(qc(r,e),Wc(r,e)),e=n}while(e!==t)}return;case 1:return e=r.stateNode,4&r.flags&&(null===t?e.componentDidMount():(n=r.elementType===r.type?t.memoizedProps:sa(r.type,t.memoizedProps),e.componentDidUpdate(n,t.memoizedState,e.__reactInternalSnapshotBeforeUpdate))),void(null!==(t=r.updateQueue)&&Sa(r,t,e));case 3:if(null!==(t=r.updateQueue)){if(e=null,null!==r.child)switch(r.child.tag){case 5:case 1:e=r.child.stateNode}Sa(r,t,e)}return;case 5:return e=r.stateNode,void(null===t&&4&r.flags&&Xn(r.type,r.memoizedProps)&&e.focus());case 6:case 4:case 12:case 19:case 17:case 20:case 21:case 23:case 24:return;case 13:return void(null===r.memoizedState&&(r=r.alternate,null!==r&&(r=r.memoizedState,null!==r&&(r=r.dehydrated,null!==r&&Ot(r)))))}throw Error(y(163))}function Co(e,t){for(var r=e;;){if(5===r.tag){var n=r.stateNode;if(t)"function"==typeof(n=n.style).setProperty?n.setProperty("display","none","important"):n.display="none";else{n=r.stateNode;var i=r.memoizedProps.style;i=null!=i&&i.hasOwnProperty("display")?i.display:null,n.style.display=Ie("display",i)}}else if(6===r.tag)r.stateNode.nodeValue=t?"":r.memoizedProps;else if((23!==r.tag&&24!==r.tag||null===r.memoizedState||r===e)&&null!==r.child){r.child.return=r,r=r.child;continue}if(r===e)break;for(;null===r.sibling;){if(null===r.return||r.return===e)return;r=r.return}r.sibling.return=r.return,r=r.sibling}}function Po(e,t){if(Ii&&"function"==typeof Ii.onCommitFiberUnmount)try{Ii.onCommitFiberUnmount(Di,t)}catch(e){}switch(t.tag){case 0:case 11:case 14:case 15:case 22:if(null!==(e=t.updateQueue)&&null!==(e=e.lastEffect)){var r=e=e.next;do{var n=r,i=n.destroy;if(n=n.tag,void 0!==i)if(0!=(4&n))qc(t,r);else{n=t;try{i()}catch(e){Kc(n,e)}}r=r.next}while(r!==e)}break;case 1:if(ko(t),"function"==typeof(e=t.stateNode).componentWillUnmount)try{e.props=t.memoizedProps,e.state=t.memoizedState,e.componentWillUnmount()}catch(e){Kc(t,e)}break;case 5:ko(t);break;case 4:Oo(e,t)}}function To(e){e.alternate=null,e.child=null,e.dependencies=null,e.firstEffect=null,e.lastEffect=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.return=null,e.updateQueue=null}function jo(e){return 5===e.tag||3===e.tag||4===e.tag}function Mo(e){e:{for(var t=e.return;null!==t;){if(jo(t))break e;t=t.return}throw Error(y(160))}var r=t;switch(t=r.stateNode,r.tag){case 5:var n=!1;break;case 3:case 4:t=t.containerInfo,n=!0;break;default:throw Error(y(161))}16&r.flags&&(je(t,""),r.flags&=-17);e:t:for(r=e;;){for(;null===r.sibling;){if(null===r.return||jo(r.return)){r=null;break e}r=r.return}for(r.sibling.return=r.return,r=r.sibling;5!==r.tag&&6!==r.tag&&18!==r.tag;){if(2&r.flags)continue t;if(null===r.child||4===r.tag)continue t;r.child.return=r,r=r.child}if(!(2&r.flags)){r=r.stateNode;break e}}n?Do(e,r,t):Io(e,r,t)}function Do(e,t,r){var n=e.tag,i=5===n||6===n;if(i)e=i?e.stateNode:e.stateNode.instance,t?8===r.nodeType?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(8===r.nodeType?(t=r.parentNode).insertBefore(e,r):(t=r).appendChild(e),null!=(r=r._reactRootContainer)||null!==t.onclick||(t.onclick=Kn));else if(4!==n&&null!==(e=e.child))for(Do(e,t,r),e=e.sibling;null!==e;)Do(e,t,r),e=e.sibling}function Io(e,t,r){var n=e.tag,i=5===n||6===n;if(i)e=i?e.stateNode:e.stateNode.instance,t?r.insertBefore(e,t):r.appendChild(e);else if(4!==n&&null!==(e=e.child))for(Io(e,t,r),e=e.sibling;null!==e;)Io(e,t,r),e=e.sibling}function Oo(e,t){for(var r,n,i=t,a=!1;;){if(!a){a=i.return;e:for(;;){if(null===a)throw Error(y(160));switch(r=a.stateNode,a.tag){case 5:n=!1;break e;case 3:case 4:r=r.containerInfo,n=!0;break e}a=a.return}a=!0}if(5===i.tag||6===i.tag){e:for(var s=e,o=i,c=o;;)if(Po(s,c),null!==c.child&&4!==c.tag)c.child.return=c,c=c.child;else{if(c===o)break e;for(;null===c.sibling;){if(null===c.return||c.return===o)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}n?(s=r,o=i.stateNode,8===s.nodeType?s.parentNode.removeChild(o):s.removeChild(o)):r.removeChild(i.stateNode)}else if(4===i.tag){if(null!==i.child){r=i.stateNode.containerInfo,n=!0,i.child.return=i,i=i.child;continue}}else if(Po(e,i),null!==i.child){i.child.return=i,i=i.child;continue}if(i===t)break;for(;null===i.sibling;){if(null===i.return||i.return===t)return;4===(i=i.return).tag&&(a=!1)}i.sibling.return=i.return,i=i.sibling}}function Lo(e,t){switch(t.tag){case 0:case 11:case 14:case 15:case 22:var r=t.updateQueue;if(null!==(r=null!==r?r.lastEffect:null)){var n=r=r.next;do{3==(3&n.tag)&&(e=n.destroy,n.destroy=void 0,void 0!==e&&e()),n=n.next}while(n!==r)}return;case 1:case 12:case 17:return;case 5:if(null!=(r=t.stateNode)){n=t.memoizedProps;var i=null!==e?e.memoizedProps:n;e=t.type;var a=t.updateQueue;if(t.updateQueue=null,null!==a){for(r[ci]=n,"input"===e&&"radio"===n.type&&null!=n.name&&fe(r,n),Ne(e,i),t=Ne(e,n),i=0;i<a.length;i+=2){var s=a[i],o=a[i+1];"style"===s?Oe(r,o):"dangerouslySetInnerHTML"===s?Te(r,o):"children"===s?je(r,o):D(r,s,o,t)}switch(e){case"input":he(r,n);break;case"textarea":_e(r,n);break;case"select":e=r._wrapperState.wasMultiple,r._wrapperState.wasMultiple=!!n.multiple,null!=(a=n.value)?ye(r,!!n.multiple,a,!1):e!==!!n.multiple&&(null!=n.defaultValue?ye(r,!!n.multiple,n.defaultValue,!0):ye(r,!!n.multiple,n.multiple?[]:"",!1))}}}return;case 6:if(null===t.stateNode)throw Error(y(162));return void(t.stateNode.nodeValue=t.memoizedProps);case 3:return void((r=t.stateNode).hydrate&&(r.hydrate=!1,Ot(r.containerInfo)));case 13:return null!==t.memoizedState&&(ec=Xi(),Co(t.child,!0)),void Ao(t);case 19:return void Ao(t);case 23:case 24:return void Co(t,null!==t.memoizedState)}throw Error(y(163))}function Ao(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var r=e.stateNode;null===r&&(r=e.stateNode=new So),t.forEach((function(t){var n=Yc.bind(null,e,t);r.has(t)||(r.add(t),t.then(n,n))}))}}function No(e,t){return null!==e&&(null===(e=e.memoizedState)||null!==e.dehydrated)&&(null!==(t=t.memoizedState)&&null===t.dehydrated)}var Fo=Math.ceil,Bo=I.ReactCurrentDispatcher,zo=I.ReactCurrentOwner,$o=0,Uo=null,Vo=null,Ho=0,Wo=0,qo=yi(0),Go=0,Zo=null,Ko=0,Qo=0,Yo=0,Xo=0,Jo=null,ec=0,tc=1/0;function rc(){tc=Xi()+500}var nc,ic=null,ac=!1,sc=null,oc=null,cc=!1,lc=null,dc=90,uc=[],pc=[],fc=null,hc=0,mc=null,gc=-1,vc=0,yc=0,wc=null,bc=!1;function _c(){return 0!=(48&$o)?Xi():-1!==gc?gc:gc=Xi()}function xc(e){if(0==(2&(e=e.mode)))return 1;if(0==(4&e))return 99===Ji()?1:2;if(0===vc&&(vc=Ko),0!==aa.transition){0!==yc&&(yc=null!==Jo?Jo.pendingLanes:0),e=vc;var t=4186112&~yc;return 0===(t&=-t)&&(0===(t=(e=4186112&~e)&-e)&&(t=8192)),t}return e=Ji(),0!=(4&$o)&&98===e?e=Xt(12,vc):e=Xt(e=function(e){switch(e){case 99:return 15;case 98:return 10;case 97:case 96:return 8;case 95:return 2;default:return 0}}(e),vc),e}function Sc(e,t,r){if(50<hc)throw hc=0,mc=null,Error(y(185));if(null===(e=kc(e,t)))return null;tr(e,t,r),e===Uo&&(Yo|=t,4===Go&&Cc(e,Ho));var n=Ji();1===t?0!=(8&$o)&&0==(48&$o)?Pc(e):(Ec(e,r),0===$o&&(rc(),na())):(0==(4&$o)||98!==n&&99!==n||(null===fc?fc=new Set([e]):fc.add(e)),Ec(e,r)),Jo=e}function kc(e,t){e.lanes|=t;var r=e.alternate;for(null!==r&&(r.lanes|=t),r=e,e=e.return;null!==e;)e.childLanes|=t,null!==(r=e.alternate)&&(r.childLanes|=t),r=e,e=e.return;return 3===r.tag?r.stateNode:null}function Ec(e,t){for(var r=e.callbackNode,n=e.suspendedLanes,i=e.pingedLanes,a=e.expirationTimes,s=e.pendingLanes;0<s;){var o=31-rr(s),c=1<<o,l=a[o];if(-1===l){if(0==(c&n)||0!=(c&i)){l=t,Kt(c);var d=Zt;a[o]=10<=d?l+250:6<=d?l+5e3:-1}}else l<=t&&(e.expiredLanes|=c);s&=~c}if(n=Qt(e,e===Uo?Ho:0),t=Zt,0===n)null!==r&&(r!==qi&&Ai(r),e.callbackNode=null,e.callbackPriority=0);else{if(null!==r){if(e.callbackPriority===t)return;r!==qi&&Ai(r)}15===t?(r=Pc.bind(null,e),null===Zi?(Zi=[r],Ki=Li($i,ia)):Zi.push(r),r=qi):14===t?r=ra(99,Pc.bind(null,e)):r=ra(r=function(e){switch(e){case 15:case 14:return 99;case 13:case 12:case 11:case 10:return 98;case 9:case 8:case 7:case 6:case 4:case 5:return 97;case 3:case 2:case 1:return 95;case 0:return 90;default:throw Error(y(358,e))}}(t),Rc.bind(null,e)),e.callbackPriority=t,e.callbackNode=r}}function Rc(e){if(gc=-1,yc=vc=0,0!=(48&$o))throw Error(y(327));var t=e.callbackNode;if(Hc()&&e.callbackNode!==t)return null;var r=Qt(e,e===Uo?Ho:0);if(0===r)return null;var n=r,i=$o;$o|=16;var a=Lc();for(Uo===e&&Ho===n||(rc(),Ic(e,n));;)try{Fc();break}catch(t){Oc(e,t)}if(ua(),Bo.current=a,$o=i,null!==Vo?n=0:(Uo=null,Ho=0,n=Go),0!=(Ko&Yo))Ic(e,0);else if(0!==n){if(2===n&&($o|=64,e.hydrate&&(e.hydrate=!1,ri(e.containerInfo)),0!==(r=Yt(e))&&(n=Ac(e,r))),1===n)throw t=Zo,Ic(e,0),Cc(e,r),Ec(e,Xi()),t;switch(e.finishedWork=e.current.alternate,e.finishedLanes=r,n){case 0:case 1:throw Error(y(345));case 2:case 5:$c(e);break;case 3:if(Cc(e,r),(62914560&r)===r&&10<(n=ec+500-Xi())){if(0!==Qt(e,0))break;if(((i=e.suspendedLanes)&r)!==r){_c(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=ei($c.bind(null,e),n);break}$c(e);break;case 4:if(Cc(e,r),(4186112&r)===r)break;for(n=e.eventTimes,i=-1;0<r;){var s=31-rr(r);a=1<<s,(s=n[s])>i&&(i=s),r&=~a}if(r=i,10<(r=(120>(r=Xi()-r)?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Fo(r/1960))-r)){e.timeoutHandle=ei($c.bind(null,e),r);break}$c(e);break;default:throw Error(y(329))}}return Ec(e,Xi()),e.callbackNode===t?Rc.bind(null,e):null}function Cc(e,t){for(t&=~Xo,t&=~Yo,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-rr(t),n=1<<r;e[r]=-1,t&=~n}}function Pc(e){if(0!=(48&$o))throw Error(y(327));if(Hc(),e===Uo&&0!=(e.expiredLanes&Ho)){var t=Ho,r=Ac(e,t);0!=(Ko&Yo)&&(r=Ac(e,t=Qt(e,t)))}else r=Ac(e,t=Qt(e,0));if(0!==e.tag&&2===r&&($o|=64,e.hydrate&&(e.hydrate=!1,ri(e.containerInfo)),0!==(t=Yt(e))&&(r=Ac(e,t))),1===r)throw r=Zo,Ic(e,0),Cc(e,t),Ec(e,Xi()),r;return e.finishedWork=e.current.alternate,e.finishedLanes=t,$c(e),Ec(e,Xi()),null}function Tc(e,t){var r=$o;$o|=1;try{return e(t)}finally{0===($o=r)&&(rc(),na())}}function jc(e,t){var r=$o;$o&=-2,$o|=8;try{return e(t)}finally{0===($o=r)&&(rc(),na())}}function Mc(e,t){bi(qo,Wo),Wo|=t,Ko|=t}function Dc(){Wo=qo.current,wi(qo)}function Ic(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(-1!==r&&(e.timeoutHandle=-1,ti(r)),null!==Vo)for(r=Vo.return;null!==r;){var n=r;switch(n.tag){case 1:null!=(n=n.type.childContextTypes)&&Ci();break;case 3:Va(),wi(Si),wi(xi),is();break;case 5:Wa(n);break;case 4:Va();break;case 13:case 19:wi(qa);break;case 10:pa(n);break;case 23:case 24:Dc()}r=r.return}Uo=e,Vo=tl(e.current,null),Ho=Wo=Ko=t,Go=0,Zo=null,Xo=Yo=Qo=0}function Oc(e,t){for(;;){var r=Vo;try{if(ua(),as.current=zs,us){for(var n=cs.memoizedState;null!==n;){var i=n.queue;null!==i&&(i.pending=null),n=n.next}us=!1}if(os=0,ds=ls=cs=null,ps=!1,zo.current=null,null===r||null===r.return){Go=1,Zo=t,Vo=null;break}e:{var a=e,s=r.return,o=r,c=t;if(t=Ho,o.flags|=2048,o.firstEffect=o.lastEffect=null,null!==c&&"object"==typeof c&&"function"==typeof c.then){var l=c;if(0==(2&o.mode)){var d=o.alternate;d?(o.updateQueue=d.updateQueue,o.memoizedState=d.memoizedState,o.lanes=d.lanes):(o.updateQueue=null,o.memoizedState=null)}var u=0!=(1&qa.current),p=s;do{var f;if(f=13===p.tag){var h=p.memoizedState;if(null!==h)f=null!==h.dehydrated;else{var m=p.memoizedProps;f=void 0!==m.fallback&&(!0!==m.unstable_avoidThisFallback||!u)}}if(f){var g=p.updateQueue;if(null===g){var v=new Set;v.add(l),p.updateQueue=v}else g.add(l);if(0==(2&p.mode)){if(p.flags|=64,o.flags|=16384,o.flags&=-2981,1===o.tag)if(null===o.alternate)o.tag=17;else{var y=wa(-1,1);y.tag=2,ba(o,y)}o.lanes|=1;break e}c=void 0,o=t;var w=a.pingCache;if(null===w?(w=a.pingCache=new bo,c=new Set,w.set(l,c)):void 0===(c=w.get(l))&&(c=new Set,w.set(l,c)),!c.has(o)){c.add(o);var b=Qc.bind(null,a,l,o);l.then(b,b)}p.flags|=4096,p.lanes=t;break e}p=p.return}while(null!==p);c=Error((ae(o.type)||"A React component")+" suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.")}5!==Go&&(Go=2),c=yo(c,o),p=s;do{switch(p.tag){case 3:a=c,p.flags|=4096,t&=-t,p.lanes|=t,_a(p,_o(0,a,t));break e;case 1:a=c;var _=p.type,x=p.stateNode;if(0==(64&p.flags)&&("function"==typeof _.getDerivedStateFromError||null!==x&&"function"==typeof x.componentDidCatch&&(null===oc||!oc.has(x)))){p.flags|=4096,t&=-t,p.lanes|=t,_a(p,xo(p,a,t));break e}}p=p.return}while(null!==p)}zc(r)}catch(e){t=e,Vo===r&&null!==r&&(Vo=r=r.return);continue}break}}function Lc(){var e=Bo.current;return Bo.current=zs,null===e?zs:e}function Ac(e,t){var r=$o;$o|=16;var n=Lc();for(Uo===e&&Ho===t||Ic(e,t);;)try{Nc();break}catch(t){Oc(e,t)}if(ua(),$o=r,Bo.current=n,null!==Vo)throw Error(y(261));return Uo=null,Ho=0,Go}function Nc(){for(;null!==Vo;)Bc(Vo)}function Fc(){for(;null!==Vo&&!Ni();)Bc(Vo)}function Bc(e){var t=nc(e.alternate,e,Wo);e.memoizedProps=e.pendingProps,null===t?zc(e):Vo=t,zo.current=null}function zc(e){var t=e;do{var r=t.alternate;if(e=t.return,0==(2048&t.flags)){if(null!==(r=go(r,t,Wo)))return void(Vo=r);if(24!==(r=t).tag&&23!==r.tag||null===r.memoizedState||0!=(1073741824&Wo)||0==(4&r.mode)){for(var n=0,i=r.child;null!==i;)n|=i.lanes|i.childLanes,i=i.sibling;r.childLanes=n}null!==e&&0==(2048&e.flags)&&(null===e.firstEffect&&(e.firstEffect=t.firstEffect),null!==t.lastEffect&&(null!==e.lastEffect&&(e.lastEffect.nextEffect=t.firstEffect),e.lastEffect=t.lastEffect),1<t.flags&&(null!==e.lastEffect?e.lastEffect.nextEffect=t:e.firstEffect=t,e.lastEffect=t))}else{if(null!==(r=vo(t)))return r.flags&=2047,void(Vo=r);null!==e&&(e.firstEffect=e.lastEffect=null,e.flags|=2048)}if(null!==(t=t.sibling))return void(Vo=t);Vo=t=e}while(null!==t);0===Go&&(Go=5)}function $c(e){var t=Ji();return ta(99,Uc.bind(null,e,t)),null}function Uc(e,t){do{Hc()}while(null!==lc);if(0!=(48&$o))throw Error(y(327));var r=e.finishedWork;if(null===r)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(y(177));e.callbackNode=null;var n=r.lanes|r.childLanes,i=n,a=e.pendingLanes&~i;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=i,e.mutableReadLanes&=i,e.entangledLanes&=i,i=e.entanglements;for(var s=e.eventTimes,o=e.expirationTimes;0<a;){var c=31-rr(a),l=1<<c;i[c]=0,s[c]=-1,o[c]=-1,a&=~l}if(null!==fc&&0==(24&n)&&fc.has(e)&&fc.delete(e),e===Uo&&(Vo=Uo=null,Ho=0),1<r.flags?null!==r.lastEffect?(r.lastEffect.nextEffect=r,n=r.firstEffect):n=r:n=r.firstEffect,null!==n){if(i=$o,$o|=32,zo.current=null,Qn=or,Rn(s=En())){if("selectionStart"in s)o={start:s.selectionStart,end:s.selectionEnd};else e:if(o=(o=s.ownerDocument)&&o.defaultView||window,(l=o.getSelection&&o.getSelection())&&0!==l.rangeCount){o=l.anchorNode,a=l.anchorOffset,c=l.focusNode,l=l.focusOffset;try{o.nodeType,c.nodeType}catch(e){o=null;break e}var d=0,u=-1,p=-1,f=0,h=0,m=s,g=null;t:for(;;){for(var v;m!==o||0!==a&&3!==m.nodeType||(u=d+a),m!==c||0!==l&&3!==m.nodeType||(p=d+l),3===m.nodeType&&(d+=m.nodeValue.length),null!==(v=m.firstChild);)g=m,m=v;for(;;){if(m===s)break t;if(g===o&&++f===a&&(u=d),g===c&&++h===l&&(p=d),null!==(v=m.nextSibling))break;g=(m=g).parentNode}m=v}o=-1===u||-1===p?null:{start:u,end:p}}else o=null;o=o||{start:0,end:0}}else o=null;Yn={focusedElem:s,selectionRange:o},or=!1,wc=null,bc=!1,ic=n;do{try{Vc()}catch(e){if(null===ic)throw Error(y(330));Kc(ic,e),ic=ic.nextEffect}}while(null!==ic);wc=null,ic=n;do{try{for(s=e;null!==ic;){var w=ic.flags;if(16&w&&je(ic.stateNode,""),128&w){var b=ic.alternate;if(null!==b){var _=b.ref;null!==_&&("function"==typeof _?_(null):_.current=null)}}switch(1038&w){case 2:Mo(ic),ic.flags&=-3;break;case 6:Mo(ic),ic.flags&=-3,Lo(ic.alternate,ic);break;case 1024:ic.flags&=-1025;break;case 1028:ic.flags&=-1025,Lo(ic.alternate,ic);break;case 4:Lo(ic.alternate,ic);break;case 8:Oo(s,o=ic);var x=o.alternate;To(o),null!==x&&To(x)}ic=ic.nextEffect}}catch(e){if(null===ic)throw Error(y(330));Kc(ic,e),ic=ic.nextEffect}}while(null!==ic);if(_=Yn,b=En(),w=_.focusedElem,s=_.selectionRange,b!==w&&w&&w.ownerDocument&&kn(w.ownerDocument.documentElement,w)){null!==s&&Rn(w)&&(b=s.start,void 0===(_=s.end)&&(_=b),"selectionStart"in w?(w.selectionStart=b,w.selectionEnd=Math.min(_,w.value.length)):(_=(b=w.ownerDocument||document)&&b.defaultView||window).getSelection&&(_=_.getSelection(),o=w.textContent.length,x=Math.min(s.start,o),s=void 0===s.end?x:Math.min(s.end,o),!_.extend&&x>s&&(o=s,s=x,x=o),o=Sn(w,x),a=Sn(w,s),o&&a&&(1!==_.rangeCount||_.anchorNode!==o.node||_.anchorOffset!==o.offset||_.focusNode!==a.node||_.focusOffset!==a.offset)&&((b=b.createRange()).setStart(o.node,o.offset),_.removeAllRanges(),x>s?(_.addRange(b),_.extend(a.node,a.offset)):(b.setEnd(a.node,a.offset),_.addRange(b))))),b=[];for(_=w;_=_.parentNode;)1===_.nodeType&&b.push({element:_,left:_.scrollLeft,top:_.scrollTop});for("function"==typeof w.focus&&w.focus(),w=0;w<b.length;w++)(_=b[w]).element.scrollLeft=_.left,_.element.scrollTop=_.top}or=!!Qn,Yn=Qn=null,e.current=r,ic=n;do{try{for(w=e;null!==ic;){var S=ic.flags;if(36&S&&Ro(w,ic.alternate,ic),128&S){b=void 0;var k=ic.ref;if(null!==k){var E=ic.stateNode;ic.tag,b=E,"function"==typeof k?k(b):k.current=b}}ic=ic.nextEffect}}catch(e){if(null===ic)throw Error(y(330));Kc(ic,e),ic=ic.nextEffect}}while(null!==ic);ic=null,Gi(),$o=i}else e.current=r;if(cc)cc=!1,lc=e,dc=t;else for(ic=n;null!==ic;)t=ic.nextEffect,ic.nextEffect=null,8&ic.flags&&((S=ic).sibling=null,S.stateNode=null),ic=t;if(0===(n=e.pendingLanes)&&(oc=null),1===n?e===mc?hc++:(hc=0,mc=e):hc=0,r=r.stateNode,Ii&&"function"==typeof Ii.onCommitFiberRoot)try{Ii.onCommitFiberRoot(Di,r,void 0,64==(64&r.current.flags))}catch(e){}if(Ec(e,Xi()),ac)throw ac=!1,e=sc,sc=null,e;return 0!=(8&$o)||na(),null}function Vc(){for(;null!==ic;){var e=ic.alternate;bc||null===wc||(0!=(8&ic.flags)?pt(ic,wc)&&(bc=!0):13===ic.tag&&No(e,ic)&&pt(ic,wc)&&(bc=!0));var t=ic.flags;0!=(256&t)&&Eo(e,ic),0==(512&t)||cc||(cc=!0,ra(97,(function(){return Hc(),null}))),ic=ic.nextEffect}}function Hc(){if(90!==dc){var e=97<dc?97:dc;return dc=90,ta(e,Gc)}return!1}function Wc(e,t){uc.push(t,e),cc||(cc=!0,ra(97,(function(){return Hc(),null})))}function qc(e,t){pc.push(t,e),cc||(cc=!0,ra(97,(function(){return Hc(),null})))}function Gc(){if(null===lc)return!1;var e=lc;if(lc=null,0!=(48&$o))throw Error(y(331));var t=$o;$o|=32;var r=pc;pc=[];for(var n=0;n<r.length;n+=2){var i=r[n],a=r[n+1],s=i.destroy;if(i.destroy=void 0,"function"==typeof s)try{s()}catch(e){if(null===a)throw Error(y(330));Kc(a,e)}}for(r=uc,uc=[],n=0;n<r.length;n+=2){i=r[n],a=r[n+1];try{var o=i.create;i.destroy=o()}catch(e){if(null===a)throw Error(y(330));Kc(a,e)}}for(o=e.current.firstEffect;null!==o;)e=o.nextEffect,o.nextEffect=null,8&o.flags&&(o.sibling=null,o.stateNode=null),o=e;return $o=t,na(),!0}function Zc(e,t,r){ba(e,t=_o(0,t=yo(r,t),1)),t=_c(),null!==(e=kc(e,1))&&(tr(e,1,t),Ec(e,t))}function Kc(e,t){if(3===e.tag)Zc(e,e,t);else for(var r=e.return;null!==r;){if(3===r.tag){Zc(r,e,t);break}if(1===r.tag){var n=r.stateNode;if("function"==typeof r.type.getDerivedStateFromError||"function"==typeof n.componentDidCatch&&(null===oc||!oc.has(n))){var i=xo(r,e=yo(t,e),1);if(ba(r,i),i=_c(),null!==(r=kc(r,1)))tr(r,1,i),Ec(r,i);else if("function"==typeof n.componentDidCatch&&(null===oc||!oc.has(n)))try{n.componentDidCatch(t,e)}catch(e){}break}}r=r.return}}function Qc(e,t,r){var n=e.pingCache;null!==n&&n.delete(t),t=_c(),e.pingedLanes|=e.suspendedLanes&r,Uo===e&&(Ho&r)===r&&(4===Go||3===Go&&(62914560&Ho)===Ho&&500>Xi()-ec?Ic(e,0):Xo|=r),Ec(e,t)}function Yc(e,t){var r=e.stateNode;null!==r&&r.delete(t),0===(t=0)&&(0==(2&(t=e.mode))?t=1:0==(4&t)?t=99===Ji()?1:2:(0===vc&&(vc=Ko),0===(t=Jt(62914560&~vc))&&(t=4194304))),r=_c(),null!==(e=kc(e,t))&&(tr(e,t,r),Ec(e,r))}function Xc(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.flags=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childLanes=this.lanes=0,this.alternate=null}function Jc(e,t,r,n){return new Xc(e,t,r,n)}function el(e){return!(!(e=e.prototype)||!e.isReactComponent)}function tl(e,t){var r=e.alternate;return null===r?((r=Jc(e.tag,t,e.key,e.mode)).elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.nextEffect=null,r.firstEffect=null,r.lastEffect=null),r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function rl(e,t,r,n,i,a){var s=2;if(n=e,"function"==typeof e)el(e)&&(s=1);else if("string"==typeof e)s=5;else e:switch(e){case A:return nl(r.children,i,a,t);case Z:s=8,i|=16;break;case N:s=8,i|=1;break;case F:return(e=Jc(12,r,t,8|i)).elementType=F,e.type=F,e.lanes=a,e;case U:return(e=Jc(13,r,t,i)).type=U,e.elementType=U,e.lanes=a,e;case V:return(e=Jc(19,r,t,i)).elementType=V,e.lanes=a,e;case K:return il(r,i,a,t);case Q:return(e=Jc(24,r,t,i)).elementType=Q,e.lanes=a,e;default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case B:s=10;break e;case z:s=9;break e;case $:s=11;break e;case H:s=14;break e;case W:s=16,n=null;break e;case q:s=22;break e}throw Error(y(130,null==e?e:typeof e,""))}return(t=Jc(s,r,t,i)).elementType=e,t.type=n,t.lanes=a,t}function nl(e,t,r,n){return(e=Jc(7,e,n,t)).lanes=r,e}function il(e,t,r,n){return(e=Jc(23,e,n,t)).elementType=K,e.lanes=r,e}function al(e,t,r){return(e=Jc(6,e,null,t)).lanes=r,e}function sl(e,t,r){return(t=Jc(4,null!==e.children?e.children:[],e.key,t)).lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function ol(e,t,r){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.pendingContext=this.context=null,this.hydrate=r,this.callbackNode=null,this.callbackPriority=0,this.eventTimes=er(0),this.expirationTimes=er(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=er(0),this.mutableSourceEagerHydrationData=null}function cl(e,t,r){var n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:L,key:null==n?null:""+n,children:e,containerInfo:t,implementation:r}}function ll(e,t,r,n){var i=t.current,a=_c(),s=xc(i);e:if(r){t:{if(ct(r=r._reactInternals)!==r||1!==r.tag)throw Error(y(170));var o=r;do{switch(o.tag){case 3:o=o.stateNode.context;break t;case 1:if(Ri(o.type)){o=o.stateNode.__reactInternalMemoizedMergedChildContext;break t}}o=o.return}while(null!==o);throw Error(y(171))}if(1===r.tag){var c=r.type;if(Ri(c)){r=Ti(r,c,o);break e}}r=o}else r=_i;return null===t.context?t.context=r:t.pendingContext=r,(t=wa(a,s)).payload={element:e},null!==(n=void 0===n?null:n)&&(t.callback=n),ba(i,t),Sc(i,s,a),s}function dl(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function ul(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var r=e.retryLane;e.retryLane=0!==r&&r<t?r:t}}function pl(e,t){ul(e,t),(e=e.alternate)&&ul(e,t)}function fl(e,t,r){var n=null!=r&&null!=r.hydrationOptions&&r.hydrationOptions.mutableSources||null;if(r=new ol(e,t,null!=r&&!0===r.hydrate),t=Jc(3,null,null,2===t?7:1===t?3:0),r.current=t,t.stateNode=r,va(t),e[li]=r.current,$n(8===e.nodeType?e.parentNode:e),n)for(e=0;e<n.length;e++){var i=(t=n[e])._getVersion;i=i(t._source),null==r.mutableSourceEagerHydrationData?r.mutableSourceEagerHydrationData=[t,i]:r.mutableSourceEagerHydrationData.push(t,i)}this._internalRoot=r}function hl(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function ml(e,t,r,n,i){var a=r._reactRootContainer;if(a){var s=a._internalRoot;if("function"==typeof i){var o=i;i=function(){var e=dl(s);o.call(e)}}ll(t,s,e,i)}else{if(a=r._reactRootContainer=function(e,t){if(t||(t=!(!(t=e?9===e.nodeType?e.documentElement:e.firstChild:null)||1!==t.nodeType||!t.hasAttribute("data-reactroot"))),!t)for(var r;r=e.lastChild;)e.removeChild(r);return new fl(e,0,t?{hydrate:!0}:void 0)}(r,n),s=a._internalRoot,"function"==typeof i){var c=i;i=function(){var e=dl(s);c.call(e)}}jc((function(){ll(t,s,e,i)}))}return dl(s)}function gl(e,t){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!hl(t))throw Error(y(200));return cl(e,t,null,r)}nc=function(e,t,r){var n=t.lanes;if(null!==e)if(e.memoizedProps!==t.pendingProps||Si.current)Ws=!0;else{if(0==(r&n)){switch(Ws=!1,t.tag){case 3:to(t),rs();break;case 5:Ha(t);break;case 1:Ri(t.type)&&ji(t);break;case 4:Ua(t,t.stateNode.containerInfo);break;case 10:n=t.memoizedProps.value;var i=t.type._context;bi(oa,i._currentValue),i._currentValue=n;break;case 13:if(null!==t.memoizedState)return 0!=(r&t.child.childLanes)?so(e,t,r):(bi(qa,1&qa.current),null!==(t=ho(e,t,r))?t.sibling:null);bi(qa,1&qa.current);break;case 19:if(n=0!=(r&t.childLanes),0!=(64&e.flags)){if(n)return fo(e,t,r);t.flags|=64}if(null!==(i=t.memoizedState)&&(i.rendering=null,i.tail=null,i.lastEffect=null),bi(qa,qa.current),n)break;return null;case 23:case 24:return t.lanes=0,Qs(e,t,r)}return ho(e,t,r)}Ws=0!=(16384&e.flags)}else Ws=!1;switch(t.lanes=0,t.tag){case 2:if(n=t.type,null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,i=Ei(t,xi.current),ha(t,r),i=ms(null,t,n,e,i,r),t.flags|=1,"object"==typeof i&&null!==i&&"function"==typeof i.render&&void 0===i.$$typeof){if(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ri(n)){var a=!0;ji(t)}else a=!1;t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null,va(t);var s=n.getDerivedStateFromProps;"function"==typeof s&&Ea(t,n,s,e),i.updater=Ra,t.stateNode=i,i._reactInternals=t,ja(t,n,e,r),t=eo(null,t,n,!0,a,r)}else t.tag=0,qs(null,t,i,r),t=t.child;return t;case 16:i=t.elementType;e:{switch(null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,i=(a=i._init)(i._payload),t.type=i,a=t.tag=function(e){if("function"==typeof e)return el(e)?1:0;if(null!=e){if((e=e.$$typeof)===$)return 11;if(e===H)return 14}return 2}(i),e=sa(i,e),a){case 0:t=Xs(null,t,i,e,r);break e;case 1:t=Js(null,t,i,e,r);break e;case 11:t=Gs(null,t,i,e,r);break e;case 14:t=Zs(null,t,i,sa(i.type,e),n,r);break e}throw Error(y(306,i,""))}return t;case 0:return n=t.type,i=t.pendingProps,Xs(e,t,n,i=t.elementType===n?i:sa(n,i),r);case 1:return n=t.type,i=t.pendingProps,Js(e,t,n,i=t.elementType===n?i:sa(n,i),r);case 3:if(to(t),n=t.updateQueue,null===e||null===n)throw Error(y(282));if(n=t.pendingProps,i=null!==(i=t.memoizedState)?i.element:null,ya(e,t),xa(t,n,null,r),(n=t.memoizedState.element)===i)rs(),t=ho(e,t,r);else{if((a=(i=t.stateNode).hydrate)&&(Ka=ni(t.stateNode.containerInfo.firstChild),Za=t,a=Qa=!0),a){if(null!=(e=i.mutableSourceEagerHydrationData))for(i=0;i<e.length;i+=2)(a=e[i])._workInProgressVersionPrimary=e[i+1],ns.push(a);for(r=Aa(t,null,n,r),t.child=r;r;)r.flags=-3&r.flags|1024,r=r.sibling}else qs(e,t,n,r),rs();t=t.child}return t;case 5:return Ha(t),null===e&&Ja(t),n=t.type,i=t.pendingProps,a=null!==e?e.memoizedProps:null,s=i.children,Jn(n,i)?s=null:null!==a&&Jn(n,a)&&(t.flags|=16),Ys(e,t),qs(e,t,s,r),t.child;case 6:return null===e&&Ja(t),null;case 13:return so(e,t,r);case 4:return Ua(t,t.stateNode.containerInfo),n=t.pendingProps,null===e?t.child=La(t,null,n,r):qs(e,t,n,r),t.child;case 11:return n=t.type,i=t.pendingProps,Gs(e,t,n,i=t.elementType===n?i:sa(n,i),r);case 7:return qs(e,t,t.pendingProps,r),t.child;case 8:case 12:return qs(e,t,t.pendingProps.children,r),t.child;case 10:e:{n=t.type._context,i=t.pendingProps,s=t.memoizedProps,a=i.value;var o=t.type._context;if(bi(oa,o._currentValue),o._currentValue=a,null!==s)if(o=s.value,0===(a=wn(o,a)?0:0|("function"==typeof n._calculateChangedBits?n._calculateChangedBits(o,a):1073741823))){if(s.children===i.children&&!Si.current){t=ho(e,t,r);break e}}else for(null!==(o=t.child)&&(o.return=t);null!==o;){var c=o.dependencies;if(null!==c){s=o.child;for(var l=c.firstContext;null!==l;){if(l.context===n&&0!=(l.observedBits&a)){1===o.tag&&((l=wa(-1,r&-r)).tag=2,ba(o,l)),o.lanes|=r,null!==(l=o.alternate)&&(l.lanes|=r),fa(o.return,r),c.lanes|=r;break}l=l.next}}else s=10===o.tag&&o.type===t.type?null:o.child;if(null!==s)s.return=o;else for(s=o;null!==s;){if(s===t){s=null;break}if(null!==(o=s.sibling)){o.return=s.return,s=o;break}s=s.return}o=s}qs(e,t,i.children,r),t=t.child}return t;case 9:return i=t.type,n=(a=t.pendingProps).children,ha(t,r),n=n(i=ma(i,a.unstable_observedBits)),t.flags|=1,qs(e,t,n,r),t.child;case 14:return a=sa(i=t.type,t.pendingProps),Zs(e,t,i,a=sa(i.type,a),n,r);case 15:return Ks(e,t,t.type,t.pendingProps,n,r);case 17:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:sa(n,i),null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),t.tag=1,Ri(n)?(e=!0,ji(t)):e=!1,ha(t,r),Pa(t,n,i),ja(t,n,i,r),eo(null,t,n,!0,e,r);case 19:return fo(e,t,r);case 23:case 24:return Qs(e,t,r)}throw Error(y(156,t.tag))},fl.prototype.render=function(e){ll(e,this._internalRoot,null,null)},fl.prototype.unmount=function(){var e=this._internalRoot,t=e.containerInfo;ll(null,e,null,(function(){t[li]=null}))},ft=function(e){13===e.tag&&(Sc(e,4,_c()),pl(e,4))},ht=function(e){13===e.tag&&(Sc(e,67108864,_c()),pl(e,67108864))},mt=function(e){if(13===e.tag){var t=_c(),r=xc(e);Sc(e,r,t),pl(e,r)}},gt=function(e,t){return t()},Be=function(e,t,r){switch(t){case"input":if(he(e,r),t=r.name,"radio"===r.type&&null!=t){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var n=r[t];if(n!==e&&n.form===e.form){var i=hi(n);if(!i)throw Error(y(90));le(n),he(n,i)}}}break;case"textarea":_e(e,r);break;case"select":null!=(t=r.value)&&ye(e,!!r.multiple,t,!1)}},We=Tc,qe=function(e,t,r,n,i){var a=$o;$o|=4;try{return ta(98,e.bind(null,t,r,n,i))}finally{0===($o=a)&&(rc(),na())}},Ge=function(){0==(49&$o)&&(function(){if(null!==fc){var e=fc;fc=null,e.forEach((function(e){e.expiredLanes|=24&e.pendingLanes,Ec(e,Xi())}))}na()}(),Hc())},Ze=function(e,t){var r=$o;$o|=2;try{return e(t)}finally{0===($o=r)&&(rc(),na())}};var vl={Events:[pi,fi,hi,Ve,He,Hc,{current:!1}]},yl={findFiberByHostInstance:ui,bundleType:0,version:"17.0.2",rendererPackageName:"react-dom"},wl={bundleType:yl.bundleType,version:yl.version,rendererPackageName:yl.rendererPackageName,rendererConfig:yl.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:I.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=ut(e))?null:e.stateNode},findFiberByHostInstance:yl.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null};if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var bl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!bl.isDisabled&&bl.supportsFiber)try{Di=bl.inject(wl),Ii=bl}catch(Pe){}}n=vl,i=gl,s=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternals;if(void 0===t){if("function"==typeof e.render)throw Error(y(188));throw Error(y(268,Object.keys(e)))}return e=null===(e=ut(t))?null:e.stateNode},o=function(e,t){var r=$o;if(0!=(48&r))return e(t);$o|=1;try{if(e)return ta(99,e.bind(null,t))}finally{$o=r,na()}},c=function(e,t,r){if(!hl(t))throw Error(y(200));return ml(null,e,t,!0,r)},l=function(e,t,r){if(!hl(t))throw Error(y(200));return ml(null,e,t,!1,r)},d=function(e){if(!hl(e))throw Error(y(40));return!!e._reactRootContainer&&(jc((function(){ml(null,null,e,!1,(function(){e._reactRootContainer=null,e[li]=null}))})),!0)},u=Tc,p=function(e,t){return gl(e,t,2<arguments.length&&void 0!==arguments[2]?arguments[2]:null)},f=function(e,t,r,n){if(!hl(r))throw Error(y(200));if(null==e||void 0===e._reactInternals)throw Error(y(38));return ml(e,t,r,!1,n)},h="17.0.2"})),a.register("kMsGZ",(function(e,t){"use strict";e.exports=a("ibDWe")})),a.register("ibDWe",(function(t,r){var n,i,a,s,o,c,l,d,u,p,f,h,m,g,v,y,w,b,_,x,S,k,E;if(e(t.exports,"unstable_now",(()=>n),(e=>n=e)),e(t.exports,"unstable_shouldYield",(()=>i),(e=>i=e)),e(t.exports,"unstable_forceFrameRate",(()=>a),(e=>a=e)),e(t.exports,"unstable_IdlePriority",(()=>s),(e=>s=e)),e(t.exports,"unstable_ImmediatePriority",(()=>o),(e=>o=e)),e(t.exports,"unstable_LowPriority",(()=>c),(e=>c=e)),e(t.exports,"unstable_NormalPriority",(()=>l),(e=>l=e)),e(t.exports,"unstable_Profiling",(()=>d),(e=>d=e)),e(t.exports,"unstable_UserBlockingPriority",(()=>u),(e=>u=e)),e(t.exports,"unstable_cancelCallback",(()=>p),(e=>p=e)),e(t.exports,"unstable_continueExecution",(()=>f),(e=>f=e)),e(t.exports,"unstable_getCurrentPriorityLevel",(()=>h),(e=>h=e)),e(t.exports,"unstable_getFirstCallbackNode",(()=>m),(e=>m=e)),e(t.exports,"unstable_next",(()=>g),(e=>g=e)),e(t.exports,"unstable_pauseExecution",(()=>v),(e=>v=e)),e(t.exports,"unstable_requestPaint",(()=>y),(e=>y=e)),e(t.exports,"unstable_runWithPriority",(()=>w),(e=>w=e)),e(t.exports,"unstable_scheduleCallback",(()=>b),(e=>b=e)),e(t.exports,"unstable_wrapCallback",(()=>_),(e=>_=e)),"object"==typeof performance&&"function"==typeof performance.now){var R=performance;n=function(){return R.now()}}else{var C=Date,P=C.now();n=function(){return C.now()-P}}if("undefined"==typeof window||"function"!=typeof MessageChannel){var T=null,j=null,M=function(){if(null!==T)try{var e=n();T(!0,e),T=null}catch(e){throw setTimeout(M,0),e}};x=function(e){null!==T?setTimeout(x,0,e):(T=e,setTimeout(M,0))},S=function(e,t){j=setTimeout(e,t)},k=function(){clearTimeout(j)},i=function(){return!1},E=a=function(){}}else{var D=window.setTimeout,I=window.clearTimeout;if("undefined"!=typeof console){var O=window.cancelAnimationFrame;"function"!=typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),"function"!=typeof O&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills")}var L=!1,A=null,N=-1,F=5,B=0;i=function(){return n()>=B},E=function(){},a=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<e?Math.floor(1e3/e):5};var z=new MessageChannel,$=z.port2;z.port1.onmessage=function(){if(null!==A){var e=n();B=e+F;try{A(!0,e)?$.postMessage(null):(L=!1,A=null)}catch(e){throw $.postMessage(null),e}}else L=!1},x=function(e){A=e,L||(L=!0,$.postMessage(null))},S=function(e,t){N=D((function(){e(n())}),t)},k=function(){I(N),N=-1}}function U(e,t){var r=e.length;e.push(t);e:for(;;){var n=r-1>>>1,i=e[n];if(!(void 0!==i&&0<W(i,t)))break e;e[n]=t,e[r]=i,r=n}}function V(e){return void 0===(e=e[0])?null:e}function H(e){var t=e[0];if(void 0!==t){var r=e.pop();if(r!==t){e[0]=r;e:for(var n=0,i=e.length;n<i;){var a=2*(n+1)-1,s=e[a],o=a+1,c=e[o];if(void 0!==s&&0>W(s,r))void 0!==c&&0>W(c,s)?(e[n]=c,e[o]=r,n=o):(e[n]=s,e[a]=r,n=a);else{if(!(void 0!==c&&0>W(c,r)))break e;e[n]=c,e[o]=r,n=o}}}return t}return null}function W(e,t){var r=e.sortIndex-t.sortIndex;return 0!==r?r:e.id-t.id}var q=[],G=[],Z=1,K=null,Q=3,Y=!1,X=!1,J=!1;function ee(e){for(var t=V(G);null!==t;){if(null===t.callback)H(G);else{if(!(t.startTime<=e))break;H(G),t.sortIndex=t.expirationTime,U(q,t)}t=V(G)}}function te(e){if(J=!1,ee(e),!X)if(null!==V(q))X=!0,x(re);else{var t=V(G);null!==t&&S(te,t.startTime-e)}}function re(e,t){X=!1,J&&(J=!1,k()),Y=!0;var r=Q;try{for(ee(t),K=V(q);null!==K&&(!(K.expirationTime>t)||e&&!i());){var a=K.callback;if("function"==typeof a){K.callback=null,Q=K.priorityLevel;var s=a(K.expirationTime<=t);t=n(),"function"==typeof s?K.callback=s:K===V(q)&&H(q),ee(t)}else H(q);K=V(q)}if(null!==K)var o=!0;else{var c=V(G);null!==c&&S(te,c.startTime-t),o=!1}return o}finally{K=null,Q=r,Y=!1}}s=5,o=1,c=4,l=3,d=null,u=2,p=function(e){e.callback=null},f=function(){X||Y||(X=!0,x(re))},h=function(){return Q},m=function(){return V(q)},g=function(e){switch(Q){case 1:case 2:case 3:var t=3;break;default:t=Q}var r=Q;Q=t;try{return e()}finally{Q=r}},v=function(){},y=E,w=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var r=Q;Q=e;try{return t()}finally{Q=r}},b=function(e,t,r){var i=n();switch("object"==typeof r&&null!==r?r="number"==typeof(r=r.delay)&&0<r?i+r:i:r=i,e){case 1:var a=-1;break;case 2:a=250;break;case 5:a=1073741823;break;case 4:a=1e4;break;default:a=5e3}return e={id:Z++,callback:t,priorityLevel:e,startTime:r,expirationTime:a=r+a,sortIndex:-1},r>i?(e.sortIndex=r,U(G,e),null===V(q)&&e===V(G)&&(J?k():J=!0,S(te,r-i))):(e.sortIndex=a,U(q,e),X||Y||(X=!0,x(re))),e},_=function(e){var t=Q;return function(){var r=Q;Q=t;try{return e.apply(this,arguments)}finally{Q=r}}}})),a.register("jkhJk",(function(t,r){var n,i,a,s,o,c,l,d,u,p,f,h,m,g,v,y,w,b,_,x,S,k,E,R,C,P;e(t.exports,"ContextConsumer",(()=>n),(e=>n=e)),e(t.exports,"ContextProvider",(()=>i),(e=>i=e)),e(t.exports,"Element",(()=>a),(e=>a=e)),e(t.exports,"ForwardRef",(()=>s),(e=>s=e)),e(t.exports,"Fragment",(()=>o),(e=>o=e)),e(t.exports,"Lazy",(()=>c),(e=>c=e)),e(t.exports,"Memo",(()=>l),(e=>l=e)),e(t.exports,"Portal",(()=>d),(e=>d=e)),e(t.exports,"Profiler",(()=>u),(e=>u=e)),e(t.exports,"StrictMode",(()=>p),(e=>p=e)),e(t.exports,"Suspense",(()=>f),(e=>f=e)),e(t.exports,"isAsyncMode",(()=>h),(e=>h=e)),e(t.exports,"isConcurrentMode",(()=>m),(e=>m=e)),e(t.exports,"isContextConsumer",(()=>g),(e=>g=e)),e(t.exports,"isContextProvider",(()=>v),(e=>v=e)),e(t.exports,"isElement",(()=>y),(e=>y=e)),e(t.exports,"isForwardRef",(()=>w),(e=>w=e)),e(t.exports,"isFragment",(()=>b),(e=>b=e)),e(t.exports,"isLazy",(()=>_),(e=>_=e)),e(t.exports,"isMemo",(()=>x),(e=>x=e)),e(t.exports,"isPortal",(()=>S),(e=>S=e)),e(t.exports,"isProfiler",(()=>k),(e=>k=e)),e(t.exports,"isStrictMode",(()=>E),(e=>E=e)),e(t.exports,"isSuspense",(()=>R),(e=>R=e)),e(t.exports,"isValidElementType",(()=>C),(e=>C=e)),e(t.exports,"typeOf",(()=>P),(e=>P=e));var T=60103,j=60106,M=60107,D=60108,I=60114,O=60109,L=60110,A=60112,N=60113,F=60120,B=60115,z=60116,$=60121,U=60122,V=60117,H=60129,W=60131;if("function"==typeof Symbol&&Symbol.for){var q=Symbol.for;T=q("react.element"),j=q("react.portal"),M=q("react.fragment"),D=q("react.strict_mode"),I=q("react.profiler"),O=q("react.provider"),L=q("react.context"),A=q("react.forward_ref"),N=q("react.suspense"),F=q("react.suspense_list"),B=q("react.memo"),z=q("react.lazy"),$=q("react.block"),U=q("react.server.block"),V=q("react.fundamental"),H=q("react.debug_trace_mode"),W=q("react.legacy_hidden")}function G(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case T:switch(e=e.type){case M:case I:case D:case N:case F:return e;default:switch(e=e&&e.$$typeof){case L:case A:case z:case B:case O:return e;default:return t}}case j:return t}}}n=L,i=O,a=T,s=A,o=M,c=z,l=B,d=j,u=I,p=D,f=N,h=function(){return!1},m=function(){return!1},g=function(e){return G(e)===L},v=function(e){return G(e)===O},y=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===T},w=function(e){return G(e)===A},b=function(e){return G(e)===M},_=function(e){return G(e)===z},x=function(e){return G(e)===B},S=function(e){return G(e)===j},k=function(e){return G(e)===I},E=function(e){return G(e)===D},R=function(e){return G(e)===N},C=function(e){return"string"==typeof e||"function"==typeof e||e===M||e===I||e===H||e===D||e===N||e===F||e===W||"object"==typeof e&&null!==e&&(e.$$typeof===z||e.$$typeof===B||e.$$typeof===O||e.$$typeof===L||e.$$typeof===A||e.$$typeof===V||e.$$typeof===$||e[0]===U)},P=G})),a.register("9Qh3N",(function(t,r){var n,i,a,s,o,c,l,d,u,p,f,h,m,g,v,y,w,b,_,x,S,k,E,R,C,P,T,j;e(t.exports,"AsyncMode",(()=>n),(e=>n=e)),e(t.exports,"ConcurrentMode",(()=>i),(e=>i=e)),e(t.exports,"ContextConsumer",(()=>a),(e=>a=e)),e(t.exports,"ContextProvider",(()=>s),(e=>s=e)),e(t.exports,"Element",(()=>o),(e=>o=e)),e(t.exports,"ForwardRef",(()=>c),(e=>c=e)),e(t.exports,"Fragment",(()=>l),(e=>l=e)),e(t.exports,"Lazy",(()=>d),(e=>d=e)),e(t.exports,"Memo",(()=>u),(e=>u=e)),e(t.exports,"Portal",(()=>p),(e=>p=e)),e(t.exports,"Profiler",(()=>f),(e=>f=e)),e(t.exports,"StrictMode",(()=>h),(e=>h=e)),e(t.exports,"Suspense",(()=>m),(e=>m=e)),e(t.exports,"isAsyncMode",(()=>g),(e=>g=e)),e(t.exports,"isConcurrentMode",(()=>v),(e=>v=e)),e(t.exports,"isContextConsumer",(()=>y),(e=>y=e)),e(t.exports,"isContextProvider",(()=>w),(e=>w=e)),e(t.exports,"isElement",(()=>b),(e=>b=e)),e(t.exports,"isForwardRef",(()=>_),(e=>_=e)),e(t.exports,"isFragment",(()=>x),(e=>x=e)),e(t.exports,"isLazy",(()=>S),(e=>S=e)),e(t.exports,"isMemo",(()=>k),(e=>k=e)),e(t.exports,"isPortal",(()=>E),(e=>E=e)),e(t.exports,"isProfiler",(()=>R),(e=>R=e)),e(t.exports,"isStrictMode",(()=>C),(e=>C=e)),e(t.exports,"isSuspense",(()=>P),(e=>P=e)),e(t.exports,"isValidElementType",(()=>T),(e=>T=e)),e(t.exports,"typeOf",(()=>j),(e=>j=e));var M="function"==typeof Symbol&&Symbol.for,D=M?Symbol.for("react.element"):60103,I=M?Symbol.for("react.portal"):60106,O=M?Symbol.for("react.fragment"):60107,L=M?Symbol.for("react.strict_mode"):60108,A=M?Symbol.for("react.profiler"):60114,N=M?Symbol.for("react.provider"):60109,F=M?Symbol.for("react.context"):60110,B=M?Symbol.for("react.async_mode"):60111,z=M?Symbol.for("react.concurrent_mode"):60111,$=M?Symbol.for("react.forward_ref"):60112,U=M?Symbol.for("react.suspense"):60113,V=M?Symbol.for("react.suspense_list"):60120,H=M?Symbol.for("react.memo"):60115,W=M?Symbol.for("react.lazy"):60116,q=M?Symbol.for("react.block"):60121,G=M?Symbol.for("react.fundamental"):60117,Z=M?Symbol.for("react.responder"):60118,K=M?Symbol.for("react.scope"):60119;function Q(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case D:switch(e=e.type){case B:case z:case O:case A:case L:case U:return e;default:switch(e=e&&e.$$typeof){case F:case $:case W:case H:case N:return e;default:return t}}case I:return t}}}function Y(e){return Q(e)===z}n=B,i=z,a=F,s=N,o=D,c=$,l=O,d=W,u=H,p=I,f=A,h=L,m=U,g=function(e){return Y(e)||Q(e)===B},v=Y,y=function(e){return Q(e)===F},w=function(e){return Q(e)===N},b=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===D},_=function(e){return Q(e)===$},x=function(e){return Q(e)===O},S=function(e){return Q(e)===W},k=function(e){return Q(e)===H},E=function(e){return Q(e)===I},R=function(e){return Q(e)===A},C=function(e){return Q(e)===L},P=function(e){return Q(e)===U},T=function(e){return"string"==typeof e||"function"==typeof e||e===O||e===z||e===A||e===L||e===U||e===V||"object"==typeof e&&null!==e&&(e.$$typeof===W||e.$$typeof===H||e.$$typeof===N||e.$$typeof===F||e.$$typeof===$||e.$$typeof===G||e.$$typeof===Z||e.$$typeof===K||e.$$typeof===q)},j=Q})),a.register("hZG0u",(function(e,t){var r=a("ePtPP");e.exports.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)},e.exports.save=function(t){try{t?e.exports.storage.setItem("debug",t):e.exports.storage.removeItem("debug")}catch(e){}},e.exports.load=function(){let t;try{t=e.exports.storage.getItem("debug")}catch(e){}!t&&void 0!==r&&"env"in r&&(t=void 0);return t},e.exports.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("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&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},e.exports.storage=function(){try{return localStorage}catch(e){}}(),e.exports.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`."))}})(),e.exports.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"],e.exports.log=console.debug||console.log||(()=>{}),e.exports=a("7Mr7K")(e.exports);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}})),a.register("ePtPP",(function(e,t){var r,n,i=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function o(e){if(r===setTimeout)return setTimeout(e,0);if((r===a||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:a}catch(e){r=a}try{n="function"==typeof clearTimeout?clearTimeout:s}catch(e){n=s}}();var c,l=[],d=!1,u=-1;function p(){d&&c&&(d=!1,c.length?l=c.concat(l):u=-1,l.length&&f())}function f(){if(!d){var e=o(p);d=!0;for(var t=l.length;t;){for(c=l,l=[];++u<t;)c&&c[u].run();u=-1,t=l.length}c=null,d=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===s||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function m(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];l.push(new h(e,t)),1!==l.length||d||o(f)},h.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=m,i.addListener=m,i.once=m,i.off=m,i.removeListener=m,i.removeAllListeners=m,i.emit=m,i.prependListener=m,i.prependOnceListener=m,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}})),a.register("7Mr7K",(function(e,t){e.exports=function(e){function t(e){let n,i,a,s=null;function o(...e){if(!o.enabled)return;const r=o,i=Number(new Date),a=i-(n||i);r.diff=a,r.prev=n,r.curr=i,n=i,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((n,i)=>{if("%%"===n)return"%";s++;const a=t.formatters[i];if("function"==typeof a){const t=e[s];n=a.call(r,t),e.splice(s,1),s--}return n})),t.formatArgs.call(r,e);(r.log||t.log).apply(r,e)}return o.namespace=e,o.useColors=t.useColors(),o.color=t.selectColor(e),o.extend=r,o.destroy=t.destroy,Object.defineProperty(o,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(i!==t.namespaces&&(i=t.namespaces,a=t.enabled(e)),a),set:e=>{s=e}}),"function"==typeof t.init&&t.init(o),o}function r(e,r){const n=t(this.namespace+(void 0===r?":":r)+e);return n.log=this.log,n}function n(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(n),...t.skips.map(n).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<i;r++)n[r]&&("-"===(e=n[r].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let r,n;for(r=0,n=t.skips.length;r<n;r++)if(t.skips[r].test(e))return!1;for(r=0,n=t.names.length;r<n;r++)if(t.names[r].test(e))return!0;return!1},t.humanize=a("e5dom"),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((r=>{t[r]=e[r]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let r=0;for(let t=0;t<e.length;t++)r=(r<<5)-r+e.charCodeAt(t),r|=0;return t.colors[Math.abs(r)%t.colors.length]},t.enable(t.load()),t}})),a.register("e5dom",(function(e,t){var r=1e3,n=6e4,i=36e5,a=864e5,s=6048e5,o=315576e5;function c(e,t,r,n){var i=t>=1.5*r;return Math.round(e/r)+" "+n+(i?"s":"")}e.exports=function(e,t){t=t||{};var l,d,u=typeof e;if("string"===u&&e.length>0)return function(e){if((e=String(e)).length>100)return;var t=/^(-?(?:\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(!t)return;var c=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*o;case"weeks":case"week":case"w":return c*s;case"days":case"day":case"d":return c*a;case"hours":case"hour":case"hrs":case"hr":case"h":return c*i;case"minutes":case"minute":case"mins":case"min":case"m":return c*n;case"seconds":case"second":case"secs":case"sec":case"s":return c*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(e);if("number"===u&&isFinite(e))return t.long?(l=e,(d=Math.abs(l))>=a?c(l,d,a,"day"):d>=i?c(l,d,i,"hour"):d>=n?c(l,d,n,"minute"):d>=r?c(l,d,r,"second"):l+" ms"):function(e){var t=Math.abs(e);return t>=a?Math.round(e/a)+"d":t>=i?Math.round(e/i)+"h":t>=n?Math.round(e/n)+"m":t>=r?Math.round(e/r)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}})),a.register("jCEG4",(function(e,t){var r=function(){if("object"==typeof self&&self)return self;if("object"==typeof window&&window)return window;throw new Error("Unable to resolve global `this`")};e.exports=function(){if(this)return this;if("object"==typeof globalThis&&globalThis)return globalThis;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch(e){return r()}try{return __global__||r()}finally{delete Object.prototype.__global__}}()})),a.register("kUMHr",(function(e,t){e.exports=JSON.parse('{"name":"websocket","description":"Websocket Client & Server Library implementing the WebSocket protocol as specified in RFC 6455.","keywords":["websocket","websockets","socket","networking","comet","push","RFC-6455","realtime","server","client"],"author":"Brian McKelvey <theturtle32@gmail.com> (https://github.com/theturtle32)","contributors":["Iñaki Baz Castillo <ibc@aliax.net> (http://dev.sipdoc.net)"],"version":"1.0.34","repository":{"type":"git","url":"https://github.com/theturtle32/WebSocket-Node.git"},"homepage":"https://github.com/theturtle32/WebSocket-Node","engines":{"node":">=4.0.0"},"dependencies":{"bufferutil":"^4.0.1","debug":"^2.2.0","es5-ext":"^0.10.50","typedarray-to-buffer":"^3.1.5","utf-8-validate":"^5.0.2","yaeti":"^0.0.6"},"devDependencies":{"buffer-equal":"^1.0.0","gulp":"^4.0.2","gulp-jshint":"^2.0.4","jshint-stylish":"^2.2.1","jshint":"^2.0.0","tape":"^4.9.1"},"config":{"verbose":false},"scripts":{"test":"tape test/unit/*.js","gulp":"gulp"},"main":"index","directories":{"lib":"./lib"},"browser":"lib/browser.js","license":"Apache-2.0"}')})),a.register("jxXWz",(function(t,r){var n,i,s,o;e(t.exports,"operation",(()=>n),(e=>n=e)),e(t.exports,"timeouts",(()=>i),(e=>i=e)),e(t.exports,"createTimeout",(()=>s),(e=>s=e)),e(t.exports,"wrap",(()=>o),(e=>o=e));var c=a("ultWe");n=function(e){var t=i(e);return new c(t,{forever:e&&e.forever,unref:e&&e.unref,maxRetryTime:e&&e.maxRetryTime})},i=function(e){if(e instanceof Array)return[].concat(e);var t={retries:10,factor:2,minTimeout:1e3,maxTimeout:1/0,randomize:!1};for(var r in e)t[r]=e[r];if(t.minTimeout>t.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var n=[],i=0;i<t.retries;i++)n.push(this.createTimeout(i,t));return e&&e.forever&&!n.length&&n.push(this.createTimeout(i,t)),n.sort((function(e,t){return e-t})),n},s=function(e,t){var r=t.randomize?Math.random()+1:1,n=Math.round(r*t.minTimeout*Math.pow(t.factor,e));return n=Math.min(n,t.maxTimeout)},o=function(e,t,r){if(t instanceof Array&&(r=t,t=null),!r)for(var i in r=[],e)"function"==typeof e[i]&&r.push(i);for(var a=0;a<r.length;a++){var s=r[a],o=e[s];e[s]=function(r){var i=n(t),a=Array.prototype.slice.call(arguments,1),s=a.pop();a.push((function(e){i.retry(e)||(e&&(arguments[0]=i.mainError()),s.apply(this,arguments))})),i.attempt((function(){r.apply(e,a)}))}.bind(e,o),e[s].options=t}}})),a.register("ultWe",(function(e,t){function r(e,t){"boolean"==typeof t&&(t={forever:t}),this._originalTimeouts=JSON.parse(JSON.stringify(e)),this._timeouts=e,this._options=t||{},this._maxRetryTime=t&&t.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}e.exports=r,r.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts},r.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timeouts=[],this._cachedTimeouts=null},r.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var t=(new Date).getTime();if(e&&t-this._operationStart>=this._maxRetryTime)return this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(e);var r=this._timeouts.shift();if(void 0===r){if(!this._cachedTimeouts)return!1;this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),r=this._timeouts.shift()}var n=this,i=setTimeout((function(){n._attempts++,n._operationTimeoutCb&&(n._timeout=setTimeout((function(){n._operationTimeoutCb(n._attempts)}),n._operationTimeout),n._options.unref&&n._timeout.unref()),n._fn(n._attempts)}),r);return this._options.unref&&i.unref(),!0},r.prototype.attempt=function(e,t){this._fn=e,t&&(t.timeout&&(this._operationTimeout=t.timeout),t.cb&&(this._operationTimeoutCb=t.cb));var r=this;this._operationTimeoutCb&&(this._timeout=setTimeout((function(){r._operationTimeoutCb()}),r._operationTimeout)),this._operationStart=(new Date).getTime(),this._fn(this._attempts)},r.prototype.try=function(e){console.log("Using RetryOperation.try() is deprecated"),this.attempt(e)},r.prototype.start=function(e){console.log("Using RetryOperation.start() is deprecated"),this.attempt(e)},r.prototype.start=r.prototype.try,r.prototype.errors=function(){return this._errors},r.prototype.attempts=function(){return this._attempts},r.prototype.mainError=function(){if(0===this._errors.length)return null;for(var e={},t=null,r=0,n=0;n<this._errors.length;n++){var i=this._errors[n],a=i.message,s=(e[a]||0)+1;e[a]=s,s>=r&&(t=i,r=s)}return t}})),a.register("1ZHQC",(function(e,t){"use strict";var r=e.exports&&e.exports.__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]}),n=e.exports&&e.exports.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=e.exports&&e.exports.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&r(t,e,i);return n(t,e),t},s=e.exports&&e.exports.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.Device=e.exports.detectDevice=void 0;const o=s(a("4Fy4N"));var c=a("ejIpo"),l=a("3owO4"),d=a("9Limk");const u=i(a("73pkW")),p=i(a("bGAAX"));var f=a("3avKh"),h=a("lptJi"),m=a("aWt89"),g=a("5GHop"),v=a("2XozP"),y=a("h1HrI"),w=a("iMWnV"),b=a("aZkX5"),_=a("3Snak"),x=a("azCHp");const S=new c.Logger("Device");function k(){if("object"==typeof navigator&&"ReactNative"===navigator.product)return"undefined"==typeof RTCPeerConnection?void S.warn("this._detectDevice() | unsupported ReactNative without RTCPeerConnection"):(S.debug("this._detectDevice() | ReactNative handler chosen"),"ReactNative");if("object"!=typeof navigator||"string"!=typeof navigator.userAgent)S.warn("this._detectDevice() | unknown device");else{const e=navigator.userAgent,t=o.default.getParser(e),r=t.getEngine();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>=74?"Chrome74":e>=70?"Chrome70":e>=67?"Chrome67":"Chrome55"}return"Chrome74"}S.warn("this._detectDevice() | browser not supported [name:%s, version:%s]",t.getBrowserName(),t.getBrowserVersion())}}e.exports.detectDevice=k;e.exports.Device=class{constructor({handlerName:e,handlerFactory:t,Handler:r}={}){if(this._loaded=!1,this._observer=new l.EnhancedEventEmitter,S.debug("constructor()"),r){if(S.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)S.debug("constructor() | handler given: %s",e);else{if(!(e=k()))throw new d.UnsupportedError("device not supported");S.debug("constructor() | detected handler: %s",e)}switch(e){case"Chrome74":this._handlerFactory=h.Chrome74.createFactory();break;case"Chrome70":this._handlerFactory=m.Chrome70.createFactory();break;case"Chrome67":this._handlerFactory=g.Chrome67.createFactory();break;case"Chrome55":this._handlerFactory=v.Chrome55.createFactory();break;case"Firefox60":this._handlerFactory=y.Firefox60.createFactory();break;case"Safari12":this._handlerFactory=w.Safari12.createFactory();break;case"Safari11":this._handlerFactory=b.Safari11.createFactory();break;case"Edge11":this._handlerFactory=_.Edge11.createFactory();break;case"ReactNative":this._handlerFactory=x.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 d.InvalidStateError("not loaded");return this._recvRtpCapabilities}get sctpCapabilities(){if(!this._loaded)throw new d.InvalidStateError("not loaded");return this._sctpCapabilities}get observer(){return this._observer}async load({routerRtpCapabilities:e}){let t;S.debug("load() [routerRtpCapabilities:%o]",e),e=u.clone(e,void 0);try{if(this._loaded)throw new d.InvalidStateError("already loaded");p.validateRtpCapabilities(e),t=this._handlerFactory();const r=await t.getNativeRtpCapabilities();S.debug("load() | got native RTP capabilities:%o",r),p.validateRtpCapabilities(r),this._extendedRtpCapabilities=p.getExtendedRtpCapabilities(r,e),S.debug("load() | got extended RTP capabilities:%o",this._extendedRtpCapabilities),this._canProduceByKind.audio=p.canSend("audio",this._extendedRtpCapabilities),this._canProduceByKind.video=p.canSend("video",this._extendedRtpCapabilities),this._recvRtpCapabilities=p.getRecvRtpCapabilities(this._extendedRtpCapabilities),p.validateRtpCapabilities(this._recvRtpCapabilities),S.debug("load() | got receiving RTP capabilities:%o",this._recvRtpCapabilities),this._sctpCapabilities=await t.getNativeSctpCapabilities(),S.debug("load() | got native SCTP capabilities:%o",this._sctpCapabilities),p.validateSctpCapabilities(this._sctpCapabilities),S.debug("load() succeeded"),this._loaded=!0,t.close()}catch(e){throw t&&t.close(),e}}canProduce(e){if(!this._loaded)throw new d.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:a,iceTransportPolicy:s,additionalSettings:o,proprietaryConstraints:c,appData:l}){return S.debug("createSendTransport()"),this._createTransport({direction:"send",id:e,iceParameters:t,iceCandidates:r,dtlsParameters:n,sctpParameters:i,iceServers:a,iceTransportPolicy:s,additionalSettings:o,proprietaryConstraints:c,appData:l})}createRecvTransport({id:e,iceParameters:t,iceCandidates:r,dtlsParameters:n,sctpParameters:i,iceServers:a,iceTransportPolicy:s,additionalSettings:o,proprietaryConstraints:c,appData:l}){return S.debug("createRecvTransport()"),this._createTransport({direction:"recv",id:e,iceParameters:t,iceCandidates:r,dtlsParameters:n,sctpParameters:i,iceServers:a,iceTransportPolicy:s,additionalSettings:o,proprietaryConstraints:c,appData:l})}_createTransport({direction:e,id:t,iceParameters:r,iceCandidates:n,dtlsParameters:i,sctpParameters:a,iceServers:s,iceTransportPolicy:o,additionalSettings:c,proprietaryConstraints:l,appData:u}){if(!this._loaded)throw new d.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(a&&"object"!=typeof a)throw new TypeError("wrong sctpParameters");if(u&&"object"!=typeof u)throw new TypeError("if given, appData must be an object");const p=new f.Transport({direction:e,id:t,iceParameters:r,iceCandidates:n,dtlsParameters:i,sctpParameters:a,iceServers:s,iceTransportPolicy:o,additionalSettings:c,proprietaryConstraints:l,appData:u,handlerFactory:this._handlerFactory,extendedRtpCapabilities:this._extendedRtpCapabilities,canProduceByKind:this._canProduceByKind});return this._observer.safeEmit("newtransport",p),p}}})),a.register("4Fy4N",(function(e,t){e.exports,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),a=e.getVersionPrecision(r),s=Math.max(i,a),o=0,c=e.map([t,r],(function(t){var r=s-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&&(o=s-Math.min(i,a)),s-=1;s>=o;){if(c[0][s]>c[1][s])return 1;if(c[0][s]===c[1][s]){if(s===o)return 0;s-=1}else if(c[0][s]<c[1][s])return-1}},e.map=function(e,t){var r,n=[];if(Array.prototype.map)return Array.prototype.map.call(e,t);for(r=0;r<e.length;r+=1)n.push(t(e[r]));return n},e.find=function(e,t){var r,n;if(Array.prototype.find)return Array.prototype.find.call(e,t);for(r=0,n=e.length;r<n;r+=1){var i=e[r];if(t(i,r))return i}},e.assign=function(e){for(var t,r,n=e,i=arguments.length,a=new Array(i>1?i-1:0),s=1;s<i;s++)a[s-1]=arguments[s];if(Object.assign)return Object.assign.apply(Object,[e].concat(a));var o=function(){var e=a[t];"object"==typeof e&&null!==e&&Object.keys(e).forEach((function(t){n[t]=e[t]}))};for(t=0,r=a.length;t<r;t+=1)o();return e},e.getBrowserAlias=function(e){return n.BROWSER_ALIASES_MAP[e]},e.getBrowserTypeByAlias=function(e){return n.BROWSER_MAP[e]||""},e}();t.default=i,e.exports=t.default},18:function(e,t,r){"use strict";t.__esModule=!0,t.ENGINE_MAP=t.OS_MAP=t.PLATFORMS_MAP=t.BROWSER_MAP=t.BROWSER_ALIASES_MAP=void 0,t.BROWSER_ALIASES_MAP={"Amazon Silk":"amazon_silk","Android Browser":"android",Bada:"bada",BlackBerry:"blackberry",Chrome:"chrome",Chromium:"chromium",Electron:"electron",Epiphany:"epiphany",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot","Internet Explorer":"ie","K-Meleon":"k_meleon",Maxthon:"maxthon","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver",Opera:"opera","Opera Coast":"opera_coast",PhantomJS:"phantomjs",Puffin:"puffin",QupZilla:"qupzilla",QQ:"qq",QQLite:"qqlite",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat","Yandex Browser":"yandex",Roku:"roku"},t.BROWSER_MAP={amazon_silk:"Amazon Silk",android:"Android Browser",bada:"Bada",blackberry:"BlackBerry",chrome:"Chrome",chromium:"Chromium",electron:"Electron",epiphany:"Epiphany",firefox:"Firefox",focus:"Focus",generic:"Generic",googlebot:"Googlebot",google_search:"Google Search",ie:"Internet Explorer",k_meleon:"K-Meleon",maxthon:"Maxthon",edge:"Microsoft Edge",mz:"MZ Browser",naver:"NAVER Whale Browser",opera:"Opera",opera_coast:"Opera Coast",phantomjs:"PhantomJS",puffin:"Puffin",qupzilla:"QupZilla",qq:"QQ Browser",qqlite:"QQ Browser Lite",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yandex:"Yandex Browser"},t.PLATFORMS_MAP={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},t.OS_MAP={WindowsPhone:"Windows Phone",Windows:"Windows",MacOS:"macOS",iOS:"iOS",Android:"Android",WebOS:"WebOS",BlackBerry:"BlackBerry",Bada:"Bada",Tizen:"Tizen",Linux:"Linux",ChromeOS:"Chrome OS",PlayStation4:"PlayStation 4",Roku:"Roku"},t.ENGINE_MAP={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"}},90:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n,i=(n=r(91))&&n.__esModule?n:{default:n},a=r(18);function s(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var o=function(){function e(){}var t;return e.getParser=function(e,t){if(void 0===t&&(t=!1),"string"!=typeof e)throw new Error("UserAgent should be a string");return new i.default(e,t)},e.parse=function(e){return new i.default(e).getResult()},(t=[{key:"BROWSER_MAP",get:function(){return a.BROWSER_MAP}},{key:"ENGINE_MAP",get:function(){return a.ENGINE_MAP}},{key:"OS_MAP",get:function(){return a.OS_MAP}},{key:"PLATFORMS_MAP",get:function(){return a.PLATFORMS_MAP}}])&&s(e,t),e}();t.default=o,e.exports=t.default},91:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n=c(r(92)),i=c(r(93)),a=c(r(94)),s=c(r(95)),o=c(r(17));function c(e){return e&&e.__esModule?e:{default:e}}var l=function(){function e(e,t){if(void 0===t&&(t=!1),null==e||""===e)throw new Error("UserAgent parameter can't be empty");this._ua=e,this.parsedResult={},!0!==t&&this.parse()}var t=e.prototype;return t.getUA=function(){return this._ua},t.test=function(e){return e.test(this._ua)},t.parseBrowser=function(){var e=this;this.parsedResult.browser={};var t=o.default.find(n.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.browser=t.describe(this.getUA())),this.parsedResult.browser},t.getBrowser=function(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()},t.getBrowserName=function(e){return e?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""},t.getBrowserVersion=function(){return this.getBrowser().version},t.getOS=function(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()},t.parseOS=function(){var e=this;this.parsedResult.os={};var t=o.default.find(i.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.os=t.describe(this.getUA())),this.parsedResult.os},t.getOSName=function(e){var t=this.getOS().name;return e?String(t).toLowerCase()||"":t||""},t.getOSVersion=function(){return this.getOS().version},t.getPlatform=function(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()},t.getPlatformType=function(e){void 0===e&&(e=!1);var t=this.getPlatform().type;return e?String(t).toLowerCase()||"":t||""},t.parsePlatform=function(){var e=this;this.parsedResult.platform={};var t=o.default.find(a.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.platform=t.describe(this.getUA())),this.parsedResult.platform},t.getEngine=function(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()},t.getEngineName=function(e){return e?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""},t.parseEngine=function(){var e=this;this.parsedResult.engine={};var t=o.default.find(s.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.engine=t.describe(this.getUA())),this.parsedResult.engine},t.parse=function(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this},t.getResult=function(){return o.default.assign({},this.parsedResult)},t.satisfies=function(e){var t=this,r={},n=0,i={},a=0;if(Object.keys(e).forEach((function(t){var s=e[t];"string"==typeof s?(i[t]=s,a+=1):"object"==typeof s&&(r[t]=s,n+=1)})),n>0){var s=Object.keys(r),c=o.default.find(s,(function(e){return t.isOS(e)}));if(c){var l=this.satisfies(r[c]);if(void 0!==l)return l}var d=o.default.find(s,(function(e){return t.isPlatform(e)}));if(d){var u=this.satisfies(r[d]);if(void 0!==u)return u}}if(a>0){var p=Object.keys(i),f=o.default.find(p,(function(e){return t.isBrowser(e,!0)}));if(void 0!==f)return this.compareVersion(i[f])}},t.isBrowser=function(e,t){void 0===t&&(t=!1);var r=this.getBrowserName().toLowerCase(),n=e.toLowerCase(),i=o.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(o.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=l,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},a=/version\/(\d+(\.?_?\d+)+)/i,s=[{test:[/googlebot/i],describe:function(e){var t={name:"Googlebot"},r=i.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||i.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/opera/i],describe:function(e){var t={name:"Opera"},r=i.default.getFirstMatch(a,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(a,e);return r&&(t.version=r),t}},{test:[/SamsungBrowser/i],describe:function(e){var t={name:"Samsung Internet for Android"},r=i.default.getFirstMatch(a,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(a,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(a,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(a,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(a,e);return r&&(t.version=r),t}},{test:[/coast/i],describe:function(e){var t={name:"Opera Coast"},r=i.default.getFirstMatch(a,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(a,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(a,e);return r&&(t.version=r),t}},{test:[/ucbrowser/i],describe:function(e){var t={name:"UC Browser"},r=i.default.getFirstMatch(a,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(a,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(a,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(a,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(a,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(a,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(a,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(a,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(a,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(a,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(a,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(a,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(a,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(a,e);return r&&(t.version=r),t}},{test:[/playstation 4/i],describe:function(e){var t={name:"PlayStation 4"},r=i.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/safari|applewebkit/i],describe:function(e){var t={name:"Safari"},r=i.default.getFirstMatch(a,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=s,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},a=r(18),s=[{test:[/Roku\/DVP/],describe:function(e){var t=i.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:a.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:a.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:a.OS_MAP.Windows,version:t,versionName:r}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(e){var t={name:a.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:a.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:a.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:a.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:a.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:a.OS_MAP.BlackBerry,version:t}}},{test:[/bada/i],describe:function(e){var t=i.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:a.OS_MAP.Bada,version:t}}},{test:[/tizen/i],describe:function(e){var t=i.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:a.OS_MAP.Tizen,version:t}}},{test:[/linux/i],describe:function(){return{name:a.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:a.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(e){var t=i.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:a.OS_MAP.PlayStation4,version:t}}}];t.default=s,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},a=r(18),s=[{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:a.PLATFORMS_MAP.mobile,vendor:"Huawei"};return t&&(r.model=t),r}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:a.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:a.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return{type:a.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:a.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:a.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:a.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:a.PLATFORMS_MAP.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:a.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe:function(){return{type:a.PLATFORMS_MAP.mobile}}},{test:function(e){return"blackberry"===e.getBrowserName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(e){return"bada"===e.getBrowserName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.mobile}}},{test:function(e){return"windows phone"===e.getBrowserName()},describe:function(){return{type:a.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:a.PLATFORMS_MAP.tablet}}},{test:function(e){return"android"===e.getOSName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.mobile}}},{test:function(e){return"macos"===e.getOSName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(e){return"windows"===e.getOSName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.desktop}}},{test:function(e){return"linux"===e.getOSName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.desktop}}},{test:function(e){return"playstation 4"===e.getOSName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.tv}}},{test:function(e){return"roku"===e.getOSName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.tv}}}];t.default=s,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},a=r(18),s=[{test:function(e){return"microsoft edge"===e.getBrowserName(!0)},describe:function(e){if(/\sedg\//i.test(e))return{name:a.ENGINE_MAP.Blink};var t=i.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:a.ENGINE_MAP.EdgeHTML,version:t}}},{test:[/trident/i],describe:function(e){var t={name:a.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:a.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:a.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:a.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(e){var t={name:a.ENGINE_MAP.WebKit},r=i.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}}];t.default=s,e.exports=t.default}})})),a.register("ejIpo",(function(e,t){"use strict";var r=e.exports&&e.exports.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.Logger=void 0;const n=r(a("hZG0u")),i="mediasoup-client";e.exports.Logger=class{constructor(e){e?(this._debug=(0,n.default)(`mediasoup-client:${e}`),this._warn=(0,n.default)(`mediasoup-client:WARN:${e}`),this._error=(0,n.default)(`mediasoup-client:ERROR:${e}`)):(this._debug=(0,n.default)(i),this._warn=(0,n.default)("mediasoup-client:WARN"),this._error=(0,n.default)("mediasoup-client: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}}})),a.register("3owO4",(function(e,t){"use strict";Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.EnhancedEventEmitter=void 0;var r=a("3oV8N");const n=new(a("ejIpo").Logger)("EnhancedEventEmitter");class i extends r.EventEmitter{constructor(){super(),this.setMaxListeners(1/0)}safeEmit(e,...t){const r=this.listenerCount(e);try{return this.emit(e,...t)}catch(t){return n.error("safeEmit() | event listener threw an error [event:%s]:%o",e,t),Boolean(r)}}async safeEmitAsPromise(e,...t){return new Promise(((r,i)=>{try{this.emit(e,...t,r,i)}catch(t){n.error("safeEmitAsPromise() | event listener threw an error [event:%s]:%o",e,t),i(t)}}))}}e.exports.EnhancedEventEmitter=i})),a.register("3oV8N",(function(e,t){"use strict";var r,n="object"==typeof Reflect?Reflect:null,i=n&&"function"==typeof n.apply?n.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};r=n&&"function"==typeof n.ownKeys?n.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,a),n(r)}function a(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}g(e,t,a,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&g(e,"error",t,r)}(e,i,{once:!0})}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var o=10;function c(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?s.defaultMaxListeners:e._maxListeners}function d(e,t,r,n){var i,a,s,o;if(c(r),void 0===(a=e._events)?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),a=e._events),s=a[t]),void 0===s)s=a[t]=r,++e._eventsCount;else if("function"==typeof s?s=a[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=l(e))>0&&s.length>i&&!s.warned){s.warned=!0;var d=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");d.name="MaxListenersExceededWarning",d.emitter=e,d.type=t,d.count=s.length,o=d,console&&console.warn&&console.warn(o)}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 p(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 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;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):m(i,i.length)}function h(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function m(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function g(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(a){n.once&&e.removeEventListener(t,i),r(a)}))}}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(e){if("number"!=typeof e||e<0||a(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");o=e}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||a(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},s.prototype.getMaxListeners=function(){return l(this)},s.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var n="error"===e,a=this._events;if(void 0!==a)n=n&&void 0===a.error;else if(!n)return!1;if(n){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var o=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw o.context=s,o}var c=a[e];if(void 0===c)return!1;if("function"==typeof c)i(c,this,t);else{var l=c.length,d=m(c,l);for(r=0;r<l;++r)i(d[r],this,t)}return!0},s.prototype.addListener=function(e,t){return d(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return d(this,e,t,!0)},s.prototype.once=function(e,t){return c(t),this.on(e,p(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return c(t),this.prependListener(e,p(this,e,t)),this},s.prototype.removeListener=function(e,t){var r,n,i,a,s;if(c(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,a=r.length-1;a>=0;a--)if(r[a]===t||r[a].listener===t){s=r[a].listener,i=a;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,s||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var i,a=Object.keys(r);for(n=0;n<a.length;++n)"removeListener"!==(i=a[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=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):h.call(e,t)},s.prototype.listenerCount=h,s.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}})),a.register("9Limk",(function(e,t){"use strict";Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.InvalidStateError=e.exports.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}}e.exports.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}}e.exports.InvalidStateError=n})),a.register("73pkW",(function(e,t){"use strict";Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.generateRandomNumber=e.exports.clone=void 0,e.exports.clone=function(e,t){return void 0===e?t:JSON.parse(JSON.stringify(e))},e.exports.generateRandomNumber=function(){return Math.round(1e7*Math.random())}})),a.register("bGAAX",(function(e,t){"use strict";var r=e.exports&&e.exports.__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]}),n=e.exports&&e.exports.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=e.exports&&e.exports.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&r(t,e,i);return n(t,e),t};Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.canReceive=e.exports.canSend=e.exports.generateProbatorRtpParameters=e.exports.reduceCodecs=e.exports.getSendingRemoteRtpParameters=e.exports.getSendingRtpParameters=e.exports.getRecvRtpCapabilities=e.exports.getExtendedRtpCapabilities=e.exports.validateSctpStreamParameters=e.exports.validateSctpParameters=e.exports.validateNumSctpStreams=e.exports.validateSctpCapabilities=e.exports.validateRtcpParameters=e.exports.validateRtpEncodingParameters=e.exports.validateRtpHeaderExtensionParameters=e.exports.validateRtpCodecParameters=e.exports.validateRtpParameters=e.exports.validateRtpHeaderExtension=e.exports.validateRtcpFeedback=e.exports.validateRtpCodecCapability=e.exports.validateRtpCapabilities=void 0;const s=i(a("cvKIE")),o=i(a("73pkW"));function c(e){const t=new RegExp("^(audio|video)/(.+)","i");if("object"!=typeof e)throw new TypeError("codec is not an object");if(!e.mimeType||"string"!=typeof e.mimeType)throw new TypeError("missing codec.mimeType");const r=t.exec(e.mimeType);if(!r)throw new TypeError("invalid codec.mimeType");if(e.kind=r[1].toLowerCase(),e.preferredPayloadType&&"number"!=typeof e.preferredPayloadType)throw new TypeError("invalid codec.preferredPayloadType");if("number"!=typeof e.clockRate)throw new TypeError("missing codec.clockRate");"audio"===e.kind?"number"!=typeof e.channels&&(e.channels=1):delete e.channels,e.parameters&&"object"==typeof e.parameters||(e.parameters={});for(const t of Object.keys(e.parameters)){let r=e.parameters[t];if(void 0===r&&(e.parameters[t]="",r=""),"string"!=typeof r&&"number"!=typeof r)throw new TypeError(`invalid codec parameter [key:${t}s, value:${r}]`);if("apt"===t&&"number"!=typeof r)throw new TypeError("invalid codec apt parameter")}e.rtcpFeedback&&Array.isArray(e.rtcpFeedback)||(e.rtcpFeedback=[]);for(const t of e.rtcpFeedback)l(t)}function l(e){if("object"!=typeof e)throw new TypeError("fb is not an object");if(!e.type||"string"!=typeof e.type)throw new TypeError("missing fb.type");e.parameter&&"string"==typeof e.parameter||(e.parameter="")}function d(e){if("object"!=typeof e)throw new TypeError("ext is not an object");if("audio"!==e.kind&&"video"!==e.kind)throw new TypeError("invalid ext.kind");if(!e.uri||"string"!=typeof e.uri)throw new TypeError("missing ext.uri");if("number"!=typeof e.preferredId)throw new TypeError("missing ext.preferredId");if(e.preferredEncrypt&&"boolean"!=typeof e.preferredEncrypt)throw new TypeError("invalid ext.preferredEncrypt");if(e.preferredEncrypt||(e.preferredEncrypt=!1),e.direction&&"string"!=typeof e.direction)throw new TypeError("invalid ext.direction");e.direction||(e.direction="sendrecv")}function u(e){if("object"!=typeof e)throw new TypeError("params is not an object");if(e.mid&&"string"!=typeof e.mid)throw new TypeError("params.mid is not a string");if(!Array.isArray(e.codecs))throw new TypeError("missing params.codecs");for(const t of e.codecs)p(t);if(e.headerExtensions&&!Array.isArray(e.headerExtensions))throw new TypeError("params.headerExtensions is not an array");e.headerExtensions||(e.headerExtensions=[]);for(const t of e.headerExtensions)f(t);if(e.encodings&&!Array.isArray(e.encodings))throw new TypeError("params.encodings is not an array");e.encodings||(e.encodings=[]);for(const t of e.encodings)h(t);if(e.rtcp&&"object"!=typeof e.rtcp)throw new TypeError("params.rtcp is not an object");e.rtcp||(e.rtcp={}),m(e.rtcp)}function p(e){const t=new RegExp("^(audio|video)/(.+)","i");if("object"!=typeof e)throw new TypeError("codec is not an object");if(!e.mimeType||"string"!=typeof e.mimeType)throw new TypeError("missing codec.mimeType");const r=t.exec(e.mimeType);if(!r)throw new TypeError("invalid codec.mimeType");if("number"!=typeof e.payloadType)throw new TypeError("missing codec.payloadType");if("number"!=typeof e.clockRate)throw new TypeError("missing codec.clockRate");"audio"===r[1].toLowerCase()?"number"!=typeof e.channels&&(e.channels=1):delete e.channels,e.parameters&&"object"==typeof e.parameters||(e.parameters={});for(const t of Object.keys(e.parameters)){let r=e.parameters[t];if(void 0===r&&(e.parameters[t]="",r=""),"string"!=typeof r&&"number"!=typeof r)throw new TypeError(`invalid codec parameter [key:${t}s, value:${r}]`);if("apt"===t&&"number"!=typeof r)throw new TypeError("invalid codec apt parameter")}e.rtcpFeedback&&Array.isArray(e.rtcpFeedback)||(e.rtcpFeedback=[]);for(const t of e.rtcpFeedback)l(t)}function f(e){if("object"!=typeof e)throw new TypeError("ext is not an object");if(!e.uri||"string"!=typeof e.uri)throw new TypeError("missing ext.uri");if("number"!=typeof e.id)throw new TypeError("missing ext.id");if(e.encrypt&&"boolean"!=typeof e.encrypt)throw new TypeError("invalid ext.encrypt");e.encrypt||(e.encrypt=!1),e.parameters&&"object"==typeof e.parameters||(e.parameters={});for(const t of Object.keys(e.parameters)){let r=e.parameters[t];if(void 0===r&&(e.parameters[t]="",r=""),"string"!=typeof r&&"number"!=typeof r)throw new TypeError("invalid header extension parameter")}}function h(e){if("object"!=typeof e)throw new TypeError("encoding is not an object");if(e.ssrc&&"number"!=typeof e.ssrc)throw new TypeError("invalid encoding.ssrc");if(e.rid&&"string"!=typeof e.rid)throw new TypeError("invalid encoding.rid");if(e.rtx&&"object"!=typeof e.rtx)throw new TypeError("invalid encoding.rtx");if(e.rtx&&"number"!=typeof e.rtx.ssrc)throw new TypeError("missing encoding.rtx.ssrc");if(e.dtx&&"boolean"==typeof e.dtx||(e.dtx=!1),e.scalabilityMode&&"string"!=typeof e.scalabilityMode)throw new TypeError("invalid encoding.scalabilityMode")}function m(e){if("object"!=typeof e)throw new TypeError("rtcp is not an object");if(e.cname&&"string"!=typeof e.cname)throw new TypeError("invalid rtcp.cname");e.reducedSize&&"boolean"==typeof e.reducedSize||(e.reducedSize=!0)}function g(e){if("object"!=typeof e)throw new TypeError("numStreams is not an object");if("number"!=typeof e.OS)throw new TypeError("missing numStreams.OS");if("number"!=typeof e.MIS)throw new TypeError("missing numStreams.MIS")}function v(e){return!!e&&/.+\/rtx$/i.test(e.mimeType)}function y(e,t,{strict:r=!1,modify:n=!1}={}){const i=e.mimeType.toLowerCase();if(i!==t.mimeType.toLowerCase())return!1;if(e.clockRate!==t.clockRate)return!1;if(e.channels!==t.channels)return!1;switch(i){case"video/h264":if(r){if((e.parameters["packetization-mode"]||0)!==(t.parameters["packetization-mode"]||0))return!1;if(!s.isSameProfile(e.parameters,t.parameters))return!1;let r;try{r=s.generateProfileLevelIdForAnswer(e.parameters,t.parameters)}catch(e){return!1}n&&(r?(e.parameters["profile-level-id"]=r,t.parameters["profile-level-id"]=r):(delete e.parameters["profile-level-id"],delete t.parameters["profile-level-id"]))}break;case"video/vp9":if(r){if((e.parameters["profile-id"]||0)!==(t.parameters["profile-id"]||0))return!1}}return!0}function w(e,t){return(!e.kind||!t.kind||e.kind===t.kind)&&e.uri===t.uri}function b(e,t){const r=[];for(const n of e.rtcpFeedback||[]){const e=(t.rtcpFeedback||[]).find((e=>e.type===n.type&&(e.parameter===n.parameter||!e.parameter&&!n.parameter)));e&&r.push(e)}return r}e.exports.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)c(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)d(t)},e.exports.validateRtpCodecCapability=c,e.exports.validateRtcpFeedback=l,e.exports.validateRtpHeaderExtension=d,e.exports.validateRtpParameters=u,e.exports.validateRtpCodecParameters=p,e.exports.validateRtpHeaderExtensionParameters=f,e.exports.validateRtpEncodingParameters=h,e.exports.validateRtcpParameters=m,e.exports.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)},e.exports.validateNumSctpStreams=g,e.exports.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")},e.exports.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")},e.exports.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=>w(e,n)));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},e.exports.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},e.exports.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},e.exports.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},e.exports.reduceCodecs=function(e,t){const r=[];if(t){for(let n=0;n<e.length;++n)if(y(e[n],t)){r.push(e[n]),v(e[n+1])&&r.push(e[n+1]);break}if(0===r.length)throw new TypeError("no matching codec found")}else r.push(e[0]),v(e[1])&&r.push(e[1]);return r},e.exports.generateProbatorRtpParameters=function(e){u(e=o.clone(e,{}));const t={mid:"probator",codecs:[],headerExtensions:[],encodings:[{ssrc:1234}],rtcp:{cname:"probator"}};return t.codecs.push(e.codecs[0]),t.codecs[0].payloadType=127,t.headerExtensions=e.headerExtensions,t},e.exports.canSend=function(e,t){return t.codecs.some((t=>t.kind===e))},e.exports.canReceive=function(e,t){if(u(e),0===e.codecs.length)return!1;const r=e.codecs[0];return t.codecs.some((e=>e.remotePayloadType===r.payloadType))}})),a.register("cvKIE",(function(t,r){var n,i,s,o,c,l,d,u,p,f,h,m,g,v,y,w,b,_,x,S,k,E,R,C,P,T,j,M;e(t.exports,"ProfileConstrainedBaseline",(()=>n),(e=>n=e)),e(t.exports,"ProfileBaseline",(()=>i),(e=>i=e)),e(t.exports,"ProfileMain",(()=>s),(e=>s=e)),e(t.exports,"ProfileConstrainedHigh",(()=>o),(e=>o=e)),e(t.exports,"ProfileHigh",(()=>c),(e=>c=e)),e(t.exports,"Level1_b",(()=>l),(e=>l=e)),e(t.exports,"Level1",(()=>d),(e=>d=e)),e(t.exports,"Level1_1",(()=>u),(e=>u=e)),e(t.exports,"Level1_2",(()=>p),(e=>p=e)),e(t.exports,"Level1_3",(()=>f),(e=>f=e)),e(t.exports,"Level2",(()=>h),(e=>h=e)),e(t.exports,"Level2_1",(()=>m),(e=>m=e)),e(t.exports,"Level2_2",(()=>g),(e=>g=e)),e(t.exports,"Level3",(()=>v),(e=>v=e)),e(t.exports,"Level3_1",(()=>y),(e=>y=e)),e(t.exports,"Level3_2",(()=>w),(e=>w=e)),e(t.exports,"Level4",(()=>b),(e=>b=e)),e(t.exports,"Level4_1",(()=>_),(e=>_=e)),e(t.exports,"Level4_2",(()=>x),(e=>x=e)),e(t.exports,"Level5",(()=>S),(e=>S=e)),e(t.exports,"Level5_1",(()=>k),(e=>k=e)),e(t.exports,"Level5_2",(()=>E),(e=>E=e)),e(t.exports,"ProfileLevelId",(()=>R),(e=>R=e)),e(t.exports,"parseProfileLevelId",(()=>C),(e=>C=e)),e(t.exports,"profileLevelIdToString",(()=>P),(e=>P=e)),e(t.exports,"parseSdpProfileLevelId",(()=>T),(e=>T=e)),e(t.exports,"isSameProfile",(()=>j),(e=>j=e)),e(t.exports,"generateProfileLevelIdForAnswer",(()=>M),(e=>M=e));const D=a("hZG0u")("h264-profile-level-id");D.log=console.info.bind(console);n=1,i=2,s=3,o=4,c=5;const I=10;l=0,d=10,u=11,p=12,f=13,h=20,m=21,g=22,v=30,y=31,w=32,b=40,_=41,x=42,S=50,k=51,E=52;class O{constructor(e,t){this.profile=e,this.level=t}}R=O;const L=new O(1,31);class A{constructor(e){this._mask=~B("x",e),this._maskedValue=B("1",e)}isMatch(e){return this._maskedValue===(e&this._mask)}}class N{constructor(e,t,r){this.profile_idc=e,this.profile_iop=t,this.profile=r}}const F=[new N(66,new A("x1xx0000"),1),new N(77,new A("1xxx0000"),1),new N(88,new A("11xx0000"),1),new N(66,new A("x0xx0000"),2),new N(88,new A("10xx0000"),2),new N(77,new A("0x0x0000"),3),new N(100,new A("00000000"),5),new N(100,new A("00001100"),4)];function B(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)<<0}function z(e={}){const t=e["level-asymmetry-allowed"];return 1===t||"1"===t}C=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,i=t>>16&255;let a;switch(r){case 11:a=0!=(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:a=r;break;default:return D("parseProfileLevelId() | unrecognized level_idc:%s",r),null}for(const e of F)if(i===e.profile_idc&&e.profile_iop.isMatch(n))return new O(e.profile,a);return D("parseProfileLevelId() | unrecognized profile_idc/profile_iop combination"),null},P=function(e){if(0==e.level)switch(e.profile){case 1:return"42f00b";case 2:return"42100b";case 3:return"4d100b";default:return D("profileLevelIdToString() | Level 1_b not is allowed for profile:%s",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;default:return D("profileLevelIdToString() | unrecognized profile:%s",e.profile),null}let r=e.level.toString(16);return 1===r.length&&(r=`0${r}`),`${t}${r}`},T=function(e={}){const t=e["profile-level-id"];return t?C(t):L},j=function(e={},t={}){const r=T(e),n=T(t);return Boolean(r&&n&&r.profile===n.profile)},M=function(e={},t={}){if(!e["profile-level-id"]&&!t["profile-level-id"])return D("generateProfileLevelIdForAnswer() | no profile-level-id in local and remote params"),null;const r=T(e),n=T(t);if(!r)throw new TypeError("invalid local_profile_level_id");if(!n)throw new TypeError("invalid remote_profile_level_id");if(r.profile!==n.profile)throw new TypeError("H264 Profile mismatch");const i=z(e)&&z(t),a=r.level,s=n.level,o=function(e,t){return 0===e?t!==I&&0!==t:0===t?e!==I:e<t}(c=a,l=s)?c:l;var c,l;const d=i?a:o;return D("generateProfileLevelIdForAnswer() | result: [profile:%s, level:%s]",r.profile,d),P(new O(r.profile,d))}})),a.register("3avKh",(function(e,t){"use strict";var r=e.exports&&e.exports.__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]}),n=e.exports&&e.exports.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=e.exports&&e.exports.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&r(t,e,i);return n(t,e),t};Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.Transport=void 0;var s=a("gqIOR"),o=a("ejIpo"),c=a("3owO4"),l=a("9Limk");const d=i(a("73pkW")),u=i(a("bGAAX"));var p=a("eEB2e"),f=a("4Ad83"),h=a("dU6XI"),m=a("4Y5zE");class g{constructor(e){this.consumerOptions=e,this.promise=new Promise(((e,t)=>{this.resolve=e,this.reject=t}))}}const v=new o.Logger("Transport");class y extends c.EnhancedEventEmitter{constructor({direction:e,id:t,iceParameters:r,iceCandidates:n,dtlsParameters:i,sctpParameters:a,iceServers:o,iceTransportPolicy:u,additionalSettings:p,proprietaryConstraints:f,appData:h,handlerFactory:m,extendedRtpCapabilities:g,canProduceByKind:y}){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({ClosedErrorClass:l.InvalidStateError}),this._pendingConsumerTasks=[],this._consumerCreationInProgress=!1,this._pendingPauseConsumers=new Map,this._consumerPauseInProgress=!1,this._pendingResumeConsumers=new Map,this._consumerResumeInProgress=!1,this._observer=new c.EnhancedEventEmitter,v.debug("constructor() [id:%s, direction:%s]",t,e),this._id=t,this._direction=e,this._extendedRtpCapabilities=g,this._canProduceByKind=y,this._maxSctpMessageSize=a?a.maxMessageSize:null,delete(p=d.clone(p,{})).iceServers,delete p.iceTransportPolicy,delete p.bundlePolicy,delete p.rtcpMuxPolicy,delete p.sdpSemantics,this._handler=m(),this._handler.run({direction:e,iceParameters:r,iceCandidates:n,dtlsParameters:i,sctpParameters:a,iceServers:o,iceTransportPolicy:u,additionalSettings:p,proprietaryConstraints:f,extendedRtpCapabilities:g}),this._appData=h||{},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){throw new Error("cannot override appData object")}get observer(){return this._observer}close(){if(!this._closed){v.debug("close()"),this._closed=!0,this._awaitQueue.close(),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 l.InvalidStateError("closed");return this._handler.getTransportStats()}async restartIce({iceParameters:e}){if(v.debug("restartIce()"),this._closed)throw new l.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(v.debug("updateIceServers()"),this._closed)throw new l.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:a=!0,zeroRtpOnPause:s=!1,appData:o={}}={}){if(v.debug("produce() [track:%o]",e),!e)throw new TypeError("missing track");if("send"!==this._direction)throw new l.UnsupportedError("not a sending Transport");if(!this._canProduceByKind[e.kind])throw new l.UnsupportedError(`cannot produce ${e.kind}`);if("ended"===e.readyState)throw new l.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(o&&"object"!=typeof o)throw new TypeError("if given, appData must be an object");return this._awaitQueue.push((async()=>{let c;if(t&&!Array.isArray(t))throw TypeError("encodings must be an array");t&&0===t.length?c=void 0:t&&(c=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:l,rtpParameters:d,rtpSender:f}=await this._handler.send({track:e,encodings:c,codecOptions:r,codec:n});try{u.validateRtpParameters(d);const{id:t}=await this.safeEmitAsPromise("produce",{kind:e.kind,rtpParameters:d,appData:o}),r=new p.Producer({id:t,localId:l,rtpSender:f,track:e,rtpParameters:d,stopTracks:i,disableTrackOnPause:a,zeroRtpOnPause:s,appData:o});return this._producers.set(r.id,r),this._handleProducer(r),this._observer.safeEmit("newproducer",r),r}catch(e){throw this._handler.stopSending(l).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,appData:i={}}){if(v.debug("consume()"),n=d.clone(n,void 0),this._closed)throw new l.InvalidStateError("closed");if("recv"!==this._direction)throw new l.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(i&&"object"!=typeof i)throw new TypeError("if given, appData must be an object");if(!u.canReceive(n,this._extendedRtpCapabilities))throw new l.UnsupportedError("cannot consume this Producer");const a=new g({id:e,producerId:t,kind:r,rtpParameters:n,appData:i});return this._pendingConsumerTasks.push(a),!1===this._consumerCreationInProgress&&this._createPendingConsumers(),a.promise}async produceData({ordered:e=!0,maxPacketLifeTime:t,maxRetransmits:r,label:n="",protocol:i="",appData:a={}}={}){if(v.debug("produceData()"),"send"!==this._direction)throw new l.UnsupportedError("not a sending Transport");if(!this._maxSctpMessageSize)throw new l.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(a&&"object"!=typeof a)throw new TypeError("if given, appData must be an object");return(t||r)&&(e=!1),this._awaitQueue.push((async()=>{const{dataChannel:s,sctpStreamParameters:o}=await this._handler.sendDataChannel({ordered:e,maxPacketLifeTime:t,maxRetransmits:r,label:n,protocol:i});u.validateSctpStreamParameters(o);const{id:c}=await this.safeEmitAsPromise("producedata",{sctpStreamParameters:o,label:n,protocol:i,appData:a}),l=new h.DataProducer({id:c,dataChannel:s,sctpStreamParameters:o,appData:a});return this._dataProducers.set(l.id,l),this._handleDataProducer(l),this._observer.safeEmit("newdataproducer",l),l}),"transport.produceData()")}async consumeData({id:e,dataProducerId:t,sctpStreamParameters:r,label:n="",protocol:i="",appData:a={}}){if(v.debug("consumeData()"),r=d.clone(r,void 0),this._closed)throw new l.InvalidStateError("closed");if("recv"!==this._direction)throw new l.UnsupportedError("not a receiving Transport");if(!this._maxSctpMessageSize)throw new l.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(a&&"object"!=typeof a)throw new TypeError("if given, appData must be an object");return u.validateSctpStreamParameters(r),this._awaitQueue.push((async()=>{const{dataChannel:s}=await this._handler.receiveDataChannel({sctpStreamParameters:r,label:n,protocol:i}),o=new m.DataConsumer({id:e,dataProducerId:t,dataChannel:s,sctpStreamParameters:r,appData:a});return this._dataConsumers.set(o.id,o),this._handleDataConsumer(o),this._observer.safeEmit("newdataconsumer",o),o}),"transport.consumeData()")}async _createPendingConsumers(){this._awaitQueue.push((async()=>{this._consumerCreationInProgress=!0;const e=[...this._pendingConsumerTasks];let t;this._pendingConsumerTasks=[];const r=[];for(const t of e){const{id:e,kind:n,rtpParameters:i}=t.consumerOptions;r.push({trackId:e,kind:n,rtpParameters:i})}try{const n=await this._handler.receive(r);for(let r=0;r<n.length;r++){const i=e[r],a=n[r],{id:s,producerId:o,kind:c,rtpParameters:l,appData:d}=i.consumerOptions,{localId:u,rtpReceiver:p,track:h}=a,m=new f.Consumer({id:s,localId:u,producerId:o,rtpReceiver:p,track:h,rtpParameters:l,appData:d});this._consumers.set(m.id,m),this._handleConsumer(m),this._probatorConsumerCreated||t||"video"!==c||(t=m),this._observer.safeEmit("newconsumer",m),i.resolve(m)}}catch(t){for(const r of e)r.reject(t)}if(t)try{const e=u.generateProbatorRtpParameters(t.rtpParameters);await this._handler.receive([{trackId:"probator",kind:"video",rtpParameters:e}]),v.debug("_createPendingConsumers() | Consumer for RTP probation created"),this._probatorConsumerCreated=!0}catch(e){v.error("_createPendingConsumers() | failed to create Consumer for RTP probation:%o",e)}this._consumerCreationInProgress=!1}),"transport._createPendingConsumers()").then((()=>{this._pendingConsumerTasks.length>0&&this._createPendingConsumers()})).catch((()=>{}))}_pausePendingConsumers(){this._awaitQueue.push((async()=>{this._consumerPauseInProgress=!0;const e=Array.from(this._pendingPauseConsumers.values());this._pendingPauseConsumers.clear();try{await this._handler.pauseReceiving(e.map((e=>e.localId)))}catch(e){v.error("_pausePendingConsumers() | failed to pause Consumers:",e)}this._consumerPauseInProgress=!1}),"consumer @pause event").then((()=>{this._pendingPauseConsumers.size>0&&this._pausePendingConsumers()})).catch((()=>{}))}_resumePendingConsumers(){this._awaitQueue.push((async()=>{this._consumerResumeInProgress=!0;const e=Array.from(this._pendingResumeConsumers.values());this._pendingResumeConsumers.clear();try{await this._handler.resumeReceiving(e.map((e=>e.localId)))}catch(e){v.error("_resumePendingConsumers() | failed to resume Consumers:",e)}}),"consumer @resume event").then((()=>{this._consumerResumeInProgress=!1,this._pendingResumeConsumers.size>0&&this._resumePendingConsumers()})).catch((()=>{}))}_handleHandler(){const e=this._handler;e.on("@connect",(({dtlsParameters:e},t,r)=>{this._closed?r(new l.InvalidStateError("closed")):this.safeEmit("connect",{dtlsParameters:e},t,r)})),e.on("@connectionstatechange",(e=>{e!==this._connectionState&&(v.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=>v.warn("producer.close() failed:%o",e)))})),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 l.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._awaitQueue.push((async()=>this._handler.stopReceiving(e.localId)),"consumer @close event").catch((()=>{}))})),e.on("@pause",(()=>{this._pendingResumeConsumers.has(e.id)&&this._pendingResumeConsumers.delete(e.id),this._pendingPauseConsumers.set(e.id,e),!1===this._consumerPauseInProgress&&this._pausePendingConsumers()})),e.on("@resume",(()=>{this._pendingPauseConsumers.has(e.id)&&this._pendingPauseConsumers.delete(e.id),this._pendingResumeConsumers.set(e.id,e),!1===this._consumerResumeInProgress&&this._resumePendingConsumers()})),e.on("@getstats",((t,r)=>{if(this._closed)return r(new l.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)}))}}e.exports.Transport=y})),a.register("gqIOR",(function(e,t){"use strict";var r=e.exports&&e.exports.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function s(e){try{c(n.next(e))}catch(e){a(e)}}function o(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,o)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(e.exports,"__esModule",{value:!0});e.exports.AwaitQueue=class{constructor({ClosedErrorClass:e=Error,StoppedErrorClass:t=Error,RemovedTaskErrorClass:r=Error}={ClosedErrorClass:Error,StoppedErrorClass:Error,RemovedTaskErrorClass:Error}){this.closed=!1,this.pendingTasks=[],this.ClosedErrorClass=Error,this.StoppedErrorClass=Error,this.RemovedTaskErrorClass=Error,this.ClosedErrorClass=e,this.StoppedErrorClass=t,this.RemovedTaskErrorClass=r}get size(){return this.pendingTasks.length}close(){if(!this.closed){this.closed=!0;for(const e of this.pendingTasks)e.stopped=!0,e.reject(new this.ClosedErrorClass("AwaitQueue closed"));this.pendingTasks.length=0}}push(e,t){return r(this,void 0,void 0,(function*(){if(this.closed)throw new this.ClosedErrorClass("AwaitQueue closed");if("function"!=typeof e)throw new TypeError("given task is not a function");if(!e.name&&t)try{Object.defineProperty(e,"name",{value:t})}catch(e){}return new Promise(((r,n)=>{const i={task:e,name:t,resolve:r,reject:n,stopped:!1,enqueuedAt:new Date,executedAt:void 0};this.pendingTasks.push(i),1===this.pendingTasks.length&&this.next()}))}))}removeTask(e){if(0===e)throw new TypeError("cannot remove task with index 0");const t=this.pendingTasks[e];t&&(this.pendingTasks.splice(e,1),t.reject(new this.RemovedTaskErrorClass("task removed from the queue")))}stop(){if(!this.closed){for(const e of this.pendingTasks)e.stopped=!0,e.reject(new this.StoppedErrorClass("AwaitQueue stopped"));this.pendingTasks.length=0}}dump(){const e=new Date;let t=0;return this.pendingTasks.map((r=>({idx:t++,task:r.task,name:r.name,enqueuedTime:r.executedAt?r.executedAt.getTime()-r.enqueuedAt.getTime():e.getTime()-r.enqueuedAt.getTime(),executingTime:r.executedAt?e.getTime()-r.executedAt.getTime():0})))}next(){return r(this,void 0,void 0,(function*(){const e=this.pendingTasks[0];e&&(yield this.executeTask(e),this.pendingTasks.shift(),this.next())}))}executeTask(e){return r(this,void 0,void 0,(function*(){if(!e.stopped){e.executedAt=new Date;try{const t=yield e.task();if(e.stopped)return;e.resolve(t)}catch(t){if(e.stopped)return;e.reject(t)}}}))}}})),a.register("eEB2e",(function(e,t){"use strict";Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.Producer=void 0;var r=a("ejIpo"),n=a("3owO4"),i=a("9Limk");const s=new r.Logger("Producer");class o extends n.EnhancedEventEmitter{constructor({id:e,localId:t,rtpSender:r,track:i,rtpParameters:a,stopTracks:o,disableTrackOnPause:c,zeroRtpOnPause:l,appData:d}){super(),this._closed=!1,this._observer=new n.EnhancedEventEmitter,s.debug("constructor()"),this._id=e,this._localId=t,this._rtpSender=r,this._track=i,this._kind=i.kind,this._rtpParameters=a,this._paused=!!c&&!i.enabled,this._maxSpatialLayer=void 0,this._stopTracks=o,this._disableTrackOnPause=c,this._zeroRtpOnPause=l,this._appData=d||{},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){throw new Error("cannot override appData object")}get observer(){return this._observer}close(){this._closed||(s.debug("close()"),this._closed=!0,this._destroyTrack(),this.emit("@close"),this._observer.safeEmit("close"))}transportClosed(){this._closed||(s.debug("transportClosed()"),this._closed=!0,this._destroyTrack(),this.safeEmit("transportclose"),this._observer.safeEmit("close"))}async getStats(){if(this._closed)throw new i.InvalidStateError("closed");return this.safeEmitAsPromise("@getstats")}pause(){s.debug("pause()"),this._closed?s.error("pause() | Producer closed"):(this._paused=!0,this._track&&this._disableTrackOnPause&&(this._track.enabled=!1),this._zeroRtpOnPause&&this.safeEmitAsPromise("@replacetrack",null).catch((()=>{})),this._observer.safeEmit("pause"))}resume(){s.debug("resume()"),this._closed?s.error("resume() | Producer closed"):(this._paused=!1,this._track&&this._disableTrackOnPause&&(this._track.enabled=!0),this._zeroRtpOnPause&&this.safeEmitAsPromise("@replacetrack",this._track).catch((()=>{})),this._observer.safeEmit("resume"))}async replaceTrack({track:e}){if(s.debug("replaceTrack() [track:%o]",e),this._closed){if(e&&this._stopTracks)try{e.stop()}catch(e){}throw new i.InvalidStateError("closed")}if(e&&"ended"===e.readyState)throw new i.InvalidStateError("track ended");e!==this._track?(this._zeroRtpOnPause&&this._paused||await this.safeEmitAsPromise("@replacetrack",e),this._destroyTrack(),this._track=e,this._track&&this._disableTrackOnPause&&(this._paused?this._paused&&(this._track.enabled=!1):this._track.enabled=!0),this._handleTrack()):s.debug("replaceTrack() | same track, ignored")}async setMaxSpatialLayer(e){if(this._closed)throw new i.InvalidStateError("closed");if("video"!==this._kind)throw new i.UnsupportedError("not a video Producer");if("number"!=typeof e)throw new TypeError("invalid spatialLayer");e!==this._maxSpatialLayer&&(await this.safeEmitAsPromise("@setmaxspatiallayer",e),this._maxSpatialLayer=e)}async setRtpEncodingParameters(e){if(this._closed)throw new i.InvalidStateError("closed");if("object"!=typeof e)throw new TypeError("invalid params");await this.safeEmitAsPromise("@setrtpencodingparameters",e)}_onTrackEnded(){s.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){}}}e.exports.Producer=o})),a.register("4Ad83",(function(e,t){"use strict";Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.Consumer=void 0;var r=a("ejIpo"),n=a("3owO4"),i=a("9Limk");const s=new r.Logger("Consumer");class o extends n.EnhancedEventEmitter{constructor({id:e,localId:t,producerId:r,rtpReceiver:i,track:a,rtpParameters:o,appData:c}){super(),this._closed=!1,this._observer=new n.EnhancedEventEmitter,s.debug("constructor()"),this._id=e,this._localId=t,this._producerId=r,this._rtpReceiver=i,this._track=a,this._rtpParameters=o,this._paused=!a.enabled,this._appData=c||{},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){throw new Error("cannot override appData object")}get observer(){return this._observer}close(){this._closed||(s.debug("close()"),this._closed=!0,this._destroyTrack(),this.emit("@close"),this._observer.safeEmit("close"))}transportClosed(){this._closed||(s.debug("transportClosed()"),this._closed=!0,this._destroyTrack(),this.safeEmit("transportclose"),this._observer.safeEmit("close"))}async getStats(){if(this._closed)throw new i.InvalidStateError("closed");return this.safeEmitAsPromise("@getstats")}pause(){s.debug("pause()"),this._closed?s.error("pause() | Consumer closed"):(this._paused=!0,this._track.enabled=!1,this.emit("@pause"),this._observer.safeEmit("pause"))}resume(){s.debug("resume()"),this._closed?s.error("resume() | Consumer closed"):(this._paused=!1,this._track.enabled=!0,this.emit("@resume"),this._observer.safeEmit("resume"))}_onTrackEnded(){s.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){}}}e.exports.Consumer=o})),a.register("dU6XI",(function(e,t){"use strict";Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.DataProducer=void 0;var r=a("ejIpo"),n=a("3owO4"),i=a("9Limk");const s=new r.Logger("DataProducer");class o extends n.EnhancedEventEmitter{constructor({id:e,dataChannel:t,sctpStreamParameters:r,appData:i}){super(),this._closed=!1,this._observer=new n.EnhancedEventEmitter,s.debug("constructor()"),this._id=e,this._dataChannel=t,this._sctpStreamParameters=r,this._appData=i||{},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){throw new Error("cannot override appData object")}get observer(){return this._observer}close(){this._closed||(s.debug("close()"),this._closed=!0,this._dataChannel.close(),this.emit("@close"),this._observer.safeEmit("close"))}transportClosed(){this._closed||(s.debug("transportClosed()"),this._closed=!0,this._dataChannel.close(),this.safeEmit("transportclose"),this._observer.safeEmit("close"))}send(e){if(s.debug("send()"),this._closed)throw new i.InvalidStateError("closed");this._dataChannel.send(e)}_handleDataChannel(){this._dataChannel.addEventListener("open",(()=>{this._closed||(s.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?s.error("DataChannel SCTP error [sctpCauseCode:%s]: %s",t.sctpCauseCode,t.message):s.error('DataChannel "error" event: %o',t),this.safeEmit("error",t)})),this._dataChannel.addEventListener("close",(()=>{this._closed||(s.warn('DataChannel "close" event'),this._closed=!0,this.emit("@close"),this.safeEmit("close"))})),this._dataChannel.addEventListener("message",(()=>{this._closed||s.warn('DataChannel "message" event in a DataProducer, message discarded')})),this._dataChannel.addEventListener("bufferedamountlow",(()=>{this._closed||this.safeEmit("bufferedamountlow")}))}}e.exports.DataProducer=o})),a.register("4Y5zE",(function(e,t){"use strict";Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.DataConsumer=void 0;var r=a("ejIpo"),n=a("3owO4");const i=new r.Logger("DataConsumer");class s extends n.EnhancedEventEmitter{constructor({id:e,dataProducerId:t,dataChannel:r,sctpStreamParameters:a,appData:s}){super(),this._closed=!1,this._observer=new n.EnhancedEventEmitter,i.debug("constructor()"),this._id=e,this._dataProducerId=t,this._dataChannel=r,this._sctpStreamParameters=a,this._appData=s||{},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){throw new Error("cannot override appData object")}get observer(){return this._observer}close(){this._closed||(i.debug("close()"),this._closed=!0,this._dataChannel.close(),this.emit("@close"),this._observer.safeEmit("close"))}transportClosed(){this._closed||(i.debug("transportClosed()"),this._closed=!0,this._dataChannel.close(),this.safeEmit("transportclose"),this._observer.safeEmit("close"))}_handleDataChannel(){this._dataChannel.addEventListener("open",(()=>{this._closed||(i.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?i.error("DataChannel SCTP error [sctpCauseCode:%s]: %s",t.sctpCauseCode,t.message):i.error('DataChannel "error" event: %o',t),this.safeEmit("error",t)})),this._dataChannel.addEventListener("close",(()=>{this._closed||(i.warn('DataChannel "close" event'),this._closed=!0,this.emit("@close"),this.safeEmit("close"))})),this._dataChannel.addEventListener("message",(e=>{this._closed||this.safeEmit("message",e.data)}))}}e.exports.DataConsumer=s})),a.register("lptJi",(function(e,t){"use strict";var r=e.exports&&e.exports.__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]}),n=e.exports&&e.exports.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=e.exports&&e.exports.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&r(t,e,i);return n(t,e),t};Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.Chrome74=void 0;const s=i(a("6j9nc"));var o=a("ejIpo");const c=i(a("73pkW")),l=i(a("bGAAX")),d=i(a("ix8yI")),u=i(a("k2kM6"));var p=a("azKWm"),f=a("dKEZw"),h=a("fT1lN");const m=new o.Logger("Chrome74"),g={OS:1024,MIS:1024};class v extends p.HandlerInterface{constructor(){super(),this._mapMidTransceiver=new Map,this._sendStream=new MediaStream,this._hasDataChannelMediaSection=!1,this._nextSendSctpStreamId=0,this._transportReady=!1}static createFactory(){return()=>new v}get name(){return"Chrome74"}close(){if(m.debug("close()"),this._pc)try{this._pc.close()}catch(e){}}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=s.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:a,iceTransportPolicy:s,additionalSettings:o,proprietaryConstraints:c,extendedRtpCapabilities:d}){m.debug("run()"),this._direction=e,this._remoteSdp=new f.RemoteSdp({iceParameters:t,iceCandidates:r,dtlsParameters:n,sctpParameters:i}),this._sendingRtpParametersByKind={audio:l.getSendingRtpParameters("audio",d),video:l.getSendingRtpParameters("video",d)},this._sendingRemoteRtpParametersByKind={audio:l.getSendingRemoteRtpParameters("audio",d),video:l.getSendingRemoteRtpParameters("video",d)},n.role&&"auto"!==n.role&&(this._forcedLocalDtlsRole="server"===n.role?"client":"server"),this._pc=new RTCPeerConnection({iceServers:a||[],iceTransportPolicy:s||"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require",sdpSemantics:"unified-plan",...o},c),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){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),t&&t.length>1&&t.forEach(((e,t)=>{e.rid=`r${t}`}));const a=c.clone(this._sendingRtpParametersByKind[e.kind],{});a.codecs=l.reduceCodecs(a.codecs,n);const o=c.clone(this._sendingRemoteRtpParametersByKind[e.kind],{});o.codecs=l.reduceCodecs(o.codecs,n);const p=this._remoteSdp.getNextMediaSectionIdx(),f=this._pc.addTransceiver(e,{direction:"sendonly",streams:[this._sendStream],sendEncodings:t});let g,v=await this._pc.createOffer(),y=s.parse(v.sdp);this._transportReady||await this._setupTransport({localDtlsRole:null!==(i=this._forcedLocalDtlsRole)&&void 0!==i?i:"client",localSdpObject:y});let w=!1;const b=(0,h.parse)((t||[{}])[0].scalabilityMode);t&&1===t.length&&b.spatialLayers>1&&"video/vp9"===a.codecs[0].mimeType.toLowerCase()&&(m.debug("send() | enabling legacy simulcast for VP9 SVC"),w=!0,y=s.parse(v.sdp),g=y.media[p.idx],u.addLegacySimulcast({offerMediaObject:g,numStreams:b.spatialLayers}),v={type:"offer",sdp:s.write(y)}),m.debug("send() | calling pc.setLocalDescription() [offer:%o]",v),await this._pc.setLocalDescription(v);const _=f.mid;if(a.mid=_,y=s.parse(this._pc.localDescription.sdp),g=y.media[p.idx],a.rtcp.cname=d.getCname({offerMediaObject:g}),t)if(1===t.length){let e=u.getRtpEncodings({offerMediaObject:g});Object.assign(e[0],t[0]),w&&(e=[e[0]]),a.encodings=e}else a.encodings=t;else a.encodings=u.getRtpEncodings({offerMediaObject:g});if(a.encodings.length>1&&("video/vp8"===a.codecs[0].mimeType.toLowerCase()||"video/h264"===a.codecs[0].mimeType.toLowerCase()))for(const e of a.encodings)e.scalabilityMode="S1T3";this._remoteSdp.send({offerMediaObject:g,reuseMid:p.reuseMid,offerRtpParameters:a,answerRtpParameters:o,codecOptions:r,extmapAllowMixed:!0});const x={type:"answer",sdp:this._remoteSdp.getSdp()};return m.debug("send() | calling pc.setRemoteDescription() [answer:%o]",x),await this._pc.setRemoteDescription(x),this._mapMidTransceiver.set(_,f),{localId:_,rtpParameters:a,rtpSender:f.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");t.sender.replaceTrack(null),this._pc.removeTrack(t.sender),this._remoteSdp.closeMediaSection(t.mid);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 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)}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)}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 a;this._assertSendDirection();const o={negotiated:!0,id:this._nextSendSctpStreamId,ordered:e,maxPacketLifeTime:t,maxRetransmits:r,protocol:i};m.debug("sendDataChannel() [options:%o]",o);const c=this._pc.createDataChannel(n,o);if(this._nextSendSctpStreamId=++this._nextSendSctpStreamId%g.MIS,!this._hasDataChannelMediaSection){const e=await this._pc.createOffer(),t=s.parse(e.sdp),r=t.media.find((e=>"application"===e.type));this._transportReady||await this._setupTransport({localDtlsRole:null!==(a=this._forcedLocalDtlsRole)&&void 0!==a?a:"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:c,sctpStreamParameters:{streamId:o.id,ordered:o.ordered,maxPacketLifeTime:o.maxPacketLifeTime,maxRetransmits:o.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 a=i.mid||String(this._mapMidTransceiver.size);n.set(e,a),this._remoteSdp.receive({mid:a,kind:r,offerRtpParameters:i,streamId: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 a=await this._pc.createAnswer();const o=s.parse(a.sdp);for(const t of e){const{trackId:e,rtpParameters:r}=t,i=n.get(e),a=o.media.find((e=>String(e.mid)===i));d.applyCodecParameters({offerRtpParameters:r,answerMediaObject:a})}a={type:"answer",sdp:s.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]",a),await this._pc.setLocalDescription(a);for(const t of e){const{trackId:e}=t,i=n.get(e),a=this._pc.getTransceivers().find((e=>e.mid===i));if(!a)throw new Error("new RTCRtpTransceiver not found");this._mapMidTransceiver.set(i,a),r.push({localId:i,track:a.receiver.track,rtpReceiver:a.receiver})}return r}async stopReceiving(e){this._assertRecvDirection(),m.debug("stopReceiving() [localId:%s]",e);const t=this._mapMidTransceiver.get(e);if(!t)throw new Error("associated RTCRtpTransceiver not found");this._remoteSdp.closeMediaSection(t.mid);const r={type:"offer",sdp:this._remoteSdp.getSdp()};m.debug("stopReceiving() | calling pc.setRemoteDescription() [offer:%o]",r),await this._pc.setRemoteDescription(r);const n=await this._pc.createAnswer();m.debug("stopReceiving() | calling pc.setLocalDescription() [answer:%o]",n),await this._pc.setLocalDescription(n),this._mapMidTransceiver.delete(e)}async pauseReceiving(e){this._assertRecvDirection();for(const t of e){m.debug("pauseReceiving() [localId:%s]",t);const e=this._mapMidTransceiver.get(t);if(!e)throw new Error("associated RTCRtpTransceiver not found");e.direction="inactive"}const t={type:"offer",sdp:this._remoteSdp.getSdp()};m.debug("pauseReceiving() | calling pc.setRemoteDescription() [offer:%o]",t),await this._pc.setRemoteDescription(t);const r=await this._pc.createAnswer();m.debug("pauseReceiving() | calling pc.setLocalDescription() [answer:%o]",r),await this._pc.setLocalDescription(r)}async resumeReceiving(e){this._assertRecvDirection();for(const t of e){m.debug("resumeReceiving() [localId:%s]",t);const e=this._mapMidTransceiver.get(t);if(!e)throw new Error("associated RTCRtpTransceiver not found");e.direction="recvonly"}const t={type:"offer",sdp:this._remoteSdp.getSdp()};m.debug("resumeReceiving() | calling pc.setRemoteDescription() [offer:%o]",t),await this._pc.setRemoteDescription(t);const r=await this._pc.createAnswer();m.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:a,maxPacketLifeTime:o,maxRetransmits:c}=e,l={negotiated:!0,id:i,ordered:a,maxPacketLifeTime:o,maxRetransmits:c,protocol:r};m.debug("receiveDataChannel() [options:%o]",l);const d=this._pc.createDataChannel(t,l);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=s.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:d}}async _setupTransport({localDtlsRole:e,localSdpObject:t}){t||(t=s.parse(this._pc.localDescription.sdp));const r=d.extractDtlsParameters({sdpObject:t});r.role=e,this._remoteSdp.updateDtlsRole("client"===e?"server":"client"),await this.safeEmitAsPromise("@connect",{dtlsParameters:r}),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')}}e.exports.Chrome74=v})),a.register("6j9nc",(function(t,r){var n,i,s,o,c,l,d,u;e(t.exports,"write",(()=>n),(e=>n=e)),e(t.exports,"parse",(()=>i),(e=>i=e)),e(t.exports,"parseParams",(()=>s),(e=>s=e)),e(t.exports,"parseFmtpConfig",(()=>o),(e=>o=e)),e(t.exports,"parsePayloads",(()=>c),(e=>c=e)),e(t.exports,"parseRemoteCandidates",(()=>l),(e=>l=e)),e(t.exports,"parseImageAttributes",(()=>d),(e=>d=e)),e(t.exports,"parseSimulcastStreamList",(()=>u),(e=>u=e));var p=a("dYCRp"),f=a("5u8CB");n=f,i=p.parse,s=p.parseParams,o=p.parseFmtpConfig,c=p.parsePayloads,l=p.parseRemoteCandidates,d=p.parseImageAttributes,u=p.parseSimulcastStreamList})),a.register("dYCRp",(function(t,r){var n,i,s,o,c,l,d;e(t.exports,"parse",(()=>n),(e=>n=e)),e(t.exports,"parseParams",(()=>i),(e=>i=e)),e(t.exports,"parseFmtpConfig",(()=>s),(e=>s=e)),e(t.exports,"parsePayloads",(()=>o),(e=>o=e)),e(t.exports,"parseRemoteCandidates",(()=>c),(e=>c=e)),e(t.exports,"parseImageAttributes",(()=>l),(e=>l=e)),e(t.exports,"parseSimulcastStreamList",(()=>d),(e=>d=e));var u=function(e){return String(Number(e))===e?Number(e):e},p=function(e,t,r){var n=e.name&&e.names;e.push&&!t[e.push]?t[e.push]=[]:n&&!t[e.name]&&(t[e.name]={});var i=e.push?{}:n?t[e.name]:t;!function(e,t,r,n){if(n&&!r)t[n]=u(e[1]);else for(var i=0;i<r.length;i+=1)null!=e[i+1]&&(t[r[i]]=u(e[i+1]))}(r.match(e.reg),i,e.names,e.name),e.push&&t[e.push].push(i)},f=a("iXbsr"),h=RegExp.prototype.test.bind(/^([a-z])=(.*)/);n=function(e){var t={},r=[],n=t;return e.split(/(\r\n|\r|\n)/).filter(h).forEach((function(e){var t=e[0],i=e.slice(2);"m"===t&&(r.push({rtp:[],fmtp:[]}),n=r[r.length-1]);for(var a=0;a<(f[t]||[]).length;a+=1){var s=f[t][a];if(s.reg.test(i))return p(s,n,i)}})),t.media=r,t};var m=function(e,t){var r=t.split(/=(.+)/,2);return 2===r.length?e[r[0]]=u(r[1]):1===r.length&&t.length>1&&(e[r[0]]=void 0),e};s=i=function(e){return e.split(/;\s?/).reduce(m,{})},o=function(e){return e.toString().split(" ").map(Number)},c=function(e){for(var t=[],r=e.split(" ").map(u),n=0;n<r.length;n+=3)t.push({component:r[n],ip:r[n+1],port:r[n+2]});return t},l=function(e){return e.split(" ").map((function(e){return e.substring(1,e.length-1).split(",").reduce(m,{})}))},d=function(e){return e.split(";").map((function(e){return e.split(",").map((function(e){var t,r=!1;return"~"!==e[0]?t=u(e):(t=u(e.substring(1,e.length)),r=!0),{scid:t,paused:r}}))}))}})),a.register("iXbsr",(function(e,t){var r=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",t+=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":"",t+=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(r).forEach((function(e){r[e].forEach((function(e){e.reg||(e.reg=/(.*)/),e.format||(e.format="%s")}))}))})),a.register("5u8CB",(function(e,t){var r=a("iXbsr"),n=/%[sdv%]/g,i=function(e){var t=1,r=arguments,i=r.length;return e.replace(n,(function(e){if(t>=i)return e;var n=r[t];switch(t+=1,e){case"%%":return"%";case"%s":return String(n);case"%d":return Number(n);case"%v":return""}}))},s=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 a=0;a<t.names.length;a+=1){var s=t.names[a];t.name?n.push(r[t.name][s]):n.push(r[t.names[a]])}else n.push(r[t.name]);return i.apply(null,n)},o=["v","o","s","i","u","e","p","c","b","t","r","z","a"],c=["i","c","b","a"];e.exports=function(e,t){t=t||{},null==e.version&&(e.version=0),null==e.name&&(e.name=" "),e.media.forEach((function(e){null==e.payloads&&(e.payloads="")}));var n=t.outerOrder||o,i=t.innerOrder||c,a=[];return n.forEach((function(t){r[t].forEach((function(r){r.name in e&&null!=e[r.name]?a.push(s(t,r,e)):r.push in e&&null!=e[r.push]&&e[r.push].forEach((function(e){a.push(s(t,r,e))}))}))})),e.media.forEach((function(e){a.push(s("m",r.m[0],e)),i.forEach((function(t){r[t].forEach((function(r){r.name in e&&null!=e[r.name]?a.push(s(t,r,e)):r.push in e&&null!=e[r.push]&&e[r.push].forEach((function(e){a.push(s(t,r,e))}))}))}))})),a.join("\r\n")+"\r\n"}})),a.register("ix8yI",(function(e,t){"use strict";var r=e.exports&&e.exports.__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]}),n=e.exports&&e.exports.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=e.exports&&e.exports.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&r(t,e,i);return n(t,e),t};Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.applyCodecParameters=e.exports.getCname=e.exports.extractDtlsParameters=e.exports.extractRtpCapabilities=void 0;const s=i(a("6j9nc"));e.exports.extractRtpCapabilities=function({sdpObject:e}){const t=new Map,r=[];let n=!1,i=!1;for(const a of e.media){const e=a.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 a.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 a.fmtp||[]){const r=s.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 e of a.rtcpFb||[]){const r=t.get(e.payload);if(!r)continue;const n={type:e.type,parameter:e.subtype};n.parameter||delete n.parameter,r.rtcpFeedback.push(n)}for(const t of a.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}},e.exports.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}]}},e.exports.getCname=function({offerMediaObject:e}){const t=(e.ssrcs||[]).find((e=>"cname"===e.attribute));return t?t.value:""},e.exports.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=s.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]}`}}})),a.register("k2kM6",(function(e,t){"use strict";Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.addLegacySimulcast=e.exports.getRtpEncodings=void 0,e.exports.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},e.exports.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(" "),a=r.id;let s;(e.ssrcGroups||[]).some((e=>{if("FID"!==e.semantics)return!1;const t=e.ssrcs.split(/\s+/);return Number(t[0])===a&&(s=Number(t[1]),!0)}));const o=e.ssrcs.find((e=>"cname"===e.attribute));if(!o)throw new Error("a=ssrc line with cname information not found");const c=o.value,l=[],d=[];for(let e=0;e<t;++e)l.push(a+e),s&&d.push(s+e);e.ssrcGroups=[],e.ssrcs=[],e.ssrcGroups.push({semantics:"SIM",ssrcs:l.join(" ")});for(let t=0;t<l.length;++t){const r=l[t];e.ssrcs.push({id:r,attribute:"cname",value:c}),e.ssrcs.push({id:r,attribute:"msid",value:`${n} ${i}`})}for(let t=0;t<d.length;++t){const r=l[t],a=d[t];e.ssrcs.push({id:a,attribute:"cname",value:c}),e.ssrcs.push({id:a,attribute:"msid",value:`${n} ${i}`}),e.ssrcGroups.push({semantics:"FID",ssrcs:`${r} ${a}`})}}})),a.register("azKWm",(function(e,t){"use strict";Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.HandlerInterface=void 0;var r=a("3owO4");class n extends r.EnhancedEventEmitter{constructor(){super()}}e.exports.HandlerInterface=n})),a.register("dKEZw",(function(e,t){"use strict";var r=e.exports&&e.exports.__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]}),n=e.exports&&e.exports.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=e.exports&&e.exports.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&r(t,e,i);return n(t,e),t};Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.RemoteSdp=void 0;const s=i(a("6j9nc"));var o=a("ejIpo"),c=a("bVG87");const l=new o.Logger("RemoteSdp");e.exports.RemoteSdp=class{constructor({iceParameters:e,iceCandidates:t,dtlsParameters:r,sctpParameters:n,plainRtpParameters:i,planB:a=!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=a,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){l.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){l.debug("updateDtlsRole() [role:%s]",e),this._dtlsParameters.role=e;for(const t of this._mediaSections)t.setDtlsRole(e)}getNextMediaSectionIdx(){for(let e=0;e<this._mediaSections.length;++e){const t=this._mediaSections[e];if(t.closed)return{idx:e,reuseMid:t.mid}}return{idx:this._mediaSections.length}}send({offerMediaObject:e,reuseMid:t,offerRtpParameters:r,answerRtpParameters:n,codecOptions:i,extmapAllowMixed:a=!1}){const s=new c.AnswerMediaSection({iceParameters:this._iceParameters,iceCandidates:this._iceCandidates,dtlsParameters:this._dtlsParameters,plainRtpParameters:this._plainRtpParameters,planB:this._planB,offerMediaObject:e,offerRtpParameters:r,answerRtpParameters:n,codecOptions:i,extmapAllowMixed:a});t?this._replaceMediaSection(s,t):this._midToIndex.has(s.mid)?this._replaceMediaSection(s):this._addMediaSection(s)}receive({mid:e,kind:t,offerRtpParameters:r,streamId:n,trackId:i}){const a=this._midToIndex.get(e);let s;if(void 0!==a&&(s=this._mediaSections[a]),s)s.planBReceive({offerRtpParameters:r,streamId:n,trackId:i}),this._replaceMediaSection(s);else{s=new c.OfferMediaSection({iceParameters:this._iceParameters,iceCandidates:this._iceCandidates,dtlsParameters:this._dtlsParameters,plainRtpParameters:this._plainRtpParameters,planB:this._planB,mid:e,kind:t,offerRtpParameters:r,streamId:n,trackId:i});const a=this._mediaSections.find((e=>e.closed));a?this._replaceMediaSection(s,a.mid):this._addMediaSection(s)}}disableMediaSection(e){const t=this._midToIndex.get(e);if(void 0===t)throw new Error(`no media section found with mid '${e}'`);this._mediaSections[t].disable()}closeMediaSection(e){const t=this._midToIndex.get(e);if(void 0===t)throw new Error(`no media section found with mid '${e}'`);const r=this._mediaSections[t];if(e===this._firstMid)return l.debug("closeMediaSection() | cannot close first media section, disabling it instead [mid:%s]",e),void this.disableMediaSection(e);r.close(),this._regenerateBundleMids()}planBStopReceiving({mid:e,offerRtpParameters:t}){const r=this._midToIndex.get(e);if(void 0===r)throw new Error(`no media section found with mid '${e}'`);const n=this._mediaSections[r];n.planBStopReceiving({offerRtpParameters:t}),this._replaceMediaSection(n)}sendSctpAssociation({offerMediaObject:e}){const t=new c.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 c.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++,s.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()}}_regenerateBundleMids(){this._dtlsParameters&&(this._sdpObject.groups[0].mids=this._mediaSections.filter((e=>!e.closed)).map((e=>e.mid)).join(" "))}}})),a.register("bVG87",(function(e,t){"use strict";var r=e.exports&&e.exports.__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]}),n=e.exports&&e.exports.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=e.exports&&e.exports.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&r(t,e,i);return n(t,e),t};Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.OfferMediaSection=e.exports.AnswerMediaSection=e.exports.MediaSection=void 0;const s=i(a("73pkW"));class o{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}disable(){this._mediaObject.direction="inactive",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}close(){this._mediaObject.direction="inactive",this._mediaObject.port=0,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}}e.exports.MediaSection=o;e.exports.AnswerMediaSection=class extends o{constructor({iceParameters:e,iceCandidates:t,dtlsParameters:r,sctpParameters:n,plainRtpParameters:i,planB:a=!1,offerMediaObject:o,offerRtpParameters:l,answerRtpParameters:d,codecOptions:u,extmapAllowMixed:p=!1}){switch(super({iceParameters:e,iceCandidates:t,dtlsParameters:r,planB:a}),this._mediaObject.mid=String(o.mid),this._mediaObject.type=o.type,this._mediaObject.protocol=o.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),o.type){case"audio":case"video":this._mediaObject.direction="recvonly",this._mediaObject.rtp=[],this._mediaObject.rtcpFb=[],this._mediaObject.fmtp=[];for(const e of d.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,{});if(u){const{opusStereo:t,opusFec:n,opusDtx:i,opusMaxPlaybackRate:a,opusMaxAverageBitrate:s,opusPtime:o,videoGoogleStartBitrate:c,videoGoogleMaxBitrate:d,videoGoogleMinBitrate:p}=u,f=l.codecs.find((t=>t.payloadType===e.payloadType));switch(e.mimeType.toLowerCase()){case"audio/opus":void 0!==t&&(f.parameters["sprop-stereo"]=t?1:0,r.stereo=t?1:0),void 0!==n&&(f.parameters.useinbandfec=n?1:0,r.useinbandfec=n?1:0),void 0!==i&&(f.parameters.usedtx=i?1:0,r.usedtx=i?1:0),void 0!==a&&(r.maxplaybackrate=a),void 0!==s&&(r.maxaveragebitrate=s),void 0!==o&&(f.parameters.ptime=o,r.ptime=o);break;case"video/vp8":case"video/vp9":case"video/h264":case"video/h265":void 0!==c&&(r["x-google-start-bitrate"]=c),void 0!==d&&(r["x-google-max-bitrate"]=d),void 0!==p&&(r["x-google-min-bitrate"]=p)}}const n={payload:e.payloadType,config:""};for(const e of Object.keys(r))n.config&&(n.config+=";"),n.config+=`${e}=${r[e]}`;n.config&&this._mediaObject.fmtp.push(n);for(const t of e.rtcpFeedback)this._mediaObject.rtcpFb.push({payload:e.payloadType,type:t.type,subtype:t.parameter})}this._mediaObject.payloads=d.codecs.map((e=>e.payloadType)).join(" "),this._mediaObject.ext=[];for(const e of d.headerExtensions){(o.ext||[]).some((t=>t.uri===e.uri))&&this._mediaObject.ext.push({uri:e.uri,value:e.id})}if(p&&"extmap-allow-mixed"===o.extmapAllowMixed&&(this._mediaObject.extmapAllowMixed="extmap-allow-mixed"),o.simulcast){this._mediaObject.simulcast={dir1:"recv",list1:o.simulcast.list1},this._mediaObject.rids=[];for(const e of o.rids||[])"send"===e.direction&&this._mediaObject.rids.push({id:e.id,direction:"recv"})}else if(o.simulcast_03){this._mediaObject.simulcast_03={value:o.simulcast_03.value.replace(/send/g,"recv")},this._mediaObject.rids=[];for(const e of o.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 o.sctpPort?(this._mediaObject.payloads="webrtc-datachannel",this._mediaObject.sctpPort=n.port,this._mediaObject.maxMessageSize=n.maxMessageSize):o.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"}}};function c(e){const t=new RegExp("^(audio|video)/(.+)","i").exec(e.mimeType);if(!t)throw new TypeError("invalid codec.mimeType");return t[2]}e.exports.OfferMediaSection=class extends o{constructor({iceParameters:e,iceCandidates:t,dtlsParameters:r,sctpParameters:n,plainRtpParameters:i,planB:a=!1,mid:s,kind:o,offerRtpParameters:l,streamId:d,trackId:u,oldDataChannelSpec:p=!1}){switch(super({iceParameters:e,iceCandidates:t,dtlsParameters:r,planB:a}),this._mediaObject.mid=String(s),this._mediaObject.type=o,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),o){case"audio":case"video":{this._mediaObject.direction="sendonly",this._mediaObject.rtp=[],this._mediaObject.rtcpFb=[],this._mediaObject.fmtp=[],this._planB||(this._mediaObject.msid=`${d||"-"} ${u}`);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:`${d||"-"} ${u}`}),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:`${d||"-"} ${u}`}),this._mediaObject.ssrcGroups.push({semantics:"FID",ssrcs:`${t} ${r}`}));break}case"application":p?(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"}planBReceive({offerRtpParameters:e,streamId:t,trackId:r}){const n=e.encodings[0],i=n.ssrc,a=n.rtx&&n.rtx.ssrc?n.rtx.ssrc:void 0,s=this._mediaObject.payloads.split(" ");for(const t of e.codecs){if(s.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}`}),a&&(e.rtcp.cname&&this._mediaObject.ssrcs.push({id:a,attribute:"cname",value:e.rtcp.cname}),this._mediaObject.ssrcs.push({id:a,attribute:"msid",value:`${t||"-"} ${r}`}),this._mediaObject.ssrcGroups.push({semantics:"FID",ssrcs:`${i} ${a}`}))}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}`)))}}})),a.register("fT1lN",(function(e,t){"use strict";Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.parse=void 0;const r=new RegExp("^[LS]([1-9]\\d{0,1})T([1-9]\\d{0,1})");e.exports.parse=function(e){const t=r.exec(e||"");return t?{spatialLayers:Number(t[1]),temporalLayers:Number(t[2])}:{spatialLayers:1,temporalLayers:1}}})),a.register("aWt89",(function(e,t){"use strict";var r=e.exports&&e.exports.__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]}),n=e.exports&&e.exports.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=e.exports&&e.exports.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&r(t,e,i);return n(t,e),t};Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.Chrome70=void 0;const s=i(a("6j9nc"));var o=a("ejIpo");const c=i(a("73pkW")),l=i(a("bGAAX")),d=i(a("ix8yI")),u=i(a("k2kM6"));var p=a("azKWm"),f=a("dKEZw"),h=a("fT1lN");const m=new o.Logger("Chrome70"),g={OS:1024,MIS:1024};class v extends p.HandlerInterface{constructor(){super(),this._mapMidTransceiver=new Map,this._sendStream=new MediaStream,this._hasDataChannelMediaSection=!1,this._nextSendSctpStreamId=0,this._transportReady=!1}static createFactory(){return()=>new v}get name(){return"Chrome70"}close(){if(m.debug("close()"),this._pc)try{this._pc.close()}catch(e){}}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=s.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:a,iceTransportPolicy:s,additionalSettings:o,proprietaryConstraints:c,extendedRtpCapabilities:d}){m.debug("run()"),this._direction=e,this._remoteSdp=new f.RemoteSdp({iceParameters:t,iceCandidates:r,dtlsParameters:n,sctpParameters:i}),this._sendingRtpParametersByKind={audio:l.getSendingRtpParameters("audio",d),video:l.getSendingRtpParameters("video",d)},this._sendingRemoteRtpParametersByKind={audio:l.getSendingRemoteRtpParameters("audio",d),video:l.getSendingRemoteRtpParameters("video",d)},n.role&&"auto"!==n.role&&(this._forcedLocalDtlsRole="server"===n.role?"client":"server"),this._pc=new RTCPeerConnection({iceServers:a||[],iceTransportPolicy:s||"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require",sdpSemantics:"unified-plan",...o},c),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){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 a=c.clone(this._sendingRtpParametersByKind[e.kind],{});a.codecs=l.reduceCodecs(a.codecs,n);const o=c.clone(this._sendingRemoteRtpParametersByKind[e.kind],{});o.codecs=l.reduceCodecs(o.codecs,n);const p=this._remoteSdp.getNextMediaSectionIdx(),f=this._pc.addTransceiver(e,{direction:"sendonly",streams:[this._sendStream]});let g,v=await this._pc.createOffer(),y=s.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=s.parse(v.sdp),g=y.media[p.idx],u.addLegacySimulcast({offerMediaObject:g,numStreams:t.length}),v={type:"offer",sdp:s.write(y)});let w=!1;const b=(0,h.parse)((t||[{}])[0].scalabilityMode);if(t&&1===t.length&&b.spatialLayers>1&&"video/vp9"===a.codecs[0].mimeType.toLowerCase()&&(m.debug("send() | enabling legacy simulcast for VP9 SVC"),w=!0,y=s.parse(v.sdp),g=y.media[p.idx],u.addLegacySimulcast({offerMediaObject:g,numStreams:b.spatialLayers}),v={type:"offer",sdp:s.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=f.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 f.sender.setParameters(e)}const _=f.mid;if(a.mid=_,y=s.parse(this._pc.localDescription.sdp),g=y.media[p.idx],a.rtcp.cname=d.getCname({offerMediaObject:g}),a.encodings=u.getRtpEncodings({offerMediaObject:g}),t)for(let e=0;e<a.encodings.length;++e)t[e]&&Object.assign(a.encodings[e],t[e]);if(w&&(a.encodings=[a.encodings[0]]),a.encodings.length>1&&("video/vp8"===a.codecs[0].mimeType.toLowerCase()||"video/h264"===a.codecs[0].mimeType.toLowerCase()))for(const e of a.encodings)e.scalabilityMode="S1T3";this._remoteSdp.send({offerMediaObject:g,reuseMid:p.reuseMid,offerRtpParameters:a,answerRtpParameters:o,codecOptions:r});const x={type:"answer",sdp:this._remoteSdp.getSdp()};return m.debug("send() | calling pc.setRemoteDescription() [answer:%o]",x),await this._pc.setRemoteDescription(x),this._mapMidTransceiver.set(_,f),{localId:_,rtpParameters:a,rtpSender:f.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");t.sender.replaceTrack(null),this._pc.removeTrack(t.sender),this._remoteSdp.closeMediaSection(t.mid);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 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)}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)}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 a;this._assertSendDirection();const o={negotiated:!0,id:this._nextSendSctpStreamId,ordered:e,maxPacketLifeTime:t,maxRetransmitTime:t,maxRetransmits:r,protocol:i};m.debug("sendDataChannel() [options:%o]",o);const c=this._pc.createDataChannel(n,o);if(this._nextSendSctpStreamId=++this._nextSendSctpStreamId%g.MIS,!this._hasDataChannelMediaSection){const e=await this._pc.createOffer(),t=s.parse(e.sdp),r=t.media.find((e=>"application"===e.type));this._transportReady||await this._setupTransport({localDtlsRole:null!==(a=this._forcedLocalDtlsRole)&&void 0!==a?a:"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:c,sctpStreamParameters:{streamId:o.id,ordered:o.ordered,maxPacketLifeTime:o.maxPacketLifeTime,maxRetransmits:o.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 a=i.mid||String(this._mapMidTransceiver.size);n.set(e,a),this._remoteSdp.receive({mid:a,kind:r,offerRtpParameters:i,streamId: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 a=await this._pc.createAnswer();const o=s.parse(a.sdp);for(const t of e){const{trackId:e,rtpParameters:r}=t,i=n.get(e),a=o.media.find((e=>String(e.mid)===i));d.applyCodecParameters({offerRtpParameters:r,answerMediaObject:a})}a={type:"answer",sdp:s.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]",a),await this._pc.setLocalDescription(a);for(const t of e){const{trackId:e}=t,i=n.get(e),a=this._pc.getTransceivers().find((e=>e.mid===i));if(!a)throw new Error("new RTCRtpTransceiver not found");this._mapMidTransceiver.set(i,a),r.push({localId:i,track:a.receiver.track,rtpReceiver:a.receiver})}return r}async stopReceiving(e){this._assertRecvDirection(),m.debug("stopReceiving() [localId:%s]",e);const t=this._mapMidTransceiver.get(e);if(!t)throw new Error("associated RTCRtpTransceiver not found");this._remoteSdp.closeMediaSection(t.mid);const r={type:"offer",sdp:this._remoteSdp.getSdp()};m.debug("stopReceiving() | calling pc.setRemoteDescription() [offer:%o]",r),await this._pc.setRemoteDescription(r);const n=await this._pc.createAnswer();m.debug("stopReceiving() | calling pc.setLocalDescription() [answer:%o]",n),await this._pc.setLocalDescription(n),this._mapMidTransceiver.delete(e)}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:a,maxPacketLifeTime:o,maxRetransmits:c}=e,l={negotiated:!0,id:i,ordered:a,maxPacketLifeTime:o,maxRetransmitTime:o,maxRetransmits:c,protocol:r};m.debug("receiveDataChannel() [options:%o]",l);const d=this._pc.createDataChannel(t,l);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=s.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:d}}async _setupTransport({localDtlsRole:e,localSdpObject:t}){t||(t=s.parse(this._pc.localDescription.sdp));const r=d.extractDtlsParameters({sdpObject:t});r.role=e,this._remoteSdp.updateDtlsRole("client"===e?"server":"client"),await this.safeEmitAsPromise("@connect",{dtlsParameters:r}),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')}}e.exports.Chrome70=v})),a.register("5GHop",(function(e,t){"use strict";var r=e.exports&&e.exports.__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]}),n=e.exports&&e.exports.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=e.exports&&e.exports.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&r(t,e,i);return n(t,e),t};Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.Chrome67=void 0;const s=i(a("6j9nc"));var o=a("ejIpo");const c=i(a("73pkW")),l=i(a("bGAAX")),d=i(a("ix8yI")),u=i(a("ddyyN"));var p=a("azKWm"),f=a("dKEZw");const h=new o.Logger("Chrome67"),m={OS:1024,MIS:1024};class g extends p.HandlerInterface{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}static createFactory(){return()=>new g}get name(){return"Chrome67"}close(){if(h.debug("close()"),this._pc)try{this._pc.close()}catch(e){}}async getNativeRtpCapabilities(){h.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=s.parse(t.sdp);return d.extractRtpCapabilities({sdpObject:r})}catch(t){try{e.close()}catch(e){}throw t}}async getNativeSctpCapabilities(){return h.debug("getNativeSctpCapabilities()"),{numStreams:m}}run({direction:e,iceParameters:t,iceCandidates:r,dtlsParameters:n,sctpParameters:i,iceServers:a,iceTransportPolicy:s,additionalSettings:o,proprietaryConstraints:c,extendedRtpCapabilities:d}){h.debug("run()"),this._direction=e,this._remoteSdp=new f.RemoteSdp({iceParameters:t,iceCandidates:r,dtlsParameters:n,sctpParameters:i,planB:!0}),this._sendingRtpParametersByKind={audio:l.getSendingRtpParameters("audio",d),video:l.getSendingRtpParameters("video",d)},this._sendingRemoteRtpParametersByKind={audio:l.getSendingRemoteRtpParameters("audio",d),video:l.getSendingRemoteRtpParameters("video",d)},n.role&&"auto"!==n.role&&(this._forcedLocalDtlsRole="server"===n.role?"client":"server"),this._pc=new RTCPeerConnection({iceServers:a||[],iceTransportPolicy:s||"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require",sdpSemantics:"plan-b",...o},c),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){h.debug("updateIceServers()");const t=this._pc.getConfiguration();t.iceServers=e,this._pc.setConfiguration(t)}async restartIce(e){if(h.debug("restartIce()"),this._remoteSdp.updateIceParameters(e),this._transportReady)if("send"===this._direction){const e=await this._pc.createOffer({iceRestart:!0});h.debug("restartIce() | calling pc.setLocalDescription() [offer:%o]",e),await this._pc.setLocalDescription(e);const t={type:"answer",sdp:this._remoteSdp.getSdp()};h.debug("restartIce() | calling pc.setRemoteDescription() [answer:%o]",t),await this._pc.setRemoteDescription(t)}else{const e={type:"offer",sdp:this._remoteSdp.getSdp()};h.debug("restartIce() | calling pc.setRemoteDescription() [offer:%o]",e),await this._pc.setRemoteDescription(e);const t=await this._pc.createAnswer();h.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(),h.debug("send() [kind:%s, track.id:%s]",e.kind,e.id),n&&h.warn("send() | codec selection is not available in %s handler",this.name),this._sendStream.addTrack(e),this._pc.addTrack(e,this._sendStream);let a,o=await this._pc.createOffer(),p=s.parse(o.sdp);const f=c.clone(this._sendingRtpParametersByKind[e.kind],{});f.codecs=l.reduceCodecs(f.codecs);const m=c.clone(this._sendingRemoteRtpParametersByKind[e.kind],{});if(m.codecs=l.reduceCodecs(m.codecs),this._transportReady||await this._setupTransport({localDtlsRole:null!==(i=this._forcedLocalDtlsRole)&&void 0!==i?i:"client",localSdpObject:p}),"video"===e.kind&&t&&t.length>1&&(h.debug("send() | enabling simulcast"),p=s.parse(o.sdp),a=p.media.find((e=>"video"===e.type)),u.addLegacySimulcast({offerMediaObject:a,track:e,numStreams:t.length}),o={type:"offer",sdp:s.write(p)}),h.debug("send() | calling pc.setLocalDescription() [offer:%o]",o),await this._pc.setLocalDescription(o),p=s.parse(this._pc.localDescription.sdp),a=p.media.find((t=>t.type===e.kind)),f.rtcp.cname=d.getCname({offerMediaObject:a}),f.encodings=u.getRtpEncodings({offerMediaObject:a,track:e}),t)for(let e=0;e<f.encodings.length;++e)t[e]&&Object.assign(f.encodings[e],t[e]);if(f.encodings.length>1&&"video/vp8"===f.codecs[0].mimeType.toLowerCase())for(const e of f.encodings)e.scalabilityMode="S1T3";this._remoteSdp.send({offerMediaObject:a,offerRtpParameters:f,answerRtpParameters:m,codecOptions:r});const g={type:"answer",sdp:this._remoteSdp.getSdp()};h.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:f,rtpSender:y}}async stopSending(e){this._assertSendDirection(),h.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();h.debug("stopSending() | calling pc.setLocalDescription() [offer:%o]",r);try{await this._pc.setLocalDescription(r)}catch(e){if(0===this._sendStream.getTracks().length)return void h.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()};h.debug("stopSending() | calling pc.setRemoteDescription() [answer:%o]",n),await this._pc.setRemoteDescription(n)}async replaceTrack(e,t){this._assertSendDirection(),t?h.debug("replaceTrack() [localId:%s, track.id:%s]",e,t.id):h.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(),h.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(),h.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 a;this._assertSendDirection();const o={negotiated:!0,id:this._nextSendSctpStreamId,ordered:e,maxPacketLifeTime:t,maxRetransmitTime:t,maxRetransmits:r,protocol:i};h.debug("sendDataChannel() [options:%o]",o);const c=this._pc.createDataChannel(n,o);if(this._nextSendSctpStreamId=++this._nextSendSctpStreamId%m.MIS,!this._hasDataChannelMediaSection){const e=await this._pc.createOffer(),t=s.parse(e.sdp),r=t.media.find((e=>"application"===e.type));this._transportReady||await this._setupTransport({localDtlsRole:null!==(a=this._forcedLocalDtlsRole)&&void 0!==a?a:"client",localSdpObject:t}),h.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()};h.debug("sendDataChannel() | calling pc.setRemoteDescription() [answer:%o]",n),await this._pc.setRemoteDescription(n),this._hasDataChannelMediaSection=!0}return{dataChannel:c,sctpStreamParameters:{streamId:o.id,ordered:o.ordered,maxPacketLifeTime:o.maxPacketLifeTime,maxRetransmits:o.maxRetransmits}}}async receive(e){var t;this._assertRecvDirection();const r=[];for(const t of e){const{trackId:e,kind:r,rtpParameters:n}=t;h.debug("receive() [trackId:%s, kind:%s]",e,r);const i=r;this._remoteSdp.receive({mid:i,kind:r,offerRtpParameters:n,streamId:n.rtcp.cname,trackId:e})}const n={type:"offer",sdp:this._remoteSdp.getSdp()};h.debug("receive() | calling pc.setRemoteDescription() [offer:%o]",n),await this._pc.setRemoteDescription(n);let i=await this._pc.createAnswer();const a=s.parse(i.sdp);for(const t of e){const{kind:e,rtpParameters:r}=t,n=e,i=a.media.find((e=>String(e.mid)===n));d.applyCodecParameters({offerRtpParameters:r,answerMediaObject:i})}i={type:"answer",sdp:s.write(a)},this._transportReady||await this._setupTransport({localDtlsRole:null!==(t=this._forcedLocalDtlsRole)&&void 0!==t?t:"client",localSdpObject:a}),h.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,a=n,s=e,o=this._pc.getReceivers().find((e=>e.track&&e.track.id===a));if(!o)throw new Error("new RTCRtpReceiver not");this._mapRecvLocalIdInfo.set(a,{mid:s,rtpParameters:i,rtpReceiver:o}),r.push({localId:a,track:o.track,rtpReceiver:o})}return r}async stopReceiving(e){this._assertRecvDirection(),h.debug("stopReceiving() [localId:%s]",e);const{mid:t,rtpParameters:r}=this._mapRecvLocalIdInfo.get(e)||{};this._mapRecvLocalIdInfo.delete(e),this._remoteSdp.planBStopReceiving({mid:t,offerRtpParameters:r});const n={type:"offer",sdp:this._remoteSdp.getSdp()};h.debug("stopReceiving() | calling pc.setRemoteDescription() [offer:%o]",n),await this._pc.setRemoteDescription(n);const i=await this._pc.createAnswer();h.debug("stopReceiving() | calling pc.setLocalDescription() [answer:%o]",i),await this._pc.setLocalDescription(i)}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:a,maxPacketLifeTime:o,maxRetransmits:c}=e,l={negotiated:!0,id:i,ordered:a,maxPacketLifeTime:o,maxRetransmitTime:o,maxRetransmits:c,protocol:r};h.debug("receiveDataChannel() [options:%o]",l);const d=this._pc.createDataChannel(t,l);if(!this._hasDataChannelMediaSection){this._remoteSdp.receiveSctpAssociation({oldDataChannelSpec:!0});const e={type:"offer",sdp:this._remoteSdp.getSdp()};h.debug("receiveDataChannel() | calling pc.setRemoteDescription() [offer:%o]",e),await this._pc.setRemoteDescription(e);const t=await this._pc.createAnswer();if(!this._transportReady){const e=s.parse(t.sdp);await this._setupTransport({localDtlsRole:null!==(n=this._forcedLocalDtlsRole)&&void 0!==n?n:"client",localSdpObject:e})}h.debug("receiveDataChannel() | calling pc.setRemoteDescription() [answer:%o]",t),await this._pc.setLocalDescription(t),this._hasDataChannelMediaSection=!0}return{dataChannel:d}}async _setupTransport({localDtlsRole:e,localSdpObject:t}){t||(t=s.parse(this._pc.localDescription.sdp));const r=d.extractDtlsParameters({sdpObject:t});r.role=e,this._remoteSdp.updateDtlsRole("client"===e?"server":"client"),await this.safeEmitAsPromise("@connect",{dtlsParameters:r}),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')}}e.exports.Chrome67=g})),a.register("ddyyN",(function(e,t){"use strict";Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.addLegacySimulcast=e.exports.getRtpEncodings=void 0,e.exports.getRtpEncodings=function({offerMediaObject:e,track:t}){let r;const n=new Set;for(const i of e.ssrcs||[]){if("msid"!==i.attribute)continue;if(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 a=[];for(const[e,t]of i){const r={ssrc:e};t&&(r.rtx={ssrc:t}),a.push(r)}return a},e.exports.addLegacySimulcast=function({offerMediaObject:e,track:t,numStreams:r}){if(r<=1)throw new TypeError("numStreams must be greater than 1");let n,i,a;if(!(e.ssrcs||[]).find((e=>{if("msid"!==e.attribute)return!1;return e.value.split(" ")[1]===t.id&&(n=e.id,a=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 s=e.ssrcs.find((e=>"cname"===e.attribute&&e.id===n));if(!s)throw new Error(`a=ssrc line with cname information not found [track.id:${t.id}]`);const o=s.value,c=[],l=[];for(let e=0;e<r;++e)c.push(n+e),i&&l.push(i+e);e.ssrcGroups=e.ssrcGroups||[],e.ssrcs=e.ssrcs||[],e.ssrcGroups.push({semantics:"SIM",ssrcs:c.join(" ")});for(let r=0;r<c.length;++r){const n=c[r];e.ssrcs.push({id:n,attribute:"cname",value:o}),e.ssrcs.push({id:n,attribute:"msid",value:`${a} ${t.id}`})}for(let r=0;r<l.length;++r){const n=c[r],i=l[r];e.ssrcs.push({id:i,attribute:"cname",value:o}),e.ssrcs.push({id:i,attribute:"msid",value:`${a} ${t.id}`}),e.ssrcGroups.push({semantics:"FID",ssrcs:`${n} ${i}`})}}})),a.register("2XozP",(function(e,t){"use strict";var r=e.exports&&e.exports.__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]}),n=e.exports&&e.exports.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=e.exports&&e.exports.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&r(t,e,i);return n(t,e),t};Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.Chrome55=void 0;const s=i(a("6j9nc"));var o=a("ejIpo"),c=a("9Limk");const l=i(a("73pkW")),d=i(a("bGAAX")),u=i(a("ix8yI")),p=i(a("ddyyN"));var f=a("azKWm"),h=a("dKEZw");const m=new o.Logger("Chrome55"),g={OS:1024,MIS:1024};class v extends f.HandlerInterface{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}static createFactory(){return()=>new v}get name(){return"Chrome55"}close(){if(m.debug("close()"),this._pc)try{this._pc.close()}catch(e){}}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=s.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:a,iceTransportPolicy:s,additionalSettings:o,proprietaryConstraints:c,extendedRtpCapabilities:l}){m.debug("run()"),this._direction=e,this._remoteSdp=new h.RemoteSdp({iceParameters:t,iceCandidates:r,dtlsParameters:n,sctpParameters:i,planB:!0}),this._sendingRtpParametersByKind={audio:d.getSendingRtpParameters("audio",l),video:d.getSendingRtpParameters("video",l)},this._sendingRemoteRtpParametersByKind={audio:d.getSendingRemoteRtpParameters("audio",l),video:d.getSendingRemoteRtpParameters("video",l)},n.role&&"auto"!==n.role&&(this._forcedLocalDtlsRole="server"===n.role?"client":"server"),this._pc=new RTCPeerConnection({iceServers:a||[],iceTransportPolicy:s||"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require",sdpSemantics:"plan-b",...o},c),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){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 a,o=await this._pc.createOffer(),c=s.parse(o.sdp);const f=l.clone(this._sendingRtpParametersByKind[e.kind],{});f.codecs=d.reduceCodecs(f.codecs);const h=l.clone(this._sendingRemoteRtpParametersByKind[e.kind],{});if(h.codecs=d.reduceCodecs(h.codecs),this._transportReady||await this._setupTransport({localDtlsRole:null!==(i=this._forcedLocalDtlsRole)&&void 0!==i?i:"client",localSdpObject:c}),"video"===e.kind&&t&&t.length>1&&(m.debug("send() | enabling simulcast"),c=s.parse(o.sdp),a=c.media.find((e=>"video"===e.type)),p.addLegacySimulcast({offerMediaObject:a,track:e,numStreams:t.length}),o={type:"offer",sdp:s.write(c)}),m.debug("send() | calling pc.setLocalDescription() [offer:%o]",o),await this._pc.setLocalDescription(o),c=s.parse(this._pc.localDescription.sdp),a=c.media.find((t=>t.type===e.kind)),f.rtcp.cname=u.getCname({offerMediaObject:a}),f.encodings=p.getRtpEncodings({offerMediaObject:a,track:e}),t)for(let e=0;e<f.encodings.length;++e)t[e]&&Object.assign(f.encodings[e],t[e]);if(f.encodings.length>1&&"video/vp8"===f.codecs[0].mimeType.toLowerCase())for(const e of f.encodings)e.scalabilityMode="S1T3";this._remoteSdp.send({offerMediaObject:a,offerRtpParameters:f,answerRtpParameters:h,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:f}}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 replaceTrack(e,t){throw new c.UnsupportedError("not implemented")}async setMaxSpatialLayer(e,t){throw new c.UnsupportedError(" not implemented")}async setRtpEncodingParameters(e,t){throw new c.UnsupportedError("not supported")}async getSenderStats(e){throw new c.UnsupportedError("not implemented")}async sendDataChannel({ordered:e,maxPacketLifeTime:t,maxRetransmits:r,label:n,protocol:i}){var a;this._assertSendDirection();const o={negotiated:!0,id:this._nextSendSctpStreamId,ordered:e,maxPacketLifeTime:t,maxRetransmitTime:t,maxRetransmits:r,protocol:i};m.debug("sendDataChannel() [options:%o]",o);const c=this._pc.createDataChannel(n,o);if(this._nextSendSctpStreamId=++this._nextSendSctpStreamId%g.MIS,!this._hasDataChannelMediaSection){const e=await this._pc.createOffer(),t=s.parse(e.sdp),r=t.media.find((e=>"application"===e.type));this._transportReady||await this._setupTransport({localDtlsRole:null!==(a=this._forcedLocalDtlsRole)&&void 0!==a?a:"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:c,sctpStreamParameters:{streamId:o.id,ordered:o.ordered,maxPacketLifeTime:o.maxPacketLifeTime,maxRetransmits:o.maxRetransmits}}}async receive(e){var t;this._assertRecvDirection();const r=[];for(const t of e){const{trackId:e,kind:r,rtpParameters:n}=t;m.debug("receive() [trackId:%s, kind:%s]",e,r);const i=r,a=n.rtcp.cname;this._remoteSdp.receive({mid:i,kind:r,offerRtpParameters:n,streamId:a,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 a=s.parse(i.sdp);for(const t of e){const{kind:e,rtpParameters:r}=t,n=e,i=a.media.find((e=>String(e.mid)===n));u.applyCodecParameters({offerRtpParameters:r,answerMediaObject:i})}i={type:"answer",sdp:s.write(a)},this._transportReady||await this._setupTransport({localDtlsRole:null!==(t=this._forcedLocalDtlsRole)&&void 0!==t?t:"client",localSdpObject:a}),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,a=e,s=n,o=i.rtcp.cname,c=this._pc.getRemoteStreams().find((e=>e.id===o)).getTrackById(s);if(!c)throw new Error("remote track not found");this._mapRecvLocalIdInfo.set(s,{mid:a,rtpParameters:i}),r.push({localId:s,track:c})}return r}async stopReceiving(e){this._assertRecvDirection(),m.debug("stopReceiving() [localId:%s]",e);const{mid:t,rtpParameters:r}=this._mapRecvLocalIdInfo.get(e)||{};this._mapRecvLocalIdInfo.delete(e),this._remoteSdp.planBStopReceiving({mid:t,offerRtpParameters:r});const n={type:"offer",sdp:this._remoteSdp.getSdp()};m.debug("stopReceiving() | calling pc.setRemoteDescription() [offer:%o]",n),await this._pc.setRemoteDescription(n);const i=await this._pc.createAnswer();m.debug("stopReceiving() | calling pc.setLocalDescription() [answer:%o]",i),await this._pc.setLocalDescription(i)}async pauseReceiving(e){}async resumeReceiving(e){}async getReceiverStats(e){throw new c.UnsupportedError("not implemented")}async receiveDataChannel({sctpStreamParameters:e,label:t,protocol:r}){var n;this._assertRecvDirection();const{streamId:i,ordered:a,maxPacketLifeTime:o,maxRetransmits:c}=e,l={negotiated:!0,id:i,ordered:a,maxPacketLifeTime:o,maxRetransmitTime:o,maxRetransmits:c,protocol:r};m.debug("receiveDataChannel() [options:%o]",l);const d=this._pc.createDataChannel(t,l);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=s.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:d}}async _setupTransport({localDtlsRole:e,localSdpObject:t}){t||(t=s.parse(this._pc.localDescription.sdp));const r=u.extractDtlsParameters({sdpObject:t});r.role=e,this._remoteSdp.updateDtlsRole("client"===e?"server":"client"),await this.safeEmitAsPromise("@connect",{dtlsParameters:r}),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')}}e.exports.Chrome55=v})),a.register("h1HrI",(function(e,t){"use strict";var r=e.exports&&e.exports.__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]}),n=e.exports&&e.exports.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=e.exports&&e.exports.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&r(t,e,i);return n(t,e),t};Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.Firefox60=void 0;const s=i(a("6j9nc"));var o=a("ejIpo"),c=a("9Limk");const l=i(a("73pkW")),d=i(a("bGAAX")),u=i(a("ix8yI")),p=i(a("k2kM6"));var f=a("azKWm"),h=a("dKEZw");const m=new o.Logger("Firefox60"),g={OS:16,MIS:2048};class v extends f.HandlerInterface{constructor(){super(),this._mapMidTransceiver=new Map,this._sendStream=new MediaStream,this._hasDataChannelMediaSection=!1,this._nextSendSctpStreamId=0,this._transportReady=!1}static createFactory(){return()=>new v}get name(){return"Firefox60"}close(){if(m.debug("close()"),this._pc)try{this._pc.close()}catch(e){}}async getNativeRtpCapabilities(){m.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(),a=[{rid:"r0",maxBitrate:1e5},{rid:"r1",maxBitrate:5e5}];i.encodings=a,await n.sender.setParameters(i);const o=await e.createOffer();try{t.remove()}catch(e){}try{r.stop()}catch(e){}try{e.close()}catch(e){}const c=s.parse(o.sdp);return u.extractRtpCapabilities({sdpObject:c})}catch(n){try{t.remove()}catch(e){}try{r.stop()}catch(e){}try{e.close()}catch(e){}throw n}}async getNativeSctpCapabilities(){return m.debug("getNativeSctpCapabilities()"),{numStreams:g}}run({direction:e,iceParameters:t,iceCandidates:r,dtlsParameters:n,sctpParameters:i,iceServers:a,iceTransportPolicy:s,additionalSettings:o,proprietaryConstraints:c,extendedRtpCapabilities:l}){m.debug("run()"),this._direction=e,this._remoteSdp=new h.RemoteSdp({iceParameters:t,iceCandidates:r,dtlsParameters:n,sctpParameters:i}),this._sendingRtpParametersByKind={audio:d.getSendingRtpParameters("audio",l),video:d.getSendingRtpParameters("video",l)},this._sendingRemoteRtpParametersByKind={audio:d.getSendingRemoteRtpParameters("audio",l),video:d.getSendingRemoteRtpParameters("video",l)},this._pc=new RTCPeerConnection({iceServers:a||[],iceTransportPolicy:s||"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require",...o},c),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){throw new c.UnsupportedError("not supported")}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}){this._assertSendDirection(),m.debug("send() [kind:%s, track.id:%s]",e.kind,e.id),t&&(t=l.clone(t,[])).length>1&&(t.forEach(((e,t)=>{e.rid=`r${t}`})),t.reverse());const i=l.clone(this._sendingRtpParametersByKind[e.kind],{});i.codecs=d.reduceCodecs(i.codecs,n);const a=l.clone(this._sendingRemoteRtpParametersByKind[e.kind],{});a.codecs=d.reduceCodecs(a.codecs,n);const o=this._pc.addTransceiver(e,{direction:"sendonly",streams:[this._sendStream]});if(t){const e=o.sender.getParameters();e.encodings=t,await o.sender.setParameters(e)}const c=await this._pc.createOffer();let f=s.parse(c.sdp);this._transportReady||await this._setupTransport({localDtlsRole:"client",localSdpObject:f}),m.debug("send() | calling pc.setLocalDescription() [offer:%o]",c),await this._pc.setLocalDescription(c);const h=o.mid;i.mid=h,f=s.parse(this._pc.localDescription.sdp);const g=f.media[f.media.length-1];if(i.rtcp.cname=u.getCname({offerMediaObject:g}),t)if(1===t.length){const e=p.getRtpEncodings({offerMediaObject:g});Object.assign(e[0],t[0]),i.encodings=e}else i.encodings=t.reverse();else i.encodings=p.getRtpEncodings({offerMediaObject:g});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="S1T3";this._remoteSdp.send({offerMediaObject:g,offerRtpParameters:i,answerRtpParameters:a,codecOptions:r,extmapAllowMixed:!0});const v={type:"answer",sdp:this._remoteSdp.getSdp()};return m.debug("send() | calling pc.setRemoteDescription() [answer:%o]",v),await this._pc.setRemoteDescription(v),this._mapMidTransceiver.set(h,o),{localId:h,rtpParameters:i,rtpSender:o.sender}}async stopSending(e){m.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();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 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 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)}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)}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 a={negotiated:!0,id:this._nextSendSctpStreamId,ordered:e,maxPacketLifeTime:t,maxRetransmits:r,protocol:i};m.debug("sendDataChannel() [options:%o]",a);const o=this._pc.createDataChannel(n,a);if(this._nextSendSctpStreamId=++this._nextSendSctpStreamId%g.MIS,!this._hasDataChannelMediaSection){const e=await this._pc.createOffer(),t=s.parse(e.sdp),r=t.media.find((e=>"application"===e.type));this._transportReady||await this._setupTransport({localDtlsRole:"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:o,sctpStreamParameters:{streamId:a.id,ordered:a.ordered,maxPacketLifeTime:a.maxPacketLifeTime,maxRetransmits:a.maxRetransmits}}}async receive(e){this._assertRecvDirection();const t=[],r=new Map;for(const t of e){const{trackId:e,kind:n,rtpParameters:i}=t;m.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:i.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 a=s.parse(i.sdp);for(const t of e){const{trackId:e,rtpParameters:n}=t,o=r.get(e),c=a.media.find((e=>String(e.mid)===o));u.applyCodecParameters({offerRtpParameters:n,answerMediaObject:c}),i={type:"answer",sdp:s.write(a)}}this._transportReady||await this._setupTransport({localDtlsRole:"client",localSdpObject:a}),m.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),a=this._pc.getTransceivers().find((e=>e.mid===i));if(!a)throw new Error("new RTCRtpTransceiver not found");this._mapMidTransceiver.set(i,a),t.push({localId:i,track:a.receiver.track,rtpReceiver:a.receiver})}return t}async stopReceiving(e){this._assertRecvDirection(),m.debug("stopReceiving() [localId:%s]",e);const t=this._mapMidTransceiver.get(e);if(!t)throw new Error("associated RTCRtpTransceiver not found");this._remoteSdp.closeMediaSection(t.mid);const r={type:"offer",sdp:this._remoteSdp.getSdp()};m.debug("stopReceiving() | calling pc.setRemoteDescription() [offer:%o]",r),await this._pc.setRemoteDescription(r);const n=await this._pc.createAnswer();m.debug("stopReceiving() | calling pc.setLocalDescription() [answer:%o]",n),await this._pc.setLocalDescription(n),this._mapMidTransceiver.delete(e)}async pauseReceiving(e){this._assertRecvDirection();for(const t of e){m.debug("pauseReceiving() [localId:%s]",t);const e=this._mapMidTransceiver.get(t);if(!e)throw new Error("associated RTCRtpTransceiver not found");e.direction="inactive"}const t={type:"offer",sdp:this._remoteSdp.getSdp()};m.debug("pauseReceiving() | calling pc.setRemoteDescription() [offer:%o]",t),await this._pc.setRemoteDescription(t);const r=await this._pc.createAnswer();m.debug("pauseReceiving() | calling pc.setLocalDescription() [answer:%o]",r),await this._pc.setLocalDescription(r)}async resumeReceiving(e){this._assertRecvDirection();for(const t of e){m.debug("resumeReceiving() [localId:%s]",t);const e=this._mapMidTransceiver.get(t);if(!e)throw new Error("associated RTCRtpTransceiver not found");e.direction="recvonly"}const t={type:"offer",sdp:this._remoteSdp.getSdp()};m.debug("resumeReceiving() | calling pc.setRemoteDescription() [offer:%o]",t),await this._pc.setRemoteDescription(t);const r=await this._pc.createAnswer();m.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:a,maxRetransmits:o}=e,c={negotiated:!0,id:n,ordered:i,maxPacketLifeTime:a,maxRetransmits:o,protocol:r};m.debug("receiveDataChannel() [options:%o]",c);const l=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=s.parse(t.sdp);await this._setupTransport({localDtlsRole:"client",localSdpObject:e})}m.debug("receiveDataChannel() | calling pc.setRemoteDescription() [answer:%o]",t),await this._pc.setLocalDescription(t),this._hasDataChannelMediaSection=!0}return{dataChannel:l}}async _setupTransport({localDtlsRole:e,localSdpObject:t}){t||(t=s.parse(this._pc.localDescription.sdp));const r=u.extractDtlsParameters({sdpObject:t});r.role=e,this._remoteSdp.updateDtlsRole("client"===e?"server":"client"),await this.safeEmitAsPromise("@connect",{dtlsParameters:r}),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')}}e.exports.Firefox60=v})),a.register("iMWnV",(function(e,t){"use strict";var r=e.exports&&e.exports.__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]}),n=e.exports&&e.exports.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=e.exports&&e.exports.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&r(t,e,i);return n(t,e),t};Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.Safari12=void 0;const s=i(a("6j9nc"));var o=a("ejIpo");const c=i(a("73pkW")),l=i(a("bGAAX")),d=i(a("ix8yI")),u=i(a("k2kM6"));var p=a("azKWm"),f=a("dKEZw");const h=new o.Logger("Safari12"),m={OS:1024,MIS:1024};class g extends p.HandlerInterface{constructor(){super(),this._mapMidTransceiver=new Map,this._sendStream=new MediaStream,this._hasDataChannelMediaSection=!1,this._nextSendSctpStreamId=0,this._transportReady=!1}static createFactory(){return()=>new g}get name(){return"Safari12"}close(){if(h.debug("close()"),this._pc)try{this._pc.close()}catch(e){}}async getNativeRtpCapabilities(){h.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=s.parse(t.sdp);return d.extractRtpCapabilities({sdpObject:r})}catch(t){try{e.close()}catch(e){}throw t}}async getNativeSctpCapabilities(){return h.debug("getNativeSctpCapabilities()"),{numStreams:m}}run({direction:e,iceParameters:t,iceCandidates:r,dtlsParameters:n,sctpParameters:i,iceServers:a,iceTransportPolicy:s,additionalSettings:o,proprietaryConstraints:c,extendedRtpCapabilities:d}){h.debug("run()"),this._direction=e,this._remoteSdp=new f.RemoteSdp({iceParameters:t,iceCandidates:r,dtlsParameters:n,sctpParameters:i}),this._sendingRtpParametersByKind={audio:l.getSendingRtpParameters("audio",d),video:l.getSendingRtpParameters("video",d)},this._sendingRemoteRtpParametersByKind={audio:l.getSendingRemoteRtpParameters("audio",d),video:l.getSendingRemoteRtpParameters("video",d)},n.role&&"auto"!==n.role&&(this._forcedLocalDtlsRole="server"===n.role?"client":"server"),this._pc=new RTCPeerConnection({iceServers:a||[],iceTransportPolicy:s||"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require",...o},c),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){h.debug("updateIceServers()");const t=this._pc.getConfiguration();t.iceServers=e,this._pc.setConfiguration(t)}async restartIce(e){if(h.debug("restartIce()"),this._remoteSdp.updateIceParameters(e),this._transportReady)if("send"===this._direction){const e=await this._pc.createOffer({iceRestart:!0});h.debug("restartIce() | calling pc.setLocalDescription() [offer:%o]",e),await this._pc.setLocalDescription(e);const t={type:"answer",sdp:this._remoteSdp.getSdp()};h.debug("restartIce() | calling pc.setRemoteDescription() [answer:%o]",t),await this._pc.setRemoteDescription(t)}else{const e={type:"offer",sdp:this._remoteSdp.getSdp()};h.debug("restartIce() | calling pc.setRemoteDescription() [offer:%o]",e),await this._pc.setRemoteDescription(e);const t=await this._pc.createAnswer();h.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(),h.debug("send() [kind:%s, track.id:%s]",e.kind,e.id);const a=c.clone(this._sendingRtpParametersByKind[e.kind],{});a.codecs=l.reduceCodecs(a.codecs,n);const o=c.clone(this._sendingRemoteRtpParametersByKind[e.kind],{});o.codecs=l.reduceCodecs(o.codecs,n);const p=this._remoteSdp.getNextMediaSectionIdx(),f=this._pc.addTransceiver(e,{direction:"sendonly",streams:[this._sendStream]});let m,g=await this._pc.createOffer(),v=s.parse(g.sdp);this._transportReady||await this._setupTransport({localDtlsRole:null!==(i=this._forcedLocalDtlsRole)&&void 0!==i?i:"client",localSdpObject:v}),t&&t.length>1&&(h.debug("send() | enabling legacy simulcast"),v=s.parse(g.sdp),m=v.media[p.idx],u.addLegacySimulcast({offerMediaObject:m,numStreams:t.length}),g={type:"offer",sdp:s.write(v)}),h.debug("send() | calling pc.setLocalDescription() [offer:%o]",g),await this._pc.setLocalDescription(g);const y=f.mid;if(a.mid=y,v=s.parse(this._pc.localDescription.sdp),m=v.media[p.idx],a.rtcp.cname=d.getCname({offerMediaObject:m}),a.encodings=u.getRtpEncodings({offerMediaObject:m}),t)for(let e=0;e<a.encodings.length;++e)t[e]&&Object.assign(a.encodings[e],t[e]);if(a.encodings.length>1&&("video/vp8"===a.codecs[0].mimeType.toLowerCase()||"video/h264"===a.codecs[0].mimeType.toLowerCase()))for(const e of a.encodings)e.scalabilityMode="S1T3";this._remoteSdp.send({offerMediaObject:m,reuseMid:p.reuseMid,offerRtpParameters:a,answerRtpParameters:o,codecOptions:r});const w={type:"answer",sdp:this._remoteSdp.getSdp()};return h.debug("send() | calling pc.setRemoteDescription() [answer:%o]",w),await this._pc.setRemoteDescription(w),this._mapMidTransceiver.set(y,f),{localId:y,rtpParameters:a,rtpSender:f.sender}}async stopSending(e){this._assertSendDirection(),h.debug("stopSending() [localId:%s]",e);const t=this._mapMidTransceiver.get(e);if(!t)throw new Error("associated RTCRtpTransceiver not found");t.sender.replaceTrack(null),this._pc.removeTrack(t.sender),this._remoteSdp.closeMediaSection(t.mid);const r=await this._pc.createOffer();h.debug("stopSending() | calling pc.setLocalDescription() [offer:%o]",r),await this._pc.setLocalDescription(r);const n={type:"answer",sdp:this._remoteSdp.getSdp()};h.debug("stopSending() | calling pc.setRemoteDescription() [answer:%o]",n),await this._pc.setRemoteDescription(n),this._mapMidTransceiver.delete(e)}async replaceTrack(e,t){this._assertSendDirection(),t?h.debug("replaceTrack() [localId:%s, track.id:%s]",e,t.id):h.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(),h.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)}async setRtpEncodingParameters(e,t){this._assertSendDirection(),h.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)}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 a;this._assertSendDirection();const o={negotiated:!0,id:this._nextSendSctpStreamId,ordered:e,maxPacketLifeTime:t,maxRetransmits:r,protocol:i};h.debug("sendDataChannel() [options:%o]",o);const c=this._pc.createDataChannel(n,o);if(this._nextSendSctpStreamId=++this._nextSendSctpStreamId%m.MIS,!this._hasDataChannelMediaSection){const e=await this._pc.createOffer(),t=s.parse(e.sdp),r=t.media.find((e=>"application"===e.type));this._transportReady||await this._setupTransport({localDtlsRole:null!==(a=this._forcedLocalDtlsRole)&&void 0!==a?a:"client",localSdpObject:t}),h.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()};h.debug("sendDataChannel() | calling pc.setRemoteDescription() [answer:%o]",n),await this._pc.setRemoteDescription(n),this._hasDataChannelMediaSection=!0}return{dataChannel:c,sctpStreamParameters:{streamId:o.id,ordered:o.ordered,maxPacketLifeTime:o.maxPacketLifeTime,maxRetransmits:o.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;h.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:i.rtcp.cname,trackId:e})}const i={type:"offer",sdp:this._remoteSdp.getSdp()};h.debug("receive() | calling pc.setRemoteDescription() [offer:%o]",i),await this._pc.setRemoteDescription(i);let a=await this._pc.createAnswer();const o=s.parse(a.sdp);for(const t of e){const{trackId:e,rtpParameters:r}=t,i=n.get(e),a=o.media.find((e=>String(e.mid)===i));d.applyCodecParameters({offerRtpParameters:r,answerMediaObject:a})}a={type:"answer",sdp:s.write(o)},this._transportReady||await this._setupTransport({localDtlsRole:null!==(t=this._forcedLocalDtlsRole)&&void 0!==t?t:"client",localSdpObject:o}),h.debug("receive() | calling pc.setLocalDescription() [answer:%o]",a),await this._pc.setLocalDescription(a);for(const t of e){const{trackId:e}=t,i=n.get(e),a=this._pc.getTransceivers().find((e=>e.mid===i));if(!a)throw new Error("new RTCRtpTransceiver not found");this._mapMidTransceiver.set(i,a),r.push({localId:i,track:a.receiver.track,rtpReceiver:a.receiver})}return r}async stopReceiving(e){this._assertRecvDirection(),h.debug("stopReceiving() [localId:%s]",e);const t=this._mapMidTransceiver.get(e);if(!t)throw new Error("associated RTCRtpTransceiver not found");this._remoteSdp.closeMediaSection(t.mid);const r={type:"offer",sdp:this._remoteSdp.getSdp()};h.debug("stopReceiving() | calling pc.setRemoteDescription() [offer:%o]",r),await this._pc.setRemoteDescription(r);const n=await this._pc.createAnswer();h.debug("stopReceiving() | calling pc.setLocalDescription() [answer:%o]",n),await this._pc.setLocalDescription(n),this._mapMidTransceiver.delete(e)}async pauseReceiving(e){this._assertRecvDirection();for(const t of e){h.debug("pauseReceiving() [localId:%s]",t);const e=this._mapMidTransceiver.get(t);if(!e)throw new Error("associated RTCRtpTransceiver not found");e.direction="inactive"}const t={type:"offer",sdp:this._remoteSdp.getSdp()};h.debug("pauseReceiving() | calling pc.setRemoteDescription() [offer:%o]",t),await this._pc.setRemoteDescription(t);const r=await this._pc.createAnswer();h.debug("pauseReceiving() | calling pc.setLocalDescription() [answer:%o]",r),await this._pc.setLocalDescription(r)}async resumeReceiving(e){this._assertRecvDirection();for(const t of e){h.debug("resumeReceiving() [localId:%s]",t);const e=this._mapMidTransceiver.get(t);if(!e)throw new Error("associated RTCRtpTransceiver not found");e.direction="recvonly"}const t={type:"offer",sdp:this._remoteSdp.getSdp()};h.debug("resumeReceiving() | calling pc.setRemoteDescription() [offer:%o]",t),await this._pc.setRemoteDescription(t);const r=await this._pc.createAnswer();h.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:a,maxPacketLifeTime:o,maxRetransmits:c}=e,l={negotiated:!0,id:i,ordered:a,maxPacketLifeTime:o,maxRetransmits:c,protocol:r};h.debug("receiveDataChannel() [options:%o]",l);const d=this._pc.createDataChannel(t,l);if(!this._hasDataChannelMediaSection){this._remoteSdp.receiveSctpAssociation();const e={type:"offer",sdp:this._remoteSdp.getSdp()};h.debug("receiveDataChannel() | calling pc.setRemoteDescription() [offer:%o]",e),await this._pc.setRemoteDescription(e);const t=await this._pc.createAnswer();if(!this._transportReady){const e=s.parse(t.sdp);await this._setupTransport({localDtlsRole:null!==(n=this._forcedLocalDtlsRole)&&void 0!==n?n:"client",localSdpObject:e})}h.debug("receiveDataChannel() | calling pc.setRemoteDescription() [answer:%o]",t),await this._pc.setLocalDescription(t),this._hasDataChannelMediaSection=!0}return{dataChannel:d}}async _setupTransport({localDtlsRole:e,localSdpObject:t}){t||(t=s.parse(this._pc.localDescription.sdp));const r=d.extractDtlsParameters({sdpObject:t});r.role=e,this._remoteSdp.updateDtlsRole("client"===e?"server":"client"),await this.safeEmitAsPromise("@connect",{dtlsParameters:r}),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')}}e.exports.Safari12=g})),a.register("aZkX5",(function(e,t){"use strict";var r=e.exports&&e.exports.__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]}),n=e.exports&&e.exports.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=e.exports&&e.exports.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&r(t,e,i);return n(t,e),t};Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.Safari11=void 0;const s=i(a("6j9nc"));var o=a("ejIpo");const c=i(a("73pkW")),l=i(a("bGAAX")),d=i(a("ix8yI")),u=i(a("ddyyN"));var p=a("azKWm"),f=a("dKEZw");const h=new o.Logger("Safari11"),m={OS:1024,MIS:1024};class g extends p.HandlerInterface{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}static createFactory(){return()=>new g}get name(){return"Safari11"}close(){if(h.debug("close()"),this._pc)try{this._pc.close()}catch(e){}}async getNativeRtpCapabilities(){h.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=s.parse(t.sdp);return d.extractRtpCapabilities({sdpObject:r})}catch(t){try{e.close()}catch(e){}throw t}}async getNativeSctpCapabilities(){return h.debug("getNativeSctpCapabilities()"),{numStreams:m}}run({direction:e,iceParameters:t,iceCandidates:r,dtlsParameters:n,sctpParameters:i,iceServers:a,iceTransportPolicy:s,additionalSettings:o,proprietaryConstraints:c,extendedRtpCapabilities:d}){h.debug("run()"),this._direction=e,this._remoteSdp=new f.RemoteSdp({iceParameters:t,iceCandidates:r,dtlsParameters:n,sctpParameters:i,planB:!0}),this._sendingRtpParametersByKind={audio:l.getSendingRtpParameters("audio",d),video:l.getSendingRtpParameters("video",d)},this._sendingRemoteRtpParametersByKind={audio:l.getSendingRemoteRtpParameters("audio",d),video:l.getSendingRemoteRtpParameters("video",d)},n.role&&"auto"!==n.role&&(this._forcedLocalDtlsRole="server"===n.role?"client":"server"),this._pc=new RTCPeerConnection({iceServers:a||[],iceTransportPolicy:s||"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require",...o},c),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){h.debug("updateIceServers()");const t=this._pc.getConfiguration();t.iceServers=e,this._pc.setConfiguration(t)}async restartIce(e){if(h.debug("restartIce()"),this._remoteSdp.updateIceParameters(e),this._transportReady)if("send"===this._direction){const e=await this._pc.createOffer({iceRestart:!0});h.debug("restartIce() | calling pc.setLocalDescription() [offer:%o]",e),await this._pc.setLocalDescription(e);const t={type:"answer",sdp:this._remoteSdp.getSdp()};h.debug("restartIce() | calling pc.setRemoteDescription() [answer:%o]",t),await this._pc.setRemoteDescription(t)}else{const e={type:"offer",sdp:this._remoteSdp.getSdp()};h.debug("restartIce() | calling pc.setRemoteDescription() [offer:%o]",e),await this._pc.setRemoteDescription(e);const t=await this._pc.createAnswer();h.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(),h.debug("send() [kind:%s, track.id:%s]",e.kind,e.id),n&&h.warn("send() | codec selection is not available in %s handler",this.name),this._sendStream.addTrack(e),this._pc.addTrack(e,this._sendStream);let a,o=await this._pc.createOffer(),p=s.parse(o.sdp);const f=c.clone(this._sendingRtpParametersByKind[e.kind],{});f.codecs=l.reduceCodecs(f.codecs);const m=c.clone(this._sendingRemoteRtpParametersByKind[e.kind],{});if(m.codecs=l.reduceCodecs(m.codecs),this._transportReady||await this._setupTransport({localDtlsRole:null!==(i=this._forcedLocalDtlsRole)&&void 0!==i?i:"client",localSdpObject:p}),"video"===e.kind&&t&&t.length>1&&(h.debug("send() | enabling simulcast"),p=s.parse(o.sdp),a=p.media.find((e=>"video"===e.type)),u.addLegacySimulcast({offerMediaObject:a,track:e,numStreams:t.length}),o={type:"offer",sdp:s.write(p)}),h.debug("send() | calling pc.setLocalDescription() [offer:%o]",o),await this._pc.setLocalDescription(o),p=s.parse(this._pc.localDescription.sdp),a=p.media.find((t=>t.type===e.kind)),f.rtcp.cname=d.getCname({offerMediaObject:a}),f.encodings=u.getRtpEncodings({offerMediaObject:a,track:e}),t)for(let e=0;e<f.encodings.length;++e)t[e]&&Object.assign(f.encodings[e],t[e]);if(f.encodings.length>1&&"video/vp8"===f.codecs[0].mimeType.toLowerCase())for(const e of f.encodings)e.scalabilityMode="S1T3";this._remoteSdp.send({offerMediaObject:a,offerRtpParameters:f,answerRtpParameters:m,codecOptions:r});const g={type:"answer",sdp:this._remoteSdp.getSdp()};h.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:f,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();h.debug("stopSending() | calling pc.setLocalDescription() [offer:%o]",r);try{await this._pc.setLocalDescription(r)}catch(e){if(0===this._sendStream.getTracks().length)return void h.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()};h.debug("stopSending() | calling pc.setRemoteDescription() [answer:%o]",n),await this._pc.setRemoteDescription(n)}async replaceTrack(e,t){this._assertSendDirection(),t?h.debug("replaceTrack() [localId:%s, track.id:%s]",e,t.id):h.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(),h.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(),h.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 a;this._assertSendDirection();const o={negotiated:!0,id:this._nextSendSctpStreamId,ordered:e,maxPacketLifeTime:t,maxRetransmits:r,protocol:i};h.debug("sendDataChannel() [options:%o]",o);const c=this._pc.createDataChannel(n,o);if(this._nextSendSctpStreamId=++this._nextSendSctpStreamId%m.MIS,!this._hasDataChannelMediaSection){const e=await this._pc.createOffer(),t=s.parse(e.sdp),r=t.media.find((e=>"application"===e.type));this._transportReady||await this._setupTransport({localDtlsRole:null!==(a=this._forcedLocalDtlsRole)&&void 0!==a?a:"client",localSdpObject:t}),h.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()};h.debug("sendDataChannel() | calling pc.setRemoteDescription() [answer:%o]",n),await this._pc.setRemoteDescription(n),this._hasDataChannelMediaSection=!0}return{dataChannel:c,sctpStreamParameters:{streamId:o.id,ordered:o.ordered,maxPacketLifeTime:o.maxPacketLifeTime,maxRetransmits:o.maxRetransmits}}}async receive(e){var t;this._assertRecvDirection();const r=[];for(const t of e){const{trackId:e,kind:r,rtpParameters:n}=t;h.debug("receive() [trackId:%s, kind:%s]",e,r);const i=r;this._remoteSdp.receive({mid:i,kind:r,offerRtpParameters:n,streamId:n.rtcp.cname,trackId:e})}const n={type:"offer",sdp:this._remoteSdp.getSdp()};h.debug("receive() | calling pc.setRemoteDescription() [offer:%o]",n),await this._pc.setRemoteDescription(n);let i=await this._pc.createAnswer();const a=s.parse(i.sdp);for(const t of e){const{kind:e,rtpParameters:r}=t,n=e,i=a.media.find((e=>String(e.mid)===n));d.applyCodecParameters({offerRtpParameters:r,answerMediaObject:i})}i={type:"answer",sdp:s.write(a)},this._transportReady||await this._setupTransport({localDtlsRole:null!==(t=this._forcedLocalDtlsRole)&&void 0!==t?t:"client",localSdpObject:a}),h.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,a=e,s=n,o=this._pc.getReceivers().find((e=>e.track&&e.track.id===s));if(!o)throw new Error("new RTCRtpReceiver not");this._mapRecvLocalIdInfo.set(s,{mid:a,rtpParameters:i,rtpReceiver:o}),r.push({localId:s,track:o.track,rtpReceiver:o})}return r}async stopReceiving(e){this._assertRecvDirection(),h.debug("stopReceiving() [localId:%s]",e);const{mid:t,rtpParameters:r}=this._mapRecvLocalIdInfo.get(e)||{};this._mapRecvLocalIdInfo.delete(e),this._remoteSdp.planBStopReceiving({mid:t,offerRtpParameters:r});const n={type:"offer",sdp:this._remoteSdp.getSdp()};h.debug("stopReceiving() | calling pc.setRemoteDescription() [offer:%o]",n),await this._pc.setRemoteDescription(n);const i=await this._pc.createAnswer();h.debug("stopReceiving() | calling pc.setLocalDescription() [answer:%o]",i),await this._pc.setLocalDescription(i)}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:a,maxPacketLifeTime:o,maxRetransmits:c}=e,l={negotiated:!0,id:i,ordered:a,maxPacketLifeTime:o,maxRetransmits:c,protocol:r};h.debug("receiveDataChannel() [options:%o]",l);const d=this._pc.createDataChannel(t,l);if(!this._hasDataChannelMediaSection){this._remoteSdp.receiveSctpAssociation({oldDataChannelSpec:!0});const e={type:"offer",sdp:this._remoteSdp.getSdp()};h.debug("receiveDataChannel() | calling pc.setRemoteDescription() [offer:%o]",e),await this._pc.setRemoteDescription(e);const t=await this._pc.createAnswer();if(!this._transportReady){const e=s.parse(t.sdp);await this._setupTransport({localDtlsRole:null!==(n=this._forcedLocalDtlsRole)&&void 0!==n?n:"client",localSdpObject:e})}h.debug("receiveDataChannel() | calling pc.setRemoteDescription() [answer:%o]",t),await this._pc.setLocalDescription(t),this._hasDataChannelMediaSection=!0}return{dataChannel:d}}async _setupTransport({localDtlsRole:e,localSdpObject:t}){t||(t=s.parse(this._pc.localDescription.sdp));const r=d.extractDtlsParameters({sdpObject:t});r.role=e,this._remoteSdp.updateDtlsRole("client"===e?"server":"client"),await this.safeEmitAsPromise("@connect",{dtlsParameters:r}),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')}}e.exports.Safari11=g})),a.register("3Snak",(function(e,t){"use strict";var r=e.exports&&e.exports.__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]}),n=e.exports&&e.exports.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=e.exports&&e.exports.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&r(t,e,i);return n(t,e),t};Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.Edge11=void 0;var s=a("ejIpo"),o=a("9Limk");const c=i(a("73pkW")),l=i(a("bGAAX")),d=i(a("9h9gT"));var u=a("azKWm");const p=new s.Logger("Edge11");class f extends u.HandlerInterface{constructor(){super(),this._rtpSenders=new Map,this._rtpReceivers=new Map,this._nextSendLocalId=0,this._transportReady=!1}static createFactory(){return()=>new f}get name(){return"Edge11"}close(){p.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){}}async getNativeRtpCapabilities(){return p.debug("getNativeRtpCapabilities()"),d.getCapabilities()}async getNativeSctpCapabilities(){return p.debug("getNativeSctpCapabilities()"),{numStreams:{OS:0,MIS:0}}}run({direction:e,iceParameters:t,iceCandidates:r,dtlsParameters:n,sctpParameters:i,iceServers:a,iceTransportPolicy:s,additionalSettings:o,proprietaryConstraints:d,extendedRtpCapabilities:u}){p.debug("run()"),this._sendingRtpParametersByKind={audio:l.getSendingRtpParameters("audio",u),video:l.getSendingRtpParameters("video",u)},this._remoteIceParameters=t,this._remoteIceCandidates=r,this._remoteDtlsParameters=n,this._cname=`CNAME-${c.generateRandomNumber()}`,this._setIceGatherer({iceServers:a,iceTransportPolicy:s}),this._setIceTransport(),this._setDtlsTransport()}async updateIceServers(e){throw new o.UnsupportedError("not supported")}async restartIce(e){if(p.debug("restartIce()"),this._remoteIceParameters=e,this._transportReady){p.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}){p.debug("send() [kind:%s, track.id:%s]",e.kind,e.id),this._transportReady||await this._setupTransport({localDtlsRole:"server"}),p.debug("send() | calling new RTCRtpSender()");const i=new RTCRtpSender(e,this._dtlsTransport),a=c.clone(this._sendingRtpParametersByKind[e.kind],{});a.codecs=l.reduceCodecs(a.codecs,n);const s=a.codecs.some((e=>/.+\/rtx$/i.test(e.mimeType)));t||(t=[{}]);for(const e of t)e.ssrc=c.generateRandomNumber(),s&&(e.rtx={ssrc:c.generateRandomNumber()});a.encodings=t,a.rtcp={cname:this._cname,reducedSize:!0,mux:!0};const o=d.mangleRtpParameters(a);p.debug("send() | calling rtpSender.send() [params:%o]",o),await i.send(o);const u=String(this._nextSendLocalId);return this._nextSendLocalId++,this._rtpSenders.set(u,i),{localId:u,rtpParameters:a,rtpSender:i}}async stopSending(e){p.debug("stopSending() [localId:%s]",e);const t=this._rtpSenders.get(e);if(!t)throw new Error("RTCRtpSender not found");this._rtpSenders.delete(e);try{p.debug("stopSending() | calling rtpSender.stop()"),t.stop()}catch(e){throw p.warn("stopSending() | rtpSender.stop() failed:%o",e),e}}async replaceTrack(e,t){t?p.debug("replaceTrack() [localId:%s, track.id:%s]",e,t.id):p.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){p.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){p.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 o.UnsupportedError("not implemented")}async receive(e){const t=[];for(const t of e){const{trackId:e,kind:r}=t;p.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;p.debug("receive() | calling new RTCRtpReceiver()");const a=new RTCRtpReceiver(this._dtlsTransport,n);a.addEventListener("error",(e=>{p.error('rtpReceiver "error" event [event:%o]',e)}));const s=d.mangleRtpParameters(i);p.debug("receive() | calling rtpReceiver.receive() [params:%o]",s),await a.receive(s);const o=e;this._rtpReceivers.set(o,a),t.push({localId:o,track:a.track,rtpReceiver:a})}return t}async stopReceiving(e){p.debug("stopReceiving() [localId:%s]",e);const t=this._rtpReceivers.get(e);if(!t)throw new Error("RTCRtpReceiver not found");this._rtpReceivers.delete(e);try{p.debug("stopReceiving() | calling rtpReceiver.stop()"),t.stop()}catch(e){p.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 o.UnsupportedError("not implemented")}_setIceGatherer({iceServers:e,iceTransportPolicy:t}){const r=new RTCIceGatherer({iceServers:e||[],gatherPolicy:t||"all"});r.addEventListener("error",(e=>{p.error('iceGatherer "error" event [event:%o]',e)}));try{r.gather()}catch(e){p.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=>{p.debug('iceTransport "candidatepairchange" event [pair:%o]',e.pair)})),this._iceTransport=e}_setDtlsTransport(){const e=new RTCDtlsTransport(this._iceTransport);e.addEventListener("statechange",(()=>{p.debug('dtlsTransport "statechange" event [state:%s]',e.state)})),e.addEventListener("dtlsstatechange",(()=>{p.debug('dtlsTransport "dtlsstatechange" event [state:%s]',e.state),"closed"===e.state&&this.emit("@connectionstatechange","closed")})),e.addEventListener("error",(e=>{p.error('dtlsTransport "error" event [event:%o]',e)})),this._dtlsTransport=e}async _setupTransport({localDtlsRole:e}){p.debug("_setupTransport()");const t=this._dtlsTransport.getLocalParameters();t.role=e,await this.safeEmitAsPromise("@connect",{dtlsParameters:t}),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}}e.exports.Edge11=f})),a.register("9h9gT",(function(e,t){"use strict";var r=e.exports&&e.exports.__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]}),n=e.exports&&e.exports.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=e.exports&&e.exports.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&r(t,e,i);return n(t,e),t};Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.mangleRtpParameters=e.exports.getCapabilities=void 0;const s=i(a("73pkW"));e.exports.getCapabilities=function(){const e=RTCRtpReceiver.getCapabilities(),t=s.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},e.exports.mangleRtpParameters=function(e){const t=s.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}})),a.register("azCHp",(function(e,t){"use strict";var r=e.exports&&e.exports.__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]}),n=e.exports&&e.exports.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=e.exports&&e.exports.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&r(t,e,i);return n(t,e),t};Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.ReactNative=void 0;const s=i(a("6j9nc"));var o=a("ejIpo"),c=a("9Limk");const l=i(a("73pkW")),d=i(a("bGAAX")),u=i(a("ix8yI")),p=i(a("ddyyN"));var f=a("azKWm"),h=a("dKEZw");const m=new o.Logger("ReactNative"),g={OS:1024,MIS:1024};class v extends f.HandlerInterface{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}static createFactory(){return()=>new v}get name(){return"ReactNative"}close(){if(m.debug("close()"),this._sendStream.release(!1),this._pc)try{this._pc.close()}catch(e){}}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=s.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:a,iceTransportPolicy:s,additionalSettings:o,proprietaryConstraints:c,extendedRtpCapabilities:l}){m.debug("run()"),this._direction=e,this._remoteSdp=new h.RemoteSdp({iceParameters:t,iceCandidates:r,dtlsParameters:n,sctpParameters:i,planB:!0}),this._sendingRtpParametersByKind={audio:d.getSendingRtpParameters("audio",l),video:d.getSendingRtpParameters("video",l)},this._sendingRemoteRtpParametersByKind={audio:d.getSendingRemoteRtpParameters("audio",l),video:d.getSendingRemoteRtpParameters("video",l)},n.role&&"auto"!==n.role&&(this._forcedLocalDtlsRole="server"===n.role?"client":"server"),this._pc=new RTCPeerConnection({iceServers:a||[],iceTransportPolicy:s||"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require",sdpSemantics:"plan-b",...o},c),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){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 a,o=await this._pc.createOffer(),c=s.parse(o.sdp);const f=l.clone(this._sendingRtpParametersByKind[e.kind],{});f.codecs=d.reduceCodecs(f.codecs);const h=l.clone(this._sendingRemoteRtpParametersByKind[e.kind],{});if(h.codecs=d.reduceCodecs(h.codecs),this._transportReady||await this._setupTransport({localDtlsRole:null!==(i=this._forcedLocalDtlsRole)&&void 0!==i?i:"client",localSdpObject:c}),"video"===e.kind&&t&&t.length>1&&(m.debug("send() | enabling simulcast"),c=s.parse(o.sdp),a=c.media.find((e=>"video"===e.type)),p.addLegacySimulcast({offerMediaObject:a,track:e,numStreams:t.length}),o={type:"offer",sdp:s.write(c)}),m.debug("send() | calling pc.setLocalDescription() [offer:%o]",o),await this._pc.setLocalDescription(o),c=s.parse(this._pc.localDescription.sdp),a=c.media.find((t=>t.type===e.kind)),f.rtcp.cname=u.getCname({offerMediaObject:a}),f.encodings=p.getRtpEncodings({offerMediaObject:a,track:e}),t)for(let e=0;e<f.encodings.length;++e)t[e]&&Object.assign(f.encodings[e],t[e]);if(f.encodings.length>1&&("video/vp8"===f.codecs[0].mimeType.toLowerCase()||"video/h264"===f.codecs[0].mimeType.toLowerCase()))for(const e of f.encodings)e.scalabilityMode="S1T3";this._remoteSdp.send({offerMediaObject:a,offerRtpParameters:f,answerRtpParameters:h,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:f}}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 replaceTrack(e,t){throw new c.UnsupportedError("not implemented")}async setMaxSpatialLayer(e,t){throw new c.UnsupportedError("not implemented")}async setRtpEncodingParameters(e,t){throw new c.UnsupportedError("not implemented")}async getSenderStats(e){throw new c.UnsupportedError("not implemented")}async sendDataChannel({ordered:e,maxPacketLifeTime:t,maxRetransmits:r,label:n,protocol:i}){var a;this._assertSendDirection();const o={negotiated:!0,id:this._nextSendSctpStreamId,ordered:e,maxPacketLifeTime:t,maxRetransmitTime:t,maxRetransmits:r,protocol:i};m.debug("sendDataChannel() [options:%o]",o);const c=this._pc.createDataChannel(n,o);if(this._nextSendSctpStreamId=++this._nextSendSctpStreamId%g.MIS,!this._hasDataChannelMediaSection){const e=await this._pc.createOffer(),t=s.parse(e.sdp),r=t.media.find((e=>"application"===e.type));this._transportReady||await this._setupTransport({localDtlsRole:null!==(a=this._forcedLocalDtlsRole)&&void 0!==a?a:"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:c,sctpStreamParameters:{streamId:o.id,ordered:o.ordered,maxPacketLifeTime:o.maxPacketLifeTime,maxRetransmits:o.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 a=r;let s=i.rtcp.cname;m.debug("receive() | forcing a random remote streamId to avoid well known bug in react-native-webrtc"),s+=`-hack-${l.generateRandomNumber()}`,n.set(e,s),this._remoteSdp.receive({mid:a,kind:r,offerRtpParameters:i,streamId:s,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 a=await this._pc.createAnswer();const o=s.parse(a.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})}a={type:"answer",sdp:s.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]",a),await this._pc.setLocalDescription(a);for(const t of e){const{kind:e,trackId:i,rtpParameters:a}=t,s=i,o=e,c=n.get(i),l=this._pc.getRemoteStreams().find((e=>e.id===c)).getTrackById(s);if(!l)throw new Error("remote track not found");this._mapRecvLocalIdInfo.set(s,{mid:o,rtpParameters:a}),r.push({localId:s,track:l})}return r}async stopReceiving(e){this._assertRecvDirection(),m.debug("stopReceiving() [localId:%s]",e);const{mid:t,rtpParameters:r}=this._mapRecvLocalIdInfo.get(e)||{};this._mapRecvLocalIdInfo.delete(e),this._remoteSdp.planBStopReceiving({mid:t,offerRtpParameters:r});const n={type:"offer",sdp:this._remoteSdp.getSdp()};m.debug("stopReceiving() | calling pc.setRemoteDescription() [offer:%o]",n),await this._pc.setRemoteDescription(n);const i=await this._pc.createAnswer();m.debug("stopReceiving() | calling pc.setLocalDescription() [answer:%o]",i),await this._pc.setLocalDescription(i)}async pauseReceiving(e){}async resumeReceiving(e){}async getReceiverStats(e){throw new c.UnsupportedError("not implemented")}async receiveDataChannel({sctpStreamParameters:e,label:t,protocol:r}){var n;this._assertRecvDirection();const{streamId:i,ordered:a,maxPacketLifeTime:o,maxRetransmits:c}=e,l={negotiated:!0,id:i,ordered:a,maxPacketLifeTime:o,maxRetransmitTime:o,maxRetransmits:c,protocol:r};m.debug("receiveDataChannel() [options:%o]",l);const d=this._pc.createDataChannel(t,l);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=s.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:d}}async _setupTransport({localDtlsRole:e,localSdpObject:t}){t||(t=s.parse(this._pc.localDescription.sdp));const r=u.extractDtlsParameters({sdpObject:t});r.role=e,this._remoteSdp.updateDtlsRole("client"===e?"server":"client"),await this.safeEmitAsPromise("@connect",{dtlsParameters:r}),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')}}e.exports.ReactNative=v})),a.register("cQumC",(function(e,t){"use strict";var r=e.exports&&e.exports.__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]}),n=e.exports&&e.exports.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(e.exports,"__esModule",{value:!0}),n(a("1ZHQC"),e.exports),n(a("3avKh"),e.exports),n(a("eEB2e"),e.exports),n(a("4Ad83"),e.exports),n(a("dU6XI"),e.exports),n(a("4Y5zE"),e.exports),n(a("jmm79"),e.exports),n(a("bVg2H"),e.exports),n(a("azKWm"),e.exports),n(a("9Limk"),e.exports)})),a.register("jmm79",(function(e,t){"use strict";Object.defineProperty(e.exports,"__esModule",{value:!0})})),a.register("bVg2H",(function(e,t){"use strict";Object.defineProperty(e.exports,"__esModule",{value:!0})})),a.register("hLvaX",(function(t,r){e(t.exports,"isNodeEnv",(()=>s),(e=>s=e)),e(t.exports,"dynamicRequire",(()=>o),(e=>o=e));var n=a("3lM4a"),i=a("ePtPP");function s(){return!(0,n.isBrowserBundle)()&&"[object process]"===Object.prototype.toString.call(void 0!==i?i:0)}function o(e,t){return e.require(t)}})),a.register("3lM4a",(function(t,r){function n(){return"undefined"!=typeof __SENTRY_BROWSER_BUNDLE__&&!!__SENTRY_BROWSER_BUNDLE__}e(t.exports,"isBrowserBundle",(()=>n))})),a.register("gTODe",(function(t,r){e(t.exports,"dateTimestampInSeconds",(()=>l),(e=>l=e)),e(t.exports,"timestampInSeconds",(()=>d),(e=>d=e));var n=a("bWPEY"),i=a("hLvaX"),s={nowSeconds:()=>Date.now()/1e3};var o=(0,i.isNodeEnv)()?function(){try{return(0,i.dynamicRequire)(t,"perf_hooks").performance}catch(e){return}}():function(){const{performance:e}=(0,n.getGlobalObject)();if(e&&e.now)return{now:()=>e.now(),timeOrigin:Date.now()-e.now()}}(),c=void 0===o?s:{nowSeconds:()=>(o.timeOrigin+o.now())/1e3},l=s.nowSeconds.bind(s),d=c.nowSeconds.bind(c);let u;(()=>{const{performance:e}=(0,n.getGlobalObject)();if(e&&e.now){var t=36e5,r=e.now(),i=Date.now(),a=e.timeOrigin?Math.abs(e.timeOrigin+r-i):t,s=a<t,o=e.timing&&e.timing.navigationStart,c="number"==typeof o?Math.abs(o+r-i):t;return s||c<t?a<=c?(u="timeOrigin",e.timeOrigin):(u="navigationStart",o):(u="dateNow",i)}u="none"})()})),a.register("bWPEY",(function(r,n){e(r.exports,"getGlobalObject",(()=>o)),e(r.exports,"getGlobalSingleton",(()=>c));var i=a("hLvaX"),s={};function o(){return(0,i.isNodeEnv)()?t:"undefined"!=typeof window?window:"undefined"!=typeof self?self:s}function c(e,t,r){var n=r||o(),i=n.__SENTRY__=n.__SENTRY__||{};return i[e]||(i[e]=t())}}));var s;s=a("9Hk4c");var o;!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),o=a("bU6y3");const c=e=>{if("object"==typeof e&&null!==e){if("function"==typeof Object.getPrototypeOf){const t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}return"[object Object]"===Object.prototype.toString.call(e)}return!1},l=(...e)=>e.reduce(((e,t)=>(Object.keys(t).forEach((r=>{Array.isArray(e[r])&&Array.isArray(t[r])?e[r]=Array.from(new Set(e[r].concat(t[r]))):c(e[r])&&c(t[r])?e[r]=l(e[r],t[r]):e[r]=t[r]})),e)),{});var d,u=a("85Hg2");d=a("jkhJk");var p;u=a("85Hg2");p=function(e,t,r,n){var i=r?r.call(n,e,t):void 0;if(void 0!==i)return!!i;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var a=Object.keys(e),s=Object.keys(t);if(a.length!==s.length)return!1;for(var o=Object.prototype.hasOwnProperty.bind(t),c=0;c<a.length;c++){var l=a[c];if(!o(l))return!1;var d=e[l],u=t[l];if(!1===(i=r?r.call(n,d,u,l):void 0)||void 0===i&&d!==u)return!1}return!0};var f=function(e){function t(e,n,c,l,p){for(var f,h,m,g,b,x=0,S=0,k=0,E=0,R=0,D=0,O=m=f=0,A=0,N=0,F=0,B=0,z=c.length,$=z-1,U="",V="",H="",W="";A<z;){if(h=c.charCodeAt(A),A===$&&0!==S+E+k+x&&(0!==S&&(h=47===S?10:47),E=k=x=0,z++,$++),0===S+E+k+x){if(A===$&&(0<N&&(U=U.replace(u,"")),0<U.trim().length)){switch(h){case 32:case 9:case 59:case 13:case 10:break;default:U+=c.charAt(A)}h=59}switch(h){case 123:for(f=(U=U.trim()).charCodeAt(0),m=1,B=++A;A<z;){switch(h=c.charCodeAt(A)){case 123:m++;break;case 125:m--;break;case 47:switch(h=c.charCodeAt(A+1)){case 42:case 47:e:{for(O=A+1;O<$;++O)switch(c.charCodeAt(O)){case 47:if(42===h&&42===c.charCodeAt(O-1)&&A+2!==O){A=O+1;break e}break;case 10:if(47===h){A=O+1;break e}}A=O}}break;case 91:h++;case 40:h++;case 34:case 39:for(;A++<$&&c.charCodeAt(A)!==h;);}if(0===m)break;A++}if(m=c.substring(B,A),0===f&&(f=(U=U.replace(d,"").trim()).charCodeAt(0)),64===f){switch(0<N&&(U=U.replace(u,"")),h=U.charCodeAt(1)){case 100:case 109:case 115:case 45:N=n;break;default:N=M}if(B=(m=t(n,N,m,h,p+1)).length,0<I&&(b=o(3,m,N=r(M,U,F),n,P,C,B,h,p,l),U=N.join(""),void 0!==b&&0===(B=(m=b.trim()).length)&&(h=0,m="")),0<B)switch(h){case 115:U=U.replace(_,s);case 100:case 109:case 45:m=U+"{"+m+"}";break;case 107:m=(U=U.replace(v,"$1 $2"))+"{"+m+"}",m=1===j||2===j&&a("@"+m,3)?"@-webkit-"+m+"@"+m:"@"+m;break;default:m=U+m,112===l&&(V+=m,m="")}else m=""}else m=t(n,r(n,U,F),m,l,p+1);H+=m,m=F=N=O=f=0,U="",h=c.charCodeAt(++A);break;case 125:case 59:if(1<(B=(U=(0<N?U.replace(u,""):U).trim()).length))switch(0===O&&(f=U.charCodeAt(0),45===f||96<f&&123>f)&&(B=(U=U.replace(" ",":")).length),0<I&&void 0!==(b=o(1,U,n,e,P,C,V.length,l,p,l))&&0===(B=(U=b.trim()).length)&&(U="\0\0"),f=U.charCodeAt(0),h=U.charCodeAt(1),f){case 0:break;case 64:if(105===h||99===h){W+=U+c.charAt(A);break}default:58!==U.charCodeAt(B-1)&&(V+=i(U,f,h,U.charCodeAt(2)))}F=N=O=f=0,U="",h=c.charCodeAt(++A)}}switch(h){case 13:case 10:47===S?S=0:0===1+f&&107!==l&&0<U.length&&(N=1,U+="\0"),0<I*L&&o(0,U,n,e,P,C,V.length,l,p,l),C=1,P++;break;case 59:case 125:if(0===S+E+k+x){C++;break}default:switch(C++,g=c.charAt(A),h){case 9:case 32:if(0===E+x+S)switch(R){case 44:case 58:case 9:case 32:g="";break;default:32!==h&&(g=" ")}break;case 0:g="\\0";break;case 12:g="\\f";break;case 11:g="\\v";break;case 38:0===E+S+x&&(N=F=1,g="\f"+g);break;case 108:if(0===E+S+x+T&&0<O)switch(A-O){case 2:112===R&&58===c.charCodeAt(A-3)&&(T=R);case 8:111===D&&(T=D)}break;case 58:0===E+S+x&&(O=A);break;case 44:0===S+k+E+x&&(N=1,g+="\r");break;case 34:case 39:0===S&&(E=E===h?0:0===E?h:E);break;case 91:0===E+S+k&&x++;break;case 93:0===E+S+k&&x--;break;case 41:0===E+S+x&&k--;break;case 40:if(0===E+S+x){if(0===f)if(2*R+3*D==533);else f=1;k++}break;case 64:0===S+k+E+x+O+m&&(m=1);break;case 42:case 47:if(!(0<E+x+k))switch(S){case 0:switch(2*h+3*c.charCodeAt(A+1)){case 235:S=47;break;case 220:B=A,S=42}break;case 42:47===h&&42===R&&B+2!==A&&(33===c.charCodeAt(B+2)&&(V+=c.substring(B,A+1)),g="",S=0)}}0===S&&(U+=g)}D=R,R=h,A++}if(0<(B=V.length)){if(N=n,0<I&&(void 0!==(b=o(2,V,N,e,P,C,B,l,p,l))&&0===(V=b).length))return W+V+H;if(V=N.join(",")+"{"+V+"}",0!=j*T){switch(2!==j||a(V,2)||(T=0),T){case 111:V=V.replace(w,":-moz-$1")+V;break;case 112:V=V.replace(y,"::-webkit-input-$1")+V.replace(y,"::-moz-$1")+V.replace(y,":-ms-input-$1")+V}T=0}}return W+V+H}function r(e,t,r){var i=t.trim().split(m);t=i;var a=i.length,s=e.length;switch(s){case 0:case 1:var o=0;for(e=0===s?"":e[0]+" ";o<a;++o)t[o]=n(e,t[o],r).trim();break;default:var c=o=0;for(t=[];o<a;++o)for(var l=0;l<s;++l)t[c++]=n(e[l]+" ",i[o],r).trim()}return t}function n(e,t,r){var n=t.charCodeAt(0);switch(33>n&&(n=(t=t.trim()).charCodeAt(0)),n){case 38:return t.replace(g,"$1"+e.trim());case 58:return e.trim()+t.replace(g,"$1"+e.trim());default:if(0<1*r&&0<t.indexOf("\f"))return t.replace(g,(58===e.charCodeAt(0)?"":"$1")+e.trim())}return e+t}function i(e,t,r,n){var s=e+";",o=2*t+3*r+4*n;if(944===o){e=s.indexOf(":",9)+1;var c=s.substring(e,s.length-1).trim();return c=s.substring(0,e).trim()+c+";",1===j||2===j&&a(c,1)?"-webkit-"+c+c:c}if(0===j||2===j&&!a(s,1))return s;switch(o){case 1015:return 97===s.charCodeAt(10)?"-webkit-"+s+s:s;case 951:return 116===s.charCodeAt(3)?"-webkit-"+s+s:s;case 963:return 110===s.charCodeAt(5)?"-webkit-"+s+s:s;case 1009:if(100!==s.charCodeAt(4))break;case 969:case 942:return"-webkit-"+s+s;case 978:return"-webkit-"+s+"-moz-"+s+s;case 1019:case 983:return"-webkit-"+s+"-moz-"+s+"-ms-"+s+s;case 883:if(45===s.charCodeAt(8))return"-webkit-"+s+s;if(0<s.indexOf("image-set(",11))return s.replace(R,"$1-webkit-$2")+s;break;case 932:if(45===s.charCodeAt(4))switch(s.charCodeAt(5)){case 103:return"-webkit-box-"+s.replace("-grow","")+"-webkit-"+s+"-ms-"+s.replace("grow","positive")+s;case 115:return"-webkit-"+s+"-ms-"+s.replace("shrink","negative")+s;case 98:return"-webkit-"+s+"-ms-"+s.replace("basis","preferred-size")+s}return"-webkit-"+s+"-ms-"+s+s;case 964:return"-webkit-"+s+"-ms-flex-"+s+s;case 1023:if(99!==s.charCodeAt(8))break;return"-webkit-box-pack"+(c=s.substring(s.indexOf(":",15)).replace("flex-","").replace("space-between","justify"))+"-webkit-"+s+"-ms-flex-pack"+c+s;case 1005:return f.test(s)?s.replace(p,":-webkit-")+s.replace(p,":-moz-")+s:s;case 1e3:switch(t=(c=s.substring(13).trim()).indexOf("-")+1,c.charCodeAt(0)+c.charCodeAt(t)){case 226:c=s.replace(b,"tb");break;case 232:c=s.replace(b,"tb-rl");break;case 220:c=s.replace(b,"lr");break;default:return s}return"-webkit-"+s+"-ms-"+c+s;case 1017:if(-1===s.indexOf("sticky",9))break;case 975:switch(t=(s=e).length-10,o=(c=(33===s.charCodeAt(t)?s.substring(0,t):s).substring(e.indexOf(":",7)+1).trim()).charCodeAt(0)+(0|c.charCodeAt(7))){case 203:if(111>c.charCodeAt(8))break;case 115:s=s.replace(c,"-webkit-"+c)+";"+s;break;case 207:case 102:s=s.replace(c,"-webkit-"+(102<o?"inline-":"")+"box")+";"+s.replace(c,"-webkit-"+c)+";"+s.replace(c,"-ms-"+c+"box")+";"+s}return s+";";case 938:if(45===s.charCodeAt(5))switch(s.charCodeAt(6)){case 105:return c=s.replace("-items",""),"-webkit-"+s+"-webkit-box-"+c+"-ms-flex-"+c+s;case 115:return"-webkit-"+s+"-ms-flex-item-"+s.replace(S,"")+s;default:return"-webkit-"+s+"-ms-flex-line-pack"+s.replace("align-content","").replace(S,"")+s}break;case 973:case 989:if(45!==s.charCodeAt(3)||122===s.charCodeAt(4))break;case 931:case 953:if(!0===E.test(e))return 115===(c=e.substring(e.indexOf(":")+1)).charCodeAt(0)?i(e.replace("stretch","fill-available"),t,r,n).replace(":fill-available",":stretch"):s.replace(c,"-webkit-"+c)+s.replace(c,"-moz-"+c.replace("fill-",""))+s;break;case 962:if(s="-webkit-"+s+(102===s.charCodeAt(5)?"-ms-"+s:"")+s,211===r+n&&105===s.charCodeAt(13)&&0<s.indexOf("transform",10))return s.substring(0,s.indexOf(";",27)+1).replace(h,"$1-webkit-$2")+s}return s}function a(e,t){var r=e.indexOf(1===t?":":"{"),n=e.substring(0,3!==t?r:10);return r=e.substring(r+1,e.length-1),O(2!==t?n:n.replace(k,"$1"),r,t)}function s(e,t){var r=i(t,t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2));return r!==t+";"?r.replace(x," or ($1)").substring(4):"("+t+")"}function o(e,t,r,n,i,a,s,o,c,d){for(var u,p=0,f=t;p<I;++p)switch(u=D[p].call(l,e,f,r,n,i,a,s,o,c,d)){case void 0:case!1:case!0:case null:break;default:f=u}if(f!==t)return f}function c(e){return void 0!==(e=e.prefix)&&(O=null,e?"function"!=typeof e?j=1:(j=2,O=e):j=0),c}function l(e,r){var n=e;if(33>n.charCodeAt(0)&&(n=n.trim()),n=[n],0<I){var i=o(-1,r,n,n,P,C,0,0,0,0);void 0!==i&&"string"==typeof i&&(r=i)}var a=t(M,n,r,0,0);return 0<I&&(void 0!==(i=o(-2,a,n,n,P,C,a.length,0,0,0))&&(a=i)),"",T=0,C=P=1,a}var d=/^\0+/g,u=/[\0\r\f]/g,p=/: */g,f=/zoo|gra/,h=/([,: ])(transform)/g,m=/,\r+?/g,g=/([\t\r\n ])*\f?&/g,v=/@(k\w+)\s*(\S*)\s*/,y=/::(place)/g,w=/:(read-only)/g,b=/[svh]\w+-[tblr]{2}/,_=/\(\s*(.*)\s*\)/g,x=/([\s\S]*?);/g,S=/-self|flex-/g,k=/[^]*?(:[rp][el]a[\w-]+)[^]*/,E=/stretch|:\s*\w+\-(?:conte|avail)/,R=/([^-])(image-set\()/,C=1,P=1,T=0,j=1,M=[],D=[],I=0,O=null,L=0;return l.use=function e(t){switch(t){case void 0:case null:I=D.length=0;break;default:if("function"==typeof t)D[I++]=t;else if("object"==typeof t)for(var r=0,n=t.length;r<n;++r)e(t[r]);else L=0|!!t}return e},l.set=c,void 0!==e&&c(e),l},h={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};var m,g,v,y=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,w=(m=function(e){return y.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91},g={},function(e){return void 0===g[e]&&(g[e]=m(e)),g[e]}),b={};b=a("9Qh3N");var _={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},x={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},S={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},k={};function E(e){return b.isMemo(e)?S:k[e.$$typeof]||_}k[b.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},k[b.Memo]=S;var R=Object.defineProperty,C=Object.getOwnPropertyNames,P=Object.getOwnPropertySymbols,T=Object.getOwnPropertyDescriptor,j=Object.getPrototypeOf,M=Object.prototype;v=function e(t,r,n){if("string"!=typeof r){if(M){var i=j(r);i&&i!==M&&e(t,i,n)}var a=C(r);P&&(a=a.concat(P(r)));for(var s=E(t),o=E(r),c=0;c<a.length;++c){var l=a[c];if(!(x[l]||n&&n[l]||o&&o[l]||s&&s[l])){var d=T(r,l);try{R(t,l,d)}catch(e){}}}}return t};a("ePtPP");function D(){return(D=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var I=function(e,t){for(var r=[e[0]],n=0,i=t.length;n<i;n+=1)r.push(t[n],e[n+1]);return r},O=function(e){return null!==e&&"object"==typeof e&&"[object Object]"===(e.toString?e.toString():Object.prototype.toString.call(e))&&!(0,d.typeOf)(e)},L=Object.freeze([]),A=Object.freeze({});function N(e){return"function"==typeof e}function F(e){return e.displayName||e.name||"Component"}function B(e){return e&&"string"==typeof e.styledComponentId}var z="data-styled",$="undefined"!=typeof window&&"HTMLElement"in window,U=Boolean("boolean"==typeof SC_DISABLE_SPEEDY&&SC_DISABLE_SPEEDY),V={};function H(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];throw new Error("An error occurred. See https://git.io/JUIaE#"+e+" for more information."+(r.length>0?" Args: "+r.join(", "):""))}var W=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}var t=e.prototype;return t.indexOfGroup=function(e){for(var t=0,r=0;r<e;r++)t+=this.groupSizes[r];return t},t.insertRules=function(e,t){if(e>=this.groupSizes.length){for(var r=this.groupSizes,n=r.length,i=n;e>=i;)(i<<=1)<0&&H(16,""+e);this.groupSizes=new Uint32Array(i),this.groupSizes.set(r),this.length=i;for(var a=n;a<i;a++)this.groupSizes[a]=0}for(var s=this.indexOfGroup(e+1),o=0,c=t.length;o<c;o++)this.tag.insertRule(s,t[o])&&(this.groupSizes[e]++,s++)},t.clearGroup=function(e){if(e<this.length){var t=this.groupSizes[e],r=this.indexOfGroup(e),n=r+t;this.groupSizes[e]=0;for(var i=r;i<n;i++)this.tag.deleteRule(r)}},t.getGroup=function(e){var t="";if(e>=this.length||0===this.groupSizes[e])return t;for(var r=this.groupSizes[e],n=this.indexOfGroup(e),i=n+r,a=n;a<i;a++)t+=this.tag.getRule(a)+"/*!sc*/\n";return t},e}(),q=new Map,G=new Map,Z=1,K=function(e){if(q.has(e))return q.get(e);for(;G.has(Z);)Z++;var t=Z++;return q.set(e,t),G.set(t,e),t},Q=new RegExp('^data-styled\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),Y=function(e,t,r){for(var n,i=r.split(","),a=0,s=i.length;a<s;a++)(n=i[a])&&e.registerName(t,n)},X=function(e,t){for(var r=(t.textContent||"").split("/*!sc*/\n"),n=[],i=0,a=r.length;i<a;i++){var s=r[i].trim();if(s){var o=s.match(Q);if(o){var c=0|parseInt(o[1],10),l=o[2];0!==c&&(d=l,(u=c)>=Z&&(Z=u+1),q.set(d,u),G.set(u,d),Y(e,l,o[3]),e.getTag().insertRules(c,n)),n.length=0}else n.push(s)}}var d,u},J=function(){return"undefined"!=typeof window&&void 0!==window.__webpack_nonce__?window.__webpack_nonce__:null},ee=function(e){var t=document.head,r=e||t,n=document.createElement("style"),i=function(e){for(var t=e.childNodes,r=t.length;r>=0;r--){var n=t[r];if(n&&1===n.nodeType&&n.hasAttribute(z))return n}}(r),a=void 0!==i?i.nextSibling:null;n.setAttribute(z,"active"),n.setAttribute("data-styled-version","5.3.3");var s=J();return s&&n.setAttribute("nonce",s),r.insertBefore(n,a),n},te=function(){function e(e){var t=this.element=ee(e);t.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,r=0,n=t.length;r<n;r++){var i=t[r];if(i.ownerNode===e)return i}H(17)}(t),this.length=0}var t=e.prototype;return t.insertRule=function(e,t){try{return this.sheet.insertRule(t,e),this.length++,!0}catch(e){return!1}},t.deleteRule=function(e){this.sheet.deleteRule(e),this.length--},t.getRule=function(e){var t=this.sheet.cssRules[e];return void 0!==t&&"string"==typeof t.cssText?t.cssText:""},e}(),re=function(){function e(e){var t=this.element=ee(e);this.nodes=t.childNodes,this.length=0}var t=e.prototype;return t.insertRule=function(e,t){if(e<=this.length&&e>=0){var r=document.createTextNode(t),n=this.nodes[e];return this.element.insertBefore(r,n||null),this.length++,!0}return!1},t.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},t.getRule=function(e){return e<this.length?this.nodes[e].textContent:""},e}(),ne=function(){function e(e){this.rules=[],this.length=0}var t=e.prototype;return t.insertRule=function(e,t){return e<=this.length&&(this.rules.splice(e,0,t),this.length++,!0)},t.deleteRule=function(e){this.rules.splice(e,1),this.length--},t.getRule=function(e){return e<this.length?this.rules[e]:""},e}(),ie=$,ae={isServer:!$,useCSSOMInjection:!U},se=function(){function e(e,t,r){void 0===e&&(e=A),void 0===t&&(t={}),this.options=D({},ae,{},e),this.gs=t,this.names=new Map(r),this.server=!!e.isServer,!this.server&&$&&ie&&(ie=!1,function(e){for(var t=document.querySelectorAll('style[data-styled][data-styled-version="5.3.3"]'),r=0,n=t.length;r<n;r++){var i=t[r];i&&"active"!==i.getAttribute(z)&&(X(e,i),i.parentNode&&i.parentNode.removeChild(i))}}(this))}e.registerId=function(e){return K(e)};var t=e.prototype;return t.reconstructWithOptions=function(t,r){return void 0===r&&(r=!0),new e(D({},this.options,{},t),this.gs,r&&this.names||void 0)},t.allocateGSInstance=function(e){return this.gs[e]=(this.gs[e]||0)+1},t.getTag=function(){var e,t,r,n,i;return this.tag||(this.tag=(r=(t=this.options).isServer,n=t.useCSSOMInjection,i=t.target,e=r?new ne(i):n?new te(i):new re(i),new W(e)))},t.hasNameForId=function(e,t){return this.names.has(e)&&this.names.get(e).has(t)},t.registerName=function(e,t){if(K(e),this.names.has(e))this.names.get(e).add(t);else{var r=new Set;r.add(t),this.names.set(e,r)}},t.insertRules=function(e,t,r){this.registerName(e,t),this.getTag().insertRules(K(e),r)},t.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear()},t.clearRules=function(e){this.getTag().clearGroup(K(e)),this.clearNames(e)},t.clearTag=function(){this.tag=void 0},t.toString=function(){return function(e){for(var t=e.getTag(),r=t.length,n="",i=0;i<r;i++){var a=(d=i,G.get(d));if(void 0!==a){var s=e.names.get(a),o=t.getGroup(i);if(s&&o&&s.size){var c="data-styled.g"+i+'[id="'+a+'"]',l="";void 0!==s&&s.forEach((function(e){e.length>0&&(l+=e+",")})),n+=""+o+c+'{content:"'+l+'"}/*!sc*/\n'}}}var d;return n}(this)},e}(),oe=/(a)(d)/gi,ce=function(e){return String.fromCharCode(e+(e>25?39:97))};function le(e){var t,r="";for(t=Math.abs(e);t>52;t=t/52|0)r=ce(t%52)+r;return(ce(t%52)+r).replace(oe,"$1-$2")}var de=function(e,t){for(var r=t.length;r;)e=33*e^t.charCodeAt(--r);return e},ue=function(e){return de(5381,e)};function pe(e){for(var t=0;t<e.length;t+=1){var r=e[t];if(N(r)&&!B(r))return!1}return!0}var fe=ue("5.3.3"),he=function(){function e(e,t,r){this.rules=e,this.staticRulesId="",this.isStatic=(void 0===r||r.isStatic)&&pe(e),this.componentId=t,this.baseHash=de(fe,t),this.baseStyle=r,se.registerId(t)}return e.prototype.generateAndInjectStyles=function(e,t,r){var n=this.componentId,i=[];if(this.baseStyle&&i.push(this.baseStyle.generateAndInjectStyles(e,t,r)),this.isStatic&&!r.hash)if(this.staticRulesId&&t.hasNameForId(n,this.staticRulesId))i.push(this.staticRulesId);else{var a=De(this.rules,e,t,r).join(""),s=le(de(this.baseHash,a)>>>0);if(!t.hasNameForId(n,s)){var o=r(a,"."+s,void 0,n);t.insertRules(n,s,o)}i.push(s),this.staticRulesId=s}else{for(var c=this.rules.length,l=de(this.baseHash,r.hash),d="",u=0;u<c;u++){var p=this.rules[u];if("string"==typeof p)d+=p;else if(p){var f=De(p,e,t,r),h=Array.isArray(f)?f.join(""):f;l=de(l,h+u),d+=h}}if(d){var m=le(l>>>0);if(!t.hasNameForId(n,m)){var g=r(d,"."+m,void 0,n);t.insertRules(n,m,g)}i.push(m)}}return i.join(" ")},e}(),me=/^\s*\/\/.*$/gm,ge=[":","[",".","#"];function ve(e){var t,r,n,i,a=void 0===e?A:e,s=a.options,o=void 0===s?A:s,c=a.plugins,l=void 0===c?L:c,d=new f(o),u=[],p=function(e){function t(t){if(t)try{e(t+"}")}catch(e){}}return function(r,n,i,a,s,o,c,l,d,u){switch(r){case 1:if(0===d&&64===n.charCodeAt(0))return e(n+";"),"";break;case 2:if(0===l)return n+"/*|*/";break;case 3:switch(l){case 102:case 112:return e(i[0]+n),"";default:return n+(0===u?"/*|*/":"")}case-2:n.split("/*|*/}").forEach(t)}}}((function(e){u.push(e)})),h=function(e,n,a){return 0===n&&-1!==ge.indexOf(a[r.length])||a.match(i)?e:"."+t};function m(e,a,s,o){void 0===o&&(o="&");var c=e.replace(me,""),l=a&&s?s+" "+a+" { "+c+" }":c;return t=o,r=a,n=new RegExp("\\"+r+"\\b","g"),i=new RegExp("(\\"+r+"\\b){2,}"),d(s||!a?"":a,l)}return d.use([].concat(l,[function(e,t,i){2===e&&i.length&&i[0].lastIndexOf(r)>0&&(i[0]=i[0].replace(n,h))},p,function(e){if(-2===e){var t=u;return u=[],t}}])),m.hash=l.length?l.reduce((function(e,t){return t.name||H(15),de(e,t.name)}),5381).toString():"",m}var ye=r(u).createContext(),we=(ye.Consumer,r(u).createContext()),be=(we.Consumer,new se),_e=ve();function xe(){return(0,u.useContext)(ye)||be}function Se(){return(0,u.useContext)(we)||_e}function ke(e){var t=(0,u.useState)(e.stylisPlugins),n=t[0],i=t[1],a=xe(),s=(0,u.useMemo)((function(){var t=a;return e.sheet?t=e.sheet:e.target&&(t=t.reconstructWithOptions({target:e.target},!1)),e.disableCSSOMInjection&&(t=t.reconstructWithOptions({useCSSOMInjection:!1})),t}),[e.disableCSSOMInjection,e.sheet,e.target]),o=(0,u.useMemo)((function(){return ve({options:{prefix:!e.disableVendorPrefixes},plugins:n})}),[e.disableVendorPrefixes,n]);return(0,u.useEffect)((function(){r(p)(n,e.stylisPlugins)||i(e.stylisPlugins)}),[e.stylisPlugins]),r(u).createElement(ye.Provider,{value:s},r(u).createElement(we.Provider,{value:o},e.children))}var Ee=function(){function e(e,t){var r=this;this.inject=function(e,t){void 0===t&&(t=_e);var n=r.name+t.hash;e.hasNameForId(r.id,n)||e.insertRules(r.id,n,t(r.rules,n,"@keyframes"))},this.toString=function(){return H(12,String(r.name))},this.name=e,this.id="sc-keyframes-"+e,this.rules=t}return e.prototype.getName=function(e){return void 0===e&&(e=_e),this.name+e.hash},e}(),Re=/([A-Z])/,Ce=/([A-Z])/g,Pe=/^ms-/,Te=function(e){return"-"+e.toLowerCase()};function je(e){return Re.test(e)?e.replace(Ce,Te).replace(Pe,"-ms-"):e}var Me=function(e){return null==e||!1===e||""===e};function De(e,t,r,n){if(Array.isArray(e)){for(var i,a=[],s=0,o=e.length;s<o;s+=1)""!==(i=De(e[s],t,r,n))&&(Array.isArray(i)?a.push.apply(a,i):a.push(i));return a}return Me(e)?"":B(e)?"."+e.styledComponentId:N(e)?"function"!=typeof(c=e)||c.prototype&&c.prototype.isReactComponent||!t?e:De(e(t),t,r,n):e instanceof Ee?r?(e.inject(r,n),e.getName(n)):e:O(e)?function e(t,r){var n,i,a=[];for(var s in t)t.hasOwnProperty(s)&&!Me(t[s])&&(Array.isArray(t[s])&&t[s].isCss||N(t[s])?a.push(je(s)+":",t[s],";"):O(t[s])?a.push.apply(a,e(t[s],s)):a.push(je(s)+": "+(n=s,(null==(i=t[s])||"boolean"==typeof i||""===i?"":"number"!=typeof i||0===i||n in h?String(i).trim():i+"px")+";")));return r?[r+" {"].concat(a,["}"]):a}(e):e.toString();var c}var Ie=function(e){return Array.isArray(e)&&(e.isCss=!0),e};function Oe(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return N(e)||O(e)?Ie(De(I(L,[e].concat(r)))):0===r.length&&1===e.length&&"string"==typeof e[0]?e:Ie(De(I(e,r)))}new Set;var Le=function(e,t,r){return void 0===r&&(r=A),e.theme!==r.theme&&e.theme||t||r.theme},Ae=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,Ne=/(^-|-$)/g;function Fe(e){return e.replace(Ae,"-").replace(Ne,"")}var Be=function(e){return le(ue(e)>>>0)};function ze(e){return"string"==typeof e&&!0}var $e=function(e){return"function"==typeof e||"object"==typeof e&&null!==e&&!Array.isArray(e)},Ue=function(e){return"__proto__"!==e&&"constructor"!==e&&"prototype"!==e};function Ve(e,t,r){var n=e[r];$e(t)&&$e(n)?He(n,t):e[r]=t}function He(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];for(var i=0,a=r;i<a.length;i++){var s=a[i];if($e(s))for(var o in s)Ue(o)&&Ve(e,s[o],o)}return e}var We=r(u).createContext();We.Consumer;function qe(e){var t=(0,u.useContext)(We),n=(0,u.useMemo)((function(){return r=e.theme,n=t,r?N(r)?r(n):Array.isArray(r)||"object"!=typeof r?H(8):n?D({},n,{},r):r:H(14);var r,n}),[e.theme,t]);return e.children?r(u).createElement(We.Provider,{value:n},e.children):null}var Ge={};function Ze(e,t,n){var i,a=B(e),s=!ze(e),o=t.attrs,c=void 0===o?L:o,l=t.componentId,d=void 0===l?function(e,t){var r="string"!=typeof e?"sc":Fe(e);Ge[r]=(Ge[r]||0)+1;var n=r+"-"+Be("5.3.3"+r+Ge[r]);return t?t+"-"+n:n}(t.displayName,t.parentComponentId):l,p=t.displayName,f=void 0===p?ze(i=e)?"styled."+i:"Styled("+F(i)+")":p,h=t.displayName&&t.componentId?Fe(t.displayName)+"-"+t.componentId:t.componentId||d,m=a&&e.attrs?Array.prototype.concat(e.attrs,c).filter(Boolean):c,g=t.shouldForwardProp;a&&e.shouldForwardProp&&(g=t.shouldForwardProp?function(r,n,i){return e.shouldForwardProp(r,n,i)&&t.shouldForwardProp(r,n,i)}:e.shouldForwardProp);var y,b=new he(n,h,a?e.componentStyle:void 0),_=b.isStatic&&0===c.length,x=function(e,t){return function(e,t,r,n){var i,a,s,o,c,l=e.attrs,d=e.componentStyle,p=e.defaultProps,f=e.foldedComponentIds,h=e.shouldForwardProp,m=e.styledComponentId,g=e.target,v=function(e,t,r){void 0===e&&(e=A);var n=D({},t,{theme:e}),i={};return r.forEach((function(e){var t,r,a,s=e;for(t in N(s)&&(s=s(n)),s)n[t]=i[t]="className"===t?(r=i[t],a=s[t],r&&a?r+" "+a:r||a):s[t]})),[n,i]}(Le(t,(0,u.useContext)(We),p)||A,t,l),y=v[0],b=v[1],_=(i=d,a=n,s=y,o=xe(),c=Se(),a?i.generateAndInjectStyles(A,o,c):i.generateAndInjectStyles(s,o,c)),x=r,S=b.$as||t.$as||b.as||t.as||g,k=ze(S),E=b!==t?D({},t,{},b):t,R={};for(var C in E)"$"!==C[0]&&"as"!==C&&("forwardedAs"===C?R.as=E[C]:(h?h(C,w,S):!k||w(C))&&(R[C]=E[C]));return t.style&&b.style!==t.style&&(R.style=D({},t.style,{},b.style)),R.className=Array.prototype.concat(f,m,_!==m?_:null,t.className,b.className).filter(Boolean).join(" "),R.ref=x,(0,u.createElement)(S,R)}(y,e,t,_)};return x.displayName=f,(y=r(u).forwardRef(x)).attrs=m,y.componentStyle=b,y.displayName=f,y.shouldForwardProp=g,y.foldedComponentIds=a?Array.prototype.concat(e.foldedComponentIds,e.styledComponentId):L,y.styledComponentId=h,y.target=a?e.target:e,y.withComponent=function(e){var r=t.componentId,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(t,["componentId"]),a=r&&r+"-"+(ze(e)?e:Fe(F(e)));return Ze(e,D({},i,{attrs:m,componentId:a}),n)},Object.defineProperty(y,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(t){this._foldedDefaultProps=a?He({},e.defaultProps,t):t}}),y.toString=function(){return"."+y.styledComponentId},s&&r(v)(y,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),y}var Ke=function(e){return function e(t,r,n){if(void 0===n&&(n=A),!(0,d.isValidElementType)(r))return H(1,String(r));var i=function(){return t(r,n,Oe.apply(void 0,arguments))};return i.withConfig=function(i){return e(t,r,D({},n,{},i))},i.attrs=function(i){return e(t,r,D({},n,{attrs:Array.prototype.concat(n.attrs,i).filter(Boolean)}))},i}(Ze,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach((function(e){Ke[e]=Ke(e)}));var Qe=function(){function e(e,t){this.rules=e,this.componentId=t,this.isStatic=pe(e),se.registerId(this.componentId+1)}var t=e.prototype;return t.createStyles=function(e,t,r,n){var i=n(De(this.rules,t,r,n).join(""),""),a=this.componentId+e;r.insertRules(a,a,i)},t.removeStyles=function(e,t){t.clearRules(this.componentId+e)},t.renderStyles=function(e,t,r,n){e>2&&se.registerId(this.componentId+e),this.removeStyles(e,r),this.createStyles(e,t,r,n)},e}();function Ye(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];var a=Oe.apply(void 0,[e].concat(n)),s="sc-global-"+Be(JSON.stringify(a)),o=new Qe(a,s);function c(e){var t=xe(),r=Se(),n=(0,u.useContext)(We),i=(0,u.useRef)(t.allocateGSInstance(s)).current;return t.server&&l(i,e,t,n,r),(0,u.useLayoutEffect)((function(){if(!t.server)return l(i,e,t,n,r),function(){return o.removeStyles(i,t)}}),[i,e,t,n,r]),null}function l(e,t,r,n,i){if(o.isStatic)o.renderStyles(e,V,r,i);else{var a=D({},t,{theme:Le(t,n,c.defaultProps)});o.renderStyles(e,a,r,i)}}return r(u).memo(c)}function Xe(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];var i=Oe.apply(void 0,[e].concat(r)).join(""),a=Be(i);return new Ee(a,i)}!function(){function e(){var e=this;this._emitSheetCSS=function(){var t=e.instance.toString();if(!t)return"";var r=J();return"<style "+[r&&'nonce="'+r+'"','data-styled="true"','data-styled-version="5.3.3"'].filter(Boolean).join(" ")+">"+t+"</style>"},this.getStyleTags=function(){return e.sealed?H(2):e._emitSheetCSS()},this.getStyleElement=function(){var t;if(e.sealed)return H(2);var n=((t={})["data-styled"]="",t["data-styled-version"]="5.3.3",t.dangerouslySetInnerHTML={__html:e.instance.toString()},t),i=J();return i&&(n.nonce=i),[r(u).createElement("style",D({},n,{key:"sc-0-0"}))]},this.seal=function(){e.sealed=!0},this.instance=new se({isServer:!0}),this.sealed=!1}var t=e.prototype;t.collectStyles=function(e){return this.sealed?H(2):r(u).createElement(ke,{sheet:this.instance},e)},t.interleaveWithNodeStream=function(e){return H(3)}}();var Je=Ke;u=a("85Hg2");let et={data:""},tt=e=>"object"==typeof window?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||et,rt=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,nt=/\/\*[^]*?\*\/|\s\s+|\n/g,it=(e,t)=>{let r="",n="",i="";for(let a in e){let s=e[a];"@"==a[0]?"i"==a[1]?r=a+" "+s+";":n+="f"==a[1]?it(s,a):a+"{"+it(s,"k"==a[1]?"":t)+"}":"object"==typeof s?n+=it(s,t?t.replace(/([^,])+/g,(e=>a.replace(/(^:.*)|([^,])+/g,(t=>/&/.test(t)?t.replace(/&/g,e):e?e+" "+t:t)))):a):null!=s&&(a=a.replace(/[A-Z]/g,"-$&").toLowerCase(),i+=it.p?it.p(a,s):a+":"+s+";")}return r+(t&&i?t+"{"+i+"}":i)+n},at={},st=e=>{if("object"==typeof e){let t="";for(let r in e)t+=r+st(e[r]);return t}return e},ot=(e,t,r,n,i)=>{let a=st(e),s=at[a]||(at[a]=(e=>{let t=0,r=11;for(;t<e.length;)r=101*r+e.charCodeAt(t++)>>>0;return"go"+r})(a));if(!at[s]){let t=a!==e?e:(e=>{let t,r=[{}];for(;t=rt.exec(e.replace(nt,""));)t[4]?r.shift():t[3]?r.unshift(r[0][t[3]]=r[0][t[3]]||{}):r[0][t[1]]=t[2];return r[0]})(e);at[s]=it(i?{["@keyframes "+s]:t}:t,r?"":"."+s)}return o=at[s],l=n,-1==(c=t).data.indexOf(o)&&(c.data=l?o+c.data:c.data+o),s;var o,c,l},ct=(e,t,r)=>e.reduce(((e,n,i)=>{let a=t[i];if(a&&a.call){let e=a(r),t=e&&e.props&&e.props.className||/^go/.test(e)&&e;a=t?"."+t:e&&"object"==typeof e?e.props?"":it(e,""):!1===e?"":e}return e+n+(null==a?"":a)}),"");function lt(e){let t=this||{},r=e.call?e(t.p):e;return ot(r.unshift?r.raw?ct(r,[].slice.call(arguments,1),t.p):r.reduce(((e,r)=>Object.assign(e,r&&r.call?r(t.p):r)),{}):r,tt(t.target),t.g,t.o,t.k)}lt.bind({g:1});let dt,ut,pt,ft=lt.bind({k:1});function ht(e,t){let r=this||{};return function(){let n=arguments;function i(a,s){let o=Object.assign({},a),c=o.className||i.className;r.p=Object.assign({theme:ut&&ut()},o),r.o=/ *go\d+/.test(c),o.className=lt.apply(r,n)+(c?" "+c:""),t&&(o.ref=s);let l=e;return e[0]&&(l=o.as||e,delete o.as),pt&&l[0]&&pt(o),dt(l,o)}return t?t(i):i}}function mt(){return mt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},mt.apply(this,arguments)}function gt(e,t){return t||(t=e.slice(0)),e.raw=t,e}var vt,yt,wt=function(e,t){return function(e){return"function"==typeof e}(e)?e(t):e},bt=function(){var e=0;return function(){return(++e).toString()}}(),_t=function(){var e=void 0;return function(){if(void 0===e&&"undefined"!=typeof window){var t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}}();(yt=vt||(vt={}))[yt.ADD_TOAST=0]="ADD_TOAST",yt[yt.UPDATE_TOAST=1]="UPDATE_TOAST",yt[yt.UPSERT_TOAST=2]="UPSERT_TOAST",yt[yt.DISMISS_TOAST=3]="DISMISS_TOAST",yt[yt.REMOVE_TOAST=4]="REMOVE_TOAST",yt[yt.START_PAUSE=5]="START_PAUSE",yt[yt.END_PAUSE=6]="END_PAUSE";var xt=new Map,St=function(e){if(!xt.has(e)){var t=setTimeout((function(){xt.delete(e),Ct({type:vt.REMOVE_TOAST,toastId:e})}),1e3);xt.set(e,t)}},kt=function e(t,r){switch(r.type){case vt.ADD_TOAST:return mt({},t,{toasts:[r.toast].concat(t.toasts).slice(0,20)});case vt.UPDATE_TOAST:return r.toast.id&&function(e){var t=xt.get(e);t&&clearTimeout(t)}(r.toast.id),mt({},t,{toasts:t.toasts.map((function(e){return e.id===r.toast.id?mt({},e,r.toast):e}))});case vt.UPSERT_TOAST:var n=r.toast;return t.toasts.find((function(e){return e.id===n.id}))?e(t,{type:vt.UPDATE_TOAST,toast:n}):e(t,{type:vt.ADD_TOAST,toast:n});case vt.DISMISS_TOAST:var i=r.toastId;return i?St(i):t.toasts.forEach((function(e){St(e.id)})),mt({},t,{toasts:t.toasts.map((function(e){return e.id===i||void 0===i?mt({},e,{visible:!1}):e}))});case vt.REMOVE_TOAST:return void 0===r.toastId?mt({},t,{toasts:[]}):mt({},t,{toasts:t.toasts.filter((function(e){return e.id!==r.toastId}))});case vt.START_PAUSE:return mt({},t,{pausedAt:r.time});case vt.END_PAUSE:var a=r.time-(t.pausedAt||0);return mt({},t,{pausedAt:void 0,toasts:t.toasts.map((function(e){return mt({},e,{pauseDuration:e.pauseDuration+a})}))})}},Et=[],Rt={toasts:[],pausedAt:void 0},Ct=function(e){Rt=kt(Rt,e),Et.forEach((function(e){e(Rt)}))},Pt={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},Tt=function(e){return function(t,r){var n=function(e,t,r){return void 0===t&&(t="blank"),mt({createdAt:Date.now(),visible:!0,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0},r,{id:(null==r?void 0:r.id)||bt()})}(t,e,r);return Ct({type:vt.UPSERT_TOAST,toast:n}),n.id}},jt=function(e,t){return Tt("blank")(e,t)};jt.error=Tt("error"),jt.success=Tt("success"),jt.loading=Tt("loading"),jt.custom=Tt("custom"),jt.dismiss=function(e){Ct({type:vt.DISMISS_TOAST,toastId:e})},jt.remove=function(e){return Ct({type:vt.REMOVE_TOAST,toastId:e})},jt.promise=function(e,t,r){var n=jt.loading(t.loading,mt({},r,null==r?void 0:r.loading));return e.then((function(e){return jt.success(wt(t.success,e),mt({id:n},r,null==r?void 0:r.success)),e})).catch((function(e){jt.error(wt(t.error,e),mt({id:n},r,null==r?void 0:r.error))})),e};var Mt=function(e){var t=function(e){void 0===e&&(e={});var t=(0,u.useState)(Rt),r=t[0],n=t[1];(0,u.useEffect)((function(){return Et.push(n),function(){var e=Et.indexOf(n);e>-1&&Et.splice(e,1)}}),[r]);var i=r.toasts.map((function(t){var r,n,i;return mt({},e,e[t.type],t,{duration:t.duration||(null==(r=e[t.type])?void 0:r.duration)||(null==(n=e)?void 0:n.duration)||Pt[t.type],style:mt({},e.style,null==(i=e[t.type])?void 0:i.style,t.style)})}));return mt({},r,{toasts:i})}(e),r=t.toasts,n=t.pausedAt;(0,u.useEffect)((function(){if(!n){var e=Date.now(),t=r.map((function(t){if(t.duration!==1/0){var r=(t.duration||0)+t.pauseDuration-(e-t.createdAt);if(!(r<0))return setTimeout((function(){return jt.dismiss(t.id)}),r);t.visible&&jt.dismiss(t.id)}}));return function(){t.forEach((function(e){return e&&clearTimeout(e)}))}}}),[r,n]);var i=(0,u.useMemo)((function(){return{startPause:function(){Ct({type:vt.START_PAUSE,time:Date.now()})},endPause:function(){n&&Ct({type:vt.END_PAUSE,time:Date.now()})},updateHeight:function(e,t){return Ct({type:vt.UPDATE_TOAST,toast:{id:e,height:t}})},calculateOffset:function(e,t){var n,i=t||{},a=i.reverseOrder,s=void 0!==a&&a,o=i.gutter,c=void 0===o?8:o,l=i.defaultPosition,d=r.filter((function(t){return(t.position||l)===(e.position||l)&&t.height})),u=d.findIndex((function(t){return t.id===e.id})),p=d.filter((function(e,t){return t<u&&e.visible})).length;return(n=d.filter((function(e){return e.visible}))).slice.apply(n,s?[p+1]:[0,p]).reduce((function(e,t){return e+(t.height||0)+c}),0)}}}),[r,n]);return{toasts:r,handlers:i}};function Dt(){var e=gt(["\n width: 20px;\n opacity: 0;\n height: 20px;\n border-radius: 10px;\n background: ",";\n position: relative;\n transform: rotate(45deg);\n\n animation: "," 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)\n forwards;\n animation-delay: 100ms;\n\n &:after,\n &:before {\n content: '';\n animation: "," 0.15s ease-out forwards;\n animation-delay: 150ms;\n position: absolute;\n border-radius: 3px;\n opacity: 0;\n background: ",";\n bottom: 9px;\n left: 4px;\n height: 2px;\n width: 12px;\n }\n\n &:before {\n animation: "," 0.15s ease-out forwards;\n animation-delay: 180ms;\n transform: rotate(90deg);\n }\n"]);return Dt=function(){return e},e}function It(){var e=gt(["\nfrom {\n transform: scale(0) rotate(90deg);\n\topacity: 0;\n}\nto {\n transform: scale(1) rotate(90deg);\n\topacity: 1;\n}"]);return It=function(){return e},e}function Ot(){var e=gt(["\nfrom {\n transform: scale(0);\n opacity: 0;\n}\nto {\n transform: scale(1);\n opacity: 1;\n}"]);return Ot=function(){return e},e}function Lt(){var e=gt(["\nfrom {\n transform: scale(0) rotate(45deg);\n\topacity: 0;\n}\nto {\n transform: scale(1) rotate(45deg);\n opacity: 1;\n}"]);return Lt=function(){return e},e}var At=ft(Lt()),Nt=ft(Ot()),Ft=ft(It()),Bt=ht("div")(Dt(),(function(e){return e.primary||"#ff4b4b"}),At,Nt,(function(e){return e.secondary||"#fff"}),Ft);function zt(){var e=gt(["\n width: 12px;\n height: 12px;\n box-sizing: border-box;\n border: 2px solid;\n border-radius: 100%;\n border-color: ",";\n border-right-color: ",";\n animation: "," 1s linear infinite;\n"]);return zt=function(){return e},e}function $t(){var e=gt(["\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n"]);return $t=function(){return e},e}var Ut=ft($t()),Vt=ht("div")(zt(),(function(e){return e.secondary||"#e0e0e0"}),(function(e){return e.primary||"#616161"}),Ut);function Ht(){var e=gt(["\n width: 20px;\n opacity: 0;\n height: 20px;\n border-radius: 10px;\n background: ",";\n position: relative;\n transform: rotate(45deg);\n\n animation: "," 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)\n forwards;\n animation-delay: 100ms;\n &:after {\n content: '';\n box-sizing: border-box;\n animation: "," 0.2s ease-out forwards;\n opacity: 0;\n animation-delay: 200ms;\n position: absolute;\n border-right: 2px solid;\n border-bottom: 2px solid;\n border-color: ",";\n bottom: 6px;\n left: 6px;\n height: 10px;\n width: 6px;\n }\n"]);return Ht=function(){return e},e}function Wt(){var e=gt(["\n0% {\n\theight: 0;\n\twidth: 0;\n\topacity: 0;\n}\n40% {\n height: 0;\n\twidth: 6px;\n\topacity: 1;\n}\n100% {\n opacity: 1;\n height: 10px;\n}"]);return Wt=function(){return e},e}function qt(){var e=gt(["\nfrom {\n transform: scale(0) rotate(45deg);\n\topacity: 0;\n}\nto {\n transform: scale(1) rotate(45deg);\n\topacity: 1;\n}"]);return qt=function(){return e},e}var Gt=ft(qt()),Zt=ft(Wt()),Kt=ht("div")(Ht(),(function(e){return e.primary||"#61d345"}),Gt,Zt,(function(e){return e.secondary||"#fff"}));function Qt(){var e=gt(["\n position: relative;\n transform: scale(0.6);\n opacity: 0.4;\n min-width: 20px;\n animation: "," 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)\n forwards;\n"]);return Qt=function(){return e},e}function Yt(){var e=gt(["\nfrom {\n transform: scale(0.6);\n opacity: 0.4;\n}\nto {\n transform: scale(1);\n opacity: 1;\n}"]);return Yt=function(){return e},e}function Xt(){var e=gt(["\n position: relative;\n display: flex;\n justify-content: center;\n align-items: center;\n min-width: 20px;\n min-height: 20px;\n"]);return Xt=function(){return e},e}function Jt(){var e=gt(["\n position: absolute;\n"]);return Jt=function(){return e},e}var er=ht("div")(Jt()),tr=ht("div")(Xt()),rr=ft(Yt()),nr=ht("div")(Qt(),rr),ir=function(e){var t=e.toast,r=t.icon,n=t.type,i=t.iconTheme;return void 0!==r?"string"==typeof r?(0,u.createElement)(nr,null,r):r:"blank"===n?null:(0,u.createElement)(tr,null,(0,u.createElement)(Vt,Object.assign({},i)),"loading"!==n&&(0,u.createElement)(er,null,"error"===n?(0,u.createElement)(Bt,Object.assign({},i)):(0,u.createElement)(Kt,Object.assign({},i))))};function ar(){var e=gt(["\n display: flex;\n justify-content: center;\n margin: 4px 10px;\n color: inherit;\n flex: 1 1 auto;\n white-space: pre-line;\n"]);return ar=function(){return e},e}function sr(){var e=gt(["\n display: flex;\n align-items: center;\n background: #fff;\n color: #363636;\n line-height: 1.3;\n will-change: transform;\n box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05);\n max-width: 350px;\n pointer-events: auto;\n padding: 8px 10px;\n border-radius: 8px;\n"]);return sr=function(){return e},e}var or,cr,lr,dr,ur=function(e){return"\n0% {transform: translate3d(0,"+-200*e+"%,0) scale(.6); opacity:.5;}\n100% {transform: translate3d(0,0,0) scale(1); opacity:1;}\n"},pr=function(e){return"\n0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}\n100% {transform: translate3d(0,"+-150*e+"%,-1px) scale(.6); opacity:0;}\n"},fr=ht("div",u.forwardRef)(sr()),hr=ht("div")(ar()),mr=(0,u.memo)((function(e){var t=e.toast,r=e.position,n=e.style,i=e.children,a=null!=t&&t.height?function(e,t){var r=e.includes("top")?1:-1,n=_t()?["0%{opacity:0;} 100%{opacity:1;}","0%{opacity:1;} 100%{opacity:0;}"]:[ur(r),pr(r)],i=n[1];return{animation:t?ft(n[0])+" 0.35s cubic-bezier(.21,1.02,.73,1) forwards":ft(i)+" 0.4s forwards cubic-bezier(.06,.71,.55,1)"}}(t.position||r||"top-center",t.visible):{opacity:0},s=(0,u.createElement)(ir,{toast:t}),o=(0,u.createElement)(hr,Object.assign({},t.ariaProps),wt(t.message,t));return(0,u.createElement)(fr,{className:t.className,style:mt({},a,n,t.style)},"function"==typeof i?i({icon:s,message:o}):(0,u.createElement)(u.Fragment,null,s,o))}));function gr(){var e=gt(["\n z-index: 9999;\n > * {\n pointer-events: auto;\n }\n"]);return gr=function(){return e},e}or=u.createElement,it.p=cr,dt=or,ut=lr,pt=dr;var vr=lt(gr()),yr=function(e){var t=e.reverseOrder,r=e.position,n=void 0===r?"top-center":r,i=e.toastOptions,a=e.gutter,s=e.children,o=e.containerStyle,c=e.containerClassName,l=Mt(i),d=l.toasts,p=l.handlers;return(0,u.createElement)("div",{style:mt({position:"fixed",zIndex:9999,top:16,left:16,right:16,bottom:16,pointerEvents:"none"},o),className:c,onMouseEnter:p.startPause,onMouseLeave:p.endPause},d.map((function(e){var r,i=e.position||n,o=function(e,t){var r=e.includes("top"),n=r?{top:0}:{bottom:0},i=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return mt({left:0,right:0,display:"flex",position:"absolute",transition:_t()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:"translateY("+t*(r?1:-1)+"px)"},n,i)}(i,p.calculateOffset(e,{reverseOrder:t,gutter:a,defaultPosition:n})),c=e.height?void 0:(r=function(t){p.updateHeight(e.id,t.height)},function(e){e&&setTimeout((function(){var t=e.getBoundingClientRect();r(t)}))});return(0,u.createElement)("div",{ref:c,className:e.visible?vr:"",key:e.id,style:o},"custom"===e.type?wt(e.message,e):s?s(e):(0,u.createElement)(mr,{toast:e,position:i}))})))},wr=jt,br={};
|
|
8
|
+
/*! iNoBounce - v0.2.0
|
|
9
|
+
* https://github.com/lazd/iNoBounce/
|
|
10
|
+
* Copyright (c) 2013 Larry Davis <lazdnet@gmail.com>; Licensed BSD */
|
|
11
|
+
!function(e){var t=0,r=!1,n=!1;try{var i=Object.defineProperty({},"passive",{get:function(){n=!0}});window.addEventListener("test",null,i)}catch(e){}var a=function(e){var r=e.target,n=window.innerWidth/window.document.documentElement.clientWidth;if(!(e.touches.length>1||1!==n)){for(;r!==document.body&&r!==document;){var i=window.getComputedStyle(r);if(!i)break;if("INPUT"===r.nodeName&&"range"===r.getAttribute("type"))return;var a=i.getPropertyValue("-webkit-overflow-scrolling"),s=i.getPropertyValue("overflow-y"),o=parseInt(i.getPropertyValue("height"),10),c="touch"===a&&("auto"===s||"scroll"===s),l=r.scrollHeight>r.offsetHeight;if(c&&l){var d=e.touches?e.touches[0].screenY:e.screenY,u=t<=d&&0===r.scrollTop,p=t>=d&&r.scrollHeight-r.scrollTop===o;return void((u||p)&&e.preventDefault())}r=r.parentNode}e.preventDefault()}},s=function(e){t=e.touches?e.touches[0].screenY:e.screenY},o=function(){window.addEventListener("touchstart",s,!!n&&{passive:!1}),window.addEventListener("touchmove",a,!!n&&{passive:!1}),r=!0},c=document.createElement("div");document.documentElement.appendChild(c),c.style.WebkitOverflowScrolling="touch";var l="getComputedStyle"in window&&"touch"===window.getComputedStyle(c)["-webkit-overflow-scrolling"];document.documentElement.removeChild(c),l&&o();var d={enable:o,disable:function(){window.removeEventListener("touchstart",s,!1),window.removeEventListener("touchmove",a,!1),r=!1},isEnabled:function(){return r},isScrollSupported:l};br&&(br=d),"function"==typeof e.define?(0,e.define)("iNoBounce",[],(function(){return d})):e.iNoBounce=d}(br);u=a("85Hg2");var _r,xr=new Uint8Array(16);function Sr(){if(!_r&&!(_r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return _r(xr)}var kr=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;for(var Er=function(e){return"string"==typeof e&&kr.test(e)},Rr=[],Cr=0;Cr<256;++Cr)Rr.push((Cr+256).toString(16).substr(1));var Pr=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(Rr[e[t+0]]+Rr[e[t+1]]+Rr[e[t+2]]+Rr[e[t+3]]+"-"+Rr[e[t+4]]+Rr[e[t+5]]+"-"+Rr[e[t+6]]+Rr[e[t+7]]+"-"+Rr[e[t+8]]+Rr[e[t+9]]+"-"+Rr[e[t+10]]+Rr[e[t+11]]+Rr[e[t+12]]+Rr[e[t+13]]+Rr[e[t+14]]+Rr[e[t+15]]).toLowerCase();if(!Er(r))throw TypeError("Stringified UUID is invalid");return r};var Tr,jr,Mr,Dr=function(e,t,r){var n=(e=e||{}).random||(e.rng||Sr)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(var i=0;i<16;++i)t[r+i]=n[i];return t}return Pr(n)},Ir=JSON.parse('{"name":"protoo-client","version":"4.0.6","description":"protoo JavaScript client module","author":"Iñaki Baz Castillo <ibc@aliax.net>","homepage":"https://protoo.versatica.com","license":"MIT","repository":{"type":"git","url":"https://github.com/ibc/protoo.git"},"main":"lib/index.js","keywords":["nodejs","browser","websocket"],"engines":{"node":">=8.0.0"},"scripts":{"lint":"eslint -c .eslintrc.js lib"},"dependencies":{"debug":"^4.3.1","events":"^3.2.0","retry":"^0.12.0"},"devDependencies":{"eslint":"^5.16.0"},"optionalDependencies":{"websocket":"^1.0.33"}}').version,Or={},Lr=a("hZG0u");const Ar="protoo-client";Or=class{constructor(e){e?(this._debug=Lr(`protoo-client:${e}`),this._warn=Lr(`protoo-client:WARN:${e}`),this._error=Lr(`protoo-client:ERROR:${e}`)):(this._debug=Lr(Ar),this._warn=Lr("protoo-client:WARN"),this._error=Lr("protoo-client: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}};var Nr,Fr=a("3oV8N").EventEmitter;Nr=class extends Fr{constructor(e){super(),this.setMaxListeners(1/0),this._logger=e||new Or("EnhancedEventEmitter")}safeEmit(e,...t){try{this.emit(e,...t)}catch(t){this._logger.error("safeEmit() | event listener threw an error [event:%s]:%o",e,t)}}async safeEmitAsPromise(e,...t){return new Promise(((r,n)=>{this.safeEmit(e,...t,r,n)}))}};var Br={},zr=function(){return Math.round(1e7*Math.random())};const $r=new Or("Message");Br=class{static parse(e){let t;const r={};try{t=JSON.parse(e)}catch(e){return void $r.error("parse() | invalid JSON: %s",e)}if("object"==typeof t&&!Array.isArray(t)){if(t.request){if(r.request=!0,"string"!=typeof t.method)return void $r.error("parse() | missing/invalid method field");if("number"!=typeof t.id)return void $r.error("parse() | missing/invalid id field");r.id=t.id,r.method=t.method,r.data=t.data||{}}else if(t.response){if(r.response=!0,"number"!=typeof t.id)return void $r.error("parse() | missing/invalid id field");r.id=t.id,t.ok?(r.ok=!0,r.data=t.data||{}):(r.ok=!1,r.errorCode=t.errorCode,r.errorReason=t.errorReason)}else{if(!t.notification)return void $r.error("parse() | missing request/response field");if(r.notification=!0,"string"!=typeof t.method)return void $r.error("parse() | missing/invalid method field");r.method=t.method,r.data=t.data||{}}return r}$r.error("parse() | not an object")}static createRequest(e,t){return{request:!0,id:zr(),method:e,data:t||{}}}static createSuccessResponse(e,t){return{response:!0,id:e.id,ok:!0,data:t||{}}}static createErrorResponse(e,t,r){return{response:!0,id:e.id,ok:!1,errorCode:t,errorReason:r}}static createNotification(e,t){return{notification:!0,method:e,data:t||{}}}};const Ur=new Or("Peer");Mr=class extends Nr{constructor(e){super(Ur),Ur.debug("constructor()"),this._closed=!1,this._transport=e,this._connected=!1,this._data={},this._sents=new Map,this._handleTransport()}get closed(){return this._closed}get connected(){return this._connected}get data(){return this._data}set data(e){throw new Error("cannot override data object")}close(){if(!this._closed){Ur.debug("close()"),this._closed=!0,this._connected=!1,this._transport.close();for(const e of this._sents.values())e.close();this.safeEmit("close")}}async request(e,t){const r=Br.createRequest(e,t);return this._logger.debug("request() [method:%s, id:%s]",e,r.id),await this._transport.send(r),new Promise(((e,t)=>{const n=1500*(15+.1*this._sents.size),i={id:r.id,method:r.method,resolve:t=>{this._sents.delete(r.id)&&(clearTimeout(i.timer),e(t))},reject:e=>{this._sents.delete(r.id)&&(clearTimeout(i.timer),t(e))},timer:setTimeout((()=>{this._sents.delete(r.id)&&t(new Error("request timeout"))}),n),close:()=>{clearTimeout(i.timer),t(new Error("peer closed"))}};this._sents.set(r.id,i)}))}async notify(e,t){const r=Br.createNotification(e,t);this._logger.debug("notify() [method:%s]",e),await this._transport.send(r)}_handleTransport(){if(this._transport.closed)return this._closed=!0,void setTimeout((()=>{this._closed||(this._connected=!1,this.safeEmit("close"))}));this._transport.on("open",(()=>{this._closed||(Ur.debug('emit "open"'),this._connected=!0,this.safeEmit("open"))})),this._transport.on("disconnected",(()=>{this._closed||(Ur.debug('emit "disconnected"'),this._connected=!1,this.safeEmit("disconnected"))})),this._transport.on("failed",(e=>{this._closed||(Ur.debug('emit "failed" [currentAttempt:%s]',e),this._connected=!1,this.safeEmit("failed",e))})),this._transport.on("close",(()=>{this._closed||(this._closed=!0,Ur.debug('emit "close"'),this._connected=!1,this.safeEmit("close"))})),this._transport.on("message",(e=>{e.request?this._handleRequest(e):e.response?this._handleResponse(e):e.notification&&this._handleNotification(e)}))}_handleRequest(e){try{this.emit("request",e,(t=>{const r=Br.createSuccessResponse(e,t);this._transport.send(r).catch((()=>{}))}),((t,r)=>{t instanceof Error?(r=t.message,t=500):"number"==typeof t&&r instanceof Error&&(r=r.message);const n=Br.createErrorResponse(e,t,r);this._transport.send(n).catch((()=>{}))}))}catch(t){const r=Br.createErrorResponse(e,500,String(t));this._transport.send(r).catch((()=>{}))}}_handleResponse(e){const t=this._sents.get(e.id);if(t)if(e.ok)t.resolve(e.data);else{const r=new Error(e.errorReason);r.code=e.errorCode,t.reject(r)}else Ur.error("received response does not match any sent request [id:%s]",e.id)}_handleNotification(e){this.safeEmit("notification",e)}};var Vr;if("object"==typeof globalThis)Vr=globalThis;else try{Vr=a("jCEG4")}catch(e){}finally{if(Vr||"undefined"==typeof window||(Vr=window),!Vr)throw new Error("Could not determine global this")}var Hr,Wr=Vr.WebSocket||Vr.MozWebSocket;function qr(e,t){return t?new Wr(e,t):new Wr(e)}Hr=a("kUMHr").version,Wr&&["CONNECTING","OPEN","CLOSING","CLOSED"].forEach((function(e){Object.defineProperty(qr,e,{get:function(){return Wr[e]}})}));var Gr={w3cwebsocket:Wr?qr:null,version:Hr}.w3cwebsocket,Zr={};Zr=a("jxXWz");const Kr={retries:10,factor:2,minTimeout:1e3,maxTimeout:8e3},Qr=new Or("WebSocketTransport");Tr=Mr,jr=class extends Nr{constructor(e,t){super(Qr),Qr.debug("constructor() [url:%s, options:%o]",e,t),this._closed=!1,this._url=e,this._options=t||{},this._ws=null,this._runWebSocket()}get closed(){return this._closed}close(){if(!this._closed){Qr.debug("close()"),this._closed=!0,this.safeEmit("close");try{this._ws.onopen=null,this._ws.onclose=null,this._ws.onerror=null,this._ws.onmessage=null,this._ws.close()}catch(e){Qr.error("close() | error closing the WebSocket: %o",e)}}}async send(e){if(this._closed)throw new Error("transport closed");try{this._ws.send(JSON.stringify(e))}catch(e){throw Qr.warn("send() failed:%o",e),e}}_runWebSocket(){const e=Zr.operation(this._options.retry||Kr);let t=!1;e.attempt((r=>{this._closed?e.stop():(Qr.debug("_runWebSocket() [currentAttempt:%s]",r),this._ws=new Gr(this._url,"protoo",this._options.origin,this._options.headers,this._options.requestOptions,this._options.clientConfig),this._ws.onopen=()=>{this._closed||(t=!0,this.safeEmit("open"))},this._ws.onclose=n=>{if(!this._closed){if(Qr.warn('WebSocket "close" event [wasClean:%s, code:%s, reason:"%s"]',n.wasClean,n.code,n.reason),4e3!==n.code){if(t){if(e.stop(),this.safeEmit("disconnected"),this._closed)return;return void this._runWebSocket()}if(this.safeEmit("failed",r),this._closed)return;if(e.retry(!0))return}this._closed=!0,this.safeEmit("close")}},this._ws.onerror=()=>{this._closed||Qr.error('WebSocket "error" event')},this._ws.onmessage=e=>{if(this._closed)return;const t=Br.parse(e.data);t&&(0!==this.listenerCount("message")?this.safeEmit("message",t):Qr.error('no listeners for WebSocket "message" event, ignoring received message'))})}))}};var Yr={},Xr=Yr&&Yr.__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]}),Jr=Yr&&Yr.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),en=Yr&&Yr.__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)&&Xr(t,e,r);return Jr(t,e),t},tn=Yr&&Yr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Yr,"__esModule",{value:!0}),Yr.debug=Yr.parseScalabilityMode=Yr.detectDevice=Yr.Device=Yr.version=Yr.types=void 0;const rn=tn(a("hZG0u"));Yr.debug=rn.default;var nn=a("1ZHQC");Object.defineProperty(Yr,"Device",{enumerable:!0,get:function(){return nn.Device}}),Object.defineProperty(Yr,"detectDevice",{enumerable:!0,get:function(){return nn.detectDevice}});const an=en(a("cQumC"));Yr.types=an,Yr.version="3.6.52";var sn=a("fT1lN");Object.defineProperty(Yr,"parseScalabilityMode",{enumerable:!0,get:function(){return sn.parse}});const on=window.AudioContext||window.webkitAudioContext;class cn{speakStartEventTime=0;speakStopEventTime=0;speaking=!1;audioMedianInterval=-1;audioLevelInterval=-1;audioLevels=[];constructor(e,t){this.id=e.id,this.listener=t,this.stream=e,this.audioContext=new on,this.analyser=this.audioContext.createAnalyser(),this.audioStreamSource=this.audioContext.createMediaStreamSource(this.stream),this.analyser.fftSize=32,this.analyser.minDecibels=-90,this.analyser.maxDecibels=-10,this.audioStreamSource.connect(this.analyser)}getAudioLevelMedian(){const{length:e}=this.audioLevels;return this.audioLevels.reduce(((e,t)=>e+t),0)/e}getCurrentAudioLevel(){const{length:e}=this.audioLevels;return e?this.audioLevels[e-1]:0}audioMuteDetection(){0===this.getAudioLevelMedian()&&this.audioLevels.length>0&&this.listener?.onMuteDetection?.(this.id)}detectSpeakingChange(e){e<20&&!this.speakStopEventTime&&(this.speakStartEventTime=0,this.speakStopEventTime=Date.now()),e>=20&&!this.speakStartEventTime&&(this.speakStartEventTime=Date.now(),this.speakStopEventTime=0);const t=this.speakStartEventTime||this.speakStopEventTime,r=Boolean(this.speakStartEventTime);(Date.now()-t>500&&r||Date.now()-t>300&&!r)&&this.speaking!==r&&(this.speaking=r,r?this.listener?.onStartSpeak():this.listener?.onStopSpeak())}computeRMS(e){let t=0;for(let r=0;r<e.length;r++)t+=e[r]*e[r];return t/=e.length,Math.sqrt(t)}getInstantAudioLevel(){const e=new Uint8Array(this.analyser.frequencyBinCount);this.analyser.getByteFrequencyData(e);const t=this.computeRMS(e);return t>0?100*t/255:0}loopCalcul(){const e=this.getInstantAudioLevel();this.audioLevels=this.audioLevels.splice(-59),this.detectSpeakingChange(e),this.audioLevels.push(e),this.listener?.onAudioLevel?.(e,this.id)}analyse(){this.audioLevelInterval=window.setInterval((()=>this.loopCalcul()),1e3/60),this.audioMedianInterval=window.setInterval((()=>this.audioMuteDetection()),2e3)}release(){this.listener=void 0,clearInterval(this.audioLevelInterval),clearInterval(this.audioMedianInterval),this.stream.getTracks().forEach((e=>{this.stream.removeTrack(e)})),this.audioStreamSource.disconnect(this.analyser),this.audioContext.close(),this.audioLevels=[]}static isAPIAvailable(){return!!on}}var ln={};e(ln,"FunctionToString",(()=>Mn)),e(ln,"InboundFilters",(()=>On));var dn=Object.prototype.toString;function un(e,t){return dn.call(e)===`[object ${t}]`}function pn(e){return un(e,"String")}function fn(e){return un(e,"Object")}function hn(e){return Boolean(e&&e.then&&"function"==typeof e.then)}var mn="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,gn=(0,(_n=a("bWPEY")).getGlobalObject)(),vn=["debug","info","warn","error","log","assert"];function yn(e){var t=(0,_n.getGlobalObject)();if(!("console"in t))return e();var r=t.console,n={};vn.forEach((e=>{var i=r[e]&&r[e].__sentry_original__;e in t.console&&i&&(n[e]=r[e],r[e]=i)}));try{return e()}finally{Object.keys(n).forEach((e=>{r[e]=n[e]}))}}function wn(){let e=!1;var t={enable:()=>{e=!0},disable:()=>{e=!1}};return mn?vn.forEach((r=>{t[r]=(...t)=>{e&&yn((()=>{gn.console[r](`Sentry Logger [${r}]:`,...t)}))}})):vn.forEach((e=>{t[e]=()=>{}})),t}let bn;bn=mn?(0,_n.getGlobalSingleton)("logger",wn):wn();var _n=a("bWPEY");_n=a("bWPEY");function xn(e,t){return!!pn(e)&&(un(t,"RegExp")?t.test(e):"string"==typeof t&&-1!==e.indexOf(t))}function Sn(e){return kn(e,(t="function"==typeof WeakSet,r=t?new WeakSet:[],[function(e){if(t)return!!r.has(e)||(r.add(e),!1);for(let t=0;t<r.length;t++)if(r[t]===e)return!0;return r.push(e),!1},function(e){if(t)r.delete(e);else for(let t=0;t<r.length;t++)if(r[t]===e){r.splice(t,1);break}}]));var t,r}function kn(e,t){const[r]=t;if(fn(e)){if(r(e))return e;var n={};for(var i of Object.keys(e))void 0!==e[i]&&(n[i]=kn(e[i],t));return n}return Array.isArray(e)?r(e)?e:e.map((e=>kn(e,t))):e}function En(){var e=(0,_n.getGlobalObject)(),t=e.crypto||e.msCrypto;if(void 0!==t&&t.getRandomValues){var r=new Uint16Array(8);t.getRandomValues(r),r[3]=4095&r[3]|16384,r[4]=16383&r[4]|32768;var n=e=>{let t=e.toString(16);for(;t.length<4;)t=`0${t}`;return t};return n(r[0])+n(r[1])+n(r[2])+n(r[3])+n(r[4])+n(r[5])+n(r[6])+n(r[7])}return"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,(e=>{var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}function Rn(e){return e.exception&&e.exception.values?e.exception.values[0]:void 0}function Cn(e){const{message:t,event_id:r}=e;if(t)return t;var n=Rn(e);return n?n.type&&n.value?`${n.type}: ${n.value}`:n.type||n.value||r||"<unknown>":r||"<unknown>"}var Pn;!function(e){e[e.PENDING=0]="PENDING";e[e.RESOLVED=1]="RESOLVED";e[e.REJECTED=2]="REJECTED"}(Pn||(Pn={}));class Tn{__init(){this._state=Pn.PENDING}__init2(){this._handlers=[]}constructor(e){Tn.prototype.__init.call(this),Tn.prototype.__init2.call(this),Tn.prototype.__init3.call(this),Tn.prototype.__init4.call(this),Tn.prototype.__init5.call(this),Tn.prototype.__init6.call(this);try{e(this._resolve,this._reject)}catch(e){this._reject(e)}}then(e,t){return new Tn(((r,n)=>{this._handlers.push([!1,t=>{if(e)try{r(e(t))}catch(e){n(e)}else r(t)},e=>{if(t)try{r(t(e))}catch(e){n(e)}else n(e)}]),this._executeHandlers()}))}catch(e){return this.then((e=>e),e)}finally(e){return new Tn(((t,r)=>{let n,i;return this.then((t=>{i=!1,n=t,e&&e()}),(t=>{i=!0,n=t,e&&e()})).then((()=>{i?r(n):t(n)}))}))}__init3(){this._resolve=e=>{this._setResult(Pn.RESOLVED,e)}}__init4(){this._reject=e=>{this._setResult(Pn.REJECTED,e)}}__init5(){this._setResult=(e,t)=>{this._state===Pn.PENDING&&(hn(t)?t.then(this._resolve,this._reject):(this._state=e,this._value=t,this._executeHandlers()))}}__init6(){this._executeHandlers=()=>{if(this._state!==Pn.PENDING){var e=this._handlers.slice();this._handlers=[],e.forEach((e=>{e[0]||(this._state===Pn.RESOLVED&&e[1](this._value),this._state===Pn.REJECTED&&e[2](this._value),e[0]=!0)}))}}}}let jn;class Mn{constructor(){Mn.prototype.__init.call(this)}static __initStatic(){this.id="FunctionToString"}__init(){this.name=Mn.id}setupOnce(){jn=Function.prototype.toString,Function.prototype.toString=function(...e){var t=this.__sentry_original__||this;return jn.apply(t,e)}}}Mn.__initStatic();var Dn="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,In=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/];class On{static __initStatic(){this.id="InboundFilters"}__init(){this.name=On.id}constructor(e={}){this._options=e,On.prototype.__init.call(this)}setupOnce(e,t){var r=e=>{var r=t();if(r){var n=r.getIntegration(On);if(n){var i=r.getClient(),a=i?i.getOptions():{},s=function(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...In],ignoreInternal:void 0===e.ignoreInternal||e.ignoreInternal}}(n._options,a);return function(e,t){if(t.ignoreInternal&&function(e){try{return"SentryError"===e.exception.values[0].type}catch(e){}return!1}(e))return Dn&&bn.warn(`Event dropped due to being internal Sentry Error.\nEvent: ${Cn(e)}`),!0;if(function(e,t){return!(!t||!t.length)&&function(e){if(e.message)return[e.message];if(e.exception)try{const{type:t="",value:r=""}=e.exception.values&&e.exception.values[0]||{};return[`${r}`,`${t}: ${r}`]}catch(t){return Dn&&bn.error(`Cannot extract message for event ${Cn(e)}`),[]}return[]}(e).some((e=>t.some((t=>xn(e,t)))))}(e,t.ignoreErrors))return Dn&&bn.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${Cn(e)}`),!0;if(function(e,t){if(!t||!t.length)return!1;var r=Ln(e);return!!r&&t.some((e=>xn(r,e)))}(e,t.denyUrls))return Dn&&bn.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${Cn(e)}.\nUrl: ${Ln(e)}`),!0;if(!function(e,t){if(!t||!t.length)return!0;var r=Ln(e);return!r||t.some((e=>xn(r,e)))}(e,t.allowUrls))return Dn&&bn.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${Cn(e)}.\nUrl: ${Ln(e)}`),!0;return!1}(e,s)?null:e}}return e};r.id=this.name,e(r)}}function Ln(e){try{let t;try{t=e.exception.values[0].stacktrace.frames}catch(e){}return t?function(e=[]){for(let r=e.length-1;r>=0;r--){var t=e[r];if(t&&"<anonymous>"!==t.filename&&"[native code]"!==t.filename)return t.filename||null}return null}(t):null}catch(t){return Dn&&bn.error(`Cannot extract url for event ${Cn(e)}`),null}}On.__initStatic();var An=a("gTODe"),Nn=(_n=a("bWPEY"),a("hLvaX")),Fn="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__;a("gTODe"),_n=a("bWPEY"),An=a("gTODe");function Bn(e){var t=(0,An.timestampInSeconds)(),r={sid:En(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(e){return Sn({sid:`${e.sid}`,init:e.init,started:new Date(1e3*e.started).toISOString(),timestamp:new Date(1e3*e.timestamp).toISOString(),status:e.status,errors:e.errors,did:"number"==typeof e.did||"string"==typeof e.did?`${e.did}`:void 0,duration:e.duration,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}})}(r)};return e&&zn(r,e),r}function zn(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),e.did||t.did||(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||(0,An.timestampInSeconds)(),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=32===t.sid.length?t.sid:En()),void 0!==t.init&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),"number"==typeof t.started&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if("number"==typeof t.duration)e.duration=t.duration;else{var r=e.timestamp-e.started;e.duration=r>=0?r:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),"number"==typeof t.errors&&(e.errors=t.errors),t.status&&(e.status=t.status)}function $n(e,t){let r={};t?r={status:t}:"ok"===e.status&&(r={status:"exited"}),zn(e,r)}class Un{constructor(){Un.prototype.__init.call(this),Un.prototype.__init2.call(this),Un.prototype.__init3.call(this),Un.prototype.__init4.call(this),Un.prototype.__init5.call(this),Un.prototype.__init6.call(this),Un.prototype.__init7.call(this),Un.prototype.__init8.call(this),Un.prototype.__init9.call(this),Un.prototype.__init10.call(this)}__init(){this._notifyingListeners=!1}__init2(){this._scopeListeners=[]}__init3(){this._eventProcessors=[]}__init4(){this._breadcrumbs=[]}__init5(){this._user={}}__init6(){this._tags={}}__init7(){this._extra={}}__init8(){this._contexts={}}__init9(){this._attachments=[]}__init10(){this._sdkProcessingMetadata={}}static clone(e){var t=new Un;return e&&(t._breadcrumbs=[...e._breadcrumbs],t._tags={...e._tags},t._extra={...e._extra},t._contexts={...e._contexts},t._user=e._user,t._level=e._level,t._span=e._span,t._session=e._session,t._transactionName=e._transactionName,t._fingerprint=e._fingerprint,t._eventProcessors=[...e._eventProcessors],t._requestSession=e._requestSession,t._attachments=[...e._attachments]),t}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{},this._session&&zn(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(e){return this._requestSession=e,this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this._tags={...this._tags,[e]:t},this._notifyScopeListeners(),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return null===t?delete this._contexts[e]:this._contexts={...this._contexts,[e]:t},this._notifyScopeListeners(),this}setSpan(e){return this._span=e,this._notifyScopeListeners(),this}getSpan(){return this._span}getTransaction(){var e=this.getSpan();return e&&e.transaction}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;if("function"==typeof e){var t=e(this);return t instanceof Un?t:this}return e instanceof Un?(this._tags={...this._tags,...e._tags},this._extra={...this._extra,...e._extra},this._contexts={...this._contexts,...e._contexts},e._user&&Object.keys(e._user).length&&(this._user=e._user),e._level&&(this._level=e._level),e._fingerprint&&(this._fingerprint=e._fingerprint),e._requestSession&&(this._requestSession=e._requestSession)):fn(e)&&(this._tags={...this._tags,...e.tags},this._extra={...this._extra,...e.extra},this._contexts={...this._contexts,...e.contexts},e.user&&(this._user=e.user),e.level&&(this._level=e.level),e.fingerprint&&(this._fingerprint=e.fingerprint),e.requestSession&&(this._requestSession=e.requestSession)),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this._attachments=[],this}addBreadcrumb(e,t){var r="number"==typeof t?Math.min(t,100):100;if(r<=0)return this;var n={timestamp:(0,An.dateTimestampInSeconds)(),...e};return this._breadcrumbs=[...this._breadcrumbs,n].slice(-r),this._notifyScopeListeners(),this}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}getAttachments(){return this._attachments}clearAttachments(){return this._attachments=[],this}applyToEvent(e,t={}){if(this._extra&&Object.keys(this._extra).length&&(e.extra={...this._extra,...e.extra}),this._tags&&Object.keys(this._tags).length&&(e.tags={...this._tags,...e.tags}),this._user&&Object.keys(this._user).length&&(e.user={...this._user,...e.user}),this._contexts&&Object.keys(this._contexts).length&&(e.contexts={...this._contexts,...e.contexts}),this._level&&(e.level=this._level),this._transactionName&&(e.transaction=this._transactionName),this._span){e.contexts={trace:this._span.getTraceContext(),...e.contexts};var r=this._span.transaction&&this._span.transaction.name;r&&(e.tags={transaction:r,...e.tags})}return this._applyFingerprint(e),e.breadcrumbs=[...e.breadcrumbs||[],...this._breadcrumbs],e.breadcrumbs=e.breadcrumbs.length>0?e.breadcrumbs:void 0,e.sdkProcessingMetadata=this._sdkProcessingMetadata,this._notifyEventProcessors([...Vn(),...this._eventProcessors],e,t)}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...e},this}_notifyEventProcessors(e,t,r,n=0){return new Tn(((i,a)=>{var s=e[n];if(null===t||"function"!=typeof s)i(t);else{var o=s({...t},r);Fn&&s.id&&null===o&&bn.log(`Event processor "${s.id}" dropped event`),hn(o)?o.then((t=>this._notifyEventProcessors(e,t,r,n+1).then(i))).then(null,a):this._notifyEventProcessors(e,o,r,n+1).then(i).then(null,a)}}))}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((e=>{e(this)})),this._notifyingListeners=!1)}_applyFingerprint(e){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],this._fingerprint&&(e.fingerprint=e.fingerprint.concat(this._fingerprint)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint}}function Vn(){return(0,_n.getGlobalSingleton)("globalEventProcessors",(()=>[]))}var Hn=100;class Wn{__init(){this._stack=[{}]}constructor(e,t=new Un,r=4){this._version=r,Wn.prototype.__init.call(this),this.getStackTop().scope=t,e&&this.bindClient(e)}isOlderThan(e){return this._version<e}bindClient(e){this.getStackTop().client=e,e&&e.setupIntegrations&&e.setupIntegrations()}pushScope(){var e=Un.clone(this.getScope());return this.getStack().push({client:this.getClient(),scope:e}),e}popScope(){return!(this.getStack().length<=1)&&!!this.getStack().pop()}withScope(e){var t=this.pushScope();try{e(t)}finally{this.popScope()}}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getStack(){return this._stack}getStackTop(){return this._stack[this._stack.length-1]}captureException(e,t){var r=this._lastEventId=t&&t.event_id?t.event_id:En(),n=new Error("Sentry syntheticException");return this._withClient(((i,a)=>{i.captureException(e,{originalException:e,syntheticException:n,...t,event_id:r},a)})),r}captureMessage(e,t,r){var n=this._lastEventId=r&&r.event_id?r.event_id:En(),i=new Error(e);return this._withClient(((a,s)=>{a.captureMessage(e,t,{originalException:e,syntheticException:i,...r,event_id:n},s)})),n}captureEvent(e,t){var r=t&&t.event_id?t.event_id:En();return"transaction"!==e.type&&(this._lastEventId=r),this._withClient(((n,i)=>{n.captureEvent(e,{...t,event_id:r},i)})),r}lastEventId(){return this._lastEventId}addBreadcrumb(e,t){const{scope:r,client:n}=this.getStackTop();if(!r||!n)return;const{beforeBreadcrumb:i=null,maxBreadcrumbs:a=Hn}=n.getOptions&&n.getOptions()||{};if(!(a<=0)){var s={timestamp:(0,An.dateTimestampInSeconds)(),...e},o=i?yn((()=>i(s,t))):s;null!==o&&r.addBreadcrumb(o,a)}}setUser(e){var t=this.getScope();t&&t.setUser(e)}setTags(e){var t=this.getScope();t&&t.setTags(e)}setExtras(e){var t=this.getScope();t&&t.setExtras(e)}setTag(e,t){var r=this.getScope();r&&r.setTag(e,t)}setExtra(e,t){var r=this.getScope();r&&r.setExtra(e,t)}setContext(e,t){var r=this.getScope();r&&r.setContext(e,t)}configureScope(e){const{scope:t,client:r}=this.getStackTop();t&&r&&e(t)}run(e){var t=Gn(this);try{e(this)}finally{Gn(t)}}getIntegration(e){var t=this.getClient();if(!t)return null;try{return t.getIntegration(e)}catch(t){return Fn&&bn.warn(`Cannot retrieve integration ${e.id} from the current Hub`),null}}startTransaction(e,t){return this._callExtensionMethod("startTransaction",e,t)}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(e=!1){if(e)return this.endSession();this._sendSessionUpdate()}endSession(){var e=this.getStackTop(),t=e&&e.scope,r=t&&t.getSession();r&&$n(r),this._sendSessionUpdate(),t&&t.setSession()}startSession(e){const{scope:t,client:r}=this.getStackTop(),{release:n,environment:i}=r&&r.getOptions()||{};var a=(0,_n.getGlobalObject)();const{userAgent:s}=a.navigator||{};var o=Bn({release:n,environment:i,...t&&{user:t.getUser()},...s&&{userAgent:s},...e});if(t){var c=t.getSession&&t.getSession();c&&"ok"===c.status&&zn(c,{status:"exited"}),this.endSession(),t.setSession(o)}return o}_sendSessionUpdate(){const{scope:e,client:t}=this.getStackTop();if(e){var r=e.getSession();r&&t&&t.captureSession&&t.captureSession(r)}}_withClient(e){const{scope:t,client:r}=this.getStackTop();r&&e(r,t)}_callExtensionMethod(e,...t){var r=qn().__SENTRY__;if(r&&r.extensions&&"function"==typeof r.extensions[e])return r.extensions[e].apply(this,t);Fn&&bn.warn(`Extension method ${e} couldn't be found, doing nothing.`)}}function qn(){var e=(0,_n.getGlobalObject)();return e.__SENTRY__=e.__SENTRY__||{extensions:{},hub:void 0},e}function Gn(e){var t=qn(),r=Qn(t);return Yn(t,e),r}function Zn(){var e=qn();return Kn(e)&&!Qn(e).isOlderThan(4)||Yn(e,new Wn),(0,Nn.isNodeEnv)()?function(e){try{var t=qn().__SENTRY__,r=t&&t.extensions&&t.extensions.domain&&t.extensions.domain.active;if(!r)return Qn(e);if(!Kn(r)||Qn(r).isOlderThan(4)){var n=Qn(e).getStackTop();Yn(r,new Wn(n.client,Un.clone(n.scope)))}return Qn(r)}catch(t){return Qn(e)}}(e):Qn(e)}function Kn(e){return!!(e&&e.__SENTRY__&&e.__SENTRY__.hub)}function Qn(e){return(0,_n.getGlobalSingleton)("hub",(()=>new Wn),e)}function Yn(e,t){return!!e&&((e.__SENTRY__=e.__SENTRY__||{}).hub=t,!0)}function Xn(e,t){return Zn().captureException(e,{captureContext:t})}const Jn=e=>{const t=document.createElement("canvas"),r=t.getContext("2d");let n=e.offsetHeight,i=e.offsetWidth;const a=e.srcObject.getVideoTracks()[0].getSettings(),s=a.width||0,o=a.height||0;if(s>o){i+=o-n,n=o;let a=s-i;a<0&&(a=0,i=s),t.width=i,t.height=Math.min(n,o),r?.drawImage(e,a/2,0,t.width,t.height,0,0,t.width,t.height)}else{n+=s-i,i=s;let a=o-n;a<0&&(a=0,n=o),t.width=Math.min(i,s),t.height=n,r?.drawImage(e,0,a/2,t.width,t.height,0,0,t.width,t.height)}return t.toDataURL("image/jpeg")},ei=async e=>{const t=document.createElement("video"),r=new MediaStream;r.addTrack(e),t.srcObject=r,t.setAttribute("muted","true");const n=e.getSettings();t.width=n.width||0,t.height=n.height||0,await t.play();const i=document.createElement("canvas"),a=i.getContext("2d");return i.height=t.height,i.width=t.width,a?.drawImage(t,0,0),i.toDataURL("image/jpeg")};var ti=a("4Fy4N");const ri={qvga:{width:{ideal:320},height:{ideal:240}},vga:{width:{ideal:640},height:{ideal:480}},hd:{width:{ideal:1280},height:{ideal:720}}};const ni=new class{pendingDeviceRequest={};joinOptions={};constructor(){this.iceServers=[{urls:"turns:t.snapcall.io:443?transport=tcp,turns:t-2.snapcall.io:443?transport=tcp"?.split(",")||[],username:"test",credential:"test",credentialType:"password"}],this.peers=new Map,this.consumers=new Map,this.webcams=new Map,this.webcam={device:null,resolution:"hd"},this.webcamTrack=null,this.webcamZoom={available:!1,min:0,max:0},this.muted=!1,this.roomId="",this.peerId="",this.webcamProducer=null,this.screenshareProducer=null,this.customMessages=new Map}onStartSpeak(){if(this.micProducer&&!this.micProducer.paused){const e=new CustomEvent("localStartSpeak");window.dispatchEvent(e),this.protoo.notify("startSpeak")}}onStopSpeak(){if(this.micProducer&&!this.micProducer.paused){const e=new CustomEvent("localStopSpeak");window.dispatchEvent(e),this.protoo.notify("stopSpeak")}}async generateToken(e){const{token:t}=await fetch("https://g.snapcall.io/stream/stream",{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify({bid:e})}).then((e=>e.json()));return t}async init(e=this.roomId,t=this.joinOptions){if(this.roomId=e,this.joinOptions=t,!this.roomId)throw new Error("Missing room ID");let r;this.peerId||(this.peerId=Dr());try{const{instanceId:t}=await fetch(`https://g.snapcall.io/stream/instance/${this.roomId}`,{method:"get",headers:{"Content-Type":"application/json"}}).then((e=>{if(e.ok)return e.json();throw new Error("Invalid room ID")}));r=`wss://g.snapcall.io/stream/${t}/?roomId=${e}&peerId=${this.peerId}`}catch(e){const t=new CustomEvent("invalidRoom");window.dispatchEvent(t)}if(!r)throw new Error("Invalid socket URL");this.protooTransport=new jr(r,{retry:{retries:0}}),this.protoo=new Tr(this.protooTransport),this.protoo.on("open",(()=>{this.joinRoom()})),this.protoo.on("disconnected",(()=>console.log("disconnected :("))),this.protoo.on("close",(()=>console.log("close :("))),this.protoo.on("notification",(async e=>{if(console.log("notification",e),"newPeer"===e.method){const{id:t,displayName:r}=e.data;this.peers.set(t,{id:t,displayName:r,producersData:[]});const n=new CustomEvent("newPeer",{detail:{id:t,displayName:r}});window.dispatchEvent(n)}else if("newProducer"===e.method){const{peerId:t,producerId:r,deviceType:n,paused:i}=e.data;await this.consumeProducer({peerId:t,producerId:r,deviceType:n,paused:i})}else if("peerClosed"===e.method){const{peerId:t,relatedConsumers:r}=e.data;r.forEach((e=>{this.onConsumerClose({consumerId:e.id})}));const n=new CustomEvent("peerClosed",{detail:{peerId:t}});window.dispatchEvent(n)}else if("consumerClosed"===e.method){const{consumerId:t}=e.data;this.onConsumerClose({consumerId:t})}else if("displayName"===e.method){const{peerId:t,displayName:r}=e.data,n=new CustomEvent("displayName",{detail:{peerId:t,displayName:r}});window.dispatchEvent(n)}else if("requestDevice"===e.method){this.pendingDeviceRequest[e.data.requestId]=e.data;const t=new CustomEvent("requestDevice",{detail:e.data});window.dispatchEvent(t)}else if("startSpeak"===e.method);else if("stopSpeak"===e.method);else if("producerPaused"===e.method||"producerResumed"===e.method){const t=new CustomEvent(e.method,{detail:e.data});window.dispatchEvent(t)}else if("requestDeviceResult"===e.method){const t=new CustomEvent(e.method,{detail:e.data});window.dispatchEvent(t)}else if("terminateRoom"===e.method){this.closeWebrtcTransport(this.sendAudioTransports),this.closeWebrtcTransport(this.recvAudioTransports),this.closeWebrtcTransport(this.sendVideoTransports),this.closeWebrtcTransport(this.recvVideoTransports);const t=new CustomEvent(e.method,{detail:e.data});window.dispatchEvent(t)}else if("customMessage"===e.method){const{messageId:t,chunk:r,chunkIndex:n,totalChunks:i}=e.data.event,a=this.customMessages.get(t);a?a.chunks.push({index:n,data:r}):this.customMessages.set(t,{chunks:[{index:n,data:r}],totalChunks:i});const s=this.customMessages.get(t);if(s&&s.totalChunks===s.chunks.length){const r=s.chunks.sort(((e,t)=>e.index-t.index)).reduce(((e,t)=>e+t.data),""),n=JSON.parse(r),i=new CustomEvent("customMessage",{detail:{...e.data,event:n}});window.dispatchEvent(i),this.customMessages.delete(t)}}}))}deviceAutoDetection(){try{const n=navigator.userAgent,i=ti.getParser(n);t="DeviceDetectionForced",r=!0,Zn().setTag(t,r),e={type:"debug",category:"browser",data:i.getResult()},Zn().addBreadcrumb(e);const a=i.getOS();if("Safari"===i.getBrowserName()&&"iOS"===a.name&&Number(a.version)>=14.3)return new Yr.Device({handlerName:"Safari12"});throw Error("failed to autoDetect browser, falling back to chrome 74")}catch(e){console.error(e),Xn(e),window.dispatchEvent(new CustomEvent("browserDetectionFailed"))}var e,t,r;return new Yr.Device({handlerName:"Chrome74"})}createDevice(){try{return new Yr.Device}catch(e){return console.error("failed to detects device from mediasoup, fallback on auto detection",e),this.deviceAutoDetection()}}closeWebrtcTransport(e){e?.transport.close(),clearTimeout(e?.disconnectTimeout)}async createTransportConfig(){const e=await this.protoo.request("createWebRtcTransport");return{id:e.id,iceParameters:e.iceParameters,iceCandidates:e.iceCandidates,dtlsParameters:{...e.dtlsParameters,role:"auto"},sctpParameters:e.sctpParameters,iceServers:this.iceServers,proprietaryConstraints:{optional:[{googDscp:!0}]},additionalSettings:{encodedInsertableStreams:!1}}}async createSendTransport(e){const t=this.mediasoupDevice.createSendTransport(await this.createTransportConfig());t.on("connect",(({dtlsParameters:e},r,n)=>{console.log("dtlsParameters",t.id,e),this.protoo.request("connectWebRtcTransport",{transportId:t.id,dtlsParameters:e}).then(r).catch(n)})),t.on("produce",(async({kind:e,rtpParameters:r,appData:n},i,a)=>{try{const{id:a}=await this.protoo.request("produce",{transportId:t.id,kind:e,rtpParameters:r,appData:n});i({id:a}),console.log("producerTransport: ",t)}catch(e){a(e)}}));const r={transport:t,disconnectTimeout:void 0,kind:e};return this.listenWebRTCTransportStats(r),r}async createRecvTransport(e){const t=this.mediasoupDevice.createRecvTransport(await this.createTransportConfig());t.on("connect",(({dtlsParameters:e},r,n)=>{console.log("dtls",t.id,e),this.protoo.request("connectWebRtcTransport",{transportId:t.id,dtlsParameters:e}).then(r).catch(n)}));const r={transport:t,disconnectTimeout:void 0,kind:e};return this.listenWebRTCTransportStats(r),r}listenWebRTCTransportStats(e){e.transport.on("connectionstatechange",(t=>{if(!e.transport.closed)if(console.log("recv connectionstatechange: ",t),"disconnected"===t)e.disconnectTimeout=setTimeout((()=>{console.log(`trying to restart transport for ${e.kind}`),this.restartIce(e.transport)}),5e3);else if("connected"===t)clearTimeout(e.disconnectTimeout);else if("failed"===t){const e=new Error("webRTC transport state failed");Xn(e),console.error("webrtc stat failed",e)}}))}async joinRoom(){if(this.mediasoupDevice=this.createDevice(),this.routerRtpCapabilities=await this.protoo.request("getRouterRtpCapabilities"),this.routerRtpCapabilities.headerExtensions=this.routerRtpCapabilities.headerExtensions?.filter((e=>"urn:3gpp:video-orientation"!==e.uri)),await this.mediasoupDevice.load({routerRtpCapabilities:this.routerRtpCapabilities}),this.recvAudioTransports=await this.createRecvTransport("audio"),this.sendAudioTransports=await this.createSendTransport("audio"),this.recvVideoTransports=await this.createRecvTransport("video"),this.sendVideoTransports=await this.createSendTransport("video"),this.joinOptions.apiKey&&this.joinOptions.email)try{await(async({apiKey:e,email:t})=>await fetch(`https://api.snapcall.io/v2/agents/${t}`,{method:"get",headers:{Authorization:`Bearer ${e}`}}).then((e=>{if(e.ok)return e.json();throw new Error("Invalid agent info")})))({apiKey:this.joinOptions.apiKey,email:this.joinOptions.email})&&window.dispatchEvent(new CustomEvent("agentIdentity",{detail:{success:!0,email:this.joinOptions.email}}))}catch(e){console.warn(e),window.dispatchEvent(new CustomEvent("agentIdentity",{detail:{success:!1}}))}const{peers:e}=await this.protoo.request("getRoomPeers",{apiKey:this.joinOptions.apiKey,email:this.joinOptions.email});this.peers=new Map(e.map((e=>[e.id,{...e}])));const t=await this.getCallId();window.dispatchEvent(new CustomEvent("enterRoom",{detail:{peerId:this.peerId,peers:e,callId:t}})),console.log("peers",e),this.joinOptions.displayName&&await this.setDisplayName(this.joinOptions.displayName),e.forEach((e=>{this.consumePeer({peerId:e.id,producersData:e.producersData})}))}async enableMicrophone(){if(!this.micProducer||this.micProducer?.closed){const e=await this.handleGetUserMediaError("microphone",navigator.mediaDevices.getUserMedia({audio:{noiseSuppression:!0,echoCancellation:!0}}));if(!this.sendAudioTransports)throw new Error("audio transport not found");this.audioLevel=new cn(e,this),this.audioLevel.analyse();const t=e.getAudioTracks()[0],r="microphone",n=await(this.sendAudioTransports?.transport.produce({track:t,codecOptions:{opusStereo:!0,opusDtx:!0},appData:{deviceType:r}}));n.on("transportclose",(()=>{console.log("micproducer transportclose")})),n.on("trackended",(async()=>{console.log("microphone disconnected!");const e=this.micProducer?.id;this.micProducer?.close(),this.micProducer=void 0,await this.protoo.request("closeProducer",{producerId:e})})),this.micProducer=n,this.muted=!1;const i=new CustomEvent("microphoneEnabled");window.dispatchEvent(i)}}async muteMicrophone(){if(this.micProducer){this.onStopSpeak(),this.micProducer?.pause(),await this.protoo.request("pauseProducer",{producerId:this.micProducer?.id}),this.muted=!0;const e=new CustomEvent("microphoneMute");window.dispatchEvent(e)}}async unMuteMicrophone(){if(this.micProducer){this.micProducer.resume(),this.resolvePendingDeviceRequest("microphone",!0),await this.protoo.request("resumeProducer",{producerId:this.micProducer.id}),this.muted=!1;const e=new CustomEvent("microphoneUnmute");window.dispatchEvent(e)}}async toggleMute(){return this.muted?(await this.unMuteMicrophone(),{muted:!1}):(await this.muteMicrophone(),{muted:!0})}endCall(){this.protoo.close(),this.protooTransport.close(),this.closeWebrtcTransport(this.sendAudioTransports),this.closeWebrtcTransport(this.recvAudioTransports),this.closeWebrtcTransport(this.sendVideoTransports),this.closeWebrtcTransport(this.recvVideoTransports),this.consumers.clear(),this.audioLevel?.release();const e=new CustomEvent("snapcallEvent_callEnd");window.dispatchEvent(e)}terminateRoom(){this.protoo.request("terminateRoom")}async updateWebcams(){this.webcams=new Map;const e=await navigator.mediaDevices.enumerateDevices();for(const t of e)"videoinput"===t.kind&&this.webcams.set(t.deviceId,t);0===this.webcams.size?this.webcam.device=null:this.webcam.device||(this.webcam.device=this.webcams.values().next().value);const t=new CustomEvent("webcamsUpdate",{detail:{numberOfAvailableWebcams:this.webcams.size}});window.dispatchEvent(t)}isVideoZoomAvailable(){return this.webcamZoom.available}resolvePendingDeviceRequest(e,t,r){Object.keys(this.pendingDeviceRequest).forEach((n=>{const i=this.pendingDeviceRequest[n];e===i.deviceType&&(delete this.pendingDeviceRequest[n],this.protoo.notify("requestDeviceResult",{result:Boolean(t),failure:r,...i}))}))}async handleGetUserMediaError(e,t){let r,n;try{r=await t}catch(e){n=e}finally{if(this.resolvePendingDeviceRequest(e,Boolean(r),n?.name),n)throw n;return r}}async restartIce(e){if(console.log("restartIce",e.connectionState,e.closed),"disconnected"===e.connectionState&&!e.closed)try{const t=await this.protoo.request("restartIce",{transportId:e.id});console.log(t),await e.restartIce({iceParameters:t})}catch(e){console.log("restartIceFailed",e),Xn(e)}}async enableVideo(){await this.updateWebcams();const{resolution:e}=this.webcam;if(!this.webcam.device)throw new Error("no webcam devices");const t=await this.handleGetUserMediaError("webcam",navigator.mediaDevices.getUserMedia({video:{deviceId:{ideal:this.webcam.device.deviceId},...ri[e]}}));if(!this.sendVideoTransports)throw new Error("video transport not found");const r=t.getVideoTracks()[0];this.webcamTrack=r;const n=await(r.getCapabilities?.())||navigator.mediaDevices.getSupportedConstraints?.();this.webcamZoom={available:Boolean(n?.zoom),min:n?.zoom?.min||0,max:n?.zoom?.max||0};this.webcamProducer=await this.sendVideoTransports.transport.produce({track:r,encodings:undefined,codecOptions:{videoGoogleStartBitrate:1e3},appData:{deviceType:"webcam"}}),this.webcamProducer.on("transportclose",(()=>{this.webcamProducer=null})),this.webcamProducer.on("trackended",(()=>{this.disableVideo().catch((()=>{}))}));const i=new CustomEvent("localVideoAvailable");window.dispatchEvent(i)}async rotateVideo(){await this.updateWebcams();const e=Array.from(this.webcams.keys()),t=this.webcam?.device?.deviceId||"unknow";let r=e.indexOf(t);r<e.length-1?r++:r=0;const n=this.webcams.get(e[r]);if(!n)throw new Error("no webcam device");this.webcam.device=n,this.webcam.resolution="hd",this.webcamProducer?.track?.stop?.();const i=(await navigator.mediaDevices.getUserMedia({video:{deviceId:{exact:this.webcam.device.deviceId},...ri[this.webcam.resolution]}})).getVideoTracks()[0];this.webcamTrack=i,await(this.webcamProducer?.replaceTrack?.({track:i}));const a=await i.getCapabilities();this.webcamZoom={available:Boolean(a.zoom),min:a?.zoom?.min||0,max:a?.zoom?.max||0};const s=new CustomEvent("localVideoRotate");window.dispatchEvent(s)}async zoomVideo(){if(!this.webcamZoom.available)throw new Error("Webcam zoom is not available");if(!this.webcamTrack)throw new Error("No webcam track available");this.webcamTrack.applyConstraints({advanced:[{zoom:2*this.webcamZoom.min}]})}async unzoomVideo(){if(!this.webcamZoom.available)throw new Error("Webcam zoom is not available");if(!this.webcamTrack)throw new Error("No webcam track available");this.webcamTrack.applyConstraints({advanced:[{zoom:this.webcamZoom.min}]})}async disableVideo(){if(!this.webcamProducer)return;this.webcamProducer.close(),await this.protoo.request("closeProducer",{producerId:this.webcamProducer.id}),this.webcamProducer=null;const e=new CustomEvent("localVideoUnavailable");window.dispatchEvent(e)}async enableScreenshare(){const e=await this.handleGetUserMediaError("screen",navigator.mediaDevices.getDisplayMedia({audio:!1,video:{displaySurface:"monitor",logicalSurface:!0,width:{max:1920},height:{max:1080},frameRate:{max:30}}}));if(!e)return;if(!this.sendVideoTransports)throw new Error("video screen transport not found");const t=e.getVideoTracks()[0];this.screenshareProducer=await this.sendVideoTransports.transport.produce({track:t,encodings:undefined,codecOptions:{videoGoogleStartBitrate:1e3},appData:{deviceType:"screen",share:!0}}),this.screenshareProducer.on("transportclose",(()=>{this.screenshareProducer=null})),this.screenshareProducer.on("trackended",(()=>{this.disableScreenshare().catch((()=>{}))}));const r=new CustomEvent("screenshareEnabled");window.dispatchEvent(r)}async disableScreenshare(){this.screenshareProducer&&(this.screenshareProducer.close(),await this.protoo.request("closeProducer",{producerId:this.screenshareProducer.id}),this.screenshareProducer=null);const e=new CustomEvent("screenshareDisabled");window.dispatchEvent(e)}onConsumerClose({consumerId:e}){const t=this.consumers.get(e);if(t){t.mediaSoupConsumer.close(),this.consumers.delete(e);const r=new CustomEvent("consumerClose",{detail:{peerId:t.mediaSoupConsumer.appData.peerId,deviceType:t.deviceType}});window.dispatchEvent(r)}}requestVoice({consumerId:e,element:t}){const r=this.consumers.get(e);if(r){const e=new MediaStream;e.addTrack(r.mediaSoupConsumer.track),t.srcObject=e}else console.error(`Audio consumer ${e} not found`)}requestVideo({consumerId:e,element:t}){const r=this.consumers.get(e);if(r){const e=new MediaStream;e.onremovetrack=()=>console.log("Remove Track"),r.mediaSoupConsumer.track.onended=()=>console.log("Track Ended"),e.addTrack(r.mediaSoupConsumer.track),t.srcObject=e}else console.error(`Video consumer ${r} not found`)}async captureVideo(e){let t;if(e)t=Jn(e);else{if(!this.webcamProducer||!this.webcamProducer.track)throw new Error("no video to capture");t=await ei(this.webcamProducer.track)}return t}requestLocalVideo(e){if(this.webcamProducer){const t=new MediaStream;t.addTrack(this.webcamProducer.track),e.srcObject=t;const r=this.webcamProducer.track?.getSettings();return{facingMode:r?.facingMode||"user"}}throw new Error("webcam producer not available yet")}requestLocalScreenshare(e){if(this.screenshareProducer){const t=new MediaStream;t.addTrack(this.screenshareProducer.track),e.srcObject=t}else console.log("screenshare producer not available yet")}consumePeer({peerId:e,producersData:t}){t.forEach((t=>{this.consumeProducer({peerId:e,producerId:t.producerId,deviceType:t.deviceType,paused:t.paused})}))}getRecvTransport(e){return"microphone"===e?this.recvAudioTransports:this.recvVideoTransports}async consumeProducer({peerId:e,producerId:t,deviceType:r,paused:n}){const i=this.getRecvTransport(r);if(!i)throw new Error(`transport for ${r} not found`);const a=await this.protoo.request("consume",{peerId:e,producerId:t,transportId:i.transport.id,rtpCapabilities:this.mediasoupDevice.rtpCapabilities}),{producerId:s,id:o,kind:c,rtpParameters:l,appData:d}=a;console.log("Data: ",a);try{const t=await i.transport.consume({id:o,producerId:s,kind:c,rtpParameters:l,appData:{...d,peerId:e}});console.log("transport",i.transport),console.log("consumer",t),this.consumers.set(t.id,{mediaSoupConsumer:t,deviceType:r});const a=new CustomEvent("newConsumer",{detail:{peerId:e,consumerId:t.id,deviceType:r,paused:n}});window.dispatchEvent(a),"video"===t.kind&&await this.protoo.request("resumeConsumer",{consumerId:t.id})}catch(e){throw console.error("newConsumer request failed",e),e}}async setDisplayName(e){this.displayName=e,await this.protoo.request("setDisplayName",{displayName:e});const t=new CustomEvent("selfDisplayName",{detail:{displayName:e}});window.dispatchEvent(t)}async requestPeerDevice(e,t){return this.protoo.request("requestPeerDevice",{remotePeerId:e,deviceType:t})}denyDeviceRequest(e){this.resolvePendingDeviceRequest(e,!1,"user denied permission")}async getCallId(){try{const{callId:e}=await this.protoo.request("getCallId");return e}catch(e){throw console.error("Failed to get callId"),e}}getConsumers(){return this.consumers}getDevicesState(){const e=!!this.micProducer&&!this.micProducer.closed,t=!!this.webcamProducer&&!this.webcamProducer.closed,r=!!this.screenshareProducer&&!this.screenshareProducer.closed;return{microphone:{enabled:e,muted:this.muted},camera:{enabled:t},screenshare:{enabled:r}}}getCustomMessageEventChunks(e){const t=JSON.stringify(e),r=[];for(let e=0;e<t.length;e+=9e4)r.push(t.substring(e,e+9e4));return r}async sendCustomMessageToAll(e){const t=Dr(),r=this.getCustomMessageEventChunks(e),n=r.map(((e,n)=>this.protoo.notify("customMessageToAllPeers",{messageId:t,chunkIndex:n,chunk:e,totalChunks:r.length})));await Promise.all(n)}async sendCustomMessage(e,t){const r=Dr(),n=this.getCustomMessageEventChunks(t),i=n.map(((t,i)=>this.protoo.notify("customMessageToPeer",{peerId:e,event:{messageId:r,chunkIndex:i,chunk:t,totalChunks:n.length}})));await Promise.all(i)}};var ii=(0,(u=a("85Hg2")).createContext)({});u=a("85Hg2");let ai;var si;(si=ai||(ai={}))[si.SET_STREAMS=0]="SET_STREAMS",si[si.ADD_STREAM=1]="ADD_STREAM",si[si.REMOVE_STREAM=2]="REMOVE_STREAM",si[si.DEVICE_UPDATE=3]="DEVICE_UPDATE",si[si.MUTE=4]="MUTE",si[si.UNMUTE=5]="UNMUTE",si[si.SET_HIGHLIGHTED_TILE=6]="SET_HIGHLIGHTED_TILE",si[si.UNSET_HIGHLIGHTED_TILE=7]="UNSET_HIGHLIGHTED_TILE",si[si.SET_STREAM_DISPLAY_NAME=8]="SET_STREAM_DISPLAY_NAME",si[si.SET_STREAM_SPEAKING=9]="SET_STREAM_SPEAKING";const oi={streams:[],highlightedTile:null},ci=(e,t)=>{switch(t.type){case ai.SET_STREAMS:return{...e,streams:t.payload};case ai.ADD_STREAM:return e.streams.find((e=>e.id===t.payload.id))?e:{...e,streams:[...e.streams,t.payload]};case ai.REMOVE_STREAM:return{...e,streams:[...e.streams.filter((e=>e.id!==t.payload.id))]};case ai.DEVICE_UPDATE:{const{streamId:r,consumerId:n,device:i,available:a,paused:s}=t.payload;return{...e,streams:e.streams.map((e=>{if(e.id===r){let t=e.muted;return"microphone"===i&&(t=s),{...e,[i]:a?n:null,muted:t}}return e}))}}case ai.MUTE:return{...e,streams:e.streams.map((e=>e.id===t.payload.streamId?{...e,muted:!0}:e))};case ai.UNMUTE:return{...e,streams:e.streams.map((e=>e.id===t.payload.streamId?{...e,muted:!1}:e))};case ai.SET_HIGHLIGHTED_TILE:return{...e,highlightedTile:t.payload};case ai.UNSET_HIGHLIGHTED_TILE:return{...e,highlightedTile:null};case ai.SET_STREAM_DISPLAY_NAME:return{...e,streams:e.streams.map((e=>e.id===t.payload.streamId?{...e,displayName:t.payload.displayName}:e))};case ai.SET_STREAM_SPEAKING:return{...e,streams:e.streams.map((e=>e.id===t.payload.streamId?{...e,isSpeaking:t.payload.isSpeaking}:e))};default:return e}},li=(0,u.createContext)(void 0),di=({children:e})=>{const[t,r]=(0,u.useReducer)(ci,oi),n={state:t,dispatch:r};return(0,s.jsx)(li.Provider,{value:n,children:e})},ui=()=>{const e=(0,u.useContext)(li);if(void 0===e)throw new Error("useStreams must be used within a StreamsProvider");return{streams:e.state.streams,highlightedTile:e.state.highlightedTile,dispatch:e.dispatch}};var pi=e=>navigator.clipboard?navigator.clipboard.writeText(e):new Promise(((t,r)=>{((e,t,r)=>{const n=document.createRange(),i=document.createElement("textarea");if(i.value=e,document.body.appendChild(i),navigator.userAgent.match(/ipad|ipod|iphone/i)){i.readOnly=!1,i.contentEditable="true",n.selectNodeContents(i);const e=window.getSelection();e&&(e.removeAllRanges(),e.addRange(n)),i.setSelectionRange(0,999999)}else i.focus(),i.select();try{document.execCommand("copy")?t():r(new Error("Copy to clipboard fallback failed"))}catch(e){e instanceof Error?r(e):console.error(e)}document.body.removeChild(i)})(e,t,r)}));const fi=Je.path`
|
|
12
|
+
fill: ${e=>e.theme.logoColor};
|
|
13
|
+
stroke: ${e=>e.stroke?e.theme.logoColor:"unset"};
|
|
14
|
+
`,hi=()=>(0,s.jsx)("svg",{width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)(fi,{d:"M7.82 15.328c.806 0 1.48-.668 1.243-1.438a4.788 4.788 0 0 0-1.143-1.93 4.579 4.579 0 0 0-3.28-1.396c-1.231 0-2.411.502-3.281 1.395a4.788 4.788 0 0 0-1.143 1.93c-.237.771.438 1.44 1.244 1.44h6.36ZM7.513 0C6.706 0 6.03.668 6.269 1.438a4.788 4.788 0 0 0 1.142 1.93 4.58 4.58 0 0 0 3.281 1.396c1.23 0 2.411-.502 3.281-1.395.531-.545.92-1.209 1.143-1.93C15.353.667 14.678 0 13.872 0h-6.36ZM10.692 13.868c0 .807.67 1.482 1.435 1.227a4.622 4.622 0 0 0 1.846-1.162 4.83 4.83 0 0 0 1.36-3.369 4.83 4.83 0 0 0-1.36-3.369 4.62 4.62 0 0 0-1.846-1.162c-.764-.255-1.435.42-1.435 1.227v6.608ZM4.64 1.46c0-.806-.67-1.482-1.435-1.226a4.62 4.62 0 0 0-1.846 1.161A4.83 4.83 0 0 0 0 4.765a4.83 4.83 0 0 0 1.359 3.368 4.62 4.62 0 0 0 1.846 1.162c.765.255 1.435-.42 1.435-1.226v-6.61Z"})}),mi=()=>(0,s.jsx)("svg",{width:"71",height:"17",viewBox:"17 0 71 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)(fi,{d:"M27.445 13.543c-1.288 0-2.324-.206-3.107-.618-.773-.422-1.355-.948-1.747-1.576a.327.327 0 0 1 .108-.448l.882-.665a.253.253 0 0 1 .185-.077c.093 0 .18.056.263.17.69 1.112 1.85 1.669 3.477 1.669.712 0 1.314-.129 1.809-.387.505-.257.757-.67.757-1.236 0-.422-.144-.752-.432-.989-.279-.237-.712-.448-1.299-.634-.536-.164-.87-.262-1.005-.293a32.224 32.224 0 0 1-1.916-.603c-.99-.37-1.644-.798-1.963-1.282-.32-.485-.48-.99-.48-1.515 0-.433.135-.896.402-1.39.279-.506.712-.933 1.299-1.283.598-.361 1.345-.541 2.241-.541.938 0 1.726.118 2.365.355.639.227 1.247.608 1.824 1.144.072.072.108.144.108.216 0 .103-.051.186-.155.247l-.989.665a.414.414 0 0 1-.2.077c-.093 0-.181-.046-.263-.139-.619-.66-1.469-.989-2.55-.989-.619 0-1.098.093-1.438.278-.33.186-.551.392-.665.618a1.486 1.486 0 0 0-.154.603c0 .37.144.67.432.896.289.227.716.433 1.283.618.052.021.448.14 1.19.356.464.123.943.263 1.438.417 1.082.36 1.803.82 2.164 1.375.37.557.556 1.093.556 1.608 0 .556-.134 1.087-.402 1.591-.257.505-.716.928-1.375 1.268-.65.33-1.53.494-2.643.494ZM37.403 5.06c.773 0 1.489.226 2.148.679.66.443.99 1.262.99 2.457v4.837c0 .103-.031.186-.093.247-.052.052-.13.078-.232.078H39.21a.374.374 0 0 1-.247-.078.374.374 0 0 1-.077-.247V8.46c-.031-.587-.196-1.051-.495-1.39-.289-.34-.665-.51-1.128-.51-.33 0-.66.092-.99.277-.32.175-.592.448-.819.82-.227.36-.36.813-.402 1.36v4.017c0 .103-.03.186-.092.247-.052.052-.13.078-.232.078h-1.005a.373.373 0 0 1-.247-.078.374.374 0 0 1-.078-.247V5.585c0-.104.026-.18.078-.232a.334.334 0 0 1 .247-.093h1.005c.103 0 .18.03.232.093.061.051.092.128.092.232v.185c0 .072.01.129.031.17.031.03.067.046.108.046.083 0 .191-.056.325-.17a3.58 3.58 0 0 1 .927-.556c.34-.134.66-.2.959-.2ZM49.302 10.916c.02.309.072.551.155.726.082.165.257.294.525.386.165.062.248.15.248.263a.364.364 0 0 1-.047.155l-.432.865c-.083.186-.217.252-.402.201-.598-.134-1.01-.428-1.237-.88-.052-.114-.103-.17-.155-.17-.051 0-.108.04-.17.123-.535.649-1.406.973-2.612.973-.731 0-1.324-.128-1.777-.386-.443-.258-.758-.567-.943-.927-.185-.371-.278-.726-.278-1.066 0-.557.17-1.056.51-1.5.35-.442.87-.752 1.561-.927.474-.113 1.134-.2 1.978-.262.577-.042.995-.083 1.252-.124.206-.03.3-.155.279-.37-.052-.464-.206-.835-.464-1.114-.247-.288-.665-.432-1.252-.432-.381 0-.747.082-1.098.247-.34.155-.602.428-.788.819-.093.196-.227.263-.402.2l-.943-.262c-.164-.051-.247-.139-.247-.262 0-.031.01-.078.031-.14a2.977 2.977 0 0 1 1.221-1.421c.567-.36 1.304-.541 2.21-.541.886 0 1.639.232 2.257.695.618.454.948 1.113.99 1.978.01.412.015.964.015 1.654.01.69.015 1.19.015 1.499Zm-3.864 1.313c.278 0 .582-.067.912-.2.34-.134.639-.366.896-.696.268-.34.433-.793.495-1.36v-.03c0-.104-.03-.181-.093-.233-.061-.061-.144-.082-.247-.061l-.603.061a17.05 17.05 0 0 0-1.638.217 2.807 2.807 0 0 0-1.067.402.898.898 0 0 0-.433.803c0 .423.186.711.557.866.371.154.778.231 1.221.231ZM55.598 5.06c.99 0 1.757.236 2.303.71.547.464.918 1.015 1.113 1.653.196.629.294 1.257.294 1.886 0 .628-.098 1.262-.294 1.9-.195.63-.566 1.18-1.113 1.654-.546.464-1.313.696-2.303.696-.803 0-1.473-.217-2.009-.65-.072-.072-.144-.108-.216-.108-.103 0-.155.088-.155.263v3.245c0 .103-.03.18-.093.232-.051.062-.128.093-.231.093h-.928a.335.335 0 0 1-.247-.093c-.052-.051-.077-.129-.077-.232V5.584c0-.103.025-.18.077-.231a.334.334 0 0 1 .247-.093h.928c.103 0 .18.03.231.093.062.051.093.128.093.232 0 .082.01.149.031.2.031.042.067.062.108.062.052 0 .098-.02.14-.062.545-.484 1.246-.726 2.101-.726Zm-.154 7.077c.793 0 1.375-.273 1.746-.82.382-.545.572-1.215.572-2.008 0-.793-.19-1.463-.572-2.01-.37-.545-.953-.818-1.746-.818-.783 0-1.355.273-1.716.819-.35.536-.525 1.205-.525 2.009 0 .803.175 1.478.525 2.024.36.536.933.804 1.716.804ZM66.122 13.543c-1.174 0-2.19-.253-3.045-.757a4.991 4.991 0 0 1-1.932-2.071c-.433-.886-.649-1.89-.649-3.014 0-1.123.216-2.122.65-2.998a4.97 4.97 0 0 1 1.931-2.086c.856-.505 1.87-.757 3.045-.757 1.113 0 2.077.227 2.89.68a4.896 4.896 0 0 1 1.933 1.9c.03.062.046.12.046.17 0 .114-.077.196-.232.248L69.6 5.15a.342.342 0 0 1-.108.016c-.134 0-.237-.067-.31-.201-.638-1.05-1.658-1.576-3.06-1.576-.865 0-1.582.2-2.148.602a3.541 3.541 0 0 0-1.252 1.592 5.497 5.497 0 0 0-.402 2.117c0 .763.134 1.468.402 2.117a3.555 3.555 0 0 0 1.252 1.577c.566.402 1.283.602 2.148.602.814 0 1.52-.19 2.118-.571.608-.382 1.04-.964 1.298-1.747.072-.195.201-.278.387-.247l1.174.155c.175.03.263.113.263.247a.93.93 0 0 1-.03.154c-.454 1.185-1.114 2.076-1.98 2.674-.855.587-1.931.88-3.23.88ZM79.474 10.916c.02.309.072.551.155.726.082.165.257.294.525.386.165.062.248.15.248.263a.364.364 0 0 1-.047.155l-.433.865c-.082.186-.216.252-.401.201-.598-.134-1.01-.428-1.237-.88-.052-.114-.103-.17-.155-.17-.051 0-.108.04-.17.123-.535.649-1.406.973-2.612.973-.731 0-1.324-.128-1.777-.386-.443-.258-.758-.567-.943-.927-.186-.371-.278-.726-.278-1.066a2.4 2.4 0 0 1 .51-1.5c.35-.442.87-.752 1.56-.927.475-.113 1.134-.2 1.98-.262.576-.042.994-.083 1.251-.124.206-.03.3-.155.278-.37-.051-.464-.206-.835-.463-1.114-.248-.288-.665-.432-1.252-.432-.381 0-.747.082-1.098.247-.34.155-.602.428-.788.819-.093.196-.227.263-.402.2l-.943-.262c-.165-.051-.247-.139-.247-.262 0-.031.01-.078.03-.14a2.979 2.979 0 0 1 1.222-1.421c.567-.36 1.303-.541 2.21-.541.887 0 1.639.232 2.257.695.618.454.948 1.113.99 1.978.01.412.015.964.015 1.654.01.69.015 1.19.015 1.499Zm-3.864 1.313c.278 0 .582-.067.912-.2.34-.134.639-.366.896-.696.268-.34.433-.793.495-1.36v-.03c0-.104-.03-.181-.093-.233-.062-.061-.144-.082-.247-.061l-.603.061c-.67.062-1.216.134-1.638.217a2.808 2.808 0 0 0-1.067.402.898.898 0 0 0-.432.803c0 .423.185.711.556.866.37.154.778.231 1.221.231ZM83.467 13.033c0 .103-.03.185-.092.247-.052.052-.13.077-.232.077h-1.005a.374.374 0 0 1-.247-.077.374.374 0 0 1-.078-.247V2.354c0-.103.026-.18.078-.232a.335.335 0 0 1 .247-.092h1.005c.103 0 .18.03.232.093.061.051.092.128.092.231v10.679ZM87.35 13.033c0 .103-.03.185-.093.247-.051.052-.129.077-.232.077h-1.004a.374.374 0 0 1-.248-.077.374.374 0 0 1-.077-.247V2.354c0-.103.026-.18.078-.232a.334.334 0 0 1 .247-.092h1.004c.103 0 .18.03.232.093.062.051.093.128.093.231v10.679Z",stroke:"#fff",strokeWidth:".5"})});var gi=({size:e="large"})=>"small"===e?(0,s.jsx)(hi,{}):"medium"===e?(0,s.jsx)(mi,{}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(hi,{}),(0,s.jsx)(mi,{})]});const vi=()=>(0,s.jsx)("svg",{width:"21",height:"20",viewBox:"0 0 21 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M17.5 0h-10a3 3 0 0 0-3 3v1h-1a3 3 0 0 0-3 3v10a3 3 0 0 0 3 3h10a3 3 0 0 0 3-3v-1h1a3 3 0 0 0 3-3V3a3 3 0 0 0-3-3Zm-3 17a1 1 0 0 1-1 1h-10a1 1 0 0 1-1-1v-7h12v7Zm0-9h-12V7a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1Zm4 5a1 1 0 0 1-1 1h-1V7a3 3 0 0 0-.18-1h2.18v7Zm0-9h-12V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1Z",fill:"#fff"})}),yi=()=>(0,s.jsx)("svg",{width:"19",height:"20",viewBox:"0 0 19 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M18.5 6.94a1.307 1.307 0 0 0-.06-.27v-.09a1.07 1.07 0 0 0-.19-.28l-6-6a1.07 1.07 0 0 0-.28-.19.32.32 0 0 0-.09 0 .88.88 0 0 0-.33-.11H7.5a3 3 0 0 0-3 3v1h-1a3 3 0 0 0-3 3v10a3 3 0 0 0 3 3h8a3 3 0 0 0 3-3v-1h1a3 3 0 0 0 3-3V6.94Zm-6-3.53L15.09 6H13.5a1 1 0 0 1-1-1V3.41Zm0 13.59a1 1 0 0 1-1 1h-8a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h1v7a3 3 0 0 0 3 3h5v1Zm4-4a1 1 0 0 1-1 1h-8a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1h3v3a3 3 0 0 0 3 3h3v5Z",fill:"#fff"})}),wi=()=>(0,s.jsx)("svg",{width:"23",height:"22",viewBox:"0 0 23 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M7.5 20h-4a1 1 0 0 1-1-1v-4a1 1 0 1 0-2 0v4a3 3 0 0 0 3 3h4a1 1 0 0 0 0-2Zm14-6a1 1 0 0 0-1 1v4a1 1 0 0 1-1 1h-4a1 1 0 0 0 0 2h4a3 3 0 0 0 3-3v-4a1 1 0 0 0-1-1Zm-2-14h-4a1 1 0 1 0 0 2h4a1 1 0 0 1 1 1v4a1 1 0 0 0 2 0V3a3 3 0 0 0-3-3Zm-18 8a1 1 0 0 0 1-1V3a1 1 0 0 1 1-1h4a1 1 0 0 0 0-2h-4a3 3 0 0 0-3 3v4a1 1 0 0 0 1 1Zm8-4h-4a1 1 0 0 0-1 1v4a1 1 0 0 0 1 1h4a1 1 0 0 0 1-1V5a1 1 0 0 0-1-1Zm-1 4h-2V6h2v2Zm5 2h4a1 1 0 0 0 1-1V5a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v4a1 1 0 0 0 1 1Zm1-4h2v2h-2V6Zm-5 6h-4a1 1 0 0 0-1 1v4a1 1 0 0 0 1 1h4a1 1 0 0 0 1-1v-4a1 1 0 0 0-1-1Zm-1 4h-2v-2h2v2Zm5-1a1 1 0 0 0 1-1 1 1 0 0 0 0-2h-1a1 1 0 0 0-1 1v1a1 1 0 0 0 1 1Zm4-3a1 1 0 0 0-1 1v3a1 1 0 0 0 0 2h1a1 1 0 0 0 1-1v-4a1 1 0 0 0-1-1Zm-4 4a1 1 0 1 0 0 2 1 1 0 0 0 0-2Z",fill:"#fff"})}),bi=()=>(0,s.jsx)("svg",{width:"21",height:"20",viewBox:"0 0 21 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"m19.82 7.55-1.89-.63.89-1.78A1 1 0 0 0 18.63 4L16.5 1.87a1 1 0 0 0-1.15-.19l-1.78.89-.63-1.89A1 1 0 0 0 12 0H9a1 1 0 0 0-.95.68l-.63 1.89-1.78-.89a1 1 0 0 0-1.14.19L2.37 4a1 1 0 0 0-.19 1.15l.89 1.78-1.89.63a1 1 0 0 0-.68.94v3a1 1 0 0 0 .68.95l1.89.63-.89 1.78A1 1 0 0 0 2.37 16l2.13 2.13a1 1 0 0 0 1.15.19l1.78-.89.63 1.89a1 1 0 0 0 .95.68h3a1 1 0 0 0 .95-.68l.63-1.89 1.78.89a1 1 0 0 0 1.13-.19L18.63 16a1 1 0 0 0 .19-1.15l-.89-1.78 1.89-.63a1 1 0 0 0 .68-.94v-3a1 1 0 0 0-.68-.95Zm-1.32 3.23-1.2.4A2 2 0 0 0 16.14 14l.57 1.14-1.1 1.1-1.11-.6a2 2 0 0 0-2.79 1.16l-.4 1.2H9.72l-.4-1.2a2 2 0 0 0-2.82-1.16l-1.14.57-1.1-1.1.6-1.11a2 2 0 0 0-1.16-2.82l-1.2-.4V9.22l1.2-.4A2 2 0 0 0 4.86 6l-.57-1.11 1.1-1.1 1.11.57A2 2 0 0 0 9.32 3.2l.4-1.2h1.56l.4 1.2a2 2 0 0 0 2.82 1.16l1.14-.57 1.1 1.1-.6 1.11a2 2 0 0 0 1.16 2.79l1.2.4v1.59ZM10.5 6a4 4 0 1 0 0 8 4 4 0 0 0 0-8Zm0 6a2 2 0 1 1 0-4 2 2 0 0 1 0 4Z",fill:"#fff"})}),_i=()=>(0,s.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M4 12a1 1 0 0 0 1 1h7.59l-2.3 2.29a1.002 1.002 0 0 0 .325 1.639 1 1 0 0 0 1.095-.219l4-4a1 1 0 0 0 .21-.33 1 1 0 0 0 0-.76 1 1 0 0 0-.21-.33l-4-4a1.003 1.003 0 1 0-1.42 1.42l2.3 2.29H5a1 1 0 0 0-1 1ZM17 2H7a3 3 0 0 0-3 3v3a1 1 0 0 0 2 0V5a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1v-3a1 1 0 1 0-2 0v3a3 3 0 0 0 3 3h10a3 3 0 0 0 3-3V5a3 3 0 0 0-3-3Z",fill:"#fff"})}),xi=()=>(0,s.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M4.91 13.1a1 1 0 0 0 .85.47A1 1 0 0 0 6.61 12a17 17 0 0 1-2.47-6.85 1 1 0 0 1 .578-1.06A1 1 0 0 1 5.13 4h3a1 1 0 0 1 1 .8c0 .23.08.44.13.67v.13c.116.525.273 1.04.47 1.54l-1.39.66a1 1 0 0 0-.52.57 1 1 0 0 0 0 .77c.1.21.2.42.32.64a1 1 0 0 0 1.755-.028 1 1 0 0 0 .115-.542l.57-.21a2 2 0 0 0 1.05-2.48 9.317 9.317 0 0 1-.39-1.3v-.1c0-.2-.08-.4-.11-.58A3 3 0 0 0 8.16 2h-3a3 3 0 0 0-2.28 1 3 3 0 0 0-.72 2.39 19.05 19.05 0 0 0 2.75 7.71Zm14.61-.21-.6-.11h-.08a9.325 9.325 0 0 1-1.33-.39 2 2 0 0 0-2.47 1l-.21.46a12.392 12.392 0 0 1-1.92-1.37l8.8-8.79a1.004 1.004 0 1 0-1.42-1.42l-18 18a.999.999 0 0 0 0 1.42 1 1 0 0 0 1.42 0l4.59-4.6a19.09 19.09 0 0 0 10.29 4.73c.133.01.267.01.4 0a3 3 0 0 0 2-.75 3 3 0 0 0 1-2.25v-3a3 3 0 0 0-2.47-2.93Zm.48 6a.999.999 0 0 1-.718.96 1 1 0 0 1-.432.03 17.07 17.07 0 0 1-9.14-4.18l1.77-1.77a14.695 14.695 0 0 0 3.38 2.21 1.002 1.002 0 0 0 .77 0 1 1 0 0 0 .57-.52l.62-1.41c.522.194 1.056.35 1.6.47h.11l.69.13a1 1 0 0 1 .78 1v3.08Z",fill:"#D84949"})}),Si=()=>(0,s.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M12.83 13.45a1 1 0 0 0-1.66 0l-4 6a1 1 0 0 0 0 1A1 1 0 0 0 8 21h8a1 1 0 0 0 .88-.53 1 1 0 0 0-.05-1l-4-6.02ZM9.87 19 12 15.8l2.13 3.2H9.87ZM19 3H5a3 3 0 0 0-3 3v9a3 3 0 0 0 3 3h.85a1 1 0 0 0 0-2H5a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1h-.85a1 1 0 0 0 0 2H19a3 3 0 0 0 3-3V6a3 3 0 0 0-3-3Z",fill:"#fff"})});u=a("85Hg2"),u=a("85Hg2");const ki=(e,t)=>((0,u.useEffect)((()=>{const r=r=>{e?.current?.contains(r.target)||t()};if(e?.current)return window.addEventListener("click",r),()=>window.removeEventListener("click",r)}),[e,t]),null),Ei=Je.div`
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
padding: 6px 8px;
|
|
18
|
+
`,Ri=Je.div`
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
padding: 4px 0;
|
|
22
|
+
background-color: ${e=>e.theme.controlsBackgroundColor};
|
|
23
|
+
border-radius: 10px;
|
|
24
|
+
white-space: nowrap;
|
|
25
|
+
max-height: 70vh;
|
|
26
|
+
overflow: auto;
|
|
27
|
+
|
|
28
|
+
${Ei}:not(:last-child) {
|
|
29
|
+
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
|
|
30
|
+
}
|
|
31
|
+
`,Ci=Je.div`
|
|
32
|
+
font-size: 12px;
|
|
33
|
+
font-weight: 400;
|
|
34
|
+
line-height: 14px;
|
|
35
|
+
color: #d4d4d4;
|
|
36
|
+
margin-left: 16px;
|
|
37
|
+
padding: 5px 0;
|
|
38
|
+
`,Pi=Je.button`
|
|
39
|
+
display: flex;
|
|
40
|
+
align-items: center;
|
|
41
|
+
font-size: 16px;
|
|
42
|
+
font-weight: 600;
|
|
43
|
+
color: ${e=>e.danger?"#d84949":e.theme.settingsTextColor};
|
|
44
|
+
background-color: transparent;
|
|
45
|
+
border: none;
|
|
46
|
+
text-align: left;
|
|
47
|
+
padding: 12px 14px;
|
|
48
|
+
border-radius: 8px;
|
|
49
|
+
|
|
50
|
+
&:hover {
|
|
51
|
+
background-color: #424242;
|
|
52
|
+
}
|
|
53
|
+
`,Ti=Je.span`
|
|
54
|
+
display: flex;
|
|
55
|
+
margin-right: 12px;
|
|
56
|
+
|
|
57
|
+
svg,
|
|
58
|
+
img {
|
|
59
|
+
max-height: 22px;
|
|
60
|
+
}
|
|
61
|
+
`,ji=Je.span`
|
|
62
|
+
font-size: 9px;
|
|
63
|
+
font-weight: 900;
|
|
64
|
+
line-height: 10px;
|
|
65
|
+
color: #ffb800;
|
|
66
|
+
margin-left: 8px;
|
|
67
|
+
`;var Mi=({categories:e})=>(0,s.jsx)(Ri,{children:e.map((e=>(0,s.jsxs)(Ei,{children:[e.title&&(0,s.jsx)(Ci,{children:e.title}),e.items.map((e=>(0,s.jsxs)(Pi,{onClick:e.action,danger:e.danger,children:[e.jsxIcon&&(0,s.jsx)(Ti,{children:e.jsxIcon}),e.srcIcon&&(0,s.jsx)(Ti,{children:(0,s.jsx)("img",{alt:e.title,src:e.srcIcon})}),e.title,e.isNew&&(0,s.jsx)(ji,{children:"NEW"})]},e.id)))]},e.id)))});const Di=Je.div`
|
|
68
|
+
display: flex;
|
|
69
|
+
justify-content: space-between;
|
|
70
|
+
align-items: center;
|
|
71
|
+
background-color: ${e=>e.theme.backgroundColor};
|
|
72
|
+
height: 60px;
|
|
73
|
+
padding: 0 15px;
|
|
74
|
+
|
|
75
|
+
@media (max-height: 500px) {
|
|
76
|
+
height: 40px;
|
|
77
|
+
}
|
|
78
|
+
`,Ii=Je.div`
|
|
79
|
+
display: flex;
|
|
80
|
+
align-items: center;
|
|
81
|
+
`,Oi=Je.span`
|
|
82
|
+
font-size: 16px;
|
|
83
|
+
font-weight: 300;
|
|
84
|
+
line-height: 16px;
|
|
85
|
+
color: #fff;
|
|
86
|
+
margin-left: 5px;
|
|
87
|
+
`,Li=Je.div`
|
|
88
|
+
display: flex;
|
|
89
|
+
gap: 10px;
|
|
90
|
+
`,Ai=Je.button`
|
|
91
|
+
display: flex;
|
|
92
|
+
justify-content: center;
|
|
93
|
+
align-items: center;
|
|
94
|
+
width: 28px;
|
|
95
|
+
height: 28px;
|
|
96
|
+
background-color: #2d2d2d;
|
|
97
|
+
padding: 0 5px;
|
|
98
|
+
border: 2px solid ${e=>e.theme.controlsBorderColor};
|
|
99
|
+
box-sizing: border-box;
|
|
100
|
+
border-radius: 100%;
|
|
101
|
+
|
|
102
|
+
&:hover {
|
|
103
|
+
border: 2px solid ${e=>e.theme.controlsHoverBorderColor};
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
img,
|
|
107
|
+
svg {
|
|
108
|
+
max-width: 100%;
|
|
109
|
+
max-height: 100%;
|
|
110
|
+
}
|
|
111
|
+
`,Ni=Je.div`
|
|
112
|
+
position: relative;
|
|
113
|
+
`,Fi=Je.button`
|
|
114
|
+
display: flex;
|
|
115
|
+
justify-content: center;
|
|
116
|
+
align-items: center;
|
|
117
|
+
background-color: ${e=>e.theme.controlsBackgroundColor};
|
|
118
|
+
border: 2px solid ${e=>e.theme.controlsBorderColor};
|
|
119
|
+
color: ${e=>e.theme.settingsTextColor};
|
|
120
|
+
font-size: 16px;
|
|
121
|
+
font-weight: 700;
|
|
122
|
+
line-height: 16px;
|
|
123
|
+
padding: 4px 12px;
|
|
124
|
+
border-radius: 50px;
|
|
125
|
+
|
|
126
|
+
&:hover {
|
|
127
|
+
border: 2px solid ${e=>e.theme.controlsHoverBorderColor};
|
|
128
|
+
}
|
|
129
|
+
`,Bi=Je.div`
|
|
130
|
+
position: absolute;
|
|
131
|
+
right: 0;
|
|
132
|
+
top: 38.5px;
|
|
133
|
+
z-index: 30;
|
|
134
|
+
`;var zi=({baseCategories:e,extraCategories:t})=>{const r=(0,u.useRef)(null),[n,i]=(0,u.useState)(!1),[a,o]=(0,u.useState)(e),{options:c}=(0,u.useContext)(ii);ki(r,(()=>i(!1)));const l=(0,u.useMemo)((()=>{const r=c.settingsShortcuts;if(r){const n=e.reduce(((e,t)=>[...e,...t.items]),[]),i=t?.reduce(((e,t)=>[...e,...t.items]),[])||[];return r.reduce(((e,t)=>{const r=n.find((e=>e.id===t));if(r)e.push(r);else{const r=i?.find((e=>e.id===t));r&&e.push(r)}return e}),[])}return[]}),[c.settingsShortcuts,e,t]);(0,u.useEffect)((()=>{const r=[...e.map((e=>({...e,items:[...e.items]})))];t?.forEach((e=>{const t=r.find((t=>t.id===e.id));if(t)e.items.forEach((e=>{const r=Number(e.position),n=isNaN(r)?t.items.length:r;t.items.splice(n,0,e)}));else{const t=Number(e.position),n=isNaN(t)?r.length:t;r.splice(n,0,e)}}));const n=r.map((e=>{const t=e.items.map((e=>({...e,action:()=>{e.action(),i(!1)}})));return{...e,items:t}}));o(n)}),[e,t]);return(0,s.jsxs)(Li,{children:[l.map((e=>(0,s.jsxs)(Ai,{onClick:e.action,children:[e.jsxIcon&&e.jsxIcon,e.srcIcon&&(0,s.jsx)("img",{alt:e.title,src:e.srcIcon})]},e.id))),c.showMenuButton&&(0,s.jsxs)(Ni,{children:[(0,s.jsx)(Fi,{onClick:()=>i((e=>!e)),children:"Menu"}),n&&(0,s.jsx)(Bi,{ref:r,children:(0,s.jsx)(Mi,{categories:a})})]})]})};const $i=({width:e,cellAspectRatio:t,tileCount:r})=>{const n=Math.round(e/t),i=Math.round(e);return r<=1?{width:i,height:n,tileRects:[{origin:{x:0,y:0},bounds:{width:i,height:n}}],tileCount:r}:(({width:e,height:t,tileCount:r})=>{const n=Math.min(r,12);let i=0,a=0;n<=2?(i=2,a=1):n<=4?(i=2,a=2):n<=6?(i=3,a=2):n<=9?(i=3,a=3):(i=4,a=3);const s={width:Math.round(e/i),height:Math.round(t/a)},o=[...Array(n)].map(((e,t)=>({origin:{x:Math.floor(t%i)*s.width,y:Math.floor(t/i)*s.height},bounds:s})));return{width:s.width*i,height:s.height*a,tileRects:o,tileCount:n}})({width:i,height:n,tileCount:r})};const Ui=new class{constructor(){this.started=!1,this.fps=18,this.devicePixelRatio=window.devicePixelRatio||1,this.layout=null,this.canvas=document.createElement("canvas"),this.ctx=this.canvas.getContext("2d"),this.ctx&&(this.ctx.fillStyle="#000",this.ctx.fillRect(0,0,this.canvas.width,this.canvas.height)),this.video=document.createElement("video"),this.video.muted=!0,this.video.autoplay=!0,this.video.playsInline=!0,this.video.addEventListener("enterpictureinpicture",this.onEnterPictureInPicture.bind(this)),this.video.addEventListener("leavepictureinpicture",this.onLeavePictureInPicture.bind(this)),this.tiles=[]}async start(){this.tiles.length?(this.video.srcObject=this.canvas.captureStream(this.fps),document.pictureInPictureElement&&document.exitPictureInPicture(),this.canvas.width=this.layout?.width||50,this.canvas.height=this.layout?.height||33,await this.video.play(),await this.video.requestPictureInPicture(),this.draw()):jt("No camera available",{className:"error"})}setTiles(e){this.tiles=e,this.layout=$i({width:300*this.devicePixelRatio,cellAspectRatio:1.5,tileCount:e.length}),this.started&&this.draw()}onEnterPictureInPicture(){this.started=!0}onLeavePictureInPicture(){this.started=!1,this.video.srcObject=null}draw(){this.ctx&&this.started&&(this.ctx.fillStyle="#1f1f1f",this.ctx.fillRect(0,0,this.canvas.width,this.canvas.height),this.tiles.length?(this.tiles.forEach(((e,t)=>{const r=document.body.querySelectorAll(`[data-peer-id='${e.id}'] video`)[0];if(!r)return console.warn(`MultiPiP: No video found for peer ${e.id}`);const n=this.layout?.tileRects[t];if(!n)return;this.ctx?.save();const{videoWidth:i,videoHeight:a}=r,{width:s,height:o}=n.bounds,c=Math.max(s/i,o/a),l=i/(i*c/s),d=a/(a*c/o),u=.5*(i-l),p=.5*(a-d),f=n.origin.x+5,h=n.origin.y+5,m=s-10,g=o-10;this.makeRoundedRect({ctx:this.ctx,x:f,y:h,width:m,height:g,radius:10}),this.ctx?.clip(),this.ctx?.drawImage(r,u,p,l,d,f,h,m,g),this.ctx?.restore()})),requestAnimationFrame(this.draw.bind(this))):document.exitPictureInPicture())}makeRoundedRect({ctx:e,x:t,y:r,width:n,height:i,radius:a}){e&&(e.beginPath(),e.moveTo(t+a,r),e.lineTo(t+n-a,r),e.quadraticCurveTo(t+n,r,t+n,r+a),e.lineTo(t+n,r+i-a),e.quadraticCurveTo(t+n,r+i,t+n-a,r+i),e.lineTo(t+a,r+i),e.quadraticCurveTo(t,r+i,t,r+i-a),e.lineTo(t,r+a),e.quadraticCurveTo(t,r,t+a,r),e.closePath())}};var Vi=()=>{const{setIsQRCodePopupVisible:e,setIsSettingsMenuVisible:t,options:r,muted:n,streaming:i}=(0,u.useContext)(ii),{streams:a}=ui(),[o,c]=(0,u.useState)(r.extraSettingsOptions||[]),l=e=>{const{extraOptions:t}=e.detail;c(t)},d=()=>{Ui.start()};(0,u.useEffect)((()=>{const e=a.filter((e=>e.webcam)).map((e=>({id:e.id})));Ui.setTiles(e)}),[a]),(0,u.useEffect)((()=>(window.addEventListener("streamUISetExtraSettingsOptions",l),()=>{window.removeEventListener("streamUISetExtraSettingsOptions",l)})),[]);const p=(0,u.useMemo)((()=>{const a=[{id:"1",items:[{id:"openNewTab",title:"Open new tab",jsxIcon:(0,s.jsx)(vi,{}),action:()=>{const e=new URL(r.sharedURL||window.location.href),t=n?"0":"1";e.searchParams.set("microphone-enabled",t);const a=i?"1":"0";e.searchParams.set("camera-enabled",a),window.open(e.href,"_blank"),ni.endCall()}}]},{id:"2",items:[{id:"copyLink",title:"Copy link",jsxIcon:(0,s.jsx)(yi,{}),action:async()=>{try{await pi(r.sharedURL||window.location.href),wr("Link copied to clipboard",{duration:2e3})}catch(e){console.warn(e),wr("An error occured when trying to copy to clipboard",{className:"error"})}}},{id:"qrCode",title:"QR Code",jsxIcon:(0,s.jsx)(wi,{}),action:()=>{e(!0)}}]},{id:"3",items:[{id:"settings",title:"Settings",jsxIcon:(0,s.jsx)(bi,{}),action:()=>{t(!0)}}]}];return document.pictureInPictureEnabled&&a[0].items.push({id:"pip",title:"Picture-in-Picture",jsxIcon:(0,s.jsx)(Si,{}),action:d}),a}),[n,i,r.sharedURL,e,t]);return(0,s.jsxs)(Di,{children:[(0,s.jsxs)(Ii,{children:[(0,s.jsx)(gi,{size:r.logo?.size}),r.logo?.text&&(0,s.jsx)(Oi,{children:r.logo.text})]}),(0,s.jsx)(zi,{baseCategories:p,extraCategories:o})]})};u=a("85Hg2"),u=a("85Hg2");var Hi=e=>{const[t,r]=(0,u.useState)([0,0]);return(0,u.useLayoutEffect)((()=>{const t=()=>r([e?.offsetWidth||window.innerWidth,e?.offsetHeight||window.innerHeight]);return window.addEventListener("resize",t),t(),()=>window.removeEventListener("resize",t)}),[e]),t};u=a("85Hg2");const Wi=Je.path`
|
|
135
|
+
fill: ${e=>e.theme.controlsIconColor};
|
|
136
|
+
`;var qi=({slash:e,redSlash:t,status:r,deviceRequest:n})=>e?(0,s.jsxs)("svg",{width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("path",{d:"M12 15a4 4 0 0 0 4-4V5a4 4 0 1 0-8 0v6a4 4 0 0 0 4 4ZM10 5a2 2 0 1 1 4 0v6a2 2 0 0 1-4 0V5Zm10 6a1 1 0 0 0-2 0 6 6 0 1 1-12 0 1 1 0 1 0-2 0 8 8 0 0 0 7 7.93V21H9a1 1 0 0 0 0 2h6a1 1 0 0 0 0-2h-2v-2.07A8 8 0 0 0 20 11Z",fill:"#fff"}),(0,s.jsx)("path",{d:"M4.005 1.53A1.75 1.75 0 1 0 1.53 4.005l19.446 19.446a1.75 1.75 0 1 0 2.475-2.475L4.005 1.53Z",fill:"#fff",stroke:"#d84949",strokeLinecap:"round"})]}):t?(0,s.jsxs)("svg",{width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("path",{d:"M12 15a4 4 0 0 0 4-4V5a4 4 0 1 0-8 0v6a4 4 0 0 0 4 4ZM10 5a2 2 0 1 1 4 0v6a2 2 0 0 1-4 0V5Zm10 6a1 1 0 0 0-2 0 6 6 0 1 1-12 0 1 1 0 1 0-2 0 8 8 0 0 0 7 7.93V21H9a1 1 0 0 0 0 2h6a1 1 0 0 0 0-2h-2v-2.07A8 8 0 0 0 20 11Z",fill:"#d84949"}),(0,s.jsx)("path",{d:"M4.005 1.53A1.75 1.75 0 1 0 1.53 4.005l19.446 19.446a1.75 1.75 0 1 0 2.475-2.475L4.005 1.53Z",fill:"#d84949",stroke:"#242324",strokeLinecap:"round"})]}):r?(0,s.jsx)("svg",{width:"12",height:"13",viewBox:"0 0 12 13",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M5.125 1.676a1.167 1.167 0 0 1 1.72-.082c.211.222.327.517.322.823v1.99a.583.583 0 1 0 1.166 0v-1.99A2.333 2.333 0 0 0 4.25.94a.583.583 0 1 0 .875.735ZM9.92 7.241h.117a.583.583 0 0 0 .583-.472c.042-.282.057-.567.047-.852a.583.583 0 1 0-1.167 0c0 .215-.021.43-.064.642a.584.584 0 0 0 .484.682Zm1.75 3.535L1.17.276a.583.583 0 1 0-.828.823l3.325 3.348v1.47a2.333 2.333 0 0 0 3.5 2.018l.851.852A3.5 3.5 0 0 1 2.5 5.917a.583.583 0 0 0-1.167 0 4.667 4.667 0 0 0 4.084 4.626v1.207H4.25a.583.583 0 0 0 0 1.167h3.5a.583.583 0 0 0 0-1.167H6.583v-1.207a4.59 4.59 0 0 0 2.246-.928l1.983 1.984a.584.584 0 0 0 .829-.823h.029ZM6 7.084a1.167 1.167 0 0 1-1.167-1.167v-.303l1.43 1.435A1.015 1.015 0 0 1 6 7.084Z",fill:"#fff"})}):n?(0,s.jsxs)("svg",{width:"30",height:"30",viewBox:"0 0 30 30",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("path",{d:"M25 13.75a1.25 1.25 0 0 0-2.5 0 7.5 7.5 0 1 1-15 0 1.25 1.25 0 0 0-2.5 0 10 10 0 0 0 8.75 9.913v2.587h-2.5a1.25 1.25 0 0 0 0 2.5h7.5a1.25 1.25 0 0 0 0-2.5h-2.5v-2.587A10 10 0 0 0 25 13.75Z",fill:"url(#microphoneBottom)"}),(0,s.jsx)("path",{d:"M15 18.75a5 5 0 0 0 5-5v-7.5a5 5 0 0 0-10 0v7.5a5 5 0 0 0 5 5Z",fill:"url(#microphoneTop)"})]}):(0,s.jsx)("svg",{width:"16",height:"22",viewBox:"0 0 16 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)(Wi,{d:"M8 14a4 4 0 0 0 4-4V4a4 4 0 1 0-8 0v6a4 4 0 0 0 4 4ZM6 4a2 2 0 1 1 4 0v6a2 2 0 0 1-4 0V4Zm10 6a1 1 0 0 0-2 0 6 6 0 1 1-12 0 1 1 0 0 0-2 0 8 8 0 0 0 7 7.93V20H5a1 1 0 0 0 0 2h6a1 1 0 0 0 0-2H9v-2.07A8 8 0 0 0 16 10Z"})});const Gi=Je.path`
|
|
137
|
+
fill: ${e=>e.theme.controlsIconColor};
|
|
138
|
+
`;var Zi=({slash:e,status:t,deviceRequest:r})=>e?(0,s.jsxs)("svg",{width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("path",{d:"M21.53 7.15a1 1 0 0 0-1 0L17 8.89A3 3 0 0 0 14 6H5a3 3 0 0 0-3 3v6a3 3 0 0 0 3 3h9a3 3 0 0 0 3-2.89l3.56 1.78A1 1 0 0 0 21 17a1 1 0 0 0 .875-.514A1 1 0 0 0 22 16V8a1 1 0 0 0-.47-.85ZM15 15a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1h9a1 1 0 0 1 1 1v6Zm5-.62-3-1.5v-1.76l3-1.5v4.76Z",fill:"#fff"}),(0,s.jsx)("path",{d:"M4.005 1.53A1.75 1.75 0 1 0 1.53 4.005l19.446 19.446a1.75 1.75 0 1 0 2.475-2.475L4.005 1.53Z",fill:"#fff",stroke:"#d84949",strokeLinecap:"round"})]}):t?(0,s.jsx)("svg",{width:"12",height:"13",viewBox:"0 0 12 13",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M3.498 3.169 1.164.836a.586.586 0 0 0-.828.828L1.695 3A1.75 1.75 0 0 0 .167 4.75v3.5A1.75 1.75 0 0 0 1.917 10h5.25a1.75 1.75 0 0 0 1.108-.403l2.56 2.567a.582.582 0 0 0 .83 0 .582.582 0 0 0 0-.828L3.497 3.169Zm3.669 5.664h-5.25a.583.583 0 0 1-.584-.583v-3.5a.583.583 0 0 1 .584-.584h.927l4.591 4.597a.583.583 0 0 1-.268.07Zm4.392-5.162a.583.583 0 0 0-.583 0l-2.06 1.015A1.75 1.75 0 0 0 7.167 3h-.781a.583.583 0 1 0 0 1.166h.782a.583.583 0 0 1 .583.584v.875a.944.944 0 0 0 0 .11.38.38 0 0 0 .03.117s.028.035.04.059a.583.583 0 0 0 .088.122s.058.035.087.058l.1.065c.044.006.089.006.133 0a.41.41 0 0 0 .082 0 .949.949 0 0 0 .11 0 .38.38 0 0 0 .118-.03l2.129-1.015v3.337a.584.584 0 0 0 1.166 0V4.166a.583.583 0 0 0-.274-.495Z",fill:"#fff"})}):r?(0,s.jsxs)("svg",{width:"30",height:"30",viewBox:"0 0 30 30",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("path",{d:"M26.54 8.438c.23 0 .456.06.656.176a1.315 1.315 0 0 1 .617 1.117v10.517a1.318 1.318 0 0 1-.617 1.117 1.31 1.31 0 0 1-.696.198 1.31 1.31 0 0 1-.578-.145l-4.672-2.34v-8.177l4.633-2.287c.2-.116.426-.177.656-.177Z",fill:"url(#cameraRight)"}),(0,s.jsx)("path",{d:"M20.104 8.55a3.75 3.75 0 0 1 1.146 2.563v7.775A3.75 3.75 0 0 1 17.5 22.5H6.25a3.75 3.75 0 0 1-3.75-3.75v-7.5A3.75 3.75 0 0 1 6.25 7.5H17.5a3.75 3.75 0 0 1 2.604 1.05Z",fill:"url(#cameraLeft)"})]}):(0,s.jsx)("svg",{width:"20",height:"12",viewBox:"0 0 20 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)(Gi,{d:"M19.53 1.15a1 1 0 0 0-1 0L15 2.89A3 3 0 0 0 12 0H3a3 3 0 0 0-3 3v6a3 3 0 0 0 3 3h9a3 3 0 0 0 3-2.89l3.56 1.78A1 1 0 0 0 19 11a1 1 0 0 0 .875-.514A1 1 0 0 0 20 10V2a1 1 0 0 0-.47-.85ZM13 9a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1h9a1 1 0 0 1 1 1v6Zm5-.62-3-1.5V5.12l3-1.5v4.76Z"})});const Ki=Je.path`
|
|
139
|
+
fill: ${e=>e.white?"#fff":e.theme.controlsIconColor};
|
|
140
|
+
`,Qi=Je.path`
|
|
141
|
+
fill: ${e=>e.white?"#fff":e.theme.controlsIconColor};
|
|
142
|
+
stroke: ${e=>e.white?"#fff":e.theme.controlsIconColor};
|
|
143
|
+
`;var Yi=({arrow:e,white:t,deviceRequest:r})=>r?(0,s.jsxs)("svg",{width:"31",height:"30",viewBox:"0 0 31 30",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("path",{d:"M6.75 3.75h17.5A3.75 3.75 0 0 1 28 7.5v10a3.75 3.75 0 0 1-3.75 3.75H6.75A3.75 3.75 0 0 1 3 17.5v-10a3.75 3.75 0 0 1 3.75-3.75Z",fill:"url(#screenTop)"}),(0,s.jsx)("path",{d:"M14.25 23.75v-2.5h2.5v2.5h5a1.25 1.25 0 0 1 0 2.5H9.25a1.25 1.25 0 0 1 0-2.5h5Z",fill:"url(#screenBottom)"})]}):(0,s.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)(Ki,{d:"M19 3H5a3 3 0 0 0-3 3v8a3 3 0 0 0 3 3h6v2H7a1 1 0 0 0 0 2h10a1 1 0 0 0 0-2h-4v-2h6a3 3 0 0 0 3-3V6a3 3 0 0 0-3-3Zm1 11a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v8Z",white:t}),e&&(0,s.jsx)(Qi,{d:"m12.443 7.054-.002-.002a.625.625 0 0 0-.205-.13.624.624 0 0 0-.473 0 .625.625 0 0 0-.205.13l-.002.002-2.498 2.501a.627.627 0 0 0 .887.887l1.43-1.436V12.5a.625.625 0 1 0 1.25 0V9.006l1.429 1.436a.626.626 0 0 0 1.023-.684.627.627 0 0 0-.136-.203l-2.498-2.5Z",strokeWidth:".25",white:t})]});var Xi=()=>(0,s.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",style:{margin:"auto",background:"0 0",display:"block",shapeRendering:"auto",maxWidth:"200px",maxHeight:"200px"},width:"100%",height:"100%",viewBox:"0 0 100 100",preserveAspectRatio:"xMidYMid",children:[(0,s.jsxs)("circle",{cx:"50",cy:"50",r:"0",fill:"none",stroke:"#6765fc",children:[(0,s.jsx)("animate",{attributeName:"r",repeatCount:"indefinite",dur:"1.25s",values:"0;28",keyTimes:"0;1",keySplines:"0 0.2 0.8 1",calcMode:"spline",begin:"0s"}),(0,s.jsx)("animate",{attributeName:"opacity",repeatCount:"indefinite",dur:"1.25s",values:"1;0",keyTimes:"0;1",keySplines:"0.2 0 0.8 1",calcMode:"spline",begin:"0s"})]}),(0,s.jsxs)("circle",{cx:"50",cy:"50",r:"0",fill:"none",stroke:"rgba(102, 100, 252, 0.7683870967741935)",children:[(0,s.jsx)("animate",{attributeName:"r",repeatCount:"indefinite",dur:"1.25s",values:"0;28",keyTimes:"0;1",keySplines:"0 0.2 0.8 1",calcMode:"spline",begin:"-0.625s"}),(0,s.jsx)("animate",{attributeName:"opacity",repeatCount:"indefinite",dur:"1.25s",values:"1;0",keyTimes:"0;1",keySplines:"0.2 0 0.8 1",calcMode:"spline",begin:"-0.625s"})]})]});var Ji=()=>(0,s.jsx)("svg",{width:"20",height:"22",viewBox:"0 0 20 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M13.71 11.71a6 6 0 1 0-7.42 0 10 10 0 0 0-6.22 8.18 1.006 1.006 0 0 0 2 .22 8 8 0 0 1 15.9 0 1 1 0 0 0 1 .89h.11a1 1 0 0 0 .88-1.1 10 10 0 0 0-6.25-8.19ZM10 11a4 4 0 1 1 0-8 4 4 0 0 1 0 8Z",fill:"#fff"})});const ea=Xe`
|
|
144
|
+
0% {
|
|
145
|
+
opacity: 0;
|
|
146
|
+
}
|
|
147
|
+
100% {
|
|
148
|
+
opacity: 1;
|
|
149
|
+
}
|
|
150
|
+
`,ta=Xe`
|
|
151
|
+
0% {
|
|
152
|
+
opacity: 1;
|
|
153
|
+
}
|
|
154
|
+
100% {
|
|
155
|
+
opacity: 0;
|
|
156
|
+
}
|
|
157
|
+
`,ra=Je.div`
|
|
158
|
+
display: flex;
|
|
159
|
+
flex-direction: row;
|
|
160
|
+
align-items: center;
|
|
161
|
+
padding: 10px 15px;
|
|
162
|
+
background-color: rgba(45, 45, 45, 0.75);
|
|
163
|
+
border-radius: 50px;
|
|
164
|
+
box-sizing: border-box;
|
|
165
|
+
pointer-events: auto;
|
|
166
|
+
gap: 10px;
|
|
167
|
+
animation: ${e=>e.visible?ea:ta} 1s ease forwards;
|
|
168
|
+
`,na=Je.div`
|
|
169
|
+
display: flex;
|
|
170
|
+
|
|
171
|
+
svg,
|
|
172
|
+
img {
|
|
173
|
+
min-width: 24px;
|
|
174
|
+
max-width: 36px;
|
|
175
|
+
max-height: 36px;
|
|
176
|
+
box-sizing: border-box;
|
|
177
|
+
}
|
|
178
|
+
`,ia=Je.p`
|
|
179
|
+
color: #fff;
|
|
180
|
+
font-size: 14px;
|
|
181
|
+
font-weight: 600;
|
|
182
|
+
line-height: 18px;
|
|
183
|
+
letter-spacing: -0.02em;
|
|
184
|
+
margin: 0;
|
|
185
|
+
max-width: ${e=>e.maxWidth};
|
|
186
|
+
text-overflow: ${e=>e.ellipsis?"ellipsis":"unset"};
|
|
187
|
+
white-space: ${e=>e.ellipsis?"nowrap":"unset"};
|
|
188
|
+
overflow: ${e=>e.ellipsis?"auto":"unset"};
|
|
189
|
+
`,aa=Je.p`
|
|
190
|
+
color: #fff;
|
|
191
|
+
font-size: 12px;
|
|
192
|
+
font-weight: 500;
|
|
193
|
+
line-height: 18px;
|
|
194
|
+
letter-spacing: -0.02em;
|
|
195
|
+
margin: 0;
|
|
196
|
+
max-width: ${e=>e.maxWidth};
|
|
197
|
+
text-overflow: ellipsis;
|
|
198
|
+
white-space: nowrap;
|
|
199
|
+
overflow: auto;
|
|
200
|
+
`,sa=Je.button`
|
|
201
|
+
color: #fff;
|
|
202
|
+
background-color: #2d2d2d;
|
|
203
|
+
border: none;
|
|
204
|
+
border-radius: 50px;
|
|
205
|
+
padding: 6px 12px 8px;
|
|
206
|
+
font-weight: 700;
|
|
207
|
+
font-size: 14px;
|
|
208
|
+
line-height: 16px;
|
|
209
|
+
`,oa=(e,t={})=>{const r=t.buttonText?"150px":"170px";let n=null;t.jsxIcon?n=(0,s.jsx)(na,{children:t.jsxIcon}):t.srcIcon?n=(0,s.jsx)(na,{children:(0,s.jsx)("img",{alt:"Notification icon",src:t.srcIcon})}):t.imgIcon&&(n=(0,s.jsx)(na,{children:t.imgIcon})),wr.custom((i=>{const a=t.duration===1/0?null:setTimeout((()=>wr.dismiss(i.id)),t.duration),o=()=>{t.duration===1/0?wr.remove(i.id):wr.dismiss(i.id),a&&clearTimeout(a)};return(0,s.jsxs)(ra,{visible:i.visible,children:[n,(0,s.jsxs)("div",{children:[(0,s.jsx)(ia,{maxWidth:r,ellipsis:Boolean(t.subText),children:e}),t.subText&&(0,s.jsx)(aa,{maxWidth:r,children:t.subText})]}),t.buttonText&&(0,s.jsx)(sa,{onClick:()=>{t.buttonAction?.({close:o})},children:t.buttonText})]})}),{duration:t.duration,position:"top-center"})},ca=Xe`
|
|
210
|
+
50% {
|
|
211
|
+
border-color: #6967fc;
|
|
212
|
+
}
|
|
213
|
+
`,la=Xe`
|
|
214
|
+
0% {
|
|
215
|
+
opacity: 0.9;
|
|
216
|
+
}
|
|
217
|
+
100% {
|
|
218
|
+
opacity: 0;
|
|
219
|
+
}
|
|
220
|
+
`,da=Xe`
|
|
221
|
+
0% {
|
|
222
|
+
opacity: 0;
|
|
223
|
+
}
|
|
224
|
+
50% {
|
|
225
|
+
opacity: 1;
|
|
226
|
+
}
|
|
227
|
+
100% {
|
|
228
|
+
opacity: 0;
|
|
229
|
+
}
|
|
230
|
+
`,ua=Xe`
|
|
231
|
+
0% {
|
|
232
|
+
width: 200px;
|
|
233
|
+
height: 200px;
|
|
234
|
+
}
|
|
235
|
+
100% {
|
|
236
|
+
width: 88px;
|
|
237
|
+
height: 88px;
|
|
238
|
+
}
|
|
239
|
+
`,pa=Je.div`
|
|
240
|
+
display: flex;
|
|
241
|
+
position: absolute;
|
|
242
|
+
z-index: 20;
|
|
243
|
+
right: 10px;
|
|
244
|
+
bottom: 0;
|
|
245
|
+
cursor: ${e=>e.cursor};
|
|
246
|
+
transition: all 0.4s;
|
|
247
|
+
|
|
248
|
+
${e=>{if(e.full)return Oe`
|
|
249
|
+
width: 100%;
|
|
250
|
+
height: 100%;
|
|
251
|
+
inset: 0 0 0 0 !important;
|
|
252
|
+
padding: 17px 10px;
|
|
253
|
+
box-sizing: border-box;
|
|
254
|
+
`}}
|
|
255
|
+
`,fa=Je.div`
|
|
256
|
+
display: flex;
|
|
257
|
+
justify-content: center;
|
|
258
|
+
align-items: center;
|
|
259
|
+
position: relative;
|
|
260
|
+
width: 100%;
|
|
261
|
+
height: 100%;
|
|
262
|
+
background-color: ${e=>e.theme.streamTileBackgroundColor};
|
|
263
|
+
border: ${e=>e.border?`2px solid ${e.theme.streamTileBorderColor}`:"none"};
|
|
264
|
+
border-radius: 20px;
|
|
265
|
+
box-sizing: border-box;
|
|
266
|
+
|
|
267
|
+
${e=>"landscape"===e.orientation?Oe`
|
|
268
|
+
aspect-ratio: 1/1;
|
|
269
|
+
@supports not (aspect-ratio: 1/1) {
|
|
270
|
+
&:before {
|
|
271
|
+
content: '';
|
|
272
|
+
padding-top: 100%;
|
|
273
|
+
float: left;
|
|
274
|
+
}
|
|
275
|
+
&:after {
|
|
276
|
+
clear: left;
|
|
277
|
+
content: '';
|
|
278
|
+
display: table;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
`:Oe`
|
|
282
|
+
aspect-ratio: 1/1;
|
|
283
|
+
@supports not (aspect-ratio: 1/1) {
|
|
284
|
+
&::before {
|
|
285
|
+
content: '';
|
|
286
|
+
padding-top: 100%;
|
|
287
|
+
float: left;
|
|
288
|
+
}
|
|
289
|
+
&::after {
|
|
290
|
+
clear: left;
|
|
291
|
+
content: '';
|
|
292
|
+
display: table;
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
`}
|
|
296
|
+
`,ha=Je.div`
|
|
297
|
+
display: flex;
|
|
298
|
+
flex-direction: column;
|
|
299
|
+
justify-content: center;
|
|
300
|
+
align-items: center;
|
|
301
|
+
position: absolute;
|
|
302
|
+
width: 100%;
|
|
303
|
+
height: 100%;
|
|
304
|
+
background-color: ${e=>e.theme.streamTileBackgroundColor};
|
|
305
|
+
border: ${e=>`2px solid ${e.theme.streamTileBorderColor}`};
|
|
306
|
+
border-radius: inherit;
|
|
307
|
+
box-sizing: border-box;
|
|
308
|
+
z-index: 50;
|
|
309
|
+
color: #fff;
|
|
310
|
+
overflow: hidden;
|
|
311
|
+
animation: ${ca} 1.3s infinite;
|
|
312
|
+
`,ma=Je.div`
|
|
313
|
+
display: flex;
|
|
314
|
+
justify-content: center;
|
|
315
|
+
align-items: center;
|
|
316
|
+
background: linear-gradient(180deg, #464646 0%, #303030 100%);
|
|
317
|
+
border-radius: 50%;
|
|
318
|
+
width: 62px;
|
|
319
|
+
height: 62px;
|
|
320
|
+
`,ga=Je.span`
|
|
321
|
+
font-size: 16px;
|
|
322
|
+
font-weight: 700;
|
|
323
|
+
max-width: 60%;
|
|
324
|
+
line-height: 18px;
|
|
325
|
+
text-align: center;
|
|
326
|
+
margin: 8px 0;
|
|
327
|
+
`,va=Je.div`
|
|
328
|
+
display: flex;
|
|
329
|
+
gap: 10px;
|
|
330
|
+
margin-top: 15px;
|
|
331
|
+
`,ya=Je.button`
|
|
332
|
+
background-color: ${e=>e.active?"#6967fc":"transparent"};
|
|
333
|
+
border: 2px solid #6967fc;
|
|
334
|
+
border-radius: 50px;
|
|
335
|
+
padding: 8px 18px;
|
|
336
|
+
color: #fff;
|
|
337
|
+
font-size: 14px;
|
|
338
|
+
font-weight: 700;
|
|
339
|
+
line-height: 22px;
|
|
340
|
+
|
|
341
|
+
&:hover {
|
|
342
|
+
background-color: #6967fc;
|
|
343
|
+
}
|
|
344
|
+
`,wa=Je.button`
|
|
345
|
+
display: flex;
|
|
346
|
+
justify-content: center;
|
|
347
|
+
align-items: center;
|
|
348
|
+
width: 36px;
|
|
349
|
+
height: 36px;
|
|
350
|
+
padding: 7px;
|
|
351
|
+
border: none;
|
|
352
|
+
border-radius: 50%;
|
|
353
|
+
background-color: rgba(28, 32, 36, 0.5);
|
|
354
|
+
color: #fff;
|
|
355
|
+
z-index: 20;
|
|
356
|
+
`,ba=Je.div`
|
|
357
|
+
display: flex;
|
|
358
|
+
flex-direction: column;
|
|
359
|
+
justify-content: space-between;
|
|
360
|
+
width: 100%;
|
|
361
|
+
height: 100%;
|
|
362
|
+
`,_a=Je.div`
|
|
363
|
+
display: flex;
|
|
364
|
+
flex-direction: row;
|
|
365
|
+
justify-content: space-between;
|
|
366
|
+
padding: 16px;
|
|
367
|
+
`,xa=Je.div`
|
|
368
|
+
position: absolute;
|
|
369
|
+
width: 100%;
|
|
370
|
+
height: 100%;
|
|
371
|
+
background-color: rgba(0, 0, 0, 0.75);
|
|
372
|
+
z-index: 16;
|
|
373
|
+
`,Sa=Je.div`
|
|
374
|
+
position: absolute;
|
|
375
|
+
width: 100%;
|
|
376
|
+
height: 100%;
|
|
377
|
+
background-color: #fff;
|
|
378
|
+
border-radius: 20px;
|
|
379
|
+
z-index: 20;
|
|
380
|
+
animation: ${la} 0.8s;
|
|
381
|
+
`,ka=Je.img`
|
|
382
|
+
width: 88px;
|
|
383
|
+
height: 88px;
|
|
384
|
+
border: 3px solid #fff;
|
|
385
|
+
border-radius: 15px;
|
|
386
|
+
box-sizing: border-box;
|
|
387
|
+
z-index: 20;
|
|
388
|
+
animation: ${da} 2.5s, ${ua} 0.3s;
|
|
389
|
+
`,Ea=Je.div`
|
|
390
|
+
display: flex;
|
|
391
|
+
flex: 1;
|
|
392
|
+
flex-direction: ${e=>e.direction};
|
|
393
|
+
background-color: ${e=>e.theme.backgroundColor};
|
|
394
|
+
padding: 16px 10px;
|
|
395
|
+
position: relative;
|
|
396
|
+
overflow: hidden;
|
|
397
|
+
`,Ra=Je.div`
|
|
398
|
+
display: flex;
|
|
399
|
+
width: ${e=>e.audioTiles?"100%":"landscape"===e.orientation?e.reduced?"20%":"80%":"100%"};
|
|
400
|
+
height: ${e=>e.audioTiles?"100%":"portrait"===e.orientation&&e.reduced?"50%":"100%"};
|
|
401
|
+
flex-direction: row;
|
|
402
|
+
flex-wrap: wrap;
|
|
403
|
+
justify-content: center;
|
|
404
|
+
align-content: center;
|
|
405
|
+
gap: ${e=>e.audioTiles?"48px":"15px"};
|
|
406
|
+
overflow: scroll;
|
|
407
|
+
`,Ca=Je.div`
|
|
408
|
+
display: flex;
|
|
409
|
+
justify-content: center;
|
|
410
|
+
align-items: center;
|
|
411
|
+
position: relative;
|
|
412
|
+
background-color: ${e=>e.theme.streamTileBackgroundColor};
|
|
413
|
+
border: ${e=>e.activeBorder?"2px solid #6967fc":e.border?`2px solid ${e.theme.streamTileBorderColor}`:"none"};
|
|
414
|
+
border-radius: 20px;
|
|
415
|
+
color: #cbcbcb;
|
|
416
|
+
box-sizing: border-box;
|
|
417
|
+
max-height: 100%;
|
|
418
|
+
cursor: ${e=>e.cursor?e.cursor:"default"};
|
|
419
|
+
`,Pa=Je.video`
|
|
420
|
+
position: absolute;
|
|
421
|
+
top: 0;
|
|
422
|
+
left: 0;
|
|
423
|
+
width: 100%;
|
|
424
|
+
height: 100%;
|
|
425
|
+
object-fit: cover;
|
|
426
|
+
border-radius: inherit;
|
|
427
|
+
transform: ${e=>e.mirror?"scale(-1, 1)":"none"};
|
|
428
|
+
z-index: ${e=>e.zIndex?e.zIndex:"unset"};
|
|
429
|
+
`,Ta=Je.div`
|
|
430
|
+
display: flex;
|
|
431
|
+
position: absolute;
|
|
432
|
+
top: 16px;
|
|
433
|
+
left: 16px;
|
|
434
|
+
gap: 8px;
|
|
435
|
+
z-index: 15;
|
|
436
|
+
|
|
437
|
+
@media (max-width: 500px) {
|
|
438
|
+
top: 8px;
|
|
439
|
+
left: 8px;
|
|
440
|
+
}
|
|
441
|
+
`,ja=Je.div`
|
|
442
|
+
display: flex;
|
|
443
|
+
justify-content: center;
|
|
444
|
+
align-items: center;
|
|
445
|
+
width: 26px;
|
|
446
|
+
height: 26px;
|
|
447
|
+
border-radius: 50%;
|
|
448
|
+
background-color: rgba(28, 32, 36, 0.25);
|
|
449
|
+
`,Ma=Je.div`
|
|
450
|
+
position: absolute;
|
|
451
|
+
display: flex;
|
|
452
|
+
bottom: 10px;
|
|
453
|
+
left: 16px;
|
|
454
|
+
color: white;
|
|
455
|
+
font-size: 12px;
|
|
456
|
+
right: 16px;
|
|
457
|
+
z-index: 15;
|
|
458
|
+
|
|
459
|
+
p {
|
|
460
|
+
display: inline-block;
|
|
461
|
+
max-width: 100%;
|
|
462
|
+
background: rgba(27, 33, 39, 0.3);
|
|
463
|
+
border-radius: 10px;
|
|
464
|
+
padding: 10px;
|
|
465
|
+
margin: 0;
|
|
466
|
+
white-space: nowrap;
|
|
467
|
+
overflow: hidden;
|
|
468
|
+
text-overflow: ellipsis;
|
|
469
|
+
box-sizing: border-box;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
@media (max-width: 500px) {
|
|
473
|
+
bottom: 7.5px;
|
|
474
|
+
left: 8px;
|
|
475
|
+
}
|
|
476
|
+
`,Da=Je.div`
|
|
477
|
+
display: flex;
|
|
478
|
+
justify-content: center;
|
|
479
|
+
align-items: center;
|
|
480
|
+
flex-direction: column;
|
|
481
|
+
width: 100%;
|
|
482
|
+
height: 100%;
|
|
483
|
+
border-radius: inherit;
|
|
484
|
+
z-index: 10;
|
|
485
|
+
background: ${e=>e.streaming?"linear-gradient(0deg, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.8))":"none"};
|
|
486
|
+
`,Ia=Je.p`
|
|
487
|
+
text-align: center;
|
|
488
|
+
font-weight: 600;
|
|
489
|
+
font-size: ${e=>"small"===e.size?"12px":"medium"===e.size?"14px":(e.size,"16px")};
|
|
490
|
+
margin: 12px 6px;
|
|
491
|
+
`,Oa=Je.div`
|
|
492
|
+
display: flex;
|
|
493
|
+
max-width: 90%;
|
|
494
|
+
background: rgba(45, 45, 45, 0.5);
|
|
495
|
+
border-radius: 50px;
|
|
496
|
+
padding: ${e=>"small"===e.size||"medium"===e.size?"6px":(e.size,"10px")};
|
|
497
|
+
gap: ${e=>"small"===e.size?"8px":"medium"===e.size?"12px":(e.size,"18px")};
|
|
498
|
+
gap: 18px;
|
|
499
|
+
box-sizing: border-box;
|
|
500
|
+
`,La=Je.button`
|
|
501
|
+
display: flex;
|
|
502
|
+
justify-content: center;
|
|
503
|
+
align-items: center;
|
|
504
|
+
border: none;
|
|
505
|
+
border-radius: 50%;
|
|
506
|
+
background-color: #2d2d2d;
|
|
507
|
+
padding: ${e=>"small"===e.size?"2px":"medium"===e.size?"6px":"large"===e.size?"12px":0};
|
|
508
|
+
border: 2px solid transparent;
|
|
509
|
+
|
|
510
|
+
&:hover {
|
|
511
|
+
border: 2px solid #6967fc;
|
|
512
|
+
box-sizing: border-box;
|
|
513
|
+
}
|
|
514
|
+
`,Aa=Je.div`
|
|
515
|
+
display: flex;
|
|
516
|
+
justify-content: center;
|
|
517
|
+
align-items: center;
|
|
518
|
+
width: 56px;
|
|
519
|
+
height: 56px;
|
|
520
|
+
background-color: #2d2d2d;
|
|
521
|
+
border-radius: 30%;
|
|
522
|
+
`,Na=Je.span`
|
|
523
|
+
font-size: 26px;
|
|
524
|
+
font-weight: 600;
|
|
525
|
+
line-height: 20px;
|
|
526
|
+
color: #fff;
|
|
527
|
+
`;Je.img`
|
|
528
|
+
width: inherit;
|
|
529
|
+
height: inherit;
|
|
530
|
+
border-radius: inherit;
|
|
531
|
+
`;var Fa=({stream:e,width:t=0,height:r=0})=>{const n=(0,u.useRef)(null),i=(0,u.useRef)(null),[a,o]=(0,u.useState)(!1),[c,l]=(0,u.useState)(null),[d,p]=(0,u.useState)(!1),f=(0,u.useRef)(null),{userInteractionTriggered:h}=(0,u.useContext)(ii),{highlightedTile:m}=ui(),g="screenshare"===m?.type&&m.data.local,v=e.microphone&&!e.muted,y=!c&&a&&!m&&(!v||!e.webcam),w=`${t}px`,b=`${r}px`,_=(x=t)<200?"small":x<300?"medium":"large";var x;return(0,u.useEffect)((()=>{e.microphone&&n.current&&ni.requestVoice({consumerId:e.microphone,element:n.current})}),[e.microphone]),(0,u.useEffect)((()=>{if(!i.current)throw new Error("videoElementRef not available");e.webcam&&i.current?ni.requestVideo({consumerId:e.webcam,element:i.current}):e.webcam||(i.current.srcObject=null)}),[e.webcam]),(0,u.useEffect)((()=>{if(c)return f.current&&clearTimeout(f.current),f.current=setTimeout((()=>{l(null),wr("Your request has timed out.",{className:"error"})}),2e4),()=>{f.current&&clearTimeout(f.current)};o(!1)}),[c]),(0,u.useEffect)((()=>{const t=t=>{const{peerId:r,result:n}=t.detail.result;if(r===e.id&&(f.current&&clearTimeout(f.current),l(null),!0!==n)){let t="Your request has been declined.";e.displayName&&(t=`${e.displayName} has declined your request.`),wr(t,{className:"error"})}};return window.addEventListener("requestDeviceResult",t),()=>{window.removeEventListener("requestDeviceResult",t)}}),[e.id,e.displayName]),(0,u.useEffect)((()=>{const t=async t=>{const{peerId:r}=t.detail,{type:n,image:i}=t.detail.event;if("snapshot"===n&&r===e.id){p(!0);const e=await fetch(i).then((e=>e.blob())),t=URL.createObjectURL(e);oa("A snapshot has been shared with you.",{imgIcon:(0,s.jsx)("img",{style:{borderRadius:"8px",border:"2px solid #FFFFFF"},alt:"Snapshot",src:t}),buttonText:"Open",buttonAction:({close:e})=>{window.open(t,"_blank"),e()},duration:1/0})}};return window.addEventListener("customMessage",t),()=>{window.removeEventListener("customMessage",t)}}),[e.id]),(0,u.useEffect)((()=>{h&&n.current?.paused&&n.current.play()}),[h]),(0,s.jsxs)(Ca,{onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),style:{width:w,height:b},border:!e.webcam,activeBorder:y||e.isSpeaking,cursor:y?"pointer":"default","data-peer-id":e.id,children:[(0,s.jsx)("audio",{ref:n,autoPlay:!0}),(0,s.jsx)(Pa,{ref:i,style:{maxHeight:"100%"},autoPlay:!0,playsInline:!0,muted:!0}),d&&(0,s.jsx)(Sa,{onAnimationEnd:()=>p(!1)}),!y&&(0,s.jsxs)(Ta,{children:[!v&&(0,s.jsx)(ja,{children:(0,s.jsx)(qi,{status:!0})}),!e.webcam&&(0,s.jsx)(ja,{children:(0,s.jsx)(Zi,{status:!0})})]}),c&&(0,s.jsx)(Da,{streaming:Boolean(e.webcam),children:(0,s.jsx)(Xi,{})}),y&&(0,s.jsxs)(Da,{streaming:Boolean(e.webcam),children:[(0,s.jsx)(Ia,{size:_,children:"Request input devices"}),(0,s.jsxs)(Oa,{size:_,children:[!v&&(0,s.jsx)(La,{onClick:()=>{ni.requestPeerDevice(e.id,"microphone"),l("microphone")},size:_,children:(0,s.jsx)(qi,{deviceRequest:!0})}),!e.webcam&&(0,s.jsx)(La,{onClick:()=>{ni.requestPeerDevice(e.id,"webcam"),l("webcam")},size:_,children:(0,s.jsx)(Zi,{deviceRequest:!0})}),!g&&(0,s.jsx)(La,{onClick:()=>{ni.requestPeerDevice(e.id,"screen"),l("screen")},size:_,children:(0,s.jsx)(Yi,{deviceRequest:!0})})]})]}),!c&&!y&&!e.webcam&&(0,s.jsx)(Da,{children:(0,s.jsxs)(Aa,{children:[e.displayName&&(0,s.jsx)(Na,{children:e.displayName.slice(0,1).toUpperCase()}),!e.displayName&&(0,s.jsx)(Ji,{})]})}),!y&&e.displayName&&(0,s.jsx)(Ma,{children:(0,s.jsx)("p",{children:e.displayName})})]})};u=a("85Hg2");const Ba=Je.div`
|
|
532
|
+
display: flex;
|
|
533
|
+
flex-direction: column;
|
|
534
|
+
align-items: center;
|
|
535
|
+
border-radius: 14px;
|
|
536
|
+
`,za=Je.div`
|
|
537
|
+
display: flex;
|
|
538
|
+
justify-content: center;
|
|
539
|
+
align-items: center;
|
|
540
|
+
width: 56px;
|
|
541
|
+
height: 56px;
|
|
542
|
+
background-color: #131313;
|
|
543
|
+
border-radius: inherit;
|
|
544
|
+
position: relative;
|
|
545
|
+
`,$a=(Je.img`
|
|
546
|
+
width: 100%;
|
|
547
|
+
height: 100%;
|
|
548
|
+
border-radius: inherit;
|
|
549
|
+
`,Je.div`
|
|
550
|
+
display: flex;
|
|
551
|
+
justify-content: center;
|
|
552
|
+
align-items: center;
|
|
553
|
+
position: absolute;
|
|
554
|
+
width: 22px;
|
|
555
|
+
height: 22px;
|
|
556
|
+
background-color: #242324;
|
|
557
|
+
border-radius: 100%;
|
|
558
|
+
bottom: -11px;
|
|
559
|
+
left: 0;
|
|
560
|
+
right: 0;
|
|
561
|
+
margin: 0 auto;
|
|
562
|
+
|
|
563
|
+
svg {
|
|
564
|
+
height: 12px;
|
|
565
|
+
}
|
|
566
|
+
`),Ua=Je.span`
|
|
567
|
+
font-size: 14px;
|
|
568
|
+
font-weight: 600;
|
|
569
|
+
line-height: 15px;
|
|
570
|
+
margin-top: 14px;
|
|
571
|
+
color: #fff;
|
|
572
|
+
`;var Va=({stream:e})=>{const t=(0,u.useRef)(null),r=e.microphone&&!e.muted,n=()=>{t.current?.paused&&t.current.play()};return(0,u.useEffect)((()=>{e.microphone&&t.current&&"self"!==e.microphone&&ni.requestVoice({consumerId:e.microphone,element:t.current})}),[e.microphone]),(0,u.useEffect)((()=>{if("self"!==e.id)return window.addEventListener("microphoneEnabled",n),()=>window.removeEventListener("microphoneEnabled",n)}),[e.id]),(0,s.jsxs)(Ba,{children:[(0,s.jsx)("audio",{ref:t,autoPlay:!0}),(0,s.jsxs)(za,{children:[e.displayName&&(0,s.jsx)(Na,{children:e.displayName.slice(0,1).toUpperCase()}),!e.displayName&&(0,s.jsx)(Ji,{}),(0,s.jsx)($a,{children:(0,s.jsx)(qi,{redSlash:!r})})]}),(0,s.jsx)(Ua,{children:e.displayName})]})};u=a("85Hg2");var Ha=()=>(0,s.jsx)("svg",{width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M9.625 5.042a.917.917 0 0 0-.917.916v1.458L3.401 2.099a.92.92 0 0 0-1.302 1.302l5.317 5.307H5.958a.917.917 0 0 0 0 1.834h3.667a.917.917 0 0 0 .348-.074.917.917 0 0 0 .495-.495.917.917 0 0 0 .074-.348V5.958a.917.917 0 0 0-.917-.916Zm10.276 13.557-5.317-5.307h1.458a.917.917 0 0 0 0-1.834h-3.667a.917.917 0 0 0-.348.074.916.916 0 0 0-.495.495.917.917 0 0 0-.074.348v3.667a.917.917 0 0 0 1.834 0v-1.458l5.307 5.317a.915.915 0 0 0 1.302 0 .915.915 0 0 0 0-1.302Z",fill:"#fff"})});const Wa=Je.path`
|
|
573
|
+
fill: ${e=>e.theme.controlsIconColor};
|
|
574
|
+
`;var qa=({width:e=15,height:t=15})=>(0,s.jsx)("svg",{width:e,height:t,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)(Wa,{d:"M1.292 1.292a1 1 0 0 1 1.416 0L8 6.586l5.292-5.294a1.002 1.002 0 0 1 1.416 1.416L9.414 8l5.294 5.292a1.001 1.001 0 1 1-1.416 1.416L8 9.414l-5.292 5.294a1 1 0 1 1-1.416-1.416L6.586 8 1.292 2.708a1 1 0 0 1 0-1.416Z"})});const Ga=()=>(0,s.jsx)("svg",{width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M18.333 9.625a.916.916 0 0 0-.916.916v6.417a.917.917 0 0 1-.917.917H3.667a.917.917 0 0 1-.917-.917V9.625a.917.917 0 0 1 .917-.917H5.5a.917.917 0 0 0 .917-.623l.495-1.504a.917.917 0 0 1 .87-.623h5.051a.917.917 0 1 0 0-1.833H7.737a2.75 2.75 0 0 0-2.604 1.879l-.293.917H3.667a2.75 2.75 0 0 0-2.75 2.75v7.333a2.75 2.75 0 0 0 2.75 2.75H16.5a2.75 2.75 0 0 0 2.75-2.75v-6.417a.916.916 0 0 0-.917-.962Zm-8.25-.917a3.667 3.667 0 1 0 0 7.333 3.667 3.667 0 0 0 0-7.333Zm0 5.5a1.834 1.834 0 1 1 0-3.667 1.834 1.834 0 0 1 0 3.667ZM20.167 4.125h-.917v-.917a.917.917 0 0 0-1.833 0v.917H16.5a.917.917 0 1 0 0 1.833h.917v.917a.916.916 0 1 0 1.833 0v-.917h.917a.917.917 0 0 0 0-1.833Z",fill:"#fff"})}),Za=({availableWidth:e,availableHeight:t,numberOfTiles:r,ratio:n})=>{let i=0;for(let a=50,s=5e3;a<s&&(i=Math.floor((s+a)/2),i!==a);){const o=Math.floor(e/i);Math.ceil(r/o)*(i*n)<t?a=i:s=i}return i},Ka=({containerWidth:e,containerHeight:t,minimumWidth:r,maximumWidth:n,orientation:i,extended:a})=>{const s=e/100*20,o=e/100*30,c=e-20;if("landscape"===i){const e={width:1,height:1};if(a){const r=t/e.height*e.width;return r>c?c:r}return s<r?r:s>n?n:s}return"portrait"===i?a?c:o<r?r:o>n?n:o:0};u=a("85Hg2");const Qa={microphone:"microphone",webcam:"camera",screen:"screen"};var Ya=({device:e,requesterId:t,setExtended:r,setDeviceRequest:n})=>{const{streams:i}=ui(),[a,o]=(0,u.useState)(!1),c=i.find((e=>e.id===t)),l=(e=>"microphone"===e?qi:"webcam"===e?Zi:"screen"===e?Yi:qi)(e);return(0,u.useEffect)((()=>{r(!0)}),[r]),(0,s.jsx)(ha,{children:a?(0,s.jsx)(Xi,{}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(ma,{children:(0,s.jsx)(l,{deviceRequest:!0})}),(0,s.jsxs)(ga,{children:[c?.displayName||"Someone"," would like you to share your"," ",Qa[e]]}),(0,s.jsxs)(va,{children:[(0,s.jsx)(ya,{onClick:async()=>{if(r(!1),o(!0),"microphone"===e){const{microphone:e}=ni.getDevicesState();e.enabled?await ni.unMuteMicrophone():await ni.enableMicrophone()}else if("webcam"===e)await ni.enableVideo();else if("screen"===e)return n(null),void await ni.enableScreenshare();o(!1),n(null)},active:!0,children:"Accept"}),(0,s.jsx)(ya,{onClick:()=>{r(!1),n(null),ni.denyDeviceRequest(e)},children:"Decline"})]})]})})};const Xa=({mouseDownEvent:e,targetElement:t,containerElement:r})=>{let n=0,i=0,a=0;e.nativeEvent instanceof MouseEvent?(i=e.nativeEvent.clientX,a=e.nativeEvent.clientY):e.nativeEvent instanceof TouchEvent&&(i=e.nativeEvent.touches[0]?.clientX,a=e.nativeEvent.touches[0]?.clientY);const s=t.getBoundingClientRect(),o=i-s.left,c=a-s.top+60;t&&(t.style.transition="none");const l=e=>{e.stopPropagation(),window.removeEventListener("click",l,!0)},d=e=>{let i=0,a=0;if(e instanceof MouseEvent?(i=e.pageX,a=e.pageY):e instanceof TouchEvent&&(i=e.touches[0]?.pageX,a=e.touches[0]?.pageY),n+=1,t&&r){let e=i-o,n=a-c;e<0&&(e=0),n<0&&(n=0),e>r.clientWidth-t.offsetWidth&&(e=r.clientWidth-t.offsetWidth),n>r.clientHeight-t.offsetHeight&&(n=r.clientHeight-t.offsetHeight),t.style.left=`${e}px`,t.style.top=`${n}px`}},u=e=>{if(n>6&&e instanceof MouseEvent&&window.addEventListener("click",l,!0),t&&r){t.style.transition="all 0.4s",delete t.dataset.top,delete t.dataset.right,delete t.dataset.bottom,delete t.dataset.left;const e=r.getBoundingClientRect(),n=t.getBoundingClientRect(),i=(n.left+n.width/2-e.left)/e.width*100,a=(n.top+n.height/2-e.top)/e.height*100;a>=50&&(t.dataset.bottom="true",t.style.top=e.height-n.height+"px"),a<50&&(t.dataset.top="true",t.style.top="0"),i>=50&&(t.dataset.right="true",t.style.left=e.width-n.width-10+"px"),i<50&&(t.dataset.left="true",t.style.left="10px")}document.removeEventListener("mousemove",d),document.removeEventListener("touchmove",d),document.removeEventListener("mouseup",u),document.removeEventListener("touchend",u)};document.addEventListener("mousemove",d),document.addEventListener("touchmove",d),document.addEventListener("mouseup",u),document.addEventListener("touchend",u)},Ja=({element:e})=>{const t={top:"unset",right:"unset",bottom:"unset",left:"unset"},{top:r,right:n,bottom:i,left:a}=e.dataset;(r||n||i||a)&&(r&&(t.top="0"),n&&(t.right="10px"),i&&(t.bottom="0"),a&&(t.left="10px"),e.style.top=t.top,e.style.right=t.right,e.style.bottom=t.bottom,e.style.left=t.left)};u=a("85Hg2");var es=()=>{const{muted:e,streaming:t}=(0,u.useContext)(ii);return(0,u.useEffect)((()=>{navigator.mediaSession.setMicrophoneActive?.(!e),navigator.mediaSession.setCameraActive?.(t)}),[e,t]),(0,u.useEffect)((()=>{try{navigator.mediaSession.setActionHandler("togglemicrophone",(async()=>{try{ni.getDevicesState().microphone.enabled?await ni.toggleMute():await ni.enableMicrophone()}catch(e){console.warn(e),wr("An error occured when trying to toggle the microphone (PiP)",{className:"error"})}}))}catch(e){console.warn("MediaSession togglemicrophone action is not available")}try{navigator.mediaSession.setActionHandler("togglecamera",(async()=>{try{ni.getDevicesState().camera.enabled?await ni.disableVideo():await ni.enableVideo()}catch(e){console.warn(e),wr("An error occured when trying to toggle the camera (PiP)",{className:"error"})}}))}catch(e){console.warn("MediaSession togglecamera action is not available")}try{navigator.mediaSession.setActionHandler("hangup",(()=>{ni.endCall()}))}catch(e){console.warn("MediaSession hangup action is not available")}}),[]),null};var ts=({isSomeonePresenting:e,width:t,height:r})=>{const[n,i]=(0,u.useState)(!1),[a,c]=(0,u.useState)(!1),[l,d]=(0,u.useState)(!1),[p,f]=(0,u.useState)(null),[h,m]=(0,u.useState)("user"),[g,v]=(0,u.useState)(!1),[y,w]=(0,u.useState)(null),b=(0,u.useRef)(null),_=(0,u.useRef)(null),x=(0,u.useRef)(null),{videosContainerRef:S,remoteTilesContainerRef:k,selfDisplayName:E,muted:R,streaming:C,orientation:P}=(0,u.useContext)(ii),{streams:T}=ui(),[j,M]=Hi(S.current),D=T.length<1,I=!C||D||n?"default":"pointer";let O="100%";if(!D){O=`${Ka({containerWidth:j,containerHeight:M,minimumWidth:126,maximumWidth:300,orientation:P,extended:n})}px`}const L=()=>{if(!b.current)throw new Error("videoElementRef not available");const{facingMode:e}=ni.requestLocalVideo(b.current);m(e),_.current=b.current.srcObject,d(ni.isVideoZoomAvailable())},A=e=>{const{peerId:t,deviceType:r}=e.detail;x.current&&Ja({element:x.current}),f({device:r,requesterId:t})},N=e=>{!D&&!n&&x.current&&S.current&&Xa({mouseDownEvent:e,targetElement:x.current,containerElement:S.current})};(0,u.useEffect)((()=>{if(!b.current)throw new Error("videoElementRef not available");if(C){const{facingMode:e}=ni.requestLocalVideo(b.current);m(e),d(ni.isVideoZoomAvailable()),_.current=b.current.srcObject}else b.current.srcObject=null,_.current=null,i(!1)}),[C]),(0,u.useEffect)((()=>{C&&b.current&&!b.current.srcObject&&(b.current.srcObject=_.current)}),[C,e]),(0,u.useEffect)((()=>{x.current&&Ja({element:x.current})}),[j,M]),(0,u.useEffect)((()=>{D&&n&&i(!1)}),[D,n]),(0,u.useEffect)((()=>{n||(v(!1),w(null))}),[n]),(0,u.useEffect)((()=>(window.addEventListener("localVideoRotate",L),window.addEventListener("requestDevice",A),()=>{window.removeEventListener("localVideoRotate",L),window.removeEventListener("requestDevice",A)})),[]);const F=(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(es,{}),(0,s.jsx)(Pa,{ref:b,mirror:"user"===h,zIndex:15,autoPlay:!0,playsInline:!0,muted:!0}),p&&(0,s.jsx)(Ya,{device:p.device,requesterId:p.requesterId,setExtended:i,setDeviceRequest:f}),!n&&(0,s.jsxs)(Ta,{children:[R&&(0,s.jsx)(ja,{children:(0,s.jsx)(qi,{status:!0})}),!C&&(0,s.jsx)(ja,{children:(0,s.jsx)(Zi,{status:!0})})]}),!C&&(0,s.jsx)(Da,{children:(0,s.jsxs)(Aa,{children:[E&&(0,s.jsx)(Na,{children:E.slice(0,1).toUpperCase()}),!E&&(0,s.jsx)(Ji,{})]})}),!n&&(0,s.jsx)(Ma,{children:(0,s.jsx)("p",{children:"You"})}),n&&(0,s.jsxs)(ba,{children:[(0,s.jsxs)(_a,{children:[(0,s.jsx)(wa,{onClick:()=>{i(!1)},children:(0,s.jsx)(Ha,{})}),y&&(0,s.jsx)(ka,{src:y,onAnimationEnd:e=>{const t=da.getName();e.animationName===t&&w(null)}})]}),(0,s.jsxs)(_a,{children:[(0,s.jsx)(wa,{onClick:async()=>{if(!g&&!y){if(!b.current)throw new Error("Video element is not available");v(!0);const e=await ni.captureVideo(b.current);w(e);try{await ni.sendCustomMessageToAll({type:"snapshot",image:e}),1===T.length?wr(`Snapshot sent to ${T[0].displayName||"user"}`):T.length>=1&&wr("Snapshot sent to users")}catch(e){wr("An error occured when trying to send the snapshot",{className:"error"}),console.error(e)}}},children:(0,s.jsx)(Ga,{})}),l&&(0,s.jsxs)(wa,{onClick:()=>{a?(ni.unzoomVideo(),c(!1)):(ni.zoomVideo(),c(!0))},children:[a?"2":"1",(0,s.jsx)(qa,{width:8,height:8})]}),(0,s.jsx)("span",{style:{width:"36px"}})]})]})]});return e&&k?.current?(0,o.createPortal)((0,s.jsx)(Ca,{style:{width:`${t}px`,height:`${r}px`},border:!C,children:F}),k.current):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(pa,{ref:x,full:D,style:{width:O,height:O},cursor:I,onClick:()=>{!C||D||p||n||!x.current||(Ja({element:x.current}),i(!0))},onMouseDown:N,onTouchStart:N,children:[g&&(0,s.jsx)(Sa,{onAnimationEnd:()=>v(!1)}),(0,s.jsx)(fa,{orientation:P,border:!C&&!p,children:F})]}),n&&(0,s.jsx)(xa,{})]})};u=a("85Hg2"),u=a("85Hg2");const rs=Je.div`
|
|
575
|
+
display: flex;
|
|
576
|
+
justify-content: center;
|
|
577
|
+
align-items: center;
|
|
578
|
+
width: 100%;
|
|
579
|
+
height: 100%;
|
|
580
|
+
color: #cbcbcb;
|
|
581
|
+
box-sizing: border-box;
|
|
582
|
+
`,ns=Je.video`
|
|
583
|
+
max-width: 100%;
|
|
584
|
+
max-height: 100%;
|
|
585
|
+
object-fit: contain;
|
|
586
|
+
border-radius: 10px;
|
|
587
|
+
`;var is=({data:e})=>{const t=(0,u.useRef)(null);return(0,u.useEffect)((()=>{e.consumerId&&t.current&&ni.requestVideo({consumerId:e.consumerId,element:t.current})}),[e.consumerId]),(0,u.useEffect)((()=>{if(e.local&&t.current)return ni.requestLocalScreenshare(t.current),()=>{ni.disableScreenshare()}}),[e.local]),(0,s.jsx)(rs,{children:(0,s.jsx)(ns,{ref:t,autoPlay:!0,playsInline:!0,muted:!0})})};u=a("85Hg2");const as=Je.div`
|
|
588
|
+
display: flex;
|
|
589
|
+
justify-content: center;
|
|
590
|
+
align-items: center;
|
|
591
|
+
position: relative;
|
|
592
|
+
background-color: ${e=>e.theme.streamTileBackgroundColor};
|
|
593
|
+
border-radius: 10px;
|
|
594
|
+
color: #cbcbcb;
|
|
595
|
+
box-sizing: border-box;
|
|
596
|
+
width: 100%;
|
|
597
|
+
height: 100%;
|
|
598
|
+
overflow: hidden;
|
|
599
|
+
`,ss=Je.div`
|
|
600
|
+
width: 100%;
|
|
601
|
+
height: 100%;
|
|
602
|
+
|
|
603
|
+
iframe {
|
|
604
|
+
width: 100%;
|
|
605
|
+
height: 100%;
|
|
606
|
+
}
|
|
607
|
+
`,os="youtube_start",cs="youtube_play",ls="youtube_pause",ds="youtube_stop";var us=({data:e})=>{const[t,r]=(0,u.useState)(null),n=e=>{const t=e.target.getCurrentTime();e.data===YT.PlayerState.PAUSED&&ni.sendCustomMessageToAll({type:ls,time:t}),e.data===YT.PlayerState.PLAYING&&ni.sendCustomMessageToAll({type:cs,time:t})};return(0,u.useEffect)((()=>{var t;if(r((e=>(e&&e.destroy(),null))),window.onYouTubeIframeAPIReady=()=>{const t=new YT.Player("youtube-player",{height:"390",width:"640",videoId:e.videoId,playerVars:{autoplay:1,controls:e.local?1:0,playsinline:1,enablejsapi:1,origin:window.location.origin,rel:0,start:e.time||0},events:{onStateChange:e.local?n:void 0}});r(t)},window?.YT?.loaded?window.onYouTubeIframeAPIReady():(t="https://www.youtube.com/iframe_api",new Promise(((e,r)=>{const n=document.createElement("script");n.src=t,n.addEventListener("load",(()=>e(1))),n.addEventListener("error",(e=>r(e))),document.body.appendChild(n)}))),e.local)return ni.sendCustomMessageToAll({type:os,videoId:e.videoId}),()=>{ni.sendCustomMessageToAll({type:ds,videoId:e.videoId})}}),[e]),(0,u.useEffect)((()=>{if(!e.local&&t){const e=e=>{const{type:r,time:n}=e.detail.event;r===ls?(t.pauseVideo(),t.seekTo(n,!0)):r===cs&&(t.playVideo(),t.seekTo(n,!0))};return window.addEventListener("customMessage",e),()=>{window.removeEventListener("customMessage",e)}}if(e.local&&t){const r=r=>{const{id:n}=r.detail,i=t.getCurrentTime();ni.sendCustomMessage(n,{type:os,videoId:e.videoId,time:i})};return window.addEventListener("newPeer",r),()=>{window.removeEventListener("newPeer",r)}}}),[e,t]),(0,s.jsx)(as,{children:(0,s.jsx)(ss,{children:(0,s.jsx)("div",{id:"youtube-player"})})})};u=a("85Hg2");var ps=()=>{const{dispatch:e,highlightedTile:t}=ui();return(0,u.useEffect)((()=>{const r=r=>{const{peerId:n,consumerId:i,deviceType:a}=r.detail,s="newConsumer"===r.type;"screen"===a&&s?e({type:ai.SET_HIGHLIGHTED_TILE,payload:{type:"screenshare",peerId:n,data:{consumerId:i}}}):"screen"===a&&"screenshare"===t?.type&&t.peerId===n&&e({type:ai.UNSET_HIGHLIGHTED_TILE})},n=r=>{"screenshareEnabled"===r.type?e({type:ai.SET_HIGHLIGHTED_TILE,payload:{type:"screenshare",peerId:"self",data:{local:!0}}}):"screenshare"===t?.type&&t.data.local&&e({type:ai.UNSET_HIGHLIGHTED_TILE})};return window.addEventListener("newConsumer",r),window.addEventListener("consumerClose",r),window.addEventListener("screenshareEnabled",n),window.addEventListener("screenshareDisabled",n),()=>{window.removeEventListener("newConsumer",r),window.removeEventListener("consumerClose",r),window.removeEventListener("screenshareEnabled",n),window.removeEventListener("screenshareDisabled",n)}}),[e,t]),null};u=a("85Hg2");var fs=()=>{const{dispatch:e,highlightedTile:t}=ui();return(0,u.useEffect)((()=>{const r=r=>{const{peerId:n}=r.detail,{type:i,videoId:a,time:s}=r.detail.event;i===os?e({type:ai.SET_HIGHLIGHTED_TILE,payload:{type:"youtube",peerId:n,data:{videoId:a,time:s}}}):i===ds&&"youtube"===t?.type&&t.data.videoId===a&&e({type:ai.UNSET_HIGHLIGHTED_TILE})};return window.addEventListener("customMessage",r),()=>{window.removeEventListener("customMessage",r)}}),[e,t]),null};const hs=Je.div`
|
|
608
|
+
display: flex;
|
|
609
|
+
justify-content: center;
|
|
610
|
+
align-items: center;
|
|
611
|
+
width: ${e=>"portrait"===e.orientation?100:80}%;
|
|
612
|
+
height: ${e=>"portrait"===e.orientation?50:100}%;
|
|
613
|
+
padding-right: ${e=>"portrait"===e.orientation?0:10}px;
|
|
614
|
+
padding-bottom: ${e=>"portrait"===e.orientation?10:0}px;
|
|
615
|
+
`,ms=()=>{const{dispatch:e,highlightedTile:t}=ui();return(0,u.useEffect)((()=>{const r=r=>{const{peerId:n}=r.detail;t?.peerId===n&&e({type:ai.UNSET_HIGHLIGHTED_TILE})};return window.addEventListener("peerClosed",r),()=>{window.removeEventListener("peerClosed",r)}}),[e,t]),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(ps,{}),(0,s.jsx)(fs,{})]})};var gs=e=>{const{orientation:t}=(0,u.useContext)(ii);return(0,s.jsxs)(hs,{orientation:t,children:["screenshare"===e.type&&(0,s.jsx)(is,{data:e.data}),"youtube"===e.type&&(0,s.jsx)(us,{data:e.data})]})};const vs=(0,s.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M7 6.333A.667.667 0 0 0 6.333 7v2.667a.667.667 0 1 0 1.334 0V7A.667.667 0 0 0 7 6.333Zm.253-2.613a.667.667 0 0 0-.506 0 .667.667 0 0 0-.22.14.767.767 0 0 0-.14.22.667.667 0 0 0 .14.727c.064.059.139.106.22.14a.667.667 0 0 0 .92-.614.7.7 0 0 0-.194-.473.667.667 0 0 0-.22-.14ZM7 .333a6.667 6.667 0 1 0 0 13.334A6.667 6.667 0 0 0 7 .333Zm0 12A5.334 5.334 0 1 1 7 1.666a5.334 5.334 0 0 1 0 10.667Z",fill:"#fff"})}),ys=(0,s.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("path",{d:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10Z",fill:"#6967FC"}),(0,s.jsx)("path",{d:"M12 17a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM12 13a1 1 0 0 1-1-1V8a1 1 0 0 1 2 0v4a1 1 0 0 1-1 1Z",fill:"#fff"})]}),ws=(0,s.jsxs)("svg",{width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("path",{d:"M20.558 22H4.443a3.023 3.023 0 0 1-2.617-4.534L9.883 3.511a3.023 3.023 0 0 1 5.235 0l8.057 13.955A3.023 3.023 0 0 1 20.558 22Z",fill:"#6967FC"}),(0,s.jsx)("path",{d:"M12.5 18a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM12.5 14a1 1 0 0 1-1-1V9a1 1 0 0 1 2 0v4a1 1 0 0 1-1 1Z",fill:"#fff"})]}),bs=Je.div`
|
|
616
|
+
background-color: rgba(45, 45, 45, 0.75);
|
|
617
|
+
display: flex;
|
|
618
|
+
flex-direction: row;
|
|
619
|
+
align-items: center;
|
|
620
|
+
justify-content: space-around;
|
|
621
|
+
padding: 10px;
|
|
622
|
+
border-radius: 10px;
|
|
623
|
+
border: 1px solid rgba(31, 31, 31, 0.5);
|
|
624
|
+
box-sizing: border-box;
|
|
625
|
+
pointer-events: auto;
|
|
626
|
+
`,_s=Je.button`
|
|
627
|
+
background-color: rgba(45, 45, 45, 0);
|
|
628
|
+
color: #fff;
|
|
629
|
+
border: none;
|
|
630
|
+
padding: 0;
|
|
631
|
+
cursor: pointer;
|
|
632
|
+
outline: inherit;
|
|
633
|
+
font-weight: 600;
|
|
634
|
+
font-size: 12px;
|
|
635
|
+
line-height: 14px;
|
|
636
|
+
height: 100%;
|
|
637
|
+
`,xs=Je.p`
|
|
638
|
+
color: #fff;
|
|
639
|
+
font-size: 12px;
|
|
640
|
+
font-weight: 400;
|
|
641
|
+
line-height: 14px;
|
|
642
|
+
max-width: 200px;
|
|
643
|
+
margin: 0;
|
|
644
|
+
`,Ss=Je.div`
|
|
645
|
+
display: flex;
|
|
646
|
+
margin-right: 10px;
|
|
647
|
+
`;var ks=e=>{wr.custom((t=>(0,s.jsxs)(bs,{children:[(0,s.jsx)(Ss,{children:vs}),(0,s.jsx)(xs,{children:e.message}),e.buttonText&&(0,s.jsx)(_s,{onClick:()=>wr.remove(t.id),children:e.buttonText})]})),{duration:e.duration||3e3,position:"top-center"})};var Es=()=>{const{videosContainerRef:e,remoteTilesContainerRef:t,options:r,muted:n,selfDisplayName:i,orientation:a,userInteractionTriggered:o}=(0,u.useContext)(ii),[c,l]=(0,u.useState)({width:0,height:0}),{streams:d,highlightedTile:p,dispatch:f}=ui(),[h,m]=Hi();return(0,u.useEffect)((()=>{r.GDPRDisclaimer&&ks({message:"Para mejorar la calidad de nuestro servicio, esta llamada será grabada",buttonText:"Cerrar",duration:-1})}),[r.GDPRDisclaimer]),(0,u.useEffect)((()=>{if(t?.current&&h&&m){const e=1,r=t.current.childElementCount,{offsetWidth:n,offsetHeight:i}=t.current,a=Za({availableWidth:n-16*(r-1),availableHeight:i-16*(r-1),numberOfTiles:r,ratio:e});l({width:a,height:a*e})}}),[t,h,m,d.length,p]),(0,u.useEffect)((()=>{o&&(r.controls?.microphone?.enabled&&ni.enableMicrophone(),r.controls?.camera?.enabled&&ni.enableVideo())}),[r.controls,o]),(0,u.useEffect)((()=>{const e=e=>{const{id:t,displayName:r}=e.detail;f({type:ai.ADD_STREAM,payload:{id:t,displayName:r}})},t=e=>{const{peerId:t,consumerId:r,deviceType:n,paused:i}=e.detail,a="newConsumer"===e.type;"screen"!==n&&f({type:ai.DEVICE_UPDATE,payload:{streamId:t,consumerId:r,device:n,available:a,paused:i}})},r=e=>{const{peerId:t,deviceType:r}=e.detail,n="producerPaused"===e.type;"microphone"===r&&n?f({type:ai.MUTE,payload:{streamId:t}}):"microphone"===r&&f({type:ai.UNMUTE,payload:{streamId:t}})},n=e=>{const{peers:t}=e.detail,r=t.map((e=>({id:e.id,displayName:e.displayName})));f({type:ai.SET_STREAMS,payload:r})},i=e=>{const{peerId:t}=e.detail;f({type:ai.REMOVE_STREAM,payload:{id:t}})},a=e=>{const{peerId:t,displayName:r}=e.detail;f({type:ai.SET_STREAM_DISPLAY_NAME,payload:{streamId:t,displayName:r}})},s=e=>{const t="peerStartSpeak"===e.type,{peerId:r}=e.detail;f({type:ai.SET_STREAM_SPEAKING,payload:{streamId:r,isSpeaking:t}})};return window.addEventListener("enterRoom",n),window.addEventListener("newPeer",e),window.addEventListener("peerClosed",i),window.addEventListener("newConsumer",t),window.addEventListener("consumerClose",t),window.addEventListener("producerPaused",r),window.addEventListener("producerResumed",r),window.addEventListener("displayName",a),window.addEventListener("peerStartSpeak",s),window.addEventListener("peerStopSpeak",s),()=>{window.removeEventListener("enterRoom",n),window.removeEventListener("newPeer",e),window.removeEventListener("peerClosed",i),window.removeEventListener("newConsumer",t),window.removeEventListener("consumerClose",t),window.removeEventListener("producerPaused",r),window.removeEventListener("producerResumed",r),window.removeEventListener("displayName",a),window.removeEventListener("peerStartSpeak",s),window.removeEventListener("peerStopSpeak",s)}}),[f]),(0,s.jsxs)(Ea,{ref:e,direction:"portrait"===a?"column":"row",children:[!r.audioTiles&&(0,s.jsx)(ts,{isSomeonePresenting:Boolean(p),width:c.width,height:c.height}),(0,s.jsx)(ms,{}),p&&(0,s.jsx)(gs,{...p}),(0,s.jsxs)(Ra,{ref:t,orientation:a,reduced:Boolean(p),audioTiles:Boolean(r.audioTiles),children:[r.audioTiles&&(0,s.jsx)(Va,{stream:{id:"self",microphone:"self",muted:n,displayName:i}}),d.map((e=>r.audioTiles?(0,s.jsx)(Va,{stream:e},e.id):(0,s.jsx)(Fa,{stream:e,width:c.width,height:c.height},e.id)))]})]})};u=a("85Hg2");var Rs=()=>(0,s.jsx)("svg",{width:"23",height:"11",viewBox:"0 0 23 11",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M6.39 9.965c.133-.133.315-.23.479-.333.329-.21.673-.396 1.029-.557a1.713 1.713 0 0 0 .896-2.107l-.14-.406a10.43 10.43 0 0 1 2.822-.4 10.43 10.43 0 0 1 2.822.4l-.085.424a1.713 1.713 0 0 0 .896 2.107c.355.163.699.35 1.03.557.163.103.326.218.484.34a2.569 2.569 0 0 0 3.324-.31l1.816-1.816a2.57 2.57 0 0 0-.248-3.88 16.269 16.269 0 0 0-19.968.035l-.23.23a2.569 2.569 0 0 0-.584 2.737c.13.339.331.647.59.902l1.816 1.817a2.57 2.57 0 0 0 3.251.26Zm-3.935-3.33a.856.856 0 0 1-.145-1.02.899.899 0 0 1 .242-.288 14.556 14.556 0 0 1 17.855.043.933.933 0 0 1 .345.647.855.855 0 0 1-.248.66l-1.817 1.817a.856.856 0 0 1-1.083.127 9.275 9.275 0 0 0-.582-.4c-.389-.249-.795-.47-1.217-.66l.454-1.24a.856.856 0 0 0-.508-1.103 12.407 12.407 0 0 0-8.477 0 .856.856 0 0 0-.46.46.856.856 0 0 0-.03.66l.472 1.223c-.425.201-.837.428-1.235.679a9.282 9.282 0 0 0-.581.4.856.856 0 0 1-1.084-.128L2.455 6.635Z",fill:"#fff"})});const Cs=Je.path`
|
|
648
|
+
fill: ${e=>e.theme.controlsIconColor};
|
|
649
|
+
`;var Ps=()=>(0,s.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)(Cs,{d:"M17.91 13.51h-4.53a1 1 0 0 0 0 2h2.4A8 8 0 0 1 2 10a1 1 0 0 0-2 0 10 10 0 0 0 16.88 7.23V19a1 1 0 0 0 2 0v-4.5a1 1 0 0 0-.97-.99ZM10 0a10 10 0 0 0-6.88 2.77V1a1 1 0 0 0-2 0v4.5a1 1 0 0 0 1 1h4.5a1 1 0 0 0 0-2h-2.4A8 8 0 0 1 18 10a1 1 0 0 0 2 0A10 10 0 0 0 10 0Z"})});u=a("85Hg2");var Ts=()=>(0,s.jsx)("svg",{width:"24",height:"16",viewBox:"0 0 24 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M23 5.71a8.499 8.499 0 0 0-.91-4.13 2.92 2.92 0 0 0-1.72-1A78.36 78.36 0 0 0 12 .27a78.45 78.45 0 0 0-8.34.3 2.87 2.87 0 0 0-1.46.74c-.9.83-1 2.25-1.1 3.45a48.29 48.29 0 0 0 0 6.48 9.55 9.55 0 0 0 .3 2c.12.505.365.972.71 1.36a2.86 2.86 0 0 0 1.49.78c2.156.266 4.328.376 6.5.33 3.5.05 6.57 0 10.2-.28a2.88 2.88 0 0 0 1.53-.78c.28-.28.49-.623.61-1 .358-1.097.533-2.246.52-3.4.04-.56.04-3.94.04-4.54ZM9.74 10.85V4.66l5.92 3.11c-1.66.92-3.85 1.96-5.92 3.08Z",fill:"#fff"})});const js=Je.div`
|
|
650
|
+
display: flex;
|
|
651
|
+
justify-content: center;
|
|
652
|
+
align-items: center;
|
|
653
|
+
background: ${e=>e.theme.controlBarBackground};
|
|
654
|
+
height: 80px;
|
|
655
|
+
gap: 13px;
|
|
656
|
+
|
|
657
|
+
@media (max-width: 400px) {
|
|
658
|
+
gap: 8px;
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
@media (max-height: 500px) {
|
|
662
|
+
height: 60px;
|
|
663
|
+
}
|
|
664
|
+
`,Ms=Je.button`
|
|
665
|
+
display: flex;
|
|
666
|
+
align-items: center;
|
|
667
|
+
justify-content: center;
|
|
668
|
+
min-width: 48px;
|
|
669
|
+
min-height: 48px;
|
|
670
|
+
background-color: ${e=>e.danger?"#d84949":e.primary?"#6967fc":e.theme.controlsBackgroundColor};
|
|
671
|
+
border: ${e=>e.danger||e.primary?"2px solid transparent":`2px solid ${e.theme.controlsBorderColor}`};
|
|
672
|
+
border-radius: 15px;
|
|
673
|
+
padding: 0 8px;
|
|
674
|
+
gap: 8px;
|
|
675
|
+
|
|
676
|
+
p {
|
|
677
|
+
color: white;
|
|
678
|
+
font-size: 14px;
|
|
679
|
+
font-weight: 600;
|
|
680
|
+
margin: 0;
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
&:hover {
|
|
684
|
+
border: 2px solid
|
|
685
|
+
${e=>e.danger?"#fc7d7d":e.primary?"#9e9cfc":e.theme.controlsHoverBorderColor};
|
|
686
|
+
}
|
|
687
|
+
`,Ds=Je.div`
|
|
688
|
+
position: relative;
|
|
689
|
+
`,Is=Je(Ms)`
|
|
690
|
+
padding: 0 14px;
|
|
691
|
+
|
|
692
|
+
@media (max-width: 345px) {
|
|
693
|
+
p {
|
|
694
|
+
display: none;
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
`,Os=Je.div`
|
|
698
|
+
position: absolute;
|
|
699
|
+
bottom: 58px;
|
|
700
|
+
left: 50%;
|
|
701
|
+
transform: translate(-50%, 0);
|
|
702
|
+
z-index: 30;
|
|
703
|
+
`,Ls=Je.div`
|
|
704
|
+
position: absolute;
|
|
705
|
+
right: 0;
|
|
706
|
+
bottom: 58px;
|
|
707
|
+
z-index: 30;
|
|
708
|
+
`,As=Boolean(navigator.mediaDevices.getDisplayMedia);var Ns=()=>{const e=(0,u.useRef)(null),[t,r]=(0,u.useState)(!1),{setIsYoutubePopupVisible:n}=(0,u.useContext)(ii),{highlightedTile:i,dispatch:a}=ui(),o=Boolean(i?.data.local);ki(e,(()=>r(!1)));const c=[{id:"1",items:[{id:"youtube",title:"Youtube",jsxIcon:(0,s.jsx)(Ts,{}),action:()=>{r(!1),n(!0)},isNew:!0}]}];return As&&c[0].items.push({id:"screensharing",title:"Screen Sharing",jsxIcon:(0,s.jsx)(Yi,{}),action:async()=>{r(!1);try{await ni.enableScreenshare()}catch(e){console.warn(e),wr("An error occured when trying to toggle screensharing",{className:"error"})}}}),(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)(Ds,{children:[t&&(0,s.jsx)(Os,{ref:e,children:(0,s.jsx)(Mi,{categories:c})}),(0,s.jsx)(Ms,{primary:o,onClick:async()=>{o?a({type:ai.UNSET_HIGHLIGHTED_TILE}):r((e=>!e))},children:(0,s.jsx)(Yi,{white:o,arrow:!0})})]})})};var Fs,Bs,zs,$s,Us,Vs,Hs,Ws,qs,Gs=()=>{const e=(0,u.useRef)(null),[t,r]=(0,u.useState)(0),[n,i]=(0,u.useState)(!1),{muted:a,streaming:o,options:c,isAgent:l}=(0,u.useContext)(ii);ki(e,(()=>i(!1)));const d=()=>{ni.endCall()},p=e=>{const{numberOfAvailableWebcams:t}=e.detail;r(t)};return(0,u.useEffect)((()=>(window.addEventListener("webcamsUpdate",p),()=>{window.removeEventListener("webcamsUpdate",p)})),[]),(0,s.jsxs)(js,{children:[c.controls?.microphone?.available&&(0,s.jsx)(Ms,{danger:a,onClick:async()=>{try{ni.getDevicesState().microphone.enabled?await ni.toggleMute():await ni.enableMicrophone()}catch(e){console.warn(e),wr("An error occured when trying to toggle the microphone",{className:"error"})}},children:(0,s.jsx)(qi,{slash:a})}),c.controls?.camera?.available&&(0,s.jsx)(Ms,{danger:!o,onClick:async()=>{try{o?await ni.disableVideo():await ni.enableVideo()}catch(e){console.warn(e),wr("An error occured when trying to toggle the camera",{className:"error"})}},children:(0,s.jsx)(Zi,{slash:!o})}),c.controls?.screenshare?.available&&(0,s.jsx)(Ns,{}),o&&t>1&&(0,s.jsx)(Ms,{onClick:async()=>{try{await ni.rotateVideo()}catch(e){console.warn(e),wr("An error occured when trying to rotate the camera",{className:"error"})}},children:(0,s.jsx)(Ps,{})}),(0,s.jsxs)(Ds,{children:[n&&(0,s.jsx)(Ls,{ref:e,children:(0,s.jsx)(Mi,{categories:[{id:"1",items:[{id:"leaveCall",title:"Leave call",jsxIcon:(0,s.jsx)(_i,{}),action:d},{id:"terminateCall",title:"End call for all",jsxIcon:(0,s.jsx)(xi,{}),action:()=>{ni.terminateRoom()},danger:!0}]}]})}),(0,s.jsxs)(Is,{onClick:()=>{l?i((e=>!e)):d()},danger:!0,children:[(0,s.jsx)(Rs,{}),(0,s.jsx)("p",{children:"Leave"})]})]})]})};u=a("85Hg2"),u=a("85Hg2");let Zs;Bs=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then};const Ks=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];var Qs,Ys,Xs,Js,eo,to;$s=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return 4*e+17},Us=function(e){return Ks[e]},Vs=function(e){let t=0;for(;0!==e;)t++,e>>>=1;return t},Hs=function(e){if("function"!=typeof e)throw new Error('"toSJISFunc" is not a valid function.');Zs=e},Ws=function(){return void 0!==Zs},qs=function(e){return Zs(e)},Qs={bit:1},Ys={bit:0},Xs={bit:3},Js={bit:2},eo=function(e){return e&&void 0!==e.bit&&e.bit>=0&&e.bit<4},to=function(e,t){if(eo(e))return e;try{return function(e){if("string"!=typeof e)throw new Error("Param is not a string");switch(e.toLowerCase()){case"l":case"low":return Qs;case"m":case"medium":return Ys;case"q":case"quartile":return Xs;case"h":case"high":return Js;default:throw new Error("Unknown EC Level: "+e)}}(e)}catch(e){return t}};var ro={};function no(){this.buffer=[],this.length=0}no.prototype={get:function(e){const t=Math.floor(e/8);return 1==(this.buffer[t]>>>7-e%8&1)},put:function(e,t){for(let r=0;r<t;r++)this.putBit(1==(e>>>t-r-1&1))},getLengthInBits:function(){return this.length},putBit:function(e){const t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}},ro=no;var io,ao,so={};function oo(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}oo.prototype.set=function(e,t,r,n){const i=e*this.size+t;this.data[i]=r,n&&(this.reservedBit[i]=!0)},oo.prototype.get=function(e,t){return this.data[e*this.size+t]},oo.prototype.xor=function(e,t,r){this.data[e*this.size+t]^=r},oo.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]},so=oo;var co,lo=$s;io=function(e){if(1===e)return[];const t=Math.floor(e/7)+2,r=lo(e),n=145===r?26:2*Math.ceil((r-13)/(2*t-2)),i=[r-7];for(let e=1;e<t-1;e++)i[e]=i[e-1]-n;return i.push(6),i.reverse()},ao=function(e){const t=[],r=io(e),n=r.length;for(let e=0;e<n;e++)for(let i=0;i<n;i++)0===e&&0===i||0===e&&i===n-1||e===n-1&&0===i||t.push([r[e],r[i]]);return t};var uo=$s;var po,fo,ho,mo,go,vo,yo,wo,bo;co=function(e){const t=uo(e);return[[0,0],[t-7,0],[0,t-7]]},po={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const _o=3,xo=3,So=40,ko=10;function Eo(e,t,r){switch(e){case po.PATTERN000:return(t+r)%2==0;case po.PATTERN001:return t%2==0;case po.PATTERN010:return r%3==0;case po.PATTERN011:return(t+r)%3==0;case po.PATTERN100:return(Math.floor(t/2)+Math.floor(r/3))%2==0;case po.PATTERN101:return t*r%2+t*r%3==0;case po.PATTERN110:return(t*r%2+t*r%3)%2==0;case po.PATTERN111:return(t*r%3+(t+r)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}}var Ro,Co;fo=function(e){return null!=e&&""!==e&&!isNaN(e)&&e>=0&&e<=7},ho=function(e){return fo(e)?parseInt(e,10):void 0},mo=function(e){const t=e.size;let r=0,n=0,i=0,a=null,s=null;for(let o=0;o<t;o++){n=i=0,a=s=null;for(let c=0;c<t;c++){let t=e.get(o,c);t===a?n++:(n>=5&&(r+=_o+(n-5)),a=t,n=1),t=e.get(c,o),t===s?i++:(i>=5&&(r+=_o+(i-5)),s=t,i=1)}n>=5&&(r+=_o+(n-5)),i>=5&&(r+=_o+(i-5))}return r},go=function(e){const t=e.size;let r=0;for(let n=0;n<t-1;n++)for(let i=0;i<t-1;i++){const t=e.get(n,i)+e.get(n,i+1)+e.get(n+1,i)+e.get(n+1,i+1);4!==t&&0!==t||r++}return r*xo},vo=function(e){const t=e.size;let r=0,n=0,i=0;for(let a=0;a<t;a++){n=i=0;for(let s=0;s<t;s++)n=n<<1&2047|e.get(a,s),s>=10&&(1488===n||93===n)&&r++,i=i<<1&2047|e.get(s,a),s>=10&&(1488===i||93===i)&&r++}return r*So},yo=function(e){let t=0;const r=e.data.length;for(let n=0;n<r;n++)t+=e.data[n];return Math.abs(Math.ceil(100*t/r/5)-10)*ko},wo=function(e,t){const r=t.size;for(let n=0;n<r;n++)for(let i=0;i<r;i++)t.isReserved(i,n)||t.xor(i,n,Eo(e,i,n))},bo=function(e,t){const r=Object.keys(po).length;let n=0,i=1/0;for(let a=0;a<r;a++){t(a),wo(a,e);const r=mo(e)+go(e)+vo(e)+yo(e);wo(a,e),r<i&&(i=r,n=a)}return n};const Po=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],To=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];Ro=function(e,t){switch(t){case Qs:return Po[4*(e-1)+0];case Ys:return Po[4*(e-1)+1];case Xs:return Po[4*(e-1)+2];case Js:return Po[4*(e-1)+3];default:return}},Co=function(e,t){switch(t){case Qs:return To[4*(e-1)+0];case Ys:return To[4*(e-1)+1];case Xs:return To[4*(e-1)+2];case Js:return To[4*(e-1)+3];default:return}};var jo,Mo,Do,Io,Oo,Lo={};const Ao=new Uint8Array(512),No=new Uint8Array(256);function Fo(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}var Bo,zo,$o,Uo,Vo,Ho,Wo,qo,Go,Zo,Ko,Qo,Yo,Xo,Jo,ec,tc,rc,nc,ic,ac,sc,oc;!function(){let e=1;for(let t=0;t<255;t++)Ao[t]=e,No[e]=t,e<<=1,256&e&&(e^=285);for(let e=255;e<512;e++)Ao[e]=Ao[e-255]}(),Io=function(e){return Ao[e]},Oo=function(e,t){return 0===e||0===t?0:Ao[No[e]+No[t]]},jo=function(e,t){const r=new Uint8Array(e.length+t.length-1);for(let n=0;n<e.length;n++)for(let i=0;i<t.length;i++)r[n+i]^=Oo(e[n],t[i]);return r},Mo=function(e,t){let r=new Uint8Array(e);for(;r.length-t.length>=0;){const e=r[0];for(let n=0;n<t.length;n++)r[n]^=Oo(t[n],e);let n=0;for(;n<r.length&&0===r[n];)n++;r=r.slice(n)}return r},Do=function(e){let t=new Uint8Array([1]);for(let r=0;r<e;r++)t=jo(t,new Uint8Array([1,Io(r)]));return t},Fo.prototype.initialize=function(e){this.degree=e,this.genPoly=Do(this.degree)},Fo.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");const t=new Uint8Array(e.length+this.degree);t.set(e);const r=Mo(t,this.genPoly),n=this.degree-r.length;if(n>0){const e=new Uint8Array(this.degree);return e.set(r,n),e}return r},Lo=Fo,Jo=function(e){return!isNaN(e)&&e>=1&&e<=40};const cc="[0-9]+";let lc="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";lc=lc.replace(/u/g,"\\u");const dc="(?:(?![A-Z0-9 $%*+\\-./:]|"+lc+")(?:.|[\r\n]))+";ec=new RegExp(lc,"g"),tc=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),rc=new RegExp(dc,"g"),nc=new RegExp(cc,"g"),ic=new RegExp("[A-Z $%*+\\-./:]+","g");const uc=new RegExp("^"+lc+"$"),pc=new RegExp("^[0-9]+$"),fc=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");ac=function(e){return uc.test(e)},sc=function(e){return pc.test(e)},oc=function(e){return fc.test(e)},Vo={id:"Numeric",bit:1,ccBits:[10,12,14]},Ho={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},Wo={id:"Byte",bit:4,ccBits:[8,16,16]},qo={id:"Kanji",bit:8,ccBits:[8,10,12]},Go={bit:-1},Zo=function(e,t){if(!e.ccBits)throw new Error("Invalid mode: "+e);if(!Jo(t))throw new Error("Invalid version: "+t);return t>=1&&t<10?e.ccBits[0]:t<27?e.ccBits[1]:e.ccBits[2]},Ko=function(e){return sc(e)?Vo:oc(e)?Ho:ac(e)?qo:Wo},Qo=function(e){if(e&&e.id)return e.id;throw new Error("Invalid mode")},Yo=function(e){return e&&e.bit&&e.ccBits},Xo=function(e,t){if(Yo(e))return e;try{return function(e){if("string"!=typeof e)throw new Error("Param is not a string");switch(e.toLowerCase()){case"numeric":return Vo;case"alphanumeric":return Ho;case"kanji":return qo;case"byte":return Wo;default:throw new Error("Unknown mode: "+e)}}(e)}catch(e){return t}};const hc=Vs(7973);function mc(e,t){return Zo(e,t)+4}function gc(e,t){let r=0;return e.forEach((function(e){const n=mc(e.mode,t);r+=n+e.getBitsLength()})),r}var vc;Bo=function(e,t){return Jo(e)?parseInt(e,10):t},zo=function(e,t,r){if(!Jo(e))throw new Error("Invalid QR Code version");void 0===r&&(r=Wo);const n=8*(Us(e)-Co(e,t));if(r===Go)return n;const i=n-mc(r,e);switch(r){case Vo:return Math.floor(i/10*3);case Ho:return Math.floor(i/11*2);case qo:return Math.floor(i/13);default:return Math.floor(i/8)}},$o=function(e,t){let r;const n=to(t,Ys);if(Array.isArray(e)){if(e.length>1)return function(e,t){for(let r=1;r<=40;r++)if(gc(e,r)<=zo(r,t,Go))return r}(e,n);if(0===e.length)return 1;r=e[0]}else r=e;return function(e,t,r){for(let n=1;n<=40;n++)if(t<=zo(n,r,e))return n}(r.mode,r.getLength(),n)},Uo=function(e){if(!Jo(e)||e<7)throw new Error("Invalid QR Code version");let t=e<<12;for(;Vs(t)-hc>=0;)t^=7973<<Vs(t)-hc;return e<<12|t};const yc=Vs(1335);var wc,bc,_c;vc=function(e,t){const r=e.bit<<3|t;let n=r<<10;for(;Vs(n)-yc>=0;)n^=1335<<Vs(n)-yc;return 21522^(r<<10|n)};var xc={};function Sc(e){this.mode=Vo,this.data=e.toString()}Sc.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},Sc.prototype.getLength=function(){return this.data.length},Sc.prototype.getBitsLength=function(){return Sc.getBitsLength(this.data.length)},Sc.prototype.write=function(e){let t,r,n;for(t=0;t+3<=this.data.length;t+=3)r=this.data.substr(t,3),n=parseInt(r,10),e.put(n,10);const i=this.data.length-t;i>0&&(r=this.data.substr(t),n=parseInt(r,10),e.put(n,3*i+1))},xc=Sc;var kc={};const Ec=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function Rc(e){this.mode=Ho,this.data=e}Rc.getBitsLength=function(e){return 11*Math.floor(e/2)+e%2*6},Rc.prototype.getLength=function(){return this.data.length},Rc.prototype.getBitsLength=function(){return Rc.getBitsLength(this.data.length)},Rc.prototype.write=function(e){let t;for(t=0;t+2<=this.data.length;t+=2){let r=45*Ec.indexOf(this.data[t]);r+=Ec.indexOf(this.data[t+1]),e.put(r,11)}this.data.length%2&&e.put(Ec.indexOf(this.data[t]),6)},kc=Rc;var Cc,Pc={};function Tc(e){this.mode=Wo,this.data=new Uint8Array(Cc(e))}Cc=function(e){for(var t=[],r=e.length,n=0;n<r;n++){var i=e.charCodeAt(n);if(i>=55296&&i<=56319&&r>n+1){var a=e.charCodeAt(n+1);a>=56320&&a<=57343&&(i=1024*(i-55296)+a-56320+65536,n+=1)}i<128?t.push(i):i<2048?(t.push(i>>6|192),t.push(63&i|128)):i<55296||i>=57344&&i<65536?(t.push(i>>12|224),t.push(i>>6&63|128),t.push(63&i|128)):i>=65536&&i<=1114111?(t.push(i>>18|240),t.push(i>>12&63|128),t.push(i>>6&63|128),t.push(63&i|128)):t.push(239,191,189)}return new Uint8Array(t).buffer},Tc.getBitsLength=function(e){return 8*e},Tc.prototype.getLength=function(){return this.data.length},Tc.prototype.getBitsLength=function(){return Tc.getBitsLength(this.data.length)},Tc.prototype.write=function(e){for(let t=0,r=this.data.length;t<r;t++)e.put(this.data[t],8)},Pc=Tc;var jc={};function Mc(e){this.mode=qo,this.data=e}Mc.getBitsLength=function(e){return 13*e},Mc.prototype.getLength=function(){return this.data.length},Mc.prototype.getBitsLength=function(){return Mc.getBitsLength(this.data.length)},Mc.prototype.write=function(e){let t;for(t=0;t<this.data.length;t++){let r=qs(this.data[t]);if(r>=33088&&r<=40956)r-=33088;else{if(!(r>=57408&&r<=60351))throw new Error("Invalid SJIS character: "+this.data[t]+"\nMake sure your charset is UTF-8");r-=49472}r=192*(r>>>8&255)+(255&r),e.put(r,13)}},jc=Mc;var Dc,Ic,Oc,Lc,Ac,Nc,Fc,Bc={},zc={single_source_shortest_paths:function(e,t,r){var n={},i={};i[t]=0;var a,s,o,c,l,d,u,p=zc.PriorityQueue.make();for(p.push(t,0);!p.empty();)for(o in s=(a=p.pop()).value,c=a.cost,l=e[s]||{})l.hasOwnProperty(o)&&(d=c+l[o],u=i[o],(void 0===i[o]||u>d)&&(i[o]=d,p.push(o,d),n[o]=s));if(void 0!==r&&void 0===i[r]){var f=["Could not find a path from ",t," to ",r,"."].join("");throw new Error(f)}return n},extract_shortest_path_from_predecessor_list:function(e,t){for(var r=[],n=t;n;)r.push(n),e[n],n=e[n];return r.reverse(),r},find_path:function(e,t,r){var n=zc.single_source_shortest_paths(e,t,r);return zc.extract_shortest_path_from_predecessor_list(n,r)},PriorityQueue:{make:function(e){var t,r=zc.PriorityQueue,n={};for(t in e=e||{},r)r.hasOwnProperty(t)&&(n[t]=r[t]);return n.queue=[],n.sorter=e.sorter||r.default_sorter,n},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){var r={value:e,cost:t};this.queue.push(r),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};function $c(e){return unescape(encodeURIComponent(e)).length}function Uc(e,t,r){const n=[];let i;for(;null!==(i=e.exec(r));)n.push({data:i[0],index:i.index,mode:t,length:i[0].length});return n}function Vc(e){const t=Uc(nc,Vo,e),r=Uc(ic,Ho,e);let n,i;Ws()?(n=Uc(rc,Wo,e),i=Uc(ec,qo,e)):(n=Uc(tc,Wo,e),i=[]);return t.concat(r,n,i).sort((function(e,t){return e.index-t.index})).map((function(e){return{data:e.data,mode:e.mode,length:e.length}}))}function Hc(e,t){switch(t){case Vo:return xc.getBitsLength(e);case Ho:return kc.getBitsLength(e);case qo:return jc.getBitsLength(e);case Wo:return Pc.getBitsLength(e)}}function Wc(e,t){let r;const n=Ko(e);if(r=Xo(t,n),r!==Wo&&r.bit<n.bit)throw new Error('"'+e+'" cannot be encoded with mode '+Qo(r)+".\n Suggested mode is: "+Qo(n));switch(r!==qo||Ws()||(r=Wo),r){case Vo:return new xc(e);case Ho:return new kc(e);case qo:return new jc(e);case Wo:return new Pc(e)}}function qc(e,t,r){const n=e.size,i=vc(t,r);let a,s;for(a=0;a<15;a++)s=1==(i>>a&1),a<6?e.set(a,8,s,!0):a<8?e.set(a+1,8,s,!0):e.set(n-15+a,8,s,!0),a<8?e.set(8,n-a-1,s,!0):a<9?e.set(8,15-a-1+1,s,!0):e.set(8,15-a-1,s,!0);e.set(n-8,8,1,!0)}function Gc(e,t,r){const n=new ro;r.forEach((function(t){n.put(t.mode.bit,4),n.put(t.getLength(),Zo(t.mode,e)),t.write(n)}));const i=8*(Us(e)-Co(e,t));for(n.getLengthInBits()+4<=i&&n.put(0,4);n.getLengthInBits()%8!=0;)n.putBit(0);const a=(i-n.getLengthInBits())/8;for(let e=0;e<a;e++)n.put(e%2?17:236,8);return function(e,t,r){const n=Us(t),i=Co(t,r),a=n-i,s=Ro(t,r),o=s-n%s,c=Math.floor(n/s),l=Math.floor(a/s),d=l+1,u=c-l,p=new Lo(u);let f=0;const h=new Array(s),m=new Array(s);let g=0;const v=new Uint8Array(e.buffer);for(let e=0;e<s;e++){const t=e<o?l:d;h[e]=v.slice(f,f+t),m[e]=p.encode(h[e]),f+=t,g=Math.max(g,t)}const y=new Uint8Array(n);let w,b,_=0;for(w=0;w<g;w++)for(b=0;b<s;b++)w<h[b].length&&(y[_++]=h[b][w]);for(w=0;w<u;w++)for(b=0;b<s;b++)y[_++]=m[b][w];return y}(n,e,t)}function Zc(e,t,r,n){let i;if(Array.isArray(e))i=wc(e);else{if("string"!=typeof e)throw new Error("Invalid data");{let n=t;if(!n){const t=_c(e);n=$o(t,r)}i=bc(e,n||40)}}const a=$o(i,r);if(!a)throw new Error("The amount of data is too big to be stored in a QR Code");if(t){if(t<a)throw new Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: "+a+".\n")}else t=a;const s=Gc(t,r,i),o=$s(t),c=new so(o);return function(e,t){const r=e.size,n=co(t);for(let t=0;t<n.length;t++){const i=n[t][0],a=n[t][1];for(let t=-1;t<=7;t++)if(!(i+t<=-1||r<=i+t))for(let n=-1;n<=7;n++)a+n<=-1||r<=a+n||(t>=0&&t<=6&&(0===n||6===n)||n>=0&&n<=6&&(0===t||6===t)||t>=2&&t<=4&&n>=2&&n<=4?e.set(i+t,a+n,!0,!0):e.set(i+t,a+n,!1,!0))}}(c,t),function(e){const t=e.size;for(let r=8;r<t-8;r++){const t=r%2==0;e.set(r,6,t,!0),e.set(6,r,t,!0)}}(c),function(e,t){const r=ao(t);for(let t=0;t<r.length;t++){const n=r[t][0],i=r[t][1];for(let t=-2;t<=2;t++)for(let r=-2;r<=2;r++)-2===t||2===t||-2===r||2===r||0===t&&0===r?e.set(n+t,i+r,!0,!0):e.set(n+t,i+r,!1,!0)}}(c,t),qc(c,r,0),t>=7&&function(e,t){const r=e.size,n=Uo(t);let i,a,s;for(let t=0;t<18;t++)i=Math.floor(t/3),a=t%3+r-8-3,s=1==(n>>t&1),e.set(i,a,s,!0),e.set(a,i,s,!0)}(c,t),function(e,t){const r=e.size;let n=-1,i=r-1,a=7,s=0;for(let o=r-1;o>0;o-=2)for(6===o&&o--;;){for(let r=0;r<2;r++)if(!e.isReserved(i,o-r)){let n=!1;s<t.length&&(n=1==(t[s]>>>a&1)),e.set(i,o-r,n),a--,-1===a&&(s++,a=7)}if(i+=n,i<0||r<=i){i-=n,n=-n;break}}}(c,s),isNaN(n)&&(n=bo(c,qc.bind(null,c,r))),wo(n,c),qc(c,r,n),{modules:c,version:t,errorCorrectionLevel:r,maskPattern:n,segments:i}}function Kc(e){if("number"==typeof e&&(e=e.toString()),"string"!=typeof e)throw new Error("Color should be defined as hex string");let t=e.slice().replace("#","").split("");if(t.length<3||5===t.length||t.length>8)throw new Error("Invalid hex color: "+e);3!==t.length&&4!==t.length||(t=Array.prototype.concat.apply([],t.map((function(e){return[e,e]})))),6===t.length&&t.push("F","F");const r=parseInt(t.join(""),16);return{r:r>>24&255,g:r>>16&255,b:r>>8&255,a:255&r,hex:"#"+t.slice(0,6).join("")}}function Qc(e,t){const r=e.a/255,n=t+'="'+e.hex+'"';return r<1?n+" "+t+'-opacity="'+r.toFixed(2).slice(1)+'"':n}function Yc(e,t,r){let n=e+t;return void 0!==r&&(n+=" "+r),n}function Xc(e,t,r,n,i){const a=[].slice.call(arguments,1),s=a.length,o="function"==typeof a[s-1];if(!o&&!Bs())throw new Error("Callback required as last argument");if(!o){if(s<1)throw new Error("Too few arguments provided");return 1===s?(r=t,t=n=void 0):2!==s||t.getContext||(n=r,r=t,t=void 0),new Promise((function(i,a){try{const a=zs(r,n);i(e(a,t,n))}catch(e){a(e)}}))}if(s<2)throw new Error("Too few arguments provided");2===s?(i=r,r=t,t=n=void 0):3===s&&(t.getContext&&void 0===i?(i=n,n=void 0):(i=n,n=r,r=t,t=void 0));try{const a=zs(r,n);i(null,e(a,t,n))}catch(e){i(e)}}Bc=zc,wc=function(e){return e.reduce((function(e,t){return"string"==typeof t?e.push(Wc(t,null)):t.data&&e.push(Wc(t.data,t.mode)),e}),[])},bc=function(e,t){const r=function(e){const t=[];for(let r=0;r<e.length;r++){const n=e[r];switch(n.mode){case Vo:t.push([n,{data:n.data,mode:Ho,length:n.length},{data:n.data,mode:Wo,length:n.length}]);break;case Ho:t.push([n,{data:n.data,mode:Wo,length:n.length}]);break;case qo:t.push([n,{data:n.data,mode:Wo,length:$c(n.data)}]);break;case Wo:t.push([{data:n.data,mode:Wo,length:$c(n.data)}])}}return t}(Vc(e,Ws())),n=function(e,t){const r={},n={start:{}};let i=["start"];for(let a=0;a<e.length;a++){const s=e[a],o=[];for(let e=0;e<s.length;e++){const c=s[e],l=""+a+e;o.push(l),r[l]={node:c,lastCount:0},n[l]={};for(let e=0;e<i.length;e++){const a=i[e];r[a]&&r[a].node.mode===c.mode?(n[a][l]=Hc(r[a].lastCount+c.length,c.mode)-Hc(r[a].lastCount,c.mode),r[a].lastCount+=c.length):(r[a]&&(r[a].lastCount=c.length),n[a][l]=Hc(c.length,c.mode)+4+Zo(c.mode,t))}}i=o}for(let e=0;e<i.length;e++)n[i[e]].end=0;return{map:n,table:r}}(r,t),i=Bc.find_path(n.map,"start","end"),a=[];for(let e=1;e<i.length-1;e++)a.push(n.table[i[e]].node);return wc(function(e){return e.reduce((function(e,t){const r=e.length-1>=0?e[e.length-1]:null;return r&&r.mode===t.mode?(e[e.length-1].data+=t.data,e):(e.push(t),e)}),[])}(a))},_c=function(e){return wc(Vc(e,Ws()))},Oc=function(e){e||(e={}),e.color||(e.color={});const t=void 0===e.margin||null===e.margin||e.margin<0?4:e.margin,r=e.width&&e.width>=21?e.width:void 0,n=e.scale||4;return{width:r,scale:r?4:n,margin:t,color:{dark:Kc(e.color.dark||"#000000ff"),light:Kc(e.color.light||"#ffffffff")},type:e.type,rendererOpts:e.rendererOpts||{}}},Lc=function(e,t){return t.width&&t.width>=e+2*t.margin?t.width/(e+2*t.margin):t.scale},Ac=function(e,t){const r=Lc(e,t);return Math.floor((e+2*t.margin)*r)},Nc=function(e,t,r){const n=t.modules.size,i=t.modules.data,a=Lc(n,r),s=Math.floor((n+2*r.margin)*a),o=r.margin*a,c=[r.color.light,r.color.dark];for(let t=0;t<s;t++)for(let l=0;l<s;l++){let d=4*(t*s+l),u=r.color.light;if(t>=o&&l>=o&&t<s-o&&l<s-o){u=c[i[Math.floor((t-o)/a)*n+Math.floor((l-o)/a)]?1:0]}e[d++]=u.r,e[d++]=u.g,e[d++]=u.b,e[d]=u.a}},Dc=function(e,t,r){let n=r,i=t;void 0!==n||t&&t.getContext||(n=t,t=void 0),t||(i=function(){try{return document.createElement("canvas")}catch(e){throw new Error("You need to specify a canvas element")}}()),n=Oc(n);const a=Ac(e.modules.size,n),s=i.getContext("2d"),o=s.createImageData(a,a);return Nc(o.data,e,n),function(e,t,r){e.clearRect(0,0,t.width,t.height),t.style||(t.style={}),t.height=r,t.width=r,t.style.height=r+"px",t.style.width=r+"px"}(s,i,a),s.putImageData(o,0,0),i},Ic=function(e,t,r){let n=r;void 0!==n||t&&t.getContext||(n=t,t=void 0),n||(n={});const i=Dc(e,t,n),a=n.type||"image/png",s=n.rendererOpts||{};return i.toDataURL(a,s.quality)},Fc=function(e,t,r){const n=Oc(t),i=e.modules.size,a=e.modules.data,s=i+2*n.margin,o=n.color.light.a?"<path "+Qc(n.color.light,"fill")+' d="M0 0h'+s+"v"+s+'H0z"/>':"",c="<path "+Qc(n.color.dark,"stroke")+' d="'+function(e,t,r){let n="",i=0,a=!1,s=0;for(let o=0;o<e.length;o++){const c=Math.floor(o%t),l=Math.floor(o/t);c||a||(a=!0),e[o]?(s++,o>0&&c>0&&e[o-1]||(n+=a?Yc("M",c+r,.5+l+r):Yc("m",i,0),i=0,a=!1),c+1<t&&e[o+1]||(n+=Yc("h",s),s=0)):i++}return n}(a,i,n.margin)+'"/>',l='viewBox="0 0 '+s+" "+s+'"',d='<svg xmlns="http://www.w3.org/2000/svg" '+(n.width?'width="'+n.width+'" height="'+n.width+'" ':"")+l+' shape-rendering="crispEdges">'+o+c+"</svg>\n";return"function"==typeof r&&r(null,d),d},zs=function(e,t){if(void 0===e||""===e)throw new Error("No input text");let r,n,i=Ys;return void 0!==t&&(i=to(t.errorCorrectionLevel,Ys),r=Bo(t.version),n=ho(t.maskPattern),t.toSJISFunc&&Hs(t.toSJISFunc)),Zc(e,r,i,n)},Fs=Xc.bind(null,Dc),Xc.bind(null,Ic),Xc.bind(null,(function(e,t,r){return Fc(e,r)}));const Jc=Je.div`
|
|
709
|
+
position: absolute;
|
|
710
|
+
width: 100%;
|
|
711
|
+
bottom: ${e=>e.open?0:"-340px"};
|
|
712
|
+
transition: all 0.4s;
|
|
713
|
+
|
|
714
|
+
${e=>{if(e.desktop)return Oe`
|
|
715
|
+
bottom: ${e.open?0:"calc(-340px - (100vh / 2))"};
|
|
716
|
+
height: 100%;
|
|
717
|
+
display: flex;
|
|
718
|
+
justify-content: center;
|
|
719
|
+
align-items: center;
|
|
720
|
+
`}}
|
|
721
|
+
`,el=Je.div`
|
|
722
|
+
display: flex;
|
|
723
|
+
flex-direction: column;
|
|
724
|
+
height: 340px;
|
|
725
|
+
max-height: 100vh;
|
|
726
|
+
background-color: ${e=>e.theme.settingsBackgroundColor};
|
|
727
|
+
color: ${e=>e.theme.settingsTextColor};
|
|
728
|
+
border-radius: ${e=>e.desktop?"20px":"20px 20px 0 0"};
|
|
729
|
+
`,tl=Je.div`
|
|
730
|
+
display: flex;
|
|
731
|
+
justify-content: space-between;
|
|
732
|
+
align-items: center;
|
|
733
|
+
padding: 12px 14px;
|
|
734
|
+
|
|
735
|
+
h4 {
|
|
736
|
+
margin: 0;
|
|
737
|
+
font-weight: 600;
|
|
738
|
+
}
|
|
739
|
+
`,rl=Je.button`
|
|
740
|
+
display: flex;
|
|
741
|
+
justify-content: center;
|
|
742
|
+
align-items: center;
|
|
743
|
+
border: none;
|
|
744
|
+
background-color: ${e=>e.theme.settingsCloseBackgroundColor};
|
|
745
|
+
border-radius: 50%;
|
|
746
|
+
height: 24px;
|
|
747
|
+
width: 24px;
|
|
748
|
+
padding: 0;
|
|
749
|
+
|
|
750
|
+
svg {
|
|
751
|
+
height: 10px;
|
|
752
|
+
width: 10px;
|
|
753
|
+
|
|
754
|
+
path {
|
|
755
|
+
fill: #000;
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
`,nl=Je.div`
|
|
759
|
+
display: flex;
|
|
760
|
+
justify-content: center;
|
|
761
|
+
flex: 1;
|
|
762
|
+
height: 0;
|
|
763
|
+
|
|
764
|
+
canvas {
|
|
765
|
+
border-radius: 10px;
|
|
766
|
+
height: 100% !important;
|
|
767
|
+
width: auto !important;
|
|
768
|
+
}
|
|
769
|
+
`,il=Je.p`
|
|
770
|
+
display: flex;
|
|
771
|
+
justify-content: center;
|
|
772
|
+
text-align: center;
|
|
773
|
+
margin: 10px 16% 20px;
|
|
774
|
+
font-size: 14px;
|
|
775
|
+
`;var al=()=>{const e=(0,u.useRef)(null),t=(0,u.useRef)(null),{selfPeerId:r,isQRCodePopupVisible:n,setIsQRCodePopupVisible:i,options:a}=(0,u.useContext)(ii),[o,c]=Hi();ki(e,(()=>{n&&i(!1)}));const l=o>c,d=(0,u.useMemo)((()=>{let e=new URL(window.location.href);if(r){if(a.sharedURL)try{e=new URL(a.sharedURL)}catch(e){console.warn(`Shared URL is invalid (${a.sharedURL})`)}e.searchParams.set("microphone-enabled","0"),e.searchParams.set("camera-enabled","1"),e.searchParams.set("qrcode",r)}return e.href}),[a.sharedURL,r]);return(0,u.useEffect)((()=>{const e=e=>{const{type:t}=e.detail.event;"qrcode_close"===t&&i(!1)};return window.addEventListener("customMessage",e),()=>{window.removeEventListener("customMessage",e)}}),[i]),(0,u.useEffect)((()=>{Fs(t.current,d)}),[d]),(0,u.useEffect)((()=>{if(r){const e=new URLSearchParams(window.location.href).get("qrcode");e&&ni.sendCustomMessage(e,{type:"qrcode_close"})}}),[r]),(0,s.jsx)(Jc,{open:n,desktop:l,children:(0,s.jsxs)(el,{ref:e,desktop:l,children:[(0,s.jsxs)(tl,{children:[(0,s.jsx)("h4",{children:"Scan QR Code"}),(0,s.jsx)(rl,{onClick:()=>i(!1),children:(0,s.jsx)(qa,{})})]}),(0,s.jsx)(nl,{children:(0,s.jsx)("canvas",{ref:t})}),(0,s.jsx)(il,{children:"Scan this QR code with your phone camera to open the call."})]})})};u=a("85Hg2");var sl=e=>e.charAt(0).toUpperCase()+e.slice(1);const ol=Je.path`
|
|
776
|
+
fill: ${e=>e.theme.controlsIconColor};
|
|
777
|
+
`;var cl=()=>(0,s.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)(ol,{d:"M12.5 7.115a.75.75 0 0 0-.75.75v5.385A.75.75 0 0 1 11 14H2.75a.75.75 0 0 1-.75-.75V5a.75.75 0 0 1 .75-.75h5.385a.75.75 0 0 0 0-1.5H2.75A2.25 2.25 0 0 0 .5 5v8.25a2.25 2.25 0 0 0 2.25 2.25H11a2.25 2.25 0 0 0 2.25-2.25V7.865a.75.75 0 0 0-.75-.75Zm2.94-6.15a.75.75 0 0 0-.405-.405.75.75 0 0 0-.285-.06h-4.5a.75.75 0 0 0 0 1.5h2.693L5.218 9.717a.75.75 0 0 0 .244 1.23.751.751 0 0 0 .82-.164L14 3.058V5.75a.75.75 0 1 0 1.5 0v-4.5a.75.75 0 0 0-.06-.285Z"})});const ll=Je.path`
|
|
778
|
+
fill: ${e=>e.theme.controlsIconColor};
|
|
779
|
+
`;var dl=({direction:e,small:t})=>"right"===e?(0,s.jsx)("svg",{width:"8",height:"12",viewBox:"0 0 8 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)(ll,{d:"M6.83 5.29 2.59 1.05a1 1 0 1 0-1.42 1.41L4.71 6 1.17 9.54a1 1 0 0 0 0 1.41 1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.24-4.24a1 1 0 0 0 0-1.42Z"})}):"left"===e?(0,s.jsx)("svg",{width:"16",height:"18",viewBox:"0 0 16 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)(ll,{d:"M14.667 7.666H4.547l4.4-4.386a1.339 1.339 0 1 0-1.893-1.894L.387 8.053a1.333 1.333 0 0 0-.28.44 1.333 1.333 0 0 0 0 1.013c.063.164.158.313.28.44l6.667 6.667a1.333 1.333 0 0 0 1.893 0 1.332 1.332 0 0 0 0-1.893l-4.4-4.387h10.12a1.333 1.333 0 1 0 0-2.667Z"})}):null;u=a("85Hg2");const ul=Je.path`
|
|
780
|
+
fill: ${e=>e.theme.controlsIconColor};
|
|
781
|
+
`;var pl=()=>(0,s.jsx)("svg",{width:"12",height:"8",viewBox:"0 0 12 8",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)(ul,{d:"M11.032.407a.75.75 0 0 0-1.065 0L4.38 6.002 2.032 3.647A.766.766 0 1 0 .967 4.75l2.88 2.88a.75.75 0 0 0 1.065 0l6.12-6.12a.75.75 0 0 0 0-1.103Z"})});const fl=Je.div`
|
|
782
|
+
display: flex;
|
|
783
|
+
flex-direction: column;
|
|
784
|
+
position: absolute;
|
|
785
|
+
width: 100%;
|
|
786
|
+
height: 100%;
|
|
787
|
+
bottom: ${e=>e.open?0:"-100vh"};
|
|
788
|
+
right: 0;
|
|
789
|
+
transition: all 0.4s;
|
|
790
|
+
|
|
791
|
+
@media (min-width: 600px) {
|
|
792
|
+
width: 375px;
|
|
793
|
+
bottom: 0;
|
|
794
|
+
right: ${e=>e.open?0:"-375px"};
|
|
795
|
+
}
|
|
796
|
+
`,hl=Je.div`
|
|
797
|
+
display: flex;
|
|
798
|
+
flex-direction: column;
|
|
799
|
+
height: 88%;
|
|
800
|
+
width: 100%;
|
|
801
|
+
background-color: ${e=>e.theme.settingsBackgroundColor};
|
|
802
|
+
color: ${e=>e.theme.settingsTextColor};
|
|
803
|
+
border-radius: 20px 20px 0 0;
|
|
804
|
+
padding: 36px 24px;
|
|
805
|
+
box-sizing: border-box;
|
|
806
|
+
gap: 42px;
|
|
807
|
+
overflow-y: auto;
|
|
808
|
+
|
|
809
|
+
@media (min-width: 600px) {
|
|
810
|
+
border-radius: 0;
|
|
811
|
+
}
|
|
812
|
+
`,ml=Je.div`
|
|
813
|
+
display: flex;
|
|
814
|
+
flex: 1;
|
|
815
|
+
justify-content: center;
|
|
816
|
+
align-items: center;
|
|
817
|
+
background-color: #000;
|
|
818
|
+
position: relative;
|
|
819
|
+
width: 100%;
|
|
820
|
+
|
|
821
|
+
@media (min-width: 600px) {
|
|
822
|
+
background-color: ${e=>e.theme.settingsBackgroundColor};
|
|
823
|
+
}
|
|
824
|
+
`,gl=Je.span`
|
|
825
|
+
color: ${e=>e.theme.settingsHeaderTextColor};
|
|
826
|
+
font-size: 18px;
|
|
827
|
+
font-weight: 700;
|
|
828
|
+
|
|
829
|
+
@media (max-width: 600px) {
|
|
830
|
+
color: #fff;
|
|
831
|
+
}
|
|
832
|
+
`,vl=Je.button`
|
|
833
|
+
display: flex;
|
|
834
|
+
justify-content: center;
|
|
835
|
+
align-items: center;
|
|
836
|
+
position: absolute;
|
|
837
|
+
left: 25px;
|
|
838
|
+
padding: 0;
|
|
839
|
+
border: none;
|
|
840
|
+
background-color: transparent;
|
|
841
|
+
`,yl=Je.div`
|
|
842
|
+
display: flex;
|
|
843
|
+
flex-direction: column;
|
|
844
|
+
gap: 12px;
|
|
845
|
+
`,wl=Je.span`
|
|
846
|
+
color: ${e=>e.theme.settingsHeaderTextColor};
|
|
847
|
+
font-size: 18px;
|
|
848
|
+
font-weight: 700;
|
|
849
|
+
margin-bottom: 4px;
|
|
850
|
+
`,bl=Je.button`
|
|
851
|
+
display: flex;
|
|
852
|
+
background-color: ${e=>e.theme.controlsBackgroundColor};
|
|
853
|
+
border: none;
|
|
854
|
+
border-radius: 10px;
|
|
855
|
+
justify-content: space-between;
|
|
856
|
+
align-items: center;
|
|
857
|
+
padding: 16px 18px;
|
|
858
|
+
font-size: 14px;
|
|
859
|
+
color: ${e=>e.theme.settingsTextColor};
|
|
860
|
+
`,_l=Je.div`
|
|
861
|
+
display: flex;
|
|
862
|
+
align-items: center;
|
|
863
|
+
gap: 8px;
|
|
864
|
+
`,xl=(Je.div`
|
|
865
|
+
display: flex;
|
|
866
|
+
justify-content: ${e=>e.checked?"flex-end":"flex-start"};
|
|
867
|
+
position: relative;
|
|
868
|
+
width: 40px;
|
|
869
|
+
height: 20px;
|
|
870
|
+
background-color: ${e=>e.checked?"#6967fc":"#b5b5b5"};
|
|
871
|
+
border-radius: 10px;
|
|
872
|
+
padding: 5px;
|
|
873
|
+
box-sizing: border-box;
|
|
874
|
+
transition: all 0.4s;
|
|
875
|
+
|
|
876
|
+
&::after {
|
|
877
|
+
position: absolute;
|
|
878
|
+
display: block;
|
|
879
|
+
content: '';
|
|
880
|
+
right: ${e=>e.checked?"calc(0% + 15px)":"calc(100% - 5px)"};
|
|
881
|
+
transform: translate(100%, 0);
|
|
882
|
+
background-color: #fff;
|
|
883
|
+
width: 10px;
|
|
884
|
+
height: 10px;
|
|
885
|
+
border-radius: 50%;
|
|
886
|
+
transition: all 0.4s;
|
|
887
|
+
}
|
|
888
|
+
`,["english"]);var Sl=({back:e})=>{const{language:t,setLanguage:r}=(0,u.useContext)(ii);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(ml,{children:[(0,s.jsx)(gl,{children:"Languages"}),(0,s.jsx)(vl,{onClick:e,children:(0,s.jsx)(dl,{direction:"left"})})]}),(0,s.jsx)(hl,{children:(0,s.jsxs)(yl,{children:[(0,s.jsx)(wl,{children:"Language"}),xl.map((e=>{const n=t===e;return(0,s.jsxs)(bl,{onClick:()=>{r(e)},children:[(0,s.jsx)("span",{children:sl(e)}),(0,s.jsx)("span",{children:n&&(0,s.jsx)(pl,{})})]},e)}))]})})]})};var kl=()=>{const[e,t]=(0,u.useState)("base"),r=(0,u.useRef)(null),{isSettingsMenuVisible:n,setIsSettingsMenuVisible:i,language:a}=(0,u.useContext)(ii),o=(0,u.useCallback)((e=>{!r?.current?.contains(e.target)&&document.body.contains(e.target)&&(i(!1),t("base"))}),[i]);return(0,u.useEffect)((()=>{n?window.addEventListener("click",o):window.removeEventListener("click",o)}),[n,i,o]),(0,s.jsxs)(fl,{ref:r,open:n,children:["base"===e&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(ml,{children:[(0,s.jsx)(gl,{children:"Settings"}),(0,s.jsx)(vl,{onClick:()=>i(!1),children:(0,s.jsx)(qa,{})})]}),(0,s.jsxs)(hl,{children:[(0,s.jsxs)(yl,{children:[(0,s.jsx)(wl,{children:"Preferences"}),(0,s.jsxs)(bl,{onClick:()=>t("languages"),children:[(0,s.jsx)("span",{children:"Language"}),(0,s.jsxs)(_l,{children:[sl(a),(0,s.jsx)(dl,{direction:"right"})]})]})]}),(0,s.jsxs)(yl,{children:[(0,s.jsx)(wl,{children:"Help"}),(0,s.jsxs)(bl,{onClick:()=>{window.open("https://support.snapcall.io/hc/","_blank")},children:[(0,s.jsx)("span",{children:"Go to help center"}),(0,s.jsx)(cl,{})]})]})]})]}),"languages"===e&&(0,s.jsx)(Sl,{back:()=>t("base")})]})};u=a("85Hg2");const El=Je.div`
|
|
889
|
+
position: absolute;
|
|
890
|
+
width: 100%;
|
|
891
|
+
bottom: ${e=>e.open?0:"-220px"};
|
|
892
|
+
transition: all 0.4s;
|
|
893
|
+
|
|
894
|
+
${e=>{if(e.desktop)return Oe`
|
|
895
|
+
bottom: ${e.open?0:"calc(-220px - (100vh / 2))"};
|
|
896
|
+
height: 100%;
|
|
897
|
+
display: flex;
|
|
898
|
+
justify-content: center;
|
|
899
|
+
align-items: center;
|
|
900
|
+
`}}
|
|
901
|
+
`,Rl=Je.div`
|
|
902
|
+
display: flex;
|
|
903
|
+
flex-direction: column;
|
|
904
|
+
width: ${e=>e.desktop?"375px":"100%"};
|
|
905
|
+
height: 220px;
|
|
906
|
+
max-height: 100vh;
|
|
907
|
+
background-color: ${e=>e.theme.settingsBackgroundColor};
|
|
908
|
+
color: ${e=>e.theme.settingsTextColor};
|
|
909
|
+
border-radius: ${e=>e.desktop?"20px":"20px 20px 0 0"};
|
|
910
|
+
padding: 12px 14px 30px;
|
|
911
|
+
box-sizing: border-box;
|
|
912
|
+
`,Cl=Je.div`
|
|
913
|
+
display: flex;
|
|
914
|
+
justify-content: space-between;
|
|
915
|
+
align-items: center;
|
|
916
|
+
margin-bottom: 30px;
|
|
917
|
+
`,Pl=Je.div`
|
|
918
|
+
display: flex;
|
|
919
|
+
align-items: center;
|
|
920
|
+
|
|
921
|
+
h4 {
|
|
922
|
+
margin: 0 0 0 8px;
|
|
923
|
+
font-weight: 600;
|
|
924
|
+
line-height: 19px;
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
svg {
|
|
928
|
+
height: 13px;
|
|
929
|
+
}
|
|
930
|
+
`,Tl=Je.button`
|
|
931
|
+
display: flex;
|
|
932
|
+
justify-content: center;
|
|
933
|
+
align-items: center;
|
|
934
|
+
border: none;
|
|
935
|
+
background-color: ${e=>e.theme.settingsCloseBackgroundColor};
|
|
936
|
+
border-radius: 50%;
|
|
937
|
+
height: 24px;
|
|
938
|
+
width: 24px;
|
|
939
|
+
padding: 0;
|
|
940
|
+
|
|
941
|
+
svg {
|
|
942
|
+
height: 10px;
|
|
943
|
+
width: 10px;
|
|
944
|
+
|
|
945
|
+
path {
|
|
946
|
+
fill: #000;
|
|
947
|
+
}
|
|
948
|
+
}
|
|
949
|
+
`,jl=Je.form`
|
|
950
|
+
display: flex;
|
|
951
|
+
flex-direction: column;
|
|
952
|
+
`,Ml=Je.div`
|
|
953
|
+
display: flex;
|
|
954
|
+
flex-direction: column;
|
|
955
|
+
position: relative;
|
|
956
|
+
|
|
957
|
+
label {
|
|
958
|
+
font-size: 10px;
|
|
959
|
+
font-weight: 700;
|
|
960
|
+
line-height: 10px;
|
|
961
|
+
color: #fff;
|
|
962
|
+
margin-bottom: 10px;
|
|
963
|
+
}
|
|
964
|
+
|
|
965
|
+
input {
|
|
966
|
+
padding: 16px 10px 16px 20px;
|
|
967
|
+
border-radius: 15px;
|
|
968
|
+
background-color: #4e4e4e;
|
|
969
|
+
border: 1px solid ${e=>e.errored?"#d84949":"transparent"};
|
|
970
|
+
color: #fff;
|
|
971
|
+
|
|
972
|
+
&:focus {
|
|
973
|
+
outline: none;
|
|
974
|
+
border: 1px solid #6967fc;
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
`,Dl=Je.span`
|
|
978
|
+
position: absolute;
|
|
979
|
+
left: 0;
|
|
980
|
+
bottom: -20px;
|
|
981
|
+
color: #d84949;
|
|
982
|
+
font-size: 10px;
|
|
983
|
+
font-weight: 700;
|
|
984
|
+
line-height: 10px;
|
|
985
|
+
margin-top: 10px;
|
|
986
|
+
`,Il=Je.button`
|
|
987
|
+
background-color: #6967fc;
|
|
988
|
+
padding: 8px 18px;
|
|
989
|
+
border-radius: 50px;
|
|
990
|
+
margin: 30px auto 0;
|
|
991
|
+
border: none;
|
|
992
|
+
color: #fff;
|
|
993
|
+
font-size: 16px;
|
|
994
|
+
font-weight: 700;
|
|
995
|
+
line-height: 18px;
|
|
996
|
+
`,Ol=/.*(?:youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=)([^#&?]*).*/;var Ll=()=>{const e=(0,u.useRef)(null),[t,r]=(0,u.useState)(""),[n,i]=(0,u.useState)(null),{isYoutubePopupVisible:a,setIsYoutubePopupVisible:o}=(0,u.useContext)(ii),{dispatch:c}=ui(),[l,d]=Hi(),p=l>d;ki(e,(()=>{a&&o(!1)}));return(0,u.useEffect)((()=>{r(""),i(null)}),[a]),(0,s.jsx)(El,{open:a,desktop:p,children:(0,s.jsxs)(Rl,{ref:e,desktop:p,children:[(0,s.jsxs)(Cl,{children:[(0,s.jsxs)(Pl,{children:[(0,s.jsx)(Ts,{}),(0,s.jsx)("h4",{children:"Embed YouTube"})]}),(0,s.jsx)(Tl,{onClick:()=>o(!1),children:(0,s.jsx)(qa,{})})]}),(0,s.jsxs)(jl,{onSubmit:e=>{e.preventDefault(),i(null);const[,r]=t.match(Ol)||[];r?(c({type:ai.SET_HIGHLIGHTED_TILE,payload:{type:"youtube",peerId:"self",data:{videoId:r,local:!0}}}),o(!1)):i("Invalid YouTube URL")},children:[(0,s.jsxs)(Ml,{errored:Boolean(n),children:[(0,s.jsx)("label",{htmlFor:"youtube-popup-input",children:"YOUTUBE URL"}),(0,s.jsx)("input",{id:"youtube-popup-input",placeholder:"http://www.youtube.com/watch?v=abcdef",value:t,onChange:e=>r(e.target.value)}),n&&(0,s.jsx)(Dl,{children:n})]}),(0,s.jsx)(Il,{type:"submit",children:"Share video"})]})]})})};const Al=Je.div`
|
|
997
|
+
position: absolute;
|
|
998
|
+
width: 100%;
|
|
999
|
+
height: 100%;
|
|
1000
|
+
background-color: ${e=>e.open?"rgba(0, 0, 0, 0.9)":"transparent"};
|
|
1001
|
+
z-index: ${e=>e.open?100:-1};
|
|
1002
|
+
overflow: hidden;
|
|
1003
|
+
transition: all ${e=>e.open?"0.2s":"0.6s"};
|
|
1004
|
+
`;var Nl=()=>{const{isQRCodePopupVisible:e,isSettingsMenuVisible:t,isYoutubePopupVisible:r}=(0,u.useContext)(ii),n=e||t||r;return(0,s.jsxs)(Al,{open:n,children:[(0,s.jsx)(al,{}),(0,s.jsx)(kl,{}),(0,s.jsx)(Ll,{})]})};u=a("85Hg2");const Fl=Je.div`
|
|
1005
|
+
display: flex;
|
|
1006
|
+
flex: 1;
|
|
1007
|
+
flex-direction: column;
|
|
1008
|
+
justify-content: center;
|
|
1009
|
+
align-items: center;
|
|
1010
|
+
background-color: #000;
|
|
1011
|
+
color: #fff;
|
|
1012
|
+
`,Bl=Je.span`
|
|
1013
|
+
font-size: 60px;
|
|
1014
|
+
`,zl=Je.h1`
|
|
1015
|
+
font-size: 28px;
|
|
1016
|
+
font-weight: 600;
|
|
1017
|
+
line-height: 33.6px;
|
|
1018
|
+
`,$l=Je.p`
|
|
1019
|
+
font-size: 22px;
|
|
1020
|
+
font-weight: 500;
|
|
1021
|
+
line-height: 26.4px;
|
|
1022
|
+
margin: 0;
|
|
1023
|
+
`,Ul=Je.button`
|
|
1024
|
+
background-color: #6967fc;
|
|
1025
|
+
border: none;
|
|
1026
|
+
border-radius: 50px;
|
|
1027
|
+
padding: 12px 18px;
|
|
1028
|
+
font-size: 16px;
|
|
1029
|
+
font-weight: 600;
|
|
1030
|
+
line-height: 18px;
|
|
1031
|
+
color: #fff;
|
|
1032
|
+
margin-top: 30px;
|
|
1033
|
+
`;var Vl=()=>{const{streamState:e,setStreamState:t}=(0,u.useContext)(ii),r="ended"===e,n="terminated"===e,i="expired"===e;return(0,u.useEffect)((()=>{document.pictureInPictureElement&&document.exitPictureInPicture()}),[]),(0,s.jsxs)(Fl,{children:[(0,s.jsxs)(Bl,{children:[(r||n)&&"👋",i&&"🥺"]}),(0,s.jsxs)(zl,{children:[r&&"You left the call",n&&"The call is now ended",i&&"You arrived too late"]}),i&&(0,s.jsx)($l,{children:"The call is over or deleted"}),r&&(0,s.jsx)(Ul,{onClick:()=>{ni.init(),t("streaming")},children:"Go back to call"})]})};u=a("85Hg2");const Hl=new Audio("https://cdn.snapcall.io/stream/connected.mp3"),Wl=new Audio("https://cdn.snapcall.io/stream/disconnected.mp3"),ql=new Audio("https://cdn.snapcall.io/stream/user-connected.mp3"),Gl=new Audio("https://cdn.snapcall.io/stream/user-disconnected.mp3");var Zl=()=>{const{userInteractionTriggered:e}=(0,u.useContext)(ii),t=async()=>{try{ql.currentTime=0,await ql.play()}catch(e){console.warn("Couldn't play user connected sound")}},r=async()=>{try{Gl.currentTime=0,await Gl.play()}catch(e){console.warn("Couldn't play user disconnected sound")}},n=async()=>{try{await Wl.play()}catch(e){console.warn("Couldn't play disconnected sound")}};return(0,u.useEffect)((()=>(window.addEventListener("newPeer",t),window.addEventListener("peerClosed",r),window.addEventListener("snapcallEvent_callEnd",n),()=>{window.removeEventListener("newPeer",t),window.removeEventListener("peerClosed",r),window.removeEventListener("snapcallEvent_callEnd",n)})),[]),(0,u.useEffect)((()=>{e&&(async()=>{try{await Hl.play()}catch(e){console.warn("Couldn't play connected sound")}})()}),[e]),null};const Kl={error:ys,critical:ws},Ql=Ye`
|
|
1034
|
+
@keyframes fadeIn {
|
|
1035
|
+
0% {
|
|
1036
|
+
opacity: 0;
|
|
1037
|
+
}
|
|
1038
|
+
100% {
|
|
1039
|
+
opacity: 1;
|
|
1040
|
+
}
|
|
1041
|
+
}
|
|
1042
|
+
@keyframes fadeOut {
|
|
1043
|
+
0% {
|
|
1044
|
+
opacity: 1;
|
|
1045
|
+
}
|
|
1046
|
+
100% {
|
|
1047
|
+
opacity: 0;
|
|
1048
|
+
}
|
|
1049
|
+
}
|
|
1050
|
+
`,Yl={top:110},Xl={style:{fontSize:"14px",fontWeight:400,lineHeight:"18px",padding:"10px 15px",color:"#fff",backgroundColor:"rgba(45, 45, 45, 0.75)",textAlign:"left",borderRadius:"50px"}},Jl=Je.div`
|
|
1051
|
+
max-width: 200px;
|
|
1052
|
+
div {
|
|
1053
|
+
margin: 0;
|
|
1054
|
+
}
|
|
1055
|
+
`,ed=Je.div`
|
|
1056
|
+
display: flex;
|
|
1057
|
+
margin-right: 10px;
|
|
1058
|
+
`;var td=()=>(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Ql,{}),(0,s.jsx)(yr,{toastOptions:Xl,containerStyle:Yl,children:e=>(0,s.jsx)(mr,{toast:e,style:{...e.style,animation:e.visible?"fadeIn 1s ease forwards":"fadeOut 1s forwards ease"},children:({message:t})=>{const r=(e=>{if(e){const t=Kl[e];if(t)return t}return null})(e.className);return(0,s.jsxs)(s.Fragment,{children:[r&&(0,s.jsx)(ed,{children:r}),(0,s.jsx)(Jl,{children:t})]})}})})]});const rd={backgroundColor:"#fff",controlBarBackground:"#fff",logoColor:"#000",controlsIconColor:"#4f5a65",controlsBackgroundColor:"#f9f9f9",controlsBorderColor:"#f5f5f5",controlsHoverBorderColor:"#8d8d8d",streamTileBackgroundColor:"#eaebec",streamTileBorderColor:"#d3d6d9",settingsBackgroundColor:"#fff",settingsHeaderTextColor:"#000",settingsTextColor:"#000",settingsCloseBackgroundColor:"#eaebec"},nd={backgroundColor:"#000",controlBarBackground:"linear-gradient(180deg, #000000 0%, #131313 100%)",logoColor:"#fff",controlsIconColor:"#fff",controlsBackgroundColor:"#2d2d2d",controlsBorderColor:"#343434",controlsHoverBorderColor:"#8d8d8d",streamTileBackgroundColor:"#131313",streamTileBorderColor:"#1f1f1f",settingsBackgroundColor:"#242324",settingsHeaderTextColor:"#f9f9f9",settingsTextColor:"#fff",settingsCloseBackgroundColor:"#7b7c7e"};var id=()=>(0,s.jsx)("svg",{style:{position:"absolute",width:0,height:0},children:(0,s.jsxs)("defs",{children:[(0,s.jsxs)("linearGradient",{id:"snapcallLogoSmall",x1:"34.5",y1:"2",x2:"34.5",y2:"66.334",gradientUnits:"userSpaceOnUse",children:[(0,s.jsx)("stop",{stopColor:"#D4D4D4"}),(0,s.jsx)("stop",{offset:"1",stopColor:"#979797"})]}),(0,s.jsxs)("linearGradient",{id:"microphoneBottom",x1:"15",y1:"12.5",x2:"15",y2:"28.75",gradientUnits:"userSpaceOnUse",children:[(0,s.jsx)("stop",{stopColor:"#9A9A9A"}),(0,s.jsx)("stop",{offset:"1",stopColor:"#969696"})]}),(0,s.jsxs)("linearGradient",{id:"microphoneTop",x1:"15",y1:"1.25",x2:"15",y2:"18.75",gradientUnits:"userSpaceOnUse",children:[(0,s.jsx)("stop",{stopColor:"#D4D4D4"}),(0,s.jsx)("stop",{offset:"1",stopColor:"#BFBFBF"})]}),(0,s.jsxs)("linearGradient",{id:"cameraRight",x1:"24.531",y1:"8.438",x2:"24.531",y2:"21.563",gradientUnits:"userSpaceOnUse",children:[(0,s.jsx)("stop",{stopColor:"#9A9A9A"}),(0,s.jsx)("stop",{offset:"1",stopColor:"#969696"})]}),(0,s.jsxs)("linearGradient",{id:"cameraLeft",x1:"11.875",y1:"7.5",x2:"11.875",y2:"22.5",gradientUnits:"userSpaceOnUse",children:[(0,s.jsx)("stop",{stopColor:"#D4D4D4"}),(0,s.jsx)("stop",{offset:"1",stopColor:"#BFBFBF"})]}),(0,s.jsxs)("linearGradient",{id:"screenTop",x1:"15.5",y1:"3.75",x2:"15.5",y2:"21.25",gradientUnits:"userSpaceOnUse",children:[(0,s.jsx)("stop",{stopColor:"#D4D4D4"}),(0,s.jsx)("stop",{offset:"1",stopColor:"#BFBFBF"})]}),(0,s.jsxs)("linearGradient",{id:"screenBottom",x1:"15.5",y1:"21.25",x2:"15.5",y2:"26.25",gradientUnits:"userSpaceOnUse",children:[(0,s.jsx)("stop",{stopColor:"#9A9A9A"}),(0,s.jsx)("stop",{offset:"1",stopColor:"#969696"})]})]})});const ad=new Blob([new Uint8Array([255,227,24,196,0,0,0,3,72,1,64,0,0,4,132,16,31,227,192,225,76,255,67,12,255,221,27,255,228,97,73,63,255,195,131,69,192,232,223,255,255,207,102,239,255,255,255,101,158,206,70,20,59,255,254,95,70,149,66,4,16,128,0,2,2,32,240,138,255,36,106,183,255,227,24,196,59,11,34,62,80,49,135,40,0,253,29,191,209,200,141,71,7,255,252,152,74,15,130,33,185,6,63,255,252,195,70,203,86,53,15,255,255,247,103,76,121,64,32,47,255,34,227,194,209,138,76,65,77,69,51,46,57,55,170,170,170,170,170,170,170,170,170,170,255,227,24,196,73,13,153,210,100,81,135,56,0,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170])],{type:"audio/mpeg"}),sd=URL.createObjectURL(ad),od=async()=>{try{const e=new Audio(sd);await e.play()}catch(e){console.warn("User interaction is required, asking audio GUM"),await navigator.mediaDevices.getUserMedia({audio:!0})}},cd=Ye`
|
|
1059
|
+
::-webkit-scrollbar {
|
|
1060
|
+
display: none;
|
|
1061
|
+
width: 0;
|
|
1062
|
+
height: 0;
|
|
1063
|
+
}
|
|
1064
|
+
|
|
1065
|
+
@font-face {
|
|
1066
|
+
font-family: 'Lato';
|
|
1067
|
+
font-weight: 300;
|
|
1068
|
+
src: url('https://cdn.snapcall.io/fonts/Lato/Light.woff2') format('woff2'),
|
|
1069
|
+
url('https://cdn.snapcall.io/fonts/Lato/Light.woff') format('woff');
|
|
1070
|
+
}
|
|
1071
|
+
@font-face {
|
|
1072
|
+
font-family: 'Lato';
|
|
1073
|
+
font-weight: 400;
|
|
1074
|
+
src: url('https://cdn.snapcall.io/fonts/Lato/Regular.woff2') format('woff2'),
|
|
1075
|
+
url('https://cdn.snapcall.io/fonts/Lato/Regular.woff') format('woff');
|
|
1076
|
+
}
|
|
1077
|
+
@font-face {
|
|
1078
|
+
font-family: 'Lato';
|
|
1079
|
+
font-weight: 500;
|
|
1080
|
+
src: url('https://cdn.snapcall.io/fonts/Lato/Medium.woff2') format('woff2'),
|
|
1081
|
+
url('https://cdn.snapcall.io/fonts/Lato/Medium.woff') format('woff');
|
|
1082
|
+
}
|
|
1083
|
+
@font-face {
|
|
1084
|
+
font-family: 'Lato';
|
|
1085
|
+
font-weight: 600;
|
|
1086
|
+
src: url('https://cdn.snapcall.io/fonts/Lato/Semibold.woff2') format('woff2'),
|
|
1087
|
+
url('https://cdn.snapcall.io/fonts/Lato/Semibold.woff') format('woff');
|
|
1088
|
+
}
|
|
1089
|
+
@font-face {
|
|
1090
|
+
font-family: 'Lato';
|
|
1091
|
+
font-weight: 700;
|
|
1092
|
+
src: url('https://cdn.snapcall.io/fonts/Lato/Bold.woff2') format('woff2'),
|
|
1093
|
+
url('https://cdn.snapcall.io/fonts/Lato/Bold.woff') format('woff');
|
|
1094
|
+
}
|
|
1095
|
+
`,ld=Je.div`
|
|
1096
|
+
display: flex;
|
|
1097
|
+
flex-direction: column;
|
|
1098
|
+
width: 100%;
|
|
1099
|
+
height: 100%;
|
|
1100
|
+
font-family: 'Lato';
|
|
1101
|
+
position: relative;
|
|
1102
|
+
overflow: auto;
|
|
1103
|
+
overscroll-behavior-y: none;
|
|
1104
|
+
-webkit-overflow-scrolling: touch;
|
|
1105
|
+
scrollbar-width: none;
|
|
1106
|
+
|
|
1107
|
+
button {
|
|
1108
|
+
cursor: pointer;
|
|
1109
|
+
font-family: 'Lato';
|
|
1110
|
+
}
|
|
1111
|
+
`,dd=(()=>{try{const e=localStorage.getItem("stream_ui_theme");return e||"dark"}catch(e){return console.warn(e),"dark"}})(),ud=(()=>{try{const e=localStorage.getItem("stream_ui_language");return e||"english"}catch(e){return console.warn(e),"english"}})();var pd=({options:e})=>{const[t,r]=(0,u.useState)(void 0),n=(0,u.useRef)(null),i=(0,u.useRef)(null),a=(0,u.useRef)(null),[o,c]=(0,u.useState)("streaming"),[l,d]=(0,u.useState)(!1),[p,f]=(0,u.useState)(!1),[h,m]=(0,u.useState)(!1),[g,v]=(0,u.useState)(dd),[y,w]=(0,u.useState)(ud),[b,_]=(0,u.useState)(""),[x,S]=(0,u.useState)(!0),[k,E]=(0,u.useState)(!1),[R,C]=(0,u.useState)(!1),[P,T]=(0,u.useState)(!1),[j,M]=(0,u.useState)(!1),[D,I]=Hi(),O=D>I?"landscape":"portrait",L="dark"===g?nd:rd,A=async e=>{const{peerId:t}=e.detail;r(t);try{await od(),M(!0)}catch(e){console.error("User interaction trigger failed",e)}},N=e=>{"localVideoAvailable"===e.type?E(!0):E(!1)},F=e=>{"screenshareEnabled"===e.type?C(!0):C(!1)},B=e=>{"microphoneMute"===e.type?S(!0):S(!1)},z=e=>{const{displayName:t}=e.detail;_(t)},$=()=>{c("ended"),S(!0),E(!1),C(!1),M(!1)},U=()=>{c("terminated")},V=()=>{c("expired")},H=e=>{const{success:t}=e.detail;t?T(!0):wr("An error occured while trying to join the room as an agent",{className:"error"})};return(0,u.useEffect)((()=>{try{localStorage.setItem("stream_ui_theme",g)}catch(e){console.warn(e)}}),[g]),(0,u.useEffect)((()=>{try{localStorage.setItem("stream_ui_language",y)}catch(e){console.warn(e)}}),[y]),(0,u.useEffect)((()=>(window.addEventListener("enterRoom",A),window.addEventListener("localVideoAvailable",N),window.addEventListener("localVideoUnavailable",N),window.addEventListener("screenshareEnabled",F),window.addEventListener("screenshareDisabled",F),window.addEventListener("microphoneEnabled",B),window.addEventListener("microphoneMute",B),window.addEventListener("microphoneUnmute",B),window.addEventListener("selfDisplayName",z),window.addEventListener("terminateRoom",U),window.addEventListener("snapcallEvent_callEnd",$),window.addEventListener("invalidRoom",V),window.addEventListener("agentIdentity",H),()=>{window.removeEventListener("enterRoom",A),window.removeEventListener("localVideoAvailable",N),window.removeEventListener("localVideoUnavailable",N),window.removeEventListener("screenshareEnabled",F),window.removeEventListener("screenshareDisabled",F),window.removeEventListener("microphoneEnabled",B),window.removeEventListener("microphoneMute",B),window.removeEventListener("microphoneUnmute",B),window.removeEventListener("selfDisplayName",z),window.removeEventListener("terminateRoom",U),window.removeEventListener("snapcallEvent_callEnd",$),window.removeEventListener("invalidRoom",V),window.removeEventListener("agentIdentity",H)})),[]),(0,s.jsx)(ii.Provider,{value:{selfPeerId:t,streamUIContainerRef:n,videosContainerRef:i,remoteTilesContainerRef:a,streamState:o,setStreamState:c,isQRCodePopupVisible:l,setIsQRCodePopupVisible:d,isSettingsMenuVisible:p,setIsSettingsMenuVisible:f,isYoutubePopupVisible:h,setIsYoutubePopupVisible:m,theme:g,setTheme:v,language:y,setLanguage:w,options:e,selfDisplayName:b,muted:x,streaming:k,screensharing:R,isAgent:P,userInteractionTriggered:j,orientation:O},children:(0,s.jsxs)(qe,{theme:L,children:[(0,s.jsx)(cd,{}),(0,s.jsx)(id,{}),(0,s.jsxs)(ld,{ref:n,children:[(0,s.jsx)(td,{}),(0,s.jsx)(Zl,{}),"streaming"===o&&(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)(di,{children:[(0,s.jsx)(Vi,{}),(0,s.jsx)(Es,{}),(0,s.jsx)(Gs,{}),(0,s.jsx)(Nl,{})]})}),("ended"===o||"terminated"===o||"expired"===o)&&(0,s.jsx)(Vl,{})]})]})})};const fd=new URL(window.location.href),hd="0"!==fd.searchParams.get("microphone-enabled"),md="1"===fd.searchParams.get("camera-enabled"),gd={sharedURL:window.location.href,showMenuButton:!0,controls:{microphone:{available:!0,enabled:hd},camera:{available:!0,enabled:md},screenshare:{available:!0}}},vd={init:({element:e,...t})=>{if(e?.nodeType!==window.Node.ELEMENT_NODE)throw new Error('The "element" property must be a valid element!');const r=l(gd,t);(0,o.render)((0,s.jsx)(pd,{options:r}),e)},setExtraSettingsOptions:e=>{const t=new CustomEvent("streamUISetExtraSettingsOptions",{detail:{extraOptions:e}});window.dispatchEvent(t)},joinRoom:(...e)=>ni.init(...e),leaveRoom:(...e)=>ni.endCall(...e),terminateRoom:(...e)=>ni.terminateRoom(...e),generateToken:(...e)=>ni.generateToken(...e)};window.streamUI=vd,window.snapcallAPI={join:(...e)=>(console.warn("snapcallAPI.join is deprecated, please use streamUI.joinRoom instead!"),vd.joinRoom(...e)),endCall:(...e)=>(console.warn("snapcallAPI.endCall is deprecated, please use streamUI.leaveRoom instead!"),vd.leaveRoom(...e)),terminateRoom:(...e)=>(console.warn("snapcallAPI.terminateRoom is deprecated, please use streamUI.terminateRoom instead!"),vd.terminateRoom(...e)),generateToken:(...e)=>(console.warn("snapcallAPI.generateToken is deprecated, please use streamUI.generateToken instead!"),vd.generateToken(...e)),setDisplayName:(...e)=>(console.warn("snapcallAPI.setDisplayName is deprecated, please use streamUI.joinRoom options instead!"),ni.setDisplayName(...e))}})();
|