UNPKG

scandit-sdk

Version:

Scandit Barcode Scanner SDK for the Web

15 lines 264 kB
/*! * @license * * Scandit Barcode Scanner SDK for the Web * v. 4.6.1 * * Copyright © 2019 Scandit AG. All Rights Reserved. * * The use of this software is governed by the Scandit Terms and Conditions. * https://ssl.scandit.com/terms/test.pdf * * The following sets forth attribution notices for third party software that may be contained in portions of the product. * https://docs.scandit.com/stable/web/LICENSE */ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).ScanditSDK={})}(this,(function(e){"use strict";var t=Math.ceil,n=Math.floor,r=function(e){return isNaN(e=+e)?0:(e>0?n:t)(e)},i=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e},a="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function o(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}function s(e,t){return e(t={exports:{}},t.exports),t.exports}var c=s((function(e){var t=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=t)})),u=s((function(e){var t=e.exports={version:"2.6.10"};"number"==typeof __e&&(__e=t)})),l=(u.version,function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}),d=function(e,t,n){if(l(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}},h=function(e){return"object"==typeof e?null!==e:"function"==typeof e},f=function(e){if(!h(e))throw TypeError(e+" is not an object!");return e},m=function(e){try{return!!e()}catch(e){return!0}},p=!m((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})),v=c.document,g=h(v)&&h(v.createElement),y=function(e){return g?v.createElement(e):{}},b=!p&&!m((function(){return 7!=Object.defineProperty(y("div"),"a",{get:function(){return 7}}).a})),w=function(e,t){if(!h(e))return e;var n,r;if(t&&"function"==typeof(n=e.toString)&&!h(r=n.call(e)))return r;if("function"==typeof(n=e.valueOf)&&!h(r=n.call(e)))return r;if(!t&&"function"==typeof(n=e.toString)&&!h(r=n.call(e)))return r;throw TypeError("Can't convert object to primitive value")},S=Object.defineProperty,C={f:p?Object.defineProperty:function(e,t,n){if(f(e),t=w(t,!0),f(n),b)try{return S(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},_=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},E=p?function(e,t,n){return C.f(e,t,_(1,n))}:function(e,t,n){return e[t]=n,e},T={}.hasOwnProperty,A=function(e,t){return T.call(e,t)},k=function(e,t,n){var r,i,a,o=e&k.F,s=e&k.G,l=e&k.S,h=e&k.P,f=e&k.B,m=e&k.W,p=s?u:u[t]||(u[t]={}),v=p.prototype,g=s?c:l?c[t]:(c[t]||{}).prototype;for(r in s&&(n=t),n)(i=!o&&g&&void 0!==g[r])&&A(p,r)||(a=i?g[r]:n[r],p[r]=s&&"function"!=typeof g[r]?n[r]:f&&i?d(a,c):m&&g[r]==a?function(e){var t=function(t,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,r)}return e.apply(this,arguments)};return t.prototype=e.prototype,t}(a):h&&"function"==typeof a?d(Function.call,a):a,h&&((p.virtual||(p.virtual={}))[r]=a,e&k.R&&v&&!v[r]&&E(v,r,a)))};k.F=1,k.G=2,k.S=4,k.P=8,k.B=16,k.W=32,k.U=64,k.R=128;var M=k,V=E,x={},I={}.toString,L=function(e){return I.call(e).slice(8,-1)},P=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==L(e)?e.split(""):Object(e)},N=function(e){return P(i(e))},O=Math.min,R=function(e){return e>0?O(r(e),9007199254740991):0},j=Math.max,D=Math.min,F=s((function(e){var t=c["__core-js_shared__"]||(c["__core-js_shared__"]={});(e.exports=function(e,n){return t[e]||(t[e]=void 0!==n?n:{})})("versions",[]).push({version:u.version,mode:"pure",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})})),U=0,z=Math.random(),B=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++U+z).toString(36))},G=F("keys"),W=function(e){return G[e]||(G[e]=B(e))},Y=function(e,t,n){for(var i=N(e),a=R(i.length),o=function(e,t){return(e=r(e))<0?j(e+t,0):D(e,t)}(n,a);a>o;o++)if(o in i&&i[o]===t)return o||0;return-1},Q=W("IE_PROTO"),H=function(e,t){var n,r=N(e),i=0,a=[];for(n in r)n!=Q&&A(r,n)&&a.push(n);for(;t.length>i;)A(r,n=t[i++])&&(~Y(a,n)||a.push(n));return a},Z="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),q=Object.keys||function(e){return H(e,Z)},K=p?Object.defineProperties:function(e,t){f(e);for(var n,r=q(t),i=r.length,a=0;i>a;)C.f(e,n=r[a++],t[n]);return e},J=c.document,X=J&&J.documentElement,$=W("IE_PROTO"),ee=function(){},te=function(){var e,t=y("iframe"),n=Z.length;for(t.style.display="none",X.appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),te=e.F;n--;)delete te.prototype[Z[n]];return te()},ne=Object.create||function(e,t){var n;return null!==e?(ee.prototype=f(e),n=new ee,ee.prototype=null,n[$]=e):n=te(),void 0===t?n:K(n,t)},re=s((function(e){var t=F("wks"),n=c.Symbol,r="function"==typeof n;(e.exports=function(e){return t[e]||(t[e]=r&&n[e]||(r?n:B)("Symbol."+e))}).store=t})),ie=C.f,ae=re("toStringTag"),oe=function(e,t,n){e&&!A(e=n?e:e.prototype,ae)&&ie(e,ae,{configurable:!0,value:t})},se={};E(se,re("iterator"),(function(){return this}));var ce=function(e,t,n){e.prototype=ne(se,{next:_(1,n)}),oe(e,t+" Iterator")},ue=function(e){return Object(i(e))},le=W("IE_PROTO"),de=Object.prototype,he=Object.getPrototypeOf||function(e){return e=ue(e),A(e,le)?e[le]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?de:null},fe=re("iterator"),me=!([].keys&&"next"in[].keys()),pe=function(){return this},ve=function(e,t,n,r,i,a,o){ce(n,t,r);var s,c,u,l=function(e){if(!me&&e in m)return m[e];switch(e){case"keys":case"values":return function(){return new n(this,e)}}return function(){return new n(this,e)}},d=t+" Iterator",h="values"==i,f=!1,m=e.prototype,p=m[fe]||m["@@iterator"]||i&&m[i],v=p||l(i),g=i?h?l("entries"):v:void 0,y="Array"==t&&m.entries||p;if(y&&(u=he(y.call(new e)))!==Object.prototype&&u.next&&oe(u,d,!0),h&&p&&"values"!==p.name&&(f=!0,v=function(){return p.call(this)}),o&&(me||f||!m[fe])&&E(m,fe,v),x[t]=v,x[d]=pe,i)if(s={values:h?v:l("values"),keys:a?v:l("keys"),entries:g},o)for(c in s)c in m||V(m,c,s[c]);else M(M.P+M.F*(me||f),t,s);return s},ge=function(e,t){var n,a,o=String(i(e)),s=r(t),c=o.length;return s<0||s>=c?"":(n=o.charCodeAt(s))<55296||n>56319||s+1===c||(a=o.charCodeAt(s+1))<56320||a>57343?o.charAt(s):o.slice(s,s+2)};ve(String,"String",(function(e){this._t=String(e),this._i=0}),(function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=ge(t,n),this._i+=e.length,{value:e,done:!1})}));var ye=function(e,t){return{value:t,done:!!e}};ve(Array,"Array",(function(e,t){this._t=N(e),this._i=0,this._k=t}),(function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,ye(1)):ye(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]])}),"values"),x.Arguments=x.Array;for(var be=re("toStringTag"),we="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),Se=0;Se<we.length;Se++){var Ce=we[Se],_e=c[Ce],Ee=_e&&_e.prototype;Ee&&!Ee[be]&&E(Ee,be,Ce),x[Ce]=x.Array}var Te,Ae,ke,Me=re("toStringTag"),Ve="Arguments"==L(function(){return arguments}()),xe=function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),Me))?n:Ve?L(t):"Object"==(r=L(t))&&"function"==typeof t.callee?"Arguments":r},Ie=function(e,t,n,r){if(!(e instanceof t)||void 0!==r&&r in e)throw TypeError(n+": incorrect invocation!");return e},Le=function(e,t,n,r){try{return r?t(f(n)[0],n[1]):t(n)}catch(t){var i=e.return;throw void 0!==i&&f(i.call(e)),t}},Pe=re("iterator"),Ne=Array.prototype,Oe=function(e){return void 0!==e&&(x.Array===e||Ne[Pe]===e)},Re=re("iterator"),je=u.getIteratorMethod=function(e){if(null!=e)return e[Re]||e["@@iterator"]||x[xe(e)]},De=s((function(e){var t={},n={},r=e.exports=function(e,r,i,a,o){var s,c,u,l,h=o?function(){return e}:je(e),m=d(i,a,r?2:1),p=0;if("function"!=typeof h)throw TypeError(e+" is not iterable!");if(Oe(h)){for(s=R(e.length);s>p;p++)if((l=r?m(f(c=e[p])[0],c[1]):m(e[p]))===t||l===n)return l}else for(u=h.call(e);!(c=u.next()).done;)if((l=Le(u,m,c.value,r))===t||l===n)return l};r.BREAK=t,r.RETURN=n})),Fe=re("species"),Ue=function(e,t){var n,r=f(e).constructor;return void 0===r||null==(n=f(r)[Fe])?t:l(n)},ze=function(e,t,n){var r=void 0===n;switch(t.length){case 0:return r?e():e.call(n);case 1:return r?e(t[0]):e.call(n,t[0]);case 2:return r?e(t[0],t[1]):e.call(n,t[0],t[1]);case 3:return r?e(t[0],t[1],t[2]):e.call(n,t[0],t[1],t[2]);case 4:return r?e(t[0],t[1],t[2],t[3]):e.call(n,t[0],t[1],t[2],t[3])}return e.apply(n,t)},Be=c.process,Ge=c.setImmediate,We=c.clearImmediate,Ye=c.MessageChannel,Qe=c.Dispatch,He=0,Ze={},qe=function(){var e=+this;if(Ze.hasOwnProperty(e)){var t=Ze[e];delete Ze[e],t()}},Ke=function(e){qe.call(e.data)};Ge&&We||(Ge=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return Ze[++He]=function(){ze("function"==typeof e?e:Function(e),t)},Te(He),He},We=function(e){delete Ze[e]},"process"==L(Be)?Te=function(e){Be.nextTick(d(qe,e,1))}:Qe&&Qe.now?Te=function(e){Qe.now(d(qe,e,1))}:Ye?(ke=(Ae=new Ye).port2,Ae.port1.onmessage=Ke,Te=d(ke.postMessage,ke,1)):c.addEventListener&&"function"==typeof postMessage&&!c.importScripts?(Te=function(e){c.postMessage(e+"","*")},c.addEventListener("message",Ke,!1)):Te="onreadystatechange"in y("script")?function(e){X.appendChild(y("script")).onreadystatechange=function(){X.removeChild(this),qe.call(e)}}:function(e){setTimeout(d(qe,e,1),0)});var Je={set:Ge,clear:We},Xe=Je.set,$e=c.MutationObserver||c.WebKitMutationObserver,et=c.process,tt=c.Promise,nt="process"==L(et);function rt(e){var t,n;this.promise=new e((function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r})),this.resolve=l(t),this.reject=l(n)}var it={f:function(e){return new rt(e)}},at=function(e){try{return{e:!1,v:e()}}catch(e){return{e:!0,v:e}}},ot=c.navigator,st=ot&&ot.userAgent||"",ct=function(e,t){if(f(e),h(t)&&t.constructor===e)return t;var n=it.f(e);return(0,n.resolve)(t),n.promise},ut=function(e,t,n){for(var r in t)n&&e[r]?e[r]=t[r]:E(e,r,t[r]);return e},lt=re("species"),dt=function(e){var t="function"==typeof u[e]?u[e]:c[e];p&&t&&!t[lt]&&C.f(t,lt,{configurable:!0,get:function(){return this}})},ht=re("iterator"),ft=!1;try{var mt=[7][ht]();mt.return=function(){ft=!0},Array.from(mt,(function(){throw 2}))}catch(e){}var pt,vt,gt,yt,bt=function(e,t){if(!t&&!ft)return!1;var n=!1;try{var r=[7],i=r[ht]();i.next=function(){return{done:n=!0}},r[ht]=function(){return i},e(r)}catch(e){}return n},wt=Je.set,St=function(){var e,t,n,r=function(){var r,i;for(nt&&(r=et.domain)&&r.exit();e;){i=e.fn,e=e.next;try{i()}catch(r){throw e?n():t=void 0,r}}t=void 0,r&&r.enter()};if(nt)n=function(){et.nextTick(r)};else if(!$e||c.navigator&&c.navigator.standalone)if(tt&&tt.resolve){var i=tt.resolve(void 0);n=function(){i.then(r)}}else n=function(){Xe.call(c,r)};else{var a=!0,o=document.createTextNode("");new $e(r).observe(o,{characterData:!0}),n=function(){o.data=a=!a}}return function(r){var i={fn:r,next:void 0};t&&(t.next=i),e||(e=i,n()),t=i}}(),Ct=c.TypeError,_t=c.process,Et=_t&&_t.versions,Tt=Et&&Et.v8||"",At=c.Promise,kt="process"==xe(_t),Mt=function(){},Vt=vt=it.f,xt=!!function(){try{var e=At.resolve(1),t=(e.constructor={})[re("species")]=function(e){e(Mt,Mt)};return(kt||"function"==typeof PromiseRejectionEvent)&&e.then(Mt)instanceof t&&0!==Tt.indexOf("6.6")&&-1===st.indexOf("Chrome/66")}catch(e){}}(),It=function(e){var t;return!(!h(e)||"function"!=typeof(t=e.then))&&t},Lt=function(e,t){if(!e._n){e._n=!0;var n=e._c;St((function(){for(var r=e._v,i=1==e._s,a=0,o=function(t){var n,a,o,s=i?t.ok:t.fail,c=t.resolve,u=t.reject,l=t.domain;try{s?(i||(2==e._h&&Ot(e),e._h=1),!0===s?n=r:(l&&l.enter(),n=s(r),l&&(l.exit(),o=!0)),n===t.promise?u(Ct("Promise-chain cycle")):(a=It(n))?a.call(n,c,u):c(n)):u(r)}catch(e){l&&!o&&l.exit(),u(e)}};n.length>a;)o(n[a++]);e._c=[],e._n=!1,t&&!e._h&&Pt(e)}))}},Pt=function(e){wt.call(c,(function(){var t,n,r,i=e._v,a=Nt(e);if(a&&(t=at((function(){kt?_t.emit("unhandledRejection",i,e):(n=c.onunhandledrejection)?n({promise:e,reason:i}):(r=c.console)&&r.error&&r.error("Unhandled promise rejection",i)})),e._h=kt||Nt(e)?2:1),e._a=void 0,a&&t.e)throw t.v}))},Nt=function(e){return 1!==e._h&&0===(e._a||e._c).length},Ot=function(e){wt.call(c,(function(){var t;kt?_t.emit("rejectionHandled",e):(t=c.onrejectionhandled)&&t({promise:e,reason:e._v})}))},Rt=function(e){var t=this;t._d||(t._d=!0,(t=t._w||t)._v=e,t._s=2,t._a||(t._a=t._c.slice()),Lt(t,!0))},jt=function(e){var t,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===e)throw Ct("Promise can't be resolved itself");(t=It(e))?St((function(){var r={_w:n,_d:!1};try{t.call(e,d(jt,r,1),d(Rt,r,1))}catch(e){Rt.call(r,e)}})):(n._v=e,n._s=1,Lt(n,!1))}catch(e){Rt.call({_w:n,_d:!1},e)}}};xt||(At=function(e){Ie(this,At,"Promise","_h"),l(e),pt.call(this);try{e(d(jt,this,1),d(Rt,this,1))}catch(e){Rt.call(this,e)}},(pt=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=ut(At.prototype,{then:function(e,t){var n=Vt(Ue(this,At));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=kt?_t.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&Lt(this,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),gt=function(){var e=new pt;this.promise=e,this.resolve=d(jt,e,1),this.reject=d(Rt,e,1)},it.f=Vt=function(e){return e===At||e===yt?new gt(e):vt(e)}),M(M.G+M.W+M.F*!xt,{Promise:At}),oe(At,"Promise"),dt("Promise"),yt=u.Promise,M(M.S+M.F*!xt,"Promise",{reject:function(e){var t=Vt(this);return(0,t.reject)(e),t.promise}}),M(M.S+!0*M.F,"Promise",{resolve:function(e){return ct(this===yt?At:this,e)}}),M(M.S+M.F*!(xt&&bt((function(e){At.all(e).catch(Mt)}))),"Promise",{all:function(e){var t=this,n=Vt(t),r=n.resolve,i=n.reject,a=at((function(){var n=[],a=0,o=1;De(e,!1,(function(e){var s=a++,c=!1;n.push(void 0),o++,t.resolve(e).then((function(e){c||(c=!0,n[s]=e,--o||r(n))}),i)})),--o||r(n)}));return a.e&&i(a.v),n.promise},race:function(e){var t=this,n=Vt(t),r=n.reject,i=at((function(){De(e,!1,(function(e){t.resolve(e).then(n.resolve,r)}))}));return i.e&&r(i.v),n.promise}}),M(M.P+M.R,"Promise",{finally:function(e){var t=Ue(this,u.Promise||c.Promise),n="function"==typeof e;return this.then(n?function(n){return ct(t,e()).then((function(){return n}))}:e,n?function(n){return ct(t,e()).then((function(){throw n}))}:e)}}),M(M.S,"Promise",{try:function(e){var t=it.f(this),n=at(e);return(n.e?t.reject:t.resolve)(n.v),t.promise}});var Dt,Ft=u.Promise;!function(){if("undefined"!=typeof window){var e=window.navigator.userAgent.match(/Edge\/(\d{2})\./),t=!!e&&16<=parseInt(e[1],10);if("objectFit"in document.documentElement.style==0||t){var n=function(e,t,n){var r,i,a,o,s;if((n=n.split(" ")).length<2&&(n[1]=n[0]),"x"===e)r=n[0],i=n[1],a="left",o="right",s=t.clientWidth;else{if("y"!==e)return;r=n[1],i=n[0],a="top",o="bottom",s=t.clientHeight}if(r!==a&&i!==a){if(r!==o&&i!==o)return"center"===r||"50%"===r?(t.style[a]="50%",void(t.style["margin-"+a]=s/-2+"px")):void(0<=r.indexOf("%")?(r=parseInt(r))<50?(t.style[a]=r+"%",t.style["margin-"+a]=s*(r/-100)+"px"):(r=100-r,t.style[o]=r+"%",t.style["margin-"+o]=s*(r/-100)+"px"):t.style[a]=r);t.style[o]="0"}else t.style[a]="0"},r=function(e){var t=e.dataset?e.dataset.objectFit:e.getAttribute("data-object-fit"),r=e.dataset?e.dataset.objectPosition:e.getAttribute("data-object-position");t=t||"cover",r=r||"50% 50%";var i=e.parentNode;return function(e){var t=window.getComputedStyle(e,null),n=t.getPropertyValue("position"),r=t.getPropertyValue("overflow"),i=t.getPropertyValue("display");n&&"static"!==n||(e.style.position="relative"),"hidden"!==r&&(e.style.overflow="hidden"),i&&"inline"!==i||(e.style.display="block"),0===e.clientHeight&&(e.style.height="100%"),-1===e.className.indexOf("object-fit-polyfill")&&(e.className=e.className+" object-fit-polyfill")}(i),function(e){var t=window.getComputedStyle(e,null),n={"max-width":"none","max-height":"none","min-width":"0px","min-height":"0px",top:"auto",right:"auto",bottom:"auto",left:"auto","margin-top":"0px","margin-right":"0px","margin-bottom":"0px","margin-left":"0px"};for(var r in n)t.getPropertyValue(r)!==n[r]&&(e.style[r]=n[r])}(e),e.style.position="absolute",e.style.width="auto",e.style.height="auto","scale-down"===t&&(t=e.clientWidth<i.clientWidth&&e.clientHeight<i.clientHeight?"none":"contain"),"none"===t?(n("x",e,r),void n("y",e,r)):"fill"===t?(e.style.width="100%",e.style.height="100%",n("x",e,r),void n("y",e,r)):(e.style.height="100%",void("cover"===t&&e.clientWidth>i.clientWidth||"contain"===t&&e.clientWidth<i.clientWidth?(e.style.top="0",e.style.marginTop="0",n("x",e,r)):(e.style.width="100%",e.style.height="auto",e.style.left="0",e.style.marginLeft="0",n("y",e,r))))},i=function(e){if(void 0===e||e instanceof Event)e=document.querySelectorAll("[data-object-fit]");else if(e&&e.nodeName)e=[e];else{if("object"!=typeof e||!e.length||!e[0].nodeName)return!1;e=e}for(var n=0;n<e.length;n++)if(e[n].nodeName){var i=e[n].nodeName.toLowerCase();if("img"===i){if(t)continue;e[n].complete?r(e[n]):e[n].addEventListener("load",(function(){r(this)}))}else"video"===i?0<e[n].readyState?r(e[n]):e[n].addEventListener("loadedmetadata",(function(){r(this)})):r(e[n])}return!0};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",i):i(),window.addEventListener("resize",i),window.objectFitPolyfill=i}else window.objectFitPolyfill=function(){return!1}}}(),(Dt=s((function(e){!function e(t,n,r){function i(s,c){if(!n[s]){if(!t[s]){if(!c&&o)return o();if(a)return a(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var l=n[s]={exports:{}};t[s][0].call(l.exports,(function(e){return i(t[s][1][e]||e)}),l,l.exports,e,t,n,r)}return n[s].exports}for(var a=o,s=0;s<r.length;s++)i(r[s]);return i}({1:[function(e,t,n){var r=(0,e("./adapter_factory.js").adapterFactory)({window:window});t.exports=r},{"./adapter_factory.js":2}],2:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.adapterFactory=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).window,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{shimChrome:!0,shimFirefox:!0,shimEdge:!0,shimSafari:!0},n=r.log,u=r.detectBrowser(e),l={browserDetails:u,commonShim:c,extractVersion:r.extractVersion,disableLog:r.disableLog,disableWarnings:r.disableWarnings};switch(u.browser){case"chrome":if(!i||!i.shimPeerConnection||!t.shimChrome)return n("Chrome shim is not included in this adapter release."),l;n("adapter.js shimming chrome."),l.browserShim=i,i.shimGetUserMedia(e),i.shimMediaStream(e),i.shimPeerConnection(e),i.shimOnTrack(e),i.shimAddTrackRemoveTrack(e),i.shimGetSendersWithDtmf(e),i.shimGetStats(e),i.shimSenderReceiverGetStats(e),i.fixNegotiationNeeded(e),c.shimRTCIceCandidate(e),c.shimConnectionState(e),c.shimMaxMessageSize(e),c.shimSendThrowTypeError(e),c.removeAllowExtmapMixed(e);break;case"firefox":if(!o||!o.shimPeerConnection||!t.shimFirefox)return n("Firefox shim is not included in this adapter release."),l;n("adapter.js shimming firefox."),l.browserShim=o,o.shimGetUserMedia(e),o.shimPeerConnection(e),o.shimOnTrack(e),o.shimRemoveStream(e),o.shimSenderGetStats(e),o.shimReceiverGetStats(e),o.shimRTCDataChannel(e),o.shimAddTransceiver(e),o.shimCreateOffer(e),o.shimCreateAnswer(e),c.shimRTCIceCandidate(e),c.shimConnectionState(e),c.shimMaxMessageSize(e),c.shimSendThrowTypeError(e);break;case"edge":if(!a||!a.shimPeerConnection||!t.shimEdge)return n("MS edge shim is not included in this adapter release."),l;n("adapter.js shimming edge."),l.browserShim=a,a.shimGetUserMedia(e),a.shimGetDisplayMedia(e),a.shimPeerConnection(e),a.shimReplaceTrack(e),c.shimMaxMessageSize(e),c.shimSendThrowTypeError(e);break;case"safari":if(!s||!t.shimSafari)return n("Safari shim is not included in this adapter release."),l;n("adapter.js shimming safari."),l.browserShim=s,s.shimRTCIceServerUrls(e),s.shimCreateOfferLegacy(e),s.shimCallbacksAPI(e),s.shimLocalStreamsAPI(e),s.shimRemoteStreamsAPI(e),s.shimTrackEventTransceiver(e),s.shimGetUserMedia(e),c.shimRTCIceCandidate(e),c.shimMaxMessageSize(e),c.shimSendThrowTypeError(e),c.removeAllowExtmapMixed(e);break;default:n("Unsupported browser!")}return l};var r=u(e("./utils")),i=u(e("./chrome/chrome_shim")),a=u(e("./edge/edge_shim")),o=u(e("./firefox/firefox_shim")),s=u(e("./safari/safari_shim")),c=u(e("./common_shim"));function u(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}},{"./chrome/chrome_shim":3,"./common_shim":6,"./edge/edge_shim":12,"./firefox/firefox_shim":7,"./safari/safari_shim":10,"./utils":11}],3:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.shimGetDisplayMedia=n.shimGetUserMedia=void 0;var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=e("./getusermedia");Object.defineProperty(n,"shimGetUserMedia",{enumerable:!0,get:function(){return i.shimGetUserMedia}});var a=e("./getdisplaymedia");Object.defineProperty(n,"shimGetDisplayMedia",{enumerable:!0,get:function(){return a.shimGetDisplayMedia}}),n.shimMediaStream=function(e){e.MediaStream=e.MediaStream||e.webkitMediaStream},n.shimOnTrack=function(e){if("object"!==(void 0===e?"undefined":r(e))||!e.RTCPeerConnection||"ontrack"in e.RTCPeerConnection.prototype)o.wrapPeerConnectionEvent(e,"track",(function(e){return e.transceiver||Object.defineProperty(e,"transceiver",{value:{receiver:e.receiver}}),e}));else{Object.defineProperty(e.RTCPeerConnection.prototype,"ontrack",{get:function(){return this._ontrack},set:function(e){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=e)},enumerable:!0,configurable:!0});var t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){var n=this;return this._ontrackpoly||(this._ontrackpoly=function(t){t.stream.addEventListener("addtrack",(function(r){var i;i=e.RTCPeerConnection.prototype.getReceivers?n.getReceivers().find((function(e){return e.track&&e.track.id===r.track.id})):{track:r.track};var a=new Event("track");a.track=r.track,a.receiver=i,a.transceiver={receiver:i},a.streams=[t.stream],n.dispatchEvent(a)})),t.stream.getTracks().forEach((function(r){var i;i=e.RTCPeerConnection.prototype.getReceivers?n.getReceivers().find((function(e){return e.track&&e.track.id===r.id})):{track:r};var a=new Event("track");a.track=r,a.receiver=i,a.transceiver={receiver:i},a.streams=[t.stream],n.dispatchEvent(a)}))},this.addEventListener("addstream",this._ontrackpoly)),t.apply(this,arguments)}}},n.shimGetSendersWithDtmf=function(e){if("object"===(void 0===e?"undefined":r(e))&&e.RTCPeerConnection&&!("getSenders"in e.RTCPeerConnection.prototype)&&"createDTMFSender"in e.RTCPeerConnection.prototype){var 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()};var n=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,r){var i=n.apply(this,arguments);return i||(i=t(this,e),this._senders.push(i)),i};var i=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){i.apply(this,arguments);var t=this._senders.indexOf(e);-1!==t&&this._senders.splice(t,1)}}var a=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){var n=this;this._senders=this._senders||[],a.apply(this,[e]),e.getTracks().forEach((function(e){n._senders.push(t(n,e))}))};var o=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){var t=this;this._senders=this._senders||[],o.apply(this,[e]),e.getTracks().forEach((function(e){var n=t._senders.find((function(t){return t.track===e}));n&&t._senders.splice(t._senders.indexOf(n),1)}))}}else if("object"===(void 0===e?"undefined":r(e))&&e.RTCPeerConnection&&"getSenders"in e.RTCPeerConnection.prototype&&"createDTMFSender"in e.RTCPeerConnection.prototype&&e.RTCRtpSender&&!("dtmf"in e.RTCRtpSender.prototype)){var s=e.RTCPeerConnection.prototype.getSenders;e.RTCPeerConnection.prototype.getSenders=function(){var e=this,t=s.apply(this,[]);return t.forEach((function(t){return t._pc=e})),t},Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get:function(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}},n.shimGetStats=function(e){if(e.RTCPeerConnection){var t=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){var e=this,n=Array.prototype.slice.call(arguments),r=n[0],i=n[1],a=n[2];if(arguments.length>0&&"function"==typeof r)return t.apply(this,arguments);if(0===t.length&&(0===arguments.length||"function"!=typeof r))return t.apply(this,[]);var o=function(e){var t={};return e.result().forEach((function(e){var n={id:e.id,timestamp:e.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[e.type]||e.type};e.names().forEach((function(t){n[t]=e.stat(t)})),t[n.id]=n})),t},s=function(e){return new Map(Object.keys(e).map((function(t){return[t,e[t]]})))};if(arguments.length>=2){var c=function(e){i(s(o(e)))};return t.apply(this,[c,r])}return new Promise((function(n,r){t.apply(e,[function(e){n(s(o(e)))},r])})).then(i,a)}}},n.shimSenderReceiverGetStats=function(e){if("object"===(void 0===e?"undefined":r(e))&&e.RTCPeerConnection&&e.RTCRtpSender&&e.RTCRtpReceiver){if(!("getStats"in e.RTCRtpSender.prototype)){var t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){var e=this,n=t.apply(this,[]);return n.forEach((function(t){return t._pc=e})),n});var n=e.RTCPeerConnection.prototype.addTrack;n&&(e.RTCPeerConnection.prototype.addTrack=function(){var e=n.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){var e=this;return this._pc.getStats().then((function(t){return o.filterStats(t,e.track,!0)}))}}if(!("getStats"in e.RTCRtpReceiver.prototype)){var i=e.RTCPeerConnection.prototype.getReceivers;i&&(e.RTCPeerConnection.prototype.getReceivers=function(){var e=this,t=i.apply(this,[]);return t.forEach((function(t){return t._pc=e})),t}),o.wrapPeerConnectionEvent(e,"track",(function(e){return e.receiver._pc=e.srcElement,e})),e.RTCRtpReceiver.prototype.getStats=function(){var e=this;return this._pc.getStats().then((function(t){return o.filterStats(t,e.track,!1)}))}}if("getStats"in e.RTCRtpSender.prototype&&"getStats"in e.RTCRtpReceiver.prototype){var a=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof e.MediaStreamTrack){var t=arguments[0],n=void 0,r=void 0,i=void 0;return this.getSenders().forEach((function(e){e.track===t&&(n?i=!0:n=e)})),this.getReceivers().forEach((function(e){return e.track===t&&(r?i=!0:r=e),e.track===t})),i||n&&r?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):n?n.getStats():r?r.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return a.apply(this,arguments)}}}},n.shimAddTrackRemoveTrackWithNative=c,n.shimAddTrackRemoveTrack=function(e){if(e.RTCPeerConnection){var t=o.detectBrowser(e);if(e.RTCPeerConnection.prototype.addTrack&&t.version>=65)return c(e);var n=e.RTCPeerConnection.prototype.getLocalStreams;e.RTCPeerConnection.prototype.getLocalStreams=function(){var e=this,t=n.apply(this);return this._reverseStreams=this._reverseStreams||{},t.map((function(t){return e._reverseStreams[t.id]}))};var r=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(t){var n=this;if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},t.getTracks().forEach((function(e){if(n.getSenders().find((function(t){return t.track===e})))throw new DOMException("Track already exists.","InvalidAccessError")})),!this._reverseStreams[t.id]){var i=new e.MediaStream(t.getTracks());this._streams[t.id]=i,this._reverseStreams[i.id]=t,t=i}r.apply(this,[t])};var i=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},i.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){var r=this;if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");var i=[].slice.call(arguments,1);if(1!==i.length||!i[0].getTracks().find((function(e){return e===t})))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");var a=this.getSenders().find((function(e){return e.track===t}));if(a)throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};var o=this._streams[n.id];if(o)o.addTrack(t),Promise.resolve().then((function(){r.dispatchEvent(new Event("negotiationneeded"))}));else{var s=new e.MediaStream([t]);this._streams[n.id]=s,this._reverseStreams[s.id]=n,this.addStream(s)}return this.getSenders().find((function(e){return e.track===t}))},["createOffer","createAnswer"].forEach((function(t){var n=e.RTCPeerConnection.prototype[t],r=s({},t,(function(){var e=this,t=arguments,r=arguments.length&&"function"==typeof arguments[0];return r?n.apply(this,[function(n){var r=l(e,n);t[0].apply(null,[r])},function(e){t[1]&&t[1].apply(null,e)},arguments[2]]):n.apply(this,arguments).then((function(t){return l(e,t)}))}));e.RTCPeerConnection.prototype[t]=r[t]}));var a=e.RTCPeerConnection.prototype.setLocalDescription;e.RTCPeerConnection.prototype.setLocalDescription=function(){return arguments.length&&arguments[0].type?(arguments[0]=d(this,arguments[0]),a.apply(this,arguments)):a.apply(this,arguments)};var u=Object.getOwnPropertyDescriptor(e.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(e.RTCPeerConnection.prototype,"localDescription",{get:function(){var e=u.get.apply(this);return""===e.type?e:l(this,e)}}),e.RTCPeerConnection.prototype.removeTrack=function(e){var t=this;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");this._streams=this._streams||{};var n=void 0;Object.keys(this._streams).forEach((function(r){t._streams[r].getTracks().find((function(t){return e.track===t}))&&(n=t._streams[r])})),n&&(1===n.getTracks().length?this.removeStream(this._reverseStreams[n.id]):n.removeTrack(e.track),this.dispatchEvent(new Event("negotiationneeded")))}}function l(e,t){var n=t.sdp;return Object.keys(e._reverseStreams||[]).forEach((function(t){var r=e._reverseStreams[t],i=e._streams[r.id];n=n.replace(new RegExp(i.id,"g"),r.id)})),new RTCSessionDescription({type:t.type,sdp:n})}function d(e,t){var n=t.sdp;return Object.keys(e._reverseStreams||[]).forEach((function(t){var r=e._reverseStreams[t],i=e._streams[r.id];n=n.replace(new RegExp(r.id,"g"),i.id)})),new RTCSessionDescription({type:t.type,sdp:n})}},n.shimPeerConnection=function(e){var t=o.detectBrowser(e);if(!e.RTCPeerConnection&&e.webkitRTCPeerConnection&&(e.RTCPeerConnection=e.webkitRTCPeerConnection),e.RTCPeerConnection){t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){var n=e.RTCPeerConnection.prototype[t],r=s({},t,(function(){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}));e.RTCPeerConnection.prototype[t]=r[t]}));var n=e.RTCPeerConnection.prototype.addIceCandidate;e.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?t.version<78&&arguments[0]&&""===arguments[0].candidate?Promise.resolve():n.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())}}},n.fixNegotiationNeeded=function(e){o.wrapPeerConnectionEvent(e,"negotiationneeded",(function(e){if("stable"===e.target.signalingState)return e}))};var o=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(e("../utils.js"));function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e){e.RTCPeerConnection.prototype.getLocalStreams=function(){var e=this;return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map((function(t){return e._shimmedLocalStreams[t][0]}))};var t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,n){if(!n)return t.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};var r=t.apply(this,arguments);return this._shimmedLocalStreams[n.id]?-1===this._shimmedLocalStreams[n.id].indexOf(r)&&this._shimmedLocalStreams[n.id].push(r):this._shimmedLocalStreams[n.id]=[n,r],r};var n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){var t=this;this._shimmedLocalStreams=this._shimmedLocalStreams||{},e.getTracks().forEach((function(e){if(t.getSenders().find((function(t){return t.track===e})))throw new DOMException("Track already exists.","InvalidAccessError")}));var r=this.getSenders();n.apply(this,arguments);var i=this.getSenders().filter((function(e){return-1===r.indexOf(e)}));this._shimmedLocalStreams[e.id]=[e].concat(i)};var r=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[e.id],r.apply(this,arguments)};var i=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){var t=this;return this._shimmedLocalStreams=this._shimmedLocalStreams||{},e&&Object.keys(this._shimmedLocalStreams).forEach((function(n){var r=t._shimmedLocalStreams[n].indexOf(e);-1!==r&&t._shimmedLocalStreams[n].splice(r,1),1===t._shimmedLocalStreams[n].length&&delete t._shimmedLocalStreams[n]})),i.apply(this,arguments)}}},{"../utils.js":11,"./getdisplaymedia":4,"./getusermedia":5}],4:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.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((function(t){var r=n.video&&n.video.width,i=n.video&&n.video.height,a=n.video&&n.video.frameRate;return n.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:t,maxFrameRate:a||3}},r&&(n.video.mandatory.maxWidth=r),i&&(n.video.mandatory.maxHeight=i),e.navigator.mediaDevices.getUserMedia(n)}))}:console.error("shimGetDisplayMedia: getSourceId argument is not a function"))}},{}],5:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};n.shimGetUserMedia=function(e){var t=e&&e.navigator;if(t.mediaDevices){var n=i.detectBrowser(e),o=function(e){if("object"!==(void 0===e?"undefined":r(e))||e.mandatory||e.optional)return e;var t={};return Object.keys(e).forEach((function(n){if("require"!==n&&"advanced"!==n&&"mediaSource"!==n){var i="object"===r(e[n])?e[n]:{ideal:e[n]};void 0!==i.exact&&"number"==typeof i.exact&&(i.min=i.max=i.exact);var a=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||[];var o={};"number"==typeof i.ideal?(o[a("min",n)]=i.ideal,t.optional.push(o),(o={})[a("max",n)]=i.ideal,t.optional.push(o)):(o[a("",n)]=i.ideal,t.optional.push(o))}void 0!==i.exact&&"number"!=typeof i.exact?(t.mandatory=t.mandatory||{},t.mandatory[a("",n)]=i.exact):["min","max"].forEach((function(e){void 0!==i[e]&&(t.mandatory=t.mandatory||{},t.mandatory[a(e,n)]=i[e])}))}})),e.advanced&&(t.optional=(t.optional||[]).concat(e.advanced)),t},s=function(e,i){if(n.version>=61)return i(e);if((e=JSON.parse(JSON.stringify(e)))&&"object"===r(e.audio)){var s=function(e,t,n){t in e&&!(n in e)&&(e[n]=e[t],delete e[t])};s((e=JSON.parse(JSON.stringify(e))).audio,"autoGainControl","googAutoGainControl"),s(e.audio,"noiseSuppression","googNoiseSuppression"),e.audio=o(e.audio)}if(e&&"object"===r(e.video)){var c=e.video.facingMode;c=c&&("object"===(void 0===c?"undefined":r(c))?c:{ideal:c});var u=n.version<66;if(c&&("user"===c.exact||"environment"===c.exact||"user"===c.ideal||"environment"===c.ideal)&&(!t.mediaDevices.getSupportedConstraints||!t.mediaDevices.getSupportedConstraints().facingMode||u)){delete e.video.facingMode;var l=void 0;if("environment"===c.exact||"environment"===c.ideal?l=["back","rear"]:"user"!==c.exact&&"user"!==c.ideal||(l=["front"]),l)return t.mediaDevices.enumerateDevices().then((function(t){var n=(t=t.filter((function(e){return"videoinput"===e.kind}))).find((function(e){return l.some((function(t){return e.label.toLowerCase().includes(t)}))}));return!n&&t.length&&l.includes("back")&&(n=t[t.length-1]),n&&(e.video.deviceId=c.exact?{exact:n.deviceId}:{ideal:n.deviceId}),e.video=o(e.video),a("chrome: "+JSON.stringify(e)),i(e)}))}e.video=o(e.video)}return a("chrome: "+JSON.stringify(e)),i(e)},c=function(e){return n.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:function(){return this.name+(this.message&&": ")+this.message}}};if(t.getUserMedia=function(e,n,r){s(e,(function(e){t.webkitGetUserMedia(e,n,(function(e){r&&r(c(e))}))}))}.bind(t),t.mediaDevices.getUserMedia){var u=t.mediaDevices.getUserMedia.bind(t.mediaDevices);t.mediaDevices.getUserMedia=function(e){return s(e,(function(e){return u(e).then((function(t){if(e.audio&&!t.getAudioTracks().length||e.video&&!t.getVideoTracks().length)throw t.getTracks().forEach((function(e){e.stop()})),new DOMException("","NotFoundError");return t}),(function(e){return Promise.reject(c(e))}))}))}}}};var i=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(e("../utils.js")),a=i.log},{"../utils.js":11}],6:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};n.shimRTCIceCandidate=function(e){if(e.RTCIceCandidate&&!(e.RTCIceCandidate&&"foundation"in e.RTCIceCandidate.prototype)){var t=e.RTCIceCandidate;e.RTCIceCandidate=function(e){if("object"===(void 0===e?"undefined":r(e))&&e.candidate&&0===e.candidate.indexOf("a=")&&((e=JSON.parse(JSON.stringify(e))).candidate=e.candidate.substr(2)),e.candidate&&e.candidate.length){var n=new t(e),i=a.default.parseCandidate(e.candidate),o=Object.assign(n,i);return o.toJSON=function(){return{candidate:o.candidate,sdpMid:o.sdpMid,sdpMLineIndex:o.sdpMLineIndex,usernameFragment:o.usernameFragment}},o}return new t(e)},e.RTCIceCandidate.prototype=t.prototype,o.wrapPeerConnectionEvent(e,"icecandidate",(function(t){return t.candidate&&Object.defineProperty(t,"candidate",{value:new e.RTCIceCandidate(t.candidate),writable:"false"}),t}))}},n.shimMaxMessageSize=function(e){if(e.RTCPeerConnection){var t=o.detectBrowser(e);"sctp"in e.RTCPeerConnection.prototype||Object.defineProperty(e.RTCPeerConnection.prototype,"sctp",{get:function(){return void 0===this._sctp?null:this._sctp}});var n=function(e){if(!e||!e.sdp)return!1;var t=a.default.splitSections(e.sdp);return t.shift(),t.some((function(e){var t=a.default.parseMLine(e);return t&&"application"===t.kind&&-1!==t.protocol.indexOf("SCTP")}))},r=function(e){var t=e.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(null===t||t.length<2)return-1;var n=parseInt(t[1],10);return n!=n?-1:n},i=function(e){var n=65536;return"firefox"===t.browser&&(n=t.version<57?-1===e?16384:2147483637:t.version<60?57===t.version?65535:65536:2147483637),n},s=function(e,n){var r=65536;"firefox"===t.browser&&57===t.version&&(r=65535);var i=a.default.matchPrefix(e.sdp,"a=max-message-size:");return i.length>0?r=parseInt(i[0].substr(19),10):"firefox"===t.browser&&-1!==n&&(r=2147483637),r},c=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,"chrome"===t.browser&&t.version>=76){var e=this.getConfiguration(),a=e.sdpSemantics;"plan-b"===a&&Object.defineProperty(this,"sctp",{get:function(){return void 0===this._sctp?null:this._sctp},enumerable:!0,configurable:!0})}if(n(arguments[0])){var o=r(arguments[0]),u=i(o),l=s(arguments[0],o),d=void 0;d=0===u&&0===l?Number.POSITIVE_INFINITY:0===u||0===l?Math.max(u,l):Math.min(u,l);var h={};Object.defineProperty(h,"maxMessageSize",{get:function(){return d}}),this._sctp=h}return c.apply(this,arguments)}}},n.shimSendThrowTypeError=function(e){if(e.RTCPeerConnection&&"createDataChannel"in e.RTCPeerConnection.prototype){var t=e.RTCPeerConnection.prototype.createDataChannel;e.RTCPeerConnection.prototype.createDataChannel=function(){var e=t.apply(this,arguments);return n(e,this),e},o.wrapPeerConnectionEvent(e,"datachannel",(function(e){return n(e.channel,e.target),e}))}function n(e,t){var n=e.send;e.send=function(){var r=arguments[0],i=r.length||r.size||r.byteLength;if("open"===e.readyState&&t.sctp&&i>t.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+t.sctp.maxMessageSize+" bytes)");return n.apply(e,arguments)}}},n.shimConnectionState=function(e){if(e.RTCPeerConnection&&!("connectionState"in e.RTCPeerConnection.prototype)){var t=e.RTCPeerConnection.prototype;Object.defineProperty(t,"connectionState",{get:function(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(t,"onconnectionstatechange",{get:function(){return this._onconnectionstatechange||null},set:function(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((function(e){var n=t[e];t[e]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=function(e){var t=e.target;if(t._lastConnectionState!==t.connectionState){t._lastConnectionState=t.connectionState;var n=new Event("connectionstatechange",e);t.dispatchEvent(n)}return e},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),n.apply(this,arguments)}}))}},n.removeAllowExtmapMixed=function(e){if(e.RTCPeerConnection){var t=o.detectBrowser(e);if(!("chrome"===t.browser&&t.version>=71)){var n=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(e){return e&&e.sdp&&-1!==e.sdp.indexOf("\na=extmap-allow-mixed")&&(e.sdp=e.sdp.split("\n").filter((function(e){return"a=extmap-allow-mixed"!==e.trim()})).join("\n")),n.apply(this,arguments)}}}};var i,a=(i=e("sdp"))&&i.__esModule?i:{default:i},o=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(e("./utils"))},{"./utils":11,sdp:13}],7:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.shimGetDisplayMedia=n.shimGetUserMedia=void 0;var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=e("./getusermedia");Object.defineProperty(n,"shimGetUserMedia",{enumerable:!0,get:function(){return i.shimGetUserMedia}});var a=e("./getdisplaymedia");Object.defineProperty(n,"shimGetDisplayMedia",{enumerable:!0,get:function(){return a.shimGetDisplayMedia}}),n.shimOnTrack=function(e){"object"===(void 0===e?"undefined":r(e))&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get:function(){return{receiver:this.receiver}}})},n.shimPeerConnection=function(e){var t=o.detectBrowser(e);if("object"===(void 0===e?"undefined":r(e))&&(e.RTCPeerConnection||e.mozRTCPeerConnection)){if(!e.RTCPeerConnection&&e.mozRTCPeerConnection&&(e.RTCPeerConnection=e.mozRTCPeerConnection),t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){var n,r,i,a=e.RTCPeerConnection.prototype[t],o=(i=function(){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),a.apply(this,arguments)},(r=t)in(n={})?Object.defineProperty(n,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[r]=i,n);e.RTCPeerConnection.prototype[t]=o[t]})),t.version<68){var n=e.RTCPeerConnection.prototype.addIceCandidate;e.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?arguments[0]&&""===arguments[0].candidate?Promise.resolve():n.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())}}var i={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},a=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){var e=Array.prototype.slice.call(arguments),n=e[0],r=e[1],o=e[2];return a.apply(this,[n||null]).then((function(e){if(t.version<53&&!r)try{e.forEach((function(e){e.type=i[e.type]||e.type}))}catch(t){if("TypeError"!==t.name)throw t;e.forEach((function(t,n){e.set(n,Object.assign({},t,{type:i[t.type]||t.type}))}))}return e})).then(r,o)}}},n.shimSenderGetStats=function(e){if("object"===(void 0===e?"undefined":r(e))&&e.RTCPeerConnection&&e.RTCRtpSender&&!(e.RTCRtpSender&&"getStats"in e.RTCRtpSender.prototype)){var t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){var e=this,n=t.apply(this,[]);return n.forEach((function(t){return t._pc=e})),n});var n=e.RTCPeerConnection.prototype.addTrack;n&&(e.RTCPeerConnection.prototype.addTrack=function(){var 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)}}},n.shimReceiverGetStats=function(e){if("object"===(void 0===e?"undefined":r(e))&&e.RTCPeerConnection&&e.RTCRtpSender&&!(e.RTCRtpSender&&"getStats"in e.RTCRtpReceiver.prototype)){var t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){var e=this,n=t.apply(this,[]);return n.forEach((function(t){return t._pc=e})),n}),o.wrapPeerConnectionEvent(e,"track",(function(e){return e.receiver._pc=e.srcElement,e})),e.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}},n.shimRemoveStream=function(e){!e.RTCPeerConnection||"removeStream"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.removeStream=function(e){var t=this;o.deprecated("removeStream","removeTrack"),this.getSenders().forEach((function(n){n.track&&e.getTracks().includes(n.track)&&t.removeTrack(n)}))})},n.shimRTCDataChannel=function(e){e.DataChannel&&!e.RTCDataChannel&&(e.RTCDataChannel=e.DataChannel)},n.shimAddTransceiver=function(e){if("object"===(void 0===e?"undefined":r(e))&&e.RTCPeerConnection){var t=e.RTCPeerConnec