|
|
|
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(e.toString()).default:"object"==typeof exports?exports.Quagga=e(e.toString()).default:t.Quagga=e(e.toString()).default}(this,function(t){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/",e(e.s=164)}([function(t,e){function n(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}t.exports=n},function(t,e){var n=Array.isArray;t.exports=n},function(t,e,n){"use strict";function r(t,e){t=a()(o(),t),u.a.call(this,t,e)}function o(){var t={};return Object.keys(r.CONFIG_KEYS).forEach(function(e){t[e]=r.CONFIG_KEYS[e].default}),t}var i=n(28),a=n.n(i),u=n(5),c=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},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(u.a.prototype,s),r.prototype.constructor=r,r.prototype._decodeCode=function(t,e){var n,r,o,i=[0,0,0,0],a=this,u=t,c=!a._row[u],s=0,f={error:Number.MAX_VALUE,code:-1,start:t,end:t};for(e||(e=a.CODE_PATTERN.length),n=u;n<a._row.length;n++)if(a._row[n]^c)i[s]++;else{if(s===i.length-1){for(r=0;r<e;r++)(o=a._matchPattern(i,a.CODE_PATTERN[r]))<f.error&&(f.code=r,f.error=o);return f.end=n,f.error>a.AVG_CODE_ERROR?null:f}s++,i[s]=1,c=!c}return null},r.prototype._findPattern=function(t,e,n,r,o){var i,a,u,c,s=[],f=this,l=0,d={error:Number.MAX_VALUE,code:-1,start:0,end:0};for(e||(e=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<t.length;i++)s[i]=0;for(i=e;i<f._row.length;i++)if(f._row[i]^n)s[l]++;else{if(l===s.length-1){for(c=0,u=0;u<s.length;u++)c+=s[u];if((a=f._matchPattern(s,t))<o)return d.error=a,d.start=i-c,d.end=i,d;if(!r)return null;for(u=0;u<s.length-2;u++)s[u]=s[u+2];s[s.length-2]=0,s[s.length-1]=0,l--}else l++;s[l]=1,n=!n}return null},r.prototype._findStart=function(){for(var t,e,n=this,r=n._nextSet(n._row);!e;){if(!(e=n._findPattern(n.START_PATTERN,r)))return null;if((t=e.start-(e.end-e.start))>=0&&n._matchRange(t,e.start,0))return e;r=e.end,e=null}},r.prototype._verifyTrailingWhitespace=function(t){var e,n=this;return e=t.end+(t.end-t.start),e<n._row.length&&n._matchRange(t.end,e,0)?t:null},r.prototype._findEnd=function(t,e){var n=this,r=n._findPattern(n.STOP_PATTERN,t,e,!1);return null!==r?n._verifyTrailingWhitespace(r):null},r.prototype._calculateFirstDigit=function(t){var e,n=this;for(e=0;e<n.CODE_FREQUENCY.length;e++)if(t===n.CODE_FREQUENCY[e])return e;return null},r.prototype._decodePayload=function(t,e,n){var r,o,i=this,a=0;for(r=0;r<6;r++){if(!(t=i._decodeCode(t.end)))return null;t.code>=i.CODE_G_START?(t.code=t.code-i.CODE_G_START,a|=1<<5-r):a|=0<<5-r,e.push(t.code),n.push(t)}if(null===(o=i._calculateFirstDigit(a)))return null;if(e.unshift(o),null===(t=i._findPattern(i.MIDDLE_PATTERN,t.end,!0,!1)))return null;for(n.push(t),r=0;r<6;r++){if(!(t=i._decodeCode(t.end,i.CODE_G_START)))return null;n.push(t),e.push(t.code)}return t},r.prototype._decode=function(){var t,e,n=this,r=[],o=[],i={};if(!(t=n._findStart()))return null;if(e={code:t.code,start:t.start,end:t.end},o.push
|