text: !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(t.toString())["default"]:"object"==typeof exports?exports.Quagga=t(t.toString())["default"]:e.Quagga=t(t.toString())["default"]}(this,function(e){return function(e){function t(r){if(n[r])return n[r].e;var o=n[r]={e:{},i:r,l:!1};return e[r].call(o.e,o,o.e,t),o.l=!0,o.e}var n={};return t.m=e,t.c=n,t.p="/",t(t.s=222)}([function(e,t,n){var r=Array.isArray;e.e=r},function(e,t,n){"use strict";var r=!0,o={disableLog:function(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(r=e,e?"adapter.js logging disabled":"adapter.js logging enabled")},log:function(){if("object"==typeof window){if(r)return;"undefined"!=typeof console&&"function"==typeof console.log&&console.log.apply(console,arguments)}},extractVersion:function(e,t,n){var r=e.match(t);return r&&r.length>=n&&parseInt(r[n],10)},detectBrowser:function(){var e={};if(e.browser=null,e.version=null,e.minVersion=null,"undefined"==typeof window||!window.navigator)return e.browser="Not a browser.",e;if(navigator.mozGetUserMedia)e.browser="firefox",e.version=this.extractVersion(navigator.userAgent,/Firefox\/([0-9]+)\./,1),e.minVersion=31;else if(navigator.webkitGetUserMedia)if(window.webkitRTCPeerConnection)e.browser="chrome",e.version=this.extractVersion(navigator.userAgent,/Chrom(e|ium)\/([0-9]+)\./,2),e.minVersion=38;else{if(!navigator.userAgent.match(/Version\/(\d+).(\d+)/))return e.browser="Unsupported webkit-based browser with GUM support but no WebRTC support.",e;e.browser="safari",e.version=this.extractVersion(navigator.userAgent,/AppleWebKit\/([0-9]+)\./,1),e.minVersion=602}else{if(!navigator.mediaDevices||!navigator.userAgent.match(/Edge\/(\d+).(\d+)$/))return e.browser="Not a supported browser.",e;e.browser="edge",e.version=this.extractVersion(navigator.userAgent,/Edge\/(\d+).(\d+)$/,2),e.minVersion=10547}return e.version<e.minVersion&&o.log("Browser: "+e.browser+" Version: "+e.version+" < minimum supported version: "+e.minVersion+"\n some things might not work!"),e}};e.e={log:o.log,disableLog:o.disableLog,browserDetails:o.detectBrowser(),extractVersion:o.extractVersion}},function(e,t,n){function r(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}e.e=r},function(e,t,n){var r=n(68),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();e.e=i},function(e,t,n){function r(e,t){e=a.a.bind()(o(),e),c.a.call(this,e,t)}function o(){var e={};return Object.keys(r.CONFIG_KEYS).forEach(function(t){e[t]=r.CONFIG_KEYS[t]["default"]}),e}var i=n(7),a=i&&i.__esModule?function(){return i["default"]}:function(){return i};Object.defineProperty(a,"a",{get:a});var c=n(9),u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s={CODE_L_START:{value:0},CODE_G_START:{value:10},START_PATTERN:{value:[1,1,1]},STOP_PATTERN:{value:[1,1,1]},MIDDLE_PATTERN:{value:[1,1,1,1,1]},EXTENSION_START_PATTERN:{value:[1,1,2]},CODE_PATTERN:{value:[[3,2,1,1],[2,2,2,1],[2,1,2,2],[1,4,1,1],[1,1,3,2],[1,2,3,1],[1,1,1,4],[1,3,1,2],[1,2,1,3],[3,1,1,2],[1,1,2,3],[1,2,2,2],[2,2,1,2],[1,1,4,1],[2,3,1,1],[1,3,2,1],[4,1,1,1],[2,1,3,1],[3,1,2,1],[2,1,1,3]]},CODE_FREQUENCY:{value:[0,11,13,14,19,25,28,21,22,26]},SINGLE_CODE_ERROR:{value:.7},AVG_CODE_ERROR:{value:.48},FORMAT:{value:"ean_13",writeable:!1}};r.prototype=Object.create(c.a.prototype,s),r.prototype.constructor=r,r.prototype._decodeCode=function(e,t){var n,r,o,i=[0,0,0,0],a=this,c=e,u=!a._row[c],s=0,f={error:Number.MAX_VALUE,code:-1,start:e,end:e};for(t||(t=a.CODE_PATTERN.length),n=c;n<a._row.length;n++)if(a._row[n]^u)i[s]++;else{if(s===i.length-1){for(r=0;r<t;r++)o=a._matchPattern(i,a.CODE_PATTERN[r]),o<f.error&&(f.code=r,f.error=o);return f.end=n,f.error>a.AVG_CODE_ERROR?null:f}s++,i[s]=1,u=!u}return null},r.prototype._findPattern=function(e,t,n,r,o){var i,a,c,u,s=[],f=this,d=0,l={error:Number.MAX_VALUE,code:-1,start:0,end:0};for(t||(t=f._nextSet(f._row)),void 0===n&&(n=!1),void 0===r&&(r=!0),void 0===o&&(o=f.AVG_CODE_ERROR),i=0;i<e.length;i++)s[i]=0;for(i=t;i<f._row.length;i++)if(f._row[i]^n)s[d]++;else{if(d===s.length-1){for(u=0,c=0;c<s.length;c++)u+=s[c];if(a=f._matchPattern(s,e),a<o)return l.error=a,l.start=i-u,l.end=i,l;if(!r)return null;for(c=0;c<s.length-2;c++)s[c]=s[c+2];s[s.length-2]=0,s[s.length-1]=0,d--}else d++;s[d]=1,n=!n}return null},r.prototype._findStart=function(){for(var e,t,n=this,r=n._nextSet(n._row);!t;){if(t=n._findPattern(n.START_PATTERN,r),!t)return null;if(e=t.start-(t.end-t.start),e>=0&&n._matchRange(e,t.start,0))return t;r=t.end,t=null}},r.prototype._verifyTrailingWhitespace=function(e){var t,n=this;return t=e.end+(e.end-e.start),t<n._row.length&&n._matchRange(e.end,t,0)?e:null},r.prototype._findEnd=function(e,t){var n=this,r=n._findPattern(n.STOP_PATTERN,e,t,!1);return null!==r?n._verifyTrailingWhitespace(r):null},r.prototype._calculateFirstDigit=function(e){var t,n=this;for(t=0;t<n.CODE_FREQUENCY.length;t++)if(e===n.CODE_FREQUENCY[t])return t;return null},r.prototype._decodePayload=function(e,t,n){var r,o,i=this,a=0;for(r=0;r<6;r++){if(e=i._decodeCode(e.end),!e)return null;e.code>=i.CODE_G_START?(e.code=e.code-i.CODE_G_START,a|=1<<5-r):a|=0<<5-r,t.push(e.code),n.push(e)}if(o=i._calculateFirstDigit(a),null===o)return null;if(t.unshift(o),e=i._findPattern(i.MIDDLE_PATTERN,e.end,!0,!1),null===e)return null;for(n.push(e),r=0;r<6;r++){if(e=i._decodeCode(e.end,i.CODE_G_START),!e)return null;n.push(e),t.push(e.code)}return e},r.prototype._decode=function(){var e,t,n=this,r=[],o=[],i={};if(e=n._findStart(),!e)return null;if(t={code:e.code,start:e.start,end:e.end},o.push(t),t=n._decodePayload(t,r,o),!t)return null;if(t=n._findEnd(t.end,!1),!t)return null;if(o.push(t),!n._checksum(r))return null;if(this.supplements.length>0){var a=this._decodeExtensions(t.end);if(!a)return null;var c=a.decodedCodes[a.decodedCodes.length-1],s={start:c.start+((c.end-c.start)/2|0),end:c.end};if(!n._verifyTrailingWhitespace(s))return null;i={supplement:a,code:r.join("")+a.code}}return u({code:r.join(""),start:e.start,end:t.end,codeset:"",startInfo:e,decodedCodes:o},i)},r.prototype._decodeExtensions=function(e){var t,n,r=this._nextSet(this._row,e),o=this._findPattern(this.EXTENSION_START_PATTERN,r,!1,!1);if(null===o)return null;for(t=0;t<this.supplements.length;t++)if(n=this.supplements[t].decode(this._row,o.end),null!==n)return{code:n.code,start:r,startInfo:o,end:n.end,codeset:"",decodedCodes:n.decodedCodes};return null},r.prototype._checksum=function(e){var t,n=0;for(t=e.length-2;t>=0;t-=2)n+=e[t];for(n*=3,t=e.length-1;t>=0;t-=2)n+=e[t];return n%10===0},r.CONFIG_KEYS={supplements:{type:"arrayOf(string)","default":[],description:"Allowed extensions to be decoded (2 and/or 5)"}},t.a=r},function(e,t,n){function r(e,t){var n=i(e,t);return o(n)?n:void 0}var o=n(138),i=n(165);e.e=r},function(e,t,n){function r(e){if("string"==typeof e||o(e))return e;var t=e+"";return"0"==t&&1/e==-i?"-0":t}var o=n(42),i=1/0;e.e=r},function(e,t,n){var r=n(143),o=n(159),i=o(function(e,t,n){r(e,t,n)});e.e=i},function(e,t,n){t.a={drawRect:function(e,t,n,r){n.strokeStyle=r.color,n.fillStyle=r.color,n.lineWidth=1,n.beginPath(),n.strokeRect(e.x,e.y,t.x,t.y)},drawPath:function(e,t,n,r){n.strokeStyle=r.color,n.fillStyle=r.color,n.lineWidth=r.lineWidth,n.beginPath(),n.moveTo(e[0][t.x],e[0][t.y]);for(var o=1;o<e.length;o++)n.lineTo(e[o][t.x],e[o][t.y]);n.closePath(),n.stroke()},drawImage:function(e,t,n){var r,o=n.getImageData(0,0,t.x,t.y),i=o.data,a=e.length,c=i.length;if(c/a!==4)return!1;for(;a--;)r=e[a],i[--c]=255,i[--c]=r,i[--c]=r,i[--c]=r;return n.putImageData(o,0,0),!0}}},function(e,t,n){function r(e,t){return this._row=[],this.config=e||{},this.supplements=t,this}r.prototype._nextUnset=function(e,t){var n;for(void 0===t&&(t=0),n=t;n<e.length;n++)if(!e[n])return n;return e.length},r.prototype._matchPattern=function(e,t,n){var r,o,i,a,c=0,u=0,s=0,f=0;for(n=n||this.SINGLE_CODE_ERROR||1,r=0;r<e.length;r++)s+=e[r],f+=t[r];if(s<f)return Number.MAX_VALUE;for(o=s/f,n*=o,r=0;r<e.length;r++){if(i=e[r],a=t[r]*o,u=Math.abs(i-a)/a,u>n)return Number.MAX_VALUE;c+=u}return c/f},r.prototype._nextSet=function(e,t){var n;for(t=t||0,n=t;n<e.length;n++)if(e[n])return n;return e.length},r.prototype._correctBars=function(e,t,n){for(var r=n.length,o=0;r--;)o=e[n[r]]*(1-(1-t)/2),o>1&&(e[n[r]]=o)},r.prototype._matchTrace=function(e,t){var n,r,o=[],i=this,a=i._nextSet(i._row),c=!i._row[a],u=0,s={error:Number.MAX_VALUE,code:-1,start:0};if(e){for(n=0;n<e.length;n++)o.push(0);for(n=a;n<i._row.length;n++)if(i._row[n]^c)o[u]++;else{if(u===o.length-1)return r=i._matchPattern(o,e),r<t?(s.start=n-a,s.end=n,s.counter=o,s):null;u++,o[u]=1,c=!c}}else for(o.push(0),n=a;n<i._row.length;n++)i._row[n]^c?o[u]++:(u++,o.push(0),o[u]=1,c=!c);return s.start=a,s.end=i._row.length-1,s.counter=o,s},r.prototype.decodePattern=function(e){var t,n=this;return n._row=e,t=n._decode(),null===t?(n._row.reverse(),t=n._decode(),t&&(t.direction=r.DIRECTION.REVERSE,t.start=n._row.length-t.start,t.end=n._row.length-t.end)):t.direction=r.DIRECTION.FORWARD,t&&(t.format=n.FORMAT),t},r.prototype._matchRange=function(e,t,n){var r;for(e=e<0?0:e,r=e;r<t;r++)if(this._row[r]!==n)return!1;return!0},r.prototype._fillCounters=function(e,t,n){var r,o=this,i=0,a=[];for(n="undefined"==typeof n||n,e="undefined"!=typeof e?e:o._nextUnset(o._row),t=t||o._row.length,a[i]=0,r=e;r<t;r++)o._row[r]^n?a[i]++:(i++,a[i]=1,n=!n);return a},Object.defineProperty(r.prototype,"FORMAT",{value:"unknown",writeable:!1}),r.DIRECTION={FORWARD:1,REVERSE:-1},r.Exception={StartNotFoundException:"Start-Info was not found!",CodeNotFoundException:"Code could not be found!",PatternNotFoundException:"Pattern could not be found!"},r.CONFIG_KEYS={},t.a=r},function(e,t,n){function r(e){var t=new Float32Array(2);return t[0]=e[0],t[1]=e[1],t}e.e=r},function(e,t,n){function r(e,t){return e===t||e!==e&&t!==t}e.e=r},function(e,t,n){function r(e){return o(e)&&c.call(e,"callee")&&(!s.call(e,"callee")||u.call(e)==i)}var o=n(76),i="[object Arguments]",a=Object.prototype,c=a.hasOwnProperty,u=a.toString,s=a.propertyIsEnumerable;e.e=r},function(e,t,n){function r(e){return null!=e&&i(e.length)&&!o(e)}var o=n(40),i=n(41);e.e=r},function(e,t,n){function r(e){return!!e&&"object"==typeof e}e.e=r},function(e,t,n){function r(e){return a(e)?o(e):i(e)}var o=n(52),i=n(140),a=n(13);e.e=r},function(e,t,n){t.a={init:function(e,t){for(var n=e.length;n--;)e[n]=t},shuffle:function(e){var t,n,r=e.length-1;for(r;r>=0;r--)t=Math.floor(Math.random()*r),n=e[r],e[r]=e[t],e[t]=n;return e},toPointList:function(e){var t,n,r=[],o=[];for(t=0;t<e.length;t++){for(r=[],n=0;n<e[t].length;n++)r[n]=e[t][n];o[t]="["+r.join(",")+"]"}return"["+o.join(",\r\n")+"]"},threshold:function(e,t,n){var r,o=[];for(r=0;r<e.length;r++)n.apply(e,[e[r]])>=t&&o.push(e[r]);return o},maxIndex:function(e){var t,n=0;for(t=0;t<e.length;t++)e[t]>e[n]&&(n=t);return n},max:function r(e){var t,r=0;for(t=0;t<e.length;t++)e[t]>r&&(r=e[t]);return r},sum:function o(e){for(var t=e.length,o=0;t--;)o+=e[t];return o}}},function(e,t,n){function r(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}var o=n(179),i=n(180),a=n(181),c=n(182),u=n(183);r.prototype.clear=o,r.prototype["delete"]=i,r.prototype.get=a,r.prototype.has=c,r.prototype.set=u,e.e=r},function(e,t,n){function r(e){this.__data__=new o(e)}var o=n(17),i=n(193),a=n(194),c=n(195),u=n(196),s=n(197);r.prototype.clear=i,r.prototype["delete"]=a,r.prototype.get=c,r.prototype.has=u,r.prototype.set=s,e.e=r},function(e,t,n){var r=n(3),o=r.Symbol;e.e=o},function(e,t,n){function r(e,t){for(var n=e.length;n--;)if(o(e[n][0],t))return n;return-1}var o=n(11);e.e=r},function(e,t,n){function r(e,t){var n=e.__data__;return o(t)?n["string"==typeof t?"string":"hash"]:n.map}var o=n(177);e.e=r},function(e,t,n){function r(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(n){}return t}e.e=r},function(e,t,n){function r(e,t){if(o(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!i(e))||(c.test(e)||!a.test(e)||null!=t&&e in Object(t))}var o=n(0),i=n(42),a=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,c=/^\w*$/;e.e=r},function(e,t,n){function r(e){var t=e&&e.constructor,n="function"==typeof t&&t.prototype||o;return e===n}var o=Object.prototype;e.e=r},function(e,t,n){var r=n(5),o=r(Object,"create");e.e=o},function(e,t,n){function r(e,t){var n={x:e,y:t,toVec2:function(){return w.clone([this.x,this.y])},toVec3:function(){return C.clone([this.x,this.y,1])},round:function(){return this.x=this.x>0?Math.floor(this.x+.5):Math.floor(this.x-.5),this.y=this.y>0?Math.floor(this.y+.5):Math.floor(this.y-.5),this}};return n}function o(e,t,n){n||(n=e);for(var r=e.data,o=r.length,i=n.data;o--;)i[o]=r[o]<t?1:0}function i(e,t){t||(t=8);for(var n=e.data,r=n.length,o=8-t,i=1<<t,a=new Int32Array(i);r--;)a[n[r]>>o]++;return a}function a(e,t){function n(e,t){var n,r=0;for(n=e;n<=t;n++)r+=a[n];return r}function r(e,t){var n,r=0;for(n=e;n<=t;n++)r+=n*a[n];return r}function o(){var o,c,u,s,f,d,l,p=[0],h=(1<<t)-1;for(a=i(e,t),s=1;s<h;s++)o=n(0,s),c=n(s+1,h),u=o*c,0===u&&(u=1),f=r(0,s)*c,d=r(s+1,h)*o,l=f-d,p[s]=l*l/u;return _.a.maxIndex(p)}t||(t=8);var a,c,u=8-t;return c=o(),c<<u}function c(e,t){var n=a(e);return o(e,n,t),n}function u(e,t,n){function r(e){var t=!1;for(i=0;i<u.length;i++)a=u[i],a.fits(e)&&(a.add(e),t=!0);return t}var o,i,a,c,u=[];for(n||(n="rad"),o=0;o<e.length;o++)c=b.a.createPoint(e[o],o,n),r(c)||u.push(b.a.create(c,t));return u}function s(e,t,n){var r,o,i,a,c=0,u=0,s=[];for(r=0;r<t;r++)s[r]={score:0,item:null};for(r=0;r<e.length;r++)if(o=n.apply(this,[e[r]]),o>u)for(i=s[c],i.score=o,i.item=e[r],u=Number.MAX_VALUE,a=0;a<t;a++)s[a].score<u&&(u=s[a].score,c=a);return s}function f(e,t,n){for(var r,o=0,i=t.x,a=Math.floor(e.length/4),c=t.x/2,u=0,s=t.x;i<a;){for(r=0;r<c;r++)n[u]=Math.floor((.299*e[4*o+0]+.587*e[4*o+1]+.114*e[4*o+2]+(.299*e[4*(o+1)+0]+.587*e[4*(o+1)+1]+.114*e[4*(o+1)+2])+(.299*e[4*i+0]+.587*e[4*i+1]+.114*e[4*i+2])+(.299*e[4*(i+1)+0]+.587*e[4*(i+1)+1]+.114*e[4*(i+1)+2]))/4),u++,o+=2,i+=2;o+=s,i+=s}}function d(e,t,n){var r,o=e.length/4|0,i=n&&n.singleChannel===!0;if(i)for(r=0;r<o;r++)t[r]=e[4*r+0];else for(r=0;r<o;r++)t[r]=Math.floor(.299*e[4*r+0]+.587*e[4*r+1]+.114*e[4*r+2])}function l(e,t){for(var n=e.data,r=e.size.x,o=t.data,i=0,a=r,c=n.length,u=r/2,s=0;a<c;){for(var f=0;f<u;f++)o[s]=Math.floor((n[i]+n[i+1]+n[a]+n[a+1])/4),s++,i+=2,a+=2;i+=r,a+=r}}function p(e,t){var n=e[0],r=e[1],o=e[2],i=o*r,a=i*(1-Math.abs(n/60%2-1)),c=o-i,u=0,s=0,f=0;return t=t||[0,0,0],n<60?(u=i,s=a):n<120?(u=a,s=i):n<180?(s=i,f=a):n<240?(s=a,f=i):n<300?(u=a,f=i):n<360&&(u=i,f=a),t[0]=255*(u+c)|0,t[1]=255*(s+c)|0,t[2]=255*(f+c)|0,t}function h(e){var t,n=[],r=[];for(t=1;t<Math.sqrt(e)+1;t++)e%t===0&&(r.push(t),t!==e/t&&n.unshift(Math.floor(e/t)));return r.concat(n)}function v(e,t){for(var n=0,r=0,o=[];n<e.length&&r<t.length;)e[n]===t[r]?(o.push(e[n]),n++,r++):e[n]>t[r]?r++:n++;return o}function g(e,t){function n(e){for(var t=0,n=e[Math.floor(e.length/2)];t<e.length-1&&e[t]<l;)t++;return t>0&&(n=Math.abs(e[t]-l)>Math.abs(e[t-1]-l)?e[t-1]:e[t]),l/n<u[f+1]/u[f]&&l/n>u[f-1]/u[f]?{x:n,y:n}:null}var r,o=h(t.x),i=h(t.y),a=Math.max(t.x,t.y),c=v(o,i),u=[8,10,15,20,32,60,80],s={"x-small":5,small:4,medium:3,large:2,"x-large":1},f=s[e]||s.medium,d=u[f],l=Math.floor(a/d);return r=n(c),r||(r=n(h(a)),r||(r=n(h(l*d)))),r}function m(e){var t={value:parseFloat(e),unit:(e.indexOf("%")===e.length-1,"%")};return t}function y(e,t,n){var r={width:e,height:t},o=Object.keys(n).reduce(function(e,t){var o=n[t],i=m(o),a=E[t](i,r);return e[t]=a,e},{});return{sx:o.left,sy:o.top,sw:o.right-o.left,sh:o.bottom-o.top}}var b=n(83),_=n(16);t.f=r,t.c=c,t.d=u,t.e=s,t.i=f,t.j=d,t.g=l,t.a=p,t.b=g,t.h=y;var w={clone:n(10)},C={clone:n(115)},E={top:function(e,t){if("%"===e.unit)return Math.floor(t.height*(e.value/100))},right:function(e,t){if("%"===e.unit)return Math.floor(t.width-t.width*(e.value/100))},bottom:function(e,t){if("%"===e.unit)return Math.floor(t.height-t.height*(e.value/100))},left:function(e,t){if("%"===e.unit)return Math.floor(t.width*(e.value/100))}}},function(e,t,n){function r(e,t,n,r){t?this.data=t:n?(this.data=new n(e.x*e.y),n===Array&&r&&a.a.init(this.data,0)):(this.data=new Uint8Array(e.x*e.y),Uint8Array===Array&&r&&a.a.init(this.data,0)),this.size=e}var o=n(86),i=n(26),a=n(16),c={clone:n(10)};r.prototype.inImageWithBorder=function(e,t){return e.x>=t&&e.y>=t&&e.x<this.size.x-t&&e.y<this.size.y-t},r.sample=function(e,t,n){var r=Math.floor(t),o=Math.floor(n),i=e.size.x,a=o*e.size.x+r,c=e.data[a+0],u=e.data[a+1],s=e.data[a+i],f=e.data[a+i+1],d=c-u;t-=r,n-=o;var l=Math.floor(t*(n*(d-s+f)-d)+n*(s-c)+c);return l},r.clearArray=function(e){for(var t=e.length;t--;)e[t]=0},r.prototype.subImage=function(e,t){return new o.a(e,t,this)},r.prototype.subImageAsCopy=function(e,t){var n,r,o=e.size.y,i=e.size.x;for(n=0;n<i;n++)for(r=0;r<o;r++)e.data[r*i+n]=this.data[(t.y+r)*this.size.x+t.x+n]},r.prototype.copyTo=function(e){for(var t=this.data.length,n=this.data,r=e.data;t--;)r[t]=n[t]},r.prototype.get=function(e,t){return this.data[t*this.size.x+e]},r.prototype.getSafe=function(e,t){var n;if(!this.indexMapping){for(this.indexMapping={x:[],y:[]},n=0;n<this.size.x;n++)this.indexMapping.x[n]=n,this.indexMapping.x[n+this.size.x]=n;for(n=0;n<this.size.y;n++)this.indexMapping.y[n]=n,this.indexMapping.y[n+this.size.y]=n}return this.data[this.indexMapping.y[t+this.size.y]*this.size.x+this.indexMapping.x[e+this.size.x]]},r.prototype.set=function(e,t,n){return this.data[t*this.size.x+e]=n,this},r.prototype.zeroBorder=function(){var e,t=this.size.x,n=this.size.y,r=this.data;for(e=0;e<t;e++)r[e]=r[(n-1)*t+e]=0;for(e=1;e<n-1;e++)r[e*t]=r[e*t+(t-1)]=0},r.prototype.invert=function(){for(var e=this.data,t=e.length;t--;)e[t]=e[t]?0:1},r.prototype.convolve=function(e){var t,n,r,o,i=e.length/2|0,a=0;for(n=0;n<this.size.y;n++)for(t=0;t<this.size.x;t++){for(a=0,o=-i;o<=i;o++)for(r=-i;r<=i;r++)a+=e[o+i][r+i]*this.getSafe(t+r,n+o);this.data[n*this.size.x+t]=a}},r.prototype.moments=function(e){var t,n,r,o,i,a,u,s,f,d,l,p,h=this.data,v=this.size.y,g=this.size.x,m=[],y=[],b=Math.PI,_=b/4;if(e<=0)return y;for(i=0;i<e;i++)m[i]={m00:0,m01:0,m10:0,m11:0,m02:0,m20:0,theta:0,rad:0};for(n=0;n<v;n++)for(o=n*n,t=0;t<g;t++)r=h[n*g+t],r>0&&(a=m[r-1],a.m00+=1,a.m01+=n,a.m10+=t,a.m11+=t*n,a.m02+=o,a.m20+=t*t);for(i=0;i<e;i++)a=m[i],isNaN(a.m00)||0===a.m00||(d=a.m10/a.m00,l=a.m01/a.m00,u=a.m11/a.m00-d*l,s=a.m02/a.m00-l*l,f=a.m20/a.m00-d*d,p=(s-f)/(2*u),p=.5*Math.atan(p)+(u>=0?_:-_)+b,a.theta=(180*p/b+90)%180-90,a.theta<0&&(a.theta+=180),a.rad=p>b?p-b:p,a.vec=c.clone([Math.cos(p),Math.sin(p)]),y.push(a));return y},r.prototype.show=function(e,t){var n,r,o,i,a,c,u;for(t||(t=1),n=e.getContext("2d"),e.width=this.size.x,e.height=this.size.y,r=n.getImageData(0,0,e.width,e.height),o=r.data,i=0,u=0;u<this.size.y;u++)for(c=0;c<this.size.x;c++)a=u*this.size.x+c,i=this.get(c,u)*t,o[4*a+0]=i,o[4*a+1]=i,o[4*a+2]=i,o[4*a+3]=255;n.putImageData(r,0,0)},r.prototype.overlay=function(e,t,n){(!t||t<0||t>360)&&(t=360);for(var r=[0,1,1],o=[0,0,0],a=[255,255,255],c=[0,0,0],u=[],s=e.getContext("2d"),f=s.getImageData(n.x,n.y,this.size.x,this.size.y),d=f.data,l=this.data.length;l--;)r[0]=this.data[l]*t,u=r[0]<=0?a:r[0]>=360?c:i.a.bind()(r,o),d[4*l+0]=u[0],d[4*l+1]=u[1],d[4*l+2]=u[2],d[4*l+3]=255;s.putImageData(f,n.x,n.y)},t.a=r},function(e,t,n){var r=n(5),o=n(3),i=r(o,"Map");e.e=i},function(e,t,n){function r(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}var o=n(184),i=n(185),a=n(186),c=n(187),u=n(188);r.prototype.clear=o,r.prototype["delete"]=i,r.prototype.get=a,r.prototype.has=c,r.prototype.set=u,e.e=r},function(e,t,n){function r(e,t){for(var n=-1,r=e?e.length:0,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}e.e=r},function(e,t,n){function r(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}e.e=r},function(e,t,n){function r(e,t){return t=i(void 0===t?e.length-1:t,0),function(){for(var n=arguments,r=-1,a=i(n.length-t,0),c=Array(a);++r<a;)c[r]=n[t+r];r=-1;for(var u=Array(t+1);++r<t;)u[r]=n[r];return u[t]=c,o(e,this,u)}}var o=n(123),i=Math.max;e.e=r},function(e,t,n){function r(e){var t=new e.constructor(e.byteLength);return new o(t).set(new o(e)),t}var o=n(50);e.e=r},function(e,t,n){function r(e,t,n,r){n||(n={});for(var i=-1,a=t.length;++i<a;){var c=t[i],u=r?r(n[c],e[c],c,n,e):void 0;o(n,c,void 0===u?e[c]:u)}return n}var o=n(55);e.e=r},function(e,t,n){var r=n(39),o=r(Object.getPrototypeOf,Object);e.e=o},function(e,t,n){var r=n(39),o=n(80),i=Object.getOwnPropertySymbols,a=i?r(i,Object):o;e.e=a},function(e,t,n){var r=n(116),o=n(28),i=n(118),a=n(119),c=n(120),u=n(132),s=n(75),f="[object Map]",d="[object Object]",l="[object Promise]",p="[object Set]",h="[object WeakMap]",v="[object DataView]",g=Object.prototype,m=g.toString,y=s(r),b=s(o),_=s(i),w=s(a),C=s(c),E=u;(r&&E(new r(new ArrayBuffer(1)))!=v||o&&E(new o)!=f||i&&E(i.resolve())!=l||a&&E(new a)!=p||c&&E(new c)!=h)&&(E=function(e){var t=m.call(e),n=t==d?e.constructor:void 0,r=n?s(n):void 0;if(r)switch(r){case y:return v;case b:return f;case _:return l;case w:return p;case C:return h}return t}),e.e=E},function(e,t,n){function r(e,t){return t=null==t?o:t,!!t&&("number"==typeof e||i.test(e))&&e>-1&&e%1==0&&e<t}var o=9007199254740991,i=/^(?:0|[1-9]\d*)$/;e.e=r},function(e,t,n){function r(e,t){return function(n){return e(t(n))}}e.e=r},function(e,t,n){function r(e){var t=o(e)?u.call(e):"";return t==i||t==a}var o=n(2),i="[object Function]",a="[object GeneratorFunction]",c=Object.prototype,u=c.toString;e.e=r},function(e,t,n){function r(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=o}var o=9007199254740991;e.e=r},function(e,t,n){function r(e){return"symbol"==typeof e||o(e)&&c.call(e)==i}var o=n(14),i="[object Symbol]",a=Object.prototype,c=a.toString;e.e=r},function(e,t,n){var r=n(139),o=n(64),i=n(190),a=i&&i.isTypedArray,c=a?o(a):r;e.e=c},function(e,t,n){function r(e,t){return!!t&&t.some(function(t){return Object.keys(t).every(function(n){return t[n]===e[n]})})}function o(e,t){return"function"!=typeof t||t(e)}var i=n(8);t.a={create:function(e){function t(t){return u&&t&&!r(t,e.blacklist)&&o(t,e.filter)}var n=document.createElement("canvas"),a=n.getContext("2d"),c=[],u=e.capacity||20,s=e.capture===!0;return{addResult:function(e,r,o){var f={};t(o)&&(u--,f.codeResult=o,s&&(n.width=r.x,n.height=r.y,i.a.drawImage(e,r,a),f.frame=n.toDataURL()),c.push(f))},getResults:function(){return c}}}}},function(e,t,n){var r=void 0;r=n(88),t.a=r},function(e,t,n){var r={searchDirections:[[0,1],[1,1],[1,0],[1,-1],[0,-1],[-1,-1],[-1,0],[-1,1]],create:function(e,t){function n(e,t,n,r){var o,f,d;for(o=0;o<7;o++){if(f=e.cy+u[e.dir][0],d=e.cx+u[e.dir][1],i=f*s+d,a[i]===t&&(0===c[i]||c[i]===n))return c[i]=n,e.cy=f,e.cx=d,!0;0===c[i]&&(c[i]=r),e.dir=(e.dir+1)%8}return!1}function r(e,t,n){return{dir:n,x:e,y:t,next:null,prev:null}}function o(e,t,o,i,a){var c,u,s,f=null,d={cx:t,cy:e,dir:0};if(n(d,i,o,a)){f=r(t,e,d.dir),c=f,s=d.dir,u=r(d.cx,d.cy,0),u.prev=c,c.next=u,u.next=null,c=u;do d.dir=(d.dir+6)%8,n(d,i,o,a),s!==d.dir?(c.dir=d.dir,u=r(d.cx,d.cy,0),u.prev=c,c.next=u,u.next=null,c=u):(c.dir=s,c.x=d.cx,c.y=d.cy),s=d.dir;while(d.cx!==t||d.cy!==e);f.prev=c.prev,c.prev.next=f}return f}var i,a=e.data,c=t.data,u=this.searchDirections,s=e.size.x;return{trace:function(e,t,r,o){return n(e,t,r,o)},contourTracing:function(e,t,n,r,i){return o(e,t,n,r,i)}}}};t.a=r},function(e,t,n){function r(){o.a.call(this)}var o=n(9),i=n(16),a={ALPHABETH_STRING:{value:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. *$/+%"},ALPHABET:{value:[48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,45,46,32,42,36,47,43,37]},CHARACTER_ENCODINGS:{value:[52,289,97,352,49,304,112,37,292,100,265,73,328,25,280,88,13,268,76,28,259,67,322,19,274,82,7,262,70,22,385,193,448,145,400,208,133,388,196,148,168,162,138,42]},ASTERISK:{value:148},FORMAT:{value:"code_39",writeable:!1}};r.prototype=Object.create(o.a.prototype,a),r.prototype.constructor=r,r.prototype._toCounters=function(e,t){var n,r=this,o=t.length,a=r._row.length,c=!r._row[e],u=0;for(i.a.init(t,0),n=e;n<a;n++)if(r._row[n]^c)t[u]++;else{if(u++,u===o)break;t[u]=1,c=!c}return t},r.prototype._decode=function(){var e,t,n,r,o=this,a=[0,0,0,0,0,0,0,0,0],c=[],u=o._findStart();if(!u)return null;r=o._nextSet(o._row,u.end);do{if(a=o._toCounters(r,a),n=o._toPattern(a),n<0)return null;if(e=o._patternToChar(n),e<0)return null;c.push(e),t=r,r+=i.a.sum(a),r=o._nextSet(o._row,r)}while("*"!==e);return c.pop(),c.length&&o._verifyTrailingWhitespace(t,r,a)?{code:c.join(""),start:u.start,end:r,startInfo:u,decodedCodes:c}:null},r.prototype._verifyTrailingWhitespace=function(e,t,n){var r,o=i.a.sum(n);return r=t-e-o,3*r>=o},r.prototype._patternToChar=function(e){var t,n=this;for(t=0;t<n.CHARACTER_ENCODINGS.length;t++)if(n.CHARACTER_ENCODINGS[t]===e)return String.fromCharCode(n.ALPHABET[t]);return-1},r.prototype._findNextWidth=function(e,t){var n,r=Number.MAX_VALUE;for(n=0;n<e.length;n++)e[n]<r&&e[n]>t&&(r=e[n]);return r},r.prototype._toPattern=function(e){for(var t,n,r=e.length,o=0,i=r,a=0,c=this;i>3;){for(o=c._findNextWidth(e,o),i=0,t=0,n=0;n<r;n++)e[n]>o&&(t|=1<<r-1-n,i++,a+=e[n]);if(3===i){for(n=0;n<r&&i>0;n++)if(e[n]>o&&(i--,2*e[n]>=a))return-1;return t}}return-1},r.prototype._findStart=function(){var e,t,n,r=this,o=r._nextSet(r._row),i=o,a=[0,0,0,0,0,0,0,0,0],c=0,u=!1;for(e=o;e<r._row.length;e++)if(r._row[e]^u)a[c]++;else{if(c===a.length-1){if(r._toPattern(a)===r.ASTERISK&&(n=Math.floor(Math.max(0,i-(e-i)/4)),r._matchRange(n,i,0)))return{start:i,end:e};for(i+=a[0]+a[1],t=0;t<7;t++)a[t]=a[t+2];a[7]=0,a[8]=0,c--}else c++;a[c]=1,u=!u}return null},t.a=r},function(e,t,n){function r(e,t){return e[0]*t[0]+e[1]*t[1]}e.e=r},function(e,t,n){function r(e){var t=-1,n=e?e.length:0;for(this.__data__=new o;++t<n;)this.add(e[t])}var o=n(29),i=n(191),a=n(192);r.prototype.add=r.prototype.push=i,r.prototype.has=a,e.e=r},function(e,t,n){var r=n(3),o=r.Uint8Array;e.e=o},function(e,t,n){function r(e,t){for(var n=-1,r=e?e.length:0;++n<r&&t(e[n],n,e)!==!1;);return e}e.e=r},function(e,t,n){function r(e,t){var n=a(e)||i(e)?o(e.length,String):[],r=n.length,u=!!r;for(var f in e)!t&&!s.call(e,f)||u&&("length"==f||c(f,r))||n.push(f);return n}var o=n(147),i=n(12),a=n(0),c=n(38),u=Object.prototype,s=u.hasOwnProperty;e.e=r},function(e,t,n){function r(e,t,n,r){var o=-1,i=e?e.length:0;for(r&&i&&(n=e[++o]);++o<i;)n=t(n,e[o],o,e);return n}e.e=r},function(e,t,n){function r(e,t,n){(void 0===n||o(e[t],n))&&("number"!=typeof t||void 0!==n||t in e)||(e[t]=n)}var o=n(11);e.e=r},function(e,t,n){function r(e,t,n){var r=e[t];a.call(e,t)&&o(r,n)&&(void 0!==n||t in e)||(e[t]=n)}var o=n(11),i=Object.prototype,a=i.hasOwnProperty;e.e=r},function(e,t,n){function r(e,t,n,a,c){var u=-1,s=e.length;for(n||(n=i),c||(c=[]);++u<s;){var f=e[u];t>0&&n(f)?t>1?r(f,t-1,n,a,c):o(c,f):a||(c[c.length]=f)}return c}var o=n(31),i=n(175);e.e=r},function(e,t,n){function r(e,t){t=i(t,e)?[t]:o(t);for(var n=0,r=t.length;null!=e&&n<r;)e=e[a(t[n++])];return n&&n==r?e:void 0}var o=n(65),i=n(23),a=n(6);e.e=r},function(e,t,n){function r(e,t,n){var r=t(e);return i(e)?r:o(r,n(e))}var o=n(31),i=n(0);e.e=r},function(e,t,n){function r(e,t,n,c,u){return e===t||(null==e||null==t||!i(e)&&!a(t)?e!==e&&t!==t:o(e,t,r,n,c,u))}var o=n(135),i=n(2),a=n(14);e.e=r},function(e,t,n){function r(e){return"function"==typeof e?e:null==e?a:"object"==typeof e?c(e)?i(e[0],e[1]):o(e):u(e)}var o=n(141),i=n(142),a=n(201),c=n(0),u=n(209);e.e=r},function(e,t,n){function r(e){if(!o(e))return a(e);var t=i(e),n=[];for(var r in e)("constructor"!=r||!t&&u.call(e,r))&&n.push(r);return n}var o=n(2),i=n(24),a=n(189),c=Object.prototype,u=c.hasOwnProperty;e.e=r},function(e,t,n){function r(e,t){return e=Object(e),o(e,t,function(t,n){return n in e})}var o=n(63);e.e=r},function(e,t,n){function r(e,t,n){for(var r=-1,o=t.length,i={};++r<o;){var a=t[r],c=e[a];n(c,a)&&(i[a]=c)}return i}e.e=r},function(e,t,n){function r(e){return function(t){return e(t)}}e.e=r},function(e,t,n){function r(e){return o(e)?e:i(e)}var o=n(0),i=n(198);e.e=r},function(e,t,n){function r(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}e.e=r},function(e,t,n){function r(e,t,n,r,u,s){var f=u&c,d=e.length,l=t.length;if(d!=l&&!(f&&l>d))return!1;var p=s.get(e);if(p&&s.get(t))return p==t;var h=-1,v=!0,g=u&a?new o:void 0;for(s.set(e,t),s.set(t,e);++h<d;){var m=e[h],y=t[h];if(r)var b=f?r(y,m,h,t,e,s):r(m,y,h,e,t,s);if(void 0!==b){if(b)continue;v=!1;break}if(g){if(!i(t,function(e,t){if(!g.has(t)&&(m===e||n(m,e,r,u,s)))return g.add(t)})){v=!1;break}}else if(m!==y&&!n(m,y,r,u,s)){v=!1;break}}return s["delete"](e),s["delete"](t),v}var o=n(49),i=n(126),a=1,c=2;e.e=r},function(e,t,n){(function(t){var n="object"==typeof t&&t&&t.Object===Object&&t;e.e=n}).call(t,function(){return this}())},function(e,t,n){function r(e){return o(e,a,i)}var o=n(58),i=n(164),a=n(78);e.e=r},function(e,t,n){function r(e){return e===e&&!o(e)}var o=n(2);e.e=r},function(e,t,n){function r(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}e.e=r},function(e,t,n){function r(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}e.e=r},function(e,t,n){var r=n(39),o=r(Object.keys,Object);e.e=o},function(e,t,n){function r(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}e.e=r},function(e,t,n){function r(e){if(null!=e){try{return i.call(e)}catch(t){}try{return e+""}catch(t){}}return""}var o=Function.prototype,i=o.toString;e.e=r},function(e,t,n){function r(e){return i(e)&&o(e)}var o=n(13),i=n(14);e.e=r},function(e,t,n){(function(e){var r=n(3),o=n(210),i="object"==typeof t&&t&&!t.nodeType&&t,a=i&&"object"==typeof e&&e&&!e.nodeType&&e,c=a&&a.exports===i,u=c?r.Buffer:void 0,s=u?u.isBuffer:void 0,f=s||o;e.e=f}).call(t,n(81)(e))},function(e,t,n){function r(e){return a(e)?o(e,!0):i(e)}var o=n(52),i=n(61),a=n(13);e.e=r},function(e,t,n){var r=n(30),o=n(56),i=n(62),a=n(32),c=n(6),u=a(function(e,t){return null==e?{}:i(e,r(o(t,1),c))});e.e=u},function(e,t,n){function r(){return[]}e.e=r},function(e,t,n){e.e=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children=[],Object.defineProperty(e,"exports",{enumerable:!0,configurable:!1,get:function(){return e.e},set:function(t){return e.e=t}}),Object.defineProperty(e,"loaded",{enumerable:!0,configurable:!1,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,configurable:!1,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,n){function r(e){var t=p.a.bind()(),n=null,r=!1;return{addEventListener:function(e,n){return t.subscribe(e,n),this},removeEventListener:function(e,n){return t.unsubscribe(e,n),this},start:function(){return t.isRunning()?Promise.resolve(!0):n?n:r?(t.start(),Promise.resolve(!0)):n=new Promise(function(o,i){t.init(e,function(e){e&&(console.log(e),i(e)),r=!0,t.start(),o(),n=null})})},stop:function(){return t.stop(),r=!1,this},toPromise:function(){var n=this;if("LiveStream"!==e.inputStream.type&&"VideoStream"!==e.inputStream.type)return new Promise(function(n,r){t.decodeSingle(e,function(e){return e&&e.codeResult&&e.codeResult.code?n(e):r(e)})});var r=function(){var e=!1;return{v:{cancel:function(){e=!0},promise:new Promise(function(r,o){function i(n){n&&n.codeResult&&n.codeResult.code&&(t.stop(),t.unsubscribe("processed",i),r(n)),e&&(t.stop(),t.unsubscribe("processed",i),o("cancelled!"))}t.subscribe("processed",i),n.start()})}}}();return"object"===("undefined"==typeof r?"undefined":b(r))?r.v:void 0},registerResultCollector:function(e){t.registerResultCollector(e)},getCanvas:function(){return t.canvas.dom.image}}}function o(e,t){var n=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];return e=y.a.bind()(e,n,t),r(e)}function i(){var e,t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=arguments[1],r=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],o=u.a.bind()({},t,(e={},
  e[n]=r,e));return a(o)}function a(){var e=arguments.length<=0||void 0===arguments[0]?m.a:arguments[0];return{fromSource:function(t,n){return o(e,t,n)},fromConfig:function(t){return r(u.a.bind()({},e,t))},decoder:function(t){return i(e,"decoder",t)},locator:function(t){return i(e,"locator",t)},throttle:function(t){return i(e,"frequency",1e3/parseInt(t))},config:function(t){return a(u.a.bind()({},e,t))},ImageWrapper:h.a,ImageDebug:v.a,ResultCollector:g.a,_worker:{createScanner:p.a}}}var c=n(7),u=c&&c.__esModule?function(){return c["default"]}:function(){return c};Object.defineProperty(u,"a",{get:u});var s=n(87),f=s&&s.__esModule?function(){return s["default"]}:function(){return s};Object.defineProperty(f,"a",{get:f});var d=n(214),l=d&&d.__esModule?function(){return d["default"]}:function(){return d};Object.defineProperty(l,"a",{get:l});var p=n(109),h=n(27),v=n(8),g=n(44),m=n(45),y=n(92),b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};t["default"]=a()},function(e,t,n){var r={clone:n(10),dot:n(48)};t.a={create:function(e,t){function n(){o(e),i()}function o(e){u[e.id]=e,a.push(e)}function i(){var e,t=0;for(e=0;e<a.length;e++)t+=a[e].rad;c.rad=t/a.length,c.vec=r.clone([Math.cos(c.rad),Math.sin(c.rad)])}var a=[],c={rad:0,vec:r.clone([0,0])},u={};return n(),{add:function(e){u[e.id]||(o(e),i())},fits:function(e){var n=Math.abs(r.dot(e.point.vec,c.vec));return n>t},getPoints:function(){return a},getCenter:function(){return c}}},createPoint:function(e,t,n){return{rad:e[n],point:e,id:t}}}},function(e,t,n){var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o="undefined"!=typeof window,i=o?window:{},a=["MediaStream","HTMLImageElement","HTMLVideoElement","HTMLCanvasElement","FileList","File","URL"],c=a.reduce(function(e,t){var n;return r({},e,(n={},n[t]=t in i?i[t]:function(){},n))},{});c.setObject=function(e,t){c[e]=t},t.a=c},function(e,t,n){function r(){function e(e){return o[e]||(o[e]={subscribers:[]}),o[e]}function t(){o={}}function n(e,t){e.async?setTimeout(function(){e.callback(t)},4):e.callback(t)}function r(t,n,r){var o;if("function"==typeof n)o={callback:n,async:r};else if(o=n,!o.callback)throw"Callback was not specified on options";e(t).subscribers.push(o)}var o={};return{subscribe:function(e,t,n){return r(e,t,n)},publish:function(t,r){var o=e(t),i=o.subscribers;i.filter(function(e){return!!e.once}).forEach(function(e){n(e,r)}),o.subscribers=i.filter(function(e){return!e.once}),o.subscribers.forEach(function(e){n(e,r)})},once:function(e,t,n){r(e,{callback:t,async:n,once:!0})},unsubscribe:function(n,r){var o;n?(o=e(n),o&&r?o.subscribers=o.subscribers.filter(function(e){return e.callback!==r}):o.subscribers=[]):t()}}}t.a=r},function(e,t,n){function r(e,t,n){n||(n={data:null,size:t}),this.data=n.data,this.originalSize=n.size,this.I=n,this.from=e,this.size=t}r.prototype.show=function(e,t){var n,r,o,i,a,c,u;for(t||(t=1),n=e.getContext("2d"),e.width=this.size.x,e.height=this.size.y,r=n.getImageData(0,0,e.width,e.height),o=r.data,i=0,a=0;a<this.size.y;a++)for(c=0;c<this.size.x;c++)u=a*this.size.x+c,i=this.get(c,a)*t,o[4*u+0]=i,o[4*u+1]=i,o[4*u+2]=i,o[4*u+3]=255;r.data=o,n.putImageData(r,0,0)},r.prototype.get=function(e,t){return this.data[(this.from.y+t)*this.originalSize.x+this.from.x+e]},r.prototype.updateData=function(e){this.originalSize=e.size,this.data=e.data},r.prototype.updateFrom=function(e){return this.from=e,this},t.a=r},function(e,t){"undefined"!=typeof window&&(window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)}}()),Math.imul=Math.imul||function(e,t){var n=e>>>16&65535,r=65535&e,o=t>>>16&65535,i=65535&t;return r*i+(n*i+r*o<<16>>>0)|0}},function(e,t,n){e.e={inputStream:{name:"Live",type:"LiveStream",constraints:{width:640,height:480,facingMode:"environment"},area:{top:"0%",right:"0%",left:"0%",bottom:"0%"},singleChannel:!1},locate:!0,numOfWorkers:4,decoder:{readers:["code_128_reader"]},locator:{halfSample:!0,patchSize:"medium"}}},function(e,t,n){var r=n(90),o=(n(8),n(101)),i=n(4),a=n(47),c=n(102),u=n(100),s=n(108),f=n(105),d=n(103),l=n(104),p=n(107),h=n(106),v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},g={code_128_reader:o.a,ean_reader:i.a,ean_5_reader:l.a,ean_2_reader:d.a,ean_8_reader:f.a,code_39_reader:a.a,code_39_vin_reader:c.a,codabar_reader:u.a,upc_reader:s.a,upc_e_reader:p.a,i2of5_reader:h.a};t.a={create:function(e,t){function n(){}function o(){e.readers.forEach(function(e){var t,n={},r=[];"object"===("undefined"==typeof e?"undefined":v(e))?(t=e.format,n=e.config):"string"==typeof e&&(t=e),n.supplements&&(r=n.supplements.map(function(e){return new g[e]})),p.push(new g[t](n,r))})}function i(){}function a(e,n,r){function o(t){var r={y:t*Math.sin(n),x:t*Math.cos(n)};e[0].y-=r.y,e[0].x-=r.x,e[1].y+=r.y,e[1].x+=r.x}for(o(r);r>1&&(!t.inImageWithBorder(e[0],0)||!t.inImageWithBorder(e[1],0));)r-=Math.ceil(r/2),o(-r);return e}function c(e){return[{x:(e[1][0]-e[0][0])/2+e[0][0],y:(e[1][1]-e[0][1])/2+e[0][1]},{x:(e[3][0]-e[2][0])/2+e[2][0],y:(e[3][1]-e[2][1])/2+e[2][1]}]}function u(e){var n,o=null,i=r.a.getBarcodeLine(t,e[0],e[1]);for(r.a.toBinaryLine(i),n=0;n<p.length&&null===o;n++)o=p[n].decodePattern(i.line);return null===o?null:{codeResult:o,barcodeLine:i}}function s(e,t,n){var r,o,i,a=Math.sqrt(Math.pow(e[1][0]-e[0][0],2)+Math.pow(e[1][1]-e[0][1],2)),c=16,s=null,f=Math.sin(n),d=Math.cos(n);for(r=1;r<c&&null===s;r++)o=a/c*r*(r%2===0?-1:1),i={y:o*f,x:o*d},t[0].y+=i.x,t[0].x-=i.y,t[1].y+=i.x,t[1].x-=i.y,s=u(t);return s}function f(e){return Math.sqrt(Math.pow(Math.abs(e[1].y-e[0].y),2)+Math.pow(Math.abs(e[1].x-e[0].x),2))}function d(e){var t,n,r,o;l.ctx.overlay;return t=c(e),o=f(t),n=Math.atan2(t[1].y-t[0].y,t[1].x-t[0].x),t=a(t,n,Math.floor(.1*o)),null===t?null:(r=u(t),null===r&&(r=s(e,t,n)),null===r?null:{codeResult:r.codeResult,line:t,angle:n,pattern:r.barcodeLine.line,threshold:r.barcodeLine.threshold})}var l={ctx:{frequency:null,pattern:null,overlay:null},dom:{frequency:null,pattern:null,overlay:null}},p=[];return n(),o(),i(),{decodeFromBoundingBox:function(e){return d(e)},decodeFromBoundingBoxes:function(t){var n,r,o=[],i=e.multiple;for(n=0;n<t.length;n++){var a=t[n];if(r=d(a)||{},r.box=a,i)o.push(r);else if(r.codeResult)return r}if(i)return{barcodes:o}},setReaders:function(t){e.readers=t,p.length=0,o()}}}}},function(e,t,n){var r={},o={DIR:{UP:1,DOWN:-1}};r.getBarcodeLine=function(e,t,n){function r(e,t){d=y[t*b+e],_+=d,w=d<w?d:w,C=d>C?d:C,m.push(d)}var o,i,a,c,u,s,f,d,l=0|t.x,p=0|t.y,h=0|n.x,v=0|n.y,g=Math.abs(v-p)>Math.abs(h-l),m=[],y=e.data,b=e.size.x,_=0,w=255,C=0;for(g&&(s=l,l=p,p=s,s=h,h=v,v=s),l>h&&(s=l,l=h,h=s,s=p,p=v,v=s),o=h-l,i=Math.abs(v-p),a=o/2|0,u=p,c=p<v?1:-1,f=l;f<h;f++)g?r(u,f):r(f,u),a-=i,a<0&&(u+=c,a+=o);return{line:m,min:w,max:C}},r.toBinaryLine=function(e){var t,n,r,i,a,c,u=e.min,s=e.max,f=e.line,d=u+(s-u)/2,l=[],p=(s-u)/12,h=-p;for(r=f[0]>d?o.DIR.UP:o.DIR.DOWN,l.push({pos:0,val:f[0]}),a=0;a<f.length-2;a++)t=f[a+1]-f[a],n=f[a+2]-f[a+1],i=t+n<h&&f[a+1]<1.5*d?o.DIR.DOWN:t+n>p&&f[a+1]>.5*d?o.DIR.UP:r,r!==i&&(l.push({pos:a,val:f[a]}),r=i);for(l.push({pos:f.length,val:f[f.length-1]}),c=l[0].pos;c<l[1].pos;c++)f[c]=f[c]>d?0:1;for(a=1;a<l.length-1;a++)for(p=l[a+1].val>l[a].val?l[a].val+(l[a+1].val-l[a].val)/3*2|0:l[a+1].val+(l[a].val-l[a+1].val)/3|0,c=l[a].pos;c<l[a+1].pos;c++)f[c]=f[c]>p?0:1;return{line:f,threshold:p}},r.debug={printFrequency:function(e,t){var n,r=t.getContext("2d");for(t.width=e.length,t.height=256,r.beginPath(),r.strokeStyle="blue",n=0;n<e.length;n++)r.moveTo(n,255),r.lineTo(n,255-e[n]);r.stroke(),r.closePath()},printPattern:function(e,t){var n,r=t.getContext("2d");for(t.width=e.length,r.fillColor="black",n=0;n<e.length;n++)1===e[n]&&r.fillRect(n,0,1,100)}},t.a=r},function(e,t,n){function r(e){return new Promise(function(t,n){function r(){o>0?e.videoWidth>0&&e.videoHeight>0?t():window.setTimeout(r,500):n("Unable to play video stream. Is webcam working?"),o--}var o=10;r()})}function o(e,t){return navigator.mediaDevices.getUserMedia(t).then(function(t){return new Promise(function(n){h=t,e.setAttribute("autoplay","true"),e.srcObject=t,e.addEventListener("loadedmetadata",function(){e.play(),n()})})}).then(r.bind(null,e))}function i(e){var t=d.a.bind()(e,["width","height","facingMode","aspectRatio","deviceId"]);return"undefined"!=typeof e.minAspectRatio&&e.minAspectRatio>0&&(t.aspectRatio=e.minAspectRatio,console.log("WARNING: Constraint 'minAspectRatio' is deprecated; Use 'aspectRatio' instead")),"undefined"!=typeof e.facing&&(t.facingMode=e.facing,console.log("WARNING: Constraint 'facing' is deprecated. Use 'facingMode' instead'")),t}function a(e,t){return"string"==typeof t.video.deviceId&&t.video.deviceId.length>0?Promise.resolve(v({},t,{video:v({},s.a.bind()(t.video,"facingMode"))})):e?"undefined"!=typeof MediaStreamTrack&&"undefined"!=typeof MediaStreamTrack.getSources?new Promise(function(n){MediaStreamTrack.getSources(function(r){var o=r.filter(function(t){return"video"===t.kind&&t.facing===e})[0];return n(o?p.a.bind()({},t,{video:{deviceId:o.id}}):t)})}):Promise.resolve(p.a.bind()({},t,{video:{facingMode:e}})):Promise.resolve(t)}function c(e){var t={audio:!1,video:i(e)};return a(t.video.facingMode,t)}var u=n(206),s=u&&u.__esModule?function(){return u["default"]}:function(){return u};Object.defineProperty(s,"a",{get:s});var f=n(79),d=f&&f.__esModule?function(){return f["default"]}:function(){return f};Object.defineProperty(d,"a",{get:d});var l=n(7),p=l&&l.__esModule?function(){return l["default"]}:function(){return l};Object.defineProperty(p,"a",{get:p});var h,v=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.a={request:function(e,t){return c(t).then(o.bind(null,e))},release:function(){var e=h&&h.getVideoTracks();e&&e.length&&e[0].stop(),h=null}}},function(e,t,n){function r(e,t,n){if(n instanceof w.a.MediaStream)return d(e,t,{srcObject:n});if(n instanceof w.a.HTMLImageElement)throw new Error('Source "HTMLImageElement": not yet supported');if(n instanceof w.a.HTMLVideoElement)throw new Error('Source "HTMLVideoElement": not yet supported');if(n instanceof w.a.HTMLCanvasElement)return s(e,t,{canvas:n});if(!(n instanceof w.a.FileList)){if(n instanceof w.a.File)return a(e,t,n);if("string"==typeof n)return c(e,t,n);if("object"!==("undefined"==typeof n?"undefined":C(n))||"undefined"==typeof n.constraints&&"undefined"==typeof n.area)throw new Error("No source given!");return l(e,n)}return n.length>0?a(e,t,n[0]):void 0}function o(e,t){var n=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],r={inputStream:_.a.bind()({type:"ImageStream",sequence:!1,size:800},t),numOfWorkers:1};return _.a.bind()(e,r,{numOfWorkers:"number"==typeof e.numOfWorkers&&e.numOfWorkers>0?1:0},{inputStream:g.a.bind()(y.a.bind()(e.inputStream,["size"]),h.a)},{inputStream:n})}function i(e,t,n){var r=n.src,i=n.mime,a=i.match(/^(video|image)\/(.*)$/i)||[],c=a[1];if("video"===c)return f(e,{src:r},t);if("image"===c)return o(e,{src:r},t);throw new Error('Source with mimetype: "'+c+'" not supported')}function a(e,t,n){var r=w.a.URL.createObjectURL(n);return i(e,t,{src:r,mime:n.type})}function c(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=arguments[2],r=n.match(E.regex)||[],o=r[1];if(o)return i(e,t,{src:n,mime:o});var a=n.match(S.regex);if(a)throw new Error('Source "objectURL": not supported');var c=n.match(T.regex)||[],s=c[2];if(s)return u(e,t,{src:n,ext:s});throw new Error('Source "'+n+'": not recognized')}function u(e,t,n){var r=n.src,i=n.ext;if(i.match(R.regex))return o(e,{src:r},t);if(i.match(O.regex))return f(e,{src:r},t);throw new Error('Source "MediaString": not recognized')}function s(e,t){t.canvas,arguments.length<=2||void 0===arguments[2]?{}:arguments[2];throw new Error('Source "Canvas": not implemented!')}function f(e,t){var n=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];return _.a.bind()({},e,{inputStream:_.a.bind()({type:"VideoStream"},t)},{inputStream:n})}function d(e,t){t.srcObject,arguments.length<=2||void 0===arguments[2]?{}:arguments[2];throw new Error('Source "MediaStream": not implemented!')}function l(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return _.a.bind()({},e,{inputStream:{type:"LiveStream",constraints:{width:640,height:480,facingMode:"environment"}}},{inputStream:t})}var p=n(202),h=p&&p.__esModule?function(){return p["default"]}:function(){return p};Object.defineProperty(h,"a",{get:h});var v=n(207),g=v&&v.__esModule?function(){return v["default"]}:function(){return v};Object.defineProperty(g,"a",{get:g});var m=n(79),y=m&&m.__esModule?function(){return m["default"]}:function(){return m};Object.defineProperty(y,"a",{get:y});var b=n(7),_=b&&b.__esModule?function(){return b["default"]}:function(){return b};Object.defineProperty(_,"a",{get:_});var w=n(84);t.a=r;var C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},E={regex:/^\s*data:([a-z]+\/[a-z0-9\-\+]+(;[a-z\-]+\=[a-z0-9\-]+)?)?(;base64)?,[a-z0-9\!\$\&\'\,\(\)\*\+\,\;\=\-\.\_\~\:\@\/\?\%\s]*\s*$/i},S={regex:/^\s*blob:(.*)$/i},T={regex:/^(?:(?:http[s]?|ftp):\/)?\/?(?:(?:[^:\/\s]+)(?:(?:\/\w+)*\/))?([\w\-]+\.([^#?\s]+))(?:.*)?(?:#[\w\-]+)?$/i},R={regex:/(jpe?g|png|gif|tiff)(?:\s+|$)/i},O={regex:/(webm|ogg|mp4|m4v)/i}},function(e,t,n){function r(e){var t=arguments.length<=1||void 0===arguments[1]?l:arguments[1];return/^blob\:/i.test(e)?i(e).then(o).then(function(e){return a(e,t)}):Promise.resolve(null)}function o(e){return new Promise(function(t){var n=new FileReader;n.onload=function(e){return t(e.target.result)},n.readAsArrayBuffer(e)})}function i(e){return new Promise(function(t,n){var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="blob",r.onreadystatechange=function(){r.readyState!==XMLHttpRequest.DONE||200!==r.status&&0!==r.status||t(this.response)},r.onerror=n,r.send()})}function a(e){var t=arguments.length<=1||void 0===arguments[1]?l:arguments[1],n=new DataView(e),r=e.byteLength,o=t.reduce(function(e,t){var n=Object.keys(d).filter(function(e){return d[e]===t})[0];return n&&(e[n]=t),e},{}),i=2,a=void 0;if(255!==n.getUint8(0)||216!==n.getUint8(1))return!1;for(;i<r;){if(255!==n.getUint8(i))return!1;if(a=n.getUint8(i+1),225===a)return c(n,i+4,o);i+=2+n.getUint16(i+2)}}function c(e,t,n){if("Exif"!==f(e,t,4))return!1;var r=t+6,o=void 0,i=void 0;if(18761===e.getUint16(r))o=!1;else{if(19789!==e.getUint16(r))return!1;o=!0}if(42!==e.getUint16(r+2,!o))return!1;var a=e.getUint32(r+4,!o);return!(a<8)&&(i=u(e,r,r+a,n,o))}function u(e,t,n,r,o){for(var i=e.getUint16(n,!o),a={},c=0;c<i;c++){var u=n+12*c+2,f=r[e.getUint16(u,!o)];f&&(a[f]=s(e,u,t,n,o))}return a}function s(e,t,n,r,o){var i=e.getUint16(t+2,!o),a=e.getUint32(t+4,!o);switch(i){case 3:if(1===a)return e.getUint16(t+8,!o)}}function f(e,t,n){for(var r="",o=t;o<t+n;o++)r+=String.fromCharCode(e.getUint8(o));return r}t.a=r;var d={274:"orientation"},l=Object.keys(d).map(function(e){return d[e]})},function(e,t,n){function r(e,t){e.width!==t.x&&(e.width=t.x),e.height!==t.y&&(e.height=t.y)}var o=n(26),i=Math.PI/180,a={};a.create=function(e,t){var n,a={},c=e.getConfig(),u=(o.f.bind()(e.getRealWidth(),e.getRealHeight()),e.getCanvasSize()),s=o.f.bind()(e.getWidth(),e.getHeight()),f=e.getTopRight(),d=f.x,l=f.y,p=null,h=null;return n=t?t:document.createElement("canvas"),n.width=u.x,n.height=u.y,p=n.getContext("2d"),h=new Uint8Array(s.x*s.y),a.attachData=function(e){h=e},a.getData=function(){return h},a.grab=function(){var t,a=c.halfSample,f=e.getFrame(),v=f,g=0;if(v){if(r(n,u),"ImageStream"===c.type&&(v=f.img,f.tags&&f.tags.orientation))switch(f.tags.orientation){case 6:g=90*i;break;case 8:g=-90*i}return 0!==g?(p.translate(u.x/2,u.y/2),p.rotate(g),p.drawImage(v,-u.y/2,-u.x/2,u.y,u.x),p.rotate(-g),p.translate(-u.x/2,-u.y/2)):p.drawImage(v,0,0,u.x,u.y),t=p.getImageData(d,l,s.x,s.y).data,a?o.i.bind()(t,s,h):o.j.bind()(t,h,c),!0}return!1},a.getSize=function(){return s},a},t.a=a},function(e,t,n){function r(e,t){e.onload=function(){t.loaded(this)}}var o=n(93),i={};i.load=function(e,t,n,i,a){var c,u,s,f=new Array(i),d=new Array(f.length);if(a===!1)f[0]=e;else for(c=0;c<f.length;c++)s=n+c,f[c]=e+"image-"+("00"+s).slice(-3)+".jpg";for(d.notLoaded=[],d.addImage=function(e){d.notLoaded.push(e)},d.loaded=function(n){for(var r=d.notLoaded,i=0;i<r.length;i++)if(r[i]===n){r.splice(i,1);for(var c=0;c<f.length;c++){var u=f[c].substr(f[c].lastIndexOf("/"));if(n.src.lastIndexOf(u)!==-1){d[c]={img:n};break}}break}0===r.length&&(a===!1?o.a.bind()(e,["orientation"]).then(function(e){d[0].tags=e,t(d)})["catch"](function(e){console.log(e),t(d)}):t(d))},c=0;c<f.length;c++)u=new Image,d.addImage(u),r(u,d),u.src=f[c]},t.a=i},function(e,t,n){var r=n(95),o={};o.createVideoStream=function(e){function t(){var t=e.videoWidth,o=e.videoHeight;n=i.size?t/o>1?i.size:Math.floor(t/o*i.size):t,r=i.size?t/o>1?Math.floor(o/t*i.size):i.size:o,s.x=n,s.y=r}var n,r,o={},i=null,a=["canrecord","ended"],c={},u={x:0,y:0},s={x:0,y:0};return o.getRealWidth=function(){return e.videoWidth},o.getRealHeight=function(){return e.videoHeight},o.getWidth=function(){return n},o.getHeight=function(){return r},o.setWidth=function(e){n=e},o.setHeight=function(e){r=e},o.setInputStream=function(t){i=t,e.src="undefined"!=typeof t.src?t.src:""},o.ended=function(){return e.ended},o.getConfig=function(){return i},o.setAttribute=function(t,n){e.setAttribute(t,n)},o.pause=function(){e.pause()},o.play=function(){e.play()},o.setCurrentTime=function(t){"LiveStream"!==i.type&&(e.currentTime=t)},o.addEventListener=function(t,n,r){a.indexOf(t)!==-1?(c[t]||(c[t]=[]),c[t].push(n)):e.addEventListener(t,n,r)},o.clearEventHandlers=function(){a.forEach(function(t){var n=c[t];n&&n.length>0&&n.forEach(function(n){e.removeEventListener(t,n)})})},o.trigger=function(e,n){var r,i=c[e];if("canrecord"===e&&t(),i&&i.length>0)for(r=0;r<i.length;r++)i[r].apply(o,n)},o.setTopRight=function(e){u.x=e.x,u.y=e.y},o.getTopRight=function(){return u},o.setCanvasSize=function(e){s.x=e.x,s.y=e.y},o.getCanvasSize=function(){return s},o.getFrame=function(){return e},o},o.createLiveStream=function(e){e.setAttribute("autoplay",!0);var t=o.createVideoStream(e);return t.ended=function(){return!1},t},o.createImageStream=function(){function e(){d=!1,r.a.load(v,function(e){if(l=e,e[0].tags&&e[0].tags.orientation)switch(e[0].tags.orientation){case 6:case 8:c=e[0].img.height,u=e[0].img.width;break;default:c=e[0].img.width,u=e[0].img.height}else c=e[0].img.width,u=e[0].img.height;n=a.size?c/u>1?a.size:Math.floor(c/u*a.size):c,o=a.size?c/u>1?Math.floor(u/c*a.size):a.size:u,_.x=n,_.y=o,d=!0,s=0,setTimeout(function(){t("canrecord",[])},0)},h,p,a.sequence)}function t(e,t){var n,r=y[e];if(r&&r.length>0)for(n=0;n<r.length;n++)r[n].apply(i,t)}var n,o,i={},a=null,c=0,u=0,s=0,f=!0,d=!1,l=null,p=0,h=1,v=null,g=!1,m=["canrecord","ended"],y={},b={x:0,y:0},_={x:0,y:0};return i.trigger=t,i.getWidth=function(){return n},i.getHeight=function(){return o},i.setWidth=function(e){n=e},i.setHeight=function(e){o=e},i.getRealWidth=function(){return c},i.getRealHeight=function(){return u},i.setInputStream=function(t){a=t,t.sequence===!1?(v=t.src,p=1):(v=t.src,p=t.length),e()},i.ended=function(){return g},i.setAttribute=function(){},i.getConfig=function(){return a},i.pause=function(){f=!0},i.play=function(){f=!1},i.setCurrentTime=function(e){s=e},i.addEventListener=function(e,t){m.indexOf(e)!==-1&&(y[e]||(y[e]=[]),y[e].push(t))},i.clearEventHandlers=function(){y={}},i.setTopRight=function(e){b.x=e.x,b.y=e.y},i.getTopRight=function(){return b},i.setCanvasSize=function(e){_.x=e.x,_.y=e.y},i.getCanvasSize=function(){return _},i.getFrame=function(){var e;return d?(f||(e=l[s],s<p-1?s++:setTimeout(function(){g=!0,t("ended",[])},0)),e):null},i},t.a=o},function(e,t,n){(function(e){function r(t,n){function r(){var t;C=j.halfSample?new i.a({x:k.size.x/2|0,y:k.size.y/2|0}):k,D=a.b.bind()(j.patchSize,C.size),I.x=C.size.x/D.x|0,I.y=C.size.y/D.y|0,P=new i.a(C.size,(void 0),Uint8Array,(!1)),T=new i.a(D,(void 0),Array,(!0)),t=new ArrayBuffer(65536),S=new i.a(D,new Uint8Array(t,0,D.x*D.y)),E=new i.a(D,new Uint8Array(t,D.x*D.y*3,D.x*D.y),(void 0),(!0)),A=f.a.bind()("undefined"!=typeof window?window:"undefined"!=typeof self?self:e,{size:D.x},t),x=new i.a({x:C.size.x/S.size.x|0,y:C.size.y/S.size.y|0},(void 0),Array,(!0)),R=new i.a(x.size,(void 0),(void 0),(!0)),O=new i.a(x.size,(void 0),Int32Array,(!0))}function o(){j.useWorker||"undefined"==typeof document||(M.dom.binary=document.createElement("canvas"),M.dom.binary.className="binaryBuffer",M.ctx.binary=M.dom.binary.getContext("2d"),M.dom.binary.width=P.size.x,M.dom.binary.height=P.size.y)}function p(e){var t,n,r,o,i,a,c,u=P.size.x,s=P.size.y,f=-P.size.x,p=-P.size.y;for(t=0,n=0;n<e.length;n++)o=e[n],t+=o.rad;for(t/=e.length,t=(180*t/Math.PI+90)%180-90,t<0&&(t+=180),t=(180-t)*Math.PI/180,i=l.copy(l.create(),[Math.cos(t),Math.sin(t),-Math.sin(t),Math.cos(t)]),n=0;n<e.length;n++)for(o=e[n],r=0;r<4;r++)d.transformMat2(o.box[r],o.box[r],i);for(n=0;n<e.length;n++)for(o=e[n],r=0;r<4;r++)o.box[r][0]<u&&(u=o.box[r][0]),o.box[r][0]>f&&(f=o.box[r][0]),o.box[r][1]<s&&(s=o.box[r][1]),o.box[r][1]>p&&(p=o.box[r][1]);for(a=[[u,s],[f,s],[f,p],[u,p]],c=j.halfSample?2:1,i=l.invert(i,i),r=0;r<4;r++)d.transformMat2(a[r],a[r],i);for(r=0;r<4;r++)d.scale(a[r],a[r],c);return a}function h(){a.c.bind()(C,P),P.zeroBorder()}function v(){var e,t,n,r,o,i,a,s=[];for(e=0;e<I.x;e++)for(t=0;t<I.y;t++)n=S.size.x*e,r=S.size.y*t,b(n,r),E.zeroBorder(),c.a.init(T.data,0),i=u.a.create(E,T),a=i.rasterize(0),o=T.moments(a.count),s=s.concat(_(o,[e,t],n,r));return s}function g(e){var t,n,r=[],o=[];for(t=0;t<e;t++)r.push(0);for(n=O.data.length;n--;)O.data[n]>0&&r[O.data[n]-1]++;return r=r.map(function(e,t){return{val:e,label:t+1}}),r.sort(function(e,t){return t.val-e.val}),o=r.filter(function(e){return e.val>=5})}function m(e,t){var n,r,o,i,a=[],c=[];for(n=0;n<e.length;n++){for(r=O.data.length,a.length=0;r--;)O.data[r]===e[n].label&&(o=x.data[r],a.push(o));i=p(a),i&&c.push(i)}return c}function y(e){var t=a.d.bind()(e,.9),n=a.e.bind()(t,1,function(e){return e.getPoints().length}),r=[],o=[];if(1===n.length){r=n[0].item.getPoints();for(var i=0;i<r.length;i++)o.push(r[i].point)}return o}function b(e,t){P.subImageAsCopy(S,a.f.bind()(e,t)),A.skeletonize()}function _(e,t,n,r){var o,i,a,c,u=[],s=[],f=Math.ceil(D.x/3);if(e.length>=2){for(o=0;o<e.length;o++)e[o].m00>f&&u.push(e[o]);if(u.length>=2){for(a=y(u),i=0,o=0;o<a.length;o++)i+=a[o].rad;a.length>1&&a.length>=u.length/4*3&&a.length>e.length/4&&(i/=a.length,c={index:t[1]*I.x+t[0],pos:{x:n,y:r},box:[d.clone([n,r]),d.clone([n+S.size.x,r]),d.clone([n+S.size.x,r+S.size.y]),d.clone([n,r+S.size.y])],moments:a,rad:i,vec:d.clone([Math.cos(i),Math.sin(i)])},s.push(c))}}return s}function w(e){function t(){var e;for(e=0;e<O.data.length;e++)if(0===O.data[e]&&1===R.data[e])return e;return O.length}function n(e){var t,r,o,c,u,f,l={x:e%O.size.x,y:e/O.size.x|0};if(e<O.data.length)for(o=x.data[e],O.data[e]=i,u=0;u<s.a.searchDirections.length;u++)r=l.y+s.a.searchDirections[u][0],t=l.x+s.a.searchDirections[u][1],c=r*O.size.x+t,0!==R.data[c]?0===O.data[c]&&(f=Math.abs(d.dot(x.data[c].vec,o.vec)),f>a&&n(c)):O.data[c]=Number.MAX_VALUE}var r,o,i=0,a=.95,u=0;for(c.a.init(R.data,0),c.a.init(O.data,0),c.a.init(x.data,null),r=0;r<e.length;r++)o=e[r],x.data[o.index]=o,R.data[o.index]=1;for(R.zeroBorder();(u=t())<O.data.length;)i++,n(u);return i}var C,E,S,T,R,O,x,P,D,A,j=n,M={ctx:{binary:null},dom:{binary:null}},I={x:0,y:0},k=t;return r(),o(),{locate:function(){var e,t,n;if(j.halfSample&&a.g.bind()(k,C),h(),e=v(),e.length<I.x*I.y*.05)return null;var r=w(e);return r<1?null:(t=g(r),0===t.length?null:n=m(t,r))}}}function o(e,t){var n,r,o,i=e.getWidth(),c=e.getHeight(),u=t.halfSample?.5:1;if(e.getConfig().area&&(o=a.h.bind()(i,c,e.getConfig().area),e.setTopRight({x:o.sx,y:o.sy}),e.setCanvasSize({x:i,y:c}),i=o.sw,c=o.sh),r={x:Math.floor(i*u),y:Math.floor(c*u)},n=a.b.bind()(t.patchSize,r),e.setWidth(Math.floor(Math.floor(r.x/n.x)*(1/u)*n.x)),e.setHeight(Math.floor(Math.floor(r.y/n.y)*(1/u)*n.y)),e.getWidth()%n.x===0&&e.getHeight()%n.y===0)return!0;throw new Error("Image dimensions do not comply with the current settings: Width ("+i+" )and height ("+c+") must a multiple of "+n.x)}var i=n(27),a=n(26),c=n(16),u=(n(8),n(98)),s=n(46),f=n(99);t.b=r,t.a=o;var d={clone:n(10),dot:n(48),scale:n(113),transformMat2:n(114)},l={copy:n(110),create:n(111),invert:n(112)}}).call(t,function(){return this}())},function(e,t,n){var r=n(46),o={createContour2D:function(){return{dir:null,index:null,firstVertex:null,insideContours:null,nextpeer:null,prevpeer:null}},CONTOUR_DIR:{CW_DIR:0,CCW_DIR:1,UNKNOWN_DIR:2},DIR:{OUTSIDE_EDGE:-32767,INSIDE_EDGE:-32766},create:function(e,t){var n=e.data,i=t.data,a=e.size.x,c=e.size.y,u=r.a.create(e,t);return{rasterize:function(e){var t,r,s,f,d,l,p,h,v,g,m,y,b=[],_=0;for(y=0;y<400;y++)b[y]=0;for(b[0]=n[0],v=null,l=1;l<c-1;l++)for(f=0,r=b[0],d=1;d<a-1;d++)if(m=l*a+d,0===i[m])if(t=n[m],t!==r){if(0===f)s=_+1,b[s]=t,r=t,p=u.contourTracing(l,d,s,t,o.DIR.OUTSIDE_EDGE),null!==p&&(_++,f=s,h=o.createContour2D(),h.dir=o.CONTOUR_DIR.CW_DIR,h.index=f,h.firstVertex=p,h.nextpeer=v,h.insideContours=null,null!==v&&(v.prevpeer=h),v=h);else if(p=u.contourTracing(l,d,o.DIR.INSIDE_EDGE,t,f),null!==p){for(h=o.createContour2D(),h.firstVertex=p,h.insideContours=null,0===e?h.dir=o.CONTOUR_DIR.CCW_DIR:h.dir=o.CONTOUR_DIR.CW_DIR,h.index=e,g=v;null!==g&&g.index!==f;)g=g.nextpeer;null!==g&&(h.nextpeer=g.insideContours,null!==g.insideContours&&(g.insideContours.prevpeer=h),g.insideContours=h)}}else i[m]=f;else i[m]===o.DIR.OUTSIDE_EDGE||i[m]===o.DIR.INSIDE_EDGE?(f=0,r=i[m]===o.DIR.INSIDE_EDGE?n[m]:b[0]):(f=i[m],r=b[f]);for(g=v;null!==g;)g.index=e,g=g.nextpeer;return{cc:v,count:_}},debug:{drawContour:function(e,t){var n,r,i,a=e.getContext("2d"),c=t;for(a.strokeStyle="red",a.fillStyle="red",a.lineWidth=1,n=null!==c?c.insideContours:null;null!==c;){switch(null!==n?(r=n,n=n.nextpeer):(r=c,c=c.nextpeer,n=null!==c?c.insideContours:null),r.dir){case o.CONTOUR_DIR.CW_DIR:a.strokeStyle="red";break;case o.CONTOUR_DIR.CCW_DIR:a.strokeStyle="blue";break;case o.CONTOUR_DIR.UNKNOWN_DIR:a.strokeStyle="green"}i=r.firstVertex,a.beginPath(),a.moveTo(i.x,i.y);do i=i.next,a.lineTo(i.x,i.y);while(i!==r.firstVertex);a.stroke()}}}}}};t.a=o},function(module, exports, __webpack_require__) {function Skeletonizer(stdlib, foreign, buffer) {"use asm";var images=new stdlib.Uint8Array(buffer),size=foreign.size|0,imul=stdlib.Math.imul;function erode(inImagePtr, outImagePtr) {inImagePtr=inImagePtr|0;outImagePtr=outImagePtr|0;var v=0,u=0,sum=0,yStart1=0,yStart2=0,xStart1=0,xStart2=0,offset=0;for (v=1; (v|0)<(size - 1|0); v=v+1|0) {offset=offset+size|0;for (u=1; (u|0)<(size - 1|0); u=u+1|0) {yStart1=offset - size|0;yStart2=offset+size|0;xStart1=u - 1|0;xStart2=u+1|0;sum=(images[inImagePtr+yStart1+xStart1|0]|0)+(images[inImagePtr+yStart1+xStart2|0]|0)+(images[inImagePtr+offset+u|0]|0)+(images[inImagePtr+yStart2+xStart1|0]|0)+(images[inImagePtr+yStart2+xStart2|0]|0)|0;if ((sum|0) == (5|0)) {images[outImagePtr+offset+u|0]=1;} else {images[outImagePtr+offset+u|0]=0;}}}return;}function subtract(aImagePtr, bImagePtr, outImagePtr) {aImagePtr=aImagePtr|0;bImagePtr=bImagePtr|0;outImagePtr=outImagePtr|0;var length=0;length=imul(size, size)|0;while ((length|0)>0) {length=length - 1|0;images[outImagePtr+length|0]=(images[aImagePtr+length|0]|0) - (images[bImagePtr+length|0]|0)|0;}}function bitwiseOr(aImagePtr, bImagePtr, outImagePtr) {aImagePtr=aImagePtr|0;bImagePtr=bImagePtr|0;outImagePtr=outImagePtr|0;var length=0;length=imul(size, size)|0;while ((length|0)>0) {length=length - 1|0;images[outImagePtr+length|0]=images[aImagePtr+length|0]|0|(images[bImagePtr+length|0]|0)|0;}}function countNonZero(imagePtr) {imagePtr=imagePtr|0;var sum=0,length=0;length=imul(size, size)|0;while ((length|0)>0) {length=length - 1|0;sum=(sum|0)+(images[imagePtr+length|0]|0)|0;}return sum|0;}function init(imagePtr, value) {imagePtr=imagePtr|0;value=value|0;var length=0;length=imul(size, size)|0;while ((length|0)>0) {length=length - 1|0;images[imagePtr+length|0]=value;}}function dilate(inImagePtr, outImagePtr) {inImagePtr=inImagePtr|0;outImagePtr=outImagePtr|0;var v=0,u=0,sum=0,yStart1=0,yStart2=0,xStart1=0,xStart2=0,offset=0;for (v=1; (v|0)<(size - 1|0); v=v+1|0) {offset=offset+size|0;for (u=1; (u|0)<(size - 1|0); u=u+1|0) {yStart1=offset - size|0;yStart2=offset+size|0;xStart1=u - 1|0;xStart2=u+1|0;sum=(images[inImagePtr+yStart1+xStart1|0]|0)+(images[inImagePtr+yStart1+xStart2|0]|0)+(images[inImagePtr+offset+u|0]|0)+(images[inImagePtr+yStart2+xStart1|0]|0)+(images[inImagePtr+yStart2+xStart2|0]|0)|0;if ((sum|0)>(0|0)) {images[outImagePtr+offset+u|0]=1;} else {images[outImagePtr+offset+u|0]=0;}}}return;}function memcpy(srcImagePtr, dstImagePtr) {srcImagePtr=srcImagePtr|0;dstImagePtr=dstImagePtr|0;var length=0;length=imul(size, size)|0;while ((length|0)>0) {length=length - 1|0;images[dstImagePtr+length|0]=images[srcImagePtr+length|0]|0;}}function zeroBorder(imagePtr) {imagePtr=imagePtr|0;var x=0,y=0;for (x=0; (x|0)<(size - 1|0); x=x+1|0) {images[imagePtr+x|0]=0;images[imagePtr+y|0]=0;y=y+size - 1|0;images[imagePtr+y|0]=0;y=y+1|0;}for (x=0; (x|0)<(size|0); x=x+1|0) {images[imagePtr+y|0]=0;y=y+1|0;}}function skeletonize() {var subImagePtr=0,erodedImagePtr=0,tempImagePtr=0,skelImagePtr=0,sum=0,done=0;erodedImagePtr=imul(size, size)|0;tempImagePtr=erodedImagePtr+erodedImagePtr|0;skelImagePtr=tempImagePtr+erodedImagePtr|0;init(skelImagePtr, 0);zeroBorder(subImagePtr);do {erode(subImagePtr, erodedImagePtr);dilate(erodedImagePtr, tempImagePtr);subtract(subImagePtr, tempImagePtr, tempImagePtr);bitwiseOr(skelImagePtr, tempImagePtr, skelImagePtr);memcpy(erodedImagePtr, subImagePtr);sum=countNonZero(subImagePtr)|0;done=(sum|0) == 0|0;} while (!done);}return {skeletonize: skeletonize};} exports["a"]=Skeletonizer; },function(e,t,n){function r(){o.a.call(this),this._counters=[]}var o=n(9),i={ALPHABETH_STRING:{value:"0123456789-$:/.+ABCD"},ALPHABET:{value:[48,49,50,51,52,53,54,55,56,57,45,36,58,47,46,43,65,66,67,68]},CHARACTER_ENCODINGS:{value:[3,6,9,96,18,66,33,36,48,72,12,24,69,81,84,21,26,41,11,14]},START_END:{value:[26,41,11,14]},MIN_ENCODED_CHARS:{value:4},MAX_ACCEPTABLE:{value:2},PADDING:{value:1.5},FORMAT:{value:"codabar",writeable:!1}};r.prototype=Object.create(o.a.prototype,i),r.prototype.constructor=r,r.prototype._decode=function(){var e,t,n,r,o,i=this,a=[];if(this._counters=i._fillCounters(),e=i._findStart(),!e)return null;r=e.startCounter;do{if(n=i._toPattern(r),n<0)return null;if(t=i._patternToChar(n),t<0)return null;if(a.push(t),r+=8,a.length>1&&i._isStartEnd(n))break}while(r<i._counters.length);return a.length-2<i.MIN_ENCODED_CHARS||!i._isStartEnd(n)?null:i._verifyWhitespace(e.startCounter,r-8)&&i._validateResult(a,e.startCounter)?(r=r>i._counters.length?i._counters.length:r,o=e.start+i._sumCounters(e.startCounter,r-8),{code:a.join(""),start:e.start,end:o,startInfo:e,decodedCodes:a}):null},r.prototype._verifyWhitespace=function(e,t){return(e-1<=0||this._counters[e-1]>=this._calculatePatternLength(e)/2)&&(t+8>=this._counters.length||this._counters[t+7]>=this._calculatePatternLength(t)/2)},r.prototype._calculatePatternLength=function(e){var t,n=0;for(t=e;t<e+7;t++)n+=this._counters[t];return n},r.prototype._thresholdResultPattern=function(e,t){var n,r,o,i,a,c=this,u={space:{narrow:{size:0,counts:0,min:0,max:Number.MAX_VALUE},wide:{size:0,counts:0,min:0,max:Number.MAX_VALUE}},bar:{narrow:{size:0,counts:0,min:0,max:Number.MAX_VALUE},wide:{size:0,counts:0,min:0,max:Number.MAX_VALUE}}},s=t;for(o=0;o<e.length;o++){for(a=c._charToPattern(e[o]),i=6;i>=0;i--)n=2===(1&i)?u.bar:u.space,r=1===(1&a)?n.wide:n.narrow,r.size+=c._counters[s+i],r.counts++,a>>=1;s+=8}return["space","bar"].forEach(function(e){var t=u[e];t.wide.min=Math.floor((t.narrow.size/t.narrow.counts+t.wide.size/t.wide.counts)/2),t.narrow.max=Math.ceil(t.wide.min),t.wide.max=Math.ceil((t.wide.size*c.MAX_ACCEPTABLE+c.PADDING)/t.wide.counts)}),u},r.prototype._charToPattern=function(e){var t,n=this,r=e.charCodeAt(0);for(t=0;t<n.ALPHABET.length;t++)if(n.ALPHABET[t]===r)return n.CHARACTER_ENCODINGS[t];return 0},r.prototype._validateResult=function(e,t){var n,r,o,i,a,c,u=this,s=u._thresholdResultPattern(e,t),f=t;for(n=0;n<e.length;n++){for(c=u._charToPattern(e[n]),r=6;r>=0;r--){if(o=0===(1&r)?s.bar:s.space,i=1===(1&c)?o.wide:o.narrow,a=u._counters[f+r],a<i.min||a>i.max)return!1;c>>=1}f+=8}return!0},r.prototype._patternToChar=function(e){var t,n=this;for(t=0;t<n.CHARACTER_ENCODINGS.length;t++)if(n.CHARACTER_ENCODINGS[t]===e)return String.fromCharCode(n.ALPHABET[t]);return-1},r.prototype._computeAlternatingThreshold=function(e,t){var n,r,o=Number.MAX_VALUE,i=0;for(n=e;n<t;n+=2)r=this._counters[n],r>i&&(i=r),r<o&&(o=r);return(o+i)/2|0},r.prototype._toPattern=function(e){var t,n,r,o,i=7,a=e+i,c=1<<i-1,u=0;if(a>this._counters.length)return-1;for(t=this._computeAlternatingThreshold(e,a),n=this._computeAlternatingThreshold(e+1,a),r=0;r<i;r++)o=0===(1&r)?t:n,this._counters[e+r]>o&&(u|=c),c>>=1;return u},r.prototype._isStartEnd=function(e){var t;for(t=0;t<this.START_END.length;t++)if(this.START_END[t]===e)return!0;return!1},r.prototype._sumCounters=function(e,t){var n,r=0;for(n=e;n<t;n++)r+=this._counters[n];return r},r.prototype._findStart=function(){var e,t,n,r=this,o=r._nextUnset(r._row);for(e=1;e<this._counters.length;e++)if(t=r._toPattern(e),t!==-1&&r._isStartEnd(t))return o+=r._sumCounters(0,e),n=o+r._sumCounters(e,e+8),{start:o,end:n,startCounter:e,endCounter:e+8}},t.a=r},function(e,t,n){function r(){i.a.call(this)}function o(e,t,n){for(var r=n.length,o=0,i=0;r--;)i+=e[n[r]],o+=t[n[r]];return i/o}var i=n(9),a={CODE_SHIFT:{value:98},CODE_C:{value:99},CODE_B:{value:100},CODE_A:{value:101},START_CODE_A:{value:103},START_CODE_B:{value:104},START_CODE_C:{value:105},STOP_CODE:{value:106},CODE_PATTERN:{value:[[2,1,2,2,2,2],[2,2,2,1,2,2],[2,2,2,2,2,1],[1,2,1,2,2,3],[1,2,1,3,2,2],[1,3,1,2,2,2],[1,2,2,2,1,3],[1,2,2,3,1,2],[1,3,2,2,1,2],[2,2,1,2,1,3],[2,2,1,3,1,2],[2,3,1,2,1,2],[1,1,2,2,3,2],[1,2,2,1,3,2],[1,2,2,2,3,1],[1,1,3,2,2,2],[1,2,3,1,2,2],[1,2,3,2,2,1],[2,2,3,2,1,1],[2,2,1,1,3,2],[2,2,1,2,3,1],[2,1,3,2,1,2],[2,2,3,1,1,2],[3,1,2,1,3,1],[3,1,1,2,2,2],[3,2,1,1,2,2],[3,2,1,2,2,1],[3,1,2,2,1,2],[3,2,2,1,1,2],[3,2,2,2,1,1],[2,1,2,1,2,3],[2,1,2,3,2,1],[2,3,2,1,2,1],[1,1,1,3,2,3],[1,3,1,1,2,3],[1,3,1,3,2,1],[1,1,2,3,1,3],[1,3,2,1,1,3],[1,3,2,3,1,1],[2,1,1,3,1,3],[2,3,1,1,1,3],[2,3,1,3,1,1],[1,1,2,1,3,3],[1,1,2,3,3,1],[1,3,2,1,3,1],[1,1,3,1,2,3],[1,1,3,3,2,1],[1,3,3,1,2,1],[3,1,3,1,2,1],[2,1,1,3,3,1],[2,3,1,1,3,1],[2,1,3,1,1,3],[2,1,3,3,1,1],[2,1,3,1,3,1],[3,1,1,1,2,3],[3,1,1,3,2,1],[3,3,1,1,2,1],[3,1,2,1,1,3],[3,1,2,3,1,1],[3,3,2,1,1,1],[3,1,4,1,1,1],[2,2,1,4,1,1],[4,3,1,1,1,1],[1,1,1,2,2,4],[1,1,1,4,2,2],[1,2,1,1,2,4],[1,2,1,4,2,1],[1,4,1,1,2,2],[1,4,1,2,2,1],[1,1,2,2,1,4],[1,1,2,4,1,2],[1,2,2,1,1,4],[1,2,2,4,1,1],[1,4,2,1,1,2],[1,4,2,2,1,1],[2,4,1,2,1,1],[2,2,1,1,1,4],[4,1,3,1,1,1],[2,4,1,1,1,2],[1,3,4,1,1,1],[1,1,1,2,4,2],[1,2,1,1,4,2],[1,2,1,2,4,1],[1,1,4,2,1,2],[1,2,4,1,1,2],[1,2,4,2,1,1],[4,1,1,2,1,2],[4,2,1,1,1,2],[4,2,1,2,1,1],[2,1,2,1,4,1],[2,1,4,1,2,1],[4,1,2,1,2,1],[1,1,1,1,4,3],[1,1,1,3,4,1],[1,3,1,1,4,1],[1,1,4,1,1,3],[1,1,4,3,1,1],[4,1,1,1,1,3],[4,1,1,3,1,1],[1,1,3,1,4,1],[1,1,4,1,3,1],[3,1,1,1,4,1],[4,1,1,1,3,1],[2,1,1,4,1,2],[2,1,1,2,1,4],[2,1,1,2,3,2],[2,3,3,1,1,1,2]]},SINGLE_CODE_ERROR:{value:.64},AVG_CODE_ERROR:{value:.3},FORMAT:{value:"code_128",writeable:!1},MODULE_INDICES:{value:{bar:[0,2,4],space:[1,3,5]}}};r.prototype=Object.create(i.a.prototype,a),r.prototype.constructor=r,r.prototype._decodeCode=function(e,t){var n,r,i,a=[0,0,0,0,0,0],c=this,u=e,s=!c._row[u],f=0,d={error:Number.MAX_VALUE,code:-1,start:e,end:e,correction:{bar:1,space:1}};for(n=u;n<c._row.length;n++)if(c._row[n]^s)a[f]++;else{if(f===a.length-1){for(t&&c._correct(a,t),r=0;r<c.CODE_PATTERN.length;r++)i=c._matchPattern(a,c.CODE_PATTERN[r]),i<d.error&&(d.code=r,d.error=i);return d.end=n,d.code===-1||d.error>c.AVG_CODE_ERROR?null:(c.CODE_PATTERN[d.code]&&(d.correction.bar=o(c.CODE_PATTERN[d.code],a,this.MODULE_INDICES.bar),d.correction.space=o(c.CODE_PATTERN[d.code],a,this.MODULE_INDICES.space)),d)}f++,a[f]=1,s=!s}return null},r.prototype._correct=function(e,t){this._correctBars(e,t.bar,this.MODULE_INDICES.bar),this._correctBars(e,t.space,this.MODULE_INDICES.space)},r.prototype._findStart=function(){var e,t,n,r,i,a=[0,0,0,0,0,0],c=this,u=c._nextSet(c._row),s=!1,f=0,d={error:Number.MAX_VALUE,code:-1,start:0,end:0,correction:{bar:1,space:1}};for(e=u;e<c._row.length;e++)if(c._row[e]^s)a[f]++;else{if(f===a.length-1){for(i=0,r=0;r<a.length;r++)i+=a[r];for(t=c.START_CODE_A;t<=c.START_CODE_C;t++)n=c._matchPattern(a,c.CODE_PATTERN[t]),n<d.error&&(d.code=t,d.error=n);if(d.error<c.AVG_CODE_ERROR)return d.start=e-i,d.end=e,d.correction.bar=o(c.CODE_PATTERN[d.code],a,this.MODULE_INDICES.bar),d.correction.space=o(c.CODE_PATTERN[d.code],a,this.MODULE_INDICES.space),d;for(r=0;r<4;r++)a[r]=a[r+2];a[4]=0,a[5]=0,f--}else f++;a[f]=1,s=!s}return null},r.prototype._decode=function(){var e,t,n=this,r=n._findStart(),o=null,i=!1,a=[],c=0,u=0,s=[],f=[],d=!1,l=!0;if(null===r)return null;switch(o={code:r.code,start:r.start,end:r.end,correction:{bar:r.correction.bar,space:r.correction.space}},f.push(o),u=o.code,o.code){case n.START_CODE_A:e=n.CODE_A;break;case n.START_CODE_B:e=n.CODE_B;break;case n.START_CODE_C:e=n.CODE_C;break;default:return null}for(;!i;){if(t=d,d=!1,o=n._decodeCode(o.end,o.correction),null!==o)switch(o.code!==n.STOP_CODE&&(l=!0),o.code!==n.STOP_CODE&&(s.push(o.code),c++,u+=c*o.code),f.push(o),e){case n.CODE_A:if(o.code<64)a.push(String.fromCharCode(32+o.code));else if(o.code<96)a.push(String.fromCharCode(o.code-64));else switch(o.code!==n.STOP_CODE&&(l=!1),o.code){case n.CODE_SHIFT:d=!0,e=n.CODE_B;break;case n.CODE_B:e=n.CODE_B;break;case n.CODE_C:e=n.CODE_C;break;case n.STOP_CODE:i=!0}break;case n.CODE_B:if(o.code<96)a.push(String.fromCharCode(32+o.code));else switch(o.code!==n.STOP_CODE&&(l=!1),o.code){case n.CODE_SHIFT:d=!0,e=n.CODE_A;break;case n.CODE_A:e=n.CODE_A;break;case n.CODE_C:e=n.CODE_C;break;case n.STOP_CODE:i=!0}break;case n.CODE_C:if(o.code<100)a.push(o.code<10?"0"+o.code:o.code);else switch(o.code!==n.STOP_CODE&&(l=!1),o.code){case n.CODE_A:e=n.CODE_A;break;case n.CODE_B:e=n.CODE_B;break;case n.STOP_CODE:i=!0}}else i=!0;t&&(e=e===n.CODE_A?n.CODE_B:n.CODE_A)}return null===o?null:(o.end=n._nextUnset(n._row,o.end),n._verifyTrailingWhitespace(o)?(u-=c*s[s.length-1],u%103!==s[s.length-1]?null:a.length?(l&&a.splice(a.length-1,1),{code:a.join(""),start:r.start,end:o.end,codeset:e,startInfo:r,decodedCodes:f,endInfo:o}):null):null)},i.a.prototype._verifyTrailingWhitespace=function(e){var t,n=this;return t=e.end+(e.end-e.start)/2,t<n._row.length&&n._matchRange(e.end,t,0)?e:null},t.a=r},function(e,t,n){function r(){o.a.call(this)}var o=n(47),i={IOQ:/[IOQ]/g,AZ09:/[A-Z0-9]{17}/};r.prototype=Object.create(o.a.prototype),r.prototype.constructor=r,r.prototype._decode=function(){var e=o.a.prototype._decode.apply(this);if(!e)return null;var t=e.code;return t?(t=t.replace(i.IOQ,""),t.match(i.AZ09)&&this._checkChecksum(t)?(e.code=t,e):null):null},r.prototype._checkChecksum=function(e){return!!e},t.a=r},function(e,t,n){function r(){o.a.call(this)}var o=n(4),i={FORMAT:{value:"ean_2",writeable:!1}};r.prototype=Object.create(o.a.prototype,i),r.prototype.constructor=r,r.prototype.decode=function(e,t){this._row=e;var n,r=0,o=0,i=t,a=this._row.length,c=[],u=[];for(o=0;o<2&&i<a;o++){if(n=this._decodeCode(i),!n)return null;u.push(n),c.push(n.code%10),n.code>=this.CODE_G_START&&(r|=1<<1-o),1!=o&&(i=this._nextSet(this._row,n.end),i=this._nextUnset(this._row,i))}return 2!=c.length||parseInt(c.join(""))%4!==r?null:{code:c.join(""),decodedCodes:u,end:n.end}},t.a=r},function(e,t,n){function r(){a.a.call(this)}function o(e){var t;for(t=0;t<10;t++)if(e===u[t])return t;return null}function i(e){var t,n=e.length,r=0;for(t=n-2;t>=0;t-=2)r+=e[t];for(r*=3,t=n-1;t>=0;t-=2)r+=e[t];return r*=3,r%10}var a=n(4),c={FORMAT:{value:"ean_5",writeable:!1}},u=[24,20,18,17,12,6,3,10,9,5];r.prototype=Object.create(a.a.prototype,c),r.prototype.constructor=r,r.prototype.decode=function(e,t){this._row=e;var n,r=0,a=0,c=t,u=this._row.length,s=[],f=[];for(a=0;a<5&&c<u;a++){if(n=this._decodeCode(c),!n)return null;f.push(n),s.push(n.code%10),n.code>=this.CODE_G_START&&(r|=1<<4-a),4!=a&&(c=this._nextSet(this._row,n.end),c=this._nextUnset(this._row,c))}return 5!=s.length?null:i(s)!==o(r)?null:{code:s.join(""),decodedCodes:f,end:n.end}},t.a=r},function(e,t,n){function r(e,t){o.a.call(this,e,t)}var o=n(4),i={FORMAT:{value:"ean_8",writeable:!1}};r.prototype=Object.create(o.a.prototype,i),r.prototype.constructor=r,r.prototype._decodePayload=function(e,t,n){var r,o=this;for(r=0;r<4;r++){if(e=o._decodeCode(e.end,o.CODE_G_START),!e)return null;t.push(e.code),n.push(e)}if(e=o._findPattern(o.MIDDLE_PATTERN,e.end,!0,!1),null===e)return null;for(n.push(e),r=0;r<4;r++){if(e=o._decodeCode(e.end,o.CODE_G_START),!e)return null;n.push(e),t.push(e.code)}return e},t.a=r},function(e,t,n){function r(e){e=a.a.bind()(o(),e),c.a.call(this,e),this.barSpaceRatio=[1,1],e.normalizeBarSpaceWidth&&(this.SINGLE_CODE_ERROR=.38,this.AVG_CODE_ERROR=.09)}function o(){var e={};return Object.keys(r.CONFIG_KEYS).forEach(function(t){e[t]=r.CONFIG_KEYS[t]["default"]}),e}var i=n(7),a=i&&i.__esModule?function(){return i["default"]}:function(){return i};Object.defineProperty(a,"a",{get:a});var c=n(9),u=1,s=3,f={START_PATTERN:{value:[u,u,u,u]},STOP_PATTERN:{value:[u,u,s]},CODE_PATTERN:{value:[[u,u,s,s,u],[s,u,u,u,s],[u,s,u,u,s],[s,s,u,u,u],[u,u,s,u,s],[s,u,s,u,u],[u,s,s,u,u],[u,u,u,s,s],[s,u,u,s,u],[u,s,u,s,u]]},SINGLE_CODE_ERROR:{value:.78,writable:!0},AVG_CODE_ERROR:{value:.38,writable:!0},MAX_CORRECTION_FACTOR:{value:5},FORMAT:{value:"i2of5"}};r.prototype=Object.create(c.a.prototype,f),r.prototype.constructor=r,r.prototype._matchPattern=function(e,t){if(this.config.normalizeBarSpaceWidth){var n,r=[0,0],o=[0,0],i=[0,0],a=this.MAX_CORRECTION_FACTOR,u=1/a;for(n=0;n<e.length;n++)r[n%2]+=e[n],o[n%2]+=t[n];for(i[0]=o[0]/r[0],i[1]=o[1]/r[1],i[0]=Math.max(Math.min(i[0],a),u),i[1]=Math.max(Math.min(i[1],a),u),this.barSpaceRatio=i,n=0;n<e.length;n++)e[n]*=this.barSpaceRatio[n%2]}return c.a.prototype._matchPattern.call(this,e,t)},r.prototype._findPattern=function(e,t,n,r){var o,i,a,c,u=[],s=this,f=0,d={error:Number.MAX_VALUE,code:-1,start:0,end:0},l=s.AVG_CODE_ERROR;for(n=n||!1,r=r||!1,t||(t=s._nextSet(s._row)),o=0;o<e.length;o++)u[o]=0;for(o=t;o<s._row.length;o++)if(s._row[o]^n)u[f]++;else{if(f===u.length-1){for(c=0,a=0;a<u.length;a++)c+=u[a];if(i=s._matchPattern(u,e),i<l)return d.error=i,d.start=o-c,d.end=o,d;if(!r)return null;for(a=0;a<u.length-2;a++)u[a]=u[a+2];u[u.length-2]=0,u[u.length-1]=0,f--}else f++;u[f]=1,n=!n}return null},r.prototype._findStart=function(){for(var e,t,n=this,r=n._nextSet(n._row),o=1;!t;){if(t=n._findPattern(n.START_PATTERN,r,!1,!0),!t)return null;if(o=Math.floor((t.end-t.start)/4),e=t.start-10*o,e>=0&&n._matchRange(e,t.start,0))return t;r=t.end,t=null}},r.prototype._verifyTrailingWhitespace=function(e){var t,n=this;return t=e.end+(e.end-e.start)/2,t<n._row.length&&n._matchRange(e.end,t,0)?e:null},r.prototype._findEnd=function(){var e,t,n=this;return n._row.reverse(),e=n._findPattern(n.STOP_PATTERN),n._row.reverse(),null===e?null:(t=e.start,e.start=n._row.length-e.end,e.end=n._row.length-t,null!==e?n._verifyTrailingWhitespace(e):null)},r.prototype._decodePair=function(e){var t,n,r=[],o=this;for(t=0;t<e.length;t++){if(n=o._decodeCode(e[t]),!n)return null;r.push(n)}return r},r.prototype._decodeCode=function(e){var t,n,r,o=this,i=0,a=o.AVG_CODE_ERROR,c={error:Number.MAX_VALUE,code:-1,start:0,end:0};for(t=0;t<e.length;t++)i+=e[t];for(r=0;r<o.CODE_PATTERN.length;r++)n=o._matchPattern(e,o.CODE_PATTERN[r]),n<c.error&&(c.code=r,c.error=n);if(c.error<a)return c},r.prototype._decodePayload=function(e,t,n){for(var r,o,i=this,a=0,c=e.length,u=[[0,0,0,0,0],[0,0,0,0,0]];a<c;){for(r=0;r<5;r++)u[0][r]=e[a]*this.barSpaceRatio[0],u[1][r]=e[a+1]*this.barSpaceRatio[1],a+=2;if(o=i._decodePair(u),!o)return null;for(r=0;r<o.length;r++)t.push(o[r].code+""),n.push(o[r])}return o},r.prototype._verifyCounterLength=function(e){return e.length%10===0},r.prototype._decode=function(){var e,t,n,r,o=this,i=[],a=[];return(e=o._findStart())?(a.push(e),(t=o._findEnd())?(r=o._fillCounters(e.end,t.start,!1),o._verifyCounterLength(r)&&(n=o._decodePayload(r,i,a))?i.length%2!==0||i.length<6?null:(a.push(t),{code:i.join(""),start:e.start,end:t.end,startInfo:e,decodedCodes:a}):null):null):null},r.CONFIG_KEYS={normalizeBarSpaceWidth:{type:"boolean","default":!1,description:"If true, the reader tries to normalize thewidth-difference between bars and spaces"}},t.a=r},function(e,t,n){function r(e,t){o.a.call(this,e,t)}var o=n(4),i={CODE_FREQUENCY:{value:[[56,52,50,49,44,38,35,42,41,37],[7,11,13,14,19,25,28,21,22,26]]},STOP_PATTERN:{value:[1/6*7,1/6*7,1/6*7,1/6*7,1/6*7,1/6*7]},FORMAT:{value:"upc_e",writeable:!1}};r.prototype=Object.create(o.a.prototype,i),r.prototype.constructor=r,r.prototype._decodePayload=function(e,t,n){var r,o=this,i=0;for(r=0;r<6;r++){if(e=o._decodeCode(e.end),!e)return null;e.code>=o.CODE_G_START&&(e.code=e.code-o.CODE_G_START,i|=1<<5-r),t.push(e.code),n.push(e)}return o._determineParity(i,t)?e:null},r.prototype._determineParity=function(e,t){var n,r;for(r=0;r<this.CODE_FREQUENCY.length;r++)for(n=0;n<this.CODE_FREQUENCY[r].length;n++)if(e===this.CODE_FREQUENCY[r][n])return t.unshift(r),t.push(n),!0;return!1},r.prototype._convertToUPCA=function(e){var t=[e[0]],n=e[e.length-2];return t=n<=2?t.concat(e.slice(1,3)).concat([n,0,0,0,0]).concat(e.slice(3,6)):3===n?t.concat(e.slice(1,4)).concat([0,0,0,0,0]).concat(e.slice(4,6)):4===n?t.concat(e.slice(1,5)).concat([0,0,0,0,0,e[5]]):t.concat(e.slice(1,6)).concat([0,0,0,0,n]),t.push(e[e.length-1]),t},r.prototype._checksum=function(e){return o.a.prototype._checksum.call(this,this._convertToUPCA(e))},r.prototype._findEnd=function(e,t){return t=!0,o.a.prototype._findEnd.call(this,e,t)},r.prototype._verifyTrailingWhitespace=function(e){var t,n=this;if(t=e.end+(e.end-e.start)/2,t<n._row.length&&n._matchRange(e.end,t,0))return e},t.a=r},function(e,t,n){function r(e,t){o.a.call(this,e,t)}var o=n(4),i={FORMAT:{value:"upc_a",writeable:!1}};r.prototype=Object.create(o.a.prototype,i),r.prototype.constructor=r,r.prototype._decode=function(){var e=o.a.prototype._decode.call(this);return e&&e.code&&13===e.code.length&&"0"===e.code.charAt(0)?(e.code=e.code.substring(1),e):null},t.a=r},function(t,n,r){function o(){function t(e){y(e),N=s.a.create(V.decoder,k)}function n(e){var t;if("VideoStream"===V.inputStream.type)t=document.createElement("video"),M=p.a.createVideoStream(t);else if("ImageStream"===V.inputStream.type)M=p.a.createImageStream();else if("LiveStream"===V.inputStream.type){var n=r();n&&(t=n.querySelector("video"),t||(t=document.createElement("video"),n.appendChild(t))),M=p.a.createLiveStream(t),d.a.request(t,V.inputStream.constraints).then(function(){M.trigger("canrecord")})["catch"](function(t){return e(t)})}M.setAttribute("preload","auto"),M.setInputStream(V.inputStream),M.addEventListener("canrecord",o.bind(void 0,e))}function r(){var e=V.inputStream.target;if(e&&e.nodeName&&1===e.nodeType)return e;var t="string"==typeof e?e:"#interactive.viewport";return document.querySelector(t)}function o(e){u.a.bind()(M,V.locator),m(V),I=h.a.create(M,G.dom.image),j(V.numOfWorkers,function(){0===V.numOfWorkers&&t(),i(e)})}function i(e){M.play(),e()}function m(){if("undefined"!=typeof document){var e=r();G.dom.image=document.querySelector("canvas.imgBuffer"),G.dom.image||(G.dom.image=document.createElement("canvas"),G.dom.image.className="imgBuffer",e&&"ImageStream"===V.inputStream.type&&e.appendChild(G.dom.image)),G.ctx.image=G.dom.image.getContext("2d"),G.dom.image.width=M.getCanvasSize().x,G.dom.image.height=M.getCanvasSize().y}}function y(e){k=e?e:new c.a({x:M.getWidth(),y:M.getHeight()}),L=[g.clone([0,0]),g.clone([0,k.size.y]),g.clone([k.size.x,k.size.y]),g.clone([k.size.x,0])],z=u.b.bind()(k,V.locator)}function b(){return V.locate?z.locate():[[g.clone(L[0]),g.clone(L[1]),g.clone(L[2]),g.clone(L[3])]]}function _(e){function t(e){for(var t=e.length;t--;)e[t][0]+=i,e[t][1]+=a}function n(e){e[0].x+=i,e[0].y+=a,e[1].x+=i,e[1].y+=a}var r,o=M.getTopRight(),i=o.x,a=o.y;if(0!==i||0!==a){if(e.barcodes)for(r=0;r<e.barcodes.length;r++)_(e.barcodes[r]);if(e.line&&2===e.line.length&&n(e.line),e.box&&t(e.box),e.boxes&&e.boxes.length>0)for(r=0;r<e.boxes.length;r++)t(e.boxes[r])}}function w(e,t){t&&U&&(e.barcodes?e.barcodes.filter(function(e){return e.codeResult}).forEach(function(e){return w(e,t)}):e.codeResult&&U.addResult(t,M.getCanvasSize(),e.codeResult))}function C(e){return e&&(e.barcodes?e.barcodes.some(function(e){return e.codeResult}):e.codeResult)}function E(e,t){var n=e;e&&W&&(_(e),w(e,t),n=e.barcodes||e),H.publish("processed",n),C(e)&&H.publish("detected",n)}function S(){var e,t;t=b(),t?(e=N.decodeFromBoundingBoxes(t),e=e||{},e.boxes=t,E(e,k.data)):E()}function T(){var e;if(W){if(B.length>0){if(e=B.filter(function(e){return!e.busy})[0],!e)return;I.attachData(e.imageData)}else I.attachData(k.data);I.grab()&&(e?(e.busy=!0,e.worker.postMessage({cmd:"process",imageData:e.imageData},[e.imageData.buffer])):S())}else S()}function R(){var e=null,t=1e3/(0===V.frequency?60:V.frequency||60);F=!1,function n(r){e=e||r,F||(r>=e&&(e+=t,T()),window.requestAnimFrame(n))}(performance.now())}function O(){W&&"LiveStream"===V.inputStream.type?R():T()}function x(e){var t,n={worker:void 0,imageData:new Uint8Array(M.getWidth()*M.getHeight()),busy:!0};t=A(),n.worker=new Worker(t),n.worker.onmessage=function(r){return"initialized"===r.data.event?(URL.revokeObjectURL(t),n.busy=!1,n.imageData=new Uint8Array(r.data.imageData),e(n)):void("processed"===r.data.event?(n.imageData=new Uint8Array(r.data.imageData),n.busy=!1,E(r.data.result,n.imageData)):"error"===r.data.event)},n.worker.postMessage({cmd:"init",size:{x:M.getWidth(),y:M.getHeight()},imageData:n.imageData,config:P(V)},[n.imageData.buffer])}function P(e){return v({},e,{inputStream:v({},e.inputStream,{target:null})})}function D(e){function t(e){self.postMessage({event:"processed",imageData:o.data,result:e},[o.data.buffer])}function n(){self.postMessage({event:"initialized",imageData:o.data},[o.data.buffer])}if(e){var r=e()["default"];if(!r)return void self.postMessage({event:"error",message:"Quagga could not be created"})}var o,i=r._worker.createScanner();self.onmessage=function(e){if("init"===e.data.cmd){var a=e.data.config;a.numOfWorkers=0,o=new r.ImageWrapper({x:e.data.size.x,y:e.data.size.y},new Uint8Array(e.data.imageData)),i.init(a,n,o),i.subscribe("processed",t)}else"process"===e.data.cmd&&(o.data=new Uint8Array(e.data.imageData),i.start())}}function A(){var t,n;return"undefined"!=typeof e&&(n=e),t=new Blob(["("+D.toString()+")("+n+");"],{type:"text/javascript"}),window.URL.createObjectURL(t)}function j(e,t){var n=e-B.length;if(0===n)return t&&t();if(n<0){var r=B.slice(n);return r.forEach(function(e){e.worker.terminate()}),B=B.slice(0,n),t&&t()}for(var o=function(n){B.push(n),B.length>=e&&t&&t()},i=0;i<n;i++)x(o)}var M,I,k,L,N,U,z,F=!0,G={ctx:{image:null},dom:{image:null}},B=[],W=!0,V={},H=f.a.bind()();return{init:function(e,r,o){return V=a.a.bind()({},l.a,e),o?(W=!1,t(o),r()):void n(r)},start:function(){O()},isRunning:function(){return!F},stop:function(){F=!0,j(0),"LiveStream"===V.inputStream.type&&d.a.release(),M.clearEventHandlers()},pause:function(){F=!0},subscribe:function(e,t){H.subscribe(e,t)},unsubscribe:function(e,t){H.unsubscribe(e,t)},registerResultCollector:function(e){e&&"function"==typeof e.addResult&&(U=e)},decodeSingle:function(e,t){var n=this;this.init(e,function(){H.once("processed",function(e){n.stop(),t.call(null,e)},!0),O()})},canvas:G}}var i=r(7),a=i&&i.__esModule?function(){return i["default"]}:function(){return i};Object.defineProperty(a,"a",{get:a});var c=r(27),u=r(97),s=r(89),f=r(85),d=r(91),l=(r(8),r(44),r(45)),p=r(96),h=r(94),v=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},g={clone:r(10)};n.a=o},function(e,t,n){function r(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}e.e=r},function(e,t,n){function r(){var e=new Float32Array(4);return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e}e.e=r},function(e,t,n){function r(e,t){var n=t[0],r=t[1],o=t[2],i=t[3],a=n*i-o*r;return a?(a=1/a,e[0]=i*a,e[1]=-r*a,e[2]=-o*a,e[3]=n*a,e):null}e.e=r},function(e,t,n){function r(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e}e.e=r},function(e,t,n){function r(e,t,n){var r=t[0],o=t[1];return e[0]=n[0]*r+n[2]*o,e[1]=n[1]*r+n[3]*o,e}e.e=r},function(e,t,n){function r(e){var t=new Float32Array(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}e.e=r},function(e,t,n){var r=n(5),o=n(3),i=r(o,"DataView");e.e=i},function(e,t,n){function r(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}var o=n(167),i=n(168),a=n(169),c=n(170),u=n(171);r.prototype.clear=o,r.prototype["delete"]=i,r.prototype.get=a,r.prototype.has=c,r.prototype.set=u,e.e=r},function(e,t,n){var r=n(5),o=n(3),i=r(o,"Promise");e.e=i},function(e,t,n){var r=n(5),o=n(3),i=r(o,"Set");e.e=i},function(e,t,n){var r=n(5),o=n(3),i=r(o,"WeakMap");e.e=i},function(e,t,n){function r(e,t){return e.set(t[0],t[1]),e}e.e=r},function(e,t,n){function r(e,t){return e.add(t),e}e.e=r},function(e,t,n){function r(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}e.e=r},function(e,t,n){function r(e,t){var n=e?e.length:0;return!!n&&o(e,t,0)>-1}var o=n(134);e.e=r},function(e,t,n){function r(e,t,n){for(var r=-1,o=e?e.length:0;++r<o;)if(n(t,e[r]))return!0;return!1}e.e=r},function(e,t,n){function r(e,t){for(var n=-1,r=e?e.length:0;++n<r;)if(t(e[n],n,e))return!0;return!1}e.e=r},function(e,t,n){function r(e,t){return e&&o(t,i(t),e)}var o=n(34),i=n(15);e.e=r},function(e,t,n){function r(e,t,n,C,E,S,T){var x;if(C&&(x=S?C(e,E,S,T):C(e)),void 0!==x)return x;if(!b(e))return e;var P=g(e);if(P){if(x=p(e),!t)return s(e,x)}else{var A=l(e),j=A==R||A==O;if(m(e))return u(e,t);if(A==D||A==w||j&&!S){if(y(e))return S?e:{};if(x=v(j?{}:e),!t)return f(e,c(x,e))}else{if(!X[A])return S?e:{};x=h(e,A,r,t)}}T||(T=new o);var M=T.get(e);if(M)return M;if(T.set(e,x),!P)var I=n?d(e):_(e);return i(I||e,function(o,i){I&&(i=o,o=e[i]),a(x,i,r(o,t,n,C,i,e,T))}),x}var o=n(18),i=n(51),a=n(55),c=n(127),u=n(150),s=n(66),f=n(157),d=n(162),l=n(37),p=n(172),h=n(173),v=n(174),g=n(0),m=n(77),y=n(22),b=n(2),_=n(15),w="[object Arguments]",C="[object Array]",E="[object Boolean]",S="[object Date]",T="[object Error]",R="[object Function]",O="[object GeneratorFunction]",x="[object Map]",P="[object Number]",D="[object Object]",A="[object RegExp]",j="[object Set]",M="[object String]",I="[object Symbol]",k="[object WeakMap]",L="[object ArrayBuffer]",N="[object DataView]",U="[object Float32Array]",z="[object Float64Array]",F="[object Int8Array]",G="[object Int16Array]",B="[object Int32Array]",W="[object Uint8Array]",V="[object Uint8ClampedArray]",H="[object Uint16Array]",q="[object Uint32Array]",X={};X[w]=X[C]=X[L]=X[N]=X[E]=X[S]=X[U]=X[z]=X[F]=X[G]=X[B]=X[x]=X[P]=X[D]=X[A]=X[j]=X[M]=X[I]=X[W]=X[V]=X[H]=X[q]=!0,X[T]=X[R]=X[k]=!1,e.e=r},function(e,t,n){function r(e){return o(e)?i(e):{}}var o=n(2),i=Object.create;e.e=r},function(e,t,n){function r(e,t,n,r){var d=-1,l=i,p=!0,h=e.length,v=[],g=t.length;if(!h)return v;n&&(t=c(t,u(n))),r?(l=a,p=!1):t.length>=f&&(l=s,p=!1,t=new o(t));e:for(;++d<h;){var m=e[d],y=n?n(m):m;if(m=r||0!==m?m:0,p&&y===y){for(var b=g;b--;)if(t[b]===y)continue e;v.push(m)}else l(t,y,r)||v.push(m)}return v}var o=n(49),i=n(124),a=n(125),c=n(30),u=n(64),s=n(149),f=200;e.e=r},function(e,t,n){function r(e,t,n,r){for(var o=e.length,i=n+(r?1:-1);r?i--:++i<o;)if(t(e[i],i,e))return i;return-1}e.e=r},function(e,t,n){function r(e){return i.call(e)}var o=Object.prototype,i=o.toString;e.e=r},function(e,t,n){function r(e,t){return null!=e&&t in Object(e)}e.e=r},function(e,t,n){function r(e,t,n){if(t!==t)return o(e,i,n);for(var r=n-1,a=e.length;++r<a;)if(e[r]===t)return r;return-1}var o=n(131),i=n(137);e.e=r},function(e,t,n){function r(e,t,n,r,g,y){var b=s(e),_=s(t),w=h,C=h;b||(w=u(e),w=w==p?v:w),_||(C=u(t),C=C==p?v:C);var E=w==v&&!f(e),S=C==v&&!f(t),T=w==C;if(T&&!E)return y||(y=new o),b||d(e)?i(e,t,n,r,g,y):a(e,t,w,n,r,g,y);if(!(g&l)){var R=E&&m.call(e,"__wrapped__"),O=S&&m.call(t,"__wrapped__");if(R||O){var x=R?e.value():e,P=O?t.value():t;return y||(y=new o),n(x,P,r,g,y)}}return!!T&&(y||(y=new o),c(e,t,n,r,g,y))}var o=n(18),i=n(67),a=n(160),c=n(161),u=n(37),s=n(0),f=n(22),d=n(43),l=2,p="[object Arguments]",h="[object Array]",v="[object Object]",g=Object.prototype,m=g.hasOwnProperty;e.e=r},function(e,t,n){function r(e,t,n,r){var u=n.length,s=u,f=!r;if(null==e)return!s;for(e=Object(e);u--;){var d=n[u];if(f&&d[2]?d[1]!==e[d[0]]:!(d[0]in e))return!1}for(;++u<s;){d=n[u];var l=d[0],p=e[l],h=d[1];if(f&&d[2]){if(void 0===p&&!(l in e))return!1}else{var v=new o;if(r)var g=r(p,h,l,e,t,v);if(!(void 0===g?i(h,p,r,a|c,v):g))return!1}}return!0}var o=n(18),i=n(59),a=1,c=2;e.e=r},function(e,t,n){function r(e){return e!==e}e.e=r},function(e,t,n){function r(e){if(!c(e)||a(e))return!1;var t=o(e)||i(e)?v:f;return t.test(u(e))}var o=n(40),i=n(22),a=n(178),c=n(2),u=n(75),s=/[\\^$.*+?()[\]{}|]/g,f=/^\[object .+?Constructor\]$/,d=Function.prototype,l=Object.prototype,p=d.toString,h=l.hasOwnProperty,v=RegExp("^"+p.call(h).replace(s,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.e=r},function(e,t,n){function r(e){return i(e)&&o(e.length)&&!!D[j.call(e)]}var o=n(41),i=n(14),a="[object Arguments]",c="[object Array]",u="[object Boolean]",s="[object Date]",f="[object Error]",d="[object Function]",l="[object Map]",p="[object Number]",h="[object Object]",v="[object RegExp]",g="[object Set]",m="[object String]",y="[object WeakMap]",b="[object ArrayBuffer]",_="[object DataView]",w="[object Float32Array]",C="[object Float64Array]",E="[object Int8Array]",S="[object Int16Array]",T="[object Int32Array]",R="[object Uint8Array]",O="[object Uint8ClampedArray]",x="[object Uint16Array]",P="[object Uint32Array]",D={};D[w]=D[C]=D[E]=D[S]=D[T]=D[R]=D[O]=D[x]=D[P]=!0,D[a]=D[c]=D[b]=D[u]=D[_]=D[s]=D[f]=D[d]=D[l]=D[p]=D[h]=D[v]=D[g]=D[m]=D[y]=!1;var A=Object.prototype,j=A.toString;e.e=r},function(e,t,n){function r(e){if(!o(e))return i(e);var t=[];for(var n in Object(e))c.call(e,n)&&"constructor"!=n&&t.push(n);return t}var o=n(24),i=n(73),a=Object.prototype,c=a.hasOwnProperty;e.e=r},function(e,t,n){function r(e){var t=i(e);return 1==t.length&&t[0][2]?a(t[0][0],t[0][1]):function(n){return n===e||o(n,e,t)}}var o=n(136),i=n(163),a=n(72);e.e=r},function(e,t,n){function r(e,t){return c(e)&&u(t)?s(f(e),t):function(n){var r=i(n,e);return void 0===r&&r===t?a(n,e):o(t,r,void 0,d|l)}}var o=n(59),i=n(199),a=n(200),c=n(23),u=n(70),s=n(72),f=n(6),d=1,l=2;e.e=r},function(e,t,n){function r(e,t,n,l,p){if(e!==t){if(!s(t)&&!d(t))var h=c(t);i(h||t,function(i,c){if(h&&(c=i,i=t[c]),f(i))p||(p=new o),u(e,t,c,n,r,l,p);else{var s=l?l(e[c],i,c+"",e,t,p):void 0;void 0===s&&(s=i),a(e,c,s)}})}}var o=n(18),i=n(51),a=n(54),c=n(61),u=n(144),s=n(0),f=n(2),d=n(43);e.e=r},function(e,t,n){function r(e,t,n,r,v,g,m){var y=e[n],b=t[n],_=m.get(b);if(_)return void o(e,n,_);var w=g?g(y,b,n+"",e,t,m):void 0,C=void 0===w;C&&(w=b,u(b)||p(b)?u(y)?w=y:s(y)?w=a(y):(C=!1,w=i(b,!0)):l(b)||c(b)?c(y)?w=h(y):!d(y)||r&&f(y)?(C=!1,w=i(b,!0)):w=y:C=!1),C&&(m.set(b,w),v(w,b,r,g,m),m["delete"](b)),o(e,n,w)}var o=n(54),i=n(128),a=n(66),c=n(12),u=n(0),s=n(76),f=n(40),d=n(2),l=n(203),p=n(43),h=n(211);e.e=r},function(e,t,n){function r(e){return function(t){return null==t?void 0:t[e]}}e.e=r},function(e,t,n){function r(e){return function(t){return o(t,e)}}var o=n(57);e.e=r},function(e,t,n){function r(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}e.e=r},function(e,t,n){function r(e){if("string"==typeof e)return e;if(i(e))return u?u.call(e):"";var t=e+"";return"0"==t&&1/e==-a?"-0":t}var o=n(19),i=n(42),a=1/0,c=o?o.prototype:void 0,u=c?c.toString:void 0;e.e=r},function(e,t,n){function r(e,t){return e.has(t)}e.e=r},function(e,t,n){function r(e,t){if(t)return e.slice();var n=new e.constructor(e.length);return e.copy(n),n}e.e=r},function(e,t,n){function r(e,t){var n=t?o(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var o=n(33);e.e=r},function(e,t,n){function r(e,t,n){var r=t?n(a(e),!0):a(e);return i(r,o,new e.constructor)}var o=n(121),i=n(53),a=n(71);e.e=r},function(e,t,n){function r(e){var t=new e.constructor(e.source,o.exec(e));return t.lastIndex=e.lastIndex,t}var o=/\w*$/;e.e=r},function(e,t,n){function r(e,t,n){var r=t?n(a(e),!0):a(e);return i(r,o,new e.constructor)}var o=n(122),i=n(53),a=n(74);e.e=r},function(e,t,n){function r(e){return a?Object(a.call(e)):{}}var o=n(19),i=o?o.prototype:void 0,a=i?i.valueOf:void 0;e.e=r},function(e,t,n){function r(e,t){var n=t?o(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var o=n(33);e.e=r},function(e,t,n){function r(e,t){return o(e,i(e),t)}var o=n(34),i=n(36);e.e=r},function(e,t,n){var r=n(3),o=r["__core-js_shared__"];e.e=o},function(e,t,n){function r(e){return o(function(t,n){var r=-1,o=n.length,a=o>1?n[o-1]:void 0,c=o>2?n[2]:void 0;for(a=e.length>3&&"function"==typeof a?(o--,a):void 0,c&&i(n[0],n[1],c)&&(a=o<3?void 0:a,o=1),t=Object(t);++r<o;){var u=n[r];u&&e(t,u,r,a)}return t})}var o=n(32),i=n(176);e.e=r},function(e,t,n){function r(e,t,n,r,o,E,T){switch(n){case C:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case w:
  return!(e.byteLength!=t.byteLength||!r(new i(e),new i(t)));case l:case p:case g:return a(+e,+t);case h:return e.name==t.name&&e.message==t.message;case m:case b:return e==t+"";case v:var R=u;case y:var O=E&d;if(R||(R=s),e.size!=t.size&&!O)return!1;var x=T.get(e);if(x)return x==t;E|=f,T.set(e,t);var P=c(R(e),R(t),r,o,E,T);return T["delete"](e),P;case _:if(S)return S.call(e)==S.call(t)}return!1}var o=n(19),i=n(50),a=n(11),c=n(67),u=n(71),s=n(74),f=1,d=2,l="[object Boolean]",p="[object Date]",h="[object Error]",v="[object Map]",g="[object Number]",m="[object RegExp]",y="[object Set]",b="[object String]",_="[object Symbol]",w="[object ArrayBuffer]",C="[object DataView]",E=o?o.prototype:void 0,S=E?E.valueOf:void 0;e.e=r},function(e,t,n){function r(e,t,n,r,a,u){var s=a&i,f=o(e),d=f.length,l=o(t),p=l.length;if(d!=p&&!s)return!1;for(var h=d;h--;){var v=f[h];if(!(s?v in t:c.call(t,v)))return!1}var g=u.get(e);if(g&&u.get(t))return g==t;var m=!0;u.set(e,t),u.set(t,e);for(var y=s;++h<d;){v=f[h];var b=e[v],_=t[v];if(r)var w=s?r(_,b,v,t,e,u):r(b,_,v,e,t,u);if(!(void 0===w?b===_||n(b,_,r,a,u):w)){m=!1;break}y||(y="constructor"==v)}if(m&&!y){var C=e.constructor,E=t.constructor;C!=E&&"constructor"in e&&"constructor"in t&&!("function"==typeof C&&C instanceof C&&"function"==typeof E&&E instanceof E)&&(m=!1)}return u["delete"](e),u["delete"](t),m}var o=n(15),i=2,a=Object.prototype,c=a.hasOwnProperty;e.e=r},function(e,t,n){function r(e){return o(e,a,i)}var o=n(58),i=n(36),a=n(15);e.e=r},function(e,t,n){function r(e){for(var t=i(e),n=t.length;n--;){var r=t[n],a=e[r];t[n]=[r,a,o(a)]}return t}var o=n(70),i=n(15);e.e=r},function(e,t,n){var r=n(31),o=n(35),i=n(36),a=n(80),c=Object.getOwnPropertySymbols,u=c?function(e){for(var t=[];e;)r(t,i(e)),e=o(e);return t}:a;e.e=u},function(e,t,n){function r(e,t){return null==e?void 0:e[t]}e.e=r},function(e,t,n){function r(e,t,n){t=u(t,e)?[t]:o(t);for(var r,d=-1,l=t.length;++d<l;){var p=f(t[d]);if(!(r=null!=e&&n(e,p)))break;e=e[p]}if(r)return r;var l=e?e.length:0;return!!l&&s(l)&&c(p,l)&&(a(e)||i(e))}var o=n(65),i=n(12),a=n(0),c=n(38),u=n(23),s=n(41),f=n(6);e.e=r},function(e,t,n){function r(){this.__data__=o?o(null):{}}var o=n(25);e.e=r},function(e,t,n){function r(e){return this.has(e)&&delete this.__data__[e]}e.e=r},function(e,t,n){function r(e){var t=this.__data__;if(o){var n=t[e];return n===i?void 0:n}return c.call(t,e)?t[e]:void 0}var o=n(25),i="__lodash_hash_undefined__",a=Object.prototype,c=a.hasOwnProperty;e.e=r},function(e,t,n){function r(e){var t=this.__data__;return o?void 0!==t[e]:a.call(t,e)}var o=n(25),i=Object.prototype,a=i.hasOwnProperty;e.e=r},function(e,t,n){function r(e,t){var n=this.__data__;return n[e]=o&&void 0===t?i:t,this}var o=n(25),i="__lodash_hash_undefined__";e.e=r},function(e,t,n){function r(e){var t=e.length,n=e.constructor(t);return t&&"string"==typeof e[0]&&i.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var o=Object.prototype,i=o.hasOwnProperty;e.e=r},function(e,t,n){function r(e,t,n,r){var D=e.constructor;switch(t){case b:return o(e);case d:case l:return new D((+e));case _:return i(e,r);case w:case C:case E:case S:case T:case R:case O:case x:case P:return f(e,r);case p:return a(e,r,n);case h:case m:return new D(e);case v:return c(e);case g:return u(e,r,n);case y:return s(e)}}var o=n(33),i=n(151),a=n(152),c=n(153),u=n(154),s=n(155),f=n(156),d="[object Boolean]",l="[object Date]",p="[object Map]",h="[object Number]",v="[object RegExp]",g="[object Set]",m="[object String]",y="[object Symbol]",b="[object ArrayBuffer]",_="[object DataView]",w="[object Float32Array]",C="[object Float64Array]",E="[object Int8Array]",S="[object Int16Array]",T="[object Int32Array]",R="[object Uint8Array]",O="[object Uint8ClampedArray]",x="[object Uint16Array]",P="[object Uint32Array]";e.e=r},function(e,t,n){function r(e){return"function"!=typeof e.constructor||a(e)?{}:o(i(e))}var o=n(129),i=n(35),a=n(24);e.e=r},function(e,t,n){function r(e){return a(e)||i(e)||!!(c&&e&&e[c])}var o=n(19),i=n(12),a=n(0),c=o?o.isConcatSpreadable:void 0;e.e=r},function(e,t,n){function r(e,t,n){if(!c(n))return!1;var r=typeof t;return!!("number"==r?i(n)&&a(t,n.length):"string"==r&&t in n)&&o(n[t],e)}var o=n(11),i=n(13),a=n(38),c=n(2);e.e=r},function(e,t,n){function r(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}e.e=r},function(e,t,n){function r(e){return!!i&&i in e}var o=n(158),i=function(){var e=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();e.e=r},function(e,t,n){function r(){this.__data__=[]}e.e=r},function(e,t,n){function r(e){var t=this.__data__,n=o(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():a.call(t,n,1),!0}var o=n(20),i=Array.prototype,a=i.splice;e.e=r},function(e,t,n){function r(e){var t=this.__data__,n=o(t,e);return n<0?void 0:t[n][1]}var o=n(20);e.e=r},function(e,t,n){function r(e){return o(this.__data__,e)>-1}var o=n(20);e.e=r},function(e,t,n){function r(e,t){var n=this.__data__,r=o(n,e);return r<0?n.push([e,t]):n[r][1]=t,this}var o=n(20);e.e=r},function(e,t,n){function r(){this.__data__={hash:new o,map:new(a||i),string:new o}}var o=n(117),i=n(17),a=n(28);e.e=r},function(e,t,n){function r(e){return o(this,e)["delete"](e)}var o=n(21);e.e=r},function(e,t,n){function r(e){return o(this,e).get(e)}var o=n(21);e.e=r},function(e,t,n){function r(e){return o(this,e).has(e)}var o=n(21);e.e=r},function(e,t,n){function r(e,t){return o(this,e).set(e,t),this}var o=n(21);e.e=r},function(e,t,n){function r(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}e.e=r},function(e,t,n){(function(e){var r=n(68),o="object"==typeof t&&t&&!t.nodeType&&t,i=o&&"object"==typeof e&&e&&!e.nodeType&&e,a=i&&i.exports===o,c=a&&r.process,u=function(){try{return c&&c.binding("util")}catch(e){}}();e.e=u}).call(t,n(81)(e))},function(e,t,n){function r(e){return this.__data__.set(e,o),this}var o="__lodash_hash_undefined__";e.e=r},function(e,t,n){function r(e){return this.__data__.has(e)}e.e=r},function(e,t,n){function r(){this.__data__=new o}var o=n(17);e.e=r},function(e,t,n){function r(e){return this.__data__["delete"](e)}e.e=r},function(e,t,n){function r(e){return this.__data__.get(e)}e.e=r},function(e,t,n){function r(e){return this.__data__.has(e)}e.e=r},function(e,t,n){function r(e,t){var n=this.__data__;if(n instanceof o){var r=n.__data__;if(!i||r.length<c-1)return r.push([e,t]),this;n=this.__data__=new a(r)}return n.set(e,t),this}var o=n(17),i=n(28),a=n(29),c=200;e.e=r},function(e,t,n){var r=n(204),o=n(212),i=/^\./,a=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,c=/\\(\\)?/g,u=r(function(e){e=o(e);var t=[];return i.test(e)&&t.push(""),e.replace(a,function(e,n,r,o){t.push(r?o.replace(c,"$1"):n||e)}),t});e.e=u},function(e,t,n){function r(e,t,n){var r=null==e?void 0:o(e,t);return void 0===r?n:r}var o=n(57);e.e=r},function(e,t,n){function r(e,t){return null!=e&&i(e,t,o)}var o=n(133),i=n(166);e.e=r},function(e,t,n){function r(e){return e}e.e=r},function(e,t,n){function r(e){if(c(e)&&(a(e)||"string"==typeof e||"function"==typeof e.splice||u(e)||i(e)))return!e.length;var t=o(e);if(t==d||t==l)return!e.size;if(g||s(e))return!f(e).length;for(var n in e)if(h.call(e,n))return!1;return!0}var o=n(37),i=n(12),a=n(0),c=n(13),u=n(77),s=n(24),f=n(73),d="[object Map]",l="[object Set]",p=Object.prototype,h=p.hasOwnProperty,v=p.propertyIsEnumerable,g=!v.call({valueOf:1},"valueOf");e.e=r},function(e,t,n){function r(e){if(!a(e)||p.call(e)!=c||i(e))return!1;var t=o(e);if(null===t)return!0;var n=d.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&f.call(n)==l}var o=n(35),i=n(22),a=n(14),c="[object Object]",u=Function.prototype,s=Object.prototype,f=u.toString,d=s.hasOwnProperty,l=f.call(Object),p=s.toString;e.e=r},function(e,t,n){function r(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError(i);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a),a};return n.cache=new(r.Cache||o),n}var o=n(29),i="Expected a function";r.Cache=o,e.e=r},function(e,t,n){function r(e){if("function"!=typeof e)throw new TypeError(o);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}var o="Expected a function";e.e=r},function(e,t,n){var r=n(30),o=n(130),i=n(56),a=n(62),c=n(32),u=n(69),s=n(6),f=c(function(e,t){return null==e?{}:(t=r(i(t,1),s),a(e,o(u(e),t)))});e.e=f},function(e,t,n){function r(e,t){return a(e,i(o(t)))}var o=n(60),i=n(205),a=n(208);e.e=r},function(e,t,n){function r(e,t){return null==e?{}:i(e,a(e),o(t))}var o=n(60),i=n(63),a=n(69);e.e=r},function(e,t,n){function r(e){return a(e)?o(c(e)):i(e)}var o=n(145),i=n(146),a=n(23),c=n(6);e.e=r},function(e,t,n){function r(){return!1}e.e=r},function(e,t,n){function r(e){return o(e,i(e))}var o=n(34),i=n(78);e.e=r},function(e,t,n){function r(e){return null==e?"":o(e)}var o=n(148);e.e=r},function(e,t,n){"use strict";var r={};r.generateIdentifier=function(){return Math.random().toString(36).substr(2,10)},r.localCName=r.generateIdentifier(),r.splitLines=function(e){return e.trim().split("\n").map(function(e){return e.trim()})},r.splitSections=function(e){var t=e.split("\nm=");return t.map(function(e,t){return(t>0?"m="+e:e).trim()+"\r\n"})},r.matchPrefix=function(e,t){return r.splitLines(e).filter(function(e){return 0===e.indexOf(t)})},r.parseCandidate=function(e){var t;t=0===e.indexOf("a=candidate:")?e.substring(12).split(" "):e.substring(10).split(" ");for(var n={foundation:t[0],component:t[1],protocol:t[2].toLowerCase(),priority:parseInt(t[3],10),ip:t[4],port:parseInt(t[5],10),type:t[7]},r=8;r<t.length;r+=2)switch(t[r]){case"raddr":n.relatedAddress=t[r+1];break;case"rport":n.relatedPort=parseInt(t[r+1],10);break;case"tcptype":n.tcpType=t[r+1]}return n},r.writeCandidate=function(e){var t=[];t.push(e.foundation),t.push(e.component),t.push(e.protocol.toUpperCase()),t.push(e.priority),t.push(e.ip),t.push(e.port);var n=e.type;return t.push("typ"),t.push(n),"host"!==n&&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)),"candidate:"+t.join(" ")},r.parseRtpMap=function(e){var t=e.substr(9).split(" "),n={payloadType:parseInt(t.shift(),10)};return t=t[0].split("/"),n.name=t[0],n.clockRate=parseInt(t[1],10),n.numChannels=3===t.length?parseInt(t[2],10):1,n},r.writeRtpMap=function(e){var t=e.payloadType;return void 0!==e.preferredPayloadType&&(t=e.preferredPayloadType),"a=rtpmap:"+t+" "+e.name+"/"+e.clockRate+(1!==e.numChannels?"/"+e.numChannels:"")+"\r\n"},r.parseExtmap=function(e){var t=e.substr(9).split(" ");return{id:parseInt(t[0],10),uri:t[1]}},r.writeExtmap=function(e){return"a=extmap:"+(e.id||e.preferredId)+" "+e.uri+"\r\n"},r.parseFmtp=function(e){for(var t,n={},r=e.substr(e.indexOf(" ")+1).split(";"),o=0;o<r.length;o++)t=r[o].trim().split("="),n[t[0].trim()]=t[1];return n},r.writeFmtp=function(e){var t="",n=e.payloadType;if(void 0!==e.preferredPayloadType&&(n=e.preferredPayloadType),e.parameters&&Object.keys(e.parameters).length){var r=[];Object.keys(e.parameters).forEach(function(t){r.push(t+"="+e.parameters[t])}),t+="a=fmtp:"+n+" "+r.join(";")+"\r\n"}return t},r.parseRtcpFb=function(e){var t=e.substr(e.indexOf(" ")+1).split(" ");return{type:t.shift(),parameter:t.join(" ")}},r.writeRtcpFb=function(e){var t="",n=e.payloadType;return void 0!==e.preferredPayloadType&&(n=e.preferredPayloadType),e.rtcpFeedback&&e.rtcpFeedback.length&&e.rtcpFeedback.forEach(function(e){t+="a=rtcp-fb:"+n+" "+e.type+(e.parameter&&e.parameter.length?" "+e.parameter:"")+"\r\n"}),t},r.parseSsrcMedia=function(e){var t=e.indexOf(" "),n={ssrc:parseInt(e.substr(7,t-7),10)},r=e.indexOf(":",t);return r>-1?(n.attribute=e.substr(t+1,r-t-1),n.value=e.substr(r+1)):n.attribute=e.substr(t+1),n},r.getDtlsParameters=function(e,t){var n=r.splitLines(e);n=n.concat(r.splitLines(t));var o=n.filter(function(e){return 0===e.indexOf("a=fingerprint:")})[0].substr(14),i={role:"auto",fingerprints:[{algorithm:o.split(" ")[0],value:o.split(" ")[1]}]};return i},r.writeDtlsParameters=function(e,t){var n="a=setup:"+t+"\r\n";return e.fingerprints.forEach(function(e){n+="a=fingerprint:"+e.algorithm+" "+e.value+"\r\n"}),n},r.getIceParameters=function(e,t){var n=r.splitLines(e);n=n.concat(r.splitLines(t));var o={usernameFragment:n.filter(function(e){return 0===e.indexOf("a=ice-ufrag:")})[0].substr(12),password:n.filter(function(e){return 0===e.indexOf("a=ice-pwd:")})[0].substr(10)};return o},r.writeIceParameters=function(e){return"a=ice-ufrag:"+e.usernameFragment+"\r\na=ice-pwd:"+e.password+"\r\n"},r.parseRtpParameters=function(e){for(var t={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},n=r.splitLines(e),o=n[0].split(" "),i=3;i<o.length;i++){var a=o[i],c=r.matchPrefix(e,"a=rtpmap:"+a+" ")[0];if(c){var u=r.parseRtpMap(c),s=r.matchPrefix(e,"a=fmtp:"+a+" ");switch(u.parameters=s.length?r.parseFmtp(s[0]):{},u.rtcpFeedback=r.matchPrefix(e,"a=rtcp-fb:"+a+" ").map(r.parseRtcpFb),t.codecs.push(u),u.name.toUpperCase()){case"RED":case"ULPFEC":t.fecMechanisms.push(u.name.toUpperCase())}}}return r.matchPrefix(e,"a=extmap:").forEach(function(e){t.headerExtensions.push(r.parseExtmap(e))}),t},r.writeRtpDescription=function(e,t){var n="";return n+="m="+e+" ",n+=t.codecs.length>0?"9":"0",n+=" UDP/TLS/RTP/SAVPF ",n+=t.codecs.map(function(e){return void 0!==e.preferredPayloadType?e.preferredPayloadType:e.payloadType}).join(" ")+"\r\n",n+="c=IN IP4 0.0.0.0\r\n",n+="a=rtcp:9 IN IP4 0.0.0.0\r\n",t.codecs.forEach(function(e){n+=r.writeRtpMap(e),n+=r.writeFmtp(e),n+=r.writeRtcpFb(e)}),n+="a=rtcp-mux\r\n"},r.parseRtpEncodingParameters=function(e){var t,n=[],o=r.parseRtpParameters(e),i=o.fecMechanisms.indexOf("RED")!==-1,a=o.fecMechanisms.indexOf("ULPFEC")!==-1,c=r.matchPrefix(e,"a=ssrc:").map(function(e){return r.parseSsrcMedia(e)}).filter(function(e){return"cname"===e.attribute}),u=c.length>0&&c[0].ssrc,s=r.matchPrefix(e,"a=ssrc-group:FID").map(function(e){var t=e.split(" ");return t.shift(),t.map(function(e){return parseInt(e,10)})});s.length>0&&s[0].length>1&&s[0][0]===u&&(t=s[0][1]),o.codecs.forEach(function(e){if("RTX"===e.name.toUpperCase()&&e.parameters.apt){var r={ssrc:u,codecPayloadType:parseInt(e.parameters.apt,10),rtx:{payloadType:e.payloadType,ssrc:t}};n.push(r),i&&(r=JSON.parse(JSON.stringify(r)),r.fec={ssrc:t,mechanism:a?"red+ulpfec":"red"},n.push(r))}}),0===n.length&&u&&n.push({ssrc:u});var f=r.matchPrefix(e,"b=");return f.length&&(0===f[0].indexOf("b=TIAS:")?f=parseInt(f[0].substr(7),10):0===f[0].indexOf("b=AS:")&&(f=parseInt(f[0].substr(5),10)),n.forEach(function(e){e.maxBitrate=f})),n},r.writeSessionBoilerplate=function(){return"v=0\r\no=thisisadapterortc 8169639915646943137 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},r.writeMediaSection=function(e,t,n,o){var i=r.writeRtpDescription(e.kind,t);if(i+=r.writeIceParameters(e.iceGatherer.getLocalParameters()),i+=r.writeDtlsParameters(e.dtlsTransport.getLocalParameters(),"offer"===n?"actpass":"active"),i+="a=mid:"+e.mid+"\r\n",i+=e.rtpSender&&e.rtpReceiver?"a=sendrecv\r\n":e.rtpSender?"a=sendonly\r\n":e.rtpReceiver?"a=recvonly\r\n":"a=inactive\r\n",e.rtpSender){var a="msid:"+o.id+" "+e.rtpSender.track.id+"\r\n";i+="a="+a,i+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" "+a}return i+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" cname:"+r.localCName+"\r\n"},r.getDirection=function(e,t){for(var n=r.splitLines(e),o=0;o<n.length;o++)switch(n[o]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return n[o].substr(2)}return t?r.getDirection(t):"sendrecv"},e.e=r},function(e,t,n){"use strict";!function(){var t=n(1).log,r=n(1).browserDetails;e.e.browserDetails=r,e.e.extractVersion=n(1).extractVersion,e.e.disableLog=n(1).disableLog;var o=n(215)||null,i=n(217)||null,a=n(219)||null,c=n(221)||null;switch(r.browser){case"opera":case"chrome":if(!o||!o.shimPeerConnection)return void t("Chrome shim is not included in this adapter release.");t("adapter.js shimming chrome."),e.e.browserShim=o,o.shimGetUserMedia(),o.shimMediaStream(),o.shimSourceObject(),o.shimPeerConnection(),o.shimOnTrack();break;case"firefox":if(!a||!a.shimPeerConnection)return void t("Firefox shim is not included in this adapter release.");t("adapter.js shimming firefox."),e.e.browserShim=a,a.shimGetUserMedia(),a.shimSourceObject(),a.shimPeerConnection(),a.shimOnTrack();break;case"edge":if(!i||!i.shimPeerConnection)return void t("MS edge shim is not included in this adapter release.");t("adapter.js shimming edge."),e.e.browserShim=i,i.shimGetUserMedia(),i.shimPeerConnection();break;case"safari":if(!c)return void t("Safari shim is not included in this adapter release.");t("adapter.js shimming safari."),e.e.browserShim=c,c.shimGetUserMedia();break;default:t("Unsupported browser!")}}()},function(e,t,n){"use strict";var r=n(1).log,o=n(1).browserDetails,i={shimMediaStream:function(){window.MediaStream=window.MediaStream||window.webkitMediaStream},shimOnTrack:function(){"object"!=typeof window||!window.RTCPeerConnection||"ontrack"in window.RTCPeerConnection.prototype||Object.defineProperty(window.RTCPeerConnection.prototype,"ontrack",{get:function(){return this._ontrack},set:function(e){var t=this;this._ontrack&&(this.removeEventListener("track",this._ontrack),this.removeEventListener("addstream",this._ontrackpoly)),this.addEventListener("track",this._ontrack=e),this.addEventListener("addstream",this._ontrackpoly=function(e){e.stream.addEventListener("addtrack",function(n){var r=new Event("track");r.track=n.track,r.receiver={track:n.track},r.streams=[e.stream],t.dispatchEvent(r)}),e.stream.getTracks().forEach(function(t){var n=new Event("track");n.track=t,n.receiver={track:t},n.streams=[e.stream],this.dispatchEvent(n)}.bind(this))}.bind(this))}})},shimSourceObject:function(){"object"==typeof window&&(!window.HTMLMediaElement||"srcObject"in window.HTMLMediaElement.prototype||Object.defineProperty(window.HTMLMediaElement.prototype,"srcObject",{get:function(){return this._srcObject},set:function(e){var t=this;return this._srcObject=e,this.src&&URL.revokeObjectURL(this.src),e?(this.src=URL.createObjectURL(e),e.addEventListener("addtrack",function(){t.src&&URL.revokeObjectURL(t.src),t.src=URL.createObjectURL(e)}),void e.addEventListener("removetrack",function(){t.src&&URL.revokeObjectURL(t.src),t.src=URL.createObjectURL(e)})):void(this.src="")}}))},shimPeerConnection:function(){window.RTCPeerConnection=function(e,t){r("PeerConnection"),e&&e.iceTransportPolicy&&(e.iceTransports=e.iceTransportPolicy);var n=new webkitRTCPeerConnection(e,t),o=n.getStats.bind(n);return n.getStats=function(e,t,n){var r=this,i=arguments;if(arguments.length>0&&"function"==typeof e)return o(e,t);var a=function(e){var t={},n=e.result();return n.forEach(function(e){var n={id:e.id,timestamp:e.timestamp,type:e.type};e.names().forEach(function(t){n[t]=e.stat(t)}),t[n.id]=n}),t},c=function(e,t){var n=new Map(Object.keys(e).map(function(t){return[t,e[t]]}));return t=t||e,Object.keys(t).forEach(function(e){n[e]=t[e]}),n};if(arguments.length>=2){var u=function(e){i[1](c(a(e)))};return o.apply(this,[u,arguments[0]])}return new Promise(function(t,n){1===i.length&&"object"==typeof e?o.apply(r,[function(e){t(c(a(e)))},n]):o.apply(r,[function(e){t(c(a(e),e.result()))},n])}).then(t,n)},n},window.RTCPeerConnection.prototype=webkitRTCPeerConnection.prototype,webkitRTCPeerConnection.generateCertificate&&Object.defineProperty(window.RTCPeerConnection,"generateCertificate",{get:function(){return webkitRTCPeerConnection.generateCertificate}}),["createOffer","createAnswer"].forEach(function(e){var t=webkitRTCPeerConnection.prototype[e];webkitRTCPeerConnection.prototype[e]=function(){var e=this;if(arguments.length<1||1===arguments.length&&"object"==typeof arguments[0]){var n=1===arguments.length?arguments[0]:void 0;return new Promise(function(r,o){t.apply(e,[r,o,n])})}return t.apply(this,arguments)}}),o.version<51&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(e){var t=webkitRTCPeerConnection.prototype[e];webkitRTCPeerConnection.prototype[e]=function(){var e=arguments,n=this,r=new Promise(function(r,o){t.apply(n,[e[0],r,o])});return e.length<2?r:r.then(function(){e[1].apply(null,[])},function(t){e.length>=3&&e[2].apply(null,[t])})}});var e=RTCPeerConnection.prototype.addIceCandidate;RTCPeerConnection.prototype.addIceCandidate=function(){return null===arguments[0]?Promise.resolve():e.apply(this,arguments)},["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(e){var t=webkitRTCPeerConnection.prototype[e];webkitRTCPeerConnection.prototype[e]=function(){return arguments[0]=new("addIceCandidate"===e?RTCIceCandidate:RTCSessionDescription)(arguments[0]),t.apply(this,arguments)}})},attachMediaStream:function(e,t){r("DEPRECATED, attachMediaStream will soon be removed."),o.version>=43?e.srcObject=t:"undefined"!=typeof e.src?e.src=URL.createObjectURL(t):r("Error attaching stream to element.")},reattachMediaStream:function(e,t){r("DEPRECATED, reattachMediaStream will soon be removed."),o.version>=43?e.srcObject=t.srcObject:e.src=t.src}};e.e={shimMediaStream:i.shimMediaStream,shimOnTrack:i.shimOnTrack,shimSourceObject:i.shimSourceObject,shimPeerConnection:i.shimPeerConnection,shimGetUserMedia:n(216),attachMediaStream:i.attachMediaStream,reattachMediaStream:i.reattachMediaStream}},function(e,t,n){"use strict";var r=n(1).log;e.e=function(){var e=function(e){if("object"!=typeof e||e.mandatory||e.optional)return e;var t={};return Object.keys(e).forEach(function(n){if("require"!==n&&"advanced"!==n&&"mediaSource"!==n){var r="object"==typeof e[n]?e[n]:{ideal:e[n]};void 0!==r.exact&&"number"==typeof r.exact&&(r.min=r.max=r.exact);var o=function(e,t){return e?e+t.charAt(0).toUpperCase()+t.slice(1):"deviceId"===t?"sourceId":t};if(void 0!==r.ideal){t.optional=t.optional||[];var i={};"number"==typeof r.ideal?(i[o("min",n)]=r.ideal,t.optional.push(i),i={},i[o("max",n)]=r.ideal,t.optional.push(i)):(i[o("",n)]=r.ideal,t.optional.push(i))}void 0!==r.exact&&"number"!=typeof r.exact?(t.mandatory=t.mandatory||{},t.mandatory[o("",n)]=r.exact):["min","max"].forEach(function(e){void 0!==r[e]&&(t.mandatory=t.mandatory||{},t.mandatory[o(e,n)]=r[e])})}}),e.advanced&&(t.optional=(t.optional||[]).concat(e.advanced)),t},t=function(t,n){if(t=JSON.parse(JSON.stringify(t)),t&&t.audio&&(t.audio=e(t.audio)),t&&"object"==typeof t.video){var o=t.video.facingMode;if(o=o&&("object"==typeof o?o:{ideal:o}),o&&("user"===o.exact||"environment"===o.exact||"user"===o.ideal||"environment"===o.ideal)&&(!navigator.mediaDevices.getSupportedConstraints||!navigator.mediaDevices.getSupportedConstraints().facingMode)&&(delete t.video.facingMode,"environment"===o.exact||"environment"===o.ideal))return navigator.mediaDevices.enumerateDevices().then(function(i){i=i.filter(function(e){return"videoinput"===e.kind});var a=i.find(function(e){return e.label.toLowerCase().indexOf("back")!==-1})||i.length&&i[i.length-1];return a&&(t.video.deviceId=o.exact?{exact:a.deviceId}:{ideal:a.deviceId}),t.video=e(t.video),r("chrome: "+JSON.stringify(t)),n(t)});t.video=e(t.video)}return r("chrome: "+JSON.stringify(t)),n(t)},n=function(e){return{name:{PermissionDeniedError:"NotAllowedError",ConstraintNotSatisfiedError:"OverconstrainedError"}[e.name]||e.name,message:e.message,constraint:e.constraintName,toString:function(){return this.name+(this.message&&": ")+this.message}}},o=function(e,r,o){t(e,function(e){navigator.webkitGetUserMedia(e,r,function(e){o(n(e))})})};navigator.getUserMedia=o;var i=function(e){return new Promise(function(t,n){navigator.getUserMedia(e,t,n)})};if(navigator.mediaDevices||(navigator.mediaDevices={getUserMedia:i,enumerateDevices:function(){return new Promise(function(e){var t={audio:"audioinput",video:"videoinput"};return MediaStreamTrack.getSources(function(n){e(n.map(function(e){return{label:e.label,kind:t[e.kind],deviceId:e.id,groupId:""}}))})})}}),navigator.mediaDevices.getUserMedia){var a=navigator.mediaDevices.getUserMedia.bind(navigator.mediaDevices);navigator.mediaDevices.getUserMedia=function(e){return t(e,function(e){return a(e)["catch"](function(e){return Promise.reject(n(e))})})}}else navigator.mediaDevices.getUserMedia=function(e){return i(e)};"undefined"==typeof navigator.mediaDevices.addEventListener&&(navigator.mediaDevices.addEventListener=function(){r("Dummy mediaDevices.addEventListener called.")}),"undefined"==typeof navigator.mediaDevices.removeEventListener&&(navigator.mediaDevices.removeEventListener=function(){r("Dummy mediaDevices.removeEventListener called.")})}},function(e,t,n){"use strict";var r=n(213),o=n(1).log,i={shimPeerConnection:function(){window.RTCIceGatherer&&(window.RTCIceCandidate||(window.RTCIceCandidate=function(e){return e}),window.RTCSessionDescription||(window.RTCSessionDescription=function(e){return e})),window.RTCPeerConnection=function(e){var t=this,n=document.createDocumentFragment();if(["addEventListener","removeEventListener","dispatchEvent"].forEach(function(e){t[e]=n[e].bind(n)}),this.onicecandidate=null,this.onaddstream=null,this.ontrack=null,this.onremovestream=null,this.onsignalingstatechange=null,this.oniceconnectionstatechange=null,this.onnegotiationneeded=null,this.ondatachannel=null,this.localStreams=[],this.remoteStreams=[],this.getLocalStreams=function(){return t.localStreams},this.getRemoteStreams=function(){return t.remoteStreams},this.localDescription=new RTCSessionDescription({type:"",sdp:""}),this.remoteDescription=new RTCSessionDescription({type:"",sdp:""}),this.signalingState="stable",this.iceConnectionState="new",this.iceGatheringState="new",this.iceOptions={gatherPolicy:"all",iceServers:[]},e&&e.iceTransportPolicy)switch(e.iceTransportPolicy){case"all":case"relay":this.iceOptions.gatherPolicy=e.iceTransportPolicy;break;case"none":throw new TypeError('iceTransportPolicy "none" not supported')}if(this.usingBundle=e&&"max-bundle"===e.bundlePolicy,e&&e.iceServers){var r=JSON.parse(JSON.stringify(e.iceServers));this.iceOptions.iceServers=r.filter(function(e){if(e&&e.urls){var t=e.urls;return"string"==typeof t&&(t=[t]),t=t.filter(function(e){return 0===e.indexOf("turn:")&&e.indexOf("transport=udp")!==-1})[0],!!t}return!1})}this.transceivers=[],this._localIceCandidatesBuffer=[]},window.RTCPeerConnection.prototype._emitBufferedCandidates=function(){var e=this,t=r.splitSections(e.localDescription.sdp);this._localIceCandidatesBuffer.forEach(function(n){var r=!n.candidate||0===Object.keys(n.candidate).length;if(r)for(var o=1;o<t.length;o++)t[o].indexOf("\r\na=end-of-candidates\r\n")===-1&&(t[o]+="a=end-of-candidates\r\n");else n.candidate.candidate.indexOf("typ endOfCandidates")===-1&&(t[n.candidate.sdpMLineIndex+1]+="a="+n.candidate.candidate+"\r\n");if(e.localDescription.sdp=t.join(""),e.dispatchEvent(n),null!==e.onicecandidate&&e.onicecandidate(n),!n.candidate&&"complete"!==e.iceGatheringState){var i=e.transceivers.every(function(e){return e.iceGatherer&&"completed"===e.iceGatherer.state});i&&(e.iceGatheringState="complete")}}),this._localIceCandidatesBuffer=[]},window.RTCPeerConnection.prototype.addStream=function(e){this.localStreams.push(e.clone()),this._maybeFireNegotiationNeeded()},window.RTCPeerConnection.prototype.removeStream=function(e){var t=this.localStreams.indexOf(e);t>-1&&(this.localStreams.splice(t,1),this._maybeFireNegotiationNeeded())},window.RTCPeerConnection.prototype.getSenders=function(){return this.transceivers.filter(function(e){return!!e.rtpSender}).map(function(e){return e.rtpSender})},window.RTCPeerConnection.prototype.getReceivers=function(){return this.transceivers.filter(function(e){return!!e.rtpReceiver}).map(function(e){return e.rtpReceiver})},window.RTCPeerConnection.prototype._getCommonCapabilities=function(e,t){var n={codecs:[],headerExtensions:[],fecMechanisms:[]};return e.codecs.forEach(function(e){for(var r=0;r<t.codecs.length;r++){var o=t.codecs[r];if(e.name.toLowerCase()===o.name.toLowerCase()&&e.clockRate===o.clockRate&&e.numChannels===o.numChannels){n.codecs.push(o);break}}}),e.headerExtensions.forEach(function(e){for(var r=0;r<t.headerExtensions.length;r++){var o=t.headerExtensions[r];if(e.uri===o.uri){n.headerExtensions.push(o);break}}}),n},window.RTCPeerConnection.prototype._createIceAndDtlsTransports=function(e,t){var n=this,o=new RTCIceGatherer(n.iceOptions),i=new RTCIceTransport(o);o.onlocalcandidate=function(a){var c=new Event("icecandidate");c.candidate={sdpMid:e,sdpMLineIndex:t};var u=a.candidate,s=!u||0===Object.keys(u).length;s?(void 0===o.state&&(o.state="completed"),c.candidate.candidate="candidate:1 1 udp 1 0.0.0.0 9 typ endOfCandidates"):(u.component="RTCP"===i.component?2:1,c.candidate.candidate=r.writeCandidate(u));var f=r.splitSections(n.localDescription.sdp);c.candidate.candidate.indexOf("typ endOfCandidates")===-1?f[c.candidate.sdpMLineIndex+1]+="a="+c.candidate.candidate+"\r\n":f[c.candidate.sdpMLineIndex+1]+="a=end-of-candidates\r\n",n.localDescription.sdp=f.join("");var d=n.transceivers.every(function(e){return e.iceGatherer&&"completed"===e.iceGatherer.state});switch(n.iceGatheringState){case"new":n._localIceCandidatesBuffer.push(c),s&&d&&n._localIceCandidatesBuffer.push(new Event("icecandidate"));break;case"gathering":n._emitBufferedCandidates(),n.dispatchEvent(c),null!==n.onicecandidate&&n.onicecandidate(c),d&&(n.dispatchEvent(new Event("icecandidate")),null!==n.onicecandidate&&n.onicecandidate(new Event("icecandidate")),n.iceGatheringState="complete");break;case"complete":}},i.onicestatechange=function(){n._updateConnectionState()};var a=new RTCDtlsTransport(i);return a.ondtlsstatechange=function(){n._updateConnectionState()},a.onerror=function(){a.state="failed",n._updateConnectionState()},{iceGatherer:o,iceTransport:i,dtlsTransport:a}},window.RTCPeerConnection.prototype._transceive=function(e,t,n){var o=this._getCommonCapabilities(e.localCapabilities,e.remoteCapabilities);t&&e.rtpSender&&(o.encodings=e.sendEncodingParameters,o.rtcp={cname:r.localCName},e.recvEncodingParameters.length&&(o.rtcp.ssrc=e.recvEncodingParameters[0].ssrc),e.rtpSender.send(o)),n&&e.rtpReceiver&&(o.encodings=e.recvEncodingParameters,o.rtcp={cname:e.cname},e.sendEncodingParameters.length&&(o.rtcp.ssrc=e.sendEncodingParameters[0].ssrc),e.rtpReceiver.receive(o))},window.RTCPeerConnection.prototype.setLocalDescription=function(e){var t,n,o=this;if("offer"===e.type)this._pendingOffer&&(t=r.splitSections(e.sdp),n=t.shift(),t.forEach(function(e,t){var n=r.parseRtpParameters(e);o._pendingOffer[t].localCapabilities=n}),this.transceivers=this._pendingOffer,delete this._pendingOffer);else if("answer"===e.type){t=r.splitSections(o.remoteDescription.sdp),n=t.shift();var i=r.matchPrefix(n,"a=ice-lite").length>0;t.forEach(function(e,t){var a=o.transceivers[t],c=a.iceGatherer,u=a.iceTransport,s=a.dtlsTransport,f=a.localCapabilities,d=a.remoteCapabilities,l="0"===e.split("\n",1)[0].split(" ",2)[1];if(!l){var p=r.getIceParameters(e,n);if(i){var h=r.matchPrefix(e,"a=candidate:").map(function(e){return r.parseCandidate(e)}).filter(function(e){return"1"===e.component});h.length&&u.setRemoteCandidates(h)}var v=r.getDtlsParameters(e,n);i&&(v.role="server"),o.usingBundle&&0!==t||(u.start(c,p,i?"controlling":"controlled"),s.start(v));var g=o._getCommonCapabilities(f,d);o._transceive(a,g.codecs.length>0,!1)}})}switch(this.localDescription={type:e.type,sdp:e.sdp},e.type){case"offer":this._updateSignalingState("have-local-offer");break;case"answer":this._updateSignalingState("stable");break;default:throw new TypeError('unsupported type "'+e.type+'"')}var a=arguments.length>1&&"function"==typeof arguments[1];if(a){var c=arguments[1];window.setTimeout(function(){c(),"new"===o.iceGatheringState&&(o.iceGatheringState="gathering"),
  o._emitBufferedCandidates()},0)}var u=Promise.resolve();return u.then(function(){a||("new"===o.iceGatheringState&&(o.iceGatheringState="gathering"),window.setTimeout(o._emitBufferedCandidates.bind(o),500))}),u},window.RTCPeerConnection.prototype.setRemoteDescription=function(e){var t=this,n=new MediaStream,o=[],i=r.splitSections(e.sdp),a=i.shift(),c=r.matchPrefix(a,"a=ice-lite").length>0;switch(this.usingBundle=r.matchPrefix(a,"a=group:BUNDLE ").length>0,i.forEach(function(i,u){var s,f,d,l,p,h,v,g,m,y,b,_,w=r.splitLines(i),C=w[0].substr(2).split(" "),E=C[0],S="0"===C[1],T=r.getDirection(i,a),R=r.parseRtpParameters(i);S||(b=r.getIceParameters(i,a),_=r.getDtlsParameters(i,a),_.role="client"),g=r.parseRtpEncodingParameters(i);var O=r.matchPrefix(i,"a=mid:");O=O.length?O[0].substr(6):r.generateIdentifier();var x,P=r.matchPrefix(i,"a=ssrc:").map(function(e){return r.parseSsrcMedia(e)}).filter(function(e){return"cname"===e.attribute})[0];P&&(x=P.value);var D=r.matchPrefix(i,"a=end-of-candidates").length>0,A=r.matchPrefix(i,"a=candidate:").map(function(e){return r.parseCandidate(e)}).filter(function(e){return"1"===e.component});if("offer"!==e.type||S)"answer"!==e.type||S||(s=t.transceivers[u],f=s.iceGatherer,d=s.iceTransport,l=s.dtlsTransport,p=s.rtpSender,h=s.rtpReceiver,v=s.sendEncodingParameters,m=s.localCapabilities,t.transceivers[u].recvEncodingParameters=g,t.transceivers[u].remoteCapabilities=R,t.transceivers[u].cname=x,(c||D)&&A.length&&d.setRemoteCandidates(A),t.usingBundle&&0!==u||(d.start(f,b,"controlling"),l.start(_)),t._transceive(s,"sendrecv"===T||"recvonly"===T,"sendrecv"===T||"sendonly"===T),!h||"sendrecv"!==T&&"sendonly"!==T?delete s.rtpReceiver:(y=h.track,o.push([y,h]),n.addTrack(y)));else{var j=t.usingBundle&&u>0?{iceGatherer:t.transceivers[0].iceGatherer,iceTransport:t.transceivers[0].iceTransport,dtlsTransport:t.transceivers[0].dtlsTransport}:t._createIceAndDtlsTransports(O,u);if(D&&j.iceTransport.setRemoteCandidates(A),m=RTCRtpReceiver.getCapabilities(E),v=[{ssrc:1001*(2*u+2)}],h=new RTCRtpReceiver(j.dtlsTransport,E),y=h.track,o.push([y,h]),n.addTrack(y),t.localStreams.length>0&&t.localStreams[0].getTracks().length>=u){var M=t.localStreams[0].getTracks()[u];p=new RTCRtpSender(M,j.dtlsTransport)}t.transceivers[u]={iceGatherer:j.iceGatherer,iceTransport:j.iceTransport,dtlsTransport:j.dtlsTransport,localCapabilities:m,remoteCapabilities:R,rtpSender:p,rtpReceiver:h,kind:E,mid:O,cname:x,sendEncodingParameters:v,recvEncodingParameters:g},t._transceive(t.transceivers[u],!1,"sendrecv"===T||"sendonly"===T)}}),this.remoteDescription={type:e.type,sdp:e.sdp},e.type){case"offer":this._updateSignalingState("have-remote-offer");break;case"answer":this._updateSignalingState("stable");break;default:throw new TypeError('unsupported type "'+e.type+'"')}return n.getTracks().length&&(t.remoteStreams.push(n),window.setTimeout(function(){var e=new Event("addstream");e.stream=n,t.dispatchEvent(e),null!==t.onaddstream&&window.setTimeout(function(){t.onaddstream(e)},0),o.forEach(function(r){var o=r[0],i=r[1],a=new Event("track");a.track=o,a.receiver=i,a.streams=[n],t.dispatchEvent(e),null!==t.ontrack&&window.setTimeout(function(){t.ontrack(a)},0)})},0)),arguments.length>1&&"function"==typeof arguments[1]&&window.setTimeout(arguments[1],0),Promise.resolve()},window.RTCPeerConnection.prototype.close=function(){this.transceivers.forEach(function(e){e.iceTransport&&e.iceTransport.stop(),e.dtlsTransport&&e.dtlsTransport.stop(),e.rtpSender&&e.rtpSender.stop(),e.rtpReceiver&&e.rtpReceiver.stop()}),this._updateSignalingState("closed")},window.RTCPeerConnection.prototype._updateSignalingState=function(e){this.signalingState=e;var t=new Event("signalingstatechange");this.dispatchEvent(t),null!==this.onsignalingstatechange&&this.onsignalingstatechange(t)},window.RTCPeerConnection.prototype._maybeFireNegotiationNeeded=function(){var e=new Event("negotiationneeded");this.dispatchEvent(e),null!==this.onnegotiationneeded&&this.onnegotiationneeded(e)},window.RTCPeerConnection.prototype._updateConnectionState=function(){var e,t=this,n={"new":0,closed:0,connecting:0,checking:0,connected:0,completed:0,failed:0};if(this.transceivers.forEach(function(e){n[e.iceTransport.state]++,n[e.dtlsTransport.state]++}),n.connected+=n.completed,e="new",n.failed>0?e="failed":n.connecting>0||n.checking>0?e="connecting":n.disconnected>0?e="disconnected":n["new"]>0?e="new":(n.connected>0||n.completed>0)&&(e="connected"),e!==t.iceConnectionState){t.iceConnectionState=e;var r=new Event("iceconnectionstatechange");this.dispatchEvent(r),null!==this.oniceconnectionstatechange&&this.oniceconnectionstatechange(r)}},window.RTCPeerConnection.prototype.createOffer=function(){var e=this;if(this._pendingOffer)throw new Error("createOffer called while there is a pending offer.");var t;1===arguments.length&&"function"!=typeof arguments[0]?t=arguments[0]:3===arguments.length&&(t=arguments[2]);var n=[],o=0,i=0;if(this.localStreams.length&&(o=this.localStreams[0].getAudioTracks().length,i=this.localStreams[0].getVideoTracks().length),t){if(t.mandatory||t.optional)throw new TypeError("Legacy mandatory/optional constraints not supported.");void 0!==t.offerToReceiveAudio&&(o=t.offerToReceiveAudio),void 0!==t.offerToReceiveVideo&&(i=t.offerToReceiveVideo)}for(this.localStreams.length&&this.localStreams[0].getTracks().forEach(function(e){n.push({kind:e.kind,track:e,wantReceive:"audio"===e.kind?o>0:i>0}),"audio"===e.kind?o--:"video"===e.kind&&i--});o>0||i>0;)o>0&&(n.push({kind:"audio",wantReceive:!0}),o--),i>0&&(n.push({kind:"video",wantReceive:!0}),i--);var a=r.writeSessionBoilerplate(),c=[];n.forEach(function(t,n){var o,i,a=t.track,u=t.kind,s=r.generateIdentifier(),f=e.usingBundle&&n>0?{iceGatherer:c[0].iceGatherer,iceTransport:c[0].iceTransport,dtlsTransport:c[0].dtlsTransport}:e._createIceAndDtlsTransports(s,n),d=RTCRtpSender.getCapabilities(u),l=[{ssrc:1001*(2*n+1)}];a&&(o=new RTCRtpSender(a,f.dtlsTransport)),t.wantReceive&&(i=new RTCRtpReceiver(f.dtlsTransport,u)),c[n]={iceGatherer:f.iceGatherer,iceTransport:f.iceTransport,dtlsTransport:f.dtlsTransport,localCapabilities:d,remoteCapabilities:null,rtpSender:o,rtpReceiver:i,kind:u,mid:s,sendEncodingParameters:l,recvEncodingParameters:null}}),this.usingBundle&&(a+="a=group:BUNDLE "+c.map(function(e){return e.mid}).join(" ")+"\r\n"),n.forEach(function(t,n){var o=c[n];a+=r.writeMediaSection(o,o.localCapabilities,"offer",e.localStreams[0])}),this._pendingOffer=c;var u=new RTCSessionDescription({type:"offer",sdp:a});return arguments.length&&"function"==typeof arguments[0]&&window.setTimeout(arguments[0],0,u),Promise.resolve(u)},window.RTCPeerConnection.prototype.createAnswer=function(){var e=this,t=r.writeSessionBoilerplate();this.usingBundle&&(t+="a=group:BUNDLE "+this.transceivers.map(function(e){return e.mid}).join(" ")+"\r\n"),this.transceivers.forEach(function(n){var o=e._getCommonCapabilities(n.localCapabilities,n.remoteCapabilities);t+=r.writeMediaSection(n,o,"answer",e.localStreams[0])});var n=new RTCSessionDescription({type:"answer",sdp:t});return arguments.length&&"function"==typeof arguments[0]&&window.setTimeout(arguments[0],0,n),Promise.resolve(n)},window.RTCPeerConnection.prototype.addIceCandidate=function(e){if(null===e)this.transceivers.forEach(function(e){e.iceTransport.addRemoteCandidate({})});else{var t=e.sdpMLineIndex;if(e.sdpMid)for(var n=0;n<this.transceivers.length;n++)if(this.transceivers[n].mid===e.sdpMid){t=n;break}var o=this.transceivers[t];if(o){var i=Object.keys(e.candidate).length>0?r.parseCandidate(e.candidate):{};if("tcp"===i.protocol&&0===i.port)return;if("1"!==i.component)return;"endOfCandidates"===i.type&&(i={}),o.iceTransport.addRemoteCandidate(i);var a=r.splitSections(this.remoteDescription.sdp);a[t+1]+=(i.type?e.candidate.trim():"a=end-of-candidates")+"\r\n",this.remoteDescription.sdp=a.join("")}}return arguments.length>1&&"function"==typeof arguments[1]&&window.setTimeout(arguments[1],0),Promise.resolve()},window.RTCPeerConnection.prototype.getStats=function(){var e=[];this.transceivers.forEach(function(t){["rtpSender","rtpReceiver","iceGatherer","iceTransport","dtlsTransport"].forEach(function(n){t[n]&&e.push(t[n].getStats())})});var t=arguments.length>1&&"function"==typeof arguments[1]&&arguments[1];return new Promise(function(n){var r=new Map;Promise.all(e).then(function(e){e.forEach(function(e){Object.keys(e).forEach(function(t){r.set(t,e[t]),r[t]=e[t]})}),t&&window.setTimeout(t,0,r),n(r)})})}},attachMediaStream:function(e,t){o("DEPRECATED, attachMediaStream will soon be removed."),e.srcObject=t},reattachMediaStream:function(e,t){o("DEPRECATED, reattachMediaStream will soon be removed."),e.srcObject=t.srcObject}};e.e={shimPeerConnection:i.shimPeerConnection,shimGetUserMedia:n(218),attachMediaStream:i.attachMediaStream,reattachMediaStream:i.reattachMediaStream}},function(e,t,n){"use strict";e.e=function(){var e=function(e){return{name:{PermissionDeniedError:"NotAllowedError"}[e.name]||e.name,message:e.message,constraint:e.constraint,toString:function(){return this.name}}},t=navigator.mediaDevices.getUserMedia.bind(navigator.mediaDevices);navigator.mediaDevices.getUserMedia=function(n){return t(n)["catch"](function(t){return Promise.reject(e(t))})}}},function(e,t,n){"use strict";var r=n(1).log,o=n(1).browserDetails,i={shimOnTrack:function(){"object"!=typeof window||!window.RTCPeerConnection||"ontrack"in window.RTCPeerConnection.prototype||Object.defineProperty(window.RTCPeerConnection.prototype,"ontrack",{get:function(){return this._ontrack},set:function(e){this._ontrack&&(this.removeEventListener("track",this._ontrack),this.removeEventListener("addstream",this._ontrackpoly)),this.addEventListener("track",this._ontrack=e),this.addEventListener("addstream",this._ontrackpoly=function(e){e.stream.getTracks().forEach(function(t){var n=new Event("track");n.track=t,n.receiver={track:t},n.streams=[e.stream],this.dispatchEvent(n)}.bind(this))}.bind(this))}})},shimSourceObject:function(){"object"==typeof window&&(!window.HTMLMediaElement||"srcObject"in window.HTMLMediaElement.prototype||Object.defineProperty(window.HTMLMediaElement.prototype,"srcObject",{get:function(){return this.mozSrcObject},set:function(e){this.mozSrcObject=e}}))},shimPeerConnection:function(){if("object"==typeof window&&(window.RTCPeerConnection||window.mozRTCPeerConnection)){window.RTCPeerConnection||(window.RTCPeerConnection=function(e,t){if(o.version<38&&e&&e.iceServers){for(var n=[],r=0;r<e.iceServers.length;r++){var i=e.iceServers[r];if(i.hasOwnProperty("urls"))for(var a=0;a<i.urls.length;a++){var c={url:i.urls[a]};0===i.urls[a].indexOf("turn")&&(c.username=i.username,c.credential=i.credential),n.push(c)}else n.push(e.iceServers[r])}e.iceServers=n}return new mozRTCPeerConnection(e,t)},window.RTCPeerConnection.prototype=mozRTCPeerConnection.prototype,mozRTCPeerConnection.generateCertificate&&Object.defineProperty(window.RTCPeerConnection,"generateCertificate",{get:function(){return mozRTCPeerConnection.generateCertificate}}),window.RTCSessionDescription=mozRTCSessionDescription,window.RTCIceCandidate=mozRTCIceCandidate),["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(e){var t=RTCPeerConnection.prototype[e];RTCPeerConnection.prototype[e]=function(){return arguments[0]=new("addIceCandidate"===e?RTCIceCandidate:RTCSessionDescription)(arguments[0]),t.apply(this,arguments)}});var e=RTCPeerConnection.prototype.addIceCandidate;RTCPeerConnection.prototype.addIceCandidate=function(){return null===arguments[0]?Promise.resolve():e.apply(this,arguments)};var t=function(e){var t=new Map;return Object.keys(e).forEach(function(n){t.set(n,e[n]),t[n]=e[n]}),t},n=RTCPeerConnection.prototype.getStats;RTCPeerConnection.prototype.getStats=function(e,r,o){return n.apply(this,[e||null]).then(function(e){return t(e)}).then(r,o)}}},attachMediaStream:function(e,t){r("DEPRECATED, attachMediaStream will soon be removed."),e.srcObject=t},reattachMediaStream:function(e,t){r("DEPRECATED, reattachMediaStream will soon be removed."),e.srcObject=t.srcObject}};e.e={shimOnTrack:i.shimOnTrack,shimSourceObject:i.shimSourceObject,shimPeerConnection:i.shimPeerConnection,shimGetUserMedia:n(220),attachMediaStream:i.attachMediaStream,reattachMediaStream:i.reattachMediaStream}},function(e,t,n){"use strict";var r=n(1).log,o=n(1).browserDetails;e.e=function(){var e=function(e){return{name:{SecurityError:"NotAllowedError",PermissionDeniedError:"NotAllowedError"}[e.name]||e.name,message:{"The operation is insecure.":"The request is not allowed by the user agent or the platform in the current context."}[e.message]||e.message,constraint:e.constraint,toString:function(){return this.name+(this.message&&": ")+this.message}}},t=function(t,n,i){var a=function(e){if("object"!=typeof e||e.require)return e;var t=[];return Object.keys(e).forEach(function(n){if("require"!==n&&"advanced"!==n&&"mediaSource"!==n){var r=e[n]="object"==typeof e[n]?e[n]:{ideal:e[n]};if(void 0===r.min&&void 0===r.max&&void 0===r.exact||t.push(n),void 0!==r.exact&&("number"==typeof r.exact?r.min=r.max=r.exact:e[n]=r.exact,delete r.exact),void 0!==r.ideal){e.advanced=e.advanced||[];var o={};"number"==typeof r.ideal?o[n]={min:r.ideal,max:r.ideal}:o[n]=r.ideal,e.advanced.push(o),delete r.ideal,Object.keys(r).length||delete e[n]}}}),t.length&&(e.require=t),e};return t=JSON.parse(JSON.stringify(t)),o.version<38&&(r("spec: "+JSON.stringify(t)),t.audio&&(t.audio=a(t.audio)),t.video&&(t.video=a(t.video)),r("ff37: "+JSON.stringify(t))),navigator.mozGetUserMedia(t,n,function(t){i(e(t))})},n=function(e){return new Promise(function(n,r){t(e,n,r)})};if(navigator.mediaDevices||(navigator.mediaDevices={getUserMedia:n,addEventListener:function(){},removeEventListener:function(){}}),navigator.mediaDevices.enumerateDevices=navigator.mediaDevices.enumerateDevices||function(){return new Promise(function(e){var t=[{kind:"audioinput",deviceId:"default",label:"",groupId:""},{kind:"videoinput",deviceId:"default",label:"",groupId:""}];e(t)})},o.version<41){var i=navigator.mediaDevices.enumerateDevices.bind(navigator.mediaDevices);navigator.mediaDevices.enumerateDevices=function(){return i().then(void 0,function(e){if("NotFoundError"===e.name)return[];throw e})}}if(o.version<49){var a=navigator.mediaDevices.getUserMedia.bind(navigator.mediaDevices);navigator.mediaDevices.getUserMedia=function(t){return a(t)["catch"](function(t){return Promise.reject(e(t))})}}navigator.getUserMedia=function(e,n,r){return o.version<44?t(e,n,r):(console.warn("navigator.getUserMedia has been replaced by navigator.mediaDevices.getUserMedia"),void navigator.mediaDevices.getUserMedia(e).then(n,r))}}},function(e,t,n){"use strict";var r={shimGetUserMedia:function(){navigator.getUserMedia=navigator.webkitGetUserMedia}};e.e={shimGetUserMedia:r.shimGetUserMedia}},function(e,t,n){e.e=n(82)}])});