@idscan/idvc2 2.7.7 → 2.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- (self.webpackChunk_idscan_idvc2=self.webpackChunk_idscan_idvc2||[]).push([[343],{4550:(e,t,r)=>{function n(e,t,r,n,o,i,u){try{var c=e[i](u),a=c.value}catch(e){r(e);return}c.done?t(a):Promise.resolve(a).then(n,o)}function o(e){return function(){var t=this,r=arguments;return new Promise(function(o,i){var u=e.apply(t,r);function c(e){n(u,o,i,c,a,"next",e)}function a(e){n(u,o,i,c,a,"throw",e)}c(void 0)})}}function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){i(e,t,r[t])})}return e}function c(e,t){var r,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(r)throw TypeError("Generator is already executing.");for(;u;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}r.d(t,{o:()=>s});var a="application/javascript",l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=u({skipSameOrigin:!0,useBlob:!0},t);return!e.includes("://")||e.includes(window.location.origin)?Promise.resolve(e):new Promise(function(t,n){return fetch(e).then(function(e){return e.text()}).then(function(n){var o=new URL(e).href.split("/");o.pop();var i="const _importScripts = importScripts;\nconst _fixImports = (url) => new URL(url, '".concat("".concat(o.join("/"),"/"),"').href;\nimportScripts = (...urls) => _importScripts(...urls.map(_fixImports));"),u="data:".concat(a,",").concat(encodeURIComponent(i+n));r.useBlob&&(u=URL.createObjectURL(new Blob(['importScripts("'.concat(u,'")')],{type:a}))),t(u)}).catch(n)})},s=function(){var e=o(function(e){var t;return c(this,function(r){switch(r.label){case 0:return[4,l(e)];case 1:return t=r.sent(),[2,new Worker(t)]}})});return function(t){return e.apply(this,arguments)}}()},5470:(e,t,r)=>{r.r(t),r.d(t,{default:()=>q});var n=r(4328),o=r(1026),i=r(8736),u=r(6955),c=r(813),a=r(683),l=["0","1","2","3","4","*","5","6","7","*","8","9","A","*","B","C","*","D","*","E","*","F","*","G","*","H","I","J","*","K","*","L","*","M","N","O","P","*","Q","R","*","S","T","*","U","*","V","*","W","X","Y","*","Z","<","*"];function s(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function f(e,t,r,n,o,i,u){try{var c=e[i](u),a=c.value}catch(e){r(e);return}c.done?t(a):Promise.resolve(a).then(n,o)}function p(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function u(e){f(i,n,o,u,c,"next",e)}function c(e){f(i,n,o,u,c,"throw",e)}u(void 0)})}}function y(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function h(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function b(e,t,r){return t&&h(e.prototype,t),r&&h(e,r),e}function v(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function m(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&g(e,t)}function w(e,t){return t&&("object"===k(t)||"function"==typeof t)?t:s(e)}function g(e,t){return(g=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function k(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function O(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function P(e){var t=O();return function(){var r,n=d(e);if(t){var o=d(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return w(this,r)}}function j(e,t){var r,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(r)throw TypeError("Generator is already executing.");for(;u;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}var S=784,x=[1,28,28,1],R="input_1",E="dense",A=function(e){"use strict";m(r,e);var t=P(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c.z.WASM,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return y(this,r),v(s(e=t.call(this,n,o,i)),"promiseList",void 0),v(s(e),"predictionList",void 0),e}return b(r,[{key:"predict",value:function(e){var t=v({},R,new i.Tensor("float32",e,x));return this.session.run(t)}},{key:"predictFromArray",value:function(e,t){var r=this;return p(function(){var n,o;return j(this,function(i){switch(i.label){case 0:if(r.promiseList||(r.promiseList=Array(t).fill(0)),r.predictionList||(r.predictionList=Array(t).fill(0)),r.loading)return[2,[]];for(o=0,n=(0,a.Fv)(e,a.eQ.STANDART);o<t;o+=1)r.promiseList[o]=r.predict(n.subarray(S*o,S*(o+1)));return[4,Promise.all(r.promiseList)];case 1:return i.sent().forEach(function(e,t){r.predictionList[t]=r.interpret(e[E].data)}),[2,r.predictionList]}})})()}},{key:"interpret",value:function(e){return Array.from(e).map(function(e,t){return{value:l[t],confidence:e}}).sort(function(e,t){return e.confidence-t.confidence}).slice(-3).reverse()}},{key:"isLoading",get:function(){return this.loading}},{key:"predictFromImage",value:function(e,t){}}]),r}(u.Z),M=r(4554);function _(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function T(e){if(Array.isArray(e))return e}function C(e,t,r,n,o,i,u){try{var c=e[i](u),a=c.value}catch(e){r(e);return}c.done?t(a):Promise.resolve(a).then(n,o)}function I(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function u(e){C(i,n,o,u,c,"next",e)}function c(e){C(i,n,o,u,c,"throw",e)}u(void 0)})}}function L(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function z(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Z(e,t,r){return t&&z(e.prototype,t),r&&z(e,r),e}function B(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function D(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],u=!0,c=!1;try{for(o=o.call(e);!(u=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);u=!0);}catch(e){c=!0,n=e}finally{try{u||null==o.return||o.return()}finally{if(c)throw n}}return i}}function U(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function F(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){B(e,t,r[t])})}return e}function N(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function G(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):N(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}function V(e,t){return T(e)||D(e,t)||W(e,t)||U()}function W(e,t){if(e){if("string"==typeof e)return _(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _(e,t)}}function K(e,t){var r,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(r)throw TypeError("Generator is already executing.");for(;u;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}var Q=function(){"use strict";function e(t,r,n){var o=this;L(this,e),B(this,"w",0),B(this,"h",0),B(this,"successCount",0),B(this,"worker",void 0),B(this,"model",void 0),B(this,"isInitialized",!1),B(this,"isProcessing",!1),B(this,"MIN_MRZ_FRAMES",3),this.model=new A("".concat(M.t.$I),c.z.WASM,n),this.worker=t,this.worker.postMessage({fn:"init",initData:{key:r,networkUrl:n}}),this.worker.onmessage=function(e){var t=e.data,r=t.name,n=t.data;"initialization"===r&&(o.isInitialized=n)}}return Z(e,[{key:"getErrorVal",value:function(e){var t;return -3===e&&(t=0),-2===e&&(t=1),t}},{key:"licenseError",value:function(e){return{error:!0,errorType:"licenceKeyError",errorVal:this.getErrorVal(e)}}},{key:"yComparator",value:function(e,t){return e.y<t.y?[e,t]:[t,e]}},{key:"allocate",value:function(){}},{key:"prepareMRZlocation",value:function(e){var t=[e.leftTop,e.rightTop,e.rightBottom,e.leftBottom].sort(function(e,t){return e.x-t.x}),r=V(this.yComparator(t[0],t[1]),2),n=r[0],o=r[1],i=V(this.yComparator(t[2],t[3]),2),u=i[0],c=i[1];return{leftTop:{x:n.x-.03,y:n.y-.03},rightTop:{x:u.x+.03,y:u.y-.03},rightBottom:{x:c.x+.03,y:c.y+.03},leftBottom:{x:o.x-.03,y:o.y+.03}}}},{key:"writeResults",value:function(e){var t={mrzText:""},r=e.fields.filter(function(e){return -1!==e.name.indexOf("Line")&&e.value.length>0}).map(function(e){return e.value}).join("\n");return r.length>0&&(t.mrzText=window.btoa(r)),t}},{key:"predict",value:function(e,t){var r=this;return I(function(){var n;return K(this,function(o){switch(o.label){case 0:return[4,r.model.predictFromArray(e,t)];case 1:if(!((n=o.sent()).filter(function(e){return"*"===V(e,1)[0].value}).length>3))return[3,3];return[4,r.model.predictFromArray(e.reverse(),t)];case 2:n=o.sent(),o.label=3;case 3:return[2,n]}})})()}},{key:"scan",value:function(e){var t=this;return new Promise(function(r){var n;t.worker.postMessage({fn:"prepare",iData:e}),t.worker.onmessage=(n=I(function(e){var n,o,i,u;return K(this,function(c){switch(c.label){case 0:if(o=(n=e.data).name,i=n.data,"batchArr"!==o)return[3,2];return[4,t.predict(i.batchArr,i.batchSize)];case 1:return u=c.sent(),t.worker.postMessage({fn:"process",predictions:u}),[2];case 2:return"result"===o&&r(i),r(i),[2]}})}),function(e){return n.apply(this,arguments)})})}},{key:"processMRZ",value:function(e){var t=this;return I(function(){var r,n,o,i,u,c,a;return K(this,function(l){switch(l.label){case 0:if(n={status:!1,cancel:!1,touch:!1,image:null,type:"mrz",isSuccessProcess:!1},t.isProcessing||!t.isInitialized)return[2,n];return t.isProcessing=!0,[4,t.scan(e)];case 1:if(null==(o=l.sent())?void 0:o.errorId)return t.isProcessing=!1,[2,G(F({},o),{error:t.licenseError(o.errorId)})];return o&&(null==o?void 0:null===(r=o.status)||void 0===r?void 0:r.value)===0&&(null==o?void 0:o.count)>0?(u=(i=t.estimateResults(o))===o.count&&o.symbolsConf>.95?"green":"yellow",n.coords={locations:t.prepareMRZlocation(o.location),color:u},c=i===o.count&&o.symbolsConf>.85,a=i>=o.count-2,(c||a)&&(t.successCount+=1,n.isSuccessProcess=!0,t.successCount>=t.MIN_MRZ_FRAMES&&(n.status=!0,n.needToCut=!0,n.image=e,n.results=t.writeResults(o)))):(n.coords=null,t.successCount=0),t.isProcessing=!1,[2,n]}})})()}},{key:"estimateResults",value:function(e){return 0===e.count?0:e.fields.reduce(function(e,t){return"Valid"===t.status?e+1:e},0)}},{key:"detectMrz",value:function(e){var t=this;return I(function(){var r,n,o;return K(this,function(i){switch(i.label){case 0:return[4,t.scan(e)];case 1:if(r=i.sent(),n=!0,r&&r.count>0&&r.symbolsConf>.8)return[2,{status:!0,locations:t.prepareMRZlocation(r.location),results:t.writeResults(r),isNotMRZ:n=!1}];return r&&r.symbolsConf>.6&&(n=!1),o={status:!1,isNotMRZ:n},(null==r?void 0:r.errorId)&&(o.error=t.licenseError(r.errorId)),[2,o]}})})()}}]),e}(),$=r(4295),H=r(4550);function J(e,t,r,n,o,i,u){try{var c=e[i](u),a=c.value}catch(e){r(e);return}c.done?t(a):Promise.resolve(a).then(n,o)}function X(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function u(e){J(i,n,o,u,c,"next",e)}function c(e){J(i,n,o,u,c,"throw",e)}u(void 0)})}}function Y(e,t){var r,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(r)throw TypeError("Generator is already executing.");for(;u;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}let q=function(){var e=X(function(e){var t,r,i,u;return Y(this,function(c){switch(c.label){case 0:if(t=e.commonLicenseKey)return[3,1];return(0,$.Z)(),[3,3];case 1:return[4,(0,H.o)("".concat(n.Z.chunkPublicPath,"mrzWorker.js"))];case 2:i=c.sent(),u=new Q(i,t,n.Z.networkUrl),o.Z.setModule("module","mrz",u),r=[u.model.initialize.bind(u.model)],c.label=3;case 3:return[2,r]}})});return function(t){return e.apply(this,arguments)}}()}}]);
1
+ (self.webpackChunk_idscan_idvc2=self.webpackChunk_idscan_idvc2||[]).push([[343],{4550:(e,t,r)=>{function n(e,t,r,n,o,i,u){try{var c=e[i](u),a=c.value}catch(e){r(e);return}c.done?t(a):Promise.resolve(a).then(n,o)}function o(e){return function(){var t=this,r=arguments;return new Promise(function(o,i){var u=e.apply(t,r);function c(e){n(u,o,i,c,a,"next",e)}function a(e){n(u,o,i,c,a,"throw",e)}c(void 0)})}}function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){i(e,t,r[t])})}return e}function c(e,t){var r,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(r)throw TypeError("Generator is already executing.");for(;u;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}r.d(t,{o:()=>s});var a="application/javascript",l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=u({skipSameOrigin:!0,useBlob:!0},t);return!e.includes("://")||e.includes(window.location.origin)?Promise.resolve(e):new Promise(function(t,n){return fetch(e).then(function(e){return e.text()}).then(function(n){var o=new URL(e).href.split("/");o.pop();var i="const _importScripts = importScripts;\nconst _fixImports = (url) => new URL(url, '".concat("".concat(o.join("/"),"/"),"').href;\nimportScripts = (...urls) => _importScripts(...urls.map(_fixImports));"),u="data:".concat(a,",").concat(encodeURIComponent(i+n));r.useBlob&&(u=URL.createObjectURL(new Blob(['importScripts("'.concat(u,'")')],{type:a}))),t(u)}).catch(n)})},s=function(){var e=o(function(e){var t;return c(this,function(r){switch(r.label){case 0:return[4,l(e)];case 1:return t=r.sent(),[2,new Worker(t)]}})});return function(t){return e.apply(this,arguments)}}()},5470:(e,t,r)=>{r.r(t),r.d(t,{default:()=>q});var n=r(4328),o=r(7286),i=r(8736),u=r(6955),c=r(813),a=r(683),l=["0","1","2","3","4","*","5","6","7","*","8","9","A","*","B","C","*","D","*","E","*","F","*","G","*","H","I","J","*","K","*","L","*","M","N","O","P","*","Q","R","*","S","T","*","U","*","V","*","W","X","Y","*","Z","<","*"];function s(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function f(e,t,r,n,o,i,u){try{var c=e[i](u),a=c.value}catch(e){r(e);return}c.done?t(a):Promise.resolve(a).then(n,o)}function p(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function u(e){f(i,n,o,u,c,"next",e)}function c(e){f(i,n,o,u,c,"throw",e)}u(void 0)})}}function y(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function h(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function b(e,t,r){return t&&h(e.prototype,t),r&&h(e,r),e}function v(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function m(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&g(e,t)}function w(e,t){return t&&("object"===k(t)||"function"==typeof t)?t:s(e)}function g(e,t){return(g=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function k(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function O(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function P(e){var t=O();return function(){var r,n=d(e);if(t){var o=d(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return w(this,r)}}function j(e,t){var r,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(r)throw TypeError("Generator is already executing.");for(;u;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}var S=784,x=[1,28,28,1],R="input_1",E="dense",A=function(e){"use strict";m(r,e);var t=P(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c.z.WASM,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return y(this,r),v(s(e=t.call(this,n,o,i)),"promiseList",void 0),v(s(e),"predictionList",void 0),e}return b(r,[{key:"predict",value:function(e){var t=v({},R,new i.Tensor("float32",e,x));return this.session.run(t)}},{key:"predictFromArray",value:function(e,t){var r=this;return p(function(){var n,o;return j(this,function(i){switch(i.label){case 0:if(r.promiseList||(r.promiseList=Array(t).fill(0)),r.predictionList||(r.predictionList=Array(t).fill(0)),r.loading)return[2,[]];for(o=0,n=(0,a.Fv)(e,a.eQ.STANDART);o<t;o+=1)r.promiseList[o]=r.predict(n.subarray(S*o,S*(o+1)));return[4,Promise.all(r.promiseList)];case 1:return i.sent().forEach(function(e,t){r.predictionList[t]=r.interpret(e[E].data)}),[2,r.predictionList]}})})()}},{key:"interpret",value:function(e){return Array.from(e).map(function(e,t){return{value:l[t],confidence:e}}).sort(function(e,t){return e.confidence-t.confidence}).slice(-3).reverse()}},{key:"isLoading",get:function(){return this.loading}},{key:"predictFromImage",value:function(e,t){}}]),r}(u.Z),M=r(4554);function _(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function T(e){if(Array.isArray(e))return e}function C(e,t,r,n,o,i,u){try{var c=e[i](u),a=c.value}catch(e){r(e);return}c.done?t(a):Promise.resolve(a).then(n,o)}function I(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function u(e){C(i,n,o,u,c,"next",e)}function c(e){C(i,n,o,u,c,"throw",e)}u(void 0)})}}function L(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function z(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Z(e,t,r){return t&&z(e.prototype,t),r&&z(e,r),e}function B(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function D(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],u=!0,c=!1;try{for(o=o.call(e);!(u=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);u=!0);}catch(e){c=!0,n=e}finally{try{u||null==o.return||o.return()}finally{if(c)throw n}}return i}}function U(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function F(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){B(e,t,r[t])})}return e}function N(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function G(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):N(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}function V(e,t){return T(e)||D(e,t)||W(e,t)||U()}function W(e,t){if(e){if("string"==typeof e)return _(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _(e,t)}}function K(e,t){var r,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(r)throw TypeError("Generator is already executing.");for(;u;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}var Q=function(){"use strict";function e(t,r,n){var o=this;L(this,e),B(this,"w",0),B(this,"h",0),B(this,"successCount",0),B(this,"worker",void 0),B(this,"model",void 0),B(this,"isInitialized",!1),B(this,"isProcessing",!1),B(this,"MIN_MRZ_FRAMES",3),this.model=new A("".concat(M.t.$I),c.z.WASM,n),this.worker=t,this.worker.postMessage({fn:"init",initData:{key:r,networkUrl:n}}),this.worker.onmessage=function(e){var t=e.data,r=t.name,n=t.data;"initialization"===r&&(o.isInitialized=n)}}return Z(e,[{key:"getErrorVal",value:function(e){var t;return -3===e&&(t=0),-2===e&&(t=1),t}},{key:"licenseError",value:function(e){return{error:!0,errorType:"licenceKeyError",errorVal:this.getErrorVal(e)}}},{key:"yComparator",value:function(e,t){return e.y<t.y?[e,t]:[t,e]}},{key:"allocate",value:function(){}},{key:"prepareMRZlocation",value:function(e){var t=[e.leftTop,e.rightTop,e.rightBottom,e.leftBottom].sort(function(e,t){return e.x-t.x}),r=V(this.yComparator(t[0],t[1]),2),n=r[0],o=r[1],i=V(this.yComparator(t[2],t[3]),2),u=i[0],c=i[1];return{leftTop:{x:n.x-.03,y:n.y-.03},rightTop:{x:u.x+.03,y:u.y-.03},rightBottom:{x:c.x+.03,y:c.y+.03},leftBottom:{x:o.x-.03,y:o.y+.03}}}},{key:"writeResults",value:function(e){var t={mrzText:""},r=e.fields.filter(function(e){return -1!==e.name.indexOf("Line")&&e.value.length>0}).map(function(e){return e.value}).join("\n");return r.length>0&&(t.mrzText=window.btoa(r)),t}},{key:"predict",value:function(e,t){var r=this;return I(function(){var n;return K(this,function(o){switch(o.label){case 0:return[4,r.model.predictFromArray(e,t)];case 1:if(!((n=o.sent()).filter(function(e){return"*"===V(e,1)[0].value}).length>3))return[3,3];return[4,r.model.predictFromArray(e.reverse(),t)];case 2:n=o.sent(),o.label=3;case 3:return[2,n]}})})()}},{key:"scan",value:function(e){var t=this;return new Promise(function(r){var n;t.worker.postMessage({fn:"prepare",iData:e}),t.worker.onmessage=(n=I(function(e){var n,o,i,u;return K(this,function(c){switch(c.label){case 0:if(o=(n=e.data).name,i=n.data,"batchArr"!==o)return[3,2];return[4,t.predict(i.batchArr,i.batchSize)];case 1:return u=c.sent(),t.worker.postMessage({fn:"process",predictions:u}),[2];case 2:return"result"===o&&r(i),r(i),[2]}})}),function(e){return n.apply(this,arguments)})})}},{key:"processMRZ",value:function(e){var t=this;return I(function(){var r,n,o,i,u,c,a;return K(this,function(l){switch(l.label){case 0:if(n={status:!1,cancel:!1,touch:!1,image:null,type:"mrz",isSuccessProcess:!1},t.isProcessing||!t.isInitialized)return[2,n];return t.isProcessing=!0,[4,t.scan(e)];case 1:if(null==(o=l.sent())?void 0:o.errorId)return t.isProcessing=!1,[2,G(F({},o),{error:t.licenseError(o.errorId)})];return o&&(null==o?void 0:null===(r=o.status)||void 0===r?void 0:r.value)===0&&(null==o?void 0:o.count)>0?(u=(i=t.estimateResults(o))===o.count&&o.symbolsConf>.95?"green":"yellow",n.coords={locations:t.prepareMRZlocation(o.location),color:u},c=i===o.count&&o.symbolsConf>.85,a=i>=o.count-2,(c||a)&&(t.successCount+=1,n.isSuccessProcess=!0,t.successCount>=t.MIN_MRZ_FRAMES&&(n.status=!0,n.needToCut=!0,n.image=e,n.results=t.writeResults(o)))):(n.coords=null,t.successCount=0),t.isProcessing=!1,[2,n]}})})()}},{key:"estimateResults",value:function(e){return 0===e.count?0:e.fields.reduce(function(e,t){return"Valid"===t.status?e+1:e},0)}},{key:"detectMrz",value:function(e){var t=this;return I(function(){var r,n,o;return K(this,function(i){switch(i.label){case 0:return[4,t.scan(e)];case 1:if(r=i.sent(),n=!0,r&&r.count>0&&r.symbolsConf>.8)return[2,{status:!0,locations:t.prepareMRZlocation(r.location),results:t.writeResults(r),isNotMRZ:n=!1}];return r&&r.symbolsConf>.6&&(n=!1),o={status:!1,isNotMRZ:n},(null==r?void 0:r.errorId)&&(o.error=t.licenseError(r.errorId)),[2,o]}})})()}}]),e}(),$=r(4295),H=r(4550);function J(e,t,r,n,o,i,u){try{var c=e[i](u),a=c.value}catch(e){r(e);return}c.done?t(a):Promise.resolve(a).then(n,o)}function X(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function u(e){J(i,n,o,u,c,"next",e)}function c(e){J(i,n,o,u,c,"throw",e)}u(void 0)})}}function Y(e,t){var r,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(r)throw TypeError("Generator is already executing.");for(;u;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}let q=function(){var e=X(function(e){var t,r,i,u;return Y(this,function(c){switch(c.label){case 0:if(t=e.commonLicenseKey)return[3,1];return(0,$.Z)(),[3,3];case 1:return[4,(0,H.o)("".concat(n.Z.chunkPublicPath,"mrzWorker.js"))];case 2:i=c.sent(),u=new Q(i,t,n.Z.networkUrl),o.Z.setModule("module","mrz",u),r=[u.model.initialize.bind(u.model)],c.label=3;case 3:return[2,r]}})});return function(t){return e.apply(this,arguments)}}()}}]);
@@ -2,4 +2,4 @@
2
2
  return function ${x(A)}(${a}) {
3
3
  if (arguments.length !== ${E-2}) {
4
4
  throwBindingError('function ${A} called with ${arguments.length} arguments, expected ${E-2} args!');
5
- }`;D&&(t+="var destructors = [];\n");var M=D?"destructors":"null",N=["throwBindingError","invoker","fn","runDestructors","retType","classParam"],F=[AB,B,Q,W,I[0],I[1]];i&&(t+="var thisWired = classParam.toWireType("+M+", this);\n");for(var o=0;o<E-2;++o)t+="var arg"+o+"Wired = argType"+o+".toWireType("+M+", arg"+o+"); // "+I[o+2].name+"\n",N.push("argType"+o),F.push(I[o+2]);if(i&&(s="thisWired"+(s.length>0?", ":"")+s),t+=(w||C?"var rv = ":"")+"invoker(fn"+(s.length>0?", ":"")+s+");\n",D)t+="runDestructors(destructors);\n";else for(var o=i?1:2;o<I.length;++o){var G=1===o?"thisWired":"arg"+(o-2)+"Wired";null!==I[o].destructorFunction&&(t+=G+"_dtor("+G+"); // "+I[o].name+"\n",N.push(G+"_dtor"),F.push(I[o].destructorFunction))}return w&&(t+="var ret = retType.fromWireType(rv);\nreturn ret;\n"),t+="}\n",N.push(t),(function(A,I){if(!(A instanceof Function))throw TypeError(`new_ called with constructor type ${typeof A} which is not a function`);var g=v(A.name||"unknownFunctionName",function(){});g.prototype=A.prototype;var B=new g,Q=A.apply(B,I);return Q instanceof Object?Q:B})(Function,N).apply(null,F)}function Al(A,I){for(var g=[],B=0;B<A;B++)g.push(t[I+4*B>>2]);return g}function AK(A,I,g){return A instanceof Object||AB(`${g} with invalid "this": ${A}`),A instanceof I.registeredClass.constructor||AB(`${g} incompatible with "this" of type ${A.constructor.name}`),A.$$.ptr||AB(`cannot call emscripten binding method ${g} on deleted object`),Ae(A.$$.ptr,A.$$.ptrType.registeredClass,I.registeredClass)}var AL=new function(){this.allocated=[void 0],this.freelist=[],this.get=function(A){return this.allocated[A]},this.has=function(A){return void 0!==this.allocated[A]},this.allocate=function(A){var I=this.freelist.pop()||this.allocated.length;return this.allocated[I]=A,I},this.free=function(A){this.allocated[A]=void 0,this.freelist.push(A)}};function Ad(A){A>=AL.reserved&&0==--AL.get(A).refcount&&AL.free(A)}var AH={toValue:A=>(A||AB("Cannot use deleted val. handle = "+A),AL.get(A).value),toHandle:A=>{switch(A){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:return AL.allocate({refcount:1,value:A})}}};function AV(A,I){var g=b[A];return void 0===g&&AB(I+" has unknown type "+Ak(A)),g}function Au(A){if(null===A)return"null";var I=typeof A;return"object"===I||"array"===I||"function"===I?A.toString():""+A}function Af(A,I,g){return function(A,I,g,B){if(!(B>0))return 0;for(var Q=g,C=g+B-1,E=0;E<A.length;++E){var i=A.charCodeAt(E);if(i>=55296&&i<=57343&&(i=65536+((1023&i)<<10)|1023&A.charCodeAt(++E)),i<=127){if(g>=C)break;I[g++]=i}else if(i<=2047){if(g+1>=C)break;I[g++]=192|i>>6,I[g++]=128|63&i}else if(i<=65535){if(g+2>=C)break;I[g++]=224|i>>12,I[g++]=128|i>>6&63,I[g++]=128|63&i}else{if(g+3>=C)break;I[g++]=240|i>>18,I[g++]=128|i>>12&63,I[g++]=128|i>>6&63,I[g++]=128|63&i}}return I[g]=0,g-Q}(A,o,I,g)}function Ap(A){for(var I=0,g=0;g<A.length;++g){var B=A.charCodeAt(g);B<=127?I++:B<=2047?I+=2:B>=55296&&B<=57343?(I+=4,++g):I+=3}return I}var Aq="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function AZ(A,I){return A?function(A,I,g){for(var B=I+g,Q=I;A[Q]&&!(Q>=B);)++Q;if(Q-I>16&&A.buffer&&Aq)return Aq.decode(A.subarray(I,Q));for(var C="";I<Q;){var E=A[I++];if(!(128&E)){C+=String.fromCharCode(E);continue}var i=63&A[I++];if((224&E)==192){C+=String.fromCharCode((31&E)<<6|i);continue}var D=63&A[I++];if((E=(240&E)==224?(15&E)<<12|i<<6|D:(7&E)<<18|i<<12|D<<6|63&A[I++])<65536)C+=String.fromCharCode(E);else{var o=E-65536;C+=String.fromCharCode(55296|o>>10,56320|1023&o)}}return C}(o,A,I):""}var AT="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0;function AW(A,I){for(var g=A,B=g>>1,Q=B+I/2;!(B>=Q)&&a[B];)++B;if((g=B<<1)-A>32&&AT)return AT.decode(o.subarray(A,g));for(var C="",E=0;!(E>=I/2);++E){var i=w[A+2*E>>1];if(0==i)break;C+=String.fromCharCode(i)}return C}function Am(A,I,g){if(void 0===g&&(g=2147483647),g<2)return 0;for(var B=I,Q=(g-=2)<2*A.length?g/2:A.length,C=0;C<Q;++C){var E=A.charCodeAt(C);w[I>>1]=E,I+=2}return w[I>>1]=0,I-B}function Aj(A){return 2*A.length}function Ab(A,I){for(var g=0,B="";!(g>=I/4);){var Q=s[A+4*g>>2];if(0==Q)break;if(++g,Q>=65536){var C=Q-65536;B+=String.fromCharCode(55296|C>>10,56320|1023&C)}else B+=String.fromCharCode(Q)}return B}function Az(A,I,g){if(void 0===g&&(g=2147483647),g<4)return 0;for(var B=I,Q=B+g-4,C=0;C<A.length;++C){var E=A.charCodeAt(C);if(E>=55296&&E<=57343&&(E=65536+((1023&E)<<10)|1023&A.charCodeAt(++C)),s[I>>2]=E,(I+=4)+4>Q)break}return s[I>>2]=0,I-B}function Ax(A){for(var I=0,g=0;g<A.length;++g){var B=A.charCodeAt(g);B>=55296&&B<=57343&&++g,I+=4}return I}var Av={};function AO(A){var I=Av[A];return void 0===I?AI(A):I}function AX(){return"object"==typeof globalThis?globalThis:Function("return this")()}function AP(A,I,g,B,Q){var C,E={string:A=>{var I,g,B=0;return null!=A&&0!==A&&(g=A9(I=Ap(A)+1),Af(A,g,I),B=g),B},array:A=>{var I=A9(A.length);return D.set(A,I),I}},i=U["_"+A],o=[],w=0;if(B)for(var a=0;a<B.length;a++){var s=E[g[a]];s?(0===w&&(w=A1()),o[a]=s(B[a])):o[a]=B[a]}var t=i.apply(null,o);return C=t,0!==w&&A4(w),t="string"===I?AZ(C):"boolean"===I?!!C:C}X=U.InternalError=O(Error,"InternalError"),function(){for(var A=Array(256),I=0;I<256;++I)A[I]=String.fromCharCode(I);AA=A}(),Ag=U.BindingError=O(Error,"BindingError"),AF.prototype.isAliasOf=function(A){if(!(this instanceof AF)||!(A instanceof AF))return!1;for(var I=this.$$.ptrType.registeredClass,g=this.$$.ptr,B=A.$$.ptrType.registeredClass,Q=A.$$.ptr;I.baseClass;)g=I.upcast(g),I=I.baseClass;for(;B.baseClass;)Q=B.upcast(Q),B=B.baseClass;return I===B&&g===Q},AF.prototype.clone=function(){if(this.$$.ptr||AC(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var A,I=AN(Object.create(Object.getPrototypeOf(this),{$$:{value:{count:(A=this.$$).count,deleteScheduled:A.deleteScheduled,preservePointerOnDelete:A.preservePointerOnDelete,ptr:A.ptr,ptrType:A.ptrType,smartPtr:A.smartPtr,smartPtrType:A.smartPtrType}}}));return I.$$.count.value+=1,I.$$.deleteScheduled=!1,I},AF.prototype.delete=function(){this.$$.ptr||AC(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&AB("Object already scheduled for deletion"),Ai(this),AD(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},AF.prototype.isDeleted=function(){return!this.$$.ptr},AF.prototype.deleteLater=function(){return this.$$.ptr||AC(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&AB("Object already scheduled for deletion"),Aw.push(this),1===Aw.length&&As&&As(Aa),this.$$.deleteScheduled=!0,this},U.getInheritedInstanceCount=function(){return Object.keys(At).length},U.getLiveInheritedInstances=function(){var A=[];for(var I in At)At.hasOwnProperty(I)&&A.push(At[I]);return A},U.flushPendingDeletes=Aa,U.setDelayFunction=function(A){As=A,Aw.length&&As&&As(Aa)},Ac.prototype.getPointee=function(A){return this.rawGetPointee&&(A=this.rawGetPointee(A)),A},Ac.prototype.destructor=function(A){this.rawDestructor&&this.rawDestructor(A)},Ac.prototype.argPackAdvance=8,Ac.prototype.readValueFromPointer=m,Ac.prototype.deleteObject=function(A){null!==A&&A.delete()},Ac.prototype.fromWireType=function(A){var I,g=this.getPointee(A);if(!g)return this.destructor(A),null;var B=At[function(A,I){for(void 0===I&&AB("ptr should not be undefined");A.baseClass;)I=A.upcast(I),A=A.baseClass;return I}(this.registeredClass,g)];if(void 0!==B){if(0===B.$$.count.value)return B.$$.ptr=g,B.$$.smartPtr=A,B.clone();var Q=B.clone();return this.destructor(A),Q}function C(){return this.isSmartPointer?AM(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:g,smartPtrType:this,smartPtr:A}):AM(this.registeredClass.instancePrototype,{ptrType:this,ptr:A})}var E=Ao[this.registeredClass.getActualType(g)];if(!E)return C.call(this);I=this.isConst?E.constPointerType:E.pointerType;var i=function A(I,g,B){if(g===B)return I;if(void 0===B.baseClass)return null;var Q=A(I,g,B.baseClass);return null===Q?null:B.downcast(Q)}(g,this.registeredClass,I.registeredClass);return null===i?C.call(this):this.isSmartPointer?AM(I.registeredClass.instancePrototype,{ptrType:I,ptr:i,smartPtrType:this,smartPtr:A}):AM(I.registeredClass.instancePrototype,{ptrType:I,ptr:i})},AS=U.UnboundTypeError=O(Error,"UnboundTypeError"),AL.allocated.push({value:void 0},{value:null},{value:!0},{value:!1}),AL.reserved=AL.allocated.length,U.count_emval_handles=function(){for(var A=0,I=AL.reserved;I<AL.allocated.length;++I)void 0!==AL.allocated[I]&&++A;return A};var A$="function"==typeof atob?atob:function(A){var I,g,B,Q,C,E,i,D="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",o="",w=0;A=A.replace(/[^A-Za-z0-9\+\/\=]/g,"");do Q=D.indexOf(A.charAt(w++)),C=D.indexOf(A.charAt(w++)),E=D.indexOf(A.charAt(w++)),i=D.indexOf(A.charAt(w++)),I=Q<<2|C>>4,g=(15&C)<<4|E>>2,B=(3&E)<<6|i,o+=String.fromCharCode(I),64!==E&&(o+=String.fromCharCode(g)),64!==i&&(o+=String.fromCharCode(B));while(w<A.length);return o};function A_(A){if(H(A))return function(A){try{for(var I=A$(A),g=new Uint8Array(I.length),B=0;B<I.length;++B)g[B]=I.charCodeAt(B);return g}catch(A){throw Error("Converting base64 string to bytes failed.")}}(A.slice(d.length))}var A0={e:function(A,I,g){throw new p(A).init(I,g),q=A,Z++,q},k:function(A){var I=T[A];delete T[A];var g=I.rawConstructor,B=I.rawDestructor,Q=I.fields;$([A],Q.map(A=>A.getterReturnType).concat(Q.map(A=>A.setterArgumentType)),A=>{var C={};return Q.forEach((I,g)=>{var B=I.fieldName,E=A[g],i=I.getter,D=I.getterContext,o=A[g+Q.length],w=I.setter,a=I.setterContext;C[B]={read:A=>E.fromWireType(i(D,A)),write:(A,I)=>{var g=[];w(a,A,o.toWireType(g,I)),W(g)}}}),[{name:I.name,fromWireType:function(A){var I={};for(var g in C)I[g]=C[g].read(A);return B(A),I},toWireType:function(A,I){for(var Q in C)if(!(Q in I))throw TypeError(`Missing field: "${Q}"`);var E=g();for(Q in C)C[Q].write(E,I[Q]);return null!==A&&A.push(B,E),E},argPackAdvance:8,readValueFromPointer:m,destructorFunction:B}]})},s:function(A,I,g,B,Q){},x:function(A,I,g,B,Q){var C=_(g);AQ(A,{name:I=AI(I),fromWireType:function(A){return!!A},toWireType:function(A,I){return I?B:Q},argPackAdvance:8,readValueFromPointer:function(A){var B;if(1===g)B=D;else if(2===g)B=w;else if(4===g)B=s;else throw TypeError("Unknown boolean type size: "+I);return this.fromWireType(B[A>>C])},destructorFunction:null})},j:function(A,I,g,B,Q,C,E,i,D,o,w,a,s){w=AI(w),C=Ah(Q,C),i&&(i=Ah(E,i)),o&&(o=Ah(D,o)),s=Ah(a,s);var t=x(w);Ar(t,function(){AJ(`Cannot construct ${w} due to unbound types`,[B])}),$([A,I,g],B?[B]:[],function(I){I=I[0],E=B?(Q=I.registeredClass).instancePrototype:AF.prototype;var g,Q,E,D=v(t,function(){if(Object.getPrototypeOf(this)!==a)throw new Ag("Use 'new' to construct "+w);if(void 0===M.constructor_body)throw new Ag(w+" has no accessible constructor");var A=M.constructor_body[arguments.length];if(void 0===A)throw new Ag(`Tried to invoke ctor of ${w} with invalid number of parameters (${arguments.length}) - expected (${Object.keys(M.constructor_body).toString()}) parameters instead!`);return A.apply(this,arguments)}),a=Object.create(E,{constructor:{value:D}});D.prototype=a;var M=new AU(w,D,a,s,Q,C,i,o);M.baseClass&&(void 0===M.baseClass.__derivedClasses&&(M.baseClass.__derivedClasses=[]),M.baseClass.__derivedClasses.push(M));var N=new Ac(w,M,!0,!1,!1),F=new Ac(w+"*",M,!1,!1,!1),G=new Ac(w+" const*",M,!1,!0,!1);return Ao[A]={pointerType:F,constPointerType:G},U.hasOwnProperty(t)||P("Replacing nonexistant public symbol"),void 0!==U[t].overloadTable&&void 0!==g?U[t].overloadTable[g]=D:(U[t]=D,U[t].argCount=g),[N,F,G]})},g:function(A,I,g,B,Q,C,E,i){var D=Al(g,B);I=AI(I),C=Ah(Q,C),$([],[A],function(A){var B=`${(A=A[0]).name}.${I}`;function Q(){AJ(`Cannot call ${B} due to unbound types`,D)}I.startsWith("@@")&&(I=Symbol[I.substring(2)]);var o=A.registeredClass.constructor;return void 0===o[I]?(Q.argCount=g-1,o[I]=Q):(AG(o,I,B),o[I].overloadTable[g-1]=Q),$([],D,function(Q){var D=AY(B,[Q[0],null].concat(Q.slice(1)),null,C,E,i);if(void 0===o[I].overloadTable?(D.argCount=g-1,o[I]=D):o[I].overloadTable[g-1]=D,A.registeredClass.__derivedClasses)for(let g of A.registeredClass.__derivedClasses)g.constructor.hasOwnProperty(I)||(g.constructor[I]=D);return[]}),[]})},q:function(A,I,g,B,Q,C){I>0||L(void 0);var E=Al(I,g);Q=Ah(B,Q),$([],[A],function(A){var g=`constructor ${(A=A[0]).name}`;if(void 0===A.registeredClass.constructor_body&&(A.registeredClass.constructor_body=[]),void 0!==A.registeredClass.constructor_body[I-1])throw new Ag(`Cannot register multiple constructors with identical number of parameters (${I-1}) for class '${A.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return A.registeredClass.constructor_body[I-1]=()=>{AJ(`Cannot construct ${A.name} due to unbound types`,E)},$([],E,function(B){return B.splice(1,0,null),A.registeredClass.constructor_body[I-1]=AY(g,B,null,Q,C),[]}),[]})},h:function(A,I,g,B,Q,C,E,i,D){var o=Al(g,B);I=AI(I),C=Ah(Q,C),$([],[A],function(A){var B=`${(A=A[0]).name}.${I}`;function Q(){AJ(`Cannot call ${B} due to unbound types`,o)}I.startsWith("@@")&&(I=Symbol[I.substring(2)]),i&&A.registeredClass.pureVirtualFunctions.push(I);var w=A.registeredClass.instancePrototype,a=w[I];return void 0===a||void 0===a.overloadTable&&a.className!==A.name&&a.argCount===g-2?(Q.argCount=g-2,Q.className=A.name,w[I]=Q):(AG(w,I,B),w[I].overloadTable[g-2]=Q),$([],o,function(Q){var i=AY(B,Q,A,C,E,D);return void 0===w[I].overloadTable?(i.argCount=g-2,w[I]=i):w[I].overloadTable[g-2]=i,[]}),[]})},f:function(A,I,g,B,Q,C,E,i,D,o){I=AI(I),Q=Ah(B,Q),$([],[A],function(A){var B=`${(A=A[0]).name}.${I}`,w={get:function(){AJ(`Cannot access ${B} due to unbound types`,[g,E])},enumerable:!0,configurable:!0};return D?w.set=()=>{AJ(`Cannot access ${B} due to unbound types`,[g,E])}:w.set=A=>{AB(B+" is a read-only property")},Object.defineProperty(A.registeredClass.instancePrototype,I,w),$([],D?[g,E]:[g],function(g){var E=g[0],w={get:function(){var I=AK(this,A,B+" getter");return E.fromWireType(Q(C,I))},enumerable:!0};if(D){D=Ah(i,D);var a=g[1];w.set=function(I){var g=AK(this,A,B+" setter"),Q=[];D(o,g,a.toWireType(Q,I)),W(Q)}}return Object.defineProperty(A.registeredClass.instancePrototype,I,w),[]}),[]})},w:function(A,I){AQ(A,{name:I=AI(I),fromWireType:function(A){var I=AH.toValue(A);return Ad(A),I},toWireType:function(A,I){return AH.toHandle(I)},argPackAdvance:8,readValueFromPointer:m,destructorFunction:null})},p:function(A,I,g,B){var Q=_(g);function C(){}I=AI(I),C.values={},AQ(A,{name:I,constructor:C,fromWireType:function(A){return this.constructor.values[A]},toWireType:function(A,I){return I.value},argPackAdvance:8,readValueFromPointer:function(A,I,g){switch(I){case 0:return function(A){var I=g?D:o;return this.fromWireType(I[A])};case 1:return function(A){var I=g?w:a;return this.fromWireType(I[A>>1])};case 2:return function(A){var I=g?s:t;return this.fromWireType(I[A>>2])};default:throw TypeError("Unknown integer type: "+A)}}(I,Q,B),destructorFunction:null}),Ar(I,C)},c:function(A,I,g){var B=AV(A,"enum");I=AI(I);var Q=B.constructor,C=Object.create(B.constructor.prototype,{value:{value:g},constructor:{value:v(`${B.name}_${I}`,function(){})}});Q.values[g]=C,Q[I]=C},m:function(A,I,g){var B=_(g);AQ(A,{name:I=AI(I),fromWireType:function(A){return A},toWireType:function(A,I){return I},argPackAdvance:8,readValueFromPointer:function(A,I){switch(I){case 2:return function(A){return this.fromWireType(M[A>>2])};case 3:return function(A){return this.fromWireType(N[A>>3])};default:throw TypeError("Unknown float type: "+A)}}(I,B),destructorFunction:null})},d:function(A,I,g,B,Q){I=AI(I),-1===Q&&(Q=4294967295);var C=_(g),E=A=>A;if(0===B){var i=32-8*g;E=A=>A<<i>>>i}var M=I.includes("unsigned"),N=(A,I)=>{};AQ(A,{name:I,fromWireType:E,toWireType:M?function(A,I){return N(I,this.name),I>>>0}:function(A,I){return N(I,this.name),I},argPackAdvance:8,readValueFromPointer:function(A,I,g){switch(I){case 0:return g?function(A){return D[A]}:function(A){return o[A]};case 1:return g?function(A){return w[A>>1]}:function(A){return a[A>>1]};case 2:return g?function(A){return s[A>>2]}:function(A){return t[A>>2]};default:throw TypeError("Unknown integer type: "+A)}}(I,C,0!==B),destructorFunction:null})},a:function(A,I,g){var B=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][I];function Q(A){var I=t,g=I[A>>=2],Q=I[A+1];return new B(I.buffer,Q,g)}AQ(A,{name:g=AI(g),fromWireType:Q,argPackAdvance:8,readValueFromPointer:Q},{ignoreDuplicateRegistrations:!0})},r:function(A,I,g,B,Q,C,E,i,D,o,w,a){g=AI(g),C=Ah(Q,C),i=Ah(E,i),o=Ah(D,o),a=Ah(w,a),$([A],[I],function(A){return A=A[0],[new Ac(g,A.registeredClass,!1,!1,!0,A,B,C,i,o,a)]})},l:function(A,I){var g="std::string"===(I=AI(I));AQ(A,{name:I,fromWireType:function(A){var I,B=t[A>>2],Q=A+4;if(g)for(var C=Q,E=0;E<=B;++E){var i=Q+E;if(E==B||0==o[i]){var D=i-C,w=AZ(C,D);void 0===I?I=w:I+="\x00"+w,C=i+1}}else{for(var a=Array(B),E=0;E<B;++E)a[E]=String.fromCharCode(o[Q+E]);I=a.join("")}return A8(A),I},toWireType:function(A,I){I instanceof ArrayBuffer&&(I=new Uint8Array(I));var B,Q="string"==typeof I;Q||I instanceof Uint8Array||I instanceof Uint8ClampedArray||I instanceof Int8Array||AB("Cannot pass non-string to std::string");var C=A2(4+(B=g&&Q?Ap(I):I.length)+1),E=C+4;if(t[C>>2]=B,g&&Q)Af(I,E,B+1);else if(Q)for(var i=0;i<B;++i){var D=I.charCodeAt(i);D>255&&(A8(E),AB("String has UTF-16 code units that do not fit in 8 bits")),o[E+i]=D}else for(var i=0;i<B;++i)o[E+i]=I[i];return null!==A&&A.push(A8,C),C},argPackAdvance:8,readValueFromPointer:m,destructorFunction:function(A){A8(A)}})},i:function(A,I,g){var B,Q,C,E,i;g=AI(g),2===I?(B=AW,Q=Am,E=Aj,C=()=>a,i=1):4===I&&(B=Ab,Q=Az,E=Ax,C=()=>t,i=2),AQ(A,{name:g,fromWireType:function(A){for(var g,Q=t[A>>2],E=C(),D=A+4,o=0;o<=Q;++o){var w=A+4+o*I;if(o==Q||0==E[w>>i]){var a=w-D,s=B(D,a);void 0===g?g=s:g+="\x00"+s,D=w+I}}return A8(A),g},toWireType:function(A,B){"string"!=typeof B&&AB(`Cannot pass non-string to C++ string type ${g}`);var C=E(B),D=A2(4+C+I);return t[D>>2]=C>>i,Q(B,D+4,C+I),null!==A&&A.push(A8,D),D},argPackAdvance:8,readValueFromPointer:m,destructorFunction:function(A){A8(A)}})},n:function(A,I,g,B,Q,C){T[A]={name:AI(I),rawConstructor:Ah(g,B),rawDestructor:Ah(Q,C),fields:[]}},o:function(A,I,g,B,Q,C,E,i,D,o){T[A].fields.push({fieldName:AI(I),getterReturnType:g,getter:Ah(B,Q),getterContext:C,setterArgumentType:E,setter:Ah(i,D),setterContext:o})},y:function(A,I){AQ(A,{isVoid:!0,name:I=AI(I),argPackAdvance:0,fromWireType:function(){},toWireType:function(A,I){}})},A:function(A,I,g){A=AH.toValue(A),I=AV(I,"emval::as");var B=[],Q=AH.toHandle(B);return t[g>>2]=Q,I.toWireType(B,A)},D:function(A,I,g,B){A=AH.toValue(A);for(var Q=function(A,I){for(var g=Array(A),B=0;B<A;++B)g[B]=AV(t[I+4*B>>2],"parameter "+B);return g}(I,g),C=Array(I),E=0;E<I;++E){var i=Q[E];C[E]=i.readValueFromPointer(B),B+=i.argPackAdvance}var D=A.apply(void 0,C);return AH.toHandle(D)},b:Ad,G:function(A){return 0===A?AH.toHandle(AX()):(A=AO(A),AH.toHandle(AX()[A]))},B:function(A,I){return A=AH.toValue(A),I=AH.toValue(I),AH.toHandle(A[I])},E:function(A){A>4&&(AL.get(A).refcount+=1)},C:function(A){return AH.toHandle(AO(A))},z:function(A){W(AH.toValue(A)),Ad(A)},F:function(A,I){var g=(A=AV(A,"_emval_take_value")).readValueFromPointer(I);return AH.toHandle(g)},t:function(){L("")},v:function(){return Date.now()},u:function(A){o.length,L("OOM")}};!function(){var A,I,g,B={a:A0};function Q(A,I){var g,B,Q=A.exports;return U.asm=Q,g=U.asm.H.buffer,U.HEAP8=D=new Int8Array(g),U.HEAP16=w=new Int16Array(g),U.HEAP32=s=new Int32Array(g),U.HEAPU8=o=new Uint8Array(g),U.HEAPU16=a=new Uint16Array(g),U.HEAPU32=t=new Uint32Array(g),U.HEAPF32=M=new Float32Array(g),U.HEAPF64=N=new Float64Array(g),F=U.asm.K,B=U.asm.I,k.unshift(B),!function(A){if(Y--,U.monitorRunDependencies&&U.monitorRunDependencies(Y),0==Y&&(null!==l&&(clearInterval(l),l=null),K)){var I=K;K=null,I()}}(0),Q}if(Y++,U.monitorRunDependencies&&U.monitorRunDependencies(Y),U.instantiateWasm)try{return U.instantiateWasm(B,Q)}catch(A){c("Module.instantiateWasm callback failed with error: "+A),C(A)}(A=i,I=G,g=function(A){Q(A.instance)},A||"function"!=typeof WebAssembly.instantiateStreaming||H(I)||"function"!=typeof fetch?u(I,B,g):fetch(I,{credentials:"same-origin"}).then(A=>WebAssembly.instantiateStreaming(A,B).then(g,function(A){return c("wasm streaming compile failed: "+A),c("falling back to ArrayBuffer instantiation"),u(I,B,g)}))).catch(C)}();var A2=U._malloc=function(){return(A2=U._malloc=U.asm.J).apply(null,arguments)},A3=function(){return(A3=U.asm.L).apply(null,arguments)},A8=(U.__embind_initialize_bindings=function(){return(U.__embind_initialize_bindings=U.asm.M).apply(null,arguments)},function(){return(A8=U.asm.N).apply(null,arguments)}),A1=function(){return(A1=U.asm.O).apply(null,arguments)},A4=function(){return(A4=U.asm.P).apply(null,arguments)},A9=function(){return(A9=U.asm.Q).apply(null,arguments)},A5=function(){return(A5=U.asm.R).apply(null,arguments)};function A6(){!(Y>0)&&(!function(){if(U.preRun)for("function"==typeof U.preRun&&(U.preRun=[U.preRun]);U.preRun.length;){var A;A=U.preRun.shift(),S.unshift(A)}f(S)}(),Y>0||(U.setStatus?(U.setStatus("Running..."),setTimeout(function(){setTimeout(function(){U.setStatus("")},1),A()},1)):A()));function A(){!r&&(r=!0,U.calledRun=!0,h||(f(k),Q(U),U.onRuntimeInitialized&&U.onRuntimeInitialized(),function(){if(U.postRun)for("function"==typeof U.postRun&&(U.postRun=[U.postRun]);U.postRun.length;){var A;A=U.postRun.shift(),J.unshift(A)}f(J)}()))}}if(U.ccall=AP,U.cwrap=function(A,I,g,B){var Q=!g||g.every(A=>"number"===A||"boolean"===A);return"string"!==I&&Q&&!B?U["_"+A]:function(){return AP(A,I,g,arguments,B)}},U.setValue=function(A,I,g="i8"){switch(g.endsWith("*")&&(g="*"),g){case"i1":case"i8":D[A>>0]=I;break;case"i16":w[A>>1]=I;break;case"i32":s[A>>2]=I;break;case"i64":L("to do setValue(i64) use WASM_BIGINT");case"float":M[A>>2]=I;break;case"double":N[A>>3]=I;break;case"*":t[A>>2]=I;break;default:L(`invalid type for setValue: ${g}`)}},U.getValue=function(A,I="i8"){switch(I.endsWith("*")&&(I="*"),I){case"i1":case"i8":return D[A>>0];case"i16":return w[A>>1];case"i32":return s[A>>2];case"i64":L("to do getValue(i64) use WASM_BIGINT");case"float":return M[A>>2];case"double":return N[A>>3];case"*":return t[A>>2];default:L(`invalid type for getValue: ${I}`)}},K=function A(){r||A6(),r||(K=A)},U.preInit)for("function"==typeof U.preInit&&(U.preInit=[U.preInit]);U.preInit.length>0;)U.preInit.pop()();return A6(),I.ready}})();function C(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=Array(I);g<I;g++)B[g]=A[g];return B}function E(A){if(Array.isArray(A))return A}function i(A,I){if(!(A instanceof I))throw TypeError("Cannot call a class as a function")}function D(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}function o(A,I,g){return I&&D(A.prototype,I),g&&D(A,g),A}function w(A,I,g){return I in A?Object.defineProperty(A,I,{value:g,enumerable:!0,configurable:!0,writable:!0}):A[I]=g,A}function a(A,I){var g,B,Q=null==A?null:"undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(null!=Q){var C=[],E=!0,i=!1;try{for(Q=Q.call(A);!(E=(g=Q.next()).done)&&(C.push(g.value),!I||C.length!==I);E=!0);}catch(A){i=!0,B=A}finally{try{E||null==Q.return||Q.return()}finally{if(i)throw B}}return C}}function s(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function t(A,I){return E(A)||a(A,I)||M(A,I)||s()}function M(A,I){if(A){if("string"==typeof A)return C(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);if("Object"===g&&A.constructor&&(g=A.constructor.name),"Map"===g||"Set"===g)return Array.from(g);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return C(A,I)}}var N=function(){"use strict";function A(I,g){i(this,A),w(this,"module",void 0),w(this,"reader",void 0),w(this,"handle",null),w(this,"bw",0),w(this,"bh",0),w(this,"src",null),w(this,"out",null),w(this,"isAllocate",!1),w(this,"successCount",0),w(this,"_errorId",0),w(this,"edgMem",null),w(this,"src2",null),w(this,"outLen",null),w(this,"locations",null),w(this,"pdfCount",0),w(this,"geometry",void 0),w(this,"minPDFframes",1),w(this,"cropSizes",void 0),w(this,"canvasSizes",void 0),this.module=I,this.handle=null,this.bw=0,this.bh=0,this.src=null,this.out=null,this.isAllocate=!1,this.successCount=0,this._errorId=0,this.edgMem=null,this.src2=null,this.outLen=null,this.locations=null,this.reader=g,this.pdfCount=0}return o(A,[{key:"init",value:function(A,I,g,B){this.geometry=A,this.minPDFframes=I,this.cropSizes=g,this.canvasSizes=B}},{key:"errorId",get:function(){return this._errorId},set:function(A){this._errorId=[1,2].includes(A)?0:A}},{key:"errorVal",get:function(){var A;return(-3===this.errorId||5===this.errorId)&&(A=0),(-2===this.errorId||4===this.errorId)&&(A=1),A}},{key:"licenseError",value:function(){return{error:!0,errorType:"licenceKeyError",errorVal:this.errorVal}}},{key:"getLocations",value:function(){this.module.ccall("pdf417_getLocation",["boolean"],["number","number"],[this.handle,this.locations])}},{key:"setResizedData",value:function(A){this.module.HEAPU8.set(A,this.src)}},{key:"initReader",value:function(A){this.reader=new this.module.PDF417Reader(A)}},{key:"destroyReader",value:function(){this.reader=null}},{key:"setPdfData",value:function(A){this.module.HEAPU8.set(A.data,this.src2)}},{key:"readPdf",value:function(){return this.reader.processImage(this.src2,this.bw,this.bh,4*this.bw,this.module.EImageFormat.RGBA)}},{key:"releasePdf",value:function(){this.reader.reset()}},{key:"create",value:function(){}},{key:"free",value:function(){this.isAllocate&&(this.module._free(this.src2),this.isAllocate=!1)}},{key:"setSizes",value:function(A,I){this.bw=A,this.bh=I}},{key:"getSizes",value:function(){return{bw:this.bw,bh:this.bh}}},{key:"allocate",value:function(){this.isAllocate||(this.isAllocate=!0,this.src2=this.module._malloc(676e4))}},{key:"readPDF",value:function(A){this.releasePdf(),this.setPdfData(A);var I=this.readPdf();return this.errorId=I.status.value,(this.errorId?this.licenseError():null)||I}},{key:"drawCords",value:function(A){var I=this,g=[];if(A){var B=[];Object.entries(A).forEach(function(A){var g=t(A,2),Q=g[0],C=Math.trunc(g[1]),E=Q[0],i=+Q[1]-1;B[i]||(B[i]={x:0,y:0}),"x"===E?B[i].x=I.canvasSizes.width*C/I.bw:B[i].y=I.canvasSizes.height*C/I.bh});var Q=[B[3].x-B[0].x,B[3].y-B[0].y],C=[B[1].x-B[0].x,B[1].y-B[0].y],E=[B[2].x-B[1].x,B[2].y-B[1].y],i=[B[3].x-B[2].x,B[3].y-B[2].y],D=this.geometry.angleBetweenTwoVectors(Q,C),o=this.geometry.angleBetweenTwoVectors(E,i);D<=100&&D>=80&&o<=100&&o>=80&&(g=B)}return g}},{key:"proccessPDF",value:function(A){var I={status:!1,predict:!1,touch:!1,image:null,type:"pdf",error:null,coords:[],trackString:"",pdfSuccessCount:0,pdfCount:0,isSuccessProcess:!1},g=this.readPDF(A);return g.error?(I.error=g,I):(1===g.status.value||2===g.status.value?(I.coords=this.drawCords(g.location),I.isSuccessProcess=!0):(this.successCount+=1,this.drawCords(null)),2===g.status.value?(this.pdfCount+=1,this.pdfCount>=this.minPDFframes&&(this.successCount=0,this.pdfCount=0,I.trackString=g.data,I.status=!0,I.image=A)):this.pdfCount=0,I.pdfSuccessCount=this.successCount,I.pdfCount=this.pdfCount,I)}}]),A}(),F=g(1026);function G(A,I,g,B,Q,C,E){try{var i=A[C](E),D=i.value}catch(A){g(A);return}i.done?I(D):Promise.resolve(D).then(B,Q)}function r(A){return function(){var I=this,g=arguments;return new Promise(function(B,Q){var C=A.apply(I,g);function E(A){G(C,B,Q,E,i,"next",A)}function i(A){G(C,B,Q,E,i,"throw",A)}E(void 0)})}}function U(A,I){var g,B,Q,C,E={label:0,sent:function(){if(1&Q[0])throw Q[1];return Q[1]},trys:[],ops:[]};return C={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(C[Symbol.iterator]=function(){return this}),C;function i(C){return function(i){return function(C){if(g)throw TypeError("Generator is already executing.");for(;E;)try{if(g=1,B&&(Q=2&C[0]?B.return:C[0]?B.throw||((Q=B.return)&&Q.call(B),0):B.next)&&!(Q=Q.call(B,C[1])).done)return Q;switch(B=0,Q&&(C=[2&C[0],Q.value]),C[0]){case 0:case 1:Q=C;break;case 4:return E.label++,{value:C[1],done:!1};case 5:E.label++,B=C[1],C=[0];continue;case 7:C=E.ops.pop(),E.trys.pop();continue;default:if(!(Q=(Q=E.trys).length>0&&Q[Q.length-1])&&(6===C[0]||2===C[0])){E=0;continue}if(3===C[0]&&(!Q||C[1]>Q[0]&&C[1]<Q[3])){E.label=C[1];break}if(6===C[0]&&E.label<Q[1]){E.label=Q[1],Q=C;break}if(Q&&E.label<Q[2]){E.label=Q[2],E.ops.push(C);break}Q[2]&&E.ops.pop(),E.trys.pop();continue}C=I.call(A,E)}catch(A){C=[6,A],B=0}finally{g=Q=0}if(5&C[0])throw C[1];return{value:C[0]?C[1]:void 0,done:!0}}([C,i])}}}var e=function(){var A=r(function(A){var I,g,B,C;return U(this,function(E){switch(E.label){case 0:return I=A.pdf417key,[4,Q()];case 1:return B=new(g=E.sent()).PDF417Reader(I),(C=new N(g,B)).allocate(),F.Z.setModule("module","pdf",C),[2]}})});return function(I){return A.apply(this,arguments)}}();let R=e}}]);
5
+ }`;D&&(t+="var destructors = [];\n");var M=D?"destructors":"null",N=["throwBindingError","invoker","fn","runDestructors","retType","classParam"],F=[AB,B,Q,W,I[0],I[1]];i&&(t+="var thisWired = classParam.toWireType("+M+", this);\n");for(var o=0;o<E-2;++o)t+="var arg"+o+"Wired = argType"+o+".toWireType("+M+", arg"+o+"); // "+I[o+2].name+"\n",N.push("argType"+o),F.push(I[o+2]);if(i&&(s="thisWired"+(s.length>0?", ":"")+s),t+=(w||C?"var rv = ":"")+"invoker(fn"+(s.length>0?", ":"")+s+");\n",D)t+="runDestructors(destructors);\n";else for(var o=i?1:2;o<I.length;++o){var G=1===o?"thisWired":"arg"+(o-2)+"Wired";null!==I[o].destructorFunction&&(t+=G+"_dtor("+G+"); // "+I[o].name+"\n",N.push(G+"_dtor"),F.push(I[o].destructorFunction))}return w&&(t+="var ret = retType.fromWireType(rv);\nreturn ret;\n"),t+="}\n",N.push(t),(function(A,I){if(!(A instanceof Function))throw TypeError(`new_ called with constructor type ${typeof A} which is not a function`);var g=v(A.name||"unknownFunctionName",function(){});g.prototype=A.prototype;var B=new g,Q=A.apply(B,I);return Q instanceof Object?Q:B})(Function,N).apply(null,F)}function Al(A,I){for(var g=[],B=0;B<A;B++)g.push(t[I+4*B>>2]);return g}function AK(A,I,g){return A instanceof Object||AB(`${g} with invalid "this": ${A}`),A instanceof I.registeredClass.constructor||AB(`${g} incompatible with "this" of type ${A.constructor.name}`),A.$$.ptr||AB(`cannot call emscripten binding method ${g} on deleted object`),Ae(A.$$.ptr,A.$$.ptrType.registeredClass,I.registeredClass)}var AL=new function(){this.allocated=[void 0],this.freelist=[],this.get=function(A){return this.allocated[A]},this.has=function(A){return void 0!==this.allocated[A]},this.allocate=function(A){var I=this.freelist.pop()||this.allocated.length;return this.allocated[I]=A,I},this.free=function(A){this.allocated[A]=void 0,this.freelist.push(A)}};function Ad(A){A>=AL.reserved&&0==--AL.get(A).refcount&&AL.free(A)}var AH={toValue:A=>(A||AB("Cannot use deleted val. handle = "+A),AL.get(A).value),toHandle:A=>{switch(A){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:return AL.allocate({refcount:1,value:A})}}};function AV(A,I){var g=b[A];return void 0===g&&AB(I+" has unknown type "+Ak(A)),g}function Au(A){if(null===A)return"null";var I=typeof A;return"object"===I||"array"===I||"function"===I?A.toString():""+A}function Af(A,I,g){return function(A,I,g,B){if(!(B>0))return 0;for(var Q=g,C=g+B-1,E=0;E<A.length;++E){var i=A.charCodeAt(E);if(i>=55296&&i<=57343&&(i=65536+((1023&i)<<10)|1023&A.charCodeAt(++E)),i<=127){if(g>=C)break;I[g++]=i}else if(i<=2047){if(g+1>=C)break;I[g++]=192|i>>6,I[g++]=128|63&i}else if(i<=65535){if(g+2>=C)break;I[g++]=224|i>>12,I[g++]=128|i>>6&63,I[g++]=128|63&i}else{if(g+3>=C)break;I[g++]=240|i>>18,I[g++]=128|i>>12&63,I[g++]=128|i>>6&63,I[g++]=128|63&i}}return I[g]=0,g-Q}(A,o,I,g)}function Ap(A){for(var I=0,g=0;g<A.length;++g){var B=A.charCodeAt(g);B<=127?I++:B<=2047?I+=2:B>=55296&&B<=57343?(I+=4,++g):I+=3}return I}var Aq="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function AZ(A,I){return A?function(A,I,g){for(var B=I+g,Q=I;A[Q]&&!(Q>=B);)++Q;if(Q-I>16&&A.buffer&&Aq)return Aq.decode(A.subarray(I,Q));for(var C="";I<Q;){var E=A[I++];if(!(128&E)){C+=String.fromCharCode(E);continue}var i=63&A[I++];if((224&E)==192){C+=String.fromCharCode((31&E)<<6|i);continue}var D=63&A[I++];if((E=(240&E)==224?(15&E)<<12|i<<6|D:(7&E)<<18|i<<12|D<<6|63&A[I++])<65536)C+=String.fromCharCode(E);else{var o=E-65536;C+=String.fromCharCode(55296|o>>10,56320|1023&o)}}return C}(o,A,I):""}var AT="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0;function AW(A,I){for(var g=A,B=g>>1,Q=B+I/2;!(B>=Q)&&a[B];)++B;if((g=B<<1)-A>32&&AT)return AT.decode(o.subarray(A,g));for(var C="",E=0;!(E>=I/2);++E){var i=w[A+2*E>>1];if(0==i)break;C+=String.fromCharCode(i)}return C}function Am(A,I,g){if(void 0===g&&(g=2147483647),g<2)return 0;for(var B=I,Q=(g-=2)<2*A.length?g/2:A.length,C=0;C<Q;++C){var E=A.charCodeAt(C);w[I>>1]=E,I+=2}return w[I>>1]=0,I-B}function Aj(A){return 2*A.length}function Ab(A,I){for(var g=0,B="";!(g>=I/4);){var Q=s[A+4*g>>2];if(0==Q)break;if(++g,Q>=65536){var C=Q-65536;B+=String.fromCharCode(55296|C>>10,56320|1023&C)}else B+=String.fromCharCode(Q)}return B}function Az(A,I,g){if(void 0===g&&(g=2147483647),g<4)return 0;for(var B=I,Q=B+g-4,C=0;C<A.length;++C){var E=A.charCodeAt(C);if(E>=55296&&E<=57343&&(E=65536+((1023&E)<<10)|1023&A.charCodeAt(++C)),s[I>>2]=E,(I+=4)+4>Q)break}return s[I>>2]=0,I-B}function Ax(A){for(var I=0,g=0;g<A.length;++g){var B=A.charCodeAt(g);B>=55296&&B<=57343&&++g,I+=4}return I}var Av={};function AO(A){var I=Av[A];return void 0===I?AI(A):I}function AX(){return"object"==typeof globalThis?globalThis:Function("return this")()}function AP(A,I,g,B,Q){var C,E={string:A=>{var I,g,B=0;return null!=A&&0!==A&&(g=A9(I=Ap(A)+1),Af(A,g,I),B=g),B},array:A=>{var I=A9(A.length);return D.set(A,I),I}},i=U["_"+A],o=[],w=0;if(B)for(var a=0;a<B.length;a++){var s=E[g[a]];s?(0===w&&(w=A1()),o[a]=s(B[a])):o[a]=B[a]}var t=i.apply(null,o);return C=t,0!==w&&A4(w),t="string"===I?AZ(C):"boolean"===I?!!C:C}X=U.InternalError=O(Error,"InternalError"),function(){for(var A=Array(256),I=0;I<256;++I)A[I]=String.fromCharCode(I);AA=A}(),Ag=U.BindingError=O(Error,"BindingError"),AF.prototype.isAliasOf=function(A){if(!(this instanceof AF)||!(A instanceof AF))return!1;for(var I=this.$$.ptrType.registeredClass,g=this.$$.ptr,B=A.$$.ptrType.registeredClass,Q=A.$$.ptr;I.baseClass;)g=I.upcast(g),I=I.baseClass;for(;B.baseClass;)Q=B.upcast(Q),B=B.baseClass;return I===B&&g===Q},AF.prototype.clone=function(){if(this.$$.ptr||AC(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var A,I=AN(Object.create(Object.getPrototypeOf(this),{$$:{value:{count:(A=this.$$).count,deleteScheduled:A.deleteScheduled,preservePointerOnDelete:A.preservePointerOnDelete,ptr:A.ptr,ptrType:A.ptrType,smartPtr:A.smartPtr,smartPtrType:A.smartPtrType}}}));return I.$$.count.value+=1,I.$$.deleteScheduled=!1,I},AF.prototype.delete=function(){this.$$.ptr||AC(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&AB("Object already scheduled for deletion"),Ai(this),AD(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},AF.prototype.isDeleted=function(){return!this.$$.ptr},AF.prototype.deleteLater=function(){return this.$$.ptr||AC(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&AB("Object already scheduled for deletion"),Aw.push(this),1===Aw.length&&As&&As(Aa),this.$$.deleteScheduled=!0,this},U.getInheritedInstanceCount=function(){return Object.keys(At).length},U.getLiveInheritedInstances=function(){var A=[];for(var I in At)At.hasOwnProperty(I)&&A.push(At[I]);return A},U.flushPendingDeletes=Aa,U.setDelayFunction=function(A){As=A,Aw.length&&As&&As(Aa)},Ac.prototype.getPointee=function(A){return this.rawGetPointee&&(A=this.rawGetPointee(A)),A},Ac.prototype.destructor=function(A){this.rawDestructor&&this.rawDestructor(A)},Ac.prototype.argPackAdvance=8,Ac.prototype.readValueFromPointer=m,Ac.prototype.deleteObject=function(A){null!==A&&A.delete()},Ac.prototype.fromWireType=function(A){var I,g=this.getPointee(A);if(!g)return this.destructor(A),null;var B=At[function(A,I){for(void 0===I&&AB("ptr should not be undefined");A.baseClass;)I=A.upcast(I),A=A.baseClass;return I}(this.registeredClass,g)];if(void 0!==B){if(0===B.$$.count.value)return B.$$.ptr=g,B.$$.smartPtr=A,B.clone();var Q=B.clone();return this.destructor(A),Q}function C(){return this.isSmartPointer?AM(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:g,smartPtrType:this,smartPtr:A}):AM(this.registeredClass.instancePrototype,{ptrType:this,ptr:A})}var E=Ao[this.registeredClass.getActualType(g)];if(!E)return C.call(this);I=this.isConst?E.constPointerType:E.pointerType;var i=function A(I,g,B){if(g===B)return I;if(void 0===B.baseClass)return null;var Q=A(I,g,B.baseClass);return null===Q?null:B.downcast(Q)}(g,this.registeredClass,I.registeredClass);return null===i?C.call(this):this.isSmartPointer?AM(I.registeredClass.instancePrototype,{ptrType:I,ptr:i,smartPtrType:this,smartPtr:A}):AM(I.registeredClass.instancePrototype,{ptrType:I,ptr:i})},AS=U.UnboundTypeError=O(Error,"UnboundTypeError"),AL.allocated.push({value:void 0},{value:null},{value:!0},{value:!1}),AL.reserved=AL.allocated.length,U.count_emval_handles=function(){for(var A=0,I=AL.reserved;I<AL.allocated.length;++I)void 0!==AL.allocated[I]&&++A;return A};var A$="function"==typeof atob?atob:function(A){var I,g,B,Q,C,E,i,D="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",o="",w=0;A=A.replace(/[^A-Za-z0-9\+\/\=]/g,"");do Q=D.indexOf(A.charAt(w++)),C=D.indexOf(A.charAt(w++)),E=D.indexOf(A.charAt(w++)),i=D.indexOf(A.charAt(w++)),I=Q<<2|C>>4,g=(15&C)<<4|E>>2,B=(3&E)<<6|i,o+=String.fromCharCode(I),64!==E&&(o+=String.fromCharCode(g)),64!==i&&(o+=String.fromCharCode(B));while(w<A.length);return o};function A_(A){if(H(A))return function(A){try{for(var I=A$(A),g=new Uint8Array(I.length),B=0;B<I.length;++B)g[B]=I.charCodeAt(B);return g}catch(A){throw Error("Converting base64 string to bytes failed.")}}(A.slice(d.length))}var A0={e:function(A,I,g){throw new p(A).init(I,g),q=A,Z++,q},k:function(A){var I=T[A];delete T[A];var g=I.rawConstructor,B=I.rawDestructor,Q=I.fields;$([A],Q.map(A=>A.getterReturnType).concat(Q.map(A=>A.setterArgumentType)),A=>{var C={};return Q.forEach((I,g)=>{var B=I.fieldName,E=A[g],i=I.getter,D=I.getterContext,o=A[g+Q.length],w=I.setter,a=I.setterContext;C[B]={read:A=>E.fromWireType(i(D,A)),write:(A,I)=>{var g=[];w(a,A,o.toWireType(g,I)),W(g)}}}),[{name:I.name,fromWireType:function(A){var I={};for(var g in C)I[g]=C[g].read(A);return B(A),I},toWireType:function(A,I){for(var Q in C)if(!(Q in I))throw TypeError(`Missing field: "${Q}"`);var E=g();for(Q in C)C[Q].write(E,I[Q]);return null!==A&&A.push(B,E),E},argPackAdvance:8,readValueFromPointer:m,destructorFunction:B}]})},s:function(A,I,g,B,Q){},x:function(A,I,g,B,Q){var C=_(g);AQ(A,{name:I=AI(I),fromWireType:function(A){return!!A},toWireType:function(A,I){return I?B:Q},argPackAdvance:8,readValueFromPointer:function(A){var B;if(1===g)B=D;else if(2===g)B=w;else if(4===g)B=s;else throw TypeError("Unknown boolean type size: "+I);return this.fromWireType(B[A>>C])},destructorFunction:null})},j:function(A,I,g,B,Q,C,E,i,D,o,w,a,s){w=AI(w),C=Ah(Q,C),i&&(i=Ah(E,i)),o&&(o=Ah(D,o)),s=Ah(a,s);var t=x(w);Ar(t,function(){AJ(`Cannot construct ${w} due to unbound types`,[B])}),$([A,I,g],B?[B]:[],function(I){I=I[0],E=B?(Q=I.registeredClass).instancePrototype:AF.prototype;var g,Q,E,D=v(t,function(){if(Object.getPrototypeOf(this)!==a)throw new Ag("Use 'new' to construct "+w);if(void 0===M.constructor_body)throw new Ag(w+" has no accessible constructor");var A=M.constructor_body[arguments.length];if(void 0===A)throw new Ag(`Tried to invoke ctor of ${w} with invalid number of parameters (${arguments.length}) - expected (${Object.keys(M.constructor_body).toString()}) parameters instead!`);return A.apply(this,arguments)}),a=Object.create(E,{constructor:{value:D}});D.prototype=a;var M=new AU(w,D,a,s,Q,C,i,o);M.baseClass&&(void 0===M.baseClass.__derivedClasses&&(M.baseClass.__derivedClasses=[]),M.baseClass.__derivedClasses.push(M));var N=new Ac(w,M,!0,!1,!1),F=new Ac(w+"*",M,!1,!1,!1),G=new Ac(w+" const*",M,!1,!0,!1);return Ao[A]={pointerType:F,constPointerType:G},U.hasOwnProperty(t)||P("Replacing nonexistant public symbol"),void 0!==U[t].overloadTable&&void 0!==g?U[t].overloadTable[g]=D:(U[t]=D,U[t].argCount=g),[N,F,G]})},g:function(A,I,g,B,Q,C,E,i){var D=Al(g,B);I=AI(I),C=Ah(Q,C),$([],[A],function(A){var B=`${(A=A[0]).name}.${I}`;function Q(){AJ(`Cannot call ${B} due to unbound types`,D)}I.startsWith("@@")&&(I=Symbol[I.substring(2)]);var o=A.registeredClass.constructor;return void 0===o[I]?(Q.argCount=g-1,o[I]=Q):(AG(o,I,B),o[I].overloadTable[g-1]=Q),$([],D,function(Q){var D=AY(B,[Q[0],null].concat(Q.slice(1)),null,C,E,i);if(void 0===o[I].overloadTable?(D.argCount=g-1,o[I]=D):o[I].overloadTable[g-1]=D,A.registeredClass.__derivedClasses)for(let g of A.registeredClass.__derivedClasses)g.constructor.hasOwnProperty(I)||(g.constructor[I]=D);return[]}),[]})},q:function(A,I,g,B,Q,C){I>0||L(void 0);var E=Al(I,g);Q=Ah(B,Q),$([],[A],function(A){var g=`constructor ${(A=A[0]).name}`;if(void 0===A.registeredClass.constructor_body&&(A.registeredClass.constructor_body=[]),void 0!==A.registeredClass.constructor_body[I-1])throw new Ag(`Cannot register multiple constructors with identical number of parameters (${I-1}) for class '${A.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return A.registeredClass.constructor_body[I-1]=()=>{AJ(`Cannot construct ${A.name} due to unbound types`,E)},$([],E,function(B){return B.splice(1,0,null),A.registeredClass.constructor_body[I-1]=AY(g,B,null,Q,C),[]}),[]})},h:function(A,I,g,B,Q,C,E,i,D){var o=Al(g,B);I=AI(I),C=Ah(Q,C),$([],[A],function(A){var B=`${(A=A[0]).name}.${I}`;function Q(){AJ(`Cannot call ${B} due to unbound types`,o)}I.startsWith("@@")&&(I=Symbol[I.substring(2)]),i&&A.registeredClass.pureVirtualFunctions.push(I);var w=A.registeredClass.instancePrototype,a=w[I];return void 0===a||void 0===a.overloadTable&&a.className!==A.name&&a.argCount===g-2?(Q.argCount=g-2,Q.className=A.name,w[I]=Q):(AG(w,I,B),w[I].overloadTable[g-2]=Q),$([],o,function(Q){var i=AY(B,Q,A,C,E,D);return void 0===w[I].overloadTable?(i.argCount=g-2,w[I]=i):w[I].overloadTable[g-2]=i,[]}),[]})},f:function(A,I,g,B,Q,C,E,i,D,o){I=AI(I),Q=Ah(B,Q),$([],[A],function(A){var B=`${(A=A[0]).name}.${I}`,w={get:function(){AJ(`Cannot access ${B} due to unbound types`,[g,E])},enumerable:!0,configurable:!0};return D?w.set=()=>{AJ(`Cannot access ${B} due to unbound types`,[g,E])}:w.set=A=>{AB(B+" is a read-only property")},Object.defineProperty(A.registeredClass.instancePrototype,I,w),$([],D?[g,E]:[g],function(g){var E=g[0],w={get:function(){var I=AK(this,A,B+" getter");return E.fromWireType(Q(C,I))},enumerable:!0};if(D){D=Ah(i,D);var a=g[1];w.set=function(I){var g=AK(this,A,B+" setter"),Q=[];D(o,g,a.toWireType(Q,I)),W(Q)}}return Object.defineProperty(A.registeredClass.instancePrototype,I,w),[]}),[]})},w:function(A,I){AQ(A,{name:I=AI(I),fromWireType:function(A){var I=AH.toValue(A);return Ad(A),I},toWireType:function(A,I){return AH.toHandle(I)},argPackAdvance:8,readValueFromPointer:m,destructorFunction:null})},p:function(A,I,g,B){var Q=_(g);function C(){}I=AI(I),C.values={},AQ(A,{name:I,constructor:C,fromWireType:function(A){return this.constructor.values[A]},toWireType:function(A,I){return I.value},argPackAdvance:8,readValueFromPointer:function(A,I,g){switch(I){case 0:return function(A){var I=g?D:o;return this.fromWireType(I[A])};case 1:return function(A){var I=g?w:a;return this.fromWireType(I[A>>1])};case 2:return function(A){var I=g?s:t;return this.fromWireType(I[A>>2])};default:throw TypeError("Unknown integer type: "+A)}}(I,Q,B),destructorFunction:null}),Ar(I,C)},c:function(A,I,g){var B=AV(A,"enum");I=AI(I);var Q=B.constructor,C=Object.create(B.constructor.prototype,{value:{value:g},constructor:{value:v(`${B.name}_${I}`,function(){})}});Q.values[g]=C,Q[I]=C},m:function(A,I,g){var B=_(g);AQ(A,{name:I=AI(I),fromWireType:function(A){return A},toWireType:function(A,I){return I},argPackAdvance:8,readValueFromPointer:function(A,I){switch(I){case 2:return function(A){return this.fromWireType(M[A>>2])};case 3:return function(A){return this.fromWireType(N[A>>3])};default:throw TypeError("Unknown float type: "+A)}}(I,B),destructorFunction:null})},d:function(A,I,g,B,Q){I=AI(I),-1===Q&&(Q=4294967295);var C=_(g),E=A=>A;if(0===B){var i=32-8*g;E=A=>A<<i>>>i}var M=I.includes("unsigned"),N=(A,I)=>{};AQ(A,{name:I,fromWireType:E,toWireType:M?function(A,I){return N(I,this.name),I>>>0}:function(A,I){return N(I,this.name),I},argPackAdvance:8,readValueFromPointer:function(A,I,g){switch(I){case 0:return g?function(A){return D[A]}:function(A){return o[A]};case 1:return g?function(A){return w[A>>1]}:function(A){return a[A>>1]};case 2:return g?function(A){return s[A>>2]}:function(A){return t[A>>2]};default:throw TypeError("Unknown integer type: "+A)}}(I,C,0!==B),destructorFunction:null})},a:function(A,I,g){var B=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][I];function Q(A){var I=t,g=I[A>>=2],Q=I[A+1];return new B(I.buffer,Q,g)}AQ(A,{name:g=AI(g),fromWireType:Q,argPackAdvance:8,readValueFromPointer:Q},{ignoreDuplicateRegistrations:!0})},r:function(A,I,g,B,Q,C,E,i,D,o,w,a){g=AI(g),C=Ah(Q,C),i=Ah(E,i),o=Ah(D,o),a=Ah(w,a),$([A],[I],function(A){return A=A[0],[new Ac(g,A.registeredClass,!1,!1,!0,A,B,C,i,o,a)]})},l:function(A,I){var g="std::string"===(I=AI(I));AQ(A,{name:I,fromWireType:function(A){var I,B=t[A>>2],Q=A+4;if(g)for(var C=Q,E=0;E<=B;++E){var i=Q+E;if(E==B||0==o[i]){var D=i-C,w=AZ(C,D);void 0===I?I=w:I+="\x00"+w,C=i+1}}else{for(var a=Array(B),E=0;E<B;++E)a[E]=String.fromCharCode(o[Q+E]);I=a.join("")}return A8(A),I},toWireType:function(A,I){I instanceof ArrayBuffer&&(I=new Uint8Array(I));var B,Q="string"==typeof I;Q||I instanceof Uint8Array||I instanceof Uint8ClampedArray||I instanceof Int8Array||AB("Cannot pass non-string to std::string");var C=A2(4+(B=g&&Q?Ap(I):I.length)+1),E=C+4;if(t[C>>2]=B,g&&Q)Af(I,E,B+1);else if(Q)for(var i=0;i<B;++i){var D=I.charCodeAt(i);D>255&&(A8(E),AB("String has UTF-16 code units that do not fit in 8 bits")),o[E+i]=D}else for(var i=0;i<B;++i)o[E+i]=I[i];return null!==A&&A.push(A8,C),C},argPackAdvance:8,readValueFromPointer:m,destructorFunction:function(A){A8(A)}})},i:function(A,I,g){var B,Q,C,E,i;g=AI(g),2===I?(B=AW,Q=Am,E=Aj,C=()=>a,i=1):4===I&&(B=Ab,Q=Az,E=Ax,C=()=>t,i=2),AQ(A,{name:g,fromWireType:function(A){for(var g,Q=t[A>>2],E=C(),D=A+4,o=0;o<=Q;++o){var w=A+4+o*I;if(o==Q||0==E[w>>i]){var a=w-D,s=B(D,a);void 0===g?g=s:g+="\x00"+s,D=w+I}}return A8(A),g},toWireType:function(A,B){"string"!=typeof B&&AB(`Cannot pass non-string to C++ string type ${g}`);var C=E(B),D=A2(4+C+I);return t[D>>2]=C>>i,Q(B,D+4,C+I),null!==A&&A.push(A8,D),D},argPackAdvance:8,readValueFromPointer:m,destructorFunction:function(A){A8(A)}})},n:function(A,I,g,B,Q,C){T[A]={name:AI(I),rawConstructor:Ah(g,B),rawDestructor:Ah(Q,C),fields:[]}},o:function(A,I,g,B,Q,C,E,i,D,o){T[A].fields.push({fieldName:AI(I),getterReturnType:g,getter:Ah(B,Q),getterContext:C,setterArgumentType:E,setter:Ah(i,D),setterContext:o})},y:function(A,I){AQ(A,{isVoid:!0,name:I=AI(I),argPackAdvance:0,fromWireType:function(){},toWireType:function(A,I){}})},A:function(A,I,g){A=AH.toValue(A),I=AV(I,"emval::as");var B=[],Q=AH.toHandle(B);return t[g>>2]=Q,I.toWireType(B,A)},D:function(A,I,g,B){A=AH.toValue(A);for(var Q=function(A,I){for(var g=Array(A),B=0;B<A;++B)g[B]=AV(t[I+4*B>>2],"parameter "+B);return g}(I,g),C=Array(I),E=0;E<I;++E){var i=Q[E];C[E]=i.readValueFromPointer(B),B+=i.argPackAdvance}var D=A.apply(void 0,C);return AH.toHandle(D)},b:Ad,G:function(A){return 0===A?AH.toHandle(AX()):(A=AO(A),AH.toHandle(AX()[A]))},B:function(A,I){return A=AH.toValue(A),I=AH.toValue(I),AH.toHandle(A[I])},E:function(A){A>4&&(AL.get(A).refcount+=1)},C:function(A){return AH.toHandle(AO(A))},z:function(A){W(AH.toValue(A)),Ad(A)},F:function(A,I){var g=(A=AV(A,"_emval_take_value")).readValueFromPointer(I);return AH.toHandle(g)},t:function(){L("")},v:function(){return Date.now()},u:function(A){o.length,L("OOM")}};!function(){var A,I,g,B={a:A0};function Q(A,I){var g,B,Q=A.exports;return U.asm=Q,g=U.asm.H.buffer,U.HEAP8=D=new Int8Array(g),U.HEAP16=w=new Int16Array(g),U.HEAP32=s=new Int32Array(g),U.HEAPU8=o=new Uint8Array(g),U.HEAPU16=a=new Uint16Array(g),U.HEAPU32=t=new Uint32Array(g),U.HEAPF32=M=new Float32Array(g),U.HEAPF64=N=new Float64Array(g),F=U.asm.K,B=U.asm.I,k.unshift(B),!function(A){if(Y--,U.monitorRunDependencies&&U.monitorRunDependencies(Y),0==Y&&(null!==l&&(clearInterval(l),l=null),K)){var I=K;K=null,I()}}(0),Q}if(Y++,U.monitorRunDependencies&&U.monitorRunDependencies(Y),U.instantiateWasm)try{return U.instantiateWasm(B,Q)}catch(A){c("Module.instantiateWasm callback failed with error: "+A),C(A)}(A=i,I=G,g=function(A){Q(A.instance)},A||"function"!=typeof WebAssembly.instantiateStreaming||H(I)||"function"!=typeof fetch?u(I,B,g):fetch(I,{credentials:"same-origin"}).then(A=>WebAssembly.instantiateStreaming(A,B).then(g,function(A){return c("wasm streaming compile failed: "+A),c("falling back to ArrayBuffer instantiation"),u(I,B,g)}))).catch(C)}();var A2=U._malloc=function(){return(A2=U._malloc=U.asm.J).apply(null,arguments)},A3=function(){return(A3=U.asm.L).apply(null,arguments)},A8=(U.__embind_initialize_bindings=function(){return(U.__embind_initialize_bindings=U.asm.M).apply(null,arguments)},function(){return(A8=U.asm.N).apply(null,arguments)}),A1=function(){return(A1=U.asm.O).apply(null,arguments)},A4=function(){return(A4=U.asm.P).apply(null,arguments)},A9=function(){return(A9=U.asm.Q).apply(null,arguments)},A5=function(){return(A5=U.asm.R).apply(null,arguments)};function A6(){!(Y>0)&&(!function(){if(U.preRun)for("function"==typeof U.preRun&&(U.preRun=[U.preRun]);U.preRun.length;){var A;A=U.preRun.shift(),S.unshift(A)}f(S)}(),Y>0||(U.setStatus?(U.setStatus("Running..."),setTimeout(function(){setTimeout(function(){U.setStatus("")},1),A()},1)):A()));function A(){!r&&(r=!0,U.calledRun=!0,h||(f(k),Q(U),U.onRuntimeInitialized&&U.onRuntimeInitialized(),function(){if(U.postRun)for("function"==typeof U.postRun&&(U.postRun=[U.postRun]);U.postRun.length;){var A;A=U.postRun.shift(),J.unshift(A)}f(J)}()))}}if(U.ccall=AP,U.cwrap=function(A,I,g,B){var Q=!g||g.every(A=>"number"===A||"boolean"===A);return"string"!==I&&Q&&!B?U["_"+A]:function(){return AP(A,I,g,arguments,B)}},U.setValue=function(A,I,g="i8"){switch(g.endsWith("*")&&(g="*"),g){case"i1":case"i8":D[A>>0]=I;break;case"i16":w[A>>1]=I;break;case"i32":s[A>>2]=I;break;case"i64":L("to do setValue(i64) use WASM_BIGINT");case"float":M[A>>2]=I;break;case"double":N[A>>3]=I;break;case"*":t[A>>2]=I;break;default:L(`invalid type for setValue: ${g}`)}},U.getValue=function(A,I="i8"){switch(I.endsWith("*")&&(I="*"),I){case"i1":case"i8":return D[A>>0];case"i16":return w[A>>1];case"i32":return s[A>>2];case"i64":L("to do getValue(i64) use WASM_BIGINT");case"float":return M[A>>2];case"double":return N[A>>3];case"*":return t[A>>2];default:L(`invalid type for getValue: ${I}`)}},K=function A(){r||A6(),r||(K=A)},U.preInit)for("function"==typeof U.preInit&&(U.preInit=[U.preInit]);U.preInit.length>0;)U.preInit.pop()();return A6(),I.ready}})();function C(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=Array(I);g<I;g++)B[g]=A[g];return B}function E(A){if(Array.isArray(A))return A}function i(A,I){if(!(A instanceof I))throw TypeError("Cannot call a class as a function")}function D(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}function o(A,I,g){return I&&D(A.prototype,I),g&&D(A,g),A}function w(A,I,g){return I in A?Object.defineProperty(A,I,{value:g,enumerable:!0,configurable:!0,writable:!0}):A[I]=g,A}function a(A,I){var g,B,Q=null==A?null:"undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(null!=Q){var C=[],E=!0,i=!1;try{for(Q=Q.call(A);!(E=(g=Q.next()).done)&&(C.push(g.value),!I||C.length!==I);E=!0);}catch(A){i=!0,B=A}finally{try{E||null==Q.return||Q.return()}finally{if(i)throw B}}return C}}function s(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function t(A,I){return E(A)||a(A,I)||M(A,I)||s()}function M(A,I){if(A){if("string"==typeof A)return C(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);if("Object"===g&&A.constructor&&(g=A.constructor.name),"Map"===g||"Set"===g)return Array.from(g);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return C(A,I)}}var N=function(){"use strict";function A(I,g){i(this,A),w(this,"module",void 0),w(this,"reader",void 0),w(this,"handle",null),w(this,"bw",0),w(this,"bh",0),w(this,"src",null),w(this,"out",null),w(this,"isAllocate",!1),w(this,"successCount",0),w(this,"edgMem",null),w(this,"src2",null),w(this,"outLen",null),w(this,"locations",null),w(this,"pdfCount",0),w(this,"geometry",void 0),w(this,"minPDFframes",1),w(this,"cropSizes",void 0),w(this,"canvasSizes",void 0),w(this,"_errorId",0),this.module=I,this.handle=null,this.bw=0,this.bh=0,this.src=null,this.out=null,this.isAllocate=!1,this.successCount=0,this._errorId=0,this.edgMem=null,this.src2=null,this.outLen=null,this.locations=null,this.reader=g,this.pdfCount=0}return o(A,[{key:"errorId",get:function(){return this._errorId},set:function(A){this._errorId=[1,2].includes(A)?0:A}},{key:"errorVal",get:function(){var A;return(-3===this.errorId||5===this.errorId)&&(A=0),(-2===this.errorId||4===this.errorId)&&(A=1),A}},{key:"init",value:function(A,I,g,B){this.geometry=A,this.minPDFframes=I,this.cropSizes=g,this.canvasSizes=B}},{key:"licenseError",value:function(){return{error:!0,errorType:"licenceKeyError",errorVal:this.errorVal}}},{key:"getLocations",value:function(){this.module.ccall("pdf417_getLocation",["boolean"],["number","number"],[this.handle,this.locations])}},{key:"setResizedData",value:function(A){this.module.HEAPU8.set(A,this.src)}},{key:"initReader",value:function(A){this.reader=new this.module.PDF417Reader(A)}},{key:"destroyReader",value:function(){this.reader=null}},{key:"setPdfData",value:function(A){this.module.HEAPU8.set(A.data,this.src2)}},{key:"readPdf",value:function(){return this.reader.processImage(this.src2,this.bw,this.bh,4*this.bw,this.module.EImageFormat.RGBA)}},{key:"releasePdf",value:function(){this.reader.reset()}},{key:"create",value:function(){}},{key:"free",value:function(){this.isAllocate&&(this.module._free(this.src2),this.isAllocate=!1)}},{key:"setSizes",value:function(A,I){this.bw=A,this.bh=I}},{key:"getSizes",value:function(){return{bw:this.bw,bh:this.bh}}},{key:"allocate",value:function(){this.isAllocate||(this.isAllocate=!0,this.src2=this.module._malloc(676e4))}},{key:"readPDF",value:function(A){this.releasePdf(),this.setPdfData(A);var I=this.readPdf();return this.errorId=I.status.value,(this.errorId?this.licenseError():null)||I}},{key:"drawCords",value:function(A){var I=this,g=[];if(A){var B=[];Object.entries(A).forEach(function(A){var g=t(A,2),Q=g[0],C=Math.trunc(g[1]),E=Q[0],i=+Q[1]-1;B[i]||(B[i]={x:0,y:0}),"x"===E?B[i].x=I.canvasSizes.width*C/I.bw:B[i].y=I.canvasSizes.height*C/I.bh});var Q=[B[3].x-B[0].x,B[3].y-B[0].y],C=[B[1].x-B[0].x,B[1].y-B[0].y],E=[B[2].x-B[1].x,B[2].y-B[1].y],i=[B[3].x-B[2].x,B[3].y-B[2].y],D=this.geometry.angleBetweenTwoVectors(Q,C),o=this.geometry.angleBetweenTwoVectors(E,i);D<=100&&D>=80&&o<=100&&o>=80&&(g=B)}return g}},{key:"proccessPDF",value:function(A){var I={status:!1,predict:!1,touch:!1,image:null,type:"pdf",error:null,coords:[],trackString:"",pdfSuccessCount:0,pdfCount:0,isSuccessProcess:!1},g=this.readPDF(A);return g.error?(I.error=g,I):(1===g.status.value||2===g.status.value?(I.coords=this.drawCords(g.location),I.isSuccessProcess=!0):(this.successCount+=1,this.drawCords(null)),2===g.status.value?(this.pdfCount+=1,this.pdfCount>=this.minPDFframes&&(this.successCount=0,this.pdfCount=0,I.trackString=g.data,I.status=!0,I.image=A)):this.pdfCount=0,I.pdfSuccessCount=this.successCount,I.pdfCount=this.pdfCount,I)}}]),A}(),F=g(7286);function G(A,I,g,B,Q,C,E){try{var i=A[C](E),D=i.value}catch(A){g(A);return}i.done?I(D):Promise.resolve(D).then(B,Q)}function r(A){return function(){var I=this,g=arguments;return new Promise(function(B,Q){var C=A.apply(I,g);function E(A){G(C,B,Q,E,i,"next",A)}function i(A){G(C,B,Q,E,i,"throw",A)}E(void 0)})}}function U(A,I){var g,B,Q,C,E={label:0,sent:function(){if(1&Q[0])throw Q[1];return Q[1]},trys:[],ops:[]};return C={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(C[Symbol.iterator]=function(){return this}),C;function i(C){return function(i){return function(C){if(g)throw TypeError("Generator is already executing.");for(;E;)try{if(g=1,B&&(Q=2&C[0]?B.return:C[0]?B.throw||((Q=B.return)&&Q.call(B),0):B.next)&&!(Q=Q.call(B,C[1])).done)return Q;switch(B=0,Q&&(C=[2&C[0],Q.value]),C[0]){case 0:case 1:Q=C;break;case 4:return E.label++,{value:C[1],done:!1};case 5:E.label++,B=C[1],C=[0];continue;case 7:C=E.ops.pop(),E.trys.pop();continue;default:if(!(Q=(Q=E.trys).length>0&&Q[Q.length-1])&&(6===C[0]||2===C[0])){E=0;continue}if(3===C[0]&&(!Q||C[1]>Q[0]&&C[1]<Q[3])){E.label=C[1];break}if(6===C[0]&&E.label<Q[1]){E.label=Q[1],Q=C;break}if(Q&&E.label<Q[2]){E.label=Q[2],E.ops.push(C);break}Q[2]&&E.ops.pop(),E.trys.pop();continue}C=I.call(A,E)}catch(A){C=[6,A],B=0}finally{g=Q=0}if(5&C[0])throw C[1];return{value:C[0]?C[1]:void 0,done:!0}}([C,i])}}}var e=function(){var A=r(function(A){var I,g,B,C;return U(this,function(E){switch(E.label){case 0:return I=A.pdf417key,[4,Q()];case 1:return B=new(g=E.sent()).PDF417Reader(I),(C=new N(g,B)).allocate(),F.Z.setModule("module","pdf",C),[2]}})});return function(I){return A.apply(this,arguments)}}();let R=e}}]);