You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

3 lines
130 KiB

10 months ago
function o(o,e,r){const t=document.createElement("canvas"),s=t.getContext("2d");return t.width=e,t.height=r,s.drawImage(o,0,0,e,r),s.getImageData(0,0,e,r)}async function e(r){if(r instanceof HTMLImageElement){try{r.decode()}catch(o){throw new DOMException("HTMLImageElement is not decodable","InvalidStateError")}return o(r,r.naturalWidth,r.naturalHeight)}if(r instanceof SVGImageElement)return o(r,640,480);if(r instanceof HTMLVideoElement){const e=1;if(0===r.readyState||r.readyState===e)throw new DOMException("","InvalidStateError");return o(r,r.videoWidth,r.videoHeight)}return r instanceof HTMLCanvasElement?r.getContext("2d").getImageData(0,0,r.width,r.height):r instanceof ImageBitmap?o(r,r.width,r.height):r instanceof OffscreenCanvas?r.getContext("2d").getImageData(0,0,r.width,r.height):r instanceof Blob?async function(o){const r=URL.createObjectURL(o),t=new Image;return t.src=r,await new Promise((o,e)=>{t.onload=o,t.onerror=e}),URL.revokeObjectURL(r),e(t)}(r):r instanceof ImageData?r:void 0}class r extends EventTarget{constructor(o){super(),this.stringUrl=o}postMessage(o,e){void 0===this.worker?(this.worker=new Worker(this.stringUrl),this.worker.onmessage=o=>{this.dispatchEvent(new MessageEvent("message",{data:o.data}))}):self.clearTimeout(this.timeout),this.worker.postMessage(o,e),this.timeout=self.setTimeout(()=>{this.worker.terminate(),this.worker=void 0},2500)}}var t=URL.createObjectURL(new Blob(['\n!function(o){"function"==typeof define&&define.amd?define(o):o()}(function(){function o(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var e,r=o((function(o,e){var r;"undefined"!=typeof self&&self,r=function(){return function(o){var e={};function r(t){if(e[t])return e[t].exports;var c=e[t]={i:t,l:!1,exports:{}};return o[t].call(c.exports,c,c.exports,r),c.l=!0,c.exports}return r.m=o,r.c=e,r.d=function(o,e,t){r.o(o,e)||Object.defineProperty(o,e,{configurable:!1,enumerable:!0,get:t})},r.n=function(o){var e=o&&o.__esModule?function(){return o.default}:function(){return o};return r.d(e,"a",e),e},r.o=function(o,e){return Object.prototype.hasOwnProperty.call(o,e)},r.p="",r(r.s=3)}([function(o,e,r){Object.defineProperty(e,"__esModule",{value:!0});var t=function(){function o(o,e){this.width=e,this.height=o.length/e,this.data=o}return o.createEmpty=function(e,r){return new o(new Uint8ClampedArray(e*r),e)},o.prototype.get=function(o,e){return!(o<0||o>=this.width||e<0||e>=this.height||!this.data[e*this.width+o])},o.prototype.set=function(o,e,r){this.data[e*this.width+o]=r?1:0},o.prototype.setRegion=function(o,e,r,t,c){for(var s=e;s<e+t;s++)for(var a=o;a<o+r;a++)this.set(a,s,!!c)},o}();e.BitMatrix=t},function(o,e,r){Object.defineProperty(e,"__esModule",{value:!0});var t=r(2);e.addOrSubtractGF=function(o,e){return o^e};var c=function(){function o(o,e,r){this.primitive=o,this.size=e,this.generatorBase=r,this.expTable=new Array(this.size),this.logTable=new Array(this.size);for(var c=1,s=0;s<this.size;s++)this.expTable[s]=c,(c*=2)>=this.size&&(c=(c^this.primitive)&this.size-1);for(s=0;s<this.size-1;s++)this.logTable[this.expTable[s]]=s;this.zero=new t.default(this,Uint8ClampedArray.from([0])),this.one=new t.default(this,Uint8ClampedArray.from([1]))}return o.prototype.multiply=function(o,e){return 0===o||0===e?0:this.expTable[(this.logTable[o]+this.logTable[e])%(this.size-1)]},o.prototype.inverse=function(o){if(0===o)throw new Error("Can\'t invert 0");return this.expTable[this.size-this.logTable[o]-1]},o.prototype.buildMonomial=function(o,e){if(o<0)throw new Error("Invalid monomial degree less than 0");if(0===e)return this.zero;var r=new Uint8ClampedArray(o+1);return r[0]=e,new t.default(this,r)},o.prototype.log=function(o){if(0===o)throw new Error("Can\'t take log(0)");return this.logTable[o]},o.prototype.exp=function(o){return this.expTable[o]},o}();e.default=c},function(o,e,r){Object.defineProperty(e,"__esModule",{value:!0});var t=r(1),c=function(){functi
//# sourceMappingURL=barcode-detector.modern.js.map