From ff9905948c5d48e343c628bbb913a16b1d710b0a Mon Sep 17 00:00:00 2001 From: "97694732@qq.com" Date: Thu, 4 Jun 2026 16:14:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=AB=E7=A0=81=E9=A1=B5:=E6=94=B9=E7=94=A8p?= =?UTF-8?q?lus.barcode=E5=8E=9F=E7=94=9F=E6=89=AB=E7=A0=81(=E5=85=A8?= =?UTF-8?q?=E9=80=8F=E6=98=8E=E6=97=A0=E5=8F=96=E6=99=AF=E6=A1=86)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hybrid/html/scanner.html | 149 +----------------------------------- hybrid/js/quagga.min.js | 6 -- pages.json | 5 +- pages/upload/scan-isbn.nvue | 105 +++++++++++++++++++++++++ pages/upload/scan-isbn.vue | 33 -------- 5 files changed, 110 insertions(+), 188 deletions(-) delete mode 100644 hybrid/js/quagga.min.js create mode 100644 pages/upload/scan-isbn.nvue delete mode 100644 pages/upload/scan-isbn.vue diff --git a/hybrid/html/scanner.html b/hybrid/html/scanner.html index f24de4d..425a62b 100644 --- a/hybrid/html/scanner.html +++ b/hybrid/html/scanner.html @@ -1,148 +1 @@ - - - - - - 扫码 - - - -
-
-
对准条码自动识别
-
正在启动摄像头...
- - - - - +deprecated - use scan-isbn.nvue \ No newline at end of file diff --git a/hybrid/js/quagga.min.js b/hybrid/js/quagga.min.js deleted file mode 100644 index 1be374d..0000000 --- a/hybrid/js/quagga.min.js +++ /dev/null @@ -1,6 +0,0 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Quagga=e():t.Quagga=e()}(window,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="/",r(r.s=90)}([function(t,e,r){var n=r(68);t.exports=function(t,e,r){return(e=n(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){function r(e){return t.exports=r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},t.exports.__esModule=!0,t.exports.default=t.exports,r(e)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){var n=r(68);function o(t,e){for(var r=0;r-1&&t%1==0&&t<=9007199254740991}},function(t,e,r){var n=r(17),o=r(32),i=r(11),a=Function.prototype,u=Object.prototype,c=a.toString,s=u.hasOwnProperty,f=c.call(Object);t.exports=function(t){if(!i(t)||"[object Object]"!=n(t))return!1;var e=o(t);if(null===e)return!0;var r=s.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&c.call(r)==f}},function(t,e,r){var n=r(129),o=r(36),i=r(37),a=i&&i.isTypedArray,u=a?o(a):n;t.exports=u},function(t,e){t.exports=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}},function(t,e,r){var n=r(29),o=r(23),i=Object.prototype.hasOwnProperty;t.exports=function(t,e,r){var a=t[e];i.call(t,e)&&o(a,r)&&(void 0!==r||e in t)||n(t,e,r)}},function(t,e,r){var n=r(131),o=r(34),i=r(12),a=r(35),u=r(62),c=r(58),s=Object.prototype.hasOwnProperty;t.exports=function(t,e){var r=i(t),f=!r&&o(t),l=!r&&!f&&a(t),d=!r&&!f&&!l&&c(t),h=r||f||l||d,v=h?n(t.length,String):[],p=v.length;for(var y in t)!e&&!s.call(t,y)||h&&("length"==y||l&&("offset"==y||"parent"==y)||d&&("buffer"==y||"byteLength"==y||"byteOffset"==y)||u(y,p))||v.push(y);return v}},function(t,e){var r=/^(?:0|[1-9]\d*)$/;t.exports=function(t,e){var n=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==n||"symbol"!=n&&r.test(t))&&t>-1&&t%1==0&&tt.length)&&(e=t.length);for(var r=0,n=Array(e);r3?(o=v===n)&&(u=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=e):i[0]<=h&&((o=t<2&&hn||n>v)&&(i[4]=t,i[5]=n,d.n=v,a=0))}if(o||t>1)return s;throw l=!0,n}return function(o,f,v){if(c>1)throw TypeError("Generator is already running");for(l&&1===f&&h(f,v),a=f,u=v;(r=a<2?e:u)||!l;){i||(a?a<3?(a>1&&(d.n=-1),h(a,u)):d.n=u:d.v=u);try{if(c=2,i){if(a||(o="next"),r=i[o]){if(!(r=r.call(i,u)))throw TypeError("iterator result is not an object");if(!r.done)return r;u=r.value,a<2&&(a=0)}else 1===a&&(r=i.return)&&r.call(i),a<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=e}else if((r=(l=d.n<0)?u:t.call(n,d))!==s)break}catch(t){i=e,a=1,u=t}finally{c=1}}return{value:r,done:l}}}(t,i,a),!0),c}var s={};function f(){}function l(){}function d(){}r=Object.getPrototypeOf;var h=[][a]?r(r([][a]())):(n(r={},a,(function(){return this})),r),v=d.prototype=f.prototype=Object.create(h);function p(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,n(t,u,"GeneratorFunction")),t.prototype=Object.create(v),t}return l.prototype=d,n(v,"constructor",d),n(d,"constructor",l),l.displayName="GeneratorFunction",n(d,u,"GeneratorFunction"),n(v),n(v,u,"Generator"),n(v,a,(function(){return this})),n(v,"toString",(function(){return"[object Generator]"})),(t.exports=o=function(){return{w:c,m:p}},t.exports.__esModule=!0,t.exports.default=t.exports)()}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){function r(e,n,o,i){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}t.exports=r=function(t,e,n,o){function i(e,n){r(t,e,(function(t){return this._invoke(e,n,t)}))}e?a?a(t,e,{value:n,enumerable:!o,configurable:!o,writable:!o}):t[e]=n:(i("next",0),i("throw",1),i("return",2))},t.exports.__esModule=!0,t.exports.default=t.exports,r(e,n,o,i)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){var n=r(70),o=r(73);t.exports=function(t,e,r,i,a){return new o(n().w(t,e,r,i),a||Promise)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){var n=r(69),o=r(71);t.exports=function t(e,r){function i(t,o,a,u){try{var c=e[t](o),s=c.value;return s instanceof n?r.resolve(s.v).then((function(t){i("next",t,a,u)}),(function(t){i("throw",t,a,u)})):r.resolve(s).then((function(t){c.value=t,a(c)}),(function(t){return i("throw",t,a,u)}))}catch(t){u(t)}}var a;this.next||(o(t.prototype),o(t.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",(function(){return this}))),o(this,"_invoke",(function(t,e,n){function o(){return new r((function(e,r){i(t,n,e,r)}))}return a=a?a.then(o,o):o()}),!0)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(t,e){for(var r=-1,n=null==t?0:t.length,o=Array(n);++r1),e})),u(t,f(t),r),s&&(r=o(r,7,c));for(var l=e.length;l--;)i(r,e[l]);return r}));t.exports=l},function(t,e,r){var n=r(1),o=r(38),i=r(195),a=r(196);function u(e){var r="function"==typeof Map?new Map:void 0;return t.exports=u=function(t){if(null===t||!i(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(t))return r.get(t);r.set(t,e)}function e(){return a(t,arguments,n(this).constructor)}return e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),o(e,t)},t.exports.__esModule=!0,t.exports.default=t.exports,u(e)}t.exports=u,t.exports.__esModule=!0,t.exports.default=t.exports},,,,,,,function(t,e,r){t.exports=r(198)},function(t,e,r){var n=r(45),o=r(49),i=r(121),a=r(123),u=r(10),c=r(20),s=r(59);t.exports=function t(e,r,f,l,d){e!==r&&i(r,(function(i,c){if(d||(d=new n),u(i))a(e,r,c,f,t,l,d);else{var h=l?l(s(e,c),i,c+"",e,r,d):void 0;void 0===h&&(h=i),o(e,c,h)}}),c)}},function(t,e){t.exports=function(){this.__data__=[],this.size=0}},function(t,e,r){var n=r(22),o=Array.prototype.splice;t.exports=function(t){var e=this.__data__,r=n(e,t);return!(r<0)&&(r==e.length-1?e.pop():o.call(e,r,1),--this.size,!0)}},function(t,e,r){var n=r(22);t.exports=function(t){var e=this.__data__,r=n(e,t);return r<0?void 0:e[r][1]}},function(t,e,r){var n=r(22);t.exports=function(t){return n(this.__data__,t)>-1}},function(t,e,r){var n=r(22);t.exports=function(t,e){var r=this.__data__,o=n(r,t);return o<0?(++this.size,r.push([t,e])):r[o][1]=e,this}},function(t,e,r){var n=r(21);t.exports=function(){this.__data__=new n,this.size=0}},function(t,e){t.exports=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}},function(t,e){t.exports=function(t){return this.__data__.get(t)}},function(t,e){t.exports=function(t){return this.__data__.has(t)}},function(t,e,r){var n=r(21),o=r(27),i=r(48);t.exports=function(t,e){var r=this.__data__;if(r instanceof n){var a=r.__data__;if(!o||a.length<199)return a.push([t,e]),this.size=++r.size,this;r=this.__data__=new i(a)}return r.set(t,e),this.size=r.size,this}},function(t,e,r){var n=r(28),o=r(106),i=r(10),a=r(47),u=/^\[object .+?Constructor\]$/,c=Function.prototype,s=Object.prototype,f=c.toString,l=s.hasOwnProperty,d=RegExp("^"+f.call(l).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(t){return!(!i(t)||o(t))&&(n(t)?d:u).test(a(t))}},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){var n=r(19),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,u=n?n.toStringTag:void 0;t.exports=function(t){var e=i.call(t,u),r=t[u];try{t[u]=void 0;var n=!0}catch(t){}var o=a.call(t);return n&&(e?t[u]=r:delete t[u]),o}},function(t,e){var r=Object.prototype.toString;t.exports=function(t){return r.call(t)}},function(t,e,r){var n,o=r(107),i=(n=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";t.exports=function(t){return!!i&&i in t}},function(t,e,r){var n=r(8)["__core-js_shared__"];t.exports=n},function(t,e){t.exports=function(t,e){return null==t?void 0:t[e]}},function(t,e,r){var n=r(110),o=r(21),i=r(27);t.exports=function(){this.size=0,this.__data__={hash:new n,map:new(i||o),string:new n}}},function(t,e,r){var n=r(111),o=r(112),i=r(113),a=r(114),u=r(115);function c(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e1?r[i-1]:void 0,u=i>2?r[2]:void 0;for(a=t.length>3&&"function"==typeof a?(i--,a):void 0,u&&o(r[0],r[1],u)&&(a=i<3?void 0:a,i=1),e=Object(e);++n0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}},function(t,e,r){var n=r(23),o=r(26),i=r(62),a=r(10);t.exports=function(t,e,r){if(!a(r))return!1;var u=typeof e;return!!("number"==u?o(r)&&i(e,r.length):"string"==u&&e in r)&&n(r[e],t)}},function(t,e){"undefined"!=typeof window&&(window.requestAnimationFrame||(window.requestAnimationFrame=window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)})),"function"!=typeof Math.imul&&(Math.imul=function(t,e){var r=65535&t,n=65535&e;return r*n+((t>>>16&65535)*n+r*(e>>>16&65535)<<16>>>0)|0}),"function"!=typeof Object.assign&&(Object.assign=function(t){"use strict";if(null===t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),r=1;r=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}}}throw new TypeError(n(t)+" is not iterable")},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){var n=r(1);t.exports=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=n(t)););return t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){var n=r(67);t.exports=function(t){if(Array.isArray(t))return n(t)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(t,e){if(null==t)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==e.indexOf(n))continue;r[n]=t[n]}return r},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){var n=r(45),o=r(157),i=r(60),a=r(158),u=r(161),c=r(51),s=r(53),f=r(162),l=r(164),d=r(165),h=r(78),v=r(42),p=r(170),y=r(171),g=r(54),x=r(12),b=r(35),_=r(175),m=r(10),w=r(177),O=r(39),M=r(20),C={};C["[object Arguments]"]=C["[object Array]"]=C["[object ArrayBuffer]"]=C["[object DataView]"]=C["[object Boolean]"]=C["[object Date]"]=C["[object Float32Array]"]=C["[object Float64Array]"]=C["[object Int8Array]"]=C["[object Int16Array]"]=C["[object Int32Array]"]=C["[object Map]"]=C["[object Number]"]=C["[object Object]"]=C["[object RegExp]"]=C["[object Set]"]=C["[object String]"]=C["[object Symbol]"]=C["[object Uint8Array]"]=C["[object Uint8ClampedArray]"]=C["[object Uint16Array]"]=C["[object Uint32Array]"]=!0,C["[object Error]"]=C["[object Function]"]=C["[object WeakMap]"]=!1,t.exports=function t(e,r,R,S,A,E){var k,j=1&r,P=2&r,D=4&r;if(R&&(k=A?R(e,S,A,E):R(e)),void 0!==k)return k;if(!m(e))return e;var T=x(e);if(T){if(k=p(e),!j)return s(e,k)}else{var I=v(e),z="[object Function]"==I||"[object GeneratorFunction]"==I;if(b(e))return c(e,j);if("[object Object]"==I||"[object Arguments]"==I||z&&!A){if(k=P||z?{}:g(e),!j)return P?l(e,u(k,e)):f(e,a(k,e))}else{if(!C[I])return A?e:{};k=y(e,I,j)}}E||(E=new n);var U=E.get(e);if(U)return U;E.set(e,k),w(e)?e.forEach((function(n){k.add(t(n,r,R,n,e,E))})):_(e)&&e.forEach((function(n,o){k.set(o,t(n,r,R,o,e,E))}));var N=T?void 0:(D?P?h:d:P?M:O)(e);return o(N||e,(function(n,o){N&&(n=e[o=n]),i(k,o,t(n,r,R,o,e,E))})),k}},function(t,e){t.exports=function(t,e){for(var r=-1,n=null==t?0:t.length;++ro?0:o+e),(r=r>o?o:r)<0&&(r+=o),o=e>r?0:r-e>>>0,e>>>=0;for(var i=Array(o);++n0&&i(f)?r>1?t(f,r-1,i,a,u):n(u,f):a||(u[u.length]=f)}return u}},function(t,e,r){var n=r(19),o=r(34),i=r(12),a=n?n.isConcatSpreadable:void 0;t.exports=function(t){return i(t)||o(t)||!!(a&&t&&t[a])}},function(t,e){t.exports=function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){var n=r(197),o=r(38);t.exports=function(t,e,r){if(n())return Reflect.construct.apply(null,arguments);var i=[null];i.push.apply(i,e);var a=new(t.bind.apply(t,i));return r&&o(a,r.prototype),a},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){function r(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(t.exports=r=function(){return!!e},t.exports.__esModule=!0,t.exports.default=t.exports)()}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){"use strict";r.r(e),r.d(e,"BarcodeDecoder",(function(){return Sn})),r.d(e,"Readers",(function(){return a})),r.d(e,"CameraAccess",(function(){return Jn})),r.d(e,"ImageDebug",(function(){return rr})),r.d(e,"ImageWrapper",(function(){return Ze})),r.d(e,"ResultCollector",(function(){return to}));var n={};r.r(n),r.d(n,"create",(function(){return w})),r.d(n,"clone",(function(){return O})),r.d(n,"copy",(function(){return M})),r.d(n,"identity",(function(){return C})),r.d(n,"fromValues",(function(){return R})),r.d(n,"set",(function(){return S})),r.d(n,"transpose",(function(){return A})),r.d(n,"invert",(function(){return E})),r.d(n,"adjoint",(function(){return k})),r.d(n,"determinant",(function(){return j})),r.d(n,"multiply",(function(){return P})),r.d(n,"rotate",(function(){return D})),r.d(n,"scale",(function(){return T})),r.d(n,"fromRotation",(function(){return I})),r.d(n,"fromScaling",(function(){return z})),r.d(n,"str",(function(){return U})),r.d(n,"frob",(function(){return N})),r.d(n,"LDU",(function(){return W})),r.d(n,"add",(function(){return F})),r.d(n,"subtract",(function(){return B})),r.d(n,"exactEquals",(function(){return L})),r.d(n,"equals",(function(){return V})),r.d(n,"multiplyScalar",(function(){return q})),r.d(n,"multiplyScalarAndAdd",(function(){return G})),r.d(n,"mul",(function(){return H})),r.d(n,"sub",(function(){return X}));var o={};r.r(o),r.d(o,"create",(function(){return Q})),r.d(o,"clone",(function(){return $})),r.d(o,"fromValues",(function(){return Y})),r.d(o,"copy",(function(){return Z})),r.d(o,"set",(function(){return K})),r.d(o,"add",(function(){return J})),r.d(o,"subtract",(function(){return tt})),r.d(o,"multiply",(function(){return et})),r.d(o,"divide",(function(){return rt})),r.d(o,"ceil",(function(){return nt})),r.d(o,"floor",(function(){return ot})),r.d(o,"min",(function(){return it})),r.d(o,"max",(function(){return at})),r.d(o,"round",(function(){return ut})),r.d(o,"scale",(function(){return ct})),r.d(o,"scaleAndAdd",(function(){return st})),r.d(o,"distance",(function(){return ft})),r.d(o,"squaredDistance",(function(){return lt})),r.d(o,"length",(function(){return dt})),r.d(o,"squaredLength",(function(){return ht})),r.d(o,"negate",(function(){return vt})),r.d(o,"inverse",(function(){return pt})),r.d(o,"normalize",(function(){return yt})),r.d(o,"dot",(function(){return gt})),r.d(o,"cross",(function(){return xt})),r.d(o,"lerp",(function(){return bt})),r.d(o,"random",(function(){return _t})),r.d(o,"transformMat2",(function(){return mt})),r.d(o,"transformMat2d",(function(){return wt})),r.d(o,"transformMat3",(function(){return Ot})),r.d(o,"transformMat4",(function(){return Mt})),r.d(o,"rotate",(function(){return Ct})),r.d(o,"angle",(function(){return Rt})),r.d(o,"signedAngle",(function(){return St})),r.d(o,"zero",(function(){return At})),r.d(o,"str",(function(){return Et})),r.d(o,"exactEquals",(function(){return kt})),r.d(o,"equals",(function(){return jt})),r.d(o,"len",(function(){return Dt})),r.d(o,"sub",(function(){return Tt})),r.d(o,"mul",(function(){return It})),r.d(o,"div",(function(){return zt})),r.d(o,"dist",(function(){return Ut})),r.d(o,"sqrDist",(function(){return Nt})),r.d(o,"sqrLen",(function(){return Wt})),r.d(o,"forEach",(function(){return Ft}));var i={};r.r(i),r.d(i,"create",(function(){return Bt})),r.d(i,"clone",(function(){return Lt})),r.d(i,"length",(function(){return Vt})),r.d(i,"fromValues",(function(){return qt})),r.d(i,"copy",(function(){return Gt})),r.d(i,"set",(function(){return Ht})),r.d(i,"add",(function(){return Xt})),r.d(i,"subtract",(function(){return Qt})),r.d(i,"multiply",(function(){return $t})),r.d(i,"divide",(function(){return Yt})),r.d(i,"ceil",(function(){return Zt})),r.d(i,"floor",(function(){return Kt})),r.d(i,"min",(function(){return Jt})),r.d(i,"max",(function(){return te})),r.d(i,"round",(function(){return ee})),r.d(i,"scale",(function(){return re})),r.d(i,"scaleAndAdd",(function(){return ne})),r.d(i,"distance",(function(){return oe})),r.d(i,"squaredDistance",(function(){return ie})),r.d(i,"squaredLength",(function(){return ae})),r.d(i,"negate",(function(){return ue})),r.d(i,"inverse",(function(){return ce})),r.d(i,"normalize",(function(){return se})),r.d(i,"dot",(function(){return fe})),r.d(i,"cross",(function(){return le})),r.d(i,"lerp",(function(){return de})),r.d(i,"slerp",(function(){return he})),r.d(i,"hermite",(function(){return ve})),r.d(i,"bezier",(function(){return pe})),r.d(i,"random",(function(){return ye})),r.d(i,"transformMat4",(function(){return ge})),r.d(i,"transformMat3",(function(){return xe})),r.d(i,"transformQuat",(function(){return be})),r.d(i,"rotateX",(function(){return _e})),r.d(i,"rotateY",(function(){return me})),r.d(i,"rotateZ",(function(){return we})),r.d(i,"angle",(function(){return Oe})),r.d(i,"zero",(function(){return Me})),r.d(i,"str",(function(){return Ce})),r.d(i,"exactEquals",(function(){return Re})),r.d(i,"equals",(function(){return Se})),r.d(i,"sub",(function(){return Ae})),r.d(i,"mul",(function(){return Ee})),r.d(i,"div",(function(){return ke})),r.d(i,"dist",(function(){return je})),r.d(i,"sqrDist",(function(){return Pe})),r.d(i,"len",(function(){return De})),r.d(i,"sqrLen",(function(){return Te})),r.d(i,"forEach",(function(){return Ie}));var a={};r.r(a),r.d(a,"BarcodeReader",(function(){return lr})),r.d(a,"TwoOfFiveReader",(function(){return gr})),r.d(a,"NewCodabarReader",(function(){return wr})),r.d(a,"Code128Reader",(function(){return Mr})),r.d(a,"Code32Reader",(function(){return Ir})),r.d(a,"Code39Reader",(function(){return Pr})),r.d(a,"Code39VINReader",(function(){return Wr})),r.d(a,"Code93Reader",(function(){return Vr})),r.d(a,"EAN2Reader",(function(){return tn})),r.d(a,"EAN5Reader",(function(){return nn})),r.d(a,"EAN8Reader",(function(){return an})),r.d(a,"EANReader",(function(){return Kr})),r.d(a,"I2of5Reader",(function(){return cn})),r.d(a,"PharmacodeReader",(function(){return vn})),r.d(a,"UPCEReader",(function(){return xn})),r.d(a,"UPCReader",(function(){return _n}));var u=r(9),c=r.n(u),s=r(15),f=r.n(s),l=(r(141),r(80)),d=r.n(l),h=r(2),v=r.n(h),p=r(3),y=r.n(p),g=r(0),x=r.n(g),b="undefined"!=typeof Float32Array?Float32Array:Array,_=Math.random;function m(t){return t>=0?Math.round(t):t%.5==0?Math.floor(t):Math.round(t)}Math.PI,Math.PI;function w(){var t=new b(4);return b!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t}function O(t){var e=new b(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function M(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function C(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t}function R(t,e,r,n){var o=new b(4);return o[0]=t,o[1]=e,o[2]=r,o[3]=n,o}function S(t,e,r,n,o){return t[0]=e,t[1]=r,t[2]=n,t[3]=o,t}function A(t,e){if(t===e){var r=e[1];t[1]=e[2],t[2]=r}else t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3];return t}function E(t,e){var r=e[0],n=e[1],o=e[2],i=e[3],a=r*i-o*n;return a?(a=1/a,t[0]=i*a,t[1]=-n*a,t[2]=-o*a,t[3]=r*a,t):null}function k(t,e){var r=e[0];return t[0]=e[3],t[1]=-e[1],t[2]=-e[2],t[3]=r,t}function j(t){return t[0]*t[3]-t[2]*t[1]}function P(t,e,r){var n=e[0],o=e[1],i=e[2],a=e[3],u=r[0],c=r[1],s=r[2],f=r[3];return t[0]=n*u+i*c,t[1]=o*u+a*c,t[2]=n*s+i*f,t[3]=o*s+a*f,t}function D(t,e,r){var n=e[0],o=e[1],i=e[2],a=e[3],u=Math.sin(r),c=Math.cos(r);return t[0]=n*c+i*u,t[1]=o*c+a*u,t[2]=n*-u+i*c,t[3]=o*-u+a*c,t}function T(t,e,r){var n=e[0],o=e[1],i=e[2],a=e[3],u=r[0],c=r[1];return t[0]=n*u,t[1]=o*u,t[2]=i*c,t[3]=a*c,t}function I(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t}function z(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t}function U(t){return"mat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function N(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]+t[3]*t[3])}function W(t,e,r,n){return t[2]=n[2]/n[0],r[0]=n[0],r[1]=n[1],r[3]=n[3]-t[2]*r[1],[t,e,r]}function F(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}function B(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t}function L(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function V(t,e){var r=t[0],n=t[1],o=t[2],i=t[3],a=e[0],u=e[1],c=e[2],s=e[3];return Math.abs(r-a)<=1e-6*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(n-u)<=1e-6*Math.max(1,Math.abs(n),Math.abs(u))&&Math.abs(o-c)<=1e-6*Math.max(1,Math.abs(o),Math.abs(c))&&Math.abs(i-s)<=1e-6*Math.max(1,Math.abs(i),Math.abs(s))}function q(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}function G(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t}var H=P,X=B;function Q(){var t=new b(2);return b!=Float32Array&&(t[0]=0,t[1]=0),t}function $(t){var e=new b(2);return e[0]=t[0],e[1]=t[1],e}function Y(t,e){var r=new b(2);return r[0]=t,r[1]=e,r}function Z(t,e){return t[0]=e[0],t[1]=e[1],t}function K(t,e,r){return t[0]=e,t[1]=r,t}function J(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t}function tt(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t}function et(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t}function rt(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t}function nt(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t}function ot(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t}function it(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t}function at(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t}function ut(t,e){return t[0]=m(e[0]),t[1]=m(e[1]),t}function ct(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t}function st(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t}function ft(t,e){var r=e[0]-t[0],n=e[1]-t[1];return Math.sqrt(r*r+n*n)}function lt(t,e){var r=e[0]-t[0],n=e[1]-t[1];return r*r+n*n}function dt(t){var e=t[0],r=t[1];return Math.sqrt(e*e+r*r)}function ht(t){var e=t[0],r=t[1];return e*e+r*r}function vt(t,e){return t[0]=-e[0],t[1]=-e[1],t}function pt(t,e){return t[0]=1/e[0],t[1]=1/e[1],t}function yt(t,e){var r=e[0],n=e[1],o=r*r+n*n;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t}function gt(t,e){return t[0]*e[0]+t[1]*e[1]}function xt(t,e,r){var n=e[0]*r[1]-e[1]*r[0];return t[0]=t[1]=0,t[2]=n,t}function bt(t,e,r,n){var o=e[0],i=e[1];return t[0]=o+n*(r[0]-o),t[1]=i+n*(r[1]-i),t}function _t(t,e){e=void 0===e?1:e;var r=2*_()*Math.PI;return t[0]=Math.cos(r)*e,t[1]=Math.sin(r)*e,t}function mt(t,e,r){var n=e[0],o=e[1];return t[0]=r[0]*n+r[2]*o,t[1]=r[1]*n+r[3]*o,t}function wt(t,e,r){var n=e[0],o=e[1];return t[0]=r[0]*n+r[2]*o+r[4],t[1]=r[1]*n+r[3]*o+r[5],t}function Ot(t,e,r){var n=e[0],o=e[1];return t[0]=r[0]*n+r[3]*o+r[6],t[1]=r[1]*n+r[4]*o+r[7],t}function Mt(t,e,r){var n=e[0],o=e[1];return t[0]=r[0]*n+r[4]*o+r[12],t[1]=r[1]*n+r[5]*o+r[13],t}function Ct(t,e,r,n){var o=e[0]-r[0],i=e[1]-r[1],a=Math.sin(n),u=Math.cos(n);return t[0]=o*u-i*a+r[0],t[1]=o*a+i*u+r[1],t}function Rt(t,e){var r=t[0],n=t[1],o=e[0],i=e[1];return Math.abs(Math.atan2(n*o-r*i,r*o+n*i))}function St(t,e){var r=t[0],n=t[1],o=e[0],i=e[1];return Math.atan2(r*i-n*o,r*o+n*i)}function At(t){return t[0]=0,t[1]=0,t}function Et(t){return"vec2("+t[0]+", "+t[1]+")"}function kt(t,e){return t[0]===e[0]&&t[1]===e[1]}function jt(t,e){var r=t[0],n=t[1],o=e[0],i=e[1];return Math.abs(r-o)<=1e-6*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))}var Pt,Dt=dt,Tt=tt,It=et,zt=rt,Ut=ft,Nt=lt,Wt=ht,Ft=(Pt=Q(),function(t,e,r,n,o,i){var a,u;for(e||(e=2),r||(r=0),u=n?Math.min(n*e+r,t.length):t.length,a=r;a0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t}function fe(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function le(t,e,r){var n=e[0],o=e[1],i=e[2],a=r[0],u=r[1],c=r[2];return t[0]=o*c-i*u,t[1]=i*a-n*c,t[2]=n*u-o*a,t}function de(t,e,r,n){var o=e[0],i=e[1],a=e[2];return t[0]=o+n*(r[0]-o),t[1]=i+n*(r[1]-i),t[2]=a+n*(r[2]-a),t}function he(t,e,r,n){var o=Math.acos(Math.min(Math.max(fe(e,r),-1),1)),i=Math.sin(o),a=Math.sin((1-n)*o)/i,u=Math.sin(n*o)/i;return t[0]=a*e[0]+u*r[0],t[1]=a*e[1]+u*r[1],t[2]=a*e[2]+u*r[2],t}function ve(t,e,r,n,o,i){var a=i*i,u=a*(2*i-3)+1,c=a*(i-2)+i,s=a*(i-1),f=a*(3-2*i);return t[0]=e[0]*u+r[0]*c+n[0]*s+o[0]*f,t[1]=e[1]*u+r[1]*c+n[1]*s+o[1]*f,t[2]=e[2]*u+r[2]*c+n[2]*s+o[2]*f,t}function pe(t,e,r,n,o,i){var a=1-i,u=a*a,c=i*i,s=u*a,f=3*i*u,l=3*c*a,d=c*i;return t[0]=e[0]*s+r[0]*f+n[0]*l+o[0]*d,t[1]=e[1]*s+r[1]*f+n[1]*l+o[1]*d,t[2]=e[2]*s+r[2]*f+n[2]*l+o[2]*d,t}function ye(t,e){e=void 0===e?1:e;var r=2*_()*Math.PI,n=2*_()-1,o=Math.sqrt(1-n*n)*e;return t[0]=Math.cos(r)*o,t[1]=Math.sin(r)*o,t[2]=n*e,t}function ge(t,e,r){var n=e[0],o=e[1],i=e[2],a=r[3]*n+r[7]*o+r[11]*i+r[15];return a=a||1,t[0]=(r[0]*n+r[4]*o+r[8]*i+r[12])/a,t[1]=(r[1]*n+r[5]*o+r[9]*i+r[13])/a,t[2]=(r[2]*n+r[6]*o+r[10]*i+r[14])/a,t}function xe(t,e,r){var n=e[0],o=e[1],i=e[2];return t[0]=n*r[0]+o*r[3]+i*r[6],t[1]=n*r[1]+o*r[4]+i*r[7],t[2]=n*r[2]+o*r[5]+i*r[8],t}function be(t,e,r){var n=r[0],o=r[1],i=r[2],a=r[3],u=e[0],c=e[1],s=e[2],f=o*s-i*c,l=i*u-n*s,d=n*c-o*u;return f+=f,l+=l,d+=d,t[0]=u+a*f+o*d-i*l,t[1]=c+a*l+i*f-n*d,t[2]=s+a*d+n*l-o*f,t}function _e(t,e,r,n){var o=[],i=[];return o[0]=e[0]-r[0],o[1]=e[1]-r[1],o[2]=e[2]-r[2],i[0]=o[0],i[1]=o[1]*Math.cos(n)-o[2]*Math.sin(n),i[2]=o[1]*Math.sin(n)+o[2]*Math.cos(n),t[0]=i[0]+r[0],t[1]=i[1]+r[1],t[2]=i[2]+r[2],t}function me(t,e,r,n){var o=[],i=[];return o[0]=e[0]-r[0],o[1]=e[1]-r[1],o[2]=e[2]-r[2],i[0]=o[2]*Math.sin(n)+o[0]*Math.cos(n),i[1]=o[1],i[2]=o[2]*Math.cos(n)-o[0]*Math.sin(n),t[0]=i[0]+r[0],t[1]=i[1]+r[1],t[2]=i[2]+r[2],t}function we(t,e,r,n){var o=[],i=[];return o[0]=e[0]-r[0],o[1]=e[1]-r[1],o[2]=e[2]-r[2],i[0]=o[0]*Math.cos(n)-o[1]*Math.sin(n),i[1]=o[0]*Math.sin(n)+o[1]*Math.cos(n),i[2]=o[2],t[0]=i[0]+r[0],t[1]=i[1]+r[1],t[2]=i[2]+r[2],t}function Oe(t,e){var r=t[0],n=t[1],o=t[2],i=e[0],a=e[1],u=e[2],c=Math.sqrt((r*r+n*n+o*o)*(i*i+a*a+u*u)),s=c&&fe(t,e)/c;return Math.acos(Math.min(Math.max(s,-1),1))}function Me(t){return t[0]=0,t[1]=0,t[2]=0,t}function Ce(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"}function Re(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function Se(t,e){var r=t[0],n=t[1],o=t[2],i=e[0],a=e[1],u=e[2];return Math.abs(r-i)<=1e-6*Math.max(1,Math.abs(r),Math.abs(i))&&Math.abs(n-a)<=1e-6*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(o-u)<=1e-6*Math.max(1,Math.abs(o),Math.abs(u))}var Ae=Qt,Ee=$t,ke=Yt,je=oe,Pe=ie,De=Vt,Te=ae,Ie=function(){var t=Bt();return function(e,r,n,o,i,a){var u,c;for(r||(r=3),n||(n=0),c=o?Math.min(o*r+n,e.length):e.length,u=n;ut[e]&&(e=r);return e},Ne=function(t){for(var e=t.length,r=0;e--;)r+=t[e];return r},We=function(t,e){var r=[],n={rad:0,vec:o.clone([0,0])},i={};function a(t){i[t.id]=t,r.push(t)}function u(){var t,e=0;for(t=0;te},getPoints:function(){return r},getCenter:function(){return n}}},Fe=function(t,e,r){return{rad:t[r],point:t,id:e}};function Be(t,e){return{x:t,y:e,toVec2:function(){return o.clone([this.x,this.y])},toVec3:function(){return i.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}}}function Le(t,e){e||(e=8);for(var r=t.data,n=r.length,o=8-e,i=new Int32Array(1<>o]++;return i}function Ve(t,e){var r=function(t){var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,n=8-r;function o(t,r){for(var n=0,o=t;o<=r;o++)n+=e[o];return n}function i(t,r){for(var n=0,o=t;o<=r;o++)n+=o*e[o];return n}function a(){var n,a,u,c,s=[0],f=(1<1&&void 0!==arguments[1]?arguments[1]:[0,0,0],r=t[0],n=t[1],o=t[2],i=o*n,a=i*(1-Math.abs(r/60%2-1)),u=o-i,c=0,s=0,f=0;return r<60?(c=i,s=a):r<120?(c=a,s=i):r<180?(s=i,f=a):r<240?(s=a,f=i):r<300?(c=a,f=i):r<360&&(c=i,f=a),e[0]=255*(c+u)|0,e[1]=255*(s+u)|0,e[2]=255*(f+u)|0,e}function He(t){if(!Number.isFinite(t)||t<1)return[];for(var e=[],r=[],n=Math.sqrt(t),o=1;o<=n;o++)t%o==0&&(r.push(o),o!==t/o&&e.unshift(Math.floor(t/o)));return r.concat(e)}function Xe(t,e){var r,n=He(e.x),o=He(e.y),i=Math.max(e.x,e.y),a=function(t,e){for(var r=0,n=0,o=[];re[n]?n++:r++;return o}(n,o),u=[8,10,15,20,32,60,80],c={"x-small":5,small:4,medium:3,large:2,"x-large":1},s=c[t]||c.medium,f=u[s],l=Math.floor(i/f);function d(t){for(var e=0,r=t[Math.floor(t.length/2)];e0&&(r=Math.abs(t[e]-l)>Math.abs(t[e-1]-l)?t[e-1]:t[e]),l/ru[s-1]/u[s]?{x:r,y:r}:null}return(r=d(a))||(r=d(He(i)))||(r=d(He(l*f))),r||(r={x:Math.max(1,e.x),y:Math.max(1,e.y)}),r}var Qe={top:function(t,e){return"%"===t.unit?Math.floor(e.height*(t.value/100)):null},right:function(t,e){return"%"===t.unit?Math.floor(e.width-e.width*(t.value/100)):null},bottom:function(t,e){return"%"===t.unit?Math.floor(e.height-e.height*(t.value/100)):null},left:function(t,e){return"%"===t.unit?Math.floor(e.width*(t.value/100)):null}};function $e(t,e,r){var n={width:t,height:e},o=Object.keys(r).reduce((function(t,e){if(!Qe[e])return t;var o=function(t){return{value:parseFloat(t),unit:(t.indexOf("%"),t.length,"%")}}(r[e]),i=Qe[e](o,n);return t[e]=i,t}),{});return{sx:o.left,sy:o.top,sw:o.right-o.left,sh:o.bottom-o.top}}function Ye(t){if(t<0)throw new Error("expected positive number, received ".concat(t))}var Ze=function(){return y()((function t(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Uint8Array,o=arguments.length>3?arguments[3]:void 0;v()(this,t),x()(this,"data",void 0),x()(this,"size",void 0),x()(this,"indexMapping",void 0),r?this.data=r:(this.data=new n(e.x*e.y),o&&ze(this.data,0)),this.size=e}),[{key:"inImageWithBorder",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return Ye(e),t.x>=0&&t.y>=0&&t.x0&&((u=p[n-1]).m00+=1,u.m01+=r,u.m10+=e,u.m11+=e*r,u.m02+=i,u.m20+=e*e);for(a=0;a=0?x:-x)+g,u.theta=(180*l/g+90)%180-90,u.theta<0&&(u.theta+=180),u.rad=l>g?l-g:l,u.vec=o.clone([Math.cos(l),Math.sin(l)]),y.push(u));return y}},{key:"getAsRGBA",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=new Uint8ClampedArray(4*this.size.x*this.size.y),r=0;r1&&void 0!==arguments[1]?arguments[1]:1;console.warn("* imagewrapper show getcontext 2d");var r=t.getContext("2d");if(!r)throw new Error("Unable to get canvas context");var n=r.getImageData(0,0,t.width,t.height),o=this.getAsRGBA(e);t.width=this.size.x,t.height=this.size.y;var i=new ImageData(o,n.width,n.height);r.putImageData(i,0,0)}},{key:"overlay",value:function(t,e,r){var n=e<0||e>360?360:e,o=[0,1,1],i=[0,0,0],a=[255,255,255],u=[0,0,0];console.warn("* imagewrapper overlay getcontext 2d");var c=t.getContext("2d");if(!c)throw new Error("Unable to get canvas context");for(var s=c.getImageData(r.x,r.y,this.size.x,this.size.y),f=s.data,l=this.data.length;l--;){o[0]=this.data[l]*n;var h=4*l,v=o[0]<=0?a:o[0]>=360?u:Ge(o,i),p=d()(v,3);f[h]=p[0],f[h+1]=p[1],f[h+2]=p[2],f[h+3]=255}c.putImageData(s,r.x,r.y)}}])}(),Ke=r(7),Je=r.n(Ke),tr=r(6),er=r.n(tr),rr={drawRect:function(t,e,r,n){r.strokeStyle=n.color,r.fillStyle=n.color,r.lineWidth=n.lineWidth||1,r.beginPath(),r.strokeRect(t.x,t.y,e.x,e.y)},drawPath:function(t,e,r,n){r.strokeStyle=n.color,r.fillStyle=n.color,r.lineWidth=n.lineWidth,r.beginPath(),r.moveTo(t[0][e.x],t[0][e.y]);for(var o=1;o1&&void 0!==arguments[1]?arguments[1]:0,r=e;r2&&void 0!==arguments[2]?arguments[2]:this.SINGLE_CODE_ERROR||1,n=0,o=0,i=0,a=0,u=0,c=0,s=0,f=0;fr)return Number.MAX_VALUE;n+=o}return n/a}},{key:"_nextSet",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=e;r1&&(t[r[n]]=o)}},{key:"decodePattern",value:function(t){this._row=t;var e=this.decode();return null===e?(this._row.reverse(),(e=this.decode())&&(e.direction=sr.Reverse,e.start=this._row.length-e.start,e.end=this._row.length-e.end)):e.direction=sr.Forward,e&&(e.format=this.FORMAT),e}},{key:"_matchRange",value:function(t,e,r){var n;for(n=t=t<0?0:t;n0&&void 0!==arguments[0]?arguments[0]:this._nextUnset(this._row),e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._row.length,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=[],o=0;n[o]=0;for(var i=t;i2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=[],i=0,a={error:Number.MAX_VALUE,code:-1,start:0,end:0},u=0,c=0,s=this.AVG_CODE_ERROR;e||(e=this._nextSet(this._row));for(var f=0;f=0&&this._matchRange(n,t.start,0))return t;e=t.end,t=null}return t}},{key:"_verifyTrailingWhitespace",value:function(t){var e=t.end+(t.end-t.start)/2;return en&&(n=o),othis._counters.length)return-1;for(var r=this._computeAlternatingThreshold(t,e),n=this._computeAlternatingThreshold(t+1,e),o=64,i=0,a=0,u=0;u<7;u++)i=0==(1&u)?r:n,this._counters[t+u]>i&&(a|=o),o>>=1;return a}},{key:"_isStartEnd",value:function(t){for(var e=0;e=this._calculatePatternLength(t)/2)&&(e+8>=this._counters.length||this._counters[e+7]>=this._calculatePatternLength(e)/2)}},{key:"_charToPattern",value:function(t){for(var e=t.charCodeAt(0),r=0;r=0;a--){var u=2==(1&a)?n.bar:n.space,c=1==(1&r)?u.wide:u.narrow;c.size+=this._counters[o+a],c.counts++,r>>=1}o+=8}return["space","bar"].forEach((function(t){var e=n[t];e.wide.min=Math.floor((e.narrow.size/e.narrow.counts+e.wide.size/e.wide.counts)/2),e.narrow.max=Math.ceil(e.wide.min),e.wide.max=Math.ceil((2*e.wide.size+1.5)/e.wide.counts)})),n}},{key:"_validateResult",value:function(t,e){for(var r,n=this._thresholdResultPattern(t,e),o=e,i=0;i=0;a--){var u=0==(1&a)?n.bar:n.space,c=1==(1&r)?u.wide:u.narrow,s=this._counters[o+a];if(sc.max)return!1;r>>=1}o+=8}return!0}},{key:"decode",value:function(t,e){if(this._counters=this._fillCounters(),!(e=this._findStart()))return null;var r,n=e.startCounter,o=[];do{if((r=this._toPattern(n))<0)return null;var i=this._patternToChar(r);if(null===i)return null;if(o.push(i),n+=8,o.length>1&&this._isStartEnd(r))break}while(nthis._counters.length?this._counters.length:n;var a=e.start+this._sumCounters(e.startCounter,n-8);return{code:o.join(""),start:e.start,end:a,startInfo:e,decodedCodes:o,format:this.FORMAT}}}])}(lr);function Or(t,e,r){return e=ar()(e),or()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,r||[],ar()(t).constructor):e.apply(t,r))}var Mr=function(t){function e(){var t;v()(this,e);for(var r=arguments.length,n=new Array(r),o=0;othis.AVG_CODE_ERROR?null:(this.CODE_PATTERN[r.code]&&(r.correction.bar=this.calculateCorrection(this.CODE_PATTERN[r.code],n,this.MODULE_INDICES.bar),r.correction.space=this.calculateCorrection(this.CODE_PATTERN[r.code],n,this.MODULE_INDICES.space)),r)}n[++a]=1,i=!i}return null}},{key:"_correct",value:function(t,e){this._correctBars(t,e.bar,this.MODULE_INDICES.bar),this._correctBars(t,e.space,this.MODULE_INDICES.space)}},{key:"_findStart",value:function(){for(var t=[0,0,0,0,0,0],e=this._nextSet(this._row),r={error:Number.MAX_VALUE,code:-1,start:0,end:0,correction:{bar:1,space:1}},n=!1,o=0,i=e;i3;){r=this._findNextWidth(t,r),n=0;for(var i=0,a=0;ar&&(i|=1<0;u++)if(t[u]>r&&(n--,2*t[u]>=o))return-1;return i}}return-1}},{key:"_findNextWidth",value:function(t,e){for(var r=Number.MAX_VALUE,n=0;ne&&(r=t[n]);return r}},{key:"_patternToChar",value:function(t){for(var e=0;e=n}},{key:"decode",value:function(){var t=new Uint16Array([0,0,0,0,0,0,0,0,0]),e=[],r=this._findStart();if(!r)return null;var n,o,i=this._nextSet(this._row,r.end);do{t=this._toCounters(i,t);var a=this._toPattern(t);if(a<0)return null;if(null===(n=this._patternToChar(a)))return null;e.push(n),o=i,i+=Ne(t),i=this._nextSet(this._row,i)}while("*"!==n);return e.pop(),e.length&&this._verifyTrailingWhitespace(o,i,t)?{code:e.join(""),start:r.start,end:i,startInfo:r,decodedCodes:e,format:this.FORMAT}:null}}])}(lr);function Dr(t,e,r){return e=ar()(e),or()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,r||[],ar()(t).constructor):e.apply(t,r))}var Tr=/[AEIO]/g,Ir=function(t){function e(){var t;v()(this,e);for(var r=arguments.length,n=new Array(r),o=0;o4)return-1;if(0==(1&o))for(var a=0;a="a"&&o<="d"){if(n>e-2)return null;var i=t[++n],a=i.charCodeAt(0),u=void 0;switch(o){case"a":if(!(i>="A"&&i<="Z"))return null;u=String.fromCharCode(a-64);break;case"b":if(i>="A"&&i<="E")u=String.fromCharCode(a-38);else if(i>="F"&&i<="J")u=String.fromCharCode(a-11);else if(i>="K"&&i<="O")u=String.fromCharCode(a+16);else if(i>="P"&&i<="S")u=String.fromCharCode(a+43);else{if(!(i>="T"&&i<="Z"))return null;u=String.fromCharCode(127)}break;case"c":if(i>="A"&&i<="O")u=String.fromCharCode(a-32);else{if("Z"!==i)return null;u=":"}break;case"d":if(!(i>="A"&&i<="Z"))return null;u=String.fromCharCode(a+32);break;default:return console.warn("* code_93_reader _decodeExtended hit default case, this may be an error",u),null}r.push(u)}else r.push(o)}return r}},{key:"_matchCheckChar",value:function(t,e,r){var n=t.slice(0,e),o=n.length,i=n.reduce((function(t,e,n){return t+((-1*n+(o-1))%r+1)*Br.indexOf(e.charCodeAt(0))}),0);return Br[i%47]===t[e].charCodeAt(0)}},{key:"_verifyChecksums",value:function(t){return this._matchCheckChar(t,t.length-2,20)&&this._matchCheckChar(t,t.length-1,15)}},{key:"decode",value:function(t,e){if(!(e=this._findStart()))return null;var r,n,o=new Uint16Array([0,0,0,0,0,0]),i=[],a=this._nextSet(this._row,e.end);do{o=this._toCounters(a,o);var u=this._toPattern(o);if(u<0)return null;if(null===(n=this._patternToChar(u)))return null;i.push(n),r=a,a+=Ne(o),a=this._nextSet(this._row,a)}while("*"!==n);return i.pop(),i.length&&this._verifyEnd(r,a)&&this._verifyChecksums(i)?(i=i.slice(0,i.length-2),null===(i=this._decodeExtended(i))?null:{code:i.join(""),start:e.start,end:a,startInfo:e,decodedCodes:i,format:this.FORMAT}):null}}])}(lr);function qr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Gr(t){for(var e=1;e.48?null:o}r[++a]=1,i=!i}return null}},{key:"_findStart",value:function(){for(var t=this._nextSet(this._row),e=null;!e;){if(!(e=this._findPattern(Xr,t,!1,!0)))return null;var r=e.start-(e.end-e.start);if(r>=0&&this._matchRange(r,e.start,0))return e;t=e.end,e=null}return null}},{key:"_calculateFirstDigit",value:function(t){for(var e=0;e=10?(n.code-=10,o|=1<<5-i):o|=0<<5-i,e.push(n.code),r.push(n)}var a=this._calculateFirstDigit(o);if(null===a)return null;e.unshift(a);var u=this._findPattern(Qr,n.end,!0,!1);if(null===u||!u.end)return null;r.push(u);for(var c=0;c<6;c++){if(!(u=this._decodeCode(u.end,10)))return null;r.push(u),e.push(u.code)}return u}},{key:"_verifyTrailingWhitespace",value:function(t){var e=t.end+(t.end-t.start);return e=0;r-=2)e+=t[r];e*=3;for(var n=t.length-1;n>=0;n-=2)e+=t[n];return e%10==0}},{key:"_decodeExtensions",value:function(t){var e=this._nextSet(this._row,t),r=this._findPattern($r,e,!1,!1);if(null===r)return null;for(var n=0;n0){var u=this._decodeExtensions(a.end);if(!u)return null;if(!u.decodedCodes)return null;var c=u.decodedCodes[u.decodedCodes.length-1],s={start:c.start+((c.end-c.start)/2|0),end:c.end};if(!this._verifyTrailingWhitespace(s))return null;o={supplement:u,code:r.join("")+u.code}}return Gr(Gr({code:r.join(""),start:i.start,end:a.end,startInfo:i,decodedCodes:n},o),{},{format:this.FORMAT})}}])}(lr);function Jr(t,e,r){return e=ar()(e),or()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,r||[],ar()(t).constructor):e.apply(t,r))}var tn=function(t){function e(){var t;v()(this,e);for(var r=arguments.length,n=new Array(r),o=0;o=10&&(r|=1<<1-c),1!==c&&(n=this._nextSet(this._row,u.end),n=this._nextUnset(this._row,n))}if(2!==i.length||parseInt(i.join(""))%4!==r)return null;var s=this._findStart();return{code:i.join(""),decodedCodes:a,end:u.end,format:this.FORMAT,startInfo:s,start:s.start}}}])}(Kr);function en(t,e,r){return e=ar()(e),or()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,r||[],ar()(t).constructor):e.apply(t,r))}var rn=[24,20,18,17,12,6,3,10,9,5];var nn=function(t){function e(){var t;v()(this,e);for(var r=arguments.length,n=new Array(r),o=0;o=10&&(r|=1<<4-c),4!==c&&(n=this._nextSet(this._row,i.end),n=this._nextUnset(this._row,n))}if(5!==a.length)return null;if(function(t){for(var e=t.length,r=0,n=e-2;n>=0;n-=2)r+=t[n];r*=3;for(var o=e-1;o>=0;o-=2)r+=t[o];return(r*=3)%10}(a)!==function(t){for(var e=0;e<10;e++)if(t===rn[e])return e;return null}(r))return null;var s=this._findStart();return{code:a.join(""),decodedCodes:u,end:i.end,format:this.FORMAT,startInfo:s,start:s.start}}}])}(Kr);function on(t,e,r){return e=ar()(e),or()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,r||[],ar()(t).constructor):e.apply(t,r))}var an=function(t){function e(){var t;v()(this,e);for(var r=arguments.length,n=new Array(r),o=0;o2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=new Array(t.length).fill(0),i=0,a={error:Number.MAX_VALUE,start:0,end:0},u=this.AVG_CODE_ERROR;r=r||!1,n=n||!1,e||(e=this._nextSet(this._row));for(var c=e;c=0&&this._matchRange(t,r.start,0))return r;e=r.end,r=null}return null}},{key:"_verifyTrailingWhitespace",value:function(t){var e=t.end+(t.end-t.start)/2;return e=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function fn(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r0&&void 0!==arguments[0]?arguments[0]:{};return v()(this,e),t=ln(this,e,[r]),x()(t,"FORMAT","pharmacode"),x()(t,"SINGLE_CODE_ERROR",.7),x()(t,"AVG_CODE_ERROR",.48),t}return cr()(e,t),y()(e,[{key:"_findStart",value:function(){for(var t=0;t=this._row.length)return null;for(var r=e;r=this._row.length)t=r+1;else{if(!(a-r>i))return{start:e,end:r};t=r+1}}else t=r+1}}return null}},{key:"_smoothBarWidths",value:function(t){if(t.length<=2)return t;for(var e=t.slice(),r=1;r0&&a<=3&&(e[r]=i)}return e}},{key:"_extractBarsAndSpaces",value:function(t){for(var e=[],r=[],n=t,o=0,i=!1;n=this._row.length)return null;r.push(o);for(var a=6*(e[0]=a){i=!0,n=c;break}if(e.length>=2&&o>=u){i=!0,n=c;break}if(n>=this._row.length){i=!0,n=c;break}if(r.push(o),r.length>=2)u=2*(r.reduce((function(t,e){return t+e}),0)/r.length)}return i?e.length<2||e.length>16||r.length!==e.length-1?null:this._validateSpaces(r)&&this._validateBarSizeCount(e)?{bars:this._smoothBarWidths(e),spaces:r,end:n}:null:null}},{key:"_validateBarSizeCount",value:function(t){if(0===t.length)return!1;var e,r=[],n=sn(t);try{for(n.s();!(e=n.n()).done;){var o,i=e.value,a=!1,u=sn(r);try{for(u.s();!(o=u.n()).done;){var c=o.value,s=c.reduce((function(t,e){return t+e}),0)/c.length;if(Math.abs(i-s)<=.35*s){c.push(i),a=!0;break}}}catch(t){u.e(t)}finally{u.f()}a||r.push([i])}}catch(t){n.e(t)}finally{n.f()}return!(r.length>2)}},{key:"_validateSpaces",value:function(t){if(0===t.length)return!0;var e=t.reduce((function(t,e){return t+e}),0)/t.length;if(0===e)return!1;var r=t.reduce((function(t,r){return t+Math.pow(r-e,2)}),0)/t.length;return Math.sqrt(r)/e<=.35}},{key:"_validateBarRatios",value:function(t,e){var r=t.reduce((function(t,e){return t+e}),0)/t.length,n=t.reduce((function(t,e){return t+Math.abs(e-r)}),0)/t.length;if((0===r?0:n/r)<=.1){var o=e.length>0?e.reduce((function(t,e){return t+e}),0)/e.length:0;if(o>0)if(o/r<.7)return{narrowWidth:r/2.5,wideRatio:2.5};return{narrowWidth:r,wideRatio:2}}var i=Array.from(new Set(t.slice().sort((function(t,e){return t-e}))));if(i.length<2)return{narrowWidth:t.reduce((function(t,e){return t+e}),0)/t.length,wideRatio:2};for(var a=[],u=0;uR)){var S,A=.15*C.avgN,E=.15*C.avgW,k=!0,j=sn(C.narrowBars);try{for(j.s();!(S=j.n()).done;){var P=S.value;if(Math.abs(P-C.avgN)>A){k=!1;break}}}catch(t){j.e(t)}finally{j.f()}if(k){var D,T=sn(C.wideBars);try{for(T.s();!(D=T.n()).done;){var I=D.value;if(Math.abs(I-C.avgW)>E){k=!1;break}}}catch(t){T.e(t)}finally{T.f()}if(k)return{narrowWidth:C.avgN,wideRatio:C.matchedRatio}}}}return null}},{key:"_validatePeriodicity",value:function(t,e){if(t.length>0){var r=t.reduce((function(t,e){return t+e}),0)/t.length,n=t.reduce((function(t,e){return t+Math.pow(e-r,2)}),0)/t.length,o=Math.sqrt(n);if((0!==r?o/r:0)>.65)return!1}if(e.length>0){var i=e.reduce((function(t,e){return t+e}),0)/e.length,a=e.reduce((function(t,e){return t+Math.pow(e-i,2)}),0)/e.length,u=Math.sqrt(a);if((0!==i?u/i:0)>.55)return!1}return!0}},{key:"_validateQuietZones",value:function(t,e,r){var n=1*e;if(t.start>=2&&t.startr?Math.pow(2,i+1):Math.pow(2,i)}for(var a="",u=o.length-1;u>=0;u--)a+=o[u]>r?"W":"N";return{value:n,pattern:a}}},{key:"_verifyTrailingWhitespace",value:function(t,e){var r=Math.min(t+2*e,this._row.length);return this._matchRange(t,r,0)}},{key:"_validatePatternConsistency",value:function(t,e){for(var r=t.start,n=0,o=0,i=0,a=[-2,-1,1,2];i=this._row.length)){o++;var c=this._extractBarsAndSpaces(u);if(c&&c.bars.length===e.length){for(var s=!0,f=0;f.25){s=!1;break}}s&&n++}}}return o>0&&n>=.5*o}},{key:"decode",value:function(t,e){var r=this._findStart();if(!r)return null;if(r.start>.5*this._row.length)return null;var n=this._extractBarsAndSpaces(r.start);if(!n)return null;var o=n.bars,i=n.spaces,a=n.end;if(o.reduce((function(t,e){return t+e}),0)+i.reduce((function(t,e){return t+e}),0)<20)return null;if(this._row.length-a<0)return null;if(!this._validateSpaces(i))return null;if(!this._validatePeriodicity(o,i))return null;if(!this._validatePatternConsistency(r,o))return null;var u=this._validateBarRatios(o,i);if(!u)return null;if(!this._validateQuietZones(r,u.narrowWidth,a))return null;var c=this._decodeBars(o,u.narrowWidth);if(!c)return null;var s=c.value;if(s<3||s>131070)return null;var f=o.reduce((function(t,e){return t+e}),0)/o.length;this._verifyTrailingWhitespace(a,f);var l=o.map((function(t,e){return{code:t>1.6*Math.min.apply(Math,Ar()(o))?1:0,start:0,end:0,error:0}}));return{code:s.toString(),start:r.start,end:a,startInfo:r,decodedCodes:l,pattern:c.pattern,format:this.FORMAT}}}])}(lr);x()(hn,"adjacentLineValidationMatches",1);var vn=hn;function pn(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function yn(t,e,r){return e=ar()(e),or()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,r||[],ar()(t).constructor):e.apply(t,r))}function gn(t,e,r,n){var o=Rr()(ar()(1&n?t.prototype:t),e,r);return 2&n&&"function"==typeof o?function(t){return o.apply(r,t)}:o}var xn=function(t){function e(){var t;v()(this,e);for(var r=arguments.length,n=new Array(r),o=0;o=10&&(n.code=n.code-10,o|=1<<5-i),e.push(n.code),r.push(n)}return this._determineParity(o,e)?n:null}},{key:"_determineParity",value:function(t,e){for(var r=0;rMath.abs(f-c),h=[],v=t.data,p=t.size.x,y=255,g=0;function x(t,e){u=v[e*p+t],y=ug?u:g,h.push(u)}d&&(i=c,c=s,s=i,i=f,f=l,l=i),c>f&&(i=c,c=f,f=i,i=s,s=l,l=i);var b=f-c,_=Math.abs(l-s);n=b/2|0,o=s;var m=sf?wn.UP:wn.DOWN,l.push({pos:0,val:s[0]}),i=0;id&&s[i+1]>.5*f?wn.UP:n)&&(l.push({pos:i,val:s[i]}),n=o);for(l.push({pos:s.length,val:s[s.length-1]}),a=l[0].pos;af?0:1;for(i=1;il[i].val?l[i].val+(l[i+1].val-l[i].val)/3*2|0:l[i+1].val+(l[i].val-l[i+1].val)/3|0,a=l[i].pos;ad?0:1;return{line:s,threshold:d}},mn.debug={printFrequency:function(t,e){var r,n=e.getContext("2d");for(e.width=t.length,e.height=256,n.beginPath(),n.strokeStyle="blue",r=0;r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function Cn(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r=0&&n[a]instanceof vn&&!function(t,e,r,n){var o=Math.round(t[1].y),i=e.start,a=r.constructor,u=a&&a.adjacentLineValidationMatches||0;if(u<=0)return!0;for(var c=0,s=!1,f=0,l=[1,2,3];f=n.size.y)){var g={x:t[0].x,y:y},x={x:t[1].x,y:y};try{var b=On.getBarcodeLine(n,g,x);On.toBinaryLine(b),r._row=b.line;var _=r._findStart();if(null!==_&&_.start===i&&++c>=u){s=!0;break}}catch(t){}}}}return c>=u}(t,o,n[a],e)?null:{codeResult:o,barcodeLine:i}}function a(t){return u.apply(this,arguments)}function u(){return(u=Je()(er.a.mark((function t(e){var r,o,i,a,u;return er.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=null,o=Mn(n),t.prev=1,o.s();case 2:if((i=o.n()).done){t.next=5;break}if(!(a=i.value).decodeImage){t.next=4;break}return t.next=3,a.decodeImage(e);case 3:if(!(r=t.sent)){t.next=4;break}return t.abrupt("continue",5);case 4:t.next=2;break;case 5:t.next=7;break;case 6:t.prev=6,u=t.catch(1),o.e(u);case 7:return t.prev=7,o.f(),t.finish(7);case 8:return t.abrupt("return",r);case 9:case"end":return t.stop()}}),t,null,[[1,6,7,8]])})))).apply(this,arguments)}function s(t){var n,o;r.overlay;var a=function(t){return Math.sqrt(Math.pow(Math.abs(t[1].y-t[0].y),2)+Math.pow(Math.abs(t[1].x-t[0].x),2))}(n=function(t){return[{x:(t[1][0]-t[0][0])/2+t[0][0],y:(t[1][1]-t[0][1])/2+t[0][1]},{x:(t[3][0]-t[2][0])/2+t[2][0],y:(t[3][1]-t[2][1])/2+t[2][1]}]}(t)),u=Math.atan2(n[1].y-n[0].y,n[1].x-n[0].x);return null===(n=function(t,r,n){function o(e){var n=e*Math.sin(r),o=e*Math.cos(r);t[0].y-=n,t[0].x-=o,t[1].y+=n,t[1].x+=o}for(o(n);n>1&&(!e.inImageWithBorder(t[0])||!e.inImageWithBorder(t[1]));)o(-(n-=Math.ceil(n/2)));return t}(n,u,Math.floor(.1*a)))?null:(null===(o=i(n))&&(o=function(t,e,r){var n,o,a,u=Math.sqrt(Math.pow(t[1][0]-t[0][0],2)+Math.pow(t[1][1]-t[0][1],2)),c=null,s=Math.sin(r),f=Math.cos(r);for(n=1;n<16&&null===c;n++)a={y:(o=u/16*n*(n%2==0?-1:1))*s,x:o*f},e[0].y+=a.x,e[0].x-=a.y,e[1].y+=a.x,e[1].x-=a.y,c=i(e);return c}(t,n,u)),null===o?null:{codeResult:o.codeResult,line:n,angle:u,pattern:o.barcodeLine.line,threshold:o.barcodeLine.threshold})}return o(),{decodeFromBoundingBox:function(t){return s(t)},decodeFromBoundingBoxes:function(e){var r,n,o=[],i=t.multiple;for(r=0;r2&&void 0!==arguments[2]&&arguments[2];n(t,{callback:e,async:r,once:!0})},unsubscribe:function(r,n){if(r){var o=e(r);o.subscribers=o&&n?o.subscribers.filter((function(t){return t.callback!==n})):[]}else t={}}}}(),En=r(81),kn=r.n(En),jn=r(82),Pn=r.n(jn),Dn=r(83);function Tn(t,e,r){return e=ar()(e),or()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,r||[],ar()(t).constructor):e.apply(t,r))}var In=function(t){function e(t,r){var n;return v()(this,e),n=Tn(this,e,[t]),x()(n,"code",void 0),n.code=r,Object.setPrototypeOf(n,e.prototype),n}return cr()(e,t),y()(e,[{key:"toJSON",value:function(){return{name:this.name,message:this.message,code:this.code}}}])}(r.n(Dn)()(Error)),zn="This may mean that the user has declined camera access, or the browser does not support media APIs. If you are running in iOS, you must use Safari.";function Un(){try{return navigator.mediaDevices.enumerateDevices()}catch(e){var t=new In("enumerateDevices is not defined. ".concat(zn),-1);return Promise.reject(t)}}function Nn(t){try{return navigator.mediaDevices.getUserMedia(t)}catch(t){var e=new In("getUserMedia is not defined. ".concat(zn),-1);return Promise.reject(e)}}var Wn,Fn=["deviceId"];function Bn(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Ln(t){for(var e=1;e=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function qn(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r0?t.videoWidth>10&&t.videoHeight>10?e():window.setTimeout(o,500):r(new In("Unable to play video stream. Is webcam working?",-1)),n--}()}))}function Hn(t,e){return Xn.apply(this,arguments)}function Xn(){return(Xn=Je()(er.a.mark((function t(e,r){var n;return er.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=1,Nn(r);case 1:if(n=t.sent,Wn=n,!e){t.next=2;break}return e.setAttribute("autoplay","true"),e.setAttribute("muted","true"),e.setAttribute("playsinline","true"),e.srcObject=n,e.addEventListener("loadedmetadata",(function(){e.play().catch((function(t){console.warn("* Error while trying to play video stream:",t)}))})),t.abrupt("return",Gn(e));case 2:return t.abrupt("return",Promise.resolve());case 3:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Qn(t){var e=Pn()(t,["facing","minAspectRatio","maxAspectRatio"]);return void 0!==t.minAspectRatio&&t.minAspectRatio>0&&(e.aspectRatio=t.minAspectRatio,console.log("WARNING: Constraint 'minAspectRatio' is deprecated; Use 'aspectRatio' instead")),void 0!==t.facing&&(e.facingMode=t.facing,console.log("WARNING: Constraint 'facing' is deprecated. Use 'facingMode' instead'")),e}function $n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=Qn(t);return e&&e.deviceId&&e.facingMode&&delete e.facingMode,Promise.resolve({audio:!1,video:e})}function Yn(){return(Yn=Je()(er.a.mark((function t(e){var r,n,o,i,a,u,c,s,f,l;return er.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=1,Un();case 1:if(r=t.sent,n=r.filter((function(t){return"videoinput"===t.kind})),e){t.next=2;break}return t.abrupt("return",n);case 2:o=[],i=Qn(e),i.deviceId,a=kn()(i,Fn),u=Vn(n),t.prev=3,u.s();case 4:if((c=u.n()).done){t.next=9;break}return s=c.value,t.prev=5,f={audio:!1,video:Ln(Ln({},a),{},{deviceId:{exact:s.deviceId}})},t.next=6,Nn(f);case 6:t.sent.getTracks().forEach((function(t){return t.stop()})),o.push(s),t.next=8;break;case 7:t.prev=7,t.catch(5);case 8:t.next=4;break;case 9:t.next=11;break;case 10:t.prev=10,l=t.catch(3),u.e(l);case 11:return t.prev=11,u.f(),t.finish(11);case 12:return t.abrupt("return",o);case 13:case"end":return t.stop()}}),t,null,[[3,10,11,12],[5,7]])})))).apply(this,arguments)}function Zn(){if(!Wn)return null;var t=Wn.getVideoTracks();return t&&null!=t&&t.length?t[0]:null}var Kn={requestedVideoElement:null,request:function(t,e){return Je()(er.a.mark((function r(){var n;return er.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return Kn.requestedVideoElement=t,r.next=1,$n(e);case 1:return n=r.sent,r.abrupt("return",Hn(t,n));case 2:case"end":return r.stop()}}),r)})))()},release:function(){var t=Wn&&Wn.getVideoTracks();return null!==Kn.requestedVideoElement&&Kn.requestedVideoElement.pause(),new Promise((function(e){setTimeout((function(){t&&t.length&&t.forEach((function(t){return t.stop()})),Wn=null,Kn.requestedVideoElement=null,e()}),0)}))},enumerateVideoDevices:function(t){return Yn.apply(this,arguments)},getActiveStream:function(){var t;return null!==(t=Wn)&&void 0!==t?t:null},getActiveStreamLabel:function(){var t=Zn();return t?t.label:""},getActiveTrack:Zn,disableTorch:function(){return Je()(er.a.mark((function t(){var e,r;return er.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(e=Zn())){t.next=4;break}return t.prev=1,t.next=2,e.applyConstraints({advanced:[{torch:!1}]});case 2:t.next=4;break;case 3:throw t.prev=3,(r=t.catch(1))instanceof OverconstrainedError&&console.warn("quagga2/CameraAccess: Torch not supported on this device"),r;case 4:case"end":return t.stop()}}),t,null,[[1,3]])})))()},enableTorch:function(){return Je()(er.a.mark((function t(){var e,r;return er.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(e=Zn())){t.next=4;break}return t.prev=1,t.next=2,e.applyConstraints({advanced:[{torch:!0}]});case 2:t.next=4;break;case 3:throw t.prev=3,(r=t.catch(1))instanceof OverconstrainedError&&console.warn("quagga2/CameraAccess: Torch not supported on this device"),r;case 4:case"end":return t.stop()}}),t,null,[[1,3]])})))()}},Jn=Kn;var to={create:function(t){var e,r=document.createElement("canvas"),n=r.getContext("2d",{willReadFrequently:!!t.willReadFrequently}),o=[],i=null!==(e=t.capacity)&&void 0!==e?e:20,a=!0===t.capture;function u(e){return!!i&&e&&!function(t,e){return e&&e.some((function(e){return Object.keys(e).every((function(r){return e[r]===t[r]}))}))}(e,t.blacklist)&&function(t,e){return"function"!=typeof e||e(t)}(e,t.filter)}return{addResult:function(t,e,c){var s={};u(c)&&(i--,s.codeResult=c,a&&(r.width=e.x,r.height=e.y,rr.drawImage(t,e,n),s.frame=r.toDataURL()),o.push(s))},getResults:function(){return o}}}},eo={inputStream:{type:"LiveStream",constraints:{width:640,height:480,facingMode:"environment"},area:{top:"0%",right:"0%",left:"0%",bottom:"0%"},singleChannel:!1},locate:!0,canvas:{createOverlay:!0},decoder:{readers:["code_128_reader"]},locator:{halfSample:!0,patchSize:"medium"}},ro=Math.PI/180;var no={};no.create=function(t,e){var r,n={},o=t.getConfig(),i=Be(t.getRealWidth(),t.getRealHeight()),a=t.getCanvasSize(),u=Be(t.getWidth(),t.getHeight()),c=t.getTopRight(),s=c.x,f=c.y,l=null,d=null,h=o.willReadFrequently;function v(t,e,r,n,o){var i=Math.floor(n),a=Math.floor(o),u=Math.min(i+1,e-1),c=Math.min(a+1,r-1),s=n-i,f=o-a;return(t[a*e+i]*(1-s)+t[a*e+u]*s)*(1-f)+(t[c*e+i]*(1-s)+t[c*e+u]*s)*f}return(r=e||document.createElement("canvas")).width=a.x,r.height=a.y,l=r.getContext("2d",{willReadFrequently:!!h}),d=new Uint8Array(u.x*u.y),n.attachData=function(t){d=t},n.getData=function(){return d},n.grab=function(){var e=o.halfSample,n=t.getFrame(),c=n,h=0;if(c){if(function(t,e,r){t.width!==e.x&&(t.width=e.x),t.height!==e.y&&(t.height=e.y)}(r,a,o.debug),"ImageStream"===o.type&&(c=n.img,n.tags&&n.tags.orientation))switch(n.tags.orientation){case 6:h=90*ro;break;case 8:h=-90*ro}if(0!==h?(l.translate(a.x/2,a.y/2),l.rotate(h),l.drawImage(c,-a.y/2,-a.x/2,a.y,a.x),l.rotate(-h),l.translate(-a.x/2,-a.y/2)):l.drawImage(c,0,0,a.x,a.y),e){!function(t,e,r){for(var n,o=0,i=e.x,a=Math.floor(t.length/4),u=e.x/2,c=0,s=e.x;i1&&void 0!==arguments[1]?arguments[1]:ao,r=new DataView(t),n=t.byteLength,o=e.reduce((function(t,e){var r=Object.keys(io).filter((function(t){return io[t]===e}))[0];return r&&(t[r]=e),t}),{}),i=2;if(255!==r.getUint8(0)||216!==r.getUint8(1))return!1;for(;i1&&void 0!==arguments[1]?arguments[1]:ao;return/^blob:/i.test(t)?co(t).then(uo).then((function(t){return so(t,e)})):Promise.resolve(null)}(t,["orientation"]).then((function(t){f[0].tags=t,e(f)})).catch((function(t){console.log(t),e(f)})):e(f))},a=0;a0&&r.forEach((function(r){t.removeEventListener(e,r)}))}))},trigger:function(o,a){var s,f,l,d,h,v=i[o];if("canrecord"===o&&(d=t.videoWidth,h=t.videoHeight,e=null!==(f=n)&&void 0!==f&&f.size?d/h>1?n.size:Math.floor(d/h*n.size):d,r=null!==(l=n)&&void 0!==l&&l.size?d/h>1?Math.floor(h/d*n.size):n.size:h,u.x=e,u.y=r),v&&v.length>0)for(s=0;s0)for(r=0;r1?r.size:Math.floor(n/o*r.size):n,e=null!==(f=r)&&void 0!==f&&f.size?n/o>1?Math.floor(o/n*r.size):r.size:o,p.x=t,p.y=e,u=!0,i=0,setTimeout((function(){y("canrecord",[])}),0)}),1,s,null===(l=r)||void 0===l?void 0:l.sequence,r)},ended:function(){return l},setAttribute:function(){},getConfig:function(){return r},pause:function(){a=!0},play:function(){a=!1},setCurrentTime:function(t){i=t},addEventListener:function(t,e){-1!==d.indexOf(t)&&(h[t]||(h[t]=[]),h[t].push(e))},clearEventHandlers:function(){Object.keys(h).forEach((function(t){return delete h[t]}))},setTopRight:function(t){v.x=t.x,v.y=t.y},getTopRight:function(){return v},setCanvasSize:function(t){p.x=t.x,p.y=t.y},getCanvasSize:function(){return p},getFrame:function(){var t,e;if(!u)return null;a||(t=null===(e=c)||void 0===e?void 0:e[i],i0){a=a-1|0;n[r+a|0]=(n[t+a|0]|0)-(n[e+a|0]|0)|0}}function c(t,e,r){t=t|0;e=e|0;r=r|0;var a=0;a=i(o,o)|0;while((a|0)>0){a=a-1|0;n[r+a|0]=n[t+a|0]|0|(n[e+a|0]|0)|0}}function s(t){t=t|0;var e=0;var r=0;r=i(o,o)|0;while((r|0)>0){r=r-1|0;e=(e|0)+(n[t+r|0]|0)|0}return e|0}function f(t,e){t=t|0;e=e|0;var r=0;r=i(o,o)|0;while((r|0)>0){r=r-1|0;n[t+r|0]=e}}function l(t,e){t=t|0;e=e|0;var r=0;var i=0;var a=0;var u=0;var c=0;var s=0;var f=0;var l=0;for(r=1;(r|0)<(o-1|0);r=r+1|0){l=l+o|0;for(i=1;(i|0)<(o-1|0);i=i+1|0){u=l-o|0;c=l+o|0;s=i-1|0;f=i+1|0;a=(n[t+u+s|0]|0)+(n[t+u+f|0]|0)+(n[t+l+i|0]|0)+(n[t+c+s|0]|0)+(n[t+c+f|0]|0)|0;if((a|0)>(0|0)){n[e+l+i|0]=1}else{n[e+l+i|0]=0}}}}function d(t,e){t=t|0;e=e|0;var r=0;r=i(o,o)|0;while((r|0)>0){r=r-1|0;n[e+r|0]=n[t+r|0]|0}}function h(t){t=t|0;var e=0;var r=0;for(e=0;(e|0)<(o-1|0);e=e+1|0){n[t+e|0]=0;n[t+r|0]=0;r=r+o-1|0;n[t+r|0]=0;r=r+1|0}for(e=0;(e|0)<(o|0);e=e+1|0){n[t+r|0]=0;r=r+1|0}}function v(){var t=0;var e=0;var r=0;var n=0;var v=0;var p=0;e=i(o,o)|0;r=e+e|0;n=r+e|0;f(n,0);h(t);do{a(t,e);l(e,r);u(t,r,r);c(n,r,n);d(e,t);v=s(t)|0;p=(v|0)==0|0}while(!p)}return{skeletonize:v}},Io={ctx:{binary:null},dom:{binary:null}},zo={x:0,y:0};function Uo(t){var e,r,i,a,u,c,s,f=ko.size.x,l=ko.size.y,d=-ko.size.x,h=-ko.size.y;for(e=0,r=0;rd&&(d=a.box[i][0]),a.box[i][1]h&&(h=a.box[i][1]);for(c=[[f,l],[d,l],[d,h],[f,h]],s=wo.halfSample?2:1,u=n.invert(u,u),i=0;i<4;i++)o.transformMat2(c[i],c[i],u);for(i=0;i<4;i++)o.scale(c[i],c[i],s);return c}function No(t){var e=function(t,e,r){var n,o,i,a,u=0,c=0,s=[];for(n=0;nc)for((i=s[u]).score=o,i.item=t[n],c=Number.MAX_VALUE,a=0;a=2){for(i=0;il&&s.push(t[i]);if(s.length>=2){for(u=No(s),a=0,i=0;i1&&u.length>=s.length/4*3&&u.length>t.length/4&&(a/=u.length,c={index:e[1]*zo.x+e[0],pos:{x:r,y:n},box:[o.clone([r,n]),o.clone([r+Co.size.x,n]),o.clone([r+Co.size.x,n+Co.size.y]),o.clone([r,n+Co.size.y])],moments:u,rad:a,vec:o.clone([Math.cos(a),Math.sin(a)])},f.push(c))}}return f}var Bo=function(t,e){wo=e,Po=t,function(){Oo=wo.halfSample?new Ze({x:Po.size.x/2|0,y:Po.size.y/2|0}):Po,jo=Xe(wo.patchSize,Oo.size),zo.x=Oo.size.x/jo.x|0,zo.y=Oo.size.y/jo.y|0,ko=new Ze(Oo.size,void 0,Uint8Array,!1),Ro=new Ze(jo,void 0,Array,!0);var t=jo.x*jo.y*4,e=Math.max(65536,Math.pow(2,Math.ceil(Math.log2(t)))),r=new ArrayBuffer(e);Co=new Ze(jo,new Uint8Array(r,0,jo.x*jo.y)),Mo=new Ze(jo,new Uint8Array(r,jo.x*jo.y*3,jo.x*jo.y),void 0,!0),Do=To({Math:Math,Uint8Array:Uint8Array},{size:jo.x},r),Eo=new Ze({x:Oo.size.x/Co.size.x|0,y:Oo.size.y/Co.size.y|0},void 0,Array,!0),So=new Ze(Eo.size,void 0,void 0,!0),Ao=new Ze(Eo.size,void 0,Int32Array,!0)}(),function(){if(!wo.useWorker&&"undefined"!=typeof document){Io.dom.binary=document.createElement("canvas"),Io.dom.binary.className="binaryBuffer";var t=!!wo.willReadFrequently;0,Io.ctx.binary=Io.dom.binary.getContext("2d",{willReadFrequently:t}),Io.dom.binary.width=ko.size.x,Io.dom.binary.height=ko.size.y}}()},Lo=function(){wo.halfSample&&function(t,e){for(var r=t.data,n=t.size.x,o=e.data,i=0,a=n,u=r.length,c=n/2,s=0;a.95&&u(a):Ao.data[a]=Number.MAX_VALUE}for(ze(So.data,0),ze(Ao.data,0),ze(Eo.data,null),e=0;e0&&n[Ao.data[r]-1]++;return(n=n.map((function(t,e){return{val:t,label:e+1}}))).sort((function(t,e){return e.val-t.val})),n.filter((function(t){return t.val>=5}))}(e);return 0===r.length?null:function(t,e){var r,n,o,i,a=[],u=[];for(r=0;r=t&&n&&n()};if(e)for(var a=0;a0&&void 0!==arguments[0]?arguments[0]:"LiveStream",e=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;switch(t){case"VideoStream":var n=document.createElement("video");return{video:n,inputStream:r.createVideoStream(n)};case"ImageStream":return{inputStream:r.createImageStream()};case"LiveStream":var o=null;return e&&((o=e.querySelector("video"))||(o=document.createElement("video"),e.appendChild(o))),{video:o,inputStream:r.createLiveStream(o)};default:return console.error("* setupInputStream invalid type ".concat(t)),{video:null,inputStream:null}}}(r,this.getViewPort(),xo),i=o.video,a=o.inputStream;"LiveStream"===r&&i&&Jn.request(i,n).then((function(){return a.trigger("canrecord")})).catch((function(e){return t(e)})),a&&(a.setAttribute("preload","auto"),a.setInputStream(this.context.config.inputStream),a.addEventListener("canrecord",this.canRecord.bind(void 0,t))),this.context.inputStream=a}}},{key:"getBoundingBoxes",value:function(){var t;return null!==(t=this.context.config)&&void 0!==t&&t.locate?Lo():[[o.clone(this.context.boxSize[0]),o.clone(this.context.boxSize[1]),o.clone(this.context.boxSize[2]),o.clone(this.context.boxSize[3])]]}},{key:"transformResult",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Set,n=this.context.inputStream.getTopRight(),o=n.x,i=n.y;if((0!==o||0!==i)&&(t.barcodes&&t.barcodes.forEach((function(t){return e.transformResult(t,r)})),t.line&&2===t.line.length&&oi(t.line,o,i),t.box&&!r.has(t.box)&&(ni(t.box,o,i),r.add(t.box)),t.boxes&&t.boxes.length>0))for(var a=0;a0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1?arguments[1]:void 0,o=r;r&&this.context.onUIThread&&(this.transformResult(r),this.addResult(r,n),o=(null==r||null===(e=r.barcodes)||void 0===e?void 0:e.length)>0?r.barcodes:r);An.publish("processed",o),this.hasCodeResult(r)&&An.publish("detected",o);var i=this.context.config;i&&!1===i.locate&&null!==(t=i.inputStream)&&void 0!==t&&t.area&&this.drawScannerArea()}},{key:"locateAndDecode",value:(e=Je()(er.a.mark((function t(){var e,r,n,o,i,a;return er.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(e=this.getBoundingBoxes())){t.next=3;break}return t.next=1,this.context.decoder.decodeFromBoundingBoxes(e);case 1:if(a=t.sent){t.next=2;break}a={};case 2:(n=a).boxes=e,this.publishResult(n,null===(r=this.context.inputImageWrapper)||void 0===r?void 0:r.data),t.next=5;break;case 3:return t.next=4,this.context.decoder.decodeFromImage(this.context.inputImageWrapper);case 4:(o=t.sent)?this.publishResult(o,null===(i=this.context.inputImageWrapper)||void 0===i?void 0:i.data):this.publishResult();case 5:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"startContinuousUpdate",value:function(){var t,e=this,r=null,n=1e3/((null===(t=this.context.config)||void 0===t?void 0:t.frequency)||60);this.context.stopped=!1;var o=this.context,i=function(t){r=r||t,o.stopped||(t>=r&&(r+=n,e.update()),window.requestAnimationFrame(i))};i(performance.now())}},{key:"start",value:function(){var t,e;this.context.onUIThread&&"LiveStream"===(null===(t=this.context.config)||void 0===t||null===(e=t.inputStream)||void 0===e?void 0:e.type)?this.startContinuousUpdate():this.update()}},{key:"stop",value:(t=Je()(er.a.mark((function t(){var e,r;return er.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.context.stopped=!0,this.context.framegrabber||(this.context.initAborted=!0),ri(0),null===(e=this.context.config)||void 0===e||!e.inputStream||"LiveStream"!==this.context.config.inputStream.type){t.next=2;break}return t.next=1,Jn.release();case 1:null===(r=this.context.inputStream)||void 0===r||r.clearEventHandlers();case 2:case"end":return t.stop()}}),t,this)}))),function(){return t.apply(this,arguments)})},{key:"setReaders",value:function(t){this.context.decoder&&this.context.decoder.setReaders(t),function(t){Ko.forEach((function(e){return e.worker.postMessage({cmd:"setReaders",readers:t})}))}(t)}},{key:"registerReader",value:function(t,e){Sn.registerReader(t,e),this.context.decoder&&this.context.decoder.registerReader(t,e),function(t,e){Ko.forEach((function(r){return r.worker.postMessage({cmd:"registerReader",name:t,reader:e})}))}(t,e)}},{key:"drawScannerArea",value:function(){var t,e,r,n=null===(t=this.context.config)||void 0===t||null===(e=t.inputStream)||void 0===e?void 0:e.area;if(n){var o=this.context.canvasContainer.ctx.overlay;if(o)if(!1===(null===(r=this.context.config)||void 0===r?void 0:r.locate))if((void 0!==n.borderColor&&""!==n.borderColor||void 0!==n.borderWidth&&n.borderWidth>0||void 0!==n.backgroundColor&&""!==n.backgroundColor)&&this.context.boxSize){var i=this.context.inputStream.getTopRight(),a=i.x,u=i.y,c=this.context.boxSize,s=c[0],f=c[1],l=c[3],d=s[0]+a,h=s[1]+u,v=l[0]-s[0],p=f[1]-s[1];if(!this._cachedStyleValues||this._cachedStyleValues.borderColor!==n.borderColor||this._cachedStyleValues.borderWidth!==n.borderWidth||this._cachedStyleValues.backgroundColor!==n.backgroundColor){var y,g;this._cachedStyleValues={borderColor:n.borderColor,borderWidth:n.borderWidth,backgroundColor:n.backgroundColor};var x=void 0!==n.borderColor||void 0!==n.borderWidth,b=null!==(y=n.borderColor)&&void 0!==y?y:"rgba(0, 255, 0, 0.5)",_=x?null!==(g=n.borderWidth)&&void 0!==g?g:2:0,m=n.backgroundColor;this._resolvedStyle={color:b,width:_,bg:m}}var w=this._resolvedStyle;w.bg&&(o.fillStyle=w.bg,o.fillRect(d,h,v,p)),w.width>0&&(o.strokeStyle=w.color,o.lineWidth=w.width,o.strokeRect(d,h,v,p))}}}}]);var t,e}(),ai=new ii,ui=ai.context,ci={init:function(t,e,r){var n,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:ai;return e||(n=new Promise((function(t,r){e=function(e){e?r(e):t()}}))),o.context.initAborted=!1,o.context.config=f()({},eo,t),o.context.config.numOfWorkers>0&&(o.context.config.numOfWorkers=0),r?(o.context.onUIThread=!1,o.initializeData(r),e&&e()):o.initInputStream(e),n},start:function(t,e){var r;if(t)return e||(r=new Promise((function(t,r){e=function(e){e?r(e):t()}}))),this.init(t,(function(t){if(t)e(t);else try{ai.start(),e()}catch(t){e(t)}})),r;if(!ui.framegrabber)throw new Error("start() was called before init() completed. Call init() first, or call start(config) to combine init and start.");return ai.start()},stop:function(){return ai.stop()},pause:function(){ui.stopped=!0},onDetected:function(t){t&&("function"==typeof t||"object"===c()(t)&&t.callback)?An.subscribe("detected",t):console.trace("* warning: Quagga.onDetected called with invalid callback, ignoring")},offDetected:function(t){An.unsubscribe("detected",t)},onProcessed:function(t){t&&("function"==typeof t||"object"===c()(t)&&t.callback)?An.subscribe("processed",t):console.trace("* warning: Quagga.onProcessed called with invalid callback, ignoring")},offProcessed:function(t){An.unsubscribe("processed",t)},setReaders:function(t){t?ai.setReaders(t):console.trace("* warning: Quagga.setReaders called with no readers, ignoring")},registerReader:function(t,e){t?e?ai.registerReader(t,e):console.trace("* warning: Quagga.registerReader called with no reader, ignoring"):console.trace("* warning: Quagga.registerReader called with no name, ignoring")},registerResultCollector:function(t){t&&"function"==typeof t.addResult&&(ui.resultCollector=t)},get canvas(){return ui.canvasContainer},drawScannerArea:function(){return ai.drawScannerArea()},decodeSingle:function(t,e){var r=this,n=new ii;return(t=f()({inputStream:{type:"ImageStream",sequence:!1,size:800,src:t.src},numOfWorkers:1,locator:{halfSample:!1}},t)).numOfWorkers>0&&(t.numOfWorkers=0),t.numOfWorkers>0&&("undefined"==typeof Blob||"undefined"==typeof Worker)&&(console.warn("* no Worker and/or Blob support - forcing numOfWorkers to 0"),t.numOfWorkers=0),new Promise((function(o,i){try{r.init(t,(function(){ui.canvasContainer=n.context.canvasContainer,An.once("processed",(function(t){n.stop(),e&&e.call(null,t),o(t)}),!0),n.start()}),null,n)}catch(t){i(t)}}))},get default(){return ci},Readers:a,CameraAccess:Jn,ImageDebug:rr,ImageWrapper:Ze,ResultCollector:to};e.default=ci}]).default})); \ No newline at end of file diff --git a/pages.json b/pages.json index b813f0b..6f964e8 100644 --- a/pages.json +++ b/pages.json @@ -58,7 +58,10 @@ "path": "pages/upload/scan-isbn", "style": { "navigationBarTitleText": "", - "navigationStyle": "custom" + "navigationStyle": "custom", + "app-plus": { + "render": "native" + } } } ], diff --git a/pages/upload/scan-isbn.nvue b/pages/upload/scan-isbn.nvue new file mode 100644 index 0000000..5643eee --- /dev/null +++ b/pages/upload/scan-isbn.nvue @@ -0,0 +1,105 @@ + + + + + diff --git a/pages/upload/scan-isbn.vue b/pages/upload/scan-isbn.vue deleted file mode 100644 index 9a0c2bb..0000000 --- a/pages/upload/scan-isbn.vue +++ /dev/null @@ -1,33 +0,0 @@ - - - - -