@whereby.com/browser-sdk 2.0.0-alpha2 → 2.0.0-alpha3

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.
@@ -7,16 +7,16 @@ function O(e){return e.join(T).replace(N,z).replace(A,F)}var D=" \\f\\n\\r\\t",j
7
7
  /*! (c) Andrea Giammarchi - ISC */
8
8
  var K=function(e){var t="fragment",n="template",i="content"in r(n)?function(e){var t=r(n);return t.innerHTML=e,t.content}:function(e){var i=r(t),a=r(n),o=null;if(/^[^\S]*?<(col(?:group)?|t(?:head|body|foot|r|d|h))/i.test(e)){var c=RegExp.$1;a.innerHTML="<table>"+e+"</table>",o=a.querySelectorAll(c)}else a.innerHTML=e,o=a.childNodes;return s(i,o),i};return function(e,t){return("svg"===t?a:i)(e)};function s(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function r(n){return n===t?e.createDocumentFragment():e.createElementNS("http://www.w3.org/1999/xhtml",n)}function a(e){var n=r(t),i=r("div");return i.innerHTML='<svg xmlns="http://www.w3.org/2000/svg">'+e+"</svg>",s(n,i.firstChild.childNodes),n}}(document),J=(e,t,n,i,s)=>{const r=n.length;let a=t.length,o=r,c=0,p=0,d=null;for(;c<a||p<o;)if(a===c){const t=o<r?p?i(n[p-1],-0).nextSibling:i(n[o-p],0):s;for(;p<o;)e.insertBefore(i(n[p++],1),t)}else if(o===p)for(;c<a;)d&&d.has(t[c])||e.removeChild(i(t[c],-1)),c++;else if(t[c]===n[p])c++,p++;else if(t[a-1]===n[o-1])a--,o--;else if(t[c]===n[o-1]&&n[p]===t[a-1]){const s=i(t[--a],-1).nextSibling;e.insertBefore(i(n[p++],1),i(t[c++],-1).nextSibling),e.insertBefore(i(n[--o],1),s),t[a]=n[o]}else{if(!d){d=new Map;let e=p;for(;e<o;)d.set(n[e],e++)}if(d.has(t[c])){const s=d.get(t[c]);if(p<s&&s<o){let r=c,l=1;for(;++r<a&&r<o&&d.get(t[r])===s+l;)l++;if(l>s-p){const r=i(t[c],0);for(;p<s;)e.insertBefore(i(n[p++],1),r)}else e.replaceChild(i(n[p++],1),i(t[c++],-1))}else c++}else e.removeChild(i(t[c++],-1))}return n},Q=function(e,t,n,i,s){var r=s in e,a=e.createDocumentFragment();return a.appendChild(e.createTextNode("g")),a.appendChild(e.createTextNode("")),(r?e.importNode(a,!0):a.cloneNode(!0)).childNodes.length<2?function e(t,n){for(var i=t.cloneNode(),s=t.childNodes||[],r=s.length,a=0;n&&a<r;a++)i.appendChild(e(s[a],n));return i}:r?e.importNode:function(e,t){return e.cloneNode(!!t)}}(document,0,0,0,"importNode"),Y="".trim||function(){return String(this).replace(/^\s+|\s+/g,"")},X=R?function(e,t){var n=t.join(" ");return t.slice.call(e,0).sort((function(e,t){return n.indexOf(e.name)<=n.indexOf(t.name)?-1:1}))}:function(e,t){return t.slice.call(e,0)};function Z(e,t){for(var n=t.length,i=0;i<n;)e=e.childNodes[t[i++]];return e}function ee(e,t,n,i){for(var s=e.childNodes,r=s.length,a=0;a<r;){var o=s[a];switch(o.nodeType){case 1:var c=i.concat(a);te(o,t,n,c),ee(o,t,n,c);break;case 8:var p=o.textContent;if(p===C)n.shift(),t.push(P.test(e.nodeName)?se(e,i):ne(o,i.concat(a)));else switch(p.slice(0,2)){case"/*":if("*/"!==p.slice(-2))break;case"👻":e.removeChild(o),a--,r--}break;case 3:P.test(e.nodeName)&&Y.call(o.textContent)===T&&(n.shift(),t.push(se(e,i)))}a++}}function te(e,t,n,i){for(var s=e.attributes,r=[],a=[],o=X(s,n),c=o.length,p=0;p<c;){var d,l=o[p++],u=l.value===C;if(u||1<(d=l.value.split(T)).length){var m=l.name;if(r.indexOf(m)<0){r.push(m);var h=n.shift().replace(u?/^(?:|[\S\s]*?\s)(\S+?)\s*=\s*('|")?$/:new RegExp("^(?:|[\\S\\s]*?\\s)("+m+")\\s*=\\s*('|\")[\\S\\s]*","i"),"$1"),f=s[h]||s[h.toLowerCase()];if(u)t.push(ie(f,i,h,null));else{for(var g=d.length-2;g--;)n.shift();t.push(ie(f,i,h,d))}}a.push(l)}}p=0;for(var v=(0<(c=a.length)&&R&&!("ownerSVGElement"in e));p<c;){var b=a[p++];v&&(b.value=""),e.removeAttribute(b.name)}var y=e.nodeName;if(/^script$/i.test(y)){var _=document.createElement(y);for(c=s.length,p=0;p<c;)_.setAttributeNode(s[p++].cloneNode(!0));_.textContent=e.textContent,e.parentNode.replaceChild(_,e)}}function ne(e,t){return{type:"any",node:e,path:t}}function ie(e,t,n,i){return{type:"attr",node:e,path:t,name:n,sparse:i}}function se(e,t){return{type:"text",node:e,path:t}}var re=H(new b);function ae(e,t){var n=(e.convert||O)(t),i=e.transform;i&&(n=i(n));var s=K(n,e.type);pe(s);var r=[];return ee(s,r,t.slice(0),[]),{content:s,updates:function(n){for(var i=[],s=r.length,a=0,o=0;a<s;){var c=r[a++],p=Z(n,c.path);switch(c.type){case"any":i.push({fn:e.any(p,[]),sparse:!1});break;case"attr":var d=c.sparse,l=e.attribute(p,c.name,c.node);null===d?i.push({fn:l,sparse:!1}):(o+=d.length-2,i.push({fn:l,sparse:!0,values:d}));break;case"text":i.push({fn:e.text(p),sparse:!1}),p.textContent=""}}return s+=o,function(){var e=arguments.length;if(s!==e-1)throw new Error(e-1+" values instead of "+s+"\n"+t.join("${value}"));for(var r=1,a=1;r<e;){var o=i[r-a];if(o.sparse){var c=o.values,p=c[0],d=1,l=c.length;for(a+=l-2;d<l;)p+=arguments[r++]+c[d++];o.fn(p)}else o.fn(arguments[r++])}return n}}}}function oe(e,t){var n=re.get(t)||re.set(t,ae(e,t));return n.updates(Q.call(document,n.content,!0))}var ce=[];function pe(e){for(var t=e.childNodes,n=t.length;n--;){var i=t[n];1!==i.nodeType&&0===Y.call(i.textContent).length&&e.removeChild(i)}}
9
9
  /*! (c) Andrea Giammarchi - ISC */var de=function(){var e=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,t=/([^A-Z])([A-Z]+)/g;return function(e,t){return"ownerSVGElement"in e?function(e,t){var n;t?n=t.cloneNode(!0):(e.setAttribute("style","--hyper:style;"),n=e.getAttributeNode("style"));return n.value="",e.setAttributeNode(n),i(n,!0)}(e,t):i(e.style,!1)};function n(e,t,n){return t+"-"+n.toLowerCase()}function i(i,s){var r,a;return function(o){var c,p,d,l;switch(typeof o){case"object":if(o){if("object"===r){if(!s&&a!==o)for(p in a)p in o||(i[p]="")}else s?i.value="":i.cssText="";for(p in c=s?{}:i,o)d="number"!=typeof(l=o[p])||e.test(p)?l:l+"px",!s&&/^--/.test(p)?c.setProperty(p,d):c[p]=d;r="object",s?i.value=function(e){var i,s=[];for(i in e)s.push(i.replace(t,n),":",e[i],";");return s.join("")}(a=c):a=o;break}default:a!=o&&(r="string",a=o,s?i.value=o||"":i.cssText=o||"")}}}}();const le=(e,t)=>{let n,i=!0;const s=document.createAttributeNS(null,t);return t=>{n!==t&&(n=t,null==n?i||(e.removeAttributeNode(s),i=!0):(s.value=t,i&&(e.setAttributeNodeNS(s),i=!1)))}},ue=({dataset:e})=>t=>{for(const n in t){const i=t[n];null==i?delete e[n]:e[n]=i}},me=(e,t)=>"dataset"===t?ue(e):n=>{e[t]=n},he=/^(?:form|list)$/i,fe=(e,t)=>e.ownerDocument.createTextNode(t);function ge(e){return this.type=e,function(e){var t=ce,n=pe;return function(i){return t!==i&&(n=oe(e,t=i)),n.apply(null,arguments)}}(this)}function ve(e){return e(this)}ge.prototype={attribute(e,t,n){const i="svg"===this.type;switch(t){case"class":if(i)return le(e,t);t="className";case"props":return me(e,t);case"aria":return(e=>t=>{for(const n in t){const i="role"===n?n:`aria-${n}`,s=t[n];null==s?e.removeAttribute(i):e.setAttribute(i,s)}})(e);case"style":return de(e,n,i);case"ref":return(e=>t=>{"function"==typeof t?t(e):t.current=e})(e);case".dataset":return ue(e);default:return"."===t.slice(0,1)?me(e,t.slice(1)):"?"===t.slice(0,1)?((e,t,n)=>i=>{n!==!!i&&((n=!!i)?e.setAttribute(t,""):e.removeAttribute(t))})(e,t.slice(1)):"on"===t.slice(0,2)?((e,t)=>{let n,i=t.slice(2);return!(t in e)&&t.toLowerCase()in e&&(i=i.toLowerCase()),t=>{const s=q(t)?t:[t,!1];n!==s[0]&&(n&&e.removeEventListener(i,n,s[1]),(n=s[0])&&e.addEventListener(i,n,s[1]))}})(e,t):!(t in e)||i||he.test(t)?le(e,t):((e,t)=>{let n;return i=>{n!==i&&(n=i,e[t]!==i&&(null==i?(e[t]="",e.removeAttribute(t)):e[t]=i))}})(e,t)}},any(e,t){const{type:n}=this;let i,s=!1;const r=a=>{switch(typeof a){case"string":case"number":case"boolean":s?i!==a&&(i=a,t[0].textContent=a):(s=!0,i=a,t=J(e.parentNode,t,[fe(e,a)],W,e));break;case"function":r(a(e));break;case"object":case"undefined":if(null==a){s=!1,t=J(e.parentNode,t,[],W,e);break}default:if(s=!1,i=a,q(a))if(0===a.length)t.length&&(t=J(e.parentNode,t,[],W,e));else switch(typeof a[0]){case"string":case"number":case"boolean":r(String(a));break;case"function":r(a.map(ve,e));break;case"object":q(a[0])&&(a=a.concat.apply([],a));default:t=J(e.parentNode,t,a,W,e)}else"ELEMENT_NODE"in a?t=J(e.parentNode,t,11===a.nodeType?V.call(a.childNodes):[a],W,e):"text"in a?r(String(a.text)):"any"in a?r(a.any):"html"in a?t=J(e.parentNode,t,V.call(K([].concat(a.html).join(""),n).childNodes),W,e):"length"in a&&r(V.call(a))}};return r},text(e){let t;const n=i=>{if(t!==i){t=i;const s=typeof i;"object"===s&&i?"text"in i?n(String(i.text)):"any"in i?n(i.any):"html"in i?n([].concat(i.html).join("")):"length"in i&&n(V.call(i).join("")):"function"===s?n(i(e)):e.textContent=null==i?"":i}};return n}};const{create:be,freeze:ye,keys:_e}=Object,xe=ge.prototype,we=H(new b),Se=e=>({html:Ce("html",e),svg:Ce("svg",e),render(t,n){const i="function"==typeof n?n():n,s=we.get(t)||we.set(t,ke()),r=i instanceof Pe?Re(e,s,i):i;return r!==s.wire&&(s.wire=r,t.textContent="",t.appendChild(r.valueOf())),t}}),ke=()=>({stack:[],entry:null,wire:null}),Ce=(e,t)=>{const n=H(new b);return i.for=(e,s)=>{const r=n.get(e)||n.set(e,be(null));return r[s]||(r[s]=(e=>function(){return Re(t,e,i.apply(null,arguments))})(ke()))},i.node=function(){return Re(t,ke(),i.apply(null,arguments)).valueOf()},i;function i(){return new Pe(e,Oe.apply(null,arguments))}},Re=(e,t,{type:n,template:i,values:s})=>{const{length:r}=s;Te(e,t,s,r);let{entry:a}=t;if(a&&a.template===i&&a.type===n)a.tag(i,...s);else{const r=new e(n);t.entry=a={type:n,template:i,tag:r,wire:G(r(i,...s))}}return a.wire},Te=(e,{stack:t},n,i)=>{for(let s=0;s<i;s++){const i=n[s];i instanceof Ee?n[s]=Re(e,t[s]||(t[s]=ke()),i):q(i)?Te(e,t[s]||(t[s]=ke()),i,i.length):t[s]=null}i<t.length&&t.splice(i)};function Pe(e,t){this.type=e,this.template=t.shift(),this.values=t}ye(Pe);const Ee=Pe;function Oe(){let e=[],t=0,{length:n}=arguments;for(;t<n;)e.push(arguments[t++]);return e}Se(ge);var De="function"==typeof cancelAnimationFrame,je=De?cancelAnimationFrame:clearTimeout,Ie=De?requestAnimationFrame:setTimeout;function Me(e){var t,n,i,s,r;return o(),function(e,o,p){return i=e,s=o,r=p,n||(n=Ie(a)),--t<0&&c(!0),c};function a(){o(),i.apply(s,r||[])}function o(){t=e||1/0,n=De?0:null}function c(e){var t=!!n;return t&&(je(n),e&&a()),t}}
10
- /*! (c) Andrea Giammarchi - ISC */let Le=null;const Ae=H(new WeakMap),Ne=(e,t,n)=>{e.apply(t,n)},Be={async:!1,always:!1},Fe=(e,t)=>"function"==typeof t?t(e):t,Ue=(e,t,n,i)=>{const s=Le.i++,{hook:r,args:a,stack:o,length:c}=Le;s===c&&(Le.length=o.push({}));const p=o[s];if(p.args=a,s===c){const s="function"==typeof n,{async:a,always:o}=(s?i:n)||i||Be;p.$=s?n(t):Fe(void 0,t),p._=a?Ae.get(r)||Ae.set(r,Me()):Ne,p.f=t=>{const n=e(p.$,t);(o||p.$!==n)&&(p.$=n,p._(r,null,p.args))}}return[p.$,p.f]},ze=new WeakMap;function qe({hook:e}){return e===this.hook}const $e=new WeakMap,Ve=H($e),He=()=>{},We=e=>(t,n)=>{const i=Le.i++,{hook:s,after:r,stack:a,length:o}=Le;if(i<o){const s=a[i],{update:o,values:c,stop:p}=s;if(!n||n.some(Ye,c)){s.values=n,e&&p(e);const{clean:i}=s;i&&(s.clean=null,i());const a=()=>{s.clean=t()};e?o(a):r.push(a)}}else{const i=e?Me():He,o={clean:null,update:i,values:n,stop:He};Le.length=a.push(o),(Ve.get(s)||Ve.set(s,[])).push(o);const c=()=>{o.clean=t()};e?o.stop=i(c):r.push(c)}},Ge=e=>{($e.get(e)||[]).forEach((e=>{const{clean:t,stop:n}=e;n(),t&&(e.clean=null,t())}))};$e.has.bind($e);const Ke=We(!0),Je=We(!1),Qe=(e,t)=>{const n=Le.i++,{stack:i,length:s}=Le;return n===s?Le.length=i.push({$:e(),_:t}):t&&!t.some(Ye,i[n]._)||(i[n]={$:e(),_:t}),i[n].$};function Ye(e,t){return e!==this[t]}let Xe=null;try{Xe=new{o(){}}.o}catch(Qt){}let Ze=e=>class extends e{};if(Xe){const{getPrototypeOf:e,setPrototypeOf:t}=Object,{construct:n}="object"==typeof Reflect?Reflect:{construct(e,n,i){const s=[null];for(let e=0;e<n.length;e++)s.push(n[e]);const r=e.bind.apply(e,s);return t(new r,i.prototype)}};Ze=function(i,s){function r(){return n(s?e(i):i,arguments,r)}return t(r.prototype,i.prototype),t(r,i)}}const et={map:{},re:null},tt=e=>new RegExp(`<(/)?(${e.join("|")})([^A-Za-z0-9:._-])`,"g");let nt=null;const it=(e,t)=>{const{map:n,re:i}=nt||t;return e.replace(i,((e,t,i,s)=>{const{tagName:r,is:a,element:o}=n[i];return o?t?`</${a}>`:`<${a}${s}`:t?`</${r}>`:`<${r} is="${a}"${s}`}))},st=({tagName:e,is:t,element:n})=>n?t:`${e}[is="${t}"]`,rt=()=>nt,at=e=>{nt=e},ot={useCallback:(e,t)=>Qe((()=>e),t),useContext:e=>{const{hook:t,args:n}=Le,i=ze.get(e),s={hook:t,args:n};return i.some(qe,s)||i.push(s),e.value},useEffect:Ke,useLayoutEffect:Je,useMemo:Qe,useReducer:Ue,useRef:e=>{const t=Le.i++,{stack:n,length:i}=Le;return t===i&&(Le.length=n.push({current:e})),n[t]},useState:(e,t)=>Ue(Fe,e,void 0,t)},{render:ct,html:pt,svg:dt}=(e=>{const t=be(xe);return _e(e).forEach((n=>{t[n]=e[n](t[n]||("convert"===n?O:String))})),n.prototype=t,Se(n);function n(){return ge.apply(this,arguments)}})({transform:()=>e=>it(e,et)}),{defineProperties:lt}=Object,ut=new b,mt=new b,ht=new b,ft=new k,gt="attributeChangedCallback",vt="connectedCallback",bt=`dis${vt}`,yt=(e,t,n)=>{if(n in e){const i=e[n];t[n]={configurable:true,value(){return Dt.call(this),i.apply(this,arguments)}}}else t[n]={configurable:true,value:Dt}},_t=e=>{const{prototype:t}=e,n=[],i={html:{configurable:true,get:Pt},svg:{configurable:true,get:Et}};if(i["_🔥"]={value:{events:n,info:null}},"handleEvent"in t||(i.handleEvent={configurable:true,value:Ot}),"render"in t&&t.render.length){const{oninit:e}=t;lt(t,{oninit:{configurable:true,value(){const t=(e=>{const t=[];return function n(){const i=Le,s=[];Le={hook:n,args:arguments,stack:t,i:0,length:t.length,after:s};try{return e.apply(null,arguments)}finally{Le=i;for(let e=0,{length:t}=s;e<t;e++)s[e]()}}})(this.render.bind(this,ot));lt(this,{render:{configurable:true,value:t}}),this.addEventListener("disconnected",Ge.bind(null,t),!1),e&&e.apply(this,arguments)}}})}"oninit"in t&&(n.push("init"),yt(t,i,"render")),yt(t,i,gt),yt(t,i,vt),yt(t,i,bt),[[gt,"onattributechanged",jt],[vt,"onconnected",It],[bt,"ondisconnected",Lt],[vt,"render",Mt]].forEach((([e,s,r])=>{if(!(e in t)&&s in t)if("render"!==s&&n.push(s.slice(2)),e in i){const t=i[e].value;i[e]={configurable:true,value(){return t.apply(this,arguments),r.apply(this,arguments)}}}else i[e]={configurable:true,value:r}}));const s=e.booleanAttributes||[];s.forEach((e=>{e in t||(i[e]={configurable:true,get(){return this.hasAttribute(e)},set(t){t&&"false"!==t?this.setAttribute(e,t):this.removeAttribute(e)}})}));const r=e.observedAttributes||[];r.forEach((e=>{e in t||(i[e]={configurable:true,get(){return this.getAttribute(e)},set(t){null==t?this.removeAttribute(e):this.setAttribute(e,t)}})}));(e.mappedAttributes||[]).forEach((e=>{const s=new b,r="on"+e in t;r&&n.push(e),i[e]={configurable:true,get(){return s.get(this)},set(t){if(s.set(this,t),r){const n=xt(e);if(n.detail=t,ft.has(this))this.dispatchEvent(n);else{const e=ht.get(this);e?e.push(n):ht.set(this,[n])}}}}})),lt(t,i);const a=s.concat(r);return a.length?lt(e,{observedAttributes:{configurable:true,get:()=>a}}):e},xt=e=>new _(e),wt=(...e)=>new Ee("html",e);wt.for=pt.for;const St=(...e)=>new Ee("svg",e);St.for=dt.for;const kt=(e,t,n)=>{const i=Ct(e,t,new b);return n.set(e,i),i},Ct=(e,t,n)=>(i,...s)=>{const r=n.get(i)||((e,t,{info:n})=>{const i=n?it(t.join("_🔥"),n).split("_🔥"):t;return e.set(t,i),i})(n,i,e["_🔥"]);return ct(e,(()=>t(r,...s)))};function Rt(e){this.addEventListener(e,this)}function Tt(e){this.dispatchEvent(e)}function Pt(){return ut.get(this)||kt(this,wt,ut)}function Et(){return mt.get(this)||kt(this,St,mt)}function Ot(e){this[`on${e.type}`](e)}function Dt(){if(!ft.has(this)){ft.add(this),this["_🔥"].events.forEach(Rt,this),this.dispatchEvent(xt("init"));const e=ht.get(this);e&&(ht.delete(this),e.forEach(Tt,this))}}function jt(e,t,n){const i=xt("attributechanged");i.attributeName=e,i.oldValue=t,i.newValue=n,this.dispatchEvent(i)}function It(){this.dispatchEvent(xt("connected"))}function Mt(){this.render()}function Lt(){this.dispatchEvent(xt("disconnected"))}const{create:At,defineProperty:Nt,defineProperties:Bt,getOwnPropertyNames:Ft,getOwnPropertySymbols:Ut,getOwnPropertyDescriptor:zt,keys:qt}=Object,$t={element:HTMLElement},Vt=new b;new b;const Ht=new b;new b;const Wt=e=>{const t=At(null),n=At(null),i={prototype:n,statics:t};return Ft(e).concat(Ut(e)).forEach((i=>{const s=zt(e,i);switch(s.enumerable=!1,i){case"extends":i="tagName";case"contains":case"includes":case"name":case"booleanAttributes":case"mappedAttributes":case"observedAttributes":case"style":case"tagName":t[i]=s;break;default:n[i]=s}})),i},Gt=(e,t,n)=>{if(!/^([A-Z][A-Za-z0-9_]*)(<([A-Za-z0-9:._-]+)>|:([A-Za-z0-9:._-]+))?$/.test(e))throw"Invalid name";const{$1:i,$3:s,$4:r}=RegExp;let a=s||r||t.tagName||t.extends||"element";const o="fragment"===a;if(o)a="element";else if(!/^[A-Za-z0-9:._-]+$/.test(a))throw"Invalid tag";let c="",p="";a.indexOf("-")<0?(c=i.replace(/(([A-Z0-9])([A-Z0-9][a-z]))|(([a-z])([A-Z]))/g,"$2$5-$3$6").toLowerCase()+n,c.indexOf("-")<0&&(p="-heresy")):(c=a+n,a="element");const d=c+p;if(customElements.get(d))throw`Duplicated ${d} definition`;const l=Ze("object"==typeof t?Ht.get(t)||((e,t)=>{const{statics:n,prototype:i}=Wt(e),s=Ze($t[t]||($t[t]=document.createElement(t).constructor),!1);return Bt(s.prototype,i),Bt(s,n),Ht.set(e,_t(s)),s})(t,a):Vt.get(t)||(e=>{const t=Ze(e,!1);return Vt.set(e,_t(t)),t})(t),!0),u="element"===a;if(Nt(l,"new",{value:u?()=>document.createElement(d):()=>document.createElement(a,{is:d})}),Nt(l.prototype,"is",{value:d}),""===n){const e=(e=>{const{length:t}=e;let n=0,i=0;for(;i<t;)n=(n<<5)-n+e.charCodeAt(i++),n&=n;return n.toString(36)})(c.toUpperCase());et.map[i]=Kt(l,a,d,{id:e,i:0}),et.re=tt(qt(et.map))}if(o){const{render:e}=l.prototype;Nt(l.prototype,"render",{configurable:!0,value(){if(e&&e.apply(this,arguments),this.parentNode){const{firstChild:e}=this;let t=null;if(e){const n=document.createRange();n.setStartBefore(e),n.setEndAfter(this.lastChild),t=n.extractContents(),this.parentNode.replaceChild(t,this)}}}})}const m=[d,l];return u||m.push({extends:a}),customElements.define(...m),{Class:l,is:d,name:i,tagName:a}},Kt=(e,t,n,i)=>{const{prototype:s}=e,r=((e,t)=>({tagName:e,is:t,element:"element"===e}))(t,n),a=[st(r)],o=e.includes||e.contains;if(o){const e={};qt(o).forEach((t=>{const n=`-${i.id}-${i.i++}`,{Class:s,is:r,name:c,tagName:p}=Gt(t,o[t],n);a.push(st(e[c]=Kt(s,p,r,i)))}));const t=tt(qt(e)),{events:n}=s["_🔥"],r={events:n,info:{map:e,re:t}};if(Nt(s,"_🔥",{value:r}),"render"in s){const{render:e}=s,{info:t}=r;Nt(s,"render",{configurable:!0,value(){const n=rt();at(t);const i=e.apply(this,arguments);return at(n),i}})}}return"style"in e&&(e=>{if((e||"").length){const t=document.createElement("style");t.type="text/css",t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e));const n=document.head||document.querySelector("head");n.insertBefore(t,n.lastChild)}})(e.style(...a)),r},Jt=["audio","background","cameraaccess","chat","people","embed","emptyRoomInvitation","help","leaveButton","precallReview","screenshare","video","floatSelf","recording","logo","locking","participantCount","settingsButton","pipButton","moreButton","personality","subgridLabels","lowData","breakout"];var Qt,Yt;Qt="WherebyEmbed",Yt={oninit(){this.iframe=((e,t)=>e?e[t]||(e[t]={current:null}):{current:null})()},onconnected(){window.addEventListener("message",this.onmessage)},ondisconnected(){window.removeEventListener("message",this.onmessage)},observedAttributes:["displayName","minimal","room","subdomain","lang","metadata","groups","virtualBackgroundUrl","avatarUrl",...Jt].map((e=>e.toLowerCase())),onattributechanged({attributeName:e,oldValue:t}){["room","subdomain"].includes(e)&&null==t||this.render()},style:e=>`\n ${e} {\n display: block;\n }\n ${e} iframe {\n border: none;\n height: 100%;\n width: 100%;\n }\n `,_postCommand(e,t=[]){if(this.iframe.current){const n=new URL(this.room,`https://${this.subdomain}.whereby.com`);this.iframe.current.contentWindow.postMessage({command:e,args:t},n.origin)}},startRecording(){this._postCommand("start_recording")},stopRecording(){this._postCommand("stop_recording")},toggleCamera(e){this._postCommand("toggle_camera",[e])},toggleMicrophone(e){this._postCommand("toggle_microphone",[e])},toggleScreenshare(e){this._postCommand("toggle_screenshare",[e])},onmessage({origin:e,data:t}){if(e!==new URL(this.room,`https://${this.subdomain}.whereby.com`).origin)return;const{type:n,payload:i}=t;this.dispatchEvent(new CustomEvent(n,{detail:i}))},render(){const{avatarurl:e,displayname:t,lang:n,metadata:i,minimal:s,room:r,groups:a,virtualbackgroundurl:o}=this;if(!r)return this.html`Whereby: Missing room attribute.`;const c=/https:\/\/([^.]+)\.whereby.com\/.+/.exec(r),p=c&&c[1]||this.subdomain;if(!p)return this.html`Whereby: Missing subdomain attr.`;const d=new URL(r,`https://${p}.whereby.com`);return Object.entries(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({jsApi:!0,we:"2.0.0-alpha2",iframeSource:p},t&&{displayName:t}),n&&{lang:n}),i&&{metadata:i}),a&&{groups:a}),o&&{virtualBackgroundUrl:o}),e&&{avatarUrl:e}),null!=s&&{embed:s}),Jt.reduce(((e,t)=>null!=this[t.toLowerCase()]?Object.assign(Object.assign({},e),{[t]:this[t.toLowerCase()]}):e),{}))).forEach((([e,t])=>{d.searchParams.has(e)||"string"!=typeof t||d.searchParams.set(e,t)})),this.html`
10
+ /*! (c) Andrea Giammarchi - ISC */let Le=null;const Ae=H(new WeakMap),Ne=(e,t,n)=>{e.apply(t,n)},Be={async:!1,always:!1},Fe=(e,t)=>"function"==typeof t?t(e):t,Ue=(e,t,n,i)=>{const s=Le.i++,{hook:r,args:a,stack:o,length:c}=Le;s===c&&(Le.length=o.push({}));const p=o[s];if(p.args=a,s===c){const s="function"==typeof n,{async:a,always:o}=(s?i:n)||i||Be;p.$=s?n(t):Fe(void 0,t),p._=a?Ae.get(r)||Ae.set(r,Me()):Ne,p.f=t=>{const n=e(p.$,t);(o||p.$!==n)&&(p.$=n,p._(r,null,p.args))}}return[p.$,p.f]},ze=new WeakMap;function qe({hook:e}){return e===this.hook}const $e=new WeakMap,Ve=H($e),He=()=>{},We=e=>(t,n)=>{const i=Le.i++,{hook:s,after:r,stack:a,length:o}=Le;if(i<o){const s=a[i],{update:o,values:c,stop:p}=s;if(!n||n.some(Ye,c)){s.values=n,e&&p(e);const{clean:i}=s;i&&(s.clean=null,i());const a=()=>{s.clean=t()};e?o(a):r.push(a)}}else{const i=e?Me():He,o={clean:null,update:i,values:n,stop:He};Le.length=a.push(o),(Ve.get(s)||Ve.set(s,[])).push(o);const c=()=>{o.clean=t()};e?o.stop=i(c):r.push(c)}},Ge=e=>{($e.get(e)||[]).forEach((e=>{const{clean:t,stop:n}=e;n(),t&&(e.clean=null,t())}))};$e.has.bind($e);const Ke=We(!0),Je=We(!1),Qe=(e,t)=>{const n=Le.i++,{stack:i,length:s}=Le;return n===s?Le.length=i.push({$:e(),_:t}):t&&!t.some(Ye,i[n]._)||(i[n]={$:e(),_:t}),i[n].$};function Ye(e,t){return e!==this[t]}let Xe=null;try{Xe=new{o(){}}.o}catch(Qt){}let Ze=e=>class extends e{};if(Xe){const{getPrototypeOf:e,setPrototypeOf:t}=Object,{construct:n}="object"==typeof Reflect?Reflect:{construct(e,n,i){const s=[null];for(let e=0;e<n.length;e++)s.push(n[e]);const r=e.bind.apply(e,s);return t(new r,i.prototype)}};Ze=function(i,s){function r(){return n(s?e(i):i,arguments,r)}return t(r.prototype,i.prototype),t(r,i)}}const et={map:{},re:null},tt=e=>new RegExp(`<(/)?(${e.join("|")})([^A-Za-z0-9:._-])`,"g");let nt=null;const it=(e,t)=>{const{map:n,re:i}=nt||t;return e.replace(i,((e,t,i,s)=>{const{tagName:r,is:a,element:o}=n[i];return o?t?`</${a}>`:`<${a}${s}`:t?`</${r}>`:`<${r} is="${a}"${s}`}))},st=({tagName:e,is:t,element:n})=>n?t:`${e}[is="${t}"]`,rt=()=>nt,at=e=>{nt=e},ot={useCallback:(e,t)=>Qe((()=>e),t),useContext:e=>{const{hook:t,args:n}=Le,i=ze.get(e),s={hook:t,args:n};return i.some(qe,s)||i.push(s),e.value},useEffect:Ke,useLayoutEffect:Je,useMemo:Qe,useReducer:Ue,useRef:e=>{const t=Le.i++,{stack:n,length:i}=Le;return t===i&&(Le.length=n.push({current:e})),n[t]},useState:(e,t)=>Ue(Fe,e,void 0,t)},{render:ct,html:pt,svg:dt}=(e=>{const t=be(xe);return _e(e).forEach((n=>{t[n]=e[n](t[n]||("convert"===n?O:String))})),n.prototype=t,Se(n);function n(){return ge.apply(this,arguments)}})({transform:()=>e=>it(e,et)}),{defineProperties:lt}=Object,ut=new b,mt=new b,ht=new b,ft=new k,gt="attributeChangedCallback",vt="connectedCallback",bt=`dis${vt}`,yt=(e,t,n)=>{if(n in e){const i=e[n];t[n]={configurable:true,value(){return Dt.call(this),i.apply(this,arguments)}}}else t[n]={configurable:true,value:Dt}},_t=e=>{const{prototype:t}=e,n=[],i={html:{configurable:true,get:Pt},svg:{configurable:true,get:Et}};if(i["_🔥"]={value:{events:n,info:null}},"handleEvent"in t||(i.handleEvent={configurable:true,value:Ot}),"render"in t&&t.render.length){const{oninit:e}=t;lt(t,{oninit:{configurable:true,value(){const t=(e=>{const t=[];return function n(){const i=Le,s=[];Le={hook:n,args:arguments,stack:t,i:0,length:t.length,after:s};try{return e.apply(null,arguments)}finally{Le=i;for(let e=0,{length:t}=s;e<t;e++)s[e]()}}})(this.render.bind(this,ot));lt(this,{render:{configurable:true,value:t}}),this.addEventListener("disconnected",Ge.bind(null,t),!1),e&&e.apply(this,arguments)}}})}"oninit"in t&&(n.push("init"),yt(t,i,"render")),yt(t,i,gt),yt(t,i,vt),yt(t,i,bt),[[gt,"onattributechanged",jt],[vt,"onconnected",It],[bt,"ondisconnected",Lt],[vt,"render",Mt]].forEach((([e,s,r])=>{if(!(e in t)&&s in t)if("render"!==s&&n.push(s.slice(2)),e in i){const t=i[e].value;i[e]={configurable:true,value(){return t.apply(this,arguments),r.apply(this,arguments)}}}else i[e]={configurable:true,value:r}}));const s=e.booleanAttributes||[];s.forEach((e=>{e in t||(i[e]={configurable:true,get(){return this.hasAttribute(e)},set(t){t&&"false"!==t?this.setAttribute(e,t):this.removeAttribute(e)}})}));const r=e.observedAttributes||[];r.forEach((e=>{e in t||(i[e]={configurable:true,get(){return this.getAttribute(e)},set(t){null==t?this.removeAttribute(e):this.setAttribute(e,t)}})}));(e.mappedAttributes||[]).forEach((e=>{const s=new b,r="on"+e in t;r&&n.push(e),i[e]={configurable:true,get(){return s.get(this)},set(t){if(s.set(this,t),r){const n=xt(e);if(n.detail=t,ft.has(this))this.dispatchEvent(n);else{const e=ht.get(this);e?e.push(n):ht.set(this,[n])}}}}})),lt(t,i);const a=s.concat(r);return a.length?lt(e,{observedAttributes:{configurable:true,get:()=>a}}):e},xt=e=>new _(e),wt=(...e)=>new Ee("html",e);wt.for=pt.for;const St=(...e)=>new Ee("svg",e);St.for=dt.for;const kt=(e,t,n)=>{const i=Ct(e,t,new b);return n.set(e,i),i},Ct=(e,t,n)=>(i,...s)=>{const r=n.get(i)||((e,t,{info:n})=>{const i=n?it(t.join("_🔥"),n).split("_🔥"):t;return e.set(t,i),i})(n,i,e["_🔥"]);return ct(e,(()=>t(r,...s)))};function Rt(e){this.addEventListener(e,this)}function Tt(e){this.dispatchEvent(e)}function Pt(){return ut.get(this)||kt(this,wt,ut)}function Et(){return mt.get(this)||kt(this,St,mt)}function Ot(e){this[`on${e.type}`](e)}function Dt(){if(!ft.has(this)){ft.add(this),this["_🔥"].events.forEach(Rt,this),this.dispatchEvent(xt("init"));const e=ht.get(this);e&&(ht.delete(this),e.forEach(Tt,this))}}function jt(e,t,n){const i=xt("attributechanged");i.attributeName=e,i.oldValue=t,i.newValue=n,this.dispatchEvent(i)}function It(){this.dispatchEvent(xt("connected"))}function Mt(){this.render()}function Lt(){this.dispatchEvent(xt("disconnected"))}const{create:At,defineProperty:Nt,defineProperties:Bt,getOwnPropertyNames:Ft,getOwnPropertySymbols:Ut,getOwnPropertyDescriptor:zt,keys:qt}=Object,$t={element:HTMLElement},Vt=new b;new b;const Ht=new b;new b;const Wt=e=>{const t=At(null),n=At(null),i={prototype:n,statics:t};return Ft(e).concat(Ut(e)).forEach((i=>{const s=zt(e,i);switch(s.enumerable=!1,i){case"extends":i="tagName";case"contains":case"includes":case"name":case"booleanAttributes":case"mappedAttributes":case"observedAttributes":case"style":case"tagName":t[i]=s;break;default:n[i]=s}})),i},Gt=(e,t,n)=>{if(!/^([A-Z][A-Za-z0-9_]*)(<([A-Za-z0-9:._-]+)>|:([A-Za-z0-9:._-]+))?$/.test(e))throw"Invalid name";const{$1:i,$3:s,$4:r}=RegExp;let a=s||r||t.tagName||t.extends||"element";const o="fragment"===a;if(o)a="element";else if(!/^[A-Za-z0-9:._-]+$/.test(a))throw"Invalid tag";let c="",p="";a.indexOf("-")<0?(c=i.replace(/(([A-Z0-9])([A-Z0-9][a-z]))|(([a-z])([A-Z]))/g,"$2$5-$3$6").toLowerCase()+n,c.indexOf("-")<0&&(p="-heresy")):(c=a+n,a="element");const d=c+p;if(customElements.get(d))throw`Duplicated ${d} definition`;const l=Ze("object"==typeof t?Ht.get(t)||((e,t)=>{const{statics:n,prototype:i}=Wt(e),s=Ze($t[t]||($t[t]=document.createElement(t).constructor),!1);return Bt(s.prototype,i),Bt(s,n),Ht.set(e,_t(s)),s})(t,a):Vt.get(t)||(e=>{const t=Ze(e,!1);return Vt.set(e,_t(t)),t})(t),!0),u="element"===a;if(Nt(l,"new",{value:u?()=>document.createElement(d):()=>document.createElement(a,{is:d})}),Nt(l.prototype,"is",{value:d}),""===n){const e=(e=>{const{length:t}=e;let n=0,i=0;for(;i<t;)n=(n<<5)-n+e.charCodeAt(i++),n&=n;return n.toString(36)})(c.toUpperCase());et.map[i]=Kt(l,a,d,{id:e,i:0}),et.re=tt(qt(et.map))}if(o){const{render:e}=l.prototype;Nt(l.prototype,"render",{configurable:!0,value(){if(e&&e.apply(this,arguments),this.parentNode){const{firstChild:e}=this;let t=null;if(e){const n=document.createRange();n.setStartBefore(e),n.setEndAfter(this.lastChild),t=n.extractContents(),this.parentNode.replaceChild(t,this)}}}})}const m=[d,l];return u||m.push({extends:a}),customElements.define(...m),{Class:l,is:d,name:i,tagName:a}},Kt=(e,t,n,i)=>{const{prototype:s}=e,r=((e,t)=>({tagName:e,is:t,element:"element"===e}))(t,n),a=[st(r)],o=e.includes||e.contains;if(o){const e={};qt(o).forEach((t=>{const n=`-${i.id}-${i.i++}`,{Class:s,is:r,name:c,tagName:p}=Gt(t,o[t],n);a.push(st(e[c]=Kt(s,p,r,i)))}));const t=tt(qt(e)),{events:n}=s["_🔥"],r={events:n,info:{map:e,re:t}};if(Nt(s,"_🔥",{value:r}),"render"in s){const{render:e}=s,{info:t}=r;Nt(s,"render",{configurable:!0,value(){const n=rt();at(t);const i=e.apply(this,arguments);return at(n),i}})}}return"style"in e&&(e=>{if((e||"").length){const t=document.createElement("style");t.type="text/css",t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e));const n=document.head||document.querySelector("head");n.insertBefore(t,n.lastChild)}})(e.style(...a)),r},Jt=["audio","background","cameraaccess","chat","people","embed","emptyRoomInvitation","help","leaveButton","precallReview","screenshare","video","floatSelf","recording","logo","locking","participantCount","settingsButton","pipButton","moreButton","personality","subgridLabels","lowData","breakout"];var Qt,Yt;function Xt(e,t,n,i){return new(n||(n=Promise))((function(s,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function o(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}c((i=i.apply(e,t||[])).next())}))}Qt="WherebyEmbed",Yt={oninit(){this.iframe=((e,t)=>e?e[t]||(e[t]={current:null}):{current:null})()},onconnected(){window.addEventListener("message",this.onmessage)},ondisconnected(){window.removeEventListener("message",this.onmessage)},observedAttributes:["displayName","minimal","room","subdomain","lang","metadata","groups","virtualBackgroundUrl","avatarUrl",...Jt].map((e=>e.toLowerCase())),onattributechanged({attributeName:e,oldValue:t}){["room","subdomain"].includes(e)&&null==t||this.render()},style:e=>`\n ${e} {\n display: block;\n }\n ${e} iframe {\n border: none;\n height: 100%;\n width: 100%;\n }\n `,_postCommand(e,t=[]){if(this.iframe.current){const n=new URL(this.room,`https://${this.subdomain}.whereby.com`);this.iframe.current.contentWindow.postMessage({command:e,args:t},n.origin)}},startRecording(){this._postCommand("start_recording")},stopRecording(){this._postCommand("stop_recording")},toggleCamera(e){this._postCommand("toggle_camera",[e])},toggleMicrophone(e){this._postCommand("toggle_microphone",[e])},toggleScreenshare(e){this._postCommand("toggle_screenshare",[e])},onmessage({origin:e,data:t}){if(e!==new URL(this.room,`https://${this.subdomain}.whereby.com`).origin)return;const{type:n,payload:i}=t;this.dispatchEvent(new CustomEvent(n,{detail:i}))},render(){const{avatarurl:e,displayname:t,lang:n,metadata:i,minimal:s,room:r,groups:a,virtualbackgroundurl:o}=this;if(!r)return this.html`Whereby: Missing room attribute.`;const c=/https:\/\/([^.]+)\.whereby.com\/.+/.exec(r),p=c&&c[1]||this.subdomain;if(!p)return this.html`Whereby: Missing subdomain attr.`;const d=new URL(r,`https://${p}.whereby.com`);return Object.entries(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({jsApi:!0,we:"2.0.0-alpha3",iframeSource:p},t&&{displayName:t}),n&&{lang:n}),i&&{metadata:i}),a&&{groups:a}),o&&{virtualBackgroundUrl:o}),e&&{avatarUrl:e}),null!=s&&{embed:s}),Jt.reduce(((e,t)=>null!=this[t.toLowerCase()]?Object.assign(Object.assign({},e),{[t]:this[t.toLowerCase()]}):e),{}))).forEach((([e,t])=>{d.searchParams.has(e)||"string"!=typeof t||d.searchParams.set(e,t)})),this.html`
11
11
  <iframe
12
12
  ref=${this.iframe}
13
13
  src=${d}
14
14
  allow="autoplay; camera; microphone; fullscreen; speaker; display-capture" />
15
- `}},("string"==typeof Qt?Gt(Qt,Yt,""):Gt(Qt.name,Qt,"")).Class;var Xt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Zt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function en(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){if(this instanceof e){var n=[null];n.push.apply(n,arguments);var i=Function.bind.apply(t,n);return new i}return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var i=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,i.get?i:{enumerable:!0,get:function(){return e[t]}})})),n}var tn,nn={},sn={};function rn(){if(tn)return sn;tn=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),r=Symbol.for("react.provider"),a=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),l=Symbol.iterator;var u={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},m=Object.assign,h={};function f(e,t,n){this.props=e,this.context=t,this.refs=h,this.updater=n||u}function g(){}function v(e,t,n){this.props=e,this.context=t,this.refs=h,this.updater=n||u}f.prototype.isReactComponent={},f.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},f.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},g.prototype=f.prototype;var b=v.prototype=new g;b.constructor=v,m(b,f.prototype),b.isPureReactComponent=!0;var y=Array.isArray,_=Object.prototype.hasOwnProperty,x={current:null},w={key:!0,ref:!0,__self:!0,__source:!0};function S(t,n,i){var s,r={},a=null,o=null;if(null!=n)for(s in void 0!==n.ref&&(o=n.ref),void 0!==n.key&&(a=""+n.key),n)_.call(n,s)&&!w.hasOwnProperty(s)&&(r[s]=n[s]);var c=arguments.length-2;if(1===c)r.children=i;else if(1<c){for(var p=Array(c),d=0;d<c;d++)p[d]=arguments[d+2];r.children=p}if(t&&t.defaultProps)for(s in c=t.defaultProps)void 0===r[s]&&(r[s]=c[s]);return{$$typeof:e,type:t,key:a,ref:o,props:r,_owner:x.current}}function k(t){return"object"==typeof t&&null!==t&&t.$$typeof===e}var C=/\/+/g;function R(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 T(n,i,s,r,a){var o=typeof n;"undefined"!==o&&"boolean"!==o||(n=null);var c=!1;if(null===n)c=!0;else switch(o){case"string":case"number":c=!0;break;case"object":switch(n.$$typeof){case e:case t:c=!0}}if(c)return a=a(c=n),n=""===r?"."+R(c,0):r,y(a)?(s="",null!=n&&(s=n.replace(C,"$&/")+"/"),T(a,i,s,"",(function(e){return e}))):null!=a&&(k(a)&&(a=function(t,n){return{$$typeof:e,type:t.type,key:n,ref:t.ref,props:t.props,_owner:t._owner}}(a,s+(!a.key||c&&c.key===a.key?"":(""+a.key).replace(C,"$&/")+"/")+n)),i.push(a)),1;if(c=0,r=""===r?".":r+":",y(n))for(var p=0;p<n.length;p++){var d=r+R(o=n[p],p);c+=T(o,i,s,d,a)}else if(d=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=l&&e[l]||e["@@iterator"])?e:null}(n),"function"==typeof d)for(n=d.call(n),p=0;!(o=n.next()).done;)c+=T(o=o.value,i,s,d=r+R(o,p++),a);else if("object"===o)throw i=String(n),Error("Objects are not valid as a React child (found: "+("[object Object]"===i?"object with keys {"+Object.keys(n).join(", ")+"}":i)+"). If you meant to render a collection of children, use an array instead.");return c}function P(e,t,n){if(null==e)return e;var i=[],s=0;return T(e,i,"","",(function(e){return t.call(n,e,s++)})),i}function E(e){if(-1===e._status){var t=e._result;(t=t()).then((function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)}),(function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)})),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var O={current:null},D={transition:null},j={ReactCurrentDispatcher:O,ReactCurrentBatchConfig:D,ReactCurrentOwner:x};return sn.Children={map:P,forEach:function(e,t,n){P(e,(function(){t.apply(this,arguments)}),n)},count:function(e){var t=0;return P(e,(function(){t++})),t},toArray:function(e){return P(e,(function(e){return e}))||[]},only:function(e){if(!k(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},sn.Component=f,sn.Fragment=n,sn.Profiler=s,sn.PureComponent=v,sn.StrictMode=i,sn.Suspense=c,sn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=j,sn.cloneElement=function(t,n,i){if(null==t)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var s=m({},t.props),r=t.key,a=t.ref,o=t._owner;if(null!=n){if(void 0!==n.ref&&(a=n.ref,o=x.current),void 0!==n.key&&(r=""+n.key),t.type&&t.type.defaultProps)var c=t.type.defaultProps;for(p in n)_.call(n,p)&&!w.hasOwnProperty(p)&&(s[p]=void 0===n[p]&&void 0!==c?c[p]:n[p])}var p=arguments.length-2;if(1===p)s.children=i;else if(1<p){c=Array(p);for(var d=0;d<p;d++)c[d]=arguments[d+2];s.children=c}return{$$typeof:e,type:t.type,key:r,ref:a,props:s,_owner:o}},sn.createContext=function(e){return(e={$$typeof:a,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:r,_context:e},e.Consumer=e},sn.createElement=S,sn.createFactory=function(e){var t=S.bind(null,e);return t.type=e,t},sn.createRef=function(){return{current:null}},sn.forwardRef=function(e){return{$$typeof:o,render:e}},sn.isValidElement=k,sn.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:E}},sn.memo=function(e,t){return{$$typeof:p,type:e,compare:void 0===t?null:t}},sn.startTransition=function(e){var t=D.transition;D.transition={};try{e()}finally{D.transition=t}},sn.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")},sn.useCallback=function(e,t){return O.current.useCallback(e,t)},sn.useContext=function(e){return O.current.useContext(e)},sn.useDebugValue=function(){},sn.useDeferredValue=function(e){return O.current.useDeferredValue(e)},sn.useEffect=function(e,t){return O.current.useEffect(e,t)},sn.useId=function(){return O.current.useId()},sn.useImperativeHandle=function(e,t,n){return O.current.useImperativeHandle(e,t,n)},sn.useInsertionEffect=function(e,t){return O.current.useInsertionEffect(e,t)},sn.useLayoutEffect=function(e,t){return O.current.useLayoutEffect(e,t)},sn.useMemo=function(e,t){return O.current.useMemo(e,t)},sn.useReducer=function(e,t,n){return O.current.useReducer(e,t,n)},sn.useRef=function(e){return O.current.useRef(e)},sn.useState=function(e){return O.current.useState(e)},sn.useSyncExternalStore=function(e,t,n){return O.current.useSyncExternalStore(e,t,n)},sn.useTransition=function(){return O.current.useTransition()},sn.version="18.2.0",sn}var an,on,cn={},pn={get exports(){return cn},set exports(e){cn=e}};function dn(){return an||(an=1,e=pn,t=cn,"production"!==process.env.NODE_ENV&&function(){"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var n=Symbol.for("react.element"),i=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),c=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),l=Symbol.for("react.suspense_list"),u=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),h=Symbol.for("react.offscreen"),f=Symbol.iterator;function g(e){if(null===e||"object"!=typeof e)return null;var t=f&&e[f]||e["@@iterator"];return"function"==typeof t?t:null}var v={current:null},b={transition:null},y={current:null,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1},_={current:null},x={},w=null;function S(e){w=e}x.setExtraStackFrame=function(e){w=e},x.getCurrentStack=null,x.getStackAddendum=function(){var e="";w&&(e+=w);var t=x.getCurrentStack;return t&&(e+=t()||""),e};var k={ReactCurrentDispatcher:v,ReactCurrentBatchConfig:b,ReactCurrentOwner:_};function C(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];T("warn",e,n)}function R(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];T("error",e,n)}function T(e,t,n){var i=k.ReactDebugCurrentFrame.getStackAddendum();""!==i&&(t+="%s",n=n.concat([i]));var s=n.map((function(e){return String(e)}));s.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,s)}k.ReactDebugCurrentFrame=x,k.ReactCurrentActQueue=y;var P={};function E(e,t){var n=e.constructor,i=n&&(n.displayName||n.name)||"ReactClass",s=i+"."+t;P[s]||(R("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",t,i),P[s]=!0)}var O={isMounted:function(e){return!1},enqueueForceUpdate:function(e,t,n){E(e,"forceUpdate")},enqueueReplaceState:function(e,t,n,i){E(e,"replaceState")},enqueueSetState:function(e,t,n,i){E(e,"setState")}},D=Object.assign,j={};function I(e,t,n){this.props=e,this.context=t,this.refs=j,this.updater=n||O}Object.freeze(j),I.prototype.isReactComponent={},I.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw new Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},I.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};var M={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]},L=function(e,t){Object.defineProperty(I.prototype,e,{get:function(){C("%s(...) is deprecated in plain JavaScript React classes. %s",t[0],t[1])}})};for(var A in M)M.hasOwnProperty(A)&&L(A,M[A]);function N(){}function B(e,t,n){this.props=e,this.context=t,this.refs=j,this.updater=n||O}N.prototype=I.prototype;var F=B.prototype=new N;F.constructor=B,D(F,I.prototype),F.isPureReactComponent=!0;var U=Array.isArray;function z(e){return U(e)}function q(e){return""+e}function $(e){if(function(e){try{return q(e),!1}catch(e){return!0}}(e))return R("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",function(e){return"function"==typeof Symbol&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object"}(e)),q(e)}function V(e){return e.displayName||"Context"}function H(e){if(null==e)return null;if("number"==typeof e.tag&&R("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),"function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case s:return"Fragment";case i:return"Portal";case a:return"Profiler";case r:return"StrictMode";case d:return"Suspense";case l:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case c:return V(e)+".Consumer";case o:return V(e._context)+".Provider";case p:return function(e,t,n){var i=e.displayName;if(i)return i;var s=t.displayName||t.name||"";return""!==s?n+"("+s+")":n}(e,e.render,"ForwardRef");case u:var t=e.displayName||null;return null!==t?t:H(e.type)||"Memo";case m:var n=e,h=n._payload,f=n._init;try{return H(f(h))}catch(e){return null}}return null}var W,G,K,J=Object.prototype.hasOwnProperty,Q={key:!0,ref:!0,__self:!0,__source:!0};function Y(e){if(J.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return void 0!==e.ref}function X(e){if(J.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return void 0!==e.key}function Z(e,t){var n=function(){W||(W=!0,R("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}function ee(e,t){var n=function(){G||(G=!0,R("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};n.isReactWarning=!0,Object.defineProperty(e,"ref",{get:n,configurable:!0})}function te(e){if("string"==typeof e.ref&&_.current&&e.__self&&_.current.stateNode!==e.__self){var t=H(_.current.type);K[t]||(R('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',t,e.ref),K[t]=!0)}}K={};var ne=function(e,t,i,s,r,a,o){var c={$$typeof:n,type:e,key:t,ref:i,props:o,_owner:a,_store:{}};return Object.defineProperty(c._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(c,"_self",{configurable:!1,enumerable:!1,writable:!1,value:s}),Object.defineProperty(c,"_source",{configurable:!1,enumerable:!1,writable:!1,value:r}),Object.freeze&&(Object.freeze(c.props),Object.freeze(c)),c};function ie(e,t,n){var i,s={},r=null,a=null,o=null,c=null;if(null!=t)for(i in Y(t)&&(a=t.ref,te(t)),X(t)&&($(t.key),r=""+t.key),o=void 0===t.__self?null:t.__self,c=void 0===t.__source?null:t.__source,t)J.call(t,i)&&!Q.hasOwnProperty(i)&&(s[i]=t[i]);var p=arguments.length-2;if(1===p)s.children=n;else if(p>1){for(var d=Array(p),l=0;l<p;l++)d[l]=arguments[l+2];Object.freeze&&Object.freeze(d),s.children=d}if(e&&e.defaultProps){var u=e.defaultProps;for(i in u)void 0===s[i]&&(s[i]=u[i])}if(r||a){var m="function"==typeof e?e.displayName||e.name||"Unknown":e;r&&Z(s,m),a&&ee(s,m)}return ne(e,r,a,o,c,_.current,s)}function se(e,t,n){if(null==e)throw new Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var i,s,r=D({},e.props),a=e.key,o=e.ref,c=e._self,p=e._source,d=e._owner;if(null!=t)for(i in Y(t)&&(o=t.ref,d=_.current),X(t)&&($(t.key),a=""+t.key),e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)J.call(t,i)&&!Q.hasOwnProperty(i)&&(void 0===t[i]&&void 0!==s?r[i]=s[i]:r[i]=t[i]);var l=arguments.length-2;if(1===l)r.children=n;else if(l>1){for(var u=Array(l),m=0;m<l;m++)u[m]=arguments[m+2];r.children=u}return ne(e.type,a,o,c,p,d,r)}function re(e){return"object"==typeof e&&null!==e&&e.$$typeof===n}var ae,oe=!1,ce=/\/+/g;function pe(e){return e.replace(ce,"$&/")}function de(e,t){return"object"==typeof e&&null!==e&&null!=e.key?($(e.key),n=""+e.key,i={"=":"=0",":":"=2"},"$"+n.replace(/[=:]/g,(function(e){return i[e]}))):t.toString(36);var n,i}function le(e,t,s,r,a){var o=typeof e;"undefined"!==o&&"boolean"!==o||(e=null);var c,p,d,l=!1;if(null===e)l=!0;else switch(o){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case n:case i:l=!0}}if(l){var u=e,m=a(u),h=""===r?"."+de(u,0):r;if(z(m)){var f="";null!=h&&(f=pe(h)+"/"),le(m,t,f,"",(function(e){return e}))}else null!=m&&(re(m)&&(!m.key||u&&u.key===m.key||$(m.key),c=m,p=s+(!m.key||u&&u.key===m.key?"":pe(""+m.key)+"/")+h,m=ne(c.type,p,c.ref,c._self,c._source,c._owner,c.props)),t.push(m));return 1}var v=0,b=""===r?".":r+":";if(z(e))for(var y=0;y<e.length;y++)v+=le(d=e[y],t,s,b+de(d,y),a);else{var _=g(e);if("function"==typeof _){var x=e;_===x.entries&&(oe||C("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),oe=!0);for(var w,S=_.call(x),k=0;!(w=S.next()).done;)v+=le(d=w.value,t,s,b+de(d,k++),a)}else if("object"===o){var R=String(e);throw new Error("Objects are not valid as a React child (found: "+("[object Object]"===R?"object with keys {"+Object.keys(e).join(", ")+"}":R)+"). If you meant to render a collection of children, use an array instead.")}}return v}function ue(e,t,n){if(null==e)return e;var i=[],s=0;return le(e,i,"","",(function(e){return t.call(n,e,s++)})),i}function me(e){if(-1===e._status){var t=(0,e._result)();if(t.then((function(t){if(0===e._status||-1===e._status){var n=e;n._status=1,n._result=t}}),(function(t){if(0===e._status||-1===e._status){var n=e;n._status=2,n._result=t}})),-1===e._status){var n=e;n._status=0,n._result=t}}if(1===e._status){var i=e._result;return void 0===i&&R("lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))\n\nDid you accidentally put curly braces around the import?",i),"default"in i||R("lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))",i),i.default}throw e._result}function he(e){return"string"==typeof e||"function"==typeof e||e===s||e===a||e===r||e===d||e===l||e===h||"object"==typeof e&&null!==e&&(e.$$typeof===m||e.$$typeof===u||e.$$typeof===o||e.$$typeof===c||e.$$typeof===p||e.$$typeof===ae||void 0!==e.getModuleId)}function fe(){var e=v.current;return null===e&&R("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem."),e}ae=Symbol.for("react.module.reference");var ge,ve,be,ye,_e,xe,we,Se=0;function ke(){}ke.__reactDisabledLog=!0;var Ce,Re=k.ReactCurrentDispatcher;function Te(e,t,n){if(void 0===Ce)try{throw Error()}catch(e){var i=e.stack.trim().match(/\n( *(at )?)/);Ce=i&&i[1]||""}return"\n"+Ce+e}var Pe,Ee=!1,Oe="function"==typeof WeakMap?WeakMap:Map;function De(e,t){if(!e||Ee)return"";var n,i=Pe.get(e);if(void 0!==i)return i;Ee=!0;var s,r=Error.prepareStackTrace;Error.prepareStackTrace=void 0,s=Re.current,Re.current=null,function(){if(0===Se){ge=console.log,ve=console.info,be=console.warn,ye=console.error,_e=console.group,xe=console.groupCollapsed,we=console.groupEnd;var e={configurable:!0,enumerable:!0,value:ke,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}Se++}();try{if(t){var a=function(){throw Error()};if(Object.defineProperty(a.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(a,[])}catch(e){n=e}Reflect.construct(e,[],a)}else{try{a.call()}catch(e){n=e}e.call(a.prototype)}}else{try{throw Error()}catch(e){n=e}e()}}catch(t){if(t&&n&&"string"==typeof t.stack){for(var o=t.stack.split("\n"),c=n.stack.split("\n"),p=o.length-1,d=c.length-1;p>=1&&d>=0&&o[p]!==c[d];)d--;for(;p>=1&&d>=0;p--,d--)if(o[p]!==c[d]){if(1!==p||1!==d)do{if(p--,--d<0||o[p]!==c[d]){var l="\n"+o[p].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),"function"==typeof e&&Pe.set(e,l),l}}while(p>=1&&d>=0);break}}}finally{Ee=!1,Re.current=s,function(){if(0==--Se){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:D({},e,{value:ge}),info:D({},e,{value:ve}),warn:D({},e,{value:be}),error:D({},e,{value:ye}),group:D({},e,{value:_e}),groupCollapsed:D({},e,{value:xe}),groupEnd:D({},e,{value:we})})}Se<0&&R("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}(),Error.prepareStackTrace=r}var u=e?e.displayName||e.name:"",m=u?Te(u):"";return"function"==typeof e&&Pe.set(e,m),m}function je(e,t,n){if(null==e)return"";if("function"==typeof e)return De(e,function(e){var t=e.prototype;return!(!t||!t.isReactComponent)}(e));if("string"==typeof e)return Te(e);switch(e){case d:return Te("Suspense");case l:return Te("SuspenseList")}if("object"==typeof e)switch(e.$$typeof){case p:return De(e.render,!1);case u:return je(e.type,t,n);case m:var i=e,s=i._payload,r=i._init;try{return je(r(s),t,n)}catch(e){}}return""}Pe=new Oe;var Ie,Me={},Le=k.ReactDebugCurrentFrame;function Ae(e){if(e){var t=e._owner,n=je(e.type,e._source,t?t.type:null);Le.setExtraStackFrame(n)}else Le.setExtraStackFrame(null)}function Ne(e){if(e){var t=e._owner;S(je(e.type,e._source,t?t.type:null))}else S(null)}function Be(){if(_.current){var e=H(_.current.type);if(e)return"\n\nCheck the render method of `"+e+"`."}return""}function Fe(e){return null!=e&&void 0!==(t=e.__source)?"\n\nCheck your code at "+t.fileName.replace(/^.*[\\\/]/,"")+":"+t.lineNumber+".":"";var t}Ie=!1;var Ue={};function ze(e,t){if(e._store&&!e._store.validated&&null==e.key){e._store.validated=!0;var n=function(e){var t=Be();if(!t){var n="string"==typeof e?e:e.displayName||e.name;n&&(t="\n\nCheck the top-level render call using <"+n+">.")}return t}(t);if(!Ue[n]){Ue[n]=!0;var i="";e&&e._owner&&e._owner!==_.current&&(i=" It was passed a child from "+H(e._owner.type)+"."),Ne(e),R('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',n,i),Ne(null)}}}function qe(e,t){if("object"==typeof e)if(z(e))for(var n=0;n<e.length;n++){var i=e[n];re(i)&&ze(i,t)}else if(re(e))e._store&&(e._store.validated=!0);else if(e){var s=g(e);if("function"==typeof s&&s!==e.entries)for(var r,a=s.call(e);!(r=a.next()).done;)re(r.value)&&ze(r.value,t)}}function $e(e){var t,n=e.type;if(null!=n&&"string"!=typeof n){if("function"==typeof n)t=n.propTypes;else{if("object"!=typeof n||n.$$typeof!==p&&n.$$typeof!==u)return;t=n.propTypes}if(t){var i=H(n);!function(e,t,n,i,s){var r=Function.call.bind(J);for(var a in e)if(r(e,a)){var o=void 0;try{if("function"!=typeof e[a]){var c=Error((i||"React class")+": "+n+" type `"+a+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[a]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw c.name="Invariant Violation",c}o=e[a](t,a,i,n,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(e){o=e}!o||o instanceof Error||(Ae(s),R("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",i||"React class",n,a,typeof o),Ae(null)),o instanceof Error&&!(o.message in Me)&&(Me[o.message]=!0,Ae(s),R("Failed %s type: %s",n,o.message),Ae(null))}}(t,e.props,"prop",i,e)}else void 0===n.PropTypes||Ie||(Ie=!0,R("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",H(n)||"Unknown"));"function"!=typeof n.getDefaultProps||n.getDefaultProps.isReactClassApproved||R("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Ve(e){for(var t=Object.keys(e.props),n=0;n<t.length;n++){var i=t[n];if("children"!==i&&"key"!==i){Ne(e),R("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",i),Ne(null);break}}null!==e.ref&&(Ne(e),R("Invalid attribute `ref` supplied to `React.Fragment`."),Ne(null))}function He(e,t,i){var r=he(e);if(!r){var a="";(void 0===e||"object"==typeof e&&null!==e&&0===Object.keys(e).length)&&(a+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var o,c=Fe(t);a+=c||Be(),null===e?o="null":z(e)?o="array":void 0!==e&&e.$$typeof===n?(o="<"+(H(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):o=typeof e,R("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",o,a)}var p=ie.apply(this,arguments);if(null==p)return p;if(r)for(var d=2;d<arguments.length;d++)qe(arguments[d],e);return e===s?Ve(p):$e(p),p}var We=!1,Ge=!1,Ke=null,Je=0,Qe=!1;function Ye(e){e!==Je-1&&R("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "),Je=e}function Xe(t,n,i){var s=y.current;if(null!==s)try{et(s),function(t){if(null===Ke)try{var n=("require"+Math.random()).slice(0,7),i=e&&e[n];Ke=i.call(e,"timers").setImmediate}catch(e){Ke=function(e){!1===Ge&&(Ge=!0,"undefined"==typeof MessageChannel&&R("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var t=new MessageChannel;t.port1.onmessage=e,t.port2.postMessage(void 0)}}Ke(t)}((function(){0===s.length?(y.current=null,n(t)):Xe(t,n,i)}))}catch(e){i(e)}else n(t)}var Ze=!1;function et(e){if(!Ze){Ze=!0;var t=0;try{for(;t<e.length;t++){var n=e[t];do{n=n(!0)}while(null!==n)}e.length=0}catch(n){throw e=e.slice(t+1),n}finally{Ze=!1}}}var tt=He,nt=function(e,t,n){for(var i=se.apply(this,arguments),s=2;s<arguments.length;s++)qe(arguments[s],i.type);return $e(i),i},it=function(e){var t=He.bind(null,e);return t.type=e,We||(We=!0,C("React.createFactory() is deprecated and will be removed in a future major release. Consider using JSX or use React.createElement() directly instead.")),Object.defineProperty(t,"type",{enumerable:!1,get:function(){return C("Factory.type is deprecated. Access the class directly before passing it to createFactory."),Object.defineProperty(this,"type",{value:e}),e}}),t},st={map:ue,forEach:function(e,t,n){ue(e,(function(){t.apply(this,arguments)}),n)},count:function(e){var t=0;return ue(e,(function(){t++})),t},toArray:function(e){return ue(e,(function(e){return e}))||[]},only:function(e){if(!re(e))throw new Error("React.Children.only expected to receive a single React element child.");return e}};t.Children=st,t.Component=I,t.Fragment=s,t.Profiler=a,t.PureComponent=B,t.StrictMode=r,t.Suspense=d,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=k,t.cloneElement=nt,t.createContext=function(e){var t={$$typeof:c,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null};t.Provider={$$typeof:o,_context:t};var n=!1,i=!1,s=!1,r={$$typeof:c,_context:t};return Object.defineProperties(r,{Provider:{get:function(){return i||(i=!0,R("Rendering <Context.Consumer.Provider> is not supported and will be removed in a future major release. Did you mean to render <Context.Provider> instead?")),t.Provider},set:function(e){t.Provider=e}},_currentValue:{get:function(){return t._currentValue},set:function(e){t._currentValue=e}},_currentValue2:{get:function(){return t._currentValue2},set:function(e){t._currentValue2=e}},_threadCount:{get:function(){return t._threadCount},set:function(e){t._threadCount=e}},Consumer:{get:function(){return n||(n=!0,R("Rendering <Context.Consumer.Consumer> is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?")),t.Consumer}},displayName:{get:function(){return t.displayName},set:function(e){s||(C("Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.displayName = '%s'.",e),s=!0)}}}),t.Consumer=r,t._currentRenderer=null,t._currentRenderer2=null,t},t.createElement=tt,t.createFactory=it,t.createRef=function(){var e={current:null};return Object.seal(e),e},t.forwardRef=function(e){null!=e&&e.$$typeof===u?R("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):"function"!=typeof e?R("forwardRef requires a render function but was given %s.",null===e?"null":typeof e):0!==e.length&&2!==e.length&&R("forwardRef render functions accept exactly two parameters: props and ref. %s",1===e.length?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),null!=e&&(null==e.defaultProps&&null==e.propTypes||R("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?"));var t,n={$$typeof:p,render:e};return Object.defineProperty(n,"displayName",{enumerable:!1,configurable:!0,get:function(){return t},set:function(n){t=n,e.name||e.displayName||(e.displayName=n)}}),n},t.isValidElement=re,t.lazy=function(e){var t,n,i={$$typeof:m,_payload:{_status:-1,_result:e},_init:me};return Object.defineProperties(i,{defaultProps:{configurable:!0,get:function(){return t},set:function(e){R("React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),t=e,Object.defineProperty(i,"defaultProps",{enumerable:!0})}},propTypes:{configurable:!0,get:function(){return n},set:function(e){R("React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),n=e,Object.defineProperty(i,"propTypes",{enumerable:!0})}}}),i},t.memo=function(e,t){he(e)||R("memo: The first argument must be a component. Instead received: %s",null===e?"null":typeof e);var n,i={$$typeof:u,type:e,compare:void 0===t?null:t};return Object.defineProperty(i,"displayName",{enumerable:!1,configurable:!0,get:function(){return n},set:function(t){n=t,e.name||e.displayName||(e.displayName=t)}}),i},t.startTransition=function(e,t){var n=b.transition;b.transition={};var i=b.transition;b.transition._updatedFibers=new Set;try{e()}finally{b.transition=n,null===n&&i._updatedFibers&&(i._updatedFibers.size>10&&C("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."),i._updatedFibers.clear())}},t.unstable_act=function(e){var t=Je;Je++,null===y.current&&(y.current=[]);var n,i=y.isBatchingLegacy;try{if(y.isBatchingLegacy=!0,n=e(),!i&&y.didScheduleLegacyUpdate){var s=y.current;null!==s&&(y.didScheduleLegacyUpdate=!1,et(s))}}catch(e){throw Ye(t),e}finally{y.isBatchingLegacy=i}if(null!==n&&"object"==typeof n&&"function"==typeof n.then){var r=n,a=!1,o={then:function(e,n){a=!0,r.then((function(i){Ye(t),0===Je?Xe(i,e,n):e(i)}),(function(e){Ye(t),n(e)}))}};return Qe||"undefined"==typeof Promise||Promise.resolve().then((function(){})).then((function(){a||(Qe=!0,R("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"))})),o}var c=n;if(Ye(t),0===Je){var p=y.current;return null!==p&&(et(p),y.current=null),{then:function(e,t){null===y.current?(y.current=[],Xe(c,e,t)):e(c)}}}return{then:function(e,t){e(c)}}},t.useCallback=function(e,t){return fe().useCallback(e,t)},t.useContext=function(e){var t=fe();if(void 0!==e._context){var n=e._context;n.Consumer===e?R("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?"):n.Provider===e&&R("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?")}return t.useContext(e)},t.useDebugValue=function(e,t){return fe().useDebugValue(e,t)},t.useDeferredValue=function(e){return fe().useDeferredValue(e)},t.useEffect=function(e,t){return fe().useEffect(e,t)},t.useId=function(){return fe().useId()},t.useImperativeHandle=function(e,t,n){return fe().useImperativeHandle(e,t,n)},t.useInsertionEffect=function(e,t){return fe().useInsertionEffect(e,t)},t.useLayoutEffect=function(e,t){return fe().useLayoutEffect(e,t)},t.useMemo=function(e,t){return fe().useMemo(e,t)},t.useReducer=function(e,t,n){return fe().useReducer(e,t,n)},t.useRef=function(e){return fe().useRef(e)},t.useState=function(e){return fe().useState(e)},t.useSyncExternalStore=function(e,t,n){return fe().useSyncExternalStore(e,t,n)},t.useTransition=function(){return fe().useTransition()},t.version="18.2.0","undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),cn;var e,t}on={get exports(){return nn},set exports(e){nn=e}},"production"===process.env.NODE_ENV?on.exports=rn():on.exports=dn();var ln=Zt(nn),un=({stream:e,style:t})=>{const n=nn.useCallback((t=>{null!==t&&t.srcObject!==e&&(t.srcObject=e)}),[]);return ln.createElement("video",{ref:n,autoPlay:!0,playsInline:!0,style:t})};function mn(e,t,n,i){return new(n||(n=Promise))((function(s,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function o(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}c((i=i.apply(e,t||[])).next())}))}const hn="client_connection_status_changed",fn="stream_added",gn="rtc_manager_created",vn="rtc_manager_destroyed",bn="local_stream_track_added",yn="local_stream_track_removed",_n="connecting",xn="connection_failed",wn="connection_successful",Sn="connection_disconnected",kn="fetch_mediaserver_config",Cn="start_screenshare",Rn="stop_screenshare",Tn="mediaserver_config",Pn="room_joined",En="ice_candidate",On="ice_endofcandidates",Dn="ready_to_receive_offer",jn="sdp_answer",In="sdp_offer";let Mn=!0,Ln=!0;function An(e,t,n){const i=e.match(t);return i&&i.length>=n&&parseInt(i[n],10)}function Nn(e,t,n){if(!e.RTCPeerConnection)return;const i=e.RTCPeerConnection.prototype,s=i.addEventListener;i.addEventListener=function(e,i){if(e!==t)return s.apply(this,arguments);const r=e=>{const t=n(e);t&&(i.handleEvent?i.handleEvent(t):i(t))};return this._eventMap=this._eventMap||{},this._eventMap[t]||(this._eventMap[t]=new Map),this._eventMap[t].set(i,r),s.apply(this,[e,r])};const r=i.removeEventListener;i.removeEventListener=function(e,n){if(e!==t||!this._eventMap||!this._eventMap[t])return r.apply(this,arguments);if(!this._eventMap[t].has(n))return r.apply(this,arguments);const i=this._eventMap[t].get(n);return this._eventMap[t].delete(n),0===this._eventMap[t].size&&delete this._eventMap[t],0===Object.keys(this._eventMap).length&&delete this._eventMap,r.apply(this,[e,i])},Object.defineProperty(i,"on"+t,{get(){return this["_on"+t]},set(e){this["_on"+t]&&(this.removeEventListener(t,this["_on"+t]),delete this["_on"+t]),e&&this.addEventListener(t,this["_on"+t]=e)},enumerable:!0,configurable:!0})}function Bn(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(Mn=e,e?"adapter.js logging disabled":"adapter.js logging enabled")}function Fn(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(Ln=!e,"adapter.js deprecation warnings "+(e?"disabled":"enabled"))}function Un(){if("object"==typeof window){if(Mn)return;"undefined"!=typeof console&&"function"==typeof console.log&&console.log.apply(console,arguments)}}function zn(e,t){Ln&&console.warn(e+" is deprecated, please use "+t+" instead.")}function qn(e){return"[object Object]"===Object.prototype.toString.call(e)}function $n(e){return qn(e)?Object.keys(e).reduce((function(t,n){const i=qn(e[n]),s=i?$n(e[n]):e[n],r=i&&!Object.keys(s).length;return void 0===s||r?t:Object.assign(t,{[n]:s})}),{}):e}function Vn(e,t,n){t&&!n.has(t.id)&&(n.set(t.id,t),Object.keys(t).forEach((i=>{i.endsWith("Id")?Vn(e,e.get(t[i]),n):i.endsWith("Ids")&&t[i].forEach((t=>{Vn(e,e.get(t),n)}))})))}function Hn(e,t,n){const i=n?"outbound-rtp":"inbound-rtp",s=new Map;if(null===t)return s;const r=[];return e.forEach((e=>{"track"===e.type&&e.trackIdentifier===t.id&&r.push(e)})),r.forEach((t=>{e.forEach((n=>{n.type===i&&n.trackId===t.id&&Vn(e,n,s)}))})),s}const Wn=Un;function Gn(e,t){const n=e&&e.navigator;if(!n.mediaDevices)return;const i=function(e){if("object"!=typeof e||e.mandatory||e.optional)return e;const t={};return Object.keys(e).forEach((n=>{if("require"===n||"advanced"===n||"mediaSource"===n)return;const i="object"==typeof e[n]?e[n]:{ideal:e[n]};void 0!==i.exact&&"number"==typeof i.exact&&(i.min=i.max=i.exact);const s=function(e,t){return e?e+t.charAt(0).toUpperCase()+t.slice(1):"deviceId"===t?"sourceId":t};if(void 0!==i.ideal){t.optional=t.optional||[];let e={};"number"==typeof i.ideal?(e[s("min",n)]=i.ideal,t.optional.push(e),e={},e[s("max",n)]=i.ideal,t.optional.push(e)):(e[s("",n)]=i.ideal,t.optional.push(e))}void 0!==i.exact&&"number"!=typeof i.exact?(t.mandatory=t.mandatory||{},t.mandatory[s("",n)]=i.exact):["min","max"].forEach((e=>{void 0!==i[e]&&(t.mandatory=t.mandatory||{},t.mandatory[s(e,n)]=i[e])}))})),e.advanced&&(t.optional=(t.optional||[]).concat(e.advanced)),t},s=function(e,s){if(t.version>=61)return s(e);if((e=JSON.parse(JSON.stringify(e)))&&"object"==typeof e.audio){const t=function(e,t,n){t in e&&!(n in e)&&(e[n]=e[t],delete e[t])};t((e=JSON.parse(JSON.stringify(e))).audio,"autoGainControl","googAutoGainControl"),t(e.audio,"noiseSuppression","googNoiseSuppression"),e.audio=i(e.audio)}if(e&&"object"==typeof e.video){let r=e.video.facingMode;r=r&&("object"==typeof r?r:{ideal:r});const a=t.version<66;if(r&&("user"===r.exact||"environment"===r.exact||"user"===r.ideal||"environment"===r.ideal)&&(!n.mediaDevices.getSupportedConstraints||!n.mediaDevices.getSupportedConstraints().facingMode||a)){let t;if(delete e.video.facingMode,"environment"===r.exact||"environment"===r.ideal?t=["back","rear"]:"user"!==r.exact&&"user"!==r.ideal||(t=["front"]),t)return n.mediaDevices.enumerateDevices().then((n=>{n=n.filter((e=>"videoinput"===e.kind));let a=n.find((e=>t.some((t=>e.label.toLowerCase().includes(t)))));return!a&&n.length&&t.includes("back")&&(a=n[n.length-1]),a&&(e.video.deviceId=r.exact?{exact:a.deviceId}:{ideal:a.deviceId}),e.video=i(e.video),Wn("chrome: "+JSON.stringify(e)),s(e)}))}e.video=i(e.video)}return Wn("chrome: "+JSON.stringify(e)),s(e)},r=function(e){return t.version>=64?e:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[e.name]||e.name,message:e.message,constraint:e.constraint||e.constraintName,toString(){return this.name+(this.message&&": ")+this.message}}};if(n.getUserMedia=function(e,t,i){s(e,(e=>{n.webkitGetUserMedia(e,t,(e=>{i&&i(r(e))}))}))}.bind(n),n.mediaDevices.getUserMedia){const e=n.mediaDevices.getUserMedia.bind(n.mediaDevices);n.mediaDevices.getUserMedia=function(t){return s(t,(t=>e(t).then((e=>{if(t.audio&&!e.getAudioTracks().length||t.video&&!e.getVideoTracks().length)throw e.getTracks().forEach((e=>{e.stop()})),new DOMException("","NotFoundError");return e}),(e=>Promise.reject(r(e))))))}}}function Kn(e){e.MediaStream=e.MediaStream||e.webkitMediaStream}function Jn(e){if("object"==typeof e&&e.RTCPeerConnection&&!("ontrack"in e.RTCPeerConnection.prototype)){Object.defineProperty(e.RTCPeerConnection.prototype,"ontrack",{get(){return this._ontrack},set(e){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=e)},enumerable:!0,configurable:!0});const t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=t=>{t.stream.addEventListener("addtrack",(n=>{let i;i=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find((e=>e.track&&e.track.id===n.track.id)):{track:n.track};const s=new Event("track");s.track=n.track,s.receiver=i,s.transceiver={receiver:i},s.streams=[t.stream],this.dispatchEvent(s)})),t.stream.getTracks().forEach((n=>{let i;i=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find((e=>e.track&&e.track.id===n.id)):{track:n};const s=new Event("track");s.track=n,s.receiver=i,s.transceiver={receiver:i},s.streams=[t.stream],this.dispatchEvent(s)}))},this.addEventListener("addstream",this._ontrackpoly)),t.apply(this,arguments)}}else Nn(e,"track",(e=>(e.transceiver||Object.defineProperty(e,"transceiver",{value:{receiver:e.receiver}}),e)))}function Qn(e){if("object"==typeof e&&e.RTCPeerConnection&&!("getSenders"in e.RTCPeerConnection.prototype)&&"createDTMFSender"in e.RTCPeerConnection.prototype){const t=function(e,t){return{track:t,get dtmf(){return void 0===this._dtmf&&("audio"===t.kind?this._dtmf=e.createDTMFSender(t):this._dtmf=null),this._dtmf},_pc:e}};if(!e.RTCPeerConnection.prototype.getSenders){e.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};const n=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,i){let s=n.apply(this,arguments);return s||(s=t(this,e),this._senders.push(s)),s};const i=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){i.apply(this,arguments);const t=this._senders.indexOf(e);-1!==t&&this._senders.splice(t,1)}}const n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){this._senders=this._senders||[],n.apply(this,[e]),e.getTracks().forEach((e=>{this._senders.push(t(this,e))}))};const i=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){this._senders=this._senders||[],i.apply(this,[e]),e.getTracks().forEach((e=>{const t=this._senders.find((t=>t.track===e));t&&this._senders.splice(this._senders.indexOf(t),1)}))}}else if("object"==typeof e&&e.RTCPeerConnection&&"getSenders"in e.RTCPeerConnection.prototype&&"createDTMFSender"in e.RTCPeerConnection.prototype&&e.RTCRtpSender&&!("dtmf"in e.RTCRtpSender.prototype)){const t=e.RTCPeerConnection.prototype.getSenders;e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e},Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}}function Yn(e){if(!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){const[e,n,i]=arguments;if(arguments.length>0&&"function"==typeof e)return t.apply(this,arguments);if(0===t.length&&(0===arguments.length||"function"!=typeof e))return t.apply(this,[]);const s=function(e){const t={};return e.result().forEach((e=>{const n={id:e.id,timestamp:e.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[e.type]||e.type};e.names().forEach((t=>{n[t]=e.stat(t)})),t[n.id]=n})),t},r=function(e){return new Map(Object.keys(e).map((t=>[t,e[t]])))};if(arguments.length>=2){const i=function(e){n(r(s(e)))};return t.apply(this,[i,e])}return new Promise(((e,n)=>{t.apply(this,[function(t){e(r(s(t)))},n])})).then(n,i)}}function Xn(e){if(!("object"==typeof e&&e.RTCPeerConnection&&e.RTCRtpSender&&e.RTCRtpReceiver))return;if(!("getStats"in e.RTCRtpSender.prototype)){const t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e});const n=e.RTCPeerConnection.prototype.addTrack;n&&(e.RTCPeerConnection.prototype.addTrack=function(){const e=n.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){const e=this;return this._pc.getStats().then((t=>Hn(t,e.track,!0)))}}if(!("getStats"in e.RTCRtpReceiver.prototype)){const t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e}),Nn(e,"track",(e=>(e.receiver._pc=e.srcElement,e))),e.RTCRtpReceiver.prototype.getStats=function(){const e=this;return this._pc.getStats().then((t=>Hn(t,e.track,!1)))}}if(!("getStats"in e.RTCRtpSender.prototype)||!("getStats"in e.RTCRtpReceiver.prototype))return;const t=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof e.MediaStreamTrack){const e=arguments[0];let t,n,i;return this.getSenders().forEach((n=>{n.track===e&&(t?i=!0:t=n)})),this.getReceivers().forEach((t=>(t.track===e&&(n?i=!0:n=t),t.track===e))),i||t&&n?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):t?t.getStats():n?n.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return t.apply(this,arguments)}}function Zn(e){e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map((e=>this._shimmedLocalStreams[e][0]))};const t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,n){if(!n)return t.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};const i=t.apply(this,arguments);return this._shimmedLocalStreams[n.id]?-1===this._shimmedLocalStreams[n.id].indexOf(i)&&this._shimmedLocalStreams[n.id].push(i):this._shimmedLocalStreams[n.id]=[n,i],i};const n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){this._shimmedLocalStreams=this._shimmedLocalStreams||{},e.getTracks().forEach((e=>{const t=this.getSenders().find((t=>t.track===e));if(t)throw new DOMException("Track already exists.","InvalidAccessError")}));const t=this.getSenders();n.apply(this,arguments);const i=this.getSenders().filter((e=>-1===t.indexOf(e)));this._shimmedLocalStreams[e.id]=[e].concat(i)};const i=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[e.id],i.apply(this,arguments)};const s=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},e&&Object.keys(this._shimmedLocalStreams).forEach((t=>{const n=this._shimmedLocalStreams[t].indexOf(e);-1!==n&&this._shimmedLocalStreams[t].splice(n,1),1===this._shimmedLocalStreams[t].length&&delete this._shimmedLocalStreams[t]})),s.apply(this,arguments)}}function ei(e,t){if(!e.RTCPeerConnection)return;if(e.RTCPeerConnection.prototype.addTrack&&t.version>=65)return Zn(e);const n=e.RTCPeerConnection.prototype.getLocalStreams;e.RTCPeerConnection.prototype.getLocalStreams=function(){const e=n.apply(this);return this._reverseStreams=this._reverseStreams||{},e.map((e=>this._reverseStreams[e.id]))};const i=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(t){if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},t.getTracks().forEach((e=>{const t=this.getSenders().find((t=>t.track===e));if(t)throw new DOMException("Track already exists.","InvalidAccessError")})),!this._reverseStreams[t.id]){const n=new e.MediaStream(t.getTracks());this._streams[t.id]=n,this._reverseStreams[n.id]=t,t=n}i.apply(this,[t])};const s=e.RTCPeerConnection.prototype.removeStream;function r(e,t){let n=t.sdp;return Object.keys(e._reverseStreams||[]).forEach((t=>{const i=e._reverseStreams[t],s=e._streams[i.id];n=n.replace(new RegExp(s.id,"g"),i.id)})),new RTCSessionDescription({type:t.type,sdp:n})}function a(e,t){let n=t.sdp;return Object.keys(e._reverseStreams||[]).forEach((t=>{const i=e._reverseStreams[t],s=e._streams[i.id];n=n.replace(new RegExp(i.id,"g"),s.id)})),new RTCSessionDescription({type:t.type,sdp:n})}e.RTCPeerConnection.prototype.removeStream=function(e){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},s.apply(this,[this._streams[e.id]||e]),delete this._reverseStreams[this._streams[e.id]?this._streams[e.id].id:e.id],delete this._streams[e.id]},e.RTCPeerConnection.prototype.addTrack=function(t,n){if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");const i=[].slice.call(arguments,1);if(1!==i.length||!i[0].getTracks().find((e=>e===t)))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");const s=this.getSenders().find((e=>e.track===t));if(s)throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};const r=this._streams[n.id];if(r)r.addTrack(t),Promise.resolve().then((()=>{this.dispatchEvent(new Event("negotiationneeded"))}));else{const i=new e.MediaStream([t]);this._streams[n.id]=i,this._reverseStreams[i.id]=n,this.addStream(i)}return this.getSenders().find((e=>e.track===t))},["createOffer","createAnswer"].forEach((function(t){const n=e.RTCPeerConnection.prototype[t],i={[t](){const e=arguments;return arguments.length&&"function"==typeof arguments[0]?n.apply(this,[t=>{const n=r(this,t);e[0].apply(null,[n])},t=>{e[1]&&e[1].apply(null,t)},arguments[2]]):n.apply(this,arguments).then((e=>r(this,e)))}};e.RTCPeerConnection.prototype[t]=i[t]}));const o=e.RTCPeerConnection.prototype.setLocalDescription;e.RTCPeerConnection.prototype.setLocalDescription=function(){return arguments.length&&arguments[0].type?(arguments[0]=a(this,arguments[0]),o.apply(this,arguments)):o.apply(this,arguments)};const c=Object.getOwnPropertyDescriptor(e.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(e.RTCPeerConnection.prototype,"localDescription",{get(){const e=c.get.apply(this);return""===e.type?e:r(this,e)}}),e.RTCPeerConnection.prototype.removeTrack=function(e){if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!e._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(!(e._pc===this))throw new DOMException("Sender was not created by this connection.","InvalidAccessError");let t;this._streams=this._streams||{},Object.keys(this._streams).forEach((n=>{this._streams[n].getTracks().find((t=>e.track===t))&&(t=this._streams[n])})),t&&(1===t.getTracks().length?this.removeStream(this._reverseStreams[t.id]):t.removeTrack(e.track),this.dispatchEvent(new Event("negotiationneeded")))}}function ti(e,t){!e.RTCPeerConnection&&e.webkitRTCPeerConnection&&(e.RTCPeerConnection=e.webkitRTCPeerConnection),e.RTCPeerConnection&&t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){const n=e.RTCPeerConnection.prototype[t],i={[t](){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}};e.RTCPeerConnection.prototype[t]=i[t]}))}function ni(e,t){Nn(e,"negotiationneeded",(e=>{const n=e.target;if(!(t.version<72||n.getConfiguration&&"plan-b"===n.getConfiguration().sdpSemantics)||"stable"===n.signalingState)return e}))}var ii=Object.freeze({__proto__:null,shimMediaStream:Kn,shimOnTrack:Jn,shimGetSendersWithDtmf:Qn,shimGetStats:Yn,shimSenderReceiverGetStats:Xn,shimAddTrackRemoveTrackWithNative:Zn,shimAddTrackRemoveTrack:ei,shimPeerConnection:ti,fixNegotiationNeeded:ni,shimGetUserMedia:Gn,shimGetDisplayMedia:function(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&("function"==typeof t?e.navigator.mediaDevices.getDisplayMedia=function(n){return t(n).then((t=>{const i=n.video&&n.video.width,s=n.video&&n.video.height,r=n.video&&n.video.frameRate;return n.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:t,maxFrameRate:r||3}},i&&(n.video.mandatory.maxWidth=i),s&&(n.video.mandatory.maxHeight=s),e.navigator.mediaDevices.getUserMedia(n)}))}:console.error("shimGetDisplayMedia: getSourceId argument is not a function"))}});function si(e,t){const n=e&&e.navigator,i=e&&e.MediaStreamTrack;if(n.getUserMedia=function(e,t,i){zn("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),n.mediaDevices.getUserMedia(e).then(t,i)},!(t.version>55&&"autoGainControl"in n.mediaDevices.getSupportedConstraints())){const e=function(e,t,n){t in e&&!(n in e)&&(e[n]=e[t],delete e[t])},t=n.mediaDevices.getUserMedia.bind(n.mediaDevices);if(n.mediaDevices.getUserMedia=function(n){return"object"==typeof n&&"object"==typeof n.audio&&(n=JSON.parse(JSON.stringify(n)),e(n.audio,"autoGainControl","mozAutoGainControl"),e(n.audio,"noiseSuppression","mozNoiseSuppression")),t(n)},i&&i.prototype.getSettings){const t=i.prototype.getSettings;i.prototype.getSettings=function(){const n=t.apply(this,arguments);return e(n,"mozAutoGainControl","autoGainControl"),e(n,"mozNoiseSuppression","noiseSuppression"),n}}if(i&&i.prototype.applyConstraints){const t=i.prototype.applyConstraints;i.prototype.applyConstraints=function(n){return"audio"===this.kind&&"object"==typeof n&&(n=JSON.parse(JSON.stringify(n)),e(n,"autoGainControl","mozAutoGainControl"),e(n,"noiseSuppression","mozNoiseSuppression")),t.apply(this,[n])}}}}function ri(e){"object"==typeof e&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function ai(e,t){if("object"!=typeof e||!e.RTCPeerConnection&&!e.mozRTCPeerConnection)return;!e.RTCPeerConnection&&e.mozRTCPeerConnection&&(e.RTCPeerConnection=e.mozRTCPeerConnection),t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){const n=e.RTCPeerConnection.prototype[t],i={[t](){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}};e.RTCPeerConnection.prototype[t]=i[t]}));const n={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},i=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){const[e,s,r]=arguments;return i.apply(this,[e||null]).then((e=>{if(t.version<53&&!s)try{e.forEach((e=>{e.type=n[e.type]||e.type}))}catch(t){if("TypeError"!==t.name)throw t;e.forEach(((t,i)=>{e.set(i,Object.assign({},t,{type:n[t.type]||t.type}))}))}return e})).then(s,r)}}function oi(e){if("object"!=typeof e||!e.RTCPeerConnection||!e.RTCRtpSender)return;if(e.RTCRtpSender&&"getStats"in e.RTCRtpSender.prototype)return;const t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e});const n=e.RTCPeerConnection.prototype.addTrack;n&&(e.RTCPeerConnection.prototype.addTrack=function(){const e=n.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}function ci(e){if("object"!=typeof e||!e.RTCPeerConnection||!e.RTCRtpSender)return;if(e.RTCRtpSender&&"getStats"in e.RTCRtpReceiver.prototype)return;const t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e}),Nn(e,"track",(e=>(e.receiver._pc=e.srcElement,e))),e.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function pi(e){e.RTCPeerConnection&&!("removeStream"in e.RTCPeerConnection.prototype)&&(e.RTCPeerConnection.prototype.removeStream=function(e){zn("removeStream","removeTrack"),this.getSenders().forEach((t=>{t.track&&e.getTracks().includes(t.track)&&this.removeTrack(t)}))})}function di(e){e.DataChannel&&!e.RTCDataChannel&&(e.RTCDataChannel=e.DataChannel)}function li(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.addTransceiver;t&&(e.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];let e=arguments[1]&&arguments[1].sendEncodings;void 0===e&&(e=[]),e=[...e];const n=e.length>0;n&&e.forEach((e=>{if("rid"in e){if(!/^[a-z0-9]{0,16}$/i.test(e.rid))throw new TypeError("Invalid RID value provided.")}if("scaleResolutionDownBy"in e&&!(parseFloat(e.scaleResolutionDownBy)>=1))throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in e&&!(parseFloat(e.maxFramerate)>=0))throw new RangeError("max_framerate must be >= 0.0")}));const i=t.apply(this,arguments);if(n){const{sender:t}=i,n=t.getParameters();(!("encodings"in n)||1===n.encodings.length&&0===Object.keys(n.encodings[0]).length)&&(n.encodings=e,t.sendEncodings=e,this.setParametersPromises.push(t.setParameters(n).then((()=>{delete t.sendEncodings})).catch((()=>{delete t.sendEncodings}))))}return i})}function ui(e){if("object"!=typeof e||!e.RTCRtpSender)return;const t=e.RTCRtpSender.prototype.getParameters;t&&(e.RTCRtpSender.prototype.getParameters=function(){const e=t.apply(this,arguments);return"encodings"in e||(e.encodings=[].concat(this.sendEncodings||[{}])),e})}function mi(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then((()=>t.apply(this,arguments))).finally((()=>{this.setParametersPromises=[]})):t.apply(this,arguments)}}function hi(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.createAnswer;e.RTCPeerConnection.prototype.createAnswer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then((()=>t.apply(this,arguments))).finally((()=>{this.setParametersPromises=[]})):t.apply(this,arguments)}}var fi=Object.freeze({__proto__:null,shimOnTrack:ri,shimPeerConnection:ai,shimSenderGetStats:oi,shimReceiverGetStats:ci,shimRemoveStream:pi,shimRTCDataChannel:di,shimAddTransceiver:li,shimGetParameters:ui,shimCreateOffer:mi,shimCreateAnswer:hi,shimGetUserMedia:si,shimGetDisplayMedia:function(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&(e.navigator.mediaDevices.getDisplayMedia=function(n){if(!n||!n.video){const e=new DOMException("getDisplayMedia without video constraints is undefined");return e.name="NotFoundError",e.code=8,Promise.reject(e)}return!0===n.video?n.video={mediaSource:t}:n.video.mediaSource=t,e.navigator.mediaDevices.getUserMedia(n)})}});function gi(e){if("object"==typeof e&&e.RTCPeerConnection){if("getLocalStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in e.RTCPeerConnection.prototype)){const t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addStream=function(e){this._localStreams||(this._localStreams=[]),this._localStreams.includes(e)||this._localStreams.push(e),e.getAudioTracks().forEach((n=>t.call(this,n,e))),e.getVideoTracks().forEach((n=>t.call(this,n,e)))},e.RTCPeerConnection.prototype.addTrack=function(e,...n){return n&&n.forEach((e=>{this._localStreams?this._localStreams.includes(e)||this._localStreams.push(e):this._localStreams=[e]})),t.apply(this,arguments)}}"removeStream"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.removeStream=function(e){this._localStreams||(this._localStreams=[]);const t=this._localStreams.indexOf(e);if(-1===t)return;this._localStreams.splice(t,1);const n=e.getTracks();this.getSenders().forEach((e=>{n.includes(e.track)&&this.removeTrack(e)}))})}}function vi(e){if("object"==typeof e&&e.RTCPeerConnection&&("getRemoteStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in e.RTCPeerConnection.prototype))){Object.defineProperty(e.RTCPeerConnection.prototype,"onaddstream",{get(){return this._onaddstream},set(e){this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=e),this.addEventListener("track",this._onaddstreampoly=e=>{e.streams.forEach((e=>{if(this._remoteStreams||(this._remoteStreams=[]),this._remoteStreams.includes(e))return;this._remoteStreams.push(e);const t=new Event("addstream");t.stream=e,this.dispatchEvent(t)}))})}});const t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){const e=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(t){t.streams.forEach((t=>{if(e._remoteStreams||(e._remoteStreams=[]),e._remoteStreams.indexOf(t)>=0)return;e._remoteStreams.push(t);const n=new Event("addstream");n.stream=t,e.dispatchEvent(n)}))}),t.apply(e,arguments)}}}function bi(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype,n=t.createOffer,i=t.createAnswer,s=t.setLocalDescription,r=t.setRemoteDescription,a=t.addIceCandidate;t.createOffer=function(e,t){const i=arguments.length>=2?arguments[2]:arguments[0],s=n.apply(this,[i]);return t?(s.then(e,t),Promise.resolve()):s},t.createAnswer=function(e,t){const n=arguments.length>=2?arguments[2]:arguments[0],s=i.apply(this,[n]);return t?(s.then(e,t),Promise.resolve()):s};let o=function(e,t,n){const i=s.apply(this,[e]);return n?(i.then(t,n),Promise.resolve()):i};t.setLocalDescription=o,o=function(e,t,n){const i=r.apply(this,[e]);return n?(i.then(t,n),Promise.resolve()):i},t.setRemoteDescription=o,o=function(e,t,n){const i=a.apply(this,[e]);return n?(i.then(t,n),Promise.resolve()):i},t.addIceCandidate=o}function yi(e){const t=e&&e.navigator;if(t.mediaDevices&&t.mediaDevices.getUserMedia){const e=t.mediaDevices,n=e.getUserMedia.bind(e);t.mediaDevices.getUserMedia=e=>n(_i(e))}!t.getUserMedia&&t.mediaDevices&&t.mediaDevices.getUserMedia&&(t.getUserMedia=function(e,n,i){t.mediaDevices.getUserMedia(e).then(n,i)}.bind(t))}function _i(e){return e&&void 0!==e.video?Object.assign({},e,{video:$n(e.video)}):e}function xi(e){if(!e.RTCPeerConnection)return;const t=e.RTCPeerConnection;e.RTCPeerConnection=function(e,n){if(e&&e.iceServers){const t=[];for(let n=0;n<e.iceServers.length;n++){let i=e.iceServers[n];!i.hasOwnProperty("urls")&&i.hasOwnProperty("url")?(zn("RTCIceServer.url","RTCIceServer.urls"),i=JSON.parse(JSON.stringify(i)),i.urls=i.url,delete i.url,t.push(i)):t.push(e.iceServers[n])}e.iceServers=t}return new t(e,n)},e.RTCPeerConnection.prototype=t.prototype,"generateCertificate"in t&&Object.defineProperty(e.RTCPeerConnection,"generateCertificate",{get:()=>t.generateCertificate})}function wi(e){"object"==typeof e&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function Si(e){const t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(e){if(e){void 0!==e.offerToReceiveAudio&&(e.offerToReceiveAudio=!!e.offerToReceiveAudio);const t=this.getTransceivers().find((e=>"audio"===e.receiver.track.kind));!1===e.offerToReceiveAudio&&t?"sendrecv"===t.direction?t.setDirection?t.setDirection("sendonly"):t.direction="sendonly":"recvonly"===t.direction&&(t.setDirection?t.setDirection("inactive"):t.direction="inactive"):!0!==e.offerToReceiveAudio||t||this.addTransceiver("audio",{direction:"recvonly"}),void 0!==e.offerToReceiveVideo&&(e.offerToReceiveVideo=!!e.offerToReceiveVideo);const n=this.getTransceivers().find((e=>"video"===e.receiver.track.kind));!1===e.offerToReceiveVideo&&n?"sendrecv"===n.direction?n.setDirection?n.setDirection("sendonly"):n.direction="sendonly":"recvonly"===n.direction&&(n.setDirection?n.setDirection("inactive"):n.direction="inactive"):!0!==e.offerToReceiveVideo||n||this.addTransceiver("video",{direction:"recvonly"})}return t.apply(this,arguments)}}function ki(e){"object"!=typeof e||e.AudioContext||(e.AudioContext=e.webkitAudioContext)}var Ci=Object.freeze({__proto__:null,shimLocalStreamsAPI:gi,shimRemoteStreamsAPI:vi,shimCallbacksAPI:bi,shimGetUserMedia:yi,shimConstraints:_i,shimRTCIceServerUrls:xi,shimTrackEventTransceiver:wi,shimCreateOfferLegacy:Si,shimAudioContext:ki}),Ri={};!function(e){const t={generateIdentifier:function(){return Math.random().toString(36).substring(2,12)}};t.localCName=t.generateIdentifier(),t.splitLines=function(e){return e.trim().split("\n").map((e=>e.trim()))},t.splitSections=function(e){return e.split("\nm=").map(((e,t)=>(t>0?"m="+e:e).trim()+"\r\n"))},t.getDescription=function(e){const n=t.splitSections(e);return n&&n[0]},t.getMediaSections=function(e){const n=t.splitSections(e);return n.shift(),n},t.matchPrefix=function(e,n){return t.splitLines(e).filter((e=>0===e.indexOf(n)))},t.parseCandidate=function(e){let t;t=0===e.indexOf("a=candidate:")?e.substring(12).split(" "):e.substring(10).split(" ");const n={foundation:t[0],component:{1:"rtp",2:"rtcp"}[t[1]]||t[1],protocol:t[2].toLowerCase(),priority:parseInt(t[3],10),ip:t[4],address:t[4],port:parseInt(t[5],10),type:t[7]};for(let e=8;e<t.length;e+=2)switch(t[e]){case"raddr":n.relatedAddress=t[e+1];break;case"rport":n.relatedPort=parseInt(t[e+1],10);break;case"tcptype":n.tcpType=t[e+1];break;case"ufrag":n.ufrag=t[e+1],n.usernameFragment=t[e+1];break;default:void 0===n[t[e]]&&(n[t[e]]=t[e+1])}return n},t.writeCandidate=function(e){const t=[];t.push(e.foundation);const n=e.component;"rtp"===n?t.push(1):"rtcp"===n?t.push(2):t.push(n),t.push(e.protocol.toUpperCase()),t.push(e.priority),t.push(e.address||e.ip),t.push(e.port);const i=e.type;return t.push("typ"),t.push(i),"host"!==i&&e.relatedAddress&&e.relatedPort&&(t.push("raddr"),t.push(e.relatedAddress),t.push("rport"),t.push(e.relatedPort)),e.tcpType&&"tcp"===e.protocol.toLowerCase()&&(t.push("tcptype"),t.push(e.tcpType)),(e.usernameFragment||e.ufrag)&&(t.push("ufrag"),t.push(e.usernameFragment||e.ufrag)),"candidate:"+t.join(" ")},t.parseIceOptions=function(e){return e.substring(14).split(" ")},t.parseRtpMap=function(e){let t=e.substring(9).split(" ");const n={payloadType:parseInt(t.shift(),10)};return t=t[0].split("/"),n.name=t[0],n.clockRate=parseInt(t[1],10),n.channels=3===t.length?parseInt(t[2],10):1,n.numChannels=n.channels,n},t.writeRtpMap=function(e){let t=e.payloadType;void 0!==e.preferredPayloadType&&(t=e.preferredPayloadType);const n=e.channels||e.numChannels||1;return"a=rtpmap:"+t+" "+e.name+"/"+e.clockRate+(1!==n?"/"+n:"")+"\r\n"},t.parseExtmap=function(e){const t=e.substring(9).split(" ");return{id:parseInt(t[0],10),direction:t[0].indexOf("/")>0?t[0].split("/")[1]:"sendrecv",uri:t[1],attributes:t.slice(2).join(" ")}},t.writeExtmap=function(e){return"a=extmap:"+(e.id||e.preferredId)+(e.direction&&"sendrecv"!==e.direction?"/"+e.direction:"")+" "+e.uri+(e.attributes?" "+e.attributes:"")+"\r\n"},t.parseFmtp=function(e){const t={};let n;const i=e.substring(e.indexOf(" ")+1).split(";");for(let e=0;e<i.length;e++)n=i[e].trim().split("="),t[n[0].trim()]=n[1];return t},t.writeFmtp=function(e){let t="",n=e.payloadType;if(void 0!==e.preferredPayloadType&&(n=e.preferredPayloadType),e.parameters&&Object.keys(e.parameters).length){const i=[];Object.keys(e.parameters).forEach((t=>{void 0!==e.parameters[t]?i.push(t+"="+e.parameters[t]):i.push(t)})),t+="a=fmtp:"+n+" "+i.join(";")+"\r\n"}return t},t.parseRtcpFb=function(e){const t=e.substring(e.indexOf(" ")+1).split(" ");return{type:t.shift(),parameter:t.join(" ")}},t.writeRtcpFb=function(e){let t="",n=e.payloadType;return void 0!==e.preferredPayloadType&&(n=e.preferredPayloadType),e.rtcpFeedback&&e.rtcpFeedback.length&&e.rtcpFeedback.forEach((e=>{t+="a=rtcp-fb:"+n+" "+e.type+(e.parameter&&e.parameter.length?" "+e.parameter:"")+"\r\n"})),t},t.parseSsrcMedia=function(e){const t=e.indexOf(" "),n={ssrc:parseInt(e.substring(7,t),10)},i=e.indexOf(":",t);return i>-1?(n.attribute=e.substring(t+1,i),n.value=e.substring(i+1)):n.attribute=e.substring(t+1),n},t.parseSsrcGroup=function(e){const t=e.substring(13).split(" ");return{semantics:t.shift(),ssrcs:t.map((e=>parseInt(e,10)))}},t.getMid=function(e){const n=t.matchPrefix(e,"a=mid:")[0];if(n)return n.substring(6)},t.parseFingerprint=function(e){const t=e.substring(14).split(" ");return{algorithm:t[0].toLowerCase(),value:t[1].toUpperCase()}},t.getDtlsParameters=function(e,n){return{role:"auto",fingerprints:t.matchPrefix(e+n,"a=fingerprint:").map(t.parseFingerprint)}},t.writeDtlsParameters=function(e,t){let n="a=setup:"+t+"\r\n";return e.fingerprints.forEach((e=>{n+="a=fingerprint:"+e.algorithm+" "+e.value+"\r\n"})),n},t.parseCryptoLine=function(e){const t=e.substring(9).split(" ");return{tag:parseInt(t[0],10),cryptoSuite:t[1],keyParams:t[2],sessionParams:t.slice(3)}},t.writeCryptoLine=function(e){return"a=crypto:"+e.tag+" "+e.cryptoSuite+" "+("object"==typeof e.keyParams?t.writeCryptoKeyParams(e.keyParams):e.keyParams)+(e.sessionParams?" "+e.sessionParams.join(" "):"")+"\r\n"},t.parseCryptoKeyParams=function(e){if(0!==e.indexOf("inline:"))return null;const t=e.substring(7).split("|");return{keyMethod:"inline",keySalt:t[0],lifeTime:t[1],mkiValue:t[2]?t[2].split(":")[0]:void 0,mkiLength:t[2]?t[2].split(":")[1]:void 0}},t.writeCryptoKeyParams=function(e){return e.keyMethod+":"+e.keySalt+(e.lifeTime?"|"+e.lifeTime:"")+(e.mkiValue&&e.mkiLength?"|"+e.mkiValue+":"+e.mkiLength:"")},t.getCryptoParameters=function(e,n){return t.matchPrefix(e+n,"a=crypto:").map(t.parseCryptoLine)},t.getIceParameters=function(e,n){const i=t.matchPrefix(e+n,"a=ice-ufrag:")[0],s=t.matchPrefix(e+n,"a=ice-pwd:")[0];return i&&s?{usernameFragment:i.substring(12),password:s.substring(10)}:null},t.writeIceParameters=function(e){let t="a=ice-ufrag:"+e.usernameFragment+"\r\na=ice-pwd:"+e.password+"\r\n";return e.iceLite&&(t+="a=ice-lite\r\n"),t},t.parseRtpParameters=function(e){const n={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},i=t.splitLines(e)[0].split(" ");for(let s=3;s<i.length;s++){const r=i[s],a=t.matchPrefix(e,"a=rtpmap:"+r+" ")[0];if(a){const i=t.parseRtpMap(a),s=t.matchPrefix(e,"a=fmtp:"+r+" ");switch(i.parameters=s.length?t.parseFmtp(s[0]):{},i.rtcpFeedback=t.matchPrefix(e,"a=rtcp-fb:"+r+" ").map(t.parseRtcpFb),n.codecs.push(i),i.name.toUpperCase()){case"RED":case"ULPFEC":n.fecMechanisms.push(i.name.toUpperCase())}}}t.matchPrefix(e,"a=extmap:").forEach((e=>{n.headerExtensions.push(t.parseExtmap(e))}));const s=t.matchPrefix(e,"a=rtcp-fb:* ").map(t.parseRtcpFb);return n.codecs.forEach((e=>{s.forEach((t=>{e.rtcpFeedback.find((e=>e.type===t.type&&e.parameter===t.parameter))||e.rtcpFeedback.push(t)}))})),n},t.writeRtpDescription=function(e,n){let i="";i+="m="+e+" ",i+=n.codecs.length>0?"9":"0",i+=" UDP/TLS/RTP/SAVPF ",i+=n.codecs.map((e=>void 0!==e.preferredPayloadType?e.preferredPayloadType:e.payloadType)).join(" ")+"\r\n",i+="c=IN IP4 0.0.0.0\r\n",i+="a=rtcp:9 IN IP4 0.0.0.0\r\n",n.codecs.forEach((e=>{i+=t.writeRtpMap(e),i+=t.writeFmtp(e),i+=t.writeRtcpFb(e)}));let s=0;return n.codecs.forEach((e=>{e.maxptime>s&&(s=e.maxptime)})),s>0&&(i+="a=maxptime:"+s+"\r\n"),n.headerExtensions&&n.headerExtensions.forEach((e=>{i+=t.writeExtmap(e)})),i},t.parseRtpEncodingParameters=function(e){const n=[],i=t.parseRtpParameters(e),s=-1!==i.fecMechanisms.indexOf("RED"),r=-1!==i.fecMechanisms.indexOf("ULPFEC"),a=t.matchPrefix(e,"a=ssrc:").map((e=>t.parseSsrcMedia(e))).filter((e=>"cname"===e.attribute)),o=a.length>0&&a[0].ssrc;let c;const p=t.matchPrefix(e,"a=ssrc-group:FID").map((e=>e.substring(17).split(" ").map((e=>parseInt(e,10)))));p.length>0&&p[0].length>1&&p[0][0]===o&&(c=p[0][1]),i.codecs.forEach((e=>{if("RTX"===e.name.toUpperCase()&&e.parameters.apt){let t={ssrc:o,codecPayloadType:parseInt(e.parameters.apt,10)};o&&c&&(t.rtx={ssrc:c}),n.push(t),s&&(t=JSON.parse(JSON.stringify(t)),t.fec={ssrc:o,mechanism:r?"red+ulpfec":"red"},n.push(t))}})),0===n.length&&o&&n.push({ssrc:o});let d=t.matchPrefix(e,"b=");return d.length&&(d=0===d[0].indexOf("b=TIAS:")?parseInt(d[0].substring(7),10):0===d[0].indexOf("b=AS:")?1e3*parseInt(d[0].substring(5),10)*.95-16e3:void 0,n.forEach((e=>{e.maxBitrate=d}))),n},t.parseRtcpParameters=function(e){const n={},i=t.matchPrefix(e,"a=ssrc:").map((e=>t.parseSsrcMedia(e))).filter((e=>"cname"===e.attribute))[0];i&&(n.cname=i.value,n.ssrc=i.ssrc);const s=t.matchPrefix(e,"a=rtcp-rsize");n.reducedSize=s.length>0,n.compound=0===s.length;const r=t.matchPrefix(e,"a=rtcp-mux");return n.mux=r.length>0,n},t.writeRtcpParameters=function(e){let t="";return e.reducedSize&&(t+="a=rtcp-rsize\r\n"),e.mux&&(t+="a=rtcp-mux\r\n"),void 0!==e.ssrc&&e.cname&&(t+="a=ssrc:"+e.ssrc+" cname:"+e.cname+"\r\n"),t},t.parseMsid=function(e){let n;const i=t.matchPrefix(e,"a=msid:");if(1===i.length)return n=i[0].substring(7).split(" "),{stream:n[0],track:n[1]};const s=t.matchPrefix(e,"a=ssrc:").map((e=>t.parseSsrcMedia(e))).filter((e=>"msid"===e.attribute));return s.length>0?(n=s[0].value.split(" "),{stream:n[0],track:n[1]}):void 0},t.parseSctpDescription=function(e){const n=t.parseMLine(e),i=t.matchPrefix(e,"a=max-message-size:");let s;i.length>0&&(s=parseInt(i[0].substring(19),10)),isNaN(s)&&(s=65536);const r=t.matchPrefix(e,"a=sctp-port:");if(r.length>0)return{port:parseInt(r[0].substring(12),10),protocol:n.fmt,maxMessageSize:s};const a=t.matchPrefix(e,"a=sctpmap:");if(a.length>0){const e=a[0].substring(10).split(" ");return{port:parseInt(e[0],10),protocol:e[1],maxMessageSize:s}}},t.writeSctpDescription=function(e,t){let n=[];return n="DTLS/SCTP"!==e.protocol?["m="+e.kind+" 9 "+e.protocol+" "+t.protocol+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctp-port:"+t.port+"\r\n"]:["m="+e.kind+" 9 "+e.protocol+" "+t.port+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctpmap:"+t.port+" "+t.protocol+" 65535\r\n"],void 0!==t.maxMessageSize&&n.push("a=max-message-size:"+t.maxMessageSize+"\r\n"),n.join("")},t.generateSessionId=function(){return Math.random().toString().substr(2,22)},t.writeSessionBoilerplate=function(e,n,i){let s;const r=void 0!==n?n:2;s=e||t.generateSessionId();return"v=0\r\no="+(i||"thisisadapterortc")+" "+s+" "+r+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},t.getDirection=function(e,n){const i=t.splitLines(e);for(let e=0;e<i.length;e++)switch(i[e]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return i[e].substring(2)}return n?t.getDirection(n):"sendrecv"},t.getKind=function(e){return t.splitLines(e)[0].split(" ")[0].substring(2)},t.isRejected=function(e){return"0"===e.split(" ",2)[1]},t.parseMLine=function(e){const n=t.splitLines(e)[0].substring(2).split(" ");return{kind:n[0],port:parseInt(n[1],10),protocol:n[2],fmt:n.slice(3).join(" ")}},t.parseOLine=function(e){const n=t.matchPrefix(e,"o=")[0].substring(2).split(" ");return{username:n[0],sessionId:n[1],sessionVersion:parseInt(n[2],10),netType:n[3],addressType:n[4],address:n[5]}},t.isValidSDP=function(e){if("string"!=typeof e||0===e.length)return!1;const n=t.splitLines(e);for(let e=0;e<n.length;e++)if(n[e].length<2||"="!==n[e].charAt(1))return!1;return!0},e.exports=t}({get exports(){return Ri},set exports(e){Ri=e}});var Ti=Ri,Pi=g({__proto__:null,default:Ti},[Ri]);function Ei(e){if(!e.RTCIceCandidate||e.RTCIceCandidate&&"foundation"in e.RTCIceCandidate.prototype)return;const t=e.RTCIceCandidate;e.RTCIceCandidate=function(e){if("object"==typeof e&&e.candidate&&0===e.candidate.indexOf("a=")&&((e=JSON.parse(JSON.stringify(e))).candidate=e.candidate.substr(2)),e.candidate&&e.candidate.length){const n=new t(e),i=Ti.parseCandidate(e.candidate),s=Object.assign(n,i);return s.toJSON=function(){return{candidate:s.candidate,sdpMid:s.sdpMid,sdpMLineIndex:s.sdpMLineIndex,usernameFragment:s.usernameFragment}},s}return new t(e)},e.RTCIceCandidate.prototype=t.prototype,Nn(e,"icecandidate",(t=>(t.candidate&&Object.defineProperty(t,"candidate",{value:new e.RTCIceCandidate(t.candidate),writable:"false"}),t)))}function Oi(e){!e.RTCIceCandidate||e.RTCIceCandidate&&"relayProtocol"in e.RTCIceCandidate.prototype||Nn(e,"icecandidate",(e=>{if(e.candidate){const t=Ti.parseCandidate(e.candidate.candidate);"relay"===t.type&&(e.candidate.relayProtocol={0:"tls",1:"tcp",2:"udp"}[t.priority>>24])}return e}))}function Di(e,t){if(!e.RTCPeerConnection)return;"sctp"in e.RTCPeerConnection.prototype||Object.defineProperty(e.RTCPeerConnection.prototype,"sctp",{get(){return void 0===this._sctp?null:this._sctp}});const n=function(e){if(!e||!e.sdp)return!1;const t=Ti.splitSections(e.sdp);return t.shift(),t.some((e=>{const t=Ti.parseMLine(e);return t&&"application"===t.kind&&-1!==t.protocol.indexOf("SCTP")}))},i=function(e){const t=e.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(null===t||t.length<2)return-1;const n=parseInt(t[1],10);return n!=n?-1:n},s=function(e){let n=65536;return"firefox"===t.browser&&(n=t.version<57?-1===e?16384:2147483637:t.version<60?57===t.version?65535:65536:2147483637),n},r=function(e,n){let i=65536;"firefox"===t.browser&&57===t.version&&(i=65535);const s=Ti.matchPrefix(e.sdp,"a=max-message-size:");return s.length>0?i=parseInt(s[0].substr(19),10):"firefox"===t.browser&&-1!==n&&(i=2147483637),i},a=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,"chrome"===t.browser&&t.version>=76){const{sdpSemantics:e}=this.getConfiguration();"plan-b"===e&&Object.defineProperty(this,"sctp",{get(){return void 0===this._sctp?null:this._sctp},enumerable:!0,configurable:!0})}if(n(arguments[0])){const e=i(arguments[0]),t=s(e),n=r(arguments[0],e);let a;a=0===t&&0===n?Number.POSITIVE_INFINITY:0===t||0===n?Math.max(t,n):Math.min(t,n);const o={};Object.defineProperty(o,"maxMessageSize",{get:()=>a}),this._sctp=o}return a.apply(this,arguments)}}function ji(e){if(!e.RTCPeerConnection||!("createDataChannel"in e.RTCPeerConnection.prototype))return;function t(e,t){const n=e.send;e.send=function(){const i=arguments[0],s=i.length||i.size||i.byteLength;if("open"===e.readyState&&t.sctp&&s>t.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+t.sctp.maxMessageSize+" bytes)");return n.apply(e,arguments)}}const n=e.RTCPeerConnection.prototype.createDataChannel;e.RTCPeerConnection.prototype.createDataChannel=function(){const e=n.apply(this,arguments);return t(e,this),e},Nn(e,"datachannel",(e=>(t(e.channel,e.target),e)))}function Ii(e){if(!e.RTCPeerConnection||"connectionState"in e.RTCPeerConnection.prototype)return;const t=e.RTCPeerConnection.prototype;Object.defineProperty(t,"connectionState",{get(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(t,"onconnectionstatechange",{get(){return this._onconnectionstatechange||null},set(e){this._onconnectionstatechange&&(this.removeEventListener("connectionstatechange",this._onconnectionstatechange),delete this._onconnectionstatechange),e&&this.addEventListener("connectionstatechange",this._onconnectionstatechange=e)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach((e=>{const n=t[e];t[e]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=e=>{const t=e.target;if(t._lastConnectionState!==t.connectionState){t._lastConnectionState=t.connectionState;const n=new Event("connectionstatechange",e);t.dispatchEvent(n)}return e},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),n.apply(this,arguments)}}))}function Mi(e,t){if(!e.RTCPeerConnection)return;if("chrome"===t.browser&&t.version>=71)return;if("safari"===t.browser&&t.version>=605)return;const n=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(t){if(t&&t.sdp&&-1!==t.sdp.indexOf("\na=extmap-allow-mixed")){const n=t.sdp.split("\n").filter((e=>"a=extmap-allow-mixed"!==e.trim())).join("\n");e.RTCSessionDescription&&t instanceof e.RTCSessionDescription?arguments[0]=new e.RTCSessionDescription({type:t.type,sdp:n}):t.sdp=n}return n.apply(this,arguments)}}function Li(e,t){if(!e.RTCPeerConnection||!e.RTCPeerConnection.prototype)return;const n=e.RTCPeerConnection.prototype.addIceCandidate;n&&0!==n.length&&(e.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?("chrome"===t.browser&&t.version<78||"firefox"===t.browser&&t.version<68||"safari"===t.browser)&&arguments[0]&&""===arguments[0].candidate?Promise.resolve():n.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())})}function Ai(e,t){if(!e.RTCPeerConnection||!e.RTCPeerConnection.prototype)return;const n=e.RTCPeerConnection.prototype.setLocalDescription;n&&0!==n.length&&(e.RTCPeerConnection.prototype.setLocalDescription=function(){let e=arguments[0]||{};if("object"!=typeof e||e.type&&e.sdp)return n.apply(this,arguments);if(e={type:e.type,sdp:e.sdp},!e.type)switch(this.signalingState){case"stable":case"have-local-offer":case"have-remote-pranswer":e.type="offer";break;default:e.type="answer"}if(e.sdp||"offer"!==e.type&&"answer"!==e.type)return n.apply(this,[e]);const t="offer"===e.type?this.createOffer:this.createAnswer;return t.apply(this).then((e=>n.apply(this,[e])))})}var Ni=Object.freeze({__proto__:null,shimRTCIceCandidate:Ei,shimRTCIceCandidateRelayProtocol:Oi,shimMaxMessageSize:Di,shimSendThrowTypeError:ji,shimConnectionState:Ii,removeExtmapAllowMixed:Mi,shimAddIceCandidateNullOrEmpty:Li,shimParameterlessSetLocalDescription:Ai});const Bi=function({window:e}={},t={shimChrome:!0,shimFirefox:!0,shimSafari:!0}){const n=Un,i=function(e){const t={browser:null,version:null};if(void 0===e||!e.navigator)return t.browser="Not a browser.",t;const{navigator:n}=e;if(n.mozGetUserMedia)t.browser="firefox",t.version=An(n.userAgent,/Firefox\/(\d+)\./,1);else if(n.webkitGetUserMedia||!1===e.isSecureContext&&e.webkitRTCPeerConnection)t.browser="chrome",t.version=An(n.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else{if(!e.RTCPeerConnection||!n.userAgent.match(/AppleWebKit\/(\d+)\./))return t.browser="Not a supported browser.",t;t.browser="safari",t.version=An(n.userAgent,/AppleWebKit\/(\d+)\./,1),t.supportsUnifiedPlan=e.RTCRtpTransceiver&&"currentDirection"in e.RTCRtpTransceiver.prototype}return t}(e),s={browserDetails:i,commonShim:Ni,extractVersion:An,disableLog:Bn,disableWarnings:Fn,sdp:Pi};switch(i.browser){case"chrome":if(!ii||!ti||!t.shimChrome)return n("Chrome shim is not included in this adapter release."),s;if(null===i.version)return n("Chrome shim can not determine version, not shimming."),s;n("adapter.js shimming chrome."),s.browserShim=ii,Li(e,i),Ai(e),Gn(e,i),Kn(e),ti(e,i),Jn(e),ei(e,i),Qn(e),Yn(e),Xn(e),ni(e,i),Ei(e),Oi(e),Ii(e),Di(e,i),ji(e),Mi(e,i);break;case"firefox":if(!fi||!ai||!t.shimFirefox)return n("Firefox shim is not included in this adapter release."),s;n("adapter.js shimming firefox."),s.browserShim=fi,Li(e,i),Ai(e),si(e,i),ai(e,i),ri(e),pi(e),oi(e),ci(e),di(e),li(e),ui(e),mi(e),hi(e),Ei(e),Ii(e),Di(e,i),ji(e);break;case"safari":if(!Ci||!t.shimSafari)return n("Safari shim is not included in this adapter release."),s;n("adapter.js shimming safari."),s.browserShim=Ci,Li(e,i),Ai(e),xi(e),Si(e),bi(e),gi(e),vi(e),wi(e),yi(e),ki(e),Ei(e),Oi(e),Di(e,i),ji(e),Mi(e,i);break;default:n("Unsupported browser!")}return s}({window:"undefined"==typeof window?void 0:window});var Fi,Ui,zi,qi,$i={},Vi={get exports(){return $i},set exports(e){$i=e}},Hi=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Wi=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],Gi=function(e){var t=e,n=e.indexOf("["),i=e.indexOf("]");-1!=n&&-1!=i&&(e=e.substring(0,n)+e.substring(n,i).replace(/:/g,";")+e.substring(i,e.length));for(var s=Hi.exec(e||""),r={},a=14;a--;)r[Wi[a]]=s[a]||"";return-1!=n&&-1!=i&&(r.source=t,r.host=r.host.substring(1,r.host.length-1).replace(/;/g,":"),r.authority=r.authority.replace("[","").replace("]","").replace(/;/g,":"),r.ipv6uri=!0),r},Ki={},Ji={},Qi={get exports(){return Ji},set exports(e){Ji=e}},Yi={},Xi={get exports(){return Yi},set exports(e){Yi=e}};function Zi(){if(Ui)return Fi;Ui=1;var e=1e3,t=60*e,n=60*t,i=24*n,s=365.25*i;function r(e,t,n){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+n:Math.ceil(e/t)+" "+n+"s"}return Fi=function(a,o){o=o||{};var c=typeof a;if("string"===c&&a.length>0)return function(r){if((r=String(r)).length>1e4)return;var a=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(r);if(!a)return;var o=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return o*s;case"days":case"day":case"d":return o*i;case"hours":case"hour":case"hrs":case"hr":case"h":return o*n;case"minutes":case"minute":case"mins":case"min":case"m":return o*t;case"seconds":case"second":case"secs":case"sec":case"s":return o*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return o;default:return}}(a);if("number"===c&&!1===isNaN(a))return o.long?function(s){return r(s,i,"day")||r(s,n,"hour")||r(s,t,"minute")||r(s,e,"second")||s+" ms"}(a):function(s){if(s>=i)return Math.round(s/i)+"d";if(s>=n)return Math.round(s/n)+"h";if(s>=t)return Math.round(s/t)+"m";if(s>=e)return Math.round(s/e)+"s";return s+"ms"}(a);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(a))},Fi}function es(){return zi||(zi=1,function(e,t){(t=Xi.exports=r.debug=r).coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){t.enable("")},t.enable=function(e){t.save(e);for(var n=(e||"").split(/[\s,]+/),i=n.length,s=0;s<i;s++)n[s]&&("-"===(e=n[s].replace(/[\\^$+?.()|[\]{}]/g,"\\$&").replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){var n,i;for(n=0,i=t.skips.length;n<i;n++)if(t.skips[n].test(e))return!1;for(n=0,i=t.names.length;n<i;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=Zi(),t.names=[],t.skips=[],t.formatters={};var n,i=0;function s(){return t.colors[i++%t.colors.length]}function r(e){function i(){}function r(){var e=r,i=+new Date,a=i-(n||i);e.diff=a,e.prev=n,e.curr=i,n=i,null==e.useColors&&(e.useColors=t.useColors()),null==e.color&&e.useColors&&(e.color=s());for(var o=new Array(arguments.length),c=0;c<o.length;c++)o[c]=arguments[c];o[0]=t.coerce(o[0]),"string"!=typeof o[0]&&(o=["%o"].concat(o));var p=0;o[0]=o[0].replace(/%([a-z%])/g,(function(n,i){if("%%"===n)return n;p++;var s=t.formatters[i];if("function"==typeof s){var r=o[p];n=s.call(e,r),o.splice(p,1),p--}return n})),o=t.formatArgs.apply(e,o);var d=r.log||t.log||console.log.bind(console);d.apply(e,o)}i.enabled=!1,r.enabled=!0;var a=t.enabled(e)?r:i;return a.namespace=e,a}}(0,Yi)),Yi}var ts,ns={},is={get exports(){return ns},set exports(e){ns=e}};!function(s){"undefined"!=typeof process&&"renderer"===process.type?s.exports=(qi||(qi=1,function(e,t){function n(){try{return t.storage.debug}catch(e){}if("undefined"!=typeof process&&"env"in process)return process.env.DEBUG}(t=Qi.exports=es()).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},t.formatArgs=function(){var e=arguments,n=this.useColors;if(e[0]=(n?"%c":"")+this.namespace+(n?" %c":" ")+e[0]+(n?"%c ":" ")+"+"+t.humanize(this.diff),!n)return e;var i="color: "+this.color;e=[e[0],i,"color: inherit"].concat(Array.prototype.slice.call(e,1));var s=0,r=0;return e[0].replace(/%[a-z%]/g,(function(e){"%%"!==e&&(s++,"%c"===e&&(r=s))})),e.splice(r,0,i),e},t.save=function(e){try{null==e?t.storage.removeItem("debug"):t.storage.debug=e}catch(e){}},t.load=n,t.useColors=function(){return"undefined"!=typeof document&&"WebkitAppearance"in document.documentElement.style||window.console&&(console.firebug||console.exception&&console.table)||navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31},t.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},t.enable(n())}(0,Ji)),Ji):s.exports=(ts||(ts=1,function(s,r){var a=e,o=t;(r=is.exports=es()).log=function(){return p.write(o.format.apply(this,arguments)+"\n")},r.formatArgs=function(){for(var e=arguments.length,t=new Array(e),n=this.useColors,i=this.namespace,s=0;s<e;s++)t[s]=arguments[s];if(n){var a=this.color;t[0]=" [3"+a+";1m"+i+" "+t[0],t.push("[3"+a+"m+"+r.humanize(this.diff)+"")}else t[0]=(new Date).toUTCString()+" "+i+" "+t[0];return t},r.save=function(e){null==e?delete process.env.DEBUG:process.env.DEBUG=e},r.load=l,r.useColors=function(){var e=(process.env.DEBUG_COLORS||"").trim().toLowerCase();return 0===e.length?a.isatty(c):"0"!==e&&"no"!==e&&"false"!==e&&"disabled"!==e},r.colors=[6,2,3,4,5,1];var c=parseInt(process.env.DEBUG_FD,10)||2,p=1===c?process.stdout:2===c?process.stderr:function(e){var t;switch(process.binding("tty_wrap").guessHandleType(e)){case"TTY":(t=new a.WriteStream(e))._type="tty",t._handle&&t._handle.unref&&t._handle.unref();break;case"FILE":(t=new n.SyncWriteStream(e,{autoClose:!1}))._type="fs";break;case"PIPE":case"TCP":(t=new i.Socket({fd:e,readable:!1,writable:!0})).readable=!1,t.read=null,t._type="pipe",t._handle&&t._handle.unref&&t._handle.unref();break;default:throw new Error("Implement me. Unknown stream file type!")}return t.fd=e,t._isStdio=!0,t}(c),d=4===o.inspect.length?function(e,t){return o.inspect(e,void 0,void 0,t)}:function(e,t){return o.inspect(e,{colors:t})};function l(){return process.env.DEBUG}r.formatters.o=r.formatters.O=function(e){return d(e,this.useColors).replace(/\s*\n\s*/g," ")},r.enable(l())}(0,ns)),ns)}({get exports(){return Ki},set exports(e){Ki=e}});var ss=Gi,rs=Ki("socket.io-client:url"),as=function(e,t){var n=e;t=t||Xt.location,null==e&&(e=t.protocol+"//"+t.host);"string"==typeof e&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?t.protocol+e:t.host+e),/^(https?|wss?):\/\//.test(e)||(rs("protocol-less url %s",e),e=void 0!==t?t.protocol+"//"+e:"https://"+e),rs("parse %s",e),n=ss(e));n.port||(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443"));n.path=n.path||"/";var i=-1!==n.host.indexOf(":")?"["+n.host+"]":n.host;return n.id=n.protocol+"://"+i+":"+n.port,n.href=n.protocol+"://"+i+(t&&t.port===n.port?"":":"+n.port),n};var os={},cs={},ps={get exports(){return cs},set exports(e){cs=e}},ds={},ls={get exports(){return ds},set exports(e){ds=e}},us=1e3,ms=60*us,hs=60*ms,fs=24*hs,gs=365.25*fs,vs=function(e,t){return t=t||{},"string"==typeof e?function(e){if((e=""+e).length>1e4)return;var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!t)return;var n=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return n*gs;case"days":case"day":case"d":return n*fs;case"hours":case"hour":case"hrs":case"hr":case"h":return n*hs;case"minutes":case"minute":case"mins":case"min":case"m":return n*ms;case"seconds":case"second":case"secs":case"sec":case"s":return n*us;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n}}(e):t.long?function(e){return bs(e,fs,"day")||bs(e,hs,"hour")||bs(e,ms,"minute")||bs(e,us,"second")||e+" ms"}(e):function(e){return e>=fs?Math.round(e/fs)+"d":e>=hs?Math.round(e/hs)+"h":e>=ms?Math.round(e/ms)+"m":e>=us?Math.round(e/us)+"s":e+"ms"}(e)};function bs(e,t,n){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+n:Math.ceil(e/t)+" "+n+"s"}!function(e,t){t=ls.exports=function(e){function i(){}function r(){var e=r,i=+new Date,a=i-(n||i);e.diff=a,e.prev=n,e.curr=i,n=i,null==e.useColors&&(e.useColors=t.useColors()),null==e.color&&e.useColors&&(e.color=s());var o=Array.prototype.slice.call(arguments);o[0]=t.coerce(o[0]),"string"!=typeof o[0]&&(o=["%o"].concat(o));var c=0;o[0]=o[0].replace(/%([a-z%])/g,(function(n,i){if("%%"===n)return n;c++;var s=t.formatters[i];if("function"==typeof s){var r=o[c];n=s.call(e,r),o.splice(c,1),c--}return n})),"function"==typeof t.formatArgs&&(o=t.formatArgs.apply(e,o));var p=r.log||t.log||console.log.bind(console);p.apply(e,o)}i.enabled=!1,r.enabled=!0;var a=t.enabled(e)?r:i;return a.namespace=e,a},t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){t.enable("")},t.enable=function(e){t.save(e);for(var n=(e||"").split(/[\s,]+/),i=n.length,s=0;s<i;s++)n[s]&&("-"===(e=n[s].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){var n,i;for(n=0,i=t.skips.length;n<i;n++)if(t.skips[n].test(e))return!1;for(n=0,i=t.names.length;n<i;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=vs,t.names=[],t.skips=[],t.formatters={};var n,i=0;function s(){return t.colors[i++%t.colors.length]}}(0,ds),function(s,r){var a=e,o=t;(r=ps.exports=ds).log=function(){return p.write(o.format.apply(this,arguments)+"\n")},r.formatArgs=function(){var e=arguments,t=this.useColors,n=this.namespace;if(t){var i=this.color;e[0]=" [3"+i+";1m"+n+" "+e[0]+"[3"+i+"m +"+r.humanize(this.diff)+""}else e[0]=(new Date).toUTCString()+" "+n+" "+e[0];return e},r.save=function(e){null==e?delete process.env.DEBUG:process.env.DEBUG=e},r.load=l,r.useColors=function(){var e=(process.env.DEBUG_COLORS||"").trim().toLowerCase();return 0===e.length?a.isatty(c):"0"!==e&&"no"!==e&&"false"!==e&&"disabled"!==e},r.colors=[6,2,3,4,5,1];var c=parseInt(process.env.DEBUG_FD,10)||2,p=1===c?process.stdout:2===c?process.stderr:function(e){var t;switch(process.binding("tty_wrap").guessHandleType(e)){case"TTY":(t=new a.WriteStream(e))._type="tty",t._handle&&t._handle.unref&&t._handle.unref();break;case"FILE":(t=new n.SyncWriteStream(e,{autoClose:!1}))._type="fs";break;case"PIPE":case"TCP":(t=new i.Socket({fd:e,readable:!1,writable:!0})).readable=!1,t.read=null,t._type="pipe",t._handle&&t._handle.unref&&t._handle.unref();break;default:throw new Error("Implement me. Unknown stream file type!")}return t.fd=e,t._isStdio=!0,t}(c);var d=4===o.inspect.length?function(e,t){return o.inspect(e,void 0,void 0,t)}:function(e,t){return o.inspect(e,{colors:t})};function l(){return process.env.DEBUG}r.formatters.o=function(e){return d(e,this.useColors).replace(/\s*\n\s*/g," ")},r.enable(l())}(0,cs);var ys={};
15
+ `}},("string"==typeof Qt?Gt(Qt,Yt,""):Gt(Qt.name,Qt,"")).Class;var Zt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function en(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function tn(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){if(this instanceof e){var n=[null];n.push.apply(n,arguments);var i=Function.bind.apply(t,n);return new i}return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var i=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,i.get?i:{enumerable:!0,get:function(){return e[t]}})})),n}var nn,sn={},rn={};function an(){if(nn)return rn;nn=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),r=Symbol.for("react.provider"),a=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),l=Symbol.iterator;var u={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},m=Object.assign,h={};function f(e,t,n){this.props=e,this.context=t,this.refs=h,this.updater=n||u}function g(){}function v(e,t,n){this.props=e,this.context=t,this.refs=h,this.updater=n||u}f.prototype.isReactComponent={},f.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},f.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},g.prototype=f.prototype;var b=v.prototype=new g;b.constructor=v,m(b,f.prototype),b.isPureReactComponent=!0;var y=Array.isArray,_=Object.prototype.hasOwnProperty,x={current:null},w={key:!0,ref:!0,__self:!0,__source:!0};function S(t,n,i){var s,r={},a=null,o=null;if(null!=n)for(s in void 0!==n.ref&&(o=n.ref),void 0!==n.key&&(a=""+n.key),n)_.call(n,s)&&!w.hasOwnProperty(s)&&(r[s]=n[s]);var c=arguments.length-2;if(1===c)r.children=i;else if(1<c){for(var p=Array(c),d=0;d<c;d++)p[d]=arguments[d+2];r.children=p}if(t&&t.defaultProps)for(s in c=t.defaultProps)void 0===r[s]&&(r[s]=c[s]);return{$$typeof:e,type:t,key:a,ref:o,props:r,_owner:x.current}}function k(t){return"object"==typeof t&&null!==t&&t.$$typeof===e}var C=/\/+/g;function R(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 T(n,i,s,r,a){var o=typeof n;"undefined"!==o&&"boolean"!==o||(n=null);var c=!1;if(null===n)c=!0;else switch(o){case"string":case"number":c=!0;break;case"object":switch(n.$$typeof){case e:case t:c=!0}}if(c)return a=a(c=n),n=""===r?"."+R(c,0):r,y(a)?(s="",null!=n&&(s=n.replace(C,"$&/")+"/"),T(a,i,s,"",(function(e){return e}))):null!=a&&(k(a)&&(a=function(t,n){return{$$typeof:e,type:t.type,key:n,ref:t.ref,props:t.props,_owner:t._owner}}(a,s+(!a.key||c&&c.key===a.key?"":(""+a.key).replace(C,"$&/")+"/")+n)),i.push(a)),1;if(c=0,r=""===r?".":r+":",y(n))for(var p=0;p<n.length;p++){var d=r+R(o=n[p],p);c+=T(o,i,s,d,a)}else if(d=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=l&&e[l]||e["@@iterator"])?e:null}(n),"function"==typeof d)for(n=d.call(n),p=0;!(o=n.next()).done;)c+=T(o=o.value,i,s,d=r+R(o,p++),a);else if("object"===o)throw i=String(n),Error("Objects are not valid as a React child (found: "+("[object Object]"===i?"object with keys {"+Object.keys(n).join(", ")+"}":i)+"). If you meant to render a collection of children, use an array instead.");return c}function P(e,t,n){if(null==e)return e;var i=[],s=0;return T(e,i,"","",(function(e){return t.call(n,e,s++)})),i}function E(e){if(-1===e._status){var t=e._result;(t=t()).then((function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)}),(function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)})),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var O={current:null},D={transition:null},j={ReactCurrentDispatcher:O,ReactCurrentBatchConfig:D,ReactCurrentOwner:x};return rn.Children={map:P,forEach:function(e,t,n){P(e,(function(){t.apply(this,arguments)}),n)},count:function(e){var t=0;return P(e,(function(){t++})),t},toArray:function(e){return P(e,(function(e){return e}))||[]},only:function(e){if(!k(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},rn.Component=f,rn.Fragment=n,rn.Profiler=s,rn.PureComponent=v,rn.StrictMode=i,rn.Suspense=c,rn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=j,rn.cloneElement=function(t,n,i){if(null==t)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var s=m({},t.props),r=t.key,a=t.ref,o=t._owner;if(null!=n){if(void 0!==n.ref&&(a=n.ref,o=x.current),void 0!==n.key&&(r=""+n.key),t.type&&t.type.defaultProps)var c=t.type.defaultProps;for(p in n)_.call(n,p)&&!w.hasOwnProperty(p)&&(s[p]=void 0===n[p]&&void 0!==c?c[p]:n[p])}var p=arguments.length-2;if(1===p)s.children=i;else if(1<p){c=Array(p);for(var d=0;d<p;d++)c[d]=arguments[d+2];s.children=c}return{$$typeof:e,type:t.type,key:r,ref:a,props:s,_owner:o}},rn.createContext=function(e){return(e={$$typeof:a,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:r,_context:e},e.Consumer=e},rn.createElement=S,rn.createFactory=function(e){var t=S.bind(null,e);return t.type=e,t},rn.createRef=function(){return{current:null}},rn.forwardRef=function(e){return{$$typeof:o,render:e}},rn.isValidElement=k,rn.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:E}},rn.memo=function(e,t){return{$$typeof:p,type:e,compare:void 0===t?null:t}},rn.startTransition=function(e){var t=D.transition;D.transition={};try{e()}finally{D.transition=t}},rn.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")},rn.useCallback=function(e,t){return O.current.useCallback(e,t)},rn.useContext=function(e){return O.current.useContext(e)},rn.useDebugValue=function(){},rn.useDeferredValue=function(e){return O.current.useDeferredValue(e)},rn.useEffect=function(e,t){return O.current.useEffect(e,t)},rn.useId=function(){return O.current.useId()},rn.useImperativeHandle=function(e,t,n){return O.current.useImperativeHandle(e,t,n)},rn.useInsertionEffect=function(e,t){return O.current.useInsertionEffect(e,t)},rn.useLayoutEffect=function(e,t){return O.current.useLayoutEffect(e,t)},rn.useMemo=function(e,t){return O.current.useMemo(e,t)},rn.useReducer=function(e,t,n){return O.current.useReducer(e,t,n)},rn.useRef=function(e){return O.current.useRef(e)},rn.useState=function(e){return O.current.useState(e)},rn.useSyncExternalStore=function(e,t,n){return O.current.useSyncExternalStore(e,t,n)},rn.useTransition=function(){return O.current.useTransition()},rn.version="18.2.0",rn}var on,cn,pn={},dn={get exports(){return pn},set exports(e){pn=e}};function ln(){return on||(on=1,e=dn,t=pn,"production"!==process.env.NODE_ENV&&function(){"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var n=Symbol.for("react.element"),i=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),c=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),l=Symbol.for("react.suspense_list"),u=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),h=Symbol.for("react.offscreen"),f=Symbol.iterator;function g(e){if(null===e||"object"!=typeof e)return null;var t=f&&e[f]||e["@@iterator"];return"function"==typeof t?t:null}var v={current:null},b={transition:null},y={current:null,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1},_={current:null},x={},w=null;function S(e){w=e}x.setExtraStackFrame=function(e){w=e},x.getCurrentStack=null,x.getStackAddendum=function(){var e="";w&&(e+=w);var t=x.getCurrentStack;return t&&(e+=t()||""),e};var k={ReactCurrentDispatcher:v,ReactCurrentBatchConfig:b,ReactCurrentOwner:_};function C(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];T("warn",e,n)}function R(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];T("error",e,n)}function T(e,t,n){var i=k.ReactDebugCurrentFrame.getStackAddendum();""!==i&&(t+="%s",n=n.concat([i]));var s=n.map((function(e){return String(e)}));s.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,s)}k.ReactDebugCurrentFrame=x,k.ReactCurrentActQueue=y;var P={};function E(e,t){var n=e.constructor,i=n&&(n.displayName||n.name)||"ReactClass",s=i+"."+t;P[s]||(R("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",t,i),P[s]=!0)}var O={isMounted:function(e){return!1},enqueueForceUpdate:function(e,t,n){E(e,"forceUpdate")},enqueueReplaceState:function(e,t,n,i){E(e,"replaceState")},enqueueSetState:function(e,t,n,i){E(e,"setState")}},D=Object.assign,j={};function I(e,t,n){this.props=e,this.context=t,this.refs=j,this.updater=n||O}Object.freeze(j),I.prototype.isReactComponent={},I.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw new Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},I.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};var M={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]},L=function(e,t){Object.defineProperty(I.prototype,e,{get:function(){C("%s(...) is deprecated in plain JavaScript React classes. %s",t[0],t[1])}})};for(var A in M)M.hasOwnProperty(A)&&L(A,M[A]);function N(){}function B(e,t,n){this.props=e,this.context=t,this.refs=j,this.updater=n||O}N.prototype=I.prototype;var F=B.prototype=new N;F.constructor=B,D(F,I.prototype),F.isPureReactComponent=!0;var U=Array.isArray;function z(e){return U(e)}function q(e){return""+e}function $(e){if(function(e){try{return q(e),!1}catch(e){return!0}}(e))return R("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",function(e){return"function"==typeof Symbol&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object"}(e)),q(e)}function V(e){return e.displayName||"Context"}function H(e){if(null==e)return null;if("number"==typeof e.tag&&R("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),"function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case s:return"Fragment";case i:return"Portal";case a:return"Profiler";case r:return"StrictMode";case d:return"Suspense";case l:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case c:return V(e)+".Consumer";case o:return V(e._context)+".Provider";case p:return function(e,t,n){var i=e.displayName;if(i)return i;var s=t.displayName||t.name||"";return""!==s?n+"("+s+")":n}(e,e.render,"ForwardRef");case u:var t=e.displayName||null;return null!==t?t:H(e.type)||"Memo";case m:var n=e,h=n._payload,f=n._init;try{return H(f(h))}catch(e){return null}}return null}var W,G,K,J=Object.prototype.hasOwnProperty,Q={key:!0,ref:!0,__self:!0,__source:!0};function Y(e){if(J.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return void 0!==e.ref}function X(e){if(J.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return void 0!==e.key}function Z(e,t){var n=function(){W||(W=!0,R("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}function ee(e,t){var n=function(){G||(G=!0,R("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};n.isReactWarning=!0,Object.defineProperty(e,"ref",{get:n,configurable:!0})}function te(e){if("string"==typeof e.ref&&_.current&&e.__self&&_.current.stateNode!==e.__self){var t=H(_.current.type);K[t]||(R('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',t,e.ref),K[t]=!0)}}K={};var ne=function(e,t,i,s,r,a,o){var c={$$typeof:n,type:e,key:t,ref:i,props:o,_owner:a,_store:{}};return Object.defineProperty(c._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(c,"_self",{configurable:!1,enumerable:!1,writable:!1,value:s}),Object.defineProperty(c,"_source",{configurable:!1,enumerable:!1,writable:!1,value:r}),Object.freeze&&(Object.freeze(c.props),Object.freeze(c)),c};function ie(e,t,n){var i,s={},r=null,a=null,o=null,c=null;if(null!=t)for(i in Y(t)&&(a=t.ref,te(t)),X(t)&&($(t.key),r=""+t.key),o=void 0===t.__self?null:t.__self,c=void 0===t.__source?null:t.__source,t)J.call(t,i)&&!Q.hasOwnProperty(i)&&(s[i]=t[i]);var p=arguments.length-2;if(1===p)s.children=n;else if(p>1){for(var d=Array(p),l=0;l<p;l++)d[l]=arguments[l+2];Object.freeze&&Object.freeze(d),s.children=d}if(e&&e.defaultProps){var u=e.defaultProps;for(i in u)void 0===s[i]&&(s[i]=u[i])}if(r||a){var m="function"==typeof e?e.displayName||e.name||"Unknown":e;r&&Z(s,m),a&&ee(s,m)}return ne(e,r,a,o,c,_.current,s)}function se(e,t,n){if(null==e)throw new Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var i,s,r=D({},e.props),a=e.key,o=e.ref,c=e._self,p=e._source,d=e._owner;if(null!=t)for(i in Y(t)&&(o=t.ref,d=_.current),X(t)&&($(t.key),a=""+t.key),e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)J.call(t,i)&&!Q.hasOwnProperty(i)&&(void 0===t[i]&&void 0!==s?r[i]=s[i]:r[i]=t[i]);var l=arguments.length-2;if(1===l)r.children=n;else if(l>1){for(var u=Array(l),m=0;m<l;m++)u[m]=arguments[m+2];r.children=u}return ne(e.type,a,o,c,p,d,r)}function re(e){return"object"==typeof e&&null!==e&&e.$$typeof===n}var ae,oe=!1,ce=/\/+/g;function pe(e){return e.replace(ce,"$&/")}function de(e,t){return"object"==typeof e&&null!==e&&null!=e.key?($(e.key),n=""+e.key,i={"=":"=0",":":"=2"},"$"+n.replace(/[=:]/g,(function(e){return i[e]}))):t.toString(36);var n,i}function le(e,t,s,r,a){var o=typeof e;"undefined"!==o&&"boolean"!==o||(e=null);var c,p,d,l=!1;if(null===e)l=!0;else switch(o){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case n:case i:l=!0}}if(l){var u=e,m=a(u),h=""===r?"."+de(u,0):r;if(z(m)){var f="";null!=h&&(f=pe(h)+"/"),le(m,t,f,"",(function(e){return e}))}else null!=m&&(re(m)&&(!m.key||u&&u.key===m.key||$(m.key),c=m,p=s+(!m.key||u&&u.key===m.key?"":pe(""+m.key)+"/")+h,m=ne(c.type,p,c.ref,c._self,c._source,c._owner,c.props)),t.push(m));return 1}var v=0,b=""===r?".":r+":";if(z(e))for(var y=0;y<e.length;y++)v+=le(d=e[y],t,s,b+de(d,y),a);else{var _=g(e);if("function"==typeof _){var x=e;_===x.entries&&(oe||C("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),oe=!0);for(var w,S=_.call(x),k=0;!(w=S.next()).done;)v+=le(d=w.value,t,s,b+de(d,k++),a)}else if("object"===o){var R=String(e);throw new Error("Objects are not valid as a React child (found: "+("[object Object]"===R?"object with keys {"+Object.keys(e).join(", ")+"}":R)+"). If you meant to render a collection of children, use an array instead.")}}return v}function ue(e,t,n){if(null==e)return e;var i=[],s=0;return le(e,i,"","",(function(e){return t.call(n,e,s++)})),i}function me(e){if(-1===e._status){var t=(0,e._result)();if(t.then((function(t){if(0===e._status||-1===e._status){var n=e;n._status=1,n._result=t}}),(function(t){if(0===e._status||-1===e._status){var n=e;n._status=2,n._result=t}})),-1===e._status){var n=e;n._status=0,n._result=t}}if(1===e._status){var i=e._result;return void 0===i&&R("lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))\n\nDid you accidentally put curly braces around the import?",i),"default"in i||R("lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))",i),i.default}throw e._result}function he(e){return"string"==typeof e||"function"==typeof e||e===s||e===a||e===r||e===d||e===l||e===h||"object"==typeof e&&null!==e&&(e.$$typeof===m||e.$$typeof===u||e.$$typeof===o||e.$$typeof===c||e.$$typeof===p||e.$$typeof===ae||void 0!==e.getModuleId)}function fe(){var e=v.current;return null===e&&R("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem."),e}ae=Symbol.for("react.module.reference");var ge,ve,be,ye,_e,xe,we,Se=0;function ke(){}ke.__reactDisabledLog=!0;var Ce,Re=k.ReactCurrentDispatcher;function Te(e,t,n){if(void 0===Ce)try{throw Error()}catch(e){var i=e.stack.trim().match(/\n( *(at )?)/);Ce=i&&i[1]||""}return"\n"+Ce+e}var Pe,Ee=!1,Oe="function"==typeof WeakMap?WeakMap:Map;function De(e,t){if(!e||Ee)return"";var n,i=Pe.get(e);if(void 0!==i)return i;Ee=!0;var s,r=Error.prepareStackTrace;Error.prepareStackTrace=void 0,s=Re.current,Re.current=null,function(){if(0===Se){ge=console.log,ve=console.info,be=console.warn,ye=console.error,_e=console.group,xe=console.groupCollapsed,we=console.groupEnd;var e={configurable:!0,enumerable:!0,value:ke,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}Se++}();try{if(t){var a=function(){throw Error()};if(Object.defineProperty(a.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(a,[])}catch(e){n=e}Reflect.construct(e,[],a)}else{try{a.call()}catch(e){n=e}e.call(a.prototype)}}else{try{throw Error()}catch(e){n=e}e()}}catch(t){if(t&&n&&"string"==typeof t.stack){for(var o=t.stack.split("\n"),c=n.stack.split("\n"),p=o.length-1,d=c.length-1;p>=1&&d>=0&&o[p]!==c[d];)d--;for(;p>=1&&d>=0;p--,d--)if(o[p]!==c[d]){if(1!==p||1!==d)do{if(p--,--d<0||o[p]!==c[d]){var l="\n"+o[p].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),"function"==typeof e&&Pe.set(e,l),l}}while(p>=1&&d>=0);break}}}finally{Ee=!1,Re.current=s,function(){if(0==--Se){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:D({},e,{value:ge}),info:D({},e,{value:ve}),warn:D({},e,{value:be}),error:D({},e,{value:ye}),group:D({},e,{value:_e}),groupCollapsed:D({},e,{value:xe}),groupEnd:D({},e,{value:we})})}Se<0&&R("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}(),Error.prepareStackTrace=r}var u=e?e.displayName||e.name:"",m=u?Te(u):"";return"function"==typeof e&&Pe.set(e,m),m}function je(e,t,n){if(null==e)return"";if("function"==typeof e)return De(e,function(e){var t=e.prototype;return!(!t||!t.isReactComponent)}(e));if("string"==typeof e)return Te(e);switch(e){case d:return Te("Suspense");case l:return Te("SuspenseList")}if("object"==typeof e)switch(e.$$typeof){case p:return De(e.render,!1);case u:return je(e.type,t,n);case m:var i=e,s=i._payload,r=i._init;try{return je(r(s),t,n)}catch(e){}}return""}Pe=new Oe;var Ie,Me={},Le=k.ReactDebugCurrentFrame;function Ae(e){if(e){var t=e._owner,n=je(e.type,e._source,t?t.type:null);Le.setExtraStackFrame(n)}else Le.setExtraStackFrame(null)}function Ne(e){if(e){var t=e._owner;S(je(e.type,e._source,t?t.type:null))}else S(null)}function Be(){if(_.current){var e=H(_.current.type);if(e)return"\n\nCheck the render method of `"+e+"`."}return""}function Fe(e){return null!=e&&void 0!==(t=e.__source)?"\n\nCheck your code at "+t.fileName.replace(/^.*[\\\/]/,"")+":"+t.lineNumber+".":"";var t}Ie=!1;var Ue={};function ze(e,t){if(e._store&&!e._store.validated&&null==e.key){e._store.validated=!0;var n=function(e){var t=Be();if(!t){var n="string"==typeof e?e:e.displayName||e.name;n&&(t="\n\nCheck the top-level render call using <"+n+">.")}return t}(t);if(!Ue[n]){Ue[n]=!0;var i="";e&&e._owner&&e._owner!==_.current&&(i=" It was passed a child from "+H(e._owner.type)+"."),Ne(e),R('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',n,i),Ne(null)}}}function qe(e,t){if("object"==typeof e)if(z(e))for(var n=0;n<e.length;n++){var i=e[n];re(i)&&ze(i,t)}else if(re(e))e._store&&(e._store.validated=!0);else if(e){var s=g(e);if("function"==typeof s&&s!==e.entries)for(var r,a=s.call(e);!(r=a.next()).done;)re(r.value)&&ze(r.value,t)}}function $e(e){var t,n=e.type;if(null!=n&&"string"!=typeof n){if("function"==typeof n)t=n.propTypes;else{if("object"!=typeof n||n.$$typeof!==p&&n.$$typeof!==u)return;t=n.propTypes}if(t){var i=H(n);!function(e,t,n,i,s){var r=Function.call.bind(J);for(var a in e)if(r(e,a)){var o=void 0;try{if("function"!=typeof e[a]){var c=Error((i||"React class")+": "+n+" type `"+a+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[a]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw c.name="Invariant Violation",c}o=e[a](t,a,i,n,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(e){o=e}!o||o instanceof Error||(Ae(s),R("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",i||"React class",n,a,typeof o),Ae(null)),o instanceof Error&&!(o.message in Me)&&(Me[o.message]=!0,Ae(s),R("Failed %s type: %s",n,o.message),Ae(null))}}(t,e.props,"prop",i,e)}else void 0===n.PropTypes||Ie||(Ie=!0,R("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",H(n)||"Unknown"));"function"!=typeof n.getDefaultProps||n.getDefaultProps.isReactClassApproved||R("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Ve(e){for(var t=Object.keys(e.props),n=0;n<t.length;n++){var i=t[n];if("children"!==i&&"key"!==i){Ne(e),R("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",i),Ne(null);break}}null!==e.ref&&(Ne(e),R("Invalid attribute `ref` supplied to `React.Fragment`."),Ne(null))}function He(e,t,i){var r=he(e);if(!r){var a="";(void 0===e||"object"==typeof e&&null!==e&&0===Object.keys(e).length)&&(a+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var o,c=Fe(t);a+=c||Be(),null===e?o="null":z(e)?o="array":void 0!==e&&e.$$typeof===n?(o="<"+(H(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):o=typeof e,R("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",o,a)}var p=ie.apply(this,arguments);if(null==p)return p;if(r)for(var d=2;d<arguments.length;d++)qe(arguments[d],e);return e===s?Ve(p):$e(p),p}var We=!1,Ge=!1,Ke=null,Je=0,Qe=!1;function Ye(e){e!==Je-1&&R("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "),Je=e}function Xe(t,n,i){var s=y.current;if(null!==s)try{et(s),function(t){if(null===Ke)try{var n=("require"+Math.random()).slice(0,7),i=e&&e[n];Ke=i.call(e,"timers").setImmediate}catch(e){Ke=function(e){!1===Ge&&(Ge=!0,"undefined"==typeof MessageChannel&&R("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var t=new MessageChannel;t.port1.onmessage=e,t.port2.postMessage(void 0)}}Ke(t)}((function(){0===s.length?(y.current=null,n(t)):Xe(t,n,i)}))}catch(e){i(e)}else n(t)}var Ze=!1;function et(e){if(!Ze){Ze=!0;var t=0;try{for(;t<e.length;t++){var n=e[t];do{n=n(!0)}while(null!==n)}e.length=0}catch(n){throw e=e.slice(t+1),n}finally{Ze=!1}}}var tt=He,nt=function(e,t,n){for(var i=se.apply(this,arguments),s=2;s<arguments.length;s++)qe(arguments[s],i.type);return $e(i),i},it=function(e){var t=He.bind(null,e);return t.type=e,We||(We=!0,C("React.createFactory() is deprecated and will be removed in a future major release. Consider using JSX or use React.createElement() directly instead.")),Object.defineProperty(t,"type",{enumerable:!1,get:function(){return C("Factory.type is deprecated. Access the class directly before passing it to createFactory."),Object.defineProperty(this,"type",{value:e}),e}}),t},st={map:ue,forEach:function(e,t,n){ue(e,(function(){t.apply(this,arguments)}),n)},count:function(e){var t=0;return ue(e,(function(){t++})),t},toArray:function(e){return ue(e,(function(e){return e}))||[]},only:function(e){if(!re(e))throw new Error("React.Children.only expected to receive a single React element child.");return e}};t.Children=st,t.Component=I,t.Fragment=s,t.Profiler=a,t.PureComponent=B,t.StrictMode=r,t.Suspense=d,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=k,t.cloneElement=nt,t.createContext=function(e){var t={$$typeof:c,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null};t.Provider={$$typeof:o,_context:t};var n=!1,i=!1,s=!1,r={$$typeof:c,_context:t};return Object.defineProperties(r,{Provider:{get:function(){return i||(i=!0,R("Rendering <Context.Consumer.Provider> is not supported and will be removed in a future major release. Did you mean to render <Context.Provider> instead?")),t.Provider},set:function(e){t.Provider=e}},_currentValue:{get:function(){return t._currentValue},set:function(e){t._currentValue=e}},_currentValue2:{get:function(){return t._currentValue2},set:function(e){t._currentValue2=e}},_threadCount:{get:function(){return t._threadCount},set:function(e){t._threadCount=e}},Consumer:{get:function(){return n||(n=!0,R("Rendering <Context.Consumer.Consumer> is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?")),t.Consumer}},displayName:{get:function(){return t.displayName},set:function(e){s||(C("Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.displayName = '%s'.",e),s=!0)}}}),t.Consumer=r,t._currentRenderer=null,t._currentRenderer2=null,t},t.createElement=tt,t.createFactory=it,t.createRef=function(){var e={current:null};return Object.seal(e),e},t.forwardRef=function(e){null!=e&&e.$$typeof===u?R("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):"function"!=typeof e?R("forwardRef requires a render function but was given %s.",null===e?"null":typeof e):0!==e.length&&2!==e.length&&R("forwardRef render functions accept exactly two parameters: props and ref. %s",1===e.length?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),null!=e&&(null==e.defaultProps&&null==e.propTypes||R("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?"));var t,n={$$typeof:p,render:e};return Object.defineProperty(n,"displayName",{enumerable:!1,configurable:!0,get:function(){return t},set:function(n){t=n,e.name||e.displayName||(e.displayName=n)}}),n},t.isValidElement=re,t.lazy=function(e){var t,n,i={$$typeof:m,_payload:{_status:-1,_result:e},_init:me};return Object.defineProperties(i,{defaultProps:{configurable:!0,get:function(){return t},set:function(e){R("React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),t=e,Object.defineProperty(i,"defaultProps",{enumerable:!0})}},propTypes:{configurable:!0,get:function(){return n},set:function(e){R("React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),n=e,Object.defineProperty(i,"propTypes",{enumerable:!0})}}}),i},t.memo=function(e,t){he(e)||R("memo: The first argument must be a component. Instead received: %s",null===e?"null":typeof e);var n,i={$$typeof:u,type:e,compare:void 0===t?null:t};return Object.defineProperty(i,"displayName",{enumerable:!1,configurable:!0,get:function(){return n},set:function(t){n=t,e.name||e.displayName||(e.displayName=t)}}),i},t.startTransition=function(e,t){var n=b.transition;b.transition={};var i=b.transition;b.transition._updatedFibers=new Set;try{e()}finally{b.transition=n,null===n&&i._updatedFibers&&(i._updatedFibers.size>10&&C("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."),i._updatedFibers.clear())}},t.unstable_act=function(e){var t=Je;Je++,null===y.current&&(y.current=[]);var n,i=y.isBatchingLegacy;try{if(y.isBatchingLegacy=!0,n=e(),!i&&y.didScheduleLegacyUpdate){var s=y.current;null!==s&&(y.didScheduleLegacyUpdate=!1,et(s))}}catch(e){throw Ye(t),e}finally{y.isBatchingLegacy=i}if(null!==n&&"object"==typeof n&&"function"==typeof n.then){var r=n,a=!1,o={then:function(e,n){a=!0,r.then((function(i){Ye(t),0===Je?Xe(i,e,n):e(i)}),(function(e){Ye(t),n(e)}))}};return Qe||"undefined"==typeof Promise||Promise.resolve().then((function(){})).then((function(){a||(Qe=!0,R("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"))})),o}var c=n;if(Ye(t),0===Je){var p=y.current;return null!==p&&(et(p),y.current=null),{then:function(e,t){null===y.current?(y.current=[],Xe(c,e,t)):e(c)}}}return{then:function(e,t){e(c)}}},t.useCallback=function(e,t){return fe().useCallback(e,t)},t.useContext=function(e){var t=fe();if(void 0!==e._context){var n=e._context;n.Consumer===e?R("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?"):n.Provider===e&&R("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?")}return t.useContext(e)},t.useDebugValue=function(e,t){return fe().useDebugValue(e,t)},t.useDeferredValue=function(e){return fe().useDeferredValue(e)},t.useEffect=function(e,t){return fe().useEffect(e,t)},t.useId=function(){return fe().useId()},t.useImperativeHandle=function(e,t,n){return fe().useImperativeHandle(e,t,n)},t.useInsertionEffect=function(e,t){return fe().useInsertionEffect(e,t)},t.useLayoutEffect=function(e,t){return fe().useLayoutEffect(e,t)},t.useMemo=function(e,t){return fe().useMemo(e,t)},t.useReducer=function(e,t,n){return fe().useReducer(e,t,n)},t.useRef=function(e){return fe().useRef(e)},t.useState=function(e){return fe().useState(e)},t.useSyncExternalStore=function(e,t,n){return fe().useSyncExternalStore(e,t,n)},t.useTransition=function(){return fe().useTransition()},t.version="18.2.0","undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),pn;var e,t}cn={get exports(){return sn},set exports(e){sn=e}},"production"===process.env.NODE_ENV?cn.exports=an():cn.exports=ln();var un=en(sn),mn=e=>{var{stream:t}=e,n=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(e);s<i.length;s++)t.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(n[i[s]]=e[i[s]])}return n}(e,["stream"]);const i=sn.useCallback((e=>{null!==e&&e.srcObject!==t&&(e.srcObject=t)}),[]);return un.createElement("video",Object.assign({ref:i,autoPlay:!0,playsInline:!0},n))};const hn="client_connection_status_changed",fn="stream_added",gn="rtc_manager_created",vn="rtc_manager_destroyed",bn="local_stream_track_added",yn="local_stream_track_removed",_n="connecting",xn="connection_failed",wn="connection_successful",Sn="connection_disconnected",kn="fetch_mediaserver_config",Cn="start_screenshare",Rn="stop_screenshare",Tn="mediaserver_config",Pn="room_joined",En="ice_candidate",On="ice_endofcandidates",Dn="ready_to_receive_offer",jn="sdp_answer",In="sdp_offer";let Mn=!0,Ln=!0;function An(e,t,n){const i=e.match(t);return i&&i.length>=n&&parseInt(i[n],10)}function Nn(e,t,n){if(!e.RTCPeerConnection)return;const i=e.RTCPeerConnection.prototype,s=i.addEventListener;i.addEventListener=function(e,i){if(e!==t)return s.apply(this,arguments);const r=e=>{const t=n(e);t&&(i.handleEvent?i.handleEvent(t):i(t))};return this._eventMap=this._eventMap||{},this._eventMap[t]||(this._eventMap[t]=new Map),this._eventMap[t].set(i,r),s.apply(this,[e,r])};const r=i.removeEventListener;i.removeEventListener=function(e,n){if(e!==t||!this._eventMap||!this._eventMap[t])return r.apply(this,arguments);if(!this._eventMap[t].has(n))return r.apply(this,arguments);const i=this._eventMap[t].get(n);return this._eventMap[t].delete(n),0===this._eventMap[t].size&&delete this._eventMap[t],0===Object.keys(this._eventMap).length&&delete this._eventMap,r.apply(this,[e,i])},Object.defineProperty(i,"on"+t,{get(){return this["_on"+t]},set(e){this["_on"+t]&&(this.removeEventListener(t,this["_on"+t]),delete this["_on"+t]),e&&this.addEventListener(t,this["_on"+t]=e)},enumerable:!0,configurable:!0})}function Bn(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(Mn=e,e?"adapter.js logging disabled":"adapter.js logging enabled")}function Fn(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(Ln=!e,"adapter.js deprecation warnings "+(e?"disabled":"enabled"))}function Un(){if("object"==typeof window){if(Mn)return;"undefined"!=typeof console&&"function"==typeof console.log&&console.log.apply(console,arguments)}}function zn(e,t){Ln&&console.warn(e+" is deprecated, please use "+t+" instead.")}function qn(e){return"[object Object]"===Object.prototype.toString.call(e)}function $n(e){return qn(e)?Object.keys(e).reduce((function(t,n){const i=qn(e[n]),s=i?$n(e[n]):e[n],r=i&&!Object.keys(s).length;return void 0===s||r?t:Object.assign(t,{[n]:s})}),{}):e}function Vn(e,t,n){t&&!n.has(t.id)&&(n.set(t.id,t),Object.keys(t).forEach((i=>{i.endsWith("Id")?Vn(e,e.get(t[i]),n):i.endsWith("Ids")&&t[i].forEach((t=>{Vn(e,e.get(t),n)}))})))}function Hn(e,t,n){const i=n?"outbound-rtp":"inbound-rtp",s=new Map;if(null===t)return s;const r=[];return e.forEach((e=>{"track"===e.type&&e.trackIdentifier===t.id&&r.push(e)})),r.forEach((t=>{e.forEach((n=>{n.type===i&&n.trackId===t.id&&Vn(e,n,s)}))})),s}const Wn=Un;function Gn(e,t){const n=e&&e.navigator;if(!n.mediaDevices)return;const i=function(e){if("object"!=typeof e||e.mandatory||e.optional)return e;const t={};return Object.keys(e).forEach((n=>{if("require"===n||"advanced"===n||"mediaSource"===n)return;const i="object"==typeof e[n]?e[n]:{ideal:e[n]};void 0!==i.exact&&"number"==typeof i.exact&&(i.min=i.max=i.exact);const s=function(e,t){return e?e+t.charAt(0).toUpperCase()+t.slice(1):"deviceId"===t?"sourceId":t};if(void 0!==i.ideal){t.optional=t.optional||[];let e={};"number"==typeof i.ideal?(e[s("min",n)]=i.ideal,t.optional.push(e),e={},e[s("max",n)]=i.ideal,t.optional.push(e)):(e[s("",n)]=i.ideal,t.optional.push(e))}void 0!==i.exact&&"number"!=typeof i.exact?(t.mandatory=t.mandatory||{},t.mandatory[s("",n)]=i.exact):["min","max"].forEach((e=>{void 0!==i[e]&&(t.mandatory=t.mandatory||{},t.mandatory[s(e,n)]=i[e])}))})),e.advanced&&(t.optional=(t.optional||[]).concat(e.advanced)),t},s=function(e,s){if(t.version>=61)return s(e);if((e=JSON.parse(JSON.stringify(e)))&&"object"==typeof e.audio){const t=function(e,t,n){t in e&&!(n in e)&&(e[n]=e[t],delete e[t])};t((e=JSON.parse(JSON.stringify(e))).audio,"autoGainControl","googAutoGainControl"),t(e.audio,"noiseSuppression","googNoiseSuppression"),e.audio=i(e.audio)}if(e&&"object"==typeof e.video){let r=e.video.facingMode;r=r&&("object"==typeof r?r:{ideal:r});const a=t.version<66;if(r&&("user"===r.exact||"environment"===r.exact||"user"===r.ideal||"environment"===r.ideal)&&(!n.mediaDevices.getSupportedConstraints||!n.mediaDevices.getSupportedConstraints().facingMode||a)){let t;if(delete e.video.facingMode,"environment"===r.exact||"environment"===r.ideal?t=["back","rear"]:"user"!==r.exact&&"user"!==r.ideal||(t=["front"]),t)return n.mediaDevices.enumerateDevices().then((n=>{n=n.filter((e=>"videoinput"===e.kind));let a=n.find((e=>t.some((t=>e.label.toLowerCase().includes(t)))));return!a&&n.length&&t.includes("back")&&(a=n[n.length-1]),a&&(e.video.deviceId=r.exact?{exact:a.deviceId}:{ideal:a.deviceId}),e.video=i(e.video),Wn("chrome: "+JSON.stringify(e)),s(e)}))}e.video=i(e.video)}return Wn("chrome: "+JSON.stringify(e)),s(e)},r=function(e){return t.version>=64?e:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[e.name]||e.name,message:e.message,constraint:e.constraint||e.constraintName,toString(){return this.name+(this.message&&": ")+this.message}}};if(n.getUserMedia=function(e,t,i){s(e,(e=>{n.webkitGetUserMedia(e,t,(e=>{i&&i(r(e))}))}))}.bind(n),n.mediaDevices.getUserMedia){const e=n.mediaDevices.getUserMedia.bind(n.mediaDevices);n.mediaDevices.getUserMedia=function(t){return s(t,(t=>e(t).then((e=>{if(t.audio&&!e.getAudioTracks().length||t.video&&!e.getVideoTracks().length)throw e.getTracks().forEach((e=>{e.stop()})),new DOMException("","NotFoundError");return e}),(e=>Promise.reject(r(e))))))}}}function Kn(e){e.MediaStream=e.MediaStream||e.webkitMediaStream}function Jn(e){if("object"==typeof e&&e.RTCPeerConnection&&!("ontrack"in e.RTCPeerConnection.prototype)){Object.defineProperty(e.RTCPeerConnection.prototype,"ontrack",{get(){return this._ontrack},set(e){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=e)},enumerable:!0,configurable:!0});const t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=t=>{t.stream.addEventListener("addtrack",(n=>{let i;i=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find((e=>e.track&&e.track.id===n.track.id)):{track:n.track};const s=new Event("track");s.track=n.track,s.receiver=i,s.transceiver={receiver:i},s.streams=[t.stream],this.dispatchEvent(s)})),t.stream.getTracks().forEach((n=>{let i;i=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find((e=>e.track&&e.track.id===n.id)):{track:n};const s=new Event("track");s.track=n,s.receiver=i,s.transceiver={receiver:i},s.streams=[t.stream],this.dispatchEvent(s)}))},this.addEventListener("addstream",this._ontrackpoly)),t.apply(this,arguments)}}else Nn(e,"track",(e=>(e.transceiver||Object.defineProperty(e,"transceiver",{value:{receiver:e.receiver}}),e)))}function Qn(e){if("object"==typeof e&&e.RTCPeerConnection&&!("getSenders"in e.RTCPeerConnection.prototype)&&"createDTMFSender"in e.RTCPeerConnection.prototype){const t=function(e,t){return{track:t,get dtmf(){return void 0===this._dtmf&&("audio"===t.kind?this._dtmf=e.createDTMFSender(t):this._dtmf=null),this._dtmf},_pc:e}};if(!e.RTCPeerConnection.prototype.getSenders){e.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};const n=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,i){let s=n.apply(this,arguments);return s||(s=t(this,e),this._senders.push(s)),s};const i=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){i.apply(this,arguments);const t=this._senders.indexOf(e);-1!==t&&this._senders.splice(t,1)}}const n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){this._senders=this._senders||[],n.apply(this,[e]),e.getTracks().forEach((e=>{this._senders.push(t(this,e))}))};const i=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){this._senders=this._senders||[],i.apply(this,[e]),e.getTracks().forEach((e=>{const t=this._senders.find((t=>t.track===e));t&&this._senders.splice(this._senders.indexOf(t),1)}))}}else if("object"==typeof e&&e.RTCPeerConnection&&"getSenders"in e.RTCPeerConnection.prototype&&"createDTMFSender"in e.RTCPeerConnection.prototype&&e.RTCRtpSender&&!("dtmf"in e.RTCRtpSender.prototype)){const t=e.RTCPeerConnection.prototype.getSenders;e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e},Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}}function Yn(e){if(!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){const[e,n,i]=arguments;if(arguments.length>0&&"function"==typeof e)return t.apply(this,arguments);if(0===t.length&&(0===arguments.length||"function"!=typeof e))return t.apply(this,[]);const s=function(e){const t={};return e.result().forEach((e=>{const n={id:e.id,timestamp:e.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[e.type]||e.type};e.names().forEach((t=>{n[t]=e.stat(t)})),t[n.id]=n})),t},r=function(e){return new Map(Object.keys(e).map((t=>[t,e[t]])))};if(arguments.length>=2){const i=function(e){n(r(s(e)))};return t.apply(this,[i,e])}return new Promise(((e,n)=>{t.apply(this,[function(t){e(r(s(t)))},n])})).then(n,i)}}function Xn(e){if(!("object"==typeof e&&e.RTCPeerConnection&&e.RTCRtpSender&&e.RTCRtpReceiver))return;if(!("getStats"in e.RTCRtpSender.prototype)){const t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e});const n=e.RTCPeerConnection.prototype.addTrack;n&&(e.RTCPeerConnection.prototype.addTrack=function(){const e=n.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){const e=this;return this._pc.getStats().then((t=>Hn(t,e.track,!0)))}}if(!("getStats"in e.RTCRtpReceiver.prototype)){const t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e}),Nn(e,"track",(e=>(e.receiver._pc=e.srcElement,e))),e.RTCRtpReceiver.prototype.getStats=function(){const e=this;return this._pc.getStats().then((t=>Hn(t,e.track,!1)))}}if(!("getStats"in e.RTCRtpSender.prototype)||!("getStats"in e.RTCRtpReceiver.prototype))return;const t=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof e.MediaStreamTrack){const e=arguments[0];let t,n,i;return this.getSenders().forEach((n=>{n.track===e&&(t?i=!0:t=n)})),this.getReceivers().forEach((t=>(t.track===e&&(n?i=!0:n=t),t.track===e))),i||t&&n?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):t?t.getStats():n?n.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return t.apply(this,arguments)}}function Zn(e){e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map((e=>this._shimmedLocalStreams[e][0]))};const t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,n){if(!n)return t.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};const i=t.apply(this,arguments);return this._shimmedLocalStreams[n.id]?-1===this._shimmedLocalStreams[n.id].indexOf(i)&&this._shimmedLocalStreams[n.id].push(i):this._shimmedLocalStreams[n.id]=[n,i],i};const n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){this._shimmedLocalStreams=this._shimmedLocalStreams||{},e.getTracks().forEach((e=>{const t=this.getSenders().find((t=>t.track===e));if(t)throw new DOMException("Track already exists.","InvalidAccessError")}));const t=this.getSenders();n.apply(this,arguments);const i=this.getSenders().filter((e=>-1===t.indexOf(e)));this._shimmedLocalStreams[e.id]=[e].concat(i)};const i=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[e.id],i.apply(this,arguments)};const s=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},e&&Object.keys(this._shimmedLocalStreams).forEach((t=>{const n=this._shimmedLocalStreams[t].indexOf(e);-1!==n&&this._shimmedLocalStreams[t].splice(n,1),1===this._shimmedLocalStreams[t].length&&delete this._shimmedLocalStreams[t]})),s.apply(this,arguments)}}function ei(e,t){if(!e.RTCPeerConnection)return;if(e.RTCPeerConnection.prototype.addTrack&&t.version>=65)return Zn(e);const n=e.RTCPeerConnection.prototype.getLocalStreams;e.RTCPeerConnection.prototype.getLocalStreams=function(){const e=n.apply(this);return this._reverseStreams=this._reverseStreams||{},e.map((e=>this._reverseStreams[e.id]))};const i=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(t){if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},t.getTracks().forEach((e=>{const t=this.getSenders().find((t=>t.track===e));if(t)throw new DOMException("Track already exists.","InvalidAccessError")})),!this._reverseStreams[t.id]){const n=new e.MediaStream(t.getTracks());this._streams[t.id]=n,this._reverseStreams[n.id]=t,t=n}i.apply(this,[t])};const s=e.RTCPeerConnection.prototype.removeStream;function r(e,t){let n=t.sdp;return Object.keys(e._reverseStreams||[]).forEach((t=>{const i=e._reverseStreams[t],s=e._streams[i.id];n=n.replace(new RegExp(s.id,"g"),i.id)})),new RTCSessionDescription({type:t.type,sdp:n})}function a(e,t){let n=t.sdp;return Object.keys(e._reverseStreams||[]).forEach((t=>{const i=e._reverseStreams[t],s=e._streams[i.id];n=n.replace(new RegExp(i.id,"g"),s.id)})),new RTCSessionDescription({type:t.type,sdp:n})}e.RTCPeerConnection.prototype.removeStream=function(e){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},s.apply(this,[this._streams[e.id]||e]),delete this._reverseStreams[this._streams[e.id]?this._streams[e.id].id:e.id],delete this._streams[e.id]},e.RTCPeerConnection.prototype.addTrack=function(t,n){if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");const i=[].slice.call(arguments,1);if(1!==i.length||!i[0].getTracks().find((e=>e===t)))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");const s=this.getSenders().find((e=>e.track===t));if(s)throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};const r=this._streams[n.id];if(r)r.addTrack(t),Promise.resolve().then((()=>{this.dispatchEvent(new Event("negotiationneeded"))}));else{const i=new e.MediaStream([t]);this._streams[n.id]=i,this._reverseStreams[i.id]=n,this.addStream(i)}return this.getSenders().find((e=>e.track===t))},["createOffer","createAnswer"].forEach((function(t){const n=e.RTCPeerConnection.prototype[t],i={[t](){const e=arguments;return arguments.length&&"function"==typeof arguments[0]?n.apply(this,[t=>{const n=r(this,t);e[0].apply(null,[n])},t=>{e[1]&&e[1].apply(null,t)},arguments[2]]):n.apply(this,arguments).then((e=>r(this,e)))}};e.RTCPeerConnection.prototype[t]=i[t]}));const o=e.RTCPeerConnection.prototype.setLocalDescription;e.RTCPeerConnection.prototype.setLocalDescription=function(){return arguments.length&&arguments[0].type?(arguments[0]=a(this,arguments[0]),o.apply(this,arguments)):o.apply(this,arguments)};const c=Object.getOwnPropertyDescriptor(e.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(e.RTCPeerConnection.prototype,"localDescription",{get(){const e=c.get.apply(this);return""===e.type?e:r(this,e)}}),e.RTCPeerConnection.prototype.removeTrack=function(e){if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!e._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(!(e._pc===this))throw new DOMException("Sender was not created by this connection.","InvalidAccessError");let t;this._streams=this._streams||{},Object.keys(this._streams).forEach((n=>{this._streams[n].getTracks().find((t=>e.track===t))&&(t=this._streams[n])})),t&&(1===t.getTracks().length?this.removeStream(this._reverseStreams[t.id]):t.removeTrack(e.track),this.dispatchEvent(new Event("negotiationneeded")))}}function ti(e,t){!e.RTCPeerConnection&&e.webkitRTCPeerConnection&&(e.RTCPeerConnection=e.webkitRTCPeerConnection),e.RTCPeerConnection&&t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){const n=e.RTCPeerConnection.prototype[t],i={[t](){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}};e.RTCPeerConnection.prototype[t]=i[t]}))}function ni(e,t){Nn(e,"negotiationneeded",(e=>{const n=e.target;if(!(t.version<72||n.getConfiguration&&"plan-b"===n.getConfiguration().sdpSemantics)||"stable"===n.signalingState)return e}))}var ii=Object.freeze({__proto__:null,shimMediaStream:Kn,shimOnTrack:Jn,shimGetSendersWithDtmf:Qn,shimGetStats:Yn,shimSenderReceiverGetStats:Xn,shimAddTrackRemoveTrackWithNative:Zn,shimAddTrackRemoveTrack:ei,shimPeerConnection:ti,fixNegotiationNeeded:ni,shimGetUserMedia:Gn,shimGetDisplayMedia:function(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&("function"==typeof t?e.navigator.mediaDevices.getDisplayMedia=function(n){return t(n).then((t=>{const i=n.video&&n.video.width,s=n.video&&n.video.height,r=n.video&&n.video.frameRate;return n.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:t,maxFrameRate:r||3}},i&&(n.video.mandatory.maxWidth=i),s&&(n.video.mandatory.maxHeight=s),e.navigator.mediaDevices.getUserMedia(n)}))}:console.error("shimGetDisplayMedia: getSourceId argument is not a function"))}});function si(e,t){const n=e&&e.navigator,i=e&&e.MediaStreamTrack;if(n.getUserMedia=function(e,t,i){zn("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),n.mediaDevices.getUserMedia(e).then(t,i)},!(t.version>55&&"autoGainControl"in n.mediaDevices.getSupportedConstraints())){const e=function(e,t,n){t in e&&!(n in e)&&(e[n]=e[t],delete e[t])},t=n.mediaDevices.getUserMedia.bind(n.mediaDevices);if(n.mediaDevices.getUserMedia=function(n){return"object"==typeof n&&"object"==typeof n.audio&&(n=JSON.parse(JSON.stringify(n)),e(n.audio,"autoGainControl","mozAutoGainControl"),e(n.audio,"noiseSuppression","mozNoiseSuppression")),t(n)},i&&i.prototype.getSettings){const t=i.prototype.getSettings;i.prototype.getSettings=function(){const n=t.apply(this,arguments);return e(n,"mozAutoGainControl","autoGainControl"),e(n,"mozNoiseSuppression","noiseSuppression"),n}}if(i&&i.prototype.applyConstraints){const t=i.prototype.applyConstraints;i.prototype.applyConstraints=function(n){return"audio"===this.kind&&"object"==typeof n&&(n=JSON.parse(JSON.stringify(n)),e(n,"autoGainControl","mozAutoGainControl"),e(n,"noiseSuppression","mozNoiseSuppression")),t.apply(this,[n])}}}}function ri(e){"object"==typeof e&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function ai(e,t){if("object"!=typeof e||!e.RTCPeerConnection&&!e.mozRTCPeerConnection)return;!e.RTCPeerConnection&&e.mozRTCPeerConnection&&(e.RTCPeerConnection=e.mozRTCPeerConnection),t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){const n=e.RTCPeerConnection.prototype[t],i={[t](){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}};e.RTCPeerConnection.prototype[t]=i[t]}));const n={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},i=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){const[e,s,r]=arguments;return i.apply(this,[e||null]).then((e=>{if(t.version<53&&!s)try{e.forEach((e=>{e.type=n[e.type]||e.type}))}catch(t){if("TypeError"!==t.name)throw t;e.forEach(((t,i)=>{e.set(i,Object.assign({},t,{type:n[t.type]||t.type}))}))}return e})).then(s,r)}}function oi(e){if("object"!=typeof e||!e.RTCPeerConnection||!e.RTCRtpSender)return;if(e.RTCRtpSender&&"getStats"in e.RTCRtpSender.prototype)return;const t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e});const n=e.RTCPeerConnection.prototype.addTrack;n&&(e.RTCPeerConnection.prototype.addTrack=function(){const e=n.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}function ci(e){if("object"!=typeof e||!e.RTCPeerConnection||!e.RTCRtpSender)return;if(e.RTCRtpSender&&"getStats"in e.RTCRtpReceiver.prototype)return;const t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e}),Nn(e,"track",(e=>(e.receiver._pc=e.srcElement,e))),e.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function pi(e){e.RTCPeerConnection&&!("removeStream"in e.RTCPeerConnection.prototype)&&(e.RTCPeerConnection.prototype.removeStream=function(e){zn("removeStream","removeTrack"),this.getSenders().forEach((t=>{t.track&&e.getTracks().includes(t.track)&&this.removeTrack(t)}))})}function di(e){e.DataChannel&&!e.RTCDataChannel&&(e.RTCDataChannel=e.DataChannel)}function li(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.addTransceiver;t&&(e.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];let e=arguments[1]&&arguments[1].sendEncodings;void 0===e&&(e=[]),e=[...e];const n=e.length>0;n&&e.forEach((e=>{if("rid"in e){if(!/^[a-z0-9]{0,16}$/i.test(e.rid))throw new TypeError("Invalid RID value provided.")}if("scaleResolutionDownBy"in e&&!(parseFloat(e.scaleResolutionDownBy)>=1))throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in e&&!(parseFloat(e.maxFramerate)>=0))throw new RangeError("max_framerate must be >= 0.0")}));const i=t.apply(this,arguments);if(n){const{sender:t}=i,n=t.getParameters();(!("encodings"in n)||1===n.encodings.length&&0===Object.keys(n.encodings[0]).length)&&(n.encodings=e,t.sendEncodings=e,this.setParametersPromises.push(t.setParameters(n).then((()=>{delete t.sendEncodings})).catch((()=>{delete t.sendEncodings}))))}return i})}function ui(e){if("object"!=typeof e||!e.RTCRtpSender)return;const t=e.RTCRtpSender.prototype.getParameters;t&&(e.RTCRtpSender.prototype.getParameters=function(){const e=t.apply(this,arguments);return"encodings"in e||(e.encodings=[].concat(this.sendEncodings||[{}])),e})}function mi(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then((()=>t.apply(this,arguments))).finally((()=>{this.setParametersPromises=[]})):t.apply(this,arguments)}}function hi(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.createAnswer;e.RTCPeerConnection.prototype.createAnswer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then((()=>t.apply(this,arguments))).finally((()=>{this.setParametersPromises=[]})):t.apply(this,arguments)}}var fi=Object.freeze({__proto__:null,shimOnTrack:ri,shimPeerConnection:ai,shimSenderGetStats:oi,shimReceiverGetStats:ci,shimRemoveStream:pi,shimRTCDataChannel:di,shimAddTransceiver:li,shimGetParameters:ui,shimCreateOffer:mi,shimCreateAnswer:hi,shimGetUserMedia:si,shimGetDisplayMedia:function(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&(e.navigator.mediaDevices.getDisplayMedia=function(n){if(!n||!n.video){const e=new DOMException("getDisplayMedia without video constraints is undefined");return e.name="NotFoundError",e.code=8,Promise.reject(e)}return!0===n.video?n.video={mediaSource:t}:n.video.mediaSource=t,e.navigator.mediaDevices.getUserMedia(n)})}});function gi(e){if("object"==typeof e&&e.RTCPeerConnection){if("getLocalStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in e.RTCPeerConnection.prototype)){const t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addStream=function(e){this._localStreams||(this._localStreams=[]),this._localStreams.includes(e)||this._localStreams.push(e),e.getAudioTracks().forEach((n=>t.call(this,n,e))),e.getVideoTracks().forEach((n=>t.call(this,n,e)))},e.RTCPeerConnection.prototype.addTrack=function(e,...n){return n&&n.forEach((e=>{this._localStreams?this._localStreams.includes(e)||this._localStreams.push(e):this._localStreams=[e]})),t.apply(this,arguments)}}"removeStream"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.removeStream=function(e){this._localStreams||(this._localStreams=[]);const t=this._localStreams.indexOf(e);if(-1===t)return;this._localStreams.splice(t,1);const n=e.getTracks();this.getSenders().forEach((e=>{n.includes(e.track)&&this.removeTrack(e)}))})}}function vi(e){if("object"==typeof e&&e.RTCPeerConnection&&("getRemoteStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in e.RTCPeerConnection.prototype))){Object.defineProperty(e.RTCPeerConnection.prototype,"onaddstream",{get(){return this._onaddstream},set(e){this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=e),this.addEventListener("track",this._onaddstreampoly=e=>{e.streams.forEach((e=>{if(this._remoteStreams||(this._remoteStreams=[]),this._remoteStreams.includes(e))return;this._remoteStreams.push(e);const t=new Event("addstream");t.stream=e,this.dispatchEvent(t)}))})}});const t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){const e=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(t){t.streams.forEach((t=>{if(e._remoteStreams||(e._remoteStreams=[]),e._remoteStreams.indexOf(t)>=0)return;e._remoteStreams.push(t);const n=new Event("addstream");n.stream=t,e.dispatchEvent(n)}))}),t.apply(e,arguments)}}}function bi(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype,n=t.createOffer,i=t.createAnswer,s=t.setLocalDescription,r=t.setRemoteDescription,a=t.addIceCandidate;t.createOffer=function(e,t){const i=arguments.length>=2?arguments[2]:arguments[0],s=n.apply(this,[i]);return t?(s.then(e,t),Promise.resolve()):s},t.createAnswer=function(e,t){const n=arguments.length>=2?arguments[2]:arguments[0],s=i.apply(this,[n]);return t?(s.then(e,t),Promise.resolve()):s};let o=function(e,t,n){const i=s.apply(this,[e]);return n?(i.then(t,n),Promise.resolve()):i};t.setLocalDescription=o,o=function(e,t,n){const i=r.apply(this,[e]);return n?(i.then(t,n),Promise.resolve()):i},t.setRemoteDescription=o,o=function(e,t,n){const i=a.apply(this,[e]);return n?(i.then(t,n),Promise.resolve()):i},t.addIceCandidate=o}function yi(e){const t=e&&e.navigator;if(t.mediaDevices&&t.mediaDevices.getUserMedia){const e=t.mediaDevices,n=e.getUserMedia.bind(e);t.mediaDevices.getUserMedia=e=>n(_i(e))}!t.getUserMedia&&t.mediaDevices&&t.mediaDevices.getUserMedia&&(t.getUserMedia=function(e,n,i){t.mediaDevices.getUserMedia(e).then(n,i)}.bind(t))}function _i(e){return e&&void 0!==e.video?Object.assign({},e,{video:$n(e.video)}):e}function xi(e){if(!e.RTCPeerConnection)return;const t=e.RTCPeerConnection;e.RTCPeerConnection=function(e,n){if(e&&e.iceServers){const t=[];for(let n=0;n<e.iceServers.length;n++){let i=e.iceServers[n];!i.hasOwnProperty("urls")&&i.hasOwnProperty("url")?(zn("RTCIceServer.url","RTCIceServer.urls"),i=JSON.parse(JSON.stringify(i)),i.urls=i.url,delete i.url,t.push(i)):t.push(e.iceServers[n])}e.iceServers=t}return new t(e,n)},e.RTCPeerConnection.prototype=t.prototype,"generateCertificate"in t&&Object.defineProperty(e.RTCPeerConnection,"generateCertificate",{get:()=>t.generateCertificate})}function wi(e){"object"==typeof e&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function Si(e){const t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(e){if(e){void 0!==e.offerToReceiveAudio&&(e.offerToReceiveAudio=!!e.offerToReceiveAudio);const t=this.getTransceivers().find((e=>"audio"===e.receiver.track.kind));!1===e.offerToReceiveAudio&&t?"sendrecv"===t.direction?t.setDirection?t.setDirection("sendonly"):t.direction="sendonly":"recvonly"===t.direction&&(t.setDirection?t.setDirection("inactive"):t.direction="inactive"):!0!==e.offerToReceiveAudio||t||this.addTransceiver("audio",{direction:"recvonly"}),void 0!==e.offerToReceiveVideo&&(e.offerToReceiveVideo=!!e.offerToReceiveVideo);const n=this.getTransceivers().find((e=>"video"===e.receiver.track.kind));!1===e.offerToReceiveVideo&&n?"sendrecv"===n.direction?n.setDirection?n.setDirection("sendonly"):n.direction="sendonly":"recvonly"===n.direction&&(n.setDirection?n.setDirection("inactive"):n.direction="inactive"):!0!==e.offerToReceiveVideo||n||this.addTransceiver("video",{direction:"recvonly"})}return t.apply(this,arguments)}}function ki(e){"object"!=typeof e||e.AudioContext||(e.AudioContext=e.webkitAudioContext)}var Ci=Object.freeze({__proto__:null,shimLocalStreamsAPI:gi,shimRemoteStreamsAPI:vi,shimCallbacksAPI:bi,shimGetUserMedia:yi,shimConstraints:_i,shimRTCIceServerUrls:xi,shimTrackEventTransceiver:wi,shimCreateOfferLegacy:Si,shimAudioContext:ki}),Ri={};!function(e){const t={generateIdentifier:function(){return Math.random().toString(36).substring(2,12)}};t.localCName=t.generateIdentifier(),t.splitLines=function(e){return e.trim().split("\n").map((e=>e.trim()))},t.splitSections=function(e){return e.split("\nm=").map(((e,t)=>(t>0?"m="+e:e).trim()+"\r\n"))},t.getDescription=function(e){const n=t.splitSections(e);return n&&n[0]},t.getMediaSections=function(e){const n=t.splitSections(e);return n.shift(),n},t.matchPrefix=function(e,n){return t.splitLines(e).filter((e=>0===e.indexOf(n)))},t.parseCandidate=function(e){let t;t=0===e.indexOf("a=candidate:")?e.substring(12).split(" "):e.substring(10).split(" ");const n={foundation:t[0],component:{1:"rtp",2:"rtcp"}[t[1]]||t[1],protocol:t[2].toLowerCase(),priority:parseInt(t[3],10),ip:t[4],address:t[4],port:parseInt(t[5],10),type:t[7]};for(let e=8;e<t.length;e+=2)switch(t[e]){case"raddr":n.relatedAddress=t[e+1];break;case"rport":n.relatedPort=parseInt(t[e+1],10);break;case"tcptype":n.tcpType=t[e+1];break;case"ufrag":n.ufrag=t[e+1],n.usernameFragment=t[e+1];break;default:void 0===n[t[e]]&&(n[t[e]]=t[e+1])}return n},t.writeCandidate=function(e){const t=[];t.push(e.foundation);const n=e.component;"rtp"===n?t.push(1):"rtcp"===n?t.push(2):t.push(n),t.push(e.protocol.toUpperCase()),t.push(e.priority),t.push(e.address||e.ip),t.push(e.port);const i=e.type;return t.push("typ"),t.push(i),"host"!==i&&e.relatedAddress&&e.relatedPort&&(t.push("raddr"),t.push(e.relatedAddress),t.push("rport"),t.push(e.relatedPort)),e.tcpType&&"tcp"===e.protocol.toLowerCase()&&(t.push("tcptype"),t.push(e.tcpType)),(e.usernameFragment||e.ufrag)&&(t.push("ufrag"),t.push(e.usernameFragment||e.ufrag)),"candidate:"+t.join(" ")},t.parseIceOptions=function(e){return e.substring(14).split(" ")},t.parseRtpMap=function(e){let t=e.substring(9).split(" ");const n={payloadType:parseInt(t.shift(),10)};return t=t[0].split("/"),n.name=t[0],n.clockRate=parseInt(t[1],10),n.channels=3===t.length?parseInt(t[2],10):1,n.numChannels=n.channels,n},t.writeRtpMap=function(e){let t=e.payloadType;void 0!==e.preferredPayloadType&&(t=e.preferredPayloadType);const n=e.channels||e.numChannels||1;return"a=rtpmap:"+t+" "+e.name+"/"+e.clockRate+(1!==n?"/"+n:"")+"\r\n"},t.parseExtmap=function(e){const t=e.substring(9).split(" ");return{id:parseInt(t[0],10),direction:t[0].indexOf("/")>0?t[0].split("/")[1]:"sendrecv",uri:t[1],attributes:t.slice(2).join(" ")}},t.writeExtmap=function(e){return"a=extmap:"+(e.id||e.preferredId)+(e.direction&&"sendrecv"!==e.direction?"/"+e.direction:"")+" "+e.uri+(e.attributes?" "+e.attributes:"")+"\r\n"},t.parseFmtp=function(e){const t={};let n;const i=e.substring(e.indexOf(" ")+1).split(";");for(let e=0;e<i.length;e++)n=i[e].trim().split("="),t[n[0].trim()]=n[1];return t},t.writeFmtp=function(e){let t="",n=e.payloadType;if(void 0!==e.preferredPayloadType&&(n=e.preferredPayloadType),e.parameters&&Object.keys(e.parameters).length){const i=[];Object.keys(e.parameters).forEach((t=>{void 0!==e.parameters[t]?i.push(t+"="+e.parameters[t]):i.push(t)})),t+="a=fmtp:"+n+" "+i.join(";")+"\r\n"}return t},t.parseRtcpFb=function(e){const t=e.substring(e.indexOf(" ")+1).split(" ");return{type:t.shift(),parameter:t.join(" ")}},t.writeRtcpFb=function(e){let t="",n=e.payloadType;return void 0!==e.preferredPayloadType&&(n=e.preferredPayloadType),e.rtcpFeedback&&e.rtcpFeedback.length&&e.rtcpFeedback.forEach((e=>{t+="a=rtcp-fb:"+n+" "+e.type+(e.parameter&&e.parameter.length?" "+e.parameter:"")+"\r\n"})),t},t.parseSsrcMedia=function(e){const t=e.indexOf(" "),n={ssrc:parseInt(e.substring(7,t),10)},i=e.indexOf(":",t);return i>-1?(n.attribute=e.substring(t+1,i),n.value=e.substring(i+1)):n.attribute=e.substring(t+1),n},t.parseSsrcGroup=function(e){const t=e.substring(13).split(" ");return{semantics:t.shift(),ssrcs:t.map((e=>parseInt(e,10)))}},t.getMid=function(e){const n=t.matchPrefix(e,"a=mid:")[0];if(n)return n.substring(6)},t.parseFingerprint=function(e){const t=e.substring(14).split(" ");return{algorithm:t[0].toLowerCase(),value:t[1].toUpperCase()}},t.getDtlsParameters=function(e,n){return{role:"auto",fingerprints:t.matchPrefix(e+n,"a=fingerprint:").map(t.parseFingerprint)}},t.writeDtlsParameters=function(e,t){let n="a=setup:"+t+"\r\n";return e.fingerprints.forEach((e=>{n+="a=fingerprint:"+e.algorithm+" "+e.value+"\r\n"})),n},t.parseCryptoLine=function(e){const t=e.substring(9).split(" ");return{tag:parseInt(t[0],10),cryptoSuite:t[1],keyParams:t[2],sessionParams:t.slice(3)}},t.writeCryptoLine=function(e){return"a=crypto:"+e.tag+" "+e.cryptoSuite+" "+("object"==typeof e.keyParams?t.writeCryptoKeyParams(e.keyParams):e.keyParams)+(e.sessionParams?" "+e.sessionParams.join(" "):"")+"\r\n"},t.parseCryptoKeyParams=function(e){if(0!==e.indexOf("inline:"))return null;const t=e.substring(7).split("|");return{keyMethod:"inline",keySalt:t[0],lifeTime:t[1],mkiValue:t[2]?t[2].split(":")[0]:void 0,mkiLength:t[2]?t[2].split(":")[1]:void 0}},t.writeCryptoKeyParams=function(e){return e.keyMethod+":"+e.keySalt+(e.lifeTime?"|"+e.lifeTime:"")+(e.mkiValue&&e.mkiLength?"|"+e.mkiValue+":"+e.mkiLength:"")},t.getCryptoParameters=function(e,n){return t.matchPrefix(e+n,"a=crypto:").map(t.parseCryptoLine)},t.getIceParameters=function(e,n){const i=t.matchPrefix(e+n,"a=ice-ufrag:")[0],s=t.matchPrefix(e+n,"a=ice-pwd:")[0];return i&&s?{usernameFragment:i.substring(12),password:s.substring(10)}:null},t.writeIceParameters=function(e){let t="a=ice-ufrag:"+e.usernameFragment+"\r\na=ice-pwd:"+e.password+"\r\n";return e.iceLite&&(t+="a=ice-lite\r\n"),t},t.parseRtpParameters=function(e){const n={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},i=t.splitLines(e)[0].split(" ");for(let s=3;s<i.length;s++){const r=i[s],a=t.matchPrefix(e,"a=rtpmap:"+r+" ")[0];if(a){const i=t.parseRtpMap(a),s=t.matchPrefix(e,"a=fmtp:"+r+" ");switch(i.parameters=s.length?t.parseFmtp(s[0]):{},i.rtcpFeedback=t.matchPrefix(e,"a=rtcp-fb:"+r+" ").map(t.parseRtcpFb),n.codecs.push(i),i.name.toUpperCase()){case"RED":case"ULPFEC":n.fecMechanisms.push(i.name.toUpperCase())}}}t.matchPrefix(e,"a=extmap:").forEach((e=>{n.headerExtensions.push(t.parseExtmap(e))}));const s=t.matchPrefix(e,"a=rtcp-fb:* ").map(t.parseRtcpFb);return n.codecs.forEach((e=>{s.forEach((t=>{e.rtcpFeedback.find((e=>e.type===t.type&&e.parameter===t.parameter))||e.rtcpFeedback.push(t)}))})),n},t.writeRtpDescription=function(e,n){let i="";i+="m="+e+" ",i+=n.codecs.length>0?"9":"0",i+=" UDP/TLS/RTP/SAVPF ",i+=n.codecs.map((e=>void 0!==e.preferredPayloadType?e.preferredPayloadType:e.payloadType)).join(" ")+"\r\n",i+="c=IN IP4 0.0.0.0\r\n",i+="a=rtcp:9 IN IP4 0.0.0.0\r\n",n.codecs.forEach((e=>{i+=t.writeRtpMap(e),i+=t.writeFmtp(e),i+=t.writeRtcpFb(e)}));let s=0;return n.codecs.forEach((e=>{e.maxptime>s&&(s=e.maxptime)})),s>0&&(i+="a=maxptime:"+s+"\r\n"),n.headerExtensions&&n.headerExtensions.forEach((e=>{i+=t.writeExtmap(e)})),i},t.parseRtpEncodingParameters=function(e){const n=[],i=t.parseRtpParameters(e),s=-1!==i.fecMechanisms.indexOf("RED"),r=-1!==i.fecMechanisms.indexOf("ULPFEC"),a=t.matchPrefix(e,"a=ssrc:").map((e=>t.parseSsrcMedia(e))).filter((e=>"cname"===e.attribute)),o=a.length>0&&a[0].ssrc;let c;const p=t.matchPrefix(e,"a=ssrc-group:FID").map((e=>e.substring(17).split(" ").map((e=>parseInt(e,10)))));p.length>0&&p[0].length>1&&p[0][0]===o&&(c=p[0][1]),i.codecs.forEach((e=>{if("RTX"===e.name.toUpperCase()&&e.parameters.apt){let t={ssrc:o,codecPayloadType:parseInt(e.parameters.apt,10)};o&&c&&(t.rtx={ssrc:c}),n.push(t),s&&(t=JSON.parse(JSON.stringify(t)),t.fec={ssrc:o,mechanism:r?"red+ulpfec":"red"},n.push(t))}})),0===n.length&&o&&n.push({ssrc:o});let d=t.matchPrefix(e,"b=");return d.length&&(d=0===d[0].indexOf("b=TIAS:")?parseInt(d[0].substring(7),10):0===d[0].indexOf("b=AS:")?1e3*parseInt(d[0].substring(5),10)*.95-16e3:void 0,n.forEach((e=>{e.maxBitrate=d}))),n},t.parseRtcpParameters=function(e){const n={},i=t.matchPrefix(e,"a=ssrc:").map((e=>t.parseSsrcMedia(e))).filter((e=>"cname"===e.attribute))[0];i&&(n.cname=i.value,n.ssrc=i.ssrc);const s=t.matchPrefix(e,"a=rtcp-rsize");n.reducedSize=s.length>0,n.compound=0===s.length;const r=t.matchPrefix(e,"a=rtcp-mux");return n.mux=r.length>0,n},t.writeRtcpParameters=function(e){let t="";return e.reducedSize&&(t+="a=rtcp-rsize\r\n"),e.mux&&(t+="a=rtcp-mux\r\n"),void 0!==e.ssrc&&e.cname&&(t+="a=ssrc:"+e.ssrc+" cname:"+e.cname+"\r\n"),t},t.parseMsid=function(e){let n;const i=t.matchPrefix(e,"a=msid:");if(1===i.length)return n=i[0].substring(7).split(" "),{stream:n[0],track:n[1]};const s=t.matchPrefix(e,"a=ssrc:").map((e=>t.parseSsrcMedia(e))).filter((e=>"msid"===e.attribute));return s.length>0?(n=s[0].value.split(" "),{stream:n[0],track:n[1]}):void 0},t.parseSctpDescription=function(e){const n=t.parseMLine(e),i=t.matchPrefix(e,"a=max-message-size:");let s;i.length>0&&(s=parseInt(i[0].substring(19),10)),isNaN(s)&&(s=65536);const r=t.matchPrefix(e,"a=sctp-port:");if(r.length>0)return{port:parseInt(r[0].substring(12),10),protocol:n.fmt,maxMessageSize:s};const a=t.matchPrefix(e,"a=sctpmap:");if(a.length>0){const e=a[0].substring(10).split(" ");return{port:parseInt(e[0],10),protocol:e[1],maxMessageSize:s}}},t.writeSctpDescription=function(e,t){let n=[];return n="DTLS/SCTP"!==e.protocol?["m="+e.kind+" 9 "+e.protocol+" "+t.protocol+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctp-port:"+t.port+"\r\n"]:["m="+e.kind+" 9 "+e.protocol+" "+t.port+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctpmap:"+t.port+" "+t.protocol+" 65535\r\n"],void 0!==t.maxMessageSize&&n.push("a=max-message-size:"+t.maxMessageSize+"\r\n"),n.join("")},t.generateSessionId=function(){return Math.random().toString().substr(2,22)},t.writeSessionBoilerplate=function(e,n,i){let s;const r=void 0!==n?n:2;s=e||t.generateSessionId();return"v=0\r\no="+(i||"thisisadapterortc")+" "+s+" "+r+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},t.getDirection=function(e,n){const i=t.splitLines(e);for(let e=0;e<i.length;e++)switch(i[e]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return i[e].substring(2)}return n?t.getDirection(n):"sendrecv"},t.getKind=function(e){return t.splitLines(e)[0].split(" ")[0].substring(2)},t.isRejected=function(e){return"0"===e.split(" ",2)[1]},t.parseMLine=function(e){const n=t.splitLines(e)[0].substring(2).split(" ");return{kind:n[0],port:parseInt(n[1],10),protocol:n[2],fmt:n.slice(3).join(" ")}},t.parseOLine=function(e){const n=t.matchPrefix(e,"o=")[0].substring(2).split(" ");return{username:n[0],sessionId:n[1],sessionVersion:parseInt(n[2],10),netType:n[3],addressType:n[4],address:n[5]}},t.isValidSDP=function(e){if("string"!=typeof e||0===e.length)return!1;const n=t.splitLines(e);for(let e=0;e<n.length;e++)if(n[e].length<2||"="!==n[e].charAt(1))return!1;return!0},e.exports=t}({get exports(){return Ri},set exports(e){Ri=e}});var Ti=Ri,Pi=g({__proto__:null,default:Ti},[Ri]);function Ei(e){if(!e.RTCIceCandidate||e.RTCIceCandidate&&"foundation"in e.RTCIceCandidate.prototype)return;const t=e.RTCIceCandidate;e.RTCIceCandidate=function(e){if("object"==typeof e&&e.candidate&&0===e.candidate.indexOf("a=")&&((e=JSON.parse(JSON.stringify(e))).candidate=e.candidate.substr(2)),e.candidate&&e.candidate.length){const n=new t(e),i=Ti.parseCandidate(e.candidate),s=Object.assign(n,i);return s.toJSON=function(){return{candidate:s.candidate,sdpMid:s.sdpMid,sdpMLineIndex:s.sdpMLineIndex,usernameFragment:s.usernameFragment}},s}return new t(e)},e.RTCIceCandidate.prototype=t.prototype,Nn(e,"icecandidate",(t=>(t.candidate&&Object.defineProperty(t,"candidate",{value:new e.RTCIceCandidate(t.candidate),writable:"false"}),t)))}function Oi(e){!e.RTCIceCandidate||e.RTCIceCandidate&&"relayProtocol"in e.RTCIceCandidate.prototype||Nn(e,"icecandidate",(e=>{if(e.candidate){const t=Ti.parseCandidate(e.candidate.candidate);"relay"===t.type&&(e.candidate.relayProtocol={0:"tls",1:"tcp",2:"udp"}[t.priority>>24])}return e}))}function Di(e,t){if(!e.RTCPeerConnection)return;"sctp"in e.RTCPeerConnection.prototype||Object.defineProperty(e.RTCPeerConnection.prototype,"sctp",{get(){return void 0===this._sctp?null:this._sctp}});const n=function(e){if(!e||!e.sdp)return!1;const t=Ti.splitSections(e.sdp);return t.shift(),t.some((e=>{const t=Ti.parseMLine(e);return t&&"application"===t.kind&&-1!==t.protocol.indexOf("SCTP")}))},i=function(e){const t=e.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(null===t||t.length<2)return-1;const n=parseInt(t[1],10);return n!=n?-1:n},s=function(e){let n=65536;return"firefox"===t.browser&&(n=t.version<57?-1===e?16384:2147483637:t.version<60?57===t.version?65535:65536:2147483637),n},r=function(e,n){let i=65536;"firefox"===t.browser&&57===t.version&&(i=65535);const s=Ti.matchPrefix(e.sdp,"a=max-message-size:");return s.length>0?i=parseInt(s[0].substr(19),10):"firefox"===t.browser&&-1!==n&&(i=2147483637),i},a=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,"chrome"===t.browser&&t.version>=76){const{sdpSemantics:e}=this.getConfiguration();"plan-b"===e&&Object.defineProperty(this,"sctp",{get(){return void 0===this._sctp?null:this._sctp},enumerable:!0,configurable:!0})}if(n(arguments[0])){const e=i(arguments[0]),t=s(e),n=r(arguments[0],e);let a;a=0===t&&0===n?Number.POSITIVE_INFINITY:0===t||0===n?Math.max(t,n):Math.min(t,n);const o={};Object.defineProperty(o,"maxMessageSize",{get:()=>a}),this._sctp=o}return a.apply(this,arguments)}}function ji(e){if(!e.RTCPeerConnection||!("createDataChannel"in e.RTCPeerConnection.prototype))return;function t(e,t){const n=e.send;e.send=function(){const i=arguments[0],s=i.length||i.size||i.byteLength;if("open"===e.readyState&&t.sctp&&s>t.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+t.sctp.maxMessageSize+" bytes)");return n.apply(e,arguments)}}const n=e.RTCPeerConnection.prototype.createDataChannel;e.RTCPeerConnection.prototype.createDataChannel=function(){const e=n.apply(this,arguments);return t(e,this),e},Nn(e,"datachannel",(e=>(t(e.channel,e.target),e)))}function Ii(e){if(!e.RTCPeerConnection||"connectionState"in e.RTCPeerConnection.prototype)return;const t=e.RTCPeerConnection.prototype;Object.defineProperty(t,"connectionState",{get(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(t,"onconnectionstatechange",{get(){return this._onconnectionstatechange||null},set(e){this._onconnectionstatechange&&(this.removeEventListener("connectionstatechange",this._onconnectionstatechange),delete this._onconnectionstatechange),e&&this.addEventListener("connectionstatechange",this._onconnectionstatechange=e)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach((e=>{const n=t[e];t[e]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=e=>{const t=e.target;if(t._lastConnectionState!==t.connectionState){t._lastConnectionState=t.connectionState;const n=new Event("connectionstatechange",e);t.dispatchEvent(n)}return e},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),n.apply(this,arguments)}}))}function Mi(e,t){if(!e.RTCPeerConnection)return;if("chrome"===t.browser&&t.version>=71)return;if("safari"===t.browser&&t.version>=605)return;const n=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(t){if(t&&t.sdp&&-1!==t.sdp.indexOf("\na=extmap-allow-mixed")){const n=t.sdp.split("\n").filter((e=>"a=extmap-allow-mixed"!==e.trim())).join("\n");e.RTCSessionDescription&&t instanceof e.RTCSessionDescription?arguments[0]=new e.RTCSessionDescription({type:t.type,sdp:n}):t.sdp=n}return n.apply(this,arguments)}}function Li(e,t){if(!e.RTCPeerConnection||!e.RTCPeerConnection.prototype)return;const n=e.RTCPeerConnection.prototype.addIceCandidate;n&&0!==n.length&&(e.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?("chrome"===t.browser&&t.version<78||"firefox"===t.browser&&t.version<68||"safari"===t.browser)&&arguments[0]&&""===arguments[0].candidate?Promise.resolve():n.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())})}function Ai(e,t){if(!e.RTCPeerConnection||!e.RTCPeerConnection.prototype)return;const n=e.RTCPeerConnection.prototype.setLocalDescription;n&&0!==n.length&&(e.RTCPeerConnection.prototype.setLocalDescription=function(){let e=arguments[0]||{};if("object"!=typeof e||e.type&&e.sdp)return n.apply(this,arguments);if(e={type:e.type,sdp:e.sdp},!e.type)switch(this.signalingState){case"stable":case"have-local-offer":case"have-remote-pranswer":e.type="offer";break;default:e.type="answer"}if(e.sdp||"offer"!==e.type&&"answer"!==e.type)return n.apply(this,[e]);const t="offer"===e.type?this.createOffer:this.createAnswer;return t.apply(this).then((e=>n.apply(this,[e])))})}var Ni=Object.freeze({__proto__:null,shimRTCIceCandidate:Ei,shimRTCIceCandidateRelayProtocol:Oi,shimMaxMessageSize:Di,shimSendThrowTypeError:ji,shimConnectionState:Ii,removeExtmapAllowMixed:Mi,shimAddIceCandidateNullOrEmpty:Li,shimParameterlessSetLocalDescription:Ai});const Bi=function({window:e}={},t={shimChrome:!0,shimFirefox:!0,shimSafari:!0}){const n=Un,i=function(e){const t={browser:null,version:null};if(void 0===e||!e.navigator)return t.browser="Not a browser.",t;const{navigator:n}=e;if(n.mozGetUserMedia)t.browser="firefox",t.version=An(n.userAgent,/Firefox\/(\d+)\./,1);else if(n.webkitGetUserMedia||!1===e.isSecureContext&&e.webkitRTCPeerConnection)t.browser="chrome",t.version=An(n.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else{if(!e.RTCPeerConnection||!n.userAgent.match(/AppleWebKit\/(\d+)\./))return t.browser="Not a supported browser.",t;t.browser="safari",t.version=An(n.userAgent,/AppleWebKit\/(\d+)\./,1),t.supportsUnifiedPlan=e.RTCRtpTransceiver&&"currentDirection"in e.RTCRtpTransceiver.prototype}return t}(e),s={browserDetails:i,commonShim:Ni,extractVersion:An,disableLog:Bn,disableWarnings:Fn,sdp:Pi};switch(i.browser){case"chrome":if(!ii||!ti||!t.shimChrome)return n("Chrome shim is not included in this adapter release."),s;if(null===i.version)return n("Chrome shim can not determine version, not shimming."),s;n("adapter.js shimming chrome."),s.browserShim=ii,Li(e,i),Ai(e),Gn(e,i),Kn(e),ti(e,i),Jn(e),ei(e,i),Qn(e),Yn(e),Xn(e),ni(e,i),Ei(e),Oi(e),Ii(e),Di(e,i),ji(e),Mi(e,i);break;case"firefox":if(!fi||!ai||!t.shimFirefox)return n("Firefox shim is not included in this adapter release."),s;n("adapter.js shimming firefox."),s.browserShim=fi,Li(e,i),Ai(e),si(e,i),ai(e,i),ri(e),pi(e),oi(e),ci(e),di(e),li(e),ui(e),mi(e),hi(e),Ei(e),Ii(e),Di(e,i),ji(e);break;case"safari":if(!Ci||!t.shimSafari)return n("Safari shim is not included in this adapter release."),s;n("adapter.js shimming safari."),s.browserShim=Ci,Li(e,i),Ai(e),xi(e),Si(e),bi(e),gi(e),vi(e),wi(e),yi(e),ki(e),Ei(e),Oi(e),Di(e,i),ji(e),Mi(e,i);break;default:n("Unsupported browser!")}return s}({window:"undefined"==typeof window?void 0:window});var Fi,Ui,zi,qi,$i={},Vi={get exports(){return $i},set exports(e){$i=e}},Hi=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Wi=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],Gi=function(e){var t=e,n=e.indexOf("["),i=e.indexOf("]");-1!=n&&-1!=i&&(e=e.substring(0,n)+e.substring(n,i).replace(/:/g,";")+e.substring(i,e.length));for(var s=Hi.exec(e||""),r={},a=14;a--;)r[Wi[a]]=s[a]||"";return-1!=n&&-1!=i&&(r.source=t,r.host=r.host.substring(1,r.host.length-1).replace(/;/g,":"),r.authority=r.authority.replace("[","").replace("]","").replace(/;/g,":"),r.ipv6uri=!0),r},Ki={},Ji={},Qi={get exports(){return Ji},set exports(e){Ji=e}},Yi={},Xi={get exports(){return Yi},set exports(e){Yi=e}};function Zi(){if(Ui)return Fi;Ui=1;var e=1e3,t=60*e,n=60*t,i=24*n,s=365.25*i;function r(e,t,n){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+n:Math.ceil(e/t)+" "+n+"s"}return Fi=function(a,o){o=o||{};var c=typeof a;if("string"===c&&a.length>0)return function(r){if((r=String(r)).length>1e4)return;var a=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(r);if(!a)return;var o=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return o*s;case"days":case"day":case"d":return o*i;case"hours":case"hour":case"hrs":case"hr":case"h":return o*n;case"minutes":case"minute":case"mins":case"min":case"m":return o*t;case"seconds":case"second":case"secs":case"sec":case"s":return o*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return o;default:return}}(a);if("number"===c&&!1===isNaN(a))return o.long?function(s){return r(s,i,"day")||r(s,n,"hour")||r(s,t,"minute")||r(s,e,"second")||s+" ms"}(a):function(s){if(s>=i)return Math.round(s/i)+"d";if(s>=n)return Math.round(s/n)+"h";if(s>=t)return Math.round(s/t)+"m";if(s>=e)return Math.round(s/e)+"s";return s+"ms"}(a);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(a))},Fi}function es(){return zi||(zi=1,function(e,t){(t=Xi.exports=r.debug=r).coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){t.enable("")},t.enable=function(e){t.save(e);for(var n=(e||"").split(/[\s,]+/),i=n.length,s=0;s<i;s++)n[s]&&("-"===(e=n[s].replace(/[\\^$+?.()|[\]{}]/g,"\\$&").replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){var n,i;for(n=0,i=t.skips.length;n<i;n++)if(t.skips[n].test(e))return!1;for(n=0,i=t.names.length;n<i;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=Zi(),t.names=[],t.skips=[],t.formatters={};var n,i=0;function s(){return t.colors[i++%t.colors.length]}function r(e){function i(){}function r(){var e=r,i=+new Date,a=i-(n||i);e.diff=a,e.prev=n,e.curr=i,n=i,null==e.useColors&&(e.useColors=t.useColors()),null==e.color&&e.useColors&&(e.color=s());for(var o=new Array(arguments.length),c=0;c<o.length;c++)o[c]=arguments[c];o[0]=t.coerce(o[0]),"string"!=typeof o[0]&&(o=["%o"].concat(o));var p=0;o[0]=o[0].replace(/%([a-z%])/g,(function(n,i){if("%%"===n)return n;p++;var s=t.formatters[i];if("function"==typeof s){var r=o[p];n=s.call(e,r),o.splice(p,1),p--}return n})),o=t.formatArgs.apply(e,o);var d=r.log||t.log||console.log.bind(console);d.apply(e,o)}i.enabled=!1,r.enabled=!0;var a=t.enabled(e)?r:i;return a.namespace=e,a}}(0,Yi)),Yi}var ts,ns={},is={get exports(){return ns},set exports(e){ns=e}};!function(s){"undefined"!=typeof process&&"renderer"===process.type?s.exports=(qi||(qi=1,function(e,t){function n(){try{return t.storage.debug}catch(e){}if("undefined"!=typeof process&&"env"in process)return process.env.DEBUG}(t=Qi.exports=es()).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},t.formatArgs=function(){var e=arguments,n=this.useColors;if(e[0]=(n?"%c":"")+this.namespace+(n?" %c":" ")+e[0]+(n?"%c ":" ")+"+"+t.humanize(this.diff),!n)return e;var i="color: "+this.color;e=[e[0],i,"color: inherit"].concat(Array.prototype.slice.call(e,1));var s=0,r=0;return e[0].replace(/%[a-z%]/g,(function(e){"%%"!==e&&(s++,"%c"===e&&(r=s))})),e.splice(r,0,i),e},t.save=function(e){try{null==e?t.storage.removeItem("debug"):t.storage.debug=e}catch(e){}},t.load=n,t.useColors=function(){return"undefined"!=typeof document&&"WebkitAppearance"in document.documentElement.style||window.console&&(console.firebug||console.exception&&console.table)||navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31},t.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},t.enable(n())}(0,Ji)),Ji):s.exports=(ts||(ts=1,function(s,r){var a=e,o=t;(r=is.exports=es()).log=function(){return p.write(o.format.apply(this,arguments)+"\n")},r.formatArgs=function(){for(var e=arguments.length,t=new Array(e),n=this.useColors,i=this.namespace,s=0;s<e;s++)t[s]=arguments[s];if(n){var a=this.color;t[0]=" [3"+a+";1m"+i+" "+t[0],t.push("[3"+a+"m+"+r.humanize(this.diff)+"")}else t[0]=(new Date).toUTCString()+" "+i+" "+t[0];return t},r.save=function(e){null==e?delete process.env.DEBUG:process.env.DEBUG=e},r.load=l,r.useColors=function(){var e=(process.env.DEBUG_COLORS||"").trim().toLowerCase();return 0===e.length?a.isatty(c):"0"!==e&&"no"!==e&&"false"!==e&&"disabled"!==e},r.colors=[6,2,3,4,5,1];var c=parseInt(process.env.DEBUG_FD,10)||2,p=1===c?process.stdout:2===c?process.stderr:function(e){var t;switch(process.binding("tty_wrap").guessHandleType(e)){case"TTY":(t=new a.WriteStream(e))._type="tty",t._handle&&t._handle.unref&&t._handle.unref();break;case"FILE":(t=new n.SyncWriteStream(e,{autoClose:!1}))._type="fs";break;case"PIPE":case"TCP":(t=new i.Socket({fd:e,readable:!1,writable:!0})).readable=!1,t.read=null,t._type="pipe",t._handle&&t._handle.unref&&t._handle.unref();break;default:throw new Error("Implement me. Unknown stream file type!")}return t.fd=e,t._isStdio=!0,t}(c),d=4===o.inspect.length?function(e,t){return o.inspect(e,void 0,void 0,t)}:function(e,t){return o.inspect(e,{colors:t})};function l(){return process.env.DEBUG}r.formatters.o=r.formatters.O=function(e){return d(e,this.useColors).replace(/\s*\n\s*/g," ")},r.enable(l())}(0,ns)),ns)}({get exports(){return Ki},set exports(e){Ki=e}});var ss=Gi,rs=Ki("socket.io-client:url"),as=function(e,t){var n=e;t=t||Zt.location,null==e&&(e=t.protocol+"//"+t.host);"string"==typeof e&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?t.protocol+e:t.host+e),/^(https?|wss?):\/\//.test(e)||(rs("protocol-less url %s",e),e=void 0!==t?t.protocol+"//"+e:"https://"+e),rs("parse %s",e),n=ss(e));n.port||(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443"));n.path=n.path||"/";var i=-1!==n.host.indexOf(":")?"["+n.host+"]":n.host;return n.id=n.protocol+"://"+i+":"+n.port,n.href=n.protocol+"://"+i+(t&&t.port===n.port?"":":"+n.port),n};var os={},cs={},ps={get exports(){return cs},set exports(e){cs=e}},ds={},ls={get exports(){return ds},set exports(e){ds=e}},us=1e3,ms=60*us,hs=60*ms,fs=24*hs,gs=365.25*fs,vs=function(e,t){return t=t||{},"string"==typeof e?function(e){if((e=""+e).length>1e4)return;var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!t)return;var n=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return n*gs;case"days":case"day":case"d":return n*fs;case"hours":case"hour":case"hrs":case"hr":case"h":return n*hs;case"minutes":case"minute":case"mins":case"min":case"m":return n*ms;case"seconds":case"second":case"secs":case"sec":case"s":return n*us;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n}}(e):t.long?function(e){return bs(e,fs,"day")||bs(e,hs,"hour")||bs(e,ms,"minute")||bs(e,us,"second")||e+" ms"}(e):function(e){return e>=fs?Math.round(e/fs)+"d":e>=hs?Math.round(e/hs)+"h":e>=ms?Math.round(e/ms)+"m":e>=us?Math.round(e/us)+"s":e+"ms"}(e)};function bs(e,t,n){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+n:Math.ceil(e/t)+" "+n+"s"}!function(e,t){t=ls.exports=function(e){function i(){}function r(){var e=r,i=+new Date,a=i-(n||i);e.diff=a,e.prev=n,e.curr=i,n=i,null==e.useColors&&(e.useColors=t.useColors()),null==e.color&&e.useColors&&(e.color=s());var o=Array.prototype.slice.call(arguments);o[0]=t.coerce(o[0]),"string"!=typeof o[0]&&(o=["%o"].concat(o));var c=0;o[0]=o[0].replace(/%([a-z%])/g,(function(n,i){if("%%"===n)return n;c++;var s=t.formatters[i];if("function"==typeof s){var r=o[c];n=s.call(e,r),o.splice(c,1),c--}return n})),"function"==typeof t.formatArgs&&(o=t.formatArgs.apply(e,o));var p=r.log||t.log||console.log.bind(console);p.apply(e,o)}i.enabled=!1,r.enabled=!0;var a=t.enabled(e)?r:i;return a.namespace=e,a},t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){t.enable("")},t.enable=function(e){t.save(e);for(var n=(e||"").split(/[\s,]+/),i=n.length,s=0;s<i;s++)n[s]&&("-"===(e=n[s].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){var n,i;for(n=0,i=t.skips.length;n<i;n++)if(t.skips[n].test(e))return!1;for(n=0,i=t.names.length;n<i;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=vs,t.names=[],t.skips=[],t.formatters={};var n,i=0;function s(){return t.colors[i++%t.colors.length]}}(0,ds),function(s,r){var a=e,o=t;(r=ps.exports=ds).log=function(){return p.write(o.format.apply(this,arguments)+"\n")},r.formatArgs=function(){var e=arguments,t=this.useColors,n=this.namespace;if(t){var i=this.color;e[0]=" [3"+i+";1m"+n+" "+e[0]+"[3"+i+"m +"+r.humanize(this.diff)+""}else e[0]=(new Date).toUTCString()+" "+n+" "+e[0];return e},r.save=function(e){null==e?delete process.env.DEBUG:process.env.DEBUG=e},r.load=l,r.useColors=function(){var e=(process.env.DEBUG_COLORS||"").trim().toLowerCase();return 0===e.length?a.isatty(c):"0"!==e&&"no"!==e&&"false"!==e&&"disabled"!==e},r.colors=[6,2,3,4,5,1];var c=parseInt(process.env.DEBUG_FD,10)||2,p=1===c?process.stdout:2===c?process.stderr:function(e){var t;switch(process.binding("tty_wrap").guessHandleType(e)){case"TTY":(t=new a.WriteStream(e))._type="tty",t._handle&&t._handle.unref&&t._handle.unref();break;case"FILE":(t=new n.SyncWriteStream(e,{autoClose:!1}))._type="fs";break;case"PIPE":case"TCP":(t=new i.Socket({fd:e,readable:!1,writable:!0})).readable=!1,t.read=null,t._type="pipe",t._handle&&t._handle.unref&&t._handle.unref();break;default:throw new Error("Implement me. Unknown stream file type!")}return t.fd=e,t._isStdio=!0,t}(c);var d=4===o.inspect.length?function(e,t){return o.inspect(e,void 0,void 0,t)}:function(e,t){return o.inspect(e,{colors:t})};function l(){return process.env.DEBUG}r.formatters.o=function(e){return d(e,this.useColors).replace(/\s*\n\s*/g," ")},r.enable(l())}(0,cs);var ys={};
16
16
  /*! JSON v3.3.2 | http://bestiejs.github.io/json3 | Copyright 2012-2014, Kit Cambridge | http://kit.mit-license.org */
17
- !function(e,t){(function(){var n={function:!0,object:!0},i=t&&!t.nodeType&&t,s=n[typeof window]&&window||this,r=i&&n.object&&e&&!e.nodeType&&"object"==typeof Xt&&Xt;function a(e,t){e||(e=s.Object()),t||(t=s.Object());var i=e.Number||s.Number,r=e.String||s.String,o=e.Object||s.Object,c=e.Date||s.Date,p=e.SyntaxError||s.SyntaxError,d=e.TypeError||s.TypeError,l=e.Math||s.Math,u=e.JSON||s.JSON;"object"==typeof u&&u&&(t.stringify=u.stringify,t.parse=u.parse);var m,h,f,g=o.prototype,v=g.toString,b=new c(-0xc782b5b800cec);try{b=-109252==b.getUTCFullYear()&&0===b.getUTCMonth()&&1===b.getUTCDate()&&10==b.getUTCHours()&&37==b.getUTCMinutes()&&6==b.getUTCSeconds()&&708==b.getUTCMilliseconds()}catch(e){}function y(e){if(y[e]!==f)return y[e];var n;if("bug-string-char-index"==e)n="a"!="a"[0];else if("json"==e)n=y("json-stringify")&&y("json-parse");else{var s,a='{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';if("json-stringify"==e){var o=t.stringify,p="function"==typeof o&&b;if(p){(s=function(){return 1}).toJSON=s;try{p="0"===o(0)&&"0"===o(new i)&&'""'==o(new r)&&o(v)===f&&o(f)===f&&o()===f&&"1"===o(s)&&"[1]"==o([s])&&"[null]"==o([f])&&"null"==o(null)&&"[null,null,null]"==o([f,v,null])&&o({a:[s,!0,!1,null,"\0\b\n\f\r\t"]})==a&&"1"===o(null,s)&&"[\n 1,\n 2\n]"==o([1,2],null,1)&&'"-271821-04-20T00:00:00.000Z"'==o(new c(-864e13))&&'"+275760-09-13T00:00:00.000Z"'==o(new c(864e13))&&'"-000001-01-01T00:00:00.000Z"'==o(new c(-621987552e5))&&'"1969-12-31T23:59:59.999Z"'==o(new c(-1))}catch(e){p=!1}}n=p}if("json-parse"==e){var d=t.parse;if("function"==typeof d)try{if(0===d("0")&&!d(!1)){var l=5==(s=d(a)).a.length&&1===s.a[0];if(l){try{l=!d('"\t"')}catch(e){}if(l)try{l=1!==d("01")}catch(e){}if(l)try{l=1!==d("1.")}catch(e){}}}}catch(e){l=!1}n=l}}return y[e]=!!n}if(!y("json")){var _="[object Function]",x="[object Number]",w="[object String]",S="[object Array]",k=y("bug-string-char-index");if(!b)var C=l.floor,R=[0,31,59,90,120,151,181,212,243,273,304,334],T=function(e,t){return R[t]+365*(e-1970)+C((e-1969+(t=+(t>1)))/4)-C((e-1901+t)/100)+C((e-1601+t)/400)};if((m=g.hasOwnProperty)||(m=function(e){var t,n={};return(n.__proto__=null,n.__proto__={toString:1},n).toString!=v?m=function(e){var t=this.__proto__,n=e in(this.__proto__=null,this);return this.__proto__=t,n}:(t=n.constructor,m=function(e){var n=(this.constructor||t).prototype;return e in this&&!(e in n&&this[e]===n[e])}),n=null,m.call(this,e)}),h=function(e,t){var i,s,r,a=0;for(r in(i=function(){this.valueOf=0}).prototype.valueOf=0,s=new i)m.call(s,r)&&a++;return i=s=null,a?h=2==a?function(e,t){var n,i={},s=v.call(e)==_;for(n in e)s&&"prototype"==n||m.call(i,n)||!(i[n]=1)||!m.call(e,n)||t(n)}:function(e,t){var n,i,s=v.call(e)==_;for(n in e)s&&"prototype"==n||!m.call(e,n)||(i="constructor"===n)||t(n);(i||m.call(e,n="constructor"))&&t(n)}:(s=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"],h=function(e,t){var i,r,a=v.call(e)==_,o=!a&&"function"!=typeof e.constructor&&n[typeof e.hasOwnProperty]&&e.hasOwnProperty||m;for(i in e)a&&"prototype"==i||!o.call(e,i)||t(i);for(r=s.length;i=s[--r];o.call(e,i)&&t(i));}),h(e,t)},!y("json-stringify")){var P={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"},E=function(e,t){return("000000"+(t||0)).slice(-e)},O=function(e){for(var t='"',n=0,i=e.length,s=!k||i>10,r=s&&(k?e.split(""):e);n<i;n++){var a=e.charCodeAt(n);switch(a){case 8:case 9:case 10:case 12:case 13:case 34:case 92:t+=P[a];break;default:if(a<32){t+="\\u00"+E(2,a.toString(16));break}t+=s?r[n]:e.charAt(n)}}return t+'"'},D=function(e,t,n,i,s,r,a){var o,c,p,l,u,g,b,y,_,k,R,P,j,I,M,L;try{o=t[e]}catch(e){}if("object"==typeof o&&o)if("[object Date]"!=(c=v.call(o))||m.call(o,"toJSON"))"function"==typeof o.toJSON&&(c!=x&&c!=w&&c!=S||m.call(o,"toJSON"))&&(o=o.toJSON(e));else if(o>-1/0&&o<1/0){if(T){for(u=C(o/864e5),p=C(u/365.2425)+1970-1;T(p+1,0)<=u;p++);for(l=C((u-T(p,0))/30.42);T(p,l+1)<=u;l++);u=1+u-T(p,l),b=C((g=(o%864e5+864e5)%864e5)/36e5)%24,y=C(g/6e4)%60,_=C(g/1e3)%60,k=g%1e3}else p=o.getUTCFullYear(),l=o.getUTCMonth(),u=o.getUTCDate(),b=o.getUTCHours(),y=o.getUTCMinutes(),_=o.getUTCSeconds(),k=o.getUTCMilliseconds();o=(p<=0||p>=1e4?(p<0?"-":"+")+E(6,p<0?-p:p):E(4,p))+"-"+E(2,l+1)+"-"+E(2,u)+"T"+E(2,b)+":"+E(2,y)+":"+E(2,_)+"."+E(3,k)+"Z"}else o=null;if(n&&(o=n.call(t,e,o)),null===o)return"null";if("[object Boolean]"==(c=v.call(o)))return""+o;if(c==x)return o>-1/0&&o<1/0?""+o:"null";if(c==w)return O(""+o);if("object"==typeof o){for(I=a.length;I--;)if(a[I]===o)throw d();if(a.push(o),R=[],M=r,r+=s,c==S){for(j=0,I=o.length;j<I;j++)P=D(j,o,n,i,s,r,a),R.push(P===f?"null":P);L=R.length?s?"[\n"+r+R.join(",\n"+r)+"\n"+M+"]":"["+R.join(",")+"]":"[]"}else h(i||o,(function(e){var t=D(e,o,n,i,s,r,a);t!==f&&R.push(O(e)+":"+(s?" ":"")+t)})),L=R.length?s?"{\n"+r+R.join(",\n"+r)+"\n"+M+"}":"{"+R.join(",")+"}":"{}";return a.pop(),L}};t.stringify=function(e,t,i){var s,r,a,o;if(n[typeof t]&&t)if((o=v.call(t))==_)r=t;else if(o==S){a={};for(var c,p=0,d=t.length;p<d;c=t[p++],((o=v.call(c))==w||o==x)&&(a[c]=1));}if(i)if((o=v.call(i))==x){if((i-=i%1)>0)for(s="",i>10&&(i=10);s.length<i;s+=" ");}else o==w&&(s=i.length<=10?i:i.slice(0,10));return D("",((c={})[""]=e,c),r,a,s,"",[])}}if(!y("json-parse")){var j,I,M=r.fromCharCode,L={92:"\\",34:'"',47:"/",98:"\b",116:"\t",110:"\n",102:"\f",114:"\r"},A=function(){throw j=I=null,p()},N=function(){for(var e,t,n,i,s,r=I,a=r.length;j<a;)switch(s=r.charCodeAt(j)){case 9:case 10:case 13:case 32:j++;break;case 123:case 125:case 91:case 93:case 58:case 44:return e=k?r.charAt(j):r[j],j++,e;case 34:for(e="@",j++;j<a;)if((s=r.charCodeAt(j))<32)A();else if(92==s)switch(s=r.charCodeAt(++j)){case 92:case 34:case 47:case 98:case 116:case 110:case 102:case 114:e+=L[s],j++;break;case 117:for(t=++j,n=j+4;j<n;j++)(s=r.charCodeAt(j))>=48&&s<=57||s>=97&&s<=102||s>=65&&s<=70||A();e+=M("0x"+r.slice(t,j));break;default:A()}else{if(34==s)break;for(s=r.charCodeAt(j),t=j;s>=32&&92!=s&&34!=s;)s=r.charCodeAt(++j);e+=r.slice(t,j)}if(34==r.charCodeAt(j))return j++,e;A();default:if(t=j,45==s&&(i=!0,s=r.charCodeAt(++j)),s>=48&&s<=57){for(48==s&&((s=r.charCodeAt(j+1))>=48&&s<=57)&&A(),i=!1;j<a&&((s=r.charCodeAt(j))>=48&&s<=57);j++);if(46==r.charCodeAt(j)){for(n=++j;n<a&&((s=r.charCodeAt(n))>=48&&s<=57);n++);n==j&&A(),j=n}if(101==(s=r.charCodeAt(j))||69==s){for(43!=(s=r.charCodeAt(++j))&&45!=s||j++,n=j;n<a&&((s=r.charCodeAt(n))>=48&&s<=57);n++);n==j&&A(),j=n}return+r.slice(t,j)}if(i&&A(),"true"==r.slice(j,j+4))return j+=4,!0;if("false"==r.slice(j,j+5))return j+=5,!1;if("null"==r.slice(j,j+4))return j+=4,null;A()}return"$"},B=function(e){var t,n;if("$"==e&&A(),"string"==typeof e){if("@"==(k?e.charAt(0):e[0]))return e.slice(1);if("["==e){for(t=[];"]"!=(e=N());n||(n=!0))n&&(","==e?"]"==(e=N())&&A():A()),","==e&&A(),t.push(B(e));return t}if("{"==e){for(t={};"}"!=(e=N());n||(n=!0))n&&(","==e?"}"==(e=N())&&A():A()),","!=e&&"string"==typeof e&&"@"==(k?e.charAt(0):e[0])&&":"==N()||A(),t[e.slice(1)]=B(N());return t}A()}return e},F=function(e,t,n){var i=U(e,t,n);i===f?delete e[t]:e[t]=i},U=function(e,t,n){var i,s=e[t];if("object"==typeof s&&s)if(v.call(s)==S)for(i=s.length;i--;)F(s,i,n);else h(s,(function(e){F(s,e,n)}));return n.call(e,t,s)};t.parse=function(e,t){var n,i;return j=0,I=""+e,n=B(N()),"$"!=N()&&A(),j=I=null,t&&v.call(t)==_?U(((i={})[""]=n,i),"",t):n}}}return t.runInContext=a,t}if(!r||r.global!==r&&r.window!==r&&r.self!==r||(s=r),i)a(s,i);else{var o=s.JSON,c=s.JSON3,p=!1,d=a(s,s.JSON3={noConflict:function(){return p||(p=!0,s.JSON=o,s.JSON3=c,o=c=null),d}});s.JSON={parse:d.parse,stringify:d.stringify}}}).call(Xt)}({get exports(){return ys},set exports(e){ys=e}},ys);var _s=xs;function xs(e){if(e)return function(e){for(var t in xs.prototype)e[t]=xs.prototype[t];return e}(e)}xs.prototype.on=xs.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks[e]=this._callbacks[e]||[]).push(t),this},xs.prototype.once=function(e,t){var n=this;function i(){n.off(e,i),t.apply(this,arguments)}return this._callbacks=this._callbacks||{},i.fn=t,this.on(e,i),this},xs.prototype.off=xs.prototype.removeListener=xs.prototype.removeAllListeners=xs.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,i=this._callbacks[e];if(!i)return this;if(1==arguments.length)return delete this._callbacks[e],this;for(var s=0;s<i.length;s++)if((n=i[s])===t||n.fn===t){i.splice(s,1);break}return this},xs.prototype.emit=function(e){this._callbacks=this._callbacks||{};var t=[].slice.call(arguments,1),n=this._callbacks[e];if(n)for(var i=0,s=(n=n.slice(0)).length;i<s;++i)n[i].apply(this,t);return this},xs.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks[e]||[]},xs.prototype.hasListeners=function(e){return!!this.listeners(e).length};var ws={},Ss=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)},ks=function(e){return Xt.Buffer&&Xt.Buffer.isBuffer(e)||Xt.ArrayBuffer&&e instanceof ArrayBuffer};var Cs=Ss,Rs=ks;ws.deconstructPacket=function(e){var t=[],n=e.data;var i=e;return i.data=function e(n){if(!n)return n;if(Rs(n)){var i={_placeholder:!0,num:t.length};return t.push(n),i}if(Cs(n)){for(var s=new Array(n.length),r=0;r<n.length;r++)s[r]=e(n[r]);return s}if("object"==typeof n&&!(n instanceof Date)){s={};for(var a in n)s[a]=e(n[a]);return s}return n}(n),i.attachments=t.length,{packet:i,buffers:t}},ws.reconstructPacket=function(e,t){return e.data=function e(n){if(n&&n._placeholder)return t[n.num];if(Cs(n)){for(var i=0;i<n.length;i++)n[i]=e(n[i]);return n}if(n&&"object"==typeof n){for(var s in n)n[s]=e(n[s]);return n}return n}(e.data),e.attachments=void 0,e},ws.removeBlobs=function(e,t){var n=0,i=e;!function e(s,r,a){if(!s)return s;if(Xt.Blob&&s instanceof Blob||Xt.File&&s instanceof File){n++;var o=new FileReader;o.onload=function(){a?a[r]=this.result:i=this.result,--n||t(i)},o.readAsArrayBuffer(s)}else if(Cs(s))for(var c=0;c<s.length;c++)e(s[c],c,s);else if(s&&"object"==typeof s&&!Rs(s))for(var p in s)e(s[p],p,s)}(i),n||t(i)},function(e){var t=cs("socket.io-parser"),n=ys,i=_s,s=ws,r=ks;function a(){}function o(i){var s="",r=!1;return s+=i.type,e.BINARY_EVENT!=i.type&&e.BINARY_ACK!=i.type||(s+=i.attachments,s+="-"),i.nsp&&"/"!=i.nsp&&(r=!0,s+=i.nsp),null!=i.id&&(r&&(s+=",",r=!1),s+=i.id),null!=i.data&&(r&&(s+=","),s+=n.stringify(i.data)),t("encoded %j as %s",i,s),s}function c(){this.reconstructor=null}function p(e){this.reconPack=e,this.buffers=[]}function d(t){return{type:e.ERROR,data:"parser error"}}e.protocol=4,e.types=["CONNECT","DISCONNECT","EVENT","ACK","ERROR","BINARY_EVENT","BINARY_ACK"],e.CONNECT=0,e.DISCONNECT=1,e.EVENT=2,e.ACK=3,e.ERROR=4,e.BINARY_EVENT=5,e.BINARY_ACK=6,e.Encoder=a,e.Decoder=c,a.prototype.encode=function(n,i){(t("encoding packet %j",n),e.BINARY_EVENT==n.type||e.BINARY_ACK==n.type)?function(e,t){function n(e){var n=s.deconstructPacket(e),i=o(n.packet),r=n.buffers;r.unshift(i),t(r)}s.removeBlobs(e,n)}(n,i):i([o(n)])},i(c.prototype),c.prototype.add=function(i){var s;if("string"==typeof i)s=function(i){var s={},r=0;if(s.type=Number(i.charAt(0)),null==e.types[s.type])return d();if(e.BINARY_EVENT==s.type||e.BINARY_ACK==s.type){for(var a="";"-"!=i.charAt(++r)&&(a+=i.charAt(r),r!=i.length););if(a!=Number(a)||"-"!=i.charAt(r))throw new Error("Illegal attachments");s.attachments=Number(a)}if("/"==i.charAt(r+1))for(s.nsp="";++r;){if(","==(c=i.charAt(r)))break;if(s.nsp+=c,r==i.length)break}else s.nsp="/";var o=i.charAt(r+1);if(""!==o&&Number(o)==o){for(s.id="";++r;){var c;if(null==(c=i.charAt(r))||Number(c)!=c){--r;break}if(s.id+=i.charAt(r),r==i.length)break}s.id=Number(s.id)}i.charAt(++r)&&(s=function(e,t){try{e.data=n.parse(t)}catch(e){return d()}return e}(s,i.substr(r)));return t("decoded %s as %j",i,s),s}(i),e.BINARY_EVENT==s.type||e.BINARY_ACK==s.type?(this.reconstructor=new p(s),0===this.reconstructor.reconPack.attachments&&this.emit("decoded",s)):this.emit("decoded",s);else{if(!r(i)&&!i.base64)throw new Error("Unknown type: "+i);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");(s=this.reconstructor.takeBinaryData(i))&&(this.reconstructor=null,this.emit("decoded",s))}},c.prototype.destroy=function(){this.reconstructor&&this.reconstructor.finishedReconstruction()},p.prototype.takeBinaryData=function(e){if(this.buffers.push(e),this.buffers.length==this.reconPack.attachments){var t=s.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null},p.prototype.finishedReconstruction=function(){this.reconPack=null,this.buffers=[]}}(os);var Ts={},Ps={get exports(){return Ts},set exports(e){Ts=e}},Es={},Os={get exports(){return Es},set exports(e){Es=e}},Ds={},js=n,Is=s,Ms=r.spawn,Ls=As;function As(e){e=e||{};var t,n,i=this,s=a,r=o,c={},p=!1,d={"User-Agent":"node-XMLHttpRequest",Accept:"*/*"},l=Object.assign({},d),u=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","content-transfer-encoding","cookie","cookie2","date","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"],m=["TRACE","TRACK","CONNECT"],h=!1,f=!1,g=!1,v={};this.UNSENT=0,this.OPENED=1,this.HEADERS_RECEIVED=2,this.LOADING=3,this.DONE=4,this.readyState=this.UNSENT,this.onreadystatechange=null,this.responseText="",this.responseXML="",this.status=null,this.statusText=null;this.open=function(e,t,n,i,s){if(this.abort(),f=!1,g=!1,!function(e){return e&&-1===m.indexOf(e)}(e))throw new Error("SecurityError: Request method not allowed");c={method:e,url:t.toString(),async:"boolean"!=typeof n||n,user:i||null,password:s||null},b(this.OPENED)},this.setDisableHeaderCheck=function(e){p=e},this.setRequestHeader=function(e,t){if(this.readyState!=this.OPENED)throw new Error("INVALID_STATE_ERR: setRequestHeader can only be called when state is OPEN");if(!function(e){return p||e&&-1===u.indexOf(e.toLowerCase())}(e))return console.warn('Refused to set unsafe header "'+e+'"'),!1;if(h)throw new Error("INVALID_STATE_ERR: send flag is true");return l[e]=t,!0},this.getResponseHeader=function(e){return"string"==typeof e&&this.readyState>this.OPENED&&n.headers[e.toLowerCase()]&&!f?n.headers[e.toLowerCase()]:null},this.getAllResponseHeaders=function(){if(this.readyState<this.HEADERS_RECEIVED||f)return"";var e="";for(var t in n.headers)"set-cookie"!==t&&"set-cookie2"!==t&&(e+=t+": "+n.headers[t]+"\r\n");return e.substr(0,e.length-2)},this.getRequestHeader=function(e){return"string"==typeof e&&l[e]?l[e]:""},this.send=function(a){if(this.readyState!=this.OPENED)throw new Error("INVALID_STATE_ERR: connection must be opened before send() is called");if(h)throw new Error("INVALID_STATE_ERR: send has already been called");var o,p=!1,d=!1,u=Is.parse(c.url);switch(u.protocol){case"https:":p=!0;case"http:":o=u.hostname;break;case"file:":d=!0;break;case void 0:case"":o="localhost";break;default:throw new Error("Protocol not supported.")}if(d){if("GET"!==c.method)throw new Error("XMLHttpRequest: Only GET method is supported");if(c.async)js.readFile(unescape(u.pathname),"utf8",(function(e,t){e?i.handleError(e):(i.status=200,i.responseText=t,b(i.DONE))}));else try{this.responseText=js.readFileSync(unescape(u.pathname),"utf8"),this.status=200,b(i.DONE)}catch(e){this.handleError(e)}}else{var m=u.port||(p?443:80),g=u.pathname+(u.search?u.search:"");if(l.Host=o,p&&443===m||80===m||(l.Host+=":"+u.port),c.user){void 0===c.password&&(c.password="");var v=new Buffer(c.user+":"+c.password);l.Authorization="Basic "+v.toString("base64")}"GET"===c.method||"HEAD"===c.method?a=null:a?(l["Content-Length"]=Buffer.isBuffer(a)?a.length:Buffer.byteLength(a),l["Content-Type"]||(l["Content-Type"]="text/plain;charset=UTF-8")):"POST"===c.method&&(l["Content-Length"]=0);var y=e.agent||!1,_={host:o,port:m,path:g,method:c.method,headers:l,agent:y};if(p&&(_.pfx=e.pfx,_.key=e.key,_.passphrase=e.passphrase,_.cert=e.cert,_.ca=e.ca,_.ciphers=e.ciphers,_.rejectUnauthorized=!1!==e.rejectUnauthorized),f=!1,c.async){var x=p?r.request:s.request;h=!0,i.dispatchEvent("readystatechange");var w=function(s){if(302===(n=s).statusCode||303===n.statusCode||307===n.statusCode){c.url=n.headers.location;var r=Is.parse(c.url);o=r.hostname;var a={hostname:r.hostname,port:r.port,path:r.path,method:303===n.statusCode?"GET":c.method,headers:l};return p&&(a.pfx=e.pfx,a.key=e.key,a.passphrase=e.passphrase,a.cert=e.cert,a.ca=e.ca,a.ciphers=e.ciphers,a.rejectUnauthorized=!1!==e.rejectUnauthorized),void(t=x(a,w).on("error",S)).end()}n&&n.setEncoding&&n.setEncoding("utf8"),b(i.HEADERS_RECEIVED),i.status=n.statusCode,n.on("data",(function(e){e&&(i.responseText+=e),h&&b(i.LOADING)})),n.on("end",(function(){h&&(h=!1,b(i.DONE))})),n.on("error",(function(e){i.handleError(e)}))},S=function(e){i.handleError(e)};t=x(_,w).on("error",S),a&&t.write(a),t.end(),i.dispatchEvent("loadstart")}else{var k=".node-xmlhttprequest-content-"+process.pid,C=".node-xmlhttprequest-sync-"+process.pid;js.writeFileSync(C,"","utf8");for(var R="var http = require('http'), https = require('https'), fs = require('fs');var doRequest = http"+(p?"s":"")+".request;var options = "+JSON.stringify(_)+";var responseText = '';var req = doRequest(options, function(response) {response.setEncoding('utf8');response.on('data', function(chunk) { responseText += chunk;});response.on('end', function() {fs.writeFileSync('"+k+"', 'NODE-XMLHTTPREQUEST-STATUS:' + response.statusCode + ',' + responseText, 'utf8');fs.unlinkSync('"+C+"');});response.on('error', function(error) {fs.writeFileSync('"+k+"', 'NODE-XMLHTTPREQUEST-ERROR:' + JSON.stringify(error), 'utf8');fs.unlinkSync('"+C+"');});}).on('error', function(error) {fs.writeFileSync('"+k+"', 'NODE-XMLHTTPREQUEST-ERROR:' + JSON.stringify(error), 'utf8');fs.unlinkSync('"+C+"');});"+(a?"req.write('"+JSON.stringify(a).slice(1,-1).replace(/'/g,"\\'")+"');":"")+"req.end();",T=Ms(process.argv[0],["-e",R]);js.existsSync(C););if(i.responseText=js.readFileSync(k,"utf8"),T.stdin.end(),js.unlinkSync(k),i.responseText.match(/^NODE-XMLHTTPREQUEST-ERROR:/)){var P=i.responseText.replace(/^NODE-XMLHTTPREQUEST-ERROR:/,"");i.handleError(P,503)}else i.status=i.responseText.replace(/^NODE-XMLHTTPREQUEST-STATUS:([0-9]*),.*/,"$1"),i.responseText=i.responseText.replace(/^NODE-XMLHTTPREQUEST-STATUS:[0-9]*,(.*)/,"$1"),b(i.DONE)}}},this.handleError=function(e,t){this.status=t||0,this.statusText=e,this.responseText=e.stack,f=!0,b(this.DONE)},this.abort=function(){t&&(t.abort(),t=null),l=Object.assign({},d),this.responseText="",this.responseXML="",f=g=!0,this.readyState===this.UNSENT||this.readyState===this.OPENED&&!h||this.readyState===this.DONE||(h=!1,b(this.DONE)),this.readyState=this.UNSENT},this.addEventListener=function(e,t){e in v||(v[e]=[]),v[e].push(t)},this.removeEventListener=function(e,t){e in v&&(v[e]=v[e].filter((function(e){return e!==t})))},this.dispatchEvent=function(e){if("function"==typeof i["on"+e]&&(this.readyState===this.DONE?setImmediate((function(){i["on"+e]()})):i["on"+e]()),e in v)for(let t=0,n=v[e].length;t<n;t++)this.readyState===this.DONE?setImmediate((function(){v[e][t].call(i)})):v[e][t].call(i)};var b=function(e){if(!(i.readyState===e||i.readyState===i.UNSENT&&g)&&(i.readyState=e,(c.async||i.readyState<i.OPENED||i.readyState===i.DONE)&&i.dispatchEvent("readystatechange"),i.readyState===i.DONE)){let e;e=g?"abort":f?"error":"load",i.dispatchEvent(e),i.dispatchEvent("loadend")}}}As.XMLHttpRequest=As;var Ns={},Bs={get exports(){return Ns},set exports(e){Ns=e}},Fs={},Us={get exports(){return Fs},set exports(e){Fs=e}},zs={},qs={};
17
+ !function(e,t){(function(){var n={function:!0,object:!0},i=t&&!t.nodeType&&t,s=n[typeof window]&&window||this,r=i&&n.object&&e&&!e.nodeType&&"object"==typeof Zt&&Zt;function a(e,t){e||(e=s.Object()),t||(t=s.Object());var i=e.Number||s.Number,r=e.String||s.String,o=e.Object||s.Object,c=e.Date||s.Date,p=e.SyntaxError||s.SyntaxError,d=e.TypeError||s.TypeError,l=e.Math||s.Math,u=e.JSON||s.JSON;"object"==typeof u&&u&&(t.stringify=u.stringify,t.parse=u.parse);var m,h,f,g=o.prototype,v=g.toString,b=new c(-0xc782b5b800cec);try{b=-109252==b.getUTCFullYear()&&0===b.getUTCMonth()&&1===b.getUTCDate()&&10==b.getUTCHours()&&37==b.getUTCMinutes()&&6==b.getUTCSeconds()&&708==b.getUTCMilliseconds()}catch(e){}function y(e){if(y[e]!==f)return y[e];var n;if("bug-string-char-index"==e)n="a"!="a"[0];else if("json"==e)n=y("json-stringify")&&y("json-parse");else{var s,a='{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';if("json-stringify"==e){var o=t.stringify,p="function"==typeof o&&b;if(p){(s=function(){return 1}).toJSON=s;try{p="0"===o(0)&&"0"===o(new i)&&'""'==o(new r)&&o(v)===f&&o(f)===f&&o()===f&&"1"===o(s)&&"[1]"==o([s])&&"[null]"==o([f])&&"null"==o(null)&&"[null,null,null]"==o([f,v,null])&&o({a:[s,!0,!1,null,"\0\b\n\f\r\t"]})==a&&"1"===o(null,s)&&"[\n 1,\n 2\n]"==o([1,2],null,1)&&'"-271821-04-20T00:00:00.000Z"'==o(new c(-864e13))&&'"+275760-09-13T00:00:00.000Z"'==o(new c(864e13))&&'"-000001-01-01T00:00:00.000Z"'==o(new c(-621987552e5))&&'"1969-12-31T23:59:59.999Z"'==o(new c(-1))}catch(e){p=!1}}n=p}if("json-parse"==e){var d=t.parse;if("function"==typeof d)try{if(0===d("0")&&!d(!1)){var l=5==(s=d(a)).a.length&&1===s.a[0];if(l){try{l=!d('"\t"')}catch(e){}if(l)try{l=1!==d("01")}catch(e){}if(l)try{l=1!==d("1.")}catch(e){}}}}catch(e){l=!1}n=l}}return y[e]=!!n}if(!y("json")){var _="[object Function]",x="[object Number]",w="[object String]",S="[object Array]",k=y("bug-string-char-index");if(!b)var C=l.floor,R=[0,31,59,90,120,151,181,212,243,273,304,334],T=function(e,t){return R[t]+365*(e-1970)+C((e-1969+(t=+(t>1)))/4)-C((e-1901+t)/100)+C((e-1601+t)/400)};if((m=g.hasOwnProperty)||(m=function(e){var t,n={};return(n.__proto__=null,n.__proto__={toString:1},n).toString!=v?m=function(e){var t=this.__proto__,n=e in(this.__proto__=null,this);return this.__proto__=t,n}:(t=n.constructor,m=function(e){var n=(this.constructor||t).prototype;return e in this&&!(e in n&&this[e]===n[e])}),n=null,m.call(this,e)}),h=function(e,t){var i,s,r,a=0;for(r in(i=function(){this.valueOf=0}).prototype.valueOf=0,s=new i)m.call(s,r)&&a++;return i=s=null,a?h=2==a?function(e,t){var n,i={},s=v.call(e)==_;for(n in e)s&&"prototype"==n||m.call(i,n)||!(i[n]=1)||!m.call(e,n)||t(n)}:function(e,t){var n,i,s=v.call(e)==_;for(n in e)s&&"prototype"==n||!m.call(e,n)||(i="constructor"===n)||t(n);(i||m.call(e,n="constructor"))&&t(n)}:(s=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"],h=function(e,t){var i,r,a=v.call(e)==_,o=!a&&"function"!=typeof e.constructor&&n[typeof e.hasOwnProperty]&&e.hasOwnProperty||m;for(i in e)a&&"prototype"==i||!o.call(e,i)||t(i);for(r=s.length;i=s[--r];o.call(e,i)&&t(i));}),h(e,t)},!y("json-stringify")){var P={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"},E=function(e,t){return("000000"+(t||0)).slice(-e)},O=function(e){for(var t='"',n=0,i=e.length,s=!k||i>10,r=s&&(k?e.split(""):e);n<i;n++){var a=e.charCodeAt(n);switch(a){case 8:case 9:case 10:case 12:case 13:case 34:case 92:t+=P[a];break;default:if(a<32){t+="\\u00"+E(2,a.toString(16));break}t+=s?r[n]:e.charAt(n)}}return t+'"'},D=function(e,t,n,i,s,r,a){var o,c,p,l,u,g,b,y,_,k,R,P,j,I,M,L;try{o=t[e]}catch(e){}if("object"==typeof o&&o)if("[object Date]"!=(c=v.call(o))||m.call(o,"toJSON"))"function"==typeof o.toJSON&&(c!=x&&c!=w&&c!=S||m.call(o,"toJSON"))&&(o=o.toJSON(e));else if(o>-1/0&&o<1/0){if(T){for(u=C(o/864e5),p=C(u/365.2425)+1970-1;T(p+1,0)<=u;p++);for(l=C((u-T(p,0))/30.42);T(p,l+1)<=u;l++);u=1+u-T(p,l),b=C((g=(o%864e5+864e5)%864e5)/36e5)%24,y=C(g/6e4)%60,_=C(g/1e3)%60,k=g%1e3}else p=o.getUTCFullYear(),l=o.getUTCMonth(),u=o.getUTCDate(),b=o.getUTCHours(),y=o.getUTCMinutes(),_=o.getUTCSeconds(),k=o.getUTCMilliseconds();o=(p<=0||p>=1e4?(p<0?"-":"+")+E(6,p<0?-p:p):E(4,p))+"-"+E(2,l+1)+"-"+E(2,u)+"T"+E(2,b)+":"+E(2,y)+":"+E(2,_)+"."+E(3,k)+"Z"}else o=null;if(n&&(o=n.call(t,e,o)),null===o)return"null";if("[object Boolean]"==(c=v.call(o)))return""+o;if(c==x)return o>-1/0&&o<1/0?""+o:"null";if(c==w)return O(""+o);if("object"==typeof o){for(I=a.length;I--;)if(a[I]===o)throw d();if(a.push(o),R=[],M=r,r+=s,c==S){for(j=0,I=o.length;j<I;j++)P=D(j,o,n,i,s,r,a),R.push(P===f?"null":P);L=R.length?s?"[\n"+r+R.join(",\n"+r)+"\n"+M+"]":"["+R.join(",")+"]":"[]"}else h(i||o,(function(e){var t=D(e,o,n,i,s,r,a);t!==f&&R.push(O(e)+":"+(s?" ":"")+t)})),L=R.length?s?"{\n"+r+R.join(",\n"+r)+"\n"+M+"}":"{"+R.join(",")+"}":"{}";return a.pop(),L}};t.stringify=function(e,t,i){var s,r,a,o;if(n[typeof t]&&t)if((o=v.call(t))==_)r=t;else if(o==S){a={};for(var c,p=0,d=t.length;p<d;c=t[p++],((o=v.call(c))==w||o==x)&&(a[c]=1));}if(i)if((o=v.call(i))==x){if((i-=i%1)>0)for(s="",i>10&&(i=10);s.length<i;s+=" ");}else o==w&&(s=i.length<=10?i:i.slice(0,10));return D("",((c={})[""]=e,c),r,a,s,"",[])}}if(!y("json-parse")){var j,I,M=r.fromCharCode,L={92:"\\",34:'"',47:"/",98:"\b",116:"\t",110:"\n",102:"\f",114:"\r"},A=function(){throw j=I=null,p()},N=function(){for(var e,t,n,i,s,r=I,a=r.length;j<a;)switch(s=r.charCodeAt(j)){case 9:case 10:case 13:case 32:j++;break;case 123:case 125:case 91:case 93:case 58:case 44:return e=k?r.charAt(j):r[j],j++,e;case 34:for(e="@",j++;j<a;)if((s=r.charCodeAt(j))<32)A();else if(92==s)switch(s=r.charCodeAt(++j)){case 92:case 34:case 47:case 98:case 116:case 110:case 102:case 114:e+=L[s],j++;break;case 117:for(t=++j,n=j+4;j<n;j++)(s=r.charCodeAt(j))>=48&&s<=57||s>=97&&s<=102||s>=65&&s<=70||A();e+=M("0x"+r.slice(t,j));break;default:A()}else{if(34==s)break;for(s=r.charCodeAt(j),t=j;s>=32&&92!=s&&34!=s;)s=r.charCodeAt(++j);e+=r.slice(t,j)}if(34==r.charCodeAt(j))return j++,e;A();default:if(t=j,45==s&&(i=!0,s=r.charCodeAt(++j)),s>=48&&s<=57){for(48==s&&((s=r.charCodeAt(j+1))>=48&&s<=57)&&A(),i=!1;j<a&&((s=r.charCodeAt(j))>=48&&s<=57);j++);if(46==r.charCodeAt(j)){for(n=++j;n<a&&((s=r.charCodeAt(n))>=48&&s<=57);n++);n==j&&A(),j=n}if(101==(s=r.charCodeAt(j))||69==s){for(43!=(s=r.charCodeAt(++j))&&45!=s||j++,n=j;n<a&&((s=r.charCodeAt(n))>=48&&s<=57);n++);n==j&&A(),j=n}return+r.slice(t,j)}if(i&&A(),"true"==r.slice(j,j+4))return j+=4,!0;if("false"==r.slice(j,j+5))return j+=5,!1;if("null"==r.slice(j,j+4))return j+=4,null;A()}return"$"},B=function(e){var t,n;if("$"==e&&A(),"string"==typeof e){if("@"==(k?e.charAt(0):e[0]))return e.slice(1);if("["==e){for(t=[];"]"!=(e=N());n||(n=!0))n&&(","==e?"]"==(e=N())&&A():A()),","==e&&A(),t.push(B(e));return t}if("{"==e){for(t={};"}"!=(e=N());n||(n=!0))n&&(","==e?"}"==(e=N())&&A():A()),","!=e&&"string"==typeof e&&"@"==(k?e.charAt(0):e[0])&&":"==N()||A(),t[e.slice(1)]=B(N());return t}A()}return e},F=function(e,t,n){var i=U(e,t,n);i===f?delete e[t]:e[t]=i},U=function(e,t,n){var i,s=e[t];if("object"==typeof s&&s)if(v.call(s)==S)for(i=s.length;i--;)F(s,i,n);else h(s,(function(e){F(s,e,n)}));return n.call(e,t,s)};t.parse=function(e,t){var n,i;return j=0,I=""+e,n=B(N()),"$"!=N()&&A(),j=I=null,t&&v.call(t)==_?U(((i={})[""]=n,i),"",t):n}}}return t.runInContext=a,t}if(!r||r.global!==r&&r.window!==r&&r.self!==r||(s=r),i)a(s,i);else{var o=s.JSON,c=s.JSON3,p=!1,d=a(s,s.JSON3={noConflict:function(){return p||(p=!0,s.JSON=o,s.JSON3=c,o=c=null),d}});s.JSON={parse:d.parse,stringify:d.stringify}}}).call(Zt)}({get exports(){return ys},set exports(e){ys=e}},ys);var _s=xs;function xs(e){if(e)return function(e){for(var t in xs.prototype)e[t]=xs.prototype[t];return e}(e)}xs.prototype.on=xs.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks[e]=this._callbacks[e]||[]).push(t),this},xs.prototype.once=function(e,t){var n=this;function i(){n.off(e,i),t.apply(this,arguments)}return this._callbacks=this._callbacks||{},i.fn=t,this.on(e,i),this},xs.prototype.off=xs.prototype.removeListener=xs.prototype.removeAllListeners=xs.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,i=this._callbacks[e];if(!i)return this;if(1==arguments.length)return delete this._callbacks[e],this;for(var s=0;s<i.length;s++)if((n=i[s])===t||n.fn===t){i.splice(s,1);break}return this},xs.prototype.emit=function(e){this._callbacks=this._callbacks||{};var t=[].slice.call(arguments,1),n=this._callbacks[e];if(n)for(var i=0,s=(n=n.slice(0)).length;i<s;++i)n[i].apply(this,t);return this},xs.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks[e]||[]},xs.prototype.hasListeners=function(e){return!!this.listeners(e).length};var ws={},Ss=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)},ks=function(e){return Zt.Buffer&&Zt.Buffer.isBuffer(e)||Zt.ArrayBuffer&&e instanceof ArrayBuffer};var Cs=Ss,Rs=ks;ws.deconstructPacket=function(e){var t=[],n=e.data;var i=e;return i.data=function e(n){if(!n)return n;if(Rs(n)){var i={_placeholder:!0,num:t.length};return t.push(n),i}if(Cs(n)){for(var s=new Array(n.length),r=0;r<n.length;r++)s[r]=e(n[r]);return s}if("object"==typeof n&&!(n instanceof Date)){s={};for(var a in n)s[a]=e(n[a]);return s}return n}(n),i.attachments=t.length,{packet:i,buffers:t}},ws.reconstructPacket=function(e,t){return e.data=function e(n){if(n&&n._placeholder)return t[n.num];if(Cs(n)){for(var i=0;i<n.length;i++)n[i]=e(n[i]);return n}if(n&&"object"==typeof n){for(var s in n)n[s]=e(n[s]);return n}return n}(e.data),e.attachments=void 0,e},ws.removeBlobs=function(e,t){var n=0,i=e;!function e(s,r,a){if(!s)return s;if(Zt.Blob&&s instanceof Blob||Zt.File&&s instanceof File){n++;var o=new FileReader;o.onload=function(){a?a[r]=this.result:i=this.result,--n||t(i)},o.readAsArrayBuffer(s)}else if(Cs(s))for(var c=0;c<s.length;c++)e(s[c],c,s);else if(s&&"object"==typeof s&&!Rs(s))for(var p in s)e(s[p],p,s)}(i),n||t(i)},function(e){var t=cs("socket.io-parser"),n=ys,i=_s,s=ws,r=ks;function a(){}function o(i){var s="",r=!1;return s+=i.type,e.BINARY_EVENT!=i.type&&e.BINARY_ACK!=i.type||(s+=i.attachments,s+="-"),i.nsp&&"/"!=i.nsp&&(r=!0,s+=i.nsp),null!=i.id&&(r&&(s+=",",r=!1),s+=i.id),null!=i.data&&(r&&(s+=","),s+=n.stringify(i.data)),t("encoded %j as %s",i,s),s}function c(){this.reconstructor=null}function p(e){this.reconPack=e,this.buffers=[]}function d(t){return{type:e.ERROR,data:"parser error"}}e.protocol=4,e.types=["CONNECT","DISCONNECT","EVENT","ACK","ERROR","BINARY_EVENT","BINARY_ACK"],e.CONNECT=0,e.DISCONNECT=1,e.EVENT=2,e.ACK=3,e.ERROR=4,e.BINARY_EVENT=5,e.BINARY_ACK=6,e.Encoder=a,e.Decoder=c,a.prototype.encode=function(n,i){(t("encoding packet %j",n),e.BINARY_EVENT==n.type||e.BINARY_ACK==n.type)?function(e,t){function n(e){var n=s.deconstructPacket(e),i=o(n.packet),r=n.buffers;r.unshift(i),t(r)}s.removeBlobs(e,n)}(n,i):i([o(n)])},i(c.prototype),c.prototype.add=function(i){var s;if("string"==typeof i)s=function(i){var s={},r=0;if(s.type=Number(i.charAt(0)),null==e.types[s.type])return d();if(e.BINARY_EVENT==s.type||e.BINARY_ACK==s.type){for(var a="";"-"!=i.charAt(++r)&&(a+=i.charAt(r),r!=i.length););if(a!=Number(a)||"-"!=i.charAt(r))throw new Error("Illegal attachments");s.attachments=Number(a)}if("/"==i.charAt(r+1))for(s.nsp="";++r;){if(","==(c=i.charAt(r)))break;if(s.nsp+=c,r==i.length)break}else s.nsp="/";var o=i.charAt(r+1);if(""!==o&&Number(o)==o){for(s.id="";++r;){var c;if(null==(c=i.charAt(r))||Number(c)!=c){--r;break}if(s.id+=i.charAt(r),r==i.length)break}s.id=Number(s.id)}i.charAt(++r)&&(s=function(e,t){try{e.data=n.parse(t)}catch(e){return d()}return e}(s,i.substr(r)));return t("decoded %s as %j",i,s),s}(i),e.BINARY_EVENT==s.type||e.BINARY_ACK==s.type?(this.reconstructor=new p(s),0===this.reconstructor.reconPack.attachments&&this.emit("decoded",s)):this.emit("decoded",s);else{if(!r(i)&&!i.base64)throw new Error("Unknown type: "+i);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");(s=this.reconstructor.takeBinaryData(i))&&(this.reconstructor=null,this.emit("decoded",s))}},c.prototype.destroy=function(){this.reconstructor&&this.reconstructor.finishedReconstruction()},p.prototype.takeBinaryData=function(e){if(this.buffers.push(e),this.buffers.length==this.reconPack.attachments){var t=s.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null},p.prototype.finishedReconstruction=function(){this.reconPack=null,this.buffers=[]}}(os);var Ts={},Ps={get exports(){return Ts},set exports(e){Ts=e}},Es={},Os={get exports(){return Es},set exports(e){Es=e}},Ds={},js=n,Is=s,Ms=r.spawn,Ls=As;function As(e){e=e||{};var t,n,i=this,s=a,r=o,c={},p=!1,d={"User-Agent":"node-XMLHttpRequest",Accept:"*/*"},l=Object.assign({},d),u=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","content-transfer-encoding","cookie","cookie2","date","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"],m=["TRACE","TRACK","CONNECT"],h=!1,f=!1,g=!1,v={};this.UNSENT=0,this.OPENED=1,this.HEADERS_RECEIVED=2,this.LOADING=3,this.DONE=4,this.readyState=this.UNSENT,this.onreadystatechange=null,this.responseText="",this.responseXML="",this.status=null,this.statusText=null;this.open=function(e,t,n,i,s){if(this.abort(),f=!1,g=!1,!function(e){return e&&-1===m.indexOf(e)}(e))throw new Error("SecurityError: Request method not allowed");c={method:e,url:t.toString(),async:"boolean"!=typeof n||n,user:i||null,password:s||null},b(this.OPENED)},this.setDisableHeaderCheck=function(e){p=e},this.setRequestHeader=function(e,t){if(this.readyState!=this.OPENED)throw new Error("INVALID_STATE_ERR: setRequestHeader can only be called when state is OPEN");if(!function(e){return p||e&&-1===u.indexOf(e.toLowerCase())}(e))return console.warn('Refused to set unsafe header "'+e+'"'),!1;if(h)throw new Error("INVALID_STATE_ERR: send flag is true");return l[e]=t,!0},this.getResponseHeader=function(e){return"string"==typeof e&&this.readyState>this.OPENED&&n.headers[e.toLowerCase()]&&!f?n.headers[e.toLowerCase()]:null},this.getAllResponseHeaders=function(){if(this.readyState<this.HEADERS_RECEIVED||f)return"";var e="";for(var t in n.headers)"set-cookie"!==t&&"set-cookie2"!==t&&(e+=t+": "+n.headers[t]+"\r\n");return e.substr(0,e.length-2)},this.getRequestHeader=function(e){return"string"==typeof e&&l[e]?l[e]:""},this.send=function(a){if(this.readyState!=this.OPENED)throw new Error("INVALID_STATE_ERR: connection must be opened before send() is called");if(h)throw new Error("INVALID_STATE_ERR: send has already been called");var o,p=!1,d=!1,u=Is.parse(c.url);switch(u.protocol){case"https:":p=!0;case"http:":o=u.hostname;break;case"file:":d=!0;break;case void 0:case"":o="localhost";break;default:throw new Error("Protocol not supported.")}if(d){if("GET"!==c.method)throw new Error("XMLHttpRequest: Only GET method is supported");if(c.async)js.readFile(unescape(u.pathname),"utf8",(function(e,t){e?i.handleError(e):(i.status=200,i.responseText=t,b(i.DONE))}));else try{this.responseText=js.readFileSync(unescape(u.pathname),"utf8"),this.status=200,b(i.DONE)}catch(e){this.handleError(e)}}else{var m=u.port||(p?443:80),g=u.pathname+(u.search?u.search:"");if(l.Host=o,p&&443===m||80===m||(l.Host+=":"+u.port),c.user){void 0===c.password&&(c.password="");var v=new Buffer(c.user+":"+c.password);l.Authorization="Basic "+v.toString("base64")}"GET"===c.method||"HEAD"===c.method?a=null:a?(l["Content-Length"]=Buffer.isBuffer(a)?a.length:Buffer.byteLength(a),l["Content-Type"]||(l["Content-Type"]="text/plain;charset=UTF-8")):"POST"===c.method&&(l["Content-Length"]=0);var y=e.agent||!1,_={host:o,port:m,path:g,method:c.method,headers:l,agent:y};if(p&&(_.pfx=e.pfx,_.key=e.key,_.passphrase=e.passphrase,_.cert=e.cert,_.ca=e.ca,_.ciphers=e.ciphers,_.rejectUnauthorized=!1!==e.rejectUnauthorized),f=!1,c.async){var x=p?r.request:s.request;h=!0,i.dispatchEvent("readystatechange");var w=function(s){if(302===(n=s).statusCode||303===n.statusCode||307===n.statusCode){c.url=n.headers.location;var r=Is.parse(c.url);o=r.hostname;var a={hostname:r.hostname,port:r.port,path:r.path,method:303===n.statusCode?"GET":c.method,headers:l};return p&&(a.pfx=e.pfx,a.key=e.key,a.passphrase=e.passphrase,a.cert=e.cert,a.ca=e.ca,a.ciphers=e.ciphers,a.rejectUnauthorized=!1!==e.rejectUnauthorized),void(t=x(a,w).on("error",S)).end()}n&&n.setEncoding&&n.setEncoding("utf8"),b(i.HEADERS_RECEIVED),i.status=n.statusCode,n.on("data",(function(e){e&&(i.responseText+=e),h&&b(i.LOADING)})),n.on("end",(function(){h&&(h=!1,b(i.DONE))})),n.on("error",(function(e){i.handleError(e)}))},S=function(e){i.handleError(e)};t=x(_,w).on("error",S),a&&t.write(a),t.end(),i.dispatchEvent("loadstart")}else{var k=".node-xmlhttprequest-content-"+process.pid,C=".node-xmlhttprequest-sync-"+process.pid;js.writeFileSync(C,"","utf8");for(var R="var http = require('http'), https = require('https'), fs = require('fs');var doRequest = http"+(p?"s":"")+".request;var options = "+JSON.stringify(_)+";var responseText = '';var req = doRequest(options, function(response) {response.setEncoding('utf8');response.on('data', function(chunk) { responseText += chunk;});response.on('end', function() {fs.writeFileSync('"+k+"', 'NODE-XMLHTTPREQUEST-STATUS:' + response.statusCode + ',' + responseText, 'utf8');fs.unlinkSync('"+C+"');});response.on('error', function(error) {fs.writeFileSync('"+k+"', 'NODE-XMLHTTPREQUEST-ERROR:' + JSON.stringify(error), 'utf8');fs.unlinkSync('"+C+"');});}).on('error', function(error) {fs.writeFileSync('"+k+"', 'NODE-XMLHTTPREQUEST-ERROR:' + JSON.stringify(error), 'utf8');fs.unlinkSync('"+C+"');});"+(a?"req.write('"+JSON.stringify(a).slice(1,-1).replace(/'/g,"\\'")+"');":"")+"req.end();",T=Ms(process.argv[0],["-e",R]);js.existsSync(C););if(i.responseText=js.readFileSync(k,"utf8"),T.stdin.end(),js.unlinkSync(k),i.responseText.match(/^NODE-XMLHTTPREQUEST-ERROR:/)){var P=i.responseText.replace(/^NODE-XMLHTTPREQUEST-ERROR:/,"");i.handleError(P,503)}else i.status=i.responseText.replace(/^NODE-XMLHTTPREQUEST-STATUS:([0-9]*),.*/,"$1"),i.responseText=i.responseText.replace(/^NODE-XMLHTTPREQUEST-STATUS:[0-9]*,(.*)/,"$1"),b(i.DONE)}}},this.handleError=function(e,t){this.status=t||0,this.statusText=e,this.responseText=e.stack,f=!0,b(this.DONE)},this.abort=function(){t&&(t.abort(),t=null),l=Object.assign({},d),this.responseText="",this.responseXML="",f=g=!0,this.readyState===this.UNSENT||this.readyState===this.OPENED&&!h||this.readyState===this.DONE||(h=!1,b(this.DONE)),this.readyState=this.UNSENT},this.addEventListener=function(e,t){e in v||(v[e]=[]),v[e].push(t)},this.removeEventListener=function(e,t){e in v&&(v[e]=v[e].filter((function(e){return e!==t})))},this.dispatchEvent=function(e){if("function"==typeof i["on"+e]&&(this.readyState===this.DONE?setImmediate((function(){i["on"+e]()})):i["on"+e]()),e in v)for(let t=0,n=v[e].length;t<n;t++)this.readyState===this.DONE?setImmediate((function(){v[e][t].call(i)})):v[e][t].call(i)};var b=function(e){if(!(i.readyState===e||i.readyState===i.UNSENT&&g)&&(i.readyState=e,(c.async||i.readyState<i.OPENED||i.readyState===i.DONE)&&i.dispatchEvent("readystatechange"),i.readyState===i.DONE)){let e;e=g?"abort":f?"error":"load",i.dispatchEvent(e),i.dispatchEvent("loadend")}}}As.XMLHttpRequest=As;var Ns={},Bs={get exports(){return Ns},set exports(e){Ns=e}},Fs={},Us={get exports(){return Fs},set exports(e){Fs=e}},zs={},qs={};
18
18
  /*! https://mths.be/wtf8 v1.0.0 by @mathias */
19
- !function(e,t){!function(n){var i=t,s=e&&e.exports==i&&e,r="object"==typeof Xt&&Xt;r.global!==r&&r.window!==r||(n=r);var a,o,c,p=String.fromCharCode;function d(e){for(var t,n,i=[],s=0,r=e.length;s<r;)(t=e.charCodeAt(s++))>=55296&&t<=56319&&s<r?56320==(64512&(n=e.charCodeAt(s++)))?i.push(((1023&t)<<10)+(1023&n)+65536):(i.push(t),s--):i.push(t);return i}function l(e,t){return p(e>>t&63|128)}function u(e){if(0==(4294967168&e))return p(e);var t="";return 0==(4294965248&e)?t=p(e>>6&31|192):0==(4294901760&e)?(t=p(e>>12&15|224),t+=l(e,6)):0==(4292870144&e)&&(t=p(e>>18&7|240),t+=l(e,12),t+=l(e,6)),t+=p(63&e|128)}function m(){if(c>=o)throw Error("Invalid byte index");var e=255&a[c];if(c++,128==(192&e))return 63&e;throw Error("Invalid continuation byte")}function h(){var e,t;if(c>o)throw Error("Invalid byte index");if(c==o)return!1;if(e=255&a[c],c++,0==(128&e))return e;if(192==(224&e)){if((t=(31&e)<<6|m())>=128)return t;throw Error("Invalid continuation byte")}if(224==(240&e)){if((t=(15&e)<<12|m()<<6|m())>=2048)return t;throw Error("Invalid continuation byte")}if(240==(248&e)&&(t=(15&e)<<18|m()<<12|m()<<6|m())>=65536&&t<=1114111)return t;throw Error("Invalid WTF-8 detected")}var f={version:"1.0.0",encode:function(e){for(var t=d(e),n=t.length,i=-1,s="";++i<n;)s+=u(t[i]);return s},decode:function(e){a=d(e),o=a.length,c=0;for(var t,n=[];!1!==(t=h());)n.push(t);return function(e){for(var t,n=e.length,i=-1,s="";++i<n;)(t=e[i])>65535&&(s+=p((t-=65536)>>>10&1023|55296),t=56320|1023&t),s+=p(t);return s}(n)}};if(i&&!i.nodeType)if(s)s.exports=f;else{var g={}.hasOwnProperty;for(var v in f)g.call(f,v)&&(i[v]=f[v])}else n.wtf8=f}(Xt)}({get exports(){return qs},set exports(e){qs=e}},qs);var $s=function(e,t,n){var i=!1;return n=n||Vs,s.count=e,0===e?t():s;function s(e,r){if(s.count<=0)throw new Error("after called too many times");--s.count,e?(i=!0,t(e),t=n):0!==s.count||i||t(null,r)}};function Vs(){}var Hs=Object.keys||function(e){var t=[],n=Object.prototype.hasOwnProperty;for(var i in e)n.call(e,i)&&t.push(i);return t};!function(e){var t=qs,n=$s,i=Hs;e.protocol=3;var s=e.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6},r=i(s),a={type:"error",data:"parser error"};function o(t,n,i){var r=t.data;if(!n)return e.encodeBase64Packet(t,i);var a=new Buffer(1);return a[0]=s[t.type],i(Buffer.concat([a,r]))}function c(e,t,i){for(var s=new Array(e.length),r=n(e.length,i),a=function(e,n,i){t(n,(function(t,n){s[e]=n,i(t,s)}))},o=0;o<e.length;o++)a(o,e[o],r)}function p(e){for(var t="",n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return t}function d(e){for(var t=new Buffer(e.length),n=0;n<e.length;n++)t.writeUInt8(e.charCodeAt(n),n);return t}function l(e){for(var t=new Uint8Array(e.buffer||e),n=e.byteLength||e.length,i=e.byteOffset||0,s=new Buffer(n),r=0;r<n;r++)s[r]=t[i+r];return s}e.encodePacket=function(e,n,i,r){if("function"==typeof n&&(r=n,n=null),"function"==typeof i&&(r=i,i=null),Buffer.isBuffer(e.data))return o(e,n,r);if(e.data&&(e.data.buffer||e.data)instanceof ArrayBuffer)return e.data=l(e.data),o(e,n,r);var a=s[e.type];return void 0!==e.data&&(a+=i?t.encode(String(e.data)):String(e.data)),r(""+a)},e.encodeBase64Packet=function(e,t){Buffer.isBuffer(e.data)||(e.data=l(e.data));var n="b"+s[e.type];return t(n+=e.data.toString("base64"))},e.decodePacket=function(n,i,s){if(void 0===n)return a;if("string"==typeof n){if("b"==n.charAt(0))return e.decodeBase64Packet(n.substr(1),i);var o=n.charAt(0);return s&&!1===(n=function(e){try{e=t.decode(e)}catch(e){return!1}return e}(n))?a:Number(o)==o&&r[o]?n.length>1?{type:r[o],data:n.substring(1)}:{type:r[o]}:a}if("arraybuffer"===i){var c=new Uint8Array(n);o=c[0];return{type:r[o],data:c.buffer.slice(1)}}n instanceof ArrayBuffer&&(n=l(n));o=n[0];return{type:r[o],data:n.slice(1)}},e.decodeBase64Packet=function(e,t){var n=r[e.charAt(0)],i=new Buffer(e.substr(1),"base64");if("arraybuffer"===t){for(var s=new Uint8Array(i.length),a=0;a<s.length;a++)s[a]=i[a];i=s.buffer}return{type:n,data:i}},e.encodePayload=function(t,n,i){if("function"==typeof n&&(i=n,n=null),n)return e.encodePayloadAsBinary(t,i);if(!t.length)return i("0:");c(t,(function(t,i){e.encodePacket(t,n,!0,(function(e){i(null,function(e){return e.length+":"+e}(e))}))}),(function(e,t){return i(t.join(""))}))},e.decodePayload=function(t,n,i){if("string"!=typeof t)return e.decodePayloadAsBinary(t,n,i);var s;if("function"==typeof n&&(i=n,n=null),""==t)return i(a,0,1);for(var r,o,c="",p=0,d=t.length;p<d;p++){var l=t.charAt(p);if(":"!=l)c+=l;else{if(""==c||c!=(r=Number(c)))return i(a,0,1);if(c!=(o=t.substr(p+1,r)).length)return i(a,0,1);if(o.length){if(s=e.decodePacket(o,n,!0),a.type==s.type&&a.data==s.data)return i(a,0,1);if(!1===i(s,p+r,d))return}p+=r,c=""}}return""!=c?i(a,0,1):void 0},e.encodePayloadAsBinary=function(t,n){if(!t.length)return n(new Buffer(0));c(t,(function(t,n){e.encodePacket(t,!0,!0,(function(e){if("string"==typeof e){var t=""+e.length;(s=new Buffer(t.length+2))[0]=0;for(var i=0;i<t.length;i++)s[i+1]=parseInt(t[i],10);return s[s.length-1]=255,n(null,Buffer.concat([s,d(e)]))}var s;t=""+e.length;(s=new Buffer(t.length+2))[0]=1;for(i=0;i<t.length;i++)s[i+1]=parseInt(t[i],10);s[s.length-1]=255,n(null,Buffer.concat([s,e]))}))}),(function(e,t){return n(Buffer.concat(t))}))},e.decodePayloadAsBinary=function(t,n,i){"function"==typeof n&&(i=n,n=null);for(var s=t,r=[];s.length>0;){for(var o="",c=0===s[0],d=!1,l=1;255!=s[l];l++){if(o.length>310){d=!0;break}o+=""+s[l]}if(d)return i(a,0,1);s=s.slice(o.length+1);var u=parseInt(o,10),m=s.slice(1,u+1);c&&(m=p(m)),r.push(m),s=s.slice(u+1)}var h=r.length;r.forEach((function(t,s){i(e.decodePacket(t,n,!0),s,h)}))}}(zs),Us.exports=zs;var Ws,Gs,Ks={},Js={get exports(){return Ks},set exports(e){Ks=e}};function Qs(){if(Gs)return Ws;Gs=1;var e=Fs;function t(e){this.path=e.path,this.hostname=e.hostname,this.port=e.port,this.secure=e.secure,this.query=e.query,this.timestampParam=e.timestampParam,this.timestampRequests=e.timestampRequests,this.readyState="",this.agent=e.agent||!1,this.socket=e.socket,this.enablesXDR=e.enablesXDR,this.pfx=e.pfx,this.key=e.key,this.passphrase=e.passphrase,this.cert=e.cert,this.ca=e.ca,this.ciphers=e.ciphers,this.rejectUnauthorized=e.rejectUnauthorized,this.forceNode=e.forceNode,this.extraHeaders=e.extraHeaders,this.localAddress=e.localAddress}return Ws=t,Ks(t.prototype),t.prototype.onError=function(e,t){var n=new Error(e);return n.type="TransportError",n.description=t,this.emit("error",n),this},t.prototype.open=function(){return"closed"!==this.readyState&&""!==this.readyState||(this.readyState="opening",this.doOpen()),this},t.prototype.close=function(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this},t.prototype.send=function(e){if("open"!==this.readyState)throw new Error("Transport not open");this.write(e)},t.prototype.onOpen=function(){this.readyState="open",this.writable=!0,this.emit("open")},t.prototype.onData=function(t){var n=e.decodePacket(t,this.socket.binaryType);this.onPacket(n)},t.prototype.onPacket=function(e){this.emit("packet",e)},t.prototype.onClose=function(){this.readyState="closed",this.emit("close")},Ws}!function(e){function t(e){if(e)return function(e){for(var n in t.prototype)e[n]=t.prototype[n];return e}(e)}Js.exports=t,t.prototype.on=t.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},t.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},t.prototype.off=t.prototype.removeListener=t.prototype.removeAllListeners=t.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,i=this._callbacks["$"+e];if(!i)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var s=0;s<i.length;s++)if((n=i[s])===t||n.fn===t){i.splice(s,1);break}return this},t.prototype.emit=function(e){this._callbacks=this._callbacks||{};var t=[].slice.call(arguments,1),n=this._callbacks["$"+e];if(n)for(var i=0,s=(n=n.slice(0)).length;i<s;++i)n[i].apply(this,t);return this},t.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},t.prototype.hasListeners=function(e){return!!this.listeners(e).length}}();var Ys,Xs={encode:function(e){var t="";for(var n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t},decode:function(e){for(var t={},n=e.split("&"),i=0,s=n.length;i<s;i++){var r=n[i].split("=");t[decodeURIComponent(r[0])]=decodeURIComponent(r[1])}return t}},Zs=function(e,t){var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e},er="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),tr={},nr=0,ir=0;function sr(e){var t="";do{t=er[e%64]+t,e=Math.floor(e/64)}while(e>0);return t}function rr(){var e=sr(+new Date);return e!==Ys?(nr=0,Ys=e):e+"."+sr(nr++)}for(;ir<64;ir++)tr[er[ir]]=ir;rr.encode=sr,rr.decode=function(e){var t=0;for(ir=0;ir<e.length;ir++)t=64*t+tr[e.charAt(ir)];return t};var ar,or,cr,pr,dr=rr,lr={},ur={},mr={get exports(){return ur},set exports(e){ur=e}},hr={},fr={get exports(){return hr},set exports(e){hr=e}};function gr(){if(or)return ar;or=1;var e=1e3,t=60*e,n=60*t,i=24*n,s=365.25*i;function r(e,t,n){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+n:Math.ceil(e/t)+" "+n+"s"}return ar=function(a,o){o=o||{};var c=typeof a;if("string"===c&&a.length>0)return function(r){if((r=String(r)).length>1e4)return;var a=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(r);if(!a)return;var o=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return o*s;case"days":case"day":case"d":return o*i;case"hours":case"hour":case"hrs":case"hr":case"h":return o*n;case"minutes":case"minute":case"mins":case"min":case"m":return o*t;case"seconds":case"second":case"secs":case"sec":case"s":return o*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return o;default:return}}(a);if("number"===c&&!1===isNaN(a))return o.long?function(s){return r(s,i,"day")||r(s,n,"hour")||r(s,t,"minute")||r(s,e,"second")||s+" ms"}(a):function(s){if(s>=i)return Math.round(s/i)+"d";if(s>=n)return Math.round(s/n)+"h";if(s>=t)return Math.round(s/t)+"m";if(s>=e)return Math.round(s/e)+"s";return s+"ms"}(a);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(a))},ar}function vr(){return cr||(cr=1,function(e,t){(t=fr.exports=r.debug=r).coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){t.enable("")},t.enable=function(e){t.save(e);for(var n=(e||"").split(/[\s,]+/),i=n.length,s=0;s<i;s++)n[s]&&("-"===(e=n[s].replace(/[\\^$+?.()|[\]{}]/g,"\\$&").replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){var n,i;for(n=0,i=t.skips.length;n<i;n++)if(t.skips[n].test(e))return!1;for(n=0,i=t.names.length;n<i;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=gr(),t.names=[],t.skips=[],t.formatters={};var n,i=0;function s(){return t.colors[i++%t.colors.length]}function r(e){function i(){}function r(){var e=r,i=+new Date,a=i-(n||i);e.diff=a,e.prev=n,e.curr=i,n=i,null==e.useColors&&(e.useColors=t.useColors()),null==e.color&&e.useColors&&(e.color=s());for(var o=new Array(arguments.length),c=0;c<o.length;c++)o[c]=arguments[c];o[0]=t.coerce(o[0]),"string"!=typeof o[0]&&(o=["%o"].concat(o));var p=0;o[0]=o[0].replace(/%([a-z%])/g,(function(n,i){if("%%"===n)return n;p++;var s=t.formatters[i];if("function"==typeof s){var r=o[p];n=s.call(e,r),o.splice(p,1),p--}return n})),o=t.formatArgs.apply(e,o);var d=r.log||t.log||console.log.bind(console);d.apply(e,o)}i.enabled=!1,r.enabled=!0;var a=t.enabled(e)?r:i;return a.namespace=e,a}}(0,hr)),hr}var br,yr={},_r={get exports(){return yr},set exports(e){yr=e}};!function(s){"undefined"!=typeof process&&"renderer"===process.type?s.exports=(pr||(pr=1,function(e,t){function n(){try{return t.storage.debug}catch(e){}if("undefined"!=typeof process&&"env"in process)return process.env.DEBUG}(t=mr.exports=vr()).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},t.formatArgs=function(){var e=arguments,n=this.useColors;if(e[0]=(n?"%c":"")+this.namespace+(n?" %c":" ")+e[0]+(n?"%c ":" ")+"+"+t.humanize(this.diff),!n)return e;var i="color: "+this.color;e=[e[0],i,"color: inherit"].concat(Array.prototype.slice.call(e,1));var s=0,r=0;return e[0].replace(/%[a-z%]/g,(function(e){"%%"!==e&&(s++,"%c"===e&&(r=s))})),e.splice(r,0,i),e},t.save=function(e){try{null==e?t.storage.removeItem("debug"):t.storage.debug=e}catch(e){}},t.load=n,t.useColors=function(){return"undefined"!=typeof document&&"WebkitAppearance"in document.documentElement.style||window.console&&(console.firebug||console.exception&&console.table)||navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31},t.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},t.enable(n())}(0,ur)),ur):s.exports=(br||(br=1,function(s,r){var a=e,o=t;(r=_r.exports=vr()).log=function(){return p.write(o.format.apply(this,arguments)+"\n")},r.formatArgs=function(){for(var e=arguments.length,t=new Array(e),n=this.useColors,i=this.namespace,s=0;s<e;s++)t[s]=arguments[s];if(n){var a=this.color;t[0]=" [3"+a+";1m"+i+" "+t[0],t.push("[3"+a+"m+"+r.humanize(this.diff)+"")}else t[0]=(new Date).toUTCString()+" "+i+" "+t[0];return t},r.save=function(e){null==e?delete process.env.DEBUG:process.env.DEBUG=e},r.load=l,r.useColors=function(){var e=(process.env.DEBUG_COLORS||"").trim().toLowerCase();return 0===e.length?a.isatty(c):"0"!==e&&"no"!==e&&"false"!==e&&"disabled"!==e},r.colors=[6,2,3,4,5,1];var c=parseInt(process.env.DEBUG_FD,10)||2,p=1===c?process.stdout:2===c?process.stderr:function(e){var t;switch(process.binding("tty_wrap").guessHandleType(e)){case"TTY":(t=new a.WriteStream(e))._type="tty",t._handle&&t._handle.unref&&t._handle.unref();break;case"FILE":(t=new n.SyncWriteStream(e,{autoClose:!1}))._type="fs";break;case"PIPE":case"TCP":(t=new i.Socket({fd:e,readable:!1,writable:!0})).readable=!1,t.read=null,t._type="pipe",t._handle&&t._handle.unref&&t._handle.unref();break;default:throw new Error("Implement me. Unknown stream file type!")}return t.fd=e,t._isStdio=!0,t}(c),d=4===o.inspect.length?function(e,t){return o.inspect(e,void 0,void 0,t)}:function(e,t){return o.inspect(e,{colors:t})};function l(){return process.env.DEBUG}r.formatters.o=r.formatters.O=function(e){return d(e,this.useColors).replace(/\s*\n\s*/g," ")},r.enable(l())}(0,yr)),yr)}({get exports(){return lr},set exports(e){lr=e}});var xr=Qs(),wr=Xs,Sr=Fs,kr=Zs,Cr=dr,Rr=lr("engine.io-client:polling"),Tr=Er,Pr=null!=new Ls({xdomain:!1}).responseType;function Er(e){var t=e&&e.forceBase64;Pr&&!t||(this.supportsBinary=!1),xr.call(this,e)}kr(Er,xr),Er.prototype.name="polling",Er.prototype.doOpen=function(){this.poll()},Er.prototype.pause=function(e){var t=this;function n(){Rr("paused"),t.readyState="paused",e()}if(this.readyState="pausing",this.polling||!this.writable){var i=0;this.polling&&(Rr("we are currently polling - waiting to pause"),i++,this.once("pollComplete",(function(){Rr("pre-pause polling complete"),--i||n()}))),this.writable||(Rr("we are currently writing - waiting to pause"),i++,this.once("drain",(function(){Rr("pre-pause writing complete"),--i||n()})))}else n()},Er.prototype.poll=function(){Rr("polling"),this.polling=!0,this.doPoll(),this.emit("poll")},Er.prototype.onData=function(e){var t=this;Rr("polling got data %s",e);Sr.decodePayload(e,this.socket.binaryType,(function(e,n,i){if("opening"===t.readyState&&t.onOpen(),"close"===e.type)return t.onClose(),!1;t.onPacket(e)})),"closed"!==this.readyState&&(this.polling=!1,this.emit("pollComplete"),"open"===this.readyState?this.poll():Rr('ignoring poll - transport state "%s"',this.readyState))},Er.prototype.doClose=function(){var e=this;function t(){Rr("writing close packet"),e.write([{type:"close"}])}"open"===this.readyState?(Rr("transport open - closing"),t()):(Rr("transport not open - deferring close"),this.once("open",t))},Er.prototype.write=function(e){var t=this;this.writable=!1;var n=function(){t.writable=!0,t.emit("drain")};Sr.encodePayload(e,this.supportsBinary,(function(e){t.doWrite(e,n)}))},Er.prototype.uri=function(){var e=this.query||{},t=this.secure?"https":"http",n="";return!1!==this.timestampRequests&&(e[this.timestampParam]=Cr()),this.supportsBinary||e.sid||(e.b64=1),e=wr.encode(e),this.port&&("https"===t&&443!==Number(this.port)||"http"===t&&80!==Number(this.port))&&(n=":"+this.port),e.length&&(e="?"+e),t+"://"+(-1!==this.hostname.indexOf(":")?"["+this.hostname+"]":this.hostname)+n+this.path+e};var Or=Ls,Dr=Tr,jr=Ks,Ir=Zs,Mr=lr("engine.io-client:polling-xhr");function Lr(){}function Ar(e){if(Dr.call(this,e),this.requestTimeout=e.requestTimeout,Xt.location){var t="https:"===location.protocol,n=location.port;n||(n=t?443:80),this.xd=e.hostname!==Xt.location.hostname||n!==e.port,this.xs=e.secure!==t}else this.extraHeaders=e.extraHeaders}function Nr(e){this.method=e.method||"GET",this.uri=e.uri,this.xd=!!e.xd,this.xs=!!e.xs,this.async=!1!==e.async,this.data=void 0!==e.data?e.data:null,this.agent=e.agent,this.isBinary=e.isBinary,this.supportsBinary=e.supportsBinary,this.enablesXDR=e.enablesXDR,this.requestTimeout=e.requestTimeout,this.pfx=e.pfx,this.key=e.key,this.passphrase=e.passphrase,this.cert=e.cert,this.ca=e.ca,this.ciphers=e.ciphers,this.rejectUnauthorized=e.rejectUnauthorized,this.extraHeaders=e.extraHeaders,this.create()}function Br(){for(var e in Nr.requests)Nr.requests.hasOwnProperty(e)&&Nr.requests[e].abort()}Bs.exports=Ar,Ns.Request=Nr,Ir(Ar,Dr),Ar.prototype.supportsBinary=!0,Ar.prototype.request=function(e){return(e=e||{}).uri=this.uri(),e.xd=this.xd,e.xs=this.xs,e.agent=this.agent||!1,e.supportsBinary=this.supportsBinary,e.enablesXDR=this.enablesXDR,e.pfx=this.pfx,e.key=this.key,e.passphrase=this.passphrase,e.cert=this.cert,e.ca=this.ca,e.ciphers=this.ciphers,e.rejectUnauthorized=this.rejectUnauthorized,e.requestTimeout=this.requestTimeout,e.extraHeaders=this.extraHeaders,new Nr(e)},Ar.prototype.doWrite=function(e,t){var n="string"!=typeof e&&void 0!==e,i=this.request({method:"POST",data:e,isBinary:n}),s=this;i.on("success",t),i.on("error",(function(e){s.onError("xhr post error",e)})),this.sendXhr=i},Ar.prototype.doPoll=function(){Mr("xhr poll");var e=this.request(),t=this;e.on("data",(function(e){t.onData(e)})),e.on("error",(function(e){t.onError("xhr poll error",e)})),this.pollXhr=e},jr(Nr.prototype),Nr.prototype.create=function(){var e={agent:this.agent,xdomain:this.xd,xscheme:this.xs,enablesXDR:this.enablesXDR};e.pfx=this.pfx,e.key=this.key,e.passphrase=this.passphrase,e.cert=this.cert,e.ca=this.ca,e.ciphers=this.ciphers,e.rejectUnauthorized=this.rejectUnauthorized;var t=this.xhr=new Or(e),n=this;try{Mr("xhr open %s: %s",this.method,this.uri),t.open(this.method,this.uri,this.async);try{if(this.extraHeaders)for(var i in t.setDisableHeaderCheck(!0),this.extraHeaders)this.extraHeaders.hasOwnProperty(i)&&t.setRequestHeader(i,this.extraHeaders[i])}catch(e){}if(this.supportsBinary&&(t.responseType="arraybuffer"),"POST"===this.method)try{this.isBinary?t.setRequestHeader("Content-type","application/octet-stream"):t.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(e){}try{t.setRequestHeader("Accept","*/*")}catch(e){}"withCredentials"in t&&(t.withCredentials=!0),this.requestTimeout&&(t.timeout=this.requestTimeout),this.hasXDR()?(t.onload=function(){n.onLoad()},t.onerror=function(){n.onError(t.responseText)}):t.onreadystatechange=function(){4===t.readyState&&(200===t.status||1223===t.status?n.onLoad():setTimeout((function(){n.onError(t.status)}),0))},Mr("xhr data %s",this.data),t.send(this.data)}catch(e){return void setTimeout((function(){n.onError(e)}),0)}Xt.document&&(this.index=Nr.requestsCount++,Nr.requests[this.index]=this)},Nr.prototype.onSuccess=function(){this.emit("success"),this.cleanup()},Nr.prototype.onData=function(e){this.emit("data",e),this.onSuccess()},Nr.prototype.onError=function(e){this.emit("error",e),this.cleanup(!0)},Nr.prototype.cleanup=function(e){if(void 0!==this.xhr&&null!==this.xhr){if(this.hasXDR()?this.xhr.onload=this.xhr.onerror=Lr:this.xhr.onreadystatechange=Lr,e)try{this.xhr.abort()}catch(e){}Xt.document&&delete Nr.requests[this.index],this.xhr=null}},Nr.prototype.onLoad=function(){var e;try{var t;try{t=this.xhr.getResponseHeader("Content-Type").split(";")[0]}catch(e){}if("application/octet-stream"===t)e=this.xhr.response||this.xhr.responseText;else if(this.supportsBinary)try{e=String.fromCharCode.apply(null,new Uint8Array(this.xhr.response))}catch(t){for(var n=new Uint8Array(this.xhr.response),i=[],s=0,r=n.length;s<r;s++)i.push(n[s]);e=String.fromCharCode.apply(null,i)}else e=this.xhr.responseText}catch(e){this.onError(e)}null!=e&&this.onData(e)},Nr.prototype.hasXDR=function(){return void 0!==Xt.XDomainRequest&&!this.xs&&this.enablesXDR},Nr.prototype.abort=function(){this.cleanup()},Nr.requestsCount=0,Nr.requests={},Xt.document&&(Xt.attachEvent?Xt.attachEvent("onunload",Br):Xt.addEventListener&&Xt.addEventListener("beforeunload",Br,!1));var Fr,Ur=Tr,zr=Hr,qr=/\n/g,$r=/\\n/g;function Vr(){}function Hr(e){Ur.call(this,e),this.query=this.query||{},Fr||(Xt.___eio||(Xt.___eio=[]),Fr=Xt.___eio),this.index=Fr.length;var t=this;Fr.push((function(e){t.onData(e)})),this.query.j=this.index,Xt.document&&Xt.addEventListener&&Xt.addEventListener("beforeunload",(function(){t.script&&(t.script.onerror=Vr)}),!1)}Zs(Hr,Ur),Hr.prototype.supportsBinary=!1,Hr.prototype.doClose=function(){this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),this.form&&(this.form.parentNode.removeChild(this.form),this.form=null,this.iframe=null),Ur.prototype.doClose.call(this)},Hr.prototype.doPoll=function(){var e=this,t=document.createElement("script");this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),t.async=!0,t.src=this.uri(),t.onerror=function(t){e.onError("jsonp poll error",t)};var n=document.getElementsByTagName("script")[0];n?n.parentNode.insertBefore(t,n):(document.head||document.body).appendChild(t),this.script=t,"undefined"!=typeof navigator&&/gecko/i.test(navigator.userAgent)&&setTimeout((function(){var e=document.createElement("iframe");document.body.appendChild(e),document.body.removeChild(e)}),100)},Hr.prototype.doWrite=function(e,t){var n=this;if(!this.form){var i,s=document.createElement("form"),r=document.createElement("textarea"),a=this.iframeId="eio_iframe_"+this.index;s.className="socketio",s.style.position="absolute",s.style.top="-1000px",s.style.left="-1000px",s.target=a,s.method="POST",s.setAttribute("accept-charset","utf-8"),r.name="d",s.appendChild(r),document.body.appendChild(s),this.form=s,this.area=r}function o(){c(),t()}function c(){if(n.iframe)try{n.form.removeChild(n.iframe)}catch(e){n.onError("jsonp polling iframe removal error",e)}try{var e='<iframe src="javascript:0" name="'+n.iframeId+'">';i=document.createElement(e)}catch(e){(i=document.createElement("iframe")).name=n.iframeId,i.src="javascript:0"}i.id=n.iframeId,n.form.appendChild(i),n.iframe=i}this.form.action=this.uri(),c(),e=e.replace($r,"\\\n"),this.area.value=e.replace(qr,"\\n");try{this.form.submit()}catch(e){}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){"complete"===n.iframe.readyState&&o()}:this.iframe.onload=o};var Wr,Gr,Kr,Jr,Qr,Yr,Xr={},Zr={get exports(){return Xr},set exports(e){Xr=e}},ea={},ta={get exports(){return ea},set exports(e){ea=e}};function na(){if(Jr)return Kr;Jr=1;var e=n;return Kr=function(t){var n={},i=this.value={};Object.keys(t).forEach((function(e){n[e]=t[e],Object.defineProperty(i,e,{get:function(){return n[e]},configurable:!1,enumerable:!0})})),this.reset=function(){return Object.keys(t).forEach((function(e){n[e]=t[e]})),this},this.merge=function(e,t){if(e=e||{},"[object Array]"===Object.prototype.toString.call(t)){for(var i=[],s=0,r=t.length;s<r;++s){var a=t[s];a in e||i.push(a)}if(i.length>0)throw i.length>1?new Error("options "+i.slice(0,i.length-1).join(", ")+" and "+i[i.length-1]+" must be defined"):new Error("option "+i[0]+" must be defined")}return Object.keys(e).forEach((function(t){t in n&&(n[t]=e[t])})),this},this.copy=function(e){var n={};return Object.keys(t).forEach((function(t){-1!==e.indexOf(t)&&(n[t]=i[t])})),n},this.read=function(t,n){if("function"==typeof n){var i=this;e.readFile(t,(function(e,t){if(e)return n(e);var s=JSON.parse(t);i.merge(s),n()}))}else{var s=JSON.parse(e.readFileSync(t));this.merge(s)}return this},this.isDefined=function(e){return void 0!==i[e]},this.isDefinedAndNonNull=function(e){return null!=i[e]},Object.freeze(i),Object.freeze(this)},Kr}
19
+ !function(e,t){!function(n){var i=t,s=e&&e.exports==i&&e,r="object"==typeof Zt&&Zt;r.global!==r&&r.window!==r||(n=r);var a,o,c,p=String.fromCharCode;function d(e){for(var t,n,i=[],s=0,r=e.length;s<r;)(t=e.charCodeAt(s++))>=55296&&t<=56319&&s<r?56320==(64512&(n=e.charCodeAt(s++)))?i.push(((1023&t)<<10)+(1023&n)+65536):(i.push(t),s--):i.push(t);return i}function l(e,t){return p(e>>t&63|128)}function u(e){if(0==(4294967168&e))return p(e);var t="";return 0==(4294965248&e)?t=p(e>>6&31|192):0==(4294901760&e)?(t=p(e>>12&15|224),t+=l(e,6)):0==(4292870144&e)&&(t=p(e>>18&7|240),t+=l(e,12),t+=l(e,6)),t+=p(63&e|128)}function m(){if(c>=o)throw Error("Invalid byte index");var e=255&a[c];if(c++,128==(192&e))return 63&e;throw Error("Invalid continuation byte")}function h(){var e,t;if(c>o)throw Error("Invalid byte index");if(c==o)return!1;if(e=255&a[c],c++,0==(128&e))return e;if(192==(224&e)){if((t=(31&e)<<6|m())>=128)return t;throw Error("Invalid continuation byte")}if(224==(240&e)){if((t=(15&e)<<12|m()<<6|m())>=2048)return t;throw Error("Invalid continuation byte")}if(240==(248&e)&&(t=(15&e)<<18|m()<<12|m()<<6|m())>=65536&&t<=1114111)return t;throw Error("Invalid WTF-8 detected")}var f={version:"1.0.0",encode:function(e){for(var t=d(e),n=t.length,i=-1,s="";++i<n;)s+=u(t[i]);return s},decode:function(e){a=d(e),o=a.length,c=0;for(var t,n=[];!1!==(t=h());)n.push(t);return function(e){for(var t,n=e.length,i=-1,s="";++i<n;)(t=e[i])>65535&&(s+=p((t-=65536)>>>10&1023|55296),t=56320|1023&t),s+=p(t);return s}(n)}};if(i&&!i.nodeType)if(s)s.exports=f;else{var g={}.hasOwnProperty;for(var v in f)g.call(f,v)&&(i[v]=f[v])}else n.wtf8=f}(Zt)}({get exports(){return qs},set exports(e){qs=e}},qs);var $s=function(e,t,n){var i=!1;return n=n||Vs,s.count=e,0===e?t():s;function s(e,r){if(s.count<=0)throw new Error("after called too many times");--s.count,e?(i=!0,t(e),t=n):0!==s.count||i||t(null,r)}};function Vs(){}var Hs=Object.keys||function(e){var t=[],n=Object.prototype.hasOwnProperty;for(var i in e)n.call(e,i)&&t.push(i);return t};!function(e){var t=qs,n=$s,i=Hs;e.protocol=3;var s=e.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6},r=i(s),a={type:"error",data:"parser error"};function o(t,n,i){var r=t.data;if(!n)return e.encodeBase64Packet(t,i);var a=new Buffer(1);return a[0]=s[t.type],i(Buffer.concat([a,r]))}function c(e,t,i){for(var s=new Array(e.length),r=n(e.length,i),a=function(e,n,i){t(n,(function(t,n){s[e]=n,i(t,s)}))},o=0;o<e.length;o++)a(o,e[o],r)}function p(e){for(var t="",n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return t}function d(e){for(var t=new Buffer(e.length),n=0;n<e.length;n++)t.writeUInt8(e.charCodeAt(n),n);return t}function l(e){for(var t=new Uint8Array(e.buffer||e),n=e.byteLength||e.length,i=e.byteOffset||0,s=new Buffer(n),r=0;r<n;r++)s[r]=t[i+r];return s}e.encodePacket=function(e,n,i,r){if("function"==typeof n&&(r=n,n=null),"function"==typeof i&&(r=i,i=null),Buffer.isBuffer(e.data))return o(e,n,r);if(e.data&&(e.data.buffer||e.data)instanceof ArrayBuffer)return e.data=l(e.data),o(e,n,r);var a=s[e.type];return void 0!==e.data&&(a+=i?t.encode(String(e.data)):String(e.data)),r(""+a)},e.encodeBase64Packet=function(e,t){Buffer.isBuffer(e.data)||(e.data=l(e.data));var n="b"+s[e.type];return t(n+=e.data.toString("base64"))},e.decodePacket=function(n,i,s){if(void 0===n)return a;if("string"==typeof n){if("b"==n.charAt(0))return e.decodeBase64Packet(n.substr(1),i);var o=n.charAt(0);return s&&!1===(n=function(e){try{e=t.decode(e)}catch(e){return!1}return e}(n))?a:Number(o)==o&&r[o]?n.length>1?{type:r[o],data:n.substring(1)}:{type:r[o]}:a}if("arraybuffer"===i){var c=new Uint8Array(n);o=c[0];return{type:r[o],data:c.buffer.slice(1)}}n instanceof ArrayBuffer&&(n=l(n));o=n[0];return{type:r[o],data:n.slice(1)}},e.decodeBase64Packet=function(e,t){var n=r[e.charAt(0)],i=new Buffer(e.substr(1),"base64");if("arraybuffer"===t){for(var s=new Uint8Array(i.length),a=0;a<s.length;a++)s[a]=i[a];i=s.buffer}return{type:n,data:i}},e.encodePayload=function(t,n,i){if("function"==typeof n&&(i=n,n=null),n)return e.encodePayloadAsBinary(t,i);if(!t.length)return i("0:");c(t,(function(t,i){e.encodePacket(t,n,!0,(function(e){i(null,function(e){return e.length+":"+e}(e))}))}),(function(e,t){return i(t.join(""))}))},e.decodePayload=function(t,n,i){if("string"!=typeof t)return e.decodePayloadAsBinary(t,n,i);var s;if("function"==typeof n&&(i=n,n=null),""==t)return i(a,0,1);for(var r,o,c="",p=0,d=t.length;p<d;p++){var l=t.charAt(p);if(":"!=l)c+=l;else{if(""==c||c!=(r=Number(c)))return i(a,0,1);if(c!=(o=t.substr(p+1,r)).length)return i(a,0,1);if(o.length){if(s=e.decodePacket(o,n,!0),a.type==s.type&&a.data==s.data)return i(a,0,1);if(!1===i(s,p+r,d))return}p+=r,c=""}}return""!=c?i(a,0,1):void 0},e.encodePayloadAsBinary=function(t,n){if(!t.length)return n(new Buffer(0));c(t,(function(t,n){e.encodePacket(t,!0,!0,(function(e){if("string"==typeof e){var t=""+e.length;(s=new Buffer(t.length+2))[0]=0;for(var i=0;i<t.length;i++)s[i+1]=parseInt(t[i],10);return s[s.length-1]=255,n(null,Buffer.concat([s,d(e)]))}var s;t=""+e.length;(s=new Buffer(t.length+2))[0]=1;for(i=0;i<t.length;i++)s[i+1]=parseInt(t[i],10);s[s.length-1]=255,n(null,Buffer.concat([s,e]))}))}),(function(e,t){return n(Buffer.concat(t))}))},e.decodePayloadAsBinary=function(t,n,i){"function"==typeof n&&(i=n,n=null);for(var s=t,r=[];s.length>0;){for(var o="",c=0===s[0],d=!1,l=1;255!=s[l];l++){if(o.length>310){d=!0;break}o+=""+s[l]}if(d)return i(a,0,1);s=s.slice(o.length+1);var u=parseInt(o,10),m=s.slice(1,u+1);c&&(m=p(m)),r.push(m),s=s.slice(u+1)}var h=r.length;r.forEach((function(t,s){i(e.decodePacket(t,n,!0),s,h)}))}}(zs),Us.exports=zs;var Ws,Gs,Ks={},Js={get exports(){return Ks},set exports(e){Ks=e}};function Qs(){if(Gs)return Ws;Gs=1;var e=Fs;function t(e){this.path=e.path,this.hostname=e.hostname,this.port=e.port,this.secure=e.secure,this.query=e.query,this.timestampParam=e.timestampParam,this.timestampRequests=e.timestampRequests,this.readyState="",this.agent=e.agent||!1,this.socket=e.socket,this.enablesXDR=e.enablesXDR,this.pfx=e.pfx,this.key=e.key,this.passphrase=e.passphrase,this.cert=e.cert,this.ca=e.ca,this.ciphers=e.ciphers,this.rejectUnauthorized=e.rejectUnauthorized,this.forceNode=e.forceNode,this.extraHeaders=e.extraHeaders,this.localAddress=e.localAddress}return Ws=t,Ks(t.prototype),t.prototype.onError=function(e,t){var n=new Error(e);return n.type="TransportError",n.description=t,this.emit("error",n),this},t.prototype.open=function(){return"closed"!==this.readyState&&""!==this.readyState||(this.readyState="opening",this.doOpen()),this},t.prototype.close=function(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this},t.prototype.send=function(e){if("open"!==this.readyState)throw new Error("Transport not open");this.write(e)},t.prototype.onOpen=function(){this.readyState="open",this.writable=!0,this.emit("open")},t.prototype.onData=function(t){var n=e.decodePacket(t,this.socket.binaryType);this.onPacket(n)},t.prototype.onPacket=function(e){this.emit("packet",e)},t.prototype.onClose=function(){this.readyState="closed",this.emit("close")},Ws}!function(e){function t(e){if(e)return function(e){for(var n in t.prototype)e[n]=t.prototype[n];return e}(e)}Js.exports=t,t.prototype.on=t.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},t.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},t.prototype.off=t.prototype.removeListener=t.prototype.removeAllListeners=t.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,i=this._callbacks["$"+e];if(!i)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var s=0;s<i.length;s++)if((n=i[s])===t||n.fn===t){i.splice(s,1);break}return this},t.prototype.emit=function(e){this._callbacks=this._callbacks||{};var t=[].slice.call(arguments,1),n=this._callbacks["$"+e];if(n)for(var i=0,s=(n=n.slice(0)).length;i<s;++i)n[i].apply(this,t);return this},t.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},t.prototype.hasListeners=function(e){return!!this.listeners(e).length}}();var Ys,Xs={encode:function(e){var t="";for(var n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t},decode:function(e){for(var t={},n=e.split("&"),i=0,s=n.length;i<s;i++){var r=n[i].split("=");t[decodeURIComponent(r[0])]=decodeURIComponent(r[1])}return t}},Zs=function(e,t){var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e},er="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),tr={},nr=0,ir=0;function sr(e){var t="";do{t=er[e%64]+t,e=Math.floor(e/64)}while(e>0);return t}function rr(){var e=sr(+new Date);return e!==Ys?(nr=0,Ys=e):e+"."+sr(nr++)}for(;ir<64;ir++)tr[er[ir]]=ir;rr.encode=sr,rr.decode=function(e){var t=0;for(ir=0;ir<e.length;ir++)t=64*t+tr[e.charAt(ir)];return t};var ar,or,cr,pr,dr=rr,lr={},ur={},mr={get exports(){return ur},set exports(e){ur=e}},hr={},fr={get exports(){return hr},set exports(e){hr=e}};function gr(){if(or)return ar;or=1;var e=1e3,t=60*e,n=60*t,i=24*n,s=365.25*i;function r(e,t,n){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+n:Math.ceil(e/t)+" "+n+"s"}return ar=function(a,o){o=o||{};var c=typeof a;if("string"===c&&a.length>0)return function(r){if((r=String(r)).length>1e4)return;var a=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(r);if(!a)return;var o=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return o*s;case"days":case"day":case"d":return o*i;case"hours":case"hour":case"hrs":case"hr":case"h":return o*n;case"minutes":case"minute":case"mins":case"min":case"m":return o*t;case"seconds":case"second":case"secs":case"sec":case"s":return o*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return o;default:return}}(a);if("number"===c&&!1===isNaN(a))return o.long?function(s){return r(s,i,"day")||r(s,n,"hour")||r(s,t,"minute")||r(s,e,"second")||s+" ms"}(a):function(s){if(s>=i)return Math.round(s/i)+"d";if(s>=n)return Math.round(s/n)+"h";if(s>=t)return Math.round(s/t)+"m";if(s>=e)return Math.round(s/e)+"s";return s+"ms"}(a);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(a))},ar}function vr(){return cr||(cr=1,function(e,t){(t=fr.exports=r.debug=r).coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){t.enable("")},t.enable=function(e){t.save(e);for(var n=(e||"").split(/[\s,]+/),i=n.length,s=0;s<i;s++)n[s]&&("-"===(e=n[s].replace(/[\\^$+?.()|[\]{}]/g,"\\$&").replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){var n,i;for(n=0,i=t.skips.length;n<i;n++)if(t.skips[n].test(e))return!1;for(n=0,i=t.names.length;n<i;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=gr(),t.names=[],t.skips=[],t.formatters={};var n,i=0;function s(){return t.colors[i++%t.colors.length]}function r(e){function i(){}function r(){var e=r,i=+new Date,a=i-(n||i);e.diff=a,e.prev=n,e.curr=i,n=i,null==e.useColors&&(e.useColors=t.useColors()),null==e.color&&e.useColors&&(e.color=s());for(var o=new Array(arguments.length),c=0;c<o.length;c++)o[c]=arguments[c];o[0]=t.coerce(o[0]),"string"!=typeof o[0]&&(o=["%o"].concat(o));var p=0;o[0]=o[0].replace(/%([a-z%])/g,(function(n,i){if("%%"===n)return n;p++;var s=t.formatters[i];if("function"==typeof s){var r=o[p];n=s.call(e,r),o.splice(p,1),p--}return n})),o=t.formatArgs.apply(e,o);var d=r.log||t.log||console.log.bind(console);d.apply(e,o)}i.enabled=!1,r.enabled=!0;var a=t.enabled(e)?r:i;return a.namespace=e,a}}(0,hr)),hr}var br,yr={},_r={get exports(){return yr},set exports(e){yr=e}};!function(s){"undefined"!=typeof process&&"renderer"===process.type?s.exports=(pr||(pr=1,function(e,t){function n(){try{return t.storage.debug}catch(e){}if("undefined"!=typeof process&&"env"in process)return process.env.DEBUG}(t=mr.exports=vr()).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},t.formatArgs=function(){var e=arguments,n=this.useColors;if(e[0]=(n?"%c":"")+this.namespace+(n?" %c":" ")+e[0]+(n?"%c ":" ")+"+"+t.humanize(this.diff),!n)return e;var i="color: "+this.color;e=[e[0],i,"color: inherit"].concat(Array.prototype.slice.call(e,1));var s=0,r=0;return e[0].replace(/%[a-z%]/g,(function(e){"%%"!==e&&(s++,"%c"===e&&(r=s))})),e.splice(r,0,i),e},t.save=function(e){try{null==e?t.storage.removeItem("debug"):t.storage.debug=e}catch(e){}},t.load=n,t.useColors=function(){return"undefined"!=typeof document&&"WebkitAppearance"in document.documentElement.style||window.console&&(console.firebug||console.exception&&console.table)||navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31},t.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},t.enable(n())}(0,ur)),ur):s.exports=(br||(br=1,function(s,r){var a=e,o=t;(r=_r.exports=vr()).log=function(){return p.write(o.format.apply(this,arguments)+"\n")},r.formatArgs=function(){for(var e=arguments.length,t=new Array(e),n=this.useColors,i=this.namespace,s=0;s<e;s++)t[s]=arguments[s];if(n){var a=this.color;t[0]=" [3"+a+";1m"+i+" "+t[0],t.push("[3"+a+"m+"+r.humanize(this.diff)+"")}else t[0]=(new Date).toUTCString()+" "+i+" "+t[0];return t},r.save=function(e){null==e?delete process.env.DEBUG:process.env.DEBUG=e},r.load=l,r.useColors=function(){var e=(process.env.DEBUG_COLORS||"").trim().toLowerCase();return 0===e.length?a.isatty(c):"0"!==e&&"no"!==e&&"false"!==e&&"disabled"!==e},r.colors=[6,2,3,4,5,1];var c=parseInt(process.env.DEBUG_FD,10)||2,p=1===c?process.stdout:2===c?process.stderr:function(e){var t;switch(process.binding("tty_wrap").guessHandleType(e)){case"TTY":(t=new a.WriteStream(e))._type="tty",t._handle&&t._handle.unref&&t._handle.unref();break;case"FILE":(t=new n.SyncWriteStream(e,{autoClose:!1}))._type="fs";break;case"PIPE":case"TCP":(t=new i.Socket({fd:e,readable:!1,writable:!0})).readable=!1,t.read=null,t._type="pipe",t._handle&&t._handle.unref&&t._handle.unref();break;default:throw new Error("Implement me. Unknown stream file type!")}return t.fd=e,t._isStdio=!0,t}(c),d=4===o.inspect.length?function(e,t){return o.inspect(e,void 0,void 0,t)}:function(e,t){return o.inspect(e,{colors:t})};function l(){return process.env.DEBUG}r.formatters.o=r.formatters.O=function(e){return d(e,this.useColors).replace(/\s*\n\s*/g," ")},r.enable(l())}(0,yr)),yr)}({get exports(){return lr},set exports(e){lr=e}});var xr=Qs(),wr=Xs,Sr=Fs,kr=Zs,Cr=dr,Rr=lr("engine.io-client:polling"),Tr=Er,Pr=null!=new Ls({xdomain:!1}).responseType;function Er(e){var t=e&&e.forceBase64;Pr&&!t||(this.supportsBinary=!1),xr.call(this,e)}kr(Er,xr),Er.prototype.name="polling",Er.prototype.doOpen=function(){this.poll()},Er.prototype.pause=function(e){var t=this;function n(){Rr("paused"),t.readyState="paused",e()}if(this.readyState="pausing",this.polling||!this.writable){var i=0;this.polling&&(Rr("we are currently polling - waiting to pause"),i++,this.once("pollComplete",(function(){Rr("pre-pause polling complete"),--i||n()}))),this.writable||(Rr("we are currently writing - waiting to pause"),i++,this.once("drain",(function(){Rr("pre-pause writing complete"),--i||n()})))}else n()},Er.prototype.poll=function(){Rr("polling"),this.polling=!0,this.doPoll(),this.emit("poll")},Er.prototype.onData=function(e){var t=this;Rr("polling got data %s",e);Sr.decodePayload(e,this.socket.binaryType,(function(e,n,i){if("opening"===t.readyState&&t.onOpen(),"close"===e.type)return t.onClose(),!1;t.onPacket(e)})),"closed"!==this.readyState&&(this.polling=!1,this.emit("pollComplete"),"open"===this.readyState?this.poll():Rr('ignoring poll - transport state "%s"',this.readyState))},Er.prototype.doClose=function(){var e=this;function t(){Rr("writing close packet"),e.write([{type:"close"}])}"open"===this.readyState?(Rr("transport open - closing"),t()):(Rr("transport not open - deferring close"),this.once("open",t))},Er.prototype.write=function(e){var t=this;this.writable=!1;var n=function(){t.writable=!0,t.emit("drain")};Sr.encodePayload(e,this.supportsBinary,(function(e){t.doWrite(e,n)}))},Er.prototype.uri=function(){var e=this.query||{},t=this.secure?"https":"http",n="";return!1!==this.timestampRequests&&(e[this.timestampParam]=Cr()),this.supportsBinary||e.sid||(e.b64=1),e=wr.encode(e),this.port&&("https"===t&&443!==Number(this.port)||"http"===t&&80!==Number(this.port))&&(n=":"+this.port),e.length&&(e="?"+e),t+"://"+(-1!==this.hostname.indexOf(":")?"["+this.hostname+"]":this.hostname)+n+this.path+e};var Or=Ls,Dr=Tr,jr=Ks,Ir=Zs,Mr=lr("engine.io-client:polling-xhr");function Lr(){}function Ar(e){if(Dr.call(this,e),this.requestTimeout=e.requestTimeout,Zt.location){var t="https:"===location.protocol,n=location.port;n||(n=t?443:80),this.xd=e.hostname!==Zt.location.hostname||n!==e.port,this.xs=e.secure!==t}else this.extraHeaders=e.extraHeaders}function Nr(e){this.method=e.method||"GET",this.uri=e.uri,this.xd=!!e.xd,this.xs=!!e.xs,this.async=!1!==e.async,this.data=void 0!==e.data?e.data:null,this.agent=e.agent,this.isBinary=e.isBinary,this.supportsBinary=e.supportsBinary,this.enablesXDR=e.enablesXDR,this.requestTimeout=e.requestTimeout,this.pfx=e.pfx,this.key=e.key,this.passphrase=e.passphrase,this.cert=e.cert,this.ca=e.ca,this.ciphers=e.ciphers,this.rejectUnauthorized=e.rejectUnauthorized,this.extraHeaders=e.extraHeaders,this.create()}function Br(){for(var e in Nr.requests)Nr.requests.hasOwnProperty(e)&&Nr.requests[e].abort()}Bs.exports=Ar,Ns.Request=Nr,Ir(Ar,Dr),Ar.prototype.supportsBinary=!0,Ar.prototype.request=function(e){return(e=e||{}).uri=this.uri(),e.xd=this.xd,e.xs=this.xs,e.agent=this.agent||!1,e.supportsBinary=this.supportsBinary,e.enablesXDR=this.enablesXDR,e.pfx=this.pfx,e.key=this.key,e.passphrase=this.passphrase,e.cert=this.cert,e.ca=this.ca,e.ciphers=this.ciphers,e.rejectUnauthorized=this.rejectUnauthorized,e.requestTimeout=this.requestTimeout,e.extraHeaders=this.extraHeaders,new Nr(e)},Ar.prototype.doWrite=function(e,t){var n="string"!=typeof e&&void 0!==e,i=this.request({method:"POST",data:e,isBinary:n}),s=this;i.on("success",t),i.on("error",(function(e){s.onError("xhr post error",e)})),this.sendXhr=i},Ar.prototype.doPoll=function(){Mr("xhr poll");var e=this.request(),t=this;e.on("data",(function(e){t.onData(e)})),e.on("error",(function(e){t.onError("xhr poll error",e)})),this.pollXhr=e},jr(Nr.prototype),Nr.prototype.create=function(){var e={agent:this.agent,xdomain:this.xd,xscheme:this.xs,enablesXDR:this.enablesXDR};e.pfx=this.pfx,e.key=this.key,e.passphrase=this.passphrase,e.cert=this.cert,e.ca=this.ca,e.ciphers=this.ciphers,e.rejectUnauthorized=this.rejectUnauthorized;var t=this.xhr=new Or(e),n=this;try{Mr("xhr open %s: %s",this.method,this.uri),t.open(this.method,this.uri,this.async);try{if(this.extraHeaders)for(var i in t.setDisableHeaderCheck(!0),this.extraHeaders)this.extraHeaders.hasOwnProperty(i)&&t.setRequestHeader(i,this.extraHeaders[i])}catch(e){}if(this.supportsBinary&&(t.responseType="arraybuffer"),"POST"===this.method)try{this.isBinary?t.setRequestHeader("Content-type","application/octet-stream"):t.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(e){}try{t.setRequestHeader("Accept","*/*")}catch(e){}"withCredentials"in t&&(t.withCredentials=!0),this.requestTimeout&&(t.timeout=this.requestTimeout),this.hasXDR()?(t.onload=function(){n.onLoad()},t.onerror=function(){n.onError(t.responseText)}):t.onreadystatechange=function(){4===t.readyState&&(200===t.status||1223===t.status?n.onLoad():setTimeout((function(){n.onError(t.status)}),0))},Mr("xhr data %s",this.data),t.send(this.data)}catch(e){return void setTimeout((function(){n.onError(e)}),0)}Zt.document&&(this.index=Nr.requestsCount++,Nr.requests[this.index]=this)},Nr.prototype.onSuccess=function(){this.emit("success"),this.cleanup()},Nr.prototype.onData=function(e){this.emit("data",e),this.onSuccess()},Nr.prototype.onError=function(e){this.emit("error",e),this.cleanup(!0)},Nr.prototype.cleanup=function(e){if(void 0!==this.xhr&&null!==this.xhr){if(this.hasXDR()?this.xhr.onload=this.xhr.onerror=Lr:this.xhr.onreadystatechange=Lr,e)try{this.xhr.abort()}catch(e){}Zt.document&&delete Nr.requests[this.index],this.xhr=null}},Nr.prototype.onLoad=function(){var e;try{var t;try{t=this.xhr.getResponseHeader("Content-Type").split(";")[0]}catch(e){}if("application/octet-stream"===t)e=this.xhr.response||this.xhr.responseText;else if(this.supportsBinary)try{e=String.fromCharCode.apply(null,new Uint8Array(this.xhr.response))}catch(t){for(var n=new Uint8Array(this.xhr.response),i=[],s=0,r=n.length;s<r;s++)i.push(n[s]);e=String.fromCharCode.apply(null,i)}else e=this.xhr.responseText}catch(e){this.onError(e)}null!=e&&this.onData(e)},Nr.prototype.hasXDR=function(){return void 0!==Zt.XDomainRequest&&!this.xs&&this.enablesXDR},Nr.prototype.abort=function(){this.cleanup()},Nr.requestsCount=0,Nr.requests={},Zt.document&&(Zt.attachEvent?Zt.attachEvent("onunload",Br):Zt.addEventListener&&Zt.addEventListener("beforeunload",Br,!1));var Fr,Ur=Tr,zr=Hr,qr=/\n/g,$r=/\\n/g;function Vr(){}function Hr(e){Ur.call(this,e),this.query=this.query||{},Fr||(Zt.___eio||(Zt.___eio=[]),Fr=Zt.___eio),this.index=Fr.length;var t=this;Fr.push((function(e){t.onData(e)})),this.query.j=this.index,Zt.document&&Zt.addEventListener&&Zt.addEventListener("beforeunload",(function(){t.script&&(t.script.onerror=Vr)}),!1)}Zs(Hr,Ur),Hr.prototype.supportsBinary=!1,Hr.prototype.doClose=function(){this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),this.form&&(this.form.parentNode.removeChild(this.form),this.form=null,this.iframe=null),Ur.prototype.doClose.call(this)},Hr.prototype.doPoll=function(){var e=this,t=document.createElement("script");this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),t.async=!0,t.src=this.uri(),t.onerror=function(t){e.onError("jsonp poll error",t)};var n=document.getElementsByTagName("script")[0];n?n.parentNode.insertBefore(t,n):(document.head||document.body).appendChild(t),this.script=t,"undefined"!=typeof navigator&&/gecko/i.test(navigator.userAgent)&&setTimeout((function(){var e=document.createElement("iframe");document.body.appendChild(e),document.body.removeChild(e)}),100)},Hr.prototype.doWrite=function(e,t){var n=this;if(!this.form){var i,s=document.createElement("form"),r=document.createElement("textarea"),a=this.iframeId="eio_iframe_"+this.index;s.className="socketio",s.style.position="absolute",s.style.top="-1000px",s.style.left="-1000px",s.target=a,s.method="POST",s.setAttribute("accept-charset","utf-8"),r.name="d",s.appendChild(r),document.body.appendChild(s),this.form=s,this.area=r}function o(){c(),t()}function c(){if(n.iframe)try{n.form.removeChild(n.iframe)}catch(e){n.onError("jsonp polling iframe removal error",e)}try{var e='<iframe src="javascript:0" name="'+n.iframeId+'">';i=document.createElement(e)}catch(e){(i=document.createElement("iframe")).name=n.iframeId,i.src="javascript:0"}i.id=n.iframeId,n.form.appendChild(i),n.iframe=i}this.form.action=this.uri(),c(),e=e.replace($r,"\\\n"),this.area.value=e.replace(qr,"\\n");try{this.form.submit()}catch(e){}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){"complete"===n.iframe.readyState&&o()}:this.iframe.onload=o};var Wr,Gr,Kr,Jr,Qr,Yr,Xr={},Zr={get exports(){return Xr},set exports(e){Xr=e}},ea={},ta={get exports(){return ea},set exports(e){ea=e}};function na(){if(Jr)return Kr;Jr=1;var e=n;return Kr=function(t){var n={},i=this.value={};Object.keys(t).forEach((function(e){n[e]=t[e],Object.defineProperty(i,e,{get:function(){return n[e]},configurable:!1,enumerable:!0})})),this.reset=function(){return Object.keys(t).forEach((function(e){n[e]=t[e]})),this},this.merge=function(e,t){if(e=e||{},"[object Array]"===Object.prototype.toString.call(t)){for(var i=[],s=0,r=t.length;s<r;++s){var a=t[s];a in e||i.push(a)}if(i.length>0)throw i.length>1?new Error("options "+i.slice(0,i.length-1).join(", ")+" and "+i[i.length-1]+" must be defined"):new Error("option "+i[0]+" must be defined")}return Object.keys(e).forEach((function(t){t in n&&(n[t]=e[t])})),this},this.copy=function(e){var n={};return Object.keys(t).forEach((function(t){-1!==e.indexOf(t)&&(n[t]=i[t])})),n},this.read=function(t,n){if("function"==typeof n){var i=this;e.readFile(t,(function(e,t){if(e)return n(e);var s=JSON.parse(t);i.merge(s),n()}))}else{var s=JSON.parse(e.readFileSync(t));this.merge(s)}return this},this.isDefined=function(e){return void 0!==i[e]},this.isDefinedAndNonNull=function(e){return null!=i[e]},Object.freeze(i),Object.freeze(this)},Kr}
20
20
  /*!
21
21
  * ws: a node.js websocket client
22
22
  * Copyright(c) 2011 Einar Otto Stangvik <einaros@gmail.com>
@@ -83,23 +83,23 @@ var e=s,n=t,i=a,r=o,l=c,u=p,m=function(){if(Gr)return Wr;Gr=1;var e=Object.proto
83
83
  * ws: a node.js websocket client
84
84
  * Copyright(c) 2011 Einar Otto Stangvik <einaros@gmail.com>
85
85
  * MIT Licensed
86
- */function Na(){if(ja)return Da;ja=1;var e=t,n=d,i=a,r=c,o=na(),p=Aa(),l=La(),u=ma(),m=s;function h(e,t){if(this instanceof h==!1)return new h(e,t);if(n.EventEmitter.call(this),!(e=new o({host:"0.0.0.0",port:null,server:null,verifyClient:null,handleProtocols:null,path:null,noServer:!1,disableHixie:!1,clientTracking:!0,perMessageDeflate:!0,maxPayload:104857600}).merge(e)).isDefinedAndNonNull("port")&&!e.isDefinedAndNonNull("server")&&!e.value.noServer)throw new TypeError("`port` or a `server` must be provided");var s=this;if(e.isDefinedAndNonNull("port"))this._server=i.createServer((function(e,t){var n=i.STATUS_CODES[426];t.writeHead(426,{"Content-Length":n.length,"Content-Type":"text/plain"}),t.end(n)})),this._server.allowHalfOpen=!1,this._server.listen(e.value.port,e.value.host,t),this._closeServer=function(){s._server&&s._server.close()};else if(e.value.server&&(this._server=e.value.server,e.value.path)){if(this._server._webSocketPaths&&e.value.server._webSocketPaths[e.value.path])throw new Error("two instances of WebSocketServer cannot listen on the same http server path");"object"!=typeof this._server._webSocketPaths&&(this._server._webSocketPaths={}),this._server._webSocketPaths[e.value.path]=1}this._server&&(this._onceServerListening=function(){s.emit("listening")},this._server.once("listening",this._onceServerListening)),void 0!==this._server&&(this._onServerError=function(e){s.emit("error",e)},this._server.on("error",this._onServerError),this._onServerUpgrade=function(e,t,n){var i=new Buffer(n.length);n.copy(i),s.handleUpgrade(e,t,i,(function(t){s.emit("connection"+e.url,t),s.emit("connection",t)}))},this._server.on("upgrade",this._onServerUpgrade)),this.options=e.value,this.path=e.value.path,this.clients=[]}function f(e,t,n,s){var a=function(){try{t.destroy()}catch(e){}};if(t.on("error",a),e.headers["sec-websocket-key"]){var o=parseInt(e.headers["sec-websocket-version"]);if(-1!==[8,13].indexOf(o)){var c=e.headers["sec-websocket-protocol"],d=o<13?e.headers["sec-websocket-origin"]:e.headers.origin,u=l.parse(e.headers["sec-websocket-extensions"]),m=this,h=function(i){var c=e.headers["sec-websocket-key"],d=r.createHash("sha1");d.update(c+"258EAFA5-E914-47DA-95CA-C5AB0DC85B11");var h=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade","Sec-WebSocket-Accept: "+(c=d.digest("base64"))];void 0!==i&&h.push("Sec-WebSocket-Protocol: "+i);var f={};try{f=v.call(m,u)}catch(e){return void b(t,400,"Bad Request")}if(Object.keys(f).length){var g={};Object.keys(f).forEach((function(e){g[e]=[f[e].params]})),h.push("Sec-WebSocket-Extensions: "+l.format(g))}m.emit("headers",h),t.setTimeout(0),t.setNoDelay(!0);try{t.write(h.concat("","").join("\r\n"))}catch(e){try{t.destroy()}catch(e){}return}var y=new p([e,t,n],{protocolVersion:o,protocol:i,extensions:f,maxPayload:m.options.maxPayload});m.options.clientTracking&&(m.clients.push(y),y.on("close",(function(){var e=m.clients.indexOf(y);-1!=e&&m.clients.splice(e,1)}))),t.removeListener("error",a),s(y)},f=function(){if("function"==typeof m.options.handleProtocols){var e=(c||"").split(/, */),n=!1;return m.options.handleProtocols(e,(function(e,i){n=!0,e?h(i):b(t,401,"Unauthorized")})),void(n||b(t,501,"Could not process protocols"))}void 0!==c?h(c.split(/, */)[0]):h()};if("function"==typeof this.options.verifyClient){var g={origin:d,secure:void 0!==e.connection.authorized||void 0!==e.connection.encrypted,req:e};if(2==this.options.verifyClient.length)return void this.options.verifyClient(g,(function(e,n,s){void 0===n&&(n=401),void 0===s&&(s=i.STATUS_CODES[n]),e?f():b(t,n,s)}));if(!this.options.verifyClient(g))return void b(t,401,"Unauthorized")}f()}else b(t,400,"Bad Request")}else b(t,400,"Bad Request")}function g(e,t,n,s){var a=function(){try{t.destroy()}catch(e){}};if(t.on("error",a),this.options.disableHixie)b(t,401,"Hixie support disabled");else if(e.headers["sec-websocket-key2"]){var o=e.headers.origin,c=this,d=function(){var i;i=e.headers["x-forwarded-host"]?e.headers["x-forwarded-host"]:e.headers.host;var d=("https"===e.headers["x-forwarded-proto"]||t.encrypted?"wss":"ws")+"://"+i+e.url,l=e.headers["sec-websocket-protocol"],u=function(){var e=["HTTP/1.1 101 Switching Protocols","Upgrade: WebSocket","Connection: Upgrade","Sec-WebSocket-Location: "+d];return void 0!==l&&e.push("Sec-WebSocket-Protocol: "+l),void 0!==o&&e.push("Sec-WebSocket-Origin: "+o),new Buffer(e.concat("","").join("\r\n"))},m=function(n,i,o){var d=e.headers["sec-websocket-key1"],u=e.headers["sec-websocket-key2"],m=r.createHash("md5");[d,u].forEach((function(e){var n=parseInt(e.replace(/[^\d]/g,"")),i=e.replace(/[^ ]/g,"").length;0!==i&&n%i==0?(n/=i,m.update(String.fromCharCode(n>>24&255,n>>16&255,n>>8&255,255&n))):b(t,400,"Bad Request")})),m.update(n.toString("binary")),t.setTimeout(0),t.setNoDelay(!0);try{var h=new Buffer(m.digest("binary"),"binary"),f=new Buffer(o.length+h.length);o.copy(f,0),h.copy(f,o.length),t.write(f,"binary",(function(n){if(!n){var r=new p([e,t,i],{protocolVersion:"hixie-76",protocol:l});c.options.clientTracking&&(c.clients.push(r),r.on("close",(function(){var e=c.clients.indexOf(r);-1!=e&&c.clients.splice(e,1)}))),t.removeListener("error",a),s(r)}}))}catch(e){try{t.destroy()}catch(e){}return}};if(n&&n.length>=8){var h=n.slice(0,8),f=n.length>8?n.slice(8):null;m.call(c,h,f,u())}else{h=new Buffer(8);n.copy(h,0);var g=n.length,v=(f=null,function(e){var n=Math.min(e.length,8-g);0!==n&&(e.copy(h,g,0,n),8==(g+=n)&&(t.removeListener("data",v),n<e.length&&(f=e.slice(n)),m.call(c,h,f,new Buffer(0))))});t.on("data",v),function(){t.setTimeout(0),t.setNoDelay(!0);var e=u();try{t.write(e,"binary",(function(e){e&&t.removeListener("data",v)}))}catch(e){try{t.destroy()}catch(e){}return}}()}};if("function"==typeof this.options.verifyClient){var l={origin:o,secure:void 0!==e.connection.authorized||void 0!==e.connection.encrypted,req:e};if(2==this.options.verifyClient.length){c=this;return void this.options.verifyClient(l,(function(e,n,s){void 0===n&&(n=401),void 0===s&&(s=i.STATUS_CODES[n]),e?d.apply(c):b(t,n,s)}))}if(!this.options.verifyClient(l))return void b(t,401,"Unauthorized")}d()}else b(t,400,"Bad Request")}function v(e){var t={},n=this.options.perMessageDeflate,i=this.options.maxPayload;if(n&&e[u.extensionName]){var s=new u(!0!==n?n:{},!0,i);s.accept(e[u.extensionName]),t[u.extensionName]=s}return t}function b(e,t,n){try{var i=["HTTP/1.1 "+t+" "+n,"Content-type: text/html"];e.write(i.concat("","").join("\r\n"))}catch(e){}finally{try{e.destroy()}catch(e){}}}return e.inherits(h,n.EventEmitter),h.prototype.close=function(e){var t=null;try{for(var n=0,i=this.clients.length;n<i;++n)this.clients[n].terminate()}catch(e){t=e}this.path&&this._server._webSocketPaths&&(delete this._server._webSocketPaths[this.path],0==Object.keys(this._server._webSocketPaths).length&&delete this._server._webSocketPaths);try{void 0!==this._closeServer&&this._closeServer()}finally{this._server&&(this._server.removeListener("listening",this._onceServerListening),this._server.removeListener("error",this._onServerError),this._server.removeListener("upgrade",this._onServerUpgrade)),delete this._server}if(e)e(t);else if(t)throw t},h.prototype.handleUpgrade=function(e,t,n,i){if(this.options.path){var s=m.parse(e.url);if(s&&s.pathname!==this.options.path)return}void 0!==e.headers.upgrade&&"websocket"===e.headers.upgrade.toLowerCase()?e.headers["sec-websocket-key1"]?g.apply(this,arguments):f.apply(this,arguments):b(t,400,"Bad Request")},Da=h}var Ba,Fa=Qs(),Ua=Fs,za=Xs,qa=Zs,$a=dr,Va=lr("engine.io-client:websocket"),Ha=Xt.WebSocket||Xt.MozWebSocket;if("undefined"==typeof window)try{Ia||(Ia=1,function(e){
86
+ */function Na(){if(ja)return Da;ja=1;var e=t,n=d,i=a,r=c,o=na(),p=Aa(),l=La(),u=ma(),m=s;function h(e,t){if(this instanceof h==!1)return new h(e,t);if(n.EventEmitter.call(this),!(e=new o({host:"0.0.0.0",port:null,server:null,verifyClient:null,handleProtocols:null,path:null,noServer:!1,disableHixie:!1,clientTracking:!0,perMessageDeflate:!0,maxPayload:104857600}).merge(e)).isDefinedAndNonNull("port")&&!e.isDefinedAndNonNull("server")&&!e.value.noServer)throw new TypeError("`port` or a `server` must be provided");var s=this;if(e.isDefinedAndNonNull("port"))this._server=i.createServer((function(e,t){var n=i.STATUS_CODES[426];t.writeHead(426,{"Content-Length":n.length,"Content-Type":"text/plain"}),t.end(n)})),this._server.allowHalfOpen=!1,this._server.listen(e.value.port,e.value.host,t),this._closeServer=function(){s._server&&s._server.close()};else if(e.value.server&&(this._server=e.value.server,e.value.path)){if(this._server._webSocketPaths&&e.value.server._webSocketPaths[e.value.path])throw new Error("two instances of WebSocketServer cannot listen on the same http server path");"object"!=typeof this._server._webSocketPaths&&(this._server._webSocketPaths={}),this._server._webSocketPaths[e.value.path]=1}this._server&&(this._onceServerListening=function(){s.emit("listening")},this._server.once("listening",this._onceServerListening)),void 0!==this._server&&(this._onServerError=function(e){s.emit("error",e)},this._server.on("error",this._onServerError),this._onServerUpgrade=function(e,t,n){var i=new Buffer(n.length);n.copy(i),s.handleUpgrade(e,t,i,(function(t){s.emit("connection"+e.url,t),s.emit("connection",t)}))},this._server.on("upgrade",this._onServerUpgrade)),this.options=e.value,this.path=e.value.path,this.clients=[]}function f(e,t,n,s){var a=function(){try{t.destroy()}catch(e){}};if(t.on("error",a),e.headers["sec-websocket-key"]){var o=parseInt(e.headers["sec-websocket-version"]);if(-1!==[8,13].indexOf(o)){var c=e.headers["sec-websocket-protocol"],d=o<13?e.headers["sec-websocket-origin"]:e.headers.origin,u=l.parse(e.headers["sec-websocket-extensions"]),m=this,h=function(i){var c=e.headers["sec-websocket-key"],d=r.createHash("sha1");d.update(c+"258EAFA5-E914-47DA-95CA-C5AB0DC85B11");var h=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade","Sec-WebSocket-Accept: "+(c=d.digest("base64"))];void 0!==i&&h.push("Sec-WebSocket-Protocol: "+i);var f={};try{f=v.call(m,u)}catch(e){return void b(t,400,"Bad Request")}if(Object.keys(f).length){var g={};Object.keys(f).forEach((function(e){g[e]=[f[e].params]})),h.push("Sec-WebSocket-Extensions: "+l.format(g))}m.emit("headers",h),t.setTimeout(0),t.setNoDelay(!0);try{t.write(h.concat("","").join("\r\n"))}catch(e){try{t.destroy()}catch(e){}return}var y=new p([e,t,n],{protocolVersion:o,protocol:i,extensions:f,maxPayload:m.options.maxPayload});m.options.clientTracking&&(m.clients.push(y),y.on("close",(function(){var e=m.clients.indexOf(y);-1!=e&&m.clients.splice(e,1)}))),t.removeListener("error",a),s(y)},f=function(){if("function"==typeof m.options.handleProtocols){var e=(c||"").split(/, */),n=!1;return m.options.handleProtocols(e,(function(e,i){n=!0,e?h(i):b(t,401,"Unauthorized")})),void(n||b(t,501,"Could not process protocols"))}void 0!==c?h(c.split(/, */)[0]):h()};if("function"==typeof this.options.verifyClient){var g={origin:d,secure:void 0!==e.connection.authorized||void 0!==e.connection.encrypted,req:e};if(2==this.options.verifyClient.length)return void this.options.verifyClient(g,(function(e,n,s){void 0===n&&(n=401),void 0===s&&(s=i.STATUS_CODES[n]),e?f():b(t,n,s)}));if(!this.options.verifyClient(g))return void b(t,401,"Unauthorized")}f()}else b(t,400,"Bad Request")}else b(t,400,"Bad Request")}function g(e,t,n,s){var a=function(){try{t.destroy()}catch(e){}};if(t.on("error",a),this.options.disableHixie)b(t,401,"Hixie support disabled");else if(e.headers["sec-websocket-key2"]){var o=e.headers.origin,c=this,d=function(){var i;i=e.headers["x-forwarded-host"]?e.headers["x-forwarded-host"]:e.headers.host;var d=("https"===e.headers["x-forwarded-proto"]||t.encrypted?"wss":"ws")+"://"+i+e.url,l=e.headers["sec-websocket-protocol"],u=function(){var e=["HTTP/1.1 101 Switching Protocols","Upgrade: WebSocket","Connection: Upgrade","Sec-WebSocket-Location: "+d];return void 0!==l&&e.push("Sec-WebSocket-Protocol: "+l),void 0!==o&&e.push("Sec-WebSocket-Origin: "+o),new Buffer(e.concat("","").join("\r\n"))},m=function(n,i,o){var d=e.headers["sec-websocket-key1"],u=e.headers["sec-websocket-key2"],m=r.createHash("md5");[d,u].forEach((function(e){var n=parseInt(e.replace(/[^\d]/g,"")),i=e.replace(/[^ ]/g,"").length;0!==i&&n%i==0?(n/=i,m.update(String.fromCharCode(n>>24&255,n>>16&255,n>>8&255,255&n))):b(t,400,"Bad Request")})),m.update(n.toString("binary")),t.setTimeout(0),t.setNoDelay(!0);try{var h=new Buffer(m.digest("binary"),"binary"),f=new Buffer(o.length+h.length);o.copy(f,0),h.copy(f,o.length),t.write(f,"binary",(function(n){if(!n){var r=new p([e,t,i],{protocolVersion:"hixie-76",protocol:l});c.options.clientTracking&&(c.clients.push(r),r.on("close",(function(){var e=c.clients.indexOf(r);-1!=e&&c.clients.splice(e,1)}))),t.removeListener("error",a),s(r)}}))}catch(e){try{t.destroy()}catch(e){}return}};if(n&&n.length>=8){var h=n.slice(0,8),f=n.length>8?n.slice(8):null;m.call(c,h,f,u())}else{h=new Buffer(8);n.copy(h,0);var g=n.length,v=(f=null,function(e){var n=Math.min(e.length,8-g);0!==n&&(e.copy(h,g,0,n),8==(g+=n)&&(t.removeListener("data",v),n<e.length&&(f=e.slice(n)),m.call(c,h,f,new Buffer(0))))});t.on("data",v),function(){t.setTimeout(0),t.setNoDelay(!0);var e=u();try{t.write(e,"binary",(function(e){e&&t.removeListener("data",v)}))}catch(e){try{t.destroy()}catch(e){}return}}()}};if("function"==typeof this.options.verifyClient){var l={origin:o,secure:void 0!==e.connection.authorized||void 0!==e.connection.encrypted,req:e};if(2==this.options.verifyClient.length){c=this;return void this.options.verifyClient(l,(function(e,n,s){void 0===n&&(n=401),void 0===s&&(s=i.STATUS_CODES[n]),e?d.apply(c):b(t,n,s)}))}if(!this.options.verifyClient(l))return void b(t,401,"Unauthorized")}d()}else b(t,400,"Bad Request")}function v(e){var t={},n=this.options.perMessageDeflate,i=this.options.maxPayload;if(n&&e[u.extensionName]){var s=new u(!0!==n?n:{},!0,i);s.accept(e[u.extensionName]),t[u.extensionName]=s}return t}function b(e,t,n){try{var i=["HTTP/1.1 "+t+" "+n,"Content-type: text/html"];e.write(i.concat("","").join("\r\n"))}catch(e){}finally{try{e.destroy()}catch(e){}}}return e.inherits(h,n.EventEmitter),h.prototype.close=function(e){var t=null;try{for(var n=0,i=this.clients.length;n<i;++n)this.clients[n].terminate()}catch(e){t=e}this.path&&this._server._webSocketPaths&&(delete this._server._webSocketPaths[this.path],0==Object.keys(this._server._webSocketPaths).length&&delete this._server._webSocketPaths);try{void 0!==this._closeServer&&this._closeServer()}finally{this._server&&(this._server.removeListener("listening",this._onceServerListening),this._server.removeListener("error",this._onServerError),this._server.removeListener("upgrade",this._onServerUpgrade)),delete this._server}if(e)e(t);else if(t)throw t},h.prototype.handleUpgrade=function(e,t,n,i){if(this.options.path){var s=m.parse(e.url);if(s&&s.pathname!==this.options.path)return}void 0!==e.headers.upgrade&&"websocket"===e.headers.upgrade.toLowerCase()?e.headers["sec-websocket-key1"]?g.apply(this,arguments):f.apply(this,arguments):b(t,400,"Bad Request")},Da=h}var Ba,Fa=Qs(),Ua=Fs,za=Xs,qa=Zs,$a=dr,Va=lr("engine.io-client:websocket"),Ha=Zt.WebSocket||Zt.MozWebSocket;if("undefined"==typeof window)try{Ia||(Ia=1,function(e){
87
87
  /*!
88
88
  * ws: a node.js websocket client
89
89
  * Copyright(c) 2011 Einar Otto Stangvik <einaros@gmail.com>
90
90
  * MIT Licensed
91
91
  */
92
- var t=Zr.exports=Aa();t.Server=Na(),t.Sender=ha(),t.Receiver=Pa(),t.createServer=function(e,n){var i=new t.Server(e);return"function"==typeof n&&i.on("connection",n),i},t.connect=t.createConnection=function(e,n){var i=new t(e);return"function"==typeof n&&i.on("open",n),i}}()),Ba=Xr}catch(e){}var Wa=Ha;Wa||"undefined"!=typeof window||(Wa=Ba);var Ga=Ka;function Ka(e){e&&e.forceBase64&&(this.supportsBinary=!1),this.perMessageDeflate=e.perMessageDeflate,this.usingBrowserWebSocket=Ha&&!e.forceNode,this.usingBrowserWebSocket||(Wa=Ba),Fa.call(this,e)}qa(Ka,Fa),Ka.prototype.name="websocket",Ka.prototype.supportsBinary=!0,Ka.prototype.doOpen=function(){if(this.check()){var e=this.uri(),t={agent:this.agent,perMessageDeflate:this.perMessageDeflate};t.pfx=this.pfx,t.key=this.key,t.passphrase=this.passphrase,t.cert=this.cert,t.ca=this.ca,t.ciphers=this.ciphers,t.rejectUnauthorized=this.rejectUnauthorized,this.extraHeaders&&(t.headers=this.extraHeaders),this.localAddress&&(t.localAddress=this.localAddress);try{this.ws=this.usingBrowserWebSocket?new Wa(e):new Wa(e,void 0,t)}catch(e){return this.emit("error",e)}void 0===this.ws.binaryType&&(this.supportsBinary=!1),this.ws.supports&&this.ws.supports.binary?(this.supportsBinary=!0,this.ws.binaryType="nodebuffer"):this.ws.binaryType="arraybuffer",this.addEventListeners()}},Ka.prototype.addEventListeners=function(){var e=this;this.ws.onopen=function(){e.onOpen()},this.ws.onclose=function(){e.onClose()},this.ws.onmessage=function(t){e.onData(t.data)},this.ws.onerror=function(t){e.onError("websocket error",t)}},Ka.prototype.write=function(e){var t=this;this.writable=!1;for(var n=e.length,i=0,s=n;i<s;i++)!function(e){Ua.encodePacket(e,t.supportsBinary,(function(i){if(!t.usingBrowserWebSocket){var s={};if(e.options&&(s.compress=e.options.compress),t.perMessageDeflate)("string"==typeof i?Xt.Buffer.byteLength(i):i.length)<t.perMessageDeflate.threshold&&(s.compress=!1)}try{t.usingBrowserWebSocket?t.ws.send(i):t.ws.send(i,s)}catch(e){Va("websocket closed before onclose event")}--n||r()}))}(e[i]);function r(){t.emit("flush"),setTimeout((function(){t.writable=!0,t.emit("drain")}),0)}},Ka.prototype.onClose=function(){Fa.prototype.onClose.call(this)},Ka.prototype.doClose=function(){void 0!==this.ws&&this.ws.close()},Ka.prototype.uri=function(){var e=this.query||{},t=this.secure?"wss":"ws",n="";return this.port&&("wss"===t&&443!==Number(this.port)||"ws"===t&&80!==Number(this.port))&&(n=":"+this.port),this.timestampRequests&&(e[this.timestampParam]=$a()),this.supportsBinary||(e.b64=1),(e=za.encode(e)).length&&(e="?"+e),t+"://"+(-1!==this.hostname.indexOf(":")?"["+this.hostname+"]":this.hostname)+n+this.path+e},Ka.prototype.check=function(){return!(!Wa||"__initialize"in Wa&&this.name===Ka.prototype.name)};var Ja=Ls,Qa=Ns,Ya=zr,Xa=Ga;Ds.polling=function(e){var t=!1,n=!1,i=!1!==e.jsonp;if(Xt.location){var s="https:"===location.protocol,r=location.port;r||(r=s?443:80),t=e.hostname!==location.hostname||r!==e.port,n=e.secure!==s}if(e.xdomain=t,e.xscheme=n,"open"in new Ja(e)&&!e.forceJSONP)return new Qa(e);if(!i)throw new Error("JSONP disabled");return new Ya(e)},Ds.websocket=Xa;var Za=[].indexOf,eo=function(e,t){if(Za)return e.indexOf(t);for(var n=0;n<e.length;++n)if(e[n]===t)return n;return-1},to=/^[\],:{}\s]*$/,no=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,io=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,so=/(?:^|:|,)(?:\s*\[)+/g,ro=/^\s+/,ao=/\s+$/,oo=Ds,co=Ks,po=lr("engine.io-client:socket"),lo=eo,uo=Fs,mo=Gi,ho=function(e){return"string"==typeof e&&e?(e=e.replace(ro,"").replace(ao,""),Xt.JSON&&JSON.parse?JSON.parse(e):to.test(e.replace(no,"@").replace(io,"]").replace(so,""))?new Function("return "+e)():void 0):null},fo=Xs,go=vo;function vo(e,t){if(!(this instanceof vo))return new vo(e,t);t=t||{},e&&"object"==typeof e&&(t=e,e=null),e?(e=mo(e),t.hostname=e.host,t.secure="https"===e.protocol||"wss"===e.protocol,t.port=e.port,e.query&&(t.query=e.query)):t.host&&(t.hostname=mo(t.host).host),this.secure=null!=t.secure?t.secure:Xt.location&&"https:"===location.protocol,t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.agent=t.agent||!1,this.hostname=t.hostname||(Xt.location?location.hostname:"localhost"),this.port=t.port||(Xt.location&&location.port?location.port:this.secure?443:80),this.query=t.query||{},"string"==typeof this.query&&(this.query=fo.decode(this.query)),this.upgrade=!1!==t.upgrade,this.path=(t.path||"/engine.io").replace(/\/$/,"")+"/",this.forceJSONP=!!t.forceJSONP,this.jsonp=!1!==t.jsonp,this.forceBase64=!!t.forceBase64,this.enablesXDR=!!t.enablesXDR,this.timestampParam=t.timestampParam||"t",this.timestampRequests=t.timestampRequests,this.transports=t.transports||["polling","websocket"],this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.policyPort=t.policyPort||843,this.rememberUpgrade=t.rememberUpgrade||!1,this.binaryType=null,this.onlyBinaryUpgrades=t.onlyBinaryUpgrades,this.perMessageDeflate=!1!==t.perMessageDeflate&&(t.perMessageDeflate||{}),!0===this.perMessageDeflate&&(this.perMessageDeflate={}),this.perMessageDeflate&&null==this.perMessageDeflate.threshold&&(this.perMessageDeflate.threshold=1024),this.pfx=t.pfx||null,this.key=t.key||null,this.passphrase=t.passphrase||null,this.cert=t.cert||null,this.ca=t.ca||null,this.ciphers=t.ciphers||null,this.rejectUnauthorized=void 0===t.rejectUnauthorized?null:t.rejectUnauthorized,this.forceNode=!!t.forceNode;var n="object"==typeof Xt&&Xt;n.global===n&&(t.extraHeaders&&Object.keys(t.extraHeaders).length>0&&(this.extraHeaders=t.extraHeaders),t.localAddress&&(this.localAddress=t.localAddress)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingIntervalTimer=null,this.pingTimeoutTimer=null,this.open()}vo.priorWebsocketSuccess=!1,co(vo.prototype),vo.protocol=uo.protocol,vo.Socket=vo,vo.Transport=Qs(),vo.transports=Ds,vo.parser=Fs,vo.prototype.createTransport=function(e){po('creating transport "%s"',e);var t=function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}(this.query);return t.EIO=uo.protocol,t.transport=e,this.id&&(t.sid=this.id),new oo[e]({agent:this.agent,hostname:this.hostname,port:this.port,secure:this.secure,path:this.path,query:t,forceJSONP:this.forceJSONP,jsonp:this.jsonp,forceBase64:this.forceBase64,enablesXDR:this.enablesXDR,timestampRequests:this.timestampRequests,timestampParam:this.timestampParam,policyPort:this.policyPort,socket:this,pfx:this.pfx,key:this.key,passphrase:this.passphrase,cert:this.cert,ca:this.ca,ciphers:this.ciphers,rejectUnauthorized:this.rejectUnauthorized,perMessageDeflate:this.perMessageDeflate,extraHeaders:this.extraHeaders,forceNode:this.forceNode,localAddress:this.localAddress})},vo.prototype.open=function(){var e;if(this.rememberUpgrade&&vo.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))e="websocket";else{if(0===this.transports.length){var t=this;return void setTimeout((function(){t.emit("error","No transports available")}),0)}e=this.transports[0]}this.readyState="opening";try{e=this.createTransport(e)}catch(e){return this.transports.shift(),void this.open()}e.open(),this.setTransport(e)},vo.prototype.setTransport=function(e){po("setting transport %s",e.name);var t=this;this.transport&&(po("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=e,e.on("drain",(function(){t.onDrain()})).on("packet",(function(e){t.onPacket(e)})).on("error",(function(e){t.onError(e)})).on("close",(function(){t.onClose("transport close")}))},vo.prototype.probe=function(e){po('probing transport "%s"',e);var t=this.createTransport(e,{probe:1}),n=!1,i=this;function s(){if(i.onlyBinaryUpgrades){var s=!this.supportsBinary&&i.transport.supportsBinary;n=n||s}n||(po('probe transport "%s" opened',e),t.send([{type:"ping",data:"probe"}]),t.once("packet",(function(s){if(!n)if("pong"===s.type&&"probe"===s.data){if(po('probe transport "%s" pong',e),i.upgrading=!0,i.emit("upgrading",t),!t)return;vo.priorWebsocketSuccess="websocket"===t.name,po('pausing current transport "%s"',i.transport.name),i.transport.pause((function(){n||"closed"!==i.readyState&&(po("changing transport and sending upgrade packet"),d(),i.setTransport(t),t.send([{type:"upgrade"}]),i.emit("upgrade",t),t=null,i.upgrading=!1,i.flush())}))}else{po('probe transport "%s" failed',e);var r=new Error("probe error");r.transport=t.name,i.emit("upgradeError",r)}})))}function r(){n||(n=!0,d(),t.close(),t=null)}function a(n){var s=new Error("probe error: "+n);s.transport=t.name,r(),po('probe transport "%s" failed because of error: %s',e,n),i.emit("upgradeError",s)}function o(){a("transport closed")}function c(){a("socket closed")}function p(e){t&&e.name!==t.name&&(po('"%s" works - aborting "%s"',e.name,t.name),r())}function d(){t.removeListener("open",s),t.removeListener("error",a),t.removeListener("close",o),i.removeListener("close",c),i.removeListener("upgrading",p)}vo.priorWebsocketSuccess=!1,t.once("open",s),t.once("error",a),t.once("close",o),this.once("close",c),this.once("upgrading",p),t.open()},vo.prototype.onOpen=function(){if(po("socket open"),this.readyState="open",vo.priorWebsocketSuccess="websocket"===this.transport.name,this.emit("open"),this.flush(),"open"===this.readyState&&this.upgrade&&this.transport.pause){po("starting upgrade probes");for(var e=0,t=this.upgrades.length;e<t;e++)this.probe(this.upgrades[e])}},vo.prototype.onPacket=function(e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(po('socket receive: type "%s", data "%s"',e.type,e.data),this.emit("packet",e),this.emit("heartbeat"),e.type){case"open":this.onHandshake(ho(e.data));break;case"pong":this.setPing(),this.emit("pong");break;case"error":var t=new Error("server error");t.code=e.data,this.onError(t);break;case"message":this.emit("data",e.data),this.emit("message",e.data)}else po('packet received with socket readyState "%s"',this.readyState)},vo.prototype.onHandshake=function(e){this.emit("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this.upgrades=this.filterUpgrades(e.upgrades),this.pingInterval=e.pingInterval,this.pingTimeout=e.pingTimeout,this.onOpen(),"closed"!==this.readyState&&(this.setPing(),this.removeListener("heartbeat",this.onHeartbeat),this.on("heartbeat",this.onHeartbeat))},vo.prototype.onHeartbeat=function(e){clearTimeout(this.pingTimeoutTimer);var t=this;t.pingTimeoutTimer=setTimeout((function(){"closed"!==t.readyState&&t.onClose("ping timeout")}),e||t.pingInterval+t.pingTimeout)},vo.prototype.setPing=function(){var e=this;clearTimeout(e.pingIntervalTimer),e.pingIntervalTimer=setTimeout((function(){po("writing ping packet - expecting pong within %sms",e.pingTimeout),e.ping(),e.onHeartbeat(e.pingTimeout)}),e.pingInterval)},vo.prototype.ping=function(){var e=this;this.sendPacket("ping",(function(){e.emit("ping")}))},vo.prototype.onDrain=function(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0===this.writeBuffer.length?this.emit("drain"):this.flush()},vo.prototype.flush=function(){"closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length&&(po("flushing %d packets in socket",this.writeBuffer.length),this.transport.send(this.writeBuffer),this.prevBufferLen=this.writeBuffer.length,this.emit("flush"))},vo.prototype.write=vo.prototype.send=function(e,t,n){return this.sendPacket("message",e,t,n),this},vo.prototype.sendPacket=function(e,t,n,i){if("function"==typeof t&&(i=t,t=void 0),"function"==typeof n&&(i=n,n=null),"closing"!==this.readyState&&"closed"!==this.readyState){(n=n||{}).compress=!1!==n.compress;var s={type:e,data:t,options:n};this.emit("packetCreate",s),this.writeBuffer.push(s),i&&this.once("flush",i),this.flush()}},vo.prototype.close=function(){if("opening"===this.readyState||"open"===this.readyState){this.readyState="closing";var e=this;this.writeBuffer.length?this.once("drain",(function(){this.upgrading?i():t()})):this.upgrading?i():t()}function t(){e.onClose("forced close"),po("socket closing - telling transport to close"),e.transport.close()}function n(){e.removeListener("upgrade",n),e.removeListener("upgradeError",n),t()}function i(){e.once("upgrade",n),e.once("upgradeError",n)}return this},vo.prototype.onError=function(e){po("socket error %j",e),vo.priorWebsocketSuccess=!1,this.emit("error",e),this.onClose("transport error",e)},vo.prototype.onClose=function(e,t){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState){po('socket close with reason: "%s"',e);clearTimeout(this.pingIntervalTimer),clearTimeout(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),this.readyState="closed",this.id=null,this.emit("close",e,t),this.writeBuffer=[],this.prevBufferLen=0}},vo.prototype.filterUpgrades=function(e){for(var t=[],n=0,i=e.length;n<i;n++)~lo(this.transports,e[n])&&t.push(e[n]);return t},function(e){e.exports=go,e.exports.parser=Fs}(Os),Ps.exports=Es;var bo,yo,_o={},xo={get exports(){return _o},set exports(e){_o=e}};var wo=function(e,t,n){return e.on(t,n),{destroy:function(){e.removeListener(t,n)}}};var So,ko,Co,Ro,To,Po=[].slice,Eo=function(e,t){if("string"==typeof t&&(t=e[t]),"function"!=typeof t)throw new Error("bind() requires a function");var n=Po.call(arguments,2);return function(){return t.apply(e,n.concat(Po.call(arguments)))}};function Oo(){if(Ro)return Co;Ro=1;var e=ko?So:(ko=1,So=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)});return Co=function(t){return function t(n){if(!n)return!1;if(Xt.Buffer&&Xt.Buffer.isBuffer&&Xt.Buffer.isBuffer(n)||Xt.ArrayBuffer&&n instanceof ArrayBuffer||Xt.Blob&&n instanceof Blob||Xt.File&&n instanceof File)return!0;if(e(n)){for(var i=0;i<n.length;i++)if(t(n[i]))return!0}else if(n&&"object"==typeof n)for(var s in n.toJSON&&"function"==typeof n.toJSON&&(n=n.toJSON()),n)if(Object.prototype.hasOwnProperty.call(n,s)&&t(n[s]))return!0;return!1}(t)},Co}function Do(){return To||(To=1,function(e,t){var n=os,i=Ks,s=(yo||(yo=1,bo=function(e,t){for(var n=[],i=(t=t||0)||0;i<e.length;i++)n[i-t]=e[i];return n}),bo),r=wo,a=Eo,o=Ki("socket.io-client:socket"),c=Oo();e.exports=l;var p={connect:1,connect_error:1,connect_timeout:1,connecting:1,disconnect:1,error:1,reconnect:1,reconnect_attempt:1,reconnect_failed:1,reconnect_error:1,reconnecting:1,ping:1,pong:1},d=i.prototype.emit;function l(e,t,n){this.io=e,this.nsp=t,this.json=this,this.ids=0,this.acks={},this.receiveBuffer=[],this.sendBuffer=[],this.connected=!1,this.disconnected=!0,n&&n.query&&(this.query=n.query),this.io.autoConnect&&this.open()}i(l.prototype),l.prototype.subEvents=function(){if(!this.subs){var e=this.io;this.subs=[r(e,"open",a(this,"onopen")),r(e,"packet",a(this,"onpacket")),r(e,"close",a(this,"onclose"))]}},l.prototype.open=l.prototype.connect=function(){return this.connected||(this.subEvents(),this.io.open(),"open"===this.io.readyState&&this.onopen(),this.emit("connecting")),this},l.prototype.send=function(){var e=s(arguments);return e.unshift("message"),this.emit.apply(this,e),this},l.prototype.emit=function(e){if(p.hasOwnProperty(e))return d.apply(this,arguments),this;var t=s(arguments),i=n.EVENT;c(t)&&(i=n.BINARY_EVENT);var r={type:i,data:t,options:{}};return r.options.compress=!this.flags||!1!==this.flags.compress,"function"==typeof t[t.length-1]&&(o("emitting packet with ack id %d",this.ids),this.acks[this.ids]=t.pop(),r.id=this.ids++),this.connected?this.packet(r):this.sendBuffer.push(r),delete this.flags,this},l.prototype.packet=function(e){e.nsp=this.nsp,this.io.packet(e)},l.prototype.onopen=function(){o("transport is open - connecting"),"/"!==this.nsp&&(this.query?this.packet({type:n.CONNECT,query:this.query}):this.packet({type:n.CONNECT}))},l.prototype.onclose=function(e){o("close (%s)",e),this.connected=!1,this.disconnected=!0,delete this.id,this.emit("disconnect",e)},l.prototype.onpacket=function(e){if(e.nsp===this.nsp)switch(e.type){case n.CONNECT:this.onconnect();break;case n.EVENT:case n.BINARY_EVENT:this.onevent(e);break;case n.ACK:case n.BINARY_ACK:this.onack(e);break;case n.DISCONNECT:this.ondisconnect();break;case n.ERROR:this.emit("error",e.data)}},l.prototype.onevent=function(e){var t=e.data||[];o("emitting event %j",t),null!=e.id&&(o("attaching ack callback to event"),t.push(this.ack(e.id))),this.connected?d.apply(this,t):this.receiveBuffer.push(t)},l.prototype.ack=function(e){var t=this,i=!1;return function(){if(!i){i=!0;var r=s(arguments);o("sending ack %j",r);var a=c(r)?n.BINARY_ACK:n.ACK;t.packet({type:a,id:e,data:r})}}},l.prototype.onack=function(e){var t=this.acks[e.id];"function"==typeof t?(o("calling ack %s with %j",e.id,e.data),t.apply(this,e.data),delete this.acks[e.id]):o("bad ack %s",e.id)},l.prototype.onconnect=function(){this.connected=!0,this.disconnected=!1,this.emit("connect"),this.emitBuffered()},l.prototype.emitBuffered=function(){var e;for(e=0;e<this.receiveBuffer.length;e++)d.apply(this,this.receiveBuffer[e]);for(this.receiveBuffer=[],e=0;e<this.sendBuffer.length;e++)this.packet(this.sendBuffer[e]);this.sendBuffer=[]},l.prototype.ondisconnect=function(){o("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")},l.prototype.destroy=function(){if(this.subs){for(var e=0;e<this.subs.length;e++)this.subs[e].destroy();this.subs=null}this.io.destroy(this)},l.prototype.close=l.prototype.disconnect=function(){return this.connected&&(o("performing disconnect (%s)",this.nsp),this.packet({type:n.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this},l.prototype.compress=function(e){return this.flags=this.flags||{},this.flags.compress=e,this}}(xo)),_o}var jo=Io;function Io(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Io.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=0==(1&Math.floor(10*t))?e-n:e+n}return 0|Math.min(e,this.max)},Io.prototype.reset=function(){this.attempts=0},Io.prototype.setMin=function(e){this.ms=e},Io.prototype.setMax=function(e){this.max=e},Io.prototype.setJitter=function(e){this.jitter=e};var Mo=Ts,Lo=Do(),Ao=Ks,No=os,Bo=wo,Fo=Eo,Uo=Ki("socket.io-client:manager"),zo=eo,qo=jo,$o=Object.prototype.hasOwnProperty,Vo=Ho;function Ho(e,t){if(!(this instanceof Ho))return new Ho(e,t);e&&"object"==typeof e&&(t=e,e=void 0),(t=t||{}).path=t.path||"/socket.io",this.nsps={},this.subs=[],this.opts=t,this.reconnection(!1!==t.reconnection),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor(t.randomizationFactor||.5),this.backoff=new qo({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==t.timeout?2e4:t.timeout),this.readyState="closed",this.uri=e,this.connecting=[],this.lastPing=null,this.encoding=!1,this.packetBuffer=[],this.encoder=new No.Encoder,this.decoder=new No.Decoder,this.autoConnect=!1!==t.autoConnect,this.autoConnect&&this.open()}Ho.prototype.emitAll=function(){for(var e in this.emit.apply(this,arguments),this.nsps)$o.call(this.nsps,e)&&this.nsps[e].emit.apply(this.nsps[e],arguments)},Ho.prototype.updateSocketIds=function(){for(var e in this.nsps)$o.call(this.nsps,e)&&(this.nsps[e].id=this.engine.id)},Ao(Ho.prototype),Ho.prototype.reconnection=function(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection},Ho.prototype.reconnectionAttempts=function(e){return arguments.length?(this._reconnectionAttempts=e,this):this._reconnectionAttempts},Ho.prototype.reconnectionDelay=function(e){return arguments.length?(this._reconnectionDelay=e,this.backoff&&this.backoff.setMin(e),this):this._reconnectionDelay},Ho.prototype.randomizationFactor=function(e){return arguments.length?(this._randomizationFactor=e,this.backoff&&this.backoff.setJitter(e),this):this._randomizationFactor},Ho.prototype.reconnectionDelayMax=function(e){return arguments.length?(this._reconnectionDelayMax=e,this.backoff&&this.backoff.setMax(e),this):this._reconnectionDelayMax},Ho.prototype.timeout=function(e){return arguments.length?(this._timeout=e,this):this._timeout},Ho.prototype.maybeReconnectOnOpen=function(){!this.reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()},Ho.prototype.open=Ho.prototype.connect=function(e,t){if(Uo("readyState %s",this.readyState),~this.readyState.indexOf("open"))return this;Uo("opening %s",this.uri),this.engine=Mo(this.uri,this.opts);var n=this.engine,i=this;this.readyState="opening",this.skipReconnect=!1;var s=Bo(n,"open",(function(){i.onopen(),e&&e()})),r=Bo(n,"error",(function(t){if(Uo("connect_error"),i.cleanup(),i.readyState="closed",i.emitAll("connect_error",t),e){var n=new Error("Connection error");n.data=t,e(n)}else i.maybeReconnectOnOpen()}));if(!1!==this._timeout){var a=this._timeout;Uo("connect attempt will timeout after %d",a);var o=setTimeout((function(){Uo("connect attempt timed out after %d",a),s.destroy(),n.close(),n.emit("error","timeout"),i.emitAll("connect_timeout",a)}),a);this.subs.push({destroy:function(){clearTimeout(o)}})}return this.subs.push(s),this.subs.push(r),this},Ho.prototype.onopen=function(){Uo("open"),this.cleanup(),this.readyState="open",this.emit("open");var e=this.engine;this.subs.push(Bo(e,"data",Fo(this,"ondata"))),this.subs.push(Bo(e,"ping",Fo(this,"onping"))),this.subs.push(Bo(e,"pong",Fo(this,"onpong"))),this.subs.push(Bo(e,"error",Fo(this,"onerror"))),this.subs.push(Bo(e,"close",Fo(this,"onclose"))),this.subs.push(Bo(this.decoder,"decoded",Fo(this,"ondecoded")))},Ho.prototype.onping=function(){this.lastPing=new Date,this.emitAll("ping")},Ho.prototype.onpong=function(){this.emitAll("pong",new Date-this.lastPing)},Ho.prototype.ondata=function(e){this.decoder.add(e)},Ho.prototype.ondecoded=function(e){this.emit("packet",e)},Ho.prototype.onerror=function(e){Uo("error",e),this.emitAll("error",e)},Ho.prototype.socket=function(e,t){var n=this.nsps[e];if(!n){n=new Lo(this,e,t),this.nsps[e]=n;var i=this;n.on("connecting",s),n.on("connect",(function(){n.id=i.engine.id})),this.autoConnect&&s()}function s(){~zo(i.connecting,n)||i.connecting.push(n)}return n},Ho.prototype.destroy=function(e){var t=zo(this.connecting,e);~t&&this.connecting.splice(t,1),this.connecting.length||this.close()},Ho.prototype.packet=function(e){Uo("writing packet %j",e);var t=this;e.query&&0===e.type&&(e.nsp+="?"+e.query),t.encoding?t.packetBuffer.push(e):(t.encoding=!0,this.encoder.encode(e,(function(n){for(var i=0;i<n.length;i++)t.engine.write(n[i],e.options);t.encoding=!1,t.processPacketQueue()})))},Ho.prototype.processPacketQueue=function(){if(this.packetBuffer.length>0&&!this.encoding){var e=this.packetBuffer.shift();this.packet(e)}},Ho.prototype.cleanup=function(){Uo("cleanup");for(var e=this.subs.length,t=0;t<e;t++){this.subs.shift().destroy()}this.packetBuffer=[],this.encoding=!1,this.lastPing=null,this.decoder.destroy()},Ho.prototype.close=Ho.prototype.disconnect=function(){Uo("disconnect"),this.skipReconnect=!0,this.reconnecting=!1,"opening"===this.readyState&&this.cleanup(),this.backoff.reset(),this.readyState="closed",this.engine&&this.engine.close()},Ho.prototype.onclose=function(e){Uo("onclose"),this.cleanup(),this.backoff.reset(),this.readyState="closed",this.emit("close",e),this._reconnection&&!this.skipReconnect&&this.reconnect()},Ho.prototype.reconnect=function(){if(this.reconnecting||this.skipReconnect)return this;var e=this;if(this.backoff.attempts>=this._reconnectionAttempts)Uo("reconnect failed"),this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1;else{var t=this.backoff.duration();Uo("will wait %dms before reconnect attempt",t),this.reconnecting=!0;var n=setTimeout((function(){e.skipReconnect||(Uo("attempting reconnect"),e.emitAll("reconnect_attempt",e.backoff.attempts),e.emitAll("reconnecting",e.backoff.attempts),e.skipReconnect||e.open((function(t){t?(Uo("reconnect attempt error"),e.reconnecting=!1,e.reconnect(),e.emitAll("reconnect_error",t.data)):(Uo("reconnect success"),e.onreconnect())})))}),t);this.subs.push({destroy:function(){clearTimeout(n)}})}},Ho.prototype.onreconnect=function(){var e=this.backoff.attempts;this.reconnecting=!1,this.backoff.reset(),this.updateSocketIds(),this.emitAll("reconnect",e)},function(e,t){var n=as,i=os,s=Vo,r=Ki("socket.io-client");e.exports=t=o;var a=t.managers={};function o(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var i,o=n(e),c=o.source,p=o.id,d=o.path,l=a[p]&&d in a[p].nsps;return t.forceNew||t["force new connection"]||!1===t.multiplex||l?(r("ignoring socket cache for %s",c),i=s(c,t)):(a[p]||(r("new io instance for %s",c),a[p]=s(c,t)),i=a[p]),o.query&&!t.query?t.query=o.query:t&&"object"==typeof t.query&&(t.query=function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t.join("&")}(t.query)),i.socket(o.path,t)}t.protocol=i.protocol,t.connect=o,t.Manager=Vo,t.Socket=Do()}(Vi,$i);var Wo=$i;class Go{constructor(e,t){t&&!t.transports&&(t.transports=["websocket"]),this._socket=Wo(e,t),this._socket.on("reconnect",(()=>{this._socket.sendBuffer=[]})),this._socket.on("reconnect_attempt",(()=>{this._wasConnectedUsingWebsocket?(this._socket.io.opts.transports=["websocket"],"safari"!==Bi.browserDetails.browser&&delete this._wasConnectedUsingWebsocket):this._socket.io.opts.transports=["polling","websocket"]})),this._socket.on("connect",(()=>{"websocket"===this.getTransport()&&(this._wasConnectedUsingWebsocket=!0)}))}connect(){this.isConnected()||this.isConnecting()||this._socket.open()}disconnect(){this._socket.disconnect()}disconnectOnConnect(){this._socket.once("connect",(()=>{this._socket.disconnect()}))}emit(){this._socket.emit.apply(this._socket,arguments)}emitIfConnected(e,t){this.isConnected()&&this.emit(e,t)}getTransport(){return this._socket&&this._socket.io&&this._socket.io.engine&&this._socket.io.engine.transport&&this._socket.io.engine.transport.name}isConnecting(){return this._socket&&this._socket.connecting}isConnected(){return this._socket&&this._socket.connected}on(e,t){return this._socket.on(e,t),()=>{this._socket.off(e,t)}}once(e,t){this._socket.once(e,t)}off(e,t){this._socket.off(e,t)}}var Ko="connection_blocked_by_network",Jo="dominant_speaker";const Qo=Bi.browserDetails.browser,Yo=Bi.browserDetails.version;function Xo(e,t){let n=e.match(/a=ssrc-group:FID (\d+) (\d+)\r\n/),i=t.match(/a=ssrc-group:FID (\d+) (\d+)\r\n/);n||(n=e.match(/a=ssrc:(\d+) cname:(.*)\r\n/g)[1].match(/a=ssrc:(\d+)/),i=t.match(/a=ssrc:(\d+) cname:(.*)\r\n/g)[1].match(/a=ssrc:(\d+)/));for(let e=1;e<n.length;e++)t=t.replace(new RegExp(i[e],"g"),n[e]);return t}function Zo(e){return"firefox"!==Qo?e:Ti.splitLines(e.trim()).map((e=>e.startsWith("a=msid-semantic:")?"a=msid-semantic: WMS *":e)).join("\r\n")+"\r\n"}const ec=console;function tc(e,t){const n=e.getSenders().find((e=>e.track&&"video"===e.track.kind));if(!n)return Promise.resolve();const i=n.getParameters();return i.encodings&&0===i.encodings.length?Promise.resolve():(i.encodings||(i.encodings=[{}]),0===t?delete i.encodings[0].maxBitrate:i.encodings[0].maxBitrate=1e3*t,n.setParameters(i).catch((e=>{ec.error("setParameters err: ",e)})))}const nc=console;class ic{constructor({peerConnectionId:e,bandwidth:t,maximumTurnBandwidth:n,deprioritizeH264Encoding:i}){this.peerConnectionId=e,this.relayCandidateSeen=!1,this.pc=null,this.wasEverConnected=!1,this.connectionStatus=null,this.stats={totalSent:0,totalRecv:0},this.bandwidth=t||0,this.maximumTurnBandwidth=n,this.pending=[],this.isOperationPending=!1,this.streamIds=[],this.streams=[],this.earlyIceCandidates=[],this.afterConnected=new Promise((e=>{this.registerConnected=e})),this.offerOptions={offerToReceiveAudio:!0,offerToReceiveVideo:!0},this._deprioritizeH264Encoding=i}setAndGetPeerConnection({clientId:e,constraints:t,peerConnectionConfig:n,shouldAddLocalVideo:i}){return this.peerConnectionConfig=n,this.shouldAddLocalVideo=i,this.clientId=e,this.pc=new RTCPeerConnection(n,t),this.signalingState=this.pc.signalingState,this.pc.addEventListener("signalingstatechange",(()=>{if(this.signalingState!==this.pc.signalingState&&(this.signalingState=this.pc.signalingState,"stable"===this.pc.signalingState)){this.isOperationPending=!1;const e=this.pending.shift();e&&e.apply()}})),this.pc}addStream(e){this.streamIds.push(e.id),this.streams.push(e),RTCPeerConnection.prototype.addTrack?(e.getAudioTracks().forEach((t=>{this.pc.addTrack(t,e)})),e.getVideoTracks().forEach((t=>{this.pc.addTrack(t,e)}))):this.pc.addStream(e)}addTrack(e,t){t||(t=this.streams[0]),t.addTrack(e),this.pc.addTrack(e,t)}removeTrack(e){this.streams[0].removeTrack(e);const t=this.pc.getSenders().find((t=>t.track===e));t&&this.pc.removeTrack(t)}removeStream(e){for(let t=0;t<this.streamIds.length;t++)this.streamIds[t]===e.id&&(this.streamIds.splice(t,1),this.streams.splice(t,1));this.pc&&(this.pc.removeTrack?e.getTracks().forEach((e=>{const t=this.pc.getSenders().find((t=>t.track===e));t&&this.pc.removeTrack(t)})):this.pc.removeStream&&this.pc.removeStream(e))}_setRemoteDescription(e){return this._deprioritizeH264Encoding&&(e.sdp=function(e){return Ti.splitSections(e).map((e=>{if("video"!==Ti.getKind(e))return e;const t=Ti.matchPrefix(e,"a=rtpmap:").map((e=>Ti.parseRtpMap(e))).filter((e=>/h264/i.test(e.name))).map((e=>""+e.payloadType));if(!t.length)return e;const n=Ti.matchPrefix(e,"m=video")[0],i=/(\s\d+)+$/i.exec(n)[0],s=[...i.split(" ").filter((e=>e&&!t.includes(e))),...t].join(" "),r=n.replace(i," "+s);return e.replace(n,r)})).join("")}(e.sdp)),this.srdComplete=this.pc.setRemoteDescription(e),this.srdComplete.then((()=>{this.earlyIceCandidates.forEach((e=>this.pc.addIceCandidate(e))),this.earlyIceCandidates=[]}))}handleOffer(e){if(!this.canModifyPeerConnection())return new Promise((t=>{this.pending.push((()=>this.handleOffer(e).then(t)))}));this.isOperationPending=!0;let t=e.sdp;t=function(e){return"safari"!==Qo&&("firefox"!==Qo||Yo>=63||60===Yo)?e:Ti.splitLines(e.trim()).filter((e=>!e.startsWith("a=extmap:")||"urn:ietf:params:rtp-hdrext:sdes:mid"!==Ti.parseExtmap(e).uri)).join("\r\n")+"\r\n"}(t),t=Zo(t);const n={type:e.type,sdp:t};let i;return this._setRemoteDescription(n).then((()=>this.pc.createAnswer())).then((e=>(i=e,this.pc.setLocalDescription(e)))).then((()=>tc(this.pc,this.bandwidth))).then((()=>i))}handleAnswer(e){if(this.pendingOffer){const t=this.pendingOffer;return delete this.pendingOffer,this.pc.setLocalDescription(t).then((()=>this.handleAnswer(e)))}let t=e.sdp;t=Zo(t);const n={type:e.type,sdp:t};return this._setRemoteDescription(n).then((()=>tc(this.pc,this.bandwidth)),(e=>{nc.warn("Could not set remote description from remote answer: ",e)}))}addIceCandidate(e){this.srdComplete?this.srdComplete.then((()=>{"closed"!==this.pc.signalingState&&("safari"===Bi.browserDetails.browser&&e&&""===e.candidate||this.pc.addIceCandidate(e).catch((t=>{nc.warn("Failed to add ICE candidate ('%s'): %s",e?e.candidate:null,t)})))})):this.earlyIceCandidates.push(e)}canModifyPeerConnection(){return"stable"===this.pc.signalingState&&!this.isOperationPending}close(){const e=this.pc;if(e){e.oniceconnectionstatechange=null,e.onicecandidate=null,e.ontrack=null;try{e.close()}catch(e){console.warn("failures during close of session",e)}}}hasConnectedPeerConnection(){return this.pc&&"connected"===this.pc.connectionState}replaceTrack(e,t){const n=this.pc;if(!n)return!1;const i=n.getSenders();function s(n){const s=e=>e&&`id:${e.id},kind:${e.kind},state:${e.readyState}`;nc.warn(`${n}. newTrack:${s(t)}, oldTrack:${s(e)}, sender tracks: ${JSON.stringify(i.map((e=>`s ${s(e.track)}`)))}, sender first codecs: ${JSON.stringify(i.map((e=>(e.getParameters().codecs||[])[0])))}`)}if(i.length||s("No senders!"),e||(e=(i.find((e=>e.track&&e.track.kind===t.kind))||{}).track,e||s("No sender with same kind! Add new track then.")),window.RTCRtpSender&&window.RTCRtpSender.prototype.replaceTrack){if(e){const n=()=>{for(let n=0;n<i.length;n++){const r=i[n],a=r.track;if(r||a||s("One of the tracks is null!"),a.id===t.id)return Promise.resolve(t);if(a.id===e.id)return i[n].replaceTrack(t)}return null};let r=n();if(r)return r;let a=null,o=null;r=new Promise(((e,t)=>{a=e,o=t}));let c=0,p=setInterval((async()=>{const e=n();if(!e)return void(3<++c&&(clearInterval(p),p=null,s("No sender track to replace"),o("No sender track to replace")));clearInterval(p),p=null;const t=await e;a(t)}),1e3);return r}const r=this.streams.find((e=>e.getTracks().find((e=>e.id===t.id))))||this.streams[0];return r?n.addTrack(t,r):(s("No stream?"),Promise.reject(new Error("replaceTrack: No stream?")))}if(!this.canModifyPeerConnection())return void this.pending.push((()=>{this.replaceTrack(e,t)}));this.isOperationPending=!0;const r=n.onnegotiationneeded;return n.onnegotiationneeded=null,this.removeTrack(e),this.addTrack(t),setTimeout((()=>{n.onnegotiationneeded=r}),0),"offer"===n.localDescription.type?n.createOffer().then((e=>(e.sdp=Xo(n.localDescription.sdp,e.sdp),n.setLocalDescription(e)))).then((()=>this._setRemoteDescription(n.remoteDescription))):this._setRemoteDescription(n.remoteDescription).then((()=>n.createAnswer())).then((e=>(e.sdp=Xo(n.localDescription.sdp,e.sdp),n.setLocalDescription(e))))}maybeRestrictRelayBandwidth(){var e;this.pc.getStats&&(e=this.pc,e.getStats(null).then((e=>{let t,n;return e.forEach((i=>{if("transport"===i.type&&i.selectedCandidatePairId){const s=e.get(i.selectedCandidatePairId);if(!s)return;return t=e.get(s.localCandidateId).candidateType,void(n=e.get(s.remoteCandidateId).candidateType)}"candidate-pair"===i.type&&i.selected&&(t=e.get(i.localCandidateId).candidateType,n=e.get(i.remoteCandidateId).candidateType)})),"relay"===t||"relayed"===t||"relay"===n||"relayed"===n}))).then((e=>{e&&0===this.bandwidth&&this.changeBandwidth(this.maximumTurnBandwidth)}))}changeBandwidth(e){e!==this.bandwidth&&(this.canModifyPeerConnection()?(this.bandwidth=e,this.pc.localDescription&&""!==this.pc.localDescription.type&&tc(this.pc,this.bandwidth)):this.pending.push((()=>this.changeBandwidth(e))))}}process.env.AWF_BASE_URL,process.env.AWF_API_BASE_URL,process.env.AP_ROOM_BASE_URL;const sc=console,rc=Bi.browserDetails.browser,ac=Bi.browserDetails.version;const oc=console,cc=Bi.browserDetails.browser;class pc extends class{constructor({selfId:e,room:t,emitter:n,serverSocket:i,webrtcProvider:s,features:r}){m.ok(e,"selfId is required"),m.ok(t,"room is required"),m.ok(n&&n.emit,"emitter is required"),m.ok(i instanceof Go,"serverSocket is required"),m.ok(s,"webrtcProvider is required");const{name:a,session:o,iceServers:c,sfuServer:p,mediaserverConfigTtlSeconds:d}=t;this._selfId=e,this._roomName=a,this._roomSessionId=o&&o.id,this.peerConnections={},this.localStreams={},this.enabledLocalStreamIds=[],this._socketListenerDeregisterFunctions=[],this._emitter=n,this._serverSocket=i,this._webrtcProvider=s,this._features=r||{},this.offerOptions={offerToReceiveAudio:!0,offerToReceiveVideo:!0},this._pendingActionsForConnectedPeerConnections=[],this._updateAndScheduleMediaServersRefresh({sfuServer:p,iceServers:c.iceServers||[],mediaserverConfigTtlSeconds:d})}numberOfPeerconnections(){return Object.keys(this.peerConnections).length}numberOfRemotePeers(){return Object.values(this.peerConnections).filter((e=>e.clientId!==this._selfId)).length}_setConnectionStatus(e,t,n){const i=e.connectionStatus;i!==t&&e.peerConnectionId!==this._selfId&&(i===Sn&&t===_n||(e.connectionStatus=t,setTimeout((()=>{this._emit(hn,{streamIds:e.streamIds,clientId:n,status:t,previous:i})}),0)))}_emitServerEvent(e,t,n){this._serverSocket.emit(e,t,n)}_emit(e,t){this._emitter.emit(e,t)}isInitializedWith({selfId:e,roomName:t,isSfu:n}){return this._selfId===e&&this._roomName===t&&n===!!this._sfuServer}supportsScreenShareAudio(){return!0}_addEnabledLocalStreamId(e){this.enabledLocalStreamIds.push(e)}_deleteEnabledLocalStreamId(e){const t=this.enabledLocalStreamIds.indexOf(e);-1!==t&&this.enabledLocalStreamIds.splice(t,1)}_getSession(e){return e in this.peerConnections?this.peerConnections[e]:null}_getOrCreateSession(e,t){let n=this.peerConnections[e];if(void 0===n){const i="safari"===rc&&ac>=14&&this._features.deprioritizeH264OnSafari;this.peerConnections[e]=n=new ic({peerConnectionId:e,bandwidth:t,maximumTurnBandwidth:this._features.restrictBandwidthWhenUsingRelay?512:768,deprioritizeH264Encoding:i})}return n}_getLocalCameraStream(){return this.localStreams[0]}_getNonLocalCameraStreamIds(){return Object.keys(this.localStreams).filter((e=>"0"!==e))}_isScreensharingLocally(){return this._getNonLocalCameraStreamIds().length>0}_getFirstLocalNonCameraStream(){const e=this._getNonLocalCameraStreamIds();return 0===e.length?null:this.localStreams[e[0]]}_transformIncomingSdp(e){return{type:e.type,sdp:e.sdpU}}_transformOutgoingSdp(e){return{type:e.type,sdpU:e.sdp}}_createSession({clientId:e,initialBandwidth:t,isOfferer:n,peerConnectionId:i,shouldAddLocalVideo:s}){if(!i)throw new Error("peerConnectionId is missing");if(!e)throw new Error("clientId is missing");const r=this._getOrCreateSession(i,t),a={optional:[]};"chrome"===rc&&a.optional.push({googCpuOveruseDetection:!0});const o={iceServers:this._iceServers};if(this._features.turnServerOverrideHost){const e=this._features.turnServerOverrideHost,t=e.indexOf(":")>0?"":":443",n=":"+e+t;o.iceServers=o.iceServers.map((e=>{const t=Object.assign({},e);return t.url&&(t.url=t.url.replace(/:[^?]*/,n)),t.urls&&(t.urls=t.urls.map((e=>e.replace(/:[^?]*/,n)))),t}))}if(this._features.useOnlyTURN){o.iceTransportPolicy="relay";const e={onlyudp:/^turn:.*transport=udp$/,onlytcp:/^turn:.*transport=tcp$/,onlytls:/^turns:.*transport=tcp$/}[this._features.useOnlyTURN];e&&(o.iceServers=o.iceServers.filter((t=>t.url&&t.url.match(e))))}"chrome"===rc&&(o.sdpSemantics="unified-plan");const c=r.setAndGetPeerConnection({constraints:a,peerConnectionConfig:o,shouldAddLocalVideo:s,clientId:e});c.ontrack=t=>{const n=t.streams[0];"default"===n.id&&0===n.getAudioTracks().length||-1===r.streamIds.indexOf(n.id)&&(r.streamIds.push(n.id),this._emit(fn,{clientId:e,stream:n}),r.connectionStatus===wn&&setTimeout((()=>{this._emit(hn,{streamIds:r.streamIds,clientId:e,status:r.connectionStatus,previous:_n})}),0))},c.oniceconnectionstatechange=()=>{let t;const n=r.connectionStatus;switch(c.iceConnectionState){case"checking":t=_n;break;case"connected":case"completed":t=wn,r.wasEverConnected||(this._pendingActionsForConnectedPeerConnections.forEach((e=>{"function"==typeof e&&e()})),this._pendingActionsForConnectedPeerConnections=[]),!r.wasEverConnected&&(c.iceConnectionState.match(/connected|completed/)||"chrome"===rc&&c.localDescription&&"answer"===c.localDescription.type)&&(r.wasEverConnected=!0,"false"!==this._features.bandwidth&&this.maybeRestrictRelayBandwidth(r)),r.registerConnected();break;case"disconnected":t=Sn,setTimeout((()=>{"disconnected"===c.iceConnectionState&&this._maybeRestartIce(e,r)}),2e3);break;case"failed":t=xn,n!==t&&this._maybeRestartIce(e,r),null!==r.relayCandidateSeen||r.wasEverConnected||this._emit(Ko);break;default:return}this._setConnectionStatus(r,t,e)},c.onconnectionstate=()=>{switch(c.connectionState){case"connected":r.registerConnected();break;case"failed":const t=xn;null!==r.relayCandidateSeen||r.wasEverConnected||this._emit(Ko),this._setConnectionStatus(r,t,e)}};const p=this.localStreams[0];return s&&p&&r.addStream(p),s&&Object.keys(this.localStreams).forEach((e=>{if("0"===e)return;const t=this.localStreams[e];n?r.addStream(t):r.afterConnected.then((()=>{this._emitServerEvent(Cn,{receiverId:r.clientId,streamId:t.id,hasAudioTrack:!!t.getAudioTracks().length}),this._withForcedRenegotiation(r,(()=>r.addStream(t)))}))})),r}_cleanup(e){const t=this._getSession(e);t?(t.close(),delete this.peerConnections[e]):sc.warn("No RTCPeerConnection in RTCManager.disconnect()",e)}_forEachPeerConnection(e){Object.keys(this.peerConnections).forEach((t=>{const n=this.peerConnections[t];e(n)}))}_addStreamToPeerConnections(e){this._forEachPeerConnection((t=>{this._withForcedRenegotiation(t,(()=>t.addStream(e)))}))}_addTrackToPeerConnections(e,t){this._forEachPeerConnection((n=>{this._withForcedRenegotiation(n,(()=>n.addTrack(e,t)))}))}_replaceTrackToPeerConnections(e,t){const n=[];return this._forEachPeerConnection((i=>{if(!i.hasConnectedPeerConnection()){sc.log("Session doesn't have a connected PeerConnection, adding pending action!");const s=this._pendingActionsForConnectedPeerConnections;if(!s)return void sc.warn("No pending action is created to repalce track, because the pending actions array is null");const r=new Promise(((n,r)=>{s.push((()=>{const s=i.replaceTrack(e,t);if(!s)return sc.error("replaceTrack returned false!"),void r("ReplaceTrack returned false");s.then((e=>n(e))).catch((e=>r(e)))}))}));return void n.push(r)}const s=i.replaceTrack(e,t);s?n.push(s):sc.error("replaceTrack returned false!")})),Promise.all(n)}_removeStreamFromPeerConnections(e){this._forEachPeerConnection((t=>{this._withForcedRenegotiation(t,(()=>t.removeStream(e)))}))}_removeTrackFromPeerConnections(e){this._forEachPeerConnection((t=>{this._withForcedRenegotiation(t,(()=>t.removeTrack(e)))}))}_addLocalStream(e,t){this._addEnabledLocalStreamId(e),this.localStreams[e]=t}_removeLocalStream(e){delete this.localStreams[e],this._deleteEnabledLocalStreamId(e)}maybeRestrictRelayBandwidth(e){e.maybeRestrictRelayBandwidth()}addNewStream(e,t){t!==this.localStreams[e]&&(this._addLocalStream(e,t),"0"!==e?this._shareScreen(e,t):this._addStreamToPeerConnections(t))}removeStream(e,t){this._removeLocalStream(e,t)}replaceTrack(e,t){return this._replaceTrackToPeerConnections(e,t)}accept({clientId:e,shouldAddLocalVideo:t}){return this.acceptNewStream({streamId:e,clientId:e,shouldAddLocalVideo:t})}disconnectAll(){Object.keys(this.peerConnections).forEach((e=>{this.disconnect(e)})),this.peerConnections={},this._socketListenerDeregisterFunctions.forEach((e=>{e()})),this._socketListenerDeregisterFunctions=[]}stopOrResumeAudio(){}stopOrResumeVideo(){}fixChromeAudio(e){if("chrome"!==rc)return;const t=this._getLocalCameraStream(),n=t.getAudioTracks()[0];return n&&"ended"===n.readyState?navigator.mediaDevices.getUserMedia({audio:e}).then((e=>{const i=e.getAudioTracks()[0];return i.enabled=n.enabled,t.removeTrack(n),t.addTrack(i),this.replaceTrack(n,i)})):void 0}_updateAndScheduleMediaServersRefresh({iceServers:e,sfuServer:t,mediaserverConfigTtlSeconds:n}){this._iceServers=e,this._sfuServer=t,this._mediaserverConfigTtlSeconds=n,this._clearMediaServersRefresh(),n&&(this._fetchMediaServersTimer=setTimeout((()=>this._emitServerEvent(kn)),1e3*n))}_clearMediaServersRefresh(){this._fetchMediaServersTimer&&(clearTimeout(this._fetchMediaServersTimer),this._fetchMediaServersTimer=null)}setupSocketListeners(){this._socketListenerDeregisterFunctions=[()=>this._clearMediaServersRefresh(),this._serverSocket.on(Tn,(e=>{e.error?sc.warn("FETCH_MEDIASERVER_CONFIG failed:",e.error):this._updateAndScheduleMediaServersRefresh(e)})),this._serverSocket.on(Dn,(e=>{this._connect(e.clientId)})),this._serverSocket.on(En,(e=>{const t=this._getSession(e.clientId);t?t.addIceCandidate(e.message):sc.warn("No RTCPeerConnection on ICE_CANDIDATE",e)})),this._serverSocket.on(On,(e=>{const t=this._getSession(e.clientId);t?t.addIceCandidate(null):sc.warn("No RTCPeerConnection on ICE_END_OF_CANDIDATES",e)})),this._serverSocket.on(In,(e=>{const t=this._getSession(e.clientId);if(!t)return void sc.warn("No RTCPeerConnection on SDP_OFFER",e);const n=this._transformIncomingSdp(e.message,t.pc);t.handleOffer(n).then((t=>{this._emitServerEvent(jn,{receiverId:e.clientId,message:this._transformOutgoingSdp(t)})}))})),this._serverSocket.on(jn,(e=>{const t=this._getSession(e.clientId);if(!t)return void sc.warn("No RTCPeerConnection on SDP_ANSWER",e);const n=this._transformIncomingSdp(e.message,t.pc);t.handleAnswer(n)}))]}setRoomSessionId(e){this._roomSessionId=e}}{_connect(e){let t=this._getSession(e),n=t&&t.bandwidth||0;return t?(oc.warn("Replacing peer session",e),this._cleanup(e)):n=this._changeBandwidthForAllClients(!0),t=this._createP2pSession(e,n,!0,!0),this._negotiatePeerConnection(e,t),Promise.resolve(t)}_maybeRestartIce(e,t){const n=t.pc;"disconnected"!==n.iceConnectionState&&"failed"!==n.iceConnectionState||"offer"===n.localDescription.type&&(t.wasEverConnected=!1,t.relayCandidateSeen=!1,this._negotiatePeerConnection(e,t,Object.assign({},this.offerOptions,{iceRestart:!0})))}_negotiatePeerConnection(e,t,n){if(!t)return void oc.warn("No RTCPeerConnection in negotiatePeerConnection()",e);const i=t.pc;t.canModifyPeerConnection()?(t.isOperationPending=!0,i.createOffer(n||this.offerOptions).then((n=>{this._emitServerEvent(In,{receiverId:e,message:this._transformOutgoingSdp(n)}),"chrome"===cc&&i.getSenders().filter((e=>e.track&&"video"===e.track.kind)).length>=2?t.pendingOffer=n:i.setLocalDescription(n).catch((e=>{oc.warn("RTCPeerConnection.setLocalDescription() failed with local offer",e)}))})).catch((e=>{oc.warn("RTCPeerConnection.createOffer() failed to create local offer",e)}))):t.pending.push((()=>{this._negotiatePeerConnection(e,t,n)}))}_withForcedRenegotiation(e,t){const n=e.pc,i=n.onnegotationneeded;n.onnegotiationneeded=null,t(),this._negotiatePeerConnection(e.clientId,e),setTimeout((()=>n.onnegotiationneeded=i),0)}_changeBandwidthForAllClients(e){let t=this.numberOfPeerconnections();if(e&&(t+=1),0===t)return 0;t>7&&(t=7);const n=this._features.bandwidth?parseInt(this._features.bandwidth,10):{1:0,2:this._features.highP2PBandwidth?768:384,3:this._features.highP2PBandwidth?512:256,4:192,5:128,6:128,7:64}[t];return void 0===n?0:(this._forEachPeerConnection((e=>{e.changeBandwidth(n)})),n)}_createP2pSession(e,t,n,i){const s=this._createSession({peerConnectionId:e,clientId:e,initialBandwidth:t,shouldAddLocalVideo:n,isOfferer:i}),r=s.pc,a=this.localStreams[0];return n&&a&&!a.getVideoTracks().length&&this._stoppedVideoTrack&&r.addTrack(this._stoppedVideoTrack,a),r.onicecandidate=t=>{t.candidate?(s.relayCandidateSeen=s.relayCandidateSeen||"relay"===t.candidate.type,this._emitServerEvent(En,{receiverId:e,message:t.candidate})):this._emitServerEvent(On,{receiverId:e})},r.onnegotiationneeded=()=>{"new"!==r.iceConnectionState&&s.connectionStatus&&this._negotiatePeerConnection(e,s)},s}acceptNewStream({streamId:e,clientId:t,shouldAddLocalVideo:n}){let i=this._getSession(t);if(i&&e!==t)return i;let s=i&&i.bandwidth||0;return i?(oc.warn("Replacing peer session",t),this._cleanup(t)):s=this._changeBandwidthForAllClients(!0),i=this._createP2pSession(t,s,n),this._emitServerEvent(Dn,{receiverId:t}),i}disconnect(e){this._cleanup(e),this._changeBandwidthForAllClients(!1);0===this.numberOfPeerconnections()&&setTimeout((()=>{this.numberOfPeerconnections()}),6e4)}updateStreamResolution(){}stopOrResumeAudio(){}stopOrResumeVideo(e,t){if("chrome"===cc)if(!1===t)setTimeout((()=>{e.getVideoTracks().forEach((t=>{!1===t.enabled&&(t.stop(),e.removeTrack(t),this._emit(yn,{stream:e,track:t}),this._stoppedVideoTrack=t)}))}),5e3);else if(this._features.simplifiedVegaClientOn){const t=e.getVideoTracks()?.[0];this._stoppedVideoTrack?(this._replaceTrackToPeerConnections(this._stoppedVideoTrack,t),delete this._stoppedVideoTrack,this._emit(bn,{streamId:e.id,tracks:[t],screenShare:!1})):t||this._addTrackToPeerConnections(t)}else if(0===e.getVideoTracks().length){const t=this._webrtcProvider.getMediaConstraints().video;if(!t)return;navigator.mediaDevices.getUserMedia({video:t}).then((t=>{const n=t.getVideoTracks()[0];e.addTrack(n),this._emit(bn,{streamId:e.id,tracks:[n],screenShare:!1}),this._stoppedVideoTrack?(this._replaceTrackToPeerConnections(this._stoppedVideoTrack,n),delete this._stoppedVideoTrack):this._addTrackToPeerConnections(n)}))}}_shareScreen(e,t){this._emitServerEvent(Cn,{streamId:e,hasAudioTrack:!!t.getAudioTracks().length}),this._addStreamToPeerConnections(t)}removeStream(e,t,n){super.removeStream(e,t),this._removeStreamFromPeerConnections(t),this._emitServerEvent(Rn,{streamId:e,requestedByClientId:n})}}var dc,lc,uc,mc,hc,fc={},gc={},vc={},bc={get exports(){return vc},set exports(e){vc=e}};function yc(){if(lc)return dc;lc=1;var e=1e3,t=60*e,n=60*t,i=24*n,s=7*i,r=365.25*i;function a(e,t,n,i){var s=t>=1.5*n;return Math.round(e/n)+" "+i+(s?"s":"")}return dc=function(o,c){c=c||{};var p=typeof o;if("string"===p&&o.length>0)return function(a){if((a=String(a)).length>100)return;var o=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(a);if(!o)return;var c=parseFloat(o[1]);switch((o[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*r;case"weeks":case"week":case"w":return c*s;case"days":case"day":case"d":return c*i;case"hours":case"hour":case"hrs":case"hr":case"h":return c*n;case"minutes":case"minute":case"mins":case"min":case"m":return c*t;case"seconds":case"second":case"secs":case"sec":case"s":return c*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(o);if("number"===p&&isFinite(o))return c.long?function(s){var r=Math.abs(s);if(r>=i)return a(s,r,i,"day");if(r>=n)return a(s,r,n,"hour");if(r>=t)return a(s,r,t,"minute");if(r>=e)return a(s,r,e,"second");return s+" ms"}(o):function(s){var r=Math.abs(s);if(r>=i)return Math.round(s/i)+"d";if(r>=n)return Math.round(s/n)+"h";if(r>=t)return Math.round(s/t)+"m";if(r>=e)return Math.round(s/e)+"s";return s+"ms"}(o);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(o))},dc}function _c(){if(mc)return uc;return mc=1,uc=function(e){function t(e){let i,s,r,a=null;function o(...e){if(!o.enabled)return;const n=o,s=Number(new Date),r=s-(i||s);n.diff=r,n.prev=i,n.curr=s,i=s,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((i,s)=>{if("%%"===i)return"%";a++;const r=t.formatters[s];if("function"==typeof r){const t=e[a];i=r.call(n,t),e.splice(a,1),a--}return i})),t.formatArgs.call(n,e);(n.log||t.log).apply(n,e)}return o.namespace=e,o.useColors=t.useColors(),o.color=t.selectColor(e),o.extend=n,o.destroy=t.destroy,Object.defineProperty(o,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==a?a:(s!==t.namespaces&&(s=t.namespaces,r=t.enabled(e)),r),set:e=>{a=e}}),"function"==typeof t.init&&t.init(o),o}function n(e,n){const i=t(this.namespace+(void 0===n?":":n)+e);return i.log=this.log,i}function i(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(i),...t.skips.map(i).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const i=("string"==typeof e?e:"").split(/[\s,]+/),s=i.length;for(n=0;n<s;n++)i[n]&&("-"===(e=i[n].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 n,i;for(n=0,i=t.skips.length;n<i;n++)if(t.skips[n].test(e))return!1;for(n=0,i=t.names.length;n<i;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=yc(),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((n=>{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t},uc}var xc,wc,Sc,kc,Cc,Rc={},Tc={get exports(){return Rc},set exports(e){Rc=e}};function Pc(){return wc?xc:(wc=1,xc=(e,t=process.argv)=>{const n=e.startsWith("-")?"":1===e.length?"-":"--",i=t.indexOf(n+e),s=t.indexOf("--");return-1!==i&&(-1===s||i<s)})}function Ec(){return Cc||(Cc=1,function(n,i){const s=e,r=t;i.init=function(e){e.inspectOpts={};const t=Object.keys(i.inspectOpts);for(let n=0;n<t.length;n++)e.inspectOpts[t[n]]=i.inspectOpts[t[n]]},i.log=function(...e){return process.stderr.write(r.format(...e)+"\n")},i.formatArgs=function(e){const{namespace:t,useColors:s}=this;if(s){const i=this.color,s="[3"+(i<8?i:"8;5;"+i),r=` ${s};1m${t} `;e[0]=r+e[0].split("\n").join("\n"+r),e.push(s+"m+"+n.exports.humanize(this.diff)+"")}else e[0]=function(){if(i.inspectOpts.hideDate)return"";return(new Date).toISOString()+" "}()+t+" "+e[0]},i.save=function(e){e?process.env.DEBUG=e:delete process.env.DEBUG},i.load=function(){return process.env.DEBUG},i.useColors=function(){return"colors"in i.inspectOpts?Boolean(i.inspectOpts.colors):s.isatty(process.stderr.fd)},i.destroy=r.deprecate((()=>{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),i.colors=[6,2,3,4,5,1];try{const t=function(){if(kc)return Sc;kc=1;const t=h,n=e,i=Pc(),{env:s}=process;let r;function a(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function o(e,n){if(0===r)return 0;if(i("color=16m")||i("color=full")||i("color=truecolor"))return 3;if(i("color=256"))return 2;if(e&&!n&&void 0===r)return 0;const a=r||0;if("dumb"===s.TERM)return a;if("win32"===process.platform){const e=t.release().split(".");return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if("CI"in s)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some((e=>e in s))||"codeship"===s.CI_NAME?1:a;if("TEAMCITY_VERSION"in s)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(s.TEAMCITY_VERSION)?1:0;if("truecolor"===s.COLORTERM)return 3;if("TERM_PROGRAM"in s){const e=parseInt((s.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(s.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(s.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(s.TERM)||"COLORTERM"in s?1:a}return i("no-color")||i("no-colors")||i("color=false")||i("color=never")?r=0:(i("color")||i("colors")||i("color=true")||i("color=always"))&&(r=1),"FORCE_COLOR"in s&&(r="true"===s.FORCE_COLOR?1:"false"===s.FORCE_COLOR?0:0===s.FORCE_COLOR.length?1:Math.min(parseInt(s.FORCE_COLOR,10),3)),Sc={supportsColor:function(e){return a(o(e,e&&e.isTTY))},stdout:a(o(!0,n.isatty(1))),stderr:a(o(!0,n.isatty(2)))},Sc}();t&&(t.stderr||t).level>=2&&(i.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}i.inspectOpts=Object.keys(process.env).filter((e=>/^debug_/i.test(e))).reduce(((e,t)=>{const n=t.substring(6).toLowerCase().replace(/_([a-z])/g,((e,t)=>t.toUpperCase()));let i=process.env[t];return i=!!/^(yes|on|true|enabled)$/i.test(i)||!/^(no|off|false|disabled)$/i.test(i)&&("null"===i?null:Number(i)),e[n]=i,e}),{}),n.exports=_c()(i);const{formatters:a}=n.exports;a.o=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts).split("\n").map((e=>e.trim())).join(" ")},a.O=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts)}}(Tc,Rc)),Rc}!function(e){"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?e.exports=(hc||(hc=1,function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let i=0,s=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(i++,"%c"===e&&(s=i))})),t.splice(s,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.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+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=_c()(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(bc,vc)),vc):e.exports=Ec()}({get exports(){return gc},set exports(e){gc=e}});var Oc={};const Dc={"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"},jc={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"},Ic={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},Mc={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"},Lc={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"};class Ac{static getFirstMatch(e,t){const n=t.match(e);return n&&n.length>0&&n[1]||""}static getSecondMatch(e,t){const n=t.match(e);return n&&n.length>1&&n[2]||""}static matchAndReturnConst(e,t,n){if(e.test(t))return n}static getWindowsVersionName(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}}static getMacOSVersionName(e){const t=e.split(".").splice(0,2).map((e=>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}}static getAndroidVersionName(e){const t=e.split(".").splice(0,2).map((e=>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}static getVersionPrecision(e){return e.split(".").length}static compareVersions(e,t,n=!1){const i=Ac.getVersionPrecision(e),s=Ac.getVersionPrecision(t);let r=Math.max(i,s),a=0;const o=Ac.map([e,t],(e=>{const t=r-Ac.getVersionPrecision(e),n=e+new Array(t+1).join(".0");return Ac.map(n.split("."),(e=>new Array(20-e.length).join("0")+e)).reverse()}));for(n&&(a=r-Math.min(i,s)),r-=1;r>=a;){if(o[0][r]>o[1][r])return 1;if(o[0][r]===o[1][r]){if(r===a)return 0;r-=1}else if(o[0][r]<o[1][r])return-1}}static map(e,t){const n=[];let i;if(Array.prototype.map)return Array.prototype.map.call(e,t);for(i=0;i<e.length;i+=1)n.push(t(e[i]));return n}static find(e,t){let n,i;if(Array.prototype.find)return Array.prototype.find.call(e,t);for(n=0,i=e.length;n<i;n+=1){const i=e[n];if(t(i,n))return i}}static assign(e,...t){const n=e;let i,s;if(Object.assign)return Object.assign(e,...t);for(i=0,s=t.length;i<s;i+=1){const e=t[i];if("object"==typeof e&&null!==e){Object.keys(e).forEach((t=>{n[t]=e[t]}))}}return e}static getBrowserAlias(e){return Dc[e]}static getBrowserTypeByAlias(e){return jc[e]||""}}const Nc=/version\/(\d+(\.?_?\d+)+)/i,Bc=[{test:[/googlebot/i],describe(e){const t={name:"Googlebot"},n=Ac.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||Ac.getFirstMatch(Nc,e);return n&&(t.version=n),t}},{test:[/opera/i],describe(e){const t={name:"Opera"},n=Ac.getFirstMatch(Nc,e)||Ac.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opr\/|opios/i],describe(e){const t={name:"Opera"},n=Ac.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||Ac.getFirstMatch(Nc,e);return n&&(t.version=n),t}},{test:[/SamsungBrowser/i],describe(e){const t={name:"Samsung Internet for Android"},n=Ac.getFirstMatch(Nc,e)||Ac.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Whale/i],describe(e){const t={name:"NAVER Whale Browser"},n=Ac.getFirstMatch(Nc,e)||Ac.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MZBrowser/i],describe(e){const t={name:"MZ Browser"},n=Ac.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||Ac.getFirstMatch(Nc,e);return n&&(t.version=n),t}},{test:[/focus/i],describe(e){const t={name:"Focus"},n=Ac.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||Ac.getFirstMatch(Nc,e);return n&&(t.version=n),t}},{test:[/swing/i],describe(e){const t={name:"Swing"},n=Ac.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||Ac.getFirstMatch(Nc,e);return n&&(t.version=n),t}},{test:[/coast/i],describe(e){const t={name:"Opera Coast"},n=Ac.getFirstMatch(Nc,e)||Ac.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe(e){const t={name:"Opera Touch"},n=Ac.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||Ac.getFirstMatch(Nc,e);return n&&(t.version=n),t}},{test:[/yabrowser/i],describe(e){const t={name:"Yandex Browser"},n=Ac.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||Ac.getFirstMatch(Nc,e);return n&&(t.version=n),t}},{test:[/ucbrowser/i],describe(e){const t={name:"UC Browser"},n=Ac.getFirstMatch(Nc,e)||Ac.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Maxthon|mxios/i],describe(e){const t={name:"Maxthon"},n=Ac.getFirstMatch(Nc,e)||Ac.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/epiphany/i],describe(e){const t={name:"Epiphany"},n=Ac.getFirstMatch(Nc,e)||Ac.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/puffin/i],describe(e){const t={name:"Puffin"},n=Ac.getFirstMatch(Nc,e)||Ac.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sleipnir/i],describe(e){const t={name:"Sleipnir"},n=Ac.getFirstMatch(Nc,e)||Ac.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/k-meleon/i],describe(e){const t={name:"K-Meleon"},n=Ac.getFirstMatch(Nc,e)||Ac.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/micromessenger/i],describe(e){const t={name:"WeChat"},n=Ac.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||Ac.getFirstMatch(Nc,e);return n&&(t.version=n),t}},{test:[/qqbrowser/i],describe(e){const t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},n=Ac.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||Ac.getFirstMatch(Nc,e);return n&&(t.version=n),t}},{test:[/msie|trident/i],describe(e){const t={name:"Internet Explorer"},n=Ac.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/\sedg\//i],describe(e){const t={name:"Microsoft Edge"},n=Ac.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/edg([ea]|ios)/i],describe(e){const t={name:"Microsoft Edge"},n=Ac.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/vivaldi/i],describe(e){const t={name:"Vivaldi"},n=Ac.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/seamonkey/i],describe(e){const t={name:"SeaMonkey"},n=Ac.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sailfish/i],describe(e){const t={name:"Sailfish"},n=Ac.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return n&&(t.version=n),t}},{test:[/silk/i],describe(e){const t={name:"Amazon Silk"},n=Ac.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/phantom/i],describe(e){const t={name:"PhantomJS"},n=Ac.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/slimerjs/i],describe(e){const t={name:"SlimerJS"},n=Ac.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(e){const t={name:"BlackBerry"},n=Ac.getFirstMatch(Nc,e)||Ac.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(web|hpw)[o0]s/i],describe(e){const t={name:"WebOS Browser"},n=Ac.getFirstMatch(Nc,e)||Ac.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/bada/i],describe(e){const t={name:"Bada"},n=Ac.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/tizen/i],describe(e){const t={name:"Tizen"},n=Ac.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||Ac.getFirstMatch(Nc,e);return n&&(t.version=n),t}},{test:[/qupzilla/i],describe(e){const t={name:"QupZilla"},n=Ac.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||Ac.getFirstMatch(Nc,e);return n&&(t.version=n),t}},{test:[/firefox|iceweasel|fxios/i],describe(e){const t={name:"Firefox"},n=Ac.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/electron/i],describe(e){const t={name:"Electron"},n=Ac.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MiuiBrowser/i],describe(e){const t={name:"Miui"},n=Ac.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/chromium/i],describe(e){const t={name:"Chromium"},n=Ac.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||Ac.getFirstMatch(Nc,e);return n&&(t.version=n),t}},{test:[/chrome|crios|crmo/i],describe(e){const t={name:"Chrome"},n=Ac.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/GSA/i],describe(e){const t={name:"Google Search"},n=Ac.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test(e){const t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe(e){const t={name:"Android Browser"},n=Ac.getFirstMatch(Nc,e);return n&&(t.version=n),t}},{test:[/playstation 4/i],describe(e){const t={name:"PlayStation 4"},n=Ac.getFirstMatch(Nc,e);return n&&(t.version=n),t}},{test:[/safari|applewebkit/i],describe(e){const t={name:"Safari"},n=Ac.getFirstMatch(Nc,e);return n&&(t.version=n),t}},{test:[/.*/i],describe(e){const t=-1!==e.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:Ac.getFirstMatch(t,e),version:Ac.getSecondMatch(t,e)}}}];var Fc=[{test:[/Roku\/DVP/],describe(e){const t=Ac.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:Mc.Roku,version:t}}},{test:[/windows phone/i],describe(e){const t=Ac.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:Mc.WindowsPhone,version:t}}},{test:[/windows /i],describe(e){const t=Ac.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),n=Ac.getWindowsVersionName(t);return{name:Mc.Windows,version:t,versionName:n}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(e){const t={name:Mc.iOS},n=Ac.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return n&&(t.version=n),t}},{test:[/macintosh/i],describe(e){const t=Ac.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),n=Ac.getMacOSVersionName(t),i={name:Mc.MacOS,version:t};return n&&(i.versionName=n),i}},{test:[/(ipod|iphone|ipad)/i],describe(e){const t=Ac.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:Mc.iOS,version:t}}},{test(e){const t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe(e){const t=Ac.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),n=Ac.getAndroidVersionName(t),i={name:Mc.Android,version:t};return n&&(i.versionName=n),i}},{test:[/(web|hpw)[o0]s/i],describe(e){const t=Ac.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),n={name:Mc.WebOS};return t&&t.length&&(n.version=t),n}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(e){const t=Ac.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||Ac.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||Ac.getFirstMatch(/\bbb(\d+)/i,e);return{name:Mc.BlackBerry,version:t}}},{test:[/bada/i],describe(e){const t=Ac.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:Mc.Bada,version:t}}},{test:[/tizen/i],describe(e){const t=Ac.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:Mc.Tizen,version:t}}},{test:[/linux/i],describe:()=>({name:Mc.Linux})},{test:[/CrOS/],describe:()=>({name:Mc.ChromeOS})},{test:[/PlayStation 4/],describe(e){const t=Ac.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:Mc.PlayStation4,version:t}}}],Uc=[{test:[/googlebot/i],describe:()=>({type:"bot",vendor:"Google"})},{test:[/huawei/i],describe(e){const t=Ac.getFirstMatch(/(can-l01)/i,e)&&"Nova",n={type:Ic.mobile,vendor:"Huawei"};return t&&(n.model=t),n}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:()=>({type:Ic.tablet,vendor:"Nexus"})},{test:[/ipad/i],describe:()=>({type:Ic.tablet,vendor:"Apple",model:"iPad"})},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:()=>({type:Ic.tablet,vendor:"Apple",model:"iPad"})},{test:[/kftt build/i],describe:()=>({type:Ic.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"})},{test:[/silk/i],describe:()=>({type:Ic.tablet,vendor:"Amazon"})},{test:[/tablet(?! pc)/i],describe:()=>({type:Ic.tablet})},{test(e){const t=e.test(/ipod|iphone/i),n=e.test(/like (ipod|iphone)/i);return t&&!n},describe(e){const t=Ac.getFirstMatch(/(ipod|iphone)/i,e);return{type:Ic.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:()=>({type:Ic.mobile,vendor:"Nexus"})},{test:[/[^-]mobi/i],describe:()=>({type:Ic.mobile})},{test:e=>"blackberry"===e.getBrowserName(!0),describe:()=>({type:Ic.mobile,vendor:"BlackBerry"})},{test:e=>"bada"===e.getBrowserName(!0),describe:()=>({type:Ic.mobile})},{test:e=>"windows phone"===e.getBrowserName(),describe:()=>({type:Ic.mobile,vendor:"Microsoft"})},{test(e){const t=Number(String(e.getOSVersion()).split(".")[0]);return"android"===e.getOSName(!0)&&t>=3},describe:()=>({type:Ic.tablet})},{test:e=>"android"===e.getOSName(!0),describe:()=>({type:Ic.mobile})},{test:e=>"macos"===e.getOSName(!0),describe:()=>({type:Ic.desktop,vendor:"Apple"})},{test:e=>"windows"===e.getOSName(!0),describe:()=>({type:Ic.desktop})},{test:e=>"linux"===e.getOSName(!0),describe:()=>({type:Ic.desktop})},{test:e=>"playstation 4"===e.getOSName(!0),describe:()=>({type:Ic.tv})},{test:e=>"roku"===e.getOSName(!0),describe:()=>({type:Ic.tv})}],zc=[{test:e=>"microsoft edge"===e.getBrowserName(!0),describe(e){if(/\sedg\//i.test(e))return{name:Lc.Blink};const t=Ac.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:Lc.EdgeHTML,version:t}}},{test:[/trident/i],describe(e){const t={name:Lc.Trident},n=Ac.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:e=>e.test(/presto/i),describe(e){const t={name:Lc.Presto},n=Ac.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test(e){const t=e.test(/gecko/i),n=e.test(/like gecko/i);return t&&!n},describe(e){const t={name:Lc.Gecko},n=Ac.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(apple)?webkit\/537\.36/i],describe:()=>({name:Lc.Blink})},{test:[/(apple)?webkit/i],describe(e){const t={name:Lc.WebKit},n=Ac.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}}];class qc{constructor(e,t=!1){if(null==e||""===e)throw new Error("UserAgent parameter can't be empty");this._ua=e,this.parsedResult={},!0!==t&&this.parse()}getUA(){return this._ua}test(e){return e.test(this._ua)}parseBrowser(){this.parsedResult.browser={};const e=Ac.find(Bc,(e=>{if("function"==typeof e.test)return e.test(this);if(e.test instanceof Array)return e.test.some((e=>this.test(e)));throw new Error("Browser's test function is not valid")}));return e&&(this.parsedResult.browser=e.describe(this.getUA())),this.parsedResult.browser}getBrowser(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()}getBrowserName(e){return e?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""}getBrowserVersion(){return this.getBrowser().version}getOS(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()}parseOS(){this.parsedResult.os={};const e=Ac.find(Fc,(e=>{if("function"==typeof e.test)return e.test(this);if(e.test instanceof Array)return e.test.some((e=>this.test(e)));throw new Error("Browser's test function is not valid")}));return e&&(this.parsedResult.os=e.describe(this.getUA())),this.parsedResult.os}getOSName(e){const{name:t}=this.getOS();return e?String(t).toLowerCase()||"":t||""}getOSVersion(){return this.getOS().version}getPlatform(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()}getPlatformType(e=!1){const{type:t}=this.getPlatform();return e?String(t).toLowerCase()||"":t||""}parsePlatform(){this.parsedResult.platform={};const e=Ac.find(Uc,(e=>{if("function"==typeof e.test)return e.test(this);if(e.test instanceof Array)return e.test.some((e=>this.test(e)));throw new Error("Browser's test function is not valid")}));return e&&(this.parsedResult.platform=e.describe(this.getUA())),this.parsedResult.platform}getEngine(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()}getEngineName(e){return e?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""}parseEngine(){this.parsedResult.engine={};const e=Ac.find(zc,(e=>{if("function"==typeof e.test)return e.test(this);if(e.test instanceof Array)return e.test.some((e=>this.test(e)));throw new Error("Browser's test function is not valid")}));return e&&(this.parsedResult.engine=e.describe(this.getUA())),this.parsedResult.engine}parse(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this}getResult(){return Ac.assign({},this.parsedResult)}satisfies(e){const t={};let n=0;const i={};let s=0;if(Object.keys(e).forEach((r=>{const a=e[r];"string"==typeof a?(i[r]=a,s+=1):"object"==typeof a&&(t[r]=a,n+=1)})),n>0){const e=Object.keys(t),n=Ac.find(e,(e=>this.isOS(e)));if(n){const e=this.satisfies(t[n]);if(void 0!==e)return e}const i=Ac.find(e,(e=>this.isPlatform(e)));if(i){const e=this.satisfies(t[i]);if(void 0!==e)return e}}if(s>0){const e=Object.keys(i),t=Ac.find(e,(e=>this.isBrowser(e,!0)));if(void 0!==t)return this.compareVersion(i[t])}}isBrowser(e,t=!1){const n=this.getBrowserName().toLowerCase();let i=e.toLowerCase();const s=Ac.getBrowserTypeByAlias(i);return t&&s&&(i=s.toLowerCase()),i===n}compareVersion(e){let t=[0],n=e,i=!1;const s=this.getBrowserVersion();if("string"==typeof s)return">"===e[0]||"<"===e[0]?(n=e.substr(1),"="===e[1]?(i=!0,n=e.substr(2)):t=[],">"===e[0]?t.push(1):t.push(-1)):"="===e[0]?n=e.substr(1):"~"===e[0]&&(i=!0,n=e.substr(1)),t.indexOf(Ac.compareVersions(s,n,i))>-1}isOS(e){return this.getOSName(!0)===String(e).toLowerCase()}isPlatform(e){return this.getPlatformType(!0)===String(e).toLowerCase()}isEngine(e){return this.getEngineName(!0)===String(e).toLowerCase()}is(e,t=!1){return this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)}some(e=[]){return e.some((e=>this.is(e)))}}
92
+ var t=Zr.exports=Aa();t.Server=Na(),t.Sender=ha(),t.Receiver=Pa(),t.createServer=function(e,n){var i=new t.Server(e);return"function"==typeof n&&i.on("connection",n),i},t.connect=t.createConnection=function(e,n){var i=new t(e);return"function"==typeof n&&i.on("open",n),i}}()),Ba=Xr}catch(e){}var Wa=Ha;Wa||"undefined"!=typeof window||(Wa=Ba);var Ga=Ka;function Ka(e){e&&e.forceBase64&&(this.supportsBinary=!1),this.perMessageDeflate=e.perMessageDeflate,this.usingBrowserWebSocket=Ha&&!e.forceNode,this.usingBrowserWebSocket||(Wa=Ba),Fa.call(this,e)}qa(Ka,Fa),Ka.prototype.name="websocket",Ka.prototype.supportsBinary=!0,Ka.prototype.doOpen=function(){if(this.check()){var e=this.uri(),t={agent:this.agent,perMessageDeflate:this.perMessageDeflate};t.pfx=this.pfx,t.key=this.key,t.passphrase=this.passphrase,t.cert=this.cert,t.ca=this.ca,t.ciphers=this.ciphers,t.rejectUnauthorized=this.rejectUnauthorized,this.extraHeaders&&(t.headers=this.extraHeaders),this.localAddress&&(t.localAddress=this.localAddress);try{this.ws=this.usingBrowserWebSocket?new Wa(e):new Wa(e,void 0,t)}catch(e){return this.emit("error",e)}void 0===this.ws.binaryType&&(this.supportsBinary=!1),this.ws.supports&&this.ws.supports.binary?(this.supportsBinary=!0,this.ws.binaryType="nodebuffer"):this.ws.binaryType="arraybuffer",this.addEventListeners()}},Ka.prototype.addEventListeners=function(){var e=this;this.ws.onopen=function(){e.onOpen()},this.ws.onclose=function(){e.onClose()},this.ws.onmessage=function(t){e.onData(t.data)},this.ws.onerror=function(t){e.onError("websocket error",t)}},Ka.prototype.write=function(e){var t=this;this.writable=!1;for(var n=e.length,i=0,s=n;i<s;i++)!function(e){Ua.encodePacket(e,t.supportsBinary,(function(i){if(!t.usingBrowserWebSocket){var s={};if(e.options&&(s.compress=e.options.compress),t.perMessageDeflate)("string"==typeof i?Zt.Buffer.byteLength(i):i.length)<t.perMessageDeflate.threshold&&(s.compress=!1)}try{t.usingBrowserWebSocket?t.ws.send(i):t.ws.send(i,s)}catch(e){Va("websocket closed before onclose event")}--n||r()}))}(e[i]);function r(){t.emit("flush"),setTimeout((function(){t.writable=!0,t.emit("drain")}),0)}},Ka.prototype.onClose=function(){Fa.prototype.onClose.call(this)},Ka.prototype.doClose=function(){void 0!==this.ws&&this.ws.close()},Ka.prototype.uri=function(){var e=this.query||{},t=this.secure?"wss":"ws",n="";return this.port&&("wss"===t&&443!==Number(this.port)||"ws"===t&&80!==Number(this.port))&&(n=":"+this.port),this.timestampRequests&&(e[this.timestampParam]=$a()),this.supportsBinary||(e.b64=1),(e=za.encode(e)).length&&(e="?"+e),t+"://"+(-1!==this.hostname.indexOf(":")?"["+this.hostname+"]":this.hostname)+n+this.path+e},Ka.prototype.check=function(){return!(!Wa||"__initialize"in Wa&&this.name===Ka.prototype.name)};var Ja=Ls,Qa=Ns,Ya=zr,Xa=Ga;Ds.polling=function(e){var t=!1,n=!1,i=!1!==e.jsonp;if(Zt.location){var s="https:"===location.protocol,r=location.port;r||(r=s?443:80),t=e.hostname!==location.hostname||r!==e.port,n=e.secure!==s}if(e.xdomain=t,e.xscheme=n,"open"in new Ja(e)&&!e.forceJSONP)return new Qa(e);if(!i)throw new Error("JSONP disabled");return new Ya(e)},Ds.websocket=Xa;var Za=[].indexOf,eo=function(e,t){if(Za)return e.indexOf(t);for(var n=0;n<e.length;++n)if(e[n]===t)return n;return-1},to=/^[\],:{}\s]*$/,no=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,io=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,so=/(?:^|:|,)(?:\s*\[)+/g,ro=/^\s+/,ao=/\s+$/,oo=Ds,co=Ks,po=lr("engine.io-client:socket"),lo=eo,uo=Fs,mo=Gi,ho=function(e){return"string"==typeof e&&e?(e=e.replace(ro,"").replace(ao,""),Zt.JSON&&JSON.parse?JSON.parse(e):to.test(e.replace(no,"@").replace(io,"]").replace(so,""))?new Function("return "+e)():void 0):null},fo=Xs,go=vo;function vo(e,t){if(!(this instanceof vo))return new vo(e,t);t=t||{},e&&"object"==typeof e&&(t=e,e=null),e?(e=mo(e),t.hostname=e.host,t.secure="https"===e.protocol||"wss"===e.protocol,t.port=e.port,e.query&&(t.query=e.query)):t.host&&(t.hostname=mo(t.host).host),this.secure=null!=t.secure?t.secure:Zt.location&&"https:"===location.protocol,t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.agent=t.agent||!1,this.hostname=t.hostname||(Zt.location?location.hostname:"localhost"),this.port=t.port||(Zt.location&&location.port?location.port:this.secure?443:80),this.query=t.query||{},"string"==typeof this.query&&(this.query=fo.decode(this.query)),this.upgrade=!1!==t.upgrade,this.path=(t.path||"/engine.io").replace(/\/$/,"")+"/",this.forceJSONP=!!t.forceJSONP,this.jsonp=!1!==t.jsonp,this.forceBase64=!!t.forceBase64,this.enablesXDR=!!t.enablesXDR,this.timestampParam=t.timestampParam||"t",this.timestampRequests=t.timestampRequests,this.transports=t.transports||["polling","websocket"],this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.policyPort=t.policyPort||843,this.rememberUpgrade=t.rememberUpgrade||!1,this.binaryType=null,this.onlyBinaryUpgrades=t.onlyBinaryUpgrades,this.perMessageDeflate=!1!==t.perMessageDeflate&&(t.perMessageDeflate||{}),!0===this.perMessageDeflate&&(this.perMessageDeflate={}),this.perMessageDeflate&&null==this.perMessageDeflate.threshold&&(this.perMessageDeflate.threshold=1024),this.pfx=t.pfx||null,this.key=t.key||null,this.passphrase=t.passphrase||null,this.cert=t.cert||null,this.ca=t.ca||null,this.ciphers=t.ciphers||null,this.rejectUnauthorized=void 0===t.rejectUnauthorized?null:t.rejectUnauthorized,this.forceNode=!!t.forceNode;var n="object"==typeof Zt&&Zt;n.global===n&&(t.extraHeaders&&Object.keys(t.extraHeaders).length>0&&(this.extraHeaders=t.extraHeaders),t.localAddress&&(this.localAddress=t.localAddress)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingIntervalTimer=null,this.pingTimeoutTimer=null,this.open()}vo.priorWebsocketSuccess=!1,co(vo.prototype),vo.protocol=uo.protocol,vo.Socket=vo,vo.Transport=Qs(),vo.transports=Ds,vo.parser=Fs,vo.prototype.createTransport=function(e){po('creating transport "%s"',e);var t=function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}(this.query);return t.EIO=uo.protocol,t.transport=e,this.id&&(t.sid=this.id),new oo[e]({agent:this.agent,hostname:this.hostname,port:this.port,secure:this.secure,path:this.path,query:t,forceJSONP:this.forceJSONP,jsonp:this.jsonp,forceBase64:this.forceBase64,enablesXDR:this.enablesXDR,timestampRequests:this.timestampRequests,timestampParam:this.timestampParam,policyPort:this.policyPort,socket:this,pfx:this.pfx,key:this.key,passphrase:this.passphrase,cert:this.cert,ca:this.ca,ciphers:this.ciphers,rejectUnauthorized:this.rejectUnauthorized,perMessageDeflate:this.perMessageDeflate,extraHeaders:this.extraHeaders,forceNode:this.forceNode,localAddress:this.localAddress})},vo.prototype.open=function(){var e;if(this.rememberUpgrade&&vo.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))e="websocket";else{if(0===this.transports.length){var t=this;return void setTimeout((function(){t.emit("error","No transports available")}),0)}e=this.transports[0]}this.readyState="opening";try{e=this.createTransport(e)}catch(e){return this.transports.shift(),void this.open()}e.open(),this.setTransport(e)},vo.prototype.setTransport=function(e){po("setting transport %s",e.name);var t=this;this.transport&&(po("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=e,e.on("drain",(function(){t.onDrain()})).on("packet",(function(e){t.onPacket(e)})).on("error",(function(e){t.onError(e)})).on("close",(function(){t.onClose("transport close")}))},vo.prototype.probe=function(e){po('probing transport "%s"',e);var t=this.createTransport(e,{probe:1}),n=!1,i=this;function s(){if(i.onlyBinaryUpgrades){var s=!this.supportsBinary&&i.transport.supportsBinary;n=n||s}n||(po('probe transport "%s" opened',e),t.send([{type:"ping",data:"probe"}]),t.once("packet",(function(s){if(!n)if("pong"===s.type&&"probe"===s.data){if(po('probe transport "%s" pong',e),i.upgrading=!0,i.emit("upgrading",t),!t)return;vo.priorWebsocketSuccess="websocket"===t.name,po('pausing current transport "%s"',i.transport.name),i.transport.pause((function(){n||"closed"!==i.readyState&&(po("changing transport and sending upgrade packet"),d(),i.setTransport(t),t.send([{type:"upgrade"}]),i.emit("upgrade",t),t=null,i.upgrading=!1,i.flush())}))}else{po('probe transport "%s" failed',e);var r=new Error("probe error");r.transport=t.name,i.emit("upgradeError",r)}})))}function r(){n||(n=!0,d(),t.close(),t=null)}function a(n){var s=new Error("probe error: "+n);s.transport=t.name,r(),po('probe transport "%s" failed because of error: %s',e,n),i.emit("upgradeError",s)}function o(){a("transport closed")}function c(){a("socket closed")}function p(e){t&&e.name!==t.name&&(po('"%s" works - aborting "%s"',e.name,t.name),r())}function d(){t.removeListener("open",s),t.removeListener("error",a),t.removeListener("close",o),i.removeListener("close",c),i.removeListener("upgrading",p)}vo.priorWebsocketSuccess=!1,t.once("open",s),t.once("error",a),t.once("close",o),this.once("close",c),this.once("upgrading",p),t.open()},vo.prototype.onOpen=function(){if(po("socket open"),this.readyState="open",vo.priorWebsocketSuccess="websocket"===this.transport.name,this.emit("open"),this.flush(),"open"===this.readyState&&this.upgrade&&this.transport.pause){po("starting upgrade probes");for(var e=0,t=this.upgrades.length;e<t;e++)this.probe(this.upgrades[e])}},vo.prototype.onPacket=function(e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(po('socket receive: type "%s", data "%s"',e.type,e.data),this.emit("packet",e),this.emit("heartbeat"),e.type){case"open":this.onHandshake(ho(e.data));break;case"pong":this.setPing(),this.emit("pong");break;case"error":var t=new Error("server error");t.code=e.data,this.onError(t);break;case"message":this.emit("data",e.data),this.emit("message",e.data)}else po('packet received with socket readyState "%s"',this.readyState)},vo.prototype.onHandshake=function(e){this.emit("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this.upgrades=this.filterUpgrades(e.upgrades),this.pingInterval=e.pingInterval,this.pingTimeout=e.pingTimeout,this.onOpen(),"closed"!==this.readyState&&(this.setPing(),this.removeListener("heartbeat",this.onHeartbeat),this.on("heartbeat",this.onHeartbeat))},vo.prototype.onHeartbeat=function(e){clearTimeout(this.pingTimeoutTimer);var t=this;t.pingTimeoutTimer=setTimeout((function(){"closed"!==t.readyState&&t.onClose("ping timeout")}),e||t.pingInterval+t.pingTimeout)},vo.prototype.setPing=function(){var e=this;clearTimeout(e.pingIntervalTimer),e.pingIntervalTimer=setTimeout((function(){po("writing ping packet - expecting pong within %sms",e.pingTimeout),e.ping(),e.onHeartbeat(e.pingTimeout)}),e.pingInterval)},vo.prototype.ping=function(){var e=this;this.sendPacket("ping",(function(){e.emit("ping")}))},vo.prototype.onDrain=function(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0===this.writeBuffer.length?this.emit("drain"):this.flush()},vo.prototype.flush=function(){"closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length&&(po("flushing %d packets in socket",this.writeBuffer.length),this.transport.send(this.writeBuffer),this.prevBufferLen=this.writeBuffer.length,this.emit("flush"))},vo.prototype.write=vo.prototype.send=function(e,t,n){return this.sendPacket("message",e,t,n),this},vo.prototype.sendPacket=function(e,t,n,i){if("function"==typeof t&&(i=t,t=void 0),"function"==typeof n&&(i=n,n=null),"closing"!==this.readyState&&"closed"!==this.readyState){(n=n||{}).compress=!1!==n.compress;var s={type:e,data:t,options:n};this.emit("packetCreate",s),this.writeBuffer.push(s),i&&this.once("flush",i),this.flush()}},vo.prototype.close=function(){if("opening"===this.readyState||"open"===this.readyState){this.readyState="closing";var e=this;this.writeBuffer.length?this.once("drain",(function(){this.upgrading?i():t()})):this.upgrading?i():t()}function t(){e.onClose("forced close"),po("socket closing - telling transport to close"),e.transport.close()}function n(){e.removeListener("upgrade",n),e.removeListener("upgradeError",n),t()}function i(){e.once("upgrade",n),e.once("upgradeError",n)}return this},vo.prototype.onError=function(e){po("socket error %j",e),vo.priorWebsocketSuccess=!1,this.emit("error",e),this.onClose("transport error",e)},vo.prototype.onClose=function(e,t){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState){po('socket close with reason: "%s"',e);clearTimeout(this.pingIntervalTimer),clearTimeout(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),this.readyState="closed",this.id=null,this.emit("close",e,t),this.writeBuffer=[],this.prevBufferLen=0}},vo.prototype.filterUpgrades=function(e){for(var t=[],n=0,i=e.length;n<i;n++)~lo(this.transports,e[n])&&t.push(e[n]);return t},function(e){e.exports=go,e.exports.parser=Fs}(Os),Ps.exports=Es;var bo,yo,_o={},xo={get exports(){return _o},set exports(e){_o=e}};var wo=function(e,t,n){return e.on(t,n),{destroy:function(){e.removeListener(t,n)}}};var So,ko,Co,Ro,To,Po=[].slice,Eo=function(e,t){if("string"==typeof t&&(t=e[t]),"function"!=typeof t)throw new Error("bind() requires a function");var n=Po.call(arguments,2);return function(){return t.apply(e,n.concat(Po.call(arguments)))}};function Oo(){if(Ro)return Co;Ro=1;var e=ko?So:(ko=1,So=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)});return Co=function(t){return function t(n){if(!n)return!1;if(Zt.Buffer&&Zt.Buffer.isBuffer&&Zt.Buffer.isBuffer(n)||Zt.ArrayBuffer&&n instanceof ArrayBuffer||Zt.Blob&&n instanceof Blob||Zt.File&&n instanceof File)return!0;if(e(n)){for(var i=0;i<n.length;i++)if(t(n[i]))return!0}else if(n&&"object"==typeof n)for(var s in n.toJSON&&"function"==typeof n.toJSON&&(n=n.toJSON()),n)if(Object.prototype.hasOwnProperty.call(n,s)&&t(n[s]))return!0;return!1}(t)},Co}function Do(){return To||(To=1,function(e,t){var n=os,i=Ks,s=(yo||(yo=1,bo=function(e,t){for(var n=[],i=(t=t||0)||0;i<e.length;i++)n[i-t]=e[i];return n}),bo),r=wo,a=Eo,o=Ki("socket.io-client:socket"),c=Oo();e.exports=l;var p={connect:1,connect_error:1,connect_timeout:1,connecting:1,disconnect:1,error:1,reconnect:1,reconnect_attempt:1,reconnect_failed:1,reconnect_error:1,reconnecting:1,ping:1,pong:1},d=i.prototype.emit;function l(e,t,n){this.io=e,this.nsp=t,this.json=this,this.ids=0,this.acks={},this.receiveBuffer=[],this.sendBuffer=[],this.connected=!1,this.disconnected=!0,n&&n.query&&(this.query=n.query),this.io.autoConnect&&this.open()}i(l.prototype),l.prototype.subEvents=function(){if(!this.subs){var e=this.io;this.subs=[r(e,"open",a(this,"onopen")),r(e,"packet",a(this,"onpacket")),r(e,"close",a(this,"onclose"))]}},l.prototype.open=l.prototype.connect=function(){return this.connected||(this.subEvents(),this.io.open(),"open"===this.io.readyState&&this.onopen(),this.emit("connecting")),this},l.prototype.send=function(){var e=s(arguments);return e.unshift("message"),this.emit.apply(this,e),this},l.prototype.emit=function(e){if(p.hasOwnProperty(e))return d.apply(this,arguments),this;var t=s(arguments),i=n.EVENT;c(t)&&(i=n.BINARY_EVENT);var r={type:i,data:t,options:{}};return r.options.compress=!this.flags||!1!==this.flags.compress,"function"==typeof t[t.length-1]&&(o("emitting packet with ack id %d",this.ids),this.acks[this.ids]=t.pop(),r.id=this.ids++),this.connected?this.packet(r):this.sendBuffer.push(r),delete this.flags,this},l.prototype.packet=function(e){e.nsp=this.nsp,this.io.packet(e)},l.prototype.onopen=function(){o("transport is open - connecting"),"/"!==this.nsp&&(this.query?this.packet({type:n.CONNECT,query:this.query}):this.packet({type:n.CONNECT}))},l.prototype.onclose=function(e){o("close (%s)",e),this.connected=!1,this.disconnected=!0,delete this.id,this.emit("disconnect",e)},l.prototype.onpacket=function(e){if(e.nsp===this.nsp)switch(e.type){case n.CONNECT:this.onconnect();break;case n.EVENT:case n.BINARY_EVENT:this.onevent(e);break;case n.ACK:case n.BINARY_ACK:this.onack(e);break;case n.DISCONNECT:this.ondisconnect();break;case n.ERROR:this.emit("error",e.data)}},l.prototype.onevent=function(e){var t=e.data||[];o("emitting event %j",t),null!=e.id&&(o("attaching ack callback to event"),t.push(this.ack(e.id))),this.connected?d.apply(this,t):this.receiveBuffer.push(t)},l.prototype.ack=function(e){var t=this,i=!1;return function(){if(!i){i=!0;var r=s(arguments);o("sending ack %j",r);var a=c(r)?n.BINARY_ACK:n.ACK;t.packet({type:a,id:e,data:r})}}},l.prototype.onack=function(e){var t=this.acks[e.id];"function"==typeof t?(o("calling ack %s with %j",e.id,e.data),t.apply(this,e.data),delete this.acks[e.id]):o("bad ack %s",e.id)},l.prototype.onconnect=function(){this.connected=!0,this.disconnected=!1,this.emit("connect"),this.emitBuffered()},l.prototype.emitBuffered=function(){var e;for(e=0;e<this.receiveBuffer.length;e++)d.apply(this,this.receiveBuffer[e]);for(this.receiveBuffer=[],e=0;e<this.sendBuffer.length;e++)this.packet(this.sendBuffer[e]);this.sendBuffer=[]},l.prototype.ondisconnect=function(){o("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")},l.prototype.destroy=function(){if(this.subs){for(var e=0;e<this.subs.length;e++)this.subs[e].destroy();this.subs=null}this.io.destroy(this)},l.prototype.close=l.prototype.disconnect=function(){return this.connected&&(o("performing disconnect (%s)",this.nsp),this.packet({type:n.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this},l.prototype.compress=function(e){return this.flags=this.flags||{},this.flags.compress=e,this}}(xo)),_o}var jo=Io;function Io(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Io.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=0==(1&Math.floor(10*t))?e-n:e+n}return 0|Math.min(e,this.max)},Io.prototype.reset=function(){this.attempts=0},Io.prototype.setMin=function(e){this.ms=e},Io.prototype.setMax=function(e){this.max=e},Io.prototype.setJitter=function(e){this.jitter=e};var Mo=Ts,Lo=Do(),Ao=Ks,No=os,Bo=wo,Fo=Eo,Uo=Ki("socket.io-client:manager"),zo=eo,qo=jo,$o=Object.prototype.hasOwnProperty,Vo=Ho;function Ho(e,t){if(!(this instanceof Ho))return new Ho(e,t);e&&"object"==typeof e&&(t=e,e=void 0),(t=t||{}).path=t.path||"/socket.io",this.nsps={},this.subs=[],this.opts=t,this.reconnection(!1!==t.reconnection),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor(t.randomizationFactor||.5),this.backoff=new qo({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==t.timeout?2e4:t.timeout),this.readyState="closed",this.uri=e,this.connecting=[],this.lastPing=null,this.encoding=!1,this.packetBuffer=[],this.encoder=new No.Encoder,this.decoder=new No.Decoder,this.autoConnect=!1!==t.autoConnect,this.autoConnect&&this.open()}Ho.prototype.emitAll=function(){for(var e in this.emit.apply(this,arguments),this.nsps)$o.call(this.nsps,e)&&this.nsps[e].emit.apply(this.nsps[e],arguments)},Ho.prototype.updateSocketIds=function(){for(var e in this.nsps)$o.call(this.nsps,e)&&(this.nsps[e].id=this.engine.id)},Ao(Ho.prototype),Ho.prototype.reconnection=function(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection},Ho.prototype.reconnectionAttempts=function(e){return arguments.length?(this._reconnectionAttempts=e,this):this._reconnectionAttempts},Ho.prototype.reconnectionDelay=function(e){return arguments.length?(this._reconnectionDelay=e,this.backoff&&this.backoff.setMin(e),this):this._reconnectionDelay},Ho.prototype.randomizationFactor=function(e){return arguments.length?(this._randomizationFactor=e,this.backoff&&this.backoff.setJitter(e),this):this._randomizationFactor},Ho.prototype.reconnectionDelayMax=function(e){return arguments.length?(this._reconnectionDelayMax=e,this.backoff&&this.backoff.setMax(e),this):this._reconnectionDelayMax},Ho.prototype.timeout=function(e){return arguments.length?(this._timeout=e,this):this._timeout},Ho.prototype.maybeReconnectOnOpen=function(){!this.reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()},Ho.prototype.open=Ho.prototype.connect=function(e,t){if(Uo("readyState %s",this.readyState),~this.readyState.indexOf("open"))return this;Uo("opening %s",this.uri),this.engine=Mo(this.uri,this.opts);var n=this.engine,i=this;this.readyState="opening",this.skipReconnect=!1;var s=Bo(n,"open",(function(){i.onopen(),e&&e()})),r=Bo(n,"error",(function(t){if(Uo("connect_error"),i.cleanup(),i.readyState="closed",i.emitAll("connect_error",t),e){var n=new Error("Connection error");n.data=t,e(n)}else i.maybeReconnectOnOpen()}));if(!1!==this._timeout){var a=this._timeout;Uo("connect attempt will timeout after %d",a);var o=setTimeout((function(){Uo("connect attempt timed out after %d",a),s.destroy(),n.close(),n.emit("error","timeout"),i.emitAll("connect_timeout",a)}),a);this.subs.push({destroy:function(){clearTimeout(o)}})}return this.subs.push(s),this.subs.push(r),this},Ho.prototype.onopen=function(){Uo("open"),this.cleanup(),this.readyState="open",this.emit("open");var e=this.engine;this.subs.push(Bo(e,"data",Fo(this,"ondata"))),this.subs.push(Bo(e,"ping",Fo(this,"onping"))),this.subs.push(Bo(e,"pong",Fo(this,"onpong"))),this.subs.push(Bo(e,"error",Fo(this,"onerror"))),this.subs.push(Bo(e,"close",Fo(this,"onclose"))),this.subs.push(Bo(this.decoder,"decoded",Fo(this,"ondecoded")))},Ho.prototype.onping=function(){this.lastPing=new Date,this.emitAll("ping")},Ho.prototype.onpong=function(){this.emitAll("pong",new Date-this.lastPing)},Ho.prototype.ondata=function(e){this.decoder.add(e)},Ho.prototype.ondecoded=function(e){this.emit("packet",e)},Ho.prototype.onerror=function(e){Uo("error",e),this.emitAll("error",e)},Ho.prototype.socket=function(e,t){var n=this.nsps[e];if(!n){n=new Lo(this,e,t),this.nsps[e]=n;var i=this;n.on("connecting",s),n.on("connect",(function(){n.id=i.engine.id})),this.autoConnect&&s()}function s(){~zo(i.connecting,n)||i.connecting.push(n)}return n},Ho.prototype.destroy=function(e){var t=zo(this.connecting,e);~t&&this.connecting.splice(t,1),this.connecting.length||this.close()},Ho.prototype.packet=function(e){Uo("writing packet %j",e);var t=this;e.query&&0===e.type&&(e.nsp+="?"+e.query),t.encoding?t.packetBuffer.push(e):(t.encoding=!0,this.encoder.encode(e,(function(n){for(var i=0;i<n.length;i++)t.engine.write(n[i],e.options);t.encoding=!1,t.processPacketQueue()})))},Ho.prototype.processPacketQueue=function(){if(this.packetBuffer.length>0&&!this.encoding){var e=this.packetBuffer.shift();this.packet(e)}},Ho.prototype.cleanup=function(){Uo("cleanup");for(var e=this.subs.length,t=0;t<e;t++){this.subs.shift().destroy()}this.packetBuffer=[],this.encoding=!1,this.lastPing=null,this.decoder.destroy()},Ho.prototype.close=Ho.prototype.disconnect=function(){Uo("disconnect"),this.skipReconnect=!0,this.reconnecting=!1,"opening"===this.readyState&&this.cleanup(),this.backoff.reset(),this.readyState="closed",this.engine&&this.engine.close()},Ho.prototype.onclose=function(e){Uo("onclose"),this.cleanup(),this.backoff.reset(),this.readyState="closed",this.emit("close",e),this._reconnection&&!this.skipReconnect&&this.reconnect()},Ho.prototype.reconnect=function(){if(this.reconnecting||this.skipReconnect)return this;var e=this;if(this.backoff.attempts>=this._reconnectionAttempts)Uo("reconnect failed"),this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1;else{var t=this.backoff.duration();Uo("will wait %dms before reconnect attempt",t),this.reconnecting=!0;var n=setTimeout((function(){e.skipReconnect||(Uo("attempting reconnect"),e.emitAll("reconnect_attempt",e.backoff.attempts),e.emitAll("reconnecting",e.backoff.attempts),e.skipReconnect||e.open((function(t){t?(Uo("reconnect attempt error"),e.reconnecting=!1,e.reconnect(),e.emitAll("reconnect_error",t.data)):(Uo("reconnect success"),e.onreconnect())})))}),t);this.subs.push({destroy:function(){clearTimeout(n)}})}},Ho.prototype.onreconnect=function(){var e=this.backoff.attempts;this.reconnecting=!1,this.backoff.reset(),this.updateSocketIds(),this.emitAll("reconnect",e)},function(e,t){var n=as,i=os,s=Vo,r=Ki("socket.io-client");e.exports=t=o;var a=t.managers={};function o(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var i,o=n(e),c=o.source,p=o.id,d=o.path,l=a[p]&&d in a[p].nsps;return t.forceNew||t["force new connection"]||!1===t.multiplex||l?(r("ignoring socket cache for %s",c),i=s(c,t)):(a[p]||(r("new io instance for %s",c),a[p]=s(c,t)),i=a[p]),o.query&&!t.query?t.query=o.query:t&&"object"==typeof t.query&&(t.query=function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t.join("&")}(t.query)),i.socket(o.path,t)}t.protocol=i.protocol,t.connect=o,t.Manager=Vo,t.Socket=Do()}(Vi,$i);var Wo=$i;class Go{constructor(e,t){t&&!t.transports&&(t.transports=["websocket"]),this._socket=Wo(e,t),this._socket.on("reconnect",(()=>{this._socket.sendBuffer=[]})),this._socket.on("reconnect_attempt",(()=>{this._wasConnectedUsingWebsocket?(this._socket.io.opts.transports=["websocket"],"safari"!==Bi.browserDetails.browser&&delete this._wasConnectedUsingWebsocket):this._socket.io.opts.transports=["polling","websocket"]})),this._socket.on("connect",(()=>{"websocket"===this.getTransport()&&(this._wasConnectedUsingWebsocket=!0)}))}connect(){this.isConnected()||this.isConnecting()||this._socket.open()}disconnect(){this._socket.disconnect()}disconnectOnConnect(){this._socket.once("connect",(()=>{this._socket.disconnect()}))}emit(){this._socket.emit.apply(this._socket,arguments)}emitIfConnected(e,t){this.isConnected()&&this.emit(e,t)}getTransport(){return this._socket&&this._socket.io&&this._socket.io.engine&&this._socket.io.engine.transport&&this._socket.io.engine.transport.name}isConnecting(){return this._socket&&this._socket.connecting}isConnected(){return this._socket&&this._socket.connected}on(e,t){return this._socket.on(e,t),()=>{this._socket.off(e,t)}}once(e,t){this._socket.once(e,t)}off(e,t){this._socket.off(e,t)}}var Ko="connection_blocked_by_network",Jo="dominant_speaker";const Qo=Bi.browserDetails.browser,Yo=Bi.browserDetails.version;function Xo(e,t){let n=e.match(/a=ssrc-group:FID (\d+) (\d+)\r\n/),i=t.match(/a=ssrc-group:FID (\d+) (\d+)\r\n/);n||(n=e.match(/a=ssrc:(\d+) cname:(.*)\r\n/g)[1].match(/a=ssrc:(\d+)/),i=t.match(/a=ssrc:(\d+) cname:(.*)\r\n/g)[1].match(/a=ssrc:(\d+)/));for(let e=1;e<n.length;e++)t=t.replace(new RegExp(i[e],"g"),n[e]);return t}function Zo(e){return"firefox"!==Qo?e:Ti.splitLines(e.trim()).map((e=>e.startsWith("a=msid-semantic:")?"a=msid-semantic: WMS *":e)).join("\r\n")+"\r\n"}const ec=console;function tc(e,t){const n=e.getSenders().find((e=>e.track&&"video"===e.track.kind));if(!n)return Promise.resolve();const i=n.getParameters();return i.encodings&&0===i.encodings.length?Promise.resolve():(i.encodings||(i.encodings=[{}]),0===t?delete i.encodings[0].maxBitrate:i.encodings[0].maxBitrate=1e3*t,n.setParameters(i).catch((e=>{ec.error("setParameters err: ",e)})))}const nc=console;class ic{constructor({peerConnectionId:e,bandwidth:t,maximumTurnBandwidth:n,deprioritizeH264Encoding:i}){this.peerConnectionId=e,this.relayCandidateSeen=!1,this.pc=null,this.wasEverConnected=!1,this.connectionStatus=null,this.stats={totalSent:0,totalRecv:0},this.bandwidth=t||0,this.maximumTurnBandwidth=n,this.pending=[],this.isOperationPending=!1,this.streamIds=[],this.streams=[],this.earlyIceCandidates=[],this.afterConnected=new Promise((e=>{this.registerConnected=e})),this.offerOptions={offerToReceiveAudio:!0,offerToReceiveVideo:!0},this._deprioritizeH264Encoding=i}setAndGetPeerConnection({clientId:e,constraints:t,peerConnectionConfig:n,shouldAddLocalVideo:i}){return this.peerConnectionConfig=n,this.shouldAddLocalVideo=i,this.clientId=e,this.pc=new RTCPeerConnection(n,t),this.signalingState=this.pc.signalingState,this.pc.addEventListener("signalingstatechange",(()=>{if(this.signalingState!==this.pc.signalingState&&(this.signalingState=this.pc.signalingState,"stable"===this.pc.signalingState)){this.isOperationPending=!1;const e=this.pending.shift();e&&e.apply()}})),this.pc}addStream(e){this.streamIds.push(e.id),this.streams.push(e),RTCPeerConnection.prototype.addTrack?(e.getAudioTracks().forEach((t=>{this.pc.addTrack(t,e)})),e.getVideoTracks().forEach((t=>{this.pc.addTrack(t,e)}))):this.pc.addStream(e)}addTrack(e,t){t||(t=this.streams[0]),t.addTrack(e),this.pc.addTrack(e,t)}removeTrack(e){this.streams[0].removeTrack(e);const t=this.pc.getSenders().find((t=>t.track===e));t&&this.pc.removeTrack(t)}removeStream(e){for(let t=0;t<this.streamIds.length;t++)this.streamIds[t]===e.id&&(this.streamIds.splice(t,1),this.streams.splice(t,1));this.pc&&(this.pc.removeTrack?e.getTracks().forEach((e=>{const t=this.pc.getSenders().find((t=>t.track===e));t&&this.pc.removeTrack(t)})):this.pc.removeStream&&this.pc.removeStream(e))}_setRemoteDescription(e){return this._deprioritizeH264Encoding&&(e.sdp=function(e){return Ti.splitSections(e).map((e=>{if("video"!==Ti.getKind(e))return e;const t=Ti.matchPrefix(e,"a=rtpmap:").map((e=>Ti.parseRtpMap(e))).filter((e=>/h264/i.test(e.name))).map((e=>""+e.payloadType));if(!t.length)return e;const n=Ti.matchPrefix(e,"m=video")[0],i=/(\s\d+)+$/i.exec(n)[0],s=[...i.split(" ").filter((e=>e&&!t.includes(e))),...t].join(" "),r=n.replace(i," "+s);return e.replace(n,r)})).join("")}(e.sdp)),this.srdComplete=this.pc.setRemoteDescription(e),this.srdComplete.then((()=>{this.earlyIceCandidates.forEach((e=>this.pc.addIceCandidate(e))),this.earlyIceCandidates=[]}))}handleOffer(e){if(!this.canModifyPeerConnection())return new Promise((t=>{this.pending.push((()=>this.handleOffer(e).then(t)))}));this.isOperationPending=!0;let t=e.sdp;t=function(e){return"safari"!==Qo&&("firefox"!==Qo||Yo>=63||60===Yo)?e:Ti.splitLines(e.trim()).filter((e=>!e.startsWith("a=extmap:")||"urn:ietf:params:rtp-hdrext:sdes:mid"!==Ti.parseExtmap(e).uri)).join("\r\n")+"\r\n"}(t),t=Zo(t);const n={type:e.type,sdp:t};let i;return this._setRemoteDescription(n).then((()=>this.pc.createAnswer())).then((e=>(i=e,this.pc.setLocalDescription(e)))).then((()=>tc(this.pc,this.bandwidth))).then((()=>i))}handleAnswer(e){if(this.pendingOffer){const t=this.pendingOffer;return delete this.pendingOffer,this.pc.setLocalDescription(t).then((()=>this.handleAnswer(e)))}let t=e.sdp;t=Zo(t);const n={type:e.type,sdp:t};return this._setRemoteDescription(n).then((()=>tc(this.pc,this.bandwidth)),(e=>{nc.warn("Could not set remote description from remote answer: ",e)}))}addIceCandidate(e){this.srdComplete?this.srdComplete.then((()=>{"closed"!==this.pc.signalingState&&("safari"===Bi.browserDetails.browser&&e&&""===e.candidate||this.pc.addIceCandidate(e).catch((t=>{nc.warn("Failed to add ICE candidate ('%s'): %s",e?e.candidate:null,t)})))})):this.earlyIceCandidates.push(e)}canModifyPeerConnection(){return"stable"===this.pc.signalingState&&!this.isOperationPending}close(){const e=this.pc;if(e){e.oniceconnectionstatechange=null,e.onicecandidate=null,e.ontrack=null;try{e.close()}catch(e){console.warn("failures during close of session",e)}}}hasConnectedPeerConnection(){return this.pc&&"connected"===this.pc.connectionState}replaceTrack(e,t){const n=this.pc;if(!n)return!1;const i=n.getSenders();function s(n){const s=e=>e&&`id:${e.id},kind:${e.kind},state:${e.readyState}`;nc.warn(`${n}. newTrack:${s(t)}, oldTrack:${s(e)}, sender tracks: ${JSON.stringify(i.map((e=>`s ${s(e.track)}`)))}, sender first codecs: ${JSON.stringify(i.map((e=>(e.getParameters().codecs||[])[0])))}`)}if(i.length||s("No senders!"),e||(e=(i.find((e=>e.track&&e.track.kind===t.kind))||{}).track,e||s("No sender with same kind! Add new track then.")),window.RTCRtpSender&&window.RTCRtpSender.prototype.replaceTrack){if(e){const n=()=>{for(let n=0;n<i.length;n++){const r=i[n],a=r.track;if(r||a||s("One of the tracks is null!"),a.id===t.id)return Promise.resolve(t);if(a.id===e.id)return i[n].replaceTrack(t)}return null};let r=n();if(r)return r;let a=null,o=null;r=new Promise(((e,t)=>{a=e,o=t}));let c=0,p=setInterval((async()=>{const e=n();if(!e)return void(3<++c&&(clearInterval(p),p=null,s("No sender track to replace"),o("No sender track to replace")));clearInterval(p),p=null;const t=await e;a(t)}),1e3);return r}const r=this.streams.find((e=>e.getTracks().find((e=>e.id===t.id))))||this.streams[0];return r?n.addTrack(t,r):(s("No stream?"),Promise.reject(new Error("replaceTrack: No stream?")))}if(!this.canModifyPeerConnection())return void this.pending.push((()=>{this.replaceTrack(e,t)}));this.isOperationPending=!0;const r=n.onnegotiationneeded;return n.onnegotiationneeded=null,this.removeTrack(e),this.addTrack(t),setTimeout((()=>{n.onnegotiationneeded=r}),0),"offer"===n.localDescription.type?n.createOffer().then((e=>(e.sdp=Xo(n.localDescription.sdp,e.sdp),n.setLocalDescription(e)))).then((()=>this._setRemoteDescription(n.remoteDescription))):this._setRemoteDescription(n.remoteDescription).then((()=>n.createAnswer())).then((e=>(e.sdp=Xo(n.localDescription.sdp,e.sdp),n.setLocalDescription(e))))}maybeRestrictRelayBandwidth(){var e;this.pc.getStats&&(e=this.pc,e.getStats(null).then((e=>{let t,n;return e.forEach((i=>{if("transport"===i.type&&i.selectedCandidatePairId){const s=e.get(i.selectedCandidatePairId);if(!s)return;return t=e.get(s.localCandidateId).candidateType,void(n=e.get(s.remoteCandidateId).candidateType)}"candidate-pair"===i.type&&i.selected&&(t=e.get(i.localCandidateId).candidateType,n=e.get(i.remoteCandidateId).candidateType)})),"relay"===t||"relayed"===t||"relay"===n||"relayed"===n}))).then((e=>{e&&0===this.bandwidth&&this.changeBandwidth(this.maximumTurnBandwidth)}))}changeBandwidth(e){e!==this.bandwidth&&(this.canModifyPeerConnection()?(this.bandwidth=e,this.pc.localDescription&&""!==this.pc.localDescription.type&&tc(this.pc,this.bandwidth)):this.pending.push((()=>this.changeBandwidth(e))))}}process.env.AWF_BASE_URL,process.env.AWF_API_BASE_URL,process.env.AP_ROOM_BASE_URL;const sc=console,rc=Bi.browserDetails.browser,ac=Bi.browserDetails.version;const oc=console,cc=Bi.browserDetails.browser;class pc extends class{constructor({selfId:e,room:t,emitter:n,serverSocket:i,webrtcProvider:s,features:r}){m.ok(e,"selfId is required"),m.ok(t,"room is required"),m.ok(n&&n.emit,"emitter is required"),m.ok(i instanceof Go,"serverSocket is required"),m.ok(s,"webrtcProvider is required");const{name:a,session:o,iceServers:c,sfuServer:p,mediaserverConfigTtlSeconds:d}=t;this._selfId=e,this._roomName=a,this._roomSessionId=o&&o.id,this.peerConnections={},this.localStreams={},this.enabledLocalStreamIds=[],this._socketListenerDeregisterFunctions=[],this._emitter=n,this._serverSocket=i,this._webrtcProvider=s,this._features=r||{},this.offerOptions={offerToReceiveAudio:!0,offerToReceiveVideo:!0},this._pendingActionsForConnectedPeerConnections=[],this._updateAndScheduleMediaServersRefresh({sfuServer:p,iceServers:c.iceServers||[],mediaserverConfigTtlSeconds:d})}numberOfPeerconnections(){return Object.keys(this.peerConnections).length}numberOfRemotePeers(){return Object.values(this.peerConnections).filter((e=>e.clientId!==this._selfId)).length}_setConnectionStatus(e,t,n){const i=e.connectionStatus;i!==t&&e.peerConnectionId!==this._selfId&&(i===Sn&&t===_n||(e.connectionStatus=t,setTimeout((()=>{this._emit(hn,{streamIds:e.streamIds,clientId:n,status:t,previous:i})}),0)))}_emitServerEvent(e,t,n){this._serverSocket.emit(e,t,n)}_emit(e,t){this._emitter.emit(e,t)}isInitializedWith({selfId:e,roomName:t,isSfu:n}){return this._selfId===e&&this._roomName===t&&n===!!this._sfuServer}supportsScreenShareAudio(){return!0}_addEnabledLocalStreamId(e){this.enabledLocalStreamIds.push(e)}_deleteEnabledLocalStreamId(e){const t=this.enabledLocalStreamIds.indexOf(e);-1!==t&&this.enabledLocalStreamIds.splice(t,1)}_getSession(e){return e in this.peerConnections?this.peerConnections[e]:null}_getOrCreateSession(e,t){let n=this.peerConnections[e];if(void 0===n){const i="safari"===rc&&ac>=14&&this._features.deprioritizeH264OnSafari;this.peerConnections[e]=n=new ic({peerConnectionId:e,bandwidth:t,maximumTurnBandwidth:this._features.restrictBandwidthWhenUsingRelay?512:768,deprioritizeH264Encoding:i})}return n}_getLocalCameraStream(){return this.localStreams[0]}_getNonLocalCameraStreamIds(){return Object.keys(this.localStreams).filter((e=>"0"!==e))}_isScreensharingLocally(){return this._getNonLocalCameraStreamIds().length>0}_getFirstLocalNonCameraStream(){const e=this._getNonLocalCameraStreamIds();return 0===e.length?null:this.localStreams[e[0]]}_transformIncomingSdp(e){return{type:e.type,sdp:e.sdpU}}_transformOutgoingSdp(e){return{type:e.type,sdpU:e.sdp}}_createSession({clientId:e,initialBandwidth:t,isOfferer:n,peerConnectionId:i,shouldAddLocalVideo:s}){if(!i)throw new Error("peerConnectionId is missing");if(!e)throw new Error("clientId is missing");const r=this._getOrCreateSession(i,t),a={optional:[]};"chrome"===rc&&a.optional.push({googCpuOveruseDetection:!0});const o={iceServers:this._iceServers};if(this._features.turnServerOverrideHost){const e=this._features.turnServerOverrideHost,t=e.indexOf(":")>0?"":":443",n=":"+e+t;o.iceServers=o.iceServers.map((e=>{const t=Object.assign({},e);return t.url&&(t.url=t.url.replace(/:[^?]*/,n)),t.urls&&(t.urls=t.urls.map((e=>e.replace(/:[^?]*/,n)))),t}))}if(this._features.useOnlyTURN){o.iceTransportPolicy="relay";const e={onlyudp:/^turn:.*transport=udp$/,onlytcp:/^turn:.*transport=tcp$/,onlytls:/^turns:.*transport=tcp$/}[this._features.useOnlyTURN];e&&(o.iceServers=o.iceServers.filter((t=>t.url&&t.url.match(e))))}"chrome"===rc&&(o.sdpSemantics="unified-plan");const c=r.setAndGetPeerConnection({constraints:a,peerConnectionConfig:o,shouldAddLocalVideo:s,clientId:e});c.ontrack=t=>{const n=t.streams[0];"default"===n.id&&0===n.getAudioTracks().length||-1===r.streamIds.indexOf(n.id)&&(r.streamIds.push(n.id),this._emit(fn,{clientId:e,stream:n}),r.connectionStatus===wn&&setTimeout((()=>{this._emit(hn,{streamIds:r.streamIds,clientId:e,status:r.connectionStatus,previous:_n})}),0))},c.oniceconnectionstatechange=()=>{let t;const n=r.connectionStatus;switch(c.iceConnectionState){case"checking":t=_n;break;case"connected":case"completed":t=wn,r.wasEverConnected||(this._pendingActionsForConnectedPeerConnections.forEach((e=>{"function"==typeof e&&e()})),this._pendingActionsForConnectedPeerConnections=[]),!r.wasEverConnected&&(c.iceConnectionState.match(/connected|completed/)||"chrome"===rc&&c.localDescription&&"answer"===c.localDescription.type)&&(r.wasEverConnected=!0,"false"!==this._features.bandwidth&&this.maybeRestrictRelayBandwidth(r)),r.registerConnected();break;case"disconnected":t=Sn,setTimeout((()=>{"disconnected"===c.iceConnectionState&&this._maybeRestartIce(e,r)}),2e3);break;case"failed":t=xn,n!==t&&this._maybeRestartIce(e,r),null!==r.relayCandidateSeen||r.wasEverConnected||this._emit(Ko);break;default:return}this._setConnectionStatus(r,t,e)},c.onconnectionstate=()=>{switch(c.connectionState){case"connected":r.registerConnected();break;case"failed":const t=xn;null!==r.relayCandidateSeen||r.wasEverConnected||this._emit(Ko),this._setConnectionStatus(r,t,e)}};const p=this.localStreams[0];return s&&p&&r.addStream(p),s&&Object.keys(this.localStreams).forEach((e=>{if("0"===e)return;const t=this.localStreams[e];n?r.addStream(t):r.afterConnected.then((()=>{this._emitServerEvent(Cn,{receiverId:r.clientId,streamId:t.id,hasAudioTrack:!!t.getAudioTracks().length}),this._withForcedRenegotiation(r,(()=>r.addStream(t)))}))})),r}_cleanup(e){const t=this._getSession(e);t?(t.close(),delete this.peerConnections[e]):sc.warn("No RTCPeerConnection in RTCManager.disconnect()",e)}_forEachPeerConnection(e){Object.keys(this.peerConnections).forEach((t=>{const n=this.peerConnections[t];e(n)}))}_addStreamToPeerConnections(e){this._forEachPeerConnection((t=>{this._withForcedRenegotiation(t,(()=>t.addStream(e)))}))}_addTrackToPeerConnections(e,t){this._forEachPeerConnection((n=>{this._withForcedRenegotiation(n,(()=>n.addTrack(e,t)))}))}_replaceTrackToPeerConnections(e,t){const n=[];return this._forEachPeerConnection((i=>{if(!i.hasConnectedPeerConnection()){sc.log("Session doesn't have a connected PeerConnection, adding pending action!");const s=this._pendingActionsForConnectedPeerConnections;if(!s)return void sc.warn("No pending action is created to repalce track, because the pending actions array is null");const r=new Promise(((n,r)=>{s.push((()=>{const s=i.replaceTrack(e,t);if(!s)return sc.error("replaceTrack returned false!"),void r("ReplaceTrack returned false");s.then((e=>n(e))).catch((e=>r(e)))}))}));return void n.push(r)}const s=i.replaceTrack(e,t);s?n.push(s):sc.error("replaceTrack returned false!")})),Promise.all(n)}_removeStreamFromPeerConnections(e){this._forEachPeerConnection((t=>{this._withForcedRenegotiation(t,(()=>t.removeStream(e)))}))}_removeTrackFromPeerConnections(e){this._forEachPeerConnection((t=>{this._withForcedRenegotiation(t,(()=>t.removeTrack(e)))}))}_addLocalStream(e,t){this._addEnabledLocalStreamId(e),this.localStreams[e]=t}_removeLocalStream(e){delete this.localStreams[e],this._deleteEnabledLocalStreamId(e)}maybeRestrictRelayBandwidth(e){e.maybeRestrictRelayBandwidth()}addNewStream(e,t){t!==this.localStreams[e]&&(this._addLocalStream(e,t),"0"!==e?this._shareScreen(e,t):this._addStreamToPeerConnections(t))}removeStream(e,t){this._removeLocalStream(e,t)}replaceTrack(e,t){return this._replaceTrackToPeerConnections(e,t)}accept({clientId:e,shouldAddLocalVideo:t}){return this.acceptNewStream({streamId:e,clientId:e,shouldAddLocalVideo:t})}disconnectAll(){Object.keys(this.peerConnections).forEach((e=>{this.disconnect(e)})),this.peerConnections={},this._socketListenerDeregisterFunctions.forEach((e=>{e()})),this._socketListenerDeregisterFunctions=[]}stopOrResumeAudio(){}stopOrResumeVideo(){}fixChromeAudio(e){if("chrome"!==rc)return;const t=this._getLocalCameraStream(),n=t.getAudioTracks()[0];return n&&"ended"===n.readyState?navigator.mediaDevices.getUserMedia({audio:e}).then((e=>{const i=e.getAudioTracks()[0];return i.enabled=n.enabled,t.removeTrack(n),t.addTrack(i),this.replaceTrack(n,i)})):void 0}_updateAndScheduleMediaServersRefresh({iceServers:e,sfuServer:t,mediaserverConfigTtlSeconds:n}){this._iceServers=e,this._sfuServer=t,this._mediaserverConfigTtlSeconds=n,this._clearMediaServersRefresh(),n&&(this._fetchMediaServersTimer=setTimeout((()=>this._emitServerEvent(kn)),1e3*n))}_clearMediaServersRefresh(){this._fetchMediaServersTimer&&(clearTimeout(this._fetchMediaServersTimer),this._fetchMediaServersTimer=null)}setupSocketListeners(){this._socketListenerDeregisterFunctions=[()=>this._clearMediaServersRefresh(),this._serverSocket.on(Tn,(e=>{e.error?sc.warn("FETCH_MEDIASERVER_CONFIG failed:",e.error):this._updateAndScheduleMediaServersRefresh(e)})),this._serverSocket.on(Dn,(e=>{this._connect(e.clientId)})),this._serverSocket.on(En,(e=>{const t=this._getSession(e.clientId);t?t.addIceCandidate(e.message):sc.warn("No RTCPeerConnection on ICE_CANDIDATE",e)})),this._serverSocket.on(On,(e=>{const t=this._getSession(e.clientId);t?t.addIceCandidate(null):sc.warn("No RTCPeerConnection on ICE_END_OF_CANDIDATES",e)})),this._serverSocket.on(In,(e=>{const t=this._getSession(e.clientId);if(!t)return void sc.warn("No RTCPeerConnection on SDP_OFFER",e);const n=this._transformIncomingSdp(e.message,t.pc);t.handleOffer(n).then((t=>{this._emitServerEvent(jn,{receiverId:e.clientId,message:this._transformOutgoingSdp(t)})}))})),this._serverSocket.on(jn,(e=>{const t=this._getSession(e.clientId);if(!t)return void sc.warn("No RTCPeerConnection on SDP_ANSWER",e);const n=this._transformIncomingSdp(e.message,t.pc);t.handleAnswer(n)}))]}setRoomSessionId(e){this._roomSessionId=e}}{_connect(e){let t=this._getSession(e),n=t&&t.bandwidth||0;return t?(oc.warn("Replacing peer session",e),this._cleanup(e)):n=this._changeBandwidthForAllClients(!0),t=this._createP2pSession(e,n,!0,!0),this._negotiatePeerConnection(e,t),Promise.resolve(t)}_maybeRestartIce(e,t){const n=t.pc;"disconnected"!==n.iceConnectionState&&"failed"!==n.iceConnectionState||"offer"===n.localDescription.type&&(t.wasEverConnected=!1,t.relayCandidateSeen=!1,this._negotiatePeerConnection(e,t,Object.assign({},this.offerOptions,{iceRestart:!0})))}_negotiatePeerConnection(e,t,n){if(!t)return void oc.warn("No RTCPeerConnection in negotiatePeerConnection()",e);const i=t.pc;t.canModifyPeerConnection()?(t.isOperationPending=!0,i.createOffer(n||this.offerOptions).then((n=>{this._emitServerEvent(In,{receiverId:e,message:this._transformOutgoingSdp(n)}),"chrome"===cc&&i.getSenders().filter((e=>e.track&&"video"===e.track.kind)).length>=2?t.pendingOffer=n:i.setLocalDescription(n).catch((e=>{oc.warn("RTCPeerConnection.setLocalDescription() failed with local offer",e)}))})).catch((e=>{oc.warn("RTCPeerConnection.createOffer() failed to create local offer",e)}))):t.pending.push((()=>{this._negotiatePeerConnection(e,t,n)}))}_withForcedRenegotiation(e,t){const n=e.pc,i=n.onnegotationneeded;n.onnegotiationneeded=null,t(),this._negotiatePeerConnection(e.clientId,e),setTimeout((()=>n.onnegotiationneeded=i),0)}_changeBandwidthForAllClients(e){let t=this.numberOfPeerconnections();if(e&&(t+=1),0===t)return 0;t>7&&(t=7);const n=this._features.bandwidth?parseInt(this._features.bandwidth,10):{1:0,2:this._features.highP2PBandwidth?768:384,3:this._features.highP2PBandwidth?512:256,4:192,5:128,6:128,7:64}[t];return void 0===n?0:(this._forEachPeerConnection((e=>{e.changeBandwidth(n)})),n)}_createP2pSession(e,t,n,i){const s=this._createSession({peerConnectionId:e,clientId:e,initialBandwidth:t,shouldAddLocalVideo:n,isOfferer:i}),r=s.pc,a=this.localStreams[0];return n&&a&&!a.getVideoTracks().length&&this._stoppedVideoTrack&&r.addTrack(this._stoppedVideoTrack,a),r.onicecandidate=t=>{t.candidate?(s.relayCandidateSeen=s.relayCandidateSeen||"relay"===t.candidate.type,this._emitServerEvent(En,{receiverId:e,message:t.candidate})):this._emitServerEvent(On,{receiverId:e})},r.onnegotiationneeded=()=>{"new"!==r.iceConnectionState&&s.connectionStatus&&this._negotiatePeerConnection(e,s)},s}acceptNewStream({streamId:e,clientId:t,shouldAddLocalVideo:n}){let i=this._getSession(t);if(i&&e!==t)return i;let s=i&&i.bandwidth||0;return i?(oc.warn("Replacing peer session",t),this._cleanup(t)):s=this._changeBandwidthForAllClients(!0),i=this._createP2pSession(t,s,n),this._emitServerEvent(Dn,{receiverId:t}),i}disconnect(e){this._cleanup(e),this._changeBandwidthForAllClients(!1);0===this.numberOfPeerconnections()&&setTimeout((()=>{this.numberOfPeerconnections()}),6e4)}updateStreamResolution(){}stopOrResumeAudio(){}stopOrResumeVideo(e,t){if("chrome"===cc)if(!1===t)setTimeout((()=>{e.getVideoTracks().forEach((t=>{!1===t.enabled&&(t.stop(),e.removeTrack(t),this._emit(yn,{stream:e,track:t}),this._stoppedVideoTrack=t)}))}),5e3);else if(this._features.simplifiedVegaClientOn){const t=e.getVideoTracks()?.[0];this._stoppedVideoTrack?(this._replaceTrackToPeerConnections(this._stoppedVideoTrack,t),delete this._stoppedVideoTrack,this._emit(bn,{streamId:e.id,tracks:[t],screenShare:!1})):t||this._addTrackToPeerConnections(t)}else if(0===e.getVideoTracks().length){const t=this._webrtcProvider.getMediaConstraints().video;if(!t)return;navigator.mediaDevices.getUserMedia({video:t}).then((t=>{const n=t.getVideoTracks()[0];e.addTrack(n),this._emit(bn,{streamId:e.id,tracks:[n],screenShare:!1}),this._stoppedVideoTrack?(this._replaceTrackToPeerConnections(this._stoppedVideoTrack,n),delete this._stoppedVideoTrack):this._addTrackToPeerConnections(n)}))}}_shareScreen(e,t){this._emitServerEvent(Cn,{streamId:e,hasAudioTrack:!!t.getAudioTracks().length}),this._addStreamToPeerConnections(t)}removeStream(e,t,n){super.removeStream(e,t),this._removeStreamFromPeerConnections(t),this._emitServerEvent(Rn,{streamId:e,requestedByClientId:n})}}var dc,lc,uc,mc,hc,fc={},gc={},vc={},bc={get exports(){return vc},set exports(e){vc=e}};function yc(){if(lc)return dc;lc=1;var e=1e3,t=60*e,n=60*t,i=24*n,s=7*i,r=365.25*i;function a(e,t,n,i){var s=t>=1.5*n;return Math.round(e/n)+" "+i+(s?"s":"")}return dc=function(o,c){c=c||{};var p=typeof o;if("string"===p&&o.length>0)return function(a){if((a=String(a)).length>100)return;var o=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(a);if(!o)return;var c=parseFloat(o[1]);switch((o[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*r;case"weeks":case"week":case"w":return c*s;case"days":case"day":case"d":return c*i;case"hours":case"hour":case"hrs":case"hr":case"h":return c*n;case"minutes":case"minute":case"mins":case"min":case"m":return c*t;case"seconds":case"second":case"secs":case"sec":case"s":return c*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(o);if("number"===p&&isFinite(o))return c.long?function(s){var r=Math.abs(s);if(r>=i)return a(s,r,i,"day");if(r>=n)return a(s,r,n,"hour");if(r>=t)return a(s,r,t,"minute");if(r>=e)return a(s,r,e,"second");return s+" ms"}(o):function(s){var r=Math.abs(s);if(r>=i)return Math.round(s/i)+"d";if(r>=n)return Math.round(s/n)+"h";if(r>=t)return Math.round(s/t)+"m";if(r>=e)return Math.round(s/e)+"s";return s+"ms"}(o);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(o))},dc}function _c(){if(mc)return uc;return mc=1,uc=function(e){function t(e){let i,s,r,a=null;function o(...e){if(!o.enabled)return;const n=o,s=Number(new Date),r=s-(i||s);n.diff=r,n.prev=i,n.curr=s,i=s,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((i,s)=>{if("%%"===i)return"%";a++;const r=t.formatters[s];if("function"==typeof r){const t=e[a];i=r.call(n,t),e.splice(a,1),a--}return i})),t.formatArgs.call(n,e);(n.log||t.log).apply(n,e)}return o.namespace=e,o.useColors=t.useColors(),o.color=t.selectColor(e),o.extend=n,o.destroy=t.destroy,Object.defineProperty(o,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==a?a:(s!==t.namespaces&&(s=t.namespaces,r=t.enabled(e)),r),set:e=>{a=e}}),"function"==typeof t.init&&t.init(o),o}function n(e,n){const i=t(this.namespace+(void 0===n?":":n)+e);return i.log=this.log,i}function i(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(i),...t.skips.map(i).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const i=("string"==typeof e?e:"").split(/[\s,]+/),s=i.length;for(n=0;n<s;n++)i[n]&&("-"===(e=i[n].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 n,i;for(n=0,i=t.skips.length;n<i;n++)if(t.skips[n].test(e))return!1;for(n=0,i=t.names.length;n<i;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=yc(),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((n=>{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t},uc}var xc,wc,Sc,kc,Cc,Rc={},Tc={get exports(){return Rc},set exports(e){Rc=e}};function Pc(){return wc?xc:(wc=1,xc=(e,t=process.argv)=>{const n=e.startsWith("-")?"":1===e.length?"-":"--",i=t.indexOf(n+e),s=t.indexOf("--");return-1!==i&&(-1===s||i<s)})}function Ec(){return Cc||(Cc=1,function(n,i){const s=e,r=t;i.init=function(e){e.inspectOpts={};const t=Object.keys(i.inspectOpts);for(let n=0;n<t.length;n++)e.inspectOpts[t[n]]=i.inspectOpts[t[n]]},i.log=function(...e){return process.stderr.write(r.format(...e)+"\n")},i.formatArgs=function(e){const{namespace:t,useColors:s}=this;if(s){const i=this.color,s="[3"+(i<8?i:"8;5;"+i),r=` ${s};1m${t} `;e[0]=r+e[0].split("\n").join("\n"+r),e.push(s+"m+"+n.exports.humanize(this.diff)+"")}else e[0]=function(){if(i.inspectOpts.hideDate)return"";return(new Date).toISOString()+" "}()+t+" "+e[0]},i.save=function(e){e?process.env.DEBUG=e:delete process.env.DEBUG},i.load=function(){return process.env.DEBUG},i.useColors=function(){return"colors"in i.inspectOpts?Boolean(i.inspectOpts.colors):s.isatty(process.stderr.fd)},i.destroy=r.deprecate((()=>{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),i.colors=[6,2,3,4,5,1];try{const t=function(){if(kc)return Sc;kc=1;const t=h,n=e,i=Pc(),{env:s}=process;let r;function a(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function o(e,n){if(0===r)return 0;if(i("color=16m")||i("color=full")||i("color=truecolor"))return 3;if(i("color=256"))return 2;if(e&&!n&&void 0===r)return 0;const a=r||0;if("dumb"===s.TERM)return a;if("win32"===process.platform){const e=t.release().split(".");return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if("CI"in s)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some((e=>e in s))||"codeship"===s.CI_NAME?1:a;if("TEAMCITY_VERSION"in s)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(s.TEAMCITY_VERSION)?1:0;if("truecolor"===s.COLORTERM)return 3;if("TERM_PROGRAM"in s){const e=parseInt((s.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(s.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(s.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(s.TERM)||"COLORTERM"in s?1:a}return i("no-color")||i("no-colors")||i("color=false")||i("color=never")?r=0:(i("color")||i("colors")||i("color=true")||i("color=always"))&&(r=1),"FORCE_COLOR"in s&&(r="true"===s.FORCE_COLOR?1:"false"===s.FORCE_COLOR?0:0===s.FORCE_COLOR.length?1:Math.min(parseInt(s.FORCE_COLOR,10),3)),Sc={supportsColor:function(e){return a(o(e,e&&e.isTTY))},stdout:a(o(!0,n.isatty(1))),stderr:a(o(!0,n.isatty(2)))},Sc}();t&&(t.stderr||t).level>=2&&(i.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}i.inspectOpts=Object.keys(process.env).filter((e=>/^debug_/i.test(e))).reduce(((e,t)=>{const n=t.substring(6).toLowerCase().replace(/_([a-z])/g,((e,t)=>t.toUpperCase()));let i=process.env[t];return i=!!/^(yes|on|true|enabled)$/i.test(i)||!/^(no|off|false|disabled)$/i.test(i)&&("null"===i?null:Number(i)),e[n]=i,e}),{}),n.exports=_c()(i);const{formatters:a}=n.exports;a.o=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts).split("\n").map((e=>e.trim())).join(" ")},a.O=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts)}}(Tc,Rc)),Rc}!function(e){"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?e.exports=(hc||(hc=1,function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let i=0,s=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(i++,"%c"===e&&(s=i))})),t.splice(s,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.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+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=_c()(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(bc,vc)),vc):e.exports=Ec()}({get exports(){return gc},set exports(e){gc=e}});var Oc={};const Dc={"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"},jc={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"},Ic={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},Mc={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"},Lc={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"};class Ac{static getFirstMatch(e,t){const n=t.match(e);return n&&n.length>0&&n[1]||""}static getSecondMatch(e,t){const n=t.match(e);return n&&n.length>1&&n[2]||""}static matchAndReturnConst(e,t,n){if(e.test(t))return n}static getWindowsVersionName(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}}static getMacOSVersionName(e){const t=e.split(".").splice(0,2).map((e=>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}}static getAndroidVersionName(e){const t=e.split(".").splice(0,2).map((e=>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}static getVersionPrecision(e){return e.split(".").length}static compareVersions(e,t,n=!1){const i=Ac.getVersionPrecision(e),s=Ac.getVersionPrecision(t);let r=Math.max(i,s),a=0;const o=Ac.map([e,t],(e=>{const t=r-Ac.getVersionPrecision(e),n=e+new Array(t+1).join(".0");return Ac.map(n.split("."),(e=>new Array(20-e.length).join("0")+e)).reverse()}));for(n&&(a=r-Math.min(i,s)),r-=1;r>=a;){if(o[0][r]>o[1][r])return 1;if(o[0][r]===o[1][r]){if(r===a)return 0;r-=1}else if(o[0][r]<o[1][r])return-1}}static map(e,t){const n=[];let i;if(Array.prototype.map)return Array.prototype.map.call(e,t);for(i=0;i<e.length;i+=1)n.push(t(e[i]));return n}static find(e,t){let n,i;if(Array.prototype.find)return Array.prototype.find.call(e,t);for(n=0,i=e.length;n<i;n+=1){const i=e[n];if(t(i,n))return i}}static assign(e,...t){const n=e;let i,s;if(Object.assign)return Object.assign(e,...t);for(i=0,s=t.length;i<s;i+=1){const e=t[i];if("object"==typeof e&&null!==e){Object.keys(e).forEach((t=>{n[t]=e[t]}))}}return e}static getBrowserAlias(e){return Dc[e]}static getBrowserTypeByAlias(e){return jc[e]||""}}const Nc=/version\/(\d+(\.?_?\d+)+)/i,Bc=[{test:[/googlebot/i],describe(e){const t={name:"Googlebot"},n=Ac.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||Ac.getFirstMatch(Nc,e);return n&&(t.version=n),t}},{test:[/opera/i],describe(e){const t={name:"Opera"},n=Ac.getFirstMatch(Nc,e)||Ac.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opr\/|opios/i],describe(e){const t={name:"Opera"},n=Ac.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||Ac.getFirstMatch(Nc,e);return n&&(t.version=n),t}},{test:[/SamsungBrowser/i],describe(e){const t={name:"Samsung Internet for Android"},n=Ac.getFirstMatch(Nc,e)||Ac.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Whale/i],describe(e){const t={name:"NAVER Whale Browser"},n=Ac.getFirstMatch(Nc,e)||Ac.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MZBrowser/i],describe(e){const t={name:"MZ Browser"},n=Ac.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||Ac.getFirstMatch(Nc,e);return n&&(t.version=n),t}},{test:[/focus/i],describe(e){const t={name:"Focus"},n=Ac.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||Ac.getFirstMatch(Nc,e);return n&&(t.version=n),t}},{test:[/swing/i],describe(e){const t={name:"Swing"},n=Ac.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||Ac.getFirstMatch(Nc,e);return n&&(t.version=n),t}},{test:[/coast/i],describe(e){const t={name:"Opera Coast"},n=Ac.getFirstMatch(Nc,e)||Ac.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe(e){const t={name:"Opera Touch"},n=Ac.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||Ac.getFirstMatch(Nc,e);return n&&(t.version=n),t}},{test:[/yabrowser/i],describe(e){const t={name:"Yandex Browser"},n=Ac.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||Ac.getFirstMatch(Nc,e);return n&&(t.version=n),t}},{test:[/ucbrowser/i],describe(e){const t={name:"UC Browser"},n=Ac.getFirstMatch(Nc,e)||Ac.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Maxthon|mxios/i],describe(e){const t={name:"Maxthon"},n=Ac.getFirstMatch(Nc,e)||Ac.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/epiphany/i],describe(e){const t={name:"Epiphany"},n=Ac.getFirstMatch(Nc,e)||Ac.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/puffin/i],describe(e){const t={name:"Puffin"},n=Ac.getFirstMatch(Nc,e)||Ac.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sleipnir/i],describe(e){const t={name:"Sleipnir"},n=Ac.getFirstMatch(Nc,e)||Ac.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/k-meleon/i],describe(e){const t={name:"K-Meleon"},n=Ac.getFirstMatch(Nc,e)||Ac.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/micromessenger/i],describe(e){const t={name:"WeChat"},n=Ac.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||Ac.getFirstMatch(Nc,e);return n&&(t.version=n),t}},{test:[/qqbrowser/i],describe(e){const t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},n=Ac.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||Ac.getFirstMatch(Nc,e);return n&&(t.version=n),t}},{test:[/msie|trident/i],describe(e){const t={name:"Internet Explorer"},n=Ac.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/\sedg\//i],describe(e){const t={name:"Microsoft Edge"},n=Ac.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/edg([ea]|ios)/i],describe(e){const t={name:"Microsoft Edge"},n=Ac.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/vivaldi/i],describe(e){const t={name:"Vivaldi"},n=Ac.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/seamonkey/i],describe(e){const t={name:"SeaMonkey"},n=Ac.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sailfish/i],describe(e){const t={name:"Sailfish"},n=Ac.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return n&&(t.version=n),t}},{test:[/silk/i],describe(e){const t={name:"Amazon Silk"},n=Ac.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/phantom/i],describe(e){const t={name:"PhantomJS"},n=Ac.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/slimerjs/i],describe(e){const t={name:"SlimerJS"},n=Ac.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(e){const t={name:"BlackBerry"},n=Ac.getFirstMatch(Nc,e)||Ac.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(web|hpw)[o0]s/i],describe(e){const t={name:"WebOS Browser"},n=Ac.getFirstMatch(Nc,e)||Ac.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/bada/i],describe(e){const t={name:"Bada"},n=Ac.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/tizen/i],describe(e){const t={name:"Tizen"},n=Ac.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||Ac.getFirstMatch(Nc,e);return n&&(t.version=n),t}},{test:[/qupzilla/i],describe(e){const t={name:"QupZilla"},n=Ac.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||Ac.getFirstMatch(Nc,e);return n&&(t.version=n),t}},{test:[/firefox|iceweasel|fxios/i],describe(e){const t={name:"Firefox"},n=Ac.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/electron/i],describe(e){const t={name:"Electron"},n=Ac.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MiuiBrowser/i],describe(e){const t={name:"Miui"},n=Ac.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/chromium/i],describe(e){const t={name:"Chromium"},n=Ac.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||Ac.getFirstMatch(Nc,e);return n&&(t.version=n),t}},{test:[/chrome|crios|crmo/i],describe(e){const t={name:"Chrome"},n=Ac.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/GSA/i],describe(e){const t={name:"Google Search"},n=Ac.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test(e){const t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe(e){const t={name:"Android Browser"},n=Ac.getFirstMatch(Nc,e);return n&&(t.version=n),t}},{test:[/playstation 4/i],describe(e){const t={name:"PlayStation 4"},n=Ac.getFirstMatch(Nc,e);return n&&(t.version=n),t}},{test:[/safari|applewebkit/i],describe(e){const t={name:"Safari"},n=Ac.getFirstMatch(Nc,e);return n&&(t.version=n),t}},{test:[/.*/i],describe(e){const t=-1!==e.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:Ac.getFirstMatch(t,e),version:Ac.getSecondMatch(t,e)}}}];var Fc=[{test:[/Roku\/DVP/],describe(e){const t=Ac.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:Mc.Roku,version:t}}},{test:[/windows phone/i],describe(e){const t=Ac.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:Mc.WindowsPhone,version:t}}},{test:[/windows /i],describe(e){const t=Ac.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),n=Ac.getWindowsVersionName(t);return{name:Mc.Windows,version:t,versionName:n}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(e){const t={name:Mc.iOS},n=Ac.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return n&&(t.version=n),t}},{test:[/macintosh/i],describe(e){const t=Ac.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),n=Ac.getMacOSVersionName(t),i={name:Mc.MacOS,version:t};return n&&(i.versionName=n),i}},{test:[/(ipod|iphone|ipad)/i],describe(e){const t=Ac.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:Mc.iOS,version:t}}},{test(e){const t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe(e){const t=Ac.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),n=Ac.getAndroidVersionName(t),i={name:Mc.Android,version:t};return n&&(i.versionName=n),i}},{test:[/(web|hpw)[o0]s/i],describe(e){const t=Ac.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),n={name:Mc.WebOS};return t&&t.length&&(n.version=t),n}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(e){const t=Ac.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||Ac.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||Ac.getFirstMatch(/\bbb(\d+)/i,e);return{name:Mc.BlackBerry,version:t}}},{test:[/bada/i],describe(e){const t=Ac.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:Mc.Bada,version:t}}},{test:[/tizen/i],describe(e){const t=Ac.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:Mc.Tizen,version:t}}},{test:[/linux/i],describe:()=>({name:Mc.Linux})},{test:[/CrOS/],describe:()=>({name:Mc.ChromeOS})},{test:[/PlayStation 4/],describe(e){const t=Ac.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:Mc.PlayStation4,version:t}}}],Uc=[{test:[/googlebot/i],describe:()=>({type:"bot",vendor:"Google"})},{test:[/huawei/i],describe(e){const t=Ac.getFirstMatch(/(can-l01)/i,e)&&"Nova",n={type:Ic.mobile,vendor:"Huawei"};return t&&(n.model=t),n}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:()=>({type:Ic.tablet,vendor:"Nexus"})},{test:[/ipad/i],describe:()=>({type:Ic.tablet,vendor:"Apple",model:"iPad"})},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:()=>({type:Ic.tablet,vendor:"Apple",model:"iPad"})},{test:[/kftt build/i],describe:()=>({type:Ic.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"})},{test:[/silk/i],describe:()=>({type:Ic.tablet,vendor:"Amazon"})},{test:[/tablet(?! pc)/i],describe:()=>({type:Ic.tablet})},{test(e){const t=e.test(/ipod|iphone/i),n=e.test(/like (ipod|iphone)/i);return t&&!n},describe(e){const t=Ac.getFirstMatch(/(ipod|iphone)/i,e);return{type:Ic.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:()=>({type:Ic.mobile,vendor:"Nexus"})},{test:[/[^-]mobi/i],describe:()=>({type:Ic.mobile})},{test:e=>"blackberry"===e.getBrowserName(!0),describe:()=>({type:Ic.mobile,vendor:"BlackBerry"})},{test:e=>"bada"===e.getBrowserName(!0),describe:()=>({type:Ic.mobile})},{test:e=>"windows phone"===e.getBrowserName(),describe:()=>({type:Ic.mobile,vendor:"Microsoft"})},{test(e){const t=Number(String(e.getOSVersion()).split(".")[0]);return"android"===e.getOSName(!0)&&t>=3},describe:()=>({type:Ic.tablet})},{test:e=>"android"===e.getOSName(!0),describe:()=>({type:Ic.mobile})},{test:e=>"macos"===e.getOSName(!0),describe:()=>({type:Ic.desktop,vendor:"Apple"})},{test:e=>"windows"===e.getOSName(!0),describe:()=>({type:Ic.desktop})},{test:e=>"linux"===e.getOSName(!0),describe:()=>({type:Ic.desktop})},{test:e=>"playstation 4"===e.getOSName(!0),describe:()=>({type:Ic.tv})},{test:e=>"roku"===e.getOSName(!0),describe:()=>({type:Ic.tv})}],zc=[{test:e=>"microsoft edge"===e.getBrowserName(!0),describe(e){if(/\sedg\//i.test(e))return{name:Lc.Blink};const t=Ac.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:Lc.EdgeHTML,version:t}}},{test:[/trident/i],describe(e){const t={name:Lc.Trident},n=Ac.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:e=>e.test(/presto/i),describe(e){const t={name:Lc.Presto},n=Ac.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test(e){const t=e.test(/gecko/i),n=e.test(/like gecko/i);return t&&!n},describe(e){const t={name:Lc.Gecko},n=Ac.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(apple)?webkit\/537\.36/i],describe:()=>({name:Lc.Blink})},{test:[/(apple)?webkit/i],describe(e){const t={name:Lc.WebKit},n=Ac.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}}];class qc{constructor(e,t=!1){if(null==e||""===e)throw new Error("UserAgent parameter can't be empty");this._ua=e,this.parsedResult={},!0!==t&&this.parse()}getUA(){return this._ua}test(e){return e.test(this._ua)}parseBrowser(){this.parsedResult.browser={};const e=Ac.find(Bc,(e=>{if("function"==typeof e.test)return e.test(this);if(e.test instanceof Array)return e.test.some((e=>this.test(e)));throw new Error("Browser's test function is not valid")}));return e&&(this.parsedResult.browser=e.describe(this.getUA())),this.parsedResult.browser}getBrowser(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()}getBrowserName(e){return e?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""}getBrowserVersion(){return this.getBrowser().version}getOS(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()}parseOS(){this.parsedResult.os={};const e=Ac.find(Fc,(e=>{if("function"==typeof e.test)return e.test(this);if(e.test instanceof Array)return e.test.some((e=>this.test(e)));throw new Error("Browser's test function is not valid")}));return e&&(this.parsedResult.os=e.describe(this.getUA())),this.parsedResult.os}getOSName(e){const{name:t}=this.getOS();return e?String(t).toLowerCase()||"":t||""}getOSVersion(){return this.getOS().version}getPlatform(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()}getPlatformType(e=!1){const{type:t}=this.getPlatform();return e?String(t).toLowerCase()||"":t||""}parsePlatform(){this.parsedResult.platform={};const e=Ac.find(Uc,(e=>{if("function"==typeof e.test)return e.test(this);if(e.test instanceof Array)return e.test.some((e=>this.test(e)));throw new Error("Browser's test function is not valid")}));return e&&(this.parsedResult.platform=e.describe(this.getUA())),this.parsedResult.platform}getEngine(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()}getEngineName(e){return e?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""}parseEngine(){this.parsedResult.engine={};const e=Ac.find(zc,(e=>{if("function"==typeof e.test)return e.test(this);if(e.test instanceof Array)return e.test.some((e=>this.test(e)));throw new Error("Browser's test function is not valid")}));return e&&(this.parsedResult.engine=e.describe(this.getUA())),this.parsedResult.engine}parse(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this}getResult(){return Ac.assign({},this.parsedResult)}satisfies(e){const t={};let n=0;const i={};let s=0;if(Object.keys(e).forEach((r=>{const a=e[r];"string"==typeof a?(i[r]=a,s+=1):"object"==typeof a&&(t[r]=a,n+=1)})),n>0){const e=Object.keys(t),n=Ac.find(e,(e=>this.isOS(e)));if(n){const e=this.satisfies(t[n]);if(void 0!==e)return e}const i=Ac.find(e,(e=>this.isPlatform(e)));if(i){const e=this.satisfies(t[i]);if(void 0!==e)return e}}if(s>0){const e=Object.keys(i),t=Ac.find(e,(e=>this.isBrowser(e,!0)));if(void 0!==t)return this.compareVersion(i[t])}}isBrowser(e,t=!1){const n=this.getBrowserName().toLowerCase();let i=e.toLowerCase();const s=Ac.getBrowserTypeByAlias(i);return t&&s&&(i=s.toLowerCase()),i===n}compareVersion(e){let t=[0],n=e,i=!1;const s=this.getBrowserVersion();if("string"==typeof s)return">"===e[0]||"<"===e[0]?(n=e.substr(1),"="===e[1]?(i=!0,n=e.substr(2)):t=[],">"===e[0]?t.push(1):t.push(-1)):"="===e[0]?n=e.substr(1):"~"===e[0]&&(i=!0,n=e.substr(1)),t.indexOf(Ac.compareVersions(s,n,i))>-1}isOS(e){return this.getOSName(!0)===String(e).toLowerCase()}isPlatform(e){return this.getPlatformType(!0)===String(e).toLowerCase()}isEngine(e){return this.getEngineName(!0)===String(e).toLowerCase()}is(e,t=!1){return this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)}some(e=[]){return e.some((e=>this.is(e)))}}
93
93
  /*!
94
94
  * Bowser - a browser detector
95
95
  * https://github.com/lancedikson/bowser
96
96
  * MIT License | (c) Dustin Diaz 2012-2015
97
97
  * MIT License | (c) Denis Demchenko 2015-2019
98
- */var $c=en(Object.freeze({__proto__:null,default:class{static getParser(e,t=!1){if("string"!=typeof e)throw new Error("UserAgent should be a string");return new qc(e,t)}static parse(e){return new qc(e).getResult()}static get BROWSER_MAP(){return jc}static get ENGINE_MAP(){return Lc}static get OS_MAP(){return Mc}static get PLATFORMS_MAP(){return Ic}}})),Vc={},Hc=Xt&&Xt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Vc,"__esModule",{value:!0}),Vc.Logger=void 0;const Wc=Hc(gc),Gc="mediasoup-client";Vc.Logger=class{constructor(e){e?(this._debug=(0,Wc.default)(`${Gc}:${e}`),this._warn=(0,Wc.default)(`${Gc}:WARN:${e}`),this._error=(0,Wc.default)(`${Gc}:ERROR:${e}`)):(this._debug=(0,Wc.default)(Gc),this._warn=(0,Wc.default)(`${Gc}:WARN`),this._error=(0,Wc.default)(`${Gc}: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 Kc={};Object.defineProperty(Kc,"__esModule",{value:!0}),Kc.EnhancedEventEmitter=void 0;const Jc=d,Qc=new Vc.Logger("EnhancedEventEmitter");class Yc extends Jc.EventEmitter{constructor(){super(),this.setMaxListeners(1/0)}emit(e,...t){return super.emit(e,...t)}safeEmit(e,...t){const n=super.listenerCount(e);try{return super.emit(e,...t)}catch(t){return Qc.error("safeEmit() | event listener threw an error [eventName:%s]:%o",e,t),Boolean(n)}}on(e,t){return super.on(e,t),this}off(e,t){return super.off(e,t),this}addListener(e,t){return super.on(e,t),this}prependListener(e,t){return super.prependListener(e,t),this}once(e,t){return super.once(e,t),this}prependOnceListener(e,t){return super.prependOnceListener(e,t),this}removeListener(e,t){return super.off(e,t),this}removeAllListeners(e){return super.removeAllListeners(e),this}listenerCount(e){return super.listenerCount(e)}listeners(e){return super.listeners(e)}rawListeners(e){return super.rawListeners(e)}}Kc.EnhancedEventEmitter=Yc;var Xc={};Object.defineProperty(Xc,"__esModule",{value:!0}),Xc.InvalidStateError=Xc.UnsupportedError=void 0;class Zc extends Error{constructor(e){super(e),this.name="UnsupportedError",Error.hasOwnProperty("captureStackTrace")?Error.captureStackTrace(this,Zc):this.stack=new Error(e).stack}}Xc.UnsupportedError=Zc;class ep extends Error{constructor(e){super(e),this.name="InvalidStateError",Error.hasOwnProperty("captureStackTrace")?Error.captureStackTrace(this,ep):this.stack=new Error(e).stack}}Xc.InvalidStateError=ep;var tp={};Object.defineProperty(tp,"__esModule",{value:!0}),tp.generateRandomNumber=tp.clone=void 0,tp.clone=function(e,t){return void 0===e?t:JSON.parse(JSON.stringify(e))},tp.generateRandomNumber=function(){return Math.round(1e7*Math.random())};var np={},ip={};!function(e){const t=gc("h264-profile-level-id");t.log=console.info.bind(console);e.ProfileConstrainedBaseline=1,e.ProfileBaseline=2,e.ProfileMain=3,e.ProfileConstrainedHigh=4,e.ProfileHigh=5;const n=10;e.Level1_b=0,e.Level1=10,e.Level1_1=11,e.Level1_2=12,e.Level1_3=13,e.Level2=20,e.Level2_1=21,e.Level2_2=22,e.Level3=30,e.Level3_1=31,e.Level3_2=32,e.Level4=40,e.Level4_1=41,e.Level4_2=42,e.Level5=50,e.Level5_1=51,e.Level5_2=52;class i{constructor(e,t){this.profile=e,this.level=t}}e.ProfileLevelId=i;const s=new i(1,31);class r{constructor(e){this._mask=~c("x",e),this._maskedValue=c("1",e)}isMatch(e){return this._maskedValue===(e&this._mask)}}class a{constructor(e,t,n){this.profile_idc=e,this.profile_iop=t,this.profile=n}}const o=[new a(66,new r("x1xx0000"),1),new a(77,new r("1xxx0000"),1),new a(88,new r("11xx0000"),1),new a(66,new r("x0xx0000"),2),new a(88,new r("10xx0000"),2),new a(77,new r("0x0x0000"),3),new a(100,new r("00000000"),5),new a(100,new r("00001100"),4)];function c(e,t){return(t[0]===e)<<7|(t[1]===e)<<6|(t[2]===e)<<5|(t[3]===e)<<4|(t[4]===e)<<3|(t[5]===e)<<2|(t[6]===e)<<1|(t[7]===e)<<0}function p(e={}){const t=e["level-asymmetry-allowed"];return 1===t||"1"===t}e.parseProfileLevelId=function(e){if("string"!=typeof e||6!==e.length)return null;const n=parseInt(e,16);if(0===n)return null;const s=255&n,r=n>>8&255,a=n>>16&255;let c;switch(s){case 11:c=0!=(16&r)?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:c=s;break;default:return t("parseProfileLevelId() | unrecognized level_idc:%s",s),null}for(const e of o)if(a===e.profile_idc&&e.profile_iop.isMatch(r))return new i(e.profile,c);return t("parseProfileLevelId() | unrecognized profile_idc/profile_iop combination"),null},e.profileLevelIdToString=function(e){if(0==e.level)switch(e.profile){case 1:return"42f00b";case 2:return"42100b";case 3:return"4d100b";default:return t("profileLevelIdToString() | Level 1_b not is allowed for profile:%s",e.profile),null}let n;switch(e.profile){case 1:n="42e0";break;case 2:n="4200";break;case 3:n="4d00";break;case 4:n="640c";break;case 5:n="6400";break;default:return t("profileLevelIdToString() | unrecognized profile:%s",e.profile),null}let i=e.level.toString(16);return 1===i.length&&(i=`0${i}`),`${n}${i}`},e.parseSdpProfileLevelId=function(t={}){const n=t["profile-level-id"];return n?e.parseProfileLevelId(n):s},e.isSameProfile=function(t={},n={}){const i=e.parseSdpProfileLevelId(t),s=e.parseSdpProfileLevelId(n);return Boolean(i&&s&&i.profile===s.profile)},e.generateProfileLevelIdForAnswer=function(s={},r={}){if(!s["profile-level-id"]&&!r["profile-level-id"])return t("generateProfileLevelIdForAnswer() | no profile-level-id in local and remote params"),null;const a=e.parseSdpProfileLevelId(s),o=e.parseSdpProfileLevelId(r);if(!a)throw new TypeError("invalid local_profile_level_id");if(!o)throw new TypeError("invalid remote_profile_level_id");if(a.profile!==o.profile)throw new TypeError("H264 Profile mismatch");const c=p(s)&&p(r),d=a.level,l=o.level,u=function(e,t){return 0===e?t!==n&&0!==t:0===t?e!==n:e<t}(m=d,h=l)?m:h;var m,h;const f=c?d:u;return t("generateProfileLevelIdForAnswer() | result: [profile:%s, level:%s]",a.profile,f),e.profileLevelIdToString(new i(a.profile,f))}}(ip);var sp=Xt&&Xt.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),rp=Xt&&Xt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),ap=Xt&&Xt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&sp(t,e,n);return rp(t,e),t};Object.defineProperty(np,"__esModule",{value:!0}),np.canReceive=np.canSend=np.generateProbatorRtpParameters=np.reduceCodecs=np.getSendingRemoteRtpParameters=np.getSendingRtpParameters=np.getRecvRtpCapabilities=np.getExtendedRtpCapabilities=np.validateSctpStreamParameters=np.validateSctpParameters=np.validateNumSctpStreams=np.validateSctpCapabilities=np.validateRtcpParameters=np.validateRtpEncodingParameters=np.validateRtpHeaderExtensionParameters=np.validateRtpCodecParameters=np.validateRtpParameters=np.validateRtpHeaderExtension=np.validateRtcpFeedback=np.validateRtpCodecCapability=np.validateRtpCapabilities=void 0;const op=ap(ip),cp=ap(tp);function pp(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 n=t.exec(e.mimeType);if(!n)throw new TypeError("invalid codec.mimeType");if(e.kind=n[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 n=e.parameters[t];if(void 0===n&&(e.parameters[t]="",n=""),"string"!=typeof n&&"number"!=typeof n)throw new TypeError(`invalid codec parameter [key:${t}s, value:${n}]`);if("apt"===t&&"number"!=typeof n)throw new TypeError("invalid codec apt parameter")}e.rtcpFeedback&&Array.isArray(e.rtcpFeedback)||(e.rtcpFeedback=[]);for(const t of e.rtcpFeedback)dp(t)}function dp(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 lp(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 up(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)mp(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)hp(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)fp(t);if(e.rtcp&&"object"!=typeof e.rtcp)throw new TypeError("params.rtcp is not an object");e.rtcp||(e.rtcp={}),gp(e.rtcp)}function mp(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 n=t.exec(e.mimeType);if(!n)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"===n[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 n=e.parameters[t];if(void 0===n&&(e.parameters[t]="",n=""),"string"!=typeof n&&"number"!=typeof n)throw new TypeError(`invalid codec parameter [key:${t}s, value:${n}]`);if("apt"===t&&"number"!=typeof n)throw new TypeError("invalid codec apt parameter")}e.rtcpFeedback&&Array.isArray(e.rtcpFeedback)||(e.rtcpFeedback=[]);for(const t of e.rtcpFeedback)dp(t)}function hp(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 n=e.parameters[t];if(void 0===n&&(e.parameters[t]="",n=""),"string"!=typeof n&&"number"!=typeof n)throw new TypeError("invalid header extension parameter")}}function fp(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 gp(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 vp(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 bp(e){return!!e&&/.+\/rtx$/i.test(e.mimeType)}function yp(e,t,{strict:n=!1,modify:i=!1}={}){const s=e.mimeType.toLowerCase();if(s!==t.mimeType.toLowerCase())return!1;if(e.clockRate!==t.clockRate)return!1;if(e.channels!==t.channels)return!1;switch(s){case"video/h264":if(n){if((e.parameters["packetization-mode"]||0)!==(t.parameters["packetization-mode"]||0))return!1;if(!op.isSameProfile(e.parameters,t.parameters))return!1;let n;try{n=op.generateProfileLevelIdForAnswer(e.parameters,t.parameters)}catch(e){return!1}i&&(n?(e.parameters["profile-level-id"]=n,t.parameters["profile-level-id"]=n):(delete e.parameters["profile-level-id"],delete t.parameters["profile-level-id"]))}break;case"video/vp9":if(n){if((e.parameters["profile-id"]||0)!==(t.parameters["profile-id"]||0))return!1}}return!0}function _p(e,t){return(!e.kind||!t.kind||e.kind===t.kind)&&e.uri===t.uri}function xp(e,t){const n=[];for(const i of e.rtcpFeedback||[]){const e=(t.rtcpFeedback||[]).find((e=>e.type===i.type&&(e.parameter===i.parameter||!e.parameter&&!i.parameter)));e&&n.push(e)}return n}np.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)pp(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)lp(t)},np.validateRtpCodecCapability=pp,np.validateRtcpFeedback=dp,np.validateRtpHeaderExtension=lp,np.validateRtpParameters=up,np.validateRtpCodecParameters=mp,np.validateRtpHeaderExtensionParameters=hp,np.validateRtpEncodingParameters=fp,np.validateRtcpParameters=gp,np.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");vp(e.numStreams)},np.validateNumSctpStreams=vp,np.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")},np.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")},np.getExtendedRtpCapabilities=function(e,t){const n={codecs:[],headerExtensions:[]};for(const i of t.codecs||[]){if(bp(i))continue;const t=(e.codecs||[]).find((e=>yp(e,i,{strict:!0,modify:!0})));if(!t)continue;const s={mimeType:t.mimeType,kind:t.kind,clockRate:t.clockRate,channels:t.channels,localPayloadType:t.preferredPayloadType,localRtxPayloadType:void 0,remotePayloadType:i.preferredPayloadType,remoteRtxPayloadType:void 0,localParameters:t.parameters,remoteParameters:i.parameters,rtcpFeedback:xp(t,i)};n.codecs.push(s)}for(const i of n.codecs){const n=e.codecs.find((e=>bp(e)&&e.parameters.apt===i.localPayloadType)),s=t.codecs.find((e=>bp(e)&&e.parameters.apt===i.remotePayloadType));n&&s&&(i.localRtxPayloadType=n.preferredPayloadType,i.remoteRtxPayloadType=s.preferredPayloadType)}for(const i of t.headerExtensions){const t=e.headerExtensions.find((e=>_p(e,i)));if(!t)continue;const s={kind:i.kind,uri:i.uri,sendId:t.preferredId,recvId:i.preferredId,encrypt:t.preferredEncrypt,direction:"sendrecv"};switch(i.direction){case"sendrecv":s.direction="sendrecv";break;case"recvonly":s.direction="sendonly";break;case"sendonly":s.direction="recvonly";break;case"inactive":s.direction="inactive"}n.headerExtensions.push(s)}return n},np.getRecvRtpCapabilities=function(e){const t={codecs:[],headerExtensions:[]};for(const n of e.codecs){const e={mimeType:n.mimeType,kind:n.kind,preferredPayloadType:n.remotePayloadType,clockRate:n.clockRate,channels:n.channels,parameters:n.localParameters,rtcpFeedback:n.rtcpFeedback};if(t.codecs.push(e),!n.remoteRtxPayloadType)continue;const i={mimeType:`${n.kind}/rtx`,kind:n.kind,preferredPayloadType:n.remoteRtxPayloadType,clockRate:n.clockRate,parameters:{apt:n.remotePayloadType},rtcpFeedback:[]};t.codecs.push(i)}for(const n of e.headerExtensions){if("sendrecv"!==n.direction&&"recvonly"!==n.direction)continue;const e={kind:n.kind,uri:n.uri,preferredId:n.recvId,preferredEncrypt:n.encrypt,direction:n.direction};t.headerExtensions.push(e)}return t},np.getSendingRtpParameters=function(e,t){const n={mid:void 0,codecs:[],headerExtensions:[],encodings:[],rtcp:{}};for(const i of t.codecs){if(i.kind!==e)continue;const t={mimeType:i.mimeType,payloadType:i.localPayloadType,clockRate:i.clockRate,channels:i.channels,parameters:i.localParameters,rtcpFeedback:i.rtcpFeedback};if(n.codecs.push(t),i.localRtxPayloadType){const e={mimeType:`${i.kind}/rtx`,payloadType:i.localRtxPayloadType,clockRate:i.clockRate,parameters:{apt:i.localPayloadType},rtcpFeedback:[]};n.codecs.push(e)}}for(const i of t.headerExtensions){if(i.kind&&i.kind!==e||"sendrecv"!==i.direction&&"sendonly"!==i.direction)continue;const t={uri:i.uri,id:i.sendId,encrypt:i.encrypt,parameters:{}};n.headerExtensions.push(t)}return n},np.getSendingRemoteRtpParameters=function(e,t){const n={mid:void 0,codecs:[],headerExtensions:[],encodings:[],rtcp:{}};for(const i of t.codecs){if(i.kind!==e)continue;const t={mimeType:i.mimeType,payloadType:i.localPayloadType,clockRate:i.clockRate,channels:i.channels,parameters:i.remoteParameters,rtcpFeedback:i.rtcpFeedback};if(n.codecs.push(t),i.localRtxPayloadType){const e={mimeType:`${i.kind}/rtx`,payloadType:i.localRtxPayloadType,clockRate:i.clockRate,parameters:{apt:i.localPayloadType},rtcpFeedback:[]};n.codecs.push(e)}}for(const i of t.headerExtensions){if(i.kind&&i.kind!==e||"sendrecv"!==i.direction&&"sendonly"!==i.direction)continue;const t={uri:i.uri,id:i.sendId,encrypt:i.encrypt,parameters:{}};n.headerExtensions.push(t)}if(n.headerExtensions.some((e=>"http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01"===e.uri)))for(const e of n.codecs)e.rtcpFeedback=(e.rtcpFeedback||[]).filter((e=>"goog-remb"!==e.type));else if(n.headerExtensions.some((e=>"http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time"===e.uri)))for(const e of n.codecs)e.rtcpFeedback=(e.rtcpFeedback||[]).filter((e=>"transport-cc"!==e.type));else for(const e of n.codecs)e.rtcpFeedback=(e.rtcpFeedback||[]).filter((e=>"transport-cc"!==e.type&&"goog-remb"!==e.type));return n},np.reduceCodecs=function(e,t){const n=[];if(t){for(let i=0;i<e.length;++i)if(yp(e[i],t)){n.push(e[i]),bp(e[i+1])&&n.push(e[i+1]);break}if(0===n.length)throw new TypeError("no matching codec found")}else n.push(e[0]),bp(e[1])&&n.push(e[1]);return n},np.generateProbatorRtpParameters=function(e){up(e=cp.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},np.canSend=function(e,t){return t.codecs.some((t=>t.kind===e))},np.canReceive=function(e,t){if(up(e),0===e.codecs.length)return!1;const n=e.codecs[0];return t.codecs.some((e=>e.remotePayloadType===n.payloadType))};var wp={},Sp={},kp={},Cp=Xt&&Xt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(kp,"__esModule",{value:!0}),kp.Logger=void 0;const Rp=Cp(gc),Tp="awaitqueue";kp.Logger=class{constructor(e){e?(this._debug=(0,Rp.default)(`awaitqueue:${e}`),this._warn=(0,Rp.default)(`awaitqueue:WARN:${e}`),this._error=(0,Rp.default)(`awaitqueue:ERROR:${e}`)):(this._debug=(0,Rp.default)(Tp),this._warn=(0,Rp.default)("awaitqueue:WARN"),this._error=(0,Rp.default)("awaitqueue: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}},Object.defineProperty(Sp,"__esModule",{value:!0}),Sp.AwaitQueue=Sp.AwaitQueueRemovedTaskError=Sp.AwaitQueueStoppedError=void 0;const Pp=new kp.Logger;class Ep extends Error{constructor(e){super(null!=e?e:"AwaitQueue stopped"),this.name="AwaitQueueStoppedError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,Ep)}}Sp.AwaitQueueStoppedError=Ep;class Op extends Error{constructor(e){super(null!=e?e:"AwaitQueue task removed"),this.name="AwaitQueueRemovedTaskError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,Op)}}Sp.AwaitQueueRemovedTaskError=Op;Sp.AwaitQueue=class{constructor(){this.pendingTasks=new Map,this.nextTaskId=0,this.stopping=!1}get size(){return this.pendingTasks.size}async push(e,t){if(t=null!=t?t:e.name,Pp.debug(`push() [name:${t}]`),"function"!=typeof e)throw new TypeError("given task is not a function");if(t)try{Object.defineProperty(e,"name",{value:t})}catch(e){}return new Promise(((n,i)=>{const s={id:this.nextTaskId++,task:e,name:t,enqueuedAt:Date.now(),executedAt:void 0,completed:!1,resolve:e=>{if(s.completed)return;s.completed=!0,this.pendingTasks.delete(s.id),Pp.debug(`resolving task [name:${s.name}]`),n(e);const[t]=this.pendingTasks.values();t&&!t.executedAt&&this.execute(t)},reject:e=>{if(!s.completed&&(s.completed=!0,this.pendingTasks.delete(s.id),Pp.debug(`rejecting task [name:${s.name}]: %s`,String(e)),i(e),!this.stopping)){const[e]=this.pendingTasks.values();e&&!e.executedAt&&this.execute(e)}}};this.pendingTasks.set(s.id,s),1===this.pendingTasks.size&&this.execute(s)}))}stop(){Pp.debug("stop()"),this.stopping=!0;for(const e of this.pendingTasks.values())Pp.debug(`stop() | stopping task [name:${e.name}]`),e.reject(new Ep);this.stopping=!1}remove(e){Pp.debug(`remove() [taskIdx:${e}]`);const t=Array.from(this.pendingTasks.values())[e];t?t.reject(new Op):Pp.debug(`stop() | no task with given idx [taskIdx:${e}]`)}dump(){const e=Date.now();let t=0;return Array.from(this.pendingTasks.values()).map((n=>({idx:t++,task:n.task,name:n.name,enqueuedTime:n.executedAt?n.executedAt-n.enqueuedAt:e-n.enqueuedAt,executionTime:n.executedAt?e-n.executedAt:0})))}async execute(e){if(Pp.debug(`execute() [name:${e.name}]`),e.executedAt)throw new Error("task already being executed");e.executedAt=Date.now();try{const t=await e.task();e.resolve(t)}catch(t){e.reject(t)}}};var Dp={};Object.defineProperty(Dp,"__esModule",{value:!0}),Dp.Producer=void 0;const jp=Kc,Ip=Xc,Mp=new Vc.Logger("Producer");class Lp extends jp.EnhancedEventEmitter{constructor({id:e,localId:t,rtpSender:n,track:i,rtpParameters:s,stopTracks:r,disableTrackOnPause:a,zeroRtpOnPause:o,appData:c}){super(),this._closed=!1,this._observer=new jp.EnhancedEventEmitter,Mp.debug("constructor()"),this._id=e,this._localId=t,this._rtpSender=n,this._track=i,this._kind=i.kind,this._rtpParameters=s,this._paused=!!a&&!i.enabled,this._maxSpatialLayer=void 0,this._stopTracks=r,this._disableTrackOnPause=a,this._zeroRtpOnPause=o,this._appData=c||{},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||(Mp.debug("close()"),this._closed=!0,this.destroyTrack(),this.emit("@close"),this._observer.safeEmit("close"))}transportClosed(){this._closed||(Mp.debug("transportClosed()"),this._closed=!0,this.destroyTrack(),this.safeEmit("transportclose"),this._observer.safeEmit("close"))}async getStats(){if(this._closed)throw new Ip.InvalidStateError("closed");return new Promise(((e,t)=>{this.safeEmit("@getstats",e,t)}))}pause(){Mp.debug("pause()"),this._closed?Mp.error("pause() | Producer closed"):(this._paused=!0,this._track&&this._disableTrackOnPause&&(this._track.enabled=!1),this._zeroRtpOnPause&&new Promise(((e,t)=>{this.safeEmit("@pause",e,t)})).catch((()=>{})),this._observer.safeEmit("pause"))}resume(){Mp.debug("resume()"),this._closed?Mp.error("resume() | Producer closed"):(this._paused=!1,this._track&&this._disableTrackOnPause&&(this._track.enabled=!0),this._zeroRtpOnPause&&new Promise(((e,t)=>{this.safeEmit("@resume",e,t)})).catch((()=>{})),this._observer.safeEmit("resume"))}async replaceTrack({track:e}){if(Mp.debug("replaceTrack() [track:%o]",e),this._closed){if(e&&this._stopTracks)try{e.stop()}catch(e){}throw new Ip.InvalidStateError("closed")}if(e&&"ended"===e.readyState)throw new Ip.InvalidStateError("track ended");e!==this._track?(await new Promise(((t,n)=>{this.safeEmit("@replacetrack",e,t,n)})),this.destroyTrack(),this._track=e,this._track&&this._disableTrackOnPause&&(this._paused?this._paused&&(this._track.enabled=!1):this._track.enabled=!0),this.handleTrack()):Mp.debug("replaceTrack() | same track, ignored")}async setMaxSpatialLayer(e){if(this._closed)throw new Ip.InvalidStateError("closed");if("video"!==this._kind)throw new Ip.UnsupportedError("not a video Producer");if("number"!=typeof e)throw new TypeError("invalid spatialLayer");e!==this._maxSpatialLayer&&(await new Promise(((t,n)=>{this.safeEmit("@setmaxspatiallayer",e,t,n)})).catch((()=>{})),this._maxSpatialLayer=e)}async setRtpEncodingParameters(e){if(this._closed)throw new Ip.InvalidStateError("closed");if("object"!=typeof e)throw new TypeError("invalid params");await new Promise(((t,n)=>{this.safeEmit("@setrtpencodingparameters",e,t,n)}))}onTrackEnded(){Mp.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){}}}Dp.Producer=Lp;var Ap={};Object.defineProperty(Ap,"__esModule",{value:!0}),Ap.Consumer=void 0;const Np=Kc,Bp=Xc,Fp=new Vc.Logger("Consumer");class Up extends Np.EnhancedEventEmitter{constructor({id:e,localId:t,producerId:n,rtpReceiver:i,track:s,rtpParameters:r,appData:a}){super(),this._closed=!1,this._observer=new Np.EnhancedEventEmitter,Fp.debug("constructor()"),this._id=e,this._localId=t,this._producerId=n,this._rtpReceiver=i,this._track=s,this._rtpParameters=r,this._paused=!s.enabled,this._appData=a||{},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||(Fp.debug("close()"),this._closed=!0,this.destroyTrack(),this.emit("@close"),this._observer.safeEmit("close"))}transportClosed(){this._closed||(Fp.debug("transportClosed()"),this._closed=!0,this.destroyTrack(),this.safeEmit("transportclose"),this._observer.safeEmit("close"))}async getStats(){if(this._closed)throw new Bp.InvalidStateError("closed");return new Promise(((e,t)=>{this.safeEmit("@getstats",e,t)}))}pause(){Fp.debug("pause()"),this._closed?Fp.error("pause() | Consumer closed"):this._paused?Fp.debug("pause() | Consumer is already paused"):(this._paused=!0,this._track.enabled=!1,this.emit("@pause"),this._observer.safeEmit("pause"))}resume(){Fp.debug("resume()"),this._closed?Fp.error("resume() | Consumer closed"):this._paused?(this._paused=!1,this._track.enabled=!0,this.emit("@resume"),this._observer.safeEmit("resume")):Fp.debug("resume() | Consumer is already resumed")}onTrackEnded(){Fp.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){}}}Ap.Consumer=Up;var zp={};Object.defineProperty(zp,"__esModule",{value:!0}),zp.DataProducer=void 0;const qp=Kc,$p=Xc,Vp=new Vc.Logger("DataProducer");class Hp extends qp.EnhancedEventEmitter{constructor({id:e,dataChannel:t,sctpStreamParameters:n,appData:i}){super(),this._closed=!1,this._observer=new qp.EnhancedEventEmitter,Vp.debug("constructor()"),this._id=e,this._dataChannel=t,this._sctpStreamParameters=n,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||(Vp.debug("close()"),this._closed=!0,this._dataChannel.close(),this.emit("@close"),this._observer.safeEmit("close"))}transportClosed(){this._closed||(Vp.debug("transportClosed()"),this._closed=!0,this._dataChannel.close(),this.safeEmit("transportclose"),this._observer.safeEmit("close"))}send(e){if(Vp.debug("send()"),this._closed)throw new $p.InvalidStateError("closed");this._dataChannel.send(e)}handleDataChannel(){this._dataChannel.addEventListener("open",(()=>{this._closed||(Vp.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?Vp.error("DataChannel SCTP error [sctpCauseCode:%s]: %s",t.sctpCauseCode,t.message):Vp.error('DataChannel "error" event: %o',t),this.safeEmit("error",t)})),this._dataChannel.addEventListener("close",(()=>{this._closed||(Vp.warn('DataChannel "close" event'),this._closed=!0,this.emit("@close"),this.safeEmit("close"),this._observer.safeEmit("close"))})),this._dataChannel.addEventListener("message",(()=>{this._closed||Vp.warn('DataChannel "message" event in a DataProducer, message discarded')})),this._dataChannel.addEventListener("bufferedamountlow",(()=>{this._closed||this.safeEmit("bufferedamountlow")}))}}zp.DataProducer=Hp;var Wp={};Object.defineProperty(Wp,"__esModule",{value:!0}),Wp.DataConsumer=void 0;const Gp=Kc,Kp=new Vc.Logger("DataConsumer");class Jp extends Gp.EnhancedEventEmitter{constructor({id:e,dataProducerId:t,dataChannel:n,sctpStreamParameters:i,appData:s}){super(),this._closed=!1,this._observer=new Gp.EnhancedEventEmitter,Kp.debug("constructor()"),this._id=e,this._dataProducerId=t,this._dataChannel=n,this._sctpStreamParameters=i,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||(Kp.debug("close()"),this._closed=!0,this._dataChannel.close(),this.emit("@close"),this._observer.safeEmit("close"))}transportClosed(){this._closed||(Kp.debug("transportClosed()"),this._closed=!0,this._dataChannel.close(),this.safeEmit("transportclose"),this._observer.safeEmit("close"))}handleDataChannel(){this._dataChannel.addEventListener("open",(()=>{this._closed||(Kp.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?Kp.error("DataChannel SCTP error [sctpCauseCode:%s]: %s",t.sctpCauseCode,t.message):Kp.error('DataChannel "error" event: %o',t),this.safeEmit("error",t)})),this._dataChannel.addEventListener("close",(()=>{this._closed||(Kp.warn('DataChannel "close" event'),this._closed=!0,this.emit("@close"),this.safeEmit("close"),this._observer.safeEmit("close"))})),this._dataChannel.addEventListener("message",(e=>{this._closed||this.safeEmit("message",e.data)}))}}Wp.DataConsumer=Jp;var Qp=Xt&&Xt.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),Yp=Xt&&Xt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Xp=Xt&&Xt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&Qp(t,e,n);return Yp(t,e),t};Object.defineProperty(wp,"__esModule",{value:!0}),wp.Transport=void 0;const Zp=Sp,ed=Vc,td=Kc,nd=Xc,id=Xp(tp),sd=Xp(np),rd=Dp,ad=Ap,od=zp,cd=Wp,pd=new ed.Logger("Transport");class dd{constructor(e){this.consumerOptions=e,this.promise=new Promise(((e,t)=>{this.resolve=e,this.reject=t}))}}class ld extends td.EnhancedEventEmitter{constructor({direction:e,id:t,iceParameters:n,iceCandidates:i,dtlsParameters:s,sctpParameters:r,iceServers:a,iceTransportPolicy:o,additionalSettings:c,proprietaryConstraints:p,appData:d,handlerFactory:l,extendedRtpCapabilities:u,canProduceByKind:m}){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 Zp.AwaitQueue,this._pendingConsumerTasks=[],this._consumerCreationInProgress=!1,this._pendingPauseConsumers=new Map,this._consumerPauseInProgress=!1,this._pendingResumeConsumers=new Map,this._consumerResumeInProgress=!1,this._pendingCloseConsumers=new Map,this._consumerCloseInProgress=!1,this._observer=new td.EnhancedEventEmitter,pd.debug("constructor() [id:%s, direction:%s]",t,e),this._id=t,this._direction=e,this._extendedRtpCapabilities=u,this._canProduceByKind=m,this._maxSctpMessageSize=r?r.maxMessageSize:null,delete(c=id.clone(c,{})).iceServers,delete c.iceTransportPolicy,delete c.bundlePolicy,delete c.rtcpMuxPolicy,delete c.sdpSemantics,this._handler=l(),this._handler.run({direction:e,iceParameters:n,iceCandidates:i,dtlsParameters:s,sctpParameters:r,iceServers:a,iceTransportPolicy:o,additionalSettings:c,proprietaryConstraints:p,extendedRtpCapabilities:u}),this._appData=d||{},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){pd.debug("close()"),this._closed=!0,this._awaitQueue.stop(),this._handler.close();for(const e of this._producers.values())e.transportClosed();this._producers.clear();for(const e of this._consumers.values())e.transportClosed();this._consumers.clear();for(const e of this._dataProducers.values())e.transportClosed();this._dataProducers.clear();for(const e of this._dataConsumers.values())e.transportClosed();this._dataConsumers.clear(),this._observer.safeEmit("close")}}async getStats(){if(this._closed)throw new nd.InvalidStateError("closed");return this._handler.getTransportStats()}async restartIce({iceParameters:e}){if(pd.debug("restartIce()"),this._closed)throw new nd.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(pd.debug("updateIceServers()"),this._closed)throw new nd.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:n,codec:i,stopTracks:s=!0,disableTrackOnPause:r=!0,zeroRtpOnPause:a=!1,appData:o={}}={}){if(pd.debug("produce() [track:%o]",e),this._closed)throw new nd.InvalidStateError("closed");if(!e)throw new TypeError("missing track");if("send"!==this._direction)throw new nd.UnsupportedError("not a sending Transport");if(!this._canProduceByKind[e.kind])throw new nd.UnsupportedError(`cannot produce ${e.kind}`);if("ended"===e.readyState)throw new nd.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:p,rtpParameters:d,rtpSender:l}=await this._handler.send({track:e,encodings:c,codecOptions:n,codec:i});try{sd.validateRtpParameters(d);const{id:t}=await new Promise(((t,n)=>{this.safeEmit("produce",{kind:e.kind,rtpParameters:d,appData:o},t,n)})),n=new rd.Producer({id:t,localId:p,rtpSender:l,track:e,rtpParameters:d,stopTracks:s,disableTrackOnPause:r,zeroRtpOnPause:a,appData:o});return this._producers.set(n.id,n),this.handleProducer(n),this._observer.safeEmit("newproducer",n),n}catch(e){throw this._handler.stopSending(p).catch((()=>{})),e}}),"transport.produce()").catch((t=>{if(s)try{e.stop()}catch(e){}throw t}))}async consume({id:e,producerId:t,kind:n,rtpParameters:i,streamId:s,appData:r={}}){if(pd.debug("consume()"),i=id.clone(i,void 0),this._closed)throw new nd.InvalidStateError("closed");if("recv"!==this._direction)throw new nd.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"!==n&&"video"!==n)throw new TypeError(`invalid kind '${n}'`);if(0===this.listenerCount("connect")&&"new"===this._connectionState)throw new TypeError('no "connect" listener set into this transport');if(r&&"object"!=typeof r)throw new TypeError("if given, appData must be an object");if(!sd.canReceive(i,this._extendedRtpCapabilities))throw new nd.UnsupportedError("cannot consume this Producer");const a=new dd({id:e,producerId:t,kind:n,rtpParameters:i,streamId:s,appData:r});return this._pendingConsumerTasks.push(a),!1===this._consumerCreationInProgress&&this.createPendingConsumers(),a.promise}async produceData({ordered:e=!0,maxPacketLifeTime:t,maxRetransmits:n,label:i="",protocol:s="",appData:r={}}={}){if(pd.debug("produceData()"),this._closed)throw new nd.InvalidStateError("closed");if("send"!==this._direction)throw new nd.UnsupportedError("not a sending Transport");if(!this._maxSctpMessageSize)throw new nd.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(r&&"object"!=typeof r)throw new TypeError("if given, appData must be an object");return(t||n)&&(e=!1),this._awaitQueue.push((async()=>{const{dataChannel:a,sctpStreamParameters:o}=await this._handler.sendDataChannel({ordered:e,maxPacketLifeTime:t,maxRetransmits:n,label:i,protocol:s});sd.validateSctpStreamParameters(o);const{id:c}=await new Promise(((e,t)=>{this.safeEmit("producedata",{sctpStreamParameters:o,label:i,protocol:s,appData:r},e,t)})),p=new od.DataProducer({id:c,dataChannel:a,sctpStreamParameters:o,appData:r});return this._dataProducers.set(p.id,p),this.handleDataProducer(p),this._observer.safeEmit("newdataproducer",p),p}),"transport.produceData()")}async consumeData({id:e,dataProducerId:t,sctpStreamParameters:n,label:i="",protocol:s="",appData:r={}}){if(pd.debug("consumeData()"),n=id.clone(n,void 0),this._closed)throw new nd.InvalidStateError("closed");if("recv"!==this._direction)throw new nd.UnsupportedError("not a receiving Transport");if(!this._maxSctpMessageSize)throw new nd.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(r&&"object"!=typeof r)throw new TypeError("if given, appData must be an object");return sd.validateSctpStreamParameters(n),this._awaitQueue.push((async()=>{const{dataChannel:a}=await this._handler.receiveDataChannel({sctpStreamParameters:n,label:i,protocol:s}),o=new cd.DataConsumer({id:e,dataProducerId:t,dataChannel:a,sctpStreamParameters:n,appData:r});return this._dataConsumers.set(o.id,o),this.handleDataConsumer(o),this._observer.safeEmit("newdataconsumer",o),o}),"transport.consumeData()")}async createPendingConsumers(){this._consumerCreationInProgress=!0,this._awaitQueue.push((async()=>{if(0===this._pendingConsumerTasks.length)return void pd.debug("createPendingConsumers() | there is no Consumer to be created");const e=[...this._pendingConsumerTasks];let t;this._pendingConsumerTasks=[];const n=[];for(const t of e){const{id:e,kind:i,rtpParameters:s,streamId:r}=t.consumerOptions;n.push({trackId:e,kind:i,rtpParameters:s,streamId:r})}try{const i=await this._handler.receive(n);for(let n=0;n<i.length;n++){const s=e[n],r=i[n],{id:a,producerId:o,kind:c,rtpParameters:p,appData:d}=s.consumerOptions,{localId:l,rtpReceiver:u,track:m}=r,h=new ad.Consumer({id:a,localId:l,producerId:o,rtpReceiver:u,track:m,rtpParameters:p,appData:d});this._consumers.set(h.id,h),this.handleConsumer(h),this._probatorConsumerCreated||t||"video"!==c||(t=h),this._observer.safeEmit("newconsumer",h),s.resolve(h)}}catch(t){for(const n of e)n.reject(t)}if(t)try{const e=sd.generateProbatorRtpParameters(t.rtpParameters);await this._handler.receive([{trackId:"probator",kind:"video",rtpParameters:e}]),pd.debug("createPendingConsumers() | Consumer for RTP probation created"),this._probatorConsumerCreated=!0}catch(e){pd.error("createPendingConsumers() | failed to create Consumer for RTP probation:%o",e)}}),"transport.createPendingConsumers()").then((()=>{this._consumerCreationInProgress=!1,this._pendingConsumerTasks.length>0&&this.createPendingConsumers()})).catch((()=>{}))}pausePendingConsumers(){this._consumerPauseInProgress=!0,this._awaitQueue.push((async()=>{if(0===this._pendingPauseConsumers.size)return void pd.debug("pausePendingConsumers() | there is no Consumer to be paused");const e=Array.from(this._pendingPauseConsumers.values());this._pendingPauseConsumers.clear();try{const t=e.map((e=>e.localId));await this._handler.pauseReceiving(t)}catch(e){pd.error("pausePendingConsumers() | failed to pause Consumers:",e)}}),"transport.pausePendingConsumers").then((()=>{this._consumerPauseInProgress=!1,this._pendingPauseConsumers.size>0&&this.pausePendingConsumers()})).catch((()=>{}))}resumePendingConsumers(){this._consumerResumeInProgress=!0,this._awaitQueue.push((async()=>{if(0===this._pendingResumeConsumers.size)return void pd.debug("resumePendingConsumers() | there is no Consumer to be resumed");const e=Array.from(this._pendingResumeConsumers.values());this._pendingResumeConsumers.clear();try{const t=e.map((e=>e.localId));await this._handler.resumeReceiving(t)}catch(e){pd.error("resumePendingConsumers() | failed to resume Consumers:",e)}}),"transport.resumePendingConsumers").then((()=>{this._consumerResumeInProgress=!1,this._pendingResumeConsumers.size>0&&this.resumePendingConsumers()})).catch((()=>{}))}closePendingConsumers(){this._consumerCloseInProgress=!0,this._awaitQueue.push((async()=>{if(0===this._pendingCloseConsumers.size)return void pd.debug("closePendingConsumers() | there is no Consumer to be closed");const e=Array.from(this._pendingCloseConsumers.values());this._pendingCloseConsumers.clear();try{await this._handler.stopReceiving(e.map((e=>e.localId)))}catch(e){pd.error("closePendingConsumers() | failed to close Consumers:",e)}}),"transport.closePendingConsumers").then((()=>{this._consumerCloseInProgress=!1,this._pendingCloseConsumers.size>0&&this.closePendingConsumers()})).catch((()=>{}))}handleHandler(){const e=this._handler;e.on("@connect",(({dtlsParameters:e},t,n)=>{this._closed?n(new nd.InvalidStateError("closed")):this.safeEmit("connect",{dtlsParameters:e},t,n)})),e.on("@connectionstatechange",(e=>{e!==this._connectionState&&(pd.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=>pd.warn("producer.close() failed:%o",e)))})),e.on("@pause",((t,n)=>{this._awaitQueue.push((async()=>this._handler.pauseSending(e.localId)),"producer @pause event").then(t).catch(n)})),e.on("@resume",((t,n)=>{this._awaitQueue.push((async()=>this._handler.resumeSending(e.localId)),"producer @resume event").then(t).catch(n)})),e.on("@replacetrack",((t,n,i)=>{this._awaitQueue.push((async()=>this._handler.replaceTrack(e.localId,t)),"producer @replacetrack event").then(n).catch(i)})),e.on("@setmaxspatiallayer",((t,n,i)=>{this._awaitQueue.push((async()=>this._handler.setMaxSpatialLayer(e.localId,t)),"producer @setmaxspatiallayer event").then(n).catch(i)})),e.on("@setrtpencodingparameters",((t,n,i)=>{this._awaitQueue.push((async()=>this._handler.setRtpEncodingParameters(e.localId,t)),"producer @setrtpencodingparameters event").then(n).catch(i)})),e.on("@getstats",((t,n)=>{if(this._closed)return n(new nd.InvalidStateError("closed"));this._handler.getSenderStats(e.localId).then(t).catch(n)}))}handleConsumer(e){e.on("@close",(()=>{this._consumers.delete(e.id),this._pendingPauseConsumers.delete(e.id),this._pendingResumeConsumers.delete(e.id),this._closed||(this._pendingCloseConsumers.set(e.id,e),!1===this._consumerCloseInProgress&&this.closePendingConsumers())})),e.on("@pause",(()=>{this._pendingResumeConsumers.has(e.id)&&this._pendingResumeConsumers.delete(e.id),this._pendingPauseConsumers.set(e.id,e),!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,n)=>{if(this._closed)return n(new nd.InvalidStateError("closed"));this._handler.getReceiverStats(e.localId).then(t).catch(n)}))}handleDataProducer(e){e.on("@close",(()=>{this._dataProducers.delete(e.id)}))}handleDataConsumer(e){e.on("@close",(()=>{this._dataConsumers.delete(e.id)}))}}wp.Transport=ld;var ud={},md={},hd={},fd={},gd={get exports(){return fd},set exports(e){fd=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(gd).forEach((function(e){gd[e].forEach((function(e){e.reg||(e.reg=/(.*)/),e.format||(e.format="%s")}))})),function(e){var t=function(e){return String(Number(e))===e?Number(e):e},n=function(e,n,i){var s=e.name&&e.names;e.push&&!n[e.push]?n[e.push]=[]:s&&!n[e.name]&&(n[e.name]={});var r=e.push?{}:s?n[e.name]:n;!function(e,n,i,s){if(s&&!i)n[s]=t(e[1]);else for(var r=0;r<i.length;r+=1)null!=e[r+1]&&(n[i[r]]=t(e[r+1]))}(i.match(e.reg),r,e.names,e.name),e.push&&n[e.push].push(r)},i=fd,s=RegExp.prototype.test.bind(/^([a-z])=(.*)/);e.parse=function(e){var t={},r=[],a=t;return e.split(/(\r\n|\r|\n)/).filter(s).forEach((function(e){var t=e[0],s=e.slice(2);"m"===t&&(r.push({rtp:[],fmtp:[]}),a=r[r.length-1]);for(var o=0;o<(i[t]||[]).length;o+=1){var c=i[t][o];if(c.reg.test(s))return n(c,a,s)}})),t.media=r,t};var r=function(e,n){var i=n.split(/=(.+)/,2);return 2===i.length?e[i[0]]=t(i[1]):1===i.length&&n.length>1&&(e[i[0]]=void 0),e};e.parseParams=function(e){return e.split(/;\s?/).reduce(r,{})},e.parseFmtpConfig=e.parseParams,e.parsePayloads=function(e){return e.toString().split(" ").map(Number)},e.parseRemoteCandidates=function(e){for(var n=[],i=e.split(" ").map(t),s=0;s<i.length;s+=3)n.push({component:i[s],ip:i[s+1],port:i[s+2]});return n},e.parseImageAttributes=function(e){return e.split(" ").map((function(e){return e.substring(1,e.length-1).split(",").reduce(r,{})}))},e.parseSimulcastStreamList=function(e){return e.split(";").map((function(e){return e.split(",").map((function(e){var n,i=!1;return"~"!==e[0]?n=t(e):(n=t(e.substring(1,e.length)),i=!0),{scid:n,paused:i}}))}))}}(hd);var vd=fd,bd=/%[sdv%]/g,yd=function(e){var t=1,n=arguments,i=n.length;return e.replace(bd,(function(e){if(t>=i)return e;var s=n[t];switch(t+=1,e){case"%%":return"%";case"%s":return String(s);case"%d":return Number(s);case"%v":return""}}))},_d=function(e,t,n){var i=[e+"="+(t.format instanceof Function?t.format(t.push?n:n[t.name]):t.format)];if(t.names)for(var s=0;s<t.names.length;s+=1){var r=t.names[s];t.name?i.push(n[t.name][r]):i.push(n[t.names[s]])}else i.push(n[t.name]);return yd.apply(null,i)},xd=["v","o","s","i","u","e","p","c","b","t","r","z","a"],wd=["i","c","b","a"],Sd=hd,kd=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||xd,i=t.innerOrder||wd,s=[];return n.forEach((function(t){vd[t].forEach((function(n){n.name in e&&null!=e[n.name]?s.push(_d(t,n,e)):n.push in e&&null!=e[n.push]&&e[n.push].forEach((function(e){s.push(_d(t,n,e))}))}))})),e.media.forEach((function(e){s.push(_d("m",vd.m[0],e)),i.forEach((function(t){vd[t].forEach((function(n){n.name in e&&null!=e[n.name]?s.push(_d(t,n,e)):n.push in e&&null!=e[n.push]&&e[n.push].forEach((function(e){s.push(_d(t,n,e))}))}))}))})),s.join("\r\n")+"\r\n"};md.write=kd,md.parse=Sd.parse,md.parseParams=Sd.parseParams,md.parseFmtpConfig=Sd.parseFmtpConfig,md.parsePayloads=Sd.parsePayloads,md.parseRemoteCandidates=Sd.parseRemoteCandidates,md.parseImageAttributes=Sd.parseImageAttributes,md.parseSimulcastStreamList=Sd.parseSimulcastStreamList;var Cd={},Rd=Xt&&Xt.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),Td=Xt&&Xt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Pd=Xt&&Xt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&Rd(t,e,n);return Td(t,e),t};Object.defineProperty(Cd,"__esModule",{value:!0}),Cd.applyCodecParameters=Cd.getCname=Cd.extractDtlsParameters=Cd.extractRtpCapabilities=void 0;const Ed=Pd(md);Cd.extractRtpCapabilities=function({sdpObject:e}){const t=new Map,n=[];let i=!1,s=!1;for(const r of e.media){const e=r.type;switch(e){case"audio":if(i)continue;i=!0;break;case"video":if(s)continue;s=!0;break;default:continue}for(const n of r.rtp){const i={kind:e,mimeType:`${e}/${n.codec}`,preferredPayloadType:n.payload,clockRate:n.rate,channels:n.encoding,parameters:{},rtcpFeedback:[]};t.set(i.preferredPayloadType,i)}for(const e of r.fmtp||[]){const n=Ed.parseParams(e.config),i=t.get(e.payload);i&&(n&&n.hasOwnProperty("profile-level-id")&&(n["profile-level-id"]=String(n["profile-level-id"])),i.parameters=n)}for(const n of r.rtcpFb||[]){const i={type:n.type,parameter:n.subtype};if(i.parameter||delete i.parameter,"*"!==n.payload){const e=t.get(n.payload);if(!e)continue;e.rtcpFeedback.push(i)}else for(const n of t.values())n.kind!==e||/.+\/rtx$/i.test(n.mimeType)||n.rtcpFeedback.push(i)}for(const t of r.ext||[]){if(t["encrypt-uri"])continue;const i={kind:e,uri:t.uri,preferredId:t.value};n.push(i)}}return{codecs:Array.from(t.values()),headerExtensions:n}},Cd.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 n=t.fingerprint||e.fingerprint;let i;switch(t.setup){case"active":i="client";break;case"passive":i="server";break;case"actpass":i="auto"}return{role:i,fingerprints:[{algorithm:n.type,value:n.hash}]}},Cd.getCname=function({offerMediaObject:e}){const t=(e.ssrcs||[]).find((e=>"cname"===e.attribute));return t?t.value:""},Cd.applyCodecParameters=function({offerRtpParameters:e,answerMediaObject:t}){for(const n of e.codecs){const e=n.mimeType.toLowerCase();if("audio/opus"!==e)continue;if(!(t.rtp||[]).find((e=>e.payload===n.payloadType)))continue;t.fmtp=t.fmtp||[];let i=t.fmtp.find((e=>e.payload===n.payloadType));i||(i={payload:n.payloadType,config:""},t.fmtp.push(i));const s=Ed.parseParams(i.config);switch(e){case"audio/opus":{const e=n.parameters["sprop-stereo"];void 0!==e&&(s.stereo=e?1:0);break}}i.config="";for(const e of Object.keys(s))i.config&&(i.config+=";"),i.config+=`${e}=${s[e]}`}};var Od={};Object.defineProperty(Od,"__esModule",{value:!0}),Od.addLegacySimulcast=Od.getRtpEncodings=void 0,Od.getRtpEncodings=function({offerMediaObject:e}){const t=new Set;for(const n of e.ssrcs||[]){const e=n.id;t.add(e)}if(0===t.size)throw new Error("no a=ssrc lines found");const n=new Map;for(const i of e.ssrcGroups||[]){if("FID"!==i.semantics)continue;let[e,s]=i.ssrcs.split(/\s+/);e=Number(e),s=Number(s),t.has(e)&&(t.delete(e),t.delete(s),n.set(e,s))}for(const e of t)n.set(e,null);const i=[];for(const[e,t]of n){const n={ssrc:e};t&&(n.rtx={ssrc:t}),i.push(n)}return i},Od.addLegacySimulcast=function({offerMediaObject:e,numStreams:t}){if(t<=1)throw new TypeError("numStreams must be greater than 1");const n=(e.ssrcs||[]).find((e=>"msid"===e.attribute));if(!n)throw new Error("a=ssrc line with msid information not found");const[i,s]=n.value.split(" "),r=n.id;let a;(e.ssrcGroups||[]).some((e=>{if("FID"!==e.semantics)return!1;const t=e.ssrcs.split(/\s+/);return Number(t[0])===r&&(a=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,p=[],d=[];for(let e=0;e<t;++e)p.push(r+e),a&&d.push(a+e);e.ssrcGroups=[],e.ssrcs=[],e.ssrcGroups.push({semantics:"SIM",ssrcs:p.join(" ")});for(let t=0;t<p.length;++t){const n=p[t];e.ssrcs.push({id:n,attribute:"cname",value:c}),e.ssrcs.push({id:n,attribute:"msid",value:`${i} ${s}`})}for(let t=0;t<d.length;++t){const n=p[t],r=d[t];e.ssrcs.push({id:r,attribute:"cname",value:c}),e.ssrcs.push({id:r,attribute:"msid",value:`${i} ${s}`}),e.ssrcGroups.push({semantics:"FID",ssrcs:`${n} ${r}`})}};var Dd={};Object.defineProperty(Dd,"__esModule",{value:!0}),Dd.HandlerInterface=void 0;const jd=Kc;class Id extends jd.EnhancedEventEmitter{constructor(){super()}}Dd.HandlerInterface=Id;var Md={},Ld={},Ad=Xt&&Xt.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),Nd=Xt&&Xt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Bd=Xt&&Xt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&Ad(t,e,n);return Nd(t,e),t};Object.defineProperty(Ld,"__esModule",{value:!0}),Ld.OfferMediaSection=Ld.AnswerMediaSection=Ld.MediaSection=void 0;const Fd=Bd(tp);class Ud{constructor({iceParameters:e,iceCandidates:t,dtlsParameters:n,planB:i=!1}){if(this._mediaObject={},this._planB=i,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"}n&&this.setDtlsRole(n.role)}get mid(){return String(this._mediaObject.mid)}get closed(){return 0===this._mediaObject.port}getObject(){return this._mediaObject}setIceParameters(e){this._mediaObject.iceUfrag=e.usernameFragment,this._mediaObject.icePwd=e.password}pause(){this._mediaObject.direction="inactive"}disable(){this.pause(),delete this._mediaObject.ext,delete this._mediaObject.ssrcs,delete this._mediaObject.ssrcGroups,delete this._mediaObject.simulcast,delete this._mediaObject.simulcast_03,delete this._mediaObject.rids,delete this._mediaObject.extmapAllowMixed}close(){this.disable(),this._mediaObject.port=0}}Ld.MediaSection=Ud;Ld.AnswerMediaSection=class extends Ud{constructor({iceParameters:e,iceCandidates:t,dtlsParameters:n,sctpParameters:i,plainRtpParameters:s,planB:r=!1,offerMediaObject:a,offerRtpParameters:o,answerRtpParameters:c,codecOptions:p,extmapAllowMixed:d=!1}){switch(super({iceParameters:e,iceCandidates:t,dtlsParameters:n,planB:r}),this._mediaObject.mid=String(a.mid),this._mediaObject.type=a.type,this._mediaObject.protocol=a.protocol,s?(this._mediaObject.connection={ip:s.ip,version:s.ipVersion},this._mediaObject.port=s.port):(this._mediaObject.connection={ip:"127.0.0.1",version:4},this._mediaObject.port=7),a.type){case"audio":case"video":this._mediaObject.direction="recvonly",this._mediaObject.rtp=[],this._mediaObject.rtcpFb=[],this._mediaObject.fmtp=[];for(const e of c.codecs){const t={payload:e.payloadType,codec:zd(e),rate:e.clockRate};e.channels>1&&(t.encoding=e.channels),this._mediaObject.rtp.push(t);const n=Fd.clone(e.parameters,{});if(p){const{opusStereo:t,opusFec:i,opusDtx:s,opusMaxPlaybackRate:r,opusMaxAverageBitrate:a,opusPtime:c,videoGoogleStartBitrate:d,videoGoogleMaxBitrate:l,videoGoogleMinBitrate:u}=p,m=o.codecs.find((t=>t.payloadType===e.payloadType));switch(e.mimeType.toLowerCase()){case"audio/opus":void 0!==t&&(m.parameters["sprop-stereo"]=t?1:0,n.stereo=t?1:0),void 0!==i&&(m.parameters.useinbandfec=i?1:0,n.useinbandfec=i?1:0),void 0!==s&&(m.parameters.usedtx=s?1:0,n.usedtx=s?1:0),void 0!==r&&(n.maxplaybackrate=r),void 0!==a&&(n.maxaveragebitrate=a),void 0!==c&&(m.parameters.ptime=c,n.ptime=c);break;case"video/vp8":case"video/vp9":case"video/h264":case"video/h265":void 0!==d&&(n["x-google-start-bitrate"]=d),void 0!==l&&(n["x-google-max-bitrate"]=l),void 0!==u&&(n["x-google-min-bitrate"]=u)}}const i={payload:e.payloadType,config:""};for(const e of Object.keys(n))i.config&&(i.config+=";"),i.config+=`${e}=${n[e]}`;i.config&&this._mediaObject.fmtp.push(i);for(const t of e.rtcpFeedback)this._mediaObject.rtcpFb.push({payload:e.payloadType,type:t.type,subtype:t.parameter})}this._mediaObject.payloads=c.codecs.map((e=>e.payloadType)).join(" "),this._mediaObject.ext=[];for(const e of c.headerExtensions){(a.ext||[]).some((t=>t.uri===e.uri))&&this._mediaObject.ext.push({uri:e.uri,value:e.id})}if(d&&"extmap-allow-mixed"===a.extmapAllowMixed&&(this._mediaObject.extmapAllowMixed="extmap-allow-mixed"),a.simulcast){this._mediaObject.simulcast={dir1:"recv",list1:a.simulcast.list1},this._mediaObject.rids=[];for(const e of a.rids||[])"send"===e.direction&&this._mediaObject.rids.push({id:e.id,direction:"recv"})}else if(a.simulcast_03){this._mediaObject.simulcast_03={value:a.simulcast_03.value.replace(/send/g,"recv")},this._mediaObject.rids=[];for(const e of a.rids||[])"send"===e.direction&&this._mediaObject.rids.push({id:e.id,direction:"recv"})}this._mediaObject.rtcpMux="rtcp-mux",this._mediaObject.rtcpRsize="rtcp-rsize",this._planB&&"video"===this._mediaObject.type&&(this._mediaObject.xGoogleFlag="conference");break;case"application":"number"==typeof a.sctpPort?(this._mediaObject.payloads="webrtc-datachannel",this._mediaObject.sctpPort=i.port,this._mediaObject.maxMessageSize=i.maxMessageSize):a.sctpmap&&(this._mediaObject.payloads=i.port,this._mediaObject.sctpmap={app:"webrtc-datachannel",sctpmapNumber:i.port,maxMessageSize:i.maxMessageSize})}}setDtlsRole(e){switch(e){case"client":this._mediaObject.setup="active";break;case"server":this._mediaObject.setup="passive";break;case"auto":this._mediaObject.setup="actpass"}}resume(){this._mediaObject.direction="recvonly"}};function zd(e){const t=new RegExp("^(audio|video)/(.+)","i").exec(e.mimeType);if(!t)throw new TypeError("invalid codec.mimeType");return t[2]}Ld.OfferMediaSection=class extends Ud{constructor({iceParameters:e,iceCandidates:t,dtlsParameters:n,sctpParameters:i,plainRtpParameters:s,planB:r=!1,mid:a,kind:o,offerRtpParameters:c,streamId:p,trackId:d,oldDataChannelSpec:l=!1}){switch(super({iceParameters:e,iceCandidates:t,dtlsParameters:n,planB:r}),this._mediaObject.mid=String(a),this._mediaObject.type=o,s?(this._mediaObject.connection={ip:s.ip,version:s.ipVersion},this._mediaObject.protocol="RTP/AVP",this._mediaObject.port=s.port):(this._mediaObject.connection={ip:"127.0.0.1",version:4},this._mediaObject.protocol=i?"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=`${p||"-"} ${d}`);for(const e of c.codecs){const t={payload:e.payloadType,codec:zd(e),rate:e.clockRate};e.channels>1&&(t.encoding=e.channels),this._mediaObject.rtp.push(t);const n={payload:e.payloadType,config:""};for(const t of Object.keys(e.parameters))n.config&&(n.config+=";"),n.config+=`${t}=${e.parameters[t]}`;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=c.codecs.map((e=>e.payloadType)).join(" "),this._mediaObject.ext=[];for(const e of c.headerExtensions)this._mediaObject.ext.push({uri:e.uri,value:e.id});this._mediaObject.rtcpMux="rtcp-mux",this._mediaObject.rtcpRsize="rtcp-rsize";const e=c.encodings[0],t=e.ssrc,n=e.rtx&&e.rtx.ssrc?e.rtx.ssrc:void 0;this._mediaObject.ssrcs=[],this._mediaObject.ssrcGroups=[],c.rtcp.cname&&this._mediaObject.ssrcs.push({id:t,attribute:"cname",value:c.rtcp.cname}),this._planB&&this._mediaObject.ssrcs.push({id:t,attribute:"msid",value:`${p||"-"} ${d}`}),n&&(c.rtcp.cname&&this._mediaObject.ssrcs.push({id:n,attribute:"cname",value:c.rtcp.cname}),this._planB&&this._mediaObject.ssrcs.push({id:n,attribute:"msid",value:`${p||"-"} ${d}`}),this._mediaObject.ssrcGroups.push({semantics:"FID",ssrcs:`${t} ${n}`}));break}case"application":l?(this._mediaObject.payloads=i.port,this._mediaObject.sctpmap={app:"webrtc-datachannel",sctpmapNumber:i.port,maxMessageSize:i.maxMessageSize}):(this._mediaObject.payloads="webrtc-datachannel",this._mediaObject.sctpPort=i.port,this._mediaObject.maxMessageSize=i.maxMessageSize)}}setDtlsRole(e){this._mediaObject.setup="actpass"}resume(){this._mediaObject.direction="sendonly"}planBReceive({offerRtpParameters:e,streamId:t,trackId:n}){const i=e.encodings[0],s=i.ssrc,r=i.rtx&&i.rtx.ssrc?i.rtx.ssrc:void 0,a=this._mediaObject.payloads.split(" ");for(const t of e.codecs){if(a.includes(String(t.payloadType)))continue;const e={payload:t.payloadType,codec:zd(t),rate:t.clockRate};t.channels>1&&(e.encoding=t.channels),this._mediaObject.rtp.push(e);const n={payload:t.payloadType,config:""};for(const e of Object.keys(t.parameters))n.config&&(n.config+=";"),n.config+=`${e}=${t.parameters[e]}`;n.config&&this._mediaObject.fmtp.push(n);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:s,attribute:"cname",value:e.rtcp.cname}),this._mediaObject.ssrcs.push({id:s,attribute:"msid",value:`${t||"-"} ${n}`}),r&&(e.rtcp.cname&&this._mediaObject.ssrcs.push({id:r,attribute:"cname",value:e.rtcp.cname}),this._mediaObject.ssrcs.push({id:r,attribute:"msid",value:`${t||"-"} ${n}`}),this._mediaObject.ssrcGroups.push({semantics:"FID",ssrcs:`${s} ${r}`}))}planBStopReceiving({offerRtpParameters:e}){const t=e.encodings[0],n=t.ssrc,i=t.rtx&&t.rtx.ssrc?t.rtx.ssrc:void 0;this._mediaObject.ssrcs=this._mediaObject.ssrcs.filter((e=>e.id!==n&&e.id!==i)),i&&(this._mediaObject.ssrcGroups=this._mediaObject.ssrcGroups.filter((e=>e.ssrcs!==`${n} ${i}`)))}};var qd=Xt&&Xt.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),$d=Xt&&Xt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Vd=Xt&&Xt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&qd(t,e,n);return $d(t,e),t};Object.defineProperty(Md,"__esModule",{value:!0}),Md.RemoteSdp=void 0;const Hd=Vd(md),Wd=Ld,Gd=new Vc.Logger("RemoteSdp");Md.RemoteSdp=class{constructor({iceParameters:e,iceCandidates:t,dtlsParameters:n,sctpParameters:i,plainRtpParameters:s,planB:r=!1}){if(this._mediaSections=[],this._midToIndex=new Map,this._iceParameters=e,this._iceCandidates=t,this._dtlsParameters=n,this._sctpParameters=i,this._plainRtpParameters=s,this._planB=r,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"),n){this._sdpObject.msidSemantic={semantic:"WMS",token:"*"};const e=this._dtlsParameters.fingerprints.length;this._sdpObject.fingerprint={type:n.fingerprints[e-1].algorithm,hash:n.fingerprints[e-1].value},this._sdpObject.groups=[{type:"BUNDLE",mids:""}]}s&&(this._sdpObject.origin.address=s.ip,this._sdpObject.origin.ipVer=s.ipVersion)}updateIceParameters(e){Gd.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){Gd.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:n,answerRtpParameters:i,codecOptions:s,extmapAllowMixed:r=!1}){const a=new Wd.AnswerMediaSection({iceParameters:this._iceParameters,iceCandidates:this._iceCandidates,dtlsParameters:this._dtlsParameters,plainRtpParameters:this._plainRtpParameters,planB:this._planB,offerMediaObject:e,offerRtpParameters:n,answerRtpParameters:i,codecOptions:s,extmapAllowMixed:r});t?this._replaceMediaSection(a,t):this._midToIndex.has(a.mid)?this._replaceMediaSection(a):this._addMediaSection(a)}receive({mid:e,kind:t,offerRtpParameters:n,streamId:i,trackId:s}){const r=this._midToIndex.get(e);let a;if(void 0!==r&&(a=this._mediaSections[r]),a)a.planBReceive({offerRtpParameters:n,streamId:i,trackId:s}),this._replaceMediaSection(a);else{a=new Wd.OfferMediaSection({iceParameters:this._iceParameters,iceCandidates:this._iceCandidates,dtlsParameters:this._dtlsParameters,plainRtpParameters:this._plainRtpParameters,planB:this._planB,mid:e,kind:t,offerRtpParameters:n,streamId:i,trackId:s});const r=this._mediaSections.find((e=>e.closed));r?this._replaceMediaSection(a,r.mid):this._addMediaSection(a)}}pauseMediaSection(e){this._findMediaSection(e).pause()}resumeSendingMediaSection(e){this._findMediaSection(e).resume()}resumeReceivingMediaSection(e){this._findMediaSection(e).resume()}disableMediaSection(e){this._findMediaSection(e).disable()}closeMediaSection(e){const t=this._findMediaSection(e);return e===this._firstMid?(Gd.debug("closeMediaSection() | cannot close first media section, disabling it instead [mid:%s]",e),this.disableMediaSection(e),!1):(t.close(),this._regenerateBundleMids(),!0)}planBStopReceiving({mid:e,offerRtpParameters:t}){const n=this._midToIndex.get(e);if(void 0===n)throw new Error(`no media section found with mid '${e}'`);const i=this._mediaSections[n];i.planBStopReceiving({offerRtpParameters:t}),this._replaceMediaSection(i)}sendSctpAssociation({offerMediaObject:e}){const t=new Wd.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 Wd.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++,Hd.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 n=this._midToIndex.get(t);if(void 0===n)throw new Error(`no media section found for reuseMid '${t}'`);const i=this._mediaSections[n];this._mediaSections[n]=e,this._midToIndex.delete(i.mid),this._midToIndex.set(e.mid,n),this._sdpObject.media[n]=e.getObject(),this._regenerateBundleMids()}else{const t=this._midToIndex.get(e.mid);if(void 0===t)throw new Error(`no media section found with mid '${e.mid}'`);this._mediaSections[t]=e,this._sdpObject.media[t]=e.getObject()}}_findMediaSection(e){const t=this._midToIndex.get(e);if(void 0===t)throw new Error(`no media section found with mid '${e}'`);return this._mediaSections[t]}_regenerateBundleMids(){this._dtlsParameters&&(this._sdpObject.groups[0].mids=this._mediaSections.filter((e=>!e.closed)).map((e=>e.mid)).join(" "))}};var Kd={};Object.defineProperty(Kd,"__esModule",{value:!0}),Kd.parse=void 0;const Jd=new RegExp("^[LS]([1-9]\\d{0,1})T([1-9]\\d{0,1})");Kd.parse=function(e){const t=Jd.exec(e||"");return t?{spatialLayers:Number(t[1]),temporalLayers:Number(t[2])}:{spatialLayers:1,temporalLayers:1}};var Qd=Xt&&Xt.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),Yd=Xt&&Xt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Xd=Xt&&Xt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&Qd(t,e,n);return Yd(t,e),t};Object.defineProperty(ud,"__esModule",{value:!0}),ud.Chrome74=void 0;const Zd=Xd(md),el=Vc,tl=Xd(tp),nl=Xd(np),il=Xd(Cd),sl=Xd(Od),rl=Dd,al=Md,ol=Kd,cl=new el.Logger("Chrome74"),pl={OS:1024,MIS:1024};class dl extends rl.HandlerInterface{static createFactory(){return()=>new dl}constructor(){super(),this._mapMidTransceiver=new Map,this._sendStream=new MediaStream,this._hasDataChannelMediaSection=!1,this._nextSendSctpStreamId=0,this._transportReady=!1}get name(){return"Chrome74"}close(){if(cl.debug("close()"),this._pc)try{this._pc.close()}catch(e){}this.emit("@close")}async getNativeRtpCapabilities(){cl.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 n=Zd.parse(t.sdp);return il.extractRtpCapabilities({sdpObject:n})}catch(t){try{e.close()}catch(e){}throw t}}async getNativeSctpCapabilities(){return cl.debug("getNativeSctpCapabilities()"),{numStreams:pl}}run({direction:e,iceParameters:t,iceCandidates:n,dtlsParameters:i,sctpParameters:s,iceServers:r,iceTransportPolicy:a,additionalSettings:o,proprietaryConstraints:c,extendedRtpCapabilities:p}){cl.debug("run()"),this._direction=e,this._remoteSdp=new al.RemoteSdp({iceParameters:t,iceCandidates:n,dtlsParameters:i,sctpParameters:s}),this._sendingRtpParametersByKind={audio:nl.getSendingRtpParameters("audio",p),video:nl.getSendingRtpParameters("video",p)},this._sendingRemoteRtpParametersByKind={audio:nl.getSendingRemoteRtpParameters("audio",p),video:nl.getSendingRemoteRtpParameters("video",p)},i.role&&"auto"!==i.role&&(this._forcedLocalDtlsRole="server"===i.role?"client":"server"),this._pc=new RTCPeerConnection({iceServers:r||[],iceTransportPolicy:a||"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require",sdpSemantics:"unified-plan",...o},c),this._pc.connectionState?this._pc.addEventListener("connectionstatechange",(()=>{this.emit("@connectionstatechange",this._pc.connectionState)})):(cl.warn("run() | pc.connectionState not supported, using pc.iceConnectionState"),this._pc.addEventListener("iceconnectionstatechange",(()=>{switch(this._pc.iceConnectionState){case"checking":this.emit("@connectionstatechange","connecting");break;case"connected":case"completed":this.emit("@connectionstatechange","connected");break;case"failed":this.emit("@connectionstatechange","failed");break;case"disconnected":this.emit("@connectionstatechange","disconnected");break;case"closed":this.emit("@connectionstatechange","closed")}})))}async updateIceServers(e){cl.debug("updateIceServers()");const t=this._pc.getConfiguration();t.iceServers=e,this._pc.setConfiguration(t)}async restartIce(e){if(cl.debug("restartIce()"),this._remoteSdp.updateIceParameters(e),this._transportReady)if("send"===this._direction){const e=await this._pc.createOffer({iceRestart:!0});cl.debug("restartIce() | calling pc.setLocalDescription() [offer:%o]",e),await this._pc.setLocalDescription(e);const t={type:"answer",sdp:this._remoteSdp.getSdp()};cl.debug("restartIce() | calling pc.setRemoteDescription() [answer:%o]",t),await this._pc.setRemoteDescription(t)}else{const e={type:"offer",sdp:this._remoteSdp.getSdp()};cl.debug("restartIce() | calling pc.setRemoteDescription() [offer:%o]",e),await this._pc.setRemoteDescription(e);const t=await this._pc.createAnswer();cl.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:n,codec:i}){var s;this.assertSendDirection(),cl.debug("send() [kind:%s, track.id:%s]",e.kind,e.id),t&&t.length>1&&t.forEach(((e,t)=>{e.rid=`r${t}`}));const r=tl.clone(this._sendingRtpParametersByKind[e.kind],{});r.codecs=nl.reduceCodecs(r.codecs,i);const a=tl.clone(this._sendingRemoteRtpParametersByKind[e.kind],{});a.codecs=nl.reduceCodecs(a.codecs,i);const o=this._remoteSdp.getNextMediaSectionIdx(),c=this._pc.addTransceiver(e,{direction:"sendonly",streams:[this._sendStream],sendEncodings:t});let p,d=await this._pc.createOffer(),l=Zd.parse(d.sdp);this._transportReady||await this.setupTransport({localDtlsRole:null!==(s=this._forcedLocalDtlsRole)&&void 0!==s?s:"client",localSdpObject:l});let u=!1;const m=(0,ol.parse)((t||[{}])[0].scalabilityMode);t&&1===t.length&&m.spatialLayers>1&&"video/vp9"===r.codecs[0].mimeType.toLowerCase()&&(cl.debug("send() | enabling legacy simulcast for VP9 SVC"),u=!0,l=Zd.parse(d.sdp),p=l.media[o.idx],sl.addLegacySimulcast({offerMediaObject:p,numStreams:m.spatialLayers}),d={type:"offer",sdp:Zd.write(l)}),cl.debug("send() | calling pc.setLocalDescription() [offer:%o]",d),await this._pc.setLocalDescription(d);const h=c.mid;if(r.mid=h,l=Zd.parse(this._pc.localDescription.sdp),p=l.media[o.idx],r.rtcp.cname=il.getCname({offerMediaObject:p}),t)if(1===t.length){let e=sl.getRtpEncodings({offerMediaObject:p});Object.assign(e[0],t[0]),u&&(e=[e[0]]),r.encodings=e}else r.encodings=t;else r.encodings=sl.getRtpEncodings({offerMediaObject:p});if(r.encodings.length>1&&("video/vp8"===r.codecs[0].mimeType.toLowerCase()||"video/h264"===r.codecs[0].mimeType.toLowerCase()))for(const e of r.encodings)e.scalabilityMode="S1T2";this._remoteSdp.send({offerMediaObject:p,reuseMid:o.reuseMid,offerRtpParameters:r,answerRtpParameters:a,codecOptions:n,extmapAllowMixed:!0});const f={type:"answer",sdp:this._remoteSdp.getSdp()};return cl.debug("send() | calling pc.setRemoteDescription() [answer:%o]",f),await this._pc.setRemoteDescription(f),this._mapMidTransceiver.set(h,c),{localId:h,rtpParameters:r,rtpSender:c.sender}}async stopSending(e){this.assertSendDirection(),cl.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);if(this._remoteSdp.closeMediaSection(t.mid))try{t.stop()}catch(e){}const n=await this._pc.createOffer();cl.debug("stopSending() | calling pc.setLocalDescription() [offer:%o]",n),await this._pc.setLocalDescription(n);const i={type:"answer",sdp:this._remoteSdp.getSdp()};cl.debug("stopSending() | calling pc.setRemoteDescription() [answer:%o]",i),await this._pc.setRemoteDescription(i),this._mapMidTransceiver.delete(e)}async pauseSending(e){this.assertSendDirection(),cl.debug("pauseSending() [localId:%s]",e);const t=this._mapMidTransceiver.get(e);if(!t)throw new Error("associated RTCRtpTransceiver not found");t.direction="inactive",this._remoteSdp.pauseMediaSection(e);const n=await this._pc.createOffer();cl.debug("pauseSending() | calling pc.setLocalDescription() [offer:%o]",n),await this._pc.setLocalDescription(n);const i={type:"answer",sdp:this._remoteSdp.getSdp()};cl.debug("pauseSending() | calling pc.setRemoteDescription() [answer:%o]",i),await this._pc.setRemoteDescription(i)}async resumeSending(e){this.assertSendDirection(),cl.debug("resumeSending() [localId:%s]",e);const t=this._mapMidTransceiver.get(e);if(this._remoteSdp.resumeSendingMediaSection(e),!t)throw new Error("associated RTCRtpTransceiver not found");t.direction="sendonly";const n=await this._pc.createOffer();cl.debug("resumeSending() | calling pc.setLocalDescription() [offer:%o]",n),await this._pc.setLocalDescription(n);const i={type:"answer",sdp:this._remoteSdp.getSdp()};cl.debug("resumeSending() | calling pc.setRemoteDescription() [answer:%o]",i),await this._pc.setRemoteDescription(i)}async replaceTrack(e,t){this.assertSendDirection(),t?cl.debug("replaceTrack() [localId:%s, track.id:%s]",e,t.id):cl.debug("replaceTrack() [localId:%s, no track]",e);const n=this._mapMidTransceiver.get(e);if(!n)throw new Error("associated RTCRtpTransceiver not found");await n.sender.replaceTrack(t)}async setMaxSpatialLayer(e,t){this.assertSendDirection(),cl.debug("setMaxSpatialLayer() [localId:%s, spatialLayer:%s]",e,t);const n=this._mapMidTransceiver.get(e);if(!n)throw new Error("associated RTCRtpTransceiver not found");const i=n.sender.getParameters();i.encodings.forEach(((e,n)=>{e.active=n<=t})),await n.sender.setParameters(i)}async setRtpEncodingParameters(e,t){this.assertSendDirection(),cl.debug("setRtpEncodingParameters() [localId:%s, params:%o]",e,t);const n=this._mapMidTransceiver.get(e);if(!n)throw new Error("associated RTCRtpTransceiver not found");const i=n.sender.getParameters();i.encodings.forEach(((e,n)=>{i.encodings[n]={...e,...t}})),await n.sender.setParameters(i)}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:n,label:i,protocol:s}){var r;this.assertSendDirection();const a={negotiated:!0,id:this._nextSendSctpStreamId,ordered:e,maxPacketLifeTime:t,maxRetransmits:n,protocol:s};cl.debug("sendDataChannel() [options:%o]",a);const o=this._pc.createDataChannel(i,a);if(this._nextSendSctpStreamId=++this._nextSendSctpStreamId%pl.MIS,!this._hasDataChannelMediaSection){const e=await this._pc.createOffer(),t=Zd.parse(e.sdp),n=t.media.find((e=>"application"===e.type));this._transportReady||await this.setupTransport({localDtlsRole:null!==(r=this._forcedLocalDtlsRole)&&void 0!==r?r:"client",localSdpObject:t}),cl.debug("sendDataChannel() | calling pc.setLocalDescription() [offer:%o]",e),await this._pc.setLocalDescription(e),this._remoteSdp.sendSctpAssociation({offerMediaObject:n});const i={type:"answer",sdp:this._remoteSdp.getSdp()};cl.debug("sendDataChannel() | calling pc.setRemoteDescription() [answer:%o]",i),await this._pc.setRemoteDescription(i),this._hasDataChannelMediaSection=!0}return{dataChannel:o,sctpStreamParameters:{streamId:a.id,ordered:a.ordered,maxPacketLifeTime:a.maxPacketLifeTime,maxRetransmits:a.maxRetransmits}}}async receive(e){var t;this.assertRecvDirection();const n=[],i=new Map;for(const t of e){const{trackId:e,kind:n,rtpParameters:s,streamId:r}=t;cl.debug("receive() [trackId:%s, kind:%s]",e,n);const a=s.mid||String(this._mapMidTransceiver.size);i.set(e,a),this._remoteSdp.receive({mid:a,kind:n,offerRtpParameters:s,streamId:r||s.rtcp.cname,trackId:e})}const s={type:"offer",sdp:this._remoteSdp.getSdp()};cl.debug("receive() | calling pc.setRemoteDescription() [offer:%o]",s),await this._pc.setRemoteDescription(s);let r=await this._pc.createAnswer();const a=Zd.parse(r.sdp);for(const t of e){const{trackId:e,rtpParameters:n}=t,s=i.get(e),r=a.media.find((e=>String(e.mid)===s));il.applyCodecParameters({offerRtpParameters:n,answerMediaObject:r})}r={type:"answer",sdp:Zd.write(a)},this._transportReady||await this.setupTransport({localDtlsRole:null!==(t=this._forcedLocalDtlsRole)&&void 0!==t?t:"client",localSdpObject:a}),cl.debug("receive() | calling pc.setLocalDescription() [answer:%o]",r),await this._pc.setLocalDescription(r);for(const t of e){const{trackId:e}=t,s=i.get(e),r=this._pc.getTransceivers().find((e=>e.mid===s));if(!r)throw new Error("new RTCRtpTransceiver not found");this._mapMidTransceiver.set(s,r),n.push({localId:s,track:r.receiver.track,rtpReceiver:r.receiver})}return n}async stopReceiving(e){this.assertRecvDirection();for(const t of e){cl.debug("stopReceiving() [localId:%s]",t);const e=this._mapMidTransceiver.get(t);if(!e)throw new Error("associated RTCRtpTransceiver not found");this._remoteSdp.closeMediaSection(e.mid)}const t={type:"offer",sdp:this._remoteSdp.getSdp()};cl.debug("stopReceiving() | calling pc.setRemoteDescription() [offer:%o]",t),await this._pc.setRemoteDescription(t);const n=await this._pc.createAnswer();cl.debug("stopReceiving() | calling pc.setLocalDescription() [answer:%o]",n),await this._pc.setLocalDescription(n);for(const t of e)this._mapMidTransceiver.delete(t)}async pauseReceiving(e){this.assertRecvDirection();for(const t of e){cl.debug("pauseReceiving() [localId:%s]",t);const e=this._mapMidTransceiver.get(t);if(!e)throw new Error("associated RTCRtpTransceiver not found");e.direction="inactive",this._remoteSdp.pauseMediaSection(t)}const t={type:"offer",sdp:this._remoteSdp.getSdp()};cl.debug("pauseReceiving() | calling pc.setRemoteDescription() [offer:%o]",t),await this._pc.setRemoteDescription(t);const n=await this._pc.createAnswer();cl.debug("pauseReceiving() | calling pc.setLocalDescription() [answer:%o]",n),await this._pc.setLocalDescription(n)}async resumeReceiving(e){this.assertRecvDirection();for(const t of e){cl.debug("resumeReceiving() [localId:%s]",t);const e=this._mapMidTransceiver.get(t);if(!e)throw new Error("associated RTCRtpTransceiver not found");e.direction="recvonly",this._remoteSdp.resumeReceivingMediaSection(t)}const t={type:"offer",sdp:this._remoteSdp.getSdp()};cl.debug("resumeReceiving() | calling pc.setRemoteDescription() [offer:%o]",t),await this._pc.setRemoteDescription(t);const n=await this._pc.createAnswer();cl.debug("resumeReceiving() | calling pc.setLocalDescription() [answer:%o]",n),await this._pc.setLocalDescription(n)}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:n}){var i;this.assertRecvDirection();const{streamId:s,ordered:r,maxPacketLifeTime:a,maxRetransmits:o}=e,c={negotiated:!0,id:s,ordered:r,maxPacketLifeTime:a,maxRetransmits:o,protocol:n};cl.debug("receiveDataChannel() [options:%o]",c);const p=this._pc.createDataChannel(t,c);if(!this._hasDataChannelMediaSection){this._remoteSdp.receiveSctpAssociation();const e={type:"offer",sdp:this._remoteSdp.getSdp()};cl.debug("receiveDataChannel() | calling pc.setRemoteDescription() [offer:%o]",e),await this._pc.setRemoteDescription(e);const t=await this._pc.createAnswer();if(!this._transportReady){const e=Zd.parse(t.sdp);await this.setupTransport({localDtlsRole:null!==(i=this._forcedLocalDtlsRole)&&void 0!==i?i:"client",localSdpObject:e})}cl.debug("receiveDataChannel() | calling pc.setRemoteDescription() [answer:%o]",t),await this._pc.setLocalDescription(t),this._hasDataChannelMediaSection=!0}return{dataChannel:p}}async setupTransport({localDtlsRole:e,localSdpObject:t}){t||(t=Zd.parse(this._pc.localDescription.sdp));const n=il.extractDtlsParameters({sdpObject:t});n.role=e,this._remoteSdp.updateDtlsRole("client"===e?"server":"client"),await new Promise(((e,t)=>{this.safeEmit("@connect",{dtlsParameters:n},e,t)})),this._transportReady=!0}assertSendDirection(){if("send"!==this._direction)throw new Error('method can just be called for handlers with "send" direction')}assertRecvDirection(){if("recv"!==this._direction)throw new Error('method can just be called for handlers with "recv" direction')}}ud.Chrome74=dl;var ll={},ul=Xt&&Xt.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),ml=Xt&&Xt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),hl=Xt&&Xt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&ul(t,e,n);return ml(t,e),t};Object.defineProperty(ll,"__esModule",{value:!0}),ll.Chrome70=void 0;const fl=hl(md),gl=Vc,vl=hl(tp),bl=hl(np),yl=hl(Cd),_l=hl(Od),xl=Dd,wl=Md,Sl=Kd,kl=new gl.Logger("Chrome70"),Cl={OS:1024,MIS:1024};class Rl extends xl.HandlerInterface{static createFactory(){return()=>new Rl}constructor(){super(),this._mapMidTransceiver=new Map,this._sendStream=new MediaStream,this._hasDataChannelMediaSection=!1,this._nextSendSctpStreamId=0,this._transportReady=!1}get name(){return"Chrome70"}close(){if(kl.debug("close()"),this._pc)try{this._pc.close()}catch(e){}this.emit("@close")}async getNativeRtpCapabilities(){kl.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 n=fl.parse(t.sdp);return yl.extractRtpCapabilities({sdpObject:n})}catch(t){try{e.close()}catch(e){}throw t}}async getNativeSctpCapabilities(){return kl.debug("getNativeSctpCapabilities()"),{numStreams:Cl}}run({direction:e,iceParameters:t,iceCandidates:n,dtlsParameters:i,sctpParameters:s,iceServers:r,iceTransportPolicy:a,additionalSettings:o,proprietaryConstraints:c,extendedRtpCapabilities:p}){kl.debug("run()"),this._direction=e,this._remoteSdp=new wl.RemoteSdp({iceParameters:t,iceCandidates:n,dtlsParameters:i,sctpParameters:s}),this._sendingRtpParametersByKind={audio:bl.getSendingRtpParameters("audio",p),video:bl.getSendingRtpParameters("video",p)},this._sendingRemoteRtpParametersByKind={audio:bl.getSendingRemoteRtpParameters("audio",p),video:bl.getSendingRemoteRtpParameters("video",p)},i.role&&"auto"!==i.role&&(this._forcedLocalDtlsRole="server"===i.role?"client":"server"),this._pc=new RTCPeerConnection({iceServers:r||[],iceTransportPolicy:a||"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require",sdpSemantics:"unified-plan",...o},c),this._pc.connectionState?this._pc.addEventListener("connectionstatechange",(()=>{this.emit("@connectionstatechange",this._pc.connectionState)})):this._pc.addEventListener("iceconnectionstatechange",(()=>{switch(kl.warn("run() | pc.connectionState not supported, using pc.iceConnectionState"),this._pc.iceConnectionState){case"checking":this.emit("@connectionstatechange","connecting");break;case"connected":case"completed":this.emit("@connectionstatechange","connected");break;case"failed":this.emit("@connectionstatechange","failed");break;case"disconnected":this.emit("@connectionstatechange","disconnected");break;case"closed":this.emit("@connectionstatechange","closed")}}))}async updateIceServers(e){kl.debug("updateIceServers()");const t=this._pc.getConfiguration();t.iceServers=e,this._pc.setConfiguration(t)}async restartIce(e){if(kl.debug("restartIce()"),this._remoteSdp.updateIceParameters(e),this._transportReady)if("send"===this._direction){const e=await this._pc.createOffer({iceRestart:!0});kl.debug("restartIce() | calling pc.setLocalDescription() [offer:%o]",e),await this._pc.setLocalDescription(e);const t={type:"answer",sdp:this._remoteSdp.getSdp()};kl.debug("restartIce() | calling pc.setRemoteDescription() [answer:%o]",t),await this._pc.setRemoteDescription(t)}else{const e={type:"offer",sdp:this._remoteSdp.getSdp()};kl.debug("restartIce() | calling pc.setRemoteDescription() [offer:%o]",e),await this._pc.setRemoteDescription(e);const t=await this._pc.createAnswer();kl.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:n,codec:i}){var s;this.assertSendDirection(),kl.debug("send() [kind:%s, track.id:%s]",e.kind,e.id);const r=vl.clone(this._sendingRtpParametersByKind[e.kind],{});r.codecs=bl.reduceCodecs(r.codecs,i);const a=vl.clone(this._sendingRemoteRtpParametersByKind[e.kind],{});a.codecs=bl.reduceCodecs(a.codecs,i);const o=this._remoteSdp.getNextMediaSectionIdx(),c=this._pc.addTransceiver(e,{direction:"sendonly",streams:[this._sendStream]});let p,d=await this._pc.createOffer(),l=fl.parse(d.sdp);this._transportReady||await this.setupTransport({localDtlsRole:null!==(s=this._forcedLocalDtlsRole)&&void 0!==s?s:"client",localSdpObject:l}),t&&t.length>1&&(kl.debug("send() | enabling legacy simulcast"),l=fl.parse(d.sdp),p=l.media[o.idx],_l.addLegacySimulcast({offerMediaObject:p,numStreams:t.length}),d={type:"offer",sdp:fl.write(l)});let u=!1;const m=(0,Sl.parse)((t||[{}])[0].scalabilityMode);if(t&&1===t.length&&m.spatialLayers>1&&"video/vp9"===r.codecs[0].mimeType.toLowerCase()&&(kl.debug("send() | enabling legacy simulcast for VP9 SVC"),u=!0,l=fl.parse(d.sdp),p=l.media[o.idx],_l.addLegacySimulcast({offerMediaObject:p,numStreams:m.spatialLayers}),d={type:"offer",sdp:fl.write(l)}),kl.debug("send() | calling pc.setLocalDescription() [offer:%o]",d),await this._pc.setLocalDescription(d),t){kl.debug("send() | applying given encodings");const e=c.sender.getParameters();for(let n=0;n<(e.encodings||[]).length;++n){const i=e.encodings[n],s=t[n];if(!s)break;e.encodings[n]=Object.assign(i,s)}await c.sender.setParameters(e)}const h=c.mid;if(r.mid=h,l=fl.parse(this._pc.localDescription.sdp),p=l.media[o.idx],r.rtcp.cname=yl.getCname({offerMediaObject:p}),r.encodings=_l.getRtpEncodings({offerMediaObject:p}),t)for(let e=0;e<r.encodings.length;++e)t[e]&&Object.assign(r.encodings[e],t[e]);if(u&&(r.encodings=[r.encodings[0]]),r.encodings.length>1&&("video/vp8"===r.codecs[0].mimeType.toLowerCase()||"video/h264"===r.codecs[0].mimeType.toLowerCase()))for(const e of r.encodings)e.scalabilityMode="S1T3";this._remoteSdp.send({offerMediaObject:p,reuseMid:o.reuseMid,offerRtpParameters:r,answerRtpParameters:a,codecOptions:n});const f={type:"answer",sdp:this._remoteSdp.getSdp()};return kl.debug("send() | calling pc.setRemoteDescription() [answer:%o]",f),await this._pc.setRemoteDescription(f),this._mapMidTransceiver.set(h,c),{localId:h,rtpParameters:r,rtpSender:c.sender}}async stopSending(e){this.assertSendDirection(),kl.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);if(this._remoteSdp.closeMediaSection(t.mid))try{t.stop()}catch(e){}const n=await this._pc.createOffer();kl.debug("stopSending() | calling pc.setLocalDescription() [offer:%o]",n),await this._pc.setLocalDescription(n);const i={type:"answer",sdp:this._remoteSdp.getSdp()};kl.debug("stopSending() | calling pc.setRemoteDescription() [answer:%o]",i),await this._pc.setRemoteDescription(i),this._mapMidTransceiver.delete(e)}async pauseSending(e){}async resumeSending(e){}async replaceTrack(e,t){this.assertSendDirection(),t?kl.debug("replaceTrack() [localId:%s, track.id:%s]",e,t.id):kl.debug("replaceTrack() [localId:%s, no track]",e);const n=this._mapMidTransceiver.get(e);if(!n)throw new Error("associated RTCRtpTransceiver not found");await n.sender.replaceTrack(t)}async setMaxSpatialLayer(e,t){this.assertSendDirection(),kl.debug("setMaxSpatialLayer() [localId:%s, spatialLayer:%s]",e,t);const n=this._mapMidTransceiver.get(e);if(!n)throw new Error("associated RTCRtpTransceiver not found");const i=n.sender.getParameters();i.encodings.forEach(((e,n)=>{e.active=n<=t})),await n.sender.setParameters(i)}async setRtpEncodingParameters(e,t){this.assertSendDirection(),kl.debug("setRtpEncodingParameters() [localId:%s, params:%o]",e,t);const n=this._mapMidTransceiver.get(e);if(!n)throw new Error("associated RTCRtpTransceiver not found");const i=n.sender.getParameters();i.encodings.forEach(((e,n)=>{i.encodings[n]={...e,...t}})),await n.sender.setParameters(i)}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:n,label:i,protocol:s}){var r;this.assertSendDirection();const a={negotiated:!0,id:this._nextSendSctpStreamId,ordered:e,maxPacketLifeTime:t,maxRetransmitTime:t,maxRetransmits:n,protocol:s};kl.debug("sendDataChannel() [options:%o]",a);const o=this._pc.createDataChannel(i,a);if(this._nextSendSctpStreamId=++this._nextSendSctpStreamId%Cl.MIS,!this._hasDataChannelMediaSection){const e=await this._pc.createOffer(),t=fl.parse(e.sdp),n=t.media.find((e=>"application"===e.type));this._transportReady||await this.setupTransport({localDtlsRole:null!==(r=this._forcedLocalDtlsRole)&&void 0!==r?r:"client",localSdpObject:t}),kl.debug("sendDataChannel() | calling pc.setLocalDescription() [offer:%o]",e),await this._pc.setLocalDescription(e),this._remoteSdp.sendSctpAssociation({offerMediaObject:n});const i={type:"answer",sdp:this._remoteSdp.getSdp()};kl.debug("sendDataChannel() | calling pc.setRemoteDescription() [answer:%o]",i),await this._pc.setRemoteDescription(i),this._hasDataChannelMediaSection=!0}return{dataChannel:o,sctpStreamParameters:{streamId:a.id,ordered:a.ordered,maxPacketLifeTime:a.maxPacketLifeTime,maxRetransmits:a.maxRetransmits}}}async receive(e){var t;this.assertRecvDirection();const n=[],i=new Map;for(const t of e){const{trackId:e,kind:n,rtpParameters:s,streamId:r}=t;kl.debug("receive() [trackId:%s, kind:%s]",e,n);const a=s.mid||String(this._mapMidTransceiver.size);i.set(e,a),this._remoteSdp.receive({mid:a,kind:n,offerRtpParameters:s,streamId:r||s.rtcp.cname,trackId:e})}const s={type:"offer",sdp:this._remoteSdp.getSdp()};kl.debug("receive() | calling pc.setRemoteDescription() [offer:%o]",s),await this._pc.setRemoteDescription(s);let r=await this._pc.createAnswer();const a=fl.parse(r.sdp);for(const t of e){const{trackId:e,rtpParameters:n}=t,s=i.get(e),r=a.media.find((e=>String(e.mid)===s));yl.applyCodecParameters({offerRtpParameters:n,answerMediaObject:r})}r={type:"answer",sdp:fl.write(a)},this._transportReady||await this.setupTransport({localDtlsRole:null!==(t=this._forcedLocalDtlsRole)&&void 0!==t?t:"client",localSdpObject:a}),kl.debug("receive() | calling pc.setLocalDescription() [answer:%o]",r),await this._pc.setLocalDescription(r);for(const t of e){const{trackId:e}=t,s=i.get(e),r=this._pc.getTransceivers().find((e=>e.mid===s));if(!r)throw new Error("new RTCRtpTransceiver not found");this._mapMidTransceiver.set(s,r),n.push({localId:s,track:r.receiver.track,rtpReceiver:r.receiver})}return n}async stopReceiving(e){this.assertRecvDirection();for(const t of e){kl.debug("stopReceiving() [localId:%s]",t);const e=this._mapMidTransceiver.get(t);if(!e)throw new Error("associated RTCRtpTransceiver not found");this._remoteSdp.closeMediaSection(e.mid)}const t={type:"offer",sdp:this._remoteSdp.getSdp()};kl.debug("stopReceiving() | calling pc.setRemoteDescription() [offer:%o]",t),await this._pc.setRemoteDescription(t);const n=await this._pc.createAnswer();kl.debug("stopReceiving() | calling pc.setLocalDescription() [answer:%o]",n),await this._pc.setLocalDescription(n);for(const t of e)this._mapMidTransceiver.delete(t)}async pauseReceiving(e){}async resumeReceiving(e){}async getReceiverStats(e){this.assertRecvDirection();const t=this._mapMidTransceiver.get(e);if(!t)throw new Error("associated RTCRtpTransceiver not found");return t.receiver.getStats()}async receiveDataChannel({sctpStreamParameters:e,label:t,protocol:n}){var i;this.assertRecvDirection();const{streamId:s,ordered:r,maxPacketLifeTime:a,maxRetransmits:o}=e,c={negotiated:!0,id:s,ordered:r,maxPacketLifeTime:a,maxRetransmitTime:a,maxRetransmits:o,protocol:n};kl.debug("receiveDataChannel() [options:%o]",c);const p=this._pc.createDataChannel(t,c);if(!this._hasDataChannelMediaSection){this._remoteSdp.receiveSctpAssociation();const e={type:"offer",sdp:this._remoteSdp.getSdp()};kl.debug("receiveDataChannel() | calling pc.setRemoteDescription() [offer:%o]",e),await this._pc.setRemoteDescription(e);const t=await this._pc.createAnswer();if(!this._transportReady){const e=fl.parse(t.sdp);await this.setupTransport({localDtlsRole:null!==(i=this._forcedLocalDtlsRole)&&void 0!==i?i:"client",localSdpObject:e})}kl.debug("receiveDataChannel() | calling pc.setRemoteDescription() [answer:%o]",t),await this._pc.setLocalDescription(t),this._hasDataChannelMediaSection=!0}return{dataChannel:p}}async setupTransport({localDtlsRole:e,localSdpObject:t}){t||(t=fl.parse(this._pc.localDescription.sdp));const n=yl.extractDtlsParameters({sdpObject:t});n.role=e,this._remoteSdp.updateDtlsRole("client"===e?"server":"client"),await new Promise(((e,t)=>{this.safeEmit("@connect",{dtlsParameters:n},e,t)})),this._transportReady=!0}assertSendDirection(){if("send"!==this._direction)throw new Error('method can just be called for handlers with "send" direction')}assertRecvDirection(){if("recv"!==this._direction)throw new Error('method can just be called for handlers with "recv" direction')}}ll.Chrome70=Rl;var Tl={},Pl={};Object.defineProperty(Pl,"__esModule",{value:!0}),Pl.addLegacySimulcast=Pl.getRtpEncodings=void 0,Pl.getRtpEncodings=function({offerMediaObject:e,track:t}){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)}}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,s]=t.ssrcs.split(/\s+/);e=Number(e),s=Number(s),n.has(e)&&(n.delete(e),n.delete(s),i.set(e,s))}for(const e of n)i.set(e,null);const s=[];for(const[e,t]of i){const n={ssrc:e};t&&(n.rtx={ssrc:t}),s.push(n)}return s},Pl.addLegacySimulcast=function({offerMediaObject:e,track:t,numStreams:n}){if(n<=1)throw new TypeError("numStreams must be greater than 1");let i,s,r;if(!(e.ssrcs||[]).find((e=>{if("msid"!==e.attribute)return!1;return e.value.split(" ")[1]===t.id&&(i=e.id,r=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])===i&&(s=Number(t[1]),!0)}));const a=e.ssrcs.find((e=>"cname"===e.attribute&&e.id===i));if(!a)throw new Error(`a=ssrc line with cname information not found [track.id:${t.id}]`);const o=a.value,c=[],p=[];for(let e=0;e<n;++e)c.push(i+e),s&&p.push(s+e);e.ssrcGroups=e.ssrcGroups||[],e.ssrcs=e.ssrcs||[],e.ssrcGroups.push({semantics:"SIM",ssrcs:c.join(" ")});for(let n=0;n<c.length;++n){const i=c[n];e.ssrcs.push({id:i,attribute:"cname",value:o}),e.ssrcs.push({id:i,attribute:"msid",value:`${r} ${t.id}`})}for(let n=0;n<p.length;++n){const i=c[n],s=p[n];e.ssrcs.push({id:s,attribute:"cname",value:o}),e.ssrcs.push({id:s,attribute:"msid",value:`${r} ${t.id}`}),e.ssrcGroups.push({semantics:"FID",ssrcs:`${i} ${s}`})}};var El=Xt&&Xt.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),Ol=Xt&&Xt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Dl=Xt&&Xt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&El(t,e,n);return Ol(t,e),t};Object.defineProperty(Tl,"__esModule",{value:!0}),Tl.Chrome67=void 0;const jl=Dl(md),Il=Vc,Ml=Dl(tp),Ll=Dl(np),Al=Dl(Cd),Nl=Dl(Pl),Bl=Dd,Fl=Md,Ul=new Il.Logger("Chrome67"),zl={OS:1024,MIS:1024};class ql extends Bl.HandlerInterface{static createFactory(){return()=>new ql}constructor(){super(),this._sendStream=new MediaStream,this._mapSendLocalIdRtpSender=new Map,this._nextSendLocalId=0,this._mapRecvLocalIdInfo=new Map,this._hasDataChannelMediaSection=!1,this._nextSendSctpStreamId=0,this._transportReady=!1}get name(){return"Chrome67"}close(){if(Ul.debug("close()"),this._pc)try{this._pc.close()}catch(e){}this.emit("@close")}async getNativeRtpCapabilities(){Ul.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 n=jl.parse(t.sdp);return Al.extractRtpCapabilities({sdpObject:n})}catch(t){try{e.close()}catch(e){}throw t}}async getNativeSctpCapabilities(){return Ul.debug("getNativeSctpCapabilities()"),{numStreams:zl}}run({direction:e,iceParameters:t,iceCandidates:n,dtlsParameters:i,sctpParameters:s,iceServers:r,iceTransportPolicy:a,additionalSettings:o,proprietaryConstraints:c,extendedRtpCapabilities:p}){Ul.debug("run()"),this._direction=e,this._remoteSdp=new Fl.RemoteSdp({iceParameters:t,iceCandidates:n,dtlsParameters:i,sctpParameters:s,planB:!0}),this._sendingRtpParametersByKind={audio:Ll.getSendingRtpParameters("audio",p),video:Ll.getSendingRtpParameters("video",p)},this._sendingRemoteRtpParametersByKind={audio:Ll.getSendingRemoteRtpParameters("audio",p),video:Ll.getSendingRemoteRtpParameters("video",p)},i.role&&"auto"!==i.role&&(this._forcedLocalDtlsRole="server"===i.role?"client":"server"),this._pc=new RTCPeerConnection({iceServers:r||[],iceTransportPolicy:a||"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require",sdpSemantics:"plan-b",...o},c),this._pc.connectionState?this._pc.addEventListener("connectionstatechange",(()=>{this.emit("@connectionstatechange",this._pc.connectionState)})):this._pc.addEventListener("iceconnectionstatechange",(()=>{switch(Ul.warn("run() | pc.connectionState not supported, using pc.iceConnectionState"),this._pc.iceConnectionState){case"checking":this.emit("@connectionstatechange","connecting");break;case"connected":case"completed":this.emit("@connectionstatechange","connected");break;case"failed":this.emit("@connectionstatechange","failed");break;case"disconnected":this.emit("@connectionstatechange","disconnected");break;case"closed":this.emit("@connectionstatechange","closed")}}))}async updateIceServers(e){Ul.debug("updateIceServers()");const t=this._pc.getConfiguration();t.iceServers=e,this._pc.setConfiguration(t)}async restartIce(e){if(Ul.debug("restartIce()"),this._remoteSdp.updateIceParameters(e),this._transportReady)if("send"===this._direction){const e=await this._pc.createOffer({iceRestart:!0});Ul.debug("restartIce() | calling pc.setLocalDescription() [offer:%o]",e),await this._pc.setLocalDescription(e);const t={type:"answer",sdp:this._remoteSdp.getSdp()};Ul.debug("restartIce() | calling pc.setRemoteDescription() [answer:%o]",t),await this._pc.setRemoteDescription(t)}else{const e={type:"offer",sdp:this._remoteSdp.getSdp()};Ul.debug("restartIce() | calling pc.setRemoteDescription() [offer:%o]",e),await this._pc.setRemoteDescription(e);const t=await this._pc.createAnswer();Ul.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:n,codec:i}){var s;this.assertSendDirection(),Ul.debug("send() [kind:%s, track.id:%s]",e.kind,e.id),i&&Ul.warn("send() | codec selection is not available in %s handler",this.name),this._sendStream.addTrack(e),this._pc.addTrack(e,this._sendStream);let r,a=await this._pc.createOffer(),o=jl.parse(a.sdp);const c=Ml.clone(this._sendingRtpParametersByKind[e.kind],{});c.codecs=Ll.reduceCodecs(c.codecs);const p=Ml.clone(this._sendingRemoteRtpParametersByKind[e.kind],{});if(p.codecs=Ll.reduceCodecs(p.codecs),this._transportReady||await this.setupTransport({localDtlsRole:null!==(s=this._forcedLocalDtlsRole)&&void 0!==s?s:"client",localSdpObject:o}),"video"===e.kind&&t&&t.length>1&&(Ul.debug("send() | enabling simulcast"),o=jl.parse(a.sdp),r=o.media.find((e=>"video"===e.type)),Nl.addLegacySimulcast({offerMediaObject:r,track:e,numStreams:t.length}),a={type:"offer",sdp:jl.write(o)}),Ul.debug("send() | calling pc.setLocalDescription() [offer:%o]",a),await this._pc.setLocalDescription(a),o=jl.parse(this._pc.localDescription.sdp),r=o.media.find((t=>t.type===e.kind)),c.rtcp.cname=Al.getCname({offerMediaObject:r}),c.encodings=Nl.getRtpEncodings({offerMediaObject:r,track:e}),t)for(let e=0;e<c.encodings.length;++e)t[e]&&Object.assign(c.encodings[e],t[e]);if(c.encodings.length>1&&"video/vp8"===c.codecs[0].mimeType.toLowerCase())for(const e of c.encodings)e.scalabilityMode="S1T3";this._remoteSdp.send({offerMediaObject:r,offerRtpParameters:c,answerRtpParameters:p,codecOptions:n});const d={type:"answer",sdp:this._remoteSdp.getSdp()};Ul.debug("send() | calling pc.setRemoteDescription() [answer:%o]",d),await this._pc.setRemoteDescription(d);const l=String(this._nextSendLocalId);this._nextSendLocalId++;const u=this._pc.getSenders().find((t=>t.track===e));return this._mapSendLocalIdRtpSender.set(l,u),{localId:l,rtpParameters:c,rtpSender:u}}async stopSending(e){this.assertSendDirection(),Ul.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 n=await this._pc.createOffer();Ul.debug("stopSending() | calling pc.setLocalDescription() [offer:%o]",n);try{await this._pc.setLocalDescription(n)}catch(e){if(0===this._sendStream.getTracks().length)return void Ul.warn("stopSending() | ignoring expected error due no sending tracks: %s",e.toString());throw e}if("stable"===this._pc.signalingState)return;const i={type:"answer",sdp:this._remoteSdp.getSdp()};Ul.debug("stopSending() | calling pc.setRemoteDescription() [answer:%o]",i),await this._pc.setRemoteDescription(i)}async pauseSending(e){}async resumeSending(e){}async replaceTrack(e,t){this.assertSendDirection(),t?Ul.debug("replaceTrack() [localId:%s, track.id:%s]",e,t.id):Ul.debug("replaceTrack() [localId:%s, no track]",e);const n=this._mapSendLocalIdRtpSender.get(e);if(!n)throw new Error("associated RTCRtpSender not found");const i=n.track;await n.replaceTrack(t),i&&this._sendStream.removeTrack(i),t&&this._sendStream.addTrack(t)}async setMaxSpatialLayer(e,t){this.assertSendDirection(),Ul.debug("setMaxSpatialLayer() [localId:%s, spatialLayer:%s]",e,t);const n=this._mapSendLocalIdRtpSender.get(e);if(!n)throw new Error("associated RTCRtpSender not found");const i=n.getParameters();i.encodings.forEach(((e,n)=>{e.active=n<=t})),await n.setParameters(i)}async setRtpEncodingParameters(e,t){this.assertSendDirection(),Ul.debug("setRtpEncodingParameters() [localId:%s, params:%o]",e,t);const n=this._mapSendLocalIdRtpSender.get(e);if(!n)throw new Error("associated RTCRtpSender not found");const i=n.getParameters();i.encodings.forEach(((e,n)=>{i.encodings[n]={...e,...t}})),await n.setParameters(i)}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:n,label:i,protocol:s}){var r;this.assertSendDirection();const a={negotiated:!0,id:this._nextSendSctpStreamId,ordered:e,maxPacketLifeTime:t,maxRetransmitTime:t,maxRetransmits:n,protocol:s};Ul.debug("sendDataChannel() [options:%o]",a);const o=this._pc.createDataChannel(i,a);if(this._nextSendSctpStreamId=++this._nextSendSctpStreamId%zl.MIS,!this._hasDataChannelMediaSection){const e=await this._pc.createOffer(),t=jl.parse(e.sdp),n=t.media.find((e=>"application"===e.type));this._transportReady||await this.setupTransport({localDtlsRole:null!==(r=this._forcedLocalDtlsRole)&&void 0!==r?r:"client",localSdpObject:t}),Ul.debug("sendDataChannel() | calling pc.setLocalDescription() [offer:%o]",e),await this._pc.setLocalDescription(e),this._remoteSdp.sendSctpAssociation({offerMediaObject:n});const i={type:"answer",sdp:this._remoteSdp.getSdp()};Ul.debug("sendDataChannel() | calling pc.setRemoteDescription() [answer:%o]",i),await this._pc.setRemoteDescription(i),this._hasDataChannelMediaSection=!0}return{dataChannel:o,sctpStreamParameters:{streamId:a.id,ordered:a.ordered,maxPacketLifeTime:a.maxPacketLifeTime,maxRetransmits:a.maxRetransmits}}}async receive(e){var t;this.assertRecvDirection();const n=[];for(const t of e){const{trackId:e,kind:n,rtpParameters:i,streamId:s}=t;Ul.debug("receive() [trackId:%s, kind:%s]",e,n);const r=n;this._remoteSdp.receive({mid:r,kind:n,offerRtpParameters:i,streamId:s||i.rtcp.cname,trackId:e})}const i={type:"offer",sdp:this._remoteSdp.getSdp()};Ul.debug("receive() | calling pc.setRemoteDescription() [offer:%o]",i),await this._pc.setRemoteDescription(i);let s=await this._pc.createAnswer();const r=jl.parse(s.sdp);for(const t of e){const{kind:e,rtpParameters:n}=t,i=e,s=r.media.find((e=>String(e.mid)===i));Al.applyCodecParameters({offerRtpParameters:n,answerMediaObject:s})}s={type:"answer",sdp:jl.write(r)},this._transportReady||await this.setupTransport({localDtlsRole:null!==(t=this._forcedLocalDtlsRole)&&void 0!==t?t:"client",localSdpObject:r}),Ul.debug("receive() | calling pc.setLocalDescription() [answer:%o]",s),await this._pc.setLocalDescription(s);for(const t of e){const{kind:e,trackId:i,rtpParameters:s}=t,r=i,a=e,o=this._pc.getReceivers().find((e=>e.track&&e.track.id===r));if(!o)throw new Error("new RTCRtpReceiver not");this._mapRecvLocalIdInfo.set(r,{mid:a,rtpParameters:s,rtpReceiver:o}),n.push({localId:r,track:o.track,rtpReceiver:o})}return n}async stopReceiving(e){this.assertRecvDirection();for(const t of e){Ul.debug("stopReceiving() [localId:%s]",t);const{mid:e,rtpParameters:n}=this._mapRecvLocalIdInfo.get(t)||{};this._mapRecvLocalIdInfo.delete(t),this._remoteSdp.planBStopReceiving({mid:e,offerRtpParameters:n})}const t={type:"offer",sdp:this._remoteSdp.getSdp()};Ul.debug("stopReceiving() | calling pc.setRemoteDescription() [offer:%o]",t),await this._pc.setRemoteDescription(t);const n=await this._pc.createAnswer();Ul.debug("stopReceiving() | calling pc.setLocalDescription() [answer:%o]",n),await this._pc.setLocalDescription(n)}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:n}){var i;this.assertRecvDirection();const{streamId:s,ordered:r,maxPacketLifeTime:a,maxRetransmits:o}=e,c={negotiated:!0,id:s,ordered:r,maxPacketLifeTime:a,maxRetransmitTime:a,maxRetransmits:o,protocol:n};Ul.debug("receiveDataChannel() [options:%o]",c);const p=this._pc.createDataChannel(t,c);if(!this._hasDataChannelMediaSection){this._remoteSdp.receiveSctpAssociation({oldDataChannelSpec:!0});const e={type:"offer",sdp:this._remoteSdp.getSdp()};Ul.debug("receiveDataChannel() | calling pc.setRemoteDescription() [offer:%o]",e),await this._pc.setRemoteDescription(e);const t=await this._pc.createAnswer();if(!this._transportReady){const e=jl.parse(t.sdp);await this.setupTransport({localDtlsRole:null!==(i=this._forcedLocalDtlsRole)&&void 0!==i?i:"client",localSdpObject:e})}Ul.debug("receiveDataChannel() | calling pc.setRemoteDescription() [answer:%o]",t),await this._pc.setLocalDescription(t),this._hasDataChannelMediaSection=!0}return{dataChannel:p}}async setupTransport({localDtlsRole:e,localSdpObject:t}){t||(t=jl.parse(this._pc.localDescription.sdp));const n=Al.extractDtlsParameters({sdpObject:t});n.role=e,this._remoteSdp.updateDtlsRole("client"===e?"server":"client"),await new Promise(((e,t)=>{this.safeEmit("@connect",{dtlsParameters:n},e,t)})),this._transportReady=!0}assertSendDirection(){if("send"!==this._direction)throw new Error('method can just be called for handlers with "send" direction')}assertRecvDirection(){if("recv"!==this._direction)throw new Error('method can just be called for handlers with "recv" direction')}}Tl.Chrome67=ql;var $l={},Vl=Xt&&Xt.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),Hl=Xt&&Xt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Wl=Xt&&Xt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&Vl(t,e,n);return Hl(t,e),t};Object.defineProperty($l,"__esModule",{value:!0}),$l.Chrome55=void 0;const Gl=Wl(md),Kl=Vc,Jl=Xc,Ql=Wl(tp),Yl=Wl(np),Xl=Wl(Cd),Zl=Wl(Pl),eu=Dd,tu=Md,nu=new Kl.Logger("Chrome55"),iu={OS:1024,MIS:1024};class su extends eu.HandlerInterface{static createFactory(){return()=>new su}constructor(){super(),this._sendStream=new MediaStream,this._mapSendLocalIdTrack=new Map,this._nextSendLocalId=0,this._mapRecvLocalIdInfo=new Map,this._hasDataChannelMediaSection=!1,this._nextSendSctpStreamId=0,this._transportReady=!1}get name(){return"Chrome55"}close(){if(nu.debug("close()"),this._pc)try{this._pc.close()}catch(e){}this.emit("@close")}async getNativeRtpCapabilities(){nu.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 n=Gl.parse(t.sdp);return Xl.extractRtpCapabilities({sdpObject:n})}catch(t){try{e.close()}catch(e){}throw t}}async getNativeSctpCapabilities(){return nu.debug("getNativeSctpCapabilities()"),{numStreams:iu}}run({direction:e,iceParameters:t,iceCandidates:n,dtlsParameters:i,sctpParameters:s,iceServers:r,iceTransportPolicy:a,additionalSettings:o,proprietaryConstraints:c,extendedRtpCapabilities:p}){nu.debug("run()"),this._direction=e,this._remoteSdp=new tu.RemoteSdp({iceParameters:t,iceCandidates:n,dtlsParameters:i,sctpParameters:s,planB:!0}),this._sendingRtpParametersByKind={audio:Yl.getSendingRtpParameters("audio",p),video:Yl.getSendingRtpParameters("video",p)},this._sendingRemoteRtpParametersByKind={audio:Yl.getSendingRemoteRtpParameters("audio",p),video:Yl.getSendingRemoteRtpParameters("video",p)},i.role&&"auto"!==i.role&&(this._forcedLocalDtlsRole="server"===i.role?"client":"server"),this._pc=new RTCPeerConnection({iceServers:r||[],iceTransportPolicy:a||"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require",sdpSemantics:"plan-b",...o},c),this._pc.connectionState?this._pc.addEventListener("connectionstatechange",(()=>{this.emit("@connectionstatechange",this._pc.connectionState)})):this._pc.addEventListener("iceconnectionstatechange",(()=>{switch(nu.warn("run() | pc.connectionState not supported, using pc.iceConnectionState"),this._pc.iceConnectionState){case"checking":this.emit("@connectionstatechange","connecting");break;case"connected":case"completed":this.emit("@connectionstatechange","connected");break;case"failed":this.emit("@connectionstatechange","failed");break;case"disconnected":this.emit("@connectionstatechange","disconnected");break;case"closed":this.emit("@connectionstatechange","closed")}}))}async updateIceServers(e){nu.debug("updateIceServers()");const t=this._pc.getConfiguration();t.iceServers=e,this._pc.setConfiguration(t)}async restartIce(e){if(nu.debug("restartIce()"),this._remoteSdp.updateIceParameters(e),this._transportReady)if("send"===this._direction){const e=await this._pc.createOffer({iceRestart:!0});nu.debug("restartIce() | calling pc.setLocalDescription() [offer:%o]",e),await this._pc.setLocalDescription(e);const t={type:"answer",sdp:this._remoteSdp.getSdp()};nu.debug("restartIce() | calling pc.setRemoteDescription() [answer:%o]",t),await this._pc.setRemoteDescription(t)}else{const e={type:"offer",sdp:this._remoteSdp.getSdp()};nu.debug("restartIce() | calling pc.setRemoteDescription() [offer:%o]",e),await this._pc.setRemoteDescription(e);const t=await this._pc.createAnswer();nu.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:n,codec:i}){var s;this.assertSendDirection(),nu.debug("send() [kind:%s, track.id:%s]",e.kind,e.id),i&&nu.warn("send() | codec selection is not available in %s handler",this.name),this._sendStream.addTrack(e),this._pc.addStream(this._sendStream);let r,a=await this._pc.createOffer(),o=Gl.parse(a.sdp);const c=Ql.clone(this._sendingRtpParametersByKind[e.kind],{});c.codecs=Yl.reduceCodecs(c.codecs);const p=Ql.clone(this._sendingRemoteRtpParametersByKind[e.kind],{});if(p.codecs=Yl.reduceCodecs(p.codecs),this._transportReady||await this.setupTransport({localDtlsRole:null!==(s=this._forcedLocalDtlsRole)&&void 0!==s?s:"client",localSdpObject:o}),"video"===e.kind&&t&&t.length>1&&(nu.debug("send() | enabling simulcast"),o=Gl.parse(a.sdp),r=o.media.find((e=>"video"===e.type)),Zl.addLegacySimulcast({offerMediaObject:r,track:e,numStreams:t.length}),a={type:"offer",sdp:Gl.write(o)}),nu.debug("send() | calling pc.setLocalDescription() [offer:%o]",a),await this._pc.setLocalDescription(a),o=Gl.parse(this._pc.localDescription.sdp),r=o.media.find((t=>t.type===e.kind)),c.rtcp.cname=Xl.getCname({offerMediaObject:r}),c.encodings=Zl.getRtpEncodings({offerMediaObject:r,track:e}),t)for(let e=0;e<c.encodings.length;++e)t[e]&&Object.assign(c.encodings[e],t[e]);if(c.encodings.length>1&&"video/vp8"===c.codecs[0].mimeType.toLowerCase())for(const e of c.encodings)e.scalabilityMode="S1T3";this._remoteSdp.send({offerMediaObject:r,offerRtpParameters:c,answerRtpParameters:p,codecOptions:n});const d={type:"answer",sdp:this._remoteSdp.getSdp()};nu.debug("send() | calling pc.setRemoteDescription() [answer:%o]",d),await this._pc.setRemoteDescription(d);const l=String(this._nextSendLocalId);return this._nextSendLocalId++,this._mapSendLocalIdTrack.set(l,e),{localId:l,rtpParameters:c}}async stopSending(e){this.assertSendDirection(),nu.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 n=await this._pc.createOffer();nu.debug("stopSending() | calling pc.setLocalDescription() [offer:%o]",n);try{await this._pc.setLocalDescription(n)}catch(e){if(0===this._sendStream.getTracks().length)return void nu.warn("stopSending() | ignoring expected error due no sending tracks: %s",e.toString());throw e}if("stable"===this._pc.signalingState)return;const i={type:"answer",sdp:this._remoteSdp.getSdp()};nu.debug("stopSending() | calling pc.setRemoteDescription() [answer:%o]",i),await this._pc.setRemoteDescription(i)}async pauseSending(e){}async resumeSending(e){}async replaceTrack(e,t){throw new Jl.UnsupportedError("not implemented")}async setMaxSpatialLayer(e,t){throw new Jl.UnsupportedError(" not implemented")}async setRtpEncodingParameters(e,t){throw new Jl.UnsupportedError("not supported")}async getSenderStats(e){throw new Jl.UnsupportedError("not implemented")}async sendDataChannel({ordered:e,maxPacketLifeTime:t,maxRetransmits:n,label:i,protocol:s}){var r;this.assertSendDirection();const a={negotiated:!0,id:this._nextSendSctpStreamId,ordered:e,maxPacketLifeTime:t,maxRetransmitTime:t,maxRetransmits:n,protocol:s};nu.debug("sendDataChannel() [options:%o]",a);const o=this._pc.createDataChannel(i,a);if(this._nextSendSctpStreamId=++this._nextSendSctpStreamId%iu.MIS,!this._hasDataChannelMediaSection){const e=await this._pc.createOffer(),t=Gl.parse(e.sdp),n=t.media.find((e=>"application"===e.type));this._transportReady||await this.setupTransport({localDtlsRole:null!==(r=this._forcedLocalDtlsRole)&&void 0!==r?r:"client",localSdpObject:t}),nu.debug("sendDataChannel() | calling pc.setLocalDescription() [offer:%o]",e),await this._pc.setLocalDescription(e),this._remoteSdp.sendSctpAssociation({offerMediaObject:n});const i={type:"answer",sdp:this._remoteSdp.getSdp()};nu.debug("sendDataChannel() | calling pc.setRemoteDescription() [answer:%o]",i),await this._pc.setRemoteDescription(i),this._hasDataChannelMediaSection=!0}return{dataChannel:o,sctpStreamParameters:{streamId:a.id,ordered:a.ordered,maxPacketLifeTime:a.maxPacketLifeTime,maxRetransmits:a.maxRetransmits}}}async receive(e){var t;this.assertRecvDirection();const n=[];for(const t of e){const{trackId:e,kind:n,rtpParameters:i,streamId:s}=t;nu.debug("receive() [trackId:%s, kind:%s]",e,n);const r=n;this._remoteSdp.receive({mid:r,kind:n,offerRtpParameters:i,streamId:s||i.rtcp.cname,trackId:e})}const i={type:"offer",sdp:this._remoteSdp.getSdp()};nu.debug("receive() | calling pc.setRemoteDescription() [offer:%o]",i),await this._pc.setRemoteDescription(i);let s=await this._pc.createAnswer();const r=Gl.parse(s.sdp);for(const t of e){const{kind:e,rtpParameters:n}=t,i=e,s=r.media.find((e=>String(e.mid)===i));Xl.applyCodecParameters({offerRtpParameters:n,answerMediaObject:s})}s={type:"answer",sdp:Gl.write(r)},this._transportReady||await this.setupTransport({localDtlsRole:null!==(t=this._forcedLocalDtlsRole)&&void 0!==t?t:"client",localSdpObject:r}),nu.debug("receive() | calling pc.setLocalDescription() [answer:%o]",s),await this._pc.setLocalDescription(s);for(const t of e){const{kind:e,trackId:i,rtpParameters:s}=t,r=e,a=i,o=t.streamId||s.rtcp.cname,c=this._pc.getRemoteStreams().find((e=>e.id===o)),p=c.getTrackById(a);if(!p)throw new Error("remote track not found");this._mapRecvLocalIdInfo.set(a,{mid:r,rtpParameters:s}),n.push({localId:a,track:p})}return n}async stopReceiving(e){this.assertRecvDirection();for(const t of e){nu.debug("stopReceiving() [localId:%s]",t);const{mid:e,rtpParameters:n}=this._mapRecvLocalIdInfo.get(t)||{};this._mapRecvLocalIdInfo.delete(t),this._remoteSdp.planBStopReceiving({mid:e,offerRtpParameters:n})}const t={type:"offer",sdp:this._remoteSdp.getSdp()};nu.debug("stopReceiving() | calling pc.setRemoteDescription() [offer:%o]",t),await this._pc.setRemoteDescription(t);const n=await this._pc.createAnswer();nu.debug("stopReceiving() | calling pc.setLocalDescription() [answer:%o]",n),await this._pc.setLocalDescription(n)}async pauseReceiving(e){}async resumeReceiving(e){}async getReceiverStats(e){throw new Jl.UnsupportedError("not implemented")}async receiveDataChannel({sctpStreamParameters:e,label:t,protocol:n}){var i;this.assertRecvDirection();const{streamId:s,ordered:r,maxPacketLifeTime:a,maxRetransmits:o}=e,c={negotiated:!0,id:s,ordered:r,maxPacketLifeTime:a,maxRetransmitTime:a,maxRetransmits:o,protocol:n};nu.debug("receiveDataChannel() [options:%o]",c);const p=this._pc.createDataChannel(t,c);if(!this._hasDataChannelMediaSection){this._remoteSdp.receiveSctpAssociation({oldDataChannelSpec:!0});const e={type:"offer",sdp:this._remoteSdp.getSdp()};nu.debug("receiveDataChannel() | calling pc.setRemoteDescription() [offer:%o]",e),await this._pc.setRemoteDescription(e);const t=await this._pc.createAnswer();if(!this._transportReady){const e=Gl.parse(t.sdp);await this.setupTransport({localDtlsRole:null!==(i=this._forcedLocalDtlsRole)&&void 0!==i?i:"client",localSdpObject:e})}nu.debug("receiveDataChannel() | calling pc.setRemoteDescription() [answer:%o]",t),await this._pc.setLocalDescription(t),this._hasDataChannelMediaSection=!0}return{dataChannel:p}}async setupTransport({localDtlsRole:e,localSdpObject:t}){t||(t=Gl.parse(this._pc.localDescription.sdp));const n=Xl.extractDtlsParameters({sdpObject:t});n.role=e,this._remoteSdp.updateDtlsRole("client"===e?"server":"client"),await new Promise(((e,t)=>{this.safeEmit("@connect",{dtlsParameters:n},e,t)})),this._transportReady=!0}assertSendDirection(){if("send"!==this._direction)throw new Error('method can just be called for handlers with "send" direction')}assertRecvDirection(){if("recv"!==this._direction)throw new Error('method can just be called for handlers with "recv" direction')}}$l.Chrome55=su;var ru={},au=Xt&&Xt.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),ou=Xt&&Xt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),cu=Xt&&Xt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&au(t,e,n);return ou(t,e),t};Object.defineProperty(ru,"__esModule",{value:!0}),ru.Firefox60=void 0;const pu=cu(md),du=Vc,lu=Xc,uu=cu(tp),mu=cu(np),hu=cu(Cd),fu=cu(Od),gu=Dd,vu=Md,bu=new du.Logger("Firefox60"),yu={OS:16,MIS:2048};class _u extends gu.HandlerInterface{static createFactory(){return()=>new _u}constructor(){super(),this._mapMidTransceiver=new Map,this._sendStream=new MediaStream,this._hasDataChannelMediaSection=!1,this._nextSendSctpStreamId=0,this._transportReady=!1}get name(){return"Firefox60"}close(){if(bu.debug("close()"),this._pc)try{this._pc.close()}catch(e){}this.emit("@close")}async getNativeRtpCapabilities(){bu.debug("getNativeRtpCapabilities()");const e=new RTCPeerConnection({iceServers:[],iceTransportPolicy:"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require"}),t=document.createElement("canvas");t.getContext("2d");const n=t.captureStream().getVideoTracks()[0];try{e.addTransceiver("audio",{direction:"sendrecv"});const i=e.addTransceiver(n,{direction:"sendrecv"}),s=i.sender.getParameters(),r=[{rid:"r0",maxBitrate:1e5},{rid:"r1",maxBitrate:5e5}];s.encodings=r,await i.sender.setParameters(s);const a=await e.createOffer();try{t.remove()}catch(e){}try{n.stop()}catch(e){}try{e.close()}catch(e){}const o=pu.parse(a.sdp);return hu.extractRtpCapabilities({sdpObject:o})}catch(i){try{t.remove()}catch(e){}try{n.stop()}catch(e){}try{e.close()}catch(e){}throw i}}async getNativeSctpCapabilities(){return bu.debug("getNativeSctpCapabilities()"),{numStreams:yu}}run({direction:e,iceParameters:t,iceCandidates:n,dtlsParameters:i,sctpParameters:s,iceServers:r,iceTransportPolicy:a,additionalSettings:o,proprietaryConstraints:c,extendedRtpCapabilities:p}){bu.debug("run()"),this._direction=e,this._remoteSdp=new vu.RemoteSdp({iceParameters:t,iceCandidates:n,dtlsParameters:i,sctpParameters:s}),this._sendingRtpParametersByKind={audio:mu.getSendingRtpParameters("audio",p),video:mu.getSendingRtpParameters("video",p)},this._sendingRemoteRtpParametersByKind={audio:mu.getSendingRemoteRtpParameters("audio",p),video:mu.getSendingRemoteRtpParameters("video",p)},this._pc=new RTCPeerConnection({iceServers:r||[],iceTransportPolicy:a||"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require",...o},c),this._pc.connectionState?this._pc.addEventListener("connectionstatechange",(()=>{this.emit("@connectionstatechange",this._pc.connectionState)})):this._pc.addEventListener("iceconnectionstatechange",(()=>{switch(bu.warn("run() | pc.connectionState not supported, using pc.iceConnectionState"),this._pc.iceConnectionState){case"checking":this.emit("@connectionstatechange","connecting");break;case"connected":case"completed":this.emit("@connectionstatechange","connected");break;case"failed":this.emit("@connectionstatechange","failed");break;case"disconnected":this.emit("@connectionstatechange","disconnected");break;case"closed":this.emit("@connectionstatechange","closed")}}))}async updateIceServers(e){throw new lu.UnsupportedError("not supported")}async restartIce(e){if(bu.debug("restartIce()"),this._remoteSdp.updateIceParameters(e),this._transportReady)if("send"===this._direction){const e=await this._pc.createOffer({iceRestart:!0});bu.debug("restartIce() | calling pc.setLocalDescription() [offer:%o]",e),await this._pc.setLocalDescription(e);const t={type:"answer",sdp:this._remoteSdp.getSdp()};bu.debug("restartIce() | calling pc.setRemoteDescription() [answer:%o]",t),await this._pc.setRemoteDescription(t)}else{const e={type:"offer",sdp:this._remoteSdp.getSdp()};bu.debug("restartIce() | calling pc.setRemoteDescription() [offer:%o]",e),await this._pc.setRemoteDescription(e);const t=await this._pc.createAnswer();bu.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:n,codec:i}){this.assertSendDirection(),bu.debug("send() [kind:%s, track.id:%s]",e.kind,e.id),t&&(t=uu.clone(t,[])).length>1&&(t.forEach(((e,t)=>{e.rid=`r${t}`})),t.reverse());const s=uu.clone(this._sendingRtpParametersByKind[e.kind],{});s.codecs=mu.reduceCodecs(s.codecs,i);const r=uu.clone(this._sendingRemoteRtpParametersByKind[e.kind],{});r.codecs=mu.reduceCodecs(r.codecs,i);const a=this._pc.addTransceiver(e,{direction:"sendonly",streams:[this._sendStream]});if(t){const e=a.sender.getParameters();e.encodings=t,await a.sender.setParameters(e)}const o=await this._pc.createOffer();let c=pu.parse(o.sdp);this._transportReady||await this.setupTransport({localDtlsRole:"client",localSdpObject:c}),bu.debug("send() | calling pc.setLocalDescription() [offer:%o]",o),await this._pc.setLocalDescription(o);const p=a.mid;s.mid=p,c=pu.parse(this._pc.localDescription.sdp);const d=c.media[c.media.length-1];if(s.rtcp.cname=hu.getCname({offerMediaObject:d}),t)if(1===t.length){const e=fu.getRtpEncodings({offerMediaObject:d});Object.assign(e[0],t[0]),s.encodings=e}else s.encodings=t.reverse();else s.encodings=fu.getRtpEncodings({offerMediaObject:d});if(s.encodings.length>1&&("video/vp8"===s.codecs[0].mimeType.toLowerCase()||"video/h264"===s.codecs[0].mimeType.toLowerCase()))for(const e of s.encodings)e.scalabilityMode="S1T2";this._remoteSdp.send({offerMediaObject:d,offerRtpParameters:s,answerRtpParameters:r,codecOptions:n,extmapAllowMixed:!0});const l={type:"answer",sdp:this._remoteSdp.getSdp()};return bu.debug("send() | calling pc.setRemoteDescription() [answer:%o]",l),await this._pc.setRemoteDescription(l),this._mapMidTransceiver.set(p,a),{localId:p,rtpParameters:s,rtpSender:a.sender}}async stopSending(e){bu.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 n=await this._pc.createOffer();bu.debug("stopSending() | calling pc.setLocalDescription() [offer:%o]",n),await this._pc.setLocalDescription(n);const i={type:"answer",sdp:this._remoteSdp.getSdp()};bu.debug("stopSending() | calling pc.setRemoteDescription() [answer:%o]",i),await this._pc.setRemoteDescription(i),this._mapMidTransceiver.delete(e)}async pauseSending(e){this.assertSendDirection(),bu.debug("pauseSending() [localId:%s]",e);const t=this._mapMidTransceiver.get(e);if(!t)throw new Error("associated RTCRtpTransceiver not found");t.direction="inactive",this._remoteSdp.pauseMediaSection(e);const n=await this._pc.createOffer();bu.debug("pauseSending() | calling pc.setLocalDescription() [offer:%o]",n),await this._pc.setLocalDescription(n);const i={type:"answer",sdp:this._remoteSdp.getSdp()};bu.debug("pauseSending() | calling pc.setRemoteDescription() [answer:%o]",i),await this._pc.setRemoteDescription(i)}async resumeSending(e){this.assertSendDirection(),bu.debug("resumeSending() [localId:%s]",e);const t=this._mapMidTransceiver.get(e);if(!t)throw new Error("associated RTCRtpTransceiver not found");t.direction="sendonly",this._remoteSdp.resumeSendingMediaSection(e);const n=await this._pc.createOffer();bu.debug("resumeSending() | calling pc.setLocalDescription() [offer:%o]",n),await this._pc.setLocalDescription(n);const i={type:"answer",sdp:this._remoteSdp.getSdp()};bu.debug("resumeSending() | calling pc.setRemoteDescription() [answer:%o]",i),await this._pc.setRemoteDescription(i)}async replaceTrack(e,t){this.assertSendDirection(),t?bu.debug("replaceTrack() [localId:%s, track.id:%s]",e,t.id):bu.debug("replaceTrack() [localId:%s, no track]",e);const n=this._mapMidTransceiver.get(e);if(!n)throw new Error("associated RTCRtpTransceiver not found");await n.sender.replaceTrack(t)}async setMaxSpatialLayer(e,t){this.assertSendDirection(),bu.debug("setMaxSpatialLayer() [localId:%s, spatialLayer:%s]",e,t);const n=this._mapMidTransceiver.get(e);if(!n)throw new Error("associated transceiver not found");const i=n.sender.getParameters();t=i.encodings.length-1-t,i.encodings.forEach(((e,n)=>{e.active=n>=t})),await n.sender.setParameters(i)}async setRtpEncodingParameters(e,t){this.assertSendDirection(),bu.debug("setRtpEncodingParameters() [localId:%s, params:%o]",e,t);const n=this._mapMidTransceiver.get(e);if(!n)throw new Error("associated RTCRtpTransceiver not found");const i=n.sender.getParameters();i.encodings.forEach(((e,n)=>{i.encodings[n]={...e,...t}})),await n.sender.setParameters(i)}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:n,label:i,protocol:s}){this.assertSendDirection();const r={negotiated:!0,id:this._nextSendSctpStreamId,ordered:e,maxPacketLifeTime:t,maxRetransmits:n,protocol:s};bu.debug("sendDataChannel() [options:%o]",r);const a=this._pc.createDataChannel(i,r);if(this._nextSendSctpStreamId=++this._nextSendSctpStreamId%yu.MIS,!this._hasDataChannelMediaSection){const e=await this._pc.createOffer(),t=pu.parse(e.sdp),n=t.media.find((e=>"application"===e.type));this._transportReady||await this.setupTransport({localDtlsRole:"client",localSdpObject:t}),bu.debug("sendDataChannel() | calling pc.setLocalDescription() [offer:%o]",e),await this._pc.setLocalDescription(e),this._remoteSdp.sendSctpAssociation({offerMediaObject:n});const i={type:"answer",sdp:this._remoteSdp.getSdp()};bu.debug("sendDataChannel() | calling pc.setRemoteDescription() [answer:%o]",i),await this._pc.setRemoteDescription(i),this._hasDataChannelMediaSection=!0}return{dataChannel:a,sctpStreamParameters:{streamId:r.id,ordered:r.ordered,maxPacketLifeTime:r.maxPacketLifeTime,maxRetransmits:r.maxRetransmits}}}async receive(e){this.assertRecvDirection();const t=[],n=new Map;for(const t of e){const{trackId:e,kind:i,rtpParameters:s,streamId:r}=t;bu.debug("receive() [trackId:%s, kind:%s]",e,i);const a=s.mid||String(this._mapMidTransceiver.size);n.set(e,a),this._remoteSdp.receive({mid:a,kind:i,offerRtpParameters:s,streamId:r||s.rtcp.cname,trackId:e})}const i={type:"offer",sdp:this._remoteSdp.getSdp()};bu.debug("receive() | calling pc.setRemoteDescription() [offer:%o]",i),await this._pc.setRemoteDescription(i);let s=await this._pc.createAnswer();const r=pu.parse(s.sdp);for(const t of e){const{trackId:e,rtpParameters:i}=t,a=n.get(e),o=r.media.find((e=>String(e.mid)===a));hu.applyCodecParameters({offerRtpParameters:i,answerMediaObject:o}),s={type:"answer",sdp:pu.write(r)}}this._transportReady||await this.setupTransport({localDtlsRole:"client",localSdpObject:r}),bu.debug("receive() | calling pc.setLocalDescription() [answer:%o]",s),await this._pc.setLocalDescription(s);for(const i of e){const{trackId:e}=i,s=n.get(e),r=this._pc.getTransceivers().find((e=>e.mid===s));if(!r)throw new Error("new RTCRtpTransceiver not found");this._mapMidTransceiver.set(s,r),t.push({localId:s,track:r.receiver.track,rtpReceiver:r.receiver})}return t}async stopReceiving(e){this.assertRecvDirection();for(const t of e){bu.debug("stopReceiving() [localId:%s]",t);const e=this._mapMidTransceiver.get(t);if(!e)throw new Error("associated RTCRtpTransceiver not found");this._remoteSdp.closeMediaSection(e.mid)}const t={type:"offer",sdp:this._remoteSdp.getSdp()};bu.debug("stopReceiving() | calling pc.setRemoteDescription() [offer:%o]",t),await this._pc.setRemoteDescription(t);const n=await this._pc.createAnswer();bu.debug("stopReceiving() | calling pc.setLocalDescription() [answer:%o]",n),await this._pc.setLocalDescription(n);for(const t of e)this._mapMidTransceiver.delete(t)}async pauseReceiving(e){this.assertRecvDirection();for(const t of e){bu.debug("pauseReceiving() [localId:%s]",t);const e=this._mapMidTransceiver.get(t);if(!e)throw new Error("associated RTCRtpTransceiver not found");e.direction="inactive",this._remoteSdp.pauseMediaSection(t)}const t={type:"offer",sdp:this._remoteSdp.getSdp()};bu.debug("pauseReceiving() | calling pc.setRemoteDescription() [offer:%o]",t),await this._pc.setRemoteDescription(t);const n=await this._pc.createAnswer();bu.debug("pauseReceiving() | calling pc.setLocalDescription() [answer:%o]",n),await this._pc.setLocalDescription(n)}async resumeReceiving(e){this.assertRecvDirection();for(const t of e){bu.debug("resumeReceiving() [localId:%s]",t);const e=this._mapMidTransceiver.get(t);if(!e)throw new Error("associated RTCRtpTransceiver not found");e.direction="recvonly",this._remoteSdp.resumeReceivingMediaSection(t)}const t={type:"offer",sdp:this._remoteSdp.getSdp()};bu.debug("resumeReceiving() | calling pc.setRemoteDescription() [offer:%o]",t),await this._pc.setRemoteDescription(t);const n=await this._pc.createAnswer();bu.debug("resumeReceiving() | calling pc.setLocalDescription() [answer:%o]",n),await this._pc.setLocalDescription(n)}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:n}){this.assertRecvDirection();const{streamId:i,ordered:s,maxPacketLifeTime:r,maxRetransmits:a}=e,o={negotiated:!0,id:i,ordered:s,maxPacketLifeTime:r,maxRetransmits:a,protocol:n};bu.debug("receiveDataChannel() [options:%o]",o);const c=this._pc.createDataChannel(t,o);if(!this._hasDataChannelMediaSection){this._remoteSdp.receiveSctpAssociation();const e={type:"offer",sdp:this._remoteSdp.getSdp()};bu.debug("receiveDataChannel() | calling pc.setRemoteDescription() [offer:%o]",e),await this._pc.setRemoteDescription(e);const t=await this._pc.createAnswer();if(!this._transportReady){const e=pu.parse(t.sdp);await this.setupTransport({localDtlsRole:"client",localSdpObject:e})}bu.debug("receiveDataChannel() | calling pc.setRemoteDescription() [answer:%o]",t),await this._pc.setLocalDescription(t),this._hasDataChannelMediaSection=!0}return{dataChannel:c}}async setupTransport({localDtlsRole:e,localSdpObject:t}){t||(t=pu.parse(this._pc.localDescription.sdp));const n=hu.extractDtlsParameters({sdpObject:t});n.role=e,this._remoteSdp.updateDtlsRole("client"===e?"server":"client"),await new Promise(((e,t)=>{this.safeEmit("@connect",{dtlsParameters:n},e,t)})),this._transportReady=!0}assertSendDirection(){if("send"!==this._direction)throw new Error('method can just be called for handlers with "send" direction')}assertRecvDirection(){if("recv"!==this._direction)throw new Error('method can just be called for handlers with "recv" direction')}}ru.Firefox60=_u;var xu={},wu=Xt&&Xt.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),Su=Xt&&Xt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),ku=Xt&&Xt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&wu(t,e,n);return Su(t,e),t};Object.defineProperty(xu,"__esModule",{value:!0}),xu.Safari12=void 0;const Cu=ku(md),Ru=Vc,Tu=ku(tp),Pu=ku(np),Eu=ku(Cd),Ou=ku(Od),Du=Dd,ju=Md,Iu=new Ru.Logger("Safari12"),Mu={OS:1024,MIS:1024};class Lu extends Du.HandlerInterface{static createFactory(){return()=>new Lu}constructor(){super(),this._mapMidTransceiver=new Map,this._sendStream=new MediaStream,this._hasDataChannelMediaSection=!1,this._nextSendSctpStreamId=0,this._transportReady=!1}get name(){return"Safari12"}close(){if(Iu.debug("close()"),this._pc)try{this._pc.close()}catch(e){}this.emit("@close")}async getNativeRtpCapabilities(){Iu.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 n=Cu.parse(t.sdp);return Eu.extractRtpCapabilities({sdpObject:n})}catch(t){try{e.close()}catch(e){}throw t}}async getNativeSctpCapabilities(){return Iu.debug("getNativeSctpCapabilities()"),{numStreams:Mu}}run({direction:e,iceParameters:t,iceCandidates:n,dtlsParameters:i,sctpParameters:s,iceServers:r,iceTransportPolicy:a,additionalSettings:o,proprietaryConstraints:c,extendedRtpCapabilities:p}){Iu.debug("run()"),this._direction=e,this._remoteSdp=new ju.RemoteSdp({iceParameters:t,iceCandidates:n,dtlsParameters:i,sctpParameters:s}),this._sendingRtpParametersByKind={audio:Pu.getSendingRtpParameters("audio",p),video:Pu.getSendingRtpParameters("video",p)},this._sendingRemoteRtpParametersByKind={audio:Pu.getSendingRemoteRtpParameters("audio",p),video:Pu.getSendingRemoteRtpParameters("video",p)},i.role&&"auto"!==i.role&&(this._forcedLocalDtlsRole="server"===i.role?"client":"server"),this._pc=new RTCPeerConnection({iceServers:r||[],iceTransportPolicy:a||"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require",...o},c),this._pc.connectionState?this._pc.addEventListener("connectionstatechange",(()=>{this.emit("@connectionstatechange",this._pc.connectionState)})):this._pc.addEventListener("iceconnectionstatechange",(()=>{switch(Iu.warn("run() | pc.connectionState not supported, using pc.iceConnectionState"),this._pc.iceConnectionState){case"checking":this.emit("@connectionstatechange","connecting");break;case"connected":case"completed":this.emit("@connectionstatechange","connected");break;case"failed":this.emit("@connectionstatechange","failed");break;case"disconnected":this.emit("@connectionstatechange","disconnected");break;case"closed":this.emit("@connectionstatechange","closed")}}))}async updateIceServers(e){Iu.debug("updateIceServers()");const t=this._pc.getConfiguration();t.iceServers=e,this._pc.setConfiguration(t)}async restartIce(e){if(Iu.debug("restartIce()"),this._remoteSdp.updateIceParameters(e),this._transportReady)if("send"===this._direction){const e=await this._pc.createOffer({iceRestart:!0});Iu.debug("restartIce() | calling pc.setLocalDescription() [offer:%o]",e),await this._pc.setLocalDescription(e);const t={type:"answer",sdp:this._remoteSdp.getSdp()};Iu.debug("restartIce() | calling pc.setRemoteDescription() [answer:%o]",t),await this._pc.setRemoteDescription(t)}else{const e={type:"offer",sdp:this._remoteSdp.getSdp()};Iu.debug("restartIce() | calling pc.setRemoteDescription() [offer:%o]",e),await this._pc.setRemoteDescription(e);const t=await this._pc.createAnswer();Iu.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:n,codec:i}){var s;this.assertSendDirection(),Iu.debug("send() [kind:%s, track.id:%s]",e.kind,e.id);const r=Tu.clone(this._sendingRtpParametersByKind[e.kind],{});r.codecs=Pu.reduceCodecs(r.codecs,i);const a=Tu.clone(this._sendingRemoteRtpParametersByKind[e.kind],{});a.codecs=Pu.reduceCodecs(a.codecs,i);const o=this._remoteSdp.getNextMediaSectionIdx(),c=this._pc.addTransceiver(e,{direction:"sendonly",streams:[this._sendStream]});let p,d=await this._pc.createOffer(),l=Cu.parse(d.sdp);this._transportReady||await this.setupTransport({localDtlsRole:null!==(s=this._forcedLocalDtlsRole)&&void 0!==s?s:"client",localSdpObject:l}),t&&t.length>1&&(Iu.debug("send() | enabling legacy simulcast"),l=Cu.parse(d.sdp),p=l.media[o.idx],Ou.addLegacySimulcast({offerMediaObject:p,numStreams:t.length}),d={type:"offer",sdp:Cu.write(l)}),Iu.debug("send() | calling pc.setLocalDescription() [offer:%o]",d),await this._pc.setLocalDescription(d);const u=c.mid;if(r.mid=u,l=Cu.parse(this._pc.localDescription.sdp),p=l.media[o.idx],r.rtcp.cname=Eu.getCname({offerMediaObject:p}),r.encodings=Ou.getRtpEncodings({offerMediaObject:p}),t)for(let e=0;e<r.encodings.length;++e)t[e]&&Object.assign(r.encodings[e],t[e]);if(r.encodings.length>1&&("video/vp8"===r.codecs[0].mimeType.toLowerCase()||"video/h264"===r.codecs[0].mimeType.toLowerCase()))for(const e of r.encodings)e.scalabilityMode="S1T3";this._remoteSdp.send({offerMediaObject:p,reuseMid:o.reuseMid,offerRtpParameters:r,answerRtpParameters:a,codecOptions:n});const m={type:"answer",sdp:this._remoteSdp.getSdp()};return Iu.debug("send() | calling pc.setRemoteDescription() [answer:%o]",m),await this._pc.setRemoteDescription(m),this._mapMidTransceiver.set(u,c),{localId:u,rtpParameters:r,rtpSender:c.sender}}async stopSending(e){this.assertSendDirection(),Iu.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);if(this._remoteSdp.closeMediaSection(t.mid))try{t.stop()}catch(e){}const n=await this._pc.createOffer();Iu.debug("stopSending() | calling pc.setLocalDescription() [offer:%o]",n),await this._pc.setLocalDescription(n);const i={type:"answer",sdp:this._remoteSdp.getSdp()};Iu.debug("stopSending() | calling pc.setRemoteDescription() [answer:%o]",i),await this._pc.setRemoteDescription(i),this._mapMidTransceiver.delete(e)}async pauseSending(e){this.assertSendDirection(),Iu.debug("pauseSending() [localId:%s]",e);const t=this._mapMidTransceiver.get(e);if(!t)throw new Error("associated RTCRtpTransceiver not found");t.direction="inactive",this._remoteSdp.pauseMediaSection(e);const n=await this._pc.createOffer();Iu.debug("pauseSending() | calling pc.setLocalDescription() [offer:%o]",n),await this._pc.setLocalDescription(n);const i={type:"answer",sdp:this._remoteSdp.getSdp()};Iu.debug("pauseSending() | calling pc.setRemoteDescription() [answer:%o]",i),await this._pc.setRemoteDescription(i)}async resumeSending(e){this.assertSendDirection(),Iu.debug("resumeSending() [localId:%s]",e);const t=this._mapMidTransceiver.get(e);if(!t)throw new Error("associated RTCRtpTransceiver not found");t.direction="sendonly",this._remoteSdp.resumeSendingMediaSection(e);const n=await this._pc.createOffer();Iu.debug("resumeSending() | calling pc.setLocalDescription() [offer:%o]",n),await this._pc.setLocalDescription(n);const i={type:"answer",sdp:this._remoteSdp.getSdp()};Iu.debug("resumeSending() | calling pc.setRemoteDescription() [answer:%o]",i),await this._pc.setRemoteDescription(i)}async replaceTrack(e,t){this.assertSendDirection(),t?Iu.debug("replaceTrack() [localId:%s, track.id:%s]",e,t.id):Iu.debug("replaceTrack() [localId:%s, no track]",e);const n=this._mapMidTransceiver.get(e);if(!n)throw new Error("associated RTCRtpTransceiver not found");await n.sender.replaceTrack(t)}async setMaxSpatialLayer(e,t){this.assertSendDirection(),Iu.debug("setMaxSpatialLayer() [localId:%s, spatialLayer:%s]",e,t);const n=this._mapMidTransceiver.get(e);if(!n)throw new Error("associated RTCRtpTransceiver not found");const i=n.sender.getParameters();i.encodings.forEach(((e,n)=>{e.active=n<=t})),await n.sender.setParameters(i)}async setRtpEncodingParameters(e,t){this.assertSendDirection(),Iu.debug("setRtpEncodingParameters() [localId:%s, params:%o]",e,t);const n=this._mapMidTransceiver.get(e);if(!n)throw new Error("associated RTCRtpTransceiver not found");const i=n.sender.getParameters();i.encodings.forEach(((e,n)=>{i.encodings[n]={...e,...t}})),await n.sender.setParameters(i)}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:n,label:i,protocol:s}){var r;this.assertSendDirection();const a={negotiated:!0,id:this._nextSendSctpStreamId,ordered:e,maxPacketLifeTime:t,maxRetransmits:n,protocol:s};Iu.debug("sendDataChannel() [options:%o]",a);const o=this._pc.createDataChannel(i,a);if(this._nextSendSctpStreamId=++this._nextSendSctpStreamId%Mu.MIS,!this._hasDataChannelMediaSection){const e=await this._pc.createOffer(),t=Cu.parse(e.sdp),n=t.media.find((e=>"application"===e.type));this._transportReady||await this.setupTransport({localDtlsRole:null!==(r=this._forcedLocalDtlsRole)&&void 0!==r?r:"client",localSdpObject:t}),Iu.debug("sendDataChannel() | calling pc.setLocalDescription() [offer:%o]",e),await this._pc.setLocalDescription(e),this._remoteSdp.sendSctpAssociation({offerMediaObject:n});const i={type:"answer",sdp:this._remoteSdp.getSdp()};Iu.debug("sendDataChannel() | calling pc.setRemoteDescription() [answer:%o]",i),await this._pc.setRemoteDescription(i),this._hasDataChannelMediaSection=!0}return{dataChannel:o,sctpStreamParameters:{streamId:a.id,ordered:a.ordered,maxPacketLifeTime:a.maxPacketLifeTime,maxRetransmits:a.maxRetransmits}}}async receive(e){var t;this.assertRecvDirection();const n=[],i=new Map;for(const t of e){const{trackId:e,kind:n,rtpParameters:s,streamId:r}=t;Iu.debug("receive() [trackId:%s, kind:%s]",e,n);const a=s.mid||String(this._mapMidTransceiver.size);i.set(e,a),this._remoteSdp.receive({mid:a,kind:n,offerRtpParameters:s,streamId:r||s.rtcp.cname,trackId:e})}const s={type:"offer",sdp:this._remoteSdp.getSdp()};Iu.debug("receive() | calling pc.setRemoteDescription() [offer:%o]",s),await this._pc.setRemoteDescription(s);let r=await this._pc.createAnswer();const a=Cu.parse(r.sdp);for(const t of e){const{trackId:e,rtpParameters:n}=t,s=i.get(e),r=a.media.find((e=>String(e.mid)===s));Eu.applyCodecParameters({offerRtpParameters:n,answerMediaObject:r})}r={type:"answer",sdp:Cu.write(a)},this._transportReady||await this.setupTransport({localDtlsRole:null!==(t=this._forcedLocalDtlsRole)&&void 0!==t?t:"client",localSdpObject:a}),Iu.debug("receive() | calling pc.setLocalDescription() [answer:%o]",r),await this._pc.setLocalDescription(r);for(const t of e){const{trackId:e}=t,s=i.get(e),r=this._pc.getTransceivers().find((e=>e.mid===s));if(!r)throw new Error("new RTCRtpTransceiver not found");this._mapMidTransceiver.set(s,r),n.push({localId:s,track:r.receiver.track,rtpReceiver:r.receiver})}return n}async stopReceiving(e){this.assertRecvDirection();for(const t of e){Iu.debug("stopReceiving() [localId:%s]",t);const e=this._mapMidTransceiver.get(t);if(!e)throw new Error("associated RTCRtpTransceiver not found");this._remoteSdp.closeMediaSection(e.mid)}const t={type:"offer",sdp:this._remoteSdp.getSdp()};Iu.debug("stopReceiving() | calling pc.setRemoteDescription() [offer:%o]",t),await this._pc.setRemoteDescription(t);const n=await this._pc.createAnswer();Iu.debug("stopReceiving() | calling pc.setLocalDescription() [answer:%o]",n),await this._pc.setLocalDescription(n);for(const t of e)this._mapMidTransceiver.delete(t)}async pauseReceiving(e){this.assertRecvDirection();for(const t of e){Iu.debug("pauseReceiving() [localId:%s]",t);const e=this._mapMidTransceiver.get(t);if(!e)throw new Error("associated RTCRtpTransceiver not found");e.direction="inactive",this._remoteSdp.pauseMediaSection(t)}const t={type:"offer",sdp:this._remoteSdp.getSdp()};Iu.debug("pauseReceiving() | calling pc.setRemoteDescription() [offer:%o]",t),await this._pc.setRemoteDescription(t);const n=await this._pc.createAnswer();Iu.debug("pauseReceiving() | calling pc.setLocalDescription() [answer:%o]",n),await this._pc.setLocalDescription(n)}async resumeReceiving(e){this.assertRecvDirection();for(const t of e){Iu.debug("resumeReceiving() [localId:%s]",t);const e=this._mapMidTransceiver.get(t);if(!e)throw new Error("associated RTCRtpTransceiver not found");e.direction="recvonly",this._remoteSdp.resumeReceivingMediaSection(t)}const t={type:"offer",sdp:this._remoteSdp.getSdp()};Iu.debug("resumeReceiving() | calling pc.setRemoteDescription() [offer:%o]",t),await this._pc.setRemoteDescription(t);const n=await this._pc.createAnswer();Iu.debug("resumeReceiving() | calling pc.setLocalDescription() [answer:%o]",n),await this._pc.setLocalDescription(n)}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:n}){var i;this.assertRecvDirection();const{streamId:s,ordered:r,maxPacketLifeTime:a,maxRetransmits:o}=e,c={negotiated:!0,id:s,ordered:r,maxPacketLifeTime:a,maxRetransmits:o,protocol:n};Iu.debug("receiveDataChannel() [options:%o]",c);const p=this._pc.createDataChannel(t,c);if(!this._hasDataChannelMediaSection){this._remoteSdp.receiveSctpAssociation();const e={type:"offer",sdp:this._remoteSdp.getSdp()};Iu.debug("receiveDataChannel() | calling pc.setRemoteDescription() [offer:%o]",e),await this._pc.setRemoteDescription(e);const t=await this._pc.createAnswer();if(!this._transportReady){const e=Cu.parse(t.sdp);await this.setupTransport({localDtlsRole:null!==(i=this._forcedLocalDtlsRole)&&void 0!==i?i:"client",localSdpObject:e})}Iu.debug("receiveDataChannel() | calling pc.setRemoteDescription() [answer:%o]",t),await this._pc.setLocalDescription(t),this._hasDataChannelMediaSection=!0}return{dataChannel:p}}async setupTransport({localDtlsRole:e,localSdpObject:t}){t||(t=Cu.parse(this._pc.localDescription.sdp));const n=Eu.extractDtlsParameters({sdpObject:t});n.role=e,this._remoteSdp.updateDtlsRole("client"===e?"server":"client"),await new Promise(((e,t)=>{this.safeEmit("@connect",{dtlsParameters:n},e,t)})),this._transportReady=!0}assertSendDirection(){if("send"!==this._direction)throw new Error('method can just be called for handlers with "send" direction')}assertRecvDirection(){if("recv"!==this._direction)throw new Error('method can just be called for handlers with "recv" direction')}}xu.Safari12=Lu;var Au={},Nu=Xt&&Xt.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),Bu=Xt&&Xt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Fu=Xt&&Xt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&Nu(t,e,n);return Bu(t,e),t};Object.defineProperty(Au,"__esModule",{value:!0}),Au.Safari11=void 0;const Uu=Fu(md),zu=Vc,qu=Fu(tp),$u=Fu(np),Vu=Fu(Cd),Hu=Fu(Pl),Wu=Dd,Gu=Md,Ku=new zu.Logger("Safari11"),Ju={OS:1024,MIS:1024};class Qu extends Wu.HandlerInterface{static createFactory(){return()=>new Qu}constructor(){super(),this._sendStream=new MediaStream,this._mapSendLocalIdRtpSender=new Map,this._nextSendLocalId=0,this._mapRecvLocalIdInfo=new Map,this._hasDataChannelMediaSection=!1,this._nextSendSctpStreamId=0,this._transportReady=!1}get name(){return"Safari11"}close(){if(Ku.debug("close()"),this._pc)try{this._pc.close()}catch(e){}this.emit("@close")}async getNativeRtpCapabilities(){Ku.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 n=Uu.parse(t.sdp);return Vu.extractRtpCapabilities({sdpObject:n})}catch(t){try{e.close()}catch(e){}throw t}}async getNativeSctpCapabilities(){return Ku.debug("getNativeSctpCapabilities()"),{numStreams:Ju}}run({direction:e,iceParameters:t,iceCandidates:n,dtlsParameters:i,sctpParameters:s,iceServers:r,iceTransportPolicy:a,additionalSettings:o,proprietaryConstraints:c,extendedRtpCapabilities:p}){Ku.debug("run()"),this._direction=e,this._remoteSdp=new Gu.RemoteSdp({iceParameters:t,iceCandidates:n,dtlsParameters:i,sctpParameters:s,planB:!0}),this._sendingRtpParametersByKind={audio:$u.getSendingRtpParameters("audio",p),video:$u.getSendingRtpParameters("video",p)},this._sendingRemoteRtpParametersByKind={audio:$u.getSendingRemoteRtpParameters("audio",p),video:$u.getSendingRemoteRtpParameters("video",p)},i.role&&"auto"!==i.role&&(this._forcedLocalDtlsRole="server"===i.role?"client":"server"),this._pc=new RTCPeerConnection({iceServers:r||[],iceTransportPolicy:a||"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require",...o},c),this._pc.connectionState?this._pc.addEventListener("connectionstatechange",(()=>{this.emit("@connectionstatechange",this._pc.connectionState)})):this._pc.addEventListener("iceconnectionstatechange",(()=>{switch(Ku.warn("run() | pc.connectionState not supported, using pc.iceConnectionState"),this._pc.iceConnectionState){case"checking":this.emit("@connectionstatechange","connecting");break;case"connected":case"completed":this.emit("@connectionstatechange","connected");break;case"failed":this.emit("@connectionstatechange","failed");break;case"disconnected":this.emit("@connectionstatechange","disconnected");break;case"closed":this.emit("@connectionstatechange","closed")}}))}async updateIceServers(e){Ku.debug("updateIceServers()");const t=this._pc.getConfiguration();t.iceServers=e,this._pc.setConfiguration(t)}async restartIce(e){if(Ku.debug("restartIce()"),this._remoteSdp.updateIceParameters(e),this._transportReady)if("send"===this._direction){const e=await this._pc.createOffer({iceRestart:!0});Ku.debug("restartIce() | calling pc.setLocalDescription() [offer:%o]",e),await this._pc.setLocalDescription(e);const t={type:"answer",sdp:this._remoteSdp.getSdp()};Ku.debug("restartIce() | calling pc.setRemoteDescription() [answer:%o]",t),await this._pc.setRemoteDescription(t)}else{const e={type:"offer",sdp:this._remoteSdp.getSdp()};Ku.debug("restartIce() | calling pc.setRemoteDescription() [offer:%o]",e),await this._pc.setRemoteDescription(e);const t=await this._pc.createAnswer();Ku.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:n,codec:i}){var s;this.assertSendDirection(),Ku.debug("send() [kind:%s, track.id:%s]",e.kind,e.id),i&&Ku.warn("send() | codec selection is not available in %s handler",this.name),this._sendStream.addTrack(e),this._pc.addTrack(e,this._sendStream);let r,a=await this._pc.createOffer(),o=Uu.parse(a.sdp);const c=qu.clone(this._sendingRtpParametersByKind[e.kind],{});c.codecs=$u.reduceCodecs(c.codecs);const p=qu.clone(this._sendingRemoteRtpParametersByKind[e.kind],{});if(p.codecs=$u.reduceCodecs(p.codecs),this._transportReady||await this.setupTransport({localDtlsRole:null!==(s=this._forcedLocalDtlsRole)&&void 0!==s?s:"client",localSdpObject:o}),"video"===e.kind&&t&&t.length>1&&(Ku.debug("send() | enabling simulcast"),o=Uu.parse(a.sdp),r=o.media.find((e=>"video"===e.type)),Hu.addLegacySimulcast({offerMediaObject:r,track:e,numStreams:t.length}),a={type:"offer",sdp:Uu.write(o)}),Ku.debug("send() | calling pc.setLocalDescription() [offer:%o]",a),await this._pc.setLocalDescription(a),o=Uu.parse(this._pc.localDescription.sdp),r=o.media.find((t=>t.type===e.kind)),c.rtcp.cname=Vu.getCname({offerMediaObject:r}),c.encodings=Hu.getRtpEncodings({offerMediaObject:r,track:e}),t)for(let e=0;e<c.encodings.length;++e)t[e]&&Object.assign(c.encodings[e],t[e]);if(c.encodings.length>1&&"video/vp8"===c.codecs[0].mimeType.toLowerCase())for(const e of c.encodings)e.scalabilityMode="S1T3";this._remoteSdp.send({offerMediaObject:r,offerRtpParameters:c,answerRtpParameters:p,codecOptions:n});const d={type:"answer",sdp:this._remoteSdp.getSdp()};Ku.debug("send() | calling pc.setRemoteDescription() [answer:%o]",d),await this._pc.setRemoteDescription(d);const l=String(this._nextSendLocalId);this._nextSendLocalId++;const u=this._pc.getSenders().find((t=>t.track===e));return this._mapSendLocalIdRtpSender.set(l,u),{localId:l,rtpParameters:c,rtpSender:u}}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 n=await this._pc.createOffer();Ku.debug("stopSending() | calling pc.setLocalDescription() [offer:%o]",n);try{await this._pc.setLocalDescription(n)}catch(e){if(0===this._sendStream.getTracks().length)return void Ku.warn("stopSending() | ignoring expected error due no sending tracks: %s",e.toString());throw e}if("stable"===this._pc.signalingState)return;const i={type:"answer",sdp:this._remoteSdp.getSdp()};Ku.debug("stopSending() | calling pc.setRemoteDescription() [answer:%o]",i),await this._pc.setRemoteDescription(i)}async pauseSending(e){}async resumeSending(e){}async replaceTrack(e,t){this.assertSendDirection(),t?Ku.debug("replaceTrack() [localId:%s, track.id:%s]",e,t.id):Ku.debug("replaceTrack() [localId:%s, no track]",e);const n=this._mapSendLocalIdRtpSender.get(e);if(!n)throw new Error("associated RTCRtpSender not found");const i=n.track;await n.replaceTrack(t),i&&this._sendStream.removeTrack(i),t&&this._sendStream.addTrack(t)}async setMaxSpatialLayer(e,t){this.assertSendDirection(),Ku.debug("setMaxSpatialLayer() [localId:%s, spatialLayer:%s]",e,t);const n=this._mapSendLocalIdRtpSender.get(e);if(!n)throw new Error("associated RTCRtpSender not found");const i=n.getParameters();i.encodings.forEach(((e,n)=>{e.active=n<=t})),await n.setParameters(i)}async setRtpEncodingParameters(e,t){this.assertSendDirection(),Ku.debug("setRtpEncodingParameters() [localId:%s, params:%o]",e,t);const n=this._mapSendLocalIdRtpSender.get(e);if(!n)throw new Error("associated RTCRtpSender not found");const i=n.getParameters();i.encodings.forEach(((e,n)=>{i.encodings[n]={...e,...t}})),await n.setParameters(i)}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:n,label:i,protocol:s}){var r;this.assertSendDirection();const a={negotiated:!0,id:this._nextSendSctpStreamId,ordered:e,maxPacketLifeTime:t,maxRetransmits:n,protocol:s};Ku.debug("sendDataChannel() [options:%o]",a);const o=this._pc.createDataChannel(i,a);if(this._nextSendSctpStreamId=++this._nextSendSctpStreamId%Ju.MIS,!this._hasDataChannelMediaSection){const e=await this._pc.createOffer(),t=Uu.parse(e.sdp),n=t.media.find((e=>"application"===e.type));this._transportReady||await this.setupTransport({localDtlsRole:null!==(r=this._forcedLocalDtlsRole)&&void 0!==r?r:"client",localSdpObject:t}),Ku.debug("sendDataChannel() | calling pc.setLocalDescription() [offer:%o]",e),await this._pc.setLocalDescription(e),this._remoteSdp.sendSctpAssociation({offerMediaObject:n});const i={type:"answer",sdp:this._remoteSdp.getSdp()};Ku.debug("sendDataChannel() | calling pc.setRemoteDescription() [answer:%o]",i),await this._pc.setRemoteDescription(i),this._hasDataChannelMediaSection=!0}return{dataChannel:o,sctpStreamParameters:{streamId:a.id,ordered:a.ordered,maxPacketLifeTime:a.maxPacketLifeTime,maxRetransmits:a.maxRetransmits}}}async receive(e){var t;this.assertRecvDirection();const n=[];for(const t of e){const{trackId:e,kind:n,rtpParameters:i,streamId:s}=t;Ku.debug("receive() [trackId:%s, kind:%s]",e,n);const r=n;this._remoteSdp.receive({mid:r,kind:n,offerRtpParameters:i,streamId:s||i.rtcp.cname,trackId:e})}const i={type:"offer",sdp:this._remoteSdp.getSdp()};Ku.debug("receive() | calling pc.setRemoteDescription() [offer:%o]",i),await this._pc.setRemoteDescription(i);let s=await this._pc.createAnswer();const r=Uu.parse(s.sdp);for(const t of e){const{kind:e,rtpParameters:n}=t,i=e,s=r.media.find((e=>String(e.mid)===i));Vu.applyCodecParameters({offerRtpParameters:n,answerMediaObject:s})}s={type:"answer",sdp:Uu.write(r)},this._transportReady||await this.setupTransport({localDtlsRole:null!==(t=this._forcedLocalDtlsRole)&&void 0!==t?t:"client",localSdpObject:r}),Ku.debug("receive() | calling pc.setLocalDescription() [answer:%o]",s),await this._pc.setLocalDescription(s);for(const t of e){const{kind:e,trackId:i,rtpParameters:s}=t,r=e,a=i,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:r,rtpParameters:s,rtpReceiver:o}),n.push({localId:a,track:o.track,rtpReceiver:o})}return n}async stopReceiving(e){this.assertRecvDirection();for(const t of e){Ku.debug("stopReceiving() [localId:%s]",t);const{mid:e,rtpParameters:n}=this._mapRecvLocalIdInfo.get(t)||{};this._mapRecvLocalIdInfo.delete(t),this._remoteSdp.planBStopReceiving({mid:e,offerRtpParameters:n})}const t={type:"offer",sdp:this._remoteSdp.getSdp()};Ku.debug("stopReceiving() | calling pc.setRemoteDescription() [offer:%o]",t),await this._pc.setRemoteDescription(t);const n=await this._pc.createAnswer();Ku.debug("stopReceiving() | calling pc.setLocalDescription() [answer:%o]",n),await this._pc.setLocalDescription(n)}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:n}){var i;this.assertRecvDirection();const{streamId:s,ordered:r,maxPacketLifeTime:a,maxRetransmits:o}=e,c={negotiated:!0,id:s,ordered:r,maxPacketLifeTime:a,maxRetransmits:o,protocol:n};Ku.debug("receiveDataChannel() [options:%o]",c);const p=this._pc.createDataChannel(t,c);if(!this._hasDataChannelMediaSection){this._remoteSdp.receiveSctpAssociation({oldDataChannelSpec:!0});const e={type:"offer",sdp:this._remoteSdp.getSdp()};Ku.debug("receiveDataChannel() | calling pc.setRemoteDescription() [offer:%o]",e),await this._pc.setRemoteDescription(e);const t=await this._pc.createAnswer();if(!this._transportReady){const e=Uu.parse(t.sdp);await this.setupTransport({localDtlsRole:null!==(i=this._forcedLocalDtlsRole)&&void 0!==i?i:"client",localSdpObject:e})}Ku.debug("receiveDataChannel() | calling pc.setRemoteDescription() [answer:%o]",t),await this._pc.setLocalDescription(t),this._hasDataChannelMediaSection=!0}return{dataChannel:p}}async setupTransport({localDtlsRole:e,localSdpObject:t}){t||(t=Uu.parse(this._pc.localDescription.sdp));const n=Vu.extractDtlsParameters({sdpObject:t});n.role=e,this._remoteSdp.updateDtlsRole("client"===e?"server":"client"),await new Promise(((e,t)=>{this.safeEmit("@connect",{dtlsParameters:n},e,t)})),this._transportReady=!0}assertSendDirection(){if("send"!==this._direction)throw new Error('method can just be called for handlers with "send" direction')}assertRecvDirection(){if("recv"!==this._direction)throw new Error('method can just be called for handlers with "recv" direction')}}Au.Safari11=Qu;var Yu={},Xu={},Zu=Xt&&Xt.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),em=Xt&&Xt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),tm=Xt&&Xt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&Zu(t,e,n);return em(t,e),t};Object.defineProperty(Xu,"__esModule",{value:!0}),Xu.mangleRtpParameters=Xu.getCapabilities=void 0;const nm=tm(tp);Xu.getCapabilities=function(){const e=RTCRtpReceiver.getCapabilities(),t=nm.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},Xu.mangleRtpParameters=function(e){const t=nm.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};var im=Xt&&Xt.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),sm=Xt&&Xt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),rm=Xt&&Xt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&im(t,e,n);return sm(t,e),t};Object.defineProperty(Yu,"__esModule",{value:!0}),Yu.Edge11=void 0;const am=Vc,om=Xc,cm=rm(tp),pm=rm(np),dm=rm(Xu),lm=Dd,um=new am.Logger("Edge11");class mm extends lm.HandlerInterface{static createFactory(){return()=>new mm}constructor(){super(),this._rtpSenders=new Map,this._rtpReceivers=new Map,this._nextSendLocalId=0,this._transportReady=!1}get name(){return"Edge11"}close(){um.debug("close()");try{this._iceGatherer.close()}catch(e){}try{this._iceTransport.stop()}catch(e){}try{this._dtlsTransport.stop()}catch(e){}for(const e of this._rtpSenders.values())try{e.stop()}catch(e){}for(const e of this._rtpReceivers.values())try{e.stop()}catch(e){}this.emit("@close")}async getNativeRtpCapabilities(){return um.debug("getNativeRtpCapabilities()"),dm.getCapabilities()}async getNativeSctpCapabilities(){return um.debug("getNativeSctpCapabilities()"),{numStreams:{OS:0,MIS:0}}}run({direction:e,iceParameters:t,iceCandidates:n,dtlsParameters:i,sctpParameters:s,iceServers:r,iceTransportPolicy:a,additionalSettings:o,proprietaryConstraints:c,extendedRtpCapabilities:p}){um.debug("run()"),this._sendingRtpParametersByKind={audio:pm.getSendingRtpParameters("audio",p),video:pm.getSendingRtpParameters("video",p)},this._remoteIceParameters=t,this._remoteIceCandidates=n,this._remoteDtlsParameters=i,this._cname=`CNAME-${cm.generateRandomNumber()}`,this.setIceGatherer({iceServers:r,iceTransportPolicy:a}),this.setIceTransport(),this.setDtlsTransport()}async updateIceServers(e){throw new om.UnsupportedError("not supported")}async restartIce(e){if(um.debug("restartIce()"),this._remoteIceParameters=e,this._transportReady){um.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:n,codec:i}){um.debug("send() [kind:%s, track.id:%s]",e.kind,e.id),this._transportReady||await this.setupTransport({localDtlsRole:"server"}),um.debug("send() | calling new RTCRtpSender()");const s=new RTCRtpSender(e,this._dtlsTransport),r=cm.clone(this._sendingRtpParametersByKind[e.kind],{});r.codecs=pm.reduceCodecs(r.codecs,i);const a=r.codecs.some((e=>/.+\/rtx$/i.test(e.mimeType)));t||(t=[{}]);for(const e of t)e.ssrc=cm.generateRandomNumber(),a&&(e.rtx={ssrc:cm.generateRandomNumber()});r.encodings=t,r.rtcp={cname:this._cname,reducedSize:!0,mux:!0};const o=dm.mangleRtpParameters(r);um.debug("send() | calling rtpSender.send() [params:%o]",o),await s.send(o);const c=String(this._nextSendLocalId);return this._nextSendLocalId++,this._rtpSenders.set(c,s),{localId:c,rtpParameters:r,rtpSender:s}}async stopSending(e){um.debug("stopSending() [localId:%s]",e);const t=this._rtpSenders.get(e);if(!t)throw new Error("RTCRtpSender not found");this._rtpSenders.delete(e);try{um.debug("stopSending() | calling rtpSender.stop()"),t.stop()}catch(e){throw um.warn("stopSending() | rtpSender.stop() failed:%o",e),e}}async pauseSending(e){}async resumeSending(e){}async replaceTrack(e,t){t?um.debug("replaceTrack() [localId:%s, track.id:%s]",e,t.id):um.debug("replaceTrack() [localId:%s, no track]",e);const n=this._rtpSenders.get(e);if(!n)throw new Error("RTCRtpSender not found");n.setTrack(t)}async setMaxSpatialLayer(e,t){um.debug("setMaxSpatialLayer() [localId:%s, spatialLayer:%s]",e,t);const n=this._rtpSenders.get(e);if(!n)throw new Error("RTCRtpSender not found");const i=n.getParameters();i.encodings.forEach(((e,n)=>{e.active=n<=t})),await n.setParameters(i)}async setRtpEncodingParameters(e,t){um.debug("setRtpEncodingParameters() [localId:%s, params:%o]",e,t);const n=this._rtpSenders.get(e);if(!n)throw new Error("RTCRtpSender not found");const i=n.getParameters();i.encodings.forEach(((e,n)=>{i.encodings[n]={...e,...t}})),await n.setParameters(i)}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 om.UnsupportedError("not implemented")}async receive(e){const t=[];for(const t of e){const{trackId:e,kind:n}=t;um.debug("receive() [trackId:%s, kind:%s]",e,n)}this._transportReady||await this.setupTransport({localDtlsRole:"server"});for(const n of e){const{trackId:e,kind:i,rtpParameters:s}=n;um.debug("receive() | calling new RTCRtpReceiver()");const r=new RTCRtpReceiver(this._dtlsTransport,i);r.addEventListener("error",(e=>{um.error('rtpReceiver "error" event [event:%o]',e)}));const a=dm.mangleRtpParameters(s);um.debug("receive() | calling rtpReceiver.receive() [params:%o]",a),await r.receive(a);const o=e;this._rtpReceivers.set(o,r),t.push({localId:o,track:r.track,rtpReceiver:r})}return t}async stopReceiving(e){for(const t of e){um.debug("stopReceiving() [localId:%s]",t);const e=this._rtpReceivers.get(t);if(!e)throw new Error("RTCRtpReceiver not found");this._rtpReceivers.delete(t);try{um.debug("stopReceiving() | calling rtpReceiver.stop()"),e.stop()}catch(e){um.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 om.UnsupportedError("not implemented")}setIceGatherer({iceServers:e,iceTransportPolicy:t}){const n=new RTCIceGatherer({iceServers:e||[],gatherPolicy:t||"all"});n.addEventListener("error",(e=>{um.error('iceGatherer "error" event [event:%o]',e)}));try{n.gather()}catch(e){um.debug("setIceGatherer() | iceGatherer.gather() failed: %s",e.toString())}this._iceGatherer=n}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=>{um.debug('iceTransport "candidatepairchange" event [pair:%o]',e.pair)})),this._iceTransport=e}setDtlsTransport(){const e=new RTCDtlsTransport(this._iceTransport);e.addEventListener("statechange",(()=>{um.debug('dtlsTransport "statechange" event [state:%s]',e.state)})),e.addEventListener("dtlsstatechange",(()=>{um.debug('dtlsTransport "dtlsstatechange" event [state:%s]',e.state),"closed"===e.state&&this.emit("@connectionstatechange","closed")})),e.addEventListener("error",(e=>{um.error('dtlsTransport "error" event [event:%o]',e)})),this._dtlsTransport=e}async setupTransport({localDtlsRole:e}){um.debug("setupTransport()");const t=this._dtlsTransport.getLocalParameters();t.role=e,await new Promise(((e,n)=>{this.safeEmit("@connect",{dtlsParameters:t},e,n)})),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}}Yu.Edge11=mm;var hm={},fm=Xt&&Xt.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),gm=Xt&&Xt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),vm=Xt&&Xt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&fm(t,e,n);return gm(t,e),t};Object.defineProperty(hm,"__esModule",{value:!0}),hm.ReactNativeUnifiedPlan=void 0;const bm=vm(md),ym=Vc,_m=vm(tp),xm=vm(np),wm=vm(Cd),Sm=vm(Od),km=Dd,Cm=Md,Rm=Kd,Tm=new ym.Logger("ReactNativeUnifiedPlan"),Pm={OS:1024,MIS:1024};class Em extends km.HandlerInterface{static createFactory(){return()=>new Em}constructor(){super(),this._mapMidTransceiver=new Map,this._sendStream=new MediaStream,this._hasDataChannelMediaSection=!1,this._nextSendSctpStreamId=0,this._transportReady=!1}get name(){return"ReactNativeUnifiedPlan"}close(){if(Tm.debug("close()"),this._sendStream.release(!1),this._pc)try{this._pc.close()}catch(e){}this.emit("@close")}async getNativeRtpCapabilities(){Tm.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 n=bm.parse(t.sdp);return wm.extractRtpCapabilities({sdpObject:n})}catch(t){try{e.close()}catch(e){}throw t}}async getNativeSctpCapabilities(){return Tm.debug("getNativeSctpCapabilities()"),{numStreams:Pm}}run({direction:e,iceParameters:t,iceCandidates:n,dtlsParameters:i,sctpParameters:s,iceServers:r,iceTransportPolicy:a,additionalSettings:o,proprietaryConstraints:c,extendedRtpCapabilities:p}){Tm.debug("run()"),this._direction=e,this._remoteSdp=new Cm.RemoteSdp({iceParameters:t,iceCandidates:n,dtlsParameters:i,sctpParameters:s}),this._sendingRtpParametersByKind={audio:xm.getSendingRtpParameters("audio",p),video:xm.getSendingRtpParameters("video",p)},this._sendingRemoteRtpParametersByKind={audio:xm.getSendingRemoteRtpParameters("audio",p),video:xm.getSendingRemoteRtpParameters("video",p)},i.role&&"auto"!==i.role&&(this._forcedLocalDtlsRole="server"===i.role?"client":"server"),this._pc=new RTCPeerConnection({iceServers:r||[],iceTransportPolicy:a||"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require",sdpSemantics:"unified-plan",...o},c),this._pc.connectionState?this._pc.addEventListener("connectionstatechange",(()=>{this.emit("@connectionstatechange",this._pc.connectionState)})):this._pc.addEventListener("iceconnectionstatechange",(()=>{switch(Tm.warn("run() | pc.connectionState not supported, using pc.iceConnectionState"),this._pc.iceConnectionState){case"checking":this.emit("@connectionstatechange","connecting");break;case"connected":case"completed":this.emit("@connectionstatechange","connected");break;case"failed":this.emit("@connectionstatechange","failed");break;case"disconnected":this.emit("@connectionstatechange","disconnected");break;case"closed":this.emit("@connectionstatechange","closed")}}))}async updateIceServers(e){Tm.debug("updateIceServers()");const t=this._pc.getConfiguration();t.iceServers=e,this._pc.setConfiguration(t)}async restartIce(e){if(Tm.debug("restartIce()"),this._remoteSdp.updateIceParameters(e),this._transportReady)if("send"===this._direction){const e=await this._pc.createOffer({iceRestart:!0});Tm.debug("restartIce() | calling pc.setLocalDescription() [offer:%o]",e),await this._pc.setLocalDescription(e);const t={type:"answer",sdp:this._remoteSdp.getSdp()};Tm.debug("restartIce() | calling pc.setRemoteDescription() [answer:%o]",t),await this._pc.setRemoteDescription(t)}else{const e={type:"offer",sdp:this._remoteSdp.getSdp()};Tm.debug("restartIce() | calling pc.setRemoteDescription() [offer:%o]",e),await this._pc.setRemoteDescription(e);const t=await this._pc.createAnswer();Tm.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:n,codec:i}){var s;this.assertSendDirection(),Tm.debug("send() [kind:%s, track.id:%s]",e.kind,e.id),t&&t.length>1&&t.forEach(((e,t)=>{e.rid=`r${t}`}));const r=_m.clone(this._sendingRtpParametersByKind[e.kind],{});r.codecs=xm.reduceCodecs(r.codecs,i);const a=_m.clone(this._sendingRemoteRtpParametersByKind[e.kind],{});a.codecs=xm.reduceCodecs(a.codecs,i);const o=this._remoteSdp.getNextMediaSectionIdx(),c=this._pc.addTransceiver(e,{direction:"sendonly",streams:[this._sendStream],sendEncodings:t});let p,d=await this._pc.createOffer(),l=bm.parse(d.sdp);this._transportReady||await this.setupTransport({localDtlsRole:null!==(s=this._forcedLocalDtlsRole)&&void 0!==s?s:"client",localSdpObject:l});let u=!1;const m=(0,Rm.parse)((t||[{}])[0].scalabilityMode);t&&1===t.length&&m.spatialLayers>1&&"video/vp9"===r.codecs[0].mimeType.toLowerCase()&&(Tm.debug("send() | enabling legacy simulcast for VP9 SVC"),u=!0,l=bm.parse(d.sdp),p=l.media[o.idx],Sm.addLegacySimulcast({offerMediaObject:p,numStreams:m.spatialLayers}),d={type:"offer",sdp:bm.write(l)}),Tm.debug("send() | calling pc.setLocalDescription() [offer:%o]",d),await this._pc.setLocalDescription(d);const h=c.mid;if(r.mid=h,l=bm.parse(this._pc.localDescription.sdp),p=l.media[o.idx],r.rtcp.cname=wm.getCname({offerMediaObject:p}),t)if(1===t.length){let e=Sm.getRtpEncodings({offerMediaObject:p});Object.assign(e[0],t[0]),u&&(e=[e[0]]),r.encodings=e}else r.encodings=t;else r.encodings=Sm.getRtpEncodings({offerMediaObject:p});if(r.encodings.length>1&&("video/vp8"===r.codecs[0].mimeType.toLowerCase()||"video/h264"===r.codecs[0].mimeType.toLowerCase()))for(const e of r.encodings)e.scalabilityMode="S1T3";this._remoteSdp.send({offerMediaObject:p,reuseMid:o.reuseMid,offerRtpParameters:r,answerRtpParameters:a,codecOptions:n,extmapAllowMixed:!0});const f={type:"answer",sdp:this._remoteSdp.getSdp()};return Tm.debug("send() | calling pc.setRemoteDescription() [answer:%o]",f),await this._pc.setRemoteDescription(f),this._mapMidTransceiver.set(h,c),{localId:h,rtpParameters:r,rtpSender:c.sender}}async stopSending(e){this.assertSendDirection(),Tm.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);if(this._remoteSdp.closeMediaSection(t.mid))try{t.stop()}catch(e){}const n=await this._pc.createOffer();Tm.debug("stopSending() | calling pc.setLocalDescription() [offer:%o]",n),await this._pc.setLocalDescription(n);const i={type:"answer",sdp:this._remoteSdp.getSdp()};Tm.debug("stopSending() | calling pc.setRemoteDescription() [answer:%o]",i),await this._pc.setRemoteDescription(i),this._mapMidTransceiver.delete(e)}async pauseSending(e){this.assertSendDirection(),Tm.debug("pauseSending() [localId:%s]",e);const t=this._mapMidTransceiver.get(e);if(!t)throw new Error("associated RTCRtpTransceiver not found");t.direction="inactive",this._remoteSdp.pauseMediaSection(e);const n=await this._pc.createOffer();Tm.debug("pauseSending() | calling pc.setLocalDescription() [offer:%o]",n),await this._pc.setLocalDescription(n);const i={type:"answer",sdp:this._remoteSdp.getSdp()};Tm.debug("pauseSending() | calling pc.setRemoteDescription() [answer:%o]",i),await this._pc.setRemoteDescription(i)}async resumeSending(e){this.assertSendDirection(),Tm.debug("resumeSending() [localId:%s]",e);const t=this._mapMidTransceiver.get(e);if(this._remoteSdp.resumeSendingMediaSection(e),!t)throw new Error("associated RTCRtpTransceiver not found");t.direction="sendonly";const n=await this._pc.createOffer();Tm.debug("resumeSending() | calling pc.setLocalDescription() [offer:%o]",n),await this._pc.setLocalDescription(n);const i={type:"answer",sdp:this._remoteSdp.getSdp()};Tm.debug("resumeSending() | calling pc.setRemoteDescription() [answer:%o]",i),await this._pc.setRemoteDescription(i)}async replaceTrack(e,t){this.assertSendDirection(),t?Tm.debug("replaceTrack() [localId:%s, track.id:%s]",e,t.id):Tm.debug("replaceTrack() [localId:%s, no track]",e);const n=this._mapMidTransceiver.get(e);if(!n)throw new Error("associated RTCRtpTransceiver not found");await n.sender.replaceTrack(t)}async setMaxSpatialLayer(e,t){this.assertSendDirection(),Tm.debug("setMaxSpatialLayer() [localId:%s, spatialLayer:%s]",e,t);const n=this._mapMidTransceiver.get(e);if(!n)throw new Error("associated RTCRtpTransceiver not found");const i=n.sender.getParameters();i.encodings.forEach(((e,n)=>{e.active=n<=t})),await n.sender.setParameters(i)}async setRtpEncodingParameters(e,t){this.assertSendDirection(),Tm.debug("setRtpEncodingParameters() [localId:%s, params:%o]",e,t);const n=this._mapMidTransceiver.get(e);if(!n)throw new Error("associated RTCRtpTransceiver not found");const i=n.sender.getParameters();i.encodings.forEach(((e,n)=>{i.encodings[n]={...e,...t}})),await n.sender.setParameters(i)}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:n,label:i,protocol:s}){var r;this.assertSendDirection();const a={negotiated:!0,id:this._nextSendSctpStreamId,ordered:e,maxPacketLifeTime:t,maxRetransmits:n,protocol:s};Tm.debug("sendDataChannel() [options:%o]",a);const o=this._pc.createDataChannel(i,a);if(this._nextSendSctpStreamId=++this._nextSendSctpStreamId%Pm.MIS,!this._hasDataChannelMediaSection){const e=await this._pc.createOffer(),t=bm.parse(e.sdp),n=t.media.find((e=>"application"===e.type));this._transportReady||await this.setupTransport({localDtlsRole:null!==(r=this._forcedLocalDtlsRole)&&void 0!==r?r:"client",localSdpObject:t}),Tm.debug("sendDataChannel() | calling pc.setLocalDescription() [offer:%o]",e),await this._pc.setLocalDescription(e),this._remoteSdp.sendSctpAssociation({offerMediaObject:n});const i={type:"answer",sdp:this._remoteSdp.getSdp()};Tm.debug("sendDataChannel() | calling pc.setRemoteDescription() [answer:%o]",i),await this._pc.setRemoteDescription(i),this._hasDataChannelMediaSection=!0}return{dataChannel:o,sctpStreamParameters:{streamId:a.id,ordered:a.ordered,maxPacketLifeTime:a.maxPacketLifeTime,maxRetransmits:a.maxRetransmits}}}async receive(e){var t;this.assertRecvDirection();const n=[],i=new Map;for(const t of e){const{trackId:e,kind:n,rtpParameters:s,streamId:r}=t;Tm.debug("receive() [trackId:%s, kind:%s]",e,n);const a=s.mid||String(this._mapMidTransceiver.size);i.set(e,a),this._remoteSdp.receive({mid:a,kind:n,offerRtpParameters:s,streamId:r||s.rtcp.cname,trackId:e})}const s={type:"offer",sdp:this._remoteSdp.getSdp()};Tm.debug("receive() | calling pc.setRemoteDescription() [offer:%o]",s),await this._pc.setRemoteDescription(s);let r=await this._pc.createAnswer();const a=bm.parse(r.sdp);for(const t of e){const{trackId:e,rtpParameters:n}=t,s=i.get(e),r=a.media.find((e=>String(e.mid)===s));wm.applyCodecParameters({offerRtpParameters:n,answerMediaObject:r})}r={type:"answer",sdp:bm.write(a)},this._transportReady||await this.setupTransport({localDtlsRole:null!==(t=this._forcedLocalDtlsRole)&&void 0!==t?t:"client",localSdpObject:a}),Tm.debug("receive() | calling pc.setLocalDescription() [answer:%o]",r),await this._pc.setLocalDescription(r);for(const t of e){const{trackId:e}=t,s=i.get(e),r=this._pc.getTransceivers().find((e=>e.mid===s));if(!r)throw new Error("new RTCRtpTransceiver not found");this._mapMidTransceiver.set(s,r),n.push({localId:s,track:r.receiver.track,rtpReceiver:r.receiver})}return n}async stopReceiving(e){this.assertRecvDirection();for(const t of e){Tm.debug("stopReceiving() [localId:%s]",t);const e=this._mapMidTransceiver.get(t);if(!e)throw new Error("associated RTCRtpTransceiver not found");this._remoteSdp.closeMediaSection(e.mid)}const t={type:"offer",sdp:this._remoteSdp.getSdp()};Tm.debug("stopReceiving() | calling pc.setRemoteDescription() [offer:%o]",t),await this._pc.setRemoteDescription(t);const n=await this._pc.createAnswer();Tm.debug("stopReceiving() | calling pc.setLocalDescription() [answer:%o]",n),await this._pc.setLocalDescription(n);for(const t of e)this._mapMidTransceiver.delete(t)}async pauseReceiving(e){this.assertRecvDirection();for(const t of e){Tm.debug("pauseReceiving() [localId:%s]",t);const e=this._mapMidTransceiver.get(t);if(!e)throw new Error("associated RTCRtpTransceiver not found");e.direction="inactive",this._remoteSdp.pauseMediaSection(t)}const t={type:"offer",sdp:this._remoteSdp.getSdp()};Tm.debug("pauseReceiving() | calling pc.setRemoteDescription() [offer:%o]",t),await this._pc.setRemoteDescription(t);const n=await this._pc.createAnswer();Tm.debug("pauseReceiving() | calling pc.setLocalDescription() [answer:%o]",n),await this._pc.setLocalDescription(n)}async resumeReceiving(e){this.assertRecvDirection();for(const t of e){Tm.debug("resumeReceiving() [localId:%s]",t);const e=this._mapMidTransceiver.get(t);if(!e)throw new Error("associated RTCRtpTransceiver not found");e.direction="recvonly",this._remoteSdp.resumeReceivingMediaSection(t)}const t={type:"offer",sdp:this._remoteSdp.getSdp()};Tm.debug("resumeReceiving() | calling pc.setRemoteDescription() [offer:%o]",t),await this._pc.setRemoteDescription(t);const n=await this._pc.createAnswer();Tm.debug("resumeReceiving() | calling pc.setLocalDescription() [answer:%o]",n),await this._pc.setLocalDescription(n)}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:n}){var i;this.assertRecvDirection();const{streamId:s,ordered:r,maxPacketLifeTime:a,maxRetransmits:o}=e,c={negotiated:!0,id:s,ordered:r,maxPacketLifeTime:a,maxRetransmits:o,protocol:n};Tm.debug("receiveDataChannel() [options:%o]",c);const p=this._pc.createDataChannel(t,c);if(!this._hasDataChannelMediaSection){this._remoteSdp.receiveSctpAssociation();const e={type:"offer",sdp:this._remoteSdp.getSdp()};Tm.debug("receiveDataChannel() | calling pc.setRemoteDescription() [offer:%o]",e),await this._pc.setRemoteDescription(e);const t=await this._pc.createAnswer();if(!this._transportReady){const e=bm.parse(t.sdp);await this.setupTransport({localDtlsRole:null!==(i=this._forcedLocalDtlsRole)&&void 0!==i?i:"client",localSdpObject:e})}Tm.debug("receiveDataChannel() | calling pc.setRemoteDescription() [answer:%o]",t),await this._pc.setLocalDescription(t),this._hasDataChannelMediaSection=!0}return{dataChannel:p}}async setupTransport({localDtlsRole:e,localSdpObject:t}){t||(t=bm.parse(this._pc.localDescription.sdp));const n=wm.extractDtlsParameters({sdpObject:t});n.role=e,this._remoteSdp.updateDtlsRole("client"===e?"server":"client"),await new Promise(((e,t)=>{this.safeEmit("@connect",{dtlsParameters:n},e,t)})),this._transportReady=!0}assertSendDirection(){if("send"!==this._direction)throw new Error('method can just be called for handlers with "send" direction')}assertRecvDirection(){if("recv"!==this._direction)throw new Error('method can just be called for handlers with "recv" direction')}}hm.ReactNativeUnifiedPlan=Em;var Om={},Dm=Xt&&Xt.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),jm=Xt&&Xt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Im=Xt&&Xt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&Dm(t,e,n);return jm(t,e),t};Object.defineProperty(Om,"__esModule",{value:!0}),Om.ReactNative=void 0;const Mm=Im(md),Lm=Vc,Am=Xc,Nm=Im(tp),Bm=Im(np),Fm=Im(Cd),Um=Im(Pl),zm=Dd,qm=Md,$m=new Lm.Logger("ReactNative"),Vm={OS:1024,MIS:1024};class Hm extends zm.HandlerInterface{static createFactory(){return()=>new Hm}constructor(){super(),this._sendStream=new MediaStream,this._mapSendLocalIdTrack=new Map,this._nextSendLocalId=0,this._mapRecvLocalIdInfo=new Map,this._hasDataChannelMediaSection=!1,this._nextSendSctpStreamId=0,this._transportReady=!1}get name(){return"ReactNative"}close(){if($m.debug("close()"),this._sendStream.release(!1),this._pc)try{this._pc.close()}catch(e){}this.emit("@close")}async getNativeRtpCapabilities(){$m.debug("getNativeRtpCapabilities()");const e=new RTCPeerConnection({iceServers:[],iceTransportPolicy:"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require",sdpSemantics:"plan-b"});try{const t=await e.createOffer({offerToReceiveAudio:!0,offerToReceiveVideo:!0});try{e.close()}catch(e){}const n=Mm.parse(t.sdp);return Fm.extractRtpCapabilities({sdpObject:n})}catch(t){try{e.close()}catch(e){}throw t}}async getNativeSctpCapabilities(){return $m.debug("getNativeSctpCapabilities()"),{numStreams:Vm}}run({direction:e,iceParameters:t,iceCandidates:n,dtlsParameters:i,sctpParameters:s,iceServers:r,iceTransportPolicy:a,additionalSettings:o,proprietaryConstraints:c,extendedRtpCapabilities:p}){$m.debug("run()"),this._direction=e,this._remoteSdp=new qm.RemoteSdp({iceParameters:t,iceCandidates:n,dtlsParameters:i,sctpParameters:s,planB:!0}),this._sendingRtpParametersByKind={audio:Bm.getSendingRtpParameters("audio",p),video:Bm.getSendingRtpParameters("video",p)},this._sendingRemoteRtpParametersByKind={audio:Bm.getSendingRemoteRtpParameters("audio",p),video:Bm.getSendingRemoteRtpParameters("video",p)},i.role&&"auto"!==i.role&&(this._forcedLocalDtlsRole="server"===i.role?"client":"server"),this._pc=new RTCPeerConnection({iceServers:r||[],iceTransportPolicy:a||"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require",sdpSemantics:"plan-b",...o},c),this._pc.connectionState?this._pc.addEventListener("connectionstatechange",(()=>{this.emit("@connectionstatechange",this._pc.connectionState)})):this._pc.addEventListener("iceconnectionstatechange",(()=>{switch($m.warn("run() | pc.connectionState not supported, using pc.iceConnectionState"),this._pc.iceConnectionState){case"checking":this.emit("@connectionstatechange","connecting");break;case"connected":case"completed":this.emit("@connectionstatechange","connected");break;case"failed":this.emit("@connectionstatechange","failed");break;case"disconnected":this.emit("@connectionstatechange","disconnected");break;case"closed":this.emit("@connectionstatechange","closed")}}))}async updateIceServers(e){$m.debug("updateIceServers()");const t=this._pc.getConfiguration();t.iceServers=e,this._pc.setConfiguration(t)}async restartIce(e){if($m.debug("restartIce()"),this._remoteSdp.updateIceParameters(e),this._transportReady)if("send"===this._direction){const e=await this._pc.createOffer({iceRestart:!0});$m.debug("restartIce() | calling pc.setLocalDescription() [offer:%o]",e),await this._pc.setLocalDescription(e);const t={type:"answer",sdp:this._remoteSdp.getSdp()};$m.debug("restartIce() | calling pc.setRemoteDescription() [answer:%o]",t),await this._pc.setRemoteDescription(t)}else{const e={type:"offer",sdp:this._remoteSdp.getSdp()};$m.debug("restartIce() | calling pc.setRemoteDescription() [offer:%o]",e),await this._pc.setRemoteDescription(e);const t=await this._pc.createAnswer();$m.debug("restartIce() | calling pc.setLocalDescription() [answer:%o]",t),await this._pc.setLocalDescription(t)}}async getTransportStats(){return this._pc.getStats()}async send({track:e,encodings:t,codecOptions:n,codec:i}){var s;this.assertSendDirection(),$m.debug("send() [kind:%s, track.id:%s]",e.kind,e.id),i&&$m.warn("send() | codec selection is not available in %s handler",this.name),this._sendStream.addTrack(e),this._pc.addStream(this._sendStream);let r,a=await this._pc.createOffer(),o=Mm.parse(a.sdp);const c=Nm.clone(this._sendingRtpParametersByKind[e.kind],{});c.codecs=Bm.reduceCodecs(c.codecs);const p=Nm.clone(this._sendingRemoteRtpParametersByKind[e.kind],{});if(p.codecs=Bm.reduceCodecs(p.codecs),this._transportReady||await this.setupTransport({localDtlsRole:null!==(s=this._forcedLocalDtlsRole)&&void 0!==s?s:"client",localSdpObject:o}),"video"===e.kind&&t&&t.length>1&&($m.debug("send() | enabling simulcast"),o=Mm.parse(a.sdp),r=o.media.find((e=>"video"===e.type)),Um.addLegacySimulcast({offerMediaObject:r,track:e,numStreams:t.length}),a={type:"offer",sdp:Mm.write(o)}),$m.debug("send() | calling pc.setLocalDescription() [offer:%o]",a),await this._pc.setLocalDescription(a),o=Mm.parse(this._pc.localDescription.sdp),r=o.media.find((t=>t.type===e.kind)),c.rtcp.cname=Fm.getCname({offerMediaObject:r}),c.encodings=Um.getRtpEncodings({offerMediaObject:r,track:e}),t)for(let e=0;e<c.encodings.length;++e)t[e]&&Object.assign(c.encodings[e],t[e]);if(c.encodings.length>1&&("video/vp8"===c.codecs[0].mimeType.toLowerCase()||"video/h264"===c.codecs[0].mimeType.toLowerCase()))for(const e of c.encodings)e.scalabilityMode="S1T3";this._remoteSdp.send({offerMediaObject:r,offerRtpParameters:c,answerRtpParameters:p,codecOptions:n});const d={type:"answer",sdp:this._remoteSdp.getSdp()};$m.debug("send() | calling pc.setRemoteDescription() [answer:%o]",d),await this._pc.setRemoteDescription(d);const l=String(this._nextSendLocalId);return this._nextSendLocalId++,this._mapSendLocalIdTrack.set(l,e),{localId:l,rtpParameters:c}}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 n=await this._pc.createOffer();$m.debug("stopSending() | calling pc.setLocalDescription() [offer:%o]",n);try{await this._pc.setLocalDescription(n)}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 i={type:"answer",sdp:this._remoteSdp.getSdp()};$m.debug("stopSending() | calling pc.setRemoteDescription() [answer:%o]",i),await this._pc.setRemoteDescription(i)}async pauseSending(e){}async resumeSending(e){}async replaceTrack(e,t){throw new Am.UnsupportedError("not implemented")}async setMaxSpatialLayer(e,t){throw new Am.UnsupportedError("not implemented")}async setRtpEncodingParameters(e,t){throw new Am.UnsupportedError("not implemented")}async getSenderStats(e){throw new Am.UnsupportedError("not implemented")}async sendDataChannel({ordered:e,maxPacketLifeTime:t,maxRetransmits:n,label:i,protocol:s}){var r;this.assertSendDirection();const a={negotiated:!0,id:this._nextSendSctpStreamId,ordered:e,maxPacketLifeTime:t,maxRetransmitTime:t,maxRetransmits:n,protocol:s};$m.debug("sendDataChannel() [options:%o]",a);const o=this._pc.createDataChannel(i,a);if(this._nextSendSctpStreamId=++this._nextSendSctpStreamId%Vm.MIS,!this._hasDataChannelMediaSection){const e=await this._pc.createOffer(),t=Mm.parse(e.sdp),n=t.media.find((e=>"application"===e.type));this._transportReady||await this.setupTransport({localDtlsRole:null!==(r=this._forcedLocalDtlsRole)&&void 0!==r?r:"client",localSdpObject:t}),$m.debug("sendDataChannel() | calling pc.setLocalDescription() [offer:%o]",e),await this._pc.setLocalDescription(e),this._remoteSdp.sendSctpAssociation({offerMediaObject:n});const i={type:"answer",sdp:this._remoteSdp.getSdp()};$m.debug("sendDataChannel() | calling pc.setRemoteDescription() [answer:%o]",i),await this._pc.setRemoteDescription(i),this._hasDataChannelMediaSection=!0}return{dataChannel:o,sctpStreamParameters:{streamId:a.id,ordered:a.ordered,maxPacketLifeTime:a.maxPacketLifeTime,maxRetransmits:a.maxRetransmits}}}async receive(e){var t;this.assertRecvDirection();const n=[],i=new Map;for(const t of e){const{trackId:e,kind:n,rtpParameters:s}=t;$m.debug("receive() [trackId:%s, kind:%s]",e,n);const r=n;let a=t.streamId||s.rtcp.cname;$m.debug("receive() | forcing a random remote streamId to avoid well known bug in react-native-webrtc"),a+=`-hack-${Nm.generateRandomNumber()}`,i.set(e,a),this._remoteSdp.receive({mid:r,kind:n,offerRtpParameters:s,streamId:a,trackId:e})}const s={type:"offer",sdp:this._remoteSdp.getSdp()};$m.debug("receive() | calling pc.setRemoteDescription() [offer:%o]",s),await this._pc.setRemoteDescription(s);let r=await this._pc.createAnswer();const a=Mm.parse(r.sdp);for(const t of e){const{kind:e,rtpParameters:n}=t,i=e,s=a.media.find((e=>String(e.mid)===i));Fm.applyCodecParameters({offerRtpParameters:n,answerMediaObject:s})}r={type:"answer",sdp:Mm.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]",r),await this._pc.setLocalDescription(r);for(const t of e){const{kind:e,trackId:s,rtpParameters:r}=t,a=s,o=e,c=i.get(s),p=this._pc.getRemoteStreams().find((e=>e.id===c)),d=p.getTrackById(a);if(!d)throw new Error("remote track not found");this._mapRecvLocalIdInfo.set(a,{mid:o,rtpParameters:r}),n.push({localId:a,track:d})}return n}async stopReceiving(e){this.assertRecvDirection();for(const t of e){$m.debug("stopReceiving() [localId:%s]",t);const{mid:e,rtpParameters:n}=this._mapRecvLocalIdInfo.get(t)||{};this._mapRecvLocalIdInfo.delete(t),this._remoteSdp.planBStopReceiving({mid:e,offerRtpParameters:n})}const t={type:"offer",sdp:this._remoteSdp.getSdp()};$m.debug("stopReceiving() | calling pc.setRemoteDescription() [offer:%o]",t),await this._pc.setRemoteDescription(t);const n=await this._pc.createAnswer();$m.debug("stopReceiving() | calling pc.setLocalDescription() [answer:%o]",n),await this._pc.setLocalDescription(n)}async pauseReceiving(e){}async resumeReceiving(e){}async getReceiverStats(e){throw new Am.UnsupportedError("not implemented")}async receiveDataChannel({sctpStreamParameters:e,label:t,protocol:n}){var i;this.assertRecvDirection();const{streamId:s,ordered:r,maxPacketLifeTime:a,maxRetransmits:o}=e,c={negotiated:!0,id:s,ordered:r,maxPacketLifeTime:a,maxRetransmitTime:a,maxRetransmits:o,protocol:n};$m.debug("receiveDataChannel() [options:%o]",c);const p=this._pc.createDataChannel(t,c);if(!this._hasDataChannelMediaSection){this._remoteSdp.receiveSctpAssociation({oldDataChannelSpec:!0});const e={type:"offer",sdp:this._remoteSdp.getSdp()};$m.debug("receiveDataChannel() | calling pc.setRemoteDescription() [offer:%o]",e),await this._pc.setRemoteDescription(e);const t=await this._pc.createAnswer();if(!this._transportReady){const e=Mm.parse(t.sdp);await this.setupTransport({localDtlsRole:null!==(i=this._forcedLocalDtlsRole)&&void 0!==i?i:"client",localSdpObject:e})}$m.debug("receiveDataChannel() | calling pc.setRemoteDescription() [answer:%o]",t),await this._pc.setLocalDescription(t),this._hasDataChannelMediaSection=!0}return{dataChannel:p}}async setupTransport({localDtlsRole:e,localSdpObject:t}){t||(t=Mm.parse(this._pc.localDescription.sdp));const n=Fm.extractDtlsParameters({sdpObject:t});n.role=e,this._remoteSdp.updateDtlsRole("client"===e?"server":"client"),await new Promise(((e,t)=>{this.safeEmit("@connect",{dtlsParameters:n},e,t)})),this._transportReady=!0}assertSendDirection(){if("send"!==this._direction)throw new Error('method can just be called for handlers with "send" direction')}assertRecvDirection(){if("recv"!==this._direction)throw new Error('method can just be called for handlers with "recv" direction')}}Om.ReactNative=Hm;var Wm=Xt&&Xt.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),Gm=Xt&&Xt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Km=Xt&&Xt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&Wm(t,e,n);return Gm(t,e),t},Jm=Xt&&Xt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Oc,"__esModule",{value:!0}),Oc.Device=Oc.detectDevice=void 0;const Qm=Jm($c),Ym=Vc,Xm=Kc,Zm=Xc,eh=Km(tp),th=Km(np),nh=wp,ih=ud,sh=ll,rh=Tl,ah=$l,oh=ru,ch=xu,ph=Au,dh=Yu,lh=hm,uh=Om,mh=new Ym.Logger("Device");function hh(){if("object"==typeof navigator&&"ReactNative"===navigator.product)return"undefined"==typeof RTCPeerConnection?void mh.warn("this._detectDevice() | unsupported react-native-webrtc without RTCPeerConnection, forgot to call registerGlobals()?"):"undefined"!=typeof RTCRtpTransceiver?(mh.debug("this._detectDevice() | ReactNative UnifiedPlan handler chosen"),"ReactNativeUnifiedPlan"):(mh.debug("this._detectDevice() | ReactNative PlanB handler chosen"),"ReactNative");if("object"!=typeof navigator||"string"!=typeof navigator.userAgent)mh.warn("this._detectDevice() | unknown device");else{const e=navigator.userAgent,t=Qm.default.getParser(e),n=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(n.name&&"blink"===n.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"}mh.warn("this._detectDevice() | browser not supported [name:%s, version:%s]",t.getBrowserName(),t.getBrowserVersion())}}Oc.detectDevice=hh;Oc.Device=class{constructor({handlerName:e,handlerFactory:t,Handler:n}={}){if(this._loaded=!1,this._observer=new Xm.EnhancedEventEmitter,mh.debug("constructor()"),n){if(mh.warn("constructor() | Handler option is DEPRECATED, use handlerName or handlerFactory instead"),"string"!=typeof n)throw new TypeError("non string Handler option no longer supported, use handlerFactory instead");e=n}if(e&&t)throw new TypeError("just one of handlerName or handlerInterface can be given");if(t)this._handlerFactory=t;else{if(e)mh.debug("constructor() | handler given: %s",e);else{if(!(e=hh()))throw new Zm.UnsupportedError("device not supported");mh.debug("constructor() | detected handler: %s",e)}switch(e){case"Chrome74":this._handlerFactory=ih.Chrome74.createFactory();break;case"Chrome70":this._handlerFactory=sh.Chrome70.createFactory();break;case"Chrome67":this._handlerFactory=rh.Chrome67.createFactory();break;case"Chrome55":this._handlerFactory=ah.Chrome55.createFactory();break;case"Firefox60":this._handlerFactory=oh.Firefox60.createFactory();break;case"Safari12":this._handlerFactory=ch.Safari12.createFactory();break;case"Safari11":this._handlerFactory=ph.Safari11.createFactory();break;case"Edge11":this._handlerFactory=dh.Edge11.createFactory();break;case"ReactNativeUnifiedPlan":this._handlerFactory=lh.ReactNativeUnifiedPlan.createFactory();break;case"ReactNative":this._handlerFactory=uh.ReactNative.createFactory();break;default:throw new TypeError(`unknown handlerName "${e}"`)}}const i=this._handlerFactory();this._handlerName=i.name,i.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 Zm.InvalidStateError("not loaded");return this._recvRtpCapabilities}get sctpCapabilities(){if(!this._loaded)throw new Zm.InvalidStateError("not loaded");return this._sctpCapabilities}get observer(){return this._observer}async load({routerRtpCapabilities:e}){let t;mh.debug("load() [routerRtpCapabilities:%o]",e),e=eh.clone(e,void 0);try{if(this._loaded)throw new Zm.InvalidStateError("already loaded");th.validateRtpCapabilities(e),t=this._handlerFactory();const n=await t.getNativeRtpCapabilities();mh.debug("load() | got native RTP capabilities:%o",n),th.validateRtpCapabilities(n),this._extendedRtpCapabilities=th.getExtendedRtpCapabilities(n,e),mh.debug("load() | got extended RTP capabilities:%o",this._extendedRtpCapabilities),this._canProduceByKind.audio=th.canSend("audio",this._extendedRtpCapabilities),this._canProduceByKind.video=th.canSend("video",this._extendedRtpCapabilities),this._recvRtpCapabilities=th.getRecvRtpCapabilities(this._extendedRtpCapabilities),th.validateRtpCapabilities(this._recvRtpCapabilities),mh.debug("load() | got receiving RTP capabilities:%o",this._recvRtpCapabilities),this._sctpCapabilities=await t.getNativeSctpCapabilities(),mh.debug("load() | got native SCTP capabilities:%o",this._sctpCapabilities),th.validateSctpCapabilities(this._sctpCapabilities),mh.debug("load() succeeded"),this._loaded=!0,t.close()}catch(e){throw t&&t.close(),e}}canProduce(e){if(!this._loaded)throw new Zm.InvalidStateError("not loaded");if("audio"!==e&&"video"!==e)throw new TypeError(`invalid kind "${e}"`);return this._canProduceByKind[e]}createSendTransport({id:e,iceParameters:t,iceCandidates:n,dtlsParameters:i,sctpParameters:s,iceServers:r,iceTransportPolicy:a,additionalSettings:o,proprietaryConstraints:c,appData:p}){return mh.debug("createSendTransport()"),this.createTransport({direction:"send",id:e,iceParameters:t,iceCandidates:n,dtlsParameters:i,sctpParameters:s,iceServers:r,iceTransportPolicy:a,additionalSettings:o,proprietaryConstraints:c,appData:p})}createRecvTransport({id:e,iceParameters:t,iceCandidates:n,dtlsParameters:i,sctpParameters:s,iceServers:r,iceTransportPolicy:a,additionalSettings:o,proprietaryConstraints:c,appData:p}){return mh.debug("createRecvTransport()"),this.createTransport({direction:"recv",id:e,iceParameters:t,iceCandidates:n,dtlsParameters:i,sctpParameters:s,iceServers:r,iceTransportPolicy:a,additionalSettings:o,proprietaryConstraints:c,appData:p})}createTransport({direction:e,id:t,iceParameters:n,iceCandidates:i,dtlsParameters:s,sctpParameters:r,iceServers:a,iceTransportPolicy:o,additionalSettings:c,proprietaryConstraints:p,appData:d}){if(!this._loaded)throw new Zm.InvalidStateError("not loaded");if("string"!=typeof t)throw new TypeError("missing id");if("object"!=typeof n)throw new TypeError("missing iceParameters");if(!Array.isArray(i))throw new TypeError("missing iceCandidates");if("object"!=typeof s)throw new TypeError("missing dtlsParameters");if(r&&"object"!=typeof r)throw new TypeError("wrong sctpParameters");if(d&&"object"!=typeof d)throw new TypeError("if given, appData must be an object");const l=new nh.Transport({direction:e,id:t,iceParameters:n,iceCandidates:i,dtlsParameters:s,sctpParameters:r,iceServers:a,iceTransportPolicy:o,additionalSettings:c,proprietaryConstraints:p,appData:d,handlerFactory:this._handlerFactory,extendedRtpCapabilities:this._extendedRtpCapabilities,canProduceByKind:this._canProduceByKind});return this._observer.safeEmit("newtransport",l),l}};var fh={},gh={};Object.defineProperty(gh,"__esModule",{value:!0});var vh={};Object.defineProperty(vh,"__esModule",{value:!0}),function(e){var t=Xt&&Xt.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),n=Xt&&Xt.__exportStar||function(e,n){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(n,i)||t(n,e,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(Oc,e),n(wp,e),n(Dp,e),n(Ap,e),n(zp,e),n(Wp,e),n(gh,e),n(vh,e),n(Dd,e),n(Xc,e)}(fh),function(e){var t=Xt&&Xt.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),n=Xt&&Xt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=Xt&&Xt.__importStar||function(e){if(e&&e.__esModule)return e;var i={};if(null!=e)for(var s in e)"default"!==s&&Object.prototype.hasOwnProperty.call(e,s)&&t(i,e,s);return n(i,e),i},s=Xt&&Xt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.debug=e.parseScalabilityMode=e.detectDevice=e.Device=e.version=e.types=void 0;const r=s(gc);e.debug=r.default;const a=Oc;Object.defineProperty(e,"Device",{enumerable:!0,get:function(){return a.Device}}),Object.defineProperty(e,"detectDevice",{enumerable:!0,get:function(){return a.detectDevice}});const o=i(fh);e.types=o,e.version="3.6.75";var c=Kd;Object.defineProperty(e,"parseScalabilityMode",{enumerable:!0,get:function(){return c.parse}})}(fc);class bh{static parse(e){let t;try{t=JSON.parse(e)}catch(e){return}if("object"==typeof t&&!Array.isArray(t))return t.request?bh._handleRequest(t):t.response?bh._handleResponse(t):t.message?bh._handleMessage(t):void 0}static _handleRequest(e){const t={request:!0};if("string"==typeof e.method&&"number"==typeof e.id)return t.id=e.id,t.method=e.method,t.data=e.data||{},t}static _handleResponse(e){const t={response:!0};if("number"==typeof e.id)return t.id=e.id,e.ok?(t.ok=!0,t.data=e.data||{}):(t.ok=!1,t.errorCode=e.errorCode,t.errorReason=e.errorReason),t}static _handleMessage(e){const t={message:!0};if("string"==typeof e.method)return t.method=e.method,t.data=e.data||{},t}static createRequest(e,t){return{request:!0,id:Math.round(1e7*Math.random()),method:e,data:t||{}}}static createSuccessResponse(e,t){return{response:!0,id:e.id,ok:!0,data:t||{}}}static createErrorResponse(e,t,n){return{response:!0,id:e.id,errorCode:t,errorReason:n}}static createMessage(e,t){return{message:!0,method:e,data:t||{}}}}class yh extends l{constructor(e,t){super(),this.wsUrl=e,this.logger=t,this.sents=new Map,this._setupSocket()}_setupSocket(){this.socket=new WebSocket(this.wsUrl,"whereby-sfu#v4"),this.socket.onopen=this._onOpen.bind(this),this.socket.onmessage=this._onMessage.bind(this),this.socket.onclose=this._onClose.bind(this),this.socket.onerror=this._onError.bind(this)}_tearDown(){this.socket.onopen=null,this.socket.onmessage=null,this.socket.onclose=null,this.socket.onerror=null,this.socket=null,this.sents.forEach((e=>e.close())),this.emit("close")}close(){this.socket?.close()}_onOpen(){this.logger.log("VegaConnectionManager: Connected"),this.emit("open")}_onMessage(e){const t=bh.parse(e.data);this.logger.log("VegaConnectionManager: Received message",t),t?.response?this._handleResponse(t):t?.message&&this.emit("message",t)}_onClose(){this.logger.log("VegaConnectionManager: Disconnected"),this._tearDown()}_onError(e){this.logger.log("VegaConnectionManager: Error",e)}_handleResponse(e){const t=this.sents.get(e.id);if(e.ok)t.resolve(e.data);else{const n=new Error(e.errorReason);t.reject(n)}}send(e){try{this.socket.send(JSON.stringify(e))}catch(e){}}message(e,t={}){const n=bh.createMessage(e,t);this.send(n)}request(e,t={},n=1500*(15+.1*this.sents.size)){const i=bh.createRequest(e,t);return this.send(i),new Promise(((e,t)=>{const s={id:i.id,method:i.method,resolve:t=>{this.sents.delete(i.id)&&(clearTimeout(s.timer),e(t))},reject:e=>{this.sents.delete(i.id)&&(clearTimeout(s.timer),t(e))},timer:setTimeout((()=>{this.sents.delete(i.id)&&t(new Error("request timeout"))}),n),close:()=>{clearTimeout(s.timer),t(new Error("transport closed"))}};this.sents.set(i.id,s)}))}}const _h={codecOptions:{opusDtx:!0,opusFec:!0},encodings:[{dtx:!0,networkPriority:"high"}]},xh={codecOptions:{videoGoogleStartBitrate:500},encodings:[{scaleResolutionDownBy:4,maxBitrate:15e4,networkPriority:"high"},{scaleResolutionDownBy:2,maxBitrate:5e5},{scaleResolutionDownBy:1,maxBitrate:1e6}]},wh={codecOptions:{videoGoogleStartBitrate:500},encodings:[{scaleResolutionDownBy:2,maxBitrate:15e4,networkPriority:"high"},{scaleResolutionDownBy:1,maxBitrate:5e5}]},Sh={codecOptions:{videoGoogleStartBitrate:500},encodings:[{scalabilityMode:"S3T3_KEY",networkPriority:"high"}]},kh={encodings:[{networkPriority:"medium"}]},Ch={encodings:[{dtx:!0,maxBitrate:5e5},{dtx:!0,maxBitrate:15e5}]},Rh={encodings:[{scalabilityMode:"S3T3",dtx:!0,networkPriority:"high"}]},Th=(e,t,n)=>{const{lowDataModeEnabled:i,simulcastScreenshareOn:s,vp9On:r}=n;return"audio"===e?_h:t?r?Rh:s?Ch:kh:i?wh:r?Sh:xh},Ph=()=>{let e=fc.detectDevice()||(/applecoremedia|applewebkit|safari/i.test(navigator.userAgent)?"Safari12":void 0);return/iphone|ipad/i.test(navigator.userAgent)&&(e="Safari12"),e};let Eh;const Oh=new Uint8Array(16);function Dh(){if(!Eh&&(Eh="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Eh))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Eh(Oh)}var jh=/^(?:[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;const Ih=[];for(let e=0;e<256;++e)Ih.push((e+256).toString(16).slice(1));function Mh(e,t=0){return(Ih[e[t+0]]+Ih[e[t+1]]+Ih[e[t+2]]+Ih[e[t+3]]+"-"+Ih[e[t+4]]+Ih[e[t+5]]+"-"+Ih[e[t+6]]+Ih[e[t+7]]+"-"+Ih[e[t+8]]+Ih[e[t+9]]+"-"+Ih[e[t+10]]+Ih[e[t+11]]+Ih[e[t+12]]+Ih[e[t+13]]+Ih[e[t+14]]+Ih[e[t+15]]).toLowerCase()}function Lh(e){if(!function(e){return"string"==typeof e&&jh.test(e)}(e))throw TypeError("Invalid UUID");let t;const n=new Uint8Array(16);return n[0]=(t=parseInt(e.slice(0,8),16))>>>24,n[1]=t>>>16&255,n[2]=t>>>8&255,n[3]=255&t,n[4]=(t=parseInt(e.slice(9,13),16))>>>8,n[5]=255&t,n[6]=(t=parseInt(e.slice(14,18),16))>>>8,n[7]=255&t,n[8]=(t=parseInt(e.slice(19,23),16))>>>8,n[9]=255&t,n[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,n[11]=t/4294967296&255,n[12]=t>>>24&255,n[13]=t>>>16&255,n[14]=t>>>8&255,n[15]=255&t,n}function Ah(e,t,n){function i(e,i,s,r){var a;if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));const t=[];for(let n=0;n<e.length;++n)t.push(e.charCodeAt(n));return t}(e)),"string"==typeof i&&(i=Lh(i)),16!==(null===(a=i)||void 0===a?void 0:a.length))throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let o=new Uint8Array(16+e.length);if(o.set(i),o.set(e,i.length),o=n(o),o[6]=15&o[6]|t,o[8]=63&o[8]|128,s){r=r||0;for(let e=0;e<16;++e)s[r+e]=o[e];return s}return Mh(o)}try{i.name=e}catch(e){}return i.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",i.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",i}function Nh(e){return 14+(e+64>>>9<<4)+1}function Bh(e,t){const n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function Fh(e,t,n,i,s,r){return Bh((a=Bh(Bh(t,e),Bh(i,r)))<<(o=s)|a>>>32-o,n);var a,o}function Uh(e,t,n,i,s,r,a){return Fh(t&n|~t&i,e,t,s,r,a)}function zh(e,t,n,i,s,r,a){return Fh(t&i|n&~i,e,t,s,r,a)}function qh(e,t,n,i,s,r,a){return Fh(t^n^i,e,t,s,r,a)}function $h(e,t,n,i,s,r,a){return Fh(n^(t|~i),e,t,s,r,a)}Ah("v3",48,(function(e){if("string"==typeof e){const t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(let n=0;n<t.length;++n)e[n]=t.charCodeAt(n)}return function(e){const t=[],n=32*e.length,i="0123456789abcdef";for(let s=0;s<n;s+=8){const n=e[s>>5]>>>s%32&255,r=parseInt(i.charAt(n>>>4&15)+i.charAt(15&n),16);t.push(r)}return t}(function(e,t){e[t>>5]|=128<<t%32,e[Nh(t)-1]=t;let n=1732584193,i=-271733879,s=-1732584194,r=271733878;for(let t=0;t<e.length;t+=16){const a=n,o=i,c=s,p=r;n=Uh(n,i,s,r,e[t],7,-680876936),r=Uh(r,n,i,s,e[t+1],12,-389564586),s=Uh(s,r,n,i,e[t+2],17,606105819),i=Uh(i,s,r,n,e[t+3],22,-1044525330),n=Uh(n,i,s,r,e[t+4],7,-176418897),r=Uh(r,n,i,s,e[t+5],12,1200080426),s=Uh(s,r,n,i,e[t+6],17,-1473231341),i=Uh(i,s,r,n,e[t+7],22,-45705983),n=Uh(n,i,s,r,e[t+8],7,1770035416),r=Uh(r,n,i,s,e[t+9],12,-1958414417),s=Uh(s,r,n,i,e[t+10],17,-42063),i=Uh(i,s,r,n,e[t+11],22,-1990404162),n=Uh(n,i,s,r,e[t+12],7,1804603682),r=Uh(r,n,i,s,e[t+13],12,-40341101),s=Uh(s,r,n,i,e[t+14],17,-1502002290),i=Uh(i,s,r,n,e[t+15],22,1236535329),n=zh(n,i,s,r,e[t+1],5,-165796510),r=zh(r,n,i,s,e[t+6],9,-1069501632),s=zh(s,r,n,i,e[t+11],14,643717713),i=zh(i,s,r,n,e[t],20,-373897302),n=zh(n,i,s,r,e[t+5],5,-701558691),r=zh(r,n,i,s,e[t+10],9,38016083),s=zh(s,r,n,i,e[t+15],14,-660478335),i=zh(i,s,r,n,e[t+4],20,-405537848),n=zh(n,i,s,r,e[t+9],5,568446438),r=zh(r,n,i,s,e[t+14],9,-1019803690),s=zh(s,r,n,i,e[t+3],14,-187363961),i=zh(i,s,r,n,e[t+8],20,1163531501),n=zh(n,i,s,r,e[t+13],5,-1444681467),r=zh(r,n,i,s,e[t+2],9,-51403784),s=zh(s,r,n,i,e[t+7],14,1735328473),i=zh(i,s,r,n,e[t+12],20,-1926607734),n=qh(n,i,s,r,e[t+5],4,-378558),r=qh(r,n,i,s,e[t+8],11,-2022574463),s=qh(s,r,n,i,e[t+11],16,1839030562),i=qh(i,s,r,n,e[t+14],23,-35309556),n=qh(n,i,s,r,e[t+1],4,-1530992060),r=qh(r,n,i,s,e[t+4],11,1272893353),s=qh(s,r,n,i,e[t+7],16,-155497632),i=qh(i,s,r,n,e[t+10],23,-1094730640),n=qh(n,i,s,r,e[t+13],4,681279174),r=qh(r,n,i,s,e[t],11,-358537222),s=qh(s,r,n,i,e[t+3],16,-722521979),i=qh(i,s,r,n,e[t+6],23,76029189),n=qh(n,i,s,r,e[t+9],4,-640364487),r=qh(r,n,i,s,e[t+12],11,-421815835),s=qh(s,r,n,i,e[t+15],16,530742520),i=qh(i,s,r,n,e[t+2],23,-995338651),n=$h(n,i,s,r,e[t],6,-198630844),r=$h(r,n,i,s,e[t+7],10,1126891415),s=$h(s,r,n,i,e[t+14],15,-1416354905),i=$h(i,s,r,n,e[t+5],21,-57434055),n=$h(n,i,s,r,e[t+12],6,1700485571),r=$h(r,n,i,s,e[t+3],10,-1894986606),s=$h(s,r,n,i,e[t+10],15,-1051523),i=$h(i,s,r,n,e[t+1],21,-2054922799),n=$h(n,i,s,r,e[t+8],6,1873313359),r=$h(r,n,i,s,e[t+15],10,-30611744),s=$h(s,r,n,i,e[t+6],15,-1560198380),i=$h(i,s,r,n,e[t+13],21,1309151649),n=$h(n,i,s,r,e[t+4],6,-145523070),r=$h(r,n,i,s,e[t+11],10,-1120210379),s=$h(s,r,n,i,e[t+2],15,718787259),i=$h(i,s,r,n,e[t+9],21,-343485551),n=Bh(n,a),i=Bh(i,o),s=Bh(s,c),r=Bh(r,p)}return[n,i,s,r]}(function(e){if(0===e.length)return[];const t=8*e.length,n=new Uint32Array(Nh(t));for(let i=0;i<t;i+=8)n[i>>5]|=(255&e[i/8])<<i%32;return n}(e),8*e.length))}));var Vh={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Hh(e,t,n){if(Vh.randomUUID&&!t&&!e)return Vh.randomUUID();const i=(e=e||{}).random||(e.rng||Dh)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=i[e];return t}return Mh(i)}function Wh(e,t,n,i){switch(e){case 0:return t&n^~t&i;case 1:case 3:return t^n^i;case 2:return t&n^t&i^n&i}}function Gh(e,t){return e<<t|e>>>32-t}Ah("v5",80,(function(e){const t=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){const t=unescape(encodeURIComponent(e));e=[];for(let n=0;n<t.length;++n)e.push(t.charCodeAt(n))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);const i=e.length/4+2,s=Math.ceil(i/16),r=new Array(s);for(let t=0;t<s;++t){const n=new Uint32Array(16);for(let i=0;i<16;++i)n[i]=e[64*t+4*i]<<24|e[64*t+4*i+1]<<16|e[64*t+4*i+2]<<8|e[64*t+4*i+3];r[t]=n}r[s-1][14]=8*(e.length-1)/Math.pow(2,32),r[s-1][14]=Math.floor(r[s-1][14]),r[s-1][15]=8*(e.length-1)&4294967295;for(let e=0;e<s;++e){const i=new Uint32Array(80);for(let t=0;t<16;++t)i[t]=r[e][t];for(let e=16;e<80;++e)i[e]=Gh(i[e-3]^i[e-8]^i[e-14]^i[e-16],1);let s=n[0],a=n[1],o=n[2],c=n[3],p=n[4];for(let e=0;e<80;++e){const n=Math.floor(e/20),r=Gh(s,5)+Wh(n,a,o,c)+p+t[n]+i[e]>>>0;p=c,c=o,o=Gh(a,30)>>>0,a=s,s=r}n[0]=n[0]+s>>>0,n[1]=n[1]+a>>>0,n[2]=n[2]+o>>>0,n[3]=n[3]+c>>>0,n[4]=n[4]+p>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,255&n[0],n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,255&n[1],n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,255&n[2],n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,255&n[3],n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,255&n[4]]}));const Kh=console,Jh=Hh(),Qh=Hh();class Yh{constructor({selfId:e,room:t,emitter:n,serverSocket:i,webrtcProvider:s,features:r,eventClaim:a}){m.ok(e,"selfId is required"),m.ok(t,"room is required"),m.ok(n&&n.emit,"emitter is required"),m.ok(s,"webrtcProvider is required");const{session:o,iceServers:c,sfuServer:p,mediaserverConfigTtlSeconds:d}=t;this._selfId=e,this._room=t,this._roomSessionId=o?.id,this._emitter=n,this._serverSocket=i,this._webrtcProvider=s,this._features=r||{},this._eventClaim=a,this._vegaConnection=null,this._mediasoupDevice=new fc.Device({handlerName:Ph()}),this._routerRtpCapabilities=null,this._sendTransport=null,this._receiveTransport=null,this._clientStates=new Map,this._streamIdToVideoConsumerId=new Map,this._consumers=new Map,this._micTrack=null,this._webcamTrack=null,this._screenVideoTrack=null,this._screenAudioTrack=null,this._micProducer=null,this._micProducerPromise=null,this._micPaused=!1,this._webcamProducer=null,this._webcamProducerPromise=null,this._webcamPaused=!1,this._screenVideoProducer=null,this._screenVideoProducerPromise=null,this._screenAudioProducer=null,this._screenAudioProducerPromise=null,this._sndTransportIceRestartPromise=null,this._rcvTransportIceRestartPromise=null,this._stopCameraTimeout=null,this._updateAndScheduleMediaServersRefresh({sfuServer:p,iceServers:c.iceServers||[],mediaserverConfigTtlSeconds:d}),this._socketListenerDeregisterFunctions=[]}_updateAndScheduleMediaServersRefresh({iceServers:e,sfuServer:t,mediaserverConfigTtlSeconds:n}){this._iceServers=e,this._sfuServer=t,this._mediaserverConfigTtlSeconds=n,this._sendTransport?.updateIceServers({iceServers:this._iceServers}),this._receiveTransport?.updateIceServers({iceServers:this._iceServers}),this._clearMediaServersRefresh(),n&&(this._fetchMediaServersTimer=setTimeout((()=>this._emitToSignal(kn)),1e3*n))}_clearMediaServersRefresh(){this._fetchMediaServersTimer&&(clearTimeout(this._fetchMediaServersTimer),this._fetchMediaServersTimer=null)}setupSocketListeners(){this._socketListenerDeregisterFunctions.push((()=>this._clearMediaServersRefresh()),this._serverSocket.on(Tn,(e=>{e.error?Kh.warn("FETCH_MEDIASERVER_CONFIG failed:",e.error):this._updateAndScheduleMediaServersRefresh(e)})),this._serverSocket.on(Pn,(()=>{this._screenVideoTrack&&this._emitScreenshareStarted()}))),this._connect()}_emitScreenshareStarted(){this._emitToSignal(Cn,{streamId:Qh,hasAudioTrack:Boolean(this._screenAudioTrack)})}_connect(){const e=`wss://${this._features.sfuServerOverrideHost||[this._sfuServer.url]}?${new URLSearchParams({clientId:this._selfId,organizationId:this._room.organizationId,roomName:this._room.name,eventClaim:this._room.isClaimed?this._eventClaim:null,lowBw:!0}).toString()}`;this._vegaConnection=new yh(e,Kh),this._vegaConnection.on("open",(()=>this._join())),this._vegaConnection.on("close",(()=>this._onClose())),this._vegaConnection.on("message",(e=>this._onMessage(e)))}_onClose(){Kh.debug("_onClose()"),this._sendTransport?.close(),this._receiveTransport?.close(),this._sendTransport=null,this._receiveTransport=null,this._streamIdToVideoConsumerId.clear(),setTimeout((()=>this._connect()),1e3)}async _join(){Kh.debug("join()");try{const{routerRtpCapabilities:e}=await this._vegaConnection.request("getCapabilities");this._routerRtpCapabilities||(((e,t)=>{const{vp9On:n,h264On:i}=t;if(n){const{preferredPayloadType:t}=e.codecs.find((e=>"video/vp9"===e.mimeType.toLowerCase())),{preferredPayloadType:n}=e.codecs.find((e=>"video/rtx"===e.mimeType.toLowerCase()&&e.parameters.apt===t));e.codecs=e.codecs.filter((e=>"audio"===e.kind||e.preferredPayloadType===t||e.preferredPayloadType===n))}else if(i){const{preferredPayloadType:t}=e.codecs.find((e=>"video/h264"===e.mimeType.toLowerCase())),{preferredPayloadType:n}=e.codecs.find((e=>"video/rtx"===e.mimeType.toLowerCase()&&e.parameters.apt===t));e.codecs=e.codecs.filter((e=>"audio"===e.kind||e.preferredPayloadType===t||e.preferredPayloadType===n))}})(e,this._features),this._routerRtpCapabilities=e,await this._mediasoupDevice.load({routerRtpCapabilities:e})),this._vegaConnection.message("setCapabilities",{rtpCapabilities:this._mediasoupDevice.rtpCapabilities}),await Promise.all([this._createTransport(!0),this._createTransport(!1)]);const t=[];!this._micTrack||this._micProducer||this._micProducerPromise||t.push(this._internalSendMic()),!this._webcamTrack||this._webcamProducer||this._webcamProducerPromise||t.push(this._internalSendWebcam()),!this._screenVideoTrack||this._screenVideoProducer||this._screenVideoProducerPromise||t.push(this._internalSendScreenVideo()),!this._screenAudioTrack||this._screenAudioProducer||this._screenAudioProducerPromise||t.push(this._internalSendScreenAudio()),await Promise.all(t)}catch(e){Kh.error("_join() [error:%o]",e),this._onClose()}}async _createTransport(e){const t=e?"createSendTransport":"createRecvTransport",n=await this._vegaConnection.request("createTransport",{producing:e,consuming:!e,enableTcp:!0,enableUdp:!0,preferUdp:!0,sctpParameters:{enableSctp:!0,numSctpStreams:{OS:1024,MIS:1024},maxSctpMessageSize:262144,sctpSendBufferSize:262144}});n.iceServers=this._iceServers,((e,t)=>{if(!t.useOnlyTURN||["off","false","0"].includes(t.useOnlyTURN))return;e.iceTransportPolicy="relay";const n={onlyudp:/^turn:.*transport=udp$/,onlytcp:/^turn:.*transport=tcp$/,onlytls:/^turns:.*transport=tcp$/}[t.useOnlyTURN];n&&(e.iceServers=e.iceServers.filter((e=>e.url&&e.url.match(n))))})(n,this._features);const i=this._mediasoupDevice[t](n),s=async t=>{if(Kh.debug(`Transport ConnectionStateChanged ${t}`),"disconnected"===t||"failed"===t)if(e){if(this._sndTransportIceRestartPromise)return;this._sndTransportIceRestartPromise=this._restartIce(i).finally((()=>{this._sndTransportIceRestartPromise=null}))}else{if(this._rcvTransportIceRestartPromise)return;this._rcvTransportIceRestartPromise=this._restartIce(i).finally((()=>{this._rcvTransportIceRestartPromise=null}))}};i.on("connect",(({dtlsParameters:e},t)=>{this._vegaConnection?.message("connectTransport",{transportId:i.id,dtlsParameters:e}),t()})).on("connectionstatechange",s),i.observer.once("close",(()=>{i.removeListener(s)})),e?(i.on("produce",(async({kind:e,rtpParameters:t,appData:n},s,r)=>{try{const{paused:r}=n,{id:a}=await(this._vegaConnection?.request("produce",{transportId:i.id,kind:e,rtpParameters:t,paused:r,appData:n}));s({id:a})}catch(e){r(e)}})),i.on("producedata",(async({appData:e,sctpStreamParameters:t},n,s)=>{try{const{id:s}=await(this._vegaConnection?.request("produceData",{transportId:i.id,sctpStreamParameters:t,appData:e}));n({id:s})}catch(e){s(e)}})),this._sendTransport=i):this._receiveTransport=i}async _restartIce(e,t=0){if(!e||!("closed"in e)||!("connectionState"in e))return void Kh.debug("_restartIce: No transport or property closed or connectionState!");if(e.closed)return void Kh.debug("_restartIce: Transport is closed!");if("disconnected"!==e.connectionState&&"failed"!==e.connectionState)return void Kh.debug("_restartIce: Connection is healthy ICE restart no loneger needed!");const{iceRestartStarted:n}=e.appData,i=Date.now();if(Number.isFinite(n)&&i-n<3500)return;if(e.appData.iceRestartStarted=i,5<=t)return void Kh.debug("_restartIce: Reached restart ICE maximum retry count!");if(!this._vegaConnection)return void Kh.debug("_restartIce: Connection is undefined");const{iceParameters:s}=await this._vegaConnection.request("restartIce",{transportId:e.id});Kh.debug("_restartIce: ICE restart iceParameters received from SFU: ",s);const r=await e.restartIce({iceParameters:s}).then((()=>null)).catch((e=>e));if(r)switch(Kh.error(`_restartIce: ICE restart failed: ${r}`),r.message){case"missing transportId":case"no such transport":break;default:await new Promise((e=>{setTimeout((()=>{e()}),Math.min(3500*2**t,6e4))})),await this._restartIce(e,t+1)}else await new Promise((e=>{setTimeout((()=>{e()}),6e4*Math.min(8,t+1))})),"failed"!==e.connectionState&&"disconnected"!==e.connectionState||await this._restartIce(e,t+1)}async _internalSendMic(){Kh.debug("_internalSendMic()"),this._micProducerPromise=(async()=>{try{if(!this._micTrack||!this._sendTransport||this._micProducer)return void(this._micProducerPromise=null);const e=this._micPaused,t=await this._sendTransport.produce({track:this._micTrack,disableTrackOnPause:!1,stopTracks:!1,...Th("audio",!1,this._features),appData:{streamId:Jh,sourceClientId:this._selfId,screenShare:!1,source:"mic",paused:e}});e?t.pause():t.resume(),this._micProducer=t,t.observer.once("close",(()=>{Kh.debug('micProducer "close" event'),t.appData.localClosed&&this._vegaConnection?.message("closeProducers",{producerIds:[t.id]}),this._micProducer=null,this._micProducerPromise=null})),this._micTrack!==this._micProducer.track&&await this._replaceMicTrack(),this._micPaused!==this._micProducer.paused&&this._pauseResumeMic()}catch(e){Kh.error("micProducer failed:%o",e)}finally{this._micProducerPromise=null,this._micTrack||(this._stopProducer(this._micProducer),this._micProducer=null)}})()}async _replaceMicTrack(){Kh.debug("_replaceMicTrack()"),this._micTrack&&this._micProducer&&!this._micProducer.closed&&this._micProducer.track!==this._micTrack&&(await this._micProducer.replaceTrack({track:this._micTrack}),await this._replaceMicTrack())}_pauseResumeMic(){Kh.debug("_pauseResumeMic()"),this._micProducer&&!this._micProducer.closed&&this._micPaused!==this._micProducer.paused&&(this._micPaused?(this._micProducer.pause(),this._vegaConnection?.message("pauseProducers",{producerIds:[this._micProducer.id]})):(this._micProducer.resume(),this._vegaConnection?.message("resumeProducers",{producerIds:[this._micProducer.id]})),this._pauseResumeMic())}async _sendMic(e){return Kh.debug("_sendMic() [track:%o]",e),this._micTrack=e,this._micProducer?await this._replaceMicTrack():this._micProducerPromise?void 0:this._sendTransport?await this._internalSendMic():void 0}async _internalSendWebcam(){Kh.debug("_internalSendWebcam()"),this._webcamProducerPromise=(async()=>{try{if(!this._webcamTrack||!this._sendTransport||this._webcamProducer)return void(this._webcamProducerPromise=null);const e=this._webcamPaused,t=await this._sendTransport.produce({track:this._webcamTrack,disableTrackOnPause:!1,stopTracks:!1,...Th("video",!1,this._features),appData:{streamId:Jh,sourceClientId:this._selfId,screenShare:!1,source:"webcam",paused:e}});e?t.pause():t.resume(),this._webcamProducer=t,t.observer.once("close",(()=>{Kh.debug('webcamProducer "close" event'),t.appData.localClosed&&this._vegaConnection?.message("closeProducers",{producerIds:[t.id]}),this._webcamProducer=null,this._webcamProducerPromise=null})),this._webcamTrack!==this._webcamProducer.track&&await this._replaceWebcamTrack(),this._webcamPaused!==this._webcamProducer.paused&&this._pauseResumeWebcam()}catch(e){Kh.error("webcamProducer failed:%o",e)}finally{this._webcamProducerPromise=null,this._webcamTrack||(await this._stopProducer(this._webcamProducer),this._webcamProducer=null)}})()}async _replaceWebcamTrack(){Kh.debug("_replaceWebcamTrack()"),this._webcamTrack&&this._webcamProducer&&!this._webcamProducer.closed&&this._webcamProducer.track!==this._webcamTrack&&(await this._webcamProducer.replaceTrack({track:this._webcamTrack}),await this._replaceWebcamTrack())}_pauseResumeWebcam(){Kh.debug("_pauseResumeWebcam()"),this._webcamProducer&&!this._webcamProducer.closed&&this._webcamPaused!==this._webcamProducer.paused&&(this._webcamPaused?(this._webcamProducer.pause(),this._vegaConnection?.message("pauseProducers",{producerIds:[this._webcamProducer.id]})):(this._webcamProducer.resume(),this._vegaConnection?.message("resumeProducers",{producerIds:[this._webcamProducer.id]})),this._pauseResumeWebcam())}async _sendWebcam(e){return Kh.debug("_sendWebcam() [track:%o]",e),this._webcamTrack=e,this._webcamProducer?await this._replaceWebcamTrack():this._webcamProducerPromise?void 0:this._sendTransport?await this._internalSendWebcam():void 0}async _internalSendScreenVideo(){Kh.debug("_internalSendScreenVideo()"),this._screenVideoProducerPromise=(async()=>{try{if(!this._screenVideoTrack||!this._sendTransport||this._screenVideoProducer)return void(this._screenVideoProducerPromise=null);const e=await this._sendTransport.produce({track:this._screenVideoTrack,disableTrackOnPause:!1,stopTracks:!1,...Th("video",!0,this._features),appData:{streamId:Qh,sourceClientId:this._selfId,screenShare:!0,source:"screenvideo",paused:!1}});this._screenVideoProducer=e,e.observer.once("close",(()=>{Kh.debug('screenVideoProducer "close" event'),e.appData.localClosed&&this._vegaConnection?.message("closeProducers",{producerIds:[e.id]}),this._screenVideoProducer=null,this._screenVideoProducerPromise=null})),this._screenVideoTrack!==this._screenVideoProducer.track&&await this._replaceScreenVideoTrack()}catch(e){Kh.error("screenVideoProducer failed:%o",e)}finally{this._screenVideoProducerPromise=null,this._screenVideoTrack||(await this._stopProducer(this._screenVideoProducer),this._screenVideoProducer=null)}})()}async _replaceScreenVideoTrack(){Kh.debug("_replaceScreenVideoTrack()"),this._screenVideoTrack&&this._screenVideoProducer&&!this._screenVideoProducer.closed&&this._screenVideoProducer.track!==this._screenVideoTrack&&(await this._screenVideoProducer.replaceTrack({track:this._screenVideoTrack}),await this._replaceScreenVideoTrack())}async _sendScreenVideo(e){return Kh.debug("_sendScreenVideo() [track:%o]",e),this._screenVideoTrack=e,this._screenVideoProducer?await this._replaceScreenVideoTrack():this._screenVideoProducerPromise?void 0:this._sendTransport?await this._internalSendScreenVideo():void 0}async _internalSendScreenAudio(){Kh.debug("_internalSendScreenAudio()"),this._screenAudioProducerPromise=(async()=>{try{if(!this._screenAudioTrack||!this._sendTransport||this._screenAudioProducer)return void(this._screenAudioProducerPromise=null);const e=await this._sendTransport.produce({track:this._screenAudioTrack,disableTrackOnPause:!1,stopTracks:!1,...Th("video",!0,this._features),appData:{streamId:Qh,sourceClientId:this._selfId,screenShare:!0,source:"screenaudio",paused:!1}});this._screenAudioProducer=e,e.observer.once("close",(()=>{Kh.debug('screenAudioProducer "close" event'),e.appData.localClosed&&this._vegaConnection?.message("closeProducers",{producerIds:[e.id]}),this._screenAudioProducer=null,this._screenAudioProducerPromise=null})),this._screenAudioTrack!==this._screenAudioProducer.track&&await this._replaceScreenAudioTrack()}catch(e){Kh.error("screenAudioProducer failed:%o",e)}finally{this._screenAudioProducerPromise=null,this._screenAudioTrack||(await this._stopProducer(this._screenAudioProducer),this._screenAudioProducer=null)}})()}async _replaceScreenAudioTrack(){Kh.debug("_replaceScreenAudioTrack()"),this._screenAudioTrack&&this._screenAudioProducer&&!this._screenAudioProducer.closed&&this._screenAudioProducer.track!==this._screenAudioTrack&&(await this._screenAudioProducer.replaceTrack({track:this._screenAudioTrack}),await this._replaceScreenAudioTrack())}async _sendScreenAudio(e){return Kh.debug("_sendScreenAudio() [track:%o]",e),this._screenAudioTrack=e,this._screenAudioProducer?await this._replaceScreenAudioTrack():this._screenAudioProducerPromise?void 0:this._sendTransport?await this._internalSendScreenAudio():void 0}_stopProducer(e){Kh.debug("_stopProducer()"),e&&!e.closed&&(e.appData.localClosed=!0,e.close())}isInitializedWith({selfId:e,roomName:t,isSfu:n}){return this._selfId===e&&this._room.name===t&&Boolean(n)}setEventClaim(e){this._eventClaim=e,this._vegaConnection?.message("eventClaim",{eventClaim:e})}setRoomSessionId(e){this._roomSessionId=e}disconnect(e,t,n){if(Kh.debug("disconnect() [clientIdOrStreamId:%s, eventClaim:%s]",e,n),this._clientStates.has(e)){const t=this._clientStates.get(e);t.hasAcceptedWebcamStream=!1,t.hasAcceptedScreenStream=!1,this._syncIncomingStreamsWithPWA(e)}n&&(this._eventClaim=n,this._vegaConnection?.message("eventClaim",{eventClaim:n}))}replaceTrack(e,t){"audio"===t.kind&&(this._micTrack=t,this._replaceMicTrack()),"video"===t.kind&&(this._webcamTrack=t,this._replaceWebcamTrack())}removeStream(e,t,n){Kh.debug("removeStream() [streamId:%s, requestedByClientId:%s]",e,n),this._emitToSignal(Rn,{streamId:Qh,requestedByClientId:n}),this._stopProducer(this._screenVideoProducer),this._screenVideoProducer=null,this._screenVideoTrack=null,this._stopProducer(this._screenAudioProducer),this._screenAudioProducer=null,this._screenAudioTrack=null}addNewStream(e,t,n,i){if("0"===e){this._micPaused=n,this._webcamPaused=i;const e=t.getVideoTracks()[0],s=t.getAudioTracks()[0];e&&this._sendWebcam(e),s&&this._sendMic(s)}else{const e=t.getVideoTracks()[0],n=t.getAudioTracks()[0];e&&this._sendScreenVideo(e),n&&this._sendScreenAudio(n),this._emitScreenshareStarted()}}stopOrResumeAudio(e,t){Kh.debug("stopOrResumeAudio() [enabled:%s]",t),this._micPaused=!t,this._pauseResumeMic()}stopOrResumeVideo(e,t){if(Kh.debug("stopOrResumeVideo() [enable:%s]",t),this._webcamPaused=!t,this._pauseResumeWebcam(),"chrome"===browserName)if(t){if(0===e.getVideoTracks().length){const t=this._webrtcProvider.getMediaConstraints().video;navigator.mediaDevices.getUserMedia({video:t}).then((t=>{const n=t.getVideoTracks()[0];e.addTrack(n),this._emitToPWA(bn,{streamId:e.id,tracks:[n],screenShare:!1}),this._sendWebcam(n)}))}}else clearTimeout(this._stopCameraTimeout),this._stopCameraTimeout=setTimeout((()=>{e.getVideoTracks().forEach((t=>{!1===t.enabled&&(t.stop(),e.removeTrack(t),this._emitToPWA(yn,{stream:e,track:t}),this._webcamProducer&&!this._webcamProducer.closed&&this._webcamProducer.track===t&&(this._stopProducer(this._webcamProducer),this._webcamProducer=null,this._webcamTrack=null))}))}),5e3)}supportsScreenShareAudio(){return!0}acceptNewStream({streamId:e,clientId:t}){Kh.debug("acceptNewStream()",{streamId:e,clientId:t});const n=this._getOrCreateClientState(t);e!==t?(n.hasAcceptedScreenStream=!0,n.hasEmittedScreenStream=!1):(n.hasAcceptedWebcamStream=!0,n.hasEmittedWebcamStream=!1),this._syncIncomingStreamsWithPWA(t)}updateStreamResolution(e,t,{width:n,height:i}){Kh.debug("updateStreamResolution()",{streamId:e,width:n,height:i});const s=this._streamIdToVideoConsumerId.get(e),r=this._consumers.get(s);if(!r)return;const a=Math.max(n,i),o=a>=480?a>=960?2:1:0;r.appData.spatialLayer!==o&&(r.appData.spatialLayer=o,this._vegaConnection?.message("setConsumersPreferredLayers",{consumerIds:[s],spatialLayer:o,temporalLayer:o}))}disconnectAll(){this._socketListenerDeregisterFunctions.forEach((e=>{e()})),this._socketListenerDeregisterFunctions=[],this._vegaConnection?.removeAllListeners(),this._vegaConnection?.close(),this._sendTransport?.close(),this._receiveTransport?.close(),this._micTrack=null,this._webcamTrack=null,this._screenVideoTrack=null,this._screenAudioTrack=null,this._streamIdToVideoConsumerId.clear(),this._mediasoupDevice=null}async _onMessage(e){const{method:t,data:n}=e;return Promise.resolve().then((()=>{switch(t){case"consumerReady":return this._onConsumerReady(n);case"consumerClosed":return this._onConsumerClosed(n);case"consumerPaused":return this._onConsumerPaused(n);case"consumerResumed":return this._onConsumerResumed(n);case"dominantSpeaker":return this._onDominantSpeaker(n);default:return void Kh.debug(`unknown message method "${t}"`)}})).catch((e=>{console.error('"message" failed [error:%o]',e)}))}async _onConsumerReady(e){Kh.debug("_onConsumerReady()",{id:e.id,producerId:e.producerId});const t=await this._receiveTransport.consume(e);t.pause(),t.appData.localPaused=!0,t.appData.spatialLayer=2,this._consumers.set(t.id,t),t.observer.once("close",(()=>{this._consumers.delete(t.id),this._consumerClosedCleanup(t)}));const{sourceClientId:n,screenShare:i,streamId:s}=t.appData,r=this._getOrCreateClientState(n);i?(r.hasEmittedScreenStream=!1,r.screenShareStreamId=s):(r.hasEmittedWebcamStream=!1,r.camStreamId=s);let a=i?r.screenStream:r.webcamStream;a&&a.inboundId===s||(a=new MediaStream,a.inboundId=s,i?r.screenStream=a:r.webcamStream=a),"video"===t.kind&&this._streamIdToVideoConsumerId.set(a.id,t.id),a.addTrack(t.track),this._syncIncomingStreamsWithPWA(n)}async _onConsumerClosed({consumerId:e,reason:t}){Kh.debug("_onConsumerClosed()",{consumerId:e,reason:t}),this._consumers.get(e)?.close()}_onConsumerPaused({consumerId:e}){Kh.debug("_onConsumerPaused()",{consumerId:e});const t=this._consumers.get(e);t&&(t.appData.remotePaused=!0,t.pause())}_onConsumerResumed({consumerId:e}){Kh.debug("_onConsumerResumed()",{consumerId:e});const t=this._consumers.get(e);t&&(t.appData.remotePaused=!1,t.appData.localPaused||t.resume())}_onDominantSpeaker({consumerId:e}){const t=this._consumers.get(e);if(!t)return;const{sourceClientId:n}=t.appData;this._emitToPWA(Jo,{clientId:n})}_consumerClosedCleanup(e){const{sourceClientId:t,screenShare:n}=e.appData,i=this._getOrCreateClientState(t),s=n?i.screenStream:i.webcamStream;s&&(s.removeTrack(e.track),0===s.getTracks().length&&(this._streamIdToVideoConsumerId.delete(s.id),n?(i.screenStream=null,i.hasEmittedScreenStream=!1,i.screenShareStreamId=null):(i.hasEmittedWebcamStream=!1,i.camStreamId=null)))}_syncIncomingStreamsWithPWA(e){const t=this._getOrCreateClientState(e),{webcamStream:n,screenStream:i,hasEmittedWebcamStream:s,hasEmittedScreenStream:r,hasAcceptedWebcamStream:a,hasAcceptedScreenStream:o,screenShareStreamId:c,camStreamId:p}=t,d=[],l=[];this._consumers.forEach((t=>{if(t.appData.sourceClientId!==e)return;const n=t.appData.screenShare?o:a;!t.appData.localPaused!==n&&(n?(t.appData.remotePaused||t.resume(),t.appData.localPaused=!1,l.push(t.id)):(t.pause(),t.appData.localPaused=!0,d.push(t.id)))})),d.length>0&&this._vegaConnection?.message("pauseConsumers",{consumerIds:d}),l.length>0&&this._vegaConnection?.message("resumeConsumers",{consumerIds:l}),n&&!s&&a&&(this._emitToPWA(fn,{clientId:e,stream:n,streamId:p}),t.hasEmittedWebcamStream=!0),i&&!r&&o&&(this._emitToPWA(fn,{clientId:e,stream:i,streamId:c}),t.hasEmittedScreenStream=!0)}_getOrCreateClientState(e){let t=this._clientStates.get(e);return t||(t={hasAcceptedWebcamStream:!1,hasAcceptedScreenStream:!1,hasEmittedWebcamStream:!1,hasEmittedScreenStream:!1,webcamStream:null,screenStream:null,screenShareStreamId:null,camStreamId:null},this._clientStates.set(e,t)),t}_emitToPWA(e,t){this._emitter.emit(e,t)}_emitToSignal(e,t,n){this._serverSocket.emit(e,t,n)}shouldAcceptStreamsFromBothSides(){return!0}}class Xh{constructor({emitter:e,serverSocket:t,webrtcProvider:n,features:i}){this.emitter=e,this.currentManager=null,t.on(Pn,(({room:s,selfId:r,error:a,eventClaim:o})=>{if(a)return;const c={selfId:r,room:s,emitter:e,serverSocket:t,webrtcProvider:n,features:i,eventClaim:o},p=!!s.sfuServer;if(this.currentManager){if(this.currentManager.isInitializedWith({selfId:r,roomName:s.name,isSfu:p}))return void(this.currentManager.setEventClaim&&o&&this.currentManager.setEventClaim(o));this.currentManager.disconnectAll(),e.emit(vn)}let d=null;d=p?new Yh(c):new pc(c),d.setupSocketListeners(),e.emit(gn,{rtcManager:d}),this.currentManager=d}))}}const Zh=[{pattern:/^(?:([^.]+)[.])?(server:?\d*)/,separator:"."},{pattern:/^(?:([^.]+)[.])?(localhost:?\d*)/,separator:"."},{pattern:/^(?:([^.]+)[.])?((\d+[.]){3}:?\d*)$/,separator:"."},{pattern:/^(?:([^.]+)-)?(ip-[^.]*[.](?:hereby[.]dev|rfc1918[.]disappear[.]at)(?::\d+|))$/,separator:"-"},{pattern:/^(?:([^.]+)[.])?((:?[^.]+[.]){1,}[^.]+)$/,separator:"."}];function ef({host:e="whereby.com",protocol:t="https:"}={}){let n="",i=e,s=".";for(const{separator:t,pattern:r}of Zh){const a=r.exec(e);if(a){n=a[1]||"",i=a[2],s=t;break}}const r=n?`${n}${s}${i}`:i;return{domain:i,domainWithSeparator:`${s}${i}`,organizationDomain:r,organization:`${t}//${r}`,service:`${t}//${i}`,subdomain:n}}ef(window&&window.location);var tf={};function nf(e,t){return function(){return e.apply(t,arguments)}}({get exports(){return tf},set exports(e){tf=e}}).exports=function(e){return(e instanceof Buffer?e:Buffer.from(e.toString(),"binary")).toString("base64")};const{toString:sf}=Object.prototype,{getPrototypeOf:rf}=Object,af=(e=>t=>{const n=sf.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),of=e=>(e=e.toLowerCase(),t=>af(t)===e),cf=e=>t=>typeof t===e,{isArray:pf}=Array,df=cf("undefined");const lf=of("ArrayBuffer");const uf=cf("string"),mf=cf("function"),hf=cf("number"),ff=e=>null!==e&&"object"==typeof e,gf=e=>{if("object"!==af(e))return!1;const t=rf(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},vf=of("Date"),bf=of("File"),yf=of("Blob"),_f=of("FileList"),xf=of("URLSearchParams");function wf(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let i,s;if("object"!=typeof e&&(e=[e]),pf(e))for(i=0,s=e.length;i<s;i++)t.call(null,e[i],i,e);else{const s=n?Object.getOwnPropertyNames(e):Object.keys(e),r=s.length;let a;for(i=0;i<r;i++)a=s[i],t.call(null,e[a],a,e)}}function Sf(e,t){t=t.toLowerCase();const n=Object.keys(e);let i,s=n.length;for(;s-- >0;)if(i=n[s],t===i.toLowerCase())return i;return null}const kf="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,Cf=e=>!df(e)&&e!==kf;const Rf=(Tf="undefined"!=typeof Uint8Array&&rf(Uint8Array),e=>Tf&&e instanceof Tf);var Tf;const Pf=of("HTMLFormElement"),Ef=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Of=of("RegExp"),Df=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),i={};wf(n,((n,s)=>{!1!==t(n,s,e)&&(i[s]=n)})),Object.defineProperties(e,i)};var jf={isArray:pf,isArrayBuffer:lf,isBuffer:function(e){return null!==e&&!df(e)&&null!==e.constructor&&!df(e.constructor)&&mf(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{const t="[object FormData]";return e&&("function"==typeof FormData&&e instanceof FormData||sf.call(e)===t||mf(e.toString)&&e.toString()===t)},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&lf(e.buffer),t},isString:uf,isNumber:hf,isBoolean:e=>!0===e||!1===e,isObject:ff,isPlainObject:gf,isUndefined:df,isDate:vf,isFile:bf,isBlob:yf,isRegExp:Of,isFunction:mf,isStream:e=>ff(e)&&mf(e.pipe),isURLSearchParams:xf,isTypedArray:Rf,isFileList:_f,forEach:wf,merge:function e(){const{caseless:t}=Cf(this)&&this||{},n={},i=(i,s)=>{const r=t&&Sf(n,s)||s;gf(n[r])&&gf(i)?n[r]=e(n[r],i):gf(i)?n[r]=e({},i):pf(i)?n[r]=i.slice():n[r]=i};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&wf(arguments[e],i);return n},extend:(e,t,n,{allOwnKeys:i}={})=>(wf(t,((t,i)=>{n&&mf(t)?e[i]=nf(t,n):e[i]=t}),{allOwnKeys:i}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,i)=>{e.prototype=Object.create(t.prototype,i),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,i)=>{let s,r,a;const o={};if(t=t||{},null==e)return t;do{for(s=Object.getOwnPropertyNames(e),r=s.length;r-- >0;)a=s[r],i&&!i(a,e,t)||o[a]||(t[a]=e[a],o[a]=!0);e=!1!==n&&rf(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:af,kindOfTest:of,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const i=e.indexOf(t,n);return-1!==i&&i===n},toArray:e=>{if(!e)return null;if(pf(e))return e;let t=e.length;if(!hf(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let i;for(;(i=n.next())&&!i.done;){const n=i.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const i=[];for(;null!==(n=e.exec(t));)i.push(n);return i},isHTMLForm:Pf,hasOwnProperty:Ef,hasOwnProp:Ef,reduceDescriptors:Df,freezeMethods:e=>{Df(e,((t,n)=>{if(mf(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const i=e[n];mf(i)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},i=e=>{e.forEach((e=>{n[e]=!0}))};return pf(e)?i(e):i(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[_-\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:Sf,global:kf,isContextDefined:Cf,toJSONObject:e=>{const t=new Array(10),n=(e,i)=>{if(ff(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[i]=e;const s=pf(e)?[]:{};return wf(e,((e,t)=>{const r=n(e,i+1);!df(r)&&(s[t]=r)})),t[i]=void 0,s}}return e};return n(e,0)}};function If(e,t,n,i,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),i&&(this.request=i),s&&(this.response=s)}jf.inherits(If,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:jf.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const Mf=If.prototype,Lf={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{Lf[e]={value:e}})),Object.defineProperties(If,Lf),Object.defineProperty(Mf,"isAxiosError",{value:!0}),If.from=(e,t,n,i,s,r)=>{const a=Object.create(Mf);return jf.toFlatObject(e,a,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),If.call(a,e.message,t,n,i,s),a.cause=e,a.name=e.name,r&&Object.assign(a,r),a};var Af=p.Stream,Nf=Bf;function Bf(){this.source=null,this.dataSize=0,this.maxDataSize=1048576,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}t.inherits(Bf,Af),Bf.create=function(e,t){var n=new this;for(var i in t=t||{})n[i]=t[i];n.source=e;var s=e.emit;return e.emit=function(){return n._handleEmit(arguments),s.apply(e,arguments)},e.on("error",(function(){})),n.pauseStream&&e.pause(),n},Object.defineProperty(Bf.prototype,"readable",{configurable:!0,enumerable:!0,get:function(){return this.source.readable}}),Bf.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)},Bf.prototype.resume=function(){this._released||this.release(),this.source.resume()},Bf.prototype.pause=function(){this.source.pause()},Bf.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]},Bf.prototype.pipe=function(){var e=Af.prototype.pipe.apply(this,arguments);return this.resume(),e},Bf.prototype._handleEmit=function(e){this._released?this.emit.apply(this,e):("data"===e[0]&&(this.dataSize+=e[1].length,this._checkIfMaxDataSizeExceeded()),this._bufferedEvents.push(e))},Bf.prototype._checkIfMaxDataSizeExceeded=function(){if(!(this._maxDataSizeExceeded||this.dataSize<=this.maxDataSize)){this._maxDataSizeExceeded=!0;var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this.emit("error",new Error(e))}};var Ff=t,Uf=p.Stream,zf=Nf,qf=$f;function $f(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2097152,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}Ff.inherits($f,Uf),$f.create=function(e){var t=new this;for(var n in e=e||{})t[n]=e[n];return t},$f.isStreamLike=function(e){return"function"!=typeof e&&"string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e&&!Buffer.isBuffer(e)},$f.prototype.append=function(e){if($f.isStreamLike(e)){if(!(e instanceof zf)){var t=zf.create(e,{maxDataSize:1/0,pauseStream:this.pauseStreams});e.on("data",this._checkDataSize.bind(this)),e=t}this._handleErrors(e),this.pauseStreams&&e.pause()}return this._streams.push(e),this},$f.prototype.pipe=function(e,t){return Uf.prototype.pipe.call(this,e,t),this.resume(),e},$f.prototype._getNext=function(){if(this._currentStream=null,this._insideLoop)this._pendingNext=!0;else{this._insideLoop=!0;try{do{this._pendingNext=!1,this._realGetNext()}while(this._pendingNext)}finally{this._insideLoop=!1}}},$f.prototype._realGetNext=function(){var e=this._streams.shift();void 0!==e?"function"==typeof e?e(function(e){$f.isStreamLike(e)&&(e.on("data",this._checkDataSize.bind(this)),this._handleErrors(e)),this._pipeNext(e)}.bind(this)):this._pipeNext(e):this.end()},$f.prototype._pipeNext=function(e){if(this._currentStream=e,$f.isStreamLike(e))return e.on("end",this._getNext.bind(this)),void e.pipe(this,{end:!1});var t=e;this.write(t),this._getNext()},$f.prototype._handleErrors=function(e){var t=this;e.on("error",(function(e){t._emitError(e)}))},$f.prototype.write=function(e){this.emit("data",e)},$f.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&"function"==typeof this._currentStream.pause&&this._currentStream.pause(),this.emit("pause"))},$f.prototype.resume=function(){this._released||(this._released=!0,this.writable=!0,this._getNext()),this.pauseStreams&&this._currentStream&&"function"==typeof this._currentStream.resume&&this._currentStream.resume(),this.emit("resume")},$f.prototype.end=function(){this._reset(),this.emit("end")},$f.prototype.destroy=function(){this._reset(),this.emit("close")},$f.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null},$f.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}},$f.prototype._updateDataSize=function(){this.dataSize=0;var e=this;this._streams.forEach((function(t){t.dataSize&&(e.dataSize+=t.dataSize)})),this._currentStream&&this._currentStream.dataSize&&(this.dataSize+=this._currentStream.dataSize)},$f.prototype._emitError=function(e){this._reset(),this.emit("error",e)};var Vf={},Hf={},Wf={"application/1d-interleaved-parityfec":{source:"iana"},"application/3gpdash-qoe-report+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/3gpp-ims+xml":{source:"iana",compressible:!0},"application/3gpphal+json":{source:"iana",compressible:!0},"application/3gpphalforms+json":{source:"iana",compressible:!0},"application/a2l":{source:"iana"},"application/ace+cbor":{source:"iana"},"application/activemessage":{source:"iana"},"application/activity+json":{source:"iana",compressible:!0},"application/alto-costmap+json":{source:"iana",compressible:!0},"application/alto-costmapfilter+json":{source:"iana",compressible:!0},"application/alto-directory+json":{source:"iana",compressible:!0},"application/alto-endpointcost+json":{source:"iana",compressible:!0},"application/alto-endpointcostparams+json":{source:"iana",compressible:!0},"application/alto-endpointprop+json":{source:"iana",compressible:!0},"application/alto-endpointpropparams+json":{source:"iana",compressible:!0},"application/alto-error+json":{source:"iana",compressible:!0},"application/alto-networkmap+json":{source:"iana",compressible:!0},"application/alto-networkmapfilter+json":{source:"iana",compressible:!0},"application/alto-updatestreamcontrol+json":{source:"iana",compressible:!0},"application/alto-updatestreamparams+json":{source:"iana",compressible:!0},"application/aml":{source:"iana"},"application/andrew-inset":{source:"iana",extensions:["ez"]},"application/applefile":{source:"iana"},"application/applixware":{source:"apache",extensions:["aw"]},"application/at+jwt":{source:"iana"},"application/atf":{source:"iana"},"application/atfx":{source:"iana"},"application/atom+xml":{source:"iana",compressible:!0,extensions:["atom"]},"application/atomcat+xml":{source:"iana",compressible:!0,extensions:["atomcat"]},"application/atomdeleted+xml":{source:"iana",compressible:!0,extensions:["atomdeleted"]},"application/atomicmail":{source:"iana"},"application/atomsvc+xml":{source:"iana",compressible:!0,extensions:["atomsvc"]},"application/atsc-dwd+xml":{source:"iana",compressible:!0,extensions:["dwd"]},"application/atsc-dynamic-event-message":{source:"iana"},"application/atsc-held+xml":{source:"iana",compressible:!0,extensions:["held"]},"application/atsc-rdt+json":{source:"iana",compressible:!0},"application/atsc-rsat+xml":{source:"iana",compressible:!0,extensions:["rsat"]},"application/atxml":{source:"iana"},"application/auth-policy+xml":{source:"iana",compressible:!0},"application/bacnet-xdd+zip":{source:"iana",compressible:!1},"application/batch-smtp":{source:"iana"},"application/bdoc":{compressible:!1,extensions:["bdoc"]},"application/beep+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/calendar+json":{source:"iana",compressible:!0},"application/calendar+xml":{source:"iana",compressible:!0,extensions:["xcs"]},"application/call-completion":{source:"iana"},"application/cals-1840":{source:"iana"},"application/captive+json":{source:"iana",compressible:!0},"application/cbor":{source:"iana"},"application/cbor-seq":{source:"iana"},"application/cccex":{source:"iana"},"application/ccmp+xml":{source:"iana",compressible:!0},"application/ccxml+xml":{source:"iana",compressible:!0,extensions:["ccxml"]},"application/cdfx+xml":{source:"iana",compressible:!0,extensions:["cdfx"]},"application/cdmi-capability":{source:"iana",extensions:["cdmia"]},"application/cdmi-container":{source:"iana",extensions:["cdmic"]},"application/cdmi-domain":{source:"iana",extensions:["cdmid"]},"application/cdmi-object":{source:"iana",extensions:["cdmio"]},"application/cdmi-queue":{source:"iana",extensions:["cdmiq"]},"application/cdni":{source:"iana"},"application/cea":{source:"iana"},"application/cea-2018+xml":{source:"iana",compressible:!0},"application/cellml+xml":{source:"iana",compressible:!0},"application/cfw":{source:"iana"},"application/city+json":{source:"iana",compressible:!0},"application/clr":{source:"iana"},"application/clue+xml":{source:"iana",compressible:!0},"application/clue_info+xml":{source:"iana",compressible:!0},"application/cms":{source:"iana"},"application/cnrp+xml":{source:"iana",compressible:!0},"application/coap-group+json":{source:"iana",compressible:!0},"application/coap-payload":{source:"iana"},"application/commonground":{source:"iana"},"application/conference-info+xml":{source:"iana",compressible:!0},"application/cose":{source:"iana"},"application/cose-key":{source:"iana"},"application/cose-key-set":{source:"iana"},"application/cpl+xml":{source:"iana",compressible:!0,extensions:["cpl"]},"application/csrattrs":{source:"iana"},"application/csta+xml":{source:"iana",compressible:!0},"application/cstadata+xml":{source:"iana",compressible:!0},"application/csvm+json":{source:"iana",compressible:!0},"application/cu-seeme":{source:"apache",extensions:["cu"]},"application/cwt":{source:"iana"},"application/cybercash":{source:"iana"},"application/dart":{compressible:!0},"application/dash+xml":{source:"iana",compressible:!0,extensions:["mpd"]},"application/dash-patch+xml":{source:"iana",compressible:!0,extensions:["mpp"]},"application/dashdelta":{source:"iana"},"application/davmount+xml":{source:"iana",compressible:!0,extensions:["davmount"]},"application/dca-rft":{source:"iana"},"application/dcd":{source:"iana"},"application/dec-dx":{source:"iana"},"application/dialog-info+xml":{source:"iana",compressible:!0},"application/dicom":{source:"iana"},"application/dicom+json":{source:"iana",compressible:!0},"application/dicom+xml":{source:"iana",compressible:!0},"application/dii":{source:"iana"},"application/dit":{source:"iana"},"application/dns":{source:"iana"},"application/dns+json":{source:"iana",compressible:!0},"application/dns-message":{source:"iana"},"application/docbook+xml":{source:"apache",compressible:!0,extensions:["dbk"]},"application/dots+cbor":{source:"iana"},"application/dskpp+xml":{source:"iana",compressible:!0},"application/dssc+der":{source:"iana",extensions:["dssc"]},"application/dssc+xml":{source:"iana",compressible:!0,extensions:["xdssc"]},"application/dvcs":{source:"iana"},"application/ecmascript":{source:"iana",compressible:!0,extensions:["es","ecma"]},"application/edi-consent":{source:"iana"},"application/edi-x12":{source:"iana",compressible:!1},"application/edifact":{source:"iana",compressible:!1},"application/efi":{source:"iana"},"application/elm+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/elm+xml":{source:"iana",compressible:!0},"application/emergencycalldata.cap+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/emergencycalldata.comment+xml":{source:"iana",compressible:!0},"application/emergencycalldata.control+xml":{source:"iana",compressible:!0},"application/emergencycalldata.deviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.ecall.msd":{source:"iana"},"application/emergencycalldata.providerinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.serviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.subscriberinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.veds+xml":{source:"iana",compressible:!0},"application/emma+xml":{source:"iana",compressible:!0,extensions:["emma"]},"application/emotionml+xml":{source:"iana",compressible:!0,extensions:["emotionml"]},"application/encaprtp":{source:"iana"},"application/epp+xml":{source:"iana",compressible:!0},"application/epub+zip":{source:"iana",compressible:!1,extensions:["epub"]},"application/eshop":{source:"iana"},"application/exi":{source:"iana",extensions:["exi"]},"application/expect-ct-report+json":{source:"iana",compressible:!0},"application/express":{source:"iana",extensions:["exp"]},"application/fastinfoset":{source:"iana"},"application/fastsoap":{source:"iana"},"application/fdt+xml":{source:"iana",compressible:!0,extensions:["fdt"]},"application/fhir+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/fhir+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/fido.trusted-apps+json":{compressible:!0},"application/fits":{source:"iana"},"application/flexfec":{source:"iana"},"application/font-sfnt":{source:"iana"},"application/font-tdpfr":{source:"iana",extensions:["pfr"]},"application/font-woff":{source:"iana",compressible:!1},"application/framework-attributes+xml":{source:"iana",compressible:!0},"application/geo+json":{source:"iana",compressible:!0,extensions:["geojson"]},"application/geo+json-seq":{source:"iana"},"application/geopackage+sqlite3":{source:"iana"},"application/geoxacml+xml":{source:"iana",compressible:!0},"application/gltf-buffer":{source:"iana"},"application/gml+xml":{source:"iana",compressible:!0,extensions:["gml"]},"application/gpx+xml":{source:"apache",compressible:!0,extensions:["gpx"]},"application/gxf":{source:"apache",extensions:["gxf"]},"application/gzip":{source:"iana",compressible:!1,extensions:["gz"]},"application/h224":{source:"iana"},"application/held+xml":{source:"iana",compressible:!0},"application/hjson":{extensions:["hjson"]},"application/http":{source:"iana"},"application/hyperstudio":{source:"iana",extensions:["stk"]},"application/ibe-key-request+xml":{source:"iana",compressible:!0},"application/ibe-pkg-reply+xml":{source:"iana",compressible:!0},"application/ibe-pp-data":{source:"iana"},"application/iges":{source:"iana"},"application/im-iscomposing+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/index":{source:"iana"},"application/index.cmd":{source:"iana"},"application/index.obj":{source:"iana"},"application/index.response":{source:"iana"},"application/index.vnd":{source:"iana"},"application/inkml+xml":{source:"iana",compressible:!0,extensions:["ink","inkml"]},"application/iotp":{source:"iana"},"application/ipfix":{source:"iana",extensions:["ipfix"]},"application/ipp":{source:"iana"},"application/isup":{source:"iana"},"application/its+xml":{source:"iana",compressible:!0,extensions:["its"]},"application/java-archive":{source:"apache",compressible:!1,extensions:["jar","war","ear"]},"application/java-serialized-object":{source:"apache",compressible:!1,extensions:["ser"]},"application/java-vm":{source:"apache",compressible:!1,extensions:["class"]},"application/javascript":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["js","mjs"]},"application/jf2feed+json":{source:"iana",compressible:!0},"application/jose":{source:"iana"},"application/jose+json":{source:"iana",compressible:!0},"application/jrd+json":{source:"iana",compressible:!0},"application/jscalendar+json":{source:"iana",compressible:!0},"application/json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["json","map"]},"application/json-patch+json":{source:"iana",compressible:!0},"application/json-seq":{source:"iana"},"application/json5":{extensions:["json5"]},"application/jsonml+json":{source:"apache",compressible:!0,extensions:["jsonml"]},"application/jwk+json":{source:"iana",compressible:!0},"application/jwk-set+json":{source:"iana",compressible:!0},"application/jwt":{source:"iana"},"application/kpml-request+xml":{source:"iana",compressible:!0},"application/kpml-response+xml":{source:"iana",compressible:!0},"application/ld+json":{source:"iana",compressible:!0,extensions:["jsonld"]},"application/lgr+xml":{source:"iana",compressible:!0,extensions:["lgr"]},"application/link-format":{source:"iana"},"application/load-control+xml":{source:"iana",compressible:!0},"application/lost+xml":{source:"iana",compressible:!0,extensions:["lostxml"]},"application/lostsync+xml":{source:"iana",compressible:!0},"application/lpf+zip":{source:"iana",compressible:!1},"application/lxf":{source:"iana"},"application/mac-binhex40":{source:"iana",extensions:["hqx"]},"application/mac-compactpro":{source:"apache",extensions:["cpt"]},"application/macwriteii":{source:"iana"},"application/mads+xml":{source:"iana",compressible:!0,extensions:["mads"]},"application/manifest+json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["webmanifest"]},"application/marc":{source:"iana",extensions:["mrc"]},"application/marcxml+xml":{source:"iana",compressible:!0,extensions:["mrcx"]},"application/mathematica":{source:"iana",extensions:["ma","nb","mb"]},"application/mathml+xml":{source:"iana",compressible:!0,extensions:["mathml"]},"application/mathml-content+xml":{source:"iana",compressible:!0},"application/mathml-presentation+xml":{source:"iana",compressible:!0},"application/mbms-associated-procedure-description+xml":{source:"iana",compressible:!0},"application/mbms-deregister+xml":{source:"iana",compressible:!0},"application/mbms-envelope+xml":{source:"iana",compressible:!0},"application/mbms-msk+xml":{source:"iana",compressible:!0},"application/mbms-msk-response+xml":{source:"iana",compressible:!0},"application/mbms-protection-description+xml":{source:"iana",compressible:!0},"application/mbms-reception-report+xml":{source:"iana",compressible:!0},"application/mbms-register+xml":{source:"iana",compressible:!0},"application/mbms-register-response+xml":{source:"iana",compressible:!0},"application/mbms-schedule+xml":{source:"iana",compressible:!0},"application/mbms-user-service-description+xml":{source:"iana",compressible:!0},"application/mbox":{source:"iana",extensions:["mbox"]},"application/media-policy-dataset+xml":{source:"iana",compressible:!0,extensions:["mpf"]},"application/media_control+xml":{source:"iana",compressible:!0},"application/mediaservercontrol+xml":{source:"iana",compressible:!0,extensions:["mscml"]},"application/merge-patch+json":{source:"iana",compressible:!0},"application/metalink+xml":{source:"apache",compressible:!0,extensions:["metalink"]},"application/metalink4+xml":{source:"iana",compressible:!0,extensions:["meta4"]},"application/mets+xml":{source:"iana",compressible:!0,extensions:["mets"]},"application/mf4":{source:"iana"},"application/mikey":{source:"iana"},"application/mipc":{source:"iana"},"application/missing-blocks+cbor-seq":{source:"iana"},"application/mmt-aei+xml":{source:"iana",compressible:!0,extensions:["maei"]},"application/mmt-usd+xml":{source:"iana",compressible:!0,extensions:["musd"]},"application/mods+xml":{source:"iana",compressible:!0,extensions:["mods"]},"application/moss-keys":{source:"iana"},"application/moss-signature":{source:"iana"},"application/mosskey-data":{source:"iana"},"application/mosskey-request":{source:"iana"},"application/mp21":{source:"iana",extensions:["m21","mp21"]},"application/mp4":{source:"iana",extensions:["mp4s","m4p"]},"application/mpeg4-generic":{source:"iana"},"application/mpeg4-iod":{source:"iana"},"application/mpeg4-iod-xmt":{source:"iana"},"application/mrb-consumer+xml":{source:"iana",compressible:!0},"application/mrb-publish+xml":{source:"iana",compressible:!0},"application/msc-ivr+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msc-mixer+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msword":{source:"iana",compressible:!1,extensions:["doc","dot"]},"application/mud+json":{source:"iana",compressible:!0},"application/multipart-core":{source:"iana"},"application/mxf":{source:"iana",extensions:["mxf"]},"application/n-quads":{source:"iana",extensions:["nq"]},"application/n-triples":{source:"iana",extensions:["nt"]},"application/nasdata":{source:"iana"},"application/news-checkgroups":{source:"iana",charset:"US-ASCII"},"application/news-groupinfo":{source:"iana",charset:"US-ASCII"},"application/news-transmission":{source:"iana"},"application/nlsml+xml":{source:"iana",compressible:!0},"application/node":{source:"iana",extensions:["cjs"]},"application/nss":{source:"iana"},"application/oauth-authz-req+jwt":{source:"iana"},"application/oblivious-dns-message":{source:"iana"},"application/ocsp-request":{source:"iana"},"application/ocsp-response":{source:"iana"},"application/octet-stream":{source:"iana",compressible:!1,extensions:["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{source:"iana",extensions:["oda"]},"application/odm+xml":{source:"iana",compressible:!0},"application/odx":{source:"iana"},"application/oebps-package+xml":{source:"iana",compressible:!0,extensions:["opf"]},"application/ogg":{source:"iana",compressible:!1,extensions:["ogx"]},"application/omdoc+xml":{source:"apache",compressible:!0,extensions:["omdoc"]},"application/onenote":{source:"apache",extensions:["onetoc","onetoc2","onetmp","onepkg"]},"application/opc-nodeset+xml":{source:"iana",compressible:!0},"application/oscore":{source:"iana"},"application/oxps":{source:"iana",extensions:["oxps"]},"application/p21":{source:"iana"},"application/p21+zip":{source:"iana",compressible:!1},"application/p2p-overlay+xml":{source:"iana",compressible:!0,extensions:["relo"]},"application/parityfec":{source:"iana"},"application/passport":{source:"iana"},"application/patch-ops-error+xml":{source:"iana",compressible:!0,extensions:["xer"]},"application/pdf":{source:"iana",compressible:!1,extensions:["pdf"]},"application/pdx":{source:"iana"},"application/pem-certificate-chain":{source:"iana"},"application/pgp-encrypted":{source:"iana",compressible:!1,extensions:["pgp"]},"application/pgp-keys":{source:"iana",extensions:["asc"]},"application/pgp-signature":{source:"iana",extensions:["asc","sig"]},"application/pics-rules":{source:"apache",extensions:["prf"]},"application/pidf+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pidf-diff+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pkcs10":{source:"iana",extensions:["p10"]},"application/pkcs12":{source:"iana"},"application/pkcs7-mime":{source:"iana",extensions:["p7m","p7c"]},"application/pkcs7-signature":{source:"iana",extensions:["p7s"]},"application/pkcs8":{source:"iana",extensions:["p8"]},"application/pkcs8-encrypted":{source:"iana"},"application/pkix-attr-cert":{source:"iana",extensions:["ac"]},"application/pkix-cert":{source:"iana",extensions:["cer"]},"application/pkix-crl":{source:"iana",extensions:["crl"]},"application/pkix-pkipath":{source:"iana",extensions:["pkipath"]},"application/pkixcmp":{source:"iana",extensions:["pki"]},"application/pls+xml":{source:"iana",compressible:!0,extensions:["pls"]},"application/poc-settings+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/postscript":{source:"iana",compressible:!0,extensions:["ai","eps","ps"]},"application/ppsp-tracker+json":{source:"iana",compressible:!0},"application/problem+json":{source:"iana",compressible:!0},"application/problem+xml":{source:"iana",compressible:!0},"application/provenance+xml":{source:"iana",compressible:!0,extensions:["provx"]},"application/prs.alvestrand.titrax-sheet":{source:"iana"},"application/prs.cww":{source:"iana",extensions:["cww"]},"application/prs.cyn":{source:"iana",charset:"7-BIT"},"application/prs.hpub+zip":{source:"iana",compressible:!1},"application/prs.nprend":{source:"iana"},"application/prs.plucker":{source:"iana"},"application/prs.rdf-xml-crypt":{source:"iana"},"application/prs.xsf+xml":{source:"iana",compressible:!0},"application/pskc+xml":{source:"iana",compressible:!0,extensions:["pskcxml"]},"application/pvd+json":{source:"iana",compressible:!0},"application/qsig":{source:"iana"},"application/raml+yaml":{compressible:!0,extensions:["raml"]},"application/raptorfec":{source:"iana"},"application/rdap+json":{source:"iana",compressible:!0},"application/rdf+xml":{source:"iana",compressible:!0,extensions:["rdf","owl"]},"application/reginfo+xml":{source:"iana",compressible:!0,extensions:["rif"]},"application/relax-ng-compact-syntax":{source:"iana",extensions:["rnc"]},"application/remote-printing":{source:"iana"},"application/reputon+json":{source:"iana",compressible:!0},"application/resource-lists+xml":{source:"iana",compressible:!0,extensions:["rl"]},"application/resource-lists-diff+xml":{source:"iana",compressible:!0,extensions:["rld"]},"application/rfc+xml":{source:"iana",compressible:!0},"application/riscos":{source:"iana"},"application/rlmi+xml":{source:"iana",compressible:!0},"application/rls-services+xml":{source:"iana",compressible:!0,extensions:["rs"]},"application/route-apd+xml":{source:"iana",compressible:!0,extensions:["rapd"]},"application/route-s-tsid+xml":{source:"iana",compressible:!0,extensions:["sls"]},"application/route-usd+xml":{source:"iana",compressible:!0,extensions:["rusd"]},"application/rpki-ghostbusters":{source:"iana",extensions:["gbr"]},"application/rpki-manifest":{source:"iana",extensions:["mft"]},"application/rpki-publication":{source:"iana"},"application/rpki-roa":{source:"iana",extensions:["roa"]},"application/rpki-updown":{source:"iana"},"application/rsd+xml":{source:"apache",compressible:!0,extensions:["rsd"]},"application/rss+xml":{source:"apache",compressible:!0,extensions:["rss"]},"application/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"application/rtploopback":{source:"iana"},"application/rtx":{source:"iana"},"application/samlassertion+xml":{source:"iana",compressible:!0},"application/samlmetadata+xml":{source:"iana",compressible:!0},"application/sarif+json":{source:"iana",compressible:!0},"application/sarif-external-properties+json":{source:"iana",compressible:!0},"application/sbe":{source:"iana"},"application/sbml+xml":{source:"iana",compressible:!0,extensions:["sbml"]},"application/scaip+xml":{source:"iana",compressible:!0},"application/scim+json":{source:"iana",compressible:!0},"application/scvp-cv-request":{source:"iana",extensions:["scq"]},"application/scvp-cv-response":{source:"iana",extensions:["scs"]},"application/scvp-vp-request":{source:"iana",extensions:["spq"]},"application/scvp-vp-response":{source:"iana",extensions:["spp"]},"application/sdp":{source:"iana",extensions:["sdp"]},"application/secevent+jwt":{source:"iana"},"application/senml+cbor":{source:"iana"},"application/senml+json":{source:"iana",compressible:!0},"application/senml+xml":{source:"iana",compressible:!0,extensions:["senmlx"]},"application/senml-etch+cbor":{source:"iana"},"application/senml-etch+json":{source:"iana",compressible:!0},"application/senml-exi":{source:"iana"},"application/sensml+cbor":{source:"iana"},"application/sensml+json":{source:"iana",compressible:!0},"application/sensml+xml":{source:"iana",compressible:!0,extensions:["sensmlx"]},"application/sensml-exi":{source:"iana"},"application/sep+xml":{source:"iana",compressible:!0},"application/sep-exi":{source:"iana"},"application/session-info":{source:"iana"},"application/set-payment":{source:"iana"},"application/set-payment-initiation":{source:"iana",extensions:["setpay"]},"application/set-registration":{source:"iana"},"application/set-registration-initiation":{source:"iana",extensions:["setreg"]},"application/sgml":{source:"iana"},"application/sgml-open-catalog":{source:"iana"},"application/shf+xml":{source:"iana",compressible:!0,extensions:["shf"]},"application/sieve":{source:"iana",extensions:["siv","sieve"]},"application/simple-filter+xml":{source:"iana",compressible:!0},"application/simple-message-summary":{source:"iana"},"application/simplesymbolcontainer":{source:"iana"},"application/sipc":{source:"iana"},"application/slate":{source:"iana"},"application/smil":{source:"iana"},"application/smil+xml":{source:"iana",compressible:!0,extensions:["smi","smil"]},"application/smpte336m":{source:"iana"},"application/soap+fastinfoset":{source:"iana"},"application/soap+xml":{source:"iana",compressible:!0},"application/sparql-query":{source:"iana",extensions:["rq"]},"application/sparql-results+xml":{source:"iana",compressible:!0,extensions:["srx"]},"application/spdx+json":{source:"iana",compressible:!0},"application/spirits-event+xml":{source:"iana",compressible:!0},"application/sql":{source:"iana"},"application/srgs":{source:"iana",extensions:["gram"]},"application/srgs+xml":{source:"iana",compressible:!0,extensions:["grxml"]},"application/sru+xml":{source:"iana",compressible:!0,extensions:["sru"]},"application/ssdl+xml":{source:"apache",compressible:!0,extensions:["ssdl"]},"application/ssml+xml":{source:"iana",compressible:!0,extensions:["ssml"]},"application/stix+json":{source:"iana",compressible:!0},"application/swid+xml":{source:"iana",compressible:!0,extensions:["swidtag"]},"application/tamp-apex-update":{source:"iana"},"application/tamp-apex-update-confirm":{source:"iana"},"application/tamp-community-update":{source:"iana"},"application/tamp-community-update-confirm":{source:"iana"},"application/tamp-error":{source:"iana"},"application/tamp-sequence-adjust":{source:"iana"},"application/tamp-sequence-adjust-confirm":{source:"iana"},"application/tamp-status-query":{source:"iana"},"application/tamp-status-response":{source:"iana"},"application/tamp-update":{source:"iana"},"application/tamp-update-confirm":{source:"iana"},"application/tar":{compressible:!0},"application/taxii+json":{source:"iana",compressible:!0},"application/td+json":{source:"iana",compressible:!0},"application/tei+xml":{source:"iana",compressible:!0,extensions:["tei","teicorpus"]},"application/tetra_isi":{source:"iana"},"application/thraud+xml":{source:"iana",compressible:!0,extensions:["tfi"]},"application/timestamp-query":{source:"iana"},"application/timestamp-reply":{source:"iana"},"application/timestamped-data":{source:"iana",extensions:["tsd"]},"application/tlsrpt+gzip":{source:"iana"},"application/tlsrpt+json":{source:"iana",compressible:!0},"application/tnauthlist":{source:"iana"},"application/token-introspection+jwt":{source:"iana"},"application/toml":{compressible:!0,extensions:["toml"]},"application/trickle-ice-sdpfrag":{source:"iana"},"application/trig":{source:"iana",extensions:["trig"]},"application/ttml+xml":{source:"iana",compressible:!0,extensions:["ttml"]},"application/tve-trigger":{source:"iana"},"application/tzif":{source:"iana"},"application/tzif-leap":{source:"iana"},"application/ubjson":{compressible:!1,extensions:["ubj"]},"application/ulpfec":{source:"iana"},"application/urc-grpsheet+xml":{source:"iana",compressible:!0},"application/urc-ressheet+xml":{source:"iana",compressible:!0,extensions:["rsheet"]},"application/urc-targetdesc+xml":{source:"iana",compressible:!0,extensions:["td"]},"application/urc-uisocketdesc+xml":{source:"iana",compressible:!0},"application/vcard+json":{source:"iana",compressible:!0},"application/vcard+xml":{source:"iana",compressible:!0},"application/vemmi":{source:"iana"},"application/vividence.scriptfile":{source:"apache"},"application/vnd.1000minds.decision-model+xml":{source:"iana",compressible:!0,extensions:["1km"]},"application/vnd.3gpp-prose+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-prose-pc3ch+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-v2x-local-service-information":{source:"iana"},"application/vnd.3gpp.5gnas":{source:"iana"},"application/vnd.3gpp.access-transfer-events+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.bsf+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gmop+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gtpc":{source:"iana"},"application/vnd.3gpp.interworking-data":{source:"iana"},"application/vnd.3gpp.lpp":{source:"iana"},"application/vnd.3gpp.mc-signalling-ear":{source:"iana"},"application/vnd.3gpp.mcdata-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-payload":{source:"iana"},"application/vnd.3gpp.mcdata-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-signalling":{source:"iana"},"application/vnd.3gpp.mcdata-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-floor-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-signed+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-init-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-transmission-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mid-call+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ngap":{source:"iana"},"application/vnd.3gpp.pfcp":{source:"iana"},"application/vnd.3gpp.pic-bw-large":{source:"iana",extensions:["plb"]},"application/vnd.3gpp.pic-bw-small":{source:"iana",extensions:["psb"]},"application/vnd.3gpp.pic-bw-var":{source:"iana",extensions:["pvb"]},"application/vnd.3gpp.s1ap":{source:"iana"},"application/vnd.3gpp.sms":{source:"iana"},"application/vnd.3gpp.sms+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-ext+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.state-and-event-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ussd+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.bcmcsinfo+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.sms":{source:"iana"},"application/vnd.3gpp2.tcap":{source:"iana",extensions:["tcap"]},"application/vnd.3lightssoftware.imagescal":{source:"iana"},"application/vnd.3m.post-it-notes":{source:"iana",extensions:["pwn"]},"application/vnd.accpac.simply.aso":{source:"iana",extensions:["aso"]},"application/vnd.accpac.simply.imp":{source:"iana",extensions:["imp"]},"application/vnd.acucobol":{source:"iana",extensions:["acu"]},"application/vnd.acucorp":{source:"iana",extensions:["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{source:"apache",compressible:!1,extensions:["air"]},"application/vnd.adobe.flash.movie":{source:"iana"},"application/vnd.adobe.formscentral.fcdt":{source:"iana",extensions:["fcdt"]},"application/vnd.adobe.fxp":{source:"iana",extensions:["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{source:"iana"},"application/vnd.adobe.xdp+xml":{source:"iana",compressible:!0,extensions:["xdp"]},"application/vnd.adobe.xfdf":{source:"iana",extensions:["xfdf"]},"application/vnd.aether.imp":{source:"iana"},"application/vnd.afpc.afplinedata":{source:"iana"},"application/vnd.afpc.afplinedata-pagedef":{source:"iana"},"application/vnd.afpc.cmoca-cmresource":{source:"iana"},"application/vnd.afpc.foca-charset":{source:"iana"},"application/vnd.afpc.foca-codedfont":{source:"iana"},"application/vnd.afpc.foca-codepage":{source:"iana"},"application/vnd.afpc.modca":{source:"iana"},"application/vnd.afpc.modca-cmtable":{source:"iana"},"application/vnd.afpc.modca-formdef":{source:"iana"},"application/vnd.afpc.modca-mediummap":{source:"iana"},"application/vnd.afpc.modca-objectcontainer":{source:"iana"},"application/vnd.afpc.modca-overlay":{source:"iana"},"application/vnd.afpc.modca-pagesegment":{source:"iana"},"application/vnd.age":{source:"iana",extensions:["age"]},"application/vnd.ah-barcode":{source:"iana"},"application/vnd.ahead.space":{source:"iana",extensions:["ahead"]},"application/vnd.airzip.filesecure.azf":{source:"iana",extensions:["azf"]},"application/vnd.airzip.filesecure.azs":{source:"iana",extensions:["azs"]},"application/vnd.amadeus+json":{source:"iana",compressible:!0},"application/vnd.amazon.ebook":{source:"apache",extensions:["azw"]},"application/vnd.amazon.mobi8-ebook":{source:"iana"},"application/vnd.americandynamics.acc":{source:"iana",extensions:["acc"]},"application/vnd.amiga.ami":{source:"iana",extensions:["ami"]},"application/vnd.amundsen.maze+xml":{source:"iana",compressible:!0},"application/vnd.android.ota":{source:"iana"},"application/vnd.android.package-archive":{source:"apache",compressible:!1,extensions:["apk"]},"application/vnd.anki":{source:"iana"},"application/vnd.anser-web-certificate-issue-initiation":{source:"iana",extensions:["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{source:"apache",extensions:["fti"]},"application/vnd.antix.game-component":{source:"iana",extensions:["atx"]},"application/vnd.apache.arrow.file":{source:"iana"},"application/vnd.apache.arrow.stream":{source:"iana"},"application/vnd.apache.thrift.binary":{source:"iana"},"application/vnd.apache.thrift.compact":{source:"iana"},"application/vnd.apache.thrift.json":{source:"iana"},"application/vnd.api+json":{source:"iana",compressible:!0},"application/vnd.aplextor.warrp+json":{source:"iana",compressible:!0},"application/vnd.apothekende.reservation+json":{source:"iana",compressible:!0},"application/vnd.apple.installer+xml":{source:"iana",compressible:!0,extensions:["mpkg"]},"application/vnd.apple.keynote":{source:"iana",extensions:["key"]},"application/vnd.apple.mpegurl":{source:"iana",extensions:["m3u8"]},"application/vnd.apple.numbers":{source:"iana",extensions:["numbers"]},"application/vnd.apple.pages":{source:"iana",extensions:["pages"]},"application/vnd.apple.pkpass":{compressible:!1,extensions:["pkpass"]},"application/vnd.arastra.swi":{source:"iana"},"application/vnd.aristanetworks.swi":{source:"iana",extensions:["swi"]},"application/vnd.artisan+json":{source:"iana",compressible:!0},"application/vnd.artsquare":{source:"iana"},"application/vnd.astraea-software.iota":{source:"iana",extensions:["iota"]},"application/vnd.audiograph":{source:"iana",extensions:["aep"]},"application/vnd.autopackage":{source:"iana"},"application/vnd.avalon+json":{source:"iana",compressible:!0},"application/vnd.avistar+xml":{source:"iana",compressible:!0},"application/vnd.balsamiq.bmml+xml":{source:"iana",compressible:!0,extensions:["bmml"]},"application/vnd.balsamiq.bmpr":{source:"iana"},"application/vnd.banana-accounting":{source:"iana"},"application/vnd.bbf.usp.error":{source:"iana"},"application/vnd.bbf.usp.msg":{source:"iana"},"application/vnd.bbf.usp.msg+json":{source:"iana",compressible:!0},"application/vnd.bekitzur-stech+json":{source:"iana",compressible:!0},"application/vnd.bint.med-content":{source:"iana"},"application/vnd.biopax.rdf+xml":{source:"iana",compressible:!0},"application/vnd.blink-idb-value-wrapper":{source:"iana"},"application/vnd.blueice.multipass":{source:"iana",extensions:["mpm"]},"application/vnd.bluetooth.ep.oob":{source:"iana"},"application/vnd.bluetooth.le.oob":{source:"iana"},"application/vnd.bmi":{source:"iana",extensions:["bmi"]},"application/vnd.bpf":{source:"iana"},"application/vnd.bpf3":{source:"iana"},"application/vnd.businessobjects":{source:"iana",extensions:["rep"]},"application/vnd.byu.uapi+json":{source:"iana",compressible:!0},"application/vnd.cab-jscript":{source:"iana"},"application/vnd.canon-cpdl":{source:"iana"},"application/vnd.canon-lips":{source:"iana"},"application/vnd.capasystems-pg+json":{source:"iana",compressible:!0},"application/vnd.cendio.thinlinc.clientconf":{source:"iana"},"application/vnd.century-systems.tcp_stream":{source:"iana"},"application/vnd.chemdraw+xml":{source:"iana",compressible:!0,extensions:["cdxml"]},"application/vnd.chess-pgn":{source:"iana"},"application/vnd.chipnuts.karaoke-mmd":{source:"iana",extensions:["mmd"]},"application/vnd.ciedi":{source:"iana"},"application/vnd.cinderella":{source:"iana",extensions:["cdy"]},"application/vnd.cirpack.isdn-ext":{source:"iana"},"application/vnd.citationstyles.style+xml":{source:"iana",compressible:!0,extensions:["csl"]},"application/vnd.claymore":{source:"iana",extensions:["cla"]},"application/vnd.cloanto.rp9":{source:"iana",extensions:["rp9"]},"application/vnd.clonk.c4group":{source:"iana",extensions:["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{source:"iana",extensions:["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{source:"iana",extensions:["c11amz"]},"application/vnd.coffeescript":{source:"iana"},"application/vnd.collabio.xodocuments.document":{source:"iana"},"application/vnd.collabio.xodocuments.document-template":{source:"iana"},"application/vnd.collabio.xodocuments.presentation":{source:"iana"},"application/vnd.collabio.xodocuments.presentation-template":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet-template":{source:"iana"},"application/vnd.collection+json":{source:"iana",compressible:!0},"application/vnd.collection.doc+json":{source:"iana",compressible:!0},"application/vnd.collection.next+json":{source:"iana",compressible:!0},"application/vnd.comicbook+zip":{source:"iana",compressible:!1},"application/vnd.comicbook-rar":{source:"iana"},"application/vnd.commerce-battelle":{source:"iana"},"application/vnd.commonspace":{source:"iana",extensions:["csp"]},"application/vnd.contact.cmsg":{source:"iana",extensions:["cdbcmsg"]},"application/vnd.coreos.ignition+json":{source:"iana",compressible:!0},"application/vnd.cosmocaller":{source:"iana",extensions:["cmc"]},"application/vnd.crick.clicker":{source:"iana",extensions:["clkx"]},"application/vnd.crick.clicker.keyboard":{source:"iana",extensions:["clkk"]},"application/vnd.crick.clicker.palette":{source:"iana",extensions:["clkp"]},"application/vnd.crick.clicker.template":{source:"iana",extensions:["clkt"]},"application/vnd.crick.clicker.wordbank":{source:"iana",extensions:["clkw"]},"application/vnd.criticaltools.wbs+xml":{source:"iana",compressible:!0,extensions:["wbs"]},"application/vnd.cryptii.pipe+json":{source:"iana",compressible:!0},"application/vnd.crypto-shade-file":{source:"iana"},"application/vnd.cryptomator.encrypted":{source:"iana"},"application/vnd.cryptomator.vault":{source:"iana"},"application/vnd.ctc-posml":{source:"iana",extensions:["pml"]},"application/vnd.ctct.ws+xml":{source:"iana",compressible:!0},"application/vnd.cups-pdf":{source:"iana"},"application/vnd.cups-postscript":{source:"iana"},"application/vnd.cups-ppd":{source:"iana",extensions:["ppd"]},"application/vnd.cups-raster":{source:"iana"},"application/vnd.cups-raw":{source:"iana"},"application/vnd.curl":{source:"iana"},"application/vnd.curl.car":{source:"apache",extensions:["car"]},"application/vnd.curl.pcurl":{source:"apache",extensions:["pcurl"]},"application/vnd.cyan.dean.root+xml":{source:"iana",compressible:!0},"application/vnd.cybank":{source:"iana"},"application/vnd.cyclonedx+json":{source:"iana",compressible:!0},"application/vnd.cyclonedx+xml":{source:"iana",compressible:!0},"application/vnd.d2l.coursepackage1p0+zip":{source:"iana",compressible:!1},"application/vnd.d3m-dataset":{source:"iana"},"application/vnd.d3m-problem":{source:"iana"},"application/vnd.dart":{source:"iana",compressible:!0,extensions:["dart"]},"application/vnd.data-vision.rdz":{source:"iana",extensions:["rdz"]},"application/vnd.datapackage+json":{source:"iana",compressible:!0},"application/vnd.dataresource+json":{source:"iana",compressible:!0},"application/vnd.dbf":{source:"iana",extensions:["dbf"]},"application/vnd.debian.binary-package":{source:"iana"},"application/vnd.dece.data":{source:"iana",extensions:["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{source:"iana",compressible:!0,extensions:["uvt","uvvt"]},"application/vnd.dece.unspecified":{source:"iana",extensions:["uvx","uvvx"]},"application/vnd.dece.zip":{source:"iana",extensions:["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{source:"iana",extensions:["fe_launch"]},"application/vnd.desmume.movie":{source:"iana"},"application/vnd.dir-bi.plate-dl-nosuffix":{source:"iana"},"application/vnd.dm.delegation+xml":{source:"iana",compressible:!0},"application/vnd.dna":{source:"iana",extensions:["dna"]},"application/vnd.document+json":{source:"iana",compressible:!0},"application/vnd.dolby.mlp":{source:"apache",extensions:["mlp"]},"application/vnd.dolby.mobile.1":{source:"iana"},"application/vnd.dolby.mobile.2":{source:"iana"},"application/vnd.doremir.scorecloud-binary-document":{source:"iana"},"application/vnd.dpgraph":{source:"iana",extensions:["dpg"]},"application/vnd.dreamfactory":{source:"iana",extensions:["dfac"]},"application/vnd.drive+json":{source:"iana",compressible:!0},"application/vnd.ds-keypoint":{source:"apache",extensions:["kpxx"]},"application/vnd.dtg.local":{source:"iana"},"application/vnd.dtg.local.flash":{source:"iana"},"application/vnd.dtg.local.html":{source:"iana"},"application/vnd.dvb.ait":{source:"iana",extensions:["ait"]},"application/vnd.dvb.dvbisl+xml":{source:"iana",compressible:!0},"application/vnd.dvb.dvbj":{source:"iana"},"application/vnd.dvb.esgcontainer":{source:"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess2":{source:"iana"},"application/vnd.dvb.ipdcesgpdd":{source:"iana"},"application/vnd.dvb.ipdcroaming":{source:"iana"},"application/vnd.dvb.iptv.alfec-base":{source:"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{source:"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-container+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-generic+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-msglist+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-request+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-response+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-init+xml":{source:"iana",compressible:!0},"application/vnd.dvb.pfr":{source:"iana"},"application/vnd.dvb.service":{source:"iana",extensions:["svc"]},"application/vnd.dxr":{source:"iana"},"application/vnd.dynageo":{source:"iana",extensions:["geo"]},"application/vnd.dzr":{source:"iana"},"application/vnd.easykaraoke.cdgdownload":{source:"iana"},"application/vnd.ecdis-update":{source:"iana"},"application/vnd.ecip.rlp":{source:"iana"},"application/vnd.eclipse.ditto+json":{source:"iana",compressible:!0},"application/vnd.ecowin.chart":{source:"iana",extensions:["mag"]},"application/vnd.ecowin.filerequest":{source:"iana"},"application/vnd.ecowin.fileupdate":{source:"iana"},"application/vnd.ecowin.series":{source:"iana"},"application/vnd.ecowin.seriesrequest":{source:"iana"},"application/vnd.ecowin.seriesupdate":{source:"iana"},"application/vnd.efi.img":{source:"iana"},"application/vnd.efi.iso":{source:"iana"},"application/vnd.emclient.accessrequest+xml":{source:"iana",compressible:!0},"application/vnd.enliven":{source:"iana",extensions:["nml"]},"application/vnd.enphase.envoy":{source:"iana"},"application/vnd.eprints.data+xml":{source:"iana",compressible:!0},"application/vnd.epson.esf":{source:"iana",extensions:["esf"]},"application/vnd.epson.msf":{source:"iana",extensions:["msf"]},"application/vnd.epson.quickanime":{source:"iana",extensions:["qam"]},"application/vnd.epson.salt":{source:"iana",extensions:["slt"]},"application/vnd.epson.ssf":{source:"iana",extensions:["ssf"]},"application/vnd.ericsson.quickcall":{source:"iana"},"application/vnd.espass-espass+zip":{source:"iana",compressible:!1},"application/vnd.eszigno3+xml":{source:"iana",compressible:!0,extensions:["es3","et3"]},"application/vnd.etsi.aoc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.asic-e+zip":{source:"iana",compressible:!1},"application/vnd.etsi.asic-s+zip":{source:"iana",compressible:!1},"application/vnd.etsi.cug+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvcommand+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-bc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-cod+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-npvr+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvservice+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsync+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvueprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mcid+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mheg5":{source:"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{source:"iana",compressible:!0},"application/vnd.etsi.pstn+xml":{source:"iana",compressible:!0},"application/vnd.etsi.sci+xml":{source:"iana",compressible:!0},"application/vnd.etsi.simservs+xml":{source:"iana",compressible:!0},"application/vnd.etsi.timestamp-token":{source:"iana"},"application/vnd.etsi.tsl+xml":{source:"iana",compressible:!0},"application/vnd.etsi.tsl.der":{source:"iana"},"application/vnd.eu.kasparian.car+json":{source:"iana",compressible:!0},"application/vnd.eudora.data":{source:"iana"},"application/vnd.evolv.ecig.profile":{source:"iana"},"application/vnd.evolv.ecig.settings":{source:"iana"},"application/vnd.evolv.ecig.theme":{source:"iana"},"application/vnd.exstream-empower+zip":{source:"iana",compressible:!1},"application/vnd.exstream-package":{source:"iana"},"application/vnd.ezpix-album":{source:"iana",extensions:["ez2"]},"application/vnd.ezpix-package":{source:"iana",extensions:["ez3"]},"application/vnd.f-secure.mobile":{source:"iana"},"application/vnd.familysearch.gedcom+zip":{source:"iana",compressible:!1},"application/vnd.fastcopy-disk-image":{source:"iana"},"application/vnd.fdf":{source:"iana",extensions:["fdf"]},"application/vnd.fdsn.mseed":{source:"iana",extensions:["mseed"]},"application/vnd.fdsn.seed":{source:"iana",extensions:["seed","dataless"]},"application/vnd.ffsns":{source:"iana"},"application/vnd.ficlab.flb+zip":{source:"iana",compressible:!1},"application/vnd.filmit.zfc":{source:"iana"},"application/vnd.fints":{source:"iana"},"application/vnd.firemonkeys.cloudcell":{source:"iana"},"application/vnd.flographit":{source:"iana",extensions:["gph"]},"application/vnd.fluxtime.clip":{source:"iana",extensions:["ftc"]},"application/vnd.font-fontforge-sfd":{source:"iana"},"application/vnd.framemaker":{source:"iana",extensions:["fm","frame","maker","book"]},"application/vnd.frogans.fnc":{source:"iana",extensions:["fnc"]},"application/vnd.frogans.ltf":{source:"iana",extensions:["ltf"]},"application/vnd.fsc.weblaunch":{source:"iana",extensions:["fsc"]},"application/vnd.fujifilm.fb.docuworks":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.binder":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.container":{source:"iana"},"application/vnd.fujifilm.fb.jfi+xml":{source:"iana",compressible:!0},"application/vnd.fujitsu.oasys":{source:"iana",extensions:["oas"]},"application/vnd.fujitsu.oasys2":{source:"iana",extensions:["oa2"]},"application/vnd.fujitsu.oasys3":{source:"iana",extensions:["oa3"]},"application/vnd.fujitsu.oasysgp":{source:"iana",extensions:["fg5"]},"application/vnd.fujitsu.oasysprs":{source:"iana",extensions:["bh2"]},"application/vnd.fujixerox.art-ex":{source:"iana"},"application/vnd.fujixerox.art4":{source:"iana"},"application/vnd.fujixerox.ddd":{source:"iana",extensions:["ddd"]},"application/vnd.fujixerox.docuworks":{source:"iana",extensions:["xdw"]},"application/vnd.fujixerox.docuworks.binder":{source:"iana",extensions:["xbd"]},"application/vnd.fujixerox.docuworks.container":{source:"iana"},"application/vnd.fujixerox.hbpl":{source:"iana"},"application/vnd.fut-misnet":{source:"iana"},"application/vnd.futoin+cbor":{source:"iana"},"application/vnd.futoin+json":{source:"iana",compressible:!0},"application/vnd.fuzzysheet":{source:"iana",extensions:["fzs"]},"application/vnd.genomatix.tuxedo":{source:"iana",extensions:["txd"]},"application/vnd.gentics.grd+json":{source:"iana",compressible:!0},"application/vnd.geo+json":{source:"iana",compressible:!0},"application/vnd.geocube+xml":{source:"iana",compressible:!0},"application/vnd.geogebra.file":{source:"iana",extensions:["ggb"]},"application/vnd.geogebra.slides":{source:"iana"},"application/vnd.geogebra.tool":{source:"iana",extensions:["ggt"]},"application/vnd.geometry-explorer":{source:"iana",extensions:["gex","gre"]},"application/vnd.geonext":{source:"iana",extensions:["gxt"]},"application/vnd.geoplan":{source:"iana",extensions:["g2w"]},"application/vnd.geospace":{source:"iana",extensions:["g3w"]},"application/vnd.gerber":{source:"iana"},"application/vnd.globalplatform.card-content-mgt":{source:"iana"},"application/vnd.globalplatform.card-content-mgt-response":{source:"iana"},"application/vnd.gmx":{source:"iana",extensions:["gmx"]},"application/vnd.google-apps.document":{compressible:!1,extensions:["gdoc"]},"application/vnd.google-apps.presentation":{compressible:!1,extensions:["gslides"]},"application/vnd.google-apps.spreadsheet":{compressible:!1,extensions:["gsheet"]},"application/vnd.google-earth.kml+xml":{source:"iana",compressible:!0,extensions:["kml"]},"application/vnd.google-earth.kmz":{source:"iana",compressible:!1,extensions:["kmz"]},"application/vnd.gov.sk.e-form+xml":{source:"iana",compressible:!0},"application/vnd.gov.sk.e-form+zip":{source:"iana",compressible:!1},"application/vnd.gov.sk.xmldatacontainer+xml":{source:"iana",compressible:!0},"application/vnd.grafeq":{source:"iana",extensions:["gqf","gqs"]},"application/vnd.gridmp":{source:"iana"},"application/vnd.groove-account":{source:"iana",extensions:["gac"]},"application/vnd.groove-help":{source:"iana",extensions:["ghf"]},"application/vnd.groove-identity-message":{source:"iana",extensions:["gim"]},"application/vnd.groove-injector":{source:"iana",extensions:["grv"]},"application/vnd.groove-tool-message":{source:"iana",extensions:["gtm"]},"application/vnd.groove-tool-template":{source:"iana",extensions:["tpl"]},"application/vnd.groove-vcard":{source:"iana",extensions:["vcg"]},"application/vnd.hal+json":{source:"iana",compressible:!0},"application/vnd.hal+xml":{source:"iana",compressible:!0,extensions:["hal"]},"application/vnd.handheld-entertainment+xml":{source:"iana",compressible:!0,extensions:["zmm"]},"application/vnd.hbci":{source:"iana",extensions:["hbci"]},"application/vnd.hc+json":{source:"iana",compressible:!0},"application/vnd.hcl-bireports":{source:"iana"},"application/vnd.hdt":{source:"iana"},"application/vnd.heroku+json":{source:"iana",compressible:!0},"application/vnd.hhe.lesson-player":{source:"iana",extensions:["les"]},"application/vnd.hl7cda+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hl7v2+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hp-hpgl":{source:"iana",extensions:["hpgl"]},"application/vnd.hp-hpid":{source:"iana",extensions:["hpid"]},"application/vnd.hp-hps":{source:"iana",extensions:["hps"]},"application/vnd.hp-jlyt":{source:"iana",extensions:["jlt"]},"application/vnd.hp-pcl":{source:"iana",extensions:["pcl"]},"application/vnd.hp-pclxl":{source:"iana",extensions:["pclxl"]},"application/vnd.httphone":{source:"iana"},"application/vnd.hydrostatix.sof-data":{source:"iana",extensions:["sfd-hdstx"]},"application/vnd.hyper+json":{source:"iana",compressible:!0},"application/vnd.hyper-item+json":{source:"iana",compressible:!0},"application/vnd.hyperdrive+json":{source:"iana",compressible:!0},"application/vnd.hzn-3d-crossword":{source:"iana"},"application/vnd.ibm.afplinedata":{source:"iana"},"application/vnd.ibm.electronic-media":{source:"iana"},"application/vnd.ibm.minipay":{source:"iana",extensions:["mpy"]},"application/vnd.ibm.modcap":{source:"iana",extensions:["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{source:"iana",extensions:["irm"]},"application/vnd.ibm.secure-container":{source:"iana",extensions:["sc"]},"application/vnd.iccprofile":{source:"iana",extensions:["icc","icm"]},"application/vnd.ieee.1905":{source:"iana"},"application/vnd.igloader":{source:"iana",extensions:["igl"]},"application/vnd.imagemeter.folder+zip":{source:"iana",compressible:!1},"application/vnd.imagemeter.image+zip":{source:"iana",compressible:!1},"application/vnd.immervision-ivp":{source:"iana",extensions:["ivp"]},"application/vnd.immervision-ivu":{source:"iana",extensions:["ivu"]},"application/vnd.ims.imsccv1p1":{source:"iana"},"application/vnd.ims.imsccv1p2":{source:"iana"},"application/vnd.ims.imsccv1p3":{source:"iana"},"application/vnd.ims.lis.v2.result+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy.id+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings.simple+json":{source:"iana",compressible:!0},"application/vnd.informedcontrol.rms+xml":{source:"iana",compressible:!0},"application/vnd.informix-visionary":{source:"iana"},"application/vnd.infotech.project":{source:"iana"},"application/vnd.infotech.project+xml":{source:"iana",compressible:!0},"application/vnd.innopath.wamp.notification":{source:"iana"},"application/vnd.insors.igm":{source:"iana",extensions:["igm"]},"application/vnd.intercon.formnet":{source:"iana",extensions:["xpw","xpx"]},"application/vnd.intergeo":{source:"iana",extensions:["i2g"]},"application/vnd.intertrust.digibox":{source:"iana"},"application/vnd.intertrust.nncp":{source:"iana"},"application/vnd.intu.qbo":{source:"iana",extensions:["qbo"]},"application/vnd.intu.qfx":{source:"iana",extensions:["qfx"]},"application/vnd.iptc.g2.catalogitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.conceptitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.knowledgeitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsmessage+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.packageitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.planningitem+xml":{source:"iana",compressible:!0},"application/vnd.ipunplugged.rcprofile":{source:"iana",extensions:["rcprofile"]},"application/vnd.irepository.package+xml":{source:"iana",compressible:!0,extensions:["irp"]},"application/vnd.is-xpr":{source:"iana",extensions:["xpr"]},"application/vnd.isac.fcs":{source:"iana",extensions:["fcs"]},"application/vnd.iso11783-10+zip":{source:"iana",compressible:!1},"application/vnd.jam":{source:"iana",extensions:["jam"]},"application/vnd.japannet-directory-service":{source:"iana"},"application/vnd.japannet-jpnstore-wakeup":{source:"iana"},"application/vnd.japannet-payment-wakeup":{source:"iana"},"application/vnd.japannet-registration":{source:"iana"},"application/vnd.japannet-registration-wakeup":{source:"iana"},"application/vnd.japannet-setstore-wakeup":{source:"iana"},"application/vnd.japannet-verification":{source:"iana"},"application/vnd.japannet-verification-wakeup":{source:"iana"},"application/vnd.jcp.javame.midlet-rms":{source:"iana",extensions:["rms"]},"application/vnd.jisp":{source:"iana",extensions:["jisp"]},"application/vnd.joost.joda-archive":{source:"iana",extensions:["joda"]},"application/vnd.jsk.isdn-ngn":{source:"iana"},"application/vnd.kahootz":{source:"iana",extensions:["ktz","ktr"]},"application/vnd.kde.karbon":{source:"iana",extensions:["karbon"]},"application/vnd.kde.kchart":{source:"iana",extensions:["chrt"]},"application/vnd.kde.kformula":{source:"iana",extensions:["kfo"]},"application/vnd.kde.kivio":{source:"iana",extensions:["flw"]},"application/vnd.kde.kontour":{source:"iana",extensions:["kon"]},"application/vnd.kde.kpresenter":{source:"iana",extensions:["kpr","kpt"]},"application/vnd.kde.kspread":{source:"iana",extensions:["ksp"]},"application/vnd.kde.kword":{source:"iana",extensions:["kwd","kwt"]},"application/vnd.kenameaapp":{source:"iana",extensions:["htke"]},"application/vnd.kidspiration":{source:"iana",extensions:["kia"]},"application/vnd.kinar":{source:"iana",extensions:["kne","knp"]},"application/vnd.koan":{source:"iana",extensions:["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{source:"iana",extensions:["sse"]},"application/vnd.las":{source:"iana"},"application/vnd.las.las+json":{source:"iana",compressible:!0},"application/vnd.las.las+xml":{source:"iana",compressible:!0,extensions:["lasxml"]},"application/vnd.laszip":{source:"iana"},"application/vnd.leap+json":{source:"iana",compressible:!0},"application/vnd.liberty-request+xml":{source:"iana",compressible:!0},"application/vnd.llamagraphics.life-balance.desktop":{source:"iana",extensions:["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{source:"iana",compressible:!0,extensions:["lbe"]},"application/vnd.logipipe.circuit+zip":{source:"iana",compressible:!1},"application/vnd.loom":{source:"iana"},"application/vnd.lotus-1-2-3":{source:"iana",extensions:["123"]},"application/vnd.lotus-approach":{source:"iana",extensions:["apr"]},"application/vnd.lotus-freelance":{source:"iana",extensions:["pre"]},"application/vnd.lotus-notes":{source:"iana",extensions:["nsf"]},"application/vnd.lotus-organizer":{source:"iana",extensions:["org"]},"application/vnd.lotus-screencam":{source:"iana",extensions:["scm"]},"application/vnd.lotus-wordpro":{source:"iana",extensions:["lwp"]},"application/vnd.macports.portpkg":{source:"iana",extensions:["portpkg"]},"application/vnd.mapbox-vector-tile":{source:"iana",extensions:["mvt"]},"application/vnd.marlin.drm.actiontoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.conftoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.license+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.mdcf":{source:"iana"},"application/vnd.mason+json":{source:"iana",compressible:!0},"application/vnd.maxar.archive.3tz+zip":{source:"iana",compressible:!1},"application/vnd.maxmind.maxmind-db":{source:"iana"},"application/vnd.mcd":{source:"iana",extensions:["mcd"]},"application/vnd.medcalcdata":{source:"iana",extensions:["mc1"]},"application/vnd.mediastation.cdkey":{source:"iana",extensions:["cdkey"]},"application/vnd.meridian-slingshot":{source:"iana"},"application/vnd.mfer":{source:"iana",extensions:["mwf"]},"application/vnd.mfmp":{source:"iana",extensions:["mfm"]},"application/vnd.micro+json":{source:"iana",compressible:!0},"application/vnd.micrografx.flo":{source:"iana",extensions:["flo"]},"application/vnd.micrografx.igx":{source:"iana",extensions:["igx"]},"application/vnd.microsoft.portable-executable":{source:"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{source:"iana"},"application/vnd.miele+json":{source:"iana",compressible:!0},"application/vnd.mif":{source:"iana",extensions:["mif"]},"application/vnd.minisoft-hp3000-save":{source:"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{source:"iana"},"application/vnd.mobius.daf":{source:"iana",extensions:["daf"]},"application/vnd.mobius.dis":{source:"iana",extensions:["dis"]},"application/vnd.mobius.mbk":{source:"iana",extensions:["mbk"]},"application/vnd.mobius.mqy":{source:"iana",extensions:["mqy"]},"application/vnd.mobius.msl":{source:"iana",extensions:["msl"]},"application/vnd.mobius.plc":{source:"iana",extensions:["plc"]},"application/vnd.mobius.txf":{source:"iana",extensions:["txf"]},"application/vnd.mophun.application":{source:"iana",extensions:["mpn"]},"application/vnd.mophun.certificate":{source:"iana",extensions:["mpc"]},"application/vnd.motorola.flexsuite":{source:"iana"},"application/vnd.motorola.flexsuite.adsi":{source:"iana"},"application/vnd.motorola.flexsuite.fis":{source:"iana"},"application/vnd.motorola.flexsuite.gotap":{source:"iana"},"application/vnd.motorola.flexsuite.kmr":{source:"iana"},"application/vnd.motorola.flexsuite.ttc":{source:"iana"},"application/vnd.motorola.flexsuite.wem":{source:"iana"},"application/vnd.motorola.iprm":{source:"iana"},"application/vnd.mozilla.xul+xml":{source:"iana",compressible:!0,extensions:["xul"]},"application/vnd.ms-3mfdocument":{source:"iana"},"application/vnd.ms-artgalry":{source:"iana",extensions:["cil"]},"application/vnd.ms-asf":{source:"iana"},"application/vnd.ms-cab-compressed":{source:"iana",extensions:["cab"]},"application/vnd.ms-color.iccprofile":{source:"apache"},"application/vnd.ms-excel":{source:"iana",compressible:!1,extensions:["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{source:"iana",extensions:["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{source:"iana",extensions:["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{source:"iana",extensions:["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{source:"iana",extensions:["xltm"]},"application/vnd.ms-fontobject":{source:"iana",compressible:!0,extensions:["eot"]},"application/vnd.ms-htmlhelp":{source:"iana",extensions:["chm"]},"application/vnd.ms-ims":{source:"iana",extensions:["ims"]},"application/vnd.ms-lrm":{source:"iana",extensions:["lrm"]},"application/vnd.ms-office.activex+xml":{source:"iana",compressible:!0},"application/vnd.ms-officetheme":{source:"iana",extensions:["thmx"]},"application/vnd.ms-opentype":{source:"apache",compressible:!0},"application/vnd.ms-outlook":{compressible:!1,extensions:["msg"]},"application/vnd.ms-package.obfuscated-opentype":{source:"apache"},"application/vnd.ms-pki.seccat":{source:"apache",extensions:["cat"]},"application/vnd.ms-pki.stl":{source:"apache",extensions:["stl"]},"application/vnd.ms-playready.initiator+xml":{source:"iana",compressible:!0},"application/vnd.ms-powerpoint":{source:"iana",compressible:!1,extensions:["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{source:"iana",extensions:["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{source:"iana",extensions:["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{source:"iana",extensions:["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{source:"iana",extensions:["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{source:"iana",extensions:["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{source:"iana",compressible:!0},"application/vnd.ms-printing.printticket+xml":{source:"apache",compressible:!0},"application/vnd.ms-printschematicket+xml":{source:"iana",compressible:!0},"application/vnd.ms-project":{source:"iana",extensions:["mpp","mpt"]},"application/vnd.ms-tnef":{source:"iana"},"application/vnd.ms-windows.devicepairing":{source:"iana"},"application/vnd.ms-windows.nwprinting.oob":{source:"iana"},"application/vnd.ms-windows.printerpairing":{source:"iana"},"application/vnd.ms-windows.wsd.oob":{source:"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.lic-resp":{source:"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.meter-resp":{source:"iana"},"application/vnd.ms-word.document.macroenabled.12":{source:"iana",extensions:["docm"]},"application/vnd.ms-word.template.macroenabled.12":{source:"iana",extensions:["dotm"]},"application/vnd.ms-works":{source:"iana",extensions:["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{source:"iana",extensions:["wpl"]},"application/vnd.ms-xpsdocument":{source:"iana",compressible:!1,extensions:["xps"]},"application/vnd.msa-disk-image":{source:"iana"},"application/vnd.mseq":{source:"iana",extensions:["mseq"]},"application/vnd.msign":{source:"iana"},"application/vnd.multiad.creator":{source:"iana"},"application/vnd.multiad.creator.cif":{source:"iana"},"application/vnd.music-niff":{source:"iana"},"application/vnd.musician":{source:"iana",extensions:["mus"]},"application/vnd.muvee.style":{source:"iana",extensions:["msty"]},"application/vnd.mynfc":{source:"iana",extensions:["taglet"]},"application/vnd.nacamar.ybrid+json":{source:"iana",compressible:!0},"application/vnd.ncd.control":{source:"iana"},"application/vnd.ncd.reference":{source:"iana"},"application/vnd.nearst.inv+json":{source:"iana",compressible:!0},"application/vnd.nebumind.line":{source:"iana"},"application/vnd.nervana":{source:"iana"},"application/vnd.netfpx":{source:"iana"},"application/vnd.neurolanguage.nlu":{source:"iana",extensions:["nlu"]},"application/vnd.nimn":{source:"iana"},"application/vnd.nintendo.nitro.rom":{source:"iana"},"application/vnd.nintendo.snes.rom":{source:"iana"},"application/vnd.nitf":{source:"iana",extensions:["ntf","nitf"]},"application/vnd.noblenet-directory":{source:"iana",extensions:["nnd"]},"application/vnd.noblenet-sealer":{source:"iana",extensions:["nns"]},"application/vnd.noblenet-web":{source:"iana",extensions:["nnw"]},"application/vnd.nokia.catalogs":{source:"iana"},"application/vnd.nokia.conml+wbxml":{source:"iana"},"application/vnd.nokia.conml+xml":{source:"iana",compressible:!0},"application/vnd.nokia.iptv.config+xml":{source:"iana",compressible:!0},"application/vnd.nokia.isds-radio-presets":{source:"iana"},"application/vnd.nokia.landmark+wbxml":{source:"iana"},"application/vnd.nokia.landmark+xml":{source:"iana",compressible:!0},"application/vnd.nokia.landmarkcollection+xml":{source:"iana",compressible:!0},"application/vnd.nokia.n-gage.ac+xml":{source:"iana",compressible:!0,extensions:["ac"]},"application/vnd.nokia.n-gage.data":{source:"iana",extensions:["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{source:"iana",extensions:["n-gage"]},"application/vnd.nokia.ncd":{source:"iana"},"application/vnd.nokia.pcd+wbxml":{source:"iana"},"application/vnd.nokia.pcd+xml":{source:"iana",compressible:!0},"application/vnd.nokia.radio-preset":{source:"iana",extensions:["rpst"]},"application/vnd.nokia.radio-presets":{source:"iana",extensions:["rpss"]},"application/vnd.novadigm.edm":{source:"iana",extensions:["edm"]},"application/vnd.novadigm.edx":{source:"iana",extensions:["edx"]},"application/vnd.novadigm.ext":{source:"iana",extensions:["ext"]},"application/vnd.ntt-local.content-share":{source:"iana"},"application/vnd.ntt-local.file-transfer":{source:"iana"},"application/vnd.ntt-local.ogw_remote-access":{source:"iana"},"application/vnd.ntt-local.sip-ta_remote":{source:"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{source:"iana"},"application/vnd.oasis.opendocument.chart":{source:"iana",extensions:["odc"]},"application/vnd.oasis.opendocument.chart-template":{source:"iana",extensions:["otc"]},"application/vnd.oasis.opendocument.database":{source:"iana",extensions:["odb"]},"application/vnd.oasis.opendocument.formula":{source:"iana",extensions:["odf"]},"application/vnd.oasis.opendocument.formula-template":{source:"iana",extensions:["odft"]},"application/vnd.oasis.opendocument.graphics":{source:"iana",compressible:!1,extensions:["odg"]},"application/vnd.oasis.opendocument.graphics-template":{source:"iana",extensions:["otg"]},"application/vnd.oasis.opendocument.image":{source:"iana",extensions:["odi"]},"application/vnd.oasis.opendocument.image-template":{source:"iana",extensions:["oti"]},"application/vnd.oasis.opendocument.presentation":{source:"iana",compressible:!1,extensions:["odp"]},"application/vnd.oasis.opendocument.presentation-template":{source:"iana",extensions:["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{source:"iana",compressible:!1,extensions:["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{source:"iana",extensions:["ots"]},"application/vnd.oasis.opendocument.text":{source:"iana",compressible:!1,extensions:["odt"]},"application/vnd.oasis.opendocument.text-master":{source:"iana",extensions:["odm"]},"application/vnd.oasis.opendocument.text-template":{source:"iana",extensions:["ott"]},"application/vnd.oasis.opendocument.text-web":{source:"iana",extensions:["oth"]},"application/vnd.obn":{source:"iana"},"application/vnd.ocf+cbor":{source:"iana"},"application/vnd.oci.image.manifest.v1+json":{source:"iana",compressible:!0},"application/vnd.oftn.l10n+json":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessdownload+xml":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessstreaming+xml":{source:"iana",compressible:!0},"application/vnd.oipf.cspg-hexbinary":{source:"iana"},"application/vnd.oipf.dae.svg+xml":{source:"iana",compressible:!0},"application/vnd.oipf.dae.xhtml+xml":{source:"iana",compressible:!0},"application/vnd.oipf.mippvcontrolmessage+xml":{source:"iana",compressible:!0},"application/vnd.oipf.pae.gem":{source:"iana"},"application/vnd.oipf.spdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.oipf.spdlist+xml":{source:"iana",compressible:!0},"application/vnd.oipf.ueprofile+xml":{source:"iana",compressible:!0},"application/vnd.oipf.userprofile+xml":{source:"iana",compressible:!0},"application/vnd.olpc-sugar":{source:"iana",extensions:["xo"]},"application/vnd.oma-scws-config":{source:"iana"},"application/vnd.oma-scws-http-request":{source:"iana"},"application/vnd.oma-scws-http-response":{source:"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.drm-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.imd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.ltkm":{source:"iana"},"application/vnd.oma.bcast.notification+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.provisioningtrigger":{source:"iana"},"application/vnd.oma.bcast.sgboot":{source:"iana"},"application/vnd.oma.bcast.sgdd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sgdu":{source:"iana"},"application/vnd.oma.bcast.simple-symbol-container":{source:"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sprov+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.stkm":{source:"iana"},"application/vnd.oma.cab-address-book+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-feature-handler+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-pcc+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-subs-invite+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-user-prefs+xml":{source:"iana",compressible:!0},"application/vnd.oma.dcd":{source:"iana"},"application/vnd.oma.dcdc":{source:"iana"},"application/vnd.oma.dd2+xml":{source:"iana",compressible:!0,extensions:["dd2"]},"application/vnd.oma.drm.risd+xml":{source:"iana",compressible:!0},"application/vnd.oma.group-usage-list+xml":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+cbor":{source:"iana"},"application/vnd.oma.lwm2m+json":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+tlv":{source:"iana"},"application/vnd.oma.pal+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.detailed-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.final-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.groups+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.invocation-descriptor+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.optimized-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.push":{source:"iana"},"application/vnd.oma.scidm.messages+xml":{source:"iana",compressible:!0},"application/vnd.oma.xcap-directory+xml":{source:"iana",compressible:!0},"application/vnd.omads-email+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-file+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-folder+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omaloc-supl-init":{source:"iana"},"application/vnd.onepager":{source:"iana"},"application/vnd.onepagertamp":{source:"iana"},"application/vnd.onepagertamx":{source:"iana"},"application/vnd.onepagertat":{source:"iana"},"application/vnd.onepagertatp":{source:"iana"},"application/vnd.onepagertatx":{source:"iana"},"application/vnd.openblox.game+xml":{source:"iana",compressible:!0,extensions:["obgx"]},"application/vnd.openblox.game-binary":{source:"iana"},"application/vnd.openeye.oeb":{source:"iana"},"application/vnd.openofficeorg.extension":{source:"apache",extensions:["oxt"]},"application/vnd.openstreetmap.data+xml":{source:"iana",compressible:!0,extensions:["osm"]},"application/vnd.opentimestamps.ots":{source:"iana"},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawing+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:"iana",compressible:!1,extensions:["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slide":{source:"iana",extensions:["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{source:"iana",extensions:["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.template":{source:"iana",extensions:["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:"iana",compressible:!1,extensions:["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{source:"iana",extensions:["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.theme+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.vmldrawing":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:"iana",compressible:!1,extensions:["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{source:"iana",extensions:["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.core-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.relationships+xml":{source:"iana",compressible:!0},"application/vnd.oracle.resource+json":{source:"iana",compressible:!0},"application/vnd.orange.indata":{source:"iana"},"application/vnd.osa.netdeploy":{source:"iana"},"application/vnd.osgeo.mapguide.package":{source:"iana",extensions:["mgp"]},"application/vnd.osgi.bundle":{source:"iana"},"application/vnd.osgi.dp":{source:"iana",extensions:["dp"]},"application/vnd.osgi.subsystem":{source:"iana",extensions:["esa"]},"application/vnd.otps.ct-kip+xml":{source:"iana",compressible:!0},"application/vnd.oxli.countgraph":{source:"iana"},"application/vnd.pagerduty+json":{source:"iana",compressible:!0},"application/vnd.palm":{source:"iana",extensions:["pdb","pqa","oprc"]},"application/vnd.panoply":{source:"iana"},"application/vnd.paos.xml":{source:"iana"},"application/vnd.patentdive":{source:"iana"},"application/vnd.patientecommsdoc":{source:"iana"},"application/vnd.pawaafile":{source:"iana",extensions:["paw"]},"application/vnd.pcos":{source:"iana"},"application/vnd.pg.format":{source:"iana",extensions:["str"]},"application/vnd.pg.osasli":{source:"iana",extensions:["ei6"]},"application/vnd.piaccess.application-licence":{source:"iana"},"application/vnd.picsel":{source:"iana",extensions:["efif"]},"application/vnd.pmi.widget":{source:"iana",extensions:["wg"]},"application/vnd.poc.group-advertisement+xml":{source:"iana",compressible:!0},"application/vnd.pocketlearn":{source:"iana",extensions:["plf"]},"application/vnd.powerbuilder6":{source:"iana",extensions:["pbd"]},"application/vnd.powerbuilder6-s":{source:"iana"},"application/vnd.powerbuilder7":{source:"iana"},"application/vnd.powerbuilder7-s":{source:"iana"},"application/vnd.powerbuilder75":{source:"iana"},"application/vnd.powerbuilder75-s":{source:"iana"},"application/vnd.preminet":{source:"iana"},"application/vnd.previewsystems.box":{source:"iana",extensions:["box"]},"application/vnd.proteus.magazine":{source:"iana",extensions:["mgz"]},"application/vnd.psfs":{source:"iana"},"application/vnd.publishare-delta-tree":{source:"iana",extensions:["qps"]},"application/vnd.pvi.ptid1":{source:"iana",extensions:["ptid"]},"application/vnd.pwg-multiplexed":{source:"iana"},"application/vnd.pwg-xhtml-print+xml":{source:"iana",compressible:!0},"application/vnd.qualcomm.brew-app-res":{source:"iana"},"application/vnd.quarantainenet":{source:"iana"},"application/vnd.quark.quarkxpress":{source:"iana",extensions:["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{source:"iana"},"application/vnd.radisys.moml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conn+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-stream+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-base+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-detect+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-group+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-speech+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-transform+xml":{source:"iana",compressible:!0},"application/vnd.rainstor.data":{source:"iana"},"application/vnd.rapid":{source:"iana"},"application/vnd.rar":{source:"iana",extensions:["rar"]},"application/vnd.realvnc.bed":{source:"iana",extensions:["bed"]},"application/vnd.recordare.musicxml":{source:"iana",extensions:["mxl"]},"application/vnd.recordare.musicxml+xml":{source:"iana",compressible:!0,extensions:["musicxml"]},"application/vnd.renlearn.rlprint":{source:"iana"},"application/vnd.resilient.logic":{source:"iana"},"application/vnd.restful+json":{source:"iana",compressible:!0},"application/vnd.rig.cryptonote":{source:"iana",extensions:["cryptonote"]},"application/vnd.rim.cod":{source:"apache",extensions:["cod"]},"application/vnd.rn-realmedia":{source:"apache",extensions:["rm"]},"application/vnd.rn-realmedia-vbr":{source:"apache",extensions:["rmvb"]},"application/vnd.route66.link66+xml":{source:"iana",compressible:!0,extensions:["link66"]},"application/vnd.rs-274x":{source:"iana"},"application/vnd.ruckus.download":{source:"iana"},"application/vnd.s3sms":{source:"iana"},"application/vnd.sailingtracker.track":{source:"iana",extensions:["st"]},"application/vnd.sar":{source:"iana"},"application/vnd.sbm.cid":{source:"iana"},"application/vnd.sbm.mid2":{source:"iana"},"application/vnd.scribus":{source:"iana"},"application/vnd.sealed.3df":{source:"iana"},"application/vnd.sealed.csf":{source:"iana"},"application/vnd.sealed.doc":{source:"iana"},"application/vnd.sealed.eml":{source:"iana"},"application/vnd.sealed.mht":{source:"iana"},"application/vnd.sealed.net":{source:"iana"},"application/vnd.sealed.ppt":{source:"iana"},"application/vnd.sealed.tiff":{source:"iana"},"application/vnd.sealed.xls":{source:"iana"},"application/vnd.sealedmedia.softseal.html":{source:"iana"},"application/vnd.sealedmedia.softseal.pdf":{source:"iana"},"application/vnd.seemail":{source:"iana",extensions:["see"]},"application/vnd.seis+json":{source:"iana",compressible:!0},"application/vnd.sema":{source:"iana",extensions:["sema"]},"application/vnd.semd":{source:"iana",extensions:["semd"]},"application/vnd.semf":{source:"iana",extensions:["semf"]},"application/vnd.shade-save-file":{source:"iana"},"application/vnd.shana.informed.formdata":{source:"iana",extensions:["ifm"]},"application/vnd.shana.informed.formtemplate":{source:"iana",extensions:["itp"]},"application/vnd.shana.informed.interchange":{source:"iana",extensions:["iif"]},"application/vnd.shana.informed.package":{source:"iana",extensions:["ipk"]},"application/vnd.shootproof+json":{source:"iana",compressible:!0},"application/vnd.shopkick+json":{source:"iana",compressible:!0},"application/vnd.shp":{source:"iana"},"application/vnd.shx":{source:"iana"},"application/vnd.sigrok.session":{source:"iana"},"application/vnd.simtech-mindmapper":{source:"iana",extensions:["twd","twds"]},"application/vnd.siren+json":{source:"iana",compressible:!0},"application/vnd.smaf":{source:"iana",extensions:["mmf"]},"application/vnd.smart.notebook":{source:"iana"},"application/vnd.smart.teacher":{source:"iana",extensions:["teacher"]},"application/vnd.snesdev-page-table":{source:"iana"},"application/vnd.software602.filler.form+xml":{source:"iana",compressible:!0,extensions:["fo"]},"application/vnd.software602.filler.form-xml-zip":{source:"iana"},"application/vnd.solent.sdkm+xml":{source:"iana",compressible:!0,extensions:["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{source:"iana",extensions:["dxp"]},"application/vnd.spotfire.sfs":{source:"iana",extensions:["sfs"]},"application/vnd.sqlite3":{source:"iana"},"application/vnd.sss-cod":{source:"iana"},"application/vnd.sss-dtf":{source:"iana"},"application/vnd.sss-ntf":{source:"iana"},"application/vnd.stardivision.calc":{source:"apache",extensions:["sdc"]},"application/vnd.stardivision.draw":{source:"apache",extensions:["sda"]},"application/vnd.stardivision.impress":{source:"apache",extensions:["sdd"]},"application/vnd.stardivision.math":{source:"apache",extensions:["smf"]},"application/vnd.stardivision.writer":{source:"apache",extensions:["sdw","vor"]},"application/vnd.stardivision.writer-global":{source:"apache",extensions:["sgl"]},"application/vnd.stepmania.package":{source:"iana",extensions:["smzip"]},"application/vnd.stepmania.stepchart":{source:"iana",extensions:["sm"]},"application/vnd.street-stream":{source:"iana"},"application/vnd.sun.wadl+xml":{source:"iana",compressible:!0,extensions:["wadl"]},"application/vnd.sun.xml.calc":{source:"apache",extensions:["sxc"]},"application/vnd.sun.xml.calc.template":{source:"apache",extensions:["stc"]},"application/vnd.sun.xml.draw":{source:"apache",extensions:["sxd"]},"application/vnd.sun.xml.draw.template":{source:"apache",extensions:["std"]},"application/vnd.sun.xml.impress":{source:"apache",extensions:["sxi"]},"application/vnd.sun.xml.impress.template":{source:"apache",extensions:["sti"]},"application/vnd.sun.xml.math":{source:"apache",extensions:["sxm"]},"application/vnd.sun.xml.writer":{source:"apache",extensions:["sxw"]},"application/vnd.sun.xml.writer.global":{source:"apache",extensions:["sxg"]},"application/vnd.sun.xml.writer.template":{source:"apache",extensions:["stw"]},"application/vnd.sus-calendar":{source:"iana",extensions:["sus","susp"]},"application/vnd.svd":{source:"iana",extensions:["svd"]},"application/vnd.swiftview-ics":{source:"iana"},"application/vnd.sycle+xml":{source:"iana",compressible:!0},"application/vnd.syft+json":{source:"iana",compressible:!0},"application/vnd.symbian.install":{source:"apache",extensions:["sis","sisx"]},"application/vnd.syncml+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xsm"]},"application/vnd.syncml.dm+wbxml":{source:"iana",charset:"UTF-8",extensions:["bdm"]},"application/vnd.syncml.dm+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xdm"]},"application/vnd.syncml.dm.notification":{source:"iana"},"application/vnd.syncml.dmddf+wbxml":{source:"iana"},"application/vnd.syncml.dmddf+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["ddf"]},"application/vnd.syncml.dmtnds+wbxml":{source:"iana"},"application/vnd.syncml.dmtnds+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.syncml.ds.notification":{source:"iana"},"application/vnd.tableschema+json":{source:"iana",compressible:!0},"application/vnd.tao.intent-module-archive":{source:"iana",extensions:["tao"]},"application/vnd.tcpdump.pcap":{source:"iana",extensions:["pcap","cap","dmp"]},"application/vnd.think-cell.ppttc+json":{source:"iana",compressible:!0},"application/vnd.tmd.mediaflex.api+xml":{source:"iana",compressible:!0},"application/vnd.tml":{source:"iana"},"application/vnd.tmobile-livetv":{source:"iana",extensions:["tmo"]},"application/vnd.tri.onesource":{source:"iana"},"application/vnd.trid.tpt":{source:"iana",extensions:["tpt"]},"application/vnd.triscape.mxs":{source:"iana",extensions:["mxs"]},"application/vnd.trueapp":{source:"iana",extensions:["tra"]},"application/vnd.truedoc":{source:"iana"},"application/vnd.ubisoft.webplayer":{source:"iana"},"application/vnd.ufdl":{source:"iana",extensions:["ufd","ufdl"]},"application/vnd.uiq.theme":{source:"iana",extensions:["utz"]},"application/vnd.umajin":{source:"iana",extensions:["umj"]},"application/vnd.unity":{source:"iana",extensions:["unityweb"]},"application/vnd.uoml+xml":{source:"iana",compressible:!0,extensions:["uoml"]},"application/vnd.uplanet.alert":{source:"iana"},"application/vnd.uplanet.alert-wbxml":{source:"iana"},"application/vnd.uplanet.bearer-choice":{source:"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{source:"iana"},"application/vnd.uplanet.cacheop":{source:"iana"},"application/vnd.uplanet.cacheop-wbxml":{source:"iana"},"application/vnd.uplanet.channel":{source:"iana"},"application/vnd.uplanet.channel-wbxml":{source:"iana"},"application/vnd.uplanet.list":{source:"iana"},"application/vnd.uplanet.list-wbxml":{source:"iana"},"application/vnd.uplanet.listcmd":{source:"iana"},"application/vnd.uplanet.listcmd-wbxml":{source:"iana"},"application/vnd.uplanet.signal":{source:"iana"},"application/vnd.uri-map":{source:"iana"},"application/vnd.valve.source.material":{source:"iana"},"application/vnd.vcx":{source:"iana",extensions:["vcx"]},"application/vnd.vd-study":{source:"iana"},"application/vnd.vectorworks":{source:"iana"},"application/vnd.vel+json":{source:"iana",compressible:!0},"application/vnd.verimatrix.vcas":{source:"iana"},"application/vnd.veritone.aion+json":{source:"iana",compressible:!0},"application/vnd.veryant.thin":{source:"iana"},"application/vnd.ves.encrypted":{source:"iana"},"application/vnd.vidsoft.vidconference":{source:"iana"},"application/vnd.visio":{source:"iana",extensions:["vsd","vst","vss","vsw"]},"application/vnd.visionary":{source:"iana",extensions:["vis"]},"application/vnd.vividence.scriptfile":{source:"iana"},"application/vnd.vsf":{source:"iana",extensions:["vsf"]},"application/vnd.wap.sic":{source:"iana"},"application/vnd.wap.slc":{source:"iana"},"application/vnd.wap.wbxml":{source:"iana",charset:"UTF-8",extensions:["wbxml"]},"application/vnd.wap.wmlc":{source:"iana",extensions:["wmlc"]},"application/vnd.wap.wmlscriptc":{source:"iana",extensions:["wmlsc"]},"application/vnd.webturbo":{source:"iana",extensions:["wtb"]},"application/vnd.wfa.dpp":{source:"iana"},"application/vnd.wfa.p2p":{source:"iana"},"application/vnd.wfa.wsc":{source:"iana"},"application/vnd.windows.devicepairing":{source:"iana"},"application/vnd.wmc":{source:"iana"},"application/vnd.wmf.bootstrap":{source:"iana"},"application/vnd.wolfram.mathematica":{source:"iana"},"application/vnd.wolfram.mathematica.package":{source:"iana"},"application/vnd.wolfram.player":{source:"iana",extensions:["nbp"]},"application/vnd.wordperfect":{source:"iana",extensions:["wpd"]},"application/vnd.wqd":{source:"iana",extensions:["wqd"]},"application/vnd.wrq-hp3000-labelled":{source:"iana"},"application/vnd.wt.stf":{source:"iana",extensions:["stf"]},"application/vnd.wv.csp+wbxml":{source:"iana"},"application/vnd.wv.csp+xml":{source:"iana",compressible:!0},"application/vnd.wv.ssp+xml":{source:"iana",compressible:!0},"application/vnd.xacml+json":{source:"iana",compressible:!0},"application/vnd.xara":{source:"iana",extensions:["xar"]},"application/vnd.xfdl":{source:"iana",extensions:["xfdl"]},"application/vnd.xfdl.webform":{source:"iana"},"application/vnd.xmi+xml":{source:"iana",compressible:!0},"application/vnd.xmpie.cpkg":{source:"iana"},"application/vnd.xmpie.dpkg":{source:"iana"},"application/vnd.xmpie.plan":{source:"iana"},"application/vnd.xmpie.ppkg":{source:"iana"},"application/vnd.xmpie.xlim":{source:"iana"},"application/vnd.yamaha.hv-dic":{source:"iana",extensions:["hvd"]},"application/vnd.yamaha.hv-script":{source:"iana",extensions:["hvs"]},"application/vnd.yamaha.hv-voice":{source:"iana",extensions:["hvp"]},"application/vnd.yamaha.openscoreformat":{source:"iana",extensions:["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{source:"iana",compressible:!0,extensions:["osfpvg"]},"application/vnd.yamaha.remote-setup":{source:"iana"},"application/vnd.yamaha.smaf-audio":{source:"iana",extensions:["saf"]},"application/vnd.yamaha.smaf-phrase":{source:"iana",extensions:["spf"]},"application/vnd.yamaha.through-ngn":{source:"iana"},"application/vnd.yamaha.tunnel-udpencap":{source:"iana"},"application/vnd.yaoweme":{source:"iana"},"application/vnd.yellowriver-custom-menu":{source:"iana",extensions:["cmp"]},"application/vnd.youtube.yt":{source:"iana"},"application/vnd.zul":{source:"iana",extensions:["zir","zirz"]},"application/vnd.zzazz.deck+xml":{source:"iana",compressible:!0,extensions:["zaz"]},"application/voicexml+xml":{source:"iana",compressible:!0,extensions:["vxml"]},"application/voucher-cms+json":{source:"iana",compressible:!0},"application/vq-rtcpxr":{source:"iana"},"application/wasm":{source:"iana",compressible:!0,extensions:["wasm"]},"application/watcherinfo+xml":{source:"iana",compressible:!0,extensions:["wif"]},"application/webpush-options+json":{source:"iana",compressible:!0},"application/whoispp-query":{source:"iana"},"application/whoispp-response":{source:"iana"},"application/widget":{source:"iana",extensions:["wgt"]},"application/winhlp":{source:"apache",extensions:["hlp"]},"application/wita":{source:"iana"},"application/wordperfect5.1":{source:"iana"},"application/wsdl+xml":{source:"iana",compressible:!0,extensions:["wsdl"]},"application/wspolicy+xml":{source:"iana",compressible:!0,extensions:["wspolicy"]},"application/x-7z-compressed":{source:"apache",compressible:!1,extensions:["7z"]},"application/x-abiword":{source:"apache",extensions:["abw"]},"application/x-ace-compressed":{source:"apache",extensions:["ace"]},"application/x-amf":{source:"apache"},"application/x-apple-diskimage":{source:"apache",extensions:["dmg"]},"application/x-arj":{compressible:!1,extensions:["arj"]},"application/x-authorware-bin":{source:"apache",extensions:["aab","x32","u32","vox"]},"application/x-authorware-map":{source:"apache",extensions:["aam"]},"application/x-authorware-seg":{source:"apache",extensions:["aas"]},"application/x-bcpio":{source:"apache",extensions:["bcpio"]},"application/x-bdoc":{compressible:!1,extensions:["bdoc"]},"application/x-bittorrent":{source:"apache",extensions:["torrent"]},"application/x-blorb":{source:"apache",extensions:["blb","blorb"]},"application/x-bzip":{source:"apache",compressible:!1,extensions:["bz"]},"application/x-bzip2":{source:"apache",compressible:!1,extensions:["bz2","boz"]},"application/x-cbr":{source:"apache",extensions:["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{source:"apache",extensions:["vcd"]},"application/x-cfs-compressed":{source:"apache",extensions:["cfs"]},"application/x-chat":{source:"apache",extensions:["chat"]},"application/x-chess-pgn":{source:"apache",extensions:["pgn"]},"application/x-chrome-extension":{extensions:["crx"]},"application/x-cocoa":{source:"nginx",extensions:["cco"]},"application/x-compress":{source:"apache"},"application/x-conference":{source:"apache",extensions:["nsc"]},"application/x-cpio":{source:"apache",extensions:["cpio"]},"application/x-csh":{source:"apache",extensions:["csh"]},"application/x-deb":{compressible:!1},"application/x-debian-package":{source:"apache",extensions:["deb","udeb"]},"application/x-dgc-compressed":{source:"apache",extensions:["dgc"]},"application/x-director":{source:"apache",extensions:["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{source:"apache",extensions:["wad"]},"application/x-dtbncx+xml":{source:"apache",compressible:!0,extensions:["ncx"]},"application/x-dtbook+xml":{source:"apache",compressible:!0,extensions:["dtb"]},"application/x-dtbresource+xml":{source:"apache",compressible:!0,extensions:["res"]},"application/x-dvi":{source:"apache",compressible:!1,extensions:["dvi"]},"application/x-envoy":{source:"apache",extensions:["evy"]},"application/x-eva":{source:"apache",extensions:["eva"]},"application/x-font-bdf":{source:"apache",extensions:["bdf"]},"application/x-font-dos":{source:"apache"},"application/x-font-framemaker":{source:"apache"},"application/x-font-ghostscript":{source:"apache",extensions:["gsf"]},"application/x-font-libgrx":{source:"apache"},"application/x-font-linux-psf":{source:"apache",extensions:["psf"]},"application/x-font-pcf":{source:"apache",extensions:["pcf"]},"application/x-font-snf":{source:"apache",extensions:["snf"]},"application/x-font-speedo":{source:"apache"},"application/x-font-sunos-news":{source:"apache"},"application/x-font-type1":{source:"apache",extensions:["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{source:"apache"},"application/x-freearc":{source:"apache",extensions:["arc"]},"application/x-futuresplash":{source:"apache",extensions:["spl"]},"application/x-gca-compressed":{source:"apache",extensions:["gca"]},"application/x-glulx":{source:"apache",extensions:["ulx"]},"application/x-gnumeric":{source:"apache",extensions:["gnumeric"]},"application/x-gramps-xml":{source:"apache",extensions:["gramps"]},"application/x-gtar":{source:"apache",extensions:["gtar"]},"application/x-gzip":{source:"apache"},"application/x-hdf":{source:"apache",extensions:["hdf"]},"application/x-httpd-php":{compressible:!0,extensions:["php"]},"application/x-install-instructions":{source:"apache",extensions:["install"]},"application/x-iso9660-image":{source:"apache",extensions:["iso"]},"application/x-iwork-keynote-sffkey":{extensions:["key"]},"application/x-iwork-numbers-sffnumbers":{extensions:["numbers"]},"application/x-iwork-pages-sffpages":{extensions:["pages"]},"application/x-java-archive-diff":{source:"nginx",extensions:["jardiff"]},"application/x-java-jnlp-file":{source:"apache",compressible:!1,extensions:["jnlp"]},"application/x-javascript":{compressible:!0},"application/x-keepass2":{extensions:["kdbx"]},"application/x-latex":{source:"apache",compressible:!1,extensions:["latex"]},"application/x-lua-bytecode":{extensions:["luac"]},"application/x-lzh-compressed":{source:"apache",extensions:["lzh","lha"]},"application/x-makeself":{source:"nginx",extensions:["run"]},"application/x-mie":{source:"apache",extensions:["mie"]},"application/x-mobipocket-ebook":{source:"apache",extensions:["prc","mobi"]},"application/x-mpegurl":{compressible:!1},"application/x-ms-application":{source:"apache",extensions:["application"]},"application/x-ms-shortcut":{source:"apache",extensions:["lnk"]},"application/x-ms-wmd":{source:"apache",extensions:["wmd"]},"application/x-ms-wmz":{source:"apache",extensions:["wmz"]},"application/x-ms-xbap":{source:"apache",extensions:["xbap"]},"application/x-msaccess":{source:"apache",extensions:["mdb"]},"application/x-msbinder":{source:"apache",extensions:["obd"]},"application/x-mscardfile":{source:"apache",extensions:["crd"]},"application/x-msclip":{source:"apache",extensions:["clp"]},"application/x-msdos-program":{extensions:["exe"]},"application/x-msdownload":{source:"apache",extensions:["exe","dll","com","bat","msi"]},"application/x-msmediaview":{source:"apache",extensions:["mvb","m13","m14"]},"application/x-msmetafile":{source:"apache",extensions:["wmf","wmz","emf","emz"]},"application/x-msmoney":{source:"apache",extensions:["mny"]},"application/x-mspublisher":{source:"apache",extensions:["pub"]},"application/x-msschedule":{source:"apache",extensions:["scd"]},"application/x-msterminal":{source:"apache",extensions:["trm"]},"application/x-mswrite":{source:"apache",extensions:["wri"]},"application/x-netcdf":{source:"apache",extensions:["nc","cdf"]},"application/x-ns-proxy-autoconfig":{compressible:!0,extensions:["pac"]},"application/x-nzb":{source:"apache",extensions:["nzb"]},"application/x-perl":{source:"nginx",extensions:["pl","pm"]},"application/x-pilot":{source:"nginx",extensions:["prc","pdb"]},"application/x-pkcs12":{source:"apache",compressible:!1,extensions:["p12","pfx"]},"application/x-pkcs7-certificates":{source:"apache",extensions:["p7b","spc"]},"application/x-pkcs7-certreqresp":{source:"apache",extensions:["p7r"]},"application/x-pki-message":{source:"iana"},"application/x-rar-compressed":{source:"apache",compressible:!1,extensions:["rar"]},"application/x-redhat-package-manager":{source:"nginx",extensions:["rpm"]},"application/x-research-info-systems":{source:"apache",extensions:["ris"]},"application/x-sea":{source:"nginx",extensions:["sea"]},"application/x-sh":{source:"apache",compressible:!0,extensions:["sh"]},"application/x-shar":{source:"apache",extensions:["shar"]},"application/x-shockwave-flash":{source:"apache",compressible:!1,extensions:["swf"]},"application/x-silverlight-app":{source:"apache",extensions:["xap"]},"application/x-sql":{source:"apache",extensions:["sql"]},"application/x-stuffit":{source:"apache",compressible:!1,extensions:["sit"]},"application/x-stuffitx":{source:"apache",extensions:["sitx"]},"application/x-subrip":{source:"apache",extensions:["srt"]},"application/x-sv4cpio":{source:"apache",extensions:["sv4cpio"]},"application/x-sv4crc":{source:"apache",extensions:["sv4crc"]},"application/x-t3vm-image":{source:"apache",extensions:["t3"]},"application/x-tads":{source:"apache",extensions:["gam"]},"application/x-tar":{source:"apache",compressible:!0,extensions:["tar"]},"application/x-tcl":{source:"apache",extensions:["tcl","tk"]},"application/x-tex":{source:"apache",extensions:["tex"]},"application/x-tex-tfm":{source:"apache",extensions:["tfm"]},"application/x-texinfo":{source:"apache",extensions:["texinfo","texi"]},"application/x-tgif":{source:"apache",extensions:["obj"]},"application/x-ustar":{source:"apache",extensions:["ustar"]},"application/x-virtualbox-hdd":{compressible:!0,extensions:["hdd"]},"application/x-virtualbox-ova":{compressible:!0,extensions:["ova"]},"application/x-virtualbox-ovf":{compressible:!0,extensions:["ovf"]},"application/x-virtualbox-vbox":{compressible:!0,extensions:["vbox"]},"application/x-virtualbox-vbox-extpack":{compressible:!1,extensions:["vbox-extpack"]},"application/x-virtualbox-vdi":{compressible:!0,extensions:["vdi"]},"application/x-virtualbox-vhd":{compressible:!0,extensions:["vhd"]},"application/x-virtualbox-vmdk":{compressible:!0,extensions:["vmdk"]},"application/x-wais-source":{source:"apache",extensions:["src"]},"application/x-web-app-manifest+json":{compressible:!0,extensions:["webapp"]},"application/x-www-form-urlencoded":{source:"iana",compressible:!0},"application/x-x509-ca-cert":{source:"iana",extensions:["der","crt","pem"]},"application/x-x509-ca-ra-cert":{source:"iana"},"application/x-x509-next-ca-cert":{source:"iana"},"application/x-xfig":{source:"apache",extensions:["fig"]},"application/x-xliff+xml":{source:"apache",compressible:!0,extensions:["xlf"]},"application/x-xpinstall":{source:"apache",compressible:!1,extensions:["xpi"]},"application/x-xz":{source:"apache",extensions:["xz"]},"application/x-zmachine":{source:"apache",extensions:["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{source:"iana"},"application/xacml+xml":{source:"iana",compressible:!0},"application/xaml+xml":{source:"apache",compressible:!0,extensions:["xaml"]},"application/xcap-att+xml":{source:"iana",compressible:!0,extensions:["xav"]},"application/xcap-caps+xml":{source:"iana",compressible:!0,extensions:["xca"]},"application/xcap-diff+xml":{source:"iana",compressible:!0,extensions:["xdf"]},"application/xcap-el+xml":{source:"iana",compressible:!0,extensions:["xel"]},"application/xcap-error+xml":{source:"iana",compressible:!0},"application/xcap-ns+xml":{source:"iana",compressible:!0,extensions:["xns"]},"application/xcon-conference-info+xml":{source:"iana",compressible:!0},"application/xcon-conference-info-diff+xml":{source:"iana",compressible:!0},"application/xenc+xml":{source:"iana",compressible:!0,extensions:["xenc"]},"application/xhtml+xml":{source:"iana",compressible:!0,extensions:["xhtml","xht"]},"application/xhtml-voice+xml":{source:"apache",compressible:!0},"application/xliff+xml":{source:"iana",compressible:!0,extensions:["xlf"]},"application/xml":{source:"iana",compressible:!0,extensions:["xml","xsl","xsd","rng"]},"application/xml-dtd":{source:"iana",compressible:!0,extensions:["dtd"]},"application/xml-external-parsed-entity":{source:"iana"},"application/xml-patch+xml":{source:"iana",compressible:!0},"application/xmpp+xml":{source:"iana",compressible:!0},"application/xop+xml":{source:"iana",compressible:!0,extensions:["xop"]},"application/xproc+xml":{source:"apache",compressible:!0,extensions:["xpl"]},"application/xslt+xml":{source:"iana",compressible:!0,extensions:["xsl","xslt"]},"application/xspf+xml":{source:"apache",compressible:!0,extensions:["xspf"]},"application/xv+xml":{source:"iana",compressible:!0,extensions:["mxml","xhvml","xvml","xvm"]},"application/yang":{source:"iana",extensions:["yang"]},"application/yang-data+json":{source:"iana",compressible:!0},"application/yang-data+xml":{source:"iana",compressible:!0},"application/yang-patch+json":{source:"iana",compressible:!0},"application/yang-patch+xml":{source:"iana",compressible:!0},"application/yin+xml":{source:"iana",compressible:!0,extensions:["yin"]},"application/zip":{source:"iana",compressible:!1,extensions:["zip"]},"application/zlib":{source:"iana"},"application/zstd":{source:"iana"},"audio/1d-interleaved-parityfec":{source:"iana"},"audio/32kadpcm":{source:"iana"},"audio/3gpp":{source:"iana",compressible:!1,extensions:["3gpp"]},"audio/3gpp2":{source:"iana"},"audio/aac":{source:"iana"},"audio/ac3":{source:"iana"},"audio/adpcm":{source:"apache",extensions:["adp"]},"audio/amr":{source:"iana",extensions:["amr"]},"audio/amr-wb":{source:"iana"},"audio/amr-wb+":{source:"iana"},"audio/aptx":{source:"iana"},"audio/asc":{source:"iana"},"audio/atrac-advanced-lossless":{source:"iana"},"audio/atrac-x":{source:"iana"},"audio/atrac3":{source:"iana"},"audio/basic":{source:"iana",compressible:!1,extensions:["au","snd"]},"audio/bv16":{source:"iana"},"audio/bv32":{source:"iana"},"audio/clearmode":{source:"iana"},"audio/cn":{source:"iana"},"audio/dat12":{source:"iana"},"audio/dls":{source:"iana"},"audio/dsr-es201108":{source:"iana"},"audio/dsr-es202050":{source:"iana"},"audio/dsr-es202211":{source:"iana"},"audio/dsr-es202212":{source:"iana"},"audio/dv":{source:"iana"},"audio/dvi4":{source:"iana"},"audio/eac3":{source:"iana"},"audio/encaprtp":{source:"iana"},"audio/evrc":{source:"iana"},"audio/evrc-qcp":{source:"iana"},"audio/evrc0":{source:"iana"},"audio/evrc1":{source:"iana"},"audio/evrcb":{source:"iana"},"audio/evrcb0":{source:"iana"},"audio/evrcb1":{source:"iana"},"audio/evrcnw":{source:"iana"},"audio/evrcnw0":{source:"iana"},"audio/evrcnw1":{source:"iana"},"audio/evrcwb":{source:"iana"},"audio/evrcwb0":{source:"iana"},"audio/evrcwb1":{source:"iana"},"audio/evs":{source:"iana"},"audio/flexfec":{source:"iana"},"audio/fwdred":{source:"iana"},"audio/g711-0":{source:"iana"},"audio/g719":{source:"iana"},"audio/g722":{source:"iana"},"audio/g7221":{source:"iana"},"audio/g723":{source:"iana"},"audio/g726-16":{source:"iana"},"audio/g726-24":{source:"iana"},"audio/g726-32":{source:"iana"},"audio/g726-40":{source:"iana"},"audio/g728":{source:"iana"},"audio/g729":{source:"iana"},"audio/g7291":{source:"iana"},"audio/g729d":{source:"iana"},"audio/g729e":{source:"iana"},"audio/gsm":{source:"iana"},"audio/gsm-efr":{source:"iana"},"audio/gsm-hr-08":{source:"iana"},"audio/ilbc":{source:"iana"},"audio/ip-mr_v2.5":{source:"iana"},"audio/isac":{source:"apache"},"audio/l16":{source:"iana"},"audio/l20":{source:"iana"},"audio/l24":{source:"iana",compressible:!1},"audio/l8":{source:"iana"},"audio/lpc":{source:"iana"},"audio/melp":{source:"iana"},"audio/melp1200":{source:"iana"},"audio/melp2400":{source:"iana"},"audio/melp600":{source:"iana"},"audio/mhas":{source:"iana"},"audio/midi":{source:"apache",extensions:["mid","midi","kar","rmi"]},"audio/mobile-xmf":{source:"iana",extensions:["mxmf"]},"audio/mp3":{compressible:!1,extensions:["mp3"]},"audio/mp4":{source:"iana",compressible:!1,extensions:["m4a","mp4a"]},"audio/mp4a-latm":{source:"iana"},"audio/mpa":{source:"iana"},"audio/mpa-robust":{source:"iana"},"audio/mpeg":{source:"iana",compressible:!1,extensions:["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{source:"iana"},"audio/musepack":{source:"apache"},"audio/ogg":{source:"iana",compressible:!1,extensions:["oga","ogg","spx","opus"]},"audio/opus":{source:"iana"},"audio/parityfec":{source:"iana"},"audio/pcma":{source:"iana"},"audio/pcma-wb":{source:"iana"},"audio/pcmu":{source:"iana"},"audio/pcmu-wb":{source:"iana"},"audio/prs.sid":{source:"iana"},"audio/qcelp":{source:"iana"},"audio/raptorfec":{source:"iana"},"audio/red":{source:"iana"},"audio/rtp-enc-aescm128":{source:"iana"},"audio/rtp-midi":{source:"iana"},"audio/rtploopback":{source:"iana"},"audio/rtx":{source:"iana"},"audio/s3m":{source:"apache",extensions:["s3m"]},"audio/scip":{source:"iana"},"audio/silk":{source:"apache",extensions:["sil"]},"audio/smv":{source:"iana"},"audio/smv-qcp":{source:"iana"},"audio/smv0":{source:"iana"},"audio/sofa":{source:"iana"},"audio/sp-midi":{source:"iana"},"audio/speex":{source:"iana"},"audio/t140c":{source:"iana"},"audio/t38":{source:"iana"},"audio/telephone-event":{source:"iana"},"audio/tetra_acelp":{source:"iana"},"audio/tetra_acelp_bb":{source:"iana"},"audio/tone":{source:"iana"},"audio/tsvcis":{source:"iana"},"audio/uemclip":{source:"iana"},"audio/ulpfec":{source:"iana"},"audio/usac":{source:"iana"},"audio/vdvi":{source:"iana"},"audio/vmr-wb":{source:"iana"},"audio/vnd.3gpp.iufp":{source:"iana"},"audio/vnd.4sb":{source:"iana"},"audio/vnd.audiokoz":{source:"iana"},"audio/vnd.celp":{source:"iana"},"audio/vnd.cisco.nse":{source:"iana"},"audio/vnd.cmles.radio-events":{source:"iana"},"audio/vnd.cns.anp1":{source:"iana"},"audio/vnd.cns.inf1":{source:"iana"},"audio/vnd.dece.audio":{source:"iana",extensions:["uva","uvva"]},"audio/vnd.digital-winds":{source:"iana",extensions:["eol"]},"audio/vnd.dlna.adts":{source:"iana"},"audio/vnd.dolby.heaac.1":{source:"iana"},"audio/vnd.dolby.heaac.2":{source:"iana"},"audio/vnd.dolby.mlp":{source:"iana"},"audio/vnd.dolby.mps":{source:"iana"},"audio/vnd.dolby.pl2":{source:"iana"},"audio/vnd.dolby.pl2x":{source:"iana"},"audio/vnd.dolby.pl2z":{source:"iana"},"audio/vnd.dolby.pulse.1":{source:"iana"},"audio/vnd.dra":{source:"iana",extensions:["dra"]},"audio/vnd.dts":{source:"iana",extensions:["dts"]},"audio/vnd.dts.hd":{source:"iana",extensions:["dtshd"]},"audio/vnd.dts.uhd":{source:"iana"},"audio/vnd.dvb.file":{source:"iana"},"audio/vnd.everad.plj":{source:"iana"},"audio/vnd.hns.audio":{source:"iana"},"audio/vnd.lucent.voice":{source:"iana",extensions:["lvp"]},"audio/vnd.ms-playready.media.pya":{source:"iana",extensions:["pya"]},"audio/vnd.nokia.mobile-xmf":{source:"iana"},"audio/vnd.nortel.vbk":{source:"iana"},"audio/vnd.nuera.ecelp4800":{source:"iana",extensions:["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{source:"iana",extensions:["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{source:"iana",extensions:["ecelp9600"]},"audio/vnd.octel.sbc":{source:"iana"},"audio/vnd.presonus.multitrack":{source:"iana"},"audio/vnd.qcelp":{source:"iana"},"audio/vnd.rhetorex.32kadpcm":{source:"iana"},"audio/vnd.rip":{source:"iana",extensions:["rip"]},"audio/vnd.rn-realaudio":{compressible:!1},"audio/vnd.sealedmedia.softseal.mpeg":{source:"iana"},"audio/vnd.vmx.cvsd":{source:"iana"},"audio/vnd.wave":{compressible:!1},"audio/vorbis":{source:"iana",compressible:!1},"audio/vorbis-config":{source:"iana"},"audio/wav":{compressible:!1,extensions:["wav"]},"audio/wave":{compressible:!1,extensions:["wav"]},"audio/webm":{source:"apache",compressible:!1,extensions:["weba"]},"audio/x-aac":{source:"apache",compressible:!1,extensions:["aac"]},"audio/x-aiff":{source:"apache",extensions:["aif","aiff","aifc"]},"audio/x-caf":{source:"apache",compressible:!1,extensions:["caf"]},"audio/x-flac":{source:"apache",extensions:["flac"]},"audio/x-m4a":{source:"nginx",extensions:["m4a"]},"audio/x-matroska":{source:"apache",extensions:["mka"]},"audio/x-mpegurl":{source:"apache",extensions:["m3u"]},"audio/x-ms-wax":{source:"apache",extensions:["wax"]},"audio/x-ms-wma":{source:"apache",extensions:["wma"]},"audio/x-pn-realaudio":{source:"apache",extensions:["ram","ra"]},"audio/x-pn-realaudio-plugin":{source:"apache",extensions:["rmp"]},"audio/x-realaudio":{source:"nginx",extensions:["ra"]},"audio/x-tta":{source:"apache"},"audio/x-wav":{source:"apache",extensions:["wav"]},"audio/xm":{source:"apache",extensions:["xm"]},"chemical/x-cdx":{source:"apache",extensions:["cdx"]},"chemical/x-cif":{source:"apache",extensions:["cif"]},"chemical/x-cmdf":{source:"apache",extensions:["cmdf"]},"chemical/x-cml":{source:"apache",extensions:["cml"]},"chemical/x-csml":{source:"apache",extensions:["csml"]},"chemical/x-pdb":{source:"apache"},"chemical/x-xyz":{source:"apache",extensions:["xyz"]},"font/collection":{source:"iana",extensions:["ttc"]},"font/otf":{source:"iana",compressible:!0,extensions:["otf"]},"font/sfnt":{source:"iana"},"font/ttf":{source:"iana",compressible:!0,extensions:["ttf"]},"font/woff":{source:"iana",extensions:["woff"]},"font/woff2":{source:"iana",extensions:["woff2"]},"image/aces":{source:"iana",extensions:["exr"]},"image/apng":{compressible:!1,extensions:["apng"]},"image/avci":{source:"iana",extensions:["avci"]},"image/avcs":{source:"iana",extensions:["avcs"]},"image/avif":{source:"iana",compressible:!1,extensions:["avif"]},"image/bmp":{source:"iana",compressible:!0,extensions:["bmp"]},"image/cgm":{source:"iana",extensions:["cgm"]},"image/dicom-rle":{source:"iana",extensions:["drle"]},"image/emf":{source:"iana",extensions:["emf"]},"image/fits":{source:"iana",extensions:["fits"]},"image/g3fax":{source:"iana",extensions:["g3"]},"image/gif":{source:"iana",compressible:!1,extensions:["gif"]},"image/heic":{source:"iana",extensions:["heic"]},"image/heic-sequence":{source:"iana",extensions:["heics"]},"image/heif":{source:"iana",extensions:["heif"]},"image/heif-sequence":{source:"iana",extensions:["heifs"]},"image/hej2k":{source:"iana",extensions:["hej2"]},"image/hsj2":{source:"iana",extensions:["hsj2"]},"image/ief":{source:"iana",extensions:["ief"]},"image/jls":{source:"iana",extensions:["jls"]},"image/jp2":{source:"iana",compressible:!1,extensions:["jp2","jpg2"]},"image/jpeg":{source:"iana",compressible:!1,extensions:["jpeg","jpg","jpe"]},"image/jph":{source:"iana",extensions:["jph"]},"image/jphc":{source:"iana",extensions:["jhc"]},"image/jpm":{source:"iana",compressible:!1,extensions:["jpm"]},"image/jpx":{source:"iana",compressible:!1,extensions:["jpx","jpf"]},"image/jxr":{source:"iana",extensions:["jxr"]},"image/jxra":{source:"iana",extensions:["jxra"]},"image/jxrs":{source:"iana",extensions:["jxrs"]},"image/jxs":{source:"iana",extensions:["jxs"]},"image/jxsc":{source:"iana",extensions:["jxsc"]},"image/jxsi":{source:"iana",extensions:["jxsi"]},"image/jxss":{source:"iana",extensions:["jxss"]},"image/ktx":{source:"iana",extensions:["ktx"]},"image/ktx2":{source:"iana",extensions:["ktx2"]},"image/naplps":{source:"iana"},"image/pjpeg":{compressible:!1},"image/png":{source:"iana",compressible:!1,extensions:["png"]},"image/prs.btif":{source:"iana",extensions:["btif"]},"image/prs.pti":{source:"iana",extensions:["pti"]},"image/pwg-raster":{source:"iana"},"image/sgi":{source:"apache",extensions:["sgi"]},"image/svg+xml":{source:"iana",compressible:!0,extensions:["svg","svgz"]},"image/t38":{source:"iana",extensions:["t38"]},"image/tiff":{source:"iana",compressible:!1,extensions:["tif","tiff"]},"image/tiff-fx":{source:"iana",extensions:["tfx"]},"image/vnd.adobe.photoshop":{source:"iana",compressible:!0,extensions:["psd"]},"image/vnd.airzip.accelerator.azv":{source:"iana",extensions:["azv"]},"image/vnd.cns.inf2":{source:"iana"},"image/vnd.dece.graphic":{source:"iana",extensions:["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{source:"iana",extensions:["djvu","djv"]},"image/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"image/vnd.dwg":{source:"iana",extensions:["dwg"]},"image/vnd.dxf":{source:"iana",extensions:["dxf"]},"image/vnd.fastbidsheet":{source:"iana",extensions:["fbs"]},"image/vnd.fpx":{source:"iana",extensions:["fpx"]},"image/vnd.fst":{source:"iana",extensions:["fst"]},"image/vnd.fujixerox.edmics-mmr":{source:"iana",extensions:["mmr"]},"image/vnd.fujixerox.edmics-rlc":{source:"iana",extensions:["rlc"]},"image/vnd.globalgraphics.pgb":{source:"iana"},"image/vnd.microsoft.icon":{source:"iana",compressible:!0,extensions:["ico"]},"image/vnd.mix":{source:"iana"},"image/vnd.mozilla.apng":{source:"iana"},"image/vnd.ms-dds":{compressible:!0,extensions:["dds"]},"image/vnd.ms-modi":{source:"iana",extensions:["mdi"]},"image/vnd.ms-photo":{source:"apache",extensions:["wdp"]},"image/vnd.net-fpx":{source:"iana",extensions:["npx"]},"image/vnd.pco.b16":{source:"iana",extensions:["b16"]},"image/vnd.radiance":{source:"iana"},"image/vnd.sealed.png":{source:"iana"},"image/vnd.sealedmedia.softseal.gif":{source:"iana"},"image/vnd.sealedmedia.softseal.jpg":{source:"iana"},"image/vnd.svf":{source:"iana"},"image/vnd.tencent.tap":{source:"iana",extensions:["tap"]},"image/vnd.valve.source.texture":{source:"iana",extensions:["vtf"]},"image/vnd.wap.wbmp":{source:"iana",extensions:["wbmp"]},"image/vnd.xiff":{source:"iana",extensions:["xif"]},"image/vnd.zbrush.pcx":{source:"iana",extensions:["pcx"]},"image/webp":{source:"apache",extensions:["webp"]},"image/wmf":{source:"iana",extensions:["wmf"]},"image/x-3ds":{source:"apache",extensions:["3ds"]},"image/x-cmu-raster":{source:"apache",extensions:["ras"]},"image/x-cmx":{source:"apache",extensions:["cmx"]},"image/x-freehand":{source:"apache",extensions:["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{source:"apache",compressible:!0,extensions:["ico"]},"image/x-jng":{source:"nginx",extensions:["jng"]},"image/x-mrsid-image":{source:"apache",extensions:["sid"]},"image/x-ms-bmp":{source:"nginx",compressible:!0,extensions:["bmp"]},"image/x-pcx":{source:"apache",extensions:["pcx"]},"image/x-pict":{source:"apache",extensions:["pic","pct"]},"image/x-portable-anymap":{source:"apache",extensions:["pnm"]},"image/x-portable-bitmap":{source:"apache",extensions:["pbm"]},"image/x-portable-graymap":{source:"apache",extensions:["pgm"]},"image/x-portable-pixmap":{source:"apache",extensions:["ppm"]},"image/x-rgb":{source:"apache",extensions:["rgb"]},"image/x-tga":{source:"apache",extensions:["tga"]},"image/x-xbitmap":{source:"apache",extensions:["xbm"]},"image/x-xcf":{compressible:!1},"image/x-xpixmap":{source:"apache",extensions:["xpm"]},"image/x-xwindowdump":{source:"apache",extensions:["xwd"]},"message/cpim":{source:"iana"},"message/delivery-status":{source:"iana"},"message/disposition-notification":{source:"iana",extensions:["disposition-notification"]},"message/external-body":{source:"iana"},"message/feedback-report":{source:"iana"},"message/global":{source:"iana",extensions:["u8msg"]},"message/global-delivery-status":{source:"iana",extensions:["u8dsn"]},"message/global-disposition-notification":{source:"iana",extensions:["u8mdn"]},"message/global-headers":{source:"iana",extensions:["u8hdr"]},"message/http":{source:"iana",compressible:!1},"message/imdn+xml":{source:"iana",compressible:!0},"message/news":{source:"iana"},"message/partial":{source:"iana",compressible:!1},"message/rfc822":{source:"iana",compressible:!0,extensions:["eml","mime"]},"message/s-http":{source:"iana"},"message/sip":{source:"iana"},"message/sipfrag":{source:"iana"},"message/tracking-status":{source:"iana"},"message/vnd.si.simp":{source:"iana"},"message/vnd.wfa.wsc":{source:"iana",extensions:["wsc"]},"model/3mf":{source:"iana",extensions:["3mf"]},"model/e57":{source:"iana"},"model/gltf+json":{source:"iana",compressible:!0,extensions:["gltf"]},"model/gltf-binary":{source:"iana",compressible:!0,extensions:["glb"]},"model/iges":{source:"iana",compressible:!1,extensions:["igs","iges"]},"model/mesh":{source:"iana",compressible:!1,extensions:["msh","mesh","silo"]},"model/mtl":{source:"iana",extensions:["mtl"]},"model/obj":{source:"iana",extensions:["obj"]},"model/step":{source:"iana"},"model/step+xml":{source:"iana",compressible:!0,extensions:["stpx"]},"model/step+zip":{source:"iana",compressible:!1,extensions:["stpz"]},"model/step-xml+zip":{source:"iana",compressible:!1,extensions:["stpxz"]},"model/stl":{source:"iana",extensions:["stl"]},"model/vnd.collada+xml":{source:"iana",compressible:!0,extensions:["dae"]},"model/vnd.dwf":{source:"iana",extensions:["dwf"]},"model/vnd.flatland.3dml":{source:"iana"},"model/vnd.gdl":{source:"iana",extensions:["gdl"]},"model/vnd.gs-gdl":{source:"apache"},"model/vnd.gs.gdl":{source:"iana"},"model/vnd.gtw":{source:"iana",extensions:["gtw"]},"model/vnd.moml+xml":{source:"iana",compressible:!0},"model/vnd.mts":{source:"iana",extensions:["mts"]},"model/vnd.opengex":{source:"iana",extensions:["ogex"]},"model/vnd.parasolid.transmit.binary":{source:"iana",extensions:["x_b"]},"model/vnd.parasolid.transmit.text":{source:"iana",extensions:["x_t"]},"model/vnd.pytha.pyox":{source:"iana"},"model/vnd.rosette.annotated-data-model":{source:"iana"},"model/vnd.sap.vds":{source:"iana",extensions:["vds"]},"model/vnd.usdz+zip":{source:"iana",compressible:!1,extensions:["usdz"]},"model/vnd.valve.source.compiled-map":{source:"iana",extensions:["bsp"]},"model/vnd.vtu":{source:"iana",extensions:["vtu"]},"model/vrml":{source:"iana",compressible:!1,extensions:["wrl","vrml"]},"model/x3d+binary":{source:"apache",compressible:!1,extensions:["x3db","x3dbz"]},"model/x3d+fastinfoset":{source:"iana",extensions:["x3db"]},"model/x3d+vrml":{source:"apache",compressible:!1,extensions:["x3dv","x3dvz"]},"model/x3d+xml":{source:"iana",compressible:!0,extensions:["x3d","x3dz"]},"model/x3d-vrml":{source:"iana",extensions:["x3dv"]},"multipart/alternative":{source:"iana",compressible:!1},"multipart/appledouble":{source:"iana"},"multipart/byteranges":{source:"iana"},"multipart/digest":{source:"iana"},"multipart/encrypted":{source:"iana",compressible:!1},"multipart/form-data":{source:"iana",compressible:!1},"multipart/header-set":{source:"iana"},"multipart/mixed":{source:"iana"},"multipart/multilingual":{source:"iana"},"multipart/parallel":{source:"iana"},"multipart/related":{source:"iana",compressible:!1},"multipart/report":{source:"iana"},"multipart/signed":{source:"iana",compressible:!1},"multipart/vnd.bint.med-plus":{source:"iana"},"multipart/voice-message":{source:"iana"},"multipart/x-mixed-replace":{source:"iana"},"text/1d-interleaved-parityfec":{source:"iana"},"text/cache-manifest":{source:"iana",compressible:!0,extensions:["appcache","manifest"]},"text/calendar":{source:"iana",extensions:["ics","ifb"]},"text/calender":{compressible:!0},"text/cmd":{compressible:!0},"text/coffeescript":{extensions:["coffee","litcoffee"]},"text/cql":{source:"iana"},"text/cql-expression":{source:"iana"},"text/cql-identifier":{source:"iana"},"text/css":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["css"]},"text/csv":{source:"iana",compressible:!0,extensions:["csv"]},"text/csv-schema":{source:"iana"},"text/directory":{source:"iana"},"text/dns":{source:"iana"},"text/ecmascript":{source:"iana"},"text/encaprtp":{source:"iana"},"text/enriched":{source:"iana"},"text/fhirpath":{source:"iana"},"text/flexfec":{source:"iana"},"text/fwdred":{source:"iana"},"text/gff3":{source:"iana"},"text/grammar-ref-list":{source:"iana"},"text/html":{source:"iana",compressible:!0,extensions:["html","htm","shtml"]},"text/jade":{extensions:["jade"]},"text/javascript":{source:"iana",compressible:!0},"text/jcr-cnd":{source:"iana"},"text/jsx":{compressible:!0,extensions:["jsx"]},"text/less":{compressible:!0,extensions:["less"]},"text/markdown":{source:"iana",compressible:!0,extensions:["markdown","md"]},"text/mathml":{source:"nginx",extensions:["mml"]},"text/mdx":{compressible:!0,extensions:["mdx"]},"text/mizar":{source:"iana"},"text/n3":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["n3"]},"text/parameters":{source:"iana",charset:"UTF-8"},"text/parityfec":{source:"iana"},"text/plain":{source:"iana",compressible:!0,extensions:["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{source:"iana",charset:"UTF-8"},"text/prs.fallenstein.rst":{source:"iana"},"text/prs.lines.tag":{source:"iana",extensions:["dsc"]},"text/prs.prop.logic":{source:"iana"},"text/raptorfec":{source:"iana"},"text/red":{source:"iana"},"text/rfc822-headers":{source:"iana"},"text/richtext":{source:"iana",compressible:!0,extensions:["rtx"]},"text/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"text/rtp-enc-aescm128":{source:"iana"},"text/rtploopback":{source:"iana"},"text/rtx":{source:"iana"},"text/sgml":{source:"iana",extensions:["sgml","sgm"]},"text/shaclc":{source:"iana"},"text/shex":{source:"iana",extensions:["shex"]},"text/slim":{extensions:["slim","slm"]},"text/spdx":{source:"iana",extensions:["spdx"]},"text/strings":{source:"iana"},"text/stylus":{extensions:["stylus","styl"]},"text/t140":{source:"iana"},"text/tab-separated-values":{source:"iana",compressible:!0,extensions:["tsv"]},"text/troff":{source:"iana",extensions:["t","tr","roff","man","me","ms"]},"text/turtle":{source:"iana",charset:"UTF-8",extensions:["ttl"]},"text/ulpfec":{source:"iana"},"text/uri-list":{source:"iana",compressible:!0,extensions:["uri","uris","urls"]},"text/vcard":{source:"iana",compressible:!0,extensions:["vcard"]},"text/vnd.a":{source:"iana"},"text/vnd.abc":{source:"iana"},"text/vnd.ascii-art":{source:"iana"},"text/vnd.curl":{source:"iana",extensions:["curl"]},"text/vnd.curl.dcurl":{source:"apache",extensions:["dcurl"]},"text/vnd.curl.mcurl":{source:"apache",extensions:["mcurl"]},"text/vnd.curl.scurl":{source:"apache",extensions:["scurl"]},"text/vnd.debian.copyright":{source:"iana",charset:"UTF-8"},"text/vnd.dmclientscript":{source:"iana"},"text/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"text/vnd.esmertec.theme-descriptor":{source:"iana",charset:"UTF-8"},"text/vnd.familysearch.gedcom":{source:"iana",extensions:["ged"]},"text/vnd.ficlab.flt":{source:"iana"},"text/vnd.fly":{source:"iana",extensions:["fly"]},"text/vnd.fmi.flexstor":{source:"iana",extensions:["flx"]},"text/vnd.gml":{source:"iana"},"text/vnd.graphviz":{source:"iana",extensions:["gv"]},"text/vnd.hans":{source:"iana"},"text/vnd.hgl":{source:"iana"},"text/vnd.in3d.3dml":{source:"iana",extensions:["3dml"]},"text/vnd.in3d.spot":{source:"iana",extensions:["spot"]},"text/vnd.iptc.newsml":{source:"iana"},"text/vnd.iptc.nitf":{source:"iana"},"text/vnd.latex-z":{source:"iana"},"text/vnd.motorola.reflex":{source:"iana"},"text/vnd.ms-mediapackage":{source:"iana"},"text/vnd.net2phone.commcenter.command":{source:"iana"},"text/vnd.radisys.msml-basic-layout":{source:"iana"},"text/vnd.senx.warpscript":{source:"iana"},"text/vnd.si.uricatalogue":{source:"iana"},"text/vnd.sosi":{source:"iana"},"text/vnd.sun.j2me.app-descriptor":{source:"iana",charset:"UTF-8",extensions:["jad"]},"text/vnd.trolltech.linguist":{source:"iana",charset:"UTF-8"},"text/vnd.wap.si":{source:"iana"},"text/vnd.wap.sl":{source:"iana"},"text/vnd.wap.wml":{source:"iana",extensions:["wml"]},"text/vnd.wap.wmlscript":{source:"iana",extensions:["wmls"]},"text/vtt":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["vtt"]},"text/x-asm":{source:"apache",extensions:["s","asm"]},"text/x-c":{source:"apache",extensions:["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{source:"nginx",extensions:["htc"]},"text/x-fortran":{source:"apache",extensions:["f","for","f77","f90"]},"text/x-gwt-rpc":{compressible:!0},"text/x-handlebars-template":{extensions:["hbs"]},"text/x-java-source":{source:"apache",extensions:["java"]},"text/x-jquery-tmpl":{compressible:!0},"text/x-lua":{extensions:["lua"]},"text/x-markdown":{compressible:!0,extensions:["mkd"]},"text/x-nfo":{source:"apache",extensions:["nfo"]},"text/x-opml":{source:"apache",extensions:["opml"]},"text/x-org":{compressible:!0,extensions:["org"]},"text/x-pascal":{source:"apache",extensions:["p","pas"]},"text/x-processing":{compressible:!0,extensions:["pde"]},"text/x-sass":{extensions:["sass"]},"text/x-scss":{extensions:["scss"]},"text/x-setext":{source:"apache",extensions:["etx"]},"text/x-sfv":{source:"apache",extensions:["sfv"]},"text/x-suse-ymp":{compressible:!0,extensions:["ymp"]},"text/x-uuencode":{source:"apache",extensions:["uu"]},"text/x-vcalendar":{source:"apache",extensions:["vcs"]},"text/x-vcard":{source:"apache",extensions:["vcf"]},"text/xml":{source:"iana",compressible:!0,extensions:["xml"]},"text/xml-external-parsed-entity":{source:"iana"},"text/yaml":{compressible:!0,extensions:["yaml","yml"]},"video/1d-interleaved-parityfec":{source:"iana"},"video/3gpp":{source:"iana",extensions:["3gp","3gpp"]},"video/3gpp-tt":{source:"iana"},"video/3gpp2":{source:"iana",extensions:["3g2"]},"video/av1":{source:"iana"},"video/bmpeg":{source:"iana"},"video/bt656":{source:"iana"},"video/celb":{source:"iana"},"video/dv":{source:"iana"},"video/encaprtp":{source:"iana"},"video/ffv1":{source:"iana"},"video/flexfec":{source:"iana"},"video/h261":{source:"iana",extensions:["h261"]},"video/h263":{source:"iana",extensions:["h263"]},"video/h263-1998":{source:"iana"},"video/h263-2000":{source:"iana"},"video/h264":{source:"iana",extensions:["h264"]},"video/h264-rcdo":{source:"iana"},"video/h264-svc":{source:"iana"},"video/h265":{source:"iana"},"video/iso.segment":{source:"iana",extensions:["m4s"]},"video/jpeg":{source:"iana",extensions:["jpgv"]},"video/jpeg2000":{source:"iana"},"video/jpm":{source:"apache",extensions:["jpm","jpgm"]},"video/jxsv":{source:"iana"},"video/mj2":{source:"iana",extensions:["mj2","mjp2"]},"video/mp1s":{source:"iana"},"video/mp2p":{source:"iana"},"video/mp2t":{source:"iana",extensions:["ts"]},"video/mp4":{source:"iana",compressible:!1,extensions:["mp4","mp4v","mpg4"]},"video/mp4v-es":{source:"iana"},"video/mpeg":{source:"iana",compressible:!1,extensions:["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{source:"iana"},"video/mpv":{source:"iana"},"video/nv":{source:"iana"},"video/ogg":{source:"iana",compressible:!1,extensions:["ogv"]},"video/parityfec":{source:"iana"},"video/pointer":{source:"iana"},"video/quicktime":{source:"iana",compressible:!1,extensions:["qt","mov"]},"video/raptorfec":{source:"iana"},"video/raw":{source:"iana"},"video/rtp-enc-aescm128":{source:"iana"},"video/rtploopback":{source:"iana"},"video/rtx":{source:"iana"},"video/scip":{source:"iana"},"video/smpte291":{source:"iana"},"video/smpte292m":{source:"iana"},"video/ulpfec":{source:"iana"},"video/vc1":{source:"iana"},"video/vc2":{source:"iana"},"video/vnd.cctv":{source:"iana"},"video/vnd.dece.hd":{source:"iana",extensions:["uvh","uvvh"]},"video/vnd.dece.mobile":{source:"iana",extensions:["uvm","uvvm"]},"video/vnd.dece.mp4":{source:"iana"},"video/vnd.dece.pd":{source:"iana",extensions:["uvp","uvvp"]},"video/vnd.dece.sd":{source:"iana",extensions:["uvs","uvvs"]},"video/vnd.dece.video":{source:"iana",extensions:["uvv","uvvv"]},"video/vnd.directv.mpeg":{source:"iana"},"video/vnd.directv.mpeg-tts":{source:"iana"},"video/vnd.dlna.mpeg-tts":{source:"iana"},"video/vnd.dvb.file":{source:"iana",extensions:["dvb"]},"video/vnd.fvt":{source:"iana",extensions:["fvt"]},"video/vnd.hns.video":{source:"iana"},"video/vnd.iptvforum.1dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.1dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.2dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.2dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.ttsavc":{source:"iana"},"video/vnd.iptvforum.ttsmpeg2":{source:"iana"},"video/vnd.motorola.video":{source:"iana"},"video/vnd.motorola.videop":{source:"iana"},"video/vnd.mpegurl":{source:"iana",extensions:["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{source:"iana",extensions:["pyv"]},"video/vnd.nokia.interleaved-multimedia":{source:"iana"},"video/vnd.nokia.mp4vr":{source:"iana"},"video/vnd.nokia.videovoip":{source:"iana"},"video/vnd.objectvideo":{source:"iana"},"video/vnd.radgamettools.bink":{source:"iana"},"video/vnd.radgamettools.smacker":{source:"iana"},"video/vnd.sealed.mpeg1":{source:"iana"},"video/vnd.sealed.mpeg4":{source:"iana"},"video/vnd.sealed.swf":{source:"iana"},"video/vnd.sealedmedia.softseal.mov":{source:"iana"},"video/vnd.uvvu.mp4":{source:"iana",extensions:["uvu","uvvu"]},"video/vnd.vivo":{source:"iana",extensions:["viv"]},"video/vnd.youtube.yt":{source:"iana"},"video/vp8":{source:"iana"},"video/vp9":{source:"iana"},"video/webm":{source:"apache",compressible:!1,extensions:["webm"]},"video/x-f4v":{source:"apache",extensions:["f4v"]},"video/x-fli":{source:"apache",extensions:["fli"]},"video/x-flv":{source:"apache",compressible:!1,extensions:["flv"]},"video/x-m4v":{source:"apache",extensions:["m4v"]},"video/x-matroska":{source:"apache",compressible:!1,extensions:["mkv","mk3d","mks"]},"video/x-mng":{source:"apache",extensions:["mng"]},"video/x-ms-asf":{source:"apache",extensions:["asf","asx"]},"video/x-ms-vob":{source:"apache",extensions:["vob"]},"video/x-ms-wm":{source:"apache",extensions:["wm"]},"video/x-ms-wmv":{source:"apache",compressible:!1,extensions:["wmv"]},"video/x-ms-wmx":{source:"apache",extensions:["wmx"]},"video/x-ms-wvx":{source:"apache",extensions:["wvx"]},"video/x-msvideo":{source:"apache",extensions:["avi"]},"video/x-sgi-movie":{source:"apache",extensions:["movie"]},"video/x-smv":{source:"apache",extensions:["smv"]},"x-conference/x-cooltalk":{source:"apache",extensions:["ice"]},"x-shader/x-fragment":{compressible:!0},"x-shader/x-vertex":{compressible:!0}};({get exports(){return Hf},set exports(e){Hf=e}}).exports=Wf,
98
+ */var $c=tn(Object.freeze({__proto__:null,default:class{static getParser(e,t=!1){if("string"!=typeof e)throw new Error("UserAgent should be a string");return new qc(e,t)}static parse(e){return new qc(e).getResult()}static get BROWSER_MAP(){return jc}static get ENGINE_MAP(){return Lc}static get OS_MAP(){return Mc}static get PLATFORMS_MAP(){return Ic}}})),Vc={},Hc=Zt&&Zt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Vc,"__esModule",{value:!0}),Vc.Logger=void 0;const Wc=Hc(gc),Gc="mediasoup-client";Vc.Logger=class{constructor(e){e?(this._debug=(0,Wc.default)(`${Gc}:${e}`),this._warn=(0,Wc.default)(`${Gc}:WARN:${e}`),this._error=(0,Wc.default)(`${Gc}:ERROR:${e}`)):(this._debug=(0,Wc.default)(Gc),this._warn=(0,Wc.default)(`${Gc}:WARN`),this._error=(0,Wc.default)(`${Gc}: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 Kc={};Object.defineProperty(Kc,"__esModule",{value:!0}),Kc.EnhancedEventEmitter=void 0;const Jc=d,Qc=new Vc.Logger("EnhancedEventEmitter");class Yc extends Jc.EventEmitter{constructor(){super(),this.setMaxListeners(1/0)}emit(e,...t){return super.emit(e,...t)}safeEmit(e,...t){const n=super.listenerCount(e);try{return super.emit(e,...t)}catch(t){return Qc.error("safeEmit() | event listener threw an error [eventName:%s]:%o",e,t),Boolean(n)}}on(e,t){return super.on(e,t),this}off(e,t){return super.off(e,t),this}addListener(e,t){return super.on(e,t),this}prependListener(e,t){return super.prependListener(e,t),this}once(e,t){return super.once(e,t),this}prependOnceListener(e,t){return super.prependOnceListener(e,t),this}removeListener(e,t){return super.off(e,t),this}removeAllListeners(e){return super.removeAllListeners(e),this}listenerCount(e){return super.listenerCount(e)}listeners(e){return super.listeners(e)}rawListeners(e){return super.rawListeners(e)}}Kc.EnhancedEventEmitter=Yc;var Xc={};Object.defineProperty(Xc,"__esModule",{value:!0}),Xc.InvalidStateError=Xc.UnsupportedError=void 0;class Zc extends Error{constructor(e){super(e),this.name="UnsupportedError",Error.hasOwnProperty("captureStackTrace")?Error.captureStackTrace(this,Zc):this.stack=new Error(e).stack}}Xc.UnsupportedError=Zc;class ep extends Error{constructor(e){super(e),this.name="InvalidStateError",Error.hasOwnProperty("captureStackTrace")?Error.captureStackTrace(this,ep):this.stack=new Error(e).stack}}Xc.InvalidStateError=ep;var tp={};Object.defineProperty(tp,"__esModule",{value:!0}),tp.generateRandomNumber=tp.clone=void 0,tp.clone=function(e,t){return void 0===e?t:JSON.parse(JSON.stringify(e))},tp.generateRandomNumber=function(){return Math.round(1e7*Math.random())};var np={},ip={};!function(e){const t=gc("h264-profile-level-id");t.log=console.info.bind(console);e.ProfileConstrainedBaseline=1,e.ProfileBaseline=2,e.ProfileMain=3,e.ProfileConstrainedHigh=4,e.ProfileHigh=5;const n=10;e.Level1_b=0,e.Level1=10,e.Level1_1=11,e.Level1_2=12,e.Level1_3=13,e.Level2=20,e.Level2_1=21,e.Level2_2=22,e.Level3=30,e.Level3_1=31,e.Level3_2=32,e.Level4=40,e.Level4_1=41,e.Level4_2=42,e.Level5=50,e.Level5_1=51,e.Level5_2=52;class i{constructor(e,t){this.profile=e,this.level=t}}e.ProfileLevelId=i;const s=new i(1,31);class r{constructor(e){this._mask=~c("x",e),this._maskedValue=c("1",e)}isMatch(e){return this._maskedValue===(e&this._mask)}}class a{constructor(e,t,n){this.profile_idc=e,this.profile_iop=t,this.profile=n}}const o=[new a(66,new r("x1xx0000"),1),new a(77,new r("1xxx0000"),1),new a(88,new r("11xx0000"),1),new a(66,new r("x0xx0000"),2),new a(88,new r("10xx0000"),2),new a(77,new r("0x0x0000"),3),new a(100,new r("00000000"),5),new a(100,new r("00001100"),4)];function c(e,t){return(t[0]===e)<<7|(t[1]===e)<<6|(t[2]===e)<<5|(t[3]===e)<<4|(t[4]===e)<<3|(t[5]===e)<<2|(t[6]===e)<<1|(t[7]===e)<<0}function p(e={}){const t=e["level-asymmetry-allowed"];return 1===t||"1"===t}e.parseProfileLevelId=function(e){if("string"!=typeof e||6!==e.length)return null;const n=parseInt(e,16);if(0===n)return null;const s=255&n,r=n>>8&255,a=n>>16&255;let c;switch(s){case 11:c=0!=(16&r)?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:c=s;break;default:return t("parseProfileLevelId() | unrecognized level_idc:%s",s),null}for(const e of o)if(a===e.profile_idc&&e.profile_iop.isMatch(r))return new i(e.profile,c);return t("parseProfileLevelId() | unrecognized profile_idc/profile_iop combination"),null},e.profileLevelIdToString=function(e){if(0==e.level)switch(e.profile){case 1:return"42f00b";case 2:return"42100b";case 3:return"4d100b";default:return t("profileLevelIdToString() | Level 1_b not is allowed for profile:%s",e.profile),null}let n;switch(e.profile){case 1:n="42e0";break;case 2:n="4200";break;case 3:n="4d00";break;case 4:n="640c";break;case 5:n="6400";break;default:return t("profileLevelIdToString() | unrecognized profile:%s",e.profile),null}let i=e.level.toString(16);return 1===i.length&&(i=`0${i}`),`${n}${i}`},e.parseSdpProfileLevelId=function(t={}){const n=t["profile-level-id"];return n?e.parseProfileLevelId(n):s},e.isSameProfile=function(t={},n={}){const i=e.parseSdpProfileLevelId(t),s=e.parseSdpProfileLevelId(n);return Boolean(i&&s&&i.profile===s.profile)},e.generateProfileLevelIdForAnswer=function(s={},r={}){if(!s["profile-level-id"]&&!r["profile-level-id"])return t("generateProfileLevelIdForAnswer() | no profile-level-id in local and remote params"),null;const a=e.parseSdpProfileLevelId(s),o=e.parseSdpProfileLevelId(r);if(!a)throw new TypeError("invalid local_profile_level_id");if(!o)throw new TypeError("invalid remote_profile_level_id");if(a.profile!==o.profile)throw new TypeError("H264 Profile mismatch");const c=p(s)&&p(r),d=a.level,l=o.level,u=function(e,t){return 0===e?t!==n&&0!==t:0===t?e!==n:e<t}(m=d,h=l)?m:h;var m,h;const f=c?d:u;return t("generateProfileLevelIdForAnswer() | result: [profile:%s, level:%s]",a.profile,f),e.profileLevelIdToString(new i(a.profile,f))}}(ip);var sp=Zt&&Zt.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),rp=Zt&&Zt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),ap=Zt&&Zt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&sp(t,e,n);return rp(t,e),t};Object.defineProperty(np,"__esModule",{value:!0}),np.canReceive=np.canSend=np.generateProbatorRtpParameters=np.reduceCodecs=np.getSendingRemoteRtpParameters=np.getSendingRtpParameters=np.getRecvRtpCapabilities=np.getExtendedRtpCapabilities=np.validateSctpStreamParameters=np.validateSctpParameters=np.validateNumSctpStreams=np.validateSctpCapabilities=np.validateRtcpParameters=np.validateRtpEncodingParameters=np.validateRtpHeaderExtensionParameters=np.validateRtpCodecParameters=np.validateRtpParameters=np.validateRtpHeaderExtension=np.validateRtcpFeedback=np.validateRtpCodecCapability=np.validateRtpCapabilities=void 0;const op=ap(ip),cp=ap(tp);function pp(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 n=t.exec(e.mimeType);if(!n)throw new TypeError("invalid codec.mimeType");if(e.kind=n[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 n=e.parameters[t];if(void 0===n&&(e.parameters[t]="",n=""),"string"!=typeof n&&"number"!=typeof n)throw new TypeError(`invalid codec parameter [key:${t}s, value:${n}]`);if("apt"===t&&"number"!=typeof n)throw new TypeError("invalid codec apt parameter")}e.rtcpFeedback&&Array.isArray(e.rtcpFeedback)||(e.rtcpFeedback=[]);for(const t of e.rtcpFeedback)dp(t)}function dp(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 lp(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 up(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)mp(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)hp(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)fp(t);if(e.rtcp&&"object"!=typeof e.rtcp)throw new TypeError("params.rtcp is not an object");e.rtcp||(e.rtcp={}),gp(e.rtcp)}function mp(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 n=t.exec(e.mimeType);if(!n)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"===n[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 n=e.parameters[t];if(void 0===n&&(e.parameters[t]="",n=""),"string"!=typeof n&&"number"!=typeof n)throw new TypeError(`invalid codec parameter [key:${t}s, value:${n}]`);if("apt"===t&&"number"!=typeof n)throw new TypeError("invalid codec apt parameter")}e.rtcpFeedback&&Array.isArray(e.rtcpFeedback)||(e.rtcpFeedback=[]);for(const t of e.rtcpFeedback)dp(t)}function hp(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 n=e.parameters[t];if(void 0===n&&(e.parameters[t]="",n=""),"string"!=typeof n&&"number"!=typeof n)throw new TypeError("invalid header extension parameter")}}function fp(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 gp(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 vp(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 bp(e){return!!e&&/.+\/rtx$/i.test(e.mimeType)}function yp(e,t,{strict:n=!1,modify:i=!1}={}){const s=e.mimeType.toLowerCase();if(s!==t.mimeType.toLowerCase())return!1;if(e.clockRate!==t.clockRate)return!1;if(e.channels!==t.channels)return!1;switch(s){case"video/h264":if(n){if((e.parameters["packetization-mode"]||0)!==(t.parameters["packetization-mode"]||0))return!1;if(!op.isSameProfile(e.parameters,t.parameters))return!1;let n;try{n=op.generateProfileLevelIdForAnswer(e.parameters,t.parameters)}catch(e){return!1}i&&(n?(e.parameters["profile-level-id"]=n,t.parameters["profile-level-id"]=n):(delete e.parameters["profile-level-id"],delete t.parameters["profile-level-id"]))}break;case"video/vp9":if(n){if((e.parameters["profile-id"]||0)!==(t.parameters["profile-id"]||0))return!1}}return!0}function _p(e,t){return(!e.kind||!t.kind||e.kind===t.kind)&&e.uri===t.uri}function xp(e,t){const n=[];for(const i of e.rtcpFeedback||[]){const e=(t.rtcpFeedback||[]).find((e=>e.type===i.type&&(e.parameter===i.parameter||!e.parameter&&!i.parameter)));e&&n.push(e)}return n}np.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)pp(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)lp(t)},np.validateRtpCodecCapability=pp,np.validateRtcpFeedback=dp,np.validateRtpHeaderExtension=lp,np.validateRtpParameters=up,np.validateRtpCodecParameters=mp,np.validateRtpHeaderExtensionParameters=hp,np.validateRtpEncodingParameters=fp,np.validateRtcpParameters=gp,np.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");vp(e.numStreams)},np.validateNumSctpStreams=vp,np.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")},np.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")},np.getExtendedRtpCapabilities=function(e,t){const n={codecs:[],headerExtensions:[]};for(const i of t.codecs||[]){if(bp(i))continue;const t=(e.codecs||[]).find((e=>yp(e,i,{strict:!0,modify:!0})));if(!t)continue;const s={mimeType:t.mimeType,kind:t.kind,clockRate:t.clockRate,channels:t.channels,localPayloadType:t.preferredPayloadType,localRtxPayloadType:void 0,remotePayloadType:i.preferredPayloadType,remoteRtxPayloadType:void 0,localParameters:t.parameters,remoteParameters:i.parameters,rtcpFeedback:xp(t,i)};n.codecs.push(s)}for(const i of n.codecs){const n=e.codecs.find((e=>bp(e)&&e.parameters.apt===i.localPayloadType)),s=t.codecs.find((e=>bp(e)&&e.parameters.apt===i.remotePayloadType));n&&s&&(i.localRtxPayloadType=n.preferredPayloadType,i.remoteRtxPayloadType=s.preferredPayloadType)}for(const i of t.headerExtensions){const t=e.headerExtensions.find((e=>_p(e,i)));if(!t)continue;const s={kind:i.kind,uri:i.uri,sendId:t.preferredId,recvId:i.preferredId,encrypt:t.preferredEncrypt,direction:"sendrecv"};switch(i.direction){case"sendrecv":s.direction="sendrecv";break;case"recvonly":s.direction="sendonly";break;case"sendonly":s.direction="recvonly";break;case"inactive":s.direction="inactive"}n.headerExtensions.push(s)}return n},np.getRecvRtpCapabilities=function(e){const t={codecs:[],headerExtensions:[]};for(const n of e.codecs){const e={mimeType:n.mimeType,kind:n.kind,preferredPayloadType:n.remotePayloadType,clockRate:n.clockRate,channels:n.channels,parameters:n.localParameters,rtcpFeedback:n.rtcpFeedback};if(t.codecs.push(e),!n.remoteRtxPayloadType)continue;const i={mimeType:`${n.kind}/rtx`,kind:n.kind,preferredPayloadType:n.remoteRtxPayloadType,clockRate:n.clockRate,parameters:{apt:n.remotePayloadType},rtcpFeedback:[]};t.codecs.push(i)}for(const n of e.headerExtensions){if("sendrecv"!==n.direction&&"recvonly"!==n.direction)continue;const e={kind:n.kind,uri:n.uri,preferredId:n.recvId,preferredEncrypt:n.encrypt,direction:n.direction};t.headerExtensions.push(e)}return t},np.getSendingRtpParameters=function(e,t){const n={mid:void 0,codecs:[],headerExtensions:[],encodings:[],rtcp:{}};for(const i of t.codecs){if(i.kind!==e)continue;const t={mimeType:i.mimeType,payloadType:i.localPayloadType,clockRate:i.clockRate,channels:i.channels,parameters:i.localParameters,rtcpFeedback:i.rtcpFeedback};if(n.codecs.push(t),i.localRtxPayloadType){const e={mimeType:`${i.kind}/rtx`,payloadType:i.localRtxPayloadType,clockRate:i.clockRate,parameters:{apt:i.localPayloadType},rtcpFeedback:[]};n.codecs.push(e)}}for(const i of t.headerExtensions){if(i.kind&&i.kind!==e||"sendrecv"!==i.direction&&"sendonly"!==i.direction)continue;const t={uri:i.uri,id:i.sendId,encrypt:i.encrypt,parameters:{}};n.headerExtensions.push(t)}return n},np.getSendingRemoteRtpParameters=function(e,t){const n={mid:void 0,codecs:[],headerExtensions:[],encodings:[],rtcp:{}};for(const i of t.codecs){if(i.kind!==e)continue;const t={mimeType:i.mimeType,payloadType:i.localPayloadType,clockRate:i.clockRate,channels:i.channels,parameters:i.remoteParameters,rtcpFeedback:i.rtcpFeedback};if(n.codecs.push(t),i.localRtxPayloadType){const e={mimeType:`${i.kind}/rtx`,payloadType:i.localRtxPayloadType,clockRate:i.clockRate,parameters:{apt:i.localPayloadType},rtcpFeedback:[]};n.codecs.push(e)}}for(const i of t.headerExtensions){if(i.kind&&i.kind!==e||"sendrecv"!==i.direction&&"sendonly"!==i.direction)continue;const t={uri:i.uri,id:i.sendId,encrypt:i.encrypt,parameters:{}};n.headerExtensions.push(t)}if(n.headerExtensions.some((e=>"http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01"===e.uri)))for(const e of n.codecs)e.rtcpFeedback=(e.rtcpFeedback||[]).filter((e=>"goog-remb"!==e.type));else if(n.headerExtensions.some((e=>"http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time"===e.uri)))for(const e of n.codecs)e.rtcpFeedback=(e.rtcpFeedback||[]).filter((e=>"transport-cc"!==e.type));else for(const e of n.codecs)e.rtcpFeedback=(e.rtcpFeedback||[]).filter((e=>"transport-cc"!==e.type&&"goog-remb"!==e.type));return n},np.reduceCodecs=function(e,t){const n=[];if(t){for(let i=0;i<e.length;++i)if(yp(e[i],t)){n.push(e[i]),bp(e[i+1])&&n.push(e[i+1]);break}if(0===n.length)throw new TypeError("no matching codec found")}else n.push(e[0]),bp(e[1])&&n.push(e[1]);return n},np.generateProbatorRtpParameters=function(e){up(e=cp.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},np.canSend=function(e,t){return t.codecs.some((t=>t.kind===e))},np.canReceive=function(e,t){if(up(e),0===e.codecs.length)return!1;const n=e.codecs[0];return t.codecs.some((e=>e.remotePayloadType===n.payloadType))};var wp={},Sp={},kp={},Cp=Zt&&Zt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(kp,"__esModule",{value:!0}),kp.Logger=void 0;const Rp=Cp(gc),Tp="awaitqueue";kp.Logger=class{constructor(e){e?(this._debug=(0,Rp.default)(`awaitqueue:${e}`),this._warn=(0,Rp.default)(`awaitqueue:WARN:${e}`),this._error=(0,Rp.default)(`awaitqueue:ERROR:${e}`)):(this._debug=(0,Rp.default)(Tp),this._warn=(0,Rp.default)("awaitqueue:WARN"),this._error=(0,Rp.default)("awaitqueue: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}},Object.defineProperty(Sp,"__esModule",{value:!0}),Sp.AwaitQueue=Sp.AwaitQueueRemovedTaskError=Sp.AwaitQueueStoppedError=void 0;const Pp=new kp.Logger;class Ep extends Error{constructor(e){super(null!=e?e:"AwaitQueue stopped"),this.name="AwaitQueueStoppedError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,Ep)}}Sp.AwaitQueueStoppedError=Ep;class Op extends Error{constructor(e){super(null!=e?e:"AwaitQueue task removed"),this.name="AwaitQueueRemovedTaskError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,Op)}}Sp.AwaitQueueRemovedTaskError=Op;Sp.AwaitQueue=class{constructor(){this.pendingTasks=new Map,this.nextTaskId=0,this.stopping=!1}get size(){return this.pendingTasks.size}async push(e,t){if(t=null!=t?t:e.name,Pp.debug(`push() [name:${t}]`),"function"!=typeof e)throw new TypeError("given task is not a function");if(t)try{Object.defineProperty(e,"name",{value:t})}catch(e){}return new Promise(((n,i)=>{const s={id:this.nextTaskId++,task:e,name:t,enqueuedAt:Date.now(),executedAt:void 0,completed:!1,resolve:e=>{if(s.completed)return;s.completed=!0,this.pendingTasks.delete(s.id),Pp.debug(`resolving task [name:${s.name}]`),n(e);const[t]=this.pendingTasks.values();t&&!t.executedAt&&this.execute(t)},reject:e=>{if(!s.completed&&(s.completed=!0,this.pendingTasks.delete(s.id),Pp.debug(`rejecting task [name:${s.name}]: %s`,String(e)),i(e),!this.stopping)){const[e]=this.pendingTasks.values();e&&!e.executedAt&&this.execute(e)}}};this.pendingTasks.set(s.id,s),1===this.pendingTasks.size&&this.execute(s)}))}stop(){Pp.debug("stop()"),this.stopping=!0;for(const e of this.pendingTasks.values())Pp.debug(`stop() | stopping task [name:${e.name}]`),e.reject(new Ep);this.stopping=!1}remove(e){Pp.debug(`remove() [taskIdx:${e}]`);const t=Array.from(this.pendingTasks.values())[e];t?t.reject(new Op):Pp.debug(`stop() | no task with given idx [taskIdx:${e}]`)}dump(){const e=Date.now();let t=0;return Array.from(this.pendingTasks.values()).map((n=>({idx:t++,task:n.task,name:n.name,enqueuedTime:n.executedAt?n.executedAt-n.enqueuedAt:e-n.enqueuedAt,executionTime:n.executedAt?e-n.executedAt:0})))}async execute(e){if(Pp.debug(`execute() [name:${e.name}]`),e.executedAt)throw new Error("task already being executed");e.executedAt=Date.now();try{const t=await e.task();e.resolve(t)}catch(t){e.reject(t)}}};var Dp={};Object.defineProperty(Dp,"__esModule",{value:!0}),Dp.Producer=void 0;const jp=Kc,Ip=Xc,Mp=new Vc.Logger("Producer");class Lp extends jp.EnhancedEventEmitter{constructor({id:e,localId:t,rtpSender:n,track:i,rtpParameters:s,stopTracks:r,disableTrackOnPause:a,zeroRtpOnPause:o,appData:c}){super(),this._closed=!1,this._observer=new jp.EnhancedEventEmitter,Mp.debug("constructor()"),this._id=e,this._localId=t,this._rtpSender=n,this._track=i,this._kind=i.kind,this._rtpParameters=s,this._paused=!!a&&!i.enabled,this._maxSpatialLayer=void 0,this._stopTracks=r,this._disableTrackOnPause=a,this._zeroRtpOnPause=o,this._appData=c||{},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||(Mp.debug("close()"),this._closed=!0,this.destroyTrack(),this.emit("@close"),this._observer.safeEmit("close"))}transportClosed(){this._closed||(Mp.debug("transportClosed()"),this._closed=!0,this.destroyTrack(),this.safeEmit("transportclose"),this._observer.safeEmit("close"))}async getStats(){if(this._closed)throw new Ip.InvalidStateError("closed");return new Promise(((e,t)=>{this.safeEmit("@getstats",e,t)}))}pause(){Mp.debug("pause()"),this._closed?Mp.error("pause() | Producer closed"):(this._paused=!0,this._track&&this._disableTrackOnPause&&(this._track.enabled=!1),this._zeroRtpOnPause&&new Promise(((e,t)=>{this.safeEmit("@pause",e,t)})).catch((()=>{})),this._observer.safeEmit("pause"))}resume(){Mp.debug("resume()"),this._closed?Mp.error("resume() | Producer closed"):(this._paused=!1,this._track&&this._disableTrackOnPause&&(this._track.enabled=!0),this._zeroRtpOnPause&&new Promise(((e,t)=>{this.safeEmit("@resume",e,t)})).catch((()=>{})),this._observer.safeEmit("resume"))}async replaceTrack({track:e}){if(Mp.debug("replaceTrack() [track:%o]",e),this._closed){if(e&&this._stopTracks)try{e.stop()}catch(e){}throw new Ip.InvalidStateError("closed")}if(e&&"ended"===e.readyState)throw new Ip.InvalidStateError("track ended");e!==this._track?(await new Promise(((t,n)=>{this.safeEmit("@replacetrack",e,t,n)})),this.destroyTrack(),this._track=e,this._track&&this._disableTrackOnPause&&(this._paused?this._paused&&(this._track.enabled=!1):this._track.enabled=!0),this.handleTrack()):Mp.debug("replaceTrack() | same track, ignored")}async setMaxSpatialLayer(e){if(this._closed)throw new Ip.InvalidStateError("closed");if("video"!==this._kind)throw new Ip.UnsupportedError("not a video Producer");if("number"!=typeof e)throw new TypeError("invalid spatialLayer");e!==this._maxSpatialLayer&&(await new Promise(((t,n)=>{this.safeEmit("@setmaxspatiallayer",e,t,n)})).catch((()=>{})),this._maxSpatialLayer=e)}async setRtpEncodingParameters(e){if(this._closed)throw new Ip.InvalidStateError("closed");if("object"!=typeof e)throw new TypeError("invalid params");await new Promise(((t,n)=>{this.safeEmit("@setrtpencodingparameters",e,t,n)}))}onTrackEnded(){Mp.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){}}}Dp.Producer=Lp;var Ap={};Object.defineProperty(Ap,"__esModule",{value:!0}),Ap.Consumer=void 0;const Np=Kc,Bp=Xc,Fp=new Vc.Logger("Consumer");class Up extends Np.EnhancedEventEmitter{constructor({id:e,localId:t,producerId:n,rtpReceiver:i,track:s,rtpParameters:r,appData:a}){super(),this._closed=!1,this._observer=new Np.EnhancedEventEmitter,Fp.debug("constructor()"),this._id=e,this._localId=t,this._producerId=n,this._rtpReceiver=i,this._track=s,this._rtpParameters=r,this._paused=!s.enabled,this._appData=a||{},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||(Fp.debug("close()"),this._closed=!0,this.destroyTrack(),this.emit("@close"),this._observer.safeEmit("close"))}transportClosed(){this._closed||(Fp.debug("transportClosed()"),this._closed=!0,this.destroyTrack(),this.safeEmit("transportclose"),this._observer.safeEmit("close"))}async getStats(){if(this._closed)throw new Bp.InvalidStateError("closed");return new Promise(((e,t)=>{this.safeEmit("@getstats",e,t)}))}pause(){Fp.debug("pause()"),this._closed?Fp.error("pause() | Consumer closed"):this._paused?Fp.debug("pause() | Consumer is already paused"):(this._paused=!0,this._track.enabled=!1,this.emit("@pause"),this._observer.safeEmit("pause"))}resume(){Fp.debug("resume()"),this._closed?Fp.error("resume() | Consumer closed"):this._paused?(this._paused=!1,this._track.enabled=!0,this.emit("@resume"),this._observer.safeEmit("resume")):Fp.debug("resume() | Consumer is already resumed")}onTrackEnded(){Fp.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){}}}Ap.Consumer=Up;var zp={};Object.defineProperty(zp,"__esModule",{value:!0}),zp.DataProducer=void 0;const qp=Kc,$p=Xc,Vp=new Vc.Logger("DataProducer");class Hp extends qp.EnhancedEventEmitter{constructor({id:e,dataChannel:t,sctpStreamParameters:n,appData:i}){super(),this._closed=!1,this._observer=new qp.EnhancedEventEmitter,Vp.debug("constructor()"),this._id=e,this._dataChannel=t,this._sctpStreamParameters=n,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||(Vp.debug("close()"),this._closed=!0,this._dataChannel.close(),this.emit("@close"),this._observer.safeEmit("close"))}transportClosed(){this._closed||(Vp.debug("transportClosed()"),this._closed=!0,this._dataChannel.close(),this.safeEmit("transportclose"),this._observer.safeEmit("close"))}send(e){if(Vp.debug("send()"),this._closed)throw new $p.InvalidStateError("closed");this._dataChannel.send(e)}handleDataChannel(){this._dataChannel.addEventListener("open",(()=>{this._closed||(Vp.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?Vp.error("DataChannel SCTP error [sctpCauseCode:%s]: %s",t.sctpCauseCode,t.message):Vp.error('DataChannel "error" event: %o',t),this.safeEmit("error",t)})),this._dataChannel.addEventListener("close",(()=>{this._closed||(Vp.warn('DataChannel "close" event'),this._closed=!0,this.emit("@close"),this.safeEmit("close"),this._observer.safeEmit("close"))})),this._dataChannel.addEventListener("message",(()=>{this._closed||Vp.warn('DataChannel "message" event in a DataProducer, message discarded')})),this._dataChannel.addEventListener("bufferedamountlow",(()=>{this._closed||this.safeEmit("bufferedamountlow")}))}}zp.DataProducer=Hp;var Wp={};Object.defineProperty(Wp,"__esModule",{value:!0}),Wp.DataConsumer=void 0;const Gp=Kc,Kp=new Vc.Logger("DataConsumer");class Jp extends Gp.EnhancedEventEmitter{constructor({id:e,dataProducerId:t,dataChannel:n,sctpStreamParameters:i,appData:s}){super(),this._closed=!1,this._observer=new Gp.EnhancedEventEmitter,Kp.debug("constructor()"),this._id=e,this._dataProducerId=t,this._dataChannel=n,this._sctpStreamParameters=i,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||(Kp.debug("close()"),this._closed=!0,this._dataChannel.close(),this.emit("@close"),this._observer.safeEmit("close"))}transportClosed(){this._closed||(Kp.debug("transportClosed()"),this._closed=!0,this._dataChannel.close(),this.safeEmit("transportclose"),this._observer.safeEmit("close"))}handleDataChannel(){this._dataChannel.addEventListener("open",(()=>{this._closed||(Kp.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?Kp.error("DataChannel SCTP error [sctpCauseCode:%s]: %s",t.sctpCauseCode,t.message):Kp.error('DataChannel "error" event: %o',t),this.safeEmit("error",t)})),this._dataChannel.addEventListener("close",(()=>{this._closed||(Kp.warn('DataChannel "close" event'),this._closed=!0,this.emit("@close"),this.safeEmit("close"),this._observer.safeEmit("close"))})),this._dataChannel.addEventListener("message",(e=>{this._closed||this.safeEmit("message",e.data)}))}}Wp.DataConsumer=Jp;var Qp=Zt&&Zt.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),Yp=Zt&&Zt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Xp=Zt&&Zt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&Qp(t,e,n);return Yp(t,e),t};Object.defineProperty(wp,"__esModule",{value:!0}),wp.Transport=void 0;const Zp=Sp,ed=Vc,td=Kc,nd=Xc,id=Xp(tp),sd=Xp(np),rd=Dp,ad=Ap,od=zp,cd=Wp,pd=new ed.Logger("Transport");class dd{constructor(e){this.consumerOptions=e,this.promise=new Promise(((e,t)=>{this.resolve=e,this.reject=t}))}}class ld extends td.EnhancedEventEmitter{constructor({direction:e,id:t,iceParameters:n,iceCandidates:i,dtlsParameters:s,sctpParameters:r,iceServers:a,iceTransportPolicy:o,additionalSettings:c,proprietaryConstraints:p,appData:d,handlerFactory:l,extendedRtpCapabilities:u,canProduceByKind:m}){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 Zp.AwaitQueue,this._pendingConsumerTasks=[],this._consumerCreationInProgress=!1,this._pendingPauseConsumers=new Map,this._consumerPauseInProgress=!1,this._pendingResumeConsumers=new Map,this._consumerResumeInProgress=!1,this._pendingCloseConsumers=new Map,this._consumerCloseInProgress=!1,this._observer=new td.EnhancedEventEmitter,pd.debug("constructor() [id:%s, direction:%s]",t,e),this._id=t,this._direction=e,this._extendedRtpCapabilities=u,this._canProduceByKind=m,this._maxSctpMessageSize=r?r.maxMessageSize:null,delete(c=id.clone(c,{})).iceServers,delete c.iceTransportPolicy,delete c.bundlePolicy,delete c.rtcpMuxPolicy,delete c.sdpSemantics,this._handler=l(),this._handler.run({direction:e,iceParameters:n,iceCandidates:i,dtlsParameters:s,sctpParameters:r,iceServers:a,iceTransportPolicy:o,additionalSettings:c,proprietaryConstraints:p,extendedRtpCapabilities:u}),this._appData=d||{},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){pd.debug("close()"),this._closed=!0,this._awaitQueue.stop(),this._handler.close();for(const e of this._producers.values())e.transportClosed();this._producers.clear();for(const e of this._consumers.values())e.transportClosed();this._consumers.clear();for(const e of this._dataProducers.values())e.transportClosed();this._dataProducers.clear();for(const e of this._dataConsumers.values())e.transportClosed();this._dataConsumers.clear(),this._observer.safeEmit("close")}}async getStats(){if(this._closed)throw new nd.InvalidStateError("closed");return this._handler.getTransportStats()}async restartIce({iceParameters:e}){if(pd.debug("restartIce()"),this._closed)throw new nd.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(pd.debug("updateIceServers()"),this._closed)throw new nd.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:n,codec:i,stopTracks:s=!0,disableTrackOnPause:r=!0,zeroRtpOnPause:a=!1,appData:o={}}={}){if(pd.debug("produce() [track:%o]",e),this._closed)throw new nd.InvalidStateError("closed");if(!e)throw new TypeError("missing track");if("send"!==this._direction)throw new nd.UnsupportedError("not a sending Transport");if(!this._canProduceByKind[e.kind])throw new nd.UnsupportedError(`cannot produce ${e.kind}`);if("ended"===e.readyState)throw new nd.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:p,rtpParameters:d,rtpSender:l}=await this._handler.send({track:e,encodings:c,codecOptions:n,codec:i});try{sd.validateRtpParameters(d);const{id:t}=await new Promise(((t,n)=>{this.safeEmit("produce",{kind:e.kind,rtpParameters:d,appData:o},t,n)})),n=new rd.Producer({id:t,localId:p,rtpSender:l,track:e,rtpParameters:d,stopTracks:s,disableTrackOnPause:r,zeroRtpOnPause:a,appData:o});return this._producers.set(n.id,n),this.handleProducer(n),this._observer.safeEmit("newproducer",n),n}catch(e){throw this._handler.stopSending(p).catch((()=>{})),e}}),"transport.produce()").catch((t=>{if(s)try{e.stop()}catch(e){}throw t}))}async consume({id:e,producerId:t,kind:n,rtpParameters:i,streamId:s,appData:r={}}){if(pd.debug("consume()"),i=id.clone(i,void 0),this._closed)throw new nd.InvalidStateError("closed");if("recv"!==this._direction)throw new nd.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"!==n&&"video"!==n)throw new TypeError(`invalid kind '${n}'`);if(0===this.listenerCount("connect")&&"new"===this._connectionState)throw new TypeError('no "connect" listener set into this transport');if(r&&"object"!=typeof r)throw new TypeError("if given, appData must be an object");if(!sd.canReceive(i,this._extendedRtpCapabilities))throw new nd.UnsupportedError("cannot consume this Producer");const a=new dd({id:e,producerId:t,kind:n,rtpParameters:i,streamId:s,appData:r});return this._pendingConsumerTasks.push(a),!1===this._consumerCreationInProgress&&this.createPendingConsumers(),a.promise}async produceData({ordered:e=!0,maxPacketLifeTime:t,maxRetransmits:n,label:i="",protocol:s="",appData:r={}}={}){if(pd.debug("produceData()"),this._closed)throw new nd.InvalidStateError("closed");if("send"!==this._direction)throw new nd.UnsupportedError("not a sending Transport");if(!this._maxSctpMessageSize)throw new nd.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(r&&"object"!=typeof r)throw new TypeError("if given, appData must be an object");return(t||n)&&(e=!1),this._awaitQueue.push((async()=>{const{dataChannel:a,sctpStreamParameters:o}=await this._handler.sendDataChannel({ordered:e,maxPacketLifeTime:t,maxRetransmits:n,label:i,protocol:s});sd.validateSctpStreamParameters(o);const{id:c}=await new Promise(((e,t)=>{this.safeEmit("producedata",{sctpStreamParameters:o,label:i,protocol:s,appData:r},e,t)})),p=new od.DataProducer({id:c,dataChannel:a,sctpStreamParameters:o,appData:r});return this._dataProducers.set(p.id,p),this.handleDataProducer(p),this._observer.safeEmit("newdataproducer",p),p}),"transport.produceData()")}async consumeData({id:e,dataProducerId:t,sctpStreamParameters:n,label:i="",protocol:s="",appData:r={}}){if(pd.debug("consumeData()"),n=id.clone(n,void 0),this._closed)throw new nd.InvalidStateError("closed");if("recv"!==this._direction)throw new nd.UnsupportedError("not a receiving Transport");if(!this._maxSctpMessageSize)throw new nd.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(r&&"object"!=typeof r)throw new TypeError("if given, appData must be an object");return sd.validateSctpStreamParameters(n),this._awaitQueue.push((async()=>{const{dataChannel:a}=await this._handler.receiveDataChannel({sctpStreamParameters:n,label:i,protocol:s}),o=new cd.DataConsumer({id:e,dataProducerId:t,dataChannel:a,sctpStreamParameters:n,appData:r});return this._dataConsumers.set(o.id,o),this.handleDataConsumer(o),this._observer.safeEmit("newdataconsumer",o),o}),"transport.consumeData()")}async createPendingConsumers(){this._consumerCreationInProgress=!0,this._awaitQueue.push((async()=>{if(0===this._pendingConsumerTasks.length)return void pd.debug("createPendingConsumers() | there is no Consumer to be created");const e=[...this._pendingConsumerTasks];let t;this._pendingConsumerTasks=[];const n=[];for(const t of e){const{id:e,kind:i,rtpParameters:s,streamId:r}=t.consumerOptions;n.push({trackId:e,kind:i,rtpParameters:s,streamId:r})}try{const i=await this._handler.receive(n);for(let n=0;n<i.length;n++){const s=e[n],r=i[n],{id:a,producerId:o,kind:c,rtpParameters:p,appData:d}=s.consumerOptions,{localId:l,rtpReceiver:u,track:m}=r,h=new ad.Consumer({id:a,localId:l,producerId:o,rtpReceiver:u,track:m,rtpParameters:p,appData:d});this._consumers.set(h.id,h),this.handleConsumer(h),this._probatorConsumerCreated||t||"video"!==c||(t=h),this._observer.safeEmit("newconsumer",h),s.resolve(h)}}catch(t){for(const n of e)n.reject(t)}if(t)try{const e=sd.generateProbatorRtpParameters(t.rtpParameters);await this._handler.receive([{trackId:"probator",kind:"video",rtpParameters:e}]),pd.debug("createPendingConsumers() | Consumer for RTP probation created"),this._probatorConsumerCreated=!0}catch(e){pd.error("createPendingConsumers() | failed to create Consumer for RTP probation:%o",e)}}),"transport.createPendingConsumers()").then((()=>{this._consumerCreationInProgress=!1,this._pendingConsumerTasks.length>0&&this.createPendingConsumers()})).catch((()=>{}))}pausePendingConsumers(){this._consumerPauseInProgress=!0,this._awaitQueue.push((async()=>{if(0===this._pendingPauseConsumers.size)return void pd.debug("pausePendingConsumers() | there is no Consumer to be paused");const e=Array.from(this._pendingPauseConsumers.values());this._pendingPauseConsumers.clear();try{const t=e.map((e=>e.localId));await this._handler.pauseReceiving(t)}catch(e){pd.error("pausePendingConsumers() | failed to pause Consumers:",e)}}),"transport.pausePendingConsumers").then((()=>{this._consumerPauseInProgress=!1,this._pendingPauseConsumers.size>0&&this.pausePendingConsumers()})).catch((()=>{}))}resumePendingConsumers(){this._consumerResumeInProgress=!0,this._awaitQueue.push((async()=>{if(0===this._pendingResumeConsumers.size)return void pd.debug("resumePendingConsumers() | there is no Consumer to be resumed");const e=Array.from(this._pendingResumeConsumers.values());this._pendingResumeConsumers.clear();try{const t=e.map((e=>e.localId));await this._handler.resumeReceiving(t)}catch(e){pd.error("resumePendingConsumers() | failed to resume Consumers:",e)}}),"transport.resumePendingConsumers").then((()=>{this._consumerResumeInProgress=!1,this._pendingResumeConsumers.size>0&&this.resumePendingConsumers()})).catch((()=>{}))}closePendingConsumers(){this._consumerCloseInProgress=!0,this._awaitQueue.push((async()=>{if(0===this._pendingCloseConsumers.size)return void pd.debug("closePendingConsumers() | there is no Consumer to be closed");const e=Array.from(this._pendingCloseConsumers.values());this._pendingCloseConsumers.clear();try{await this._handler.stopReceiving(e.map((e=>e.localId)))}catch(e){pd.error("closePendingConsumers() | failed to close Consumers:",e)}}),"transport.closePendingConsumers").then((()=>{this._consumerCloseInProgress=!1,this._pendingCloseConsumers.size>0&&this.closePendingConsumers()})).catch((()=>{}))}handleHandler(){const e=this._handler;e.on("@connect",(({dtlsParameters:e},t,n)=>{this._closed?n(new nd.InvalidStateError("closed")):this.safeEmit("connect",{dtlsParameters:e},t,n)})),e.on("@connectionstatechange",(e=>{e!==this._connectionState&&(pd.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=>pd.warn("producer.close() failed:%o",e)))})),e.on("@pause",((t,n)=>{this._awaitQueue.push((async()=>this._handler.pauseSending(e.localId)),"producer @pause event").then(t).catch(n)})),e.on("@resume",((t,n)=>{this._awaitQueue.push((async()=>this._handler.resumeSending(e.localId)),"producer @resume event").then(t).catch(n)})),e.on("@replacetrack",((t,n,i)=>{this._awaitQueue.push((async()=>this._handler.replaceTrack(e.localId,t)),"producer @replacetrack event").then(n).catch(i)})),e.on("@setmaxspatiallayer",((t,n,i)=>{this._awaitQueue.push((async()=>this._handler.setMaxSpatialLayer(e.localId,t)),"producer @setmaxspatiallayer event").then(n).catch(i)})),e.on("@setrtpencodingparameters",((t,n,i)=>{this._awaitQueue.push((async()=>this._handler.setRtpEncodingParameters(e.localId,t)),"producer @setrtpencodingparameters event").then(n).catch(i)})),e.on("@getstats",((t,n)=>{if(this._closed)return n(new nd.InvalidStateError("closed"));this._handler.getSenderStats(e.localId).then(t).catch(n)}))}handleConsumer(e){e.on("@close",(()=>{this._consumers.delete(e.id),this._pendingPauseConsumers.delete(e.id),this._pendingResumeConsumers.delete(e.id),this._closed||(this._pendingCloseConsumers.set(e.id,e),!1===this._consumerCloseInProgress&&this.closePendingConsumers())})),e.on("@pause",(()=>{this._pendingResumeConsumers.has(e.id)&&this._pendingResumeConsumers.delete(e.id),this._pendingPauseConsumers.set(e.id,e),!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,n)=>{if(this._closed)return n(new nd.InvalidStateError("closed"));this._handler.getReceiverStats(e.localId).then(t).catch(n)}))}handleDataProducer(e){e.on("@close",(()=>{this._dataProducers.delete(e.id)}))}handleDataConsumer(e){e.on("@close",(()=>{this._dataConsumers.delete(e.id)}))}}wp.Transport=ld;var ud={},md={},hd={},fd={},gd={get exports(){return fd},set exports(e){fd=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(gd).forEach((function(e){gd[e].forEach((function(e){e.reg||(e.reg=/(.*)/),e.format||(e.format="%s")}))})),function(e){var t=function(e){return String(Number(e))===e?Number(e):e},n=function(e,n,i){var s=e.name&&e.names;e.push&&!n[e.push]?n[e.push]=[]:s&&!n[e.name]&&(n[e.name]={});var r=e.push?{}:s?n[e.name]:n;!function(e,n,i,s){if(s&&!i)n[s]=t(e[1]);else for(var r=0;r<i.length;r+=1)null!=e[r+1]&&(n[i[r]]=t(e[r+1]))}(i.match(e.reg),r,e.names,e.name),e.push&&n[e.push].push(r)},i=fd,s=RegExp.prototype.test.bind(/^([a-z])=(.*)/);e.parse=function(e){var t={},r=[],a=t;return e.split(/(\r\n|\r|\n)/).filter(s).forEach((function(e){var t=e[0],s=e.slice(2);"m"===t&&(r.push({rtp:[],fmtp:[]}),a=r[r.length-1]);for(var o=0;o<(i[t]||[]).length;o+=1){var c=i[t][o];if(c.reg.test(s))return n(c,a,s)}})),t.media=r,t};var r=function(e,n){var i=n.split(/=(.+)/,2);return 2===i.length?e[i[0]]=t(i[1]):1===i.length&&n.length>1&&(e[i[0]]=void 0),e};e.parseParams=function(e){return e.split(/;\s?/).reduce(r,{})},e.parseFmtpConfig=e.parseParams,e.parsePayloads=function(e){return e.toString().split(" ").map(Number)},e.parseRemoteCandidates=function(e){for(var n=[],i=e.split(" ").map(t),s=0;s<i.length;s+=3)n.push({component:i[s],ip:i[s+1],port:i[s+2]});return n},e.parseImageAttributes=function(e){return e.split(" ").map((function(e){return e.substring(1,e.length-1).split(",").reduce(r,{})}))},e.parseSimulcastStreamList=function(e){return e.split(";").map((function(e){return e.split(",").map((function(e){var n,i=!1;return"~"!==e[0]?n=t(e):(n=t(e.substring(1,e.length)),i=!0),{scid:n,paused:i}}))}))}}(hd);var vd=fd,bd=/%[sdv%]/g,yd=function(e){var t=1,n=arguments,i=n.length;return e.replace(bd,(function(e){if(t>=i)return e;var s=n[t];switch(t+=1,e){case"%%":return"%";case"%s":return String(s);case"%d":return Number(s);case"%v":return""}}))},_d=function(e,t,n){var i=[e+"="+(t.format instanceof Function?t.format(t.push?n:n[t.name]):t.format)];if(t.names)for(var s=0;s<t.names.length;s+=1){var r=t.names[s];t.name?i.push(n[t.name][r]):i.push(n[t.names[s]])}else i.push(n[t.name]);return yd.apply(null,i)},xd=["v","o","s","i","u","e","p","c","b","t","r","z","a"],wd=["i","c","b","a"],Sd=hd,kd=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||xd,i=t.innerOrder||wd,s=[];return n.forEach((function(t){vd[t].forEach((function(n){n.name in e&&null!=e[n.name]?s.push(_d(t,n,e)):n.push in e&&null!=e[n.push]&&e[n.push].forEach((function(e){s.push(_d(t,n,e))}))}))})),e.media.forEach((function(e){s.push(_d("m",vd.m[0],e)),i.forEach((function(t){vd[t].forEach((function(n){n.name in e&&null!=e[n.name]?s.push(_d(t,n,e)):n.push in e&&null!=e[n.push]&&e[n.push].forEach((function(e){s.push(_d(t,n,e))}))}))}))})),s.join("\r\n")+"\r\n"};md.write=kd,md.parse=Sd.parse,md.parseParams=Sd.parseParams,md.parseFmtpConfig=Sd.parseFmtpConfig,md.parsePayloads=Sd.parsePayloads,md.parseRemoteCandidates=Sd.parseRemoteCandidates,md.parseImageAttributes=Sd.parseImageAttributes,md.parseSimulcastStreamList=Sd.parseSimulcastStreamList;var Cd={},Rd=Zt&&Zt.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),Td=Zt&&Zt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Pd=Zt&&Zt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&Rd(t,e,n);return Td(t,e),t};Object.defineProperty(Cd,"__esModule",{value:!0}),Cd.applyCodecParameters=Cd.getCname=Cd.extractDtlsParameters=Cd.extractRtpCapabilities=void 0;const Ed=Pd(md);Cd.extractRtpCapabilities=function({sdpObject:e}){const t=new Map,n=[];let i=!1,s=!1;for(const r of e.media){const e=r.type;switch(e){case"audio":if(i)continue;i=!0;break;case"video":if(s)continue;s=!0;break;default:continue}for(const n of r.rtp){const i={kind:e,mimeType:`${e}/${n.codec}`,preferredPayloadType:n.payload,clockRate:n.rate,channels:n.encoding,parameters:{},rtcpFeedback:[]};t.set(i.preferredPayloadType,i)}for(const e of r.fmtp||[]){const n=Ed.parseParams(e.config),i=t.get(e.payload);i&&(n&&n.hasOwnProperty("profile-level-id")&&(n["profile-level-id"]=String(n["profile-level-id"])),i.parameters=n)}for(const n of r.rtcpFb||[]){const i={type:n.type,parameter:n.subtype};if(i.parameter||delete i.parameter,"*"!==n.payload){const e=t.get(n.payload);if(!e)continue;e.rtcpFeedback.push(i)}else for(const n of t.values())n.kind!==e||/.+\/rtx$/i.test(n.mimeType)||n.rtcpFeedback.push(i)}for(const t of r.ext||[]){if(t["encrypt-uri"])continue;const i={kind:e,uri:t.uri,preferredId:t.value};n.push(i)}}return{codecs:Array.from(t.values()),headerExtensions:n}},Cd.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 n=t.fingerprint||e.fingerprint;let i;switch(t.setup){case"active":i="client";break;case"passive":i="server";break;case"actpass":i="auto"}return{role:i,fingerprints:[{algorithm:n.type,value:n.hash}]}},Cd.getCname=function({offerMediaObject:e}){const t=(e.ssrcs||[]).find((e=>"cname"===e.attribute));return t?t.value:""},Cd.applyCodecParameters=function({offerRtpParameters:e,answerMediaObject:t}){for(const n of e.codecs){const e=n.mimeType.toLowerCase();if("audio/opus"!==e)continue;if(!(t.rtp||[]).find((e=>e.payload===n.payloadType)))continue;t.fmtp=t.fmtp||[];let i=t.fmtp.find((e=>e.payload===n.payloadType));i||(i={payload:n.payloadType,config:""},t.fmtp.push(i));const s=Ed.parseParams(i.config);switch(e){case"audio/opus":{const e=n.parameters["sprop-stereo"];void 0!==e&&(s.stereo=e?1:0);break}}i.config="";for(const e of Object.keys(s))i.config&&(i.config+=";"),i.config+=`${e}=${s[e]}`}};var Od={};Object.defineProperty(Od,"__esModule",{value:!0}),Od.addLegacySimulcast=Od.getRtpEncodings=void 0,Od.getRtpEncodings=function({offerMediaObject:e}){const t=new Set;for(const n of e.ssrcs||[]){const e=n.id;t.add(e)}if(0===t.size)throw new Error("no a=ssrc lines found");const n=new Map;for(const i of e.ssrcGroups||[]){if("FID"!==i.semantics)continue;let[e,s]=i.ssrcs.split(/\s+/);e=Number(e),s=Number(s),t.has(e)&&(t.delete(e),t.delete(s),n.set(e,s))}for(const e of t)n.set(e,null);const i=[];for(const[e,t]of n){const n={ssrc:e};t&&(n.rtx={ssrc:t}),i.push(n)}return i},Od.addLegacySimulcast=function({offerMediaObject:e,numStreams:t}){if(t<=1)throw new TypeError("numStreams must be greater than 1");const n=(e.ssrcs||[]).find((e=>"msid"===e.attribute));if(!n)throw new Error("a=ssrc line with msid information not found");const[i,s]=n.value.split(" "),r=n.id;let a;(e.ssrcGroups||[]).some((e=>{if("FID"!==e.semantics)return!1;const t=e.ssrcs.split(/\s+/);return Number(t[0])===r&&(a=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,p=[],d=[];for(let e=0;e<t;++e)p.push(r+e),a&&d.push(a+e);e.ssrcGroups=[],e.ssrcs=[],e.ssrcGroups.push({semantics:"SIM",ssrcs:p.join(" ")});for(let t=0;t<p.length;++t){const n=p[t];e.ssrcs.push({id:n,attribute:"cname",value:c}),e.ssrcs.push({id:n,attribute:"msid",value:`${i} ${s}`})}for(let t=0;t<d.length;++t){const n=p[t],r=d[t];e.ssrcs.push({id:r,attribute:"cname",value:c}),e.ssrcs.push({id:r,attribute:"msid",value:`${i} ${s}`}),e.ssrcGroups.push({semantics:"FID",ssrcs:`${n} ${r}`})}};var Dd={};Object.defineProperty(Dd,"__esModule",{value:!0}),Dd.HandlerInterface=void 0;const jd=Kc;class Id extends jd.EnhancedEventEmitter{constructor(){super()}}Dd.HandlerInterface=Id;var Md={},Ld={},Ad=Zt&&Zt.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),Nd=Zt&&Zt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Bd=Zt&&Zt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&Ad(t,e,n);return Nd(t,e),t};Object.defineProperty(Ld,"__esModule",{value:!0}),Ld.OfferMediaSection=Ld.AnswerMediaSection=Ld.MediaSection=void 0;const Fd=Bd(tp);class Ud{constructor({iceParameters:e,iceCandidates:t,dtlsParameters:n,planB:i=!1}){if(this._mediaObject={},this._planB=i,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"}n&&this.setDtlsRole(n.role)}get mid(){return String(this._mediaObject.mid)}get closed(){return 0===this._mediaObject.port}getObject(){return this._mediaObject}setIceParameters(e){this._mediaObject.iceUfrag=e.usernameFragment,this._mediaObject.icePwd=e.password}pause(){this._mediaObject.direction="inactive"}disable(){this.pause(),delete this._mediaObject.ext,delete this._mediaObject.ssrcs,delete this._mediaObject.ssrcGroups,delete this._mediaObject.simulcast,delete this._mediaObject.simulcast_03,delete this._mediaObject.rids,delete this._mediaObject.extmapAllowMixed}close(){this.disable(),this._mediaObject.port=0}}Ld.MediaSection=Ud;Ld.AnswerMediaSection=class extends Ud{constructor({iceParameters:e,iceCandidates:t,dtlsParameters:n,sctpParameters:i,plainRtpParameters:s,planB:r=!1,offerMediaObject:a,offerRtpParameters:o,answerRtpParameters:c,codecOptions:p,extmapAllowMixed:d=!1}){switch(super({iceParameters:e,iceCandidates:t,dtlsParameters:n,planB:r}),this._mediaObject.mid=String(a.mid),this._mediaObject.type=a.type,this._mediaObject.protocol=a.protocol,s?(this._mediaObject.connection={ip:s.ip,version:s.ipVersion},this._mediaObject.port=s.port):(this._mediaObject.connection={ip:"127.0.0.1",version:4},this._mediaObject.port=7),a.type){case"audio":case"video":this._mediaObject.direction="recvonly",this._mediaObject.rtp=[],this._mediaObject.rtcpFb=[],this._mediaObject.fmtp=[];for(const e of c.codecs){const t={payload:e.payloadType,codec:zd(e),rate:e.clockRate};e.channels>1&&(t.encoding=e.channels),this._mediaObject.rtp.push(t);const n=Fd.clone(e.parameters,{});if(p){const{opusStereo:t,opusFec:i,opusDtx:s,opusMaxPlaybackRate:r,opusMaxAverageBitrate:a,opusPtime:c,videoGoogleStartBitrate:d,videoGoogleMaxBitrate:l,videoGoogleMinBitrate:u}=p,m=o.codecs.find((t=>t.payloadType===e.payloadType));switch(e.mimeType.toLowerCase()){case"audio/opus":void 0!==t&&(m.parameters["sprop-stereo"]=t?1:0,n.stereo=t?1:0),void 0!==i&&(m.parameters.useinbandfec=i?1:0,n.useinbandfec=i?1:0),void 0!==s&&(m.parameters.usedtx=s?1:0,n.usedtx=s?1:0),void 0!==r&&(n.maxplaybackrate=r),void 0!==a&&(n.maxaveragebitrate=a),void 0!==c&&(m.parameters.ptime=c,n.ptime=c);break;case"video/vp8":case"video/vp9":case"video/h264":case"video/h265":void 0!==d&&(n["x-google-start-bitrate"]=d),void 0!==l&&(n["x-google-max-bitrate"]=l),void 0!==u&&(n["x-google-min-bitrate"]=u)}}const i={payload:e.payloadType,config:""};for(const e of Object.keys(n))i.config&&(i.config+=";"),i.config+=`${e}=${n[e]}`;i.config&&this._mediaObject.fmtp.push(i);for(const t of e.rtcpFeedback)this._mediaObject.rtcpFb.push({payload:e.payloadType,type:t.type,subtype:t.parameter})}this._mediaObject.payloads=c.codecs.map((e=>e.payloadType)).join(" "),this._mediaObject.ext=[];for(const e of c.headerExtensions){(a.ext||[]).some((t=>t.uri===e.uri))&&this._mediaObject.ext.push({uri:e.uri,value:e.id})}if(d&&"extmap-allow-mixed"===a.extmapAllowMixed&&(this._mediaObject.extmapAllowMixed="extmap-allow-mixed"),a.simulcast){this._mediaObject.simulcast={dir1:"recv",list1:a.simulcast.list1},this._mediaObject.rids=[];for(const e of a.rids||[])"send"===e.direction&&this._mediaObject.rids.push({id:e.id,direction:"recv"})}else if(a.simulcast_03){this._mediaObject.simulcast_03={value:a.simulcast_03.value.replace(/send/g,"recv")},this._mediaObject.rids=[];for(const e of a.rids||[])"send"===e.direction&&this._mediaObject.rids.push({id:e.id,direction:"recv"})}this._mediaObject.rtcpMux="rtcp-mux",this._mediaObject.rtcpRsize="rtcp-rsize",this._planB&&"video"===this._mediaObject.type&&(this._mediaObject.xGoogleFlag="conference");break;case"application":"number"==typeof a.sctpPort?(this._mediaObject.payloads="webrtc-datachannel",this._mediaObject.sctpPort=i.port,this._mediaObject.maxMessageSize=i.maxMessageSize):a.sctpmap&&(this._mediaObject.payloads=i.port,this._mediaObject.sctpmap={app:"webrtc-datachannel",sctpmapNumber:i.port,maxMessageSize:i.maxMessageSize})}}setDtlsRole(e){switch(e){case"client":this._mediaObject.setup="active";break;case"server":this._mediaObject.setup="passive";break;case"auto":this._mediaObject.setup="actpass"}}resume(){this._mediaObject.direction="recvonly"}};function zd(e){const t=new RegExp("^(audio|video)/(.+)","i").exec(e.mimeType);if(!t)throw new TypeError("invalid codec.mimeType");return t[2]}Ld.OfferMediaSection=class extends Ud{constructor({iceParameters:e,iceCandidates:t,dtlsParameters:n,sctpParameters:i,plainRtpParameters:s,planB:r=!1,mid:a,kind:o,offerRtpParameters:c,streamId:p,trackId:d,oldDataChannelSpec:l=!1}){switch(super({iceParameters:e,iceCandidates:t,dtlsParameters:n,planB:r}),this._mediaObject.mid=String(a),this._mediaObject.type=o,s?(this._mediaObject.connection={ip:s.ip,version:s.ipVersion},this._mediaObject.protocol="RTP/AVP",this._mediaObject.port=s.port):(this._mediaObject.connection={ip:"127.0.0.1",version:4},this._mediaObject.protocol=i?"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=`${p||"-"} ${d}`);for(const e of c.codecs){const t={payload:e.payloadType,codec:zd(e),rate:e.clockRate};e.channels>1&&(t.encoding=e.channels),this._mediaObject.rtp.push(t);const n={payload:e.payloadType,config:""};for(const t of Object.keys(e.parameters))n.config&&(n.config+=";"),n.config+=`${t}=${e.parameters[t]}`;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=c.codecs.map((e=>e.payloadType)).join(" "),this._mediaObject.ext=[];for(const e of c.headerExtensions)this._mediaObject.ext.push({uri:e.uri,value:e.id});this._mediaObject.rtcpMux="rtcp-mux",this._mediaObject.rtcpRsize="rtcp-rsize";const e=c.encodings[0],t=e.ssrc,n=e.rtx&&e.rtx.ssrc?e.rtx.ssrc:void 0;this._mediaObject.ssrcs=[],this._mediaObject.ssrcGroups=[],c.rtcp.cname&&this._mediaObject.ssrcs.push({id:t,attribute:"cname",value:c.rtcp.cname}),this._planB&&this._mediaObject.ssrcs.push({id:t,attribute:"msid",value:`${p||"-"} ${d}`}),n&&(c.rtcp.cname&&this._mediaObject.ssrcs.push({id:n,attribute:"cname",value:c.rtcp.cname}),this._planB&&this._mediaObject.ssrcs.push({id:n,attribute:"msid",value:`${p||"-"} ${d}`}),this._mediaObject.ssrcGroups.push({semantics:"FID",ssrcs:`${t} ${n}`}));break}case"application":l?(this._mediaObject.payloads=i.port,this._mediaObject.sctpmap={app:"webrtc-datachannel",sctpmapNumber:i.port,maxMessageSize:i.maxMessageSize}):(this._mediaObject.payloads="webrtc-datachannel",this._mediaObject.sctpPort=i.port,this._mediaObject.maxMessageSize=i.maxMessageSize)}}setDtlsRole(e){this._mediaObject.setup="actpass"}resume(){this._mediaObject.direction="sendonly"}planBReceive({offerRtpParameters:e,streamId:t,trackId:n}){const i=e.encodings[0],s=i.ssrc,r=i.rtx&&i.rtx.ssrc?i.rtx.ssrc:void 0,a=this._mediaObject.payloads.split(" ");for(const t of e.codecs){if(a.includes(String(t.payloadType)))continue;const e={payload:t.payloadType,codec:zd(t),rate:t.clockRate};t.channels>1&&(e.encoding=t.channels),this._mediaObject.rtp.push(e);const n={payload:t.payloadType,config:""};for(const e of Object.keys(t.parameters))n.config&&(n.config+=";"),n.config+=`${e}=${t.parameters[e]}`;n.config&&this._mediaObject.fmtp.push(n);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:s,attribute:"cname",value:e.rtcp.cname}),this._mediaObject.ssrcs.push({id:s,attribute:"msid",value:`${t||"-"} ${n}`}),r&&(e.rtcp.cname&&this._mediaObject.ssrcs.push({id:r,attribute:"cname",value:e.rtcp.cname}),this._mediaObject.ssrcs.push({id:r,attribute:"msid",value:`${t||"-"} ${n}`}),this._mediaObject.ssrcGroups.push({semantics:"FID",ssrcs:`${s} ${r}`}))}planBStopReceiving({offerRtpParameters:e}){const t=e.encodings[0],n=t.ssrc,i=t.rtx&&t.rtx.ssrc?t.rtx.ssrc:void 0;this._mediaObject.ssrcs=this._mediaObject.ssrcs.filter((e=>e.id!==n&&e.id!==i)),i&&(this._mediaObject.ssrcGroups=this._mediaObject.ssrcGroups.filter((e=>e.ssrcs!==`${n} ${i}`)))}};var qd=Zt&&Zt.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),$d=Zt&&Zt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Vd=Zt&&Zt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&qd(t,e,n);return $d(t,e),t};Object.defineProperty(Md,"__esModule",{value:!0}),Md.RemoteSdp=void 0;const Hd=Vd(md),Wd=Ld,Gd=new Vc.Logger("RemoteSdp");Md.RemoteSdp=class{constructor({iceParameters:e,iceCandidates:t,dtlsParameters:n,sctpParameters:i,plainRtpParameters:s,planB:r=!1}){if(this._mediaSections=[],this._midToIndex=new Map,this._iceParameters=e,this._iceCandidates=t,this._dtlsParameters=n,this._sctpParameters=i,this._plainRtpParameters=s,this._planB=r,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"),n){this._sdpObject.msidSemantic={semantic:"WMS",token:"*"};const e=this._dtlsParameters.fingerprints.length;this._sdpObject.fingerprint={type:n.fingerprints[e-1].algorithm,hash:n.fingerprints[e-1].value},this._sdpObject.groups=[{type:"BUNDLE",mids:""}]}s&&(this._sdpObject.origin.address=s.ip,this._sdpObject.origin.ipVer=s.ipVersion)}updateIceParameters(e){Gd.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){Gd.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:n,answerRtpParameters:i,codecOptions:s,extmapAllowMixed:r=!1}){const a=new Wd.AnswerMediaSection({iceParameters:this._iceParameters,iceCandidates:this._iceCandidates,dtlsParameters:this._dtlsParameters,plainRtpParameters:this._plainRtpParameters,planB:this._planB,offerMediaObject:e,offerRtpParameters:n,answerRtpParameters:i,codecOptions:s,extmapAllowMixed:r});t?this._replaceMediaSection(a,t):this._midToIndex.has(a.mid)?this._replaceMediaSection(a):this._addMediaSection(a)}receive({mid:e,kind:t,offerRtpParameters:n,streamId:i,trackId:s}){const r=this._midToIndex.get(e);let a;if(void 0!==r&&(a=this._mediaSections[r]),a)a.planBReceive({offerRtpParameters:n,streamId:i,trackId:s}),this._replaceMediaSection(a);else{a=new Wd.OfferMediaSection({iceParameters:this._iceParameters,iceCandidates:this._iceCandidates,dtlsParameters:this._dtlsParameters,plainRtpParameters:this._plainRtpParameters,planB:this._planB,mid:e,kind:t,offerRtpParameters:n,streamId:i,trackId:s});const r=this._mediaSections.find((e=>e.closed));r?this._replaceMediaSection(a,r.mid):this._addMediaSection(a)}}pauseMediaSection(e){this._findMediaSection(e).pause()}resumeSendingMediaSection(e){this._findMediaSection(e).resume()}resumeReceivingMediaSection(e){this._findMediaSection(e).resume()}disableMediaSection(e){this._findMediaSection(e).disable()}closeMediaSection(e){const t=this._findMediaSection(e);return e===this._firstMid?(Gd.debug("closeMediaSection() | cannot close first media section, disabling it instead [mid:%s]",e),this.disableMediaSection(e),!1):(t.close(),this._regenerateBundleMids(),!0)}planBStopReceiving({mid:e,offerRtpParameters:t}){const n=this._midToIndex.get(e);if(void 0===n)throw new Error(`no media section found with mid '${e}'`);const i=this._mediaSections[n];i.planBStopReceiving({offerRtpParameters:t}),this._replaceMediaSection(i)}sendSctpAssociation({offerMediaObject:e}){const t=new Wd.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 Wd.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++,Hd.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 n=this._midToIndex.get(t);if(void 0===n)throw new Error(`no media section found for reuseMid '${t}'`);const i=this._mediaSections[n];this._mediaSections[n]=e,this._midToIndex.delete(i.mid),this._midToIndex.set(e.mid,n),this._sdpObject.media[n]=e.getObject(),this._regenerateBundleMids()}else{const t=this._midToIndex.get(e.mid);if(void 0===t)throw new Error(`no media section found with mid '${e.mid}'`);this._mediaSections[t]=e,this._sdpObject.media[t]=e.getObject()}}_findMediaSection(e){const t=this._midToIndex.get(e);if(void 0===t)throw new Error(`no media section found with mid '${e}'`);return this._mediaSections[t]}_regenerateBundleMids(){this._dtlsParameters&&(this._sdpObject.groups[0].mids=this._mediaSections.filter((e=>!e.closed)).map((e=>e.mid)).join(" "))}};var Kd={};Object.defineProperty(Kd,"__esModule",{value:!0}),Kd.parse=void 0;const Jd=new RegExp("^[LS]([1-9]\\d{0,1})T([1-9]\\d{0,1})");Kd.parse=function(e){const t=Jd.exec(e||"");return t?{spatialLayers:Number(t[1]),temporalLayers:Number(t[2])}:{spatialLayers:1,temporalLayers:1}};var Qd=Zt&&Zt.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),Yd=Zt&&Zt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Xd=Zt&&Zt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&Qd(t,e,n);return Yd(t,e),t};Object.defineProperty(ud,"__esModule",{value:!0}),ud.Chrome74=void 0;const Zd=Xd(md),el=Vc,tl=Xd(tp),nl=Xd(np),il=Xd(Cd),sl=Xd(Od),rl=Dd,al=Md,ol=Kd,cl=new el.Logger("Chrome74"),pl={OS:1024,MIS:1024};class dl extends rl.HandlerInterface{static createFactory(){return()=>new dl}constructor(){super(),this._mapMidTransceiver=new Map,this._sendStream=new MediaStream,this._hasDataChannelMediaSection=!1,this._nextSendSctpStreamId=0,this._transportReady=!1}get name(){return"Chrome74"}close(){if(cl.debug("close()"),this._pc)try{this._pc.close()}catch(e){}this.emit("@close")}async getNativeRtpCapabilities(){cl.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 n=Zd.parse(t.sdp);return il.extractRtpCapabilities({sdpObject:n})}catch(t){try{e.close()}catch(e){}throw t}}async getNativeSctpCapabilities(){return cl.debug("getNativeSctpCapabilities()"),{numStreams:pl}}run({direction:e,iceParameters:t,iceCandidates:n,dtlsParameters:i,sctpParameters:s,iceServers:r,iceTransportPolicy:a,additionalSettings:o,proprietaryConstraints:c,extendedRtpCapabilities:p}){cl.debug("run()"),this._direction=e,this._remoteSdp=new al.RemoteSdp({iceParameters:t,iceCandidates:n,dtlsParameters:i,sctpParameters:s}),this._sendingRtpParametersByKind={audio:nl.getSendingRtpParameters("audio",p),video:nl.getSendingRtpParameters("video",p)},this._sendingRemoteRtpParametersByKind={audio:nl.getSendingRemoteRtpParameters("audio",p),video:nl.getSendingRemoteRtpParameters("video",p)},i.role&&"auto"!==i.role&&(this._forcedLocalDtlsRole="server"===i.role?"client":"server"),this._pc=new RTCPeerConnection({iceServers:r||[],iceTransportPolicy:a||"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require",sdpSemantics:"unified-plan",...o},c),this._pc.connectionState?this._pc.addEventListener("connectionstatechange",(()=>{this.emit("@connectionstatechange",this._pc.connectionState)})):(cl.warn("run() | pc.connectionState not supported, using pc.iceConnectionState"),this._pc.addEventListener("iceconnectionstatechange",(()=>{switch(this._pc.iceConnectionState){case"checking":this.emit("@connectionstatechange","connecting");break;case"connected":case"completed":this.emit("@connectionstatechange","connected");break;case"failed":this.emit("@connectionstatechange","failed");break;case"disconnected":this.emit("@connectionstatechange","disconnected");break;case"closed":this.emit("@connectionstatechange","closed")}})))}async updateIceServers(e){cl.debug("updateIceServers()");const t=this._pc.getConfiguration();t.iceServers=e,this._pc.setConfiguration(t)}async restartIce(e){if(cl.debug("restartIce()"),this._remoteSdp.updateIceParameters(e),this._transportReady)if("send"===this._direction){const e=await this._pc.createOffer({iceRestart:!0});cl.debug("restartIce() | calling pc.setLocalDescription() [offer:%o]",e),await this._pc.setLocalDescription(e);const t={type:"answer",sdp:this._remoteSdp.getSdp()};cl.debug("restartIce() | calling pc.setRemoteDescription() [answer:%o]",t),await this._pc.setRemoteDescription(t)}else{const e={type:"offer",sdp:this._remoteSdp.getSdp()};cl.debug("restartIce() | calling pc.setRemoteDescription() [offer:%o]",e),await this._pc.setRemoteDescription(e);const t=await this._pc.createAnswer();cl.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:n,codec:i}){var s;this.assertSendDirection(),cl.debug("send() [kind:%s, track.id:%s]",e.kind,e.id),t&&t.length>1&&t.forEach(((e,t)=>{e.rid=`r${t}`}));const r=tl.clone(this._sendingRtpParametersByKind[e.kind],{});r.codecs=nl.reduceCodecs(r.codecs,i);const a=tl.clone(this._sendingRemoteRtpParametersByKind[e.kind],{});a.codecs=nl.reduceCodecs(a.codecs,i);const o=this._remoteSdp.getNextMediaSectionIdx(),c=this._pc.addTransceiver(e,{direction:"sendonly",streams:[this._sendStream],sendEncodings:t});let p,d=await this._pc.createOffer(),l=Zd.parse(d.sdp);this._transportReady||await this.setupTransport({localDtlsRole:null!==(s=this._forcedLocalDtlsRole)&&void 0!==s?s:"client",localSdpObject:l});let u=!1;const m=(0,ol.parse)((t||[{}])[0].scalabilityMode);t&&1===t.length&&m.spatialLayers>1&&"video/vp9"===r.codecs[0].mimeType.toLowerCase()&&(cl.debug("send() | enabling legacy simulcast for VP9 SVC"),u=!0,l=Zd.parse(d.sdp),p=l.media[o.idx],sl.addLegacySimulcast({offerMediaObject:p,numStreams:m.spatialLayers}),d={type:"offer",sdp:Zd.write(l)}),cl.debug("send() | calling pc.setLocalDescription() [offer:%o]",d),await this._pc.setLocalDescription(d);const h=c.mid;if(r.mid=h,l=Zd.parse(this._pc.localDescription.sdp),p=l.media[o.idx],r.rtcp.cname=il.getCname({offerMediaObject:p}),t)if(1===t.length){let e=sl.getRtpEncodings({offerMediaObject:p});Object.assign(e[0],t[0]),u&&(e=[e[0]]),r.encodings=e}else r.encodings=t;else r.encodings=sl.getRtpEncodings({offerMediaObject:p});if(r.encodings.length>1&&("video/vp8"===r.codecs[0].mimeType.toLowerCase()||"video/h264"===r.codecs[0].mimeType.toLowerCase()))for(const e of r.encodings)e.scalabilityMode="S1T2";this._remoteSdp.send({offerMediaObject:p,reuseMid:o.reuseMid,offerRtpParameters:r,answerRtpParameters:a,codecOptions:n,extmapAllowMixed:!0});const f={type:"answer",sdp:this._remoteSdp.getSdp()};return cl.debug("send() | calling pc.setRemoteDescription() [answer:%o]",f),await this._pc.setRemoteDescription(f),this._mapMidTransceiver.set(h,c),{localId:h,rtpParameters:r,rtpSender:c.sender}}async stopSending(e){this.assertSendDirection(),cl.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);if(this._remoteSdp.closeMediaSection(t.mid))try{t.stop()}catch(e){}const n=await this._pc.createOffer();cl.debug("stopSending() | calling pc.setLocalDescription() [offer:%o]",n),await this._pc.setLocalDescription(n);const i={type:"answer",sdp:this._remoteSdp.getSdp()};cl.debug("stopSending() | calling pc.setRemoteDescription() [answer:%o]",i),await this._pc.setRemoteDescription(i),this._mapMidTransceiver.delete(e)}async pauseSending(e){this.assertSendDirection(),cl.debug("pauseSending() [localId:%s]",e);const t=this._mapMidTransceiver.get(e);if(!t)throw new Error("associated RTCRtpTransceiver not found");t.direction="inactive",this._remoteSdp.pauseMediaSection(e);const n=await this._pc.createOffer();cl.debug("pauseSending() | calling pc.setLocalDescription() [offer:%o]",n),await this._pc.setLocalDescription(n);const i={type:"answer",sdp:this._remoteSdp.getSdp()};cl.debug("pauseSending() | calling pc.setRemoteDescription() [answer:%o]",i),await this._pc.setRemoteDescription(i)}async resumeSending(e){this.assertSendDirection(),cl.debug("resumeSending() [localId:%s]",e);const t=this._mapMidTransceiver.get(e);if(this._remoteSdp.resumeSendingMediaSection(e),!t)throw new Error("associated RTCRtpTransceiver not found");t.direction="sendonly";const n=await this._pc.createOffer();cl.debug("resumeSending() | calling pc.setLocalDescription() [offer:%o]",n),await this._pc.setLocalDescription(n);const i={type:"answer",sdp:this._remoteSdp.getSdp()};cl.debug("resumeSending() | calling pc.setRemoteDescription() [answer:%o]",i),await this._pc.setRemoteDescription(i)}async replaceTrack(e,t){this.assertSendDirection(),t?cl.debug("replaceTrack() [localId:%s, track.id:%s]",e,t.id):cl.debug("replaceTrack() [localId:%s, no track]",e);const n=this._mapMidTransceiver.get(e);if(!n)throw new Error("associated RTCRtpTransceiver not found");await n.sender.replaceTrack(t)}async setMaxSpatialLayer(e,t){this.assertSendDirection(),cl.debug("setMaxSpatialLayer() [localId:%s, spatialLayer:%s]",e,t);const n=this._mapMidTransceiver.get(e);if(!n)throw new Error("associated RTCRtpTransceiver not found");const i=n.sender.getParameters();i.encodings.forEach(((e,n)=>{e.active=n<=t})),await n.sender.setParameters(i)}async setRtpEncodingParameters(e,t){this.assertSendDirection(),cl.debug("setRtpEncodingParameters() [localId:%s, params:%o]",e,t);const n=this._mapMidTransceiver.get(e);if(!n)throw new Error("associated RTCRtpTransceiver not found");const i=n.sender.getParameters();i.encodings.forEach(((e,n)=>{i.encodings[n]={...e,...t}})),await n.sender.setParameters(i)}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:n,label:i,protocol:s}){var r;this.assertSendDirection();const a={negotiated:!0,id:this._nextSendSctpStreamId,ordered:e,maxPacketLifeTime:t,maxRetransmits:n,protocol:s};cl.debug("sendDataChannel() [options:%o]",a);const o=this._pc.createDataChannel(i,a);if(this._nextSendSctpStreamId=++this._nextSendSctpStreamId%pl.MIS,!this._hasDataChannelMediaSection){const e=await this._pc.createOffer(),t=Zd.parse(e.sdp),n=t.media.find((e=>"application"===e.type));this._transportReady||await this.setupTransport({localDtlsRole:null!==(r=this._forcedLocalDtlsRole)&&void 0!==r?r:"client",localSdpObject:t}),cl.debug("sendDataChannel() | calling pc.setLocalDescription() [offer:%o]",e),await this._pc.setLocalDescription(e),this._remoteSdp.sendSctpAssociation({offerMediaObject:n});const i={type:"answer",sdp:this._remoteSdp.getSdp()};cl.debug("sendDataChannel() | calling pc.setRemoteDescription() [answer:%o]",i),await this._pc.setRemoteDescription(i),this._hasDataChannelMediaSection=!0}return{dataChannel:o,sctpStreamParameters:{streamId:a.id,ordered:a.ordered,maxPacketLifeTime:a.maxPacketLifeTime,maxRetransmits:a.maxRetransmits}}}async receive(e){var t;this.assertRecvDirection();const n=[],i=new Map;for(const t of e){const{trackId:e,kind:n,rtpParameters:s,streamId:r}=t;cl.debug("receive() [trackId:%s, kind:%s]",e,n);const a=s.mid||String(this._mapMidTransceiver.size);i.set(e,a),this._remoteSdp.receive({mid:a,kind:n,offerRtpParameters:s,streamId:r||s.rtcp.cname,trackId:e})}const s={type:"offer",sdp:this._remoteSdp.getSdp()};cl.debug("receive() | calling pc.setRemoteDescription() [offer:%o]",s),await this._pc.setRemoteDescription(s);let r=await this._pc.createAnswer();const a=Zd.parse(r.sdp);for(const t of e){const{trackId:e,rtpParameters:n}=t,s=i.get(e),r=a.media.find((e=>String(e.mid)===s));il.applyCodecParameters({offerRtpParameters:n,answerMediaObject:r})}r={type:"answer",sdp:Zd.write(a)},this._transportReady||await this.setupTransport({localDtlsRole:null!==(t=this._forcedLocalDtlsRole)&&void 0!==t?t:"client",localSdpObject:a}),cl.debug("receive() | calling pc.setLocalDescription() [answer:%o]",r),await this._pc.setLocalDescription(r);for(const t of e){const{trackId:e}=t,s=i.get(e),r=this._pc.getTransceivers().find((e=>e.mid===s));if(!r)throw new Error("new RTCRtpTransceiver not found");this._mapMidTransceiver.set(s,r),n.push({localId:s,track:r.receiver.track,rtpReceiver:r.receiver})}return n}async stopReceiving(e){this.assertRecvDirection();for(const t of e){cl.debug("stopReceiving() [localId:%s]",t);const e=this._mapMidTransceiver.get(t);if(!e)throw new Error("associated RTCRtpTransceiver not found");this._remoteSdp.closeMediaSection(e.mid)}const t={type:"offer",sdp:this._remoteSdp.getSdp()};cl.debug("stopReceiving() | calling pc.setRemoteDescription() [offer:%o]",t),await this._pc.setRemoteDescription(t);const n=await this._pc.createAnswer();cl.debug("stopReceiving() | calling pc.setLocalDescription() [answer:%o]",n),await this._pc.setLocalDescription(n);for(const t of e)this._mapMidTransceiver.delete(t)}async pauseReceiving(e){this.assertRecvDirection();for(const t of e){cl.debug("pauseReceiving() [localId:%s]",t);const e=this._mapMidTransceiver.get(t);if(!e)throw new Error("associated RTCRtpTransceiver not found");e.direction="inactive",this._remoteSdp.pauseMediaSection(t)}const t={type:"offer",sdp:this._remoteSdp.getSdp()};cl.debug("pauseReceiving() | calling pc.setRemoteDescription() [offer:%o]",t),await this._pc.setRemoteDescription(t);const n=await this._pc.createAnswer();cl.debug("pauseReceiving() | calling pc.setLocalDescription() [answer:%o]",n),await this._pc.setLocalDescription(n)}async resumeReceiving(e){this.assertRecvDirection();for(const t of e){cl.debug("resumeReceiving() [localId:%s]",t);const e=this._mapMidTransceiver.get(t);if(!e)throw new Error("associated RTCRtpTransceiver not found");e.direction="recvonly",this._remoteSdp.resumeReceivingMediaSection(t)}const t={type:"offer",sdp:this._remoteSdp.getSdp()};cl.debug("resumeReceiving() | calling pc.setRemoteDescription() [offer:%o]",t),await this._pc.setRemoteDescription(t);const n=await this._pc.createAnswer();cl.debug("resumeReceiving() | calling pc.setLocalDescription() [answer:%o]",n),await this._pc.setLocalDescription(n)}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:n}){var i;this.assertRecvDirection();const{streamId:s,ordered:r,maxPacketLifeTime:a,maxRetransmits:o}=e,c={negotiated:!0,id:s,ordered:r,maxPacketLifeTime:a,maxRetransmits:o,protocol:n};cl.debug("receiveDataChannel() [options:%o]",c);const p=this._pc.createDataChannel(t,c);if(!this._hasDataChannelMediaSection){this._remoteSdp.receiveSctpAssociation();const e={type:"offer",sdp:this._remoteSdp.getSdp()};cl.debug("receiveDataChannel() | calling pc.setRemoteDescription() [offer:%o]",e),await this._pc.setRemoteDescription(e);const t=await this._pc.createAnswer();if(!this._transportReady){const e=Zd.parse(t.sdp);await this.setupTransport({localDtlsRole:null!==(i=this._forcedLocalDtlsRole)&&void 0!==i?i:"client",localSdpObject:e})}cl.debug("receiveDataChannel() | calling pc.setRemoteDescription() [answer:%o]",t),await this._pc.setLocalDescription(t),this._hasDataChannelMediaSection=!0}return{dataChannel:p}}async setupTransport({localDtlsRole:e,localSdpObject:t}){t||(t=Zd.parse(this._pc.localDescription.sdp));const n=il.extractDtlsParameters({sdpObject:t});n.role=e,this._remoteSdp.updateDtlsRole("client"===e?"server":"client"),await new Promise(((e,t)=>{this.safeEmit("@connect",{dtlsParameters:n},e,t)})),this._transportReady=!0}assertSendDirection(){if("send"!==this._direction)throw new Error('method can just be called for handlers with "send" direction')}assertRecvDirection(){if("recv"!==this._direction)throw new Error('method can just be called for handlers with "recv" direction')}}ud.Chrome74=dl;var ll={},ul=Zt&&Zt.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),ml=Zt&&Zt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),hl=Zt&&Zt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&ul(t,e,n);return ml(t,e),t};Object.defineProperty(ll,"__esModule",{value:!0}),ll.Chrome70=void 0;const fl=hl(md),gl=Vc,vl=hl(tp),bl=hl(np),yl=hl(Cd),_l=hl(Od),xl=Dd,wl=Md,Sl=Kd,kl=new gl.Logger("Chrome70"),Cl={OS:1024,MIS:1024};class Rl extends xl.HandlerInterface{static createFactory(){return()=>new Rl}constructor(){super(),this._mapMidTransceiver=new Map,this._sendStream=new MediaStream,this._hasDataChannelMediaSection=!1,this._nextSendSctpStreamId=0,this._transportReady=!1}get name(){return"Chrome70"}close(){if(kl.debug("close()"),this._pc)try{this._pc.close()}catch(e){}this.emit("@close")}async getNativeRtpCapabilities(){kl.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 n=fl.parse(t.sdp);return yl.extractRtpCapabilities({sdpObject:n})}catch(t){try{e.close()}catch(e){}throw t}}async getNativeSctpCapabilities(){return kl.debug("getNativeSctpCapabilities()"),{numStreams:Cl}}run({direction:e,iceParameters:t,iceCandidates:n,dtlsParameters:i,sctpParameters:s,iceServers:r,iceTransportPolicy:a,additionalSettings:o,proprietaryConstraints:c,extendedRtpCapabilities:p}){kl.debug("run()"),this._direction=e,this._remoteSdp=new wl.RemoteSdp({iceParameters:t,iceCandidates:n,dtlsParameters:i,sctpParameters:s}),this._sendingRtpParametersByKind={audio:bl.getSendingRtpParameters("audio",p),video:bl.getSendingRtpParameters("video",p)},this._sendingRemoteRtpParametersByKind={audio:bl.getSendingRemoteRtpParameters("audio",p),video:bl.getSendingRemoteRtpParameters("video",p)},i.role&&"auto"!==i.role&&(this._forcedLocalDtlsRole="server"===i.role?"client":"server"),this._pc=new RTCPeerConnection({iceServers:r||[],iceTransportPolicy:a||"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require",sdpSemantics:"unified-plan",...o},c),this._pc.connectionState?this._pc.addEventListener("connectionstatechange",(()=>{this.emit("@connectionstatechange",this._pc.connectionState)})):this._pc.addEventListener("iceconnectionstatechange",(()=>{switch(kl.warn("run() | pc.connectionState not supported, using pc.iceConnectionState"),this._pc.iceConnectionState){case"checking":this.emit("@connectionstatechange","connecting");break;case"connected":case"completed":this.emit("@connectionstatechange","connected");break;case"failed":this.emit("@connectionstatechange","failed");break;case"disconnected":this.emit("@connectionstatechange","disconnected");break;case"closed":this.emit("@connectionstatechange","closed")}}))}async updateIceServers(e){kl.debug("updateIceServers()");const t=this._pc.getConfiguration();t.iceServers=e,this._pc.setConfiguration(t)}async restartIce(e){if(kl.debug("restartIce()"),this._remoteSdp.updateIceParameters(e),this._transportReady)if("send"===this._direction){const e=await this._pc.createOffer({iceRestart:!0});kl.debug("restartIce() | calling pc.setLocalDescription() [offer:%o]",e),await this._pc.setLocalDescription(e);const t={type:"answer",sdp:this._remoteSdp.getSdp()};kl.debug("restartIce() | calling pc.setRemoteDescription() [answer:%o]",t),await this._pc.setRemoteDescription(t)}else{const e={type:"offer",sdp:this._remoteSdp.getSdp()};kl.debug("restartIce() | calling pc.setRemoteDescription() [offer:%o]",e),await this._pc.setRemoteDescription(e);const t=await this._pc.createAnswer();kl.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:n,codec:i}){var s;this.assertSendDirection(),kl.debug("send() [kind:%s, track.id:%s]",e.kind,e.id);const r=vl.clone(this._sendingRtpParametersByKind[e.kind],{});r.codecs=bl.reduceCodecs(r.codecs,i);const a=vl.clone(this._sendingRemoteRtpParametersByKind[e.kind],{});a.codecs=bl.reduceCodecs(a.codecs,i);const o=this._remoteSdp.getNextMediaSectionIdx(),c=this._pc.addTransceiver(e,{direction:"sendonly",streams:[this._sendStream]});let p,d=await this._pc.createOffer(),l=fl.parse(d.sdp);this._transportReady||await this.setupTransport({localDtlsRole:null!==(s=this._forcedLocalDtlsRole)&&void 0!==s?s:"client",localSdpObject:l}),t&&t.length>1&&(kl.debug("send() | enabling legacy simulcast"),l=fl.parse(d.sdp),p=l.media[o.idx],_l.addLegacySimulcast({offerMediaObject:p,numStreams:t.length}),d={type:"offer",sdp:fl.write(l)});let u=!1;const m=(0,Sl.parse)((t||[{}])[0].scalabilityMode);if(t&&1===t.length&&m.spatialLayers>1&&"video/vp9"===r.codecs[0].mimeType.toLowerCase()&&(kl.debug("send() | enabling legacy simulcast for VP9 SVC"),u=!0,l=fl.parse(d.sdp),p=l.media[o.idx],_l.addLegacySimulcast({offerMediaObject:p,numStreams:m.spatialLayers}),d={type:"offer",sdp:fl.write(l)}),kl.debug("send() | calling pc.setLocalDescription() [offer:%o]",d),await this._pc.setLocalDescription(d),t){kl.debug("send() | applying given encodings");const e=c.sender.getParameters();for(let n=0;n<(e.encodings||[]).length;++n){const i=e.encodings[n],s=t[n];if(!s)break;e.encodings[n]=Object.assign(i,s)}await c.sender.setParameters(e)}const h=c.mid;if(r.mid=h,l=fl.parse(this._pc.localDescription.sdp),p=l.media[o.idx],r.rtcp.cname=yl.getCname({offerMediaObject:p}),r.encodings=_l.getRtpEncodings({offerMediaObject:p}),t)for(let e=0;e<r.encodings.length;++e)t[e]&&Object.assign(r.encodings[e],t[e]);if(u&&(r.encodings=[r.encodings[0]]),r.encodings.length>1&&("video/vp8"===r.codecs[0].mimeType.toLowerCase()||"video/h264"===r.codecs[0].mimeType.toLowerCase()))for(const e of r.encodings)e.scalabilityMode="S1T3";this._remoteSdp.send({offerMediaObject:p,reuseMid:o.reuseMid,offerRtpParameters:r,answerRtpParameters:a,codecOptions:n});const f={type:"answer",sdp:this._remoteSdp.getSdp()};return kl.debug("send() | calling pc.setRemoteDescription() [answer:%o]",f),await this._pc.setRemoteDescription(f),this._mapMidTransceiver.set(h,c),{localId:h,rtpParameters:r,rtpSender:c.sender}}async stopSending(e){this.assertSendDirection(),kl.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);if(this._remoteSdp.closeMediaSection(t.mid))try{t.stop()}catch(e){}const n=await this._pc.createOffer();kl.debug("stopSending() | calling pc.setLocalDescription() [offer:%o]",n),await this._pc.setLocalDescription(n);const i={type:"answer",sdp:this._remoteSdp.getSdp()};kl.debug("stopSending() | calling pc.setRemoteDescription() [answer:%o]",i),await this._pc.setRemoteDescription(i),this._mapMidTransceiver.delete(e)}async pauseSending(e){}async resumeSending(e){}async replaceTrack(e,t){this.assertSendDirection(),t?kl.debug("replaceTrack() [localId:%s, track.id:%s]",e,t.id):kl.debug("replaceTrack() [localId:%s, no track]",e);const n=this._mapMidTransceiver.get(e);if(!n)throw new Error("associated RTCRtpTransceiver not found");await n.sender.replaceTrack(t)}async setMaxSpatialLayer(e,t){this.assertSendDirection(),kl.debug("setMaxSpatialLayer() [localId:%s, spatialLayer:%s]",e,t);const n=this._mapMidTransceiver.get(e);if(!n)throw new Error("associated RTCRtpTransceiver not found");const i=n.sender.getParameters();i.encodings.forEach(((e,n)=>{e.active=n<=t})),await n.sender.setParameters(i)}async setRtpEncodingParameters(e,t){this.assertSendDirection(),kl.debug("setRtpEncodingParameters() [localId:%s, params:%o]",e,t);const n=this._mapMidTransceiver.get(e);if(!n)throw new Error("associated RTCRtpTransceiver not found");const i=n.sender.getParameters();i.encodings.forEach(((e,n)=>{i.encodings[n]={...e,...t}})),await n.sender.setParameters(i)}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:n,label:i,protocol:s}){var r;this.assertSendDirection();const a={negotiated:!0,id:this._nextSendSctpStreamId,ordered:e,maxPacketLifeTime:t,maxRetransmitTime:t,maxRetransmits:n,protocol:s};kl.debug("sendDataChannel() [options:%o]",a);const o=this._pc.createDataChannel(i,a);if(this._nextSendSctpStreamId=++this._nextSendSctpStreamId%Cl.MIS,!this._hasDataChannelMediaSection){const e=await this._pc.createOffer(),t=fl.parse(e.sdp),n=t.media.find((e=>"application"===e.type));this._transportReady||await this.setupTransport({localDtlsRole:null!==(r=this._forcedLocalDtlsRole)&&void 0!==r?r:"client",localSdpObject:t}),kl.debug("sendDataChannel() | calling pc.setLocalDescription() [offer:%o]",e),await this._pc.setLocalDescription(e),this._remoteSdp.sendSctpAssociation({offerMediaObject:n});const i={type:"answer",sdp:this._remoteSdp.getSdp()};kl.debug("sendDataChannel() | calling pc.setRemoteDescription() [answer:%o]",i),await this._pc.setRemoteDescription(i),this._hasDataChannelMediaSection=!0}return{dataChannel:o,sctpStreamParameters:{streamId:a.id,ordered:a.ordered,maxPacketLifeTime:a.maxPacketLifeTime,maxRetransmits:a.maxRetransmits}}}async receive(e){var t;this.assertRecvDirection();const n=[],i=new Map;for(const t of e){const{trackId:e,kind:n,rtpParameters:s,streamId:r}=t;kl.debug("receive() [trackId:%s, kind:%s]",e,n);const a=s.mid||String(this._mapMidTransceiver.size);i.set(e,a),this._remoteSdp.receive({mid:a,kind:n,offerRtpParameters:s,streamId:r||s.rtcp.cname,trackId:e})}const s={type:"offer",sdp:this._remoteSdp.getSdp()};kl.debug("receive() | calling pc.setRemoteDescription() [offer:%o]",s),await this._pc.setRemoteDescription(s);let r=await this._pc.createAnswer();const a=fl.parse(r.sdp);for(const t of e){const{trackId:e,rtpParameters:n}=t,s=i.get(e),r=a.media.find((e=>String(e.mid)===s));yl.applyCodecParameters({offerRtpParameters:n,answerMediaObject:r})}r={type:"answer",sdp:fl.write(a)},this._transportReady||await this.setupTransport({localDtlsRole:null!==(t=this._forcedLocalDtlsRole)&&void 0!==t?t:"client",localSdpObject:a}),kl.debug("receive() | calling pc.setLocalDescription() [answer:%o]",r),await this._pc.setLocalDescription(r);for(const t of e){const{trackId:e}=t,s=i.get(e),r=this._pc.getTransceivers().find((e=>e.mid===s));if(!r)throw new Error("new RTCRtpTransceiver not found");this._mapMidTransceiver.set(s,r),n.push({localId:s,track:r.receiver.track,rtpReceiver:r.receiver})}return n}async stopReceiving(e){this.assertRecvDirection();for(const t of e){kl.debug("stopReceiving() [localId:%s]",t);const e=this._mapMidTransceiver.get(t);if(!e)throw new Error("associated RTCRtpTransceiver not found");this._remoteSdp.closeMediaSection(e.mid)}const t={type:"offer",sdp:this._remoteSdp.getSdp()};kl.debug("stopReceiving() | calling pc.setRemoteDescription() [offer:%o]",t),await this._pc.setRemoteDescription(t);const n=await this._pc.createAnswer();kl.debug("stopReceiving() | calling pc.setLocalDescription() [answer:%o]",n),await this._pc.setLocalDescription(n);for(const t of e)this._mapMidTransceiver.delete(t)}async pauseReceiving(e){}async resumeReceiving(e){}async getReceiverStats(e){this.assertRecvDirection();const t=this._mapMidTransceiver.get(e);if(!t)throw new Error("associated RTCRtpTransceiver not found");return t.receiver.getStats()}async receiveDataChannel({sctpStreamParameters:e,label:t,protocol:n}){var i;this.assertRecvDirection();const{streamId:s,ordered:r,maxPacketLifeTime:a,maxRetransmits:o}=e,c={negotiated:!0,id:s,ordered:r,maxPacketLifeTime:a,maxRetransmitTime:a,maxRetransmits:o,protocol:n};kl.debug("receiveDataChannel() [options:%o]",c);const p=this._pc.createDataChannel(t,c);if(!this._hasDataChannelMediaSection){this._remoteSdp.receiveSctpAssociation();const e={type:"offer",sdp:this._remoteSdp.getSdp()};kl.debug("receiveDataChannel() | calling pc.setRemoteDescription() [offer:%o]",e),await this._pc.setRemoteDescription(e);const t=await this._pc.createAnswer();if(!this._transportReady){const e=fl.parse(t.sdp);await this.setupTransport({localDtlsRole:null!==(i=this._forcedLocalDtlsRole)&&void 0!==i?i:"client",localSdpObject:e})}kl.debug("receiveDataChannel() | calling pc.setRemoteDescription() [answer:%o]",t),await this._pc.setLocalDescription(t),this._hasDataChannelMediaSection=!0}return{dataChannel:p}}async setupTransport({localDtlsRole:e,localSdpObject:t}){t||(t=fl.parse(this._pc.localDescription.sdp));const n=yl.extractDtlsParameters({sdpObject:t});n.role=e,this._remoteSdp.updateDtlsRole("client"===e?"server":"client"),await new Promise(((e,t)=>{this.safeEmit("@connect",{dtlsParameters:n},e,t)})),this._transportReady=!0}assertSendDirection(){if("send"!==this._direction)throw new Error('method can just be called for handlers with "send" direction')}assertRecvDirection(){if("recv"!==this._direction)throw new Error('method can just be called for handlers with "recv" direction')}}ll.Chrome70=Rl;var Tl={},Pl={};Object.defineProperty(Pl,"__esModule",{value:!0}),Pl.addLegacySimulcast=Pl.getRtpEncodings=void 0,Pl.getRtpEncodings=function({offerMediaObject:e,track:t}){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)}}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,s]=t.ssrcs.split(/\s+/);e=Number(e),s=Number(s),n.has(e)&&(n.delete(e),n.delete(s),i.set(e,s))}for(const e of n)i.set(e,null);const s=[];for(const[e,t]of i){const n={ssrc:e};t&&(n.rtx={ssrc:t}),s.push(n)}return s},Pl.addLegacySimulcast=function({offerMediaObject:e,track:t,numStreams:n}){if(n<=1)throw new TypeError("numStreams must be greater than 1");let i,s,r;if(!(e.ssrcs||[]).find((e=>{if("msid"!==e.attribute)return!1;return e.value.split(" ")[1]===t.id&&(i=e.id,r=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])===i&&(s=Number(t[1]),!0)}));const a=e.ssrcs.find((e=>"cname"===e.attribute&&e.id===i));if(!a)throw new Error(`a=ssrc line with cname information not found [track.id:${t.id}]`);const o=a.value,c=[],p=[];for(let e=0;e<n;++e)c.push(i+e),s&&p.push(s+e);e.ssrcGroups=e.ssrcGroups||[],e.ssrcs=e.ssrcs||[],e.ssrcGroups.push({semantics:"SIM",ssrcs:c.join(" ")});for(let n=0;n<c.length;++n){const i=c[n];e.ssrcs.push({id:i,attribute:"cname",value:o}),e.ssrcs.push({id:i,attribute:"msid",value:`${r} ${t.id}`})}for(let n=0;n<p.length;++n){const i=c[n],s=p[n];e.ssrcs.push({id:s,attribute:"cname",value:o}),e.ssrcs.push({id:s,attribute:"msid",value:`${r} ${t.id}`}),e.ssrcGroups.push({semantics:"FID",ssrcs:`${i} ${s}`})}};var El=Zt&&Zt.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),Ol=Zt&&Zt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Dl=Zt&&Zt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&El(t,e,n);return Ol(t,e),t};Object.defineProperty(Tl,"__esModule",{value:!0}),Tl.Chrome67=void 0;const jl=Dl(md),Il=Vc,Ml=Dl(tp),Ll=Dl(np),Al=Dl(Cd),Nl=Dl(Pl),Bl=Dd,Fl=Md,Ul=new Il.Logger("Chrome67"),zl={OS:1024,MIS:1024};class ql extends Bl.HandlerInterface{static createFactory(){return()=>new ql}constructor(){super(),this._sendStream=new MediaStream,this._mapSendLocalIdRtpSender=new Map,this._nextSendLocalId=0,this._mapRecvLocalIdInfo=new Map,this._hasDataChannelMediaSection=!1,this._nextSendSctpStreamId=0,this._transportReady=!1}get name(){return"Chrome67"}close(){if(Ul.debug("close()"),this._pc)try{this._pc.close()}catch(e){}this.emit("@close")}async getNativeRtpCapabilities(){Ul.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 n=jl.parse(t.sdp);return Al.extractRtpCapabilities({sdpObject:n})}catch(t){try{e.close()}catch(e){}throw t}}async getNativeSctpCapabilities(){return Ul.debug("getNativeSctpCapabilities()"),{numStreams:zl}}run({direction:e,iceParameters:t,iceCandidates:n,dtlsParameters:i,sctpParameters:s,iceServers:r,iceTransportPolicy:a,additionalSettings:o,proprietaryConstraints:c,extendedRtpCapabilities:p}){Ul.debug("run()"),this._direction=e,this._remoteSdp=new Fl.RemoteSdp({iceParameters:t,iceCandidates:n,dtlsParameters:i,sctpParameters:s,planB:!0}),this._sendingRtpParametersByKind={audio:Ll.getSendingRtpParameters("audio",p),video:Ll.getSendingRtpParameters("video",p)},this._sendingRemoteRtpParametersByKind={audio:Ll.getSendingRemoteRtpParameters("audio",p),video:Ll.getSendingRemoteRtpParameters("video",p)},i.role&&"auto"!==i.role&&(this._forcedLocalDtlsRole="server"===i.role?"client":"server"),this._pc=new RTCPeerConnection({iceServers:r||[],iceTransportPolicy:a||"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require",sdpSemantics:"plan-b",...o},c),this._pc.connectionState?this._pc.addEventListener("connectionstatechange",(()=>{this.emit("@connectionstatechange",this._pc.connectionState)})):this._pc.addEventListener("iceconnectionstatechange",(()=>{switch(Ul.warn("run() | pc.connectionState not supported, using pc.iceConnectionState"),this._pc.iceConnectionState){case"checking":this.emit("@connectionstatechange","connecting");break;case"connected":case"completed":this.emit("@connectionstatechange","connected");break;case"failed":this.emit("@connectionstatechange","failed");break;case"disconnected":this.emit("@connectionstatechange","disconnected");break;case"closed":this.emit("@connectionstatechange","closed")}}))}async updateIceServers(e){Ul.debug("updateIceServers()");const t=this._pc.getConfiguration();t.iceServers=e,this._pc.setConfiguration(t)}async restartIce(e){if(Ul.debug("restartIce()"),this._remoteSdp.updateIceParameters(e),this._transportReady)if("send"===this._direction){const e=await this._pc.createOffer({iceRestart:!0});Ul.debug("restartIce() | calling pc.setLocalDescription() [offer:%o]",e),await this._pc.setLocalDescription(e);const t={type:"answer",sdp:this._remoteSdp.getSdp()};Ul.debug("restartIce() | calling pc.setRemoteDescription() [answer:%o]",t),await this._pc.setRemoteDescription(t)}else{const e={type:"offer",sdp:this._remoteSdp.getSdp()};Ul.debug("restartIce() | calling pc.setRemoteDescription() [offer:%o]",e),await this._pc.setRemoteDescription(e);const t=await this._pc.createAnswer();Ul.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:n,codec:i}){var s;this.assertSendDirection(),Ul.debug("send() [kind:%s, track.id:%s]",e.kind,e.id),i&&Ul.warn("send() | codec selection is not available in %s handler",this.name),this._sendStream.addTrack(e),this._pc.addTrack(e,this._sendStream);let r,a=await this._pc.createOffer(),o=jl.parse(a.sdp);const c=Ml.clone(this._sendingRtpParametersByKind[e.kind],{});c.codecs=Ll.reduceCodecs(c.codecs);const p=Ml.clone(this._sendingRemoteRtpParametersByKind[e.kind],{});if(p.codecs=Ll.reduceCodecs(p.codecs),this._transportReady||await this.setupTransport({localDtlsRole:null!==(s=this._forcedLocalDtlsRole)&&void 0!==s?s:"client",localSdpObject:o}),"video"===e.kind&&t&&t.length>1&&(Ul.debug("send() | enabling simulcast"),o=jl.parse(a.sdp),r=o.media.find((e=>"video"===e.type)),Nl.addLegacySimulcast({offerMediaObject:r,track:e,numStreams:t.length}),a={type:"offer",sdp:jl.write(o)}),Ul.debug("send() | calling pc.setLocalDescription() [offer:%o]",a),await this._pc.setLocalDescription(a),o=jl.parse(this._pc.localDescription.sdp),r=o.media.find((t=>t.type===e.kind)),c.rtcp.cname=Al.getCname({offerMediaObject:r}),c.encodings=Nl.getRtpEncodings({offerMediaObject:r,track:e}),t)for(let e=0;e<c.encodings.length;++e)t[e]&&Object.assign(c.encodings[e],t[e]);if(c.encodings.length>1&&"video/vp8"===c.codecs[0].mimeType.toLowerCase())for(const e of c.encodings)e.scalabilityMode="S1T3";this._remoteSdp.send({offerMediaObject:r,offerRtpParameters:c,answerRtpParameters:p,codecOptions:n});const d={type:"answer",sdp:this._remoteSdp.getSdp()};Ul.debug("send() | calling pc.setRemoteDescription() [answer:%o]",d),await this._pc.setRemoteDescription(d);const l=String(this._nextSendLocalId);this._nextSendLocalId++;const u=this._pc.getSenders().find((t=>t.track===e));return this._mapSendLocalIdRtpSender.set(l,u),{localId:l,rtpParameters:c,rtpSender:u}}async stopSending(e){this.assertSendDirection(),Ul.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 n=await this._pc.createOffer();Ul.debug("stopSending() | calling pc.setLocalDescription() [offer:%o]",n);try{await this._pc.setLocalDescription(n)}catch(e){if(0===this._sendStream.getTracks().length)return void Ul.warn("stopSending() | ignoring expected error due no sending tracks: %s",e.toString());throw e}if("stable"===this._pc.signalingState)return;const i={type:"answer",sdp:this._remoteSdp.getSdp()};Ul.debug("stopSending() | calling pc.setRemoteDescription() [answer:%o]",i),await this._pc.setRemoteDescription(i)}async pauseSending(e){}async resumeSending(e){}async replaceTrack(e,t){this.assertSendDirection(),t?Ul.debug("replaceTrack() [localId:%s, track.id:%s]",e,t.id):Ul.debug("replaceTrack() [localId:%s, no track]",e);const n=this._mapSendLocalIdRtpSender.get(e);if(!n)throw new Error("associated RTCRtpSender not found");const i=n.track;await n.replaceTrack(t),i&&this._sendStream.removeTrack(i),t&&this._sendStream.addTrack(t)}async setMaxSpatialLayer(e,t){this.assertSendDirection(),Ul.debug("setMaxSpatialLayer() [localId:%s, spatialLayer:%s]",e,t);const n=this._mapSendLocalIdRtpSender.get(e);if(!n)throw new Error("associated RTCRtpSender not found");const i=n.getParameters();i.encodings.forEach(((e,n)=>{e.active=n<=t})),await n.setParameters(i)}async setRtpEncodingParameters(e,t){this.assertSendDirection(),Ul.debug("setRtpEncodingParameters() [localId:%s, params:%o]",e,t);const n=this._mapSendLocalIdRtpSender.get(e);if(!n)throw new Error("associated RTCRtpSender not found");const i=n.getParameters();i.encodings.forEach(((e,n)=>{i.encodings[n]={...e,...t}})),await n.setParameters(i)}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:n,label:i,protocol:s}){var r;this.assertSendDirection();const a={negotiated:!0,id:this._nextSendSctpStreamId,ordered:e,maxPacketLifeTime:t,maxRetransmitTime:t,maxRetransmits:n,protocol:s};Ul.debug("sendDataChannel() [options:%o]",a);const o=this._pc.createDataChannel(i,a);if(this._nextSendSctpStreamId=++this._nextSendSctpStreamId%zl.MIS,!this._hasDataChannelMediaSection){const e=await this._pc.createOffer(),t=jl.parse(e.sdp),n=t.media.find((e=>"application"===e.type));this._transportReady||await this.setupTransport({localDtlsRole:null!==(r=this._forcedLocalDtlsRole)&&void 0!==r?r:"client",localSdpObject:t}),Ul.debug("sendDataChannel() | calling pc.setLocalDescription() [offer:%o]",e),await this._pc.setLocalDescription(e),this._remoteSdp.sendSctpAssociation({offerMediaObject:n});const i={type:"answer",sdp:this._remoteSdp.getSdp()};Ul.debug("sendDataChannel() | calling pc.setRemoteDescription() [answer:%o]",i),await this._pc.setRemoteDescription(i),this._hasDataChannelMediaSection=!0}return{dataChannel:o,sctpStreamParameters:{streamId:a.id,ordered:a.ordered,maxPacketLifeTime:a.maxPacketLifeTime,maxRetransmits:a.maxRetransmits}}}async receive(e){var t;this.assertRecvDirection();const n=[];for(const t of e){const{trackId:e,kind:n,rtpParameters:i,streamId:s}=t;Ul.debug("receive() [trackId:%s, kind:%s]",e,n);const r=n;this._remoteSdp.receive({mid:r,kind:n,offerRtpParameters:i,streamId:s||i.rtcp.cname,trackId:e})}const i={type:"offer",sdp:this._remoteSdp.getSdp()};Ul.debug("receive() | calling pc.setRemoteDescription() [offer:%o]",i),await this._pc.setRemoteDescription(i);let s=await this._pc.createAnswer();const r=jl.parse(s.sdp);for(const t of e){const{kind:e,rtpParameters:n}=t,i=e,s=r.media.find((e=>String(e.mid)===i));Al.applyCodecParameters({offerRtpParameters:n,answerMediaObject:s})}s={type:"answer",sdp:jl.write(r)},this._transportReady||await this.setupTransport({localDtlsRole:null!==(t=this._forcedLocalDtlsRole)&&void 0!==t?t:"client",localSdpObject:r}),Ul.debug("receive() | calling pc.setLocalDescription() [answer:%o]",s),await this._pc.setLocalDescription(s);for(const t of e){const{kind:e,trackId:i,rtpParameters:s}=t,r=i,a=e,o=this._pc.getReceivers().find((e=>e.track&&e.track.id===r));if(!o)throw new Error("new RTCRtpReceiver not");this._mapRecvLocalIdInfo.set(r,{mid:a,rtpParameters:s,rtpReceiver:o}),n.push({localId:r,track:o.track,rtpReceiver:o})}return n}async stopReceiving(e){this.assertRecvDirection();for(const t of e){Ul.debug("stopReceiving() [localId:%s]",t);const{mid:e,rtpParameters:n}=this._mapRecvLocalIdInfo.get(t)||{};this._mapRecvLocalIdInfo.delete(t),this._remoteSdp.planBStopReceiving({mid:e,offerRtpParameters:n})}const t={type:"offer",sdp:this._remoteSdp.getSdp()};Ul.debug("stopReceiving() | calling pc.setRemoteDescription() [offer:%o]",t),await this._pc.setRemoteDescription(t);const n=await this._pc.createAnswer();Ul.debug("stopReceiving() | calling pc.setLocalDescription() [answer:%o]",n),await this._pc.setLocalDescription(n)}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:n}){var i;this.assertRecvDirection();const{streamId:s,ordered:r,maxPacketLifeTime:a,maxRetransmits:o}=e,c={negotiated:!0,id:s,ordered:r,maxPacketLifeTime:a,maxRetransmitTime:a,maxRetransmits:o,protocol:n};Ul.debug("receiveDataChannel() [options:%o]",c);const p=this._pc.createDataChannel(t,c);if(!this._hasDataChannelMediaSection){this._remoteSdp.receiveSctpAssociation({oldDataChannelSpec:!0});const e={type:"offer",sdp:this._remoteSdp.getSdp()};Ul.debug("receiveDataChannel() | calling pc.setRemoteDescription() [offer:%o]",e),await this._pc.setRemoteDescription(e);const t=await this._pc.createAnswer();if(!this._transportReady){const e=jl.parse(t.sdp);await this.setupTransport({localDtlsRole:null!==(i=this._forcedLocalDtlsRole)&&void 0!==i?i:"client",localSdpObject:e})}Ul.debug("receiveDataChannel() | calling pc.setRemoteDescription() [answer:%o]",t),await this._pc.setLocalDescription(t),this._hasDataChannelMediaSection=!0}return{dataChannel:p}}async setupTransport({localDtlsRole:e,localSdpObject:t}){t||(t=jl.parse(this._pc.localDescription.sdp));const n=Al.extractDtlsParameters({sdpObject:t});n.role=e,this._remoteSdp.updateDtlsRole("client"===e?"server":"client"),await new Promise(((e,t)=>{this.safeEmit("@connect",{dtlsParameters:n},e,t)})),this._transportReady=!0}assertSendDirection(){if("send"!==this._direction)throw new Error('method can just be called for handlers with "send" direction')}assertRecvDirection(){if("recv"!==this._direction)throw new Error('method can just be called for handlers with "recv" direction')}}Tl.Chrome67=ql;var $l={},Vl=Zt&&Zt.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),Hl=Zt&&Zt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Wl=Zt&&Zt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&Vl(t,e,n);return Hl(t,e),t};Object.defineProperty($l,"__esModule",{value:!0}),$l.Chrome55=void 0;const Gl=Wl(md),Kl=Vc,Jl=Xc,Ql=Wl(tp),Yl=Wl(np),Xl=Wl(Cd),Zl=Wl(Pl),eu=Dd,tu=Md,nu=new Kl.Logger("Chrome55"),iu={OS:1024,MIS:1024};class su extends eu.HandlerInterface{static createFactory(){return()=>new su}constructor(){super(),this._sendStream=new MediaStream,this._mapSendLocalIdTrack=new Map,this._nextSendLocalId=0,this._mapRecvLocalIdInfo=new Map,this._hasDataChannelMediaSection=!1,this._nextSendSctpStreamId=0,this._transportReady=!1}get name(){return"Chrome55"}close(){if(nu.debug("close()"),this._pc)try{this._pc.close()}catch(e){}this.emit("@close")}async getNativeRtpCapabilities(){nu.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 n=Gl.parse(t.sdp);return Xl.extractRtpCapabilities({sdpObject:n})}catch(t){try{e.close()}catch(e){}throw t}}async getNativeSctpCapabilities(){return nu.debug("getNativeSctpCapabilities()"),{numStreams:iu}}run({direction:e,iceParameters:t,iceCandidates:n,dtlsParameters:i,sctpParameters:s,iceServers:r,iceTransportPolicy:a,additionalSettings:o,proprietaryConstraints:c,extendedRtpCapabilities:p}){nu.debug("run()"),this._direction=e,this._remoteSdp=new tu.RemoteSdp({iceParameters:t,iceCandidates:n,dtlsParameters:i,sctpParameters:s,planB:!0}),this._sendingRtpParametersByKind={audio:Yl.getSendingRtpParameters("audio",p),video:Yl.getSendingRtpParameters("video",p)},this._sendingRemoteRtpParametersByKind={audio:Yl.getSendingRemoteRtpParameters("audio",p),video:Yl.getSendingRemoteRtpParameters("video",p)},i.role&&"auto"!==i.role&&(this._forcedLocalDtlsRole="server"===i.role?"client":"server"),this._pc=new RTCPeerConnection({iceServers:r||[],iceTransportPolicy:a||"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require",sdpSemantics:"plan-b",...o},c),this._pc.connectionState?this._pc.addEventListener("connectionstatechange",(()=>{this.emit("@connectionstatechange",this._pc.connectionState)})):this._pc.addEventListener("iceconnectionstatechange",(()=>{switch(nu.warn("run() | pc.connectionState not supported, using pc.iceConnectionState"),this._pc.iceConnectionState){case"checking":this.emit("@connectionstatechange","connecting");break;case"connected":case"completed":this.emit("@connectionstatechange","connected");break;case"failed":this.emit("@connectionstatechange","failed");break;case"disconnected":this.emit("@connectionstatechange","disconnected");break;case"closed":this.emit("@connectionstatechange","closed")}}))}async updateIceServers(e){nu.debug("updateIceServers()");const t=this._pc.getConfiguration();t.iceServers=e,this._pc.setConfiguration(t)}async restartIce(e){if(nu.debug("restartIce()"),this._remoteSdp.updateIceParameters(e),this._transportReady)if("send"===this._direction){const e=await this._pc.createOffer({iceRestart:!0});nu.debug("restartIce() | calling pc.setLocalDescription() [offer:%o]",e),await this._pc.setLocalDescription(e);const t={type:"answer",sdp:this._remoteSdp.getSdp()};nu.debug("restartIce() | calling pc.setRemoteDescription() [answer:%o]",t),await this._pc.setRemoteDescription(t)}else{const e={type:"offer",sdp:this._remoteSdp.getSdp()};nu.debug("restartIce() | calling pc.setRemoteDescription() [offer:%o]",e),await this._pc.setRemoteDescription(e);const t=await this._pc.createAnswer();nu.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:n,codec:i}){var s;this.assertSendDirection(),nu.debug("send() [kind:%s, track.id:%s]",e.kind,e.id),i&&nu.warn("send() | codec selection is not available in %s handler",this.name),this._sendStream.addTrack(e),this._pc.addStream(this._sendStream);let r,a=await this._pc.createOffer(),o=Gl.parse(a.sdp);const c=Ql.clone(this._sendingRtpParametersByKind[e.kind],{});c.codecs=Yl.reduceCodecs(c.codecs);const p=Ql.clone(this._sendingRemoteRtpParametersByKind[e.kind],{});if(p.codecs=Yl.reduceCodecs(p.codecs),this._transportReady||await this.setupTransport({localDtlsRole:null!==(s=this._forcedLocalDtlsRole)&&void 0!==s?s:"client",localSdpObject:o}),"video"===e.kind&&t&&t.length>1&&(nu.debug("send() | enabling simulcast"),o=Gl.parse(a.sdp),r=o.media.find((e=>"video"===e.type)),Zl.addLegacySimulcast({offerMediaObject:r,track:e,numStreams:t.length}),a={type:"offer",sdp:Gl.write(o)}),nu.debug("send() | calling pc.setLocalDescription() [offer:%o]",a),await this._pc.setLocalDescription(a),o=Gl.parse(this._pc.localDescription.sdp),r=o.media.find((t=>t.type===e.kind)),c.rtcp.cname=Xl.getCname({offerMediaObject:r}),c.encodings=Zl.getRtpEncodings({offerMediaObject:r,track:e}),t)for(let e=0;e<c.encodings.length;++e)t[e]&&Object.assign(c.encodings[e],t[e]);if(c.encodings.length>1&&"video/vp8"===c.codecs[0].mimeType.toLowerCase())for(const e of c.encodings)e.scalabilityMode="S1T3";this._remoteSdp.send({offerMediaObject:r,offerRtpParameters:c,answerRtpParameters:p,codecOptions:n});const d={type:"answer",sdp:this._remoteSdp.getSdp()};nu.debug("send() | calling pc.setRemoteDescription() [answer:%o]",d),await this._pc.setRemoteDescription(d);const l=String(this._nextSendLocalId);return this._nextSendLocalId++,this._mapSendLocalIdTrack.set(l,e),{localId:l,rtpParameters:c}}async stopSending(e){this.assertSendDirection(),nu.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 n=await this._pc.createOffer();nu.debug("stopSending() | calling pc.setLocalDescription() [offer:%o]",n);try{await this._pc.setLocalDescription(n)}catch(e){if(0===this._sendStream.getTracks().length)return void nu.warn("stopSending() | ignoring expected error due no sending tracks: %s",e.toString());throw e}if("stable"===this._pc.signalingState)return;const i={type:"answer",sdp:this._remoteSdp.getSdp()};nu.debug("stopSending() | calling pc.setRemoteDescription() [answer:%o]",i),await this._pc.setRemoteDescription(i)}async pauseSending(e){}async resumeSending(e){}async replaceTrack(e,t){throw new Jl.UnsupportedError("not implemented")}async setMaxSpatialLayer(e,t){throw new Jl.UnsupportedError(" not implemented")}async setRtpEncodingParameters(e,t){throw new Jl.UnsupportedError("not supported")}async getSenderStats(e){throw new Jl.UnsupportedError("not implemented")}async sendDataChannel({ordered:e,maxPacketLifeTime:t,maxRetransmits:n,label:i,protocol:s}){var r;this.assertSendDirection();const a={negotiated:!0,id:this._nextSendSctpStreamId,ordered:e,maxPacketLifeTime:t,maxRetransmitTime:t,maxRetransmits:n,protocol:s};nu.debug("sendDataChannel() [options:%o]",a);const o=this._pc.createDataChannel(i,a);if(this._nextSendSctpStreamId=++this._nextSendSctpStreamId%iu.MIS,!this._hasDataChannelMediaSection){const e=await this._pc.createOffer(),t=Gl.parse(e.sdp),n=t.media.find((e=>"application"===e.type));this._transportReady||await this.setupTransport({localDtlsRole:null!==(r=this._forcedLocalDtlsRole)&&void 0!==r?r:"client",localSdpObject:t}),nu.debug("sendDataChannel() | calling pc.setLocalDescription() [offer:%o]",e),await this._pc.setLocalDescription(e),this._remoteSdp.sendSctpAssociation({offerMediaObject:n});const i={type:"answer",sdp:this._remoteSdp.getSdp()};nu.debug("sendDataChannel() | calling pc.setRemoteDescription() [answer:%o]",i),await this._pc.setRemoteDescription(i),this._hasDataChannelMediaSection=!0}return{dataChannel:o,sctpStreamParameters:{streamId:a.id,ordered:a.ordered,maxPacketLifeTime:a.maxPacketLifeTime,maxRetransmits:a.maxRetransmits}}}async receive(e){var t;this.assertRecvDirection();const n=[];for(const t of e){const{trackId:e,kind:n,rtpParameters:i,streamId:s}=t;nu.debug("receive() [trackId:%s, kind:%s]",e,n);const r=n;this._remoteSdp.receive({mid:r,kind:n,offerRtpParameters:i,streamId:s||i.rtcp.cname,trackId:e})}const i={type:"offer",sdp:this._remoteSdp.getSdp()};nu.debug("receive() | calling pc.setRemoteDescription() [offer:%o]",i),await this._pc.setRemoteDescription(i);let s=await this._pc.createAnswer();const r=Gl.parse(s.sdp);for(const t of e){const{kind:e,rtpParameters:n}=t,i=e,s=r.media.find((e=>String(e.mid)===i));Xl.applyCodecParameters({offerRtpParameters:n,answerMediaObject:s})}s={type:"answer",sdp:Gl.write(r)},this._transportReady||await this.setupTransport({localDtlsRole:null!==(t=this._forcedLocalDtlsRole)&&void 0!==t?t:"client",localSdpObject:r}),nu.debug("receive() | calling pc.setLocalDescription() [answer:%o]",s),await this._pc.setLocalDescription(s);for(const t of e){const{kind:e,trackId:i,rtpParameters:s}=t,r=e,a=i,o=t.streamId||s.rtcp.cname,c=this._pc.getRemoteStreams().find((e=>e.id===o)),p=c.getTrackById(a);if(!p)throw new Error("remote track not found");this._mapRecvLocalIdInfo.set(a,{mid:r,rtpParameters:s}),n.push({localId:a,track:p})}return n}async stopReceiving(e){this.assertRecvDirection();for(const t of e){nu.debug("stopReceiving() [localId:%s]",t);const{mid:e,rtpParameters:n}=this._mapRecvLocalIdInfo.get(t)||{};this._mapRecvLocalIdInfo.delete(t),this._remoteSdp.planBStopReceiving({mid:e,offerRtpParameters:n})}const t={type:"offer",sdp:this._remoteSdp.getSdp()};nu.debug("stopReceiving() | calling pc.setRemoteDescription() [offer:%o]",t),await this._pc.setRemoteDescription(t);const n=await this._pc.createAnswer();nu.debug("stopReceiving() | calling pc.setLocalDescription() [answer:%o]",n),await this._pc.setLocalDescription(n)}async pauseReceiving(e){}async resumeReceiving(e){}async getReceiverStats(e){throw new Jl.UnsupportedError("not implemented")}async receiveDataChannel({sctpStreamParameters:e,label:t,protocol:n}){var i;this.assertRecvDirection();const{streamId:s,ordered:r,maxPacketLifeTime:a,maxRetransmits:o}=e,c={negotiated:!0,id:s,ordered:r,maxPacketLifeTime:a,maxRetransmitTime:a,maxRetransmits:o,protocol:n};nu.debug("receiveDataChannel() [options:%o]",c);const p=this._pc.createDataChannel(t,c);if(!this._hasDataChannelMediaSection){this._remoteSdp.receiveSctpAssociation({oldDataChannelSpec:!0});const e={type:"offer",sdp:this._remoteSdp.getSdp()};nu.debug("receiveDataChannel() | calling pc.setRemoteDescription() [offer:%o]",e),await this._pc.setRemoteDescription(e);const t=await this._pc.createAnswer();if(!this._transportReady){const e=Gl.parse(t.sdp);await this.setupTransport({localDtlsRole:null!==(i=this._forcedLocalDtlsRole)&&void 0!==i?i:"client",localSdpObject:e})}nu.debug("receiveDataChannel() | calling pc.setRemoteDescription() [answer:%o]",t),await this._pc.setLocalDescription(t),this._hasDataChannelMediaSection=!0}return{dataChannel:p}}async setupTransport({localDtlsRole:e,localSdpObject:t}){t||(t=Gl.parse(this._pc.localDescription.sdp));const n=Xl.extractDtlsParameters({sdpObject:t});n.role=e,this._remoteSdp.updateDtlsRole("client"===e?"server":"client"),await new Promise(((e,t)=>{this.safeEmit("@connect",{dtlsParameters:n},e,t)})),this._transportReady=!0}assertSendDirection(){if("send"!==this._direction)throw new Error('method can just be called for handlers with "send" direction')}assertRecvDirection(){if("recv"!==this._direction)throw new Error('method can just be called for handlers with "recv" direction')}}$l.Chrome55=su;var ru={},au=Zt&&Zt.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),ou=Zt&&Zt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),cu=Zt&&Zt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&au(t,e,n);return ou(t,e),t};Object.defineProperty(ru,"__esModule",{value:!0}),ru.Firefox60=void 0;const pu=cu(md),du=Vc,lu=Xc,uu=cu(tp),mu=cu(np),hu=cu(Cd),fu=cu(Od),gu=Dd,vu=Md,bu=new du.Logger("Firefox60"),yu={OS:16,MIS:2048};class _u extends gu.HandlerInterface{static createFactory(){return()=>new _u}constructor(){super(),this._mapMidTransceiver=new Map,this._sendStream=new MediaStream,this._hasDataChannelMediaSection=!1,this._nextSendSctpStreamId=0,this._transportReady=!1}get name(){return"Firefox60"}close(){if(bu.debug("close()"),this._pc)try{this._pc.close()}catch(e){}this.emit("@close")}async getNativeRtpCapabilities(){bu.debug("getNativeRtpCapabilities()");const e=new RTCPeerConnection({iceServers:[],iceTransportPolicy:"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require"}),t=document.createElement("canvas");t.getContext("2d");const n=t.captureStream().getVideoTracks()[0];try{e.addTransceiver("audio",{direction:"sendrecv"});const i=e.addTransceiver(n,{direction:"sendrecv"}),s=i.sender.getParameters(),r=[{rid:"r0",maxBitrate:1e5},{rid:"r1",maxBitrate:5e5}];s.encodings=r,await i.sender.setParameters(s);const a=await e.createOffer();try{t.remove()}catch(e){}try{n.stop()}catch(e){}try{e.close()}catch(e){}const o=pu.parse(a.sdp);return hu.extractRtpCapabilities({sdpObject:o})}catch(i){try{t.remove()}catch(e){}try{n.stop()}catch(e){}try{e.close()}catch(e){}throw i}}async getNativeSctpCapabilities(){return bu.debug("getNativeSctpCapabilities()"),{numStreams:yu}}run({direction:e,iceParameters:t,iceCandidates:n,dtlsParameters:i,sctpParameters:s,iceServers:r,iceTransportPolicy:a,additionalSettings:o,proprietaryConstraints:c,extendedRtpCapabilities:p}){bu.debug("run()"),this._direction=e,this._remoteSdp=new vu.RemoteSdp({iceParameters:t,iceCandidates:n,dtlsParameters:i,sctpParameters:s}),this._sendingRtpParametersByKind={audio:mu.getSendingRtpParameters("audio",p),video:mu.getSendingRtpParameters("video",p)},this._sendingRemoteRtpParametersByKind={audio:mu.getSendingRemoteRtpParameters("audio",p),video:mu.getSendingRemoteRtpParameters("video",p)},this._pc=new RTCPeerConnection({iceServers:r||[],iceTransportPolicy:a||"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require",...o},c),this._pc.connectionState?this._pc.addEventListener("connectionstatechange",(()=>{this.emit("@connectionstatechange",this._pc.connectionState)})):this._pc.addEventListener("iceconnectionstatechange",(()=>{switch(bu.warn("run() | pc.connectionState not supported, using pc.iceConnectionState"),this._pc.iceConnectionState){case"checking":this.emit("@connectionstatechange","connecting");break;case"connected":case"completed":this.emit("@connectionstatechange","connected");break;case"failed":this.emit("@connectionstatechange","failed");break;case"disconnected":this.emit("@connectionstatechange","disconnected");break;case"closed":this.emit("@connectionstatechange","closed")}}))}async updateIceServers(e){throw new lu.UnsupportedError("not supported")}async restartIce(e){if(bu.debug("restartIce()"),this._remoteSdp.updateIceParameters(e),this._transportReady)if("send"===this._direction){const e=await this._pc.createOffer({iceRestart:!0});bu.debug("restartIce() | calling pc.setLocalDescription() [offer:%o]",e),await this._pc.setLocalDescription(e);const t={type:"answer",sdp:this._remoteSdp.getSdp()};bu.debug("restartIce() | calling pc.setRemoteDescription() [answer:%o]",t),await this._pc.setRemoteDescription(t)}else{const e={type:"offer",sdp:this._remoteSdp.getSdp()};bu.debug("restartIce() | calling pc.setRemoteDescription() [offer:%o]",e),await this._pc.setRemoteDescription(e);const t=await this._pc.createAnswer();bu.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:n,codec:i}){this.assertSendDirection(),bu.debug("send() [kind:%s, track.id:%s]",e.kind,e.id),t&&(t=uu.clone(t,[])).length>1&&(t.forEach(((e,t)=>{e.rid=`r${t}`})),t.reverse());const s=uu.clone(this._sendingRtpParametersByKind[e.kind],{});s.codecs=mu.reduceCodecs(s.codecs,i);const r=uu.clone(this._sendingRemoteRtpParametersByKind[e.kind],{});r.codecs=mu.reduceCodecs(r.codecs,i);const a=this._pc.addTransceiver(e,{direction:"sendonly",streams:[this._sendStream]});if(t){const e=a.sender.getParameters();e.encodings=t,await a.sender.setParameters(e)}const o=await this._pc.createOffer();let c=pu.parse(o.sdp);this._transportReady||await this.setupTransport({localDtlsRole:"client",localSdpObject:c}),bu.debug("send() | calling pc.setLocalDescription() [offer:%o]",o),await this._pc.setLocalDescription(o);const p=a.mid;s.mid=p,c=pu.parse(this._pc.localDescription.sdp);const d=c.media[c.media.length-1];if(s.rtcp.cname=hu.getCname({offerMediaObject:d}),t)if(1===t.length){const e=fu.getRtpEncodings({offerMediaObject:d});Object.assign(e[0],t[0]),s.encodings=e}else s.encodings=t.reverse();else s.encodings=fu.getRtpEncodings({offerMediaObject:d});if(s.encodings.length>1&&("video/vp8"===s.codecs[0].mimeType.toLowerCase()||"video/h264"===s.codecs[0].mimeType.toLowerCase()))for(const e of s.encodings)e.scalabilityMode="S1T2";this._remoteSdp.send({offerMediaObject:d,offerRtpParameters:s,answerRtpParameters:r,codecOptions:n,extmapAllowMixed:!0});const l={type:"answer",sdp:this._remoteSdp.getSdp()};return bu.debug("send() | calling pc.setRemoteDescription() [answer:%o]",l),await this._pc.setRemoteDescription(l),this._mapMidTransceiver.set(p,a),{localId:p,rtpParameters:s,rtpSender:a.sender}}async stopSending(e){bu.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 n=await this._pc.createOffer();bu.debug("stopSending() | calling pc.setLocalDescription() [offer:%o]",n),await this._pc.setLocalDescription(n);const i={type:"answer",sdp:this._remoteSdp.getSdp()};bu.debug("stopSending() | calling pc.setRemoteDescription() [answer:%o]",i),await this._pc.setRemoteDescription(i),this._mapMidTransceiver.delete(e)}async pauseSending(e){this.assertSendDirection(),bu.debug("pauseSending() [localId:%s]",e);const t=this._mapMidTransceiver.get(e);if(!t)throw new Error("associated RTCRtpTransceiver not found");t.direction="inactive",this._remoteSdp.pauseMediaSection(e);const n=await this._pc.createOffer();bu.debug("pauseSending() | calling pc.setLocalDescription() [offer:%o]",n),await this._pc.setLocalDescription(n);const i={type:"answer",sdp:this._remoteSdp.getSdp()};bu.debug("pauseSending() | calling pc.setRemoteDescription() [answer:%o]",i),await this._pc.setRemoteDescription(i)}async resumeSending(e){this.assertSendDirection(),bu.debug("resumeSending() [localId:%s]",e);const t=this._mapMidTransceiver.get(e);if(!t)throw new Error("associated RTCRtpTransceiver not found");t.direction="sendonly",this._remoteSdp.resumeSendingMediaSection(e);const n=await this._pc.createOffer();bu.debug("resumeSending() | calling pc.setLocalDescription() [offer:%o]",n),await this._pc.setLocalDescription(n);const i={type:"answer",sdp:this._remoteSdp.getSdp()};bu.debug("resumeSending() | calling pc.setRemoteDescription() [answer:%o]",i),await this._pc.setRemoteDescription(i)}async replaceTrack(e,t){this.assertSendDirection(),t?bu.debug("replaceTrack() [localId:%s, track.id:%s]",e,t.id):bu.debug("replaceTrack() [localId:%s, no track]",e);const n=this._mapMidTransceiver.get(e);if(!n)throw new Error("associated RTCRtpTransceiver not found");await n.sender.replaceTrack(t)}async setMaxSpatialLayer(e,t){this.assertSendDirection(),bu.debug("setMaxSpatialLayer() [localId:%s, spatialLayer:%s]",e,t);const n=this._mapMidTransceiver.get(e);if(!n)throw new Error("associated transceiver not found");const i=n.sender.getParameters();t=i.encodings.length-1-t,i.encodings.forEach(((e,n)=>{e.active=n>=t})),await n.sender.setParameters(i)}async setRtpEncodingParameters(e,t){this.assertSendDirection(),bu.debug("setRtpEncodingParameters() [localId:%s, params:%o]",e,t);const n=this._mapMidTransceiver.get(e);if(!n)throw new Error("associated RTCRtpTransceiver not found");const i=n.sender.getParameters();i.encodings.forEach(((e,n)=>{i.encodings[n]={...e,...t}})),await n.sender.setParameters(i)}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:n,label:i,protocol:s}){this.assertSendDirection();const r={negotiated:!0,id:this._nextSendSctpStreamId,ordered:e,maxPacketLifeTime:t,maxRetransmits:n,protocol:s};bu.debug("sendDataChannel() [options:%o]",r);const a=this._pc.createDataChannel(i,r);if(this._nextSendSctpStreamId=++this._nextSendSctpStreamId%yu.MIS,!this._hasDataChannelMediaSection){const e=await this._pc.createOffer(),t=pu.parse(e.sdp),n=t.media.find((e=>"application"===e.type));this._transportReady||await this.setupTransport({localDtlsRole:"client",localSdpObject:t}),bu.debug("sendDataChannel() | calling pc.setLocalDescription() [offer:%o]",e),await this._pc.setLocalDescription(e),this._remoteSdp.sendSctpAssociation({offerMediaObject:n});const i={type:"answer",sdp:this._remoteSdp.getSdp()};bu.debug("sendDataChannel() | calling pc.setRemoteDescription() [answer:%o]",i),await this._pc.setRemoteDescription(i),this._hasDataChannelMediaSection=!0}return{dataChannel:a,sctpStreamParameters:{streamId:r.id,ordered:r.ordered,maxPacketLifeTime:r.maxPacketLifeTime,maxRetransmits:r.maxRetransmits}}}async receive(e){this.assertRecvDirection();const t=[],n=new Map;for(const t of e){const{trackId:e,kind:i,rtpParameters:s,streamId:r}=t;bu.debug("receive() [trackId:%s, kind:%s]",e,i);const a=s.mid||String(this._mapMidTransceiver.size);n.set(e,a),this._remoteSdp.receive({mid:a,kind:i,offerRtpParameters:s,streamId:r||s.rtcp.cname,trackId:e})}const i={type:"offer",sdp:this._remoteSdp.getSdp()};bu.debug("receive() | calling pc.setRemoteDescription() [offer:%o]",i),await this._pc.setRemoteDescription(i);let s=await this._pc.createAnswer();const r=pu.parse(s.sdp);for(const t of e){const{trackId:e,rtpParameters:i}=t,a=n.get(e),o=r.media.find((e=>String(e.mid)===a));hu.applyCodecParameters({offerRtpParameters:i,answerMediaObject:o}),s={type:"answer",sdp:pu.write(r)}}this._transportReady||await this.setupTransport({localDtlsRole:"client",localSdpObject:r}),bu.debug("receive() | calling pc.setLocalDescription() [answer:%o]",s),await this._pc.setLocalDescription(s);for(const i of e){const{trackId:e}=i,s=n.get(e),r=this._pc.getTransceivers().find((e=>e.mid===s));if(!r)throw new Error("new RTCRtpTransceiver not found");this._mapMidTransceiver.set(s,r),t.push({localId:s,track:r.receiver.track,rtpReceiver:r.receiver})}return t}async stopReceiving(e){this.assertRecvDirection();for(const t of e){bu.debug("stopReceiving() [localId:%s]",t);const e=this._mapMidTransceiver.get(t);if(!e)throw new Error("associated RTCRtpTransceiver not found");this._remoteSdp.closeMediaSection(e.mid)}const t={type:"offer",sdp:this._remoteSdp.getSdp()};bu.debug("stopReceiving() | calling pc.setRemoteDescription() [offer:%o]",t),await this._pc.setRemoteDescription(t);const n=await this._pc.createAnswer();bu.debug("stopReceiving() | calling pc.setLocalDescription() [answer:%o]",n),await this._pc.setLocalDescription(n);for(const t of e)this._mapMidTransceiver.delete(t)}async pauseReceiving(e){this.assertRecvDirection();for(const t of e){bu.debug("pauseReceiving() [localId:%s]",t);const e=this._mapMidTransceiver.get(t);if(!e)throw new Error("associated RTCRtpTransceiver not found");e.direction="inactive",this._remoteSdp.pauseMediaSection(t)}const t={type:"offer",sdp:this._remoteSdp.getSdp()};bu.debug("pauseReceiving() | calling pc.setRemoteDescription() [offer:%o]",t),await this._pc.setRemoteDescription(t);const n=await this._pc.createAnswer();bu.debug("pauseReceiving() | calling pc.setLocalDescription() [answer:%o]",n),await this._pc.setLocalDescription(n)}async resumeReceiving(e){this.assertRecvDirection();for(const t of e){bu.debug("resumeReceiving() [localId:%s]",t);const e=this._mapMidTransceiver.get(t);if(!e)throw new Error("associated RTCRtpTransceiver not found");e.direction="recvonly",this._remoteSdp.resumeReceivingMediaSection(t)}const t={type:"offer",sdp:this._remoteSdp.getSdp()};bu.debug("resumeReceiving() | calling pc.setRemoteDescription() [offer:%o]",t),await this._pc.setRemoteDescription(t);const n=await this._pc.createAnswer();bu.debug("resumeReceiving() | calling pc.setLocalDescription() [answer:%o]",n),await this._pc.setLocalDescription(n)}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:n}){this.assertRecvDirection();const{streamId:i,ordered:s,maxPacketLifeTime:r,maxRetransmits:a}=e,o={negotiated:!0,id:i,ordered:s,maxPacketLifeTime:r,maxRetransmits:a,protocol:n};bu.debug("receiveDataChannel() [options:%o]",o);const c=this._pc.createDataChannel(t,o);if(!this._hasDataChannelMediaSection){this._remoteSdp.receiveSctpAssociation();const e={type:"offer",sdp:this._remoteSdp.getSdp()};bu.debug("receiveDataChannel() | calling pc.setRemoteDescription() [offer:%o]",e),await this._pc.setRemoteDescription(e);const t=await this._pc.createAnswer();if(!this._transportReady){const e=pu.parse(t.sdp);await this.setupTransport({localDtlsRole:"client",localSdpObject:e})}bu.debug("receiveDataChannel() | calling pc.setRemoteDescription() [answer:%o]",t),await this._pc.setLocalDescription(t),this._hasDataChannelMediaSection=!0}return{dataChannel:c}}async setupTransport({localDtlsRole:e,localSdpObject:t}){t||(t=pu.parse(this._pc.localDescription.sdp));const n=hu.extractDtlsParameters({sdpObject:t});n.role=e,this._remoteSdp.updateDtlsRole("client"===e?"server":"client"),await new Promise(((e,t)=>{this.safeEmit("@connect",{dtlsParameters:n},e,t)})),this._transportReady=!0}assertSendDirection(){if("send"!==this._direction)throw new Error('method can just be called for handlers with "send" direction')}assertRecvDirection(){if("recv"!==this._direction)throw new Error('method can just be called for handlers with "recv" direction')}}ru.Firefox60=_u;var xu={},wu=Zt&&Zt.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),Su=Zt&&Zt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),ku=Zt&&Zt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&wu(t,e,n);return Su(t,e),t};Object.defineProperty(xu,"__esModule",{value:!0}),xu.Safari12=void 0;const Cu=ku(md),Ru=Vc,Tu=ku(tp),Pu=ku(np),Eu=ku(Cd),Ou=ku(Od),Du=Dd,ju=Md,Iu=new Ru.Logger("Safari12"),Mu={OS:1024,MIS:1024};class Lu extends Du.HandlerInterface{static createFactory(){return()=>new Lu}constructor(){super(),this._mapMidTransceiver=new Map,this._sendStream=new MediaStream,this._hasDataChannelMediaSection=!1,this._nextSendSctpStreamId=0,this._transportReady=!1}get name(){return"Safari12"}close(){if(Iu.debug("close()"),this._pc)try{this._pc.close()}catch(e){}this.emit("@close")}async getNativeRtpCapabilities(){Iu.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 n=Cu.parse(t.sdp);return Eu.extractRtpCapabilities({sdpObject:n})}catch(t){try{e.close()}catch(e){}throw t}}async getNativeSctpCapabilities(){return Iu.debug("getNativeSctpCapabilities()"),{numStreams:Mu}}run({direction:e,iceParameters:t,iceCandidates:n,dtlsParameters:i,sctpParameters:s,iceServers:r,iceTransportPolicy:a,additionalSettings:o,proprietaryConstraints:c,extendedRtpCapabilities:p}){Iu.debug("run()"),this._direction=e,this._remoteSdp=new ju.RemoteSdp({iceParameters:t,iceCandidates:n,dtlsParameters:i,sctpParameters:s}),this._sendingRtpParametersByKind={audio:Pu.getSendingRtpParameters("audio",p),video:Pu.getSendingRtpParameters("video",p)},this._sendingRemoteRtpParametersByKind={audio:Pu.getSendingRemoteRtpParameters("audio",p),video:Pu.getSendingRemoteRtpParameters("video",p)},i.role&&"auto"!==i.role&&(this._forcedLocalDtlsRole="server"===i.role?"client":"server"),this._pc=new RTCPeerConnection({iceServers:r||[],iceTransportPolicy:a||"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require",...o},c),this._pc.connectionState?this._pc.addEventListener("connectionstatechange",(()=>{this.emit("@connectionstatechange",this._pc.connectionState)})):this._pc.addEventListener("iceconnectionstatechange",(()=>{switch(Iu.warn("run() | pc.connectionState not supported, using pc.iceConnectionState"),this._pc.iceConnectionState){case"checking":this.emit("@connectionstatechange","connecting");break;case"connected":case"completed":this.emit("@connectionstatechange","connected");break;case"failed":this.emit("@connectionstatechange","failed");break;case"disconnected":this.emit("@connectionstatechange","disconnected");break;case"closed":this.emit("@connectionstatechange","closed")}}))}async updateIceServers(e){Iu.debug("updateIceServers()");const t=this._pc.getConfiguration();t.iceServers=e,this._pc.setConfiguration(t)}async restartIce(e){if(Iu.debug("restartIce()"),this._remoteSdp.updateIceParameters(e),this._transportReady)if("send"===this._direction){const e=await this._pc.createOffer({iceRestart:!0});Iu.debug("restartIce() | calling pc.setLocalDescription() [offer:%o]",e),await this._pc.setLocalDescription(e);const t={type:"answer",sdp:this._remoteSdp.getSdp()};Iu.debug("restartIce() | calling pc.setRemoteDescription() [answer:%o]",t),await this._pc.setRemoteDescription(t)}else{const e={type:"offer",sdp:this._remoteSdp.getSdp()};Iu.debug("restartIce() | calling pc.setRemoteDescription() [offer:%o]",e),await this._pc.setRemoteDescription(e);const t=await this._pc.createAnswer();Iu.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:n,codec:i}){var s;this.assertSendDirection(),Iu.debug("send() [kind:%s, track.id:%s]",e.kind,e.id);const r=Tu.clone(this._sendingRtpParametersByKind[e.kind],{});r.codecs=Pu.reduceCodecs(r.codecs,i);const a=Tu.clone(this._sendingRemoteRtpParametersByKind[e.kind],{});a.codecs=Pu.reduceCodecs(a.codecs,i);const o=this._remoteSdp.getNextMediaSectionIdx(),c=this._pc.addTransceiver(e,{direction:"sendonly",streams:[this._sendStream]});let p,d=await this._pc.createOffer(),l=Cu.parse(d.sdp);this._transportReady||await this.setupTransport({localDtlsRole:null!==(s=this._forcedLocalDtlsRole)&&void 0!==s?s:"client",localSdpObject:l}),t&&t.length>1&&(Iu.debug("send() | enabling legacy simulcast"),l=Cu.parse(d.sdp),p=l.media[o.idx],Ou.addLegacySimulcast({offerMediaObject:p,numStreams:t.length}),d={type:"offer",sdp:Cu.write(l)}),Iu.debug("send() | calling pc.setLocalDescription() [offer:%o]",d),await this._pc.setLocalDescription(d);const u=c.mid;if(r.mid=u,l=Cu.parse(this._pc.localDescription.sdp),p=l.media[o.idx],r.rtcp.cname=Eu.getCname({offerMediaObject:p}),r.encodings=Ou.getRtpEncodings({offerMediaObject:p}),t)for(let e=0;e<r.encodings.length;++e)t[e]&&Object.assign(r.encodings[e],t[e]);if(r.encodings.length>1&&("video/vp8"===r.codecs[0].mimeType.toLowerCase()||"video/h264"===r.codecs[0].mimeType.toLowerCase()))for(const e of r.encodings)e.scalabilityMode="S1T3";this._remoteSdp.send({offerMediaObject:p,reuseMid:o.reuseMid,offerRtpParameters:r,answerRtpParameters:a,codecOptions:n});const m={type:"answer",sdp:this._remoteSdp.getSdp()};return Iu.debug("send() | calling pc.setRemoteDescription() [answer:%o]",m),await this._pc.setRemoteDescription(m),this._mapMidTransceiver.set(u,c),{localId:u,rtpParameters:r,rtpSender:c.sender}}async stopSending(e){this.assertSendDirection(),Iu.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);if(this._remoteSdp.closeMediaSection(t.mid))try{t.stop()}catch(e){}const n=await this._pc.createOffer();Iu.debug("stopSending() | calling pc.setLocalDescription() [offer:%o]",n),await this._pc.setLocalDescription(n);const i={type:"answer",sdp:this._remoteSdp.getSdp()};Iu.debug("stopSending() | calling pc.setRemoteDescription() [answer:%o]",i),await this._pc.setRemoteDescription(i),this._mapMidTransceiver.delete(e)}async pauseSending(e){this.assertSendDirection(),Iu.debug("pauseSending() [localId:%s]",e);const t=this._mapMidTransceiver.get(e);if(!t)throw new Error("associated RTCRtpTransceiver not found");t.direction="inactive",this._remoteSdp.pauseMediaSection(e);const n=await this._pc.createOffer();Iu.debug("pauseSending() | calling pc.setLocalDescription() [offer:%o]",n),await this._pc.setLocalDescription(n);const i={type:"answer",sdp:this._remoteSdp.getSdp()};Iu.debug("pauseSending() | calling pc.setRemoteDescription() [answer:%o]",i),await this._pc.setRemoteDescription(i)}async resumeSending(e){this.assertSendDirection(),Iu.debug("resumeSending() [localId:%s]",e);const t=this._mapMidTransceiver.get(e);if(!t)throw new Error("associated RTCRtpTransceiver not found");t.direction="sendonly",this._remoteSdp.resumeSendingMediaSection(e);const n=await this._pc.createOffer();Iu.debug("resumeSending() | calling pc.setLocalDescription() [offer:%o]",n),await this._pc.setLocalDescription(n);const i={type:"answer",sdp:this._remoteSdp.getSdp()};Iu.debug("resumeSending() | calling pc.setRemoteDescription() [answer:%o]",i),await this._pc.setRemoteDescription(i)}async replaceTrack(e,t){this.assertSendDirection(),t?Iu.debug("replaceTrack() [localId:%s, track.id:%s]",e,t.id):Iu.debug("replaceTrack() [localId:%s, no track]",e);const n=this._mapMidTransceiver.get(e);if(!n)throw new Error("associated RTCRtpTransceiver not found");await n.sender.replaceTrack(t)}async setMaxSpatialLayer(e,t){this.assertSendDirection(),Iu.debug("setMaxSpatialLayer() [localId:%s, spatialLayer:%s]",e,t);const n=this._mapMidTransceiver.get(e);if(!n)throw new Error("associated RTCRtpTransceiver not found");const i=n.sender.getParameters();i.encodings.forEach(((e,n)=>{e.active=n<=t})),await n.sender.setParameters(i)}async setRtpEncodingParameters(e,t){this.assertSendDirection(),Iu.debug("setRtpEncodingParameters() [localId:%s, params:%o]",e,t);const n=this._mapMidTransceiver.get(e);if(!n)throw new Error("associated RTCRtpTransceiver not found");const i=n.sender.getParameters();i.encodings.forEach(((e,n)=>{i.encodings[n]={...e,...t}})),await n.sender.setParameters(i)}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:n,label:i,protocol:s}){var r;this.assertSendDirection();const a={negotiated:!0,id:this._nextSendSctpStreamId,ordered:e,maxPacketLifeTime:t,maxRetransmits:n,protocol:s};Iu.debug("sendDataChannel() [options:%o]",a);const o=this._pc.createDataChannel(i,a);if(this._nextSendSctpStreamId=++this._nextSendSctpStreamId%Mu.MIS,!this._hasDataChannelMediaSection){const e=await this._pc.createOffer(),t=Cu.parse(e.sdp),n=t.media.find((e=>"application"===e.type));this._transportReady||await this.setupTransport({localDtlsRole:null!==(r=this._forcedLocalDtlsRole)&&void 0!==r?r:"client",localSdpObject:t}),Iu.debug("sendDataChannel() | calling pc.setLocalDescription() [offer:%o]",e),await this._pc.setLocalDescription(e),this._remoteSdp.sendSctpAssociation({offerMediaObject:n});const i={type:"answer",sdp:this._remoteSdp.getSdp()};Iu.debug("sendDataChannel() | calling pc.setRemoteDescription() [answer:%o]",i),await this._pc.setRemoteDescription(i),this._hasDataChannelMediaSection=!0}return{dataChannel:o,sctpStreamParameters:{streamId:a.id,ordered:a.ordered,maxPacketLifeTime:a.maxPacketLifeTime,maxRetransmits:a.maxRetransmits}}}async receive(e){var t;this.assertRecvDirection();const n=[],i=new Map;for(const t of e){const{trackId:e,kind:n,rtpParameters:s,streamId:r}=t;Iu.debug("receive() [trackId:%s, kind:%s]",e,n);const a=s.mid||String(this._mapMidTransceiver.size);i.set(e,a),this._remoteSdp.receive({mid:a,kind:n,offerRtpParameters:s,streamId:r||s.rtcp.cname,trackId:e})}const s={type:"offer",sdp:this._remoteSdp.getSdp()};Iu.debug("receive() | calling pc.setRemoteDescription() [offer:%o]",s),await this._pc.setRemoteDescription(s);let r=await this._pc.createAnswer();const a=Cu.parse(r.sdp);for(const t of e){const{trackId:e,rtpParameters:n}=t,s=i.get(e),r=a.media.find((e=>String(e.mid)===s));Eu.applyCodecParameters({offerRtpParameters:n,answerMediaObject:r})}r={type:"answer",sdp:Cu.write(a)},this._transportReady||await this.setupTransport({localDtlsRole:null!==(t=this._forcedLocalDtlsRole)&&void 0!==t?t:"client",localSdpObject:a}),Iu.debug("receive() | calling pc.setLocalDescription() [answer:%o]",r),await this._pc.setLocalDescription(r);for(const t of e){const{trackId:e}=t,s=i.get(e),r=this._pc.getTransceivers().find((e=>e.mid===s));if(!r)throw new Error("new RTCRtpTransceiver not found");this._mapMidTransceiver.set(s,r),n.push({localId:s,track:r.receiver.track,rtpReceiver:r.receiver})}return n}async stopReceiving(e){this.assertRecvDirection();for(const t of e){Iu.debug("stopReceiving() [localId:%s]",t);const e=this._mapMidTransceiver.get(t);if(!e)throw new Error("associated RTCRtpTransceiver not found");this._remoteSdp.closeMediaSection(e.mid)}const t={type:"offer",sdp:this._remoteSdp.getSdp()};Iu.debug("stopReceiving() | calling pc.setRemoteDescription() [offer:%o]",t),await this._pc.setRemoteDescription(t);const n=await this._pc.createAnswer();Iu.debug("stopReceiving() | calling pc.setLocalDescription() [answer:%o]",n),await this._pc.setLocalDescription(n);for(const t of e)this._mapMidTransceiver.delete(t)}async pauseReceiving(e){this.assertRecvDirection();for(const t of e){Iu.debug("pauseReceiving() [localId:%s]",t);const e=this._mapMidTransceiver.get(t);if(!e)throw new Error("associated RTCRtpTransceiver not found");e.direction="inactive",this._remoteSdp.pauseMediaSection(t)}const t={type:"offer",sdp:this._remoteSdp.getSdp()};Iu.debug("pauseReceiving() | calling pc.setRemoteDescription() [offer:%o]",t),await this._pc.setRemoteDescription(t);const n=await this._pc.createAnswer();Iu.debug("pauseReceiving() | calling pc.setLocalDescription() [answer:%o]",n),await this._pc.setLocalDescription(n)}async resumeReceiving(e){this.assertRecvDirection();for(const t of e){Iu.debug("resumeReceiving() [localId:%s]",t);const e=this._mapMidTransceiver.get(t);if(!e)throw new Error("associated RTCRtpTransceiver not found");e.direction="recvonly",this._remoteSdp.resumeReceivingMediaSection(t)}const t={type:"offer",sdp:this._remoteSdp.getSdp()};Iu.debug("resumeReceiving() | calling pc.setRemoteDescription() [offer:%o]",t),await this._pc.setRemoteDescription(t);const n=await this._pc.createAnswer();Iu.debug("resumeReceiving() | calling pc.setLocalDescription() [answer:%o]",n),await this._pc.setLocalDescription(n)}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:n}){var i;this.assertRecvDirection();const{streamId:s,ordered:r,maxPacketLifeTime:a,maxRetransmits:o}=e,c={negotiated:!0,id:s,ordered:r,maxPacketLifeTime:a,maxRetransmits:o,protocol:n};Iu.debug("receiveDataChannel() [options:%o]",c);const p=this._pc.createDataChannel(t,c);if(!this._hasDataChannelMediaSection){this._remoteSdp.receiveSctpAssociation();const e={type:"offer",sdp:this._remoteSdp.getSdp()};Iu.debug("receiveDataChannel() | calling pc.setRemoteDescription() [offer:%o]",e),await this._pc.setRemoteDescription(e);const t=await this._pc.createAnswer();if(!this._transportReady){const e=Cu.parse(t.sdp);await this.setupTransport({localDtlsRole:null!==(i=this._forcedLocalDtlsRole)&&void 0!==i?i:"client",localSdpObject:e})}Iu.debug("receiveDataChannel() | calling pc.setRemoteDescription() [answer:%o]",t),await this._pc.setLocalDescription(t),this._hasDataChannelMediaSection=!0}return{dataChannel:p}}async setupTransport({localDtlsRole:e,localSdpObject:t}){t||(t=Cu.parse(this._pc.localDescription.sdp));const n=Eu.extractDtlsParameters({sdpObject:t});n.role=e,this._remoteSdp.updateDtlsRole("client"===e?"server":"client"),await new Promise(((e,t)=>{this.safeEmit("@connect",{dtlsParameters:n},e,t)})),this._transportReady=!0}assertSendDirection(){if("send"!==this._direction)throw new Error('method can just be called for handlers with "send" direction')}assertRecvDirection(){if("recv"!==this._direction)throw new Error('method can just be called for handlers with "recv" direction')}}xu.Safari12=Lu;var Au={},Nu=Zt&&Zt.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),Bu=Zt&&Zt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Fu=Zt&&Zt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&Nu(t,e,n);return Bu(t,e),t};Object.defineProperty(Au,"__esModule",{value:!0}),Au.Safari11=void 0;const Uu=Fu(md),zu=Vc,qu=Fu(tp),$u=Fu(np),Vu=Fu(Cd),Hu=Fu(Pl),Wu=Dd,Gu=Md,Ku=new zu.Logger("Safari11"),Ju={OS:1024,MIS:1024};class Qu extends Wu.HandlerInterface{static createFactory(){return()=>new Qu}constructor(){super(),this._sendStream=new MediaStream,this._mapSendLocalIdRtpSender=new Map,this._nextSendLocalId=0,this._mapRecvLocalIdInfo=new Map,this._hasDataChannelMediaSection=!1,this._nextSendSctpStreamId=0,this._transportReady=!1}get name(){return"Safari11"}close(){if(Ku.debug("close()"),this._pc)try{this._pc.close()}catch(e){}this.emit("@close")}async getNativeRtpCapabilities(){Ku.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 n=Uu.parse(t.sdp);return Vu.extractRtpCapabilities({sdpObject:n})}catch(t){try{e.close()}catch(e){}throw t}}async getNativeSctpCapabilities(){return Ku.debug("getNativeSctpCapabilities()"),{numStreams:Ju}}run({direction:e,iceParameters:t,iceCandidates:n,dtlsParameters:i,sctpParameters:s,iceServers:r,iceTransportPolicy:a,additionalSettings:o,proprietaryConstraints:c,extendedRtpCapabilities:p}){Ku.debug("run()"),this._direction=e,this._remoteSdp=new Gu.RemoteSdp({iceParameters:t,iceCandidates:n,dtlsParameters:i,sctpParameters:s,planB:!0}),this._sendingRtpParametersByKind={audio:$u.getSendingRtpParameters("audio",p),video:$u.getSendingRtpParameters("video",p)},this._sendingRemoteRtpParametersByKind={audio:$u.getSendingRemoteRtpParameters("audio",p),video:$u.getSendingRemoteRtpParameters("video",p)},i.role&&"auto"!==i.role&&(this._forcedLocalDtlsRole="server"===i.role?"client":"server"),this._pc=new RTCPeerConnection({iceServers:r||[],iceTransportPolicy:a||"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require",...o},c),this._pc.connectionState?this._pc.addEventListener("connectionstatechange",(()=>{this.emit("@connectionstatechange",this._pc.connectionState)})):this._pc.addEventListener("iceconnectionstatechange",(()=>{switch(Ku.warn("run() | pc.connectionState not supported, using pc.iceConnectionState"),this._pc.iceConnectionState){case"checking":this.emit("@connectionstatechange","connecting");break;case"connected":case"completed":this.emit("@connectionstatechange","connected");break;case"failed":this.emit("@connectionstatechange","failed");break;case"disconnected":this.emit("@connectionstatechange","disconnected");break;case"closed":this.emit("@connectionstatechange","closed")}}))}async updateIceServers(e){Ku.debug("updateIceServers()");const t=this._pc.getConfiguration();t.iceServers=e,this._pc.setConfiguration(t)}async restartIce(e){if(Ku.debug("restartIce()"),this._remoteSdp.updateIceParameters(e),this._transportReady)if("send"===this._direction){const e=await this._pc.createOffer({iceRestart:!0});Ku.debug("restartIce() | calling pc.setLocalDescription() [offer:%o]",e),await this._pc.setLocalDescription(e);const t={type:"answer",sdp:this._remoteSdp.getSdp()};Ku.debug("restartIce() | calling pc.setRemoteDescription() [answer:%o]",t),await this._pc.setRemoteDescription(t)}else{const e={type:"offer",sdp:this._remoteSdp.getSdp()};Ku.debug("restartIce() | calling pc.setRemoteDescription() [offer:%o]",e),await this._pc.setRemoteDescription(e);const t=await this._pc.createAnswer();Ku.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:n,codec:i}){var s;this.assertSendDirection(),Ku.debug("send() [kind:%s, track.id:%s]",e.kind,e.id),i&&Ku.warn("send() | codec selection is not available in %s handler",this.name),this._sendStream.addTrack(e),this._pc.addTrack(e,this._sendStream);let r,a=await this._pc.createOffer(),o=Uu.parse(a.sdp);const c=qu.clone(this._sendingRtpParametersByKind[e.kind],{});c.codecs=$u.reduceCodecs(c.codecs);const p=qu.clone(this._sendingRemoteRtpParametersByKind[e.kind],{});if(p.codecs=$u.reduceCodecs(p.codecs),this._transportReady||await this.setupTransport({localDtlsRole:null!==(s=this._forcedLocalDtlsRole)&&void 0!==s?s:"client",localSdpObject:o}),"video"===e.kind&&t&&t.length>1&&(Ku.debug("send() | enabling simulcast"),o=Uu.parse(a.sdp),r=o.media.find((e=>"video"===e.type)),Hu.addLegacySimulcast({offerMediaObject:r,track:e,numStreams:t.length}),a={type:"offer",sdp:Uu.write(o)}),Ku.debug("send() | calling pc.setLocalDescription() [offer:%o]",a),await this._pc.setLocalDescription(a),o=Uu.parse(this._pc.localDescription.sdp),r=o.media.find((t=>t.type===e.kind)),c.rtcp.cname=Vu.getCname({offerMediaObject:r}),c.encodings=Hu.getRtpEncodings({offerMediaObject:r,track:e}),t)for(let e=0;e<c.encodings.length;++e)t[e]&&Object.assign(c.encodings[e],t[e]);if(c.encodings.length>1&&"video/vp8"===c.codecs[0].mimeType.toLowerCase())for(const e of c.encodings)e.scalabilityMode="S1T3";this._remoteSdp.send({offerMediaObject:r,offerRtpParameters:c,answerRtpParameters:p,codecOptions:n});const d={type:"answer",sdp:this._remoteSdp.getSdp()};Ku.debug("send() | calling pc.setRemoteDescription() [answer:%o]",d),await this._pc.setRemoteDescription(d);const l=String(this._nextSendLocalId);this._nextSendLocalId++;const u=this._pc.getSenders().find((t=>t.track===e));return this._mapSendLocalIdRtpSender.set(l,u),{localId:l,rtpParameters:c,rtpSender:u}}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 n=await this._pc.createOffer();Ku.debug("stopSending() | calling pc.setLocalDescription() [offer:%o]",n);try{await this._pc.setLocalDescription(n)}catch(e){if(0===this._sendStream.getTracks().length)return void Ku.warn("stopSending() | ignoring expected error due no sending tracks: %s",e.toString());throw e}if("stable"===this._pc.signalingState)return;const i={type:"answer",sdp:this._remoteSdp.getSdp()};Ku.debug("stopSending() | calling pc.setRemoteDescription() [answer:%o]",i),await this._pc.setRemoteDescription(i)}async pauseSending(e){}async resumeSending(e){}async replaceTrack(e,t){this.assertSendDirection(),t?Ku.debug("replaceTrack() [localId:%s, track.id:%s]",e,t.id):Ku.debug("replaceTrack() [localId:%s, no track]",e);const n=this._mapSendLocalIdRtpSender.get(e);if(!n)throw new Error("associated RTCRtpSender not found");const i=n.track;await n.replaceTrack(t),i&&this._sendStream.removeTrack(i),t&&this._sendStream.addTrack(t)}async setMaxSpatialLayer(e,t){this.assertSendDirection(),Ku.debug("setMaxSpatialLayer() [localId:%s, spatialLayer:%s]",e,t);const n=this._mapSendLocalIdRtpSender.get(e);if(!n)throw new Error("associated RTCRtpSender not found");const i=n.getParameters();i.encodings.forEach(((e,n)=>{e.active=n<=t})),await n.setParameters(i)}async setRtpEncodingParameters(e,t){this.assertSendDirection(),Ku.debug("setRtpEncodingParameters() [localId:%s, params:%o]",e,t);const n=this._mapSendLocalIdRtpSender.get(e);if(!n)throw new Error("associated RTCRtpSender not found");const i=n.getParameters();i.encodings.forEach(((e,n)=>{i.encodings[n]={...e,...t}})),await n.setParameters(i)}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:n,label:i,protocol:s}){var r;this.assertSendDirection();const a={negotiated:!0,id:this._nextSendSctpStreamId,ordered:e,maxPacketLifeTime:t,maxRetransmits:n,protocol:s};Ku.debug("sendDataChannel() [options:%o]",a);const o=this._pc.createDataChannel(i,a);if(this._nextSendSctpStreamId=++this._nextSendSctpStreamId%Ju.MIS,!this._hasDataChannelMediaSection){const e=await this._pc.createOffer(),t=Uu.parse(e.sdp),n=t.media.find((e=>"application"===e.type));this._transportReady||await this.setupTransport({localDtlsRole:null!==(r=this._forcedLocalDtlsRole)&&void 0!==r?r:"client",localSdpObject:t}),Ku.debug("sendDataChannel() | calling pc.setLocalDescription() [offer:%o]",e),await this._pc.setLocalDescription(e),this._remoteSdp.sendSctpAssociation({offerMediaObject:n});const i={type:"answer",sdp:this._remoteSdp.getSdp()};Ku.debug("sendDataChannel() | calling pc.setRemoteDescription() [answer:%o]",i),await this._pc.setRemoteDescription(i),this._hasDataChannelMediaSection=!0}return{dataChannel:o,sctpStreamParameters:{streamId:a.id,ordered:a.ordered,maxPacketLifeTime:a.maxPacketLifeTime,maxRetransmits:a.maxRetransmits}}}async receive(e){var t;this.assertRecvDirection();const n=[];for(const t of e){const{trackId:e,kind:n,rtpParameters:i,streamId:s}=t;Ku.debug("receive() [trackId:%s, kind:%s]",e,n);const r=n;this._remoteSdp.receive({mid:r,kind:n,offerRtpParameters:i,streamId:s||i.rtcp.cname,trackId:e})}const i={type:"offer",sdp:this._remoteSdp.getSdp()};Ku.debug("receive() | calling pc.setRemoteDescription() [offer:%o]",i),await this._pc.setRemoteDescription(i);let s=await this._pc.createAnswer();const r=Uu.parse(s.sdp);for(const t of e){const{kind:e,rtpParameters:n}=t,i=e,s=r.media.find((e=>String(e.mid)===i));Vu.applyCodecParameters({offerRtpParameters:n,answerMediaObject:s})}s={type:"answer",sdp:Uu.write(r)},this._transportReady||await this.setupTransport({localDtlsRole:null!==(t=this._forcedLocalDtlsRole)&&void 0!==t?t:"client",localSdpObject:r}),Ku.debug("receive() | calling pc.setLocalDescription() [answer:%o]",s),await this._pc.setLocalDescription(s);for(const t of e){const{kind:e,trackId:i,rtpParameters:s}=t,r=e,a=i,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:r,rtpParameters:s,rtpReceiver:o}),n.push({localId:a,track:o.track,rtpReceiver:o})}return n}async stopReceiving(e){this.assertRecvDirection();for(const t of e){Ku.debug("stopReceiving() [localId:%s]",t);const{mid:e,rtpParameters:n}=this._mapRecvLocalIdInfo.get(t)||{};this._mapRecvLocalIdInfo.delete(t),this._remoteSdp.planBStopReceiving({mid:e,offerRtpParameters:n})}const t={type:"offer",sdp:this._remoteSdp.getSdp()};Ku.debug("stopReceiving() | calling pc.setRemoteDescription() [offer:%o]",t),await this._pc.setRemoteDescription(t);const n=await this._pc.createAnswer();Ku.debug("stopReceiving() | calling pc.setLocalDescription() [answer:%o]",n),await this._pc.setLocalDescription(n)}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:n}){var i;this.assertRecvDirection();const{streamId:s,ordered:r,maxPacketLifeTime:a,maxRetransmits:o}=e,c={negotiated:!0,id:s,ordered:r,maxPacketLifeTime:a,maxRetransmits:o,protocol:n};Ku.debug("receiveDataChannel() [options:%o]",c);const p=this._pc.createDataChannel(t,c);if(!this._hasDataChannelMediaSection){this._remoteSdp.receiveSctpAssociation({oldDataChannelSpec:!0});const e={type:"offer",sdp:this._remoteSdp.getSdp()};Ku.debug("receiveDataChannel() | calling pc.setRemoteDescription() [offer:%o]",e),await this._pc.setRemoteDescription(e);const t=await this._pc.createAnswer();if(!this._transportReady){const e=Uu.parse(t.sdp);await this.setupTransport({localDtlsRole:null!==(i=this._forcedLocalDtlsRole)&&void 0!==i?i:"client",localSdpObject:e})}Ku.debug("receiveDataChannel() | calling pc.setRemoteDescription() [answer:%o]",t),await this._pc.setLocalDescription(t),this._hasDataChannelMediaSection=!0}return{dataChannel:p}}async setupTransport({localDtlsRole:e,localSdpObject:t}){t||(t=Uu.parse(this._pc.localDescription.sdp));const n=Vu.extractDtlsParameters({sdpObject:t});n.role=e,this._remoteSdp.updateDtlsRole("client"===e?"server":"client"),await new Promise(((e,t)=>{this.safeEmit("@connect",{dtlsParameters:n},e,t)})),this._transportReady=!0}assertSendDirection(){if("send"!==this._direction)throw new Error('method can just be called for handlers with "send" direction')}assertRecvDirection(){if("recv"!==this._direction)throw new Error('method can just be called for handlers with "recv" direction')}}Au.Safari11=Qu;var Yu={},Xu={},Zu=Zt&&Zt.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),em=Zt&&Zt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),tm=Zt&&Zt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&Zu(t,e,n);return em(t,e),t};Object.defineProperty(Xu,"__esModule",{value:!0}),Xu.mangleRtpParameters=Xu.getCapabilities=void 0;const nm=tm(tp);Xu.getCapabilities=function(){const e=RTCRtpReceiver.getCapabilities(),t=nm.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},Xu.mangleRtpParameters=function(e){const t=nm.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};var im=Zt&&Zt.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),sm=Zt&&Zt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),rm=Zt&&Zt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&im(t,e,n);return sm(t,e),t};Object.defineProperty(Yu,"__esModule",{value:!0}),Yu.Edge11=void 0;const am=Vc,om=Xc,cm=rm(tp),pm=rm(np),dm=rm(Xu),lm=Dd,um=new am.Logger("Edge11");class mm extends lm.HandlerInterface{static createFactory(){return()=>new mm}constructor(){super(),this._rtpSenders=new Map,this._rtpReceivers=new Map,this._nextSendLocalId=0,this._transportReady=!1}get name(){return"Edge11"}close(){um.debug("close()");try{this._iceGatherer.close()}catch(e){}try{this._iceTransport.stop()}catch(e){}try{this._dtlsTransport.stop()}catch(e){}for(const e of this._rtpSenders.values())try{e.stop()}catch(e){}for(const e of this._rtpReceivers.values())try{e.stop()}catch(e){}this.emit("@close")}async getNativeRtpCapabilities(){return um.debug("getNativeRtpCapabilities()"),dm.getCapabilities()}async getNativeSctpCapabilities(){return um.debug("getNativeSctpCapabilities()"),{numStreams:{OS:0,MIS:0}}}run({direction:e,iceParameters:t,iceCandidates:n,dtlsParameters:i,sctpParameters:s,iceServers:r,iceTransportPolicy:a,additionalSettings:o,proprietaryConstraints:c,extendedRtpCapabilities:p}){um.debug("run()"),this._sendingRtpParametersByKind={audio:pm.getSendingRtpParameters("audio",p),video:pm.getSendingRtpParameters("video",p)},this._remoteIceParameters=t,this._remoteIceCandidates=n,this._remoteDtlsParameters=i,this._cname=`CNAME-${cm.generateRandomNumber()}`,this.setIceGatherer({iceServers:r,iceTransportPolicy:a}),this.setIceTransport(),this.setDtlsTransport()}async updateIceServers(e){throw new om.UnsupportedError("not supported")}async restartIce(e){if(um.debug("restartIce()"),this._remoteIceParameters=e,this._transportReady){um.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:n,codec:i}){um.debug("send() [kind:%s, track.id:%s]",e.kind,e.id),this._transportReady||await this.setupTransport({localDtlsRole:"server"}),um.debug("send() | calling new RTCRtpSender()");const s=new RTCRtpSender(e,this._dtlsTransport),r=cm.clone(this._sendingRtpParametersByKind[e.kind],{});r.codecs=pm.reduceCodecs(r.codecs,i);const a=r.codecs.some((e=>/.+\/rtx$/i.test(e.mimeType)));t||(t=[{}]);for(const e of t)e.ssrc=cm.generateRandomNumber(),a&&(e.rtx={ssrc:cm.generateRandomNumber()});r.encodings=t,r.rtcp={cname:this._cname,reducedSize:!0,mux:!0};const o=dm.mangleRtpParameters(r);um.debug("send() | calling rtpSender.send() [params:%o]",o),await s.send(o);const c=String(this._nextSendLocalId);return this._nextSendLocalId++,this._rtpSenders.set(c,s),{localId:c,rtpParameters:r,rtpSender:s}}async stopSending(e){um.debug("stopSending() [localId:%s]",e);const t=this._rtpSenders.get(e);if(!t)throw new Error("RTCRtpSender not found");this._rtpSenders.delete(e);try{um.debug("stopSending() | calling rtpSender.stop()"),t.stop()}catch(e){throw um.warn("stopSending() | rtpSender.stop() failed:%o",e),e}}async pauseSending(e){}async resumeSending(e){}async replaceTrack(e,t){t?um.debug("replaceTrack() [localId:%s, track.id:%s]",e,t.id):um.debug("replaceTrack() [localId:%s, no track]",e);const n=this._rtpSenders.get(e);if(!n)throw new Error("RTCRtpSender not found");n.setTrack(t)}async setMaxSpatialLayer(e,t){um.debug("setMaxSpatialLayer() [localId:%s, spatialLayer:%s]",e,t);const n=this._rtpSenders.get(e);if(!n)throw new Error("RTCRtpSender not found");const i=n.getParameters();i.encodings.forEach(((e,n)=>{e.active=n<=t})),await n.setParameters(i)}async setRtpEncodingParameters(e,t){um.debug("setRtpEncodingParameters() [localId:%s, params:%o]",e,t);const n=this._rtpSenders.get(e);if(!n)throw new Error("RTCRtpSender not found");const i=n.getParameters();i.encodings.forEach(((e,n)=>{i.encodings[n]={...e,...t}})),await n.setParameters(i)}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 om.UnsupportedError("not implemented")}async receive(e){const t=[];for(const t of e){const{trackId:e,kind:n}=t;um.debug("receive() [trackId:%s, kind:%s]",e,n)}this._transportReady||await this.setupTransport({localDtlsRole:"server"});for(const n of e){const{trackId:e,kind:i,rtpParameters:s}=n;um.debug("receive() | calling new RTCRtpReceiver()");const r=new RTCRtpReceiver(this._dtlsTransport,i);r.addEventListener("error",(e=>{um.error('rtpReceiver "error" event [event:%o]',e)}));const a=dm.mangleRtpParameters(s);um.debug("receive() | calling rtpReceiver.receive() [params:%o]",a),await r.receive(a);const o=e;this._rtpReceivers.set(o,r),t.push({localId:o,track:r.track,rtpReceiver:r})}return t}async stopReceiving(e){for(const t of e){um.debug("stopReceiving() [localId:%s]",t);const e=this._rtpReceivers.get(t);if(!e)throw new Error("RTCRtpReceiver not found");this._rtpReceivers.delete(t);try{um.debug("stopReceiving() | calling rtpReceiver.stop()"),e.stop()}catch(e){um.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 om.UnsupportedError("not implemented")}setIceGatherer({iceServers:e,iceTransportPolicy:t}){const n=new RTCIceGatherer({iceServers:e||[],gatherPolicy:t||"all"});n.addEventListener("error",(e=>{um.error('iceGatherer "error" event [event:%o]',e)}));try{n.gather()}catch(e){um.debug("setIceGatherer() | iceGatherer.gather() failed: %s",e.toString())}this._iceGatherer=n}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=>{um.debug('iceTransport "candidatepairchange" event [pair:%o]',e.pair)})),this._iceTransport=e}setDtlsTransport(){const e=new RTCDtlsTransport(this._iceTransport);e.addEventListener("statechange",(()=>{um.debug('dtlsTransport "statechange" event [state:%s]',e.state)})),e.addEventListener("dtlsstatechange",(()=>{um.debug('dtlsTransport "dtlsstatechange" event [state:%s]',e.state),"closed"===e.state&&this.emit("@connectionstatechange","closed")})),e.addEventListener("error",(e=>{um.error('dtlsTransport "error" event [event:%o]',e)})),this._dtlsTransport=e}async setupTransport({localDtlsRole:e}){um.debug("setupTransport()");const t=this._dtlsTransport.getLocalParameters();t.role=e,await new Promise(((e,n)=>{this.safeEmit("@connect",{dtlsParameters:t},e,n)})),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}}Yu.Edge11=mm;var hm={},fm=Zt&&Zt.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),gm=Zt&&Zt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),vm=Zt&&Zt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&fm(t,e,n);return gm(t,e),t};Object.defineProperty(hm,"__esModule",{value:!0}),hm.ReactNativeUnifiedPlan=void 0;const bm=vm(md),ym=Vc,_m=vm(tp),xm=vm(np),wm=vm(Cd),Sm=vm(Od),km=Dd,Cm=Md,Rm=Kd,Tm=new ym.Logger("ReactNativeUnifiedPlan"),Pm={OS:1024,MIS:1024};class Em extends km.HandlerInterface{static createFactory(){return()=>new Em}constructor(){super(),this._mapMidTransceiver=new Map,this._sendStream=new MediaStream,this._hasDataChannelMediaSection=!1,this._nextSendSctpStreamId=0,this._transportReady=!1}get name(){return"ReactNativeUnifiedPlan"}close(){if(Tm.debug("close()"),this._sendStream.release(!1),this._pc)try{this._pc.close()}catch(e){}this.emit("@close")}async getNativeRtpCapabilities(){Tm.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 n=bm.parse(t.sdp);return wm.extractRtpCapabilities({sdpObject:n})}catch(t){try{e.close()}catch(e){}throw t}}async getNativeSctpCapabilities(){return Tm.debug("getNativeSctpCapabilities()"),{numStreams:Pm}}run({direction:e,iceParameters:t,iceCandidates:n,dtlsParameters:i,sctpParameters:s,iceServers:r,iceTransportPolicy:a,additionalSettings:o,proprietaryConstraints:c,extendedRtpCapabilities:p}){Tm.debug("run()"),this._direction=e,this._remoteSdp=new Cm.RemoteSdp({iceParameters:t,iceCandidates:n,dtlsParameters:i,sctpParameters:s}),this._sendingRtpParametersByKind={audio:xm.getSendingRtpParameters("audio",p),video:xm.getSendingRtpParameters("video",p)},this._sendingRemoteRtpParametersByKind={audio:xm.getSendingRemoteRtpParameters("audio",p),video:xm.getSendingRemoteRtpParameters("video",p)},i.role&&"auto"!==i.role&&(this._forcedLocalDtlsRole="server"===i.role?"client":"server"),this._pc=new RTCPeerConnection({iceServers:r||[],iceTransportPolicy:a||"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require",sdpSemantics:"unified-plan",...o},c),this._pc.connectionState?this._pc.addEventListener("connectionstatechange",(()=>{this.emit("@connectionstatechange",this._pc.connectionState)})):this._pc.addEventListener("iceconnectionstatechange",(()=>{switch(Tm.warn("run() | pc.connectionState not supported, using pc.iceConnectionState"),this._pc.iceConnectionState){case"checking":this.emit("@connectionstatechange","connecting");break;case"connected":case"completed":this.emit("@connectionstatechange","connected");break;case"failed":this.emit("@connectionstatechange","failed");break;case"disconnected":this.emit("@connectionstatechange","disconnected");break;case"closed":this.emit("@connectionstatechange","closed")}}))}async updateIceServers(e){Tm.debug("updateIceServers()");const t=this._pc.getConfiguration();t.iceServers=e,this._pc.setConfiguration(t)}async restartIce(e){if(Tm.debug("restartIce()"),this._remoteSdp.updateIceParameters(e),this._transportReady)if("send"===this._direction){const e=await this._pc.createOffer({iceRestart:!0});Tm.debug("restartIce() | calling pc.setLocalDescription() [offer:%o]",e),await this._pc.setLocalDescription(e);const t={type:"answer",sdp:this._remoteSdp.getSdp()};Tm.debug("restartIce() | calling pc.setRemoteDescription() [answer:%o]",t),await this._pc.setRemoteDescription(t)}else{const e={type:"offer",sdp:this._remoteSdp.getSdp()};Tm.debug("restartIce() | calling pc.setRemoteDescription() [offer:%o]",e),await this._pc.setRemoteDescription(e);const t=await this._pc.createAnswer();Tm.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:n,codec:i}){var s;this.assertSendDirection(),Tm.debug("send() [kind:%s, track.id:%s]",e.kind,e.id),t&&t.length>1&&t.forEach(((e,t)=>{e.rid=`r${t}`}));const r=_m.clone(this._sendingRtpParametersByKind[e.kind],{});r.codecs=xm.reduceCodecs(r.codecs,i);const a=_m.clone(this._sendingRemoteRtpParametersByKind[e.kind],{});a.codecs=xm.reduceCodecs(a.codecs,i);const o=this._remoteSdp.getNextMediaSectionIdx(),c=this._pc.addTransceiver(e,{direction:"sendonly",streams:[this._sendStream],sendEncodings:t});let p,d=await this._pc.createOffer(),l=bm.parse(d.sdp);this._transportReady||await this.setupTransport({localDtlsRole:null!==(s=this._forcedLocalDtlsRole)&&void 0!==s?s:"client",localSdpObject:l});let u=!1;const m=(0,Rm.parse)((t||[{}])[0].scalabilityMode);t&&1===t.length&&m.spatialLayers>1&&"video/vp9"===r.codecs[0].mimeType.toLowerCase()&&(Tm.debug("send() | enabling legacy simulcast for VP9 SVC"),u=!0,l=bm.parse(d.sdp),p=l.media[o.idx],Sm.addLegacySimulcast({offerMediaObject:p,numStreams:m.spatialLayers}),d={type:"offer",sdp:bm.write(l)}),Tm.debug("send() | calling pc.setLocalDescription() [offer:%o]",d),await this._pc.setLocalDescription(d);const h=c.mid;if(r.mid=h,l=bm.parse(this._pc.localDescription.sdp),p=l.media[o.idx],r.rtcp.cname=wm.getCname({offerMediaObject:p}),t)if(1===t.length){let e=Sm.getRtpEncodings({offerMediaObject:p});Object.assign(e[0],t[0]),u&&(e=[e[0]]),r.encodings=e}else r.encodings=t;else r.encodings=Sm.getRtpEncodings({offerMediaObject:p});if(r.encodings.length>1&&("video/vp8"===r.codecs[0].mimeType.toLowerCase()||"video/h264"===r.codecs[0].mimeType.toLowerCase()))for(const e of r.encodings)e.scalabilityMode="S1T3";this._remoteSdp.send({offerMediaObject:p,reuseMid:o.reuseMid,offerRtpParameters:r,answerRtpParameters:a,codecOptions:n,extmapAllowMixed:!0});const f={type:"answer",sdp:this._remoteSdp.getSdp()};return Tm.debug("send() | calling pc.setRemoteDescription() [answer:%o]",f),await this._pc.setRemoteDescription(f),this._mapMidTransceiver.set(h,c),{localId:h,rtpParameters:r,rtpSender:c.sender}}async stopSending(e){this.assertSendDirection(),Tm.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);if(this._remoteSdp.closeMediaSection(t.mid))try{t.stop()}catch(e){}const n=await this._pc.createOffer();Tm.debug("stopSending() | calling pc.setLocalDescription() [offer:%o]",n),await this._pc.setLocalDescription(n);const i={type:"answer",sdp:this._remoteSdp.getSdp()};Tm.debug("stopSending() | calling pc.setRemoteDescription() [answer:%o]",i),await this._pc.setRemoteDescription(i),this._mapMidTransceiver.delete(e)}async pauseSending(e){this.assertSendDirection(),Tm.debug("pauseSending() [localId:%s]",e);const t=this._mapMidTransceiver.get(e);if(!t)throw new Error("associated RTCRtpTransceiver not found");t.direction="inactive",this._remoteSdp.pauseMediaSection(e);const n=await this._pc.createOffer();Tm.debug("pauseSending() | calling pc.setLocalDescription() [offer:%o]",n),await this._pc.setLocalDescription(n);const i={type:"answer",sdp:this._remoteSdp.getSdp()};Tm.debug("pauseSending() | calling pc.setRemoteDescription() [answer:%o]",i),await this._pc.setRemoteDescription(i)}async resumeSending(e){this.assertSendDirection(),Tm.debug("resumeSending() [localId:%s]",e);const t=this._mapMidTransceiver.get(e);if(this._remoteSdp.resumeSendingMediaSection(e),!t)throw new Error("associated RTCRtpTransceiver not found");t.direction="sendonly";const n=await this._pc.createOffer();Tm.debug("resumeSending() | calling pc.setLocalDescription() [offer:%o]",n),await this._pc.setLocalDescription(n);const i={type:"answer",sdp:this._remoteSdp.getSdp()};Tm.debug("resumeSending() | calling pc.setRemoteDescription() [answer:%o]",i),await this._pc.setRemoteDescription(i)}async replaceTrack(e,t){this.assertSendDirection(),t?Tm.debug("replaceTrack() [localId:%s, track.id:%s]",e,t.id):Tm.debug("replaceTrack() [localId:%s, no track]",e);const n=this._mapMidTransceiver.get(e);if(!n)throw new Error("associated RTCRtpTransceiver not found");await n.sender.replaceTrack(t)}async setMaxSpatialLayer(e,t){this.assertSendDirection(),Tm.debug("setMaxSpatialLayer() [localId:%s, spatialLayer:%s]",e,t);const n=this._mapMidTransceiver.get(e);if(!n)throw new Error("associated RTCRtpTransceiver not found");const i=n.sender.getParameters();i.encodings.forEach(((e,n)=>{e.active=n<=t})),await n.sender.setParameters(i)}async setRtpEncodingParameters(e,t){this.assertSendDirection(),Tm.debug("setRtpEncodingParameters() [localId:%s, params:%o]",e,t);const n=this._mapMidTransceiver.get(e);if(!n)throw new Error("associated RTCRtpTransceiver not found");const i=n.sender.getParameters();i.encodings.forEach(((e,n)=>{i.encodings[n]={...e,...t}})),await n.sender.setParameters(i)}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:n,label:i,protocol:s}){var r;this.assertSendDirection();const a={negotiated:!0,id:this._nextSendSctpStreamId,ordered:e,maxPacketLifeTime:t,maxRetransmits:n,protocol:s};Tm.debug("sendDataChannel() [options:%o]",a);const o=this._pc.createDataChannel(i,a);if(this._nextSendSctpStreamId=++this._nextSendSctpStreamId%Pm.MIS,!this._hasDataChannelMediaSection){const e=await this._pc.createOffer(),t=bm.parse(e.sdp),n=t.media.find((e=>"application"===e.type));this._transportReady||await this.setupTransport({localDtlsRole:null!==(r=this._forcedLocalDtlsRole)&&void 0!==r?r:"client",localSdpObject:t}),Tm.debug("sendDataChannel() | calling pc.setLocalDescription() [offer:%o]",e),await this._pc.setLocalDescription(e),this._remoteSdp.sendSctpAssociation({offerMediaObject:n});const i={type:"answer",sdp:this._remoteSdp.getSdp()};Tm.debug("sendDataChannel() | calling pc.setRemoteDescription() [answer:%o]",i),await this._pc.setRemoteDescription(i),this._hasDataChannelMediaSection=!0}return{dataChannel:o,sctpStreamParameters:{streamId:a.id,ordered:a.ordered,maxPacketLifeTime:a.maxPacketLifeTime,maxRetransmits:a.maxRetransmits}}}async receive(e){var t;this.assertRecvDirection();const n=[],i=new Map;for(const t of e){const{trackId:e,kind:n,rtpParameters:s,streamId:r}=t;Tm.debug("receive() [trackId:%s, kind:%s]",e,n);const a=s.mid||String(this._mapMidTransceiver.size);i.set(e,a),this._remoteSdp.receive({mid:a,kind:n,offerRtpParameters:s,streamId:r||s.rtcp.cname,trackId:e})}const s={type:"offer",sdp:this._remoteSdp.getSdp()};Tm.debug("receive() | calling pc.setRemoteDescription() [offer:%o]",s),await this._pc.setRemoteDescription(s);let r=await this._pc.createAnswer();const a=bm.parse(r.sdp);for(const t of e){const{trackId:e,rtpParameters:n}=t,s=i.get(e),r=a.media.find((e=>String(e.mid)===s));wm.applyCodecParameters({offerRtpParameters:n,answerMediaObject:r})}r={type:"answer",sdp:bm.write(a)},this._transportReady||await this.setupTransport({localDtlsRole:null!==(t=this._forcedLocalDtlsRole)&&void 0!==t?t:"client",localSdpObject:a}),Tm.debug("receive() | calling pc.setLocalDescription() [answer:%o]",r),await this._pc.setLocalDescription(r);for(const t of e){const{trackId:e}=t,s=i.get(e),r=this._pc.getTransceivers().find((e=>e.mid===s));if(!r)throw new Error("new RTCRtpTransceiver not found");this._mapMidTransceiver.set(s,r),n.push({localId:s,track:r.receiver.track,rtpReceiver:r.receiver})}return n}async stopReceiving(e){this.assertRecvDirection();for(const t of e){Tm.debug("stopReceiving() [localId:%s]",t);const e=this._mapMidTransceiver.get(t);if(!e)throw new Error("associated RTCRtpTransceiver not found");this._remoteSdp.closeMediaSection(e.mid)}const t={type:"offer",sdp:this._remoteSdp.getSdp()};Tm.debug("stopReceiving() | calling pc.setRemoteDescription() [offer:%o]",t),await this._pc.setRemoteDescription(t);const n=await this._pc.createAnswer();Tm.debug("stopReceiving() | calling pc.setLocalDescription() [answer:%o]",n),await this._pc.setLocalDescription(n);for(const t of e)this._mapMidTransceiver.delete(t)}async pauseReceiving(e){this.assertRecvDirection();for(const t of e){Tm.debug("pauseReceiving() [localId:%s]",t);const e=this._mapMidTransceiver.get(t);if(!e)throw new Error("associated RTCRtpTransceiver not found");e.direction="inactive",this._remoteSdp.pauseMediaSection(t)}const t={type:"offer",sdp:this._remoteSdp.getSdp()};Tm.debug("pauseReceiving() | calling pc.setRemoteDescription() [offer:%o]",t),await this._pc.setRemoteDescription(t);const n=await this._pc.createAnswer();Tm.debug("pauseReceiving() | calling pc.setLocalDescription() [answer:%o]",n),await this._pc.setLocalDescription(n)}async resumeReceiving(e){this.assertRecvDirection();for(const t of e){Tm.debug("resumeReceiving() [localId:%s]",t);const e=this._mapMidTransceiver.get(t);if(!e)throw new Error("associated RTCRtpTransceiver not found");e.direction="recvonly",this._remoteSdp.resumeReceivingMediaSection(t)}const t={type:"offer",sdp:this._remoteSdp.getSdp()};Tm.debug("resumeReceiving() | calling pc.setRemoteDescription() [offer:%o]",t),await this._pc.setRemoteDescription(t);const n=await this._pc.createAnswer();Tm.debug("resumeReceiving() | calling pc.setLocalDescription() [answer:%o]",n),await this._pc.setLocalDescription(n)}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:n}){var i;this.assertRecvDirection();const{streamId:s,ordered:r,maxPacketLifeTime:a,maxRetransmits:o}=e,c={negotiated:!0,id:s,ordered:r,maxPacketLifeTime:a,maxRetransmits:o,protocol:n};Tm.debug("receiveDataChannel() [options:%o]",c);const p=this._pc.createDataChannel(t,c);if(!this._hasDataChannelMediaSection){this._remoteSdp.receiveSctpAssociation();const e={type:"offer",sdp:this._remoteSdp.getSdp()};Tm.debug("receiveDataChannel() | calling pc.setRemoteDescription() [offer:%o]",e),await this._pc.setRemoteDescription(e);const t=await this._pc.createAnswer();if(!this._transportReady){const e=bm.parse(t.sdp);await this.setupTransport({localDtlsRole:null!==(i=this._forcedLocalDtlsRole)&&void 0!==i?i:"client",localSdpObject:e})}Tm.debug("receiveDataChannel() | calling pc.setRemoteDescription() [answer:%o]",t),await this._pc.setLocalDescription(t),this._hasDataChannelMediaSection=!0}return{dataChannel:p}}async setupTransport({localDtlsRole:e,localSdpObject:t}){t||(t=bm.parse(this._pc.localDescription.sdp));const n=wm.extractDtlsParameters({sdpObject:t});n.role=e,this._remoteSdp.updateDtlsRole("client"===e?"server":"client"),await new Promise(((e,t)=>{this.safeEmit("@connect",{dtlsParameters:n},e,t)})),this._transportReady=!0}assertSendDirection(){if("send"!==this._direction)throw new Error('method can just be called for handlers with "send" direction')}assertRecvDirection(){if("recv"!==this._direction)throw new Error('method can just be called for handlers with "recv" direction')}}hm.ReactNativeUnifiedPlan=Em;var Om={},Dm=Zt&&Zt.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),jm=Zt&&Zt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Im=Zt&&Zt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&Dm(t,e,n);return jm(t,e),t};Object.defineProperty(Om,"__esModule",{value:!0}),Om.ReactNative=void 0;const Mm=Im(md),Lm=Vc,Am=Xc,Nm=Im(tp),Bm=Im(np),Fm=Im(Cd),Um=Im(Pl),zm=Dd,qm=Md,$m=new Lm.Logger("ReactNative"),Vm={OS:1024,MIS:1024};class Hm extends zm.HandlerInterface{static createFactory(){return()=>new Hm}constructor(){super(),this._sendStream=new MediaStream,this._mapSendLocalIdTrack=new Map,this._nextSendLocalId=0,this._mapRecvLocalIdInfo=new Map,this._hasDataChannelMediaSection=!1,this._nextSendSctpStreamId=0,this._transportReady=!1}get name(){return"ReactNative"}close(){if($m.debug("close()"),this._sendStream.release(!1),this._pc)try{this._pc.close()}catch(e){}this.emit("@close")}async getNativeRtpCapabilities(){$m.debug("getNativeRtpCapabilities()");const e=new RTCPeerConnection({iceServers:[],iceTransportPolicy:"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require",sdpSemantics:"plan-b"});try{const t=await e.createOffer({offerToReceiveAudio:!0,offerToReceiveVideo:!0});try{e.close()}catch(e){}const n=Mm.parse(t.sdp);return Fm.extractRtpCapabilities({sdpObject:n})}catch(t){try{e.close()}catch(e){}throw t}}async getNativeSctpCapabilities(){return $m.debug("getNativeSctpCapabilities()"),{numStreams:Vm}}run({direction:e,iceParameters:t,iceCandidates:n,dtlsParameters:i,sctpParameters:s,iceServers:r,iceTransportPolicy:a,additionalSettings:o,proprietaryConstraints:c,extendedRtpCapabilities:p}){$m.debug("run()"),this._direction=e,this._remoteSdp=new qm.RemoteSdp({iceParameters:t,iceCandidates:n,dtlsParameters:i,sctpParameters:s,planB:!0}),this._sendingRtpParametersByKind={audio:Bm.getSendingRtpParameters("audio",p),video:Bm.getSendingRtpParameters("video",p)},this._sendingRemoteRtpParametersByKind={audio:Bm.getSendingRemoteRtpParameters("audio",p),video:Bm.getSendingRemoteRtpParameters("video",p)},i.role&&"auto"!==i.role&&(this._forcedLocalDtlsRole="server"===i.role?"client":"server"),this._pc=new RTCPeerConnection({iceServers:r||[],iceTransportPolicy:a||"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require",sdpSemantics:"plan-b",...o},c),this._pc.connectionState?this._pc.addEventListener("connectionstatechange",(()=>{this.emit("@connectionstatechange",this._pc.connectionState)})):this._pc.addEventListener("iceconnectionstatechange",(()=>{switch($m.warn("run() | pc.connectionState not supported, using pc.iceConnectionState"),this._pc.iceConnectionState){case"checking":this.emit("@connectionstatechange","connecting");break;case"connected":case"completed":this.emit("@connectionstatechange","connected");break;case"failed":this.emit("@connectionstatechange","failed");break;case"disconnected":this.emit("@connectionstatechange","disconnected");break;case"closed":this.emit("@connectionstatechange","closed")}}))}async updateIceServers(e){$m.debug("updateIceServers()");const t=this._pc.getConfiguration();t.iceServers=e,this._pc.setConfiguration(t)}async restartIce(e){if($m.debug("restartIce()"),this._remoteSdp.updateIceParameters(e),this._transportReady)if("send"===this._direction){const e=await this._pc.createOffer({iceRestart:!0});$m.debug("restartIce() | calling pc.setLocalDescription() [offer:%o]",e),await this._pc.setLocalDescription(e);const t={type:"answer",sdp:this._remoteSdp.getSdp()};$m.debug("restartIce() | calling pc.setRemoteDescription() [answer:%o]",t),await this._pc.setRemoteDescription(t)}else{const e={type:"offer",sdp:this._remoteSdp.getSdp()};$m.debug("restartIce() | calling pc.setRemoteDescription() [offer:%o]",e),await this._pc.setRemoteDescription(e);const t=await this._pc.createAnswer();$m.debug("restartIce() | calling pc.setLocalDescription() [answer:%o]",t),await this._pc.setLocalDescription(t)}}async getTransportStats(){return this._pc.getStats()}async send({track:e,encodings:t,codecOptions:n,codec:i}){var s;this.assertSendDirection(),$m.debug("send() [kind:%s, track.id:%s]",e.kind,e.id),i&&$m.warn("send() | codec selection is not available in %s handler",this.name),this._sendStream.addTrack(e),this._pc.addStream(this._sendStream);let r,a=await this._pc.createOffer(),o=Mm.parse(a.sdp);const c=Nm.clone(this._sendingRtpParametersByKind[e.kind],{});c.codecs=Bm.reduceCodecs(c.codecs);const p=Nm.clone(this._sendingRemoteRtpParametersByKind[e.kind],{});if(p.codecs=Bm.reduceCodecs(p.codecs),this._transportReady||await this.setupTransport({localDtlsRole:null!==(s=this._forcedLocalDtlsRole)&&void 0!==s?s:"client",localSdpObject:o}),"video"===e.kind&&t&&t.length>1&&($m.debug("send() | enabling simulcast"),o=Mm.parse(a.sdp),r=o.media.find((e=>"video"===e.type)),Um.addLegacySimulcast({offerMediaObject:r,track:e,numStreams:t.length}),a={type:"offer",sdp:Mm.write(o)}),$m.debug("send() | calling pc.setLocalDescription() [offer:%o]",a),await this._pc.setLocalDescription(a),o=Mm.parse(this._pc.localDescription.sdp),r=o.media.find((t=>t.type===e.kind)),c.rtcp.cname=Fm.getCname({offerMediaObject:r}),c.encodings=Um.getRtpEncodings({offerMediaObject:r,track:e}),t)for(let e=0;e<c.encodings.length;++e)t[e]&&Object.assign(c.encodings[e],t[e]);if(c.encodings.length>1&&("video/vp8"===c.codecs[0].mimeType.toLowerCase()||"video/h264"===c.codecs[0].mimeType.toLowerCase()))for(const e of c.encodings)e.scalabilityMode="S1T3";this._remoteSdp.send({offerMediaObject:r,offerRtpParameters:c,answerRtpParameters:p,codecOptions:n});const d={type:"answer",sdp:this._remoteSdp.getSdp()};$m.debug("send() | calling pc.setRemoteDescription() [answer:%o]",d),await this._pc.setRemoteDescription(d);const l=String(this._nextSendLocalId);return this._nextSendLocalId++,this._mapSendLocalIdTrack.set(l,e),{localId:l,rtpParameters:c}}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 n=await this._pc.createOffer();$m.debug("stopSending() | calling pc.setLocalDescription() [offer:%o]",n);try{await this._pc.setLocalDescription(n)}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 i={type:"answer",sdp:this._remoteSdp.getSdp()};$m.debug("stopSending() | calling pc.setRemoteDescription() [answer:%o]",i),await this._pc.setRemoteDescription(i)}async pauseSending(e){}async resumeSending(e){}async replaceTrack(e,t){throw new Am.UnsupportedError("not implemented")}async setMaxSpatialLayer(e,t){throw new Am.UnsupportedError("not implemented")}async setRtpEncodingParameters(e,t){throw new Am.UnsupportedError("not implemented")}async getSenderStats(e){throw new Am.UnsupportedError("not implemented")}async sendDataChannel({ordered:e,maxPacketLifeTime:t,maxRetransmits:n,label:i,protocol:s}){var r;this.assertSendDirection();const a={negotiated:!0,id:this._nextSendSctpStreamId,ordered:e,maxPacketLifeTime:t,maxRetransmitTime:t,maxRetransmits:n,protocol:s};$m.debug("sendDataChannel() [options:%o]",a);const o=this._pc.createDataChannel(i,a);if(this._nextSendSctpStreamId=++this._nextSendSctpStreamId%Vm.MIS,!this._hasDataChannelMediaSection){const e=await this._pc.createOffer(),t=Mm.parse(e.sdp),n=t.media.find((e=>"application"===e.type));this._transportReady||await this.setupTransport({localDtlsRole:null!==(r=this._forcedLocalDtlsRole)&&void 0!==r?r:"client",localSdpObject:t}),$m.debug("sendDataChannel() | calling pc.setLocalDescription() [offer:%o]",e),await this._pc.setLocalDescription(e),this._remoteSdp.sendSctpAssociation({offerMediaObject:n});const i={type:"answer",sdp:this._remoteSdp.getSdp()};$m.debug("sendDataChannel() | calling pc.setRemoteDescription() [answer:%o]",i),await this._pc.setRemoteDescription(i),this._hasDataChannelMediaSection=!0}return{dataChannel:o,sctpStreamParameters:{streamId:a.id,ordered:a.ordered,maxPacketLifeTime:a.maxPacketLifeTime,maxRetransmits:a.maxRetransmits}}}async receive(e){var t;this.assertRecvDirection();const n=[],i=new Map;for(const t of e){const{trackId:e,kind:n,rtpParameters:s}=t;$m.debug("receive() [trackId:%s, kind:%s]",e,n);const r=n;let a=t.streamId||s.rtcp.cname;$m.debug("receive() | forcing a random remote streamId to avoid well known bug in react-native-webrtc"),a+=`-hack-${Nm.generateRandomNumber()}`,i.set(e,a),this._remoteSdp.receive({mid:r,kind:n,offerRtpParameters:s,streamId:a,trackId:e})}const s={type:"offer",sdp:this._remoteSdp.getSdp()};$m.debug("receive() | calling pc.setRemoteDescription() [offer:%o]",s),await this._pc.setRemoteDescription(s);let r=await this._pc.createAnswer();const a=Mm.parse(r.sdp);for(const t of e){const{kind:e,rtpParameters:n}=t,i=e,s=a.media.find((e=>String(e.mid)===i));Fm.applyCodecParameters({offerRtpParameters:n,answerMediaObject:s})}r={type:"answer",sdp:Mm.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]",r),await this._pc.setLocalDescription(r);for(const t of e){const{kind:e,trackId:s,rtpParameters:r}=t,a=s,o=e,c=i.get(s),p=this._pc.getRemoteStreams().find((e=>e.id===c)),d=p.getTrackById(a);if(!d)throw new Error("remote track not found");this._mapRecvLocalIdInfo.set(a,{mid:o,rtpParameters:r}),n.push({localId:a,track:d})}return n}async stopReceiving(e){this.assertRecvDirection();for(const t of e){$m.debug("stopReceiving() [localId:%s]",t);const{mid:e,rtpParameters:n}=this._mapRecvLocalIdInfo.get(t)||{};this._mapRecvLocalIdInfo.delete(t),this._remoteSdp.planBStopReceiving({mid:e,offerRtpParameters:n})}const t={type:"offer",sdp:this._remoteSdp.getSdp()};$m.debug("stopReceiving() | calling pc.setRemoteDescription() [offer:%o]",t),await this._pc.setRemoteDescription(t);const n=await this._pc.createAnswer();$m.debug("stopReceiving() | calling pc.setLocalDescription() [answer:%o]",n),await this._pc.setLocalDescription(n)}async pauseReceiving(e){}async resumeReceiving(e){}async getReceiverStats(e){throw new Am.UnsupportedError("not implemented")}async receiveDataChannel({sctpStreamParameters:e,label:t,protocol:n}){var i;this.assertRecvDirection();const{streamId:s,ordered:r,maxPacketLifeTime:a,maxRetransmits:o}=e,c={negotiated:!0,id:s,ordered:r,maxPacketLifeTime:a,maxRetransmitTime:a,maxRetransmits:o,protocol:n};$m.debug("receiveDataChannel() [options:%o]",c);const p=this._pc.createDataChannel(t,c);if(!this._hasDataChannelMediaSection){this._remoteSdp.receiveSctpAssociation({oldDataChannelSpec:!0});const e={type:"offer",sdp:this._remoteSdp.getSdp()};$m.debug("receiveDataChannel() | calling pc.setRemoteDescription() [offer:%o]",e),await this._pc.setRemoteDescription(e);const t=await this._pc.createAnswer();if(!this._transportReady){const e=Mm.parse(t.sdp);await this.setupTransport({localDtlsRole:null!==(i=this._forcedLocalDtlsRole)&&void 0!==i?i:"client",localSdpObject:e})}$m.debug("receiveDataChannel() | calling pc.setRemoteDescription() [answer:%o]",t),await this._pc.setLocalDescription(t),this._hasDataChannelMediaSection=!0}return{dataChannel:p}}async setupTransport({localDtlsRole:e,localSdpObject:t}){t||(t=Mm.parse(this._pc.localDescription.sdp));const n=Fm.extractDtlsParameters({sdpObject:t});n.role=e,this._remoteSdp.updateDtlsRole("client"===e?"server":"client"),await new Promise(((e,t)=>{this.safeEmit("@connect",{dtlsParameters:n},e,t)})),this._transportReady=!0}assertSendDirection(){if("send"!==this._direction)throw new Error('method can just be called for handlers with "send" direction')}assertRecvDirection(){if("recv"!==this._direction)throw new Error('method can just be called for handlers with "recv" direction')}}Om.ReactNative=Hm;var Wm=Zt&&Zt.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),Gm=Zt&&Zt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Km=Zt&&Zt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&Wm(t,e,n);return Gm(t,e),t},Jm=Zt&&Zt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Oc,"__esModule",{value:!0}),Oc.Device=Oc.detectDevice=void 0;const Qm=Jm($c),Ym=Vc,Xm=Kc,Zm=Xc,eh=Km(tp),th=Km(np),nh=wp,ih=ud,sh=ll,rh=Tl,ah=$l,oh=ru,ch=xu,ph=Au,dh=Yu,lh=hm,uh=Om,mh=new Ym.Logger("Device");function hh(){if("object"==typeof navigator&&"ReactNative"===navigator.product)return"undefined"==typeof RTCPeerConnection?void mh.warn("this._detectDevice() | unsupported react-native-webrtc without RTCPeerConnection, forgot to call registerGlobals()?"):"undefined"!=typeof RTCRtpTransceiver?(mh.debug("this._detectDevice() | ReactNative UnifiedPlan handler chosen"),"ReactNativeUnifiedPlan"):(mh.debug("this._detectDevice() | ReactNative PlanB handler chosen"),"ReactNative");if("object"!=typeof navigator||"string"!=typeof navigator.userAgent)mh.warn("this._detectDevice() | unknown device");else{const e=navigator.userAgent,t=Qm.default.getParser(e),n=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(n.name&&"blink"===n.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"}mh.warn("this._detectDevice() | browser not supported [name:%s, version:%s]",t.getBrowserName(),t.getBrowserVersion())}}Oc.detectDevice=hh;Oc.Device=class{constructor({handlerName:e,handlerFactory:t,Handler:n}={}){if(this._loaded=!1,this._observer=new Xm.EnhancedEventEmitter,mh.debug("constructor()"),n){if(mh.warn("constructor() | Handler option is DEPRECATED, use handlerName or handlerFactory instead"),"string"!=typeof n)throw new TypeError("non string Handler option no longer supported, use handlerFactory instead");e=n}if(e&&t)throw new TypeError("just one of handlerName or handlerInterface can be given");if(t)this._handlerFactory=t;else{if(e)mh.debug("constructor() | handler given: %s",e);else{if(!(e=hh()))throw new Zm.UnsupportedError("device not supported");mh.debug("constructor() | detected handler: %s",e)}switch(e){case"Chrome74":this._handlerFactory=ih.Chrome74.createFactory();break;case"Chrome70":this._handlerFactory=sh.Chrome70.createFactory();break;case"Chrome67":this._handlerFactory=rh.Chrome67.createFactory();break;case"Chrome55":this._handlerFactory=ah.Chrome55.createFactory();break;case"Firefox60":this._handlerFactory=oh.Firefox60.createFactory();break;case"Safari12":this._handlerFactory=ch.Safari12.createFactory();break;case"Safari11":this._handlerFactory=ph.Safari11.createFactory();break;case"Edge11":this._handlerFactory=dh.Edge11.createFactory();break;case"ReactNativeUnifiedPlan":this._handlerFactory=lh.ReactNativeUnifiedPlan.createFactory();break;case"ReactNative":this._handlerFactory=uh.ReactNative.createFactory();break;default:throw new TypeError(`unknown handlerName "${e}"`)}}const i=this._handlerFactory();this._handlerName=i.name,i.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 Zm.InvalidStateError("not loaded");return this._recvRtpCapabilities}get sctpCapabilities(){if(!this._loaded)throw new Zm.InvalidStateError("not loaded");return this._sctpCapabilities}get observer(){return this._observer}async load({routerRtpCapabilities:e}){let t;mh.debug("load() [routerRtpCapabilities:%o]",e),e=eh.clone(e,void 0);try{if(this._loaded)throw new Zm.InvalidStateError("already loaded");th.validateRtpCapabilities(e),t=this._handlerFactory();const n=await t.getNativeRtpCapabilities();mh.debug("load() | got native RTP capabilities:%o",n),th.validateRtpCapabilities(n),this._extendedRtpCapabilities=th.getExtendedRtpCapabilities(n,e),mh.debug("load() | got extended RTP capabilities:%o",this._extendedRtpCapabilities),this._canProduceByKind.audio=th.canSend("audio",this._extendedRtpCapabilities),this._canProduceByKind.video=th.canSend("video",this._extendedRtpCapabilities),this._recvRtpCapabilities=th.getRecvRtpCapabilities(this._extendedRtpCapabilities),th.validateRtpCapabilities(this._recvRtpCapabilities),mh.debug("load() | got receiving RTP capabilities:%o",this._recvRtpCapabilities),this._sctpCapabilities=await t.getNativeSctpCapabilities(),mh.debug("load() | got native SCTP capabilities:%o",this._sctpCapabilities),th.validateSctpCapabilities(this._sctpCapabilities),mh.debug("load() succeeded"),this._loaded=!0,t.close()}catch(e){throw t&&t.close(),e}}canProduce(e){if(!this._loaded)throw new Zm.InvalidStateError("not loaded");if("audio"!==e&&"video"!==e)throw new TypeError(`invalid kind "${e}"`);return this._canProduceByKind[e]}createSendTransport({id:e,iceParameters:t,iceCandidates:n,dtlsParameters:i,sctpParameters:s,iceServers:r,iceTransportPolicy:a,additionalSettings:o,proprietaryConstraints:c,appData:p}){return mh.debug("createSendTransport()"),this.createTransport({direction:"send",id:e,iceParameters:t,iceCandidates:n,dtlsParameters:i,sctpParameters:s,iceServers:r,iceTransportPolicy:a,additionalSettings:o,proprietaryConstraints:c,appData:p})}createRecvTransport({id:e,iceParameters:t,iceCandidates:n,dtlsParameters:i,sctpParameters:s,iceServers:r,iceTransportPolicy:a,additionalSettings:o,proprietaryConstraints:c,appData:p}){return mh.debug("createRecvTransport()"),this.createTransport({direction:"recv",id:e,iceParameters:t,iceCandidates:n,dtlsParameters:i,sctpParameters:s,iceServers:r,iceTransportPolicy:a,additionalSettings:o,proprietaryConstraints:c,appData:p})}createTransport({direction:e,id:t,iceParameters:n,iceCandidates:i,dtlsParameters:s,sctpParameters:r,iceServers:a,iceTransportPolicy:o,additionalSettings:c,proprietaryConstraints:p,appData:d}){if(!this._loaded)throw new Zm.InvalidStateError("not loaded");if("string"!=typeof t)throw new TypeError("missing id");if("object"!=typeof n)throw new TypeError("missing iceParameters");if(!Array.isArray(i))throw new TypeError("missing iceCandidates");if("object"!=typeof s)throw new TypeError("missing dtlsParameters");if(r&&"object"!=typeof r)throw new TypeError("wrong sctpParameters");if(d&&"object"!=typeof d)throw new TypeError("if given, appData must be an object");const l=new nh.Transport({direction:e,id:t,iceParameters:n,iceCandidates:i,dtlsParameters:s,sctpParameters:r,iceServers:a,iceTransportPolicy:o,additionalSettings:c,proprietaryConstraints:p,appData:d,handlerFactory:this._handlerFactory,extendedRtpCapabilities:this._extendedRtpCapabilities,canProduceByKind:this._canProduceByKind});return this._observer.safeEmit("newtransport",l),l}};var fh={},gh={};Object.defineProperty(gh,"__esModule",{value:!0});var vh={};Object.defineProperty(vh,"__esModule",{value:!0}),function(e){var t=Zt&&Zt.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),n=Zt&&Zt.__exportStar||function(e,n){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(n,i)||t(n,e,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(Oc,e),n(wp,e),n(Dp,e),n(Ap,e),n(zp,e),n(Wp,e),n(gh,e),n(vh,e),n(Dd,e),n(Xc,e)}(fh),function(e){var t=Zt&&Zt.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),n=Zt&&Zt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=Zt&&Zt.__importStar||function(e){if(e&&e.__esModule)return e;var i={};if(null!=e)for(var s in e)"default"!==s&&Object.prototype.hasOwnProperty.call(e,s)&&t(i,e,s);return n(i,e),i},s=Zt&&Zt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.debug=e.parseScalabilityMode=e.detectDevice=e.Device=e.version=e.types=void 0;const r=s(gc);e.debug=r.default;const a=Oc;Object.defineProperty(e,"Device",{enumerable:!0,get:function(){return a.Device}}),Object.defineProperty(e,"detectDevice",{enumerable:!0,get:function(){return a.detectDevice}});const o=i(fh);e.types=o,e.version="3.6.75";var c=Kd;Object.defineProperty(e,"parseScalabilityMode",{enumerable:!0,get:function(){return c.parse}})}(fc);class bh{static parse(e){let t;try{t=JSON.parse(e)}catch(e){return}if("object"==typeof t&&!Array.isArray(t))return t.request?bh._handleRequest(t):t.response?bh._handleResponse(t):t.message?bh._handleMessage(t):void 0}static _handleRequest(e){const t={request:!0};if("string"==typeof e.method&&"number"==typeof e.id)return t.id=e.id,t.method=e.method,t.data=e.data||{},t}static _handleResponse(e){const t={response:!0};if("number"==typeof e.id)return t.id=e.id,e.ok?(t.ok=!0,t.data=e.data||{}):(t.ok=!1,t.errorCode=e.errorCode,t.errorReason=e.errorReason),t}static _handleMessage(e){const t={message:!0};if("string"==typeof e.method)return t.method=e.method,t.data=e.data||{},t}static createRequest(e,t){return{request:!0,id:Math.round(1e7*Math.random()),method:e,data:t||{}}}static createSuccessResponse(e,t){return{response:!0,id:e.id,ok:!0,data:t||{}}}static createErrorResponse(e,t,n){return{response:!0,id:e.id,errorCode:t,errorReason:n}}static createMessage(e,t){return{message:!0,method:e,data:t||{}}}}class yh extends l{constructor(e,t){super(),this.wsUrl=e,this.logger=t,this.sents=new Map,this._setupSocket()}_setupSocket(){this.socket=new WebSocket(this.wsUrl,"whereby-sfu#v4"),this.socket.onopen=this._onOpen.bind(this),this.socket.onmessage=this._onMessage.bind(this),this.socket.onclose=this._onClose.bind(this),this.socket.onerror=this._onError.bind(this)}_tearDown(){this.socket.onopen=null,this.socket.onmessage=null,this.socket.onclose=null,this.socket.onerror=null,this.socket=null,this.sents.forEach((e=>e.close())),this.emit("close")}close(){this.socket?.close()}_onOpen(){this.logger.log("VegaConnectionManager: Connected"),this.emit("open")}_onMessage(e){const t=bh.parse(e.data);this.logger.log("VegaConnectionManager: Received message",t),t?.response?this._handleResponse(t):t?.message&&this.emit("message",t)}_onClose(){this.logger.log("VegaConnectionManager: Disconnected"),this._tearDown()}_onError(e){this.logger.log("VegaConnectionManager: Error",e)}_handleResponse(e){const t=this.sents.get(e.id);if(e.ok)t.resolve(e.data);else{const n=new Error(e.errorReason);t.reject(n)}}send(e){try{this.socket.send(JSON.stringify(e))}catch(e){}}message(e,t={}){const n=bh.createMessage(e,t);this.send(n)}request(e,t={},n=1500*(15+.1*this.sents.size)){const i=bh.createRequest(e,t);return this.send(i),new Promise(((e,t)=>{const s={id:i.id,method:i.method,resolve:t=>{this.sents.delete(i.id)&&(clearTimeout(s.timer),e(t))},reject:e=>{this.sents.delete(i.id)&&(clearTimeout(s.timer),t(e))},timer:setTimeout((()=>{this.sents.delete(i.id)&&t(new Error("request timeout"))}),n),close:()=>{clearTimeout(s.timer),t(new Error("transport closed"))}};this.sents.set(i.id,s)}))}}const _h={codecOptions:{opusDtx:!0,opusFec:!0},encodings:[{dtx:!0,networkPriority:"high"}]},xh={codecOptions:{videoGoogleStartBitrate:500},encodings:[{scaleResolutionDownBy:4,maxBitrate:15e4,networkPriority:"high"},{scaleResolutionDownBy:2,maxBitrate:5e5},{scaleResolutionDownBy:1,maxBitrate:1e6}]},wh={codecOptions:{videoGoogleStartBitrate:500},encodings:[{scaleResolutionDownBy:2,maxBitrate:15e4,networkPriority:"high"},{scaleResolutionDownBy:1,maxBitrate:5e5}]},Sh={codecOptions:{videoGoogleStartBitrate:500},encodings:[{scalabilityMode:"S3T3_KEY",networkPriority:"high"}]},kh={encodings:[{networkPriority:"medium"}]},Ch={encodings:[{dtx:!0,maxBitrate:5e5},{dtx:!0,maxBitrate:15e5}]},Rh={encodings:[{scalabilityMode:"S3T3",dtx:!0,networkPriority:"high"}]},Th=(e,t,n)=>{const{lowDataModeEnabled:i,simulcastScreenshareOn:s,vp9On:r}=n;return"audio"===e?_h:t?r?Rh:s?Ch:kh:i?wh:r?Sh:xh},Ph=()=>{let e=fc.detectDevice()||(/applecoremedia|applewebkit|safari/i.test(navigator.userAgent)?"Safari12":void 0);return/iphone|ipad/i.test(navigator.userAgent)&&(e="Safari12"),e};let Eh;const Oh=new Uint8Array(16);function Dh(){if(!Eh&&(Eh="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Eh))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Eh(Oh)}var jh=/^(?:[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;const Ih=[];for(let e=0;e<256;++e)Ih.push((e+256).toString(16).slice(1));function Mh(e,t=0){return(Ih[e[t+0]]+Ih[e[t+1]]+Ih[e[t+2]]+Ih[e[t+3]]+"-"+Ih[e[t+4]]+Ih[e[t+5]]+"-"+Ih[e[t+6]]+Ih[e[t+7]]+"-"+Ih[e[t+8]]+Ih[e[t+9]]+"-"+Ih[e[t+10]]+Ih[e[t+11]]+Ih[e[t+12]]+Ih[e[t+13]]+Ih[e[t+14]]+Ih[e[t+15]]).toLowerCase()}function Lh(e){if(!function(e){return"string"==typeof e&&jh.test(e)}(e))throw TypeError("Invalid UUID");let t;const n=new Uint8Array(16);return n[0]=(t=parseInt(e.slice(0,8),16))>>>24,n[1]=t>>>16&255,n[2]=t>>>8&255,n[3]=255&t,n[4]=(t=parseInt(e.slice(9,13),16))>>>8,n[5]=255&t,n[6]=(t=parseInt(e.slice(14,18),16))>>>8,n[7]=255&t,n[8]=(t=parseInt(e.slice(19,23),16))>>>8,n[9]=255&t,n[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,n[11]=t/4294967296&255,n[12]=t>>>24&255,n[13]=t>>>16&255,n[14]=t>>>8&255,n[15]=255&t,n}function Ah(e,t,n){function i(e,i,s,r){var a;if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));const t=[];for(let n=0;n<e.length;++n)t.push(e.charCodeAt(n));return t}(e)),"string"==typeof i&&(i=Lh(i)),16!==(null===(a=i)||void 0===a?void 0:a.length))throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let o=new Uint8Array(16+e.length);if(o.set(i),o.set(e,i.length),o=n(o),o[6]=15&o[6]|t,o[8]=63&o[8]|128,s){r=r||0;for(let e=0;e<16;++e)s[r+e]=o[e];return s}return Mh(o)}try{i.name=e}catch(e){}return i.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",i.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",i}function Nh(e){return 14+(e+64>>>9<<4)+1}function Bh(e,t){const n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function Fh(e,t,n,i,s,r){return Bh((a=Bh(Bh(t,e),Bh(i,r)))<<(o=s)|a>>>32-o,n);var a,o}function Uh(e,t,n,i,s,r,a){return Fh(t&n|~t&i,e,t,s,r,a)}function zh(e,t,n,i,s,r,a){return Fh(t&i|n&~i,e,t,s,r,a)}function qh(e,t,n,i,s,r,a){return Fh(t^n^i,e,t,s,r,a)}function $h(e,t,n,i,s,r,a){return Fh(n^(t|~i),e,t,s,r,a)}Ah("v3",48,(function(e){if("string"==typeof e){const t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(let n=0;n<t.length;++n)e[n]=t.charCodeAt(n)}return function(e){const t=[],n=32*e.length,i="0123456789abcdef";for(let s=0;s<n;s+=8){const n=e[s>>5]>>>s%32&255,r=parseInt(i.charAt(n>>>4&15)+i.charAt(15&n),16);t.push(r)}return t}(function(e,t){e[t>>5]|=128<<t%32,e[Nh(t)-1]=t;let n=1732584193,i=-271733879,s=-1732584194,r=271733878;for(let t=0;t<e.length;t+=16){const a=n,o=i,c=s,p=r;n=Uh(n,i,s,r,e[t],7,-680876936),r=Uh(r,n,i,s,e[t+1],12,-389564586),s=Uh(s,r,n,i,e[t+2],17,606105819),i=Uh(i,s,r,n,e[t+3],22,-1044525330),n=Uh(n,i,s,r,e[t+4],7,-176418897),r=Uh(r,n,i,s,e[t+5],12,1200080426),s=Uh(s,r,n,i,e[t+6],17,-1473231341),i=Uh(i,s,r,n,e[t+7],22,-45705983),n=Uh(n,i,s,r,e[t+8],7,1770035416),r=Uh(r,n,i,s,e[t+9],12,-1958414417),s=Uh(s,r,n,i,e[t+10],17,-42063),i=Uh(i,s,r,n,e[t+11],22,-1990404162),n=Uh(n,i,s,r,e[t+12],7,1804603682),r=Uh(r,n,i,s,e[t+13],12,-40341101),s=Uh(s,r,n,i,e[t+14],17,-1502002290),i=Uh(i,s,r,n,e[t+15],22,1236535329),n=zh(n,i,s,r,e[t+1],5,-165796510),r=zh(r,n,i,s,e[t+6],9,-1069501632),s=zh(s,r,n,i,e[t+11],14,643717713),i=zh(i,s,r,n,e[t],20,-373897302),n=zh(n,i,s,r,e[t+5],5,-701558691),r=zh(r,n,i,s,e[t+10],9,38016083),s=zh(s,r,n,i,e[t+15],14,-660478335),i=zh(i,s,r,n,e[t+4],20,-405537848),n=zh(n,i,s,r,e[t+9],5,568446438),r=zh(r,n,i,s,e[t+14],9,-1019803690),s=zh(s,r,n,i,e[t+3],14,-187363961),i=zh(i,s,r,n,e[t+8],20,1163531501),n=zh(n,i,s,r,e[t+13],5,-1444681467),r=zh(r,n,i,s,e[t+2],9,-51403784),s=zh(s,r,n,i,e[t+7],14,1735328473),i=zh(i,s,r,n,e[t+12],20,-1926607734),n=qh(n,i,s,r,e[t+5],4,-378558),r=qh(r,n,i,s,e[t+8],11,-2022574463),s=qh(s,r,n,i,e[t+11],16,1839030562),i=qh(i,s,r,n,e[t+14],23,-35309556),n=qh(n,i,s,r,e[t+1],4,-1530992060),r=qh(r,n,i,s,e[t+4],11,1272893353),s=qh(s,r,n,i,e[t+7],16,-155497632),i=qh(i,s,r,n,e[t+10],23,-1094730640),n=qh(n,i,s,r,e[t+13],4,681279174),r=qh(r,n,i,s,e[t],11,-358537222),s=qh(s,r,n,i,e[t+3],16,-722521979),i=qh(i,s,r,n,e[t+6],23,76029189),n=qh(n,i,s,r,e[t+9],4,-640364487),r=qh(r,n,i,s,e[t+12],11,-421815835),s=qh(s,r,n,i,e[t+15],16,530742520),i=qh(i,s,r,n,e[t+2],23,-995338651),n=$h(n,i,s,r,e[t],6,-198630844),r=$h(r,n,i,s,e[t+7],10,1126891415),s=$h(s,r,n,i,e[t+14],15,-1416354905),i=$h(i,s,r,n,e[t+5],21,-57434055),n=$h(n,i,s,r,e[t+12],6,1700485571),r=$h(r,n,i,s,e[t+3],10,-1894986606),s=$h(s,r,n,i,e[t+10],15,-1051523),i=$h(i,s,r,n,e[t+1],21,-2054922799),n=$h(n,i,s,r,e[t+8],6,1873313359),r=$h(r,n,i,s,e[t+15],10,-30611744),s=$h(s,r,n,i,e[t+6],15,-1560198380),i=$h(i,s,r,n,e[t+13],21,1309151649),n=$h(n,i,s,r,e[t+4],6,-145523070),r=$h(r,n,i,s,e[t+11],10,-1120210379),s=$h(s,r,n,i,e[t+2],15,718787259),i=$h(i,s,r,n,e[t+9],21,-343485551),n=Bh(n,a),i=Bh(i,o),s=Bh(s,c),r=Bh(r,p)}return[n,i,s,r]}(function(e){if(0===e.length)return[];const t=8*e.length,n=new Uint32Array(Nh(t));for(let i=0;i<t;i+=8)n[i>>5]|=(255&e[i/8])<<i%32;return n}(e),8*e.length))}));var Vh={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Hh(e,t,n){if(Vh.randomUUID&&!t&&!e)return Vh.randomUUID();const i=(e=e||{}).random||(e.rng||Dh)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=i[e];return t}return Mh(i)}function Wh(e,t,n,i){switch(e){case 0:return t&n^~t&i;case 1:case 3:return t^n^i;case 2:return t&n^t&i^n&i}}function Gh(e,t){return e<<t|e>>>32-t}Ah("v5",80,(function(e){const t=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){const t=unescape(encodeURIComponent(e));e=[];for(let n=0;n<t.length;++n)e.push(t.charCodeAt(n))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);const i=e.length/4+2,s=Math.ceil(i/16),r=new Array(s);for(let t=0;t<s;++t){const n=new Uint32Array(16);for(let i=0;i<16;++i)n[i]=e[64*t+4*i]<<24|e[64*t+4*i+1]<<16|e[64*t+4*i+2]<<8|e[64*t+4*i+3];r[t]=n}r[s-1][14]=8*(e.length-1)/Math.pow(2,32),r[s-1][14]=Math.floor(r[s-1][14]),r[s-1][15]=8*(e.length-1)&4294967295;for(let e=0;e<s;++e){const i=new Uint32Array(80);for(let t=0;t<16;++t)i[t]=r[e][t];for(let e=16;e<80;++e)i[e]=Gh(i[e-3]^i[e-8]^i[e-14]^i[e-16],1);let s=n[0],a=n[1],o=n[2],c=n[3],p=n[4];for(let e=0;e<80;++e){const n=Math.floor(e/20),r=Gh(s,5)+Wh(n,a,o,c)+p+t[n]+i[e]>>>0;p=c,c=o,o=Gh(a,30)>>>0,a=s,s=r}n[0]=n[0]+s>>>0,n[1]=n[1]+a>>>0,n[2]=n[2]+o>>>0,n[3]=n[3]+c>>>0,n[4]=n[4]+p>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,255&n[0],n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,255&n[1],n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,255&n[2],n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,255&n[3],n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,255&n[4]]}));const Kh=console,Jh=Hh(),Qh=Hh();class Yh{constructor({selfId:e,room:t,emitter:n,serverSocket:i,webrtcProvider:s,features:r,eventClaim:a}){m.ok(e,"selfId is required"),m.ok(t,"room is required"),m.ok(n&&n.emit,"emitter is required"),m.ok(s,"webrtcProvider is required");const{session:o,iceServers:c,sfuServer:p,mediaserverConfigTtlSeconds:d}=t;this._selfId=e,this._room=t,this._roomSessionId=o?.id,this._emitter=n,this._serverSocket=i,this._webrtcProvider=s,this._features=r||{},this._eventClaim=a,this._vegaConnection=null,this._mediasoupDevice=new fc.Device({handlerName:Ph()}),this._routerRtpCapabilities=null,this._sendTransport=null,this._receiveTransport=null,this._clientStates=new Map,this._streamIdToVideoConsumerId=new Map,this._consumers=new Map,this._micTrack=null,this._webcamTrack=null,this._screenVideoTrack=null,this._screenAudioTrack=null,this._micProducer=null,this._micProducerPromise=null,this._micPaused=!1,this._webcamProducer=null,this._webcamProducerPromise=null,this._webcamPaused=!1,this._screenVideoProducer=null,this._screenVideoProducerPromise=null,this._screenAudioProducer=null,this._screenAudioProducerPromise=null,this._sndTransportIceRestartPromise=null,this._rcvTransportIceRestartPromise=null,this._stopCameraTimeout=null,this._updateAndScheduleMediaServersRefresh({sfuServer:p,iceServers:c.iceServers||[],mediaserverConfigTtlSeconds:d}),this._socketListenerDeregisterFunctions=[]}_updateAndScheduleMediaServersRefresh({iceServers:e,sfuServer:t,mediaserverConfigTtlSeconds:n}){this._iceServers=e,this._sfuServer=t,this._mediaserverConfigTtlSeconds=n,this._sendTransport?.updateIceServers({iceServers:this._iceServers}),this._receiveTransport?.updateIceServers({iceServers:this._iceServers}),this._clearMediaServersRefresh(),n&&(this._fetchMediaServersTimer=setTimeout((()=>this._emitToSignal(kn)),1e3*n))}_clearMediaServersRefresh(){this._fetchMediaServersTimer&&(clearTimeout(this._fetchMediaServersTimer),this._fetchMediaServersTimer=null)}setupSocketListeners(){this._socketListenerDeregisterFunctions.push((()=>this._clearMediaServersRefresh()),this._serverSocket.on(Tn,(e=>{e.error?Kh.warn("FETCH_MEDIASERVER_CONFIG failed:",e.error):this._updateAndScheduleMediaServersRefresh(e)})),this._serverSocket.on(Pn,(()=>{this._screenVideoTrack&&this._emitScreenshareStarted()}))),this._connect()}_emitScreenshareStarted(){this._emitToSignal(Cn,{streamId:Qh,hasAudioTrack:Boolean(this._screenAudioTrack)})}_connect(){const e=`wss://${this._features.sfuServerOverrideHost||[this._sfuServer.url]}?${new URLSearchParams({clientId:this._selfId,organizationId:this._room.organizationId,roomName:this._room.name,eventClaim:this._room.isClaimed?this._eventClaim:null,lowBw:!0}).toString()}`;this._vegaConnection=new yh(e,Kh),this._vegaConnection.on("open",(()=>this._join())),this._vegaConnection.on("close",(()=>this._onClose())),this._vegaConnection.on("message",(e=>this._onMessage(e)))}_onClose(){Kh.debug("_onClose()"),this._sendTransport?.close(),this._receiveTransport?.close(),this._sendTransport=null,this._receiveTransport=null,this._streamIdToVideoConsumerId.clear(),setTimeout((()=>this._connect()),1e3)}async _join(){Kh.debug("join()");try{const{routerRtpCapabilities:e}=await this._vegaConnection.request("getCapabilities");this._routerRtpCapabilities||(((e,t)=>{const{vp9On:n,h264On:i}=t;if(n){const{preferredPayloadType:t}=e.codecs.find((e=>"video/vp9"===e.mimeType.toLowerCase())),{preferredPayloadType:n}=e.codecs.find((e=>"video/rtx"===e.mimeType.toLowerCase()&&e.parameters.apt===t));e.codecs=e.codecs.filter((e=>"audio"===e.kind||e.preferredPayloadType===t||e.preferredPayloadType===n))}else if(i){const{preferredPayloadType:t}=e.codecs.find((e=>"video/h264"===e.mimeType.toLowerCase())),{preferredPayloadType:n}=e.codecs.find((e=>"video/rtx"===e.mimeType.toLowerCase()&&e.parameters.apt===t));e.codecs=e.codecs.filter((e=>"audio"===e.kind||e.preferredPayloadType===t||e.preferredPayloadType===n))}})(e,this._features),this._routerRtpCapabilities=e,await this._mediasoupDevice.load({routerRtpCapabilities:e})),this._vegaConnection.message("setCapabilities",{rtpCapabilities:this._mediasoupDevice.rtpCapabilities}),await Promise.all([this._createTransport(!0),this._createTransport(!1)]);const t=[];!this._micTrack||this._micProducer||this._micProducerPromise||t.push(this._internalSendMic()),!this._webcamTrack||this._webcamProducer||this._webcamProducerPromise||t.push(this._internalSendWebcam()),!this._screenVideoTrack||this._screenVideoProducer||this._screenVideoProducerPromise||t.push(this._internalSendScreenVideo()),!this._screenAudioTrack||this._screenAudioProducer||this._screenAudioProducerPromise||t.push(this._internalSendScreenAudio()),await Promise.all(t)}catch(e){Kh.error("_join() [error:%o]",e),this._onClose()}}async _createTransport(e){const t=e?"createSendTransport":"createRecvTransport",n=await this._vegaConnection.request("createTransport",{producing:e,consuming:!e,enableTcp:!0,enableUdp:!0,preferUdp:!0,sctpParameters:{enableSctp:!0,numSctpStreams:{OS:1024,MIS:1024},maxSctpMessageSize:262144,sctpSendBufferSize:262144}});n.iceServers=this._iceServers,((e,t)=>{if(!t.useOnlyTURN||["off","false","0"].includes(t.useOnlyTURN))return;e.iceTransportPolicy="relay";const n={onlyudp:/^turn:.*transport=udp$/,onlytcp:/^turn:.*transport=tcp$/,onlytls:/^turns:.*transport=tcp$/}[t.useOnlyTURN];n&&(e.iceServers=e.iceServers.filter((e=>e.url&&e.url.match(n))))})(n,this._features);const i=this._mediasoupDevice[t](n),s=async t=>{if(Kh.debug(`Transport ConnectionStateChanged ${t}`),"disconnected"===t||"failed"===t)if(e){if(this._sndTransportIceRestartPromise)return;this._sndTransportIceRestartPromise=this._restartIce(i).finally((()=>{this._sndTransportIceRestartPromise=null}))}else{if(this._rcvTransportIceRestartPromise)return;this._rcvTransportIceRestartPromise=this._restartIce(i).finally((()=>{this._rcvTransportIceRestartPromise=null}))}};i.on("connect",(({dtlsParameters:e},t)=>{this._vegaConnection?.message("connectTransport",{transportId:i.id,dtlsParameters:e}),t()})).on("connectionstatechange",s),i.observer.once("close",(()=>{i.removeListener(s)})),e?(i.on("produce",(async({kind:e,rtpParameters:t,appData:n},s,r)=>{try{const{paused:r}=n,{id:a}=await(this._vegaConnection?.request("produce",{transportId:i.id,kind:e,rtpParameters:t,paused:r,appData:n}));s({id:a})}catch(e){r(e)}})),i.on("producedata",(async({appData:e,sctpStreamParameters:t},n,s)=>{try{const{id:s}=await(this._vegaConnection?.request("produceData",{transportId:i.id,sctpStreamParameters:t,appData:e}));n({id:s})}catch(e){s(e)}})),this._sendTransport=i):this._receiveTransport=i}async _restartIce(e,t=0){if(!e||!("closed"in e)||!("connectionState"in e))return void Kh.debug("_restartIce: No transport or property closed or connectionState!");if(e.closed)return void Kh.debug("_restartIce: Transport is closed!");if("disconnected"!==e.connectionState&&"failed"!==e.connectionState)return void Kh.debug("_restartIce: Connection is healthy ICE restart no loneger needed!");const{iceRestartStarted:n}=e.appData,i=Date.now();if(Number.isFinite(n)&&i-n<3500)return;if(e.appData.iceRestartStarted=i,5<=t)return void Kh.debug("_restartIce: Reached restart ICE maximum retry count!");if(!this._vegaConnection)return void Kh.debug("_restartIce: Connection is undefined");const{iceParameters:s}=await this._vegaConnection.request("restartIce",{transportId:e.id});Kh.debug("_restartIce: ICE restart iceParameters received from SFU: ",s);const r=await e.restartIce({iceParameters:s}).then((()=>null)).catch((e=>e));if(r)switch(Kh.error(`_restartIce: ICE restart failed: ${r}`),r.message){case"missing transportId":case"no such transport":break;default:await new Promise((e=>{setTimeout((()=>{e()}),Math.min(3500*2**t,6e4))})),await this._restartIce(e,t+1)}else await new Promise((e=>{setTimeout((()=>{e()}),6e4*Math.min(8,t+1))})),"failed"!==e.connectionState&&"disconnected"!==e.connectionState||await this._restartIce(e,t+1)}async _internalSendMic(){Kh.debug("_internalSendMic()"),this._micProducerPromise=(async()=>{try{if(!this._micTrack||!this._sendTransport||this._micProducer)return void(this._micProducerPromise=null);const e=this._micPaused,t=await this._sendTransport.produce({track:this._micTrack,disableTrackOnPause:!1,stopTracks:!1,...Th("audio",!1,this._features),appData:{streamId:Jh,sourceClientId:this._selfId,screenShare:!1,source:"mic",paused:e}});e?t.pause():t.resume(),this._micProducer=t,t.observer.once("close",(()=>{Kh.debug('micProducer "close" event'),t.appData.localClosed&&this._vegaConnection?.message("closeProducers",{producerIds:[t.id]}),this._micProducer=null,this._micProducerPromise=null})),this._micTrack!==this._micProducer.track&&await this._replaceMicTrack(),this._micPaused!==this._micProducer.paused&&this._pauseResumeMic()}catch(e){Kh.error("micProducer failed:%o",e)}finally{this._micProducerPromise=null,this._micTrack||(this._stopProducer(this._micProducer),this._micProducer=null)}})()}async _replaceMicTrack(){Kh.debug("_replaceMicTrack()"),this._micTrack&&this._micProducer&&!this._micProducer.closed&&this._micProducer.track!==this._micTrack&&(await this._micProducer.replaceTrack({track:this._micTrack}),await this._replaceMicTrack())}_pauseResumeMic(){Kh.debug("_pauseResumeMic()"),this._micProducer&&!this._micProducer.closed&&this._micPaused!==this._micProducer.paused&&(this._micPaused?(this._micProducer.pause(),this._vegaConnection?.message("pauseProducers",{producerIds:[this._micProducer.id]})):(this._micProducer.resume(),this._vegaConnection?.message("resumeProducers",{producerIds:[this._micProducer.id]})),this._pauseResumeMic())}async _sendMic(e){return Kh.debug("_sendMic() [track:%o]",e),this._micTrack=e,this._micProducer?await this._replaceMicTrack():this._micProducerPromise?void 0:this._sendTransport?await this._internalSendMic():void 0}async _internalSendWebcam(){Kh.debug("_internalSendWebcam()"),this._webcamProducerPromise=(async()=>{try{if(!this._webcamTrack||!this._sendTransport||this._webcamProducer)return void(this._webcamProducerPromise=null);const e=this._webcamPaused,t=await this._sendTransport.produce({track:this._webcamTrack,disableTrackOnPause:!1,stopTracks:!1,...Th("video",!1,this._features),appData:{streamId:Jh,sourceClientId:this._selfId,screenShare:!1,source:"webcam",paused:e}});e?t.pause():t.resume(),this._webcamProducer=t,t.observer.once("close",(()=>{Kh.debug('webcamProducer "close" event'),t.appData.localClosed&&this._vegaConnection?.message("closeProducers",{producerIds:[t.id]}),this._webcamProducer=null,this._webcamProducerPromise=null})),this._webcamTrack!==this._webcamProducer.track&&await this._replaceWebcamTrack(),this._webcamPaused!==this._webcamProducer.paused&&this._pauseResumeWebcam()}catch(e){Kh.error("webcamProducer failed:%o",e)}finally{this._webcamProducerPromise=null,this._webcamTrack||(await this._stopProducer(this._webcamProducer),this._webcamProducer=null)}})()}async _replaceWebcamTrack(){Kh.debug("_replaceWebcamTrack()"),this._webcamTrack&&this._webcamProducer&&!this._webcamProducer.closed&&this._webcamProducer.track!==this._webcamTrack&&(await this._webcamProducer.replaceTrack({track:this._webcamTrack}),await this._replaceWebcamTrack())}_pauseResumeWebcam(){Kh.debug("_pauseResumeWebcam()"),this._webcamProducer&&!this._webcamProducer.closed&&this._webcamPaused!==this._webcamProducer.paused&&(this._webcamPaused?(this._webcamProducer.pause(),this._vegaConnection?.message("pauseProducers",{producerIds:[this._webcamProducer.id]})):(this._webcamProducer.resume(),this._vegaConnection?.message("resumeProducers",{producerIds:[this._webcamProducer.id]})),this._pauseResumeWebcam())}async _sendWebcam(e){return Kh.debug("_sendWebcam() [track:%o]",e),this._webcamTrack=e,this._webcamProducer?await this._replaceWebcamTrack():this._webcamProducerPromise?void 0:this._sendTransport?await this._internalSendWebcam():void 0}async _internalSendScreenVideo(){Kh.debug("_internalSendScreenVideo()"),this._screenVideoProducerPromise=(async()=>{try{if(!this._screenVideoTrack||!this._sendTransport||this._screenVideoProducer)return void(this._screenVideoProducerPromise=null);const e=await this._sendTransport.produce({track:this._screenVideoTrack,disableTrackOnPause:!1,stopTracks:!1,...Th("video",!0,this._features),appData:{streamId:Qh,sourceClientId:this._selfId,screenShare:!0,source:"screenvideo",paused:!1}});this._screenVideoProducer=e,e.observer.once("close",(()=>{Kh.debug('screenVideoProducer "close" event'),e.appData.localClosed&&this._vegaConnection?.message("closeProducers",{producerIds:[e.id]}),this._screenVideoProducer=null,this._screenVideoProducerPromise=null})),this._screenVideoTrack!==this._screenVideoProducer.track&&await this._replaceScreenVideoTrack()}catch(e){Kh.error("screenVideoProducer failed:%o",e)}finally{this._screenVideoProducerPromise=null,this._screenVideoTrack||(await this._stopProducer(this._screenVideoProducer),this._screenVideoProducer=null)}})()}async _replaceScreenVideoTrack(){Kh.debug("_replaceScreenVideoTrack()"),this._screenVideoTrack&&this._screenVideoProducer&&!this._screenVideoProducer.closed&&this._screenVideoProducer.track!==this._screenVideoTrack&&(await this._screenVideoProducer.replaceTrack({track:this._screenVideoTrack}),await this._replaceScreenVideoTrack())}async _sendScreenVideo(e){return Kh.debug("_sendScreenVideo() [track:%o]",e),this._screenVideoTrack=e,this._screenVideoProducer?await this._replaceScreenVideoTrack():this._screenVideoProducerPromise?void 0:this._sendTransport?await this._internalSendScreenVideo():void 0}async _internalSendScreenAudio(){Kh.debug("_internalSendScreenAudio()"),this._screenAudioProducerPromise=(async()=>{try{if(!this._screenAudioTrack||!this._sendTransport||this._screenAudioProducer)return void(this._screenAudioProducerPromise=null);const e=await this._sendTransport.produce({track:this._screenAudioTrack,disableTrackOnPause:!1,stopTracks:!1,...Th("video",!0,this._features),appData:{streamId:Qh,sourceClientId:this._selfId,screenShare:!0,source:"screenaudio",paused:!1}});this._screenAudioProducer=e,e.observer.once("close",(()=>{Kh.debug('screenAudioProducer "close" event'),e.appData.localClosed&&this._vegaConnection?.message("closeProducers",{producerIds:[e.id]}),this._screenAudioProducer=null,this._screenAudioProducerPromise=null})),this._screenAudioTrack!==this._screenAudioProducer.track&&await this._replaceScreenAudioTrack()}catch(e){Kh.error("screenAudioProducer failed:%o",e)}finally{this._screenAudioProducerPromise=null,this._screenAudioTrack||(await this._stopProducer(this._screenAudioProducer),this._screenAudioProducer=null)}})()}async _replaceScreenAudioTrack(){Kh.debug("_replaceScreenAudioTrack()"),this._screenAudioTrack&&this._screenAudioProducer&&!this._screenAudioProducer.closed&&this._screenAudioProducer.track!==this._screenAudioTrack&&(await this._screenAudioProducer.replaceTrack({track:this._screenAudioTrack}),await this._replaceScreenAudioTrack())}async _sendScreenAudio(e){return Kh.debug("_sendScreenAudio() [track:%o]",e),this._screenAudioTrack=e,this._screenAudioProducer?await this._replaceScreenAudioTrack():this._screenAudioProducerPromise?void 0:this._sendTransport?await this._internalSendScreenAudio():void 0}_stopProducer(e){Kh.debug("_stopProducer()"),e&&!e.closed&&(e.appData.localClosed=!0,e.close())}isInitializedWith({selfId:e,roomName:t,isSfu:n}){return this._selfId===e&&this._room.name===t&&Boolean(n)}setEventClaim(e){this._eventClaim=e,this._vegaConnection?.message("eventClaim",{eventClaim:e})}setRoomSessionId(e){this._roomSessionId=e}disconnect(e,t,n){if(Kh.debug("disconnect() [clientIdOrStreamId:%s, eventClaim:%s]",e,n),this._clientStates.has(e)){const t=this._clientStates.get(e);t.hasAcceptedWebcamStream=!1,t.hasAcceptedScreenStream=!1,this._syncIncomingStreamsWithPWA(e)}n&&(this._eventClaim=n,this._vegaConnection?.message("eventClaim",{eventClaim:n}))}replaceTrack(e,t){"audio"===t.kind&&(this._micTrack=t,this._replaceMicTrack()),"video"===t.kind&&(this._webcamTrack=t,this._replaceWebcamTrack())}removeStream(e,t,n){Kh.debug("removeStream() [streamId:%s, requestedByClientId:%s]",e,n),this._emitToSignal(Rn,{streamId:Qh,requestedByClientId:n}),this._stopProducer(this._screenVideoProducer),this._screenVideoProducer=null,this._screenVideoTrack=null,this._stopProducer(this._screenAudioProducer),this._screenAudioProducer=null,this._screenAudioTrack=null}addNewStream(e,t,n,i){if("0"===e){this._micPaused=n,this._webcamPaused=i;const e=t.getVideoTracks()[0],s=t.getAudioTracks()[0];e&&this._sendWebcam(e),s&&this._sendMic(s)}else{const e=t.getVideoTracks()[0],n=t.getAudioTracks()[0];e&&this._sendScreenVideo(e),n&&this._sendScreenAudio(n),this._emitScreenshareStarted()}}stopOrResumeAudio(e,t){Kh.debug("stopOrResumeAudio() [enabled:%s]",t),this._micPaused=!t,this._pauseResumeMic()}stopOrResumeVideo(e,t){if(Kh.debug("stopOrResumeVideo() [enable:%s]",t),this._webcamPaused=!t,this._pauseResumeWebcam(),"chrome"===browserName)if(t){if(0===e.getVideoTracks().length){const t=this._webrtcProvider.getMediaConstraints().video;navigator.mediaDevices.getUserMedia({video:t}).then((t=>{const n=t.getVideoTracks()[0];e.addTrack(n),this._emitToPWA(bn,{streamId:e.id,tracks:[n],screenShare:!1}),this._sendWebcam(n)}))}}else clearTimeout(this._stopCameraTimeout),this._stopCameraTimeout=setTimeout((()=>{e.getVideoTracks().forEach((t=>{!1===t.enabled&&(t.stop(),e.removeTrack(t),this._emitToPWA(yn,{stream:e,track:t}),this._webcamProducer&&!this._webcamProducer.closed&&this._webcamProducer.track===t&&(this._stopProducer(this._webcamProducer),this._webcamProducer=null,this._webcamTrack=null))}))}),5e3)}supportsScreenShareAudio(){return!0}acceptNewStream({streamId:e,clientId:t}){Kh.debug("acceptNewStream()",{streamId:e,clientId:t});const n=this._getOrCreateClientState(t);e!==t?(n.hasAcceptedScreenStream=!0,n.hasEmittedScreenStream=!1):(n.hasAcceptedWebcamStream=!0,n.hasEmittedWebcamStream=!1),this._syncIncomingStreamsWithPWA(t)}updateStreamResolution(e,t,{width:n,height:i}){Kh.debug("updateStreamResolution()",{streamId:e,width:n,height:i});const s=this._streamIdToVideoConsumerId.get(e),r=this._consumers.get(s);if(!r)return;const a=Math.max(n,i),o=a>=480?a>=960?2:1:0;r.appData.spatialLayer!==o&&(r.appData.spatialLayer=o,this._vegaConnection?.message("setConsumersPreferredLayers",{consumerIds:[s],spatialLayer:o,temporalLayer:o}))}disconnectAll(){this._socketListenerDeregisterFunctions.forEach((e=>{e()})),this._socketListenerDeregisterFunctions=[],this._vegaConnection?.removeAllListeners(),this._vegaConnection?.close(),this._sendTransport?.close(),this._receiveTransport?.close(),this._micTrack=null,this._webcamTrack=null,this._screenVideoTrack=null,this._screenAudioTrack=null,this._streamIdToVideoConsumerId.clear(),this._mediasoupDevice=null}async _onMessage(e){const{method:t,data:n}=e;return Promise.resolve().then((()=>{switch(t){case"consumerReady":return this._onConsumerReady(n);case"consumerClosed":return this._onConsumerClosed(n);case"consumerPaused":return this._onConsumerPaused(n);case"consumerResumed":return this._onConsumerResumed(n);case"dominantSpeaker":return this._onDominantSpeaker(n);default:return void Kh.debug(`unknown message method "${t}"`)}})).catch((e=>{console.error('"message" failed [error:%o]',e)}))}async _onConsumerReady(e){Kh.debug("_onConsumerReady()",{id:e.id,producerId:e.producerId});const t=await this._receiveTransport.consume(e);t.pause(),t.appData.localPaused=!0,t.appData.spatialLayer=2,this._consumers.set(t.id,t),t.observer.once("close",(()=>{this._consumers.delete(t.id),this._consumerClosedCleanup(t)}));const{sourceClientId:n,screenShare:i,streamId:s}=t.appData,r=this._getOrCreateClientState(n);i?(r.hasEmittedScreenStream=!1,r.screenShareStreamId=s):(r.hasEmittedWebcamStream=!1,r.camStreamId=s);let a=i?r.screenStream:r.webcamStream;a&&a.inboundId===s||(a=new MediaStream,a.inboundId=s,i?r.screenStream=a:r.webcamStream=a),"video"===t.kind&&this._streamIdToVideoConsumerId.set(a.id,t.id),a.addTrack(t.track),this._syncIncomingStreamsWithPWA(n)}async _onConsumerClosed({consumerId:e,reason:t}){Kh.debug("_onConsumerClosed()",{consumerId:e,reason:t}),this._consumers.get(e)?.close()}_onConsumerPaused({consumerId:e}){Kh.debug("_onConsumerPaused()",{consumerId:e});const t=this._consumers.get(e);t&&(t.appData.remotePaused=!0,t.pause())}_onConsumerResumed({consumerId:e}){Kh.debug("_onConsumerResumed()",{consumerId:e});const t=this._consumers.get(e);t&&(t.appData.remotePaused=!1,t.appData.localPaused||t.resume())}_onDominantSpeaker({consumerId:e}){const t=this._consumers.get(e);if(!t)return;const{sourceClientId:n}=t.appData;this._emitToPWA(Jo,{clientId:n})}_consumerClosedCleanup(e){const{sourceClientId:t,screenShare:n}=e.appData,i=this._getOrCreateClientState(t),s=n?i.screenStream:i.webcamStream;s&&(s.removeTrack(e.track),0===s.getTracks().length&&(this._streamIdToVideoConsumerId.delete(s.id),n?(i.screenStream=null,i.hasEmittedScreenStream=!1,i.screenShareStreamId=null):(i.hasEmittedWebcamStream=!1,i.camStreamId=null)))}_syncIncomingStreamsWithPWA(e){const t=this._getOrCreateClientState(e),{webcamStream:n,screenStream:i,hasEmittedWebcamStream:s,hasEmittedScreenStream:r,hasAcceptedWebcamStream:a,hasAcceptedScreenStream:o,screenShareStreamId:c,camStreamId:p}=t,d=[],l=[];this._consumers.forEach((t=>{if(t.appData.sourceClientId!==e)return;const n=t.appData.screenShare?o:a;!t.appData.localPaused!==n&&(n?(t.appData.remotePaused||t.resume(),t.appData.localPaused=!1,l.push(t.id)):(t.pause(),t.appData.localPaused=!0,d.push(t.id)))})),d.length>0&&this._vegaConnection?.message("pauseConsumers",{consumerIds:d}),l.length>0&&this._vegaConnection?.message("resumeConsumers",{consumerIds:l}),n&&!s&&a&&(this._emitToPWA(fn,{clientId:e,stream:n,streamId:p}),t.hasEmittedWebcamStream=!0),i&&!r&&o&&(this._emitToPWA(fn,{clientId:e,stream:i,streamId:c}),t.hasEmittedScreenStream=!0)}_getOrCreateClientState(e){let t=this._clientStates.get(e);return t||(t={hasAcceptedWebcamStream:!1,hasAcceptedScreenStream:!1,hasEmittedWebcamStream:!1,hasEmittedScreenStream:!1,webcamStream:null,screenStream:null,screenShareStreamId:null,camStreamId:null},this._clientStates.set(e,t)),t}_emitToPWA(e,t){this._emitter.emit(e,t)}_emitToSignal(e,t,n){this._serverSocket.emit(e,t,n)}shouldAcceptStreamsFromBothSides(){return!0}}class Xh{constructor({emitter:e,serverSocket:t,webrtcProvider:n,features:i}){this.emitter=e,this.currentManager=null,t.on(Pn,(({room:s,selfId:r,error:a,eventClaim:o})=>{if(a)return;const c={selfId:r,room:s,emitter:e,serverSocket:t,webrtcProvider:n,features:i,eventClaim:o},p=!!s.sfuServer;if(this.currentManager){if(this.currentManager.isInitializedWith({selfId:r,roomName:s.name,isSfu:p}))return void(this.currentManager.setEventClaim&&o&&this.currentManager.setEventClaim(o));this.currentManager.disconnectAll(),e.emit(vn)}let d=null;d=p?new Yh(c):new pc(c),d.setupSocketListeners(),e.emit(gn,{rtcManager:d}),this.currentManager=d}))}}const Zh=[{pattern:/^(?:([^.]+)[.])?(server:?\d*)/,separator:"."},{pattern:/^(?:([^.]+)[.])?(localhost:?\d*)/,separator:"."},{pattern:/^(?:([^.]+)[.])?((\d+[.]){3}:?\d*)$/,separator:"."},{pattern:/^(?:([^.]+)-)?(ip-[^.]*[.](?:hereby[.]dev|rfc1918[.]disappear[.]at)(?::\d+|))$/,separator:"-"},{pattern:/^(?:([^.]+)[.])?((:?[^.]+[.]){1,}[^.]+)$/,separator:"."}];function ef({host:e="whereby.com",protocol:t="https:"}={}){let n="",i=e,s=".";for(const{separator:t,pattern:r}of Zh){const a=r.exec(e);if(a){n=a[1]||"",i=a[2],s=t;break}}const r=n?`${n}${s}${i}`:i;return{domain:i,domainWithSeparator:`${s}${i}`,organizationDomain:r,organization:`${t}//${r}`,service:`${t}//${i}`,subdomain:n}}ef(window&&window.location);var tf={};function nf(e,t){return function(){return e.apply(t,arguments)}}({get exports(){return tf},set exports(e){tf=e}}).exports=function(e){return(e instanceof Buffer?e:Buffer.from(e.toString(),"binary")).toString("base64")};const{toString:sf}=Object.prototype,{getPrototypeOf:rf}=Object,af=(e=>t=>{const n=sf.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),of=e=>(e=e.toLowerCase(),t=>af(t)===e),cf=e=>t=>typeof t===e,{isArray:pf}=Array,df=cf("undefined");const lf=of("ArrayBuffer");const uf=cf("string"),mf=cf("function"),hf=cf("number"),ff=e=>null!==e&&"object"==typeof e,gf=e=>{if("object"!==af(e))return!1;const t=rf(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},vf=of("Date"),bf=of("File"),yf=of("Blob"),_f=of("FileList"),xf=of("URLSearchParams");function wf(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let i,s;if("object"!=typeof e&&(e=[e]),pf(e))for(i=0,s=e.length;i<s;i++)t.call(null,e[i],i,e);else{const s=n?Object.getOwnPropertyNames(e):Object.keys(e),r=s.length;let a;for(i=0;i<r;i++)a=s[i],t.call(null,e[a],a,e)}}function Sf(e,t){t=t.toLowerCase();const n=Object.keys(e);let i,s=n.length;for(;s-- >0;)if(i=n[s],t===i.toLowerCase())return i;return null}const kf="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,Cf=e=>!df(e)&&e!==kf;const Rf=(Tf="undefined"!=typeof Uint8Array&&rf(Uint8Array),e=>Tf&&e instanceof Tf);var Tf;const Pf=of("HTMLFormElement"),Ef=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Of=of("RegExp"),Df=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),i={};wf(n,((n,s)=>{!1!==t(n,s,e)&&(i[s]=n)})),Object.defineProperties(e,i)};var jf={isArray:pf,isArrayBuffer:lf,isBuffer:function(e){return null!==e&&!df(e)&&null!==e.constructor&&!df(e.constructor)&&mf(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{const t="[object FormData]";return e&&("function"==typeof FormData&&e instanceof FormData||sf.call(e)===t||mf(e.toString)&&e.toString()===t)},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&lf(e.buffer),t},isString:uf,isNumber:hf,isBoolean:e=>!0===e||!1===e,isObject:ff,isPlainObject:gf,isUndefined:df,isDate:vf,isFile:bf,isBlob:yf,isRegExp:Of,isFunction:mf,isStream:e=>ff(e)&&mf(e.pipe),isURLSearchParams:xf,isTypedArray:Rf,isFileList:_f,forEach:wf,merge:function e(){const{caseless:t}=Cf(this)&&this||{},n={},i=(i,s)=>{const r=t&&Sf(n,s)||s;gf(n[r])&&gf(i)?n[r]=e(n[r],i):gf(i)?n[r]=e({},i):pf(i)?n[r]=i.slice():n[r]=i};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&wf(arguments[e],i);return n},extend:(e,t,n,{allOwnKeys:i}={})=>(wf(t,((t,i)=>{n&&mf(t)?e[i]=nf(t,n):e[i]=t}),{allOwnKeys:i}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,i)=>{e.prototype=Object.create(t.prototype,i),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,i)=>{let s,r,a;const o={};if(t=t||{},null==e)return t;do{for(s=Object.getOwnPropertyNames(e),r=s.length;r-- >0;)a=s[r],i&&!i(a,e,t)||o[a]||(t[a]=e[a],o[a]=!0);e=!1!==n&&rf(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:af,kindOfTest:of,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const i=e.indexOf(t,n);return-1!==i&&i===n},toArray:e=>{if(!e)return null;if(pf(e))return e;let t=e.length;if(!hf(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let i;for(;(i=n.next())&&!i.done;){const n=i.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const i=[];for(;null!==(n=e.exec(t));)i.push(n);return i},isHTMLForm:Pf,hasOwnProperty:Ef,hasOwnProp:Ef,reduceDescriptors:Df,freezeMethods:e=>{Df(e,((t,n)=>{if(mf(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const i=e[n];mf(i)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},i=e=>{e.forEach((e=>{n[e]=!0}))};return pf(e)?i(e):i(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[_-\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:Sf,global:kf,isContextDefined:Cf,toJSONObject:e=>{const t=new Array(10),n=(e,i)=>{if(ff(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[i]=e;const s=pf(e)?[]:{};return wf(e,((e,t)=>{const r=n(e,i+1);!df(r)&&(s[t]=r)})),t[i]=void 0,s}}return e};return n(e,0)}};function If(e,t,n,i,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),i&&(this.request=i),s&&(this.response=s)}jf.inherits(If,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:jf.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const Mf=If.prototype,Lf={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{Lf[e]={value:e}})),Object.defineProperties(If,Lf),Object.defineProperty(Mf,"isAxiosError",{value:!0}),If.from=(e,t,n,i,s,r)=>{const a=Object.create(Mf);return jf.toFlatObject(e,a,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),If.call(a,e.message,t,n,i,s),a.cause=e,a.name=e.name,r&&Object.assign(a,r),a};var Af=p.Stream,Nf=Bf;function Bf(){this.source=null,this.dataSize=0,this.maxDataSize=1048576,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}t.inherits(Bf,Af),Bf.create=function(e,t){var n=new this;for(var i in t=t||{})n[i]=t[i];n.source=e;var s=e.emit;return e.emit=function(){return n._handleEmit(arguments),s.apply(e,arguments)},e.on("error",(function(){})),n.pauseStream&&e.pause(),n},Object.defineProperty(Bf.prototype,"readable",{configurable:!0,enumerable:!0,get:function(){return this.source.readable}}),Bf.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)},Bf.prototype.resume=function(){this._released||this.release(),this.source.resume()},Bf.prototype.pause=function(){this.source.pause()},Bf.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]},Bf.prototype.pipe=function(){var e=Af.prototype.pipe.apply(this,arguments);return this.resume(),e},Bf.prototype._handleEmit=function(e){this._released?this.emit.apply(this,e):("data"===e[0]&&(this.dataSize+=e[1].length,this._checkIfMaxDataSizeExceeded()),this._bufferedEvents.push(e))},Bf.prototype._checkIfMaxDataSizeExceeded=function(){if(!(this._maxDataSizeExceeded||this.dataSize<=this.maxDataSize)){this._maxDataSizeExceeded=!0;var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this.emit("error",new Error(e))}};var Ff=t,Uf=p.Stream,zf=Nf,qf=$f;function $f(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2097152,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}Ff.inherits($f,Uf),$f.create=function(e){var t=new this;for(var n in e=e||{})t[n]=e[n];return t},$f.isStreamLike=function(e){return"function"!=typeof e&&"string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e&&!Buffer.isBuffer(e)},$f.prototype.append=function(e){if($f.isStreamLike(e)){if(!(e instanceof zf)){var t=zf.create(e,{maxDataSize:1/0,pauseStream:this.pauseStreams});e.on("data",this._checkDataSize.bind(this)),e=t}this._handleErrors(e),this.pauseStreams&&e.pause()}return this._streams.push(e),this},$f.prototype.pipe=function(e,t){return Uf.prototype.pipe.call(this,e,t),this.resume(),e},$f.prototype._getNext=function(){if(this._currentStream=null,this._insideLoop)this._pendingNext=!0;else{this._insideLoop=!0;try{do{this._pendingNext=!1,this._realGetNext()}while(this._pendingNext)}finally{this._insideLoop=!1}}},$f.prototype._realGetNext=function(){var e=this._streams.shift();void 0!==e?"function"==typeof e?e(function(e){$f.isStreamLike(e)&&(e.on("data",this._checkDataSize.bind(this)),this._handleErrors(e)),this._pipeNext(e)}.bind(this)):this._pipeNext(e):this.end()},$f.prototype._pipeNext=function(e){if(this._currentStream=e,$f.isStreamLike(e))return e.on("end",this._getNext.bind(this)),void e.pipe(this,{end:!1});var t=e;this.write(t),this._getNext()},$f.prototype._handleErrors=function(e){var t=this;e.on("error",(function(e){t._emitError(e)}))},$f.prototype.write=function(e){this.emit("data",e)},$f.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&"function"==typeof this._currentStream.pause&&this._currentStream.pause(),this.emit("pause"))},$f.prototype.resume=function(){this._released||(this._released=!0,this.writable=!0,this._getNext()),this.pauseStreams&&this._currentStream&&"function"==typeof this._currentStream.resume&&this._currentStream.resume(),this.emit("resume")},$f.prototype.end=function(){this._reset(),this.emit("end")},$f.prototype.destroy=function(){this._reset(),this.emit("close")},$f.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null},$f.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}},$f.prototype._updateDataSize=function(){this.dataSize=0;var e=this;this._streams.forEach((function(t){t.dataSize&&(e.dataSize+=t.dataSize)})),this._currentStream&&this._currentStream.dataSize&&(this.dataSize+=this._currentStream.dataSize)},$f.prototype._emitError=function(e){this._reset(),this.emit("error",e)};var Vf={},Hf={},Wf={"application/1d-interleaved-parityfec":{source:"iana"},"application/3gpdash-qoe-report+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/3gpp-ims+xml":{source:"iana",compressible:!0},"application/3gpphal+json":{source:"iana",compressible:!0},"application/3gpphalforms+json":{source:"iana",compressible:!0},"application/a2l":{source:"iana"},"application/ace+cbor":{source:"iana"},"application/activemessage":{source:"iana"},"application/activity+json":{source:"iana",compressible:!0},"application/alto-costmap+json":{source:"iana",compressible:!0},"application/alto-costmapfilter+json":{source:"iana",compressible:!0},"application/alto-directory+json":{source:"iana",compressible:!0},"application/alto-endpointcost+json":{source:"iana",compressible:!0},"application/alto-endpointcostparams+json":{source:"iana",compressible:!0},"application/alto-endpointprop+json":{source:"iana",compressible:!0},"application/alto-endpointpropparams+json":{source:"iana",compressible:!0},"application/alto-error+json":{source:"iana",compressible:!0},"application/alto-networkmap+json":{source:"iana",compressible:!0},"application/alto-networkmapfilter+json":{source:"iana",compressible:!0},"application/alto-updatestreamcontrol+json":{source:"iana",compressible:!0},"application/alto-updatestreamparams+json":{source:"iana",compressible:!0},"application/aml":{source:"iana"},"application/andrew-inset":{source:"iana",extensions:["ez"]},"application/applefile":{source:"iana"},"application/applixware":{source:"apache",extensions:["aw"]},"application/at+jwt":{source:"iana"},"application/atf":{source:"iana"},"application/atfx":{source:"iana"},"application/atom+xml":{source:"iana",compressible:!0,extensions:["atom"]},"application/atomcat+xml":{source:"iana",compressible:!0,extensions:["atomcat"]},"application/atomdeleted+xml":{source:"iana",compressible:!0,extensions:["atomdeleted"]},"application/atomicmail":{source:"iana"},"application/atomsvc+xml":{source:"iana",compressible:!0,extensions:["atomsvc"]},"application/atsc-dwd+xml":{source:"iana",compressible:!0,extensions:["dwd"]},"application/atsc-dynamic-event-message":{source:"iana"},"application/atsc-held+xml":{source:"iana",compressible:!0,extensions:["held"]},"application/atsc-rdt+json":{source:"iana",compressible:!0},"application/atsc-rsat+xml":{source:"iana",compressible:!0,extensions:["rsat"]},"application/atxml":{source:"iana"},"application/auth-policy+xml":{source:"iana",compressible:!0},"application/bacnet-xdd+zip":{source:"iana",compressible:!1},"application/batch-smtp":{source:"iana"},"application/bdoc":{compressible:!1,extensions:["bdoc"]},"application/beep+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/calendar+json":{source:"iana",compressible:!0},"application/calendar+xml":{source:"iana",compressible:!0,extensions:["xcs"]},"application/call-completion":{source:"iana"},"application/cals-1840":{source:"iana"},"application/captive+json":{source:"iana",compressible:!0},"application/cbor":{source:"iana"},"application/cbor-seq":{source:"iana"},"application/cccex":{source:"iana"},"application/ccmp+xml":{source:"iana",compressible:!0},"application/ccxml+xml":{source:"iana",compressible:!0,extensions:["ccxml"]},"application/cdfx+xml":{source:"iana",compressible:!0,extensions:["cdfx"]},"application/cdmi-capability":{source:"iana",extensions:["cdmia"]},"application/cdmi-container":{source:"iana",extensions:["cdmic"]},"application/cdmi-domain":{source:"iana",extensions:["cdmid"]},"application/cdmi-object":{source:"iana",extensions:["cdmio"]},"application/cdmi-queue":{source:"iana",extensions:["cdmiq"]},"application/cdni":{source:"iana"},"application/cea":{source:"iana"},"application/cea-2018+xml":{source:"iana",compressible:!0},"application/cellml+xml":{source:"iana",compressible:!0},"application/cfw":{source:"iana"},"application/city+json":{source:"iana",compressible:!0},"application/clr":{source:"iana"},"application/clue+xml":{source:"iana",compressible:!0},"application/clue_info+xml":{source:"iana",compressible:!0},"application/cms":{source:"iana"},"application/cnrp+xml":{source:"iana",compressible:!0},"application/coap-group+json":{source:"iana",compressible:!0},"application/coap-payload":{source:"iana"},"application/commonground":{source:"iana"},"application/conference-info+xml":{source:"iana",compressible:!0},"application/cose":{source:"iana"},"application/cose-key":{source:"iana"},"application/cose-key-set":{source:"iana"},"application/cpl+xml":{source:"iana",compressible:!0,extensions:["cpl"]},"application/csrattrs":{source:"iana"},"application/csta+xml":{source:"iana",compressible:!0},"application/cstadata+xml":{source:"iana",compressible:!0},"application/csvm+json":{source:"iana",compressible:!0},"application/cu-seeme":{source:"apache",extensions:["cu"]},"application/cwt":{source:"iana"},"application/cybercash":{source:"iana"},"application/dart":{compressible:!0},"application/dash+xml":{source:"iana",compressible:!0,extensions:["mpd"]},"application/dash-patch+xml":{source:"iana",compressible:!0,extensions:["mpp"]},"application/dashdelta":{source:"iana"},"application/davmount+xml":{source:"iana",compressible:!0,extensions:["davmount"]},"application/dca-rft":{source:"iana"},"application/dcd":{source:"iana"},"application/dec-dx":{source:"iana"},"application/dialog-info+xml":{source:"iana",compressible:!0},"application/dicom":{source:"iana"},"application/dicom+json":{source:"iana",compressible:!0},"application/dicom+xml":{source:"iana",compressible:!0},"application/dii":{source:"iana"},"application/dit":{source:"iana"},"application/dns":{source:"iana"},"application/dns+json":{source:"iana",compressible:!0},"application/dns-message":{source:"iana"},"application/docbook+xml":{source:"apache",compressible:!0,extensions:["dbk"]},"application/dots+cbor":{source:"iana"},"application/dskpp+xml":{source:"iana",compressible:!0},"application/dssc+der":{source:"iana",extensions:["dssc"]},"application/dssc+xml":{source:"iana",compressible:!0,extensions:["xdssc"]},"application/dvcs":{source:"iana"},"application/ecmascript":{source:"iana",compressible:!0,extensions:["es","ecma"]},"application/edi-consent":{source:"iana"},"application/edi-x12":{source:"iana",compressible:!1},"application/edifact":{source:"iana",compressible:!1},"application/efi":{source:"iana"},"application/elm+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/elm+xml":{source:"iana",compressible:!0},"application/emergencycalldata.cap+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/emergencycalldata.comment+xml":{source:"iana",compressible:!0},"application/emergencycalldata.control+xml":{source:"iana",compressible:!0},"application/emergencycalldata.deviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.ecall.msd":{source:"iana"},"application/emergencycalldata.providerinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.serviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.subscriberinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.veds+xml":{source:"iana",compressible:!0},"application/emma+xml":{source:"iana",compressible:!0,extensions:["emma"]},"application/emotionml+xml":{source:"iana",compressible:!0,extensions:["emotionml"]},"application/encaprtp":{source:"iana"},"application/epp+xml":{source:"iana",compressible:!0},"application/epub+zip":{source:"iana",compressible:!1,extensions:["epub"]},"application/eshop":{source:"iana"},"application/exi":{source:"iana",extensions:["exi"]},"application/expect-ct-report+json":{source:"iana",compressible:!0},"application/express":{source:"iana",extensions:["exp"]},"application/fastinfoset":{source:"iana"},"application/fastsoap":{source:"iana"},"application/fdt+xml":{source:"iana",compressible:!0,extensions:["fdt"]},"application/fhir+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/fhir+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/fido.trusted-apps+json":{compressible:!0},"application/fits":{source:"iana"},"application/flexfec":{source:"iana"},"application/font-sfnt":{source:"iana"},"application/font-tdpfr":{source:"iana",extensions:["pfr"]},"application/font-woff":{source:"iana",compressible:!1},"application/framework-attributes+xml":{source:"iana",compressible:!0},"application/geo+json":{source:"iana",compressible:!0,extensions:["geojson"]},"application/geo+json-seq":{source:"iana"},"application/geopackage+sqlite3":{source:"iana"},"application/geoxacml+xml":{source:"iana",compressible:!0},"application/gltf-buffer":{source:"iana"},"application/gml+xml":{source:"iana",compressible:!0,extensions:["gml"]},"application/gpx+xml":{source:"apache",compressible:!0,extensions:["gpx"]},"application/gxf":{source:"apache",extensions:["gxf"]},"application/gzip":{source:"iana",compressible:!1,extensions:["gz"]},"application/h224":{source:"iana"},"application/held+xml":{source:"iana",compressible:!0},"application/hjson":{extensions:["hjson"]},"application/http":{source:"iana"},"application/hyperstudio":{source:"iana",extensions:["stk"]},"application/ibe-key-request+xml":{source:"iana",compressible:!0},"application/ibe-pkg-reply+xml":{source:"iana",compressible:!0},"application/ibe-pp-data":{source:"iana"},"application/iges":{source:"iana"},"application/im-iscomposing+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/index":{source:"iana"},"application/index.cmd":{source:"iana"},"application/index.obj":{source:"iana"},"application/index.response":{source:"iana"},"application/index.vnd":{source:"iana"},"application/inkml+xml":{source:"iana",compressible:!0,extensions:["ink","inkml"]},"application/iotp":{source:"iana"},"application/ipfix":{source:"iana",extensions:["ipfix"]},"application/ipp":{source:"iana"},"application/isup":{source:"iana"},"application/its+xml":{source:"iana",compressible:!0,extensions:["its"]},"application/java-archive":{source:"apache",compressible:!1,extensions:["jar","war","ear"]},"application/java-serialized-object":{source:"apache",compressible:!1,extensions:["ser"]},"application/java-vm":{source:"apache",compressible:!1,extensions:["class"]},"application/javascript":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["js","mjs"]},"application/jf2feed+json":{source:"iana",compressible:!0},"application/jose":{source:"iana"},"application/jose+json":{source:"iana",compressible:!0},"application/jrd+json":{source:"iana",compressible:!0},"application/jscalendar+json":{source:"iana",compressible:!0},"application/json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["json","map"]},"application/json-patch+json":{source:"iana",compressible:!0},"application/json-seq":{source:"iana"},"application/json5":{extensions:["json5"]},"application/jsonml+json":{source:"apache",compressible:!0,extensions:["jsonml"]},"application/jwk+json":{source:"iana",compressible:!0},"application/jwk-set+json":{source:"iana",compressible:!0},"application/jwt":{source:"iana"},"application/kpml-request+xml":{source:"iana",compressible:!0},"application/kpml-response+xml":{source:"iana",compressible:!0},"application/ld+json":{source:"iana",compressible:!0,extensions:["jsonld"]},"application/lgr+xml":{source:"iana",compressible:!0,extensions:["lgr"]},"application/link-format":{source:"iana"},"application/load-control+xml":{source:"iana",compressible:!0},"application/lost+xml":{source:"iana",compressible:!0,extensions:["lostxml"]},"application/lostsync+xml":{source:"iana",compressible:!0},"application/lpf+zip":{source:"iana",compressible:!1},"application/lxf":{source:"iana"},"application/mac-binhex40":{source:"iana",extensions:["hqx"]},"application/mac-compactpro":{source:"apache",extensions:["cpt"]},"application/macwriteii":{source:"iana"},"application/mads+xml":{source:"iana",compressible:!0,extensions:["mads"]},"application/manifest+json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["webmanifest"]},"application/marc":{source:"iana",extensions:["mrc"]},"application/marcxml+xml":{source:"iana",compressible:!0,extensions:["mrcx"]},"application/mathematica":{source:"iana",extensions:["ma","nb","mb"]},"application/mathml+xml":{source:"iana",compressible:!0,extensions:["mathml"]},"application/mathml-content+xml":{source:"iana",compressible:!0},"application/mathml-presentation+xml":{source:"iana",compressible:!0},"application/mbms-associated-procedure-description+xml":{source:"iana",compressible:!0},"application/mbms-deregister+xml":{source:"iana",compressible:!0},"application/mbms-envelope+xml":{source:"iana",compressible:!0},"application/mbms-msk+xml":{source:"iana",compressible:!0},"application/mbms-msk-response+xml":{source:"iana",compressible:!0},"application/mbms-protection-description+xml":{source:"iana",compressible:!0},"application/mbms-reception-report+xml":{source:"iana",compressible:!0},"application/mbms-register+xml":{source:"iana",compressible:!0},"application/mbms-register-response+xml":{source:"iana",compressible:!0},"application/mbms-schedule+xml":{source:"iana",compressible:!0},"application/mbms-user-service-description+xml":{source:"iana",compressible:!0},"application/mbox":{source:"iana",extensions:["mbox"]},"application/media-policy-dataset+xml":{source:"iana",compressible:!0,extensions:["mpf"]},"application/media_control+xml":{source:"iana",compressible:!0},"application/mediaservercontrol+xml":{source:"iana",compressible:!0,extensions:["mscml"]},"application/merge-patch+json":{source:"iana",compressible:!0},"application/metalink+xml":{source:"apache",compressible:!0,extensions:["metalink"]},"application/metalink4+xml":{source:"iana",compressible:!0,extensions:["meta4"]},"application/mets+xml":{source:"iana",compressible:!0,extensions:["mets"]},"application/mf4":{source:"iana"},"application/mikey":{source:"iana"},"application/mipc":{source:"iana"},"application/missing-blocks+cbor-seq":{source:"iana"},"application/mmt-aei+xml":{source:"iana",compressible:!0,extensions:["maei"]},"application/mmt-usd+xml":{source:"iana",compressible:!0,extensions:["musd"]},"application/mods+xml":{source:"iana",compressible:!0,extensions:["mods"]},"application/moss-keys":{source:"iana"},"application/moss-signature":{source:"iana"},"application/mosskey-data":{source:"iana"},"application/mosskey-request":{source:"iana"},"application/mp21":{source:"iana",extensions:["m21","mp21"]},"application/mp4":{source:"iana",extensions:["mp4s","m4p"]},"application/mpeg4-generic":{source:"iana"},"application/mpeg4-iod":{source:"iana"},"application/mpeg4-iod-xmt":{source:"iana"},"application/mrb-consumer+xml":{source:"iana",compressible:!0},"application/mrb-publish+xml":{source:"iana",compressible:!0},"application/msc-ivr+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msc-mixer+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msword":{source:"iana",compressible:!1,extensions:["doc","dot"]},"application/mud+json":{source:"iana",compressible:!0},"application/multipart-core":{source:"iana"},"application/mxf":{source:"iana",extensions:["mxf"]},"application/n-quads":{source:"iana",extensions:["nq"]},"application/n-triples":{source:"iana",extensions:["nt"]},"application/nasdata":{source:"iana"},"application/news-checkgroups":{source:"iana",charset:"US-ASCII"},"application/news-groupinfo":{source:"iana",charset:"US-ASCII"},"application/news-transmission":{source:"iana"},"application/nlsml+xml":{source:"iana",compressible:!0},"application/node":{source:"iana",extensions:["cjs"]},"application/nss":{source:"iana"},"application/oauth-authz-req+jwt":{source:"iana"},"application/oblivious-dns-message":{source:"iana"},"application/ocsp-request":{source:"iana"},"application/ocsp-response":{source:"iana"},"application/octet-stream":{source:"iana",compressible:!1,extensions:["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{source:"iana",extensions:["oda"]},"application/odm+xml":{source:"iana",compressible:!0},"application/odx":{source:"iana"},"application/oebps-package+xml":{source:"iana",compressible:!0,extensions:["opf"]},"application/ogg":{source:"iana",compressible:!1,extensions:["ogx"]},"application/omdoc+xml":{source:"apache",compressible:!0,extensions:["omdoc"]},"application/onenote":{source:"apache",extensions:["onetoc","onetoc2","onetmp","onepkg"]},"application/opc-nodeset+xml":{source:"iana",compressible:!0},"application/oscore":{source:"iana"},"application/oxps":{source:"iana",extensions:["oxps"]},"application/p21":{source:"iana"},"application/p21+zip":{source:"iana",compressible:!1},"application/p2p-overlay+xml":{source:"iana",compressible:!0,extensions:["relo"]},"application/parityfec":{source:"iana"},"application/passport":{source:"iana"},"application/patch-ops-error+xml":{source:"iana",compressible:!0,extensions:["xer"]},"application/pdf":{source:"iana",compressible:!1,extensions:["pdf"]},"application/pdx":{source:"iana"},"application/pem-certificate-chain":{source:"iana"},"application/pgp-encrypted":{source:"iana",compressible:!1,extensions:["pgp"]},"application/pgp-keys":{source:"iana",extensions:["asc"]},"application/pgp-signature":{source:"iana",extensions:["asc","sig"]},"application/pics-rules":{source:"apache",extensions:["prf"]},"application/pidf+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pidf-diff+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pkcs10":{source:"iana",extensions:["p10"]},"application/pkcs12":{source:"iana"},"application/pkcs7-mime":{source:"iana",extensions:["p7m","p7c"]},"application/pkcs7-signature":{source:"iana",extensions:["p7s"]},"application/pkcs8":{source:"iana",extensions:["p8"]},"application/pkcs8-encrypted":{source:"iana"},"application/pkix-attr-cert":{source:"iana",extensions:["ac"]},"application/pkix-cert":{source:"iana",extensions:["cer"]},"application/pkix-crl":{source:"iana",extensions:["crl"]},"application/pkix-pkipath":{source:"iana",extensions:["pkipath"]},"application/pkixcmp":{source:"iana",extensions:["pki"]},"application/pls+xml":{source:"iana",compressible:!0,extensions:["pls"]},"application/poc-settings+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/postscript":{source:"iana",compressible:!0,extensions:["ai","eps","ps"]},"application/ppsp-tracker+json":{source:"iana",compressible:!0},"application/problem+json":{source:"iana",compressible:!0},"application/problem+xml":{source:"iana",compressible:!0},"application/provenance+xml":{source:"iana",compressible:!0,extensions:["provx"]},"application/prs.alvestrand.titrax-sheet":{source:"iana"},"application/prs.cww":{source:"iana",extensions:["cww"]},"application/prs.cyn":{source:"iana",charset:"7-BIT"},"application/prs.hpub+zip":{source:"iana",compressible:!1},"application/prs.nprend":{source:"iana"},"application/prs.plucker":{source:"iana"},"application/prs.rdf-xml-crypt":{source:"iana"},"application/prs.xsf+xml":{source:"iana",compressible:!0},"application/pskc+xml":{source:"iana",compressible:!0,extensions:["pskcxml"]},"application/pvd+json":{source:"iana",compressible:!0},"application/qsig":{source:"iana"},"application/raml+yaml":{compressible:!0,extensions:["raml"]},"application/raptorfec":{source:"iana"},"application/rdap+json":{source:"iana",compressible:!0},"application/rdf+xml":{source:"iana",compressible:!0,extensions:["rdf","owl"]},"application/reginfo+xml":{source:"iana",compressible:!0,extensions:["rif"]},"application/relax-ng-compact-syntax":{source:"iana",extensions:["rnc"]},"application/remote-printing":{source:"iana"},"application/reputon+json":{source:"iana",compressible:!0},"application/resource-lists+xml":{source:"iana",compressible:!0,extensions:["rl"]},"application/resource-lists-diff+xml":{source:"iana",compressible:!0,extensions:["rld"]},"application/rfc+xml":{source:"iana",compressible:!0},"application/riscos":{source:"iana"},"application/rlmi+xml":{source:"iana",compressible:!0},"application/rls-services+xml":{source:"iana",compressible:!0,extensions:["rs"]},"application/route-apd+xml":{source:"iana",compressible:!0,extensions:["rapd"]},"application/route-s-tsid+xml":{source:"iana",compressible:!0,extensions:["sls"]},"application/route-usd+xml":{source:"iana",compressible:!0,extensions:["rusd"]},"application/rpki-ghostbusters":{source:"iana",extensions:["gbr"]},"application/rpki-manifest":{source:"iana",extensions:["mft"]},"application/rpki-publication":{source:"iana"},"application/rpki-roa":{source:"iana",extensions:["roa"]},"application/rpki-updown":{source:"iana"},"application/rsd+xml":{source:"apache",compressible:!0,extensions:["rsd"]},"application/rss+xml":{source:"apache",compressible:!0,extensions:["rss"]},"application/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"application/rtploopback":{source:"iana"},"application/rtx":{source:"iana"},"application/samlassertion+xml":{source:"iana",compressible:!0},"application/samlmetadata+xml":{source:"iana",compressible:!0},"application/sarif+json":{source:"iana",compressible:!0},"application/sarif-external-properties+json":{source:"iana",compressible:!0},"application/sbe":{source:"iana"},"application/sbml+xml":{source:"iana",compressible:!0,extensions:["sbml"]},"application/scaip+xml":{source:"iana",compressible:!0},"application/scim+json":{source:"iana",compressible:!0},"application/scvp-cv-request":{source:"iana",extensions:["scq"]},"application/scvp-cv-response":{source:"iana",extensions:["scs"]},"application/scvp-vp-request":{source:"iana",extensions:["spq"]},"application/scvp-vp-response":{source:"iana",extensions:["spp"]},"application/sdp":{source:"iana",extensions:["sdp"]},"application/secevent+jwt":{source:"iana"},"application/senml+cbor":{source:"iana"},"application/senml+json":{source:"iana",compressible:!0},"application/senml+xml":{source:"iana",compressible:!0,extensions:["senmlx"]},"application/senml-etch+cbor":{source:"iana"},"application/senml-etch+json":{source:"iana",compressible:!0},"application/senml-exi":{source:"iana"},"application/sensml+cbor":{source:"iana"},"application/sensml+json":{source:"iana",compressible:!0},"application/sensml+xml":{source:"iana",compressible:!0,extensions:["sensmlx"]},"application/sensml-exi":{source:"iana"},"application/sep+xml":{source:"iana",compressible:!0},"application/sep-exi":{source:"iana"},"application/session-info":{source:"iana"},"application/set-payment":{source:"iana"},"application/set-payment-initiation":{source:"iana",extensions:["setpay"]},"application/set-registration":{source:"iana"},"application/set-registration-initiation":{source:"iana",extensions:["setreg"]},"application/sgml":{source:"iana"},"application/sgml-open-catalog":{source:"iana"},"application/shf+xml":{source:"iana",compressible:!0,extensions:["shf"]},"application/sieve":{source:"iana",extensions:["siv","sieve"]},"application/simple-filter+xml":{source:"iana",compressible:!0},"application/simple-message-summary":{source:"iana"},"application/simplesymbolcontainer":{source:"iana"},"application/sipc":{source:"iana"},"application/slate":{source:"iana"},"application/smil":{source:"iana"},"application/smil+xml":{source:"iana",compressible:!0,extensions:["smi","smil"]},"application/smpte336m":{source:"iana"},"application/soap+fastinfoset":{source:"iana"},"application/soap+xml":{source:"iana",compressible:!0},"application/sparql-query":{source:"iana",extensions:["rq"]},"application/sparql-results+xml":{source:"iana",compressible:!0,extensions:["srx"]},"application/spdx+json":{source:"iana",compressible:!0},"application/spirits-event+xml":{source:"iana",compressible:!0},"application/sql":{source:"iana"},"application/srgs":{source:"iana",extensions:["gram"]},"application/srgs+xml":{source:"iana",compressible:!0,extensions:["grxml"]},"application/sru+xml":{source:"iana",compressible:!0,extensions:["sru"]},"application/ssdl+xml":{source:"apache",compressible:!0,extensions:["ssdl"]},"application/ssml+xml":{source:"iana",compressible:!0,extensions:["ssml"]},"application/stix+json":{source:"iana",compressible:!0},"application/swid+xml":{source:"iana",compressible:!0,extensions:["swidtag"]},"application/tamp-apex-update":{source:"iana"},"application/tamp-apex-update-confirm":{source:"iana"},"application/tamp-community-update":{source:"iana"},"application/tamp-community-update-confirm":{source:"iana"},"application/tamp-error":{source:"iana"},"application/tamp-sequence-adjust":{source:"iana"},"application/tamp-sequence-adjust-confirm":{source:"iana"},"application/tamp-status-query":{source:"iana"},"application/tamp-status-response":{source:"iana"},"application/tamp-update":{source:"iana"},"application/tamp-update-confirm":{source:"iana"},"application/tar":{compressible:!0},"application/taxii+json":{source:"iana",compressible:!0},"application/td+json":{source:"iana",compressible:!0},"application/tei+xml":{source:"iana",compressible:!0,extensions:["tei","teicorpus"]},"application/tetra_isi":{source:"iana"},"application/thraud+xml":{source:"iana",compressible:!0,extensions:["tfi"]},"application/timestamp-query":{source:"iana"},"application/timestamp-reply":{source:"iana"},"application/timestamped-data":{source:"iana",extensions:["tsd"]},"application/tlsrpt+gzip":{source:"iana"},"application/tlsrpt+json":{source:"iana",compressible:!0},"application/tnauthlist":{source:"iana"},"application/token-introspection+jwt":{source:"iana"},"application/toml":{compressible:!0,extensions:["toml"]},"application/trickle-ice-sdpfrag":{source:"iana"},"application/trig":{source:"iana",extensions:["trig"]},"application/ttml+xml":{source:"iana",compressible:!0,extensions:["ttml"]},"application/tve-trigger":{source:"iana"},"application/tzif":{source:"iana"},"application/tzif-leap":{source:"iana"},"application/ubjson":{compressible:!1,extensions:["ubj"]},"application/ulpfec":{source:"iana"},"application/urc-grpsheet+xml":{source:"iana",compressible:!0},"application/urc-ressheet+xml":{source:"iana",compressible:!0,extensions:["rsheet"]},"application/urc-targetdesc+xml":{source:"iana",compressible:!0,extensions:["td"]},"application/urc-uisocketdesc+xml":{source:"iana",compressible:!0},"application/vcard+json":{source:"iana",compressible:!0},"application/vcard+xml":{source:"iana",compressible:!0},"application/vemmi":{source:"iana"},"application/vividence.scriptfile":{source:"apache"},"application/vnd.1000minds.decision-model+xml":{source:"iana",compressible:!0,extensions:["1km"]},"application/vnd.3gpp-prose+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-prose-pc3ch+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-v2x-local-service-information":{source:"iana"},"application/vnd.3gpp.5gnas":{source:"iana"},"application/vnd.3gpp.access-transfer-events+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.bsf+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gmop+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gtpc":{source:"iana"},"application/vnd.3gpp.interworking-data":{source:"iana"},"application/vnd.3gpp.lpp":{source:"iana"},"application/vnd.3gpp.mc-signalling-ear":{source:"iana"},"application/vnd.3gpp.mcdata-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-payload":{source:"iana"},"application/vnd.3gpp.mcdata-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-signalling":{source:"iana"},"application/vnd.3gpp.mcdata-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-floor-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-signed+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-init-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-transmission-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mid-call+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ngap":{source:"iana"},"application/vnd.3gpp.pfcp":{source:"iana"},"application/vnd.3gpp.pic-bw-large":{source:"iana",extensions:["plb"]},"application/vnd.3gpp.pic-bw-small":{source:"iana",extensions:["psb"]},"application/vnd.3gpp.pic-bw-var":{source:"iana",extensions:["pvb"]},"application/vnd.3gpp.s1ap":{source:"iana"},"application/vnd.3gpp.sms":{source:"iana"},"application/vnd.3gpp.sms+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-ext+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.state-and-event-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ussd+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.bcmcsinfo+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.sms":{source:"iana"},"application/vnd.3gpp2.tcap":{source:"iana",extensions:["tcap"]},"application/vnd.3lightssoftware.imagescal":{source:"iana"},"application/vnd.3m.post-it-notes":{source:"iana",extensions:["pwn"]},"application/vnd.accpac.simply.aso":{source:"iana",extensions:["aso"]},"application/vnd.accpac.simply.imp":{source:"iana",extensions:["imp"]},"application/vnd.acucobol":{source:"iana",extensions:["acu"]},"application/vnd.acucorp":{source:"iana",extensions:["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{source:"apache",compressible:!1,extensions:["air"]},"application/vnd.adobe.flash.movie":{source:"iana"},"application/vnd.adobe.formscentral.fcdt":{source:"iana",extensions:["fcdt"]},"application/vnd.adobe.fxp":{source:"iana",extensions:["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{source:"iana"},"application/vnd.adobe.xdp+xml":{source:"iana",compressible:!0,extensions:["xdp"]},"application/vnd.adobe.xfdf":{source:"iana",extensions:["xfdf"]},"application/vnd.aether.imp":{source:"iana"},"application/vnd.afpc.afplinedata":{source:"iana"},"application/vnd.afpc.afplinedata-pagedef":{source:"iana"},"application/vnd.afpc.cmoca-cmresource":{source:"iana"},"application/vnd.afpc.foca-charset":{source:"iana"},"application/vnd.afpc.foca-codedfont":{source:"iana"},"application/vnd.afpc.foca-codepage":{source:"iana"},"application/vnd.afpc.modca":{source:"iana"},"application/vnd.afpc.modca-cmtable":{source:"iana"},"application/vnd.afpc.modca-formdef":{source:"iana"},"application/vnd.afpc.modca-mediummap":{source:"iana"},"application/vnd.afpc.modca-objectcontainer":{source:"iana"},"application/vnd.afpc.modca-overlay":{source:"iana"},"application/vnd.afpc.modca-pagesegment":{source:"iana"},"application/vnd.age":{source:"iana",extensions:["age"]},"application/vnd.ah-barcode":{source:"iana"},"application/vnd.ahead.space":{source:"iana",extensions:["ahead"]},"application/vnd.airzip.filesecure.azf":{source:"iana",extensions:["azf"]},"application/vnd.airzip.filesecure.azs":{source:"iana",extensions:["azs"]},"application/vnd.amadeus+json":{source:"iana",compressible:!0},"application/vnd.amazon.ebook":{source:"apache",extensions:["azw"]},"application/vnd.amazon.mobi8-ebook":{source:"iana"},"application/vnd.americandynamics.acc":{source:"iana",extensions:["acc"]},"application/vnd.amiga.ami":{source:"iana",extensions:["ami"]},"application/vnd.amundsen.maze+xml":{source:"iana",compressible:!0},"application/vnd.android.ota":{source:"iana"},"application/vnd.android.package-archive":{source:"apache",compressible:!1,extensions:["apk"]},"application/vnd.anki":{source:"iana"},"application/vnd.anser-web-certificate-issue-initiation":{source:"iana",extensions:["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{source:"apache",extensions:["fti"]},"application/vnd.antix.game-component":{source:"iana",extensions:["atx"]},"application/vnd.apache.arrow.file":{source:"iana"},"application/vnd.apache.arrow.stream":{source:"iana"},"application/vnd.apache.thrift.binary":{source:"iana"},"application/vnd.apache.thrift.compact":{source:"iana"},"application/vnd.apache.thrift.json":{source:"iana"},"application/vnd.api+json":{source:"iana",compressible:!0},"application/vnd.aplextor.warrp+json":{source:"iana",compressible:!0},"application/vnd.apothekende.reservation+json":{source:"iana",compressible:!0},"application/vnd.apple.installer+xml":{source:"iana",compressible:!0,extensions:["mpkg"]},"application/vnd.apple.keynote":{source:"iana",extensions:["key"]},"application/vnd.apple.mpegurl":{source:"iana",extensions:["m3u8"]},"application/vnd.apple.numbers":{source:"iana",extensions:["numbers"]},"application/vnd.apple.pages":{source:"iana",extensions:["pages"]},"application/vnd.apple.pkpass":{compressible:!1,extensions:["pkpass"]},"application/vnd.arastra.swi":{source:"iana"},"application/vnd.aristanetworks.swi":{source:"iana",extensions:["swi"]},"application/vnd.artisan+json":{source:"iana",compressible:!0},"application/vnd.artsquare":{source:"iana"},"application/vnd.astraea-software.iota":{source:"iana",extensions:["iota"]},"application/vnd.audiograph":{source:"iana",extensions:["aep"]},"application/vnd.autopackage":{source:"iana"},"application/vnd.avalon+json":{source:"iana",compressible:!0},"application/vnd.avistar+xml":{source:"iana",compressible:!0},"application/vnd.balsamiq.bmml+xml":{source:"iana",compressible:!0,extensions:["bmml"]},"application/vnd.balsamiq.bmpr":{source:"iana"},"application/vnd.banana-accounting":{source:"iana"},"application/vnd.bbf.usp.error":{source:"iana"},"application/vnd.bbf.usp.msg":{source:"iana"},"application/vnd.bbf.usp.msg+json":{source:"iana",compressible:!0},"application/vnd.bekitzur-stech+json":{source:"iana",compressible:!0},"application/vnd.bint.med-content":{source:"iana"},"application/vnd.biopax.rdf+xml":{source:"iana",compressible:!0},"application/vnd.blink-idb-value-wrapper":{source:"iana"},"application/vnd.blueice.multipass":{source:"iana",extensions:["mpm"]},"application/vnd.bluetooth.ep.oob":{source:"iana"},"application/vnd.bluetooth.le.oob":{source:"iana"},"application/vnd.bmi":{source:"iana",extensions:["bmi"]},"application/vnd.bpf":{source:"iana"},"application/vnd.bpf3":{source:"iana"},"application/vnd.businessobjects":{source:"iana",extensions:["rep"]},"application/vnd.byu.uapi+json":{source:"iana",compressible:!0},"application/vnd.cab-jscript":{source:"iana"},"application/vnd.canon-cpdl":{source:"iana"},"application/vnd.canon-lips":{source:"iana"},"application/vnd.capasystems-pg+json":{source:"iana",compressible:!0},"application/vnd.cendio.thinlinc.clientconf":{source:"iana"},"application/vnd.century-systems.tcp_stream":{source:"iana"},"application/vnd.chemdraw+xml":{source:"iana",compressible:!0,extensions:["cdxml"]},"application/vnd.chess-pgn":{source:"iana"},"application/vnd.chipnuts.karaoke-mmd":{source:"iana",extensions:["mmd"]},"application/vnd.ciedi":{source:"iana"},"application/vnd.cinderella":{source:"iana",extensions:["cdy"]},"application/vnd.cirpack.isdn-ext":{source:"iana"},"application/vnd.citationstyles.style+xml":{source:"iana",compressible:!0,extensions:["csl"]},"application/vnd.claymore":{source:"iana",extensions:["cla"]},"application/vnd.cloanto.rp9":{source:"iana",extensions:["rp9"]},"application/vnd.clonk.c4group":{source:"iana",extensions:["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{source:"iana",extensions:["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{source:"iana",extensions:["c11amz"]},"application/vnd.coffeescript":{source:"iana"},"application/vnd.collabio.xodocuments.document":{source:"iana"},"application/vnd.collabio.xodocuments.document-template":{source:"iana"},"application/vnd.collabio.xodocuments.presentation":{source:"iana"},"application/vnd.collabio.xodocuments.presentation-template":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet-template":{source:"iana"},"application/vnd.collection+json":{source:"iana",compressible:!0},"application/vnd.collection.doc+json":{source:"iana",compressible:!0},"application/vnd.collection.next+json":{source:"iana",compressible:!0},"application/vnd.comicbook+zip":{source:"iana",compressible:!1},"application/vnd.comicbook-rar":{source:"iana"},"application/vnd.commerce-battelle":{source:"iana"},"application/vnd.commonspace":{source:"iana",extensions:["csp"]},"application/vnd.contact.cmsg":{source:"iana",extensions:["cdbcmsg"]},"application/vnd.coreos.ignition+json":{source:"iana",compressible:!0},"application/vnd.cosmocaller":{source:"iana",extensions:["cmc"]},"application/vnd.crick.clicker":{source:"iana",extensions:["clkx"]},"application/vnd.crick.clicker.keyboard":{source:"iana",extensions:["clkk"]},"application/vnd.crick.clicker.palette":{source:"iana",extensions:["clkp"]},"application/vnd.crick.clicker.template":{source:"iana",extensions:["clkt"]},"application/vnd.crick.clicker.wordbank":{source:"iana",extensions:["clkw"]},"application/vnd.criticaltools.wbs+xml":{source:"iana",compressible:!0,extensions:["wbs"]},"application/vnd.cryptii.pipe+json":{source:"iana",compressible:!0},"application/vnd.crypto-shade-file":{source:"iana"},"application/vnd.cryptomator.encrypted":{source:"iana"},"application/vnd.cryptomator.vault":{source:"iana"},"application/vnd.ctc-posml":{source:"iana",extensions:["pml"]},"application/vnd.ctct.ws+xml":{source:"iana",compressible:!0},"application/vnd.cups-pdf":{source:"iana"},"application/vnd.cups-postscript":{source:"iana"},"application/vnd.cups-ppd":{source:"iana",extensions:["ppd"]},"application/vnd.cups-raster":{source:"iana"},"application/vnd.cups-raw":{source:"iana"},"application/vnd.curl":{source:"iana"},"application/vnd.curl.car":{source:"apache",extensions:["car"]},"application/vnd.curl.pcurl":{source:"apache",extensions:["pcurl"]},"application/vnd.cyan.dean.root+xml":{source:"iana",compressible:!0},"application/vnd.cybank":{source:"iana"},"application/vnd.cyclonedx+json":{source:"iana",compressible:!0},"application/vnd.cyclonedx+xml":{source:"iana",compressible:!0},"application/vnd.d2l.coursepackage1p0+zip":{source:"iana",compressible:!1},"application/vnd.d3m-dataset":{source:"iana"},"application/vnd.d3m-problem":{source:"iana"},"application/vnd.dart":{source:"iana",compressible:!0,extensions:["dart"]},"application/vnd.data-vision.rdz":{source:"iana",extensions:["rdz"]},"application/vnd.datapackage+json":{source:"iana",compressible:!0},"application/vnd.dataresource+json":{source:"iana",compressible:!0},"application/vnd.dbf":{source:"iana",extensions:["dbf"]},"application/vnd.debian.binary-package":{source:"iana"},"application/vnd.dece.data":{source:"iana",extensions:["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{source:"iana",compressible:!0,extensions:["uvt","uvvt"]},"application/vnd.dece.unspecified":{source:"iana",extensions:["uvx","uvvx"]},"application/vnd.dece.zip":{source:"iana",extensions:["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{source:"iana",extensions:["fe_launch"]},"application/vnd.desmume.movie":{source:"iana"},"application/vnd.dir-bi.plate-dl-nosuffix":{source:"iana"},"application/vnd.dm.delegation+xml":{source:"iana",compressible:!0},"application/vnd.dna":{source:"iana",extensions:["dna"]},"application/vnd.document+json":{source:"iana",compressible:!0},"application/vnd.dolby.mlp":{source:"apache",extensions:["mlp"]},"application/vnd.dolby.mobile.1":{source:"iana"},"application/vnd.dolby.mobile.2":{source:"iana"},"application/vnd.doremir.scorecloud-binary-document":{source:"iana"},"application/vnd.dpgraph":{source:"iana",extensions:["dpg"]},"application/vnd.dreamfactory":{source:"iana",extensions:["dfac"]},"application/vnd.drive+json":{source:"iana",compressible:!0},"application/vnd.ds-keypoint":{source:"apache",extensions:["kpxx"]},"application/vnd.dtg.local":{source:"iana"},"application/vnd.dtg.local.flash":{source:"iana"},"application/vnd.dtg.local.html":{source:"iana"},"application/vnd.dvb.ait":{source:"iana",extensions:["ait"]},"application/vnd.dvb.dvbisl+xml":{source:"iana",compressible:!0},"application/vnd.dvb.dvbj":{source:"iana"},"application/vnd.dvb.esgcontainer":{source:"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess2":{source:"iana"},"application/vnd.dvb.ipdcesgpdd":{source:"iana"},"application/vnd.dvb.ipdcroaming":{source:"iana"},"application/vnd.dvb.iptv.alfec-base":{source:"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{source:"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-container+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-generic+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-msglist+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-request+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-response+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-init+xml":{source:"iana",compressible:!0},"application/vnd.dvb.pfr":{source:"iana"},"application/vnd.dvb.service":{source:"iana",extensions:["svc"]},"application/vnd.dxr":{source:"iana"},"application/vnd.dynageo":{source:"iana",extensions:["geo"]},"application/vnd.dzr":{source:"iana"},"application/vnd.easykaraoke.cdgdownload":{source:"iana"},"application/vnd.ecdis-update":{source:"iana"},"application/vnd.ecip.rlp":{source:"iana"},"application/vnd.eclipse.ditto+json":{source:"iana",compressible:!0},"application/vnd.ecowin.chart":{source:"iana",extensions:["mag"]},"application/vnd.ecowin.filerequest":{source:"iana"},"application/vnd.ecowin.fileupdate":{source:"iana"},"application/vnd.ecowin.series":{source:"iana"},"application/vnd.ecowin.seriesrequest":{source:"iana"},"application/vnd.ecowin.seriesupdate":{source:"iana"},"application/vnd.efi.img":{source:"iana"},"application/vnd.efi.iso":{source:"iana"},"application/vnd.emclient.accessrequest+xml":{source:"iana",compressible:!0},"application/vnd.enliven":{source:"iana",extensions:["nml"]},"application/vnd.enphase.envoy":{source:"iana"},"application/vnd.eprints.data+xml":{source:"iana",compressible:!0},"application/vnd.epson.esf":{source:"iana",extensions:["esf"]},"application/vnd.epson.msf":{source:"iana",extensions:["msf"]},"application/vnd.epson.quickanime":{source:"iana",extensions:["qam"]},"application/vnd.epson.salt":{source:"iana",extensions:["slt"]},"application/vnd.epson.ssf":{source:"iana",extensions:["ssf"]},"application/vnd.ericsson.quickcall":{source:"iana"},"application/vnd.espass-espass+zip":{source:"iana",compressible:!1},"application/vnd.eszigno3+xml":{source:"iana",compressible:!0,extensions:["es3","et3"]},"application/vnd.etsi.aoc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.asic-e+zip":{source:"iana",compressible:!1},"application/vnd.etsi.asic-s+zip":{source:"iana",compressible:!1},"application/vnd.etsi.cug+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvcommand+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-bc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-cod+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-npvr+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvservice+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsync+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvueprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mcid+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mheg5":{source:"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{source:"iana",compressible:!0},"application/vnd.etsi.pstn+xml":{source:"iana",compressible:!0},"application/vnd.etsi.sci+xml":{source:"iana",compressible:!0},"application/vnd.etsi.simservs+xml":{source:"iana",compressible:!0},"application/vnd.etsi.timestamp-token":{source:"iana"},"application/vnd.etsi.tsl+xml":{source:"iana",compressible:!0},"application/vnd.etsi.tsl.der":{source:"iana"},"application/vnd.eu.kasparian.car+json":{source:"iana",compressible:!0},"application/vnd.eudora.data":{source:"iana"},"application/vnd.evolv.ecig.profile":{source:"iana"},"application/vnd.evolv.ecig.settings":{source:"iana"},"application/vnd.evolv.ecig.theme":{source:"iana"},"application/vnd.exstream-empower+zip":{source:"iana",compressible:!1},"application/vnd.exstream-package":{source:"iana"},"application/vnd.ezpix-album":{source:"iana",extensions:["ez2"]},"application/vnd.ezpix-package":{source:"iana",extensions:["ez3"]},"application/vnd.f-secure.mobile":{source:"iana"},"application/vnd.familysearch.gedcom+zip":{source:"iana",compressible:!1},"application/vnd.fastcopy-disk-image":{source:"iana"},"application/vnd.fdf":{source:"iana",extensions:["fdf"]},"application/vnd.fdsn.mseed":{source:"iana",extensions:["mseed"]},"application/vnd.fdsn.seed":{source:"iana",extensions:["seed","dataless"]},"application/vnd.ffsns":{source:"iana"},"application/vnd.ficlab.flb+zip":{source:"iana",compressible:!1},"application/vnd.filmit.zfc":{source:"iana"},"application/vnd.fints":{source:"iana"},"application/vnd.firemonkeys.cloudcell":{source:"iana"},"application/vnd.flographit":{source:"iana",extensions:["gph"]},"application/vnd.fluxtime.clip":{source:"iana",extensions:["ftc"]},"application/vnd.font-fontforge-sfd":{source:"iana"},"application/vnd.framemaker":{source:"iana",extensions:["fm","frame","maker","book"]},"application/vnd.frogans.fnc":{source:"iana",extensions:["fnc"]},"application/vnd.frogans.ltf":{source:"iana",extensions:["ltf"]},"application/vnd.fsc.weblaunch":{source:"iana",extensions:["fsc"]},"application/vnd.fujifilm.fb.docuworks":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.binder":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.container":{source:"iana"},"application/vnd.fujifilm.fb.jfi+xml":{source:"iana",compressible:!0},"application/vnd.fujitsu.oasys":{source:"iana",extensions:["oas"]},"application/vnd.fujitsu.oasys2":{source:"iana",extensions:["oa2"]},"application/vnd.fujitsu.oasys3":{source:"iana",extensions:["oa3"]},"application/vnd.fujitsu.oasysgp":{source:"iana",extensions:["fg5"]},"application/vnd.fujitsu.oasysprs":{source:"iana",extensions:["bh2"]},"application/vnd.fujixerox.art-ex":{source:"iana"},"application/vnd.fujixerox.art4":{source:"iana"},"application/vnd.fujixerox.ddd":{source:"iana",extensions:["ddd"]},"application/vnd.fujixerox.docuworks":{source:"iana",extensions:["xdw"]},"application/vnd.fujixerox.docuworks.binder":{source:"iana",extensions:["xbd"]},"application/vnd.fujixerox.docuworks.container":{source:"iana"},"application/vnd.fujixerox.hbpl":{source:"iana"},"application/vnd.fut-misnet":{source:"iana"},"application/vnd.futoin+cbor":{source:"iana"},"application/vnd.futoin+json":{source:"iana",compressible:!0},"application/vnd.fuzzysheet":{source:"iana",extensions:["fzs"]},"application/vnd.genomatix.tuxedo":{source:"iana",extensions:["txd"]},"application/vnd.gentics.grd+json":{source:"iana",compressible:!0},"application/vnd.geo+json":{source:"iana",compressible:!0},"application/vnd.geocube+xml":{source:"iana",compressible:!0},"application/vnd.geogebra.file":{source:"iana",extensions:["ggb"]},"application/vnd.geogebra.slides":{source:"iana"},"application/vnd.geogebra.tool":{source:"iana",extensions:["ggt"]},"application/vnd.geometry-explorer":{source:"iana",extensions:["gex","gre"]},"application/vnd.geonext":{source:"iana",extensions:["gxt"]},"application/vnd.geoplan":{source:"iana",extensions:["g2w"]},"application/vnd.geospace":{source:"iana",extensions:["g3w"]},"application/vnd.gerber":{source:"iana"},"application/vnd.globalplatform.card-content-mgt":{source:"iana"},"application/vnd.globalplatform.card-content-mgt-response":{source:"iana"},"application/vnd.gmx":{source:"iana",extensions:["gmx"]},"application/vnd.google-apps.document":{compressible:!1,extensions:["gdoc"]},"application/vnd.google-apps.presentation":{compressible:!1,extensions:["gslides"]},"application/vnd.google-apps.spreadsheet":{compressible:!1,extensions:["gsheet"]},"application/vnd.google-earth.kml+xml":{source:"iana",compressible:!0,extensions:["kml"]},"application/vnd.google-earth.kmz":{source:"iana",compressible:!1,extensions:["kmz"]},"application/vnd.gov.sk.e-form+xml":{source:"iana",compressible:!0},"application/vnd.gov.sk.e-form+zip":{source:"iana",compressible:!1},"application/vnd.gov.sk.xmldatacontainer+xml":{source:"iana",compressible:!0},"application/vnd.grafeq":{source:"iana",extensions:["gqf","gqs"]},"application/vnd.gridmp":{source:"iana"},"application/vnd.groove-account":{source:"iana",extensions:["gac"]},"application/vnd.groove-help":{source:"iana",extensions:["ghf"]},"application/vnd.groove-identity-message":{source:"iana",extensions:["gim"]},"application/vnd.groove-injector":{source:"iana",extensions:["grv"]},"application/vnd.groove-tool-message":{source:"iana",extensions:["gtm"]},"application/vnd.groove-tool-template":{source:"iana",extensions:["tpl"]},"application/vnd.groove-vcard":{source:"iana",extensions:["vcg"]},"application/vnd.hal+json":{source:"iana",compressible:!0},"application/vnd.hal+xml":{source:"iana",compressible:!0,extensions:["hal"]},"application/vnd.handheld-entertainment+xml":{source:"iana",compressible:!0,extensions:["zmm"]},"application/vnd.hbci":{source:"iana",extensions:["hbci"]},"application/vnd.hc+json":{source:"iana",compressible:!0},"application/vnd.hcl-bireports":{source:"iana"},"application/vnd.hdt":{source:"iana"},"application/vnd.heroku+json":{source:"iana",compressible:!0},"application/vnd.hhe.lesson-player":{source:"iana",extensions:["les"]},"application/vnd.hl7cda+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hl7v2+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hp-hpgl":{source:"iana",extensions:["hpgl"]},"application/vnd.hp-hpid":{source:"iana",extensions:["hpid"]},"application/vnd.hp-hps":{source:"iana",extensions:["hps"]},"application/vnd.hp-jlyt":{source:"iana",extensions:["jlt"]},"application/vnd.hp-pcl":{source:"iana",extensions:["pcl"]},"application/vnd.hp-pclxl":{source:"iana",extensions:["pclxl"]},"application/vnd.httphone":{source:"iana"},"application/vnd.hydrostatix.sof-data":{source:"iana",extensions:["sfd-hdstx"]},"application/vnd.hyper+json":{source:"iana",compressible:!0},"application/vnd.hyper-item+json":{source:"iana",compressible:!0},"application/vnd.hyperdrive+json":{source:"iana",compressible:!0},"application/vnd.hzn-3d-crossword":{source:"iana"},"application/vnd.ibm.afplinedata":{source:"iana"},"application/vnd.ibm.electronic-media":{source:"iana"},"application/vnd.ibm.minipay":{source:"iana",extensions:["mpy"]},"application/vnd.ibm.modcap":{source:"iana",extensions:["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{source:"iana",extensions:["irm"]},"application/vnd.ibm.secure-container":{source:"iana",extensions:["sc"]},"application/vnd.iccprofile":{source:"iana",extensions:["icc","icm"]},"application/vnd.ieee.1905":{source:"iana"},"application/vnd.igloader":{source:"iana",extensions:["igl"]},"application/vnd.imagemeter.folder+zip":{source:"iana",compressible:!1},"application/vnd.imagemeter.image+zip":{source:"iana",compressible:!1},"application/vnd.immervision-ivp":{source:"iana",extensions:["ivp"]},"application/vnd.immervision-ivu":{source:"iana",extensions:["ivu"]},"application/vnd.ims.imsccv1p1":{source:"iana"},"application/vnd.ims.imsccv1p2":{source:"iana"},"application/vnd.ims.imsccv1p3":{source:"iana"},"application/vnd.ims.lis.v2.result+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy.id+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings.simple+json":{source:"iana",compressible:!0},"application/vnd.informedcontrol.rms+xml":{source:"iana",compressible:!0},"application/vnd.informix-visionary":{source:"iana"},"application/vnd.infotech.project":{source:"iana"},"application/vnd.infotech.project+xml":{source:"iana",compressible:!0},"application/vnd.innopath.wamp.notification":{source:"iana"},"application/vnd.insors.igm":{source:"iana",extensions:["igm"]},"application/vnd.intercon.formnet":{source:"iana",extensions:["xpw","xpx"]},"application/vnd.intergeo":{source:"iana",extensions:["i2g"]},"application/vnd.intertrust.digibox":{source:"iana"},"application/vnd.intertrust.nncp":{source:"iana"},"application/vnd.intu.qbo":{source:"iana",extensions:["qbo"]},"application/vnd.intu.qfx":{source:"iana",extensions:["qfx"]},"application/vnd.iptc.g2.catalogitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.conceptitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.knowledgeitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsmessage+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.packageitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.planningitem+xml":{source:"iana",compressible:!0},"application/vnd.ipunplugged.rcprofile":{source:"iana",extensions:["rcprofile"]},"application/vnd.irepository.package+xml":{source:"iana",compressible:!0,extensions:["irp"]},"application/vnd.is-xpr":{source:"iana",extensions:["xpr"]},"application/vnd.isac.fcs":{source:"iana",extensions:["fcs"]},"application/vnd.iso11783-10+zip":{source:"iana",compressible:!1},"application/vnd.jam":{source:"iana",extensions:["jam"]},"application/vnd.japannet-directory-service":{source:"iana"},"application/vnd.japannet-jpnstore-wakeup":{source:"iana"},"application/vnd.japannet-payment-wakeup":{source:"iana"},"application/vnd.japannet-registration":{source:"iana"},"application/vnd.japannet-registration-wakeup":{source:"iana"},"application/vnd.japannet-setstore-wakeup":{source:"iana"},"application/vnd.japannet-verification":{source:"iana"},"application/vnd.japannet-verification-wakeup":{source:"iana"},"application/vnd.jcp.javame.midlet-rms":{source:"iana",extensions:["rms"]},"application/vnd.jisp":{source:"iana",extensions:["jisp"]},"application/vnd.joost.joda-archive":{source:"iana",extensions:["joda"]},"application/vnd.jsk.isdn-ngn":{source:"iana"},"application/vnd.kahootz":{source:"iana",extensions:["ktz","ktr"]},"application/vnd.kde.karbon":{source:"iana",extensions:["karbon"]},"application/vnd.kde.kchart":{source:"iana",extensions:["chrt"]},"application/vnd.kde.kformula":{source:"iana",extensions:["kfo"]},"application/vnd.kde.kivio":{source:"iana",extensions:["flw"]},"application/vnd.kde.kontour":{source:"iana",extensions:["kon"]},"application/vnd.kde.kpresenter":{source:"iana",extensions:["kpr","kpt"]},"application/vnd.kde.kspread":{source:"iana",extensions:["ksp"]},"application/vnd.kde.kword":{source:"iana",extensions:["kwd","kwt"]},"application/vnd.kenameaapp":{source:"iana",extensions:["htke"]},"application/vnd.kidspiration":{source:"iana",extensions:["kia"]},"application/vnd.kinar":{source:"iana",extensions:["kne","knp"]},"application/vnd.koan":{source:"iana",extensions:["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{source:"iana",extensions:["sse"]},"application/vnd.las":{source:"iana"},"application/vnd.las.las+json":{source:"iana",compressible:!0},"application/vnd.las.las+xml":{source:"iana",compressible:!0,extensions:["lasxml"]},"application/vnd.laszip":{source:"iana"},"application/vnd.leap+json":{source:"iana",compressible:!0},"application/vnd.liberty-request+xml":{source:"iana",compressible:!0},"application/vnd.llamagraphics.life-balance.desktop":{source:"iana",extensions:["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{source:"iana",compressible:!0,extensions:["lbe"]},"application/vnd.logipipe.circuit+zip":{source:"iana",compressible:!1},"application/vnd.loom":{source:"iana"},"application/vnd.lotus-1-2-3":{source:"iana",extensions:["123"]},"application/vnd.lotus-approach":{source:"iana",extensions:["apr"]},"application/vnd.lotus-freelance":{source:"iana",extensions:["pre"]},"application/vnd.lotus-notes":{source:"iana",extensions:["nsf"]},"application/vnd.lotus-organizer":{source:"iana",extensions:["org"]},"application/vnd.lotus-screencam":{source:"iana",extensions:["scm"]},"application/vnd.lotus-wordpro":{source:"iana",extensions:["lwp"]},"application/vnd.macports.portpkg":{source:"iana",extensions:["portpkg"]},"application/vnd.mapbox-vector-tile":{source:"iana",extensions:["mvt"]},"application/vnd.marlin.drm.actiontoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.conftoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.license+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.mdcf":{source:"iana"},"application/vnd.mason+json":{source:"iana",compressible:!0},"application/vnd.maxar.archive.3tz+zip":{source:"iana",compressible:!1},"application/vnd.maxmind.maxmind-db":{source:"iana"},"application/vnd.mcd":{source:"iana",extensions:["mcd"]},"application/vnd.medcalcdata":{source:"iana",extensions:["mc1"]},"application/vnd.mediastation.cdkey":{source:"iana",extensions:["cdkey"]},"application/vnd.meridian-slingshot":{source:"iana"},"application/vnd.mfer":{source:"iana",extensions:["mwf"]},"application/vnd.mfmp":{source:"iana",extensions:["mfm"]},"application/vnd.micro+json":{source:"iana",compressible:!0},"application/vnd.micrografx.flo":{source:"iana",extensions:["flo"]},"application/vnd.micrografx.igx":{source:"iana",extensions:["igx"]},"application/vnd.microsoft.portable-executable":{source:"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{source:"iana"},"application/vnd.miele+json":{source:"iana",compressible:!0},"application/vnd.mif":{source:"iana",extensions:["mif"]},"application/vnd.minisoft-hp3000-save":{source:"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{source:"iana"},"application/vnd.mobius.daf":{source:"iana",extensions:["daf"]},"application/vnd.mobius.dis":{source:"iana",extensions:["dis"]},"application/vnd.mobius.mbk":{source:"iana",extensions:["mbk"]},"application/vnd.mobius.mqy":{source:"iana",extensions:["mqy"]},"application/vnd.mobius.msl":{source:"iana",extensions:["msl"]},"application/vnd.mobius.plc":{source:"iana",extensions:["plc"]},"application/vnd.mobius.txf":{source:"iana",extensions:["txf"]},"application/vnd.mophun.application":{source:"iana",extensions:["mpn"]},"application/vnd.mophun.certificate":{source:"iana",extensions:["mpc"]},"application/vnd.motorola.flexsuite":{source:"iana"},"application/vnd.motorola.flexsuite.adsi":{source:"iana"},"application/vnd.motorola.flexsuite.fis":{source:"iana"},"application/vnd.motorola.flexsuite.gotap":{source:"iana"},"application/vnd.motorola.flexsuite.kmr":{source:"iana"},"application/vnd.motorola.flexsuite.ttc":{source:"iana"},"application/vnd.motorola.flexsuite.wem":{source:"iana"},"application/vnd.motorola.iprm":{source:"iana"},"application/vnd.mozilla.xul+xml":{source:"iana",compressible:!0,extensions:["xul"]},"application/vnd.ms-3mfdocument":{source:"iana"},"application/vnd.ms-artgalry":{source:"iana",extensions:["cil"]},"application/vnd.ms-asf":{source:"iana"},"application/vnd.ms-cab-compressed":{source:"iana",extensions:["cab"]},"application/vnd.ms-color.iccprofile":{source:"apache"},"application/vnd.ms-excel":{source:"iana",compressible:!1,extensions:["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{source:"iana",extensions:["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{source:"iana",extensions:["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{source:"iana",extensions:["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{source:"iana",extensions:["xltm"]},"application/vnd.ms-fontobject":{source:"iana",compressible:!0,extensions:["eot"]},"application/vnd.ms-htmlhelp":{source:"iana",extensions:["chm"]},"application/vnd.ms-ims":{source:"iana",extensions:["ims"]},"application/vnd.ms-lrm":{source:"iana",extensions:["lrm"]},"application/vnd.ms-office.activex+xml":{source:"iana",compressible:!0},"application/vnd.ms-officetheme":{source:"iana",extensions:["thmx"]},"application/vnd.ms-opentype":{source:"apache",compressible:!0},"application/vnd.ms-outlook":{compressible:!1,extensions:["msg"]},"application/vnd.ms-package.obfuscated-opentype":{source:"apache"},"application/vnd.ms-pki.seccat":{source:"apache",extensions:["cat"]},"application/vnd.ms-pki.stl":{source:"apache",extensions:["stl"]},"application/vnd.ms-playready.initiator+xml":{source:"iana",compressible:!0},"application/vnd.ms-powerpoint":{source:"iana",compressible:!1,extensions:["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{source:"iana",extensions:["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{source:"iana",extensions:["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{source:"iana",extensions:["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{source:"iana",extensions:["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{source:"iana",extensions:["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{source:"iana",compressible:!0},"application/vnd.ms-printing.printticket+xml":{source:"apache",compressible:!0},"application/vnd.ms-printschematicket+xml":{source:"iana",compressible:!0},"application/vnd.ms-project":{source:"iana",extensions:["mpp","mpt"]},"application/vnd.ms-tnef":{source:"iana"},"application/vnd.ms-windows.devicepairing":{source:"iana"},"application/vnd.ms-windows.nwprinting.oob":{source:"iana"},"application/vnd.ms-windows.printerpairing":{source:"iana"},"application/vnd.ms-windows.wsd.oob":{source:"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.lic-resp":{source:"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.meter-resp":{source:"iana"},"application/vnd.ms-word.document.macroenabled.12":{source:"iana",extensions:["docm"]},"application/vnd.ms-word.template.macroenabled.12":{source:"iana",extensions:["dotm"]},"application/vnd.ms-works":{source:"iana",extensions:["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{source:"iana",extensions:["wpl"]},"application/vnd.ms-xpsdocument":{source:"iana",compressible:!1,extensions:["xps"]},"application/vnd.msa-disk-image":{source:"iana"},"application/vnd.mseq":{source:"iana",extensions:["mseq"]},"application/vnd.msign":{source:"iana"},"application/vnd.multiad.creator":{source:"iana"},"application/vnd.multiad.creator.cif":{source:"iana"},"application/vnd.music-niff":{source:"iana"},"application/vnd.musician":{source:"iana",extensions:["mus"]},"application/vnd.muvee.style":{source:"iana",extensions:["msty"]},"application/vnd.mynfc":{source:"iana",extensions:["taglet"]},"application/vnd.nacamar.ybrid+json":{source:"iana",compressible:!0},"application/vnd.ncd.control":{source:"iana"},"application/vnd.ncd.reference":{source:"iana"},"application/vnd.nearst.inv+json":{source:"iana",compressible:!0},"application/vnd.nebumind.line":{source:"iana"},"application/vnd.nervana":{source:"iana"},"application/vnd.netfpx":{source:"iana"},"application/vnd.neurolanguage.nlu":{source:"iana",extensions:["nlu"]},"application/vnd.nimn":{source:"iana"},"application/vnd.nintendo.nitro.rom":{source:"iana"},"application/vnd.nintendo.snes.rom":{source:"iana"},"application/vnd.nitf":{source:"iana",extensions:["ntf","nitf"]},"application/vnd.noblenet-directory":{source:"iana",extensions:["nnd"]},"application/vnd.noblenet-sealer":{source:"iana",extensions:["nns"]},"application/vnd.noblenet-web":{source:"iana",extensions:["nnw"]},"application/vnd.nokia.catalogs":{source:"iana"},"application/vnd.nokia.conml+wbxml":{source:"iana"},"application/vnd.nokia.conml+xml":{source:"iana",compressible:!0},"application/vnd.nokia.iptv.config+xml":{source:"iana",compressible:!0},"application/vnd.nokia.isds-radio-presets":{source:"iana"},"application/vnd.nokia.landmark+wbxml":{source:"iana"},"application/vnd.nokia.landmark+xml":{source:"iana",compressible:!0},"application/vnd.nokia.landmarkcollection+xml":{source:"iana",compressible:!0},"application/vnd.nokia.n-gage.ac+xml":{source:"iana",compressible:!0,extensions:["ac"]},"application/vnd.nokia.n-gage.data":{source:"iana",extensions:["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{source:"iana",extensions:["n-gage"]},"application/vnd.nokia.ncd":{source:"iana"},"application/vnd.nokia.pcd+wbxml":{source:"iana"},"application/vnd.nokia.pcd+xml":{source:"iana",compressible:!0},"application/vnd.nokia.radio-preset":{source:"iana",extensions:["rpst"]},"application/vnd.nokia.radio-presets":{source:"iana",extensions:["rpss"]},"application/vnd.novadigm.edm":{source:"iana",extensions:["edm"]},"application/vnd.novadigm.edx":{source:"iana",extensions:["edx"]},"application/vnd.novadigm.ext":{source:"iana",extensions:["ext"]},"application/vnd.ntt-local.content-share":{source:"iana"},"application/vnd.ntt-local.file-transfer":{source:"iana"},"application/vnd.ntt-local.ogw_remote-access":{source:"iana"},"application/vnd.ntt-local.sip-ta_remote":{source:"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{source:"iana"},"application/vnd.oasis.opendocument.chart":{source:"iana",extensions:["odc"]},"application/vnd.oasis.opendocument.chart-template":{source:"iana",extensions:["otc"]},"application/vnd.oasis.opendocument.database":{source:"iana",extensions:["odb"]},"application/vnd.oasis.opendocument.formula":{source:"iana",extensions:["odf"]},"application/vnd.oasis.opendocument.formula-template":{source:"iana",extensions:["odft"]},"application/vnd.oasis.opendocument.graphics":{source:"iana",compressible:!1,extensions:["odg"]},"application/vnd.oasis.opendocument.graphics-template":{source:"iana",extensions:["otg"]},"application/vnd.oasis.opendocument.image":{source:"iana",extensions:["odi"]},"application/vnd.oasis.opendocument.image-template":{source:"iana",extensions:["oti"]},"application/vnd.oasis.opendocument.presentation":{source:"iana",compressible:!1,extensions:["odp"]},"application/vnd.oasis.opendocument.presentation-template":{source:"iana",extensions:["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{source:"iana",compressible:!1,extensions:["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{source:"iana",extensions:["ots"]},"application/vnd.oasis.opendocument.text":{source:"iana",compressible:!1,extensions:["odt"]},"application/vnd.oasis.opendocument.text-master":{source:"iana",extensions:["odm"]},"application/vnd.oasis.opendocument.text-template":{source:"iana",extensions:["ott"]},"application/vnd.oasis.opendocument.text-web":{source:"iana",extensions:["oth"]},"application/vnd.obn":{source:"iana"},"application/vnd.ocf+cbor":{source:"iana"},"application/vnd.oci.image.manifest.v1+json":{source:"iana",compressible:!0},"application/vnd.oftn.l10n+json":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessdownload+xml":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessstreaming+xml":{source:"iana",compressible:!0},"application/vnd.oipf.cspg-hexbinary":{source:"iana"},"application/vnd.oipf.dae.svg+xml":{source:"iana",compressible:!0},"application/vnd.oipf.dae.xhtml+xml":{source:"iana",compressible:!0},"application/vnd.oipf.mippvcontrolmessage+xml":{source:"iana",compressible:!0},"application/vnd.oipf.pae.gem":{source:"iana"},"application/vnd.oipf.spdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.oipf.spdlist+xml":{source:"iana",compressible:!0},"application/vnd.oipf.ueprofile+xml":{source:"iana",compressible:!0},"application/vnd.oipf.userprofile+xml":{source:"iana",compressible:!0},"application/vnd.olpc-sugar":{source:"iana",extensions:["xo"]},"application/vnd.oma-scws-config":{source:"iana"},"application/vnd.oma-scws-http-request":{source:"iana"},"application/vnd.oma-scws-http-response":{source:"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.drm-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.imd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.ltkm":{source:"iana"},"application/vnd.oma.bcast.notification+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.provisioningtrigger":{source:"iana"},"application/vnd.oma.bcast.sgboot":{source:"iana"},"application/vnd.oma.bcast.sgdd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sgdu":{source:"iana"},"application/vnd.oma.bcast.simple-symbol-container":{source:"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sprov+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.stkm":{source:"iana"},"application/vnd.oma.cab-address-book+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-feature-handler+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-pcc+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-subs-invite+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-user-prefs+xml":{source:"iana",compressible:!0},"application/vnd.oma.dcd":{source:"iana"},"application/vnd.oma.dcdc":{source:"iana"},"application/vnd.oma.dd2+xml":{source:"iana",compressible:!0,extensions:["dd2"]},"application/vnd.oma.drm.risd+xml":{source:"iana",compressible:!0},"application/vnd.oma.group-usage-list+xml":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+cbor":{source:"iana"},"application/vnd.oma.lwm2m+json":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+tlv":{source:"iana"},"application/vnd.oma.pal+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.detailed-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.final-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.groups+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.invocation-descriptor+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.optimized-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.push":{source:"iana"},"application/vnd.oma.scidm.messages+xml":{source:"iana",compressible:!0},"application/vnd.oma.xcap-directory+xml":{source:"iana",compressible:!0},"application/vnd.omads-email+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-file+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-folder+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omaloc-supl-init":{source:"iana"},"application/vnd.onepager":{source:"iana"},"application/vnd.onepagertamp":{source:"iana"},"application/vnd.onepagertamx":{source:"iana"},"application/vnd.onepagertat":{source:"iana"},"application/vnd.onepagertatp":{source:"iana"},"application/vnd.onepagertatx":{source:"iana"},"application/vnd.openblox.game+xml":{source:"iana",compressible:!0,extensions:["obgx"]},"application/vnd.openblox.game-binary":{source:"iana"},"application/vnd.openeye.oeb":{source:"iana"},"application/vnd.openofficeorg.extension":{source:"apache",extensions:["oxt"]},"application/vnd.openstreetmap.data+xml":{source:"iana",compressible:!0,extensions:["osm"]},"application/vnd.opentimestamps.ots":{source:"iana"},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawing+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:"iana",compressible:!1,extensions:["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slide":{source:"iana",extensions:["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{source:"iana",extensions:["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.template":{source:"iana",extensions:["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:"iana",compressible:!1,extensions:["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{source:"iana",extensions:["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.theme+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.vmldrawing":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:"iana",compressible:!1,extensions:["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{source:"iana",extensions:["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.core-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.relationships+xml":{source:"iana",compressible:!0},"application/vnd.oracle.resource+json":{source:"iana",compressible:!0},"application/vnd.orange.indata":{source:"iana"},"application/vnd.osa.netdeploy":{source:"iana"},"application/vnd.osgeo.mapguide.package":{source:"iana",extensions:["mgp"]},"application/vnd.osgi.bundle":{source:"iana"},"application/vnd.osgi.dp":{source:"iana",extensions:["dp"]},"application/vnd.osgi.subsystem":{source:"iana",extensions:["esa"]},"application/vnd.otps.ct-kip+xml":{source:"iana",compressible:!0},"application/vnd.oxli.countgraph":{source:"iana"},"application/vnd.pagerduty+json":{source:"iana",compressible:!0},"application/vnd.palm":{source:"iana",extensions:["pdb","pqa","oprc"]},"application/vnd.panoply":{source:"iana"},"application/vnd.paos.xml":{source:"iana"},"application/vnd.patentdive":{source:"iana"},"application/vnd.patientecommsdoc":{source:"iana"},"application/vnd.pawaafile":{source:"iana",extensions:["paw"]},"application/vnd.pcos":{source:"iana"},"application/vnd.pg.format":{source:"iana",extensions:["str"]},"application/vnd.pg.osasli":{source:"iana",extensions:["ei6"]},"application/vnd.piaccess.application-licence":{source:"iana"},"application/vnd.picsel":{source:"iana",extensions:["efif"]},"application/vnd.pmi.widget":{source:"iana",extensions:["wg"]},"application/vnd.poc.group-advertisement+xml":{source:"iana",compressible:!0},"application/vnd.pocketlearn":{source:"iana",extensions:["plf"]},"application/vnd.powerbuilder6":{source:"iana",extensions:["pbd"]},"application/vnd.powerbuilder6-s":{source:"iana"},"application/vnd.powerbuilder7":{source:"iana"},"application/vnd.powerbuilder7-s":{source:"iana"},"application/vnd.powerbuilder75":{source:"iana"},"application/vnd.powerbuilder75-s":{source:"iana"},"application/vnd.preminet":{source:"iana"},"application/vnd.previewsystems.box":{source:"iana",extensions:["box"]},"application/vnd.proteus.magazine":{source:"iana",extensions:["mgz"]},"application/vnd.psfs":{source:"iana"},"application/vnd.publishare-delta-tree":{source:"iana",extensions:["qps"]},"application/vnd.pvi.ptid1":{source:"iana",extensions:["ptid"]},"application/vnd.pwg-multiplexed":{source:"iana"},"application/vnd.pwg-xhtml-print+xml":{source:"iana",compressible:!0},"application/vnd.qualcomm.brew-app-res":{source:"iana"},"application/vnd.quarantainenet":{source:"iana"},"application/vnd.quark.quarkxpress":{source:"iana",extensions:["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{source:"iana"},"application/vnd.radisys.moml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conn+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-stream+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-base+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-detect+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-group+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-speech+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-transform+xml":{source:"iana",compressible:!0},"application/vnd.rainstor.data":{source:"iana"},"application/vnd.rapid":{source:"iana"},"application/vnd.rar":{source:"iana",extensions:["rar"]},"application/vnd.realvnc.bed":{source:"iana",extensions:["bed"]},"application/vnd.recordare.musicxml":{source:"iana",extensions:["mxl"]},"application/vnd.recordare.musicxml+xml":{source:"iana",compressible:!0,extensions:["musicxml"]},"application/vnd.renlearn.rlprint":{source:"iana"},"application/vnd.resilient.logic":{source:"iana"},"application/vnd.restful+json":{source:"iana",compressible:!0},"application/vnd.rig.cryptonote":{source:"iana",extensions:["cryptonote"]},"application/vnd.rim.cod":{source:"apache",extensions:["cod"]},"application/vnd.rn-realmedia":{source:"apache",extensions:["rm"]},"application/vnd.rn-realmedia-vbr":{source:"apache",extensions:["rmvb"]},"application/vnd.route66.link66+xml":{source:"iana",compressible:!0,extensions:["link66"]},"application/vnd.rs-274x":{source:"iana"},"application/vnd.ruckus.download":{source:"iana"},"application/vnd.s3sms":{source:"iana"},"application/vnd.sailingtracker.track":{source:"iana",extensions:["st"]},"application/vnd.sar":{source:"iana"},"application/vnd.sbm.cid":{source:"iana"},"application/vnd.sbm.mid2":{source:"iana"},"application/vnd.scribus":{source:"iana"},"application/vnd.sealed.3df":{source:"iana"},"application/vnd.sealed.csf":{source:"iana"},"application/vnd.sealed.doc":{source:"iana"},"application/vnd.sealed.eml":{source:"iana"},"application/vnd.sealed.mht":{source:"iana"},"application/vnd.sealed.net":{source:"iana"},"application/vnd.sealed.ppt":{source:"iana"},"application/vnd.sealed.tiff":{source:"iana"},"application/vnd.sealed.xls":{source:"iana"},"application/vnd.sealedmedia.softseal.html":{source:"iana"},"application/vnd.sealedmedia.softseal.pdf":{source:"iana"},"application/vnd.seemail":{source:"iana",extensions:["see"]},"application/vnd.seis+json":{source:"iana",compressible:!0},"application/vnd.sema":{source:"iana",extensions:["sema"]},"application/vnd.semd":{source:"iana",extensions:["semd"]},"application/vnd.semf":{source:"iana",extensions:["semf"]},"application/vnd.shade-save-file":{source:"iana"},"application/vnd.shana.informed.formdata":{source:"iana",extensions:["ifm"]},"application/vnd.shana.informed.formtemplate":{source:"iana",extensions:["itp"]},"application/vnd.shana.informed.interchange":{source:"iana",extensions:["iif"]},"application/vnd.shana.informed.package":{source:"iana",extensions:["ipk"]},"application/vnd.shootproof+json":{source:"iana",compressible:!0},"application/vnd.shopkick+json":{source:"iana",compressible:!0},"application/vnd.shp":{source:"iana"},"application/vnd.shx":{source:"iana"},"application/vnd.sigrok.session":{source:"iana"},"application/vnd.simtech-mindmapper":{source:"iana",extensions:["twd","twds"]},"application/vnd.siren+json":{source:"iana",compressible:!0},"application/vnd.smaf":{source:"iana",extensions:["mmf"]},"application/vnd.smart.notebook":{source:"iana"},"application/vnd.smart.teacher":{source:"iana",extensions:["teacher"]},"application/vnd.snesdev-page-table":{source:"iana"},"application/vnd.software602.filler.form+xml":{source:"iana",compressible:!0,extensions:["fo"]},"application/vnd.software602.filler.form-xml-zip":{source:"iana"},"application/vnd.solent.sdkm+xml":{source:"iana",compressible:!0,extensions:["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{source:"iana",extensions:["dxp"]},"application/vnd.spotfire.sfs":{source:"iana",extensions:["sfs"]},"application/vnd.sqlite3":{source:"iana"},"application/vnd.sss-cod":{source:"iana"},"application/vnd.sss-dtf":{source:"iana"},"application/vnd.sss-ntf":{source:"iana"},"application/vnd.stardivision.calc":{source:"apache",extensions:["sdc"]},"application/vnd.stardivision.draw":{source:"apache",extensions:["sda"]},"application/vnd.stardivision.impress":{source:"apache",extensions:["sdd"]},"application/vnd.stardivision.math":{source:"apache",extensions:["smf"]},"application/vnd.stardivision.writer":{source:"apache",extensions:["sdw","vor"]},"application/vnd.stardivision.writer-global":{source:"apache",extensions:["sgl"]},"application/vnd.stepmania.package":{source:"iana",extensions:["smzip"]},"application/vnd.stepmania.stepchart":{source:"iana",extensions:["sm"]},"application/vnd.street-stream":{source:"iana"},"application/vnd.sun.wadl+xml":{source:"iana",compressible:!0,extensions:["wadl"]},"application/vnd.sun.xml.calc":{source:"apache",extensions:["sxc"]},"application/vnd.sun.xml.calc.template":{source:"apache",extensions:["stc"]},"application/vnd.sun.xml.draw":{source:"apache",extensions:["sxd"]},"application/vnd.sun.xml.draw.template":{source:"apache",extensions:["std"]},"application/vnd.sun.xml.impress":{source:"apache",extensions:["sxi"]},"application/vnd.sun.xml.impress.template":{source:"apache",extensions:["sti"]},"application/vnd.sun.xml.math":{source:"apache",extensions:["sxm"]},"application/vnd.sun.xml.writer":{source:"apache",extensions:["sxw"]},"application/vnd.sun.xml.writer.global":{source:"apache",extensions:["sxg"]},"application/vnd.sun.xml.writer.template":{source:"apache",extensions:["stw"]},"application/vnd.sus-calendar":{source:"iana",extensions:["sus","susp"]},"application/vnd.svd":{source:"iana",extensions:["svd"]},"application/vnd.swiftview-ics":{source:"iana"},"application/vnd.sycle+xml":{source:"iana",compressible:!0},"application/vnd.syft+json":{source:"iana",compressible:!0},"application/vnd.symbian.install":{source:"apache",extensions:["sis","sisx"]},"application/vnd.syncml+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xsm"]},"application/vnd.syncml.dm+wbxml":{source:"iana",charset:"UTF-8",extensions:["bdm"]},"application/vnd.syncml.dm+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xdm"]},"application/vnd.syncml.dm.notification":{source:"iana"},"application/vnd.syncml.dmddf+wbxml":{source:"iana"},"application/vnd.syncml.dmddf+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["ddf"]},"application/vnd.syncml.dmtnds+wbxml":{source:"iana"},"application/vnd.syncml.dmtnds+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.syncml.ds.notification":{source:"iana"},"application/vnd.tableschema+json":{source:"iana",compressible:!0},"application/vnd.tao.intent-module-archive":{source:"iana",extensions:["tao"]},"application/vnd.tcpdump.pcap":{source:"iana",extensions:["pcap","cap","dmp"]},"application/vnd.think-cell.ppttc+json":{source:"iana",compressible:!0},"application/vnd.tmd.mediaflex.api+xml":{source:"iana",compressible:!0},"application/vnd.tml":{source:"iana"},"application/vnd.tmobile-livetv":{source:"iana",extensions:["tmo"]},"application/vnd.tri.onesource":{source:"iana"},"application/vnd.trid.tpt":{source:"iana",extensions:["tpt"]},"application/vnd.triscape.mxs":{source:"iana",extensions:["mxs"]},"application/vnd.trueapp":{source:"iana",extensions:["tra"]},"application/vnd.truedoc":{source:"iana"},"application/vnd.ubisoft.webplayer":{source:"iana"},"application/vnd.ufdl":{source:"iana",extensions:["ufd","ufdl"]},"application/vnd.uiq.theme":{source:"iana",extensions:["utz"]},"application/vnd.umajin":{source:"iana",extensions:["umj"]},"application/vnd.unity":{source:"iana",extensions:["unityweb"]},"application/vnd.uoml+xml":{source:"iana",compressible:!0,extensions:["uoml"]},"application/vnd.uplanet.alert":{source:"iana"},"application/vnd.uplanet.alert-wbxml":{source:"iana"},"application/vnd.uplanet.bearer-choice":{source:"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{source:"iana"},"application/vnd.uplanet.cacheop":{source:"iana"},"application/vnd.uplanet.cacheop-wbxml":{source:"iana"},"application/vnd.uplanet.channel":{source:"iana"},"application/vnd.uplanet.channel-wbxml":{source:"iana"},"application/vnd.uplanet.list":{source:"iana"},"application/vnd.uplanet.list-wbxml":{source:"iana"},"application/vnd.uplanet.listcmd":{source:"iana"},"application/vnd.uplanet.listcmd-wbxml":{source:"iana"},"application/vnd.uplanet.signal":{source:"iana"},"application/vnd.uri-map":{source:"iana"},"application/vnd.valve.source.material":{source:"iana"},"application/vnd.vcx":{source:"iana",extensions:["vcx"]},"application/vnd.vd-study":{source:"iana"},"application/vnd.vectorworks":{source:"iana"},"application/vnd.vel+json":{source:"iana",compressible:!0},"application/vnd.verimatrix.vcas":{source:"iana"},"application/vnd.veritone.aion+json":{source:"iana",compressible:!0},"application/vnd.veryant.thin":{source:"iana"},"application/vnd.ves.encrypted":{source:"iana"},"application/vnd.vidsoft.vidconference":{source:"iana"},"application/vnd.visio":{source:"iana",extensions:["vsd","vst","vss","vsw"]},"application/vnd.visionary":{source:"iana",extensions:["vis"]},"application/vnd.vividence.scriptfile":{source:"iana"},"application/vnd.vsf":{source:"iana",extensions:["vsf"]},"application/vnd.wap.sic":{source:"iana"},"application/vnd.wap.slc":{source:"iana"},"application/vnd.wap.wbxml":{source:"iana",charset:"UTF-8",extensions:["wbxml"]},"application/vnd.wap.wmlc":{source:"iana",extensions:["wmlc"]},"application/vnd.wap.wmlscriptc":{source:"iana",extensions:["wmlsc"]},"application/vnd.webturbo":{source:"iana",extensions:["wtb"]},"application/vnd.wfa.dpp":{source:"iana"},"application/vnd.wfa.p2p":{source:"iana"},"application/vnd.wfa.wsc":{source:"iana"},"application/vnd.windows.devicepairing":{source:"iana"},"application/vnd.wmc":{source:"iana"},"application/vnd.wmf.bootstrap":{source:"iana"},"application/vnd.wolfram.mathematica":{source:"iana"},"application/vnd.wolfram.mathematica.package":{source:"iana"},"application/vnd.wolfram.player":{source:"iana",extensions:["nbp"]},"application/vnd.wordperfect":{source:"iana",extensions:["wpd"]},"application/vnd.wqd":{source:"iana",extensions:["wqd"]},"application/vnd.wrq-hp3000-labelled":{source:"iana"},"application/vnd.wt.stf":{source:"iana",extensions:["stf"]},"application/vnd.wv.csp+wbxml":{source:"iana"},"application/vnd.wv.csp+xml":{source:"iana",compressible:!0},"application/vnd.wv.ssp+xml":{source:"iana",compressible:!0},"application/vnd.xacml+json":{source:"iana",compressible:!0},"application/vnd.xara":{source:"iana",extensions:["xar"]},"application/vnd.xfdl":{source:"iana",extensions:["xfdl"]},"application/vnd.xfdl.webform":{source:"iana"},"application/vnd.xmi+xml":{source:"iana",compressible:!0},"application/vnd.xmpie.cpkg":{source:"iana"},"application/vnd.xmpie.dpkg":{source:"iana"},"application/vnd.xmpie.plan":{source:"iana"},"application/vnd.xmpie.ppkg":{source:"iana"},"application/vnd.xmpie.xlim":{source:"iana"},"application/vnd.yamaha.hv-dic":{source:"iana",extensions:["hvd"]},"application/vnd.yamaha.hv-script":{source:"iana",extensions:["hvs"]},"application/vnd.yamaha.hv-voice":{source:"iana",extensions:["hvp"]},"application/vnd.yamaha.openscoreformat":{source:"iana",extensions:["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{source:"iana",compressible:!0,extensions:["osfpvg"]},"application/vnd.yamaha.remote-setup":{source:"iana"},"application/vnd.yamaha.smaf-audio":{source:"iana",extensions:["saf"]},"application/vnd.yamaha.smaf-phrase":{source:"iana",extensions:["spf"]},"application/vnd.yamaha.through-ngn":{source:"iana"},"application/vnd.yamaha.tunnel-udpencap":{source:"iana"},"application/vnd.yaoweme":{source:"iana"},"application/vnd.yellowriver-custom-menu":{source:"iana",extensions:["cmp"]},"application/vnd.youtube.yt":{source:"iana"},"application/vnd.zul":{source:"iana",extensions:["zir","zirz"]},"application/vnd.zzazz.deck+xml":{source:"iana",compressible:!0,extensions:["zaz"]},"application/voicexml+xml":{source:"iana",compressible:!0,extensions:["vxml"]},"application/voucher-cms+json":{source:"iana",compressible:!0},"application/vq-rtcpxr":{source:"iana"},"application/wasm":{source:"iana",compressible:!0,extensions:["wasm"]},"application/watcherinfo+xml":{source:"iana",compressible:!0,extensions:["wif"]},"application/webpush-options+json":{source:"iana",compressible:!0},"application/whoispp-query":{source:"iana"},"application/whoispp-response":{source:"iana"},"application/widget":{source:"iana",extensions:["wgt"]},"application/winhlp":{source:"apache",extensions:["hlp"]},"application/wita":{source:"iana"},"application/wordperfect5.1":{source:"iana"},"application/wsdl+xml":{source:"iana",compressible:!0,extensions:["wsdl"]},"application/wspolicy+xml":{source:"iana",compressible:!0,extensions:["wspolicy"]},"application/x-7z-compressed":{source:"apache",compressible:!1,extensions:["7z"]},"application/x-abiword":{source:"apache",extensions:["abw"]},"application/x-ace-compressed":{source:"apache",extensions:["ace"]},"application/x-amf":{source:"apache"},"application/x-apple-diskimage":{source:"apache",extensions:["dmg"]},"application/x-arj":{compressible:!1,extensions:["arj"]},"application/x-authorware-bin":{source:"apache",extensions:["aab","x32","u32","vox"]},"application/x-authorware-map":{source:"apache",extensions:["aam"]},"application/x-authorware-seg":{source:"apache",extensions:["aas"]},"application/x-bcpio":{source:"apache",extensions:["bcpio"]},"application/x-bdoc":{compressible:!1,extensions:["bdoc"]},"application/x-bittorrent":{source:"apache",extensions:["torrent"]},"application/x-blorb":{source:"apache",extensions:["blb","blorb"]},"application/x-bzip":{source:"apache",compressible:!1,extensions:["bz"]},"application/x-bzip2":{source:"apache",compressible:!1,extensions:["bz2","boz"]},"application/x-cbr":{source:"apache",extensions:["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{source:"apache",extensions:["vcd"]},"application/x-cfs-compressed":{source:"apache",extensions:["cfs"]},"application/x-chat":{source:"apache",extensions:["chat"]},"application/x-chess-pgn":{source:"apache",extensions:["pgn"]},"application/x-chrome-extension":{extensions:["crx"]},"application/x-cocoa":{source:"nginx",extensions:["cco"]},"application/x-compress":{source:"apache"},"application/x-conference":{source:"apache",extensions:["nsc"]},"application/x-cpio":{source:"apache",extensions:["cpio"]},"application/x-csh":{source:"apache",extensions:["csh"]},"application/x-deb":{compressible:!1},"application/x-debian-package":{source:"apache",extensions:["deb","udeb"]},"application/x-dgc-compressed":{source:"apache",extensions:["dgc"]},"application/x-director":{source:"apache",extensions:["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{source:"apache",extensions:["wad"]},"application/x-dtbncx+xml":{source:"apache",compressible:!0,extensions:["ncx"]},"application/x-dtbook+xml":{source:"apache",compressible:!0,extensions:["dtb"]},"application/x-dtbresource+xml":{source:"apache",compressible:!0,extensions:["res"]},"application/x-dvi":{source:"apache",compressible:!1,extensions:["dvi"]},"application/x-envoy":{source:"apache",extensions:["evy"]},"application/x-eva":{source:"apache",extensions:["eva"]},"application/x-font-bdf":{source:"apache",extensions:["bdf"]},"application/x-font-dos":{source:"apache"},"application/x-font-framemaker":{source:"apache"},"application/x-font-ghostscript":{source:"apache",extensions:["gsf"]},"application/x-font-libgrx":{source:"apache"},"application/x-font-linux-psf":{source:"apache",extensions:["psf"]},"application/x-font-pcf":{source:"apache",extensions:["pcf"]},"application/x-font-snf":{source:"apache",extensions:["snf"]},"application/x-font-speedo":{source:"apache"},"application/x-font-sunos-news":{source:"apache"},"application/x-font-type1":{source:"apache",extensions:["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{source:"apache"},"application/x-freearc":{source:"apache",extensions:["arc"]},"application/x-futuresplash":{source:"apache",extensions:["spl"]},"application/x-gca-compressed":{source:"apache",extensions:["gca"]},"application/x-glulx":{source:"apache",extensions:["ulx"]},"application/x-gnumeric":{source:"apache",extensions:["gnumeric"]},"application/x-gramps-xml":{source:"apache",extensions:["gramps"]},"application/x-gtar":{source:"apache",extensions:["gtar"]},"application/x-gzip":{source:"apache"},"application/x-hdf":{source:"apache",extensions:["hdf"]},"application/x-httpd-php":{compressible:!0,extensions:["php"]},"application/x-install-instructions":{source:"apache",extensions:["install"]},"application/x-iso9660-image":{source:"apache",extensions:["iso"]},"application/x-iwork-keynote-sffkey":{extensions:["key"]},"application/x-iwork-numbers-sffnumbers":{extensions:["numbers"]},"application/x-iwork-pages-sffpages":{extensions:["pages"]},"application/x-java-archive-diff":{source:"nginx",extensions:["jardiff"]},"application/x-java-jnlp-file":{source:"apache",compressible:!1,extensions:["jnlp"]},"application/x-javascript":{compressible:!0},"application/x-keepass2":{extensions:["kdbx"]},"application/x-latex":{source:"apache",compressible:!1,extensions:["latex"]},"application/x-lua-bytecode":{extensions:["luac"]},"application/x-lzh-compressed":{source:"apache",extensions:["lzh","lha"]},"application/x-makeself":{source:"nginx",extensions:["run"]},"application/x-mie":{source:"apache",extensions:["mie"]},"application/x-mobipocket-ebook":{source:"apache",extensions:["prc","mobi"]},"application/x-mpegurl":{compressible:!1},"application/x-ms-application":{source:"apache",extensions:["application"]},"application/x-ms-shortcut":{source:"apache",extensions:["lnk"]},"application/x-ms-wmd":{source:"apache",extensions:["wmd"]},"application/x-ms-wmz":{source:"apache",extensions:["wmz"]},"application/x-ms-xbap":{source:"apache",extensions:["xbap"]},"application/x-msaccess":{source:"apache",extensions:["mdb"]},"application/x-msbinder":{source:"apache",extensions:["obd"]},"application/x-mscardfile":{source:"apache",extensions:["crd"]},"application/x-msclip":{source:"apache",extensions:["clp"]},"application/x-msdos-program":{extensions:["exe"]},"application/x-msdownload":{source:"apache",extensions:["exe","dll","com","bat","msi"]},"application/x-msmediaview":{source:"apache",extensions:["mvb","m13","m14"]},"application/x-msmetafile":{source:"apache",extensions:["wmf","wmz","emf","emz"]},"application/x-msmoney":{source:"apache",extensions:["mny"]},"application/x-mspublisher":{source:"apache",extensions:["pub"]},"application/x-msschedule":{source:"apache",extensions:["scd"]},"application/x-msterminal":{source:"apache",extensions:["trm"]},"application/x-mswrite":{source:"apache",extensions:["wri"]},"application/x-netcdf":{source:"apache",extensions:["nc","cdf"]},"application/x-ns-proxy-autoconfig":{compressible:!0,extensions:["pac"]},"application/x-nzb":{source:"apache",extensions:["nzb"]},"application/x-perl":{source:"nginx",extensions:["pl","pm"]},"application/x-pilot":{source:"nginx",extensions:["prc","pdb"]},"application/x-pkcs12":{source:"apache",compressible:!1,extensions:["p12","pfx"]},"application/x-pkcs7-certificates":{source:"apache",extensions:["p7b","spc"]},"application/x-pkcs7-certreqresp":{source:"apache",extensions:["p7r"]},"application/x-pki-message":{source:"iana"},"application/x-rar-compressed":{source:"apache",compressible:!1,extensions:["rar"]},"application/x-redhat-package-manager":{source:"nginx",extensions:["rpm"]},"application/x-research-info-systems":{source:"apache",extensions:["ris"]},"application/x-sea":{source:"nginx",extensions:["sea"]},"application/x-sh":{source:"apache",compressible:!0,extensions:["sh"]},"application/x-shar":{source:"apache",extensions:["shar"]},"application/x-shockwave-flash":{source:"apache",compressible:!1,extensions:["swf"]},"application/x-silverlight-app":{source:"apache",extensions:["xap"]},"application/x-sql":{source:"apache",extensions:["sql"]},"application/x-stuffit":{source:"apache",compressible:!1,extensions:["sit"]},"application/x-stuffitx":{source:"apache",extensions:["sitx"]},"application/x-subrip":{source:"apache",extensions:["srt"]},"application/x-sv4cpio":{source:"apache",extensions:["sv4cpio"]},"application/x-sv4crc":{source:"apache",extensions:["sv4crc"]},"application/x-t3vm-image":{source:"apache",extensions:["t3"]},"application/x-tads":{source:"apache",extensions:["gam"]},"application/x-tar":{source:"apache",compressible:!0,extensions:["tar"]},"application/x-tcl":{source:"apache",extensions:["tcl","tk"]},"application/x-tex":{source:"apache",extensions:["tex"]},"application/x-tex-tfm":{source:"apache",extensions:["tfm"]},"application/x-texinfo":{source:"apache",extensions:["texinfo","texi"]},"application/x-tgif":{source:"apache",extensions:["obj"]},"application/x-ustar":{source:"apache",extensions:["ustar"]},"application/x-virtualbox-hdd":{compressible:!0,extensions:["hdd"]},"application/x-virtualbox-ova":{compressible:!0,extensions:["ova"]},"application/x-virtualbox-ovf":{compressible:!0,extensions:["ovf"]},"application/x-virtualbox-vbox":{compressible:!0,extensions:["vbox"]},"application/x-virtualbox-vbox-extpack":{compressible:!1,extensions:["vbox-extpack"]},"application/x-virtualbox-vdi":{compressible:!0,extensions:["vdi"]},"application/x-virtualbox-vhd":{compressible:!0,extensions:["vhd"]},"application/x-virtualbox-vmdk":{compressible:!0,extensions:["vmdk"]},"application/x-wais-source":{source:"apache",extensions:["src"]},"application/x-web-app-manifest+json":{compressible:!0,extensions:["webapp"]},"application/x-www-form-urlencoded":{source:"iana",compressible:!0},"application/x-x509-ca-cert":{source:"iana",extensions:["der","crt","pem"]},"application/x-x509-ca-ra-cert":{source:"iana"},"application/x-x509-next-ca-cert":{source:"iana"},"application/x-xfig":{source:"apache",extensions:["fig"]},"application/x-xliff+xml":{source:"apache",compressible:!0,extensions:["xlf"]},"application/x-xpinstall":{source:"apache",compressible:!1,extensions:["xpi"]},"application/x-xz":{source:"apache",extensions:["xz"]},"application/x-zmachine":{source:"apache",extensions:["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{source:"iana"},"application/xacml+xml":{source:"iana",compressible:!0},"application/xaml+xml":{source:"apache",compressible:!0,extensions:["xaml"]},"application/xcap-att+xml":{source:"iana",compressible:!0,extensions:["xav"]},"application/xcap-caps+xml":{source:"iana",compressible:!0,extensions:["xca"]},"application/xcap-diff+xml":{source:"iana",compressible:!0,extensions:["xdf"]},"application/xcap-el+xml":{source:"iana",compressible:!0,extensions:["xel"]},"application/xcap-error+xml":{source:"iana",compressible:!0},"application/xcap-ns+xml":{source:"iana",compressible:!0,extensions:["xns"]},"application/xcon-conference-info+xml":{source:"iana",compressible:!0},"application/xcon-conference-info-diff+xml":{source:"iana",compressible:!0},"application/xenc+xml":{source:"iana",compressible:!0,extensions:["xenc"]},"application/xhtml+xml":{source:"iana",compressible:!0,extensions:["xhtml","xht"]},"application/xhtml-voice+xml":{source:"apache",compressible:!0},"application/xliff+xml":{source:"iana",compressible:!0,extensions:["xlf"]},"application/xml":{source:"iana",compressible:!0,extensions:["xml","xsl","xsd","rng"]},"application/xml-dtd":{source:"iana",compressible:!0,extensions:["dtd"]},"application/xml-external-parsed-entity":{source:"iana"},"application/xml-patch+xml":{source:"iana",compressible:!0},"application/xmpp+xml":{source:"iana",compressible:!0},"application/xop+xml":{source:"iana",compressible:!0,extensions:["xop"]},"application/xproc+xml":{source:"apache",compressible:!0,extensions:["xpl"]},"application/xslt+xml":{source:"iana",compressible:!0,extensions:["xsl","xslt"]},"application/xspf+xml":{source:"apache",compressible:!0,extensions:["xspf"]},"application/xv+xml":{source:"iana",compressible:!0,extensions:["mxml","xhvml","xvml","xvm"]},"application/yang":{source:"iana",extensions:["yang"]},"application/yang-data+json":{source:"iana",compressible:!0},"application/yang-data+xml":{source:"iana",compressible:!0},"application/yang-patch+json":{source:"iana",compressible:!0},"application/yang-patch+xml":{source:"iana",compressible:!0},"application/yin+xml":{source:"iana",compressible:!0,extensions:["yin"]},"application/zip":{source:"iana",compressible:!1,extensions:["zip"]},"application/zlib":{source:"iana"},"application/zstd":{source:"iana"},"audio/1d-interleaved-parityfec":{source:"iana"},"audio/32kadpcm":{source:"iana"},"audio/3gpp":{source:"iana",compressible:!1,extensions:["3gpp"]},"audio/3gpp2":{source:"iana"},"audio/aac":{source:"iana"},"audio/ac3":{source:"iana"},"audio/adpcm":{source:"apache",extensions:["adp"]},"audio/amr":{source:"iana",extensions:["amr"]},"audio/amr-wb":{source:"iana"},"audio/amr-wb+":{source:"iana"},"audio/aptx":{source:"iana"},"audio/asc":{source:"iana"},"audio/atrac-advanced-lossless":{source:"iana"},"audio/atrac-x":{source:"iana"},"audio/atrac3":{source:"iana"},"audio/basic":{source:"iana",compressible:!1,extensions:["au","snd"]},"audio/bv16":{source:"iana"},"audio/bv32":{source:"iana"},"audio/clearmode":{source:"iana"},"audio/cn":{source:"iana"},"audio/dat12":{source:"iana"},"audio/dls":{source:"iana"},"audio/dsr-es201108":{source:"iana"},"audio/dsr-es202050":{source:"iana"},"audio/dsr-es202211":{source:"iana"},"audio/dsr-es202212":{source:"iana"},"audio/dv":{source:"iana"},"audio/dvi4":{source:"iana"},"audio/eac3":{source:"iana"},"audio/encaprtp":{source:"iana"},"audio/evrc":{source:"iana"},"audio/evrc-qcp":{source:"iana"},"audio/evrc0":{source:"iana"},"audio/evrc1":{source:"iana"},"audio/evrcb":{source:"iana"},"audio/evrcb0":{source:"iana"},"audio/evrcb1":{source:"iana"},"audio/evrcnw":{source:"iana"},"audio/evrcnw0":{source:"iana"},"audio/evrcnw1":{source:"iana"},"audio/evrcwb":{source:"iana"},"audio/evrcwb0":{source:"iana"},"audio/evrcwb1":{source:"iana"},"audio/evs":{source:"iana"},"audio/flexfec":{source:"iana"},"audio/fwdred":{source:"iana"},"audio/g711-0":{source:"iana"},"audio/g719":{source:"iana"},"audio/g722":{source:"iana"},"audio/g7221":{source:"iana"},"audio/g723":{source:"iana"},"audio/g726-16":{source:"iana"},"audio/g726-24":{source:"iana"},"audio/g726-32":{source:"iana"},"audio/g726-40":{source:"iana"},"audio/g728":{source:"iana"},"audio/g729":{source:"iana"},"audio/g7291":{source:"iana"},"audio/g729d":{source:"iana"},"audio/g729e":{source:"iana"},"audio/gsm":{source:"iana"},"audio/gsm-efr":{source:"iana"},"audio/gsm-hr-08":{source:"iana"},"audio/ilbc":{source:"iana"},"audio/ip-mr_v2.5":{source:"iana"},"audio/isac":{source:"apache"},"audio/l16":{source:"iana"},"audio/l20":{source:"iana"},"audio/l24":{source:"iana",compressible:!1},"audio/l8":{source:"iana"},"audio/lpc":{source:"iana"},"audio/melp":{source:"iana"},"audio/melp1200":{source:"iana"},"audio/melp2400":{source:"iana"},"audio/melp600":{source:"iana"},"audio/mhas":{source:"iana"},"audio/midi":{source:"apache",extensions:["mid","midi","kar","rmi"]},"audio/mobile-xmf":{source:"iana",extensions:["mxmf"]},"audio/mp3":{compressible:!1,extensions:["mp3"]},"audio/mp4":{source:"iana",compressible:!1,extensions:["m4a","mp4a"]},"audio/mp4a-latm":{source:"iana"},"audio/mpa":{source:"iana"},"audio/mpa-robust":{source:"iana"},"audio/mpeg":{source:"iana",compressible:!1,extensions:["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{source:"iana"},"audio/musepack":{source:"apache"},"audio/ogg":{source:"iana",compressible:!1,extensions:["oga","ogg","spx","opus"]},"audio/opus":{source:"iana"},"audio/parityfec":{source:"iana"},"audio/pcma":{source:"iana"},"audio/pcma-wb":{source:"iana"},"audio/pcmu":{source:"iana"},"audio/pcmu-wb":{source:"iana"},"audio/prs.sid":{source:"iana"},"audio/qcelp":{source:"iana"},"audio/raptorfec":{source:"iana"},"audio/red":{source:"iana"},"audio/rtp-enc-aescm128":{source:"iana"},"audio/rtp-midi":{source:"iana"},"audio/rtploopback":{source:"iana"},"audio/rtx":{source:"iana"},"audio/s3m":{source:"apache",extensions:["s3m"]},"audio/scip":{source:"iana"},"audio/silk":{source:"apache",extensions:["sil"]},"audio/smv":{source:"iana"},"audio/smv-qcp":{source:"iana"},"audio/smv0":{source:"iana"},"audio/sofa":{source:"iana"},"audio/sp-midi":{source:"iana"},"audio/speex":{source:"iana"},"audio/t140c":{source:"iana"},"audio/t38":{source:"iana"},"audio/telephone-event":{source:"iana"},"audio/tetra_acelp":{source:"iana"},"audio/tetra_acelp_bb":{source:"iana"},"audio/tone":{source:"iana"},"audio/tsvcis":{source:"iana"},"audio/uemclip":{source:"iana"},"audio/ulpfec":{source:"iana"},"audio/usac":{source:"iana"},"audio/vdvi":{source:"iana"},"audio/vmr-wb":{source:"iana"},"audio/vnd.3gpp.iufp":{source:"iana"},"audio/vnd.4sb":{source:"iana"},"audio/vnd.audiokoz":{source:"iana"},"audio/vnd.celp":{source:"iana"},"audio/vnd.cisco.nse":{source:"iana"},"audio/vnd.cmles.radio-events":{source:"iana"},"audio/vnd.cns.anp1":{source:"iana"},"audio/vnd.cns.inf1":{source:"iana"},"audio/vnd.dece.audio":{source:"iana",extensions:["uva","uvva"]},"audio/vnd.digital-winds":{source:"iana",extensions:["eol"]},"audio/vnd.dlna.adts":{source:"iana"},"audio/vnd.dolby.heaac.1":{source:"iana"},"audio/vnd.dolby.heaac.2":{source:"iana"},"audio/vnd.dolby.mlp":{source:"iana"},"audio/vnd.dolby.mps":{source:"iana"},"audio/vnd.dolby.pl2":{source:"iana"},"audio/vnd.dolby.pl2x":{source:"iana"},"audio/vnd.dolby.pl2z":{source:"iana"},"audio/vnd.dolby.pulse.1":{source:"iana"},"audio/vnd.dra":{source:"iana",extensions:["dra"]},"audio/vnd.dts":{source:"iana",extensions:["dts"]},"audio/vnd.dts.hd":{source:"iana",extensions:["dtshd"]},"audio/vnd.dts.uhd":{source:"iana"},"audio/vnd.dvb.file":{source:"iana"},"audio/vnd.everad.plj":{source:"iana"},"audio/vnd.hns.audio":{source:"iana"},"audio/vnd.lucent.voice":{source:"iana",extensions:["lvp"]},"audio/vnd.ms-playready.media.pya":{source:"iana",extensions:["pya"]},"audio/vnd.nokia.mobile-xmf":{source:"iana"},"audio/vnd.nortel.vbk":{source:"iana"},"audio/vnd.nuera.ecelp4800":{source:"iana",extensions:["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{source:"iana",extensions:["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{source:"iana",extensions:["ecelp9600"]},"audio/vnd.octel.sbc":{source:"iana"},"audio/vnd.presonus.multitrack":{source:"iana"},"audio/vnd.qcelp":{source:"iana"},"audio/vnd.rhetorex.32kadpcm":{source:"iana"},"audio/vnd.rip":{source:"iana",extensions:["rip"]},"audio/vnd.rn-realaudio":{compressible:!1},"audio/vnd.sealedmedia.softseal.mpeg":{source:"iana"},"audio/vnd.vmx.cvsd":{source:"iana"},"audio/vnd.wave":{compressible:!1},"audio/vorbis":{source:"iana",compressible:!1},"audio/vorbis-config":{source:"iana"},"audio/wav":{compressible:!1,extensions:["wav"]},"audio/wave":{compressible:!1,extensions:["wav"]},"audio/webm":{source:"apache",compressible:!1,extensions:["weba"]},"audio/x-aac":{source:"apache",compressible:!1,extensions:["aac"]},"audio/x-aiff":{source:"apache",extensions:["aif","aiff","aifc"]},"audio/x-caf":{source:"apache",compressible:!1,extensions:["caf"]},"audio/x-flac":{source:"apache",extensions:["flac"]},"audio/x-m4a":{source:"nginx",extensions:["m4a"]},"audio/x-matroska":{source:"apache",extensions:["mka"]},"audio/x-mpegurl":{source:"apache",extensions:["m3u"]},"audio/x-ms-wax":{source:"apache",extensions:["wax"]},"audio/x-ms-wma":{source:"apache",extensions:["wma"]},"audio/x-pn-realaudio":{source:"apache",extensions:["ram","ra"]},"audio/x-pn-realaudio-plugin":{source:"apache",extensions:["rmp"]},"audio/x-realaudio":{source:"nginx",extensions:["ra"]},"audio/x-tta":{source:"apache"},"audio/x-wav":{source:"apache",extensions:["wav"]},"audio/xm":{source:"apache",extensions:["xm"]},"chemical/x-cdx":{source:"apache",extensions:["cdx"]},"chemical/x-cif":{source:"apache",extensions:["cif"]},"chemical/x-cmdf":{source:"apache",extensions:["cmdf"]},"chemical/x-cml":{source:"apache",extensions:["cml"]},"chemical/x-csml":{source:"apache",extensions:["csml"]},"chemical/x-pdb":{source:"apache"},"chemical/x-xyz":{source:"apache",extensions:["xyz"]},"font/collection":{source:"iana",extensions:["ttc"]},"font/otf":{source:"iana",compressible:!0,extensions:["otf"]},"font/sfnt":{source:"iana"},"font/ttf":{source:"iana",compressible:!0,extensions:["ttf"]},"font/woff":{source:"iana",extensions:["woff"]},"font/woff2":{source:"iana",extensions:["woff2"]},"image/aces":{source:"iana",extensions:["exr"]},"image/apng":{compressible:!1,extensions:["apng"]},"image/avci":{source:"iana",extensions:["avci"]},"image/avcs":{source:"iana",extensions:["avcs"]},"image/avif":{source:"iana",compressible:!1,extensions:["avif"]},"image/bmp":{source:"iana",compressible:!0,extensions:["bmp"]},"image/cgm":{source:"iana",extensions:["cgm"]},"image/dicom-rle":{source:"iana",extensions:["drle"]},"image/emf":{source:"iana",extensions:["emf"]},"image/fits":{source:"iana",extensions:["fits"]},"image/g3fax":{source:"iana",extensions:["g3"]},"image/gif":{source:"iana",compressible:!1,extensions:["gif"]},"image/heic":{source:"iana",extensions:["heic"]},"image/heic-sequence":{source:"iana",extensions:["heics"]},"image/heif":{source:"iana",extensions:["heif"]},"image/heif-sequence":{source:"iana",extensions:["heifs"]},"image/hej2k":{source:"iana",extensions:["hej2"]},"image/hsj2":{source:"iana",extensions:["hsj2"]},"image/ief":{source:"iana",extensions:["ief"]},"image/jls":{source:"iana",extensions:["jls"]},"image/jp2":{source:"iana",compressible:!1,extensions:["jp2","jpg2"]},"image/jpeg":{source:"iana",compressible:!1,extensions:["jpeg","jpg","jpe"]},"image/jph":{source:"iana",extensions:["jph"]},"image/jphc":{source:"iana",extensions:["jhc"]},"image/jpm":{source:"iana",compressible:!1,extensions:["jpm"]},"image/jpx":{source:"iana",compressible:!1,extensions:["jpx","jpf"]},"image/jxr":{source:"iana",extensions:["jxr"]},"image/jxra":{source:"iana",extensions:["jxra"]},"image/jxrs":{source:"iana",extensions:["jxrs"]},"image/jxs":{source:"iana",extensions:["jxs"]},"image/jxsc":{source:"iana",extensions:["jxsc"]},"image/jxsi":{source:"iana",extensions:["jxsi"]},"image/jxss":{source:"iana",extensions:["jxss"]},"image/ktx":{source:"iana",extensions:["ktx"]},"image/ktx2":{source:"iana",extensions:["ktx2"]},"image/naplps":{source:"iana"},"image/pjpeg":{compressible:!1},"image/png":{source:"iana",compressible:!1,extensions:["png"]},"image/prs.btif":{source:"iana",extensions:["btif"]},"image/prs.pti":{source:"iana",extensions:["pti"]},"image/pwg-raster":{source:"iana"},"image/sgi":{source:"apache",extensions:["sgi"]},"image/svg+xml":{source:"iana",compressible:!0,extensions:["svg","svgz"]},"image/t38":{source:"iana",extensions:["t38"]},"image/tiff":{source:"iana",compressible:!1,extensions:["tif","tiff"]},"image/tiff-fx":{source:"iana",extensions:["tfx"]},"image/vnd.adobe.photoshop":{source:"iana",compressible:!0,extensions:["psd"]},"image/vnd.airzip.accelerator.azv":{source:"iana",extensions:["azv"]},"image/vnd.cns.inf2":{source:"iana"},"image/vnd.dece.graphic":{source:"iana",extensions:["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{source:"iana",extensions:["djvu","djv"]},"image/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"image/vnd.dwg":{source:"iana",extensions:["dwg"]},"image/vnd.dxf":{source:"iana",extensions:["dxf"]},"image/vnd.fastbidsheet":{source:"iana",extensions:["fbs"]},"image/vnd.fpx":{source:"iana",extensions:["fpx"]},"image/vnd.fst":{source:"iana",extensions:["fst"]},"image/vnd.fujixerox.edmics-mmr":{source:"iana",extensions:["mmr"]},"image/vnd.fujixerox.edmics-rlc":{source:"iana",extensions:["rlc"]},"image/vnd.globalgraphics.pgb":{source:"iana"},"image/vnd.microsoft.icon":{source:"iana",compressible:!0,extensions:["ico"]},"image/vnd.mix":{source:"iana"},"image/vnd.mozilla.apng":{source:"iana"},"image/vnd.ms-dds":{compressible:!0,extensions:["dds"]},"image/vnd.ms-modi":{source:"iana",extensions:["mdi"]},"image/vnd.ms-photo":{source:"apache",extensions:["wdp"]},"image/vnd.net-fpx":{source:"iana",extensions:["npx"]},"image/vnd.pco.b16":{source:"iana",extensions:["b16"]},"image/vnd.radiance":{source:"iana"},"image/vnd.sealed.png":{source:"iana"},"image/vnd.sealedmedia.softseal.gif":{source:"iana"},"image/vnd.sealedmedia.softseal.jpg":{source:"iana"},"image/vnd.svf":{source:"iana"},"image/vnd.tencent.tap":{source:"iana",extensions:["tap"]},"image/vnd.valve.source.texture":{source:"iana",extensions:["vtf"]},"image/vnd.wap.wbmp":{source:"iana",extensions:["wbmp"]},"image/vnd.xiff":{source:"iana",extensions:["xif"]},"image/vnd.zbrush.pcx":{source:"iana",extensions:["pcx"]},"image/webp":{source:"apache",extensions:["webp"]},"image/wmf":{source:"iana",extensions:["wmf"]},"image/x-3ds":{source:"apache",extensions:["3ds"]},"image/x-cmu-raster":{source:"apache",extensions:["ras"]},"image/x-cmx":{source:"apache",extensions:["cmx"]},"image/x-freehand":{source:"apache",extensions:["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{source:"apache",compressible:!0,extensions:["ico"]},"image/x-jng":{source:"nginx",extensions:["jng"]},"image/x-mrsid-image":{source:"apache",extensions:["sid"]},"image/x-ms-bmp":{source:"nginx",compressible:!0,extensions:["bmp"]},"image/x-pcx":{source:"apache",extensions:["pcx"]},"image/x-pict":{source:"apache",extensions:["pic","pct"]},"image/x-portable-anymap":{source:"apache",extensions:["pnm"]},"image/x-portable-bitmap":{source:"apache",extensions:["pbm"]},"image/x-portable-graymap":{source:"apache",extensions:["pgm"]},"image/x-portable-pixmap":{source:"apache",extensions:["ppm"]},"image/x-rgb":{source:"apache",extensions:["rgb"]},"image/x-tga":{source:"apache",extensions:["tga"]},"image/x-xbitmap":{source:"apache",extensions:["xbm"]},"image/x-xcf":{compressible:!1},"image/x-xpixmap":{source:"apache",extensions:["xpm"]},"image/x-xwindowdump":{source:"apache",extensions:["xwd"]},"message/cpim":{source:"iana"},"message/delivery-status":{source:"iana"},"message/disposition-notification":{source:"iana",extensions:["disposition-notification"]},"message/external-body":{source:"iana"},"message/feedback-report":{source:"iana"},"message/global":{source:"iana",extensions:["u8msg"]},"message/global-delivery-status":{source:"iana",extensions:["u8dsn"]},"message/global-disposition-notification":{source:"iana",extensions:["u8mdn"]},"message/global-headers":{source:"iana",extensions:["u8hdr"]},"message/http":{source:"iana",compressible:!1},"message/imdn+xml":{source:"iana",compressible:!0},"message/news":{source:"iana"},"message/partial":{source:"iana",compressible:!1},"message/rfc822":{source:"iana",compressible:!0,extensions:["eml","mime"]},"message/s-http":{source:"iana"},"message/sip":{source:"iana"},"message/sipfrag":{source:"iana"},"message/tracking-status":{source:"iana"},"message/vnd.si.simp":{source:"iana"},"message/vnd.wfa.wsc":{source:"iana",extensions:["wsc"]},"model/3mf":{source:"iana",extensions:["3mf"]},"model/e57":{source:"iana"},"model/gltf+json":{source:"iana",compressible:!0,extensions:["gltf"]},"model/gltf-binary":{source:"iana",compressible:!0,extensions:["glb"]},"model/iges":{source:"iana",compressible:!1,extensions:["igs","iges"]},"model/mesh":{source:"iana",compressible:!1,extensions:["msh","mesh","silo"]},"model/mtl":{source:"iana",extensions:["mtl"]},"model/obj":{source:"iana",extensions:["obj"]},"model/step":{source:"iana"},"model/step+xml":{source:"iana",compressible:!0,extensions:["stpx"]},"model/step+zip":{source:"iana",compressible:!1,extensions:["stpz"]},"model/step-xml+zip":{source:"iana",compressible:!1,extensions:["stpxz"]},"model/stl":{source:"iana",extensions:["stl"]},"model/vnd.collada+xml":{source:"iana",compressible:!0,extensions:["dae"]},"model/vnd.dwf":{source:"iana",extensions:["dwf"]},"model/vnd.flatland.3dml":{source:"iana"},"model/vnd.gdl":{source:"iana",extensions:["gdl"]},"model/vnd.gs-gdl":{source:"apache"},"model/vnd.gs.gdl":{source:"iana"},"model/vnd.gtw":{source:"iana",extensions:["gtw"]},"model/vnd.moml+xml":{source:"iana",compressible:!0},"model/vnd.mts":{source:"iana",extensions:["mts"]},"model/vnd.opengex":{source:"iana",extensions:["ogex"]},"model/vnd.parasolid.transmit.binary":{source:"iana",extensions:["x_b"]},"model/vnd.parasolid.transmit.text":{source:"iana",extensions:["x_t"]},"model/vnd.pytha.pyox":{source:"iana"},"model/vnd.rosette.annotated-data-model":{source:"iana"},"model/vnd.sap.vds":{source:"iana",extensions:["vds"]},"model/vnd.usdz+zip":{source:"iana",compressible:!1,extensions:["usdz"]},"model/vnd.valve.source.compiled-map":{source:"iana",extensions:["bsp"]},"model/vnd.vtu":{source:"iana",extensions:["vtu"]},"model/vrml":{source:"iana",compressible:!1,extensions:["wrl","vrml"]},"model/x3d+binary":{source:"apache",compressible:!1,extensions:["x3db","x3dbz"]},"model/x3d+fastinfoset":{source:"iana",extensions:["x3db"]},"model/x3d+vrml":{source:"apache",compressible:!1,extensions:["x3dv","x3dvz"]},"model/x3d+xml":{source:"iana",compressible:!0,extensions:["x3d","x3dz"]},"model/x3d-vrml":{source:"iana",extensions:["x3dv"]},"multipart/alternative":{source:"iana",compressible:!1},"multipart/appledouble":{source:"iana"},"multipart/byteranges":{source:"iana"},"multipart/digest":{source:"iana"},"multipart/encrypted":{source:"iana",compressible:!1},"multipart/form-data":{source:"iana",compressible:!1},"multipart/header-set":{source:"iana"},"multipart/mixed":{source:"iana"},"multipart/multilingual":{source:"iana"},"multipart/parallel":{source:"iana"},"multipart/related":{source:"iana",compressible:!1},"multipart/report":{source:"iana"},"multipart/signed":{source:"iana",compressible:!1},"multipart/vnd.bint.med-plus":{source:"iana"},"multipart/voice-message":{source:"iana"},"multipart/x-mixed-replace":{source:"iana"},"text/1d-interleaved-parityfec":{source:"iana"},"text/cache-manifest":{source:"iana",compressible:!0,extensions:["appcache","manifest"]},"text/calendar":{source:"iana",extensions:["ics","ifb"]},"text/calender":{compressible:!0},"text/cmd":{compressible:!0},"text/coffeescript":{extensions:["coffee","litcoffee"]},"text/cql":{source:"iana"},"text/cql-expression":{source:"iana"},"text/cql-identifier":{source:"iana"},"text/css":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["css"]},"text/csv":{source:"iana",compressible:!0,extensions:["csv"]},"text/csv-schema":{source:"iana"},"text/directory":{source:"iana"},"text/dns":{source:"iana"},"text/ecmascript":{source:"iana"},"text/encaprtp":{source:"iana"},"text/enriched":{source:"iana"},"text/fhirpath":{source:"iana"},"text/flexfec":{source:"iana"},"text/fwdred":{source:"iana"},"text/gff3":{source:"iana"},"text/grammar-ref-list":{source:"iana"},"text/html":{source:"iana",compressible:!0,extensions:["html","htm","shtml"]},"text/jade":{extensions:["jade"]},"text/javascript":{source:"iana",compressible:!0},"text/jcr-cnd":{source:"iana"},"text/jsx":{compressible:!0,extensions:["jsx"]},"text/less":{compressible:!0,extensions:["less"]},"text/markdown":{source:"iana",compressible:!0,extensions:["markdown","md"]},"text/mathml":{source:"nginx",extensions:["mml"]},"text/mdx":{compressible:!0,extensions:["mdx"]},"text/mizar":{source:"iana"},"text/n3":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["n3"]},"text/parameters":{source:"iana",charset:"UTF-8"},"text/parityfec":{source:"iana"},"text/plain":{source:"iana",compressible:!0,extensions:["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{source:"iana",charset:"UTF-8"},"text/prs.fallenstein.rst":{source:"iana"},"text/prs.lines.tag":{source:"iana",extensions:["dsc"]},"text/prs.prop.logic":{source:"iana"},"text/raptorfec":{source:"iana"},"text/red":{source:"iana"},"text/rfc822-headers":{source:"iana"},"text/richtext":{source:"iana",compressible:!0,extensions:["rtx"]},"text/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"text/rtp-enc-aescm128":{source:"iana"},"text/rtploopback":{source:"iana"},"text/rtx":{source:"iana"},"text/sgml":{source:"iana",extensions:["sgml","sgm"]},"text/shaclc":{source:"iana"},"text/shex":{source:"iana",extensions:["shex"]},"text/slim":{extensions:["slim","slm"]},"text/spdx":{source:"iana",extensions:["spdx"]},"text/strings":{source:"iana"},"text/stylus":{extensions:["stylus","styl"]},"text/t140":{source:"iana"},"text/tab-separated-values":{source:"iana",compressible:!0,extensions:["tsv"]},"text/troff":{source:"iana",extensions:["t","tr","roff","man","me","ms"]},"text/turtle":{source:"iana",charset:"UTF-8",extensions:["ttl"]},"text/ulpfec":{source:"iana"},"text/uri-list":{source:"iana",compressible:!0,extensions:["uri","uris","urls"]},"text/vcard":{source:"iana",compressible:!0,extensions:["vcard"]},"text/vnd.a":{source:"iana"},"text/vnd.abc":{source:"iana"},"text/vnd.ascii-art":{source:"iana"},"text/vnd.curl":{source:"iana",extensions:["curl"]},"text/vnd.curl.dcurl":{source:"apache",extensions:["dcurl"]},"text/vnd.curl.mcurl":{source:"apache",extensions:["mcurl"]},"text/vnd.curl.scurl":{source:"apache",extensions:["scurl"]},"text/vnd.debian.copyright":{source:"iana",charset:"UTF-8"},"text/vnd.dmclientscript":{source:"iana"},"text/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"text/vnd.esmertec.theme-descriptor":{source:"iana",charset:"UTF-8"},"text/vnd.familysearch.gedcom":{source:"iana",extensions:["ged"]},"text/vnd.ficlab.flt":{source:"iana"},"text/vnd.fly":{source:"iana",extensions:["fly"]},"text/vnd.fmi.flexstor":{source:"iana",extensions:["flx"]},"text/vnd.gml":{source:"iana"},"text/vnd.graphviz":{source:"iana",extensions:["gv"]},"text/vnd.hans":{source:"iana"},"text/vnd.hgl":{source:"iana"},"text/vnd.in3d.3dml":{source:"iana",extensions:["3dml"]},"text/vnd.in3d.spot":{source:"iana",extensions:["spot"]},"text/vnd.iptc.newsml":{source:"iana"},"text/vnd.iptc.nitf":{source:"iana"},"text/vnd.latex-z":{source:"iana"},"text/vnd.motorola.reflex":{source:"iana"},"text/vnd.ms-mediapackage":{source:"iana"},"text/vnd.net2phone.commcenter.command":{source:"iana"},"text/vnd.radisys.msml-basic-layout":{source:"iana"},"text/vnd.senx.warpscript":{source:"iana"},"text/vnd.si.uricatalogue":{source:"iana"},"text/vnd.sosi":{source:"iana"},"text/vnd.sun.j2me.app-descriptor":{source:"iana",charset:"UTF-8",extensions:["jad"]},"text/vnd.trolltech.linguist":{source:"iana",charset:"UTF-8"},"text/vnd.wap.si":{source:"iana"},"text/vnd.wap.sl":{source:"iana"},"text/vnd.wap.wml":{source:"iana",extensions:["wml"]},"text/vnd.wap.wmlscript":{source:"iana",extensions:["wmls"]},"text/vtt":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["vtt"]},"text/x-asm":{source:"apache",extensions:["s","asm"]},"text/x-c":{source:"apache",extensions:["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{source:"nginx",extensions:["htc"]},"text/x-fortran":{source:"apache",extensions:["f","for","f77","f90"]},"text/x-gwt-rpc":{compressible:!0},"text/x-handlebars-template":{extensions:["hbs"]},"text/x-java-source":{source:"apache",extensions:["java"]},"text/x-jquery-tmpl":{compressible:!0},"text/x-lua":{extensions:["lua"]},"text/x-markdown":{compressible:!0,extensions:["mkd"]},"text/x-nfo":{source:"apache",extensions:["nfo"]},"text/x-opml":{source:"apache",extensions:["opml"]},"text/x-org":{compressible:!0,extensions:["org"]},"text/x-pascal":{source:"apache",extensions:["p","pas"]},"text/x-processing":{compressible:!0,extensions:["pde"]},"text/x-sass":{extensions:["sass"]},"text/x-scss":{extensions:["scss"]},"text/x-setext":{source:"apache",extensions:["etx"]},"text/x-sfv":{source:"apache",extensions:["sfv"]},"text/x-suse-ymp":{compressible:!0,extensions:["ymp"]},"text/x-uuencode":{source:"apache",extensions:["uu"]},"text/x-vcalendar":{source:"apache",extensions:["vcs"]},"text/x-vcard":{source:"apache",extensions:["vcf"]},"text/xml":{source:"iana",compressible:!0,extensions:["xml"]},"text/xml-external-parsed-entity":{source:"iana"},"text/yaml":{compressible:!0,extensions:["yaml","yml"]},"video/1d-interleaved-parityfec":{source:"iana"},"video/3gpp":{source:"iana",extensions:["3gp","3gpp"]},"video/3gpp-tt":{source:"iana"},"video/3gpp2":{source:"iana",extensions:["3g2"]},"video/av1":{source:"iana"},"video/bmpeg":{source:"iana"},"video/bt656":{source:"iana"},"video/celb":{source:"iana"},"video/dv":{source:"iana"},"video/encaprtp":{source:"iana"},"video/ffv1":{source:"iana"},"video/flexfec":{source:"iana"},"video/h261":{source:"iana",extensions:["h261"]},"video/h263":{source:"iana",extensions:["h263"]},"video/h263-1998":{source:"iana"},"video/h263-2000":{source:"iana"},"video/h264":{source:"iana",extensions:["h264"]},"video/h264-rcdo":{source:"iana"},"video/h264-svc":{source:"iana"},"video/h265":{source:"iana"},"video/iso.segment":{source:"iana",extensions:["m4s"]},"video/jpeg":{source:"iana",extensions:["jpgv"]},"video/jpeg2000":{source:"iana"},"video/jpm":{source:"apache",extensions:["jpm","jpgm"]},"video/jxsv":{source:"iana"},"video/mj2":{source:"iana",extensions:["mj2","mjp2"]},"video/mp1s":{source:"iana"},"video/mp2p":{source:"iana"},"video/mp2t":{source:"iana",extensions:["ts"]},"video/mp4":{source:"iana",compressible:!1,extensions:["mp4","mp4v","mpg4"]},"video/mp4v-es":{source:"iana"},"video/mpeg":{source:"iana",compressible:!1,extensions:["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{source:"iana"},"video/mpv":{source:"iana"},"video/nv":{source:"iana"},"video/ogg":{source:"iana",compressible:!1,extensions:["ogv"]},"video/parityfec":{source:"iana"},"video/pointer":{source:"iana"},"video/quicktime":{source:"iana",compressible:!1,extensions:["qt","mov"]},"video/raptorfec":{source:"iana"},"video/raw":{source:"iana"},"video/rtp-enc-aescm128":{source:"iana"},"video/rtploopback":{source:"iana"},"video/rtx":{source:"iana"},"video/scip":{source:"iana"},"video/smpte291":{source:"iana"},"video/smpte292m":{source:"iana"},"video/ulpfec":{source:"iana"},"video/vc1":{source:"iana"},"video/vc2":{source:"iana"},"video/vnd.cctv":{source:"iana"},"video/vnd.dece.hd":{source:"iana",extensions:["uvh","uvvh"]},"video/vnd.dece.mobile":{source:"iana",extensions:["uvm","uvvm"]},"video/vnd.dece.mp4":{source:"iana"},"video/vnd.dece.pd":{source:"iana",extensions:["uvp","uvvp"]},"video/vnd.dece.sd":{source:"iana",extensions:["uvs","uvvs"]},"video/vnd.dece.video":{source:"iana",extensions:["uvv","uvvv"]},"video/vnd.directv.mpeg":{source:"iana"},"video/vnd.directv.mpeg-tts":{source:"iana"},"video/vnd.dlna.mpeg-tts":{source:"iana"},"video/vnd.dvb.file":{source:"iana",extensions:["dvb"]},"video/vnd.fvt":{source:"iana",extensions:["fvt"]},"video/vnd.hns.video":{source:"iana"},"video/vnd.iptvforum.1dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.1dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.2dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.2dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.ttsavc":{source:"iana"},"video/vnd.iptvforum.ttsmpeg2":{source:"iana"},"video/vnd.motorola.video":{source:"iana"},"video/vnd.motorola.videop":{source:"iana"},"video/vnd.mpegurl":{source:"iana",extensions:["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{source:"iana",extensions:["pyv"]},"video/vnd.nokia.interleaved-multimedia":{source:"iana"},"video/vnd.nokia.mp4vr":{source:"iana"},"video/vnd.nokia.videovoip":{source:"iana"},"video/vnd.objectvideo":{source:"iana"},"video/vnd.radgamettools.bink":{source:"iana"},"video/vnd.radgamettools.smacker":{source:"iana"},"video/vnd.sealed.mpeg1":{source:"iana"},"video/vnd.sealed.mpeg4":{source:"iana"},"video/vnd.sealed.swf":{source:"iana"},"video/vnd.sealedmedia.softseal.mov":{source:"iana"},"video/vnd.uvvu.mp4":{source:"iana",extensions:["uvu","uvvu"]},"video/vnd.vivo":{source:"iana",extensions:["viv"]},"video/vnd.youtube.yt":{source:"iana"},"video/vp8":{source:"iana"},"video/vp9":{source:"iana"},"video/webm":{source:"apache",compressible:!1,extensions:["webm"]},"video/x-f4v":{source:"apache",extensions:["f4v"]},"video/x-fli":{source:"apache",extensions:["fli"]},"video/x-flv":{source:"apache",compressible:!1,extensions:["flv"]},"video/x-m4v":{source:"apache",extensions:["m4v"]},"video/x-matroska":{source:"apache",compressible:!1,extensions:["mkv","mk3d","mks"]},"video/x-mng":{source:"apache",extensions:["mng"]},"video/x-ms-asf":{source:"apache",extensions:["asf","asx"]},"video/x-ms-vob":{source:"apache",extensions:["vob"]},"video/x-ms-wm":{source:"apache",extensions:["wm"]},"video/x-ms-wmv":{source:"apache",compressible:!1,extensions:["wmv"]},"video/x-ms-wmx":{source:"apache",extensions:["wmx"]},"video/x-ms-wvx":{source:"apache",extensions:["wvx"]},"video/x-msvideo":{source:"apache",extensions:["avi"]},"video/x-sgi-movie":{source:"apache",extensions:["movie"]},"video/x-smv":{source:"apache",extensions:["smv"]},"x-conference/x-cooltalk":{source:"apache",extensions:["ice"]},"x-shader/x-fragment":{compressible:!0},"x-shader/x-vertex":{compressible:!0}};({get exports(){return Hf},set exports(e){Hf=e}}).exports=Wf,
99
99
  /*!
100
100
  * mime-types
101
101
  * Copyright(c) 2014 Jonathan Ong
102
102
  * Copyright(c) 2015 Douglas Christopher Wilson
103
103
  * MIT Licensed
104
104
  */
105
- function(e){var t=Hf,n=f.extname,i=/^\s*([^;\s]*)(?:;|\s|$)/,s=/^text\//i;function r(e){if(!e||"string"!=typeof e)return!1;var n=i.exec(e),r=n&&t[n[1].toLowerCase()];return r&&r.charset?r.charset:!(!n||!s.test(n[1]))&&"UTF-8"}e.charset=r,e.charsets={lookup:r},e.contentType=function(t){if(!t||"string"!=typeof t)return!1;var n=-1===t.indexOf("/")?e.lookup(t):t;if(!n)return!1;if(-1===n.indexOf("charset")){var i=e.charset(n);i&&(n+="; charset="+i.toLowerCase())}return n},e.extension=function(t){if(!t||"string"!=typeof t)return!1;var n=i.exec(t),s=n&&e.extensions[n[1].toLowerCase()];if(!s||!s.length)return!1;return s[0]},e.extensions=Object.create(null),e.lookup=function(t){if(!t||"string"!=typeof t)return!1;var i=n("x."+t).toLowerCase().substr(1);if(!i)return!1;return e.types[i]||!1},e.types=Object.create(null),function(e,n){var i=["nginx","apache",void 0,"iana"];Object.keys(t).forEach((function(s){var r=t[s],a=r.extensions;if(a&&a.length){e[s]=a;for(var o=0;o<a.length;o++){var c=a[o];if(n[c]){var p=i.indexOf(t[n[c]].source),d=i.indexOf(r.source);if("application/octet-stream"!==n[c]&&(p>d||p===d&&"application/"===n[c].substr(0,12)))continue}n[c]=s}}}))}(e.extensions,e.types)}(Vf);var Gf=function(e){var t="function"==typeof setImmediate?setImmediate:"object"==typeof process&&"function"==typeof process.nextTick?process.nextTick:null;t?t(e):setTimeout(e,0)},Kf=function(e){var t=!1;return Gf((function(){t=!0})),function(n,i){t?e(n,i):Gf((function(){e(n,i)}))}};var Jf=function(e){Object.keys(e.jobs).forEach(Qf.bind(e)),e.jobs={}};function Qf(e){"function"==typeof this.jobs[e]&&this.jobs[e]()}var Yf=Kf,Xf=Jf,Zf=function(e,t,n,i){var s=n.keyedList?n.keyedList[n.index]:n.index;n.jobs[s]=function(e,t,n,i){var s;s=2==e.length?e(n,Yf(i)):e(n,t,Yf(i));return s}(t,s,e[s],(function(e,t){s in n.jobs&&(delete n.jobs[s],e?Xf(n):n.results[s]=t,i(e,n.results))}))};var eg=function(e,t){var n=!Array.isArray(e),i={index:0,keyedList:n||t?Object.keys(e):null,jobs:{},results:n?{}:[],size:n?Object.keys(e).length:e.length};t&&i.keyedList.sort(n?t:function(n,i){return t(e[n],e[i])});return i};var tg=Jf,ng=Kf,ig=function(e){if(!Object.keys(this.jobs).length)return;this.index=this.size,tg(this),ng(e)(null,this.results)};var sg=Zf,rg=eg,ag=ig,og=function(e,t,n){var i=rg(e);for(;i.index<(i.keyedList||e).length;)sg(e,t,i,(function(e,t){e?n(e,t):0!==Object.keys(i.jobs).length||n(null,i.results)})),i.index++;return ag.bind(i,n)};var cg={},pg=Zf,dg=eg,lg=ig;function ug(e,t){return e<t?-1:e>t?1:0}({get exports(){return cg},set exports(e){cg=e}}).exports=function(e,t,n,i){var s=dg(e,n);return pg(e,t,s,(function n(r,a){r?i(r,a):(s.index++,s.index<(s.keyedList||e).length?pg(e,t,s,n):i(null,s.results))})),lg.bind(s,i)},cg.ascending=ug,cg.descending=function(e,t){return-1*ug(e,t)};var mg=cg;var hg={parallel:og,serial:function(e,t,n){return mg(e,t,null,n)},serialOrdered:cg},fg=qf,gg=t,vg=f,bg=a,yg=o,_g=s.parse,xg=n,wg=p.Stream,Sg=Vf,kg=hg,Cg=function(e,t){return Object.keys(t).forEach((function(n){e[n]=e[n]||t[n]})),e},Rg=Tg;function Tg(e){if(!(this instanceof Tg))return new Tg(e);for(var t in this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],fg.call(this),e=e||{})this[t]=e[t]}function Pg(e){return jf.isPlainObject(e)||jf.isArray(e)}function Eg(e){return jf.endsWith(e,"[]")?e.slice(0,-2):e}function Og(e,t,n){return e?e.concat(t).map((function(e,t){return e=Eg(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}gg.inherits(Tg,fg),Tg.LINE_BREAK="\r\n",Tg.DEFAULT_CONTENT_TYPE="application/octet-stream",Tg.prototype.append=function(e,t,n){"string"==typeof(n=n||{})&&(n={filename:n});var i=fg.prototype.append.bind(this);if("number"==typeof t&&(t=""+t),gg.isArray(t))this._error(new Error("Arrays are not supported."));else{var s=this._multiPartHeader(e,t,n),r=this._multiPartFooter();i(s),i(t),i(r),this._trackLength(s,t,n)}},Tg.prototype._trackLength=function(e,t,n){var i=0;null!=n.knownLength?i+=+n.knownLength:Buffer.isBuffer(t)?i=t.length:"string"==typeof t&&(i=Buffer.byteLength(t)),this._valueLength+=i,this._overheadLength+=Buffer.byteLength(e)+Tg.LINE_BREAK.length,t&&(t.path||t.readable&&t.hasOwnProperty("httpVersion")||t instanceof wg)&&(n.knownLength||this._valuesToMeasure.push(t))},Tg.prototype._lengthRetriever=function(e,t){e.hasOwnProperty("fd")?null!=e.end&&e.end!=1/0&&null!=e.start?t(null,e.end+1-(e.start?e.start:0)):xg.stat(e.path,(function(n,i){var s;n?t(n):(s=i.size-(e.start?e.start:0),t(null,s))})):e.hasOwnProperty("httpVersion")?t(null,+e.headers["content-length"]):e.hasOwnProperty("httpModule")?(e.on("response",(function(n){e.pause(),t(null,+n.headers["content-length"])})),e.resume()):t("Unknown stream")},Tg.prototype._multiPartHeader=function(e,t,n){if("string"==typeof n.header)return n.header;var i,s=this._getContentDisposition(t,n),r=this._getContentType(t,n),a="",o={"Content-Disposition":["form-data",'name="'+e+'"'].concat(s||[]),"Content-Type":[].concat(r||[])};for(var c in"object"==typeof n.header&&Cg(o,n.header),o)o.hasOwnProperty(c)&&null!=(i=o[c])&&(Array.isArray(i)||(i=[i]),i.length&&(a+=c+": "+i.join("; ")+Tg.LINE_BREAK));return"--"+this.getBoundary()+Tg.LINE_BREAK+a+Tg.LINE_BREAK},Tg.prototype._getContentDisposition=function(e,t){var n,i;return"string"==typeof t.filepath?n=vg.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e.name||e.path?n=vg.basename(t.filename||e.name||e.path):e.readable&&e.hasOwnProperty("httpVersion")&&(n=vg.basename(e.client._httpMessage.path||"")),n&&(i='filename="'+n+'"'),i},Tg.prototype._getContentType=function(e,t){var n=t.contentType;return!n&&e.name&&(n=Sg.lookup(e.name)),!n&&e.path&&(n=Sg.lookup(e.path)),!n&&e.readable&&e.hasOwnProperty("httpVersion")&&(n=e.headers["content-type"]),n||!t.filepath&&!t.filename||(n=Sg.lookup(t.filepath||t.filename)),n||"object"!=typeof e||(n=Tg.DEFAULT_CONTENT_TYPE),n},Tg.prototype._multiPartFooter=function(){return function(e){var t=Tg.LINE_BREAK;0===this._streams.length&&(t+=this._lastBoundary()),e(t)}.bind(this)},Tg.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+Tg.LINE_BREAK},Tg.prototype.getHeaders=function(e){var t,n={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)e.hasOwnProperty(t)&&(n[t.toLowerCase()]=e[t]);return n},Tg.prototype.setBoundary=function(e){this._boundary=e},Tg.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary},Tg.prototype.getBuffer=function(){for(var e=new Buffer.alloc(0),t=this.getBoundary(),n=0,i=this._streams.length;n<i;n++)"function"!=typeof this._streams[n]&&(e=Buffer.isBuffer(this._streams[n])?Buffer.concat([e,this._streams[n]]):Buffer.concat([e,Buffer.from(this._streams[n])]),"string"==typeof this._streams[n]&&this._streams[n].substring(2,t.length+2)===t||(e=Buffer.concat([e,Buffer.from(Tg.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])},Tg.prototype._generateBoundary=function(){for(var e="--------------------------",t=0;t<24;t++)e+=Math.floor(10*Math.random()).toString(16);this._boundary=e},Tg.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;return this._streams.length&&(e+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),e},Tg.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e},Tg.prototype.getLength=function(e){var t=this._overheadLength+this._valueLength;this._streams.length&&(t+=this._lastBoundary().length),this._valuesToMeasure.length?kg.parallel(this._valuesToMeasure,this._lengthRetriever,(function(n,i){n?e(n):(i.forEach((function(e){t+=e})),e(null,t))})):process.nextTick(e.bind(this,null,t))},Tg.prototype.submit=function(e,t){var n,i,s={method:"post"};return"string"==typeof e?(e=_g(e),i=Cg({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},s)):(i=Cg(e,s)).port||(i.port="https:"==i.protocol?443:80),i.headers=this.getHeaders(e.headers),n="https:"==i.protocol?yg.request(i):bg.request(i),this.getLength(function(e,i){if(e&&"Unknown stream"!==e)this._error(e);else if(i&&n.setHeader("Content-Length",i),this.pipe(n),t){var s,r=function(e,i){return n.removeListener("error",r),n.removeListener("response",s),t.call(this,e,i)};s=r.bind(this,null),n.on("error",r),n.on("response",s)}}.bind(this)),n},Tg.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))},Tg.prototype.toString=function(){return"[object FormData]"};const Dg=jf.toFlatObject(jf,{},null,(function(e){return/^is[A-Z]/.test(e)}));function jg(e,t,n){if(!jf.isObject(e))throw new TypeError("target must be an object");t=t||new(Rg||FormData);const i=(n=jf.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!jf.isUndefined(t[e])}))).metaTokens,s=n.visitor||d,r=n.dots,a=n.indexes,o=(n.Blob||"undefined"!=typeof Blob&&Blob)&&((c=t)&&jf.isFunction(c.append)&&"FormData"===c[Symbol.toStringTag]&&c[Symbol.iterator]);var c;if(!jf.isFunction(s))throw new TypeError("visitor must be a function");function p(e){if(null===e)return"";if(jf.isDate(e))return e.toISOString();if(!o&&jf.isBlob(e))throw new If("Blob is not supported. Use a Buffer instead.");return jf.isArrayBuffer(e)||jf.isTypedArray(e)?o&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function d(e,n,s){let o=e;if(e&&!s&&"object"==typeof e)if(jf.endsWith(n,"{}"))n=i?n:n.slice(0,-2),e=JSON.stringify(e);else if(jf.isArray(e)&&function(e){return jf.isArray(e)&&!e.some(Pg)}(e)||jf.isFileList(e)||jf.endsWith(n,"[]")&&(o=jf.toArray(e)))return n=Eg(n),o.forEach((function(e,i){!jf.isUndefined(e)&&null!==e&&t.append(!0===a?Og([n],i,r):null===a?n:n+"[]",p(e))})),!1;return!!Pg(e)||(t.append(Og(s,n,r),p(e)),!1)}const l=[],u=Object.assign(Dg,{defaultVisitor:d,convertValue:p,isVisitable:Pg});if(!jf.isObject(e))throw new TypeError("data must be an object");return function e(n,i){if(!jf.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+i.join("."));l.push(n),jf.forEach(n,(function(n,r){!0===(!(jf.isUndefined(n)||null===n)&&s.call(t,n,jf.isString(r)?r.trim():r,i,u))&&e(n,i?i.concat(r):[r])})),l.pop()}}(e),t}function Ig(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function Mg(e,t){this._pairs=[],e&&jg(e,this,t)}const Lg=Mg.prototype;function Ag(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Ng(e,t,n){if(!t)return e;const i=n&&n.encode||Ag,s=n&&n.serialize;let r;if(r=s?s(t,n):jf.isURLSearchParams(t)?t.toString():new Mg(t,n).toString(i),r){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+r}return e}Lg.append=function(e,t){this._pairs.push([e,t])},Lg.toString=function(e){const t=e?function(t){return e.call(this,t,Ig)}:Ig;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};class Bg{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){jf.forEach(this.handlers,(function(t){null!==t&&e(t)}))}}var Fg={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Ug={isNode:!0,classes:{URLSearchParams:s.URLSearchParams,FormData:Rg,Blob:"undefined"!=typeof Blob&&Blob||null},protocols:["http","https","file","data"]};function zg(e){function t(e,n,i,s){let r=e[s++];const a=Number.isFinite(+r),o=s>=e.length;if(r=!r&&jf.isArray(i)?i.length:r,o)return jf.hasOwnProp(i,r)?i[r]=[i[r],n]:i[r]=n,!a;i[r]&&jf.isObject(i[r])||(i[r]=[]);return t(e,n,i[r],s)&&jf.isArray(i[r])&&(i[r]=function(e){const t={},n=Object.keys(e);let i;const s=n.length;let r;for(i=0;i<s;i++)r=n[i],t[r]=e[r];return t}(i[r])),!a}if(jf.isFormData(e)&&jf.isFunction(e.entries)){const n={};return jf.forEachEntry(e,((e,i)=>{t(function(e){return jf.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),i,n,0)})),n}return null}const qg={"Content-Type":void 0};const $g={transitional:Fg,adapter:["xhr","http"],transformRequest:[function(e,t){const n=t.getContentType()||"",i=n.indexOf("application/json")>-1,s=jf.isObject(e);s&&jf.isHTMLForm(e)&&(e=new FormData(e));if(jf.isFormData(e))return i&&i?JSON.stringify(zg(e)):e;if(jf.isArrayBuffer(e)||jf.isBuffer(e)||jf.isStream(e)||jf.isFile(e)||jf.isBlob(e))return e;if(jf.isArrayBufferView(e))return e.buffer;if(jf.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let r;if(s){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return jg(e,new Ug.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,i){return jf.isBuffer(e)?(this.append(t,e.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((r=jf.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return jg(r?{"files[]":e}:e,t&&new t,this.formSerializer)}}return s||i?(t.setContentType("application/json",!1),function(e,t,n){if(jf.isString(e))try{return(t||JSON.parse)(e),jf.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||$g.transitional,n=t&&t.forcedJSONParsing,i="json"===this.responseType;if(e&&jf.isString(e)&&(n&&!this.responseType||i)){const n=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw If.from(e,If.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ug.classes.FormData,Blob:Ug.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};jf.forEach(["delete","get","head"],(function(e){$g.headers[e]={}})),jf.forEach(["post","put","patch"],(function(e){$g.headers[e]=jf.merge(qg)}));const Vg=jf.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const Hg=Symbol("internals");function Wg(e){return e&&String(e).trim().toLowerCase()}function Gg(e){return!1===e||null==e?e:jf.isArray(e)?e.map(Gg):String(e)}function Kg(e,t,n,i){return jf.isFunction(i)?i.call(this,t,n):jf.isString(t)?jf.isString(i)?-1!==t.indexOf(i):jf.isRegExp(i)?i.test(t):void 0:void 0}class Jg{constructor(e){e&&this.set(e)}set(e,t,n){const i=this;function s(e,t,n){const s=Wg(t);if(!s)throw new Error("header name must be a non-empty string");const r=jf.findKey(i,s);(!r||void 0===i[r]||!0===n||void 0===n&&!1!==i[r])&&(i[r||t]=Gg(e))}const r=(e,t)=>jf.forEach(e,((e,n)=>s(e,n,t)));return jf.isPlainObject(e)||e instanceof this.constructor?r(e,t):jf.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z]+$/.test(e.trim())?r((e=>{const t={};let n,i,s;return e&&e.split("\n").forEach((function(e){s=e.indexOf(":"),n=e.substring(0,s).trim().toLowerCase(),i=e.substring(s+1).trim(),!n||t[n]&&Vg[n]||("set-cookie"===n?t[n]?t[n].push(i):t[n]=[i]:t[n]=t[n]?t[n]+", "+i:i)})),t})(e),t):null!=e&&s(t,e,n),this}get(e,t){if(e=Wg(e)){const n=jf.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let i;for(;i=n.exec(e);)t[i[1]]=i[2];return t}(e);if(jf.isFunction(t))return t.call(this,e,n);if(jf.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Wg(e)){const n=jf.findKey(this,e);return!(!n||t&&!Kg(0,this[n],n,t))}return!1}delete(e,t){const n=this;let i=!1;function s(e){if(e=Wg(e)){const s=jf.findKey(n,e);!s||t&&!Kg(0,n[s],s,t)||(delete n[s],i=!0)}}return jf.isArray(e)?e.forEach(s):s(e),i}clear(){return Object.keys(this).forEach(this.delete.bind(this))}normalize(e){const t=this,n={};return jf.forEach(this,((i,s)=>{const r=jf.findKey(n,s);if(r)return t[r]=Gg(i),void delete t[s];const a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(s):String(s).trim();a!==s&&delete t[s],t[a]=Gg(i),n[a]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return jf.forEach(this,((n,i)=>{null!=n&&!1!==n&&(t[i]=e&&jf.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[Hg]=this[Hg]={accessors:{}}).accessors,n=this.prototype;function i(e){const i=Wg(e);t[i]||(!function(e,t){const n=jf.toCamelCase(" "+t);["get","set","has"].forEach((i=>{Object.defineProperty(e,i+n,{value:function(e,n,s){return this[i].call(this,t,e,n,s)},configurable:!0})}))}(n,e),t[i]=!0)}return jf.isArray(e)?e.forEach(i):i(e),this}}function Qg(e,t){const n=this||$g,i=t||n,s=Jg.from(i.headers);let r=i.data;return jf.forEach(e,(function(e){r=e.call(n,r,s.normalize(),t?t.status:void 0)})),s.normalize(),r}function Yg(e){return!(!e||!e.__CANCEL__)}function Xg(e,t,n){If.call(this,null==e?"canceled":e,If.ERR_CANCELED,t,n),this.name="CanceledError"}function Zg(e,t,n){const i=n.config.validateStatus;n.status&&i&&!i(n.status)?t(new If("Request failed with status code "+n.status,[If.ERR_BAD_REQUEST,If.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}function ev(e,t){return e&&!function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}(t)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}Jg.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent"]),jf.freezeMethods(Jg.prototype),jf.freezeMethods(Jg),jf.inherits(Xg,If,{__CANCEL__:!0});var tv=s.parse,nv={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443},iv=String.prototype.endsWith||function(e){return e.length<=this.length&&-1!==this.indexOf(e,this.length-e.length)};function sv(e){return process.env[e.toLowerCase()]||process.env[e.toUpperCase()]||""}var rv,av=function(e){var t="string"==typeof e?tv(e):e||{},n=t.protocol,i=t.host,s=t.port;if("string"!=typeof i||!i||"string"!=typeof n)return"";if(n=n.split(":",1)[0],!function(e,t){var n=(sv("npm_config_no_proxy")||sv("no_proxy")).toLowerCase();if(!n)return!0;if("*"===n)return!1;return n.split(/[,\s]/).every((function(n){if(!n)return!0;var i=n.match(/^(.+):(\d+)$/),s=i?i[1]:n,r=i?parseInt(i[2]):0;return!(!r||r===t)||(/^[.*]/.test(s)?("*"===s.charAt(0)&&(s=s.slice(1)),!iv.call(e,s)):e!==s)}))}(i=i.replace(/:\d*$/,""),s=parseInt(s)||nv[n]||0))return"";var r=sv("npm_config_"+n+"_proxy")||sv(n+"_proxy")||sv("npm_config_proxy")||sv("all_proxy");return r&&-1===r.indexOf("://")&&(r=n+"://"+r),r},ov={},cv={get exports(){return ov},set exports(e){ov=e}},pv=s,dv=pv.URL,lv=a,uv=o,mv=p.Writable,hv=m,fv=function(){if(!rv){try{rv=gc("follow-redirects")}catch(e){}"function"!=typeof rv&&(rv=function(){})}rv.apply(null,arguments)},gv=["abort","aborted","connect","error","socket","timeout"],vv=Object.create(null);gv.forEach((function(e){vv[e]=function(t,n,i){this._redirectable.emit(e,t,n,i)}}));var bv=Pv("ERR_INVALID_URL","Invalid URL",TypeError),yv=Pv("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),_v=Pv("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded"),xv=Pv("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),wv=Pv("ERR_STREAM_WRITE_AFTER_END","write after end");function Sv(e,t){mv.call(this),this._sanitizeOptions(e),this._options=e,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],t&&this.on("response",t);var n=this;this._onNativeResponse=function(e){n._processResponse(e)},this._performRequest()}function kv(e){var t={maxRedirects:21,maxBodyLength:10485760},n={};return Object.keys(e).forEach((function(i){var s=i+":",r=n[s]=e[i],a=t[i]=Object.create(r);Object.defineProperties(a,{request:{value:function(e,i,r){if(Ov(e)){var a;try{a=Rv(new dv(e))}catch(t){a=pv.parse(e)}if(!Ov(a.protocol))throw new bv({input:e});e=a}else dv&&e instanceof dv?e=Rv(e):(r=i,i=e,e={protocol:s});return Dv(i)&&(r=i,i=null),(i=Object.assign({maxRedirects:t.maxRedirects,maxBodyLength:t.maxBodyLength},e,i)).nativeProtocols=n,Ov(i.host)||Ov(i.hostname)||(i.hostname="::1"),hv.equal(i.protocol,s,"protocol mismatch"),fv("options",i),new Sv(i,r)},configurable:!0,enumerable:!0,writable:!0},get:{value:function(e,t,n){var i=a.request(e,t,n);return i.end(),i},configurable:!0,enumerable:!0,writable:!0}})})),t}function Cv(){}function Rv(e){var t={protocol:e.protocol,hostname:e.hostname.startsWith("[")?e.hostname.slice(1,-1):e.hostname,hash:e.hash,search:e.search,pathname:e.pathname,path:e.pathname+e.search,href:e.href};return""!==e.port&&(t.port=Number(e.port)),t}function Tv(e,t){var n;for(var i in t)e.test(i)&&(n=t[i],delete t[i]);return null==n?void 0:String(n).trim()}function Pv(e,t,n){function i(n){Error.captureStackTrace(this,this.constructor),Object.assign(this,n||{}),this.code=e,this.message=this.cause?t+": "+this.cause.message:t}return i.prototype=new(n||Error),i.prototype.constructor=i,i.prototype.name="Error ["+e+"]",i}function Ev(e){for(var t of gv)e.removeListener(t,vv[t]);e.on("error",Cv),e.abort()}function Ov(e){return"string"==typeof e||e instanceof String}function Dv(e){return"function"==typeof e}Sv.prototype=Object.create(mv.prototype),Sv.prototype.abort=function(){Ev(this._currentRequest),this.emit("abort")},Sv.prototype.write=function(e,t,n){if(this._ending)throw new wv;if(!Ov(e)&&("object"!=typeof(i=e)||!("length"in i)))throw new TypeError("data should be a string, Buffer or Uint8Array");var i;Dv(t)&&(n=t,t=null),0!==e.length?this._requestBodyLength+e.length<=this._options.maxBodyLength?(this._requestBodyLength+=e.length,this._requestBodyBuffers.push({data:e,encoding:t}),this._currentRequest.write(e,t,n)):(this.emit("error",new xv),this.abort()):n&&n()},Sv.prototype.end=function(e,t,n){if(Dv(e)?(n=e,e=t=null):Dv(t)&&(n=t,t=null),e){var i=this,s=this._currentRequest;this.write(e,t,(function(){i._ended=!0,s.end(null,null,n)})),this._ending=!0}else this._ended=this._ending=!0,this._currentRequest.end(null,null,n)},Sv.prototype.setHeader=function(e,t){this._options.headers[e]=t,this._currentRequest.setHeader(e,t)},Sv.prototype.removeHeader=function(e){delete this._options.headers[e],this._currentRequest.removeHeader(e)},Sv.prototype.setTimeout=function(e,t){var n=this;function i(t){t.setTimeout(e),t.removeListener("timeout",t.destroy),t.addListener("timeout",t.destroy)}function s(t){n._timeout&&clearTimeout(n._timeout),n._timeout=setTimeout((function(){n.emit("timeout"),r()}),e),i(t)}function r(){n._timeout&&(clearTimeout(n._timeout),n._timeout=null),n.removeListener("abort",r),n.removeListener("error",r),n.removeListener("response",r),t&&n.removeListener("timeout",t),n.socket||n._currentRequest.removeListener("socket",s)}return t&&this.on("timeout",t),this.socket?s(this.socket):this._currentRequest.once("socket",s),this.on("socket",i),this.on("abort",r),this.on("error",r),this.on("response",r),this},["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach((function(e){Sv.prototype[e]=function(t,n){return this._currentRequest[e](t,n)}})),["aborted","connection","socket"].forEach((function(e){Object.defineProperty(Sv.prototype,e,{get:function(){return this._currentRequest[e]}})})),Sv.prototype._sanitizeOptions=function(e){if(e.headers||(e.headers={}),e.host&&(e.hostname||(e.hostname=e.host),delete e.host),!e.pathname&&e.path){var t=e.path.indexOf("?");t<0?e.pathname=e.path:(e.pathname=e.path.substring(0,t),e.search=e.path.substring(t))}},Sv.prototype._performRequest=function(){var e=this._options.protocol,t=this._options.nativeProtocols[e];if(t){if(this._options.agents){var n=e.slice(0,-1);this._options.agent=this._options.agents[n]}var i=this._currentRequest=t.request(this._options,this._onNativeResponse);for(var s of(i._redirectable=this,gv))i.on(s,vv[s]);if(this._currentUrl=/^\//.test(this._options.path)?pv.format(this._options):this._options.path,this._isRedirect){var r=0,a=this,o=this._requestBodyBuffers;!function e(t){if(i===a._currentRequest)if(t)a.emit("error",t);else if(r<o.length){var n=o[r++];i.finished||i.write(n.data,n.encoding,e)}else a._ended&&i.end()}()}}else this.emit("error",new TypeError("Unsupported protocol "+e))},Sv.prototype._processResponse=function(e){var t=e.statusCode;this._options.trackRedirects&&this._redirects.push({url:this._currentUrl,headers:e.headers,statusCode:t});var n=e.headers.location;if(!n||!1===this._options.followRedirects||t<300||t>=400)return e.responseUrl=this._currentUrl,e.redirects=this._redirects,this.emit("response",e),void(this._requestBodyBuffers=[]);if(Ev(this._currentRequest),e.destroy(),++this._redirectCount>this._options.maxRedirects)this.emit("error",new _v);else{var i,s=this._options.beforeRedirect;s&&(i=Object.assign({Host:e.req.getHeader("host")},this._options.headers));var r=this._options.method;((301===t||302===t)&&"POST"===this._options.method||303===t&&!/^(?:GET|HEAD)$/.test(this._options.method))&&(this._options.method="GET",this._requestBodyBuffers=[],Tv(/^content-/i,this._options.headers));var a,o=Tv(/^host$/i,this._options.headers),c=pv.parse(this._currentUrl),p=o||c.host,d=/^\w+:/.test(n)?this._currentUrl:pv.format(Object.assign(c,{host:p}));try{a=pv.resolve(d,n)}catch(e){return void this.emit("error",new yv({cause:e}))}fv("redirecting to",a),this._isRedirect=!0;var l=pv.parse(a);if(Object.assign(this._options,l),(l.protocol!==c.protocol&&"https:"!==l.protocol||l.host!==p&&!function(e,t){hv(Ov(e)&&Ov(t));var n=e.length-t.length-1;return n>0&&"."===e[n]&&e.endsWith(t)}(l.host,p))&&Tv(/^(?:authorization|cookie)$/i,this._options.headers),Dv(s)){var u={headers:e.headers,statusCode:t},m={url:d,method:r,headers:i};try{s(this._options,u,m)}catch(e){return void this.emit("error",e)}this._sanitizeOptions(this._options)}try{this._performRequest()}catch(e){this.emit("error",new yv({cause:e}))}}},cv.exports=kv({http:lv,https:uv}),ov.wrap=kv;function jv(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}const Iv=/^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;function Mv(e,t){e=e||10;const n=new Array(e),i=new Array(e);let s,r=0,a=0;return t=void 0!==t?t:1e3,function(o){const c=Date.now(),p=i[a];s||(s=c),n[r]=o,i[r]=c;let d=a,l=0;for(;d!==r;)l+=n[d++],d%=e;if(r=(r+1)%e,r===a&&(a=(a+1)%e),c-s<t)return;const u=p&&c-p;return u?Math.round(1e3*l/u):void 0}}const Lv=Symbol("internals");class Av extends p.Transform{constructor(e){super({readableHighWaterMark:(e=jf.toFlatObject(e,{maxRate:0,chunkSize:65536,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,((e,t)=>!jf.isUndefined(t[e])))).chunkSize});const t=this,n=this[Lv]={length:e.length,timeWindow:e.timeWindow,ticksRate:e.ticksRate,chunkSize:e.chunkSize,maxRate:e.maxRate,minChunkSize:e.minChunkSize,bytesSeen:0,isCaptured:!1,notifiedBytesLoaded:0,ts:Date.now(),bytes:0,onReadCallback:null},i=Mv(n.ticksRate*e.samplesCount,n.timeWindow);this.on("newListener",(e=>{"progress"===e&&(n.isCaptured||(n.isCaptured=!0))}));let s=0;n.updateProgress=function(e,t){let n=0;const i=1e3/t;let s=null;return function(t,r){const a=Date.now();if(t||a-n>i)return s&&(clearTimeout(s),s=null),n=a,e.apply(null,r);s||(s=setTimeout((()=>(s=null,n=Date.now(),e.apply(null,r))),i-(a-n)))}}((function(){const e=n.length,r=n.bytesSeen,a=r-s;if(!a||t.destroyed)return;const o=i(a);s=r,process.nextTick((()=>{t.emit("progress",{loaded:r,total:e,progress:e?r/e:void 0,bytes:a,rate:o||void 0,estimated:o&&e&&r<=e?(e-r)/o:void 0})}))}),n.ticksRate);const r=()=>{n.updateProgress(!0)};this.once("end",r),this.once("error",r)}_read(e){const t=this[Lv];return t.onReadCallback&&t.onReadCallback(),super._read(e)}_transform(e,t,n){const i=this,s=this[Lv],r=s.maxRate,a=this.readableHighWaterMark,o=s.timeWindow,c=r/(1e3/o),p=!1!==s.minChunkSize?Math.max(s.minChunkSize,.01*c):0;const d=(e,t)=>{const n=Buffer.byteLength(e);let d,l=null,u=a,m=0;if(r){const e=Date.now();(!s.ts||(m=e-s.ts)>=o)&&(s.ts=e,d=c-s.bytes,s.bytes=d<0?-d:0,m=0),d=c-s.bytes}if(r){if(d<=0)return setTimeout((()=>{t(null,e)}),o-m);d<u&&(u=d)}u&&n>u&&n-u>p&&(l=e.subarray(u),e=e.subarray(0,u)),function(e,t){const n=Buffer.byteLength(e);s.bytesSeen+=n,s.bytes+=n,s.isCaptured&&s.updateProgress(),i.push(e)?process.nextTick(t):s.onReadCallback=()=>{s.onReadCallback=null,process.nextTick(t)}}(e,l?()=>{process.nextTick(t,null,l)}:t)};d(e,(function e(t,i){if(t)return n(t);i?d(i,e):n(null)}))}setLength(e){return this[Lv].length=+e,this}}const Nv={flush:u.constants.Z_SYNC_FLUSH,finishFlush:u.constants.Z_SYNC_FLUSH},Bv={flush:u.constants.BROTLI_OPERATION_FLUSH,finishFlush:u.constants.BROTLI_OPERATION_FLUSH},Fv=jf.isFunction(u.createBrotliDecompress),{http:Uv,https:zv}=ov,qv=/https:?/,$v=Ug.protocols.map((e=>e+":"));function Vv(e){e.beforeRedirects.proxy&&e.beforeRedirects.proxy(e),e.beforeRedirects.config&&e.beforeRedirects.config(e)}function Hv(e,t,n){let i=t;if(!i&&!1!==i){const e=av(n);e&&(i=new URL(e))}if(i){if(i.username&&(i.auth=(i.username||"")+":"+(i.password||"")),i.auth){(i.auth.username||i.auth.password)&&(i.auth=(i.auth.username||"")+":"+(i.auth.password||""));const t=Buffer.from(i.auth,"utf8").toString("base64");e.headers["Proxy-Authorization"]="Basic "+t}e.headers.host=e.hostname+(e.port?":"+e.port:"");const t=i.hostname||i.host;e.hostname=t,e.host=t,e.port=i.port,e.path=n,i.protocol&&(e.protocol=i.protocol.includes(":")?i.protocol:`${i.protocol}:`)}e.beforeRedirects.proxy=function(e){Hv(e,t,e.href)}}var Wv="undefined"!=typeof process&&"process"===jf.kindOf(process)&&function(e){return new Promise((function(t,n){let i=e.data;const s=e.responseType,r=e.responseEncoding,c=e.method.toUpperCase();let l,m,h,f=!1;const g=new d;function v(){l||(l=!0,e.cancelToken&&e.cancelToken.unsubscribe(x),e.signal&&e.signal.removeEventListener("abort",x),g.removeAllListeners())}function b(e,i){m||(m=!0,i&&(f=!0,v()),i?n(e):t(e))}const y=function(e){b(e)},_=function(e){b(e,!0)};function x(t){g.emit("abort",!t||t.type?new Xg(null,e,h):t)}g.once("abort",_),(e.cancelToken||e.signal)&&(e.cancelToken&&e.cancelToken.subscribe(x),e.signal&&(e.signal.aborted?x():e.signal.addEventListener("abort",x)));const w=ev(e.baseURL,e.url),S=new URL(w),k=S.protocol||$v[0];if("data:"===k){let t;if("GET"!==c)return Zg(y,_,{status:405,statusText:"method not allowed",headers:{},config:e});try{t=function(e,t,n){const i=n&&n.Blob||Ug.classes.Blob,s=jv(e);if(void 0===t&&i&&(t=!0),"data"===s){e=s.length?e.slice(s.length+1):e;const n=Iv.exec(e);if(!n)throw new If("Invalid URL",If.ERR_INVALID_URL);const r=n[1],a=n[2],o=n[3],c=Buffer.from(decodeURIComponent(o),a?"base64":"utf8");if(t){if(!i)throw new If("Blob is not supported",If.ERR_NOT_SUPPORT);return new i([c],{type:r})}return c}throw new If("Unsupported protocol "+s,If.ERR_NOT_SUPPORT)}(e.url,"blob"===s,{Blob:e.env&&e.env.Blob})}catch(t){throw If.from(t,If.ERR_BAD_REQUEST,e)}return"text"===s?(t=t.toString(r),r&&"utf8"!==r||(i=jf.stripBOM(t))):"stream"===s&&(t=p.Readable.from(t)),Zg(y,_,{data:t,status:200,statusText:"OK",headers:new Jg,config:e})}if(-1===$v.indexOf(k))return _(new If("Unsupported protocol "+k,If.ERR_BAD_REQUEST,e));const C=Jg.from(e.headers).normalize();C.set("User-Agent","axios/1.2.3",!1);const R=e.onDownloadProgress,T=e.onUploadProgress,P=e.maxRate;let E,O;if(jf.isFormData(i)&&jf.isFunction(i.getHeaders))C.set(i.getHeaders());else if(i&&!jf.isStream(i)){if(Buffer.isBuffer(i));else if(jf.isArrayBuffer(i))i=Buffer.from(new Uint8Array(i));else{if(!jf.isString(i))return _(new If("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",If.ERR_BAD_REQUEST,e));i=Buffer.from(i,"utf-8")}if(C.set("Content-Length",i.length,!1),e.maxBodyLength>-1&&i.length>e.maxBodyLength)return _(new If("Request body larger than maxBodyLength limit",If.ERR_BAD_REQUEST,e))}const D=jf.toFiniteNumber(C.getContentLength());let j,I;if(jf.isArray(P)?(E=P[0],O=P[1]):E=O=P,i&&(T||E)&&(jf.isStream(i)||(i=p.Readable.from(i,{objectMode:!1})),i=p.pipeline([i,new Av({length:D,maxRate:jf.toFiniteNumber(E)})],jf.noop),T&&i.on("progress",(e=>{T(Object.assign(e,{upload:!0}))}))),e.auth){j=(e.auth.username||"")+":"+(e.auth.password||"")}if(!j&&S.username){j=S.username+":"+S.password}j&&C.delete("authorization");try{I=Ng(S.pathname+S.search,e.params,e.paramsSerializer).replace(/^\?/,"")}catch(t){const n=new Error(t.message);return n.config=e,n.url=e.url,n.exists=!0,_(n)}C.set("Accept-Encoding","gzip, compress, deflate"+(Fv?", br":""),!1);const M={path:I,method:c,headers:C.toJSON(),agents:{http:e.httpAgent,https:e.httpsAgent},auth:j,protocol:k,beforeRedirect:Vv,beforeRedirects:{}};let L;e.socketPath?M.socketPath=e.socketPath:(M.hostname=S.hostname,M.port=S.port,Hv(M,e.proxy,k+"//"+S.hostname+(S.port?":"+S.port:"")+M.path));const A=qv.test(M.protocol);if(M.agent=A?e.httpsAgent:e.httpAgent,e.transport?L=e.transport:0===e.maxRedirects?L=A?o:a:(e.maxRedirects&&(M.maxRedirects=e.maxRedirects),e.beforeRedirect&&(M.beforeRedirects.config=e.beforeRedirect),L=A?zv:Uv),e.maxBodyLength>-1?M.maxBodyLength=e.maxBodyLength:M.maxBodyLength=1/0,e.insecureHTTPParser&&(M.insecureHTTPParser=e.insecureHTTPParser),h=L.request(M,(function(t){if(h.destroyed)return;const n=[t],i=+t.headers["content-length"];if(R){const e=new Av({length:jf.toFiniteNumber(i),maxRate:jf.toFiniteNumber(O)});R&&e.on("progress",(e=>{R(Object.assign(e,{download:!0}))})),n.push(e)}let a=t;const o=t.req||h;if(!1!==e.decompress&&t.headers["content-encoding"])switch("HEAD"!==c&&204!==t.statusCode||delete t.headers["content-encoding"],t.headers["content-encoding"]){case"gzip":case"x-gzip":case"compress":case"x-compress":case"deflate":n.push(u.createUnzip(Nv)),delete t.headers["content-encoding"];break;case"br":Fv&&(n.push(u.createBrotliDecompress(Bv)),delete t.headers["content-encoding"])}a=n.length>1?p.pipeline(n,jf.noop):n[0];const d=p.finished(a,(()=>{d(),v()})),l={status:t.statusCode,statusText:t.statusMessage,headers:new Jg(t.headers),config:e,request:o};if("stream"===s)l.data=a,Zg(y,_,l);else{const t=[];let n=0;a.on("data",(function(i){t.push(i),n+=i.length,e.maxContentLength>-1&&n>e.maxContentLength&&(f=!0,a.destroy(),_(new If("maxContentLength size of "+e.maxContentLength+" exceeded",If.ERR_BAD_RESPONSE,e,o)))})),a.on("aborted",(function(){if(f)return;const t=new If("maxContentLength size of "+e.maxContentLength+" exceeded",If.ERR_BAD_RESPONSE,e,o);a.destroy(t),_(t)})),a.on("error",(function(t){h.destroyed||_(If.from(t,null,e,o))})),a.on("end",(function(){try{let e=1===t.length?t[0]:Buffer.concat(t);"arraybuffer"!==s&&(e=e.toString(r),r&&"utf8"!==r||(e=jf.stripBOM(e))),l.data=e}catch(t){_(If.from(t,null,e,l.request,l))}Zg(y,_,l)}))}g.once("abort",(e=>{a.destroyed||(a.emit("error",e),a.destroy())}))})),g.once("abort",(e=>{_(e),h.destroy(e)})),h.on("error",(function(t){_(If.from(t,null,e,h))})),h.on("socket",(function(e){e.setKeepAlive(!0,6e4)})),e.timeout){const t=parseInt(e.timeout,10);if(isNaN(t))return void _(new If("error trying to parse `config.timeout` to int",If.ERR_BAD_OPTION_VALUE,e,h));h.setTimeout(t,(function(){if(m)return;let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const n=e.transitional||Fg;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),_(new If(t,n.clarifyTimeoutError?If.ETIMEDOUT:If.ECONNABORTED,e,h)),x()}))}if(jf.isStream(i)){let t=!1,n=!1;i.on("end",(()=>{t=!0})),i.once("error",(e=>{n=!0,h.destroy(e)})),i.on("close",(()=>{t||n||x(new Xg("Request stream has been aborted",e,h))})),i.pipe(h)}else h.end(i)}))},Gv=Ug.isStandardBrowserEnv?{write:function(e,t,n,i,s,r){const a=[];a.push(e+"="+encodeURIComponent(t)),jf.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),jf.isString(i)&&a.push("path="+i),jf.isString(s)&&a.push("domain="+s),!0===r&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},Kv=Ug.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let n;function i(n){let i=n;return e&&(t.setAttribute("href",i),i=t.href),t.setAttribute("href",i),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return n=i(window.location.href),function(e){const t=jf.isString(e)?i(e):e;return t.protocol===n.protocol&&t.host===n.host}}():function(){return!0};function Jv(e,t){let n=0;const i=Mv(50,250);return s=>{const r=s.loaded,a=s.lengthComputable?s.total:void 0,o=r-n,c=i(o);n=r;const p={loaded:r,total:a,progress:a?r/a:void 0,bytes:o,rate:c||void 0,estimated:c&&a&&r<=a?(a-r)/c:void 0,event:s};p[t?"download":"upload"]=!0,e(p)}}const Qv={http:Wv,xhr:"undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){let i=e.data;const s=Jg.from(e.headers).normalize(),r=e.responseType;let a;function o(){e.cancelToken&&e.cancelToken.unsubscribe(a),e.signal&&e.signal.removeEventListener("abort",a)}jf.isFormData(i)&&(Ug.isStandardBrowserEnv||Ug.isStandardBrowserWebWorkerEnv)&&s.setContentType(!1);let c=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",n=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";s.set("Authorization","Basic "+btoa(t+":"+n))}const p=ev(e.baseURL,e.url);function d(){if(!c)return;const i=Jg.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders());Zg((function(e){t(e),o()}),(function(e){n(e),o()}),{data:r&&"text"!==r&&"json"!==r?c.response:c.responseText,status:c.status,statusText:c.statusText,headers:i,config:e,request:c}),c=null}if(c.open(e.method.toUpperCase(),Ng(p,e.params,e.paramsSerializer),!0),c.timeout=e.timeout,"onloadend"in c?c.onloadend=d:c.onreadystatechange=function(){c&&4===c.readyState&&(0!==c.status||c.responseURL&&0===c.responseURL.indexOf("file:"))&&setTimeout(d)},c.onabort=function(){c&&(n(new If("Request aborted",If.ECONNABORTED,e,c)),c=null)},c.onerror=function(){n(new If("Network Error",If.ERR_NETWORK,e,c)),c=null},c.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const i=e.transitional||Fg;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(new If(t,i.clarifyTimeoutError?If.ETIMEDOUT:If.ECONNABORTED,e,c)),c=null},Ug.isStandardBrowserEnv){const t=(e.withCredentials||Kv(p))&&e.xsrfCookieName&&Gv.read(e.xsrfCookieName);t&&s.set(e.xsrfHeaderName,t)}void 0===i&&s.setContentType(null),"setRequestHeader"in c&&jf.forEach(s.toJSON(),(function(e,t){c.setRequestHeader(t,e)})),jf.isUndefined(e.withCredentials)||(c.withCredentials=!!e.withCredentials),r&&"json"!==r&&(c.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&c.addEventListener("progress",Jv(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&c.upload&&c.upload.addEventListener("progress",Jv(e.onUploadProgress)),(e.cancelToken||e.signal)&&(a=t=>{c&&(n(!t||t.type?new Xg(null,e,c):t),c.abort(),c=null)},e.cancelToken&&e.cancelToken.subscribe(a),e.signal&&(e.signal.aborted?a():e.signal.addEventListener("abort",a)));const l=jv(p);l&&-1===Ug.protocols.indexOf(l)?n(new If("Unsupported protocol "+l+":",If.ERR_BAD_REQUEST,e)):c.send(i||null)}))}};jf.forEach(Qv,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));var Yv=e=>{e=jf.isArray(e)?e:[e];const{length:t}=e;let n,i;for(let s=0;s<t&&(n=e[s],!(i=jf.isString(n)?Qv[n.toLowerCase()]:n));s++);if(!i){if(!1===i)throw new If(`Adapter ${n} is not supported by the environment`,"ERR_NOT_SUPPORT");throw new Error(jf.hasOwnProp(Qv,n)?`Adapter '${n}' is not available in the build`:`Unknown adapter '${n}'`)}if(!jf.isFunction(i))throw new TypeError("adapter is not a function");return i};function Xv(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Xg(null,e)}function Zv(e){Xv(e),e.headers=Jg.from(e.headers),e.data=Qg.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return Yv(e.adapter||$g.adapter)(e).then((function(t){return Xv(e),t.data=Qg.call(e,e.transformResponse,t),t.headers=Jg.from(t.headers),t}),(function(t){return Yg(t)||(Xv(e),t&&t.response&&(t.response.data=Qg.call(e,e.transformResponse,t.response),t.response.headers=Jg.from(t.response.headers))),Promise.reject(t)}))}const eb=e=>e instanceof Jg?e.toJSON():e;function tb(e,t){t=t||{};const n={};function i(e,t,n){return jf.isPlainObject(e)&&jf.isPlainObject(t)?jf.merge.call({caseless:n},e,t):jf.isPlainObject(t)?jf.merge({},t):jf.isArray(t)?t.slice():t}function s(e,t,n){return jf.isUndefined(t)?jf.isUndefined(e)?void 0:i(void 0,e,n):i(e,t,n)}function r(e,t){if(!jf.isUndefined(t))return i(void 0,t)}function a(e,t){return jf.isUndefined(t)?jf.isUndefined(e)?void 0:i(void 0,e):i(void 0,t)}function o(n,s,r){return r in t?i(n,s):r in e?i(void 0,n):void 0}const c={url:r,method:r,data:r,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:o,headers:(e,t)=>s(eb(e),eb(t),!0)};return jf.forEach(Object.keys(e).concat(Object.keys(t)),(function(i){const r=c[i]||s,a=r(e[i],t[i],i);jf.isUndefined(a)&&r!==o||(n[i]=a)})),n}const nb={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{nb[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const ib={};nb.transitional=function(e,t,n){function i(e,t){return"[Axios v1.2.3] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,s,r)=>{if(!1===e)throw new If(i(s," has been removed"+(t?" in "+t:"")),If.ERR_DEPRECATED);return t&&!ib[s]&&(ib[s]=!0,console.warn(i(s," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,s,r)}};var sb={assertOptions:function(e,t,n){if("object"!=typeof e)throw new If("options must be an object",If.ERR_BAD_OPTION_VALUE);const i=Object.keys(e);let s=i.length;for(;s-- >0;){const r=i[s],a=t[r];if(a){const t=e[r],n=void 0===t||a(t,r,e);if(!0!==n)throw new If("option "+r+" must be "+n,If.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new If("Unknown option "+r,If.ERR_BAD_OPTION)}},validators:nb};const rb=sb.validators;class ab{constructor(e){this.defaults=e,this.interceptors={request:new Bg,response:new Bg}}request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=tb(this.defaults,t);const{transitional:n,paramsSerializer:i,headers:s}=t;let r;void 0!==n&&sb.assertOptions(n,{silentJSONParsing:rb.transitional(rb.boolean),forcedJSONParsing:rb.transitional(rb.boolean),clarifyTimeoutError:rb.transitional(rb.boolean)},!1),void 0!==i&&sb.assertOptions(i,{encode:rb.function,serialize:rb.function},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase(),r=s&&jf.merge(s.common,s[t.method]),r&&jf.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete s[e]})),t.headers=Jg.concat(r,s);const a=[];let o=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(o=o&&e.synchronous,a.unshift(e.fulfilled,e.rejected))}));const c=[];let p;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let d,l=0;if(!o){const e=[Zv.bind(this),void 0];for(e.unshift.apply(e,a),e.push.apply(e,c),d=e.length,p=Promise.resolve(t);l<d;)p=p.then(e[l++],e[l++]);return p}d=a.length;let u=t;for(l=0;l<d;){const e=a[l++],t=a[l++];try{u=e(u)}catch(e){t.call(this,e);break}}try{p=Zv.call(this,u)}catch(e){return Promise.reject(e)}for(l=0,d=c.length;l<d;)p=p.then(c[l++],c[l++]);return p}getUri(e){return Ng(ev((e=tb(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}jf.forEach(["delete","get","head","options"],(function(e){ab.prototype[e]=function(t,n){return this.request(tb(n||{},{method:e,url:t,data:(n||{}).data}))}})),jf.forEach(["post","put","patch"],(function(e){function t(t){return function(n,i,s){return this.request(tb(s||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:i}))}}ab.prototype[e]=t(),ab.prototype[e+"Form"]=t(!0)}));class ob{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const i=new Promise((e=>{n.subscribe(e),t=e})).then(e);return i.cancel=function(){n.unsubscribe(t)},i},e((function(e,i,s){n.reason||(n.reason=new Xg(e,i,s),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;return{token:new ob((function(t){e=t})),cancel:e}}}const cb={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(cb).forEach((([e,t])=>{cb[t]=e}));const pb=function e(t){const n=new ab(t),i=nf(ab.prototype.request,n);return jf.extend(i,ab.prototype,n,{allOwnKeys:!0}),jf.extend(i,n,null,{allOwnKeys:!0}),i.create=function(n){return e(tb(t,n))},i}($g);pb.Axios=ab,pb.CanceledError=Xg,pb.CancelToken=ob,pb.isCancel=Yg,pb.VERSION="1.2.3",pb.toFormData=jg,pb.AxiosError=If,pb.Cancel=pb.CanceledError,pb.all=function(e){return Promise.all(e)},pb.spread=function(e){return function(t){return e.apply(null,t)}},pb.isAxiosError=function(e){return jf.isObject(e)&&!0===e.isAxiosError},pb.mergeConfig=tb,pb.AxiosHeaders=Jg,pb.formToJSON=e=>zg(jf.isHTMLForm(e)?new FormData(e):e),pb.HttpStatusCode=cb,pb.default=pb;class db{constructor(e={}){this.data=void 0===e.data?{}:e.data,this.headers=e.headers||{},this.status=e.status||200,this.statusText=e.statusText||"OK",this.url=e.url||null}}function lb(e,t){return m.ok(e,`${t} is required`),e}function ub(e,t){return m.ok("boolean"==typeof e,`${t}<boolean> is required`),e}function mb(e,t){return m.ok("number"==typeof e,`${t}<number> is required`),e}function hb(e,t){return m.ok("string"==typeof e,`${t}<string> is required`),e}function fb(e,t,n){const i=n||t.name[0].toLowerCase()+t.name.substring(1);return m.ok(e instanceof t,`${i}<${t.name}> is required`),e}function gb(e,t="roomName"){return hb(e,t),m.equal("string"==typeof e&&e[0],"/",`${t} must begin with a '/'`),e}function vb(e,t){return m.ok(Array.isArray(e),`${t}<array> is required`),e}function bb(e,t){if(null==e||"object"!=typeof e||Array.isArray(e))throw new Error(`${t} must be a record. ${JSON.stringify(e)}`);return e}function yb(e,t,n){hb(t,"name"),function(e,t,n,i){hb(n,"name");const s=i||`${n} must be null or of type ${t}`;m.ok(null===e||typeof e===t,s)}(e,"string",t,n)}function _b({baseUrl:e,url:t}){return m.ok("string"==typeof t,"url<String> is required"),e?e+t:t}class xb{constructor({baseUrl:e}){hb(e,"baseUrl"),this._baseUrl=e}_requestAxios(e,t){const n=Object.assign({},t,{url:e,baseURL:this._baseUrl});return pb.request(n)}request(e,t){return hb(e,"url"),m.equal(e[0],"/",'url<String> only accepts relative URLs beginning with "/".'),m.ok(t,"options are required"),this._requestAxios(e,t).then((e=>{const{data:t,headers:n,status:i,statusText:s,config:r}=e,a=r&&r.url?_b({baseUrl:r.baseURL,url:r.url}):null;return new db({data:t,headers:n,status:i,statusText:s,url:a})})).catch((e=>{const t=e.response;if(!t)throw new Error("Could not make the request.");const{data:n,headers:i,status:s,statusText:r,config:a}=t,o=a&&a.url?_b({baseUrl:a.baseURL,url:a.url}):null;return Promise.reject(new db({data:n,headers:i,status:s,statusText:r,url:o}))}))}}class wb{constructor({httpClient:e}){m.ok(e,"httpClient is required"),this._httpClient=e}static dataToFormData(e){m.ok(e,"data is required");const t=new FormData;return Object.keys(e).forEach((n=>{const i=e[n];t.append(n,i)})),t}request(e,t={}){const n=Object.assign(t.headers||{},{"Content-Type":void 0});return this._httpClient.request(e,Object.assign(t,{headers:n,transformRequest:wb.dataToFormData}))}}let Sb;Sb="object"==typeof window?window.btoa||tf:"object"==typeof global&&global.btoa||tf;const kb=()=>Promise.resolve(null);class Cb{constructor({httpClient:e,fetchDeviceCredentials:t}){this._httpClient=e,this._fetchDeviceCredentials=t}request(e,t){return this._fetchDeviceCredentials().then((n=>{const i=Object.assign({},t.headers,function(e){if(e&&e.credentials){const t=`${e.credentials.uuid}:${e.hmac}`;return{Authorization:`Basic ${Sb(t)}`}}return{}}(n),{"X-Appearin-Device-Platform":"web"}),s=Object.assign({},t,{headers:i});return this._httpClient.request(e,s)}))}}class Rb{constructor({baseUrl:e="https://api.appearin.net",fetchDeviceCredentials:t=kb}={}){hb(e,"baseUrl"),m.ok("function"==typeof t,"fetchDeviceCredentials<Function> is required"),this.authenticatedHttpClient=new Cb({httpClient:new xb({baseUrl:e}),fetchDeviceCredentials:t}),this.authenticatedFormDataHttpClient=new wb({httpClient:this.authenticatedHttpClient})}request(e,t){return hb(e,"url"),m.equal(e[0],"/",'url<String> only accepts relative URLs beginning with "/".'),m.ok(t,"options are required"),this.authenticatedHttpClient.request(e,t)}requestMultipart(e,t){return hb(e,"url"),m.equal(e[0],"/",'url<String> only accepts relative URLs beginning with "/".'),m.ok(t,"options are required"),this.authenticatedFormDataHttpClient.request(e,t)}}function Tb(e,t){return hb(bb(e,"data")[t],t)}const Pb=(Eb=Tb,(e,t)=>{const n=bb(e,"data")[t];return null==n?null:Eb(e,t)});var Eb;function Ob(e,t){const n=Tb(e,t),i=new Date(n);if(isNaN(i.getTime()))throw new Error(`Invalid date for ${n}`);return i}function Db(e,t,n){return function(e,t){return vb(bb(e,"data")[t],t)}(e,t).map((e=>n(e)))}class jb{constructor(e,t,n){this.credentials={uuid:e},this.hmac=t,this.userId=n}toJson(){return Object.assign({credentials:this.credentials,hmac:this.hmac},this.userId&&{userId:this.userId})}static fromJson(e){return new jb(Tb(function(e,t){const n=bb(e,"data")[t];return void 0===n?null:n}(e,"credentials"),"uuid"),Tb(e,"hmac"),Pb(e,"userId")||void 0)}}class Ib{constructor({apiClient:e}){this._apiClient=fb(e,Rb)}getCredentials(){return this._apiClient.request("/devices",{method:"post"}).then((({data:e})=>jb.fromJson(e))).catch((e=>{if(e.response&&404===e.response.status)return null;throw e}))}}class Mb{constructor(e,t){this._key=e,this._chromeStorage=t}loadOrDefault(e){return new Promise((t=>{this._chromeStorage.get(this._key,(n=>{t(n[this._key]||e)}))}))}save(e){return new Promise((t=>{this._chromeStorage.set({[this._key]:e},(()=>{t()}))}))}}class Lb{constructor(e,t){lb(t,"localStorage"),this._key=hb(e,"key"),this._localStorage=t}loadOrDefault(e){try{const t=this._localStorage.getItem(this._key);if(t)try{return Promise.resolve(JSON.parse(t))}catch(e){}return Promise.resolve(e)}catch(t){return console.warn("Error getting access to storage. Are cookies blocked?",t),Promise.resolve(e)}}save(e){try{return this._localStorage.setItem(this._key,JSON.stringify(e)),Promise.resolve()}catch(e){return console.warn("Error getting access to storage. Are cookies blocked?",e),Promise.reject(e)}}}let Ab;try{Ab=self.localStorage}catch(e){Ab={getItem:()=>{},key:()=>{},setItem:()=>{},removeItem:()=>{},hasOwnProperty:()=>{},length:0}}var Nb=Ab;const Bb="credentials_saved";class Fb extends d{constructor({deviceService:e,credentialsStore:t}){super(),this._deviceService=fb(e,Ib),this._credentialsStore=t}static create({baseUrl:e,storeName:t="CredentialsStorage",storeType:n="localStorage"}){const i=new Ib({apiClient:new Rb({baseUrl:e})});let s=null;if("localStorage"===n)s=new Lb(t,Nb);else{if("chromeStorage"!==n)throw new Error(`Unknown store type: ${n}`);s=new Mb(t,window.chrome.storage.local)}return new Fb({deviceService:i,credentialsStore:s})}_fetchNewCredentialsFromApi(){const e=this._credentialsStore;return new Promise((t=>{const n=()=>{this._deviceService.getCredentials().then((n=>e.save(n?n.toJson():null).then((()=>t(n))))).catch((()=>{setTimeout(n,2e3)}))};n()}))}getCurrentCredentials(){return this._credentialsStore.loadOrDefault(null).then((e=>e?jb.fromJson(e):null))}getCredentials(){return this.credentialsPromise||(this.credentialsPromise=this.getCurrentCredentials().then((e=>e||this._fetchNewCredentialsFromApi()))),this.credentialsPromise}saveCredentials(e){return this.credentialsPromise=void 0,this._credentialsStore.save(e.toJson()).then((()=>(this.emit(Bb,e),e)))}setUserId(e){return this.getCurrentCredentials().then((t=>{t||console.error("Illegal state: no credentials to set user id for.");if(null===t||t.userId!==e)return this._credentialsStore.save(Object.assign({},null==t?void 0:t.toJson(),{userId:e}))})).then((()=>{}))}}const Ub=()=>Promise.resolve(void 0);class zb{constructor({apiClient:e,fetchOrganization:t=Ub}){this._apiClient=fb(e,Rb),m.ok("function"==typeof t,"fetchOrganization<Function> is required"),this._fetchOrganization=t,this._apiClient=e}_callRequestMethod(e,t,n){return hb(t,"url"),m.equal(t[0],"/",'url<String> only accepts relative URLs beginning with "/".'),m.ok(n,"options are required"),this._fetchOrganization().then((i=>{if(!i)return this._apiClient[e](t,n);const{organizationId:s}=i;return this._apiClient[e](`/organizations/${encodeURIComponent(s)}${t}`,n)}))}request(e,t){return this._callRequestMethod("request",e,t)}requestMultipart(e,t){return this._callRequestMethod("requestMultipart",e,t)}}class qb{constructor({isExhausted:e,renewsAt:t,totalMinutesLimit:n,totalMinutesUsed:i}){this.isExhausted=e,this.renewsAt=t,this.totalMinutesLimit=n,this.totalMinutesUsed=i}static fromJson(e){return new qb({isExhausted:ub(e.isExhausted,"isExhausted"),renewsAt:new Date(hb(e.renewsAt,"renewsAt")),totalMinutesLimit:mb(e.totalMinutesLimit,"totalMinutesLimit"),totalMinutesUsed:mb(e.totalMinutesUsed,"totalMinutesUsed")})}}class $b{constructor({basePlanId:e,embeddedFreeTierStatus:t,isDeactivated:n,isOnTrial:i,onTrialUntil:s,trialStatus:r}){this.basePlanId=e,this.isDeactivated=n,this.isOnTrial=i,this.onTrialUntil=s||null,this.trialStatus=r||null,this.embeddedFreeTierStatus=t||null}static fromJson(e){return new $b({basePlanId:"string"==typeof e.basePlanId?e.basePlanId:null,isDeactivated:ub(e.isDeactivated,"isDeactivated"),isOnTrial:ub(e.isOnTrial,"isOnTrial"),onTrialUntil:"string"==typeof e.onTrialUntil?new Date(e.onTrialUntil):null,trialStatus:"string"==typeof e.trialStatus?e.trialStatus:null,embeddedFreeTierStatus:e.embeddedFreeTierStatus?qb.fromJson(e.embeddedFreeTierStatus):null})}}function Vb(e){return null!=e}function Hb(e={}){return{maxNumberOfInvitationsAndUsers:Vb(null==e?void 0:e.maxNumberOfInvitationsAndUsers)?Number(null==e?void 0:e.maxNumberOfInvitationsAndUsers):null,maxNumberOfClaimedRooms:Vb(null==e?void 0:e.maxNumberOfClaimedRooms)?Number(null==e?void 0:e.maxNumberOfClaimedRooms):null,maxRoomLimitPerOrganization:Vb(null==e?void 0:e.maxRoomLimitPerOrganization)?Number(null==e?void 0:e.maxRoomLimitPerOrganization):null,trialMinutesLimit:Vb(null==e?void 0:e.trialMinutesLimit)?Number(null==e?void 0:e.trialMinutesLimit):null,includedUnits:Vb(null==e?void 0:e.includedUnits)?Number(null==e?void 0:e.includedUnits):null}}class Wb{constructor(e){this.logoImageUrl=null,this.roomBackgroundImageUrl=null,this.roomBackgroundThumbnailUrl=null,this.roomKnockPageBackgroundImageUrl=null,this.roomKnockPageBackgroundThumbnailUrl=null,this.preferences=null,this.onboardingSurvey=null,this.type=null,fb(e,Object,"properties"),hb(e.organizationId,"organizationId"),hb(e.organizationName,"organizationName"),hb(e.subdomain,"subdomain"),fb(e.permissions,Object,"permissions"),fb(e.limits,Object,"limits"),this.organizationId=e.organizationId,this.organizationName=e.organizationName,this.subdomain=e.subdomain,this.permissions=e.permissions,this.limits=e.limits,this.account=e.account?new $b(e.account):null,this.logoImageUrl=e.logoImageUrl,this.roomBackgroundImageUrl=e.roomBackgroundImageUrl,this.roomBackgroundThumbnailUrl=e.roomBackgroundThumbnailUrl,this.roomKnockPageBackgroundImageUrl=e.roomKnockPageBackgroundImageUrl,this.roomKnockPageBackgroundThumbnailUrl=e.roomKnockPageBackgroundThumbnailUrl,this.preferences=e.preferences,this.onboardingSurvey=e.onboardingSurvey,this.type=e.type}static fromJson(e){const t=fb(e,Object,"data"),n=(null==t?void 0:t.preferences)||{},i=(null==t?void 0:t.onboardingSurvey)||null,s=fb(t.permissions,Object,"permissions");return new Wb({organizationId:hb(t.organizationId,"organizationId"),organizationName:hb(t.organizationName,"organizationName"),subdomain:hb(t.subdomain,"subdomain"),permissions:s,limits:Hb(fb(t.limits,Object,"limits")),account:t.account?$b.fromJson(t.account):null,logoImageUrl:"string"==typeof t.logoImageUrl?t.logoImageUrl:null,roomBackgroundImageUrl:"string"==typeof t.roomBackgroundImageUrl?t.roomBackgroundImageUrl:null,roomBackgroundThumbnailUrl:"string"==typeof t.roomBackgroundThumbnailUrl?t.roomBackgroundThumbnailUrl:null,roomKnockPageBackgroundImageUrl:"string"==typeof t.roomKnockPageBackgroundImageUrl?t.roomKnockPageBackgroundImageUrl:null,roomKnockPageBackgroundThumbnailUrl:"string"==typeof t.roomKnockPageBackgroundThumbnailUrl?t.roomKnockPageBackgroundThumbnailUrl:null,preferences:n,onboardingSurvey:i,type:"string"==typeof t.type?t.type:null})}}Wb.GLOBAL_ORGANIZATION_ID="1";class Gb{constructor({apiClient:e}){this._apiClient=fb(e,Rb)}createOrganization({organizationName:e,subdomain:t,owner:n}){const{displayName:i,consents:s}=n||{},r="email"in n?{value:n.email,verificationCode:hb(n.verificationCode,"owner.verificationCode")}:null,a="idToken"in n?n.idToken:null;if(hb(t,"subdomain"),hb(e,"organizationName"),hb(i,"owner.displayName"),m.ok(r||a,"owner.email or owner.idToken is required"),s){vb(s,"consents");for(const{consentRevisionId:e,action:t}of s)hb(e,"consentRevisionId"),yb(t,"action")}return this._apiClient.request("/organizations",{method:"POST",data:{organizationName:e,type:"private",subdomain:t,owner:Object.assign(Object.assign(Object.assign(Object.assign({},r&&{email:r}),a&&{idToken:a}),s&&{consents:s}),{displayName:i})}}).then((({data:e})=>Tb(e,"organizationId")))}getOrganizationBySubdomain(e){return hb(e,"subdomain"),this._apiClient.request(`/organization-subdomains/${encodeURIComponent(e)}/?fields=permissions,account,onboardingSurvey`,{method:"GET"}).then((({data:e})=>Wb.fromJson(e))).catch((e=>{if(e instanceof db){if(404===e.status)return null;throw new Error(e.statusText)}throw e}))}getOrganizationByOrganizationId(e){return hb(e,"organizationId"),this._apiClient.request(`/organizations/${encodeURIComponent(e)}?fields=permissions,account`,{method:"GET"}).then((({data:e})=>Wb.fromJson(e))).catch((e=>{if(e instanceof db){if(404===e.status)return null;throw new Error(e.statusText)}throw e}))}getOrganizationsByContactPoint(e){const{code:t}=e,n="email"in e?e.email:null,i="phoneNumber"in e?e.phoneNumber:null;m.ok((n||i)&&!(n&&i),"either email or phoneNumber is required"),hb(t,"code");const s=n?{type:"email",value:n}:{type:"phoneNumber",value:i};return this._apiClient.request("/organization-queries",{method:"POST",data:{contactPoint:s,code:t}}).then((({data:e})=>Db(e,"organizations",(e=>Wb.fromJson(e)))))}getOrganizationsByIdToken({idToken:e}){return hb(e,"idToken"),this._apiClient.request("/organization-queries",{method:"POST",data:{idToken:e}}).then((({data:e})=>Db(e,"organizations",(e=>Wb.fromJson(Object.assign({permissions:{},limits:{}},bb(e,"organization")))))))}getOrganizationsByLoggedInUser(){return this._apiClient.request("/user/organizations",{method:"GET"}).then((({data:e})=>Db(e,"organizations",(e=>Wb.fromJson(Object.assign({permissions:{},limits:{}},bb(e,"organization")))))))}getSubdomainAvailability(e){return hb(e,"subdomain"),this._apiClient.request(`/organization-subdomains/${encodeURIComponent(e)}/availability`,{method:"GET"}).then((({data:e})=>(fb(e,Object,"data"),{status:Tb(e,"status")})))}updatePreferences({organizationId:e,preferences:t}){return lb(e,"organizationId"),lb(t,"preferences"),this._apiClient.request(`/organizations/${encodeURIComponent(e)}/preferences`,{method:"PATCH",data:t}).then((()=>{}))}deleteOrganization({organizationId:e}){return lb(e,"organizationId"),this._apiClient.request(`/organizations/${encodeURIComponent(e)}`,{method:"DELETE"}).then((()=>{}))}}class Kb{constructor({organizationService:e,subdomain:t}){fb(e,Gb),hb(t,"subdomain"),this._organizationService=e,this._subdomain=t,this._organizationPromise=null}initOrganization(){return this.fetchOrganization().then((()=>{}))}fetchOrganization(){return this._organizationPromise||(this._organizationPromise=this._organizationService.getOrganizationBySubdomain(this._subdomain)),this._organizationPromise}}class Jb{constructor(e={}){m.ok(e instanceof Object,"properties<object> must be empty or an object"),this.isClaimed=!1,this.isBanned=!1,this.isLocked=!1,this.knockPage={backgroundImageUrl:null,backgroundThumbnailUrl:null},this.logoUrl=null,this.backgroundImageUrl=null,this.backgroundThumbnailUrl=null,this.type=null,this.legacyRoomType=null,this.mode=null,this.product=null,this.roomName=null,this.theme=null,this.preferences={},this.protectedPreferences={},this.publicProfile=null;const t={};Object.getOwnPropertyNames(e).forEach((n=>{-1!==Object.getOwnPropertyNames(this).indexOf(n)&&(t[n]=e[n])})),void 0!==e.ownerId&&(this.ownerId=e.ownerId),void 0!==e.meeting&&(this.meeting=e.meeting),Object.assign(this,t)}}class Qb{constructor({meetingId:e,roomName:t,roomUrl:n,startDate:i,endDate:s,hostRoomUrl:r,viewerRoomUrl:a}){hb(e,"meetingId"),hb(t,"roomName"),hb(n,"roomUrl"),fb(i,Date,"startDate"),fb(s,Date,"endDate"),this.meetingId=e,this.roomName=t,this.roomUrl=n,this.startDate=i,this.endDate=s,this.hostRoomUrl=r,this.viewerRoomUrl=a}static fromJson(e){return new Qb({meetingId:Tb(e,"meetingId"),roomName:Tb(e,"roomName"),roomUrl:Tb(e,"roomUrl"),startDate:Ob(e,"startDate"),endDate:Ob(e,"endDate"),hostRoomUrl:Pb(e,"hostRoomUrl"),viewerRoomUrl:Pb(e,"viewerRoomUrl")})}}function Yb(e,t=""){return`/room/${encodeURIComponent(e.substring(1))}${t}`}class Xb{constructor({organizationApiClient:e}){this._organizationApiClient=fb(e,zb)}getRooms({types:e,fields:t=[]}={}){return vb(e,"types"),vb(t,"fields"),this._organizationApiClient.request("/room",{method:"GET",params:{types:e.join(","),fields:t.join(","),includeOnlyLegacyRoomType:"false"}}).then((({data:e})=>e.rooms.map((e=>new Jb(e)))))}getRoom({roomName:e,fields:t}){gb(e);const n=encodeURIComponent(e.substring(1));return this._organizationApiClient.request(`/rooms/${n}`,{method:"GET",params:Object.assign({includeOnlyLegacyRoomType:"false"},t&&{fields:t.join(",")})}).then((({data:t})=>new Jb(Object.assign({},t,Object.assign({roomName:e},t.meeting&&{meeting:Qb.fromJson(t.meeting)}))))).catch((t=>{if(404===t.status)return new Jb({roomName:e,isClaimed:!1,mode:"normal",product:{categoryName:"personal_free"},type:"personal",legacyRoomType:"free"});if(400===t.status&&"Banned room"===t.data.error)return new Jb({roomName:e,isBanned:!0});throw new Error(t.data?t.data.error:"Could not fetch room information")}))}claimRoom({roomName:e,type:t,mode:n,isLocked:i}){return gb(e),hb(t,"type"),this._organizationApiClient.request("/room/claim",{method:"POST",data:Object.assign(Object.assign({roomName:e,type:t},"string"==typeof n&&{mode:n}),"boolean"==typeof i&&{isLocked:i})}).then((()=>{})).catch((e=>{throw new Error(e.data.error||"Failed to claim room")}))}unclaimRoom(e){gb(e);const t=encodeURIComponent(e.substring(1));return this._organizationApiClient.request(`/room/${t}`,{method:"DELETE"}).then((()=>{}))}renameRoom({roomName:e,newRoomName:t}){gb(e),hb(t,"newRoomName");const n=encodeURIComponent(e.substring(1));return this._organizationApiClient.request(`/room/${n}/roomName`,{method:"PUT",data:{newRoomName:t}}).then((()=>{}))}changeMode({roomName:e,mode:t}){gb(e),hb(t,"mode");const n=encodeURIComponent(e.substring(1));return this._organizationApiClient.request(`/room/${n}/mode`,{method:"PUT",data:{mode:t}}).then((()=>{}))}updatePreferences({roomName:e,preferences:t}){gb(e),fb(t,Object,"preferences");const n=encodeURIComponent(e.substring(1));return this._organizationApiClient.request(`/room/${n}/preferences`,{method:"PATCH",data:t}).then((()=>{}))}updateProtectedPreferences({roomName:e,preferences:t}){gb(e),fb(t,Object,"preferences");const n=encodeURIComponent(e.substring(1));return this._organizationApiClient.request(`/room/${n}/protected-preferences`,{method:"PATCH",data:t}).then((()=>{}))}getRoomPermissions(e,{roomKey:t}={}){return gb(e),this._organizationApiClient.request(Yb(e,"/permissions"),Object.assign({method:"GET"},t&&{headers:{"X-Whereby-Room-Key":t}})).then((e=>{const{permissions:t,limits:n}=e.data;return{permissions:t,limits:n}}))}getRoomMetrics({roomName:e,metrics:t,from:n,to:i}){return gb(e),hb(t,"metrics"),this._organizationApiClient.request(Yb(e,"/metrics"),{method:"GET",params:{metrics:t,from:n,to:i}}).then((e=>e.data))}changeType({roomName:e,type:t}){gb(e),function(e,t,n){if(lb(e,"value"),vb(t,"allowedValues"),!t.includes(e))throw new Error(`${n}<string> must be one of the following: ${t.join(", ")}`)}(t,["personal","personal_xl"],"type");const n=encodeURIComponent(e.substring(1));return this._organizationApiClient.request(`/room/${n}/type`,{method:"PUT",data:{type:t}}).then((()=>{}))}getForestSocialImage({roomName:e,count:t}){return gb(e),mb(t,"count"),this._organizationApiClient.request(Yb(e,`/forest-social-image/${t}`),{method:"GET"}).then((e=>e.data.imageUrl))}}class Zb{constructor({displayName:e,id:t,stream:n,isAudioEnabled:i,isVideoEnabled:s}){this.isLocalParticipant=!1,this.displayName=e,this.id=t,this.stream=n,this.isAudioEnabled=i,this.isVideoEnabled=s}}class ey extends Zb{constructor({displayName:e,id:t,newJoiner:n,streams:i,isAudioEnabled:s,isVideoEnabled:r}){super({displayName:e,id:t,isAudioEnabled:s,isVideoEnabled:r}),this.newJoiner=n,this.streams=i.map((e=>({id:e,state:n?"new_accept":"to_accept"})))}updateStreamState(e,t){const n=this.streams.find((t=>t.id===e));n&&(n.state=t)}}class ty extends Zb{constructor({displayName:e,id:t,stream:n,isAudioEnabled:i,isVideoEnabled:s}){super({displayName:e,id:t,stream:n,isAudioEnabled:i,isVideoEnabled:s}),this.isLocalParticipant=!0}}const ny=["recorder","streamer"];const iy=()=>{},sy=EventTarget;class ry extends sy{constructor(e,{displayName:t,localMediaConstraints:n,localStream:i,logger:s}){super(),this.localParticipant=null,this.remoteParticipants=[],this.roomConnectionState="",this.roomUrl=new URL(e),this.logger=s||{debug:iy,error:iy,log:iy,warn:iy},this.displayName=t,this.localStream=i,this.localMediaConstraints=n;const r=ef({host:this.roomUrl.host});this.credentialsService=Fb.create({baseUrl:"https://api.appearin.net"}),this.apiClient=new Rb({fetchDeviceCredentials:this.credentialsService.getCredentials.bind(this.credentialsService),baseUrl:"https://api.appearin.net"}),this.organizationService=new Gb({apiClient:this.apiClient}),this.organizationServiceCache=new Kb({organizationService:this.organizationService,subdomain:r.subdomain}),this.organizationApiClient=new zb({apiClient:this.apiClient,fetchOrganization:()=>mn(this,void 0,void 0,(function*(){return(yield this.organizationServiceCache.fetchOrganization())||void 0}))}),this.roomService=new Xb({organizationApiClient:this.organizationApiClient}),this.signalSocket=function(){const e=new URL("wss://signal.appearin.net"),t=`${e.pathname.replace(/^\/$/,"")}/protocol/socket.io/v1`,n=e.origin;return new Go(n,{host:n,path:t,reconnectionDelay:5e3,reconnectionDelayMax:3e4,timeout:1e4})}(),this.signalSocket.on("new_client",this._handleNewClient.bind(this)),this.signalSocket.on("client_left",this._handleClientLeft.bind(this)),this.signalSocket.on("audio_enabled",this._handleClientAudioEnabled.bind(this)),this.signalSocket.on("video_enabled",this._handleClientVideoEnabled.bind(this)),this.signalSocket.on("client_metadata_received",this._handleClientMetadataReceived.bind(this))}_handleNewClient({client:e}){if(ny.includes(e.role.roleName))return;const t=new ey(Object.assign(Object.assign({},e),{newJoiner:!0}));this.remoteParticipants=[...this.remoteParticipants,t],this._handleAcceptStreams([t]),this.dispatchEvent(new CustomEvent("participant_joined",{detail:{remoteParticipant:t}}))}_handleClientLeft({clientId:e}){const t=this.remoteParticipants.find((t=>t.id===e));this.remoteParticipants=this.remoteParticipants.filter((t=>t.id!==e)),t&&this.dispatchEvent(new CustomEvent("participant_left",{detail:{participantId:t.id}}))}_handleClientAudioEnabled({clientId:e,isAudioEnabled:t}){const n=this.remoteParticipants.find((t=>t.id===e));n&&this.dispatchEvent(new CustomEvent("participant_audio_enabled",{detail:{participantId:n.id,isAudioEnabled:t}}))}_handleClientVideoEnabled({clientId:e,isVideoEnabled:t}){const n=this.remoteParticipants.find((t=>t.id===e));n&&this.dispatchEvent(new CustomEvent("participant_video_enabled",{detail:{participantId:n.id,isVideoEnabled:t}}))}_handleClientMetadataReceived({payload:{clientId:e,displayName:t}}){const n=this.remoteParticipants.find((t=>t.id===e));n&&this.dispatchEvent(new CustomEvent("participant_metadata_changed",{detail:{participantId:n.id,displayName:t}}))}_handleRtcEvent(e,t){return"rtc_manager_created"===e?this._handleRtcManagerCreated(t):"stream_added"===e?this._handleStreamAdded(t):void this.logger.log(`Unhandled RTC event ${e}`)}_handleRtcManagerCreated({rtcManager:e}){var t,n,i;this.rtcManager=e,this.localStream&&(null===(t=this.rtcManager)||void 0===t||t.addNewStream("0",this.localStream,!(null===(n=this.localStream)||void 0===n?void 0:n.getAudioTracks().find((e=>e.enabled))),!(null===(i=this.localStream)||void 0===i?void 0:i.getVideoTracks().find((e=>e.enabled)))))}_handleAcceptStreams(e){var t,n;if(!this.rtcManager)return void this.logger.log("Unable to accept streams, no rtc manager");const i=null===(n=(t=this.rtcManager).shouldAcceptStreamsFromBothSides)||void 0===n?void 0:n.call(t);e.forEach((e=>{const{id:t,streams:n,newJoiner:s}=e;n.forEach((n=>{var r,a;const{id:o,state:c}=n;let p;if("done_accept"!==c&&(p=(s&&"0"===o?"new":"to")+"_accept"),p){if("to_accept"===p||"new_accept"===p&&i||"old_accept"===p&&!i)this.logger.log(`Accepting stream ${o} from ${t}`),null===(r=this.rtcManager)||void 0===r||r.acceptNewStream({streamId:"0"===o?t:o,clientId:t,shouldAddLocalVideo:"0"===o,activeBreakout:false});else if("new_accept"===p||"old_accept"===p);else if("to_unaccept"===p)this.logger.log(`Disconnecting stream ${o} from ${t}`),null===(a=this.rtcManager)||void 0===a||a.disconnect("0"===o?t:o,false);else if("done_accept"!==p)return void this.logger.warn(`Stream state not handled: ${p} for ${t}-${o}`);e.updateStreamState(o,c.replace(/to_|new_|old_/,"done_"))}}))}))}_handleStreamAdded({clientId:e,stream:t,streamId:n}){this.remoteParticipants.find((t=>t.id===e))?this.dispatchEvent(new CustomEvent("participant_stream_added",{detail:{participantId:e,stream:t,streamId:n}})):this.logger.log("WARN: Could not find participant for incoming stream")}join(){return mn(this,void 0,void 0,(function*(){if(["connected","connecting"].includes(this.roomConnectionState))return void console.warn(`Trying to join room state is ${this.roomConnectionState}`);if(this.logger.log("Joining room"),this.roomConnectionState="connecting",!this.localStream&&this.localMediaConstraints){const e=yield navigator.mediaDevices.getUserMedia(this.localMediaConstraints);this.localStream=e}const e=yield this.organizationServiceCache.fetchOrganization();if(!e)throw new Error("Invalid room url");const t={getMediaConstraints:()=>{var e,t;return{audio:!!(null===(e=this.localStream)||void 0===e?void 0:e.getAudioTracks().find((e=>e.enabled))),video:!!(null===(t=this.localStream)||void 0===t?void 0:t.getVideoTracks().find((e=>e.enabled)))}},deferrable:e=>!e};this.rtcManagerDispatcher=new Xh({emitter:{emit:this._handleRtcEvent.bind(this)},serverSocket:this.signalSocket,webrtcProvider:t,features:{lowDataModeEnabled:!1,sfuServerOverrideHost:void 0,turnServerOverrideHost:void 0,useOnlyTURN:void 0,vp9On:!1,h264On:!1,simulcastScreenshareOn:!1}});const n=yield this.credentialsService.getCredentials();setTimeout((()=>{this.logger.log("Connected to signal socket"),this.signalSocket.emit("identify_device",{deviceCredentials:n})}),2e3),this.signalSocket.once("device_identified",(()=>{var t,n;this.signalSocket.emit("join_room",{avatarUrl:null,config:{isAudioEnabled:!!(null===(t=this.localStream)||void 0===t?void 0:t.getAudioTracks().find((e=>e.enabled))),isVideoEnabled:!!(null===(n=this.localStream)||void 0===n?void 0:n.getVideoTracks().find((e=>e.enabled)))},deviceCapabilities:{canScreenshare:!0},displayName:this.displayName,isCoLocated:!1,isDevicePermissionDenied:!1,kickFromOtherRooms:!1,organizationId:e.organizationId,roomKey:null,roomName:this.roomUrl.pathname,selfId:""})})),this.signalSocket.once("room_joined",(e=>{const{selfId:t,room:{clients:n}}=e,i=n.find((e=>e.id===t));if(!i)throw new Error("Missing local client");this.localParticipant=new ty(Object.assign(Object.assign({},i),{stream:this.localStream})),this.remoteParticipants=n.filter((e=>e.id!==t)).map((e=>new ey(Object.assign(Object.assign({},e),{newJoiner:!1})))),this.rtcManager&&this._handleAcceptStreams(this.remoteParticipants),this.roomConnectionState="connected",this.dispatchEvent(new CustomEvent("room_joined",{detail:{localParticipant:this.localParticipant,remoteParticipants:this.remoteParticipants}}))}))}))}leave(){return new Promise((e=>{if(!this.signalSocket)return e();this.signalSocket.emit("leave_room");const t=setTimeout((()=>{e()}),200);this.signalSocket.once("room_left",(()=>{clearTimeout(t),this.signalSocket.disconnect(),e()}))}))}toggleCamera(e){var t;const n=null===(t=this.localStream)||void 0===t?void 0:t.getVideoTracks()[0];if(!n)return void this.logger.log("Tried toggling non-existing video track");const i=null!=e?e:!n.enabled;n.enabled=i,this.signalSocket.emit("enable_video",{enabled:i})}toggleMicrophone(e){var t;const n=null===(t=this.localStream)||void 0===t?void 0:t.getAudioTracks()[0];if(!n)return void this.logger.log("Tried toggling non-existing audio track");const i=null!=e?e:!n.enabled;n.enabled=i,this.signalSocket.emit("enable_audio",{enabled:i})}setDisplayName(e){this.signalSocket.emit("send_client_metadata",{type:"UserData",payload:{displayName:e}})}}function ay(e,t,n){const i=e.find((e=>e.id===t));if(!i)return e;const s=e.indexOf(i);return[...e.slice(0,s),Object.assign(Object.assign({},i),n),...e.slice(s+1)]}function oy(e,t){switch(t.type){case"ROOM_JOINED":return Object.assign(Object.assign({},e),{localParticipant:t.payload.localParticipant,remoteParticipants:t.payload.remoteParticipants,roomConnectionStatus:"connected"});case"PARTICIPANT_AUDIO_ENABLED":return Object.assign(Object.assign({},e),{remoteParticipants:ay(e.remoteParticipants,t.payload.participantId,{isAudioEnabled:t.payload.isAudioEnabled})});case"PARTICIPANT_JOINED":return Object.assign(Object.assign({},e),{remoteParticipants:[...e.remoteParticipants,t.payload.paritipant]});case"PARTICIPANT_LEFT":return Object.assign(Object.assign({},e),{remoteParticipants:[...e.remoteParticipants.filter((e=>e.id!==t.payload.participantId))]});case"PARTICIPANT_STREAM_ADDED":return Object.assign(Object.assign({},e),{remoteParticipants:ay(e.remoteParticipants,t.payload.participantId,{stream:t.payload.stream})});case"PARTICIPANT_VIDEO_ENABLED":return Object.assign(Object.assign({},e),{remoteParticipants:ay(e.remoteParticipants,t.payload.participantId,{isVideoEnabled:t.payload.isVideoEnabled})});case"PARTICIPANT_METADATA_CHANGED":return Object.assign(Object.assign({},e),{remoteParticipants:[...e.remoteParticipants.map((e=>e.id===t.payload.participantId?Object.assign(Object.assign({},e),{displayName:t.payload.displayName}):e))]});case"LOCAL_CLIENT_DISPLAY_NAME_CHANGED":return e.localParticipant?Object.assign(Object.assign({},e),{localParticipant:Object.assign(Object.assign({},e.localParticipant),{displayName:t.payload.displayName})}):e;default:throw e}}function cy(e,t){const[n,i]=nn.useState(null),[s,r]=nn.useReducer(oy,{remoteParticipants:[]});return nn.useEffect((()=>{i(new ry(e,t))}),[e]),nn.useEffect((()=>{if(n)return n.addEventListener("participant_audio_enabled",(e=>{const{participantId:t,isAudioEnabled:n}=e.detail;r({type:"PARTICIPANT_AUDIO_ENABLED",payload:{participantId:t,isAudioEnabled:n}})})),n.addEventListener("participant_joined",(e=>{const{remoteParticipant:t}=e.detail;r({type:"PARTICIPANT_JOINED",payload:{paritipant:t}})})),n.addEventListener("participant_left",(e=>{const{participantId:t}=e.detail;r({type:"PARTICIPANT_LEFT",payload:{participantId:t}})})),n.addEventListener("participant_stream_added",(e=>{const{participantId:t,stream:n}=e.detail;r({type:"PARTICIPANT_STREAM_ADDED",payload:{participantId:t,stream:n}})})),n.addEventListener("room_joined",(e=>{const{localParticipant:t,remoteParticipants:n}=e.detail;r({type:"ROOM_JOINED",payload:{localParticipant:t,remoteParticipants:n}})})),n.addEventListener("participant_video_enabled",(e=>{const{participantId:t,isVideoEnabled:n}=e.detail;r({type:"PARTICIPANT_VIDEO_ENABLED",payload:{participantId:t,isVideoEnabled:n}})})),n.addEventListener("participant_metadata_changed",(e=>{const{participantId:t,displayName:n}=e.detail;r({type:"PARTICIPANT_METADATA_CHANGED",payload:{participantId:t,displayName:n}})})),n.join(),()=>{n.leave()}}),[n]),[s,{toggleCamera:e=>{null==n||n.toggleCamera(e)},toggleMicrophone:e=>{null==n||n.toggleMicrophone(e)},setDisplayName:e=>{null==n||n.setDisplayName(e),r({type:"LOCAL_CLIENT_DISPLAY_NAME_CHANGED",payload:{displayName:e}})}},{VideoView:un}]}const py="2.0.0-alpha2";export{py as sdkVersion,cy as useRoomConnection};
105
+ function(e){var t=Hf,n=f.extname,i=/^\s*([^;\s]*)(?:;|\s|$)/,s=/^text\//i;function r(e){if(!e||"string"!=typeof e)return!1;var n=i.exec(e),r=n&&t[n[1].toLowerCase()];return r&&r.charset?r.charset:!(!n||!s.test(n[1]))&&"UTF-8"}e.charset=r,e.charsets={lookup:r},e.contentType=function(t){if(!t||"string"!=typeof t)return!1;var n=-1===t.indexOf("/")?e.lookup(t):t;if(!n)return!1;if(-1===n.indexOf("charset")){var i=e.charset(n);i&&(n+="; charset="+i.toLowerCase())}return n},e.extension=function(t){if(!t||"string"!=typeof t)return!1;var n=i.exec(t),s=n&&e.extensions[n[1].toLowerCase()];if(!s||!s.length)return!1;return s[0]},e.extensions=Object.create(null),e.lookup=function(t){if(!t||"string"!=typeof t)return!1;var i=n("x."+t).toLowerCase().substr(1);if(!i)return!1;return e.types[i]||!1},e.types=Object.create(null),function(e,n){var i=["nginx","apache",void 0,"iana"];Object.keys(t).forEach((function(s){var r=t[s],a=r.extensions;if(a&&a.length){e[s]=a;for(var o=0;o<a.length;o++){var c=a[o];if(n[c]){var p=i.indexOf(t[n[c]].source),d=i.indexOf(r.source);if("application/octet-stream"!==n[c]&&(p>d||p===d&&"application/"===n[c].substr(0,12)))continue}n[c]=s}}}))}(e.extensions,e.types)}(Vf);var Gf=function(e){var t="function"==typeof setImmediate?setImmediate:"object"==typeof process&&"function"==typeof process.nextTick?process.nextTick:null;t?t(e):setTimeout(e,0)},Kf=function(e){var t=!1;return Gf((function(){t=!0})),function(n,i){t?e(n,i):Gf((function(){e(n,i)}))}};var Jf=function(e){Object.keys(e.jobs).forEach(Qf.bind(e)),e.jobs={}};function Qf(e){"function"==typeof this.jobs[e]&&this.jobs[e]()}var Yf=Kf,Xf=Jf,Zf=function(e,t,n,i){var s=n.keyedList?n.keyedList[n.index]:n.index;n.jobs[s]=function(e,t,n,i){var s;s=2==e.length?e(n,Yf(i)):e(n,t,Yf(i));return s}(t,s,e[s],(function(e,t){s in n.jobs&&(delete n.jobs[s],e?Xf(n):n.results[s]=t,i(e,n.results))}))};var eg=function(e,t){var n=!Array.isArray(e),i={index:0,keyedList:n||t?Object.keys(e):null,jobs:{},results:n?{}:[],size:n?Object.keys(e).length:e.length};t&&i.keyedList.sort(n?t:function(n,i){return t(e[n],e[i])});return i};var tg=Jf,ng=Kf,ig=function(e){if(!Object.keys(this.jobs).length)return;this.index=this.size,tg(this),ng(e)(null,this.results)};var sg=Zf,rg=eg,ag=ig,og=function(e,t,n){var i=rg(e);for(;i.index<(i.keyedList||e).length;)sg(e,t,i,(function(e,t){e?n(e,t):0!==Object.keys(i.jobs).length||n(null,i.results)})),i.index++;return ag.bind(i,n)};var cg={},pg=Zf,dg=eg,lg=ig;function ug(e,t){return e<t?-1:e>t?1:0}({get exports(){return cg},set exports(e){cg=e}}).exports=function(e,t,n,i){var s=dg(e,n);return pg(e,t,s,(function n(r,a){r?i(r,a):(s.index++,s.index<(s.keyedList||e).length?pg(e,t,s,n):i(null,s.results))})),lg.bind(s,i)},cg.ascending=ug,cg.descending=function(e,t){return-1*ug(e,t)};var mg=cg;var hg={parallel:og,serial:function(e,t,n){return mg(e,t,null,n)},serialOrdered:cg},fg=qf,gg=t,vg=f,bg=a,yg=o,_g=s.parse,xg=n,wg=p.Stream,Sg=Vf,kg=hg,Cg=function(e,t){return Object.keys(t).forEach((function(n){e[n]=e[n]||t[n]})),e},Rg=Tg;function Tg(e){if(!(this instanceof Tg))return new Tg(e);for(var t in this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],fg.call(this),e=e||{})this[t]=e[t]}function Pg(e){return jf.isPlainObject(e)||jf.isArray(e)}function Eg(e){return jf.endsWith(e,"[]")?e.slice(0,-2):e}function Og(e,t,n){return e?e.concat(t).map((function(e,t){return e=Eg(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}gg.inherits(Tg,fg),Tg.LINE_BREAK="\r\n",Tg.DEFAULT_CONTENT_TYPE="application/octet-stream",Tg.prototype.append=function(e,t,n){"string"==typeof(n=n||{})&&(n={filename:n});var i=fg.prototype.append.bind(this);if("number"==typeof t&&(t=""+t),gg.isArray(t))this._error(new Error("Arrays are not supported."));else{var s=this._multiPartHeader(e,t,n),r=this._multiPartFooter();i(s),i(t),i(r),this._trackLength(s,t,n)}},Tg.prototype._trackLength=function(e,t,n){var i=0;null!=n.knownLength?i+=+n.knownLength:Buffer.isBuffer(t)?i=t.length:"string"==typeof t&&(i=Buffer.byteLength(t)),this._valueLength+=i,this._overheadLength+=Buffer.byteLength(e)+Tg.LINE_BREAK.length,t&&(t.path||t.readable&&t.hasOwnProperty("httpVersion")||t instanceof wg)&&(n.knownLength||this._valuesToMeasure.push(t))},Tg.prototype._lengthRetriever=function(e,t){e.hasOwnProperty("fd")?null!=e.end&&e.end!=1/0&&null!=e.start?t(null,e.end+1-(e.start?e.start:0)):xg.stat(e.path,(function(n,i){var s;n?t(n):(s=i.size-(e.start?e.start:0),t(null,s))})):e.hasOwnProperty("httpVersion")?t(null,+e.headers["content-length"]):e.hasOwnProperty("httpModule")?(e.on("response",(function(n){e.pause(),t(null,+n.headers["content-length"])})),e.resume()):t("Unknown stream")},Tg.prototype._multiPartHeader=function(e,t,n){if("string"==typeof n.header)return n.header;var i,s=this._getContentDisposition(t,n),r=this._getContentType(t,n),a="",o={"Content-Disposition":["form-data",'name="'+e+'"'].concat(s||[]),"Content-Type":[].concat(r||[])};for(var c in"object"==typeof n.header&&Cg(o,n.header),o)o.hasOwnProperty(c)&&null!=(i=o[c])&&(Array.isArray(i)||(i=[i]),i.length&&(a+=c+": "+i.join("; ")+Tg.LINE_BREAK));return"--"+this.getBoundary()+Tg.LINE_BREAK+a+Tg.LINE_BREAK},Tg.prototype._getContentDisposition=function(e,t){var n,i;return"string"==typeof t.filepath?n=vg.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e.name||e.path?n=vg.basename(t.filename||e.name||e.path):e.readable&&e.hasOwnProperty("httpVersion")&&(n=vg.basename(e.client._httpMessage.path||"")),n&&(i='filename="'+n+'"'),i},Tg.prototype._getContentType=function(e,t){var n=t.contentType;return!n&&e.name&&(n=Sg.lookup(e.name)),!n&&e.path&&(n=Sg.lookup(e.path)),!n&&e.readable&&e.hasOwnProperty("httpVersion")&&(n=e.headers["content-type"]),n||!t.filepath&&!t.filename||(n=Sg.lookup(t.filepath||t.filename)),n||"object"!=typeof e||(n=Tg.DEFAULT_CONTENT_TYPE),n},Tg.prototype._multiPartFooter=function(){return function(e){var t=Tg.LINE_BREAK;0===this._streams.length&&(t+=this._lastBoundary()),e(t)}.bind(this)},Tg.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+Tg.LINE_BREAK},Tg.prototype.getHeaders=function(e){var t,n={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)e.hasOwnProperty(t)&&(n[t.toLowerCase()]=e[t]);return n},Tg.prototype.setBoundary=function(e){this._boundary=e},Tg.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary},Tg.prototype.getBuffer=function(){for(var e=new Buffer.alloc(0),t=this.getBoundary(),n=0,i=this._streams.length;n<i;n++)"function"!=typeof this._streams[n]&&(e=Buffer.isBuffer(this._streams[n])?Buffer.concat([e,this._streams[n]]):Buffer.concat([e,Buffer.from(this._streams[n])]),"string"==typeof this._streams[n]&&this._streams[n].substring(2,t.length+2)===t||(e=Buffer.concat([e,Buffer.from(Tg.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])},Tg.prototype._generateBoundary=function(){for(var e="--------------------------",t=0;t<24;t++)e+=Math.floor(10*Math.random()).toString(16);this._boundary=e},Tg.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;return this._streams.length&&(e+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),e},Tg.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e},Tg.prototype.getLength=function(e){var t=this._overheadLength+this._valueLength;this._streams.length&&(t+=this._lastBoundary().length),this._valuesToMeasure.length?kg.parallel(this._valuesToMeasure,this._lengthRetriever,(function(n,i){n?e(n):(i.forEach((function(e){t+=e})),e(null,t))})):process.nextTick(e.bind(this,null,t))},Tg.prototype.submit=function(e,t){var n,i,s={method:"post"};return"string"==typeof e?(e=_g(e),i=Cg({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},s)):(i=Cg(e,s)).port||(i.port="https:"==i.protocol?443:80),i.headers=this.getHeaders(e.headers),n="https:"==i.protocol?yg.request(i):bg.request(i),this.getLength(function(e,i){if(e&&"Unknown stream"!==e)this._error(e);else if(i&&n.setHeader("Content-Length",i),this.pipe(n),t){var s,r=function(e,i){return n.removeListener("error",r),n.removeListener("response",s),t.call(this,e,i)};s=r.bind(this,null),n.on("error",r),n.on("response",s)}}.bind(this)),n},Tg.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))},Tg.prototype.toString=function(){return"[object FormData]"};const Dg=jf.toFlatObject(jf,{},null,(function(e){return/^is[A-Z]/.test(e)}));function jg(e,t,n){if(!jf.isObject(e))throw new TypeError("target must be an object");t=t||new(Rg||FormData);const i=(n=jf.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!jf.isUndefined(t[e])}))).metaTokens,s=n.visitor||d,r=n.dots,a=n.indexes,o=(n.Blob||"undefined"!=typeof Blob&&Blob)&&((c=t)&&jf.isFunction(c.append)&&"FormData"===c[Symbol.toStringTag]&&c[Symbol.iterator]);var c;if(!jf.isFunction(s))throw new TypeError("visitor must be a function");function p(e){if(null===e)return"";if(jf.isDate(e))return e.toISOString();if(!o&&jf.isBlob(e))throw new If("Blob is not supported. Use a Buffer instead.");return jf.isArrayBuffer(e)||jf.isTypedArray(e)?o&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function d(e,n,s){let o=e;if(e&&!s&&"object"==typeof e)if(jf.endsWith(n,"{}"))n=i?n:n.slice(0,-2),e=JSON.stringify(e);else if(jf.isArray(e)&&function(e){return jf.isArray(e)&&!e.some(Pg)}(e)||jf.isFileList(e)||jf.endsWith(n,"[]")&&(o=jf.toArray(e)))return n=Eg(n),o.forEach((function(e,i){!jf.isUndefined(e)&&null!==e&&t.append(!0===a?Og([n],i,r):null===a?n:n+"[]",p(e))})),!1;return!!Pg(e)||(t.append(Og(s,n,r),p(e)),!1)}const l=[],u=Object.assign(Dg,{defaultVisitor:d,convertValue:p,isVisitable:Pg});if(!jf.isObject(e))throw new TypeError("data must be an object");return function e(n,i){if(!jf.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+i.join("."));l.push(n),jf.forEach(n,(function(n,r){!0===(!(jf.isUndefined(n)||null===n)&&s.call(t,n,jf.isString(r)?r.trim():r,i,u))&&e(n,i?i.concat(r):[r])})),l.pop()}}(e),t}function Ig(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function Mg(e,t){this._pairs=[],e&&jg(e,this,t)}const Lg=Mg.prototype;function Ag(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Ng(e,t,n){if(!t)return e;const i=n&&n.encode||Ag,s=n&&n.serialize;let r;if(r=s?s(t,n):jf.isURLSearchParams(t)?t.toString():new Mg(t,n).toString(i),r){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+r}return e}Lg.append=function(e,t){this._pairs.push([e,t])},Lg.toString=function(e){const t=e?function(t){return e.call(this,t,Ig)}:Ig;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};class Bg{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){jf.forEach(this.handlers,(function(t){null!==t&&e(t)}))}}var Fg={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Ug={isNode:!0,classes:{URLSearchParams:s.URLSearchParams,FormData:Rg,Blob:"undefined"!=typeof Blob&&Blob||null},protocols:["http","https","file","data"]};function zg(e){function t(e,n,i,s){let r=e[s++];const a=Number.isFinite(+r),o=s>=e.length;if(r=!r&&jf.isArray(i)?i.length:r,o)return jf.hasOwnProp(i,r)?i[r]=[i[r],n]:i[r]=n,!a;i[r]&&jf.isObject(i[r])||(i[r]=[]);return t(e,n,i[r],s)&&jf.isArray(i[r])&&(i[r]=function(e){const t={},n=Object.keys(e);let i;const s=n.length;let r;for(i=0;i<s;i++)r=n[i],t[r]=e[r];return t}(i[r])),!a}if(jf.isFormData(e)&&jf.isFunction(e.entries)){const n={};return jf.forEachEntry(e,((e,i)=>{t(function(e){return jf.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),i,n,0)})),n}return null}const qg={"Content-Type":void 0};const $g={transitional:Fg,adapter:["xhr","http"],transformRequest:[function(e,t){const n=t.getContentType()||"",i=n.indexOf("application/json")>-1,s=jf.isObject(e);s&&jf.isHTMLForm(e)&&(e=new FormData(e));if(jf.isFormData(e))return i&&i?JSON.stringify(zg(e)):e;if(jf.isArrayBuffer(e)||jf.isBuffer(e)||jf.isStream(e)||jf.isFile(e)||jf.isBlob(e))return e;if(jf.isArrayBufferView(e))return e.buffer;if(jf.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let r;if(s){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return jg(e,new Ug.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,i){return jf.isBuffer(e)?(this.append(t,e.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((r=jf.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return jg(r?{"files[]":e}:e,t&&new t,this.formSerializer)}}return s||i?(t.setContentType("application/json",!1),function(e,t,n){if(jf.isString(e))try{return(t||JSON.parse)(e),jf.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||$g.transitional,n=t&&t.forcedJSONParsing,i="json"===this.responseType;if(e&&jf.isString(e)&&(n&&!this.responseType||i)){const n=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw If.from(e,If.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ug.classes.FormData,Blob:Ug.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};jf.forEach(["delete","get","head"],(function(e){$g.headers[e]={}})),jf.forEach(["post","put","patch"],(function(e){$g.headers[e]=jf.merge(qg)}));const Vg=jf.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const Hg=Symbol("internals");function Wg(e){return e&&String(e).trim().toLowerCase()}function Gg(e){return!1===e||null==e?e:jf.isArray(e)?e.map(Gg):String(e)}function Kg(e,t,n,i){return jf.isFunction(i)?i.call(this,t,n):jf.isString(t)?jf.isString(i)?-1!==t.indexOf(i):jf.isRegExp(i)?i.test(t):void 0:void 0}class Jg{constructor(e){e&&this.set(e)}set(e,t,n){const i=this;function s(e,t,n){const s=Wg(t);if(!s)throw new Error("header name must be a non-empty string");const r=jf.findKey(i,s);(!r||void 0===i[r]||!0===n||void 0===n&&!1!==i[r])&&(i[r||t]=Gg(e))}const r=(e,t)=>jf.forEach(e,((e,n)=>s(e,n,t)));return jf.isPlainObject(e)||e instanceof this.constructor?r(e,t):jf.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z]+$/.test(e.trim())?r((e=>{const t={};let n,i,s;return e&&e.split("\n").forEach((function(e){s=e.indexOf(":"),n=e.substring(0,s).trim().toLowerCase(),i=e.substring(s+1).trim(),!n||t[n]&&Vg[n]||("set-cookie"===n?t[n]?t[n].push(i):t[n]=[i]:t[n]=t[n]?t[n]+", "+i:i)})),t})(e),t):null!=e&&s(t,e,n),this}get(e,t){if(e=Wg(e)){const n=jf.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let i;for(;i=n.exec(e);)t[i[1]]=i[2];return t}(e);if(jf.isFunction(t))return t.call(this,e,n);if(jf.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Wg(e)){const n=jf.findKey(this,e);return!(!n||t&&!Kg(0,this[n],n,t))}return!1}delete(e,t){const n=this;let i=!1;function s(e){if(e=Wg(e)){const s=jf.findKey(n,e);!s||t&&!Kg(0,n[s],s,t)||(delete n[s],i=!0)}}return jf.isArray(e)?e.forEach(s):s(e),i}clear(){return Object.keys(this).forEach(this.delete.bind(this))}normalize(e){const t=this,n={};return jf.forEach(this,((i,s)=>{const r=jf.findKey(n,s);if(r)return t[r]=Gg(i),void delete t[s];const a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(s):String(s).trim();a!==s&&delete t[s],t[a]=Gg(i),n[a]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return jf.forEach(this,((n,i)=>{null!=n&&!1!==n&&(t[i]=e&&jf.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[Hg]=this[Hg]={accessors:{}}).accessors,n=this.prototype;function i(e){const i=Wg(e);t[i]||(!function(e,t){const n=jf.toCamelCase(" "+t);["get","set","has"].forEach((i=>{Object.defineProperty(e,i+n,{value:function(e,n,s){return this[i].call(this,t,e,n,s)},configurable:!0})}))}(n,e),t[i]=!0)}return jf.isArray(e)?e.forEach(i):i(e),this}}function Qg(e,t){const n=this||$g,i=t||n,s=Jg.from(i.headers);let r=i.data;return jf.forEach(e,(function(e){r=e.call(n,r,s.normalize(),t?t.status:void 0)})),s.normalize(),r}function Yg(e){return!(!e||!e.__CANCEL__)}function Xg(e,t,n){If.call(this,null==e?"canceled":e,If.ERR_CANCELED,t,n),this.name="CanceledError"}function Zg(e,t,n){const i=n.config.validateStatus;n.status&&i&&!i(n.status)?t(new If("Request failed with status code "+n.status,[If.ERR_BAD_REQUEST,If.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}function ev(e,t){return e&&!function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}(t)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}Jg.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent"]),jf.freezeMethods(Jg.prototype),jf.freezeMethods(Jg),jf.inherits(Xg,If,{__CANCEL__:!0});var tv=s.parse,nv={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443},iv=String.prototype.endsWith||function(e){return e.length<=this.length&&-1!==this.indexOf(e,this.length-e.length)};function sv(e){return process.env[e.toLowerCase()]||process.env[e.toUpperCase()]||""}var rv,av=function(e){var t="string"==typeof e?tv(e):e||{},n=t.protocol,i=t.host,s=t.port;if("string"!=typeof i||!i||"string"!=typeof n)return"";if(n=n.split(":",1)[0],!function(e,t){var n=(sv("npm_config_no_proxy")||sv("no_proxy")).toLowerCase();if(!n)return!0;if("*"===n)return!1;return n.split(/[,\s]/).every((function(n){if(!n)return!0;var i=n.match(/^(.+):(\d+)$/),s=i?i[1]:n,r=i?parseInt(i[2]):0;return!(!r||r===t)||(/^[.*]/.test(s)?("*"===s.charAt(0)&&(s=s.slice(1)),!iv.call(e,s)):e!==s)}))}(i=i.replace(/:\d*$/,""),s=parseInt(s)||nv[n]||0))return"";var r=sv("npm_config_"+n+"_proxy")||sv(n+"_proxy")||sv("npm_config_proxy")||sv("all_proxy");return r&&-1===r.indexOf("://")&&(r=n+"://"+r),r},ov={},cv={get exports(){return ov},set exports(e){ov=e}},pv=s,dv=pv.URL,lv=a,uv=o,mv=p.Writable,hv=m,fv=function(){if(!rv){try{rv=gc("follow-redirects")}catch(e){}"function"!=typeof rv&&(rv=function(){})}rv.apply(null,arguments)},gv=["abort","aborted","connect","error","socket","timeout"],vv=Object.create(null);gv.forEach((function(e){vv[e]=function(t,n,i){this._redirectable.emit(e,t,n,i)}}));var bv=Pv("ERR_INVALID_URL","Invalid URL",TypeError),yv=Pv("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),_v=Pv("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded"),xv=Pv("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),wv=Pv("ERR_STREAM_WRITE_AFTER_END","write after end");function Sv(e,t){mv.call(this),this._sanitizeOptions(e),this._options=e,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],t&&this.on("response",t);var n=this;this._onNativeResponse=function(e){n._processResponse(e)},this._performRequest()}function kv(e){var t={maxRedirects:21,maxBodyLength:10485760},n={};return Object.keys(e).forEach((function(i){var s=i+":",r=n[s]=e[i],a=t[i]=Object.create(r);Object.defineProperties(a,{request:{value:function(e,i,r){if(Ov(e)){var a;try{a=Rv(new dv(e))}catch(t){a=pv.parse(e)}if(!Ov(a.protocol))throw new bv({input:e});e=a}else dv&&e instanceof dv?e=Rv(e):(r=i,i=e,e={protocol:s});return Dv(i)&&(r=i,i=null),(i=Object.assign({maxRedirects:t.maxRedirects,maxBodyLength:t.maxBodyLength},e,i)).nativeProtocols=n,Ov(i.host)||Ov(i.hostname)||(i.hostname="::1"),hv.equal(i.protocol,s,"protocol mismatch"),fv("options",i),new Sv(i,r)},configurable:!0,enumerable:!0,writable:!0},get:{value:function(e,t,n){var i=a.request(e,t,n);return i.end(),i},configurable:!0,enumerable:!0,writable:!0}})})),t}function Cv(){}function Rv(e){var t={protocol:e.protocol,hostname:e.hostname.startsWith("[")?e.hostname.slice(1,-1):e.hostname,hash:e.hash,search:e.search,pathname:e.pathname,path:e.pathname+e.search,href:e.href};return""!==e.port&&(t.port=Number(e.port)),t}function Tv(e,t){var n;for(var i in t)e.test(i)&&(n=t[i],delete t[i]);return null==n?void 0:String(n).trim()}function Pv(e,t,n){function i(n){Error.captureStackTrace(this,this.constructor),Object.assign(this,n||{}),this.code=e,this.message=this.cause?t+": "+this.cause.message:t}return i.prototype=new(n||Error),i.prototype.constructor=i,i.prototype.name="Error ["+e+"]",i}function Ev(e){for(var t of gv)e.removeListener(t,vv[t]);e.on("error",Cv),e.abort()}function Ov(e){return"string"==typeof e||e instanceof String}function Dv(e){return"function"==typeof e}Sv.prototype=Object.create(mv.prototype),Sv.prototype.abort=function(){Ev(this._currentRequest),this.emit("abort")},Sv.prototype.write=function(e,t,n){if(this._ending)throw new wv;if(!Ov(e)&&("object"!=typeof(i=e)||!("length"in i)))throw new TypeError("data should be a string, Buffer or Uint8Array");var i;Dv(t)&&(n=t,t=null),0!==e.length?this._requestBodyLength+e.length<=this._options.maxBodyLength?(this._requestBodyLength+=e.length,this._requestBodyBuffers.push({data:e,encoding:t}),this._currentRequest.write(e,t,n)):(this.emit("error",new xv),this.abort()):n&&n()},Sv.prototype.end=function(e,t,n){if(Dv(e)?(n=e,e=t=null):Dv(t)&&(n=t,t=null),e){var i=this,s=this._currentRequest;this.write(e,t,(function(){i._ended=!0,s.end(null,null,n)})),this._ending=!0}else this._ended=this._ending=!0,this._currentRequest.end(null,null,n)},Sv.prototype.setHeader=function(e,t){this._options.headers[e]=t,this._currentRequest.setHeader(e,t)},Sv.prototype.removeHeader=function(e){delete this._options.headers[e],this._currentRequest.removeHeader(e)},Sv.prototype.setTimeout=function(e,t){var n=this;function i(t){t.setTimeout(e),t.removeListener("timeout",t.destroy),t.addListener("timeout",t.destroy)}function s(t){n._timeout&&clearTimeout(n._timeout),n._timeout=setTimeout((function(){n.emit("timeout"),r()}),e),i(t)}function r(){n._timeout&&(clearTimeout(n._timeout),n._timeout=null),n.removeListener("abort",r),n.removeListener("error",r),n.removeListener("response",r),t&&n.removeListener("timeout",t),n.socket||n._currentRequest.removeListener("socket",s)}return t&&this.on("timeout",t),this.socket?s(this.socket):this._currentRequest.once("socket",s),this.on("socket",i),this.on("abort",r),this.on("error",r),this.on("response",r),this},["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach((function(e){Sv.prototype[e]=function(t,n){return this._currentRequest[e](t,n)}})),["aborted","connection","socket"].forEach((function(e){Object.defineProperty(Sv.prototype,e,{get:function(){return this._currentRequest[e]}})})),Sv.prototype._sanitizeOptions=function(e){if(e.headers||(e.headers={}),e.host&&(e.hostname||(e.hostname=e.host),delete e.host),!e.pathname&&e.path){var t=e.path.indexOf("?");t<0?e.pathname=e.path:(e.pathname=e.path.substring(0,t),e.search=e.path.substring(t))}},Sv.prototype._performRequest=function(){var e=this._options.protocol,t=this._options.nativeProtocols[e];if(t){if(this._options.agents){var n=e.slice(0,-1);this._options.agent=this._options.agents[n]}var i=this._currentRequest=t.request(this._options,this._onNativeResponse);for(var s of(i._redirectable=this,gv))i.on(s,vv[s]);if(this._currentUrl=/^\//.test(this._options.path)?pv.format(this._options):this._options.path,this._isRedirect){var r=0,a=this,o=this._requestBodyBuffers;!function e(t){if(i===a._currentRequest)if(t)a.emit("error",t);else if(r<o.length){var n=o[r++];i.finished||i.write(n.data,n.encoding,e)}else a._ended&&i.end()}()}}else this.emit("error",new TypeError("Unsupported protocol "+e))},Sv.prototype._processResponse=function(e){var t=e.statusCode;this._options.trackRedirects&&this._redirects.push({url:this._currentUrl,headers:e.headers,statusCode:t});var n=e.headers.location;if(!n||!1===this._options.followRedirects||t<300||t>=400)return e.responseUrl=this._currentUrl,e.redirects=this._redirects,this.emit("response",e),void(this._requestBodyBuffers=[]);if(Ev(this._currentRequest),e.destroy(),++this._redirectCount>this._options.maxRedirects)this.emit("error",new _v);else{var i,s=this._options.beforeRedirect;s&&(i=Object.assign({Host:e.req.getHeader("host")},this._options.headers));var r=this._options.method;((301===t||302===t)&&"POST"===this._options.method||303===t&&!/^(?:GET|HEAD)$/.test(this._options.method))&&(this._options.method="GET",this._requestBodyBuffers=[],Tv(/^content-/i,this._options.headers));var a,o=Tv(/^host$/i,this._options.headers),c=pv.parse(this._currentUrl),p=o||c.host,d=/^\w+:/.test(n)?this._currentUrl:pv.format(Object.assign(c,{host:p}));try{a=pv.resolve(d,n)}catch(e){return void this.emit("error",new yv({cause:e}))}fv("redirecting to",a),this._isRedirect=!0;var l=pv.parse(a);if(Object.assign(this._options,l),(l.protocol!==c.protocol&&"https:"!==l.protocol||l.host!==p&&!function(e,t){hv(Ov(e)&&Ov(t));var n=e.length-t.length-1;return n>0&&"."===e[n]&&e.endsWith(t)}(l.host,p))&&Tv(/^(?:authorization|cookie)$/i,this._options.headers),Dv(s)){var u={headers:e.headers,statusCode:t},m={url:d,method:r,headers:i};try{s(this._options,u,m)}catch(e){return void this.emit("error",e)}this._sanitizeOptions(this._options)}try{this._performRequest()}catch(e){this.emit("error",new yv({cause:e}))}}},cv.exports=kv({http:lv,https:uv}),ov.wrap=kv;function jv(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}const Iv=/^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;function Mv(e,t){e=e||10;const n=new Array(e),i=new Array(e);let s,r=0,a=0;return t=void 0!==t?t:1e3,function(o){const c=Date.now(),p=i[a];s||(s=c),n[r]=o,i[r]=c;let d=a,l=0;for(;d!==r;)l+=n[d++],d%=e;if(r=(r+1)%e,r===a&&(a=(a+1)%e),c-s<t)return;const u=p&&c-p;return u?Math.round(1e3*l/u):void 0}}const Lv=Symbol("internals");class Av extends p.Transform{constructor(e){super({readableHighWaterMark:(e=jf.toFlatObject(e,{maxRate:0,chunkSize:65536,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,((e,t)=>!jf.isUndefined(t[e])))).chunkSize});const t=this,n=this[Lv]={length:e.length,timeWindow:e.timeWindow,ticksRate:e.ticksRate,chunkSize:e.chunkSize,maxRate:e.maxRate,minChunkSize:e.minChunkSize,bytesSeen:0,isCaptured:!1,notifiedBytesLoaded:0,ts:Date.now(),bytes:0,onReadCallback:null},i=Mv(n.ticksRate*e.samplesCount,n.timeWindow);this.on("newListener",(e=>{"progress"===e&&(n.isCaptured||(n.isCaptured=!0))}));let s=0;n.updateProgress=function(e,t){let n=0;const i=1e3/t;let s=null;return function(t,r){const a=Date.now();if(t||a-n>i)return s&&(clearTimeout(s),s=null),n=a,e.apply(null,r);s||(s=setTimeout((()=>(s=null,n=Date.now(),e.apply(null,r))),i-(a-n)))}}((function(){const e=n.length,r=n.bytesSeen,a=r-s;if(!a||t.destroyed)return;const o=i(a);s=r,process.nextTick((()=>{t.emit("progress",{loaded:r,total:e,progress:e?r/e:void 0,bytes:a,rate:o||void 0,estimated:o&&e&&r<=e?(e-r)/o:void 0})}))}),n.ticksRate);const r=()=>{n.updateProgress(!0)};this.once("end",r),this.once("error",r)}_read(e){const t=this[Lv];return t.onReadCallback&&t.onReadCallback(),super._read(e)}_transform(e,t,n){const i=this,s=this[Lv],r=s.maxRate,a=this.readableHighWaterMark,o=s.timeWindow,c=r/(1e3/o),p=!1!==s.minChunkSize?Math.max(s.minChunkSize,.01*c):0;const d=(e,t)=>{const n=Buffer.byteLength(e);let d,l=null,u=a,m=0;if(r){const e=Date.now();(!s.ts||(m=e-s.ts)>=o)&&(s.ts=e,d=c-s.bytes,s.bytes=d<0?-d:0,m=0),d=c-s.bytes}if(r){if(d<=0)return setTimeout((()=>{t(null,e)}),o-m);d<u&&(u=d)}u&&n>u&&n-u>p&&(l=e.subarray(u),e=e.subarray(0,u)),function(e,t){const n=Buffer.byteLength(e);s.bytesSeen+=n,s.bytes+=n,s.isCaptured&&s.updateProgress(),i.push(e)?process.nextTick(t):s.onReadCallback=()=>{s.onReadCallback=null,process.nextTick(t)}}(e,l?()=>{process.nextTick(t,null,l)}:t)};d(e,(function e(t,i){if(t)return n(t);i?d(i,e):n(null)}))}setLength(e){return this[Lv].length=+e,this}}const Nv={flush:u.constants.Z_SYNC_FLUSH,finishFlush:u.constants.Z_SYNC_FLUSH},Bv={flush:u.constants.BROTLI_OPERATION_FLUSH,finishFlush:u.constants.BROTLI_OPERATION_FLUSH},Fv=jf.isFunction(u.createBrotliDecompress),{http:Uv,https:zv}=ov,qv=/https:?/,$v=Ug.protocols.map((e=>e+":"));function Vv(e){e.beforeRedirects.proxy&&e.beforeRedirects.proxy(e),e.beforeRedirects.config&&e.beforeRedirects.config(e)}function Hv(e,t,n){let i=t;if(!i&&!1!==i){const e=av(n);e&&(i=new URL(e))}if(i){if(i.username&&(i.auth=(i.username||"")+":"+(i.password||"")),i.auth){(i.auth.username||i.auth.password)&&(i.auth=(i.auth.username||"")+":"+(i.auth.password||""));const t=Buffer.from(i.auth,"utf8").toString("base64");e.headers["Proxy-Authorization"]="Basic "+t}e.headers.host=e.hostname+(e.port?":"+e.port:"");const t=i.hostname||i.host;e.hostname=t,e.host=t,e.port=i.port,e.path=n,i.protocol&&(e.protocol=i.protocol.includes(":")?i.protocol:`${i.protocol}:`)}e.beforeRedirects.proxy=function(e){Hv(e,t,e.href)}}var Wv="undefined"!=typeof process&&"process"===jf.kindOf(process)&&function(e){return new Promise((function(t,n){let i=e.data;const s=e.responseType,r=e.responseEncoding,c=e.method.toUpperCase();let l,m,h,f=!1;const g=new d;function v(){l||(l=!0,e.cancelToken&&e.cancelToken.unsubscribe(x),e.signal&&e.signal.removeEventListener("abort",x),g.removeAllListeners())}function b(e,i){m||(m=!0,i&&(f=!0,v()),i?n(e):t(e))}const y=function(e){b(e)},_=function(e){b(e,!0)};function x(t){g.emit("abort",!t||t.type?new Xg(null,e,h):t)}g.once("abort",_),(e.cancelToken||e.signal)&&(e.cancelToken&&e.cancelToken.subscribe(x),e.signal&&(e.signal.aborted?x():e.signal.addEventListener("abort",x)));const w=ev(e.baseURL,e.url),S=new URL(w),k=S.protocol||$v[0];if("data:"===k){let t;if("GET"!==c)return Zg(y,_,{status:405,statusText:"method not allowed",headers:{},config:e});try{t=function(e,t,n){const i=n&&n.Blob||Ug.classes.Blob,s=jv(e);if(void 0===t&&i&&(t=!0),"data"===s){e=s.length?e.slice(s.length+1):e;const n=Iv.exec(e);if(!n)throw new If("Invalid URL",If.ERR_INVALID_URL);const r=n[1],a=n[2],o=n[3],c=Buffer.from(decodeURIComponent(o),a?"base64":"utf8");if(t){if(!i)throw new If("Blob is not supported",If.ERR_NOT_SUPPORT);return new i([c],{type:r})}return c}throw new If("Unsupported protocol "+s,If.ERR_NOT_SUPPORT)}(e.url,"blob"===s,{Blob:e.env&&e.env.Blob})}catch(t){throw If.from(t,If.ERR_BAD_REQUEST,e)}return"text"===s?(t=t.toString(r),r&&"utf8"!==r||(i=jf.stripBOM(t))):"stream"===s&&(t=p.Readable.from(t)),Zg(y,_,{data:t,status:200,statusText:"OK",headers:new Jg,config:e})}if(-1===$v.indexOf(k))return _(new If("Unsupported protocol "+k,If.ERR_BAD_REQUEST,e));const C=Jg.from(e.headers).normalize();C.set("User-Agent","axios/1.2.3",!1);const R=e.onDownloadProgress,T=e.onUploadProgress,P=e.maxRate;let E,O;if(jf.isFormData(i)&&jf.isFunction(i.getHeaders))C.set(i.getHeaders());else if(i&&!jf.isStream(i)){if(Buffer.isBuffer(i));else if(jf.isArrayBuffer(i))i=Buffer.from(new Uint8Array(i));else{if(!jf.isString(i))return _(new If("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",If.ERR_BAD_REQUEST,e));i=Buffer.from(i,"utf-8")}if(C.set("Content-Length",i.length,!1),e.maxBodyLength>-1&&i.length>e.maxBodyLength)return _(new If("Request body larger than maxBodyLength limit",If.ERR_BAD_REQUEST,e))}const D=jf.toFiniteNumber(C.getContentLength());let j,I;if(jf.isArray(P)?(E=P[0],O=P[1]):E=O=P,i&&(T||E)&&(jf.isStream(i)||(i=p.Readable.from(i,{objectMode:!1})),i=p.pipeline([i,new Av({length:D,maxRate:jf.toFiniteNumber(E)})],jf.noop),T&&i.on("progress",(e=>{T(Object.assign(e,{upload:!0}))}))),e.auth){j=(e.auth.username||"")+":"+(e.auth.password||"")}if(!j&&S.username){j=S.username+":"+S.password}j&&C.delete("authorization");try{I=Ng(S.pathname+S.search,e.params,e.paramsSerializer).replace(/^\?/,"")}catch(t){const n=new Error(t.message);return n.config=e,n.url=e.url,n.exists=!0,_(n)}C.set("Accept-Encoding","gzip, compress, deflate"+(Fv?", br":""),!1);const M={path:I,method:c,headers:C.toJSON(),agents:{http:e.httpAgent,https:e.httpsAgent},auth:j,protocol:k,beforeRedirect:Vv,beforeRedirects:{}};let L;e.socketPath?M.socketPath=e.socketPath:(M.hostname=S.hostname,M.port=S.port,Hv(M,e.proxy,k+"//"+S.hostname+(S.port?":"+S.port:"")+M.path));const A=qv.test(M.protocol);if(M.agent=A?e.httpsAgent:e.httpAgent,e.transport?L=e.transport:0===e.maxRedirects?L=A?o:a:(e.maxRedirects&&(M.maxRedirects=e.maxRedirects),e.beforeRedirect&&(M.beforeRedirects.config=e.beforeRedirect),L=A?zv:Uv),e.maxBodyLength>-1?M.maxBodyLength=e.maxBodyLength:M.maxBodyLength=1/0,e.insecureHTTPParser&&(M.insecureHTTPParser=e.insecureHTTPParser),h=L.request(M,(function(t){if(h.destroyed)return;const n=[t],i=+t.headers["content-length"];if(R){const e=new Av({length:jf.toFiniteNumber(i),maxRate:jf.toFiniteNumber(O)});R&&e.on("progress",(e=>{R(Object.assign(e,{download:!0}))})),n.push(e)}let a=t;const o=t.req||h;if(!1!==e.decompress&&t.headers["content-encoding"])switch("HEAD"!==c&&204!==t.statusCode||delete t.headers["content-encoding"],t.headers["content-encoding"]){case"gzip":case"x-gzip":case"compress":case"x-compress":case"deflate":n.push(u.createUnzip(Nv)),delete t.headers["content-encoding"];break;case"br":Fv&&(n.push(u.createBrotliDecompress(Bv)),delete t.headers["content-encoding"])}a=n.length>1?p.pipeline(n,jf.noop):n[0];const d=p.finished(a,(()=>{d(),v()})),l={status:t.statusCode,statusText:t.statusMessage,headers:new Jg(t.headers),config:e,request:o};if("stream"===s)l.data=a,Zg(y,_,l);else{const t=[];let n=0;a.on("data",(function(i){t.push(i),n+=i.length,e.maxContentLength>-1&&n>e.maxContentLength&&(f=!0,a.destroy(),_(new If("maxContentLength size of "+e.maxContentLength+" exceeded",If.ERR_BAD_RESPONSE,e,o)))})),a.on("aborted",(function(){if(f)return;const t=new If("maxContentLength size of "+e.maxContentLength+" exceeded",If.ERR_BAD_RESPONSE,e,o);a.destroy(t),_(t)})),a.on("error",(function(t){h.destroyed||_(If.from(t,null,e,o))})),a.on("end",(function(){try{let e=1===t.length?t[0]:Buffer.concat(t);"arraybuffer"!==s&&(e=e.toString(r),r&&"utf8"!==r||(e=jf.stripBOM(e))),l.data=e}catch(t){_(If.from(t,null,e,l.request,l))}Zg(y,_,l)}))}g.once("abort",(e=>{a.destroyed||(a.emit("error",e),a.destroy())}))})),g.once("abort",(e=>{_(e),h.destroy(e)})),h.on("error",(function(t){_(If.from(t,null,e,h))})),h.on("socket",(function(e){e.setKeepAlive(!0,6e4)})),e.timeout){const t=parseInt(e.timeout,10);if(isNaN(t))return void _(new If("error trying to parse `config.timeout` to int",If.ERR_BAD_OPTION_VALUE,e,h));h.setTimeout(t,(function(){if(m)return;let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const n=e.transitional||Fg;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),_(new If(t,n.clarifyTimeoutError?If.ETIMEDOUT:If.ECONNABORTED,e,h)),x()}))}if(jf.isStream(i)){let t=!1,n=!1;i.on("end",(()=>{t=!0})),i.once("error",(e=>{n=!0,h.destroy(e)})),i.on("close",(()=>{t||n||x(new Xg("Request stream has been aborted",e,h))})),i.pipe(h)}else h.end(i)}))},Gv=Ug.isStandardBrowserEnv?{write:function(e,t,n,i,s,r){const a=[];a.push(e+"="+encodeURIComponent(t)),jf.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),jf.isString(i)&&a.push("path="+i),jf.isString(s)&&a.push("domain="+s),!0===r&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},Kv=Ug.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let n;function i(n){let i=n;return e&&(t.setAttribute("href",i),i=t.href),t.setAttribute("href",i),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return n=i(window.location.href),function(e){const t=jf.isString(e)?i(e):e;return t.protocol===n.protocol&&t.host===n.host}}():function(){return!0};function Jv(e,t){let n=0;const i=Mv(50,250);return s=>{const r=s.loaded,a=s.lengthComputable?s.total:void 0,o=r-n,c=i(o);n=r;const p={loaded:r,total:a,progress:a?r/a:void 0,bytes:o,rate:c||void 0,estimated:c&&a&&r<=a?(a-r)/c:void 0,event:s};p[t?"download":"upload"]=!0,e(p)}}const Qv={http:Wv,xhr:"undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){let i=e.data;const s=Jg.from(e.headers).normalize(),r=e.responseType;let a;function o(){e.cancelToken&&e.cancelToken.unsubscribe(a),e.signal&&e.signal.removeEventListener("abort",a)}jf.isFormData(i)&&(Ug.isStandardBrowserEnv||Ug.isStandardBrowserWebWorkerEnv)&&s.setContentType(!1);let c=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",n=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";s.set("Authorization","Basic "+btoa(t+":"+n))}const p=ev(e.baseURL,e.url);function d(){if(!c)return;const i=Jg.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders());Zg((function(e){t(e),o()}),(function(e){n(e),o()}),{data:r&&"text"!==r&&"json"!==r?c.response:c.responseText,status:c.status,statusText:c.statusText,headers:i,config:e,request:c}),c=null}if(c.open(e.method.toUpperCase(),Ng(p,e.params,e.paramsSerializer),!0),c.timeout=e.timeout,"onloadend"in c?c.onloadend=d:c.onreadystatechange=function(){c&&4===c.readyState&&(0!==c.status||c.responseURL&&0===c.responseURL.indexOf("file:"))&&setTimeout(d)},c.onabort=function(){c&&(n(new If("Request aborted",If.ECONNABORTED,e,c)),c=null)},c.onerror=function(){n(new If("Network Error",If.ERR_NETWORK,e,c)),c=null},c.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const i=e.transitional||Fg;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(new If(t,i.clarifyTimeoutError?If.ETIMEDOUT:If.ECONNABORTED,e,c)),c=null},Ug.isStandardBrowserEnv){const t=(e.withCredentials||Kv(p))&&e.xsrfCookieName&&Gv.read(e.xsrfCookieName);t&&s.set(e.xsrfHeaderName,t)}void 0===i&&s.setContentType(null),"setRequestHeader"in c&&jf.forEach(s.toJSON(),(function(e,t){c.setRequestHeader(t,e)})),jf.isUndefined(e.withCredentials)||(c.withCredentials=!!e.withCredentials),r&&"json"!==r&&(c.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&c.addEventListener("progress",Jv(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&c.upload&&c.upload.addEventListener("progress",Jv(e.onUploadProgress)),(e.cancelToken||e.signal)&&(a=t=>{c&&(n(!t||t.type?new Xg(null,e,c):t),c.abort(),c=null)},e.cancelToken&&e.cancelToken.subscribe(a),e.signal&&(e.signal.aborted?a():e.signal.addEventListener("abort",a)));const l=jv(p);l&&-1===Ug.protocols.indexOf(l)?n(new If("Unsupported protocol "+l+":",If.ERR_BAD_REQUEST,e)):c.send(i||null)}))}};jf.forEach(Qv,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));var Yv=e=>{e=jf.isArray(e)?e:[e];const{length:t}=e;let n,i;for(let s=0;s<t&&(n=e[s],!(i=jf.isString(n)?Qv[n.toLowerCase()]:n));s++);if(!i){if(!1===i)throw new If(`Adapter ${n} is not supported by the environment`,"ERR_NOT_SUPPORT");throw new Error(jf.hasOwnProp(Qv,n)?`Adapter '${n}' is not available in the build`:`Unknown adapter '${n}'`)}if(!jf.isFunction(i))throw new TypeError("adapter is not a function");return i};function Xv(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Xg(null,e)}function Zv(e){Xv(e),e.headers=Jg.from(e.headers),e.data=Qg.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return Yv(e.adapter||$g.adapter)(e).then((function(t){return Xv(e),t.data=Qg.call(e,e.transformResponse,t),t.headers=Jg.from(t.headers),t}),(function(t){return Yg(t)||(Xv(e),t&&t.response&&(t.response.data=Qg.call(e,e.transformResponse,t.response),t.response.headers=Jg.from(t.response.headers))),Promise.reject(t)}))}const eb=e=>e instanceof Jg?e.toJSON():e;function tb(e,t){t=t||{};const n={};function i(e,t,n){return jf.isPlainObject(e)&&jf.isPlainObject(t)?jf.merge.call({caseless:n},e,t):jf.isPlainObject(t)?jf.merge({},t):jf.isArray(t)?t.slice():t}function s(e,t,n){return jf.isUndefined(t)?jf.isUndefined(e)?void 0:i(void 0,e,n):i(e,t,n)}function r(e,t){if(!jf.isUndefined(t))return i(void 0,t)}function a(e,t){return jf.isUndefined(t)?jf.isUndefined(e)?void 0:i(void 0,e):i(void 0,t)}function o(n,s,r){return r in t?i(n,s):r in e?i(void 0,n):void 0}const c={url:r,method:r,data:r,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:o,headers:(e,t)=>s(eb(e),eb(t),!0)};return jf.forEach(Object.keys(e).concat(Object.keys(t)),(function(i){const r=c[i]||s,a=r(e[i],t[i],i);jf.isUndefined(a)&&r!==o||(n[i]=a)})),n}const nb={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{nb[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const ib={};nb.transitional=function(e,t,n){function i(e,t){return"[Axios v1.2.3] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,s,r)=>{if(!1===e)throw new If(i(s," has been removed"+(t?" in "+t:"")),If.ERR_DEPRECATED);return t&&!ib[s]&&(ib[s]=!0,console.warn(i(s," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,s,r)}};var sb={assertOptions:function(e,t,n){if("object"!=typeof e)throw new If("options must be an object",If.ERR_BAD_OPTION_VALUE);const i=Object.keys(e);let s=i.length;for(;s-- >0;){const r=i[s],a=t[r];if(a){const t=e[r],n=void 0===t||a(t,r,e);if(!0!==n)throw new If("option "+r+" must be "+n,If.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new If("Unknown option "+r,If.ERR_BAD_OPTION)}},validators:nb};const rb=sb.validators;class ab{constructor(e){this.defaults=e,this.interceptors={request:new Bg,response:new Bg}}request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=tb(this.defaults,t);const{transitional:n,paramsSerializer:i,headers:s}=t;let r;void 0!==n&&sb.assertOptions(n,{silentJSONParsing:rb.transitional(rb.boolean),forcedJSONParsing:rb.transitional(rb.boolean),clarifyTimeoutError:rb.transitional(rb.boolean)},!1),void 0!==i&&sb.assertOptions(i,{encode:rb.function,serialize:rb.function},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase(),r=s&&jf.merge(s.common,s[t.method]),r&&jf.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete s[e]})),t.headers=Jg.concat(r,s);const a=[];let o=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(o=o&&e.synchronous,a.unshift(e.fulfilled,e.rejected))}));const c=[];let p;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let d,l=0;if(!o){const e=[Zv.bind(this),void 0];for(e.unshift.apply(e,a),e.push.apply(e,c),d=e.length,p=Promise.resolve(t);l<d;)p=p.then(e[l++],e[l++]);return p}d=a.length;let u=t;for(l=0;l<d;){const e=a[l++],t=a[l++];try{u=e(u)}catch(e){t.call(this,e);break}}try{p=Zv.call(this,u)}catch(e){return Promise.reject(e)}for(l=0,d=c.length;l<d;)p=p.then(c[l++],c[l++]);return p}getUri(e){return Ng(ev((e=tb(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}jf.forEach(["delete","get","head","options"],(function(e){ab.prototype[e]=function(t,n){return this.request(tb(n||{},{method:e,url:t,data:(n||{}).data}))}})),jf.forEach(["post","put","patch"],(function(e){function t(t){return function(n,i,s){return this.request(tb(s||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:i}))}}ab.prototype[e]=t(),ab.prototype[e+"Form"]=t(!0)}));class ob{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const i=new Promise((e=>{n.subscribe(e),t=e})).then(e);return i.cancel=function(){n.unsubscribe(t)},i},e((function(e,i,s){n.reason||(n.reason=new Xg(e,i,s),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;return{token:new ob((function(t){e=t})),cancel:e}}}const cb={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(cb).forEach((([e,t])=>{cb[t]=e}));const pb=function e(t){const n=new ab(t),i=nf(ab.prototype.request,n);return jf.extend(i,ab.prototype,n,{allOwnKeys:!0}),jf.extend(i,n,null,{allOwnKeys:!0}),i.create=function(n){return e(tb(t,n))},i}($g);pb.Axios=ab,pb.CanceledError=Xg,pb.CancelToken=ob,pb.isCancel=Yg,pb.VERSION="1.2.3",pb.toFormData=jg,pb.AxiosError=If,pb.Cancel=pb.CanceledError,pb.all=function(e){return Promise.all(e)},pb.spread=function(e){return function(t){return e.apply(null,t)}},pb.isAxiosError=function(e){return jf.isObject(e)&&!0===e.isAxiosError},pb.mergeConfig=tb,pb.AxiosHeaders=Jg,pb.formToJSON=e=>zg(jf.isHTMLForm(e)?new FormData(e):e),pb.HttpStatusCode=cb,pb.default=pb;class db{constructor(e={}){this.data=void 0===e.data?{}:e.data,this.headers=e.headers||{},this.status=e.status||200,this.statusText=e.statusText||"OK",this.url=e.url||null}}function lb(e,t){return m.ok(e,`${t} is required`),e}function ub(e,t){return m.ok("boolean"==typeof e,`${t}<boolean> is required`),e}function mb(e,t){return m.ok("number"==typeof e,`${t}<number> is required`),e}function hb(e,t){return m.ok("string"==typeof e,`${t}<string> is required`),e}function fb(e,t,n){const i=n||t.name[0].toLowerCase()+t.name.substring(1);return m.ok(e instanceof t,`${i}<${t.name}> is required`),e}function gb(e,t="roomName"){return hb(e,t),m.equal("string"==typeof e&&e[0],"/",`${t} must begin with a '/'`),e}function vb(e,t){return m.ok(Array.isArray(e),`${t}<array> is required`),e}function bb(e,t){if(null==e||"object"!=typeof e||Array.isArray(e))throw new Error(`${t} must be a record. ${JSON.stringify(e)}`);return e}function yb(e,t,n){hb(t,"name"),function(e,t,n,i){hb(n,"name");const s=i||`${n} must be null or of type ${t}`;m.ok(null===e||typeof e===t,s)}(e,"string",t,n)}function _b({baseUrl:e,url:t}){return m.ok("string"==typeof t,"url<String> is required"),e?e+t:t}class xb{constructor({baseUrl:e}){hb(e,"baseUrl"),this._baseUrl=e}_requestAxios(e,t){const n=Object.assign({},t,{url:e,baseURL:this._baseUrl});return pb.request(n)}request(e,t){return hb(e,"url"),m.equal(e[0],"/",'url<String> only accepts relative URLs beginning with "/".'),m.ok(t,"options are required"),this._requestAxios(e,t).then((e=>{const{data:t,headers:n,status:i,statusText:s,config:r}=e,a=r&&r.url?_b({baseUrl:r.baseURL,url:r.url}):null;return new db({data:t,headers:n,status:i,statusText:s,url:a})})).catch((e=>{const t=e.response;if(!t)throw new Error("Could not make the request.");const{data:n,headers:i,status:s,statusText:r,config:a}=t,o=a&&a.url?_b({baseUrl:a.baseURL,url:a.url}):null;return Promise.reject(new db({data:n,headers:i,status:s,statusText:r,url:o}))}))}}class wb{constructor({httpClient:e}){m.ok(e,"httpClient is required"),this._httpClient=e}static dataToFormData(e){m.ok(e,"data is required");const t=new FormData;return Object.keys(e).forEach((n=>{const i=e[n];t.append(n,i)})),t}request(e,t={}){const n=Object.assign(t.headers||{},{"Content-Type":void 0});return this._httpClient.request(e,Object.assign(t,{headers:n,transformRequest:wb.dataToFormData}))}}let Sb;Sb="object"==typeof window?window.btoa||tf:"object"==typeof global&&global.btoa||tf;const kb=()=>Promise.resolve(null);class Cb{constructor({httpClient:e,fetchDeviceCredentials:t}){this._httpClient=e,this._fetchDeviceCredentials=t}request(e,t){return this._fetchDeviceCredentials().then((n=>{const i=Object.assign({},t.headers,function(e){if(e&&e.credentials){const t=`${e.credentials.uuid}:${e.hmac}`;return{Authorization:`Basic ${Sb(t)}`}}return{}}(n),{"X-Appearin-Device-Platform":"web"}),s=Object.assign({},t,{headers:i});return this._httpClient.request(e,s)}))}}class Rb{constructor({baseUrl:e="https://api.appearin.net",fetchDeviceCredentials:t=kb}={}){hb(e,"baseUrl"),m.ok("function"==typeof t,"fetchDeviceCredentials<Function> is required"),this.authenticatedHttpClient=new Cb({httpClient:new xb({baseUrl:e}),fetchDeviceCredentials:t}),this.authenticatedFormDataHttpClient=new wb({httpClient:this.authenticatedHttpClient})}request(e,t){return hb(e,"url"),m.equal(e[0],"/",'url<String> only accepts relative URLs beginning with "/".'),m.ok(t,"options are required"),this.authenticatedHttpClient.request(e,t)}requestMultipart(e,t){return hb(e,"url"),m.equal(e[0],"/",'url<String> only accepts relative URLs beginning with "/".'),m.ok(t,"options are required"),this.authenticatedFormDataHttpClient.request(e,t)}}function Tb(e,t){return hb(bb(e,"data")[t],t)}const Pb=(Eb=Tb,(e,t)=>{const n=bb(e,"data")[t];return null==n?null:Eb(e,t)});var Eb;function Ob(e,t){const n=Tb(e,t),i=new Date(n);if(isNaN(i.getTime()))throw new Error(`Invalid date for ${n}`);return i}function Db(e,t,n){return function(e,t){return vb(bb(e,"data")[t],t)}(e,t).map((e=>n(e)))}class jb{constructor(e,t,n){this.credentials={uuid:e},this.hmac=t,this.userId=n}toJson(){return Object.assign({credentials:this.credentials,hmac:this.hmac},this.userId&&{userId:this.userId})}static fromJson(e){return new jb(Tb(function(e,t){const n=bb(e,"data")[t];return void 0===n?null:n}(e,"credentials"),"uuid"),Tb(e,"hmac"),Pb(e,"userId")||void 0)}}class Ib{constructor({apiClient:e}){this._apiClient=fb(e,Rb)}getCredentials(){return this._apiClient.request("/devices",{method:"post"}).then((({data:e})=>jb.fromJson(e))).catch((e=>{if(e.response&&404===e.response.status)return null;throw e}))}}class Mb{constructor(e,t){this._key=e,this._chromeStorage=t}loadOrDefault(e){return new Promise((t=>{this._chromeStorage.get(this._key,(n=>{t(n[this._key]||e)}))}))}save(e){return new Promise((t=>{this._chromeStorage.set({[this._key]:e},(()=>{t()}))}))}}class Lb{constructor(e,t){lb(t,"localStorage"),this._key=hb(e,"key"),this._localStorage=t}loadOrDefault(e){try{const t=this._localStorage.getItem(this._key);if(t)try{return Promise.resolve(JSON.parse(t))}catch(e){}return Promise.resolve(e)}catch(t){return console.warn("Error getting access to storage. Are cookies blocked?",t),Promise.resolve(e)}}save(e){try{return this._localStorage.setItem(this._key,JSON.stringify(e)),Promise.resolve()}catch(e){return console.warn("Error getting access to storage. Are cookies blocked?",e),Promise.reject(e)}}}let Ab;try{Ab=self.localStorage}catch(e){Ab={getItem:()=>{},key:()=>{},setItem:()=>{},removeItem:()=>{},hasOwnProperty:()=>{},length:0}}var Nb=Ab;const Bb="credentials_saved";class Fb extends d{constructor({deviceService:e,credentialsStore:t}){super(),this._deviceService=fb(e,Ib),this._credentialsStore=t}static create({baseUrl:e,storeName:t="CredentialsStorage",storeType:n="localStorage"}){const i=new Ib({apiClient:new Rb({baseUrl:e})});let s=null;if("localStorage"===n)s=new Lb(t,Nb);else{if("chromeStorage"!==n)throw new Error(`Unknown store type: ${n}`);s=new Mb(t,window.chrome.storage.local)}return new Fb({deviceService:i,credentialsStore:s})}_fetchNewCredentialsFromApi(){const e=this._credentialsStore;return new Promise((t=>{const n=()=>{this._deviceService.getCredentials().then((n=>e.save(n?n.toJson():null).then((()=>t(n))))).catch((()=>{setTimeout(n,2e3)}))};n()}))}getCurrentCredentials(){return this._credentialsStore.loadOrDefault(null).then((e=>e?jb.fromJson(e):null))}getCredentials(){return this.credentialsPromise||(this.credentialsPromise=this.getCurrentCredentials().then((e=>e||this._fetchNewCredentialsFromApi()))),this.credentialsPromise}saveCredentials(e){return this.credentialsPromise=void 0,this._credentialsStore.save(e.toJson()).then((()=>(this.emit(Bb,e),e)))}setUserId(e){return this.getCurrentCredentials().then((t=>{t||console.error("Illegal state: no credentials to set user id for.");if(null===t||t.userId!==e)return this._credentialsStore.save(Object.assign({},null==t?void 0:t.toJson(),{userId:e}))})).then((()=>{}))}}const Ub=()=>Promise.resolve(void 0);class zb{constructor({apiClient:e,fetchOrganization:t=Ub}){this._apiClient=fb(e,Rb),m.ok("function"==typeof t,"fetchOrganization<Function> is required"),this._fetchOrganization=t,this._apiClient=e}_callRequestMethod(e,t,n){return hb(t,"url"),m.equal(t[0],"/",'url<String> only accepts relative URLs beginning with "/".'),m.ok(n,"options are required"),this._fetchOrganization().then((i=>{if(!i)return this._apiClient[e](t,n);const{organizationId:s}=i;return this._apiClient[e](`/organizations/${encodeURIComponent(s)}${t}`,n)}))}request(e,t){return this._callRequestMethod("request",e,t)}requestMultipart(e,t){return this._callRequestMethod("requestMultipart",e,t)}}class qb{constructor({isExhausted:e,renewsAt:t,totalMinutesLimit:n,totalMinutesUsed:i}){this.isExhausted=e,this.renewsAt=t,this.totalMinutesLimit=n,this.totalMinutesUsed=i}static fromJson(e){return new qb({isExhausted:ub(e.isExhausted,"isExhausted"),renewsAt:new Date(hb(e.renewsAt,"renewsAt")),totalMinutesLimit:mb(e.totalMinutesLimit,"totalMinutesLimit"),totalMinutesUsed:mb(e.totalMinutesUsed,"totalMinutesUsed")})}}class $b{constructor({basePlanId:e,embeddedFreeTierStatus:t,isDeactivated:n,isOnTrial:i,onTrialUntil:s,trialStatus:r}){this.basePlanId=e,this.isDeactivated=n,this.isOnTrial=i,this.onTrialUntil=s||null,this.trialStatus=r||null,this.embeddedFreeTierStatus=t||null}static fromJson(e){return new $b({basePlanId:"string"==typeof e.basePlanId?e.basePlanId:null,isDeactivated:ub(e.isDeactivated,"isDeactivated"),isOnTrial:ub(e.isOnTrial,"isOnTrial"),onTrialUntil:"string"==typeof e.onTrialUntil?new Date(e.onTrialUntil):null,trialStatus:"string"==typeof e.trialStatus?e.trialStatus:null,embeddedFreeTierStatus:e.embeddedFreeTierStatus?qb.fromJson(e.embeddedFreeTierStatus):null})}}function Vb(e){return null!=e}function Hb(e={}){return{maxNumberOfInvitationsAndUsers:Vb(null==e?void 0:e.maxNumberOfInvitationsAndUsers)?Number(null==e?void 0:e.maxNumberOfInvitationsAndUsers):null,maxNumberOfClaimedRooms:Vb(null==e?void 0:e.maxNumberOfClaimedRooms)?Number(null==e?void 0:e.maxNumberOfClaimedRooms):null,maxRoomLimitPerOrganization:Vb(null==e?void 0:e.maxRoomLimitPerOrganization)?Number(null==e?void 0:e.maxRoomLimitPerOrganization):null,trialMinutesLimit:Vb(null==e?void 0:e.trialMinutesLimit)?Number(null==e?void 0:e.trialMinutesLimit):null,includedUnits:Vb(null==e?void 0:e.includedUnits)?Number(null==e?void 0:e.includedUnits):null}}class Wb{constructor(e){this.logoImageUrl=null,this.roomBackgroundImageUrl=null,this.roomBackgroundThumbnailUrl=null,this.roomKnockPageBackgroundImageUrl=null,this.roomKnockPageBackgroundThumbnailUrl=null,this.preferences=null,this.onboardingSurvey=null,this.type=null,fb(e,Object,"properties"),hb(e.organizationId,"organizationId"),hb(e.organizationName,"organizationName"),hb(e.subdomain,"subdomain"),fb(e.permissions,Object,"permissions"),fb(e.limits,Object,"limits"),this.organizationId=e.organizationId,this.organizationName=e.organizationName,this.subdomain=e.subdomain,this.permissions=e.permissions,this.limits=e.limits,this.account=e.account?new $b(e.account):null,this.logoImageUrl=e.logoImageUrl,this.roomBackgroundImageUrl=e.roomBackgroundImageUrl,this.roomBackgroundThumbnailUrl=e.roomBackgroundThumbnailUrl,this.roomKnockPageBackgroundImageUrl=e.roomKnockPageBackgroundImageUrl,this.roomKnockPageBackgroundThumbnailUrl=e.roomKnockPageBackgroundThumbnailUrl,this.preferences=e.preferences,this.onboardingSurvey=e.onboardingSurvey,this.type=e.type}static fromJson(e){const t=fb(e,Object,"data"),n=(null==t?void 0:t.preferences)||{},i=(null==t?void 0:t.onboardingSurvey)||null,s=fb(t.permissions,Object,"permissions");return new Wb({organizationId:hb(t.organizationId,"organizationId"),organizationName:hb(t.organizationName,"organizationName"),subdomain:hb(t.subdomain,"subdomain"),permissions:s,limits:Hb(fb(t.limits,Object,"limits")),account:t.account?$b.fromJson(t.account):null,logoImageUrl:"string"==typeof t.logoImageUrl?t.logoImageUrl:null,roomBackgroundImageUrl:"string"==typeof t.roomBackgroundImageUrl?t.roomBackgroundImageUrl:null,roomBackgroundThumbnailUrl:"string"==typeof t.roomBackgroundThumbnailUrl?t.roomBackgroundThumbnailUrl:null,roomKnockPageBackgroundImageUrl:"string"==typeof t.roomKnockPageBackgroundImageUrl?t.roomKnockPageBackgroundImageUrl:null,roomKnockPageBackgroundThumbnailUrl:"string"==typeof t.roomKnockPageBackgroundThumbnailUrl?t.roomKnockPageBackgroundThumbnailUrl:null,preferences:n,onboardingSurvey:i,type:"string"==typeof t.type?t.type:null})}}Wb.GLOBAL_ORGANIZATION_ID="1";class Gb{constructor({apiClient:e}){this._apiClient=fb(e,Rb)}createOrganization({organizationName:e,subdomain:t,owner:n}){const{displayName:i,consents:s}=n||{},r="email"in n?{value:n.email,verificationCode:hb(n.verificationCode,"owner.verificationCode")}:null,a="idToken"in n?n.idToken:null;if(hb(t,"subdomain"),hb(e,"organizationName"),hb(i,"owner.displayName"),m.ok(r||a,"owner.email or owner.idToken is required"),s){vb(s,"consents");for(const{consentRevisionId:e,action:t}of s)hb(e,"consentRevisionId"),yb(t,"action")}return this._apiClient.request("/organizations",{method:"POST",data:{organizationName:e,type:"private",subdomain:t,owner:Object.assign(Object.assign(Object.assign(Object.assign({},r&&{email:r}),a&&{idToken:a}),s&&{consents:s}),{displayName:i})}}).then((({data:e})=>Tb(e,"organizationId")))}getOrganizationBySubdomain(e){return hb(e,"subdomain"),this._apiClient.request(`/organization-subdomains/${encodeURIComponent(e)}/?fields=permissions,account,onboardingSurvey`,{method:"GET"}).then((({data:e})=>Wb.fromJson(e))).catch((e=>{if(e instanceof db){if(404===e.status)return null;throw new Error(e.statusText)}throw e}))}getOrganizationByOrganizationId(e){return hb(e,"organizationId"),this._apiClient.request(`/organizations/${encodeURIComponent(e)}?fields=permissions,account`,{method:"GET"}).then((({data:e})=>Wb.fromJson(e))).catch((e=>{if(e instanceof db){if(404===e.status)return null;throw new Error(e.statusText)}throw e}))}getOrganizationsByContactPoint(e){const{code:t}=e,n="email"in e?e.email:null,i="phoneNumber"in e?e.phoneNumber:null;m.ok((n||i)&&!(n&&i),"either email or phoneNumber is required"),hb(t,"code");const s=n?{type:"email",value:n}:{type:"phoneNumber",value:i};return this._apiClient.request("/organization-queries",{method:"POST",data:{contactPoint:s,code:t}}).then((({data:e})=>Db(e,"organizations",(e=>Wb.fromJson(e)))))}getOrganizationsByIdToken({idToken:e}){return hb(e,"idToken"),this._apiClient.request("/organization-queries",{method:"POST",data:{idToken:e}}).then((({data:e})=>Db(e,"organizations",(e=>Wb.fromJson(Object.assign({permissions:{},limits:{}},bb(e,"organization")))))))}getOrganizationsByLoggedInUser(){return this._apiClient.request("/user/organizations",{method:"GET"}).then((({data:e})=>Db(e,"organizations",(e=>Wb.fromJson(Object.assign({permissions:{},limits:{}},bb(e,"organization")))))))}getSubdomainAvailability(e){return hb(e,"subdomain"),this._apiClient.request(`/organization-subdomains/${encodeURIComponent(e)}/availability`,{method:"GET"}).then((({data:e})=>(fb(e,Object,"data"),{status:Tb(e,"status")})))}updatePreferences({organizationId:e,preferences:t}){return lb(e,"organizationId"),lb(t,"preferences"),this._apiClient.request(`/organizations/${encodeURIComponent(e)}/preferences`,{method:"PATCH",data:t}).then((()=>{}))}deleteOrganization({organizationId:e}){return lb(e,"organizationId"),this._apiClient.request(`/organizations/${encodeURIComponent(e)}`,{method:"DELETE"}).then((()=>{}))}}class Kb{constructor({organizationService:e,subdomain:t}){fb(e,Gb),hb(t,"subdomain"),this._organizationService=e,this._subdomain=t,this._organizationPromise=null}initOrganization(){return this.fetchOrganization().then((()=>{}))}fetchOrganization(){return this._organizationPromise||(this._organizationPromise=this._organizationService.getOrganizationBySubdomain(this._subdomain)),this._organizationPromise}}class Jb{constructor(e={}){m.ok(e instanceof Object,"properties<object> must be empty or an object"),this.isClaimed=!1,this.isBanned=!1,this.isLocked=!1,this.knockPage={backgroundImageUrl:null,backgroundThumbnailUrl:null},this.logoUrl=null,this.backgroundImageUrl=null,this.backgroundThumbnailUrl=null,this.type=null,this.legacyRoomType=null,this.mode=null,this.product=null,this.roomName=null,this.theme=null,this.preferences={},this.protectedPreferences={},this.publicProfile=null;const t={};Object.getOwnPropertyNames(e).forEach((n=>{-1!==Object.getOwnPropertyNames(this).indexOf(n)&&(t[n]=e[n])})),void 0!==e.ownerId&&(this.ownerId=e.ownerId),void 0!==e.meeting&&(this.meeting=e.meeting),Object.assign(this,t)}}class Qb{constructor({meetingId:e,roomName:t,roomUrl:n,startDate:i,endDate:s,hostRoomUrl:r,viewerRoomUrl:a}){hb(e,"meetingId"),hb(t,"roomName"),hb(n,"roomUrl"),fb(i,Date,"startDate"),fb(s,Date,"endDate"),this.meetingId=e,this.roomName=t,this.roomUrl=n,this.startDate=i,this.endDate=s,this.hostRoomUrl=r,this.viewerRoomUrl=a}static fromJson(e){return new Qb({meetingId:Tb(e,"meetingId"),roomName:Tb(e,"roomName"),roomUrl:Tb(e,"roomUrl"),startDate:Ob(e,"startDate"),endDate:Ob(e,"endDate"),hostRoomUrl:Pb(e,"hostRoomUrl"),viewerRoomUrl:Pb(e,"viewerRoomUrl")})}}function Yb(e,t=""){return`/room/${encodeURIComponent(e.substring(1))}${t}`}class Xb{constructor({organizationApiClient:e}){this._organizationApiClient=fb(e,zb)}getRooms({types:e,fields:t=[]}={}){return vb(e,"types"),vb(t,"fields"),this._organizationApiClient.request("/room",{method:"GET",params:{types:e.join(","),fields:t.join(","),includeOnlyLegacyRoomType:"false"}}).then((({data:e})=>e.rooms.map((e=>new Jb(e)))))}getRoom({roomName:e,fields:t}){gb(e);const n=encodeURIComponent(e.substring(1));return this._organizationApiClient.request(`/rooms/${n}`,{method:"GET",params:Object.assign({includeOnlyLegacyRoomType:"false"},t&&{fields:t.join(",")})}).then((({data:t})=>new Jb(Object.assign({},t,Object.assign({roomName:e},t.meeting&&{meeting:Qb.fromJson(t.meeting)}))))).catch((t=>{if(404===t.status)return new Jb({roomName:e,isClaimed:!1,mode:"normal",product:{categoryName:"personal_free"},type:"personal",legacyRoomType:"free"});if(400===t.status&&"Banned room"===t.data.error)return new Jb({roomName:e,isBanned:!0});throw new Error(t.data?t.data.error:"Could not fetch room information")}))}claimRoom({roomName:e,type:t,mode:n,isLocked:i}){return gb(e),hb(t,"type"),this._organizationApiClient.request("/room/claim",{method:"POST",data:Object.assign(Object.assign({roomName:e,type:t},"string"==typeof n&&{mode:n}),"boolean"==typeof i&&{isLocked:i})}).then((()=>{})).catch((e=>{throw new Error(e.data.error||"Failed to claim room")}))}unclaimRoom(e){gb(e);const t=encodeURIComponent(e.substring(1));return this._organizationApiClient.request(`/room/${t}`,{method:"DELETE"}).then((()=>{}))}renameRoom({roomName:e,newRoomName:t}){gb(e),hb(t,"newRoomName");const n=encodeURIComponent(e.substring(1));return this._organizationApiClient.request(`/room/${n}/roomName`,{method:"PUT",data:{newRoomName:t}}).then((()=>{}))}changeMode({roomName:e,mode:t}){gb(e),hb(t,"mode");const n=encodeURIComponent(e.substring(1));return this._organizationApiClient.request(`/room/${n}/mode`,{method:"PUT",data:{mode:t}}).then((()=>{}))}updatePreferences({roomName:e,preferences:t}){gb(e),fb(t,Object,"preferences");const n=encodeURIComponent(e.substring(1));return this._organizationApiClient.request(`/room/${n}/preferences`,{method:"PATCH",data:t}).then((()=>{}))}updateProtectedPreferences({roomName:e,preferences:t}){gb(e),fb(t,Object,"preferences");const n=encodeURIComponent(e.substring(1));return this._organizationApiClient.request(`/room/${n}/protected-preferences`,{method:"PATCH",data:t}).then((()=>{}))}getRoomPermissions(e,{roomKey:t}={}){return gb(e),this._organizationApiClient.request(Yb(e,"/permissions"),Object.assign({method:"GET"},t&&{headers:{"X-Whereby-Room-Key":t}})).then((e=>{const{permissions:t,limits:n}=e.data;return{permissions:t,limits:n}}))}getRoomMetrics({roomName:e,metrics:t,from:n,to:i}){return gb(e),hb(t,"metrics"),this._organizationApiClient.request(Yb(e,"/metrics"),{method:"GET",params:{metrics:t,from:n,to:i}}).then((e=>e.data))}changeType({roomName:e,type:t}){gb(e),function(e,t,n){if(lb(e,"value"),vb(t,"allowedValues"),!t.includes(e))throw new Error(`${n}<string> must be one of the following: ${t.join(", ")}`)}(t,["personal","personal_xl"],"type");const n=encodeURIComponent(e.substring(1));return this._organizationApiClient.request(`/room/${n}/type`,{method:"PUT",data:{type:t}}).then((()=>{}))}getForestSocialImage({roomName:e,count:t}){return gb(e),mb(t,"count"),this._organizationApiClient.request(Yb(e,`/forest-social-image/${t}`),{method:"GET"}).then((e=>e.data.imageUrl))}}class Zb{constructor({displayName:e,id:t,stream:n,isAudioEnabled:i,isVideoEnabled:s}){this.isLocalParticipant=!1,this.displayName=e,this.id=t,this.stream=n,this.isAudioEnabled=i,this.isVideoEnabled=s}}class ey extends Zb{constructor({displayName:e,id:t,newJoiner:n,streams:i,isAudioEnabled:s,isVideoEnabled:r}){super({displayName:e,id:t,isAudioEnabled:s,isVideoEnabled:r}),this.newJoiner=n,this.streams=i.map((e=>({id:e,state:n?"new_accept":"to_accept"})))}updateStreamState(e,t){const n=this.streams.find((t=>t.id===e));n&&(n.state=t)}}class ty extends Zb{constructor({displayName:e,id:t,stream:n,isAudioEnabled:i,isVideoEnabled:s}){super({displayName:e,id:t,stream:n,isAudioEnabled:i,isVideoEnabled:s}),this.isLocalParticipant=!0}}const ny=["recorder","streamer"];const iy=()=>{},sy=EventTarget;class ry extends sy{constructor(e,{displayName:t,localMediaConstraints:n,localStream:i,logger:s}){super(),this.localParticipant=null,this.remoteParticipants=[],this.roomConnectionState="",this.roomUrl=new URL(e),this.logger=s||{debug:iy,error:iy,log:iy,warn:iy},this.displayName=t,this.localStream=i,this.localMediaConstraints=n;const r=ef({host:this.roomUrl.host});this.credentialsService=Fb.create({baseUrl:"https://api.appearin.net"}),this.apiClient=new Rb({fetchDeviceCredentials:this.credentialsService.getCredentials.bind(this.credentialsService),baseUrl:"https://api.appearin.net"}),this.organizationService=new Gb({apiClient:this.apiClient}),this.organizationServiceCache=new Kb({organizationService:this.organizationService,subdomain:r.subdomain}),this.organizationApiClient=new zb({apiClient:this.apiClient,fetchOrganization:()=>Xt(this,void 0,void 0,(function*(){return(yield this.organizationServiceCache.fetchOrganization())||void 0}))}),this.roomService=new Xb({organizationApiClient:this.organizationApiClient}),this.signalSocket=function(){const e=new URL("wss://signal.appearin.net"),t=`${e.pathname.replace(/^\/$/,"")}/protocol/socket.io/v1`,n=e.origin;return new Go(n,{host:n,path:t,reconnectionDelay:5e3,reconnectionDelayMax:3e4,timeout:1e4})}(),this.signalSocket.on("new_client",this._handleNewClient.bind(this)),this.signalSocket.on("client_left",this._handleClientLeft.bind(this)),this.signalSocket.on("audio_enabled",this._handleClientAudioEnabled.bind(this)),this.signalSocket.on("video_enabled",this._handleClientVideoEnabled.bind(this)),this.signalSocket.on("client_metadata_received",this._handleClientMetadataReceived.bind(this))}_handleNewClient({client:e}){if(ny.includes(e.role.roleName))return;const t=new ey(Object.assign(Object.assign({},e),{newJoiner:!0}));this.remoteParticipants=[...this.remoteParticipants,t],this._handleAcceptStreams([t]),this.dispatchEvent(new CustomEvent("participant_joined",{detail:{remoteParticipant:t}}))}_handleClientLeft({clientId:e}){const t=this.remoteParticipants.find((t=>t.id===e));this.remoteParticipants=this.remoteParticipants.filter((t=>t.id!==e)),t&&this.dispatchEvent(new CustomEvent("participant_left",{detail:{participantId:t.id}}))}_handleClientAudioEnabled({clientId:e,isAudioEnabled:t}){const n=this.remoteParticipants.find((t=>t.id===e));n&&this.dispatchEvent(new CustomEvent("participant_audio_enabled",{detail:{participantId:n.id,isAudioEnabled:t}}))}_handleClientVideoEnabled({clientId:e,isVideoEnabled:t}){const n=this.remoteParticipants.find((t=>t.id===e));n&&this.dispatchEvent(new CustomEvent("participant_video_enabled",{detail:{participantId:n.id,isVideoEnabled:t}}))}_handleClientMetadataReceived({payload:{clientId:e,displayName:t}}){const n=this.remoteParticipants.find((t=>t.id===e));n&&this.dispatchEvent(new CustomEvent("participant_metadata_changed",{detail:{participantId:n.id,displayName:t}}))}_handleRtcEvent(e,t){return"rtc_manager_created"===e?this._handleRtcManagerCreated(t):"stream_added"===e?this._handleStreamAdded(t):void this.logger.log(`Unhandled RTC event ${e}`)}_handleRtcManagerCreated({rtcManager:e}){var t,n,i;this.rtcManager=e,this.localStream&&(null===(t=this.rtcManager)||void 0===t||t.addNewStream("0",this.localStream,!(null===(n=this.localStream)||void 0===n?void 0:n.getAudioTracks().find((e=>e.enabled))),!(null===(i=this.localStream)||void 0===i?void 0:i.getVideoTracks().find((e=>e.enabled)))))}_handleAcceptStreams(e){var t,n;if(!this.rtcManager)return void this.logger.log("Unable to accept streams, no rtc manager");const i=null===(n=(t=this.rtcManager).shouldAcceptStreamsFromBothSides)||void 0===n?void 0:n.call(t);e.forEach((e=>{const{id:t,streams:n,newJoiner:s}=e;n.forEach((n=>{var r,a;const{id:o,state:c}=n;let p;if("done_accept"!==c&&(p=(s&&"0"===o?"new":"to")+"_accept"),p){if("to_accept"===p||"new_accept"===p&&i||"old_accept"===p&&!i)this.logger.log(`Accepting stream ${o} from ${t}`),null===(r=this.rtcManager)||void 0===r||r.acceptNewStream({streamId:"0"===o?t:o,clientId:t,shouldAddLocalVideo:"0"===o,activeBreakout:false});else if("new_accept"===p||"old_accept"===p);else if("to_unaccept"===p)this.logger.log(`Disconnecting stream ${o} from ${t}`),null===(a=this.rtcManager)||void 0===a||a.disconnect("0"===o?t:o,false);else if("done_accept"!==p)return void this.logger.warn(`Stream state not handled: ${p} for ${t}-${o}`);e.updateStreamState(o,c.replace(/to_|new_|old_/,"done_"))}}))}))}_handleStreamAdded({clientId:e,stream:t,streamId:n}){this.remoteParticipants.find((t=>t.id===e))?this.dispatchEvent(new CustomEvent("participant_stream_added",{detail:{participantId:e,stream:t,streamId:n}})):this.logger.log("WARN: Could not find participant for incoming stream")}join(){return Xt(this,void 0,void 0,(function*(){if(["connected","connecting"].includes(this.roomConnectionState))return void console.warn(`Trying to join room state is ${this.roomConnectionState}`);if(this.logger.log("Joining room"),this.roomConnectionState="connecting",!this.localStream&&this.localMediaConstraints){const e=yield navigator.mediaDevices.getUserMedia(this.localMediaConstraints);this.localStream=e}const e=yield this.organizationServiceCache.fetchOrganization();if(!e)throw new Error("Invalid room url");const t={getMediaConstraints:()=>{var e,t;return{audio:!!(null===(e=this.localStream)||void 0===e?void 0:e.getAudioTracks().find((e=>e.enabled))),video:!!(null===(t=this.localStream)||void 0===t?void 0:t.getVideoTracks().find((e=>e.enabled)))}},deferrable:e=>!e};this.rtcManagerDispatcher=new Xh({emitter:{emit:this._handleRtcEvent.bind(this)},serverSocket:this.signalSocket,webrtcProvider:t,features:{lowDataModeEnabled:!1,sfuServerOverrideHost:void 0,turnServerOverrideHost:void 0,useOnlyTURN:void 0,vp9On:!1,h264On:!1,simulcastScreenshareOn:!1}});const n=yield this.credentialsService.getCredentials();setTimeout((()=>{this.logger.log("Connected to signal socket"),this.signalSocket.emit("identify_device",{deviceCredentials:n})}),2e3),this.signalSocket.once("device_identified",(()=>{var t,n;this.signalSocket.emit("join_room",{avatarUrl:null,config:{isAudioEnabled:!!(null===(t=this.localStream)||void 0===t?void 0:t.getAudioTracks().find((e=>e.enabled))),isVideoEnabled:!!(null===(n=this.localStream)||void 0===n?void 0:n.getVideoTracks().find((e=>e.enabled)))},deviceCapabilities:{canScreenshare:!0},displayName:this.displayName,isCoLocated:!1,isDevicePermissionDenied:!1,kickFromOtherRooms:!1,organizationId:e.organizationId,roomKey:null,roomName:this.roomUrl.pathname,selfId:""})})),this.signalSocket.once("room_joined",(e=>{const{selfId:t,room:{clients:n}}=e,i=n.find((e=>e.id===t));if(!i)throw new Error("Missing local client");this.localParticipant=new ty(Object.assign(Object.assign({},i),{stream:this.localStream})),this.remoteParticipants=n.filter((e=>e.id!==t)).map((e=>new ey(Object.assign(Object.assign({},e),{newJoiner:!1})))),this.rtcManager&&this._handleAcceptStreams(this.remoteParticipants),this.roomConnectionState="connected",this.dispatchEvent(new CustomEvent("room_joined",{detail:{localParticipant:this.localParticipant,remoteParticipants:this.remoteParticipants}}))}))}))}leave(){return new Promise((e=>{if(!this.signalSocket)return e();this.signalSocket.emit("leave_room");const t=setTimeout((()=>{e()}),200);this.signalSocket.once("room_left",(()=>{clearTimeout(t),this.signalSocket.disconnect(),e()}))}))}toggleCamera(e){var t;const n=null===(t=this.localStream)||void 0===t?void 0:t.getVideoTracks()[0];if(!n)return void this.logger.log("Tried toggling non-existing video track");const i=null!=e?e:!n.enabled;n.enabled=i,this.signalSocket.emit("enable_video",{enabled:i})}toggleMicrophone(e){var t;const n=null===(t=this.localStream)||void 0===t?void 0:t.getAudioTracks()[0];if(!n)return void this.logger.log("Tried toggling non-existing audio track");const i=null!=e?e:!n.enabled;n.enabled=i,this.signalSocket.emit("enable_audio",{enabled:i})}setDisplayName(e){this.signalSocket.emit("send_client_metadata",{type:"UserData",payload:{displayName:e}})}}function ay(e,t,n){const i=e.find((e=>e.id===t));if(!i)return e;const s=e.indexOf(i);return[...e.slice(0,s),Object.assign(Object.assign({},i),n),...e.slice(s+1)]}function oy(e,t){switch(t.type){case"ROOM_JOINED":return Object.assign(Object.assign({},e),{localParticipant:t.payload.localParticipant,remoteParticipants:t.payload.remoteParticipants,roomConnectionStatus:"connected"});case"PARTICIPANT_AUDIO_ENABLED":return Object.assign(Object.assign({},e),{remoteParticipants:ay(e.remoteParticipants,t.payload.participantId,{isAudioEnabled:t.payload.isAudioEnabled})});case"PARTICIPANT_JOINED":return Object.assign(Object.assign({},e),{remoteParticipants:[...e.remoteParticipants,t.payload.paritipant]});case"PARTICIPANT_LEFT":return Object.assign(Object.assign({},e),{remoteParticipants:[...e.remoteParticipants.filter((e=>e.id!==t.payload.participantId))]});case"PARTICIPANT_STREAM_ADDED":return Object.assign(Object.assign({},e),{remoteParticipants:ay(e.remoteParticipants,t.payload.participantId,{stream:t.payload.stream})});case"PARTICIPANT_VIDEO_ENABLED":return Object.assign(Object.assign({},e),{remoteParticipants:ay(e.remoteParticipants,t.payload.participantId,{isVideoEnabled:t.payload.isVideoEnabled})});case"PARTICIPANT_METADATA_CHANGED":return Object.assign(Object.assign({},e),{remoteParticipants:[...e.remoteParticipants.map((e=>e.id===t.payload.participantId?Object.assign(Object.assign({},e),{displayName:t.payload.displayName}):e))]});case"LOCAL_CLIENT_DISPLAY_NAME_CHANGED":return e.localParticipant?Object.assign(Object.assign({},e),{localParticipant:Object.assign(Object.assign({},e.localParticipant),{displayName:t.payload.displayName})}):e;default:throw e}}function cy(e,t){const[n,i]=sn.useState(null),[s,r]=sn.useReducer(oy,{remoteParticipants:[]});return sn.useEffect((()=>{i(new ry(e,t))}),[e]),sn.useEffect((()=>{if(n)return n.addEventListener("participant_audio_enabled",(e=>{const{participantId:t,isAudioEnabled:n}=e.detail;r({type:"PARTICIPANT_AUDIO_ENABLED",payload:{participantId:t,isAudioEnabled:n}})})),n.addEventListener("participant_joined",(e=>{const{remoteParticipant:t}=e.detail;r({type:"PARTICIPANT_JOINED",payload:{paritipant:t}})})),n.addEventListener("participant_left",(e=>{const{participantId:t}=e.detail;r({type:"PARTICIPANT_LEFT",payload:{participantId:t}})})),n.addEventListener("participant_stream_added",(e=>{const{participantId:t,stream:n}=e.detail;r({type:"PARTICIPANT_STREAM_ADDED",payload:{participantId:t,stream:n}})})),n.addEventListener("room_joined",(e=>{const{localParticipant:t,remoteParticipants:n}=e.detail;r({type:"ROOM_JOINED",payload:{localParticipant:t,remoteParticipants:n}})})),n.addEventListener("participant_video_enabled",(e=>{const{participantId:t,isVideoEnabled:n}=e.detail;r({type:"PARTICIPANT_VIDEO_ENABLED",payload:{participantId:t,isVideoEnabled:n}})})),n.addEventListener("participant_metadata_changed",(e=>{const{participantId:t,displayName:n}=e.detail;r({type:"PARTICIPANT_METADATA_CHANGED",payload:{participantId:t,displayName:n}})})),n.join(),()=>{n.leave()}}),[n]),[s,{toggleCamera:e=>{null==n||n.toggleCamera(e)},toggleMicrophone:e=>{null==n||n.toggleMicrophone(e)},setDisplayName:e=>{null==n||n.setDisplayName(e),r({type:"LOCAL_CLIENT_DISPLAY_NAME_CHANGED",payload:{displayName:e}})}},{VideoView:mn}]}const py="2.0.0-alpha3";export{py as sdkVersion,cy as useRoomConnection};