scanbot-web-sdk 6.0.0-dev.2 → 6.0.0-dev.3
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.
- package/@types/consume-type.d.ts +2 -1
- package/@types/core/bridge/common.d.ts +1 -1
- package/@types/core/bridge/compiled/BarcodeScannerTypes.d.ts +5 -3
- package/@types/core/bridge/compiled/GDRTypes.d.ts +38 -0
- package/@types/core/bridge/compiled/GenericDocument.d.ts +38 -0
- package/@types/core/bridge/compiled/GenericDocumentRecognizerConfigs.d.ts +183 -0
- package/@types/core/bridge/compiled/GenericDocumentRecognizerTypes.d.ts +7 -6
- package/@types/core/bridge/compiled/GenericDocumentTypes.d.ts +38 -0
- package/@types/core/bridge/compiled/ParametricFilters.d.ts +4 -2
- package/@types/core/bridge/worker-bridge.d.ts +584 -26
- package/@types/core/worker/ScanbotSDK.Core.d.ts +18 -7
- package/@types/core-types.d.ts +3 -1
- package/@types/document-scanner-view.d.ts +3 -1
- package/@types/index.d.ts +39 -4
- package/@types/model/barcode/barcode-result.d.ts +12 -2
- package/@types/model/barcode/barcode.d.ts +2 -1
- package/@types/model/camera-info.d.ts +3 -2
- package/@types/model/configuration/barcode-scanner-configuration.d.ts +6 -3
- package/@types/model/configuration/cropping-view-configuration.d.ts +5 -0
- package/@types/model/configuration/document-scanner-configuration.d.ts +2 -8
- package/@types/model/configuration/generic-document-recognizer-configuration.d.ts +1 -1
- package/@types/model/configuration/initialization-options.d.ts +8 -0
- package/@types/model/configuration/mrz-scanner-configuration.d.ts +1 -1
- package/@types/model/configuration/scanner-configuration.d.ts +7 -0
- package/@types/model/configuration/selection-overlay-configuration.d.ts +2 -2
- package/@types/model/configuration/view-finder-scanner-configuration.d.ts +1 -1
- package/@types/model/error/media-error.d.ts +1 -0
- package/@types/scanbot-sdk.d.ts +355 -52
- package/@types/service/generic-document-recognizer.d.ts +3 -1
- package/@types/service/simple-mrz-recognizer.d.ts +3 -1
- package/@types/service/text-data-recognizer.d.ts +3 -1
- package/@types/ui2/common.d.ts +8 -0
- package/@types/ui2/configuration/ActionBarConfiguration.d.ts +30 -30
- package/@types/ui2/configuration/ArTrackingOverlayConfiguration.d.ts +220 -220
- package/@types/ui2/configuration/BarcodeInfoMapping.d.ts +51 -51
- package/@types/ui2/configuration/BarcodeItemMapper.d.ts +2 -2
- package/@types/ui2/configuration/BarcodeRecognizerConfiguration.d.ts +32 -32
- package/@types/ui2/configuration/BarcodeScannerConfiguration.d.ts +168 -168
- package/@types/ui2/configuration/BarcodeScannerTypes.d.ts +1 -6
- package/@types/ui2/configuration/BarcodeScannerUIResult.d.ts +29 -0
- package/@types/ui2/configuration/BarcodeTextLocalization.d.ts +124 -69
- package/@types/ui2/configuration/BarcodeTypes.d.ts +1 -1
- package/@types/ui2/configuration/BarcodeUseCase.d.ts +4 -3
- package/@types/ui2/configuration/CameraConfiguration.d.ts +32 -32
- package/@types/ui2/configuration/CameraPermission.d.ts +33 -33
- package/@types/ui2/configuration/Common.d.ts +190 -190
- package/@types/ui2/configuration/CommonFieldType.d.ts +1 -0
- package/@types/ui2/configuration/FindAndPickScanningModeUseCase.d.ts +364 -12
- package/@types/ui2/configuration/GenericDocument.d.ts +1 -0
- package/@types/ui2/configuration/MultipleScanningModeUseCase.d.ts +488 -488
- package/@types/ui2/configuration/ScanbotAlertDialog.d.ts +27 -27
- package/@types/ui2/configuration/SingleScanningModeUseCase.d.ts +169 -169
- package/@types/ui2/configuration/TopBarConfiguration.d.ts +36 -36
- package/@types/ui2/configuration/UserGuidanceConfiguration.d.ts +16 -16
- package/@types/ui2/configuration/ViewFinderConfiguration.d.ts +45 -45
- package/@types/ui2/configuration.d.ts +2 -1
- package/@types/ui2/controllers/barcode-scanner-controller.d.ts +2 -2
- package/@types/ui2/controllers/multiple-scanning-mode-controller.d.ts +4 -2
- package/@types/ui2/controllers/single-scanning-mode-controller.d.ts +4 -2
- package/@types/ui2/model/counted-barcodes.d.ts +12 -19
- package/@types/ui2/scanbot-sdk-ui.d.ts +2 -2
- package/@types/ui2/scanbot-ui-library.d.ts +3 -2
- package/@types/ui2/utils/barcode-mapper/expected-barcode-mapper.d.ts +13 -0
- package/@types/ui2/utils/barcode-mapper/i-barcode-mapper.d.ts +18 -0
- package/@types/ui2/utils/{barcode-mapper.d.ts → barcode-mapper/user-barcode-mapper.d.ts} +4 -16
- package/@types/ui2/utils/find-and-pick.ts/expected-barcode-counter.d.ts +7 -0
- package/@types/ui2/utils/styled-badge.d.ts +1 -1
- package/@types/ui2/views/ar/ar-badge.d.ts +18 -0
- package/@types/ui2/views/ar/ar-overlay-barcode-info.d.ts +5 -1
- package/@types/ui2/views/ar/vertical-positions.d.ts +12 -0
- package/@types/ui2/views/barcode-info/barcode-info.d.ts +3 -1
- package/@types/ui2/views/barcode-scanner.d.ts +5 -5
- package/@types/ui2/views/dialog/base/confirmation-dialog.d.ts +20 -0
- package/@types/ui2/views/dialog/find-and-pick-submit-dialog.d.ts +10 -0
- package/@types/ui2/views/drawer/barcode-result-drawer.d.ts +1 -1
- package/@types/ui2/views/drawer/counting-button.d.ts +1 -1
- package/@types/ui2/views/drawer/subviews/barcode-drawer-empty-state.d.ts +1 -1
- package/@types/ui2/views/drawer/subviews/barcode-list-item.d.ts +5 -4
- package/@types/ui2/views/drawer/subviews/barcode-list.d.ts +8 -1
- package/@types/ui2/views/drawer/subviews/drawer-header-content.d.ts +1 -1
- package/@types/utils/barcode-utils.d.ts +10 -0
- package/@types/utils/browser-cameras.d.ts +92 -0
- package/@types/utils/dto/Polygon.d.ts +2 -1
- package/@types/utils/stats.d.ts +4 -0
- package/@types/utils/video-stream.d.ts +3 -3
- package/@types/utils/video-to-image-data/two-d-video-to-image-data.d.ts +8 -0
- package/@types/utils/video-to-image-data/video-to-image-data.d.ts +5 -0
- package/@types/utils/video-to-image-data/webgl-video-to-image-data.d.ts +21 -0
- package/@types/view/barcode-polygon/animated-barcode-selection-overlay.d.ts +1 -0
- package/@types/view/scanbot-camera-view.d.ts +9 -3
- package/@types/worker/worker-bridge.d.ts +587 -30
- package/bundle/ScanbotSDK.min.js +4 -4
- package/bundle/ScanbotSDK.ui2.min.js +16 -16
- package/bundle/bin/barcode-scanner/ScanbotSDK.Asm-simd-threads.js +1 -1
- package/bundle/bin/barcode-scanner/ScanbotSDK.Asm-simd-threads.wasm +0 -0
- package/bundle/bin/barcode-scanner/ScanbotSDK.Asm-simd.wasm +0 -0
- package/bundle/bin/barcode-scanner/ScanbotSDK.Asm.wasm +0 -0
- package/bundle/bin/barcode-scanner/ScanbotSDK.Core-simd-threads.js +1 -1
- package/bundle/bin/barcode-scanner/ScanbotSDK.Core-simd.js +1 -1
- package/bundle/bin/barcode-scanner/ScanbotSDK.Core.js +1 -1
- package/bundle/bin/complete/ScanbotSDK.Asm-simd-threads.js +1 -1
- package/bundle/bin/complete/ScanbotSDK.Asm-simd-threads.wasm +0 -0
- package/bundle/bin/complete/ScanbotSDK.Asm-simd.wasm +0 -0
- package/bundle/bin/complete/ScanbotSDK.Asm.wasm +0 -0
- package/bundle/bin/complete/ScanbotSDK.Core-simd-threads.js +1 -1
- package/bundle/bin/complete/ScanbotSDK.Core-simd.js +1 -1
- package/bundle/bin/complete/ScanbotSDK.Core.js +1 -1
- package/bundle/bin/document-scanner/ScanbotSDK.Asm-simd-threads.js +1 -1
- package/bundle/bin/document-scanner/ScanbotSDK.Asm-simd-threads.wasm +0 -0
- package/bundle/bin/document-scanner/ScanbotSDK.Asm-simd.wasm +0 -0
- package/bundle/bin/document-scanner/ScanbotSDK.Asm.wasm +0 -0
- package/bundle/bin/document-scanner/ScanbotSDK.Core-simd-threads.js +1 -1
- package/bundle/bin/document-scanner/ScanbotSDK.Core-simd.js +1 -1
- package/bundle/bin/document-scanner/ScanbotSDK.Core.js +1 -1
- package/package.json +2 -2
- package/@types/core/bridge/compiled_schemas_v3/BarcodeConfigs.d.ts +0 -973
- package/@types/core/bridge/compiled_schemas_v3/BarcodeScannerTypes.d.ts +0 -183
- package/@types/core/bridge/compiled_schemas_v3/BarcodeTypes.d.ts +0 -183
- package/@types/core/bridge/compiled_schemas_v3/CheckRecognizerTypes.d.ts +0 -29
- package/@types/core/bridge/compiled_schemas_v3/CommonFieldType.d.ts +0 -59
- package/@types/core/bridge/compiled_schemas_v3/DocumentDetectorTypes.d.ts +0 -196
- package/@types/core/bridge/compiled_schemas_v3/DocumentQualityAnalyzerTypes.d.ts +0 -105
- package/@types/core/bridge/compiled_schemas_v3/EhicTypes.d.ts +0 -218
- package/@types/core/bridge/compiled_schemas_v3/FrameUtilities.d.ts +0 -18
- package/@types/core/bridge/compiled_schemas_v3/GenericDocument.d.ts +0 -198
- package/@types/core/bridge/compiled_schemas_v3/GenericDocumentRecognizerTypes.d.ts +0 -104
- package/@types/core/bridge/compiled_schemas_v3/GenericTextLineScannerTypes.d.ts +0 -165
- package/@types/core/bridge/compiled_schemas_v3/Geometry.d.ts +0 -49
- package/@types/core/bridge/compiled_schemas_v3/ImageProcessorTypes.d.ts +0 -13
- package/@types/core/bridge/compiled_schemas_v3/LicensePlateScannerTypes.d.ts +0 -67
- package/@types/core/bridge/compiled_schemas_v3/MRZTypes.d.ts +0 -52
- package/@types/core/bridge/compiled_schemas_v3/MedicalCertificateTypes.d.ts +0 -306
- package/@types/core/bridge/compiled_schemas_v3/OcrElements.d.ts +0 -129
- package/@types/core/bridge/compiled_schemas_v3/ParametricFilters.d.ts +0 -186
- package/@types/core/bridge/compiled_schemas_v3/PdfConfig.d.ts +0 -197
- package/@types/core/bridge/compiled_schemas_v3/TiffTypes.d.ts +0 -183
- package/@types/ui2/configuration/BarcodeItem.d.ts +0 -6
- package/@types/ui2/configuration/utils.d.ts +0 -6
- /package/@types/ui2/views/dialog/{styled-dialog.d.ts → base/styled-dialog.d.ts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=4)}([function(e,t,r){"use strict";(function(e){function n(e,t=!1){const r=[];return function e(n){if(n){if(n.constructor===ImageData){const e={data:n.data.slice(),width:n.width,height:n.height};return r.push(e.data.buffer),e}if(n.constructor===ArrayBuffer){const e=t?n.slice(0):n;if(r.push(e),t)return n}else if(ArrayBuffer.isView(n)){let e;if(t){e=new(0,n.constructor)(n.buffer.slice(0))}else e=n;if(r.push(e.buffer),t)return n}else if(Array.isArray(n))for(let t=0;t<n.length;++t){const r=e(n[t]);r&&(n[t]=r)}else if(n.constructor===Object)for(const t in n)if(n.hasOwnProperty(t)){const r=e(n[t]);r&&(n[t]=r)}}}(e),r}function i(e){return e.startsWith("http:")||e.startsWith("https:")}function o(t){const{allowSimd:r=!0,allowThreads:n=!0}=t||{};let i="";if(r&&function(){try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11]))}catch(e){return!1}}()){i+="-simd";n&&function(){if("undefined"!=typeof e&&"undefined"!=typeof e.versions&&"undefined"!=typeof e.versions.node)return!1;if(/(iPad|iPhone|iPod)/g.test(navigator.userAgent))return!1;try{return(new MessageChannel).port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11]))}catch(e){return!1}}()&&(i+="-threads")}return i}r.d(t,"a",(function(){return n})),r.d(t,"c",(function(){return i})),r.d(t,"b",(function(){return o}))}).call(this,r(1))},function(e,t){var r,n,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(e){if(r===setTimeout)return setTimeout(e,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:o}catch(e){r=o}try{n="function"==typeof clearTimeout?clearTimeout:s}catch(e){n=s}}();var u,c=[],l=!1,d=-1;function h(){l&&u&&(l=!1,u.length?c=u.concat(c):d=-1,c.length&&m())}function m(){if(!l){var e=a(h);l=!0;for(var t=c.length;t;){for(u=c,c=[];++d<t;)u&&u[d].run();d=-1,t=c.length}u=null,l=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===s||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function f(e,t){this.fun=e,this.array=t}function p(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];c.push(new f(e,t)),1!==c.length||l||a(m)},f.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=p,i.addListener=p,i.once=p,i.off=p,i.removeListener=p,i.removeAllListeners=p,i.emit=p,i.prependListener=p,i.prependOnceListener=p,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(e,t,r){"use strict";var n,i=(n="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,function(e={}){var t,r,i=e;i.ready=new Promise(((e,n)=>{t=e,r=n}));var o,s,a,u=Object.assign({},i),c="./this.program",l=(e,t)=>{throw t},d="";d=self.location.href,n&&(d=n),d=0!==d.indexOf("blob:")?d.substr(0,d.replace(/[?#].*/,"").lastIndexOf("/")+1):"",o=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},a=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)},s=(e,t,r)=>{var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?t(n.response):r()},n.onerror=r,n.send(null)};var h,m=i.print||console.log.bind(console),f=i.printErr||console.error.bind(console);Object.assign(i,u),u=null,i.arguments&&i.arguments,i.thisProgram&&(c=i.thisProgram),i.quit&&(l=i.quit),i.wasmBinary&&(h=i.wasmBinary);var p,g=i.noExitRuntime||!0;"object"!=typeof WebAssembly&&j("no native wasm support detected");var v,y,w,C,_,E,b,x,F,D=!1;function T(){var e=p.buffer;i.HEAP8=v=new Int8Array(e),i.HEAP16=w=new Int16Array(e),i.HEAPU8=y=new Uint8Array(e),i.HEAPU16=C=new Uint16Array(e),i.HEAP32=_=new Int32Array(e),i.HEAPU32=E=new Uint32Array(e),i.HEAPF32=b=new Float32Array(e),i.HEAPF64=x=new Float64Array(e)}var S,A,P,k,O=[],M=[],R=[],$=0,z=null,L=null;function I(e){$++,i.monitorRunDependencies&&i.monitorRunDependencies($)}function W(e){if($--,i.monitorRunDependencies&&i.monitorRunDependencies($),0==$&&(null!==z&&(clearInterval(z),z=null),L)){var t=L;L=null,t()}}function j(e){i.onAbort&&i.onAbort(e),f(e="Aborted("+e+")"),D=!0,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw r(t),t}function N(e){return e.startsWith("data:application/octet-stream;base64,")}function Q(e){if(e==S&&h)return new Uint8Array(h);if(a)return a(e);throw"both async and sync fetching of the wasm failed"}function B(e,t,r){return function(e){return h||"function"!=typeof fetch?Promise.resolve().then((()=>Q(e))):fetch(e,{credentials:"same-origin"}).then((t=>{if(!t.ok)throw"failed to load wasm binary file at '"+e+"'";return t.arrayBuffer()})).catch((()=>Q(e)))}(e).then((e=>WebAssembly.instantiate(e,t))).then((e=>e)).then(r,(e=>{f(`failed to asynchronously prepare wasm: ${e}`),j(e)}))}N(S="ScanbotSDK.Asm.wasm")||(A=S,S=i.locateFile?i.locateFile(A,d):d+A);var H={3710384:e=>hr(function(){return this[pe(e)].toString()}.apply((0,eval)("(()=>this)()")))};function U(e){this.name="ExitStatus",this.message=`Program terminated with exit(${e})`,this.status=e}var Z=e=>{for(;e.length>0;)e.shift()(i)},V=[],q=0,G=0;function Y(e){this.excPtr=e,this.ptr=e-24,this.set_type=function(e){E[this.ptr+4>>2]=e},this.get_type=function(){return E[this.ptr+4>>2]},this.set_destructor=function(e){E[this.ptr+8>>2]=e},this.get_destructor=function(){return E[this.ptr+8>>2]},this.set_caught=function(e){e=e?1:0,v[this.ptr+12>>0]=e},this.get_caught=function(){return 0!=v[this.ptr+12>>0]},this.set_rethrown=function(e){e=e?1:0,v[this.ptr+13>>0]=e},this.get_rethrown=function(){return 0!=v[this.ptr+13>>0]},this.init=function(e,t){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(t)},this.set_adjusted_ptr=function(e){E[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return E[this.ptr+16>>2]},this.get_exception_ptr=function(){if(kr(this.get_type()))return E[this.excPtr>>2];var e=this.get_adjusted_ptr();return 0!==e?e:this.excPtr}}var X=e=>{var t=G;if(!t)return Er(0),0;var r=new Y(t);r.set_adjusted_ptr(t);var n=r.get_type();if(!n)return Er(0),t;for(var i in e){var o=e[i];if(0===o||o===n)break;var s=r.ptr+16;if(Pr(o,n,s))return Er(o),t}return Er(n),t},K=()=>{var e=V.pop();e||j("no exception to throw");var t=e.excPtr;throw e.get_rethrown()||(V.push(e),e.set_rethrown(!0),e.set_caught(!1),q++),G=t},J={isAbs:e=>"/"===e.charAt(0),splitPath:e=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1),normalizeArray:(e,t)=>{for(var r=0,n=e.length-1;n>=0;n--){var i=e[n];"."===i?e.splice(n,1):".."===i?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r;r--)e.unshift("..");return e},normalize:e=>{var t=J.isAbs(e),r="/"===e.substr(-1);return(e=J.normalizeArray(e.split("/").filter((e=>!!e)),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},dirname:e=>{var t=J.splitPath(e),r=t[0],n=t[1];return r||n?(n&&(n=n.substr(0,n.length-1)),r+n):"."},basename:e=>{if("/"===e)return"/";var t=(e=(e=J.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?e:e.substr(t+1)},join:function(){var e=Array.prototype.slice.call(arguments);return J.normalize(e.join("/"))},join2:(e,t)=>J.normalize(e+"/"+t)},ee=e=>(ee=(()=>{if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues)return e=>crypto.getRandomValues(e);j("initRandomDevice")})())(e),te={resolve:function(){for(var e="",t=!1,r=arguments.length-1;r>=-1&&!t;r--){var n=r>=0?arguments[r]:fe.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,t=J.isAbs(n)}return(t?"/":"")+(e=J.normalizeArray(e.split("/").filter((e=>!!e)),!t).join("/"))||"."},relative:(e,t)=>{function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var r=e.length-1;r>=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=te.resolve(e).substr(1),t=te.resolve(t).substr(1);for(var n=r(e.split("/")),i=r(t.split("/")),o=Math.min(n.length,i.length),s=o,a=0;a<o;a++)if(n[a]!==i[a]){s=a;break}var u=[];for(a=s;a<n.length;a++)u.push("..");return(u=u.concat(i.slice(s))).join("/")}},re="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0,ne=(e,t,r)=>{for(var n=t+r,i=t;e[i]&&!(i>=n);)++i;if(i-t>16&&e.buffer&&re)return re.decode(e.subarray(t,i));for(var o="";t<i;){var s=e[t++];if(128&s){var a=63&e[t++];if(192!=(224&s)){var u=63&e[t++];if((s=224==(240&s)?(15&s)<<12|a<<6|u:(7&s)<<18|a<<12|u<<6|63&e[t++])<65536)o+=String.fromCharCode(s);else{var c=s-65536;o+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else o+=String.fromCharCode((31&s)<<6|a)}else o+=String.fromCharCode(s)}return o},ie=[],oe=e=>{for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n<=127?t++:n<=2047?t+=2:n>=55296&&n<=57343?(t+=4,++r):t+=3}return t},se=(e,t,r,n)=>{if(!(n>0))return 0;for(var i=r,o=r+n-1,s=0;s<e.length;++s){var a=e.charCodeAt(s);if(a>=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++s)),a<=127){if(r>=o)break;t[r++]=a}else if(a<=2047){if(r+1>=o)break;t[r++]=192|a>>6,t[r++]=128|63&a}else if(a<=65535){if(r+2>=o)break;t[r++]=224|a>>12,t[r++]=128|a>>6&63,t[r++]=128|63&a}else{if(r+3>=o)break;t[r++]=240|a>>18,t[r++]=128|a>>12&63,t[r++]=128|a>>6&63,t[r++]=128|63&a}}return t[r]=0,r-i};function ae(e,t,r){var n=r>0?r:oe(e)+1,i=new Array(n),o=se(e,i,0,i.length);return t&&(i.length=o),i}var ue={ttys:[],init(){},shutdown(){},register(e,t){ue.ttys[e]={input:[],output:[],ops:t},fe.registerDevice(e,ue.stream_ops)},stream_ops:{open(e){var t=ue.ttys[e.node.rdev];if(!t)throw new fe.ErrnoError(43);e.tty=t,e.seekable=!1},close(e){e.tty.ops.fsync(e.tty)},fsync(e){e.tty.ops.fsync(e.tty)},read(e,t,r,n,i){if(!e.tty||!e.tty.ops.get_char)throw new fe.ErrnoError(60);for(var o=0,s=0;s<n;s++){var a;try{a=e.tty.ops.get_char(e.tty)}catch(e){throw new fe.ErrnoError(29)}if(void 0===a&&0===o)throw new fe.ErrnoError(6);if(null==a)break;o++,t[r+s]=a}return o&&(e.node.timestamp=Date.now()),o},write(e,t,r,n,i){if(!e.tty||!e.tty.ops.put_char)throw new fe.ErrnoError(60);try{for(var o=0;o<n;o++)e.tty.ops.put_char(e.tty,t[r+o])}catch(e){throw new fe.ErrnoError(29)}return n&&(e.node.timestamp=Date.now()),o}},default_tty_ops:{get_char:e=>(()=>{if(!ie.length){var e=null;if("undefined"!=typeof window&&"function"==typeof window.prompt?null!==(e=window.prompt("Input: "))&&(e+="\n"):"function"==typeof readline&&null!==(e=readline())&&(e+="\n"),!e)return null;ie=ae(e,!0)}return ie.shift()})(),put_char(e,t){null===t||10===t?(m(ne(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync(e){e.output&&e.output.length>0&&(m(ne(e.output,0)),e.output=[])},ioctl_tcgets:e=>({c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}),ioctl_tcsets:(e,t,r)=>0,ioctl_tiocgwinsz:e=>[24,80]},default_tty1_ops:{put_char(e,t){null===t||10===t?(f(ne(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync(e){e.output&&e.output.length>0&&(f(ne(e.output,0)),e.output=[])}}},ce=e=>{e=((e,t)=>Math.ceil(e/t)*t)(e,65536);var t=xr(65536,e);return t?((e,t)=>(y.fill(0,e,e+t),e))(t,e):0},le={ops_table:null,mount:e=>le.createNode(null,"/",16895,0),createNode(e,t,r,n){if(fe.isBlkdev(r)||fe.isFIFO(r))throw new fe.ErrnoError(63);le.ops_table||(le.ops_table={dir:{node:{getattr:le.node_ops.getattr,setattr:le.node_ops.setattr,lookup:le.node_ops.lookup,mknod:le.node_ops.mknod,rename:le.node_ops.rename,unlink:le.node_ops.unlink,rmdir:le.node_ops.rmdir,readdir:le.node_ops.readdir,symlink:le.node_ops.symlink},stream:{llseek:le.stream_ops.llseek}},file:{node:{getattr:le.node_ops.getattr,setattr:le.node_ops.setattr},stream:{llseek:le.stream_ops.llseek,read:le.stream_ops.read,write:le.stream_ops.write,allocate:le.stream_ops.allocate,mmap:le.stream_ops.mmap,msync:le.stream_ops.msync}},link:{node:{getattr:le.node_ops.getattr,setattr:le.node_ops.setattr,readlink:le.node_ops.readlink},stream:{}},chrdev:{node:{getattr:le.node_ops.getattr,setattr:le.node_ops.setattr},stream:fe.chrdev_stream_ops}});var i=fe.createNode(e,t,r,n);return fe.isDir(i.mode)?(i.node_ops=le.ops_table.dir.node,i.stream_ops=le.ops_table.dir.stream,i.contents={}):fe.isFile(i.mode)?(i.node_ops=le.ops_table.file.node,i.stream_ops=le.ops_table.file.stream,i.usedBytes=0,i.contents=null):fe.isLink(i.mode)?(i.node_ops=le.ops_table.link.node,i.stream_ops=le.ops_table.link.stream):fe.isChrdev(i.mode)&&(i.node_ops=le.ops_table.chrdev.node,i.stream_ops=le.ops_table.chrdev.stream),i.timestamp=Date.now(),e&&(e.contents[t]=i,e.timestamp=i.timestamp),i},getFileDataAsTypedArray:e=>e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0),expandFileStorage(e,t){var r=e.contents?e.contents.length:0;if(!(r>=t)){t=Math.max(t,r*(r<1048576?2:1.125)>>>0),0!=r&&(t=Math.max(t,256));var n=e.contents;e.contents=new Uint8Array(t),e.usedBytes>0&&e.contents.set(n.subarray(0,e.usedBytes),0)}},resizeFileStorage(e,t){if(e.usedBytes!=t)if(0==t)e.contents=null,e.usedBytes=0;else{var r=e.contents;e.contents=new Uint8Array(t),r&&e.contents.set(r.subarray(0,Math.min(t,e.usedBytes))),e.usedBytes=t}},node_ops:{getattr(e){var t={};return t.dev=fe.isChrdev(e.mode)?e.id:1,t.ino=e.id,t.mode=e.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=e.rdev,fe.isDir(e.mode)?t.size=4096:fe.isFile(e.mode)?t.size=e.usedBytes:fe.isLink(e.mode)?t.size=e.link.length:t.size=0,t.atime=new Date(e.timestamp),t.mtime=new Date(e.timestamp),t.ctime=new Date(e.timestamp),t.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},setattr(e,t){void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp),void 0!==t.size&&le.resizeFileStorage(e,t.size)},lookup(e,t){throw fe.genericErrors[44]},mknod:(e,t,r,n)=>le.createNode(e,t,r,n),rename(e,t,r){if(fe.isDir(e.mode)){var n;try{n=fe.lookupNode(t,r)}catch(e){}if(n)for(var i in n.contents)throw new fe.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=r,t.contents[r]=e,t.timestamp=e.parent.timestamp,e.parent=t},unlink(e,t){delete e.contents[t],e.timestamp=Date.now()},rmdir(e,t){var r=fe.lookupNode(e,t);for(var n in r.contents)throw new fe.ErrnoError(55);delete e.contents[t],e.timestamp=Date.now()},readdir(e){var t=[".",".."];for(var r in e.contents)e.contents.hasOwnProperty(r)&&t.push(r);return t},symlink(e,t,r){var n=le.createNode(e,t,41471,0);return n.link=r,n},readlink(e){if(!fe.isLink(e.mode))throw new fe.ErrnoError(28);return e.link}},stream_ops:{read(e,t,r,n,i){var o=e.node.contents;if(i>=e.node.usedBytes)return 0;var s=Math.min(e.node.usedBytes-i,n);if(s>8&&o.subarray)t.set(o.subarray(i,i+s),r);else for(var a=0;a<s;a++)t[r+a]=o[i+a];return s},write(e,t,r,n,i,o){if(t.buffer===v.buffer&&(o=!1),!n)return 0;var s=e.node;if(s.timestamp=Date.now(),t.subarray&&(!s.contents||s.contents.subarray)){if(o)return s.contents=t.subarray(r,r+n),s.usedBytes=n,n;if(0===s.usedBytes&&0===i)return s.contents=t.slice(r,r+n),s.usedBytes=n,n;if(i+n<=s.usedBytes)return s.contents.set(t.subarray(r,r+n),i),n}if(le.expandFileStorage(s,i+n),s.contents.subarray&&t.subarray)s.contents.set(t.subarray(r,r+n),i);else for(var a=0;a<n;a++)s.contents[i+a]=t[r+a];return s.usedBytes=Math.max(s.usedBytes,i+n),n},llseek(e,t,r){var n=t;if(1===r?n+=e.position:2===r&&fe.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new fe.ErrnoError(28);return n},allocate(e,t,r){le.expandFileStorage(e.node,t+r),e.node.usedBytes=Math.max(e.node.usedBytes,t+r)},mmap(e,t,r,n,i){if(!fe.isFile(e.node.mode))throw new fe.ErrnoError(43);var o,s,a=e.node.contents;if(2&i||a.buffer!==v.buffer){if((r>0||r+t<a.length)&&(a=a.subarray?a.subarray(r,r+t):Array.prototype.slice.call(a,r,r+t)),s=!0,!(o=ce(t)))throw new fe.ErrnoError(48);v.set(a,o)}else s=!1,o=a.byteOffset;return{ptr:o,allocated:s}},msync:(e,t,r,n,i)=>(le.stream_ops.write(e,t,0,n,r,!1),0)}},de=(e,t,r,n)=>{var i=n?"":`al ${e}`;s(e,(r=>{var n;n=`Loading data file "${e}" failed (no arrayBuffer).`,r||j(n),t(new Uint8Array(r)),i&&W()}),(t=>{if(!r)throw`Loading data file "${e}" failed.`;r()})),i&&I()},he=i.preloadPlugins||[],me=(e,t)=>{var r=0;return e&&(r|=365),t&&(r|=146),r},fe={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath(e,t={}){if(!(e=te.resolve(e)))return{path:"",node:null};if((t=Object.assign({follow_mount:!0,recurse_count:0},t)).recurse_count>8)throw new fe.ErrnoError(32);for(var r=e.split("/").filter((e=>!!e)),n=fe.root,i="/",o=0;o<r.length;o++){var s=o===r.length-1;if(s&&t.parent)break;if(n=fe.lookupNode(n,r[o]),i=J.join2(i,r[o]),fe.isMountpoint(n)&&(!s||s&&t.follow_mount)&&(n=n.mounted.root),!s||t.follow)for(var a=0;fe.isLink(n.mode);){var u=fe.readlink(i);if(i=te.resolve(J.dirname(i),u),n=fe.lookupPath(i,{recurse_count:t.recurse_count+1}).node,a++>40)throw new fe.ErrnoError(32)}}return{path:i,node:n}},getPath(e){for(var t;;){if(fe.isRoot(e)){var r=e.mount.mountpoint;return t?"/"!==r[r.length-1]?`${r}/${t}`:r+t:r}t=t?`${e.name}/${t}`:e.name,e=e.parent}},hashName(e,t){for(var r=0,n=0;n<t.length;n++)r=(r<<5)-r+t.charCodeAt(n)|0;return(e+r>>>0)%fe.nameTable.length},hashAddNode(e){var t=fe.hashName(e.parent.id,e.name);e.name_next=fe.nameTable[t],fe.nameTable[t]=e},hashRemoveNode(e){var t=fe.hashName(e.parent.id,e.name);if(fe.nameTable[t]===e)fe.nameTable[t]=e.name_next;else for(var r=fe.nameTable[t];r;){if(r.name_next===e){r.name_next=e.name_next;break}r=r.name_next}},lookupNode(e,t){var r=fe.mayLookup(e);if(r)throw new fe.ErrnoError(r,e);for(var n=fe.hashName(e.id,t),i=fe.nameTable[n];i;i=i.name_next){var o=i.name;if(i.parent.id===e.id&&o===t)return i}return fe.lookup(e,t)},createNode(e,t,r,n){var i=new fe.FSNode(e,t,r,n);return fe.hashAddNode(i),i},destroyNode(e){fe.hashRemoveNode(e)},isRoot:e=>e===e.parent,isMountpoint:e=>!!e.mounted,isFile:e=>32768==(61440&e),isDir:e=>16384==(61440&e),isLink:e=>40960==(61440&e),isChrdev:e=>8192==(61440&e),isBlkdev:e=>24576==(61440&e),isFIFO:e=>4096==(61440&e),isSocket:e=>49152==(49152&e),flagsToPermissionString(e){var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t},nodePermissions:(e,t)=>fe.ignorePermissions||(!t.includes("r")||292&e.mode)&&(!t.includes("w")||146&e.mode)&&(!t.includes("x")||73&e.mode)?0:2,mayLookup(e){var t=fe.nodePermissions(e,"x");return t||(e.node_ops.lookup?0:2)},mayCreate(e,t){try{return fe.lookupNode(e,t),20}catch(e){}return fe.nodePermissions(e,"wx")},mayDelete(e,t,r){var n;try{n=fe.lookupNode(e,t)}catch(e){return e.errno}var i=fe.nodePermissions(e,"wx");if(i)return i;if(r){if(!fe.isDir(n.mode))return 54;if(fe.isRoot(n)||fe.getPath(n)===fe.cwd())return 10}else if(fe.isDir(n.mode))return 31;return 0},mayOpen:(e,t)=>e?fe.isLink(e.mode)?32:fe.isDir(e.mode)&&("r"!==fe.flagsToPermissionString(t)||512&t)?31:fe.nodePermissions(e,fe.flagsToPermissionString(t)):44,MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=fe.MAX_OPEN_FDS;e++)if(!fe.streams[e])return e;throw new fe.ErrnoError(33)},getStreamChecked(e){var t=fe.getStream(e);if(!t)throw new fe.ErrnoError(8);return t},getStream:e=>fe.streams[e],createStream:(e,t=-1)=>(fe.FSStream||(fe.FSStream=function(){this.shared={}},fe.FSStream.prototype={},Object.defineProperties(fe.FSStream.prototype,{object:{get(){return this.node},set(e){this.node=e}},isRead:{get(){return 1!=(2097155&this.flags)}},isWrite:{get(){return 0!=(2097155&this.flags)}},isAppend:{get(){return 1024&this.flags}},flags:{get(){return this.shared.flags},set(e){this.shared.flags=e}},position:{get(){return this.shared.position},set(e){this.shared.position=e}}})),e=Object.assign(new fe.FSStream,e),-1==t&&(t=fe.nextfd()),e.fd=t,fe.streams[t]=e,e),closeStream(e){fe.streams[e]=null},chrdev_stream_ops:{open(e){var t=fe.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek(){throw new fe.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,t)=>e<<8|t,registerDevice(e,t){fe.devices[e]={stream_ops:t}},getDevice:e=>fe.devices[e],getMounts(e){for(var t=[],r=[e];r.length;){var n=r.pop();t.push(n),r.push.apply(r,n.mounts)}return t},syncfs(e,t){"function"==typeof e&&(t=e,e=!1),fe.syncFSRequests++,fe.syncFSRequests>1&&f(`warning: ${fe.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var r=fe.getMounts(fe.root.mount),n=0;function i(e){return fe.syncFSRequests--,t(e)}function o(e){if(e)return o.errored?void 0:(o.errored=!0,i(e));++n>=r.length&&i(null)}r.forEach((t=>{if(!t.type.syncfs)return o(null);t.type.syncfs(t,e,o)}))},mount(e,t,r){var n,i="/"===r,o=!r;if(i&&fe.root)throw new fe.ErrnoError(10);if(!i&&!o){var s=fe.lookupPath(r,{follow_mount:!1});if(r=s.path,n=s.node,fe.isMountpoint(n))throw new fe.ErrnoError(10);if(!fe.isDir(n.mode))throw new fe.ErrnoError(54)}var a={type:e,opts:t,mountpoint:r,mounts:[]},u=e.mount(a);return u.mount=a,a.root=u,i?fe.root=u:n&&(n.mounted=a,n.mount&&n.mount.mounts.push(a)),u},unmount(e){var t=fe.lookupPath(e,{follow_mount:!1});if(!fe.isMountpoint(t.node))throw new fe.ErrnoError(28);var r=t.node,n=r.mounted,i=fe.getMounts(n);Object.keys(fe.nameTable).forEach((e=>{for(var t=fe.nameTable[e];t;){var r=t.name_next;i.includes(t.mount)&&fe.destroyNode(t),t=r}})),r.mounted=null;var o=r.mount.mounts.indexOf(n);r.mount.mounts.splice(o,1)},lookup:(e,t)=>e.node_ops.lookup(e,t),mknod(e,t,r){var n=fe.lookupPath(e,{parent:!0}).node,i=J.basename(e);if(!i||"."===i||".."===i)throw new fe.ErrnoError(28);var o=fe.mayCreate(n,i);if(o)throw new fe.ErrnoError(o);if(!n.node_ops.mknod)throw new fe.ErrnoError(63);return n.node_ops.mknod(n,i,t,r)},create:(e,t)=>(t=void 0!==t?t:438,t&=4095,t|=32768,fe.mknod(e,t,0)),mkdir:(e,t)=>(t=void 0!==t?t:511,t&=1023,t|=16384,fe.mknod(e,t,0)),mkdirTree(e,t){for(var r=e.split("/"),n="",i=0;i<r.length;++i)if(r[i]){n+="/"+r[i];try{fe.mkdir(n,t)}catch(e){if(20!=e.errno)throw e}}},mkdev:(e,t,r)=>("undefined"==typeof r&&(r=t,t=438),t|=8192,fe.mknod(e,t,r)),symlink(e,t){if(!te.resolve(e))throw new fe.ErrnoError(44);var r=fe.lookupPath(t,{parent:!0}).node;if(!r)throw new fe.ErrnoError(44);var n=J.basename(t),i=fe.mayCreate(r,n);if(i)throw new fe.ErrnoError(i);if(!r.node_ops.symlink)throw new fe.ErrnoError(63);return r.node_ops.symlink(r,n,e)},rename(e,t){var r,n,i=J.dirname(e),o=J.dirname(t),s=J.basename(e),a=J.basename(t);if(r=fe.lookupPath(e,{parent:!0}).node,n=fe.lookupPath(t,{parent:!0}).node,!r||!n)throw new fe.ErrnoError(44);if(r.mount!==n.mount)throw new fe.ErrnoError(75);var u,c=fe.lookupNode(r,s),l=te.relative(e,o);if("."!==l.charAt(0))throw new fe.ErrnoError(28);if("."!==(l=te.relative(t,i)).charAt(0))throw new fe.ErrnoError(55);try{u=fe.lookupNode(n,a)}catch(e){}if(c!==u){var d=fe.isDir(c.mode),h=fe.mayDelete(r,s,d);if(h)throw new fe.ErrnoError(h);if(h=u?fe.mayDelete(n,a,d):fe.mayCreate(n,a))throw new fe.ErrnoError(h);if(!r.node_ops.rename)throw new fe.ErrnoError(63);if(fe.isMountpoint(c)||u&&fe.isMountpoint(u))throw new fe.ErrnoError(10);if(n!==r&&(h=fe.nodePermissions(r,"w")))throw new fe.ErrnoError(h);fe.hashRemoveNode(c);try{r.node_ops.rename(c,n,a)}catch(e){throw e}finally{fe.hashAddNode(c)}}},rmdir(e){var t=fe.lookupPath(e,{parent:!0}).node,r=J.basename(e),n=fe.lookupNode(t,r),i=fe.mayDelete(t,r,!0);if(i)throw new fe.ErrnoError(i);if(!t.node_ops.rmdir)throw new fe.ErrnoError(63);if(fe.isMountpoint(n))throw new fe.ErrnoError(10);t.node_ops.rmdir(t,r),fe.destroyNode(n)},readdir(e){var t=fe.lookupPath(e,{follow:!0}).node;if(!t.node_ops.readdir)throw new fe.ErrnoError(54);return t.node_ops.readdir(t)},unlink(e){var t=fe.lookupPath(e,{parent:!0}).node;if(!t)throw new fe.ErrnoError(44);var r=J.basename(e),n=fe.lookupNode(t,r),i=fe.mayDelete(t,r,!1);if(i)throw new fe.ErrnoError(i);if(!t.node_ops.unlink)throw new fe.ErrnoError(63);if(fe.isMountpoint(n))throw new fe.ErrnoError(10);t.node_ops.unlink(t,r),fe.destroyNode(n)},readlink(e){var t=fe.lookupPath(e).node;if(!t)throw new fe.ErrnoError(44);if(!t.node_ops.readlink)throw new fe.ErrnoError(28);return te.resolve(fe.getPath(t.parent),t.node_ops.readlink(t))},stat(e,t){var r=fe.lookupPath(e,{follow:!t}).node;if(!r)throw new fe.ErrnoError(44);if(!r.node_ops.getattr)throw new fe.ErrnoError(63);return r.node_ops.getattr(r)},lstat:e=>fe.stat(e,!0),chmod(e,t,r){var n;if(!(n="string"==typeof e?fe.lookupPath(e,{follow:!r}).node:e).node_ops.setattr)throw new fe.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&t|-4096&n.mode,timestamp:Date.now()})},lchmod(e,t){fe.chmod(e,t,!0)},fchmod(e,t){var r=fe.getStreamChecked(e);fe.chmod(r.node,t)},chown(e,t,r,n){var i;if(!(i="string"==typeof e?fe.lookupPath(e,{follow:!n}).node:e).node_ops.setattr)throw new fe.ErrnoError(63);i.node_ops.setattr(i,{timestamp:Date.now()})},lchown(e,t,r){fe.chown(e,t,r,!0)},fchown(e,t,r){var n=fe.getStreamChecked(e);fe.chown(n.node,t,r)},truncate(e,t){if(t<0)throw new fe.ErrnoError(28);var r;if(!(r="string"==typeof e?fe.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new fe.ErrnoError(63);if(fe.isDir(r.mode))throw new fe.ErrnoError(31);if(!fe.isFile(r.mode))throw new fe.ErrnoError(28);var n=fe.nodePermissions(r,"w");if(n)throw new fe.ErrnoError(n);r.node_ops.setattr(r,{size:t,timestamp:Date.now()})},ftruncate(e,t){var r=fe.getStreamChecked(e);if(0==(2097155&r.flags))throw new fe.ErrnoError(28);fe.truncate(r.node,t)},utime(e,t,r){var n=fe.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(t,r)})},open(e,t,r){if(""===e)throw new fe.ErrnoError(44);var n;if(r="undefined"==typeof r?438:r,r=64&(t="string"==typeof t?(e=>{var t={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[e];if("undefined"==typeof t)throw new Error(`Unknown file open mode: ${e}`);return t})(t):t)?4095&r|32768:0,"object"==typeof e)n=e;else{e=J.normalize(e);try{n=fe.lookupPath(e,{follow:!(131072&t)}).node}catch(e){}}var o=!1;if(64&t)if(n){if(128&t)throw new fe.ErrnoError(20)}else n=fe.mknod(e,r,0),o=!0;if(!n)throw new fe.ErrnoError(44);if(fe.isChrdev(n.mode)&&(t&=-513),65536&t&&!fe.isDir(n.mode))throw new fe.ErrnoError(54);if(!o){var s=fe.mayOpen(n,t);if(s)throw new fe.ErrnoError(s)}512&t&&!o&&fe.truncate(n,0),t&=-131713;var a=fe.createStream({node:n,path:fe.getPath(n),flags:t,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return a.stream_ops.open&&a.stream_ops.open(a),!i.logReadFiles||1&t||(fe.readFiles||(fe.readFiles={}),e in fe.readFiles||(fe.readFiles[e]=1)),a},close(e){if(fe.isClosed(e))throw new fe.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{fe.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek(e,t,r){if(fe.isClosed(e))throw new fe.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new fe.ErrnoError(70);if(0!=r&&1!=r&&2!=r)throw new fe.ErrnoError(28);return e.position=e.stream_ops.llseek(e,t,r),e.ungotten=[],e.position},read(e,t,r,n,i){if(n<0||i<0)throw new fe.ErrnoError(28);if(fe.isClosed(e))throw new fe.ErrnoError(8);if(1==(2097155&e.flags))throw new fe.ErrnoError(8);if(fe.isDir(e.node.mode))throw new fe.ErrnoError(31);if(!e.stream_ops.read)throw new fe.ErrnoError(28);var o="undefined"!=typeof i;if(o){if(!e.seekable)throw new fe.ErrnoError(70)}else i=e.position;var s=e.stream_ops.read(e,t,r,n,i);return o||(e.position+=s),s},write(e,t,r,n,i,o){if(n<0||i<0)throw new fe.ErrnoError(28);if(fe.isClosed(e))throw new fe.ErrnoError(8);if(0==(2097155&e.flags))throw new fe.ErrnoError(8);if(fe.isDir(e.node.mode))throw new fe.ErrnoError(31);if(!e.stream_ops.write)throw new fe.ErrnoError(28);e.seekable&&1024&e.flags&&fe.llseek(e,0,2);var s="undefined"!=typeof i;if(s){if(!e.seekable)throw new fe.ErrnoError(70)}else i=e.position;var a=e.stream_ops.write(e,t,r,n,i,o);return s||(e.position+=a),a},allocate(e,t,r){if(fe.isClosed(e))throw new fe.ErrnoError(8);if(t<0||r<=0)throw new fe.ErrnoError(28);if(0==(2097155&e.flags))throw new fe.ErrnoError(8);if(!fe.isFile(e.node.mode)&&!fe.isDir(e.node.mode))throw new fe.ErrnoError(43);if(!e.stream_ops.allocate)throw new fe.ErrnoError(138);e.stream_ops.allocate(e,t,r)},mmap(e,t,r,n,i){if(0!=(2&n)&&0==(2&i)&&2!=(2097155&e.flags))throw new fe.ErrnoError(2);if(1==(2097155&e.flags))throw new fe.ErrnoError(2);if(!e.stream_ops.mmap)throw new fe.ErrnoError(43);return e.stream_ops.mmap(e,t,r,n,i)},msync:(e,t,r,n,i)=>e.stream_ops.msync?e.stream_ops.msync(e,t,r,n,i):0,munmap:e=>0,ioctl(e,t,r){if(!e.stream_ops.ioctl)throw new fe.ErrnoError(59);return e.stream_ops.ioctl(e,t,r)},readFile(e,t={}){if(t.flags=t.flags||0,t.encoding=t.encoding||"binary","utf8"!==t.encoding&&"binary"!==t.encoding)throw new Error(`Invalid encoding type "${t.encoding}"`);var r,n=fe.open(e,t.flags),i=fe.stat(e).size,o=new Uint8Array(i);return fe.read(n,o,0,i,0),"utf8"===t.encoding?r=ne(o,0):"binary"===t.encoding&&(r=o),fe.close(n),r},writeFile(e,t,r={}){r.flags=r.flags||577;var n=fe.open(e,r.flags,r.mode);if("string"==typeof t){var i=new Uint8Array(oe(t)+1),o=se(t,i,0,i.length);fe.write(n,i,0,o,void 0,r.canOwn)}else{if(!ArrayBuffer.isView(t))throw new Error("Unsupported data type");fe.write(n,t,0,t.byteLength,void 0,r.canOwn)}fe.close(n)},cwd:()=>fe.currentPath,chdir(e){var t=fe.lookupPath(e,{follow:!0});if(null===t.node)throw new fe.ErrnoError(44);if(!fe.isDir(t.node.mode))throw new fe.ErrnoError(54);var r=fe.nodePermissions(t.node,"x");if(r)throw new fe.ErrnoError(r);fe.currentPath=t.path},createDefaultDirectories(){fe.mkdir("/tmp"),fe.mkdir("/home"),fe.mkdir("/home/web_user")},createDefaultDevices(){fe.mkdir("/dev"),fe.registerDevice(fe.makedev(1,3),{read:()=>0,write:(e,t,r,n,i)=>n}),fe.mkdev("/dev/null",fe.makedev(1,3)),ue.register(fe.makedev(5,0),ue.default_tty_ops),ue.register(fe.makedev(6,0),ue.default_tty1_ops),fe.mkdev("/dev/tty",fe.makedev(5,0)),fe.mkdev("/dev/tty1",fe.makedev(6,0));var e=new Uint8Array(1024),t=0,r=()=>(0===t&&(t=ee(e).byteLength),e[--t]);fe.createDevice("/dev","random",r),fe.createDevice("/dev","urandom",r),fe.mkdir("/dev/shm"),fe.mkdir("/dev/shm/tmp")},createSpecialDirectories(){fe.mkdir("/proc");var e=fe.mkdir("/proc/self");fe.mkdir("/proc/self/fd"),fe.mount({mount(){var t=fe.createNode(e,"fd",16895,73);return t.node_ops={lookup(e,t){var r=+t,n=fe.getStreamChecked(r),i={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path}};return i.parent=i,i}},t}},{},"/proc/self/fd")},createStandardStreams(){i.stdin?fe.createDevice("/dev","stdin",i.stdin):fe.symlink("/dev/tty","/dev/stdin"),i.stdout?fe.createDevice("/dev","stdout",null,i.stdout):fe.symlink("/dev/tty","/dev/stdout"),i.stderr?fe.createDevice("/dev","stderr",null,i.stderr):fe.symlink("/dev/tty1","/dev/stderr"),fe.open("/dev/stdin",0),fe.open("/dev/stdout",1),fe.open("/dev/stderr",1)},ensureErrnoError(){fe.ErrnoError||(fe.ErrnoError=function(e,t){this.name="ErrnoError",this.node=t,this.setErrno=function(e){this.errno=e},this.setErrno(e),this.message="FS error"},fe.ErrnoError.prototype=new Error,fe.ErrnoError.prototype.constructor=fe.ErrnoError,[44].forEach((e=>{fe.genericErrors[e]=new fe.ErrnoError(e),fe.genericErrors[e].stack="<generic error, no stack>"})))},staticInit(){fe.ensureErrnoError(),fe.nameTable=new Array(4096),fe.mount(le,{},"/"),fe.createDefaultDirectories(),fe.createDefaultDevices(),fe.createSpecialDirectories(),fe.filesystems={MEMFS:le}},init(e,t,r){fe.init.initialized=!0,fe.ensureErrnoError(),i.stdin=e||i.stdin,i.stdout=t||i.stdout,i.stderr=r||i.stderr,fe.createStandardStreams()},quit(){fe.init.initialized=!1;for(var e=0;e<fe.streams.length;e++){var t=fe.streams[e];t&&fe.close(t)}},findObject(e,t){var r=fe.analyzePath(e,t);return r.exists?r.object:null},analyzePath(e,t){try{e=(n=fe.lookupPath(e,{follow:!t})).path}catch(e){}var r={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=fe.lookupPath(e,{parent:!0});r.parentExists=!0,r.parentPath=n.path,r.parentObject=n.node,r.name=J.basename(e),n=fe.lookupPath(e,{follow:!t}),r.exists=!0,r.path=n.path,r.object=n.node,r.name=n.node.name,r.isRoot="/"===n.path}catch(e){r.error=e.errno}return r},createPath(e,t,r,n){e="string"==typeof e?e:fe.getPath(e);for(var i=t.split("/").reverse();i.length;){var o=i.pop();if(o){var s=J.join2(e,o);try{fe.mkdir(s)}catch(e){}e=s}}return s},createFile(e,t,r,n,i){var o=J.join2("string"==typeof e?e:fe.getPath(e),t),s=me(n,i);return fe.create(o,s)},createDataFile(e,t,r,n,i,o){var s=t;e&&(e="string"==typeof e?e:fe.getPath(e),s=t?J.join2(e,t):e);var a=me(n,i),u=fe.create(s,a);if(r){if("string"==typeof r){for(var c=new Array(r.length),l=0,d=r.length;l<d;++l)c[l]=r.charCodeAt(l);r=c}fe.chmod(u,146|a);var h=fe.open(u,577);fe.write(h,r,0,r.length,0,o),fe.close(h),fe.chmod(u,a)}return u},createDevice(e,t,r,n){var i=J.join2("string"==typeof e?e:fe.getPath(e),t),o=me(!!r,!!n);fe.createDevice.major||(fe.createDevice.major=64);var s=fe.makedev(fe.createDevice.major++,0);return fe.registerDevice(s,{open(e){e.seekable=!1},close(e){n&&n.buffer&&n.buffer.length&&n(10)},read(e,t,n,i,o){for(var s=0,a=0;a<i;a++){var u;try{u=r()}catch(e){throw new fe.ErrnoError(29)}if(void 0===u&&0===s)throw new fe.ErrnoError(6);if(null==u)break;s++,t[n+a]=u}return s&&(e.node.timestamp=Date.now()),s},write(e,t,r,i,o){for(var s=0;s<i;s++)try{n(t[r+s])}catch(e){throw new fe.ErrnoError(29)}return i&&(e.node.timestamp=Date.now()),s}}),fe.mkdev(i,o,s)},forceLoadFile(e){if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!o)throw new Error("Cannot load without read() or XMLHttpRequest.");try{e.contents=ae(o(e.url),!0),e.usedBytes=e.contents.length}catch(e){throw new fe.ErrnoError(29)}},createLazyFile(e,t,r,n,i){function o(){this.lengthKnown=!1,this.chunks=[]}if(o.prototype.get=function(e){if(!(e>this.length-1||e<0)){var t=e%this.chunkSize,r=e/this.chunkSize|0;return this.getter(r)[t]}},o.prototype.setDataGetter=function(e){this.getter=e},o.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",r,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+r+". Status: "+e.status);var t,n=Number(e.getResponseHeader("Content-length")),i=(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t,o=(t=e.getResponseHeader("Content-Encoding"))&&"gzip"===t,s=1048576;i||(s=n);var a=this;a.setDataGetter((e=>{var t=e*s,i=(e+1)*s-1;if(i=Math.min(i,n-1),"undefined"==typeof a.chunks[e]&&(a.chunks[e]=((e,t)=>{if(e>t)throw new Error("invalid range ("+e+", "+t+") or no bytes requested!");if(t>n-1)throw new Error("only "+n+" bytes available! programmer error!");var i=new XMLHttpRequest;if(i.open("GET",r,!1),n!==s&&i.setRequestHeader("Range","bytes="+e+"-"+t),i.responseType="arraybuffer",i.overrideMimeType&&i.overrideMimeType("text/plain; charset=x-user-defined"),i.send(null),!(i.status>=200&&i.status<300||304===i.status))throw new Error("Couldn't load "+r+". Status: "+i.status);return void 0!==i.response?new Uint8Array(i.response||[]):ae(i.responseText||"",!0)})(t,i)),"undefined"==typeof a.chunks[e])throw new Error("doXHR failed!");return a.chunks[e]})),!o&&n||(s=n=1,n=this.getter(0).length,s=n,m("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=s,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){var s=new o;Object.defineProperties(s,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var a={isDevice:!1,contents:s}}else a={isDevice:!1,url:r};var u=fe.createFile(e,t,a,n,i);a.contents?u.contents=a.contents:a.url&&(u.contents=null,u.url=a.url),Object.defineProperties(u,{usedBytes:{get:function(){return this.contents.length}}});var c={};function l(e,t,r,n,i){var o=e.node.contents;if(i>=o.length)return 0;var s=Math.min(o.length-i,n);if(o.slice)for(var a=0;a<s;a++)t[r+a]=o[i+a];else for(a=0;a<s;a++)t[r+a]=o.get(i+a);return s}return Object.keys(u.stream_ops).forEach((e=>{var t=u.stream_ops[e];c[e]=function(){return fe.forceLoadFile(u),t.apply(null,arguments)}})),c.read=(e,t,r,n,i)=>(fe.forceLoadFile(u),l(e,t,r,n,i)),c.mmap=(e,t,r,n,i)=>{fe.forceLoadFile(u);var o=ce(t);if(!o)throw new fe.ErrnoError(48);return l(e,v,o,t,r),{ptr:o,allocated:!0}},u.stream_ops=c,u}},pe=(e,t)=>e?ne(y,e,t):"",ge={DEFAULT_POLLMASK:5,calculateAt(e,t,r){if(J.isAbs(t))return t;var n;if(n=-100===e?fe.cwd():ge.getStreamFromFD(e).path,0==t.length){if(!r)throw new fe.ErrnoError(44);return n}return J.join2(n,t)},doStat(e,t,r){try{var n=e(t)}catch(e){if(e&&e.node&&J.normalize(t)!==J.normalize(fe.getPath(e.node)))return-54;throw e}_[r>>2]=n.dev,_[r+4>>2]=n.mode,E[r+8>>2]=n.nlink,_[r+12>>2]=n.uid,_[r+16>>2]=n.gid,_[r+20>>2]=n.rdev,k=[n.size>>>0,(P=n.size,+Math.abs(P)>=1?P>0?+Math.floor(P/4294967296)>>>0:~~+Math.ceil((P-+(~~P>>>0))/4294967296)>>>0:0)],_[r+24>>2]=k[0],_[r+28>>2]=k[1],_[r+32>>2]=4096,_[r+36>>2]=n.blocks;var i=n.atime.getTime(),o=n.mtime.getTime(),s=n.ctime.getTime();return k=[Math.floor(i/1e3)>>>0,(P=Math.floor(i/1e3),+Math.abs(P)>=1?P>0?+Math.floor(P/4294967296)>>>0:~~+Math.ceil((P-+(~~P>>>0))/4294967296)>>>0:0)],_[r+40>>2]=k[0],_[r+44>>2]=k[1],E[r+48>>2]=i%1e3*1e3,k=[Math.floor(o/1e3)>>>0,(P=Math.floor(o/1e3),+Math.abs(P)>=1?P>0?+Math.floor(P/4294967296)>>>0:~~+Math.ceil((P-+(~~P>>>0))/4294967296)>>>0:0)],_[r+56>>2]=k[0],_[r+60>>2]=k[1],E[r+64>>2]=o%1e3*1e3,k=[Math.floor(s/1e3)>>>0,(P=Math.floor(s/1e3),+Math.abs(P)>=1?P>0?+Math.floor(P/4294967296)>>>0:~~+Math.ceil((P-+(~~P>>>0))/4294967296)>>>0:0)],_[r+72>>2]=k[0],_[r+76>>2]=k[1],E[r+80>>2]=s%1e3*1e3,k=[n.ino>>>0,(P=n.ino,+Math.abs(P)>=1?P>0?+Math.floor(P/4294967296)>>>0:~~+Math.ceil((P-+(~~P>>>0))/4294967296)>>>0:0)],_[r+88>>2]=k[0],_[r+92>>2]=k[1],0},doMsync(e,t,r,n,i){if(!fe.isFile(t.node.mode))throw new fe.ErrnoError(43);if(2&n)return 0;var o=y.slice(e,e+r);fe.msync(t,o,i,r,n)},varargs:void 0,get(){var e=_[ge.varargs>>2];return ge.varargs+=4,e},getp:()=>ge.get(),getStr:e=>pe(e),getStreamFromFD:e=>fe.getStreamChecked(e)},ve={},ye=e=>{for(;e.length;){var t=e.pop();e.pop()(t)}};function we(e){return this.fromWireType(_[e>>2])}var Ce={},_e={},Ee={},be=void 0,xe=e=>{throw new be(e)},Fe=(e,t,r)=>{function n(t){var n=r(t);n.length!==e.length&&xe("Mismatched type converter count");for(var i=0;i<e.length;++i)Pe(e[i],n[i])}e.forEach((function(e){Ee[e]=t}));var i=new Array(t.length),o=[],s=0;t.forEach(((e,t)=>{_e.hasOwnProperty(e)?i[t]=_e[e]:(o.push(e),Ce.hasOwnProperty(e)||(Ce[e]=[]),Ce[e].push((()=>{i[t]=_e[e],++s===o.length&&n(i)})))})),0===o.length&&n(i)},De=void 0,Te=e=>{for(var t="",r=e;y[r];)t+=De[y[r++]];return t},Se=void 0,Ae=e=>{throw new Se(e)};function Pe(e,t,r={}){if(!("argPackAdvance"in t))throw new TypeError("registerType registeredInstance requires argPackAdvance");return function(e,t,r={}){var n=t.name;if(e||Ae(`type "${n}" must have a positive integer typeid pointer`),_e.hasOwnProperty(e)){if(r.ignoreDuplicateRegistrations)return;Ae(`Cannot register type '${n}' twice`)}if(_e[e]=t,delete Ee[e],Ce.hasOwnProperty(e)){var i=Ce[e];delete Ce[e],i.forEach((e=>e()))}}(e,t,r)}var ke=8;function Oe(e){if(!(this instanceof et))return!1;if(!(e instanceof et))return!1;for(var t=this.$$.ptrType.registeredClass,r=this.$$.ptr,n=e.$$.ptrType.registeredClass,i=e.$$.ptr;t.baseClass;)r=t.upcast(r),t=t.baseClass;for(;n.baseClass;)i=n.upcast(i),n=n.baseClass;return t===n&&r===i}var Me=e=>{Ae(e.$$.ptrType.registeredClass.name+" instance already deleted")},Re=!1,$e=e=>{},ze=e=>{e.count.value-=1,0===e.count.value&&(e=>{e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)})(e)},Le=(e,t,r)=>{if(t===r)return e;if(void 0===r.baseClass)return null;var n=Le(e,t,r.baseClass);return null===n?null:r.downcast(n)},Ie={},We=()=>Object.keys(Ue).length,je=()=>{var e=[];for(var t in Ue)Ue.hasOwnProperty(t)&&e.push(Ue[t]);return e},Ne=[],Qe=()=>{for(;Ne.length;){var e=Ne.pop();e.$$.deleteScheduled=!1,e.delete()}},Be=void 0,He=e=>{Be=e,Ne.length&&Be&&Be(Qe)},Ue={},Ze=(e,t)=>(t=((e,t)=>{for(void 0===t&&Ae("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t})(e,t),Ue[t]),Ve=(e,t)=>(t.ptrType&&t.ptr||xe("makeClassHandle requires ptr and ptrType"),!!t.smartPtrType!=!!t.smartPtr&&xe("Both smartPtrType and smartPtr must be specified"),t.count={value:1},Ge(Object.create(e,{$$:{value:t}})));function qe(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var r=Ze(this.registeredClass,t);if(void 0!==r){if(0===r.$$.count.value)return r.$$.ptr=t,r.$$.smartPtr=e,r.clone();var n=r.clone();return this.destructor(e),n}function i(){return this.isSmartPointer?Ve(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):Ve(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var o,s=this.registeredClass.getActualType(t),a=Ie[s];if(!a)return i.call(this);o=this.isConst?a.constPointerType:a.pointerType;var u=Le(t,this.registeredClass,o.registeredClass);return null===u?i.call(this):this.isSmartPointer?Ve(o.registeredClass.instancePrototype,{ptrType:o,ptr:u,smartPtrType:this,smartPtr:e}):Ve(o.registeredClass.instancePrototype,{ptrType:o,ptr:u})}var Ge=e=>"undefined"==typeof FinalizationRegistry?(Ge=e=>e,e):(Re=new FinalizationRegistry((e=>{ze(e.$$)})),Ge=e=>{var t=e.$$;if(t.smartPtr){var r={$$:t};Re.register(e,r,e)}return e},$e=e=>Re.unregister(e),Ge(e));function Ye(){if(this.$$.ptr||Me(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e,t=Ge(Object.create(Object.getPrototypeOf(this),{$$:{value:(e=this.$$,{count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType})}}));return t.$$.count.value+=1,t.$$.deleteScheduled=!1,t}function Xe(){this.$$.ptr||Me(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Ae("Object already scheduled for deletion"),$e(this),ze(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)}function Ke(){return!this.$$.ptr}function Je(){return this.$$.ptr||Me(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Ae("Object already scheduled for deletion"),Ne.push(this),1===Ne.length&&Be&&Be(Qe),this.$$.deleteScheduled=!0,this}function et(){}var tt=e=>{if(void 0===e)return"_unknown";var t=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return t>=48&&t<=57?`_${e}`:e};function rt(e,t){return{[e=tt(e)]:function(){return t.apply(this,arguments)}}[e]}var nt=(e,t,r)=>{if(void 0===e[t].overloadTable){var n=e[t];e[t]=function(){return e[t].overloadTable.hasOwnProperty(arguments.length)||Ae(`Function '${r}' called with an invalid number of arguments (${arguments.length}) - expects one of (${e[t].overloadTable})!`),e[t].overloadTable[arguments.length].apply(this,arguments)},e[t].overloadTable=[],e[t].overloadTable[n.argCount]=n}},it=(e,t,r)=>{i.hasOwnProperty(e)?((void 0===r||void 0!==i[e].overloadTable&&void 0!==i[e].overloadTable[r])&&Ae(`Cannot register public name '${e}' twice`),nt(i,e,e),i.hasOwnProperty(r)&&Ae(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`),i[e].overloadTable[r]=t):(i[e]=t,void 0!==r&&(i[e].numArguments=r))};function ot(e,t,r,n,i,o,s,a){this.name=e,this.constructor=t,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=i,this.getActualType=o,this.upcast=s,this.downcast=a,this.pureVirtualFunctions=[]}var st=(e,t,r)=>{for(;t!==r;)t.upcast||Ae(`Expected null or instance of ${r.name}, got an instance of ${t.name}`),e=t.upcast(e),t=t.baseClass;return e};function at(e,t){if(null===t)return this.isReference&&Ae(`null is not a valid ${this.name}`),0;t.$$||Ae(`Cannot pass "${kt(t)}" as a ${this.name}`),t.$$.ptr||Ae(`Cannot pass deleted object as a pointer of type ${this.name}`);var r=t.$$.ptrType.registeredClass;return st(t.$$.ptr,r,this.registeredClass)}function ut(e,t){var r;if(null===t)return this.isReference&&Ae(`null is not a valid ${this.name}`),this.isSmartPointer?(r=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,r),r):0;t.$$||Ae(`Cannot pass "${kt(t)}" as a ${this.name}`),t.$$.ptr||Ae(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&t.$$.ptrType.isConst&&Ae(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);var n=t.$$.ptrType.registeredClass;if(r=st(t.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(void 0===t.$$.smartPtr&&Ae("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:t.$$.smartPtrType===this?r=t.$$.smartPtr:Ae(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:r=t.$$.smartPtr;break;case 2:if(t.$$.smartPtrType===this)r=t.$$.smartPtr;else{var i=t.clone();r=this.rawShare(r,Pt.toHandle((()=>i.delete()))),null!==e&&e.push(this.rawDestructor,r)}break;default:Ae("Unsupporting sharing policy")}return r}function ct(e,t){if(null===t)return this.isReference&&Ae(`null is not a valid ${this.name}`),0;t.$$||Ae(`Cannot pass "${kt(t)}" as a ${this.name}`),t.$$.ptr||Ae(`Cannot pass deleted object as a pointer of type ${this.name}`),t.$$.ptrType.isConst&&Ae(`Cannot convert argument of type ${t.$$.ptrType.name} to parameter type ${this.name}`);var r=t.$$.ptrType.registeredClass;return st(t.$$.ptr,r,this.registeredClass)}function lt(e){return this.fromWireType(E[e>>2])}function dt(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e}function ht(e){this.rawDestructor&&this.rawDestructor(e)}var mt=e=>{null!==e&&e.delete()};function ft(e,t,r,n,i,o,s,a,u,c,l){this.name=e,this.registeredClass=t,this.isReference=r,this.isConst=n,this.isSmartPointer=i,this.pointeeType=o,this.sharingPolicy=s,this.rawGetPointee=a,this.rawConstructor=u,this.rawShare=c,this.rawDestructor=l,i||void 0!==t.baseClass?this.toWireType=ut:n?(this.toWireType=at,this.destructorFunction=null):(this.toWireType=ct,this.destructorFunction=null)}var pt=(e,t,r)=>{i.hasOwnProperty(e)||xe("Replacing nonexistant public symbol"),void 0!==i[e].overloadTable&&void 0!==r?i[e].overloadTable[r]=t:(i[e]=t,i[e].argCount=r)},gt=e=>F.get(e),vt=(e,t,r)=>e.includes("j")?((e,t,r)=>{var n=i["dynCall_"+e];return r&&r.length?n.apply(null,[t].concat(r)):n.call(null,t)})(e,t,r):gt(t).apply(null,r),yt=(e,t)=>{var r,n,i,o=(e=Te(e)).includes("j")?(r=e,n=t,i=[],function(){return i.length=0,Object.assign(i,arguments),vt(r,n,i)}):gt(t);return"function"!=typeof o&&Ae(`unknown function pointer with signature ${e}: ${t}`),o},wt=void 0,Ct=e=>{var t=br(e),r=Te(t);return Cr(t),r},_t=(e,t)=>{var r=[],n={};throw t.forEach((function e(t){n[t]||_e[t]||(Ee[t]?Ee[t].forEach(e):(r.push(t),n[t]=!0))})),new wt(`${e}: `+r.map(Ct).join([", "]))},Et=(e,t)=>{for(var r=[],n=0;n<e;n++)r.push(E[t+4*n>>2]);return r};function bt(e,t){if(!(e instanceof Function))throw new TypeError(`new_ called with constructor type ${typeof e} which is not a function`);var r=rt(e.name||"unknownFunctionName",(function(){}));r.prototype=e.prototype;var n=new r,i=e.apply(n,t);return i instanceof Object?i:n}function xt(e,t,r,n,i,o){var s=t.length;s<2&&Ae("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var a=null!==t[1]&&null!==r,u=!1,c=1;c<t.length;++c)if(null!==t[c]&&void 0===t[c].destructorFunction){u=!0;break}var l="void"!==t[0].name,d="",h="";for(c=0;c<s-2;++c)d+=(0!==c?", ":"")+"arg"+c,h+=(0!==c?", ":"")+"arg"+c+"Wired";var m=`\n return function ${tt(e)}(${d}) {\n if (arguments.length !== ${s-2}) {\n throwBindingError('function ${e} called with ' + arguments.length + ' arguments, expected ${s-2}');\n }`;u&&(m+="var destructors = [];\n");var f=u?"destructors":"null",p=["throwBindingError","invoker","fn","runDestructors","retType","classParam"],g=[Ae,n,i,ye,t[0],t[1]];for(a&&(m+="var thisWired = classParam.toWireType("+f+", this);\n"),c=0;c<s-2;++c)m+="var arg"+c+"Wired = argType"+c+".toWireType("+f+", arg"+c+"); // "+t[c+2].name+"\n",p.push("argType"+c),g.push(t[c+2]);if(a&&(h="thisWired"+(h.length>0?", ":"")+h),m+=(l||o?"var rv = ":"")+"invoker(fn"+(h.length>0?", ":"")+h+");\n",u)m+="runDestructors(destructors);\n";else for(c=a?1:2;c<t.length;++c){var v=1===c?"thisWired":"arg"+(c-2)+"Wired";null!==t[c].destructorFunction&&(m+=v+"_dtor("+v+"); // "+t[c].name+"\n",p.push(v+"_dtor"),g.push(t[c].destructorFunction))}return l&&(m+="var ret = retType.fromWireType(rv);\nreturn ret;\n"),m+="}\n",p.push(m),bt(Function,p).apply(null,g)}function Ft(){this.allocated=[void 0],this.freelist=[]}var Dt,Tt=new Ft,St=e=>{e>=Tt.reserved&&0==--Tt.get(e).refcount&&Tt.free(e)},At=()=>{for(var e=0,t=Tt.reserved;t<Tt.allocated.length;++t)void 0!==Tt.allocated[t]&&++e;return e},Pt={toValue:e=>(e||Ae("Cannot use deleted val. handle = "+e),Tt.get(e).value),toHandle:e=>{switch(e){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:return Tt.allocate({refcount:1,value:e})}}},kt=e=>{if(null===e)return"null";var t=typeof e;return"object"===t||"array"===t||"function"===t?e.toString():""+e},Ot=(e,t)=>{switch(t){case 4:return function(e){return this.fromWireType(b[e>>2])};case 8:return function(e){return this.fromWireType(x[e>>3])};default:throw new TypeError(`invalid float width (${t}): ${e}`)}},Mt=(e,t,r)=>{switch(t){case 1:return r?e=>v[e>>0]:e=>y[e>>0];case 2:return r?e=>w[e>>1]:e=>C[e>>1];case 4:return r?e=>_[e>>2]:e=>E[e>>2];default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},Rt=(e,t,r)=>se(e,y,t,r),$t="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,zt=(e,t)=>{for(var r=e,n=r>>1,i=n+t/2;!(n>=i)&&C[n];)++n;if((r=n<<1)-e>32&&$t)return $t.decode(y.subarray(e,r));for(var o="",s=0;!(s>=t/2);++s){var a=w[e+2*s>>1];if(0==a)break;o+=String.fromCharCode(a)}return o},Lt=(e,t,r)=>{if(void 0===r&&(r=2147483647),r<2)return 0;for(var n=t,i=(r-=2)<2*e.length?r/2:e.length,o=0;o<i;++o){var s=e.charCodeAt(o);w[t>>1]=s,t+=2}return w[t>>1]=0,t-n},It=e=>2*e.length,Wt=(e,t)=>{for(var r=0,n="";!(r>=t/4);){var i=_[e+4*r>>2];if(0==i)break;if(++r,i>=65536){var o=i-65536;n+=String.fromCharCode(55296|o>>10,56320|1023&o)}else n+=String.fromCharCode(i)}return n},jt=(e,t,r)=>{if(void 0===r&&(r=2147483647),r<4)return 0;for(var n=t,i=n+r-4,o=0;o<e.length;++o){var s=e.charCodeAt(o);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++o)),_[t>>2]=s,(t+=4)+4>i)break}return _[t>>2]=0,t-n},Nt=e=>{for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n>=55296&&n<=57343&&++r,t+=4}return t},Qt=(e,t)=>{var r=_e[e];return void 0===r&&Ae(t+" has unknown type "+Ct(e)),r},Bt={},Ht=e=>{var t=Bt[e];return void 0===t?Te(e):t},Ut=[],Zt=()=>"object"==typeof globalThis?globalThis:Function("return this")(),Vt=[],qt=(e,t)=>t+2097152>>>0<4194305-!!e?(e>>>0)+4294967296*t:NaN,Gt=e=>e%4==0&&(e%100!=0||e%400==0),Yt=[0,31,60,91,121,152,182,213,244,274,305,335],Xt=[0,31,59,90,120,151,181,212,243,273,304,334],Kt=e=>{var t=oe(e)+1,r=wr(t);return r&&Rt(e,r,t),r},Jt=[],er=(e,t,r)=>{var n=((e,t)=>{var r;for(Jt.length=0;r=y[e++];)t+=105!=r&&t%8?4:0,Jt.push(105==r?_[t>>2]:x[t>>3]),t+=105==r?4:8;return Jt})(t,r);return H[e].apply(null,n)};Dt=()=>performance.now();var tr,rr,nr,ir=e=>{var t=(e-p.buffer.byteLength+65535)/65536;try{return p.grow(t),T(),1}catch(e){}},or={},sr=()=>{if(!sr.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:c||"./this.program"};for(var t in or)void 0===or[t]?delete e[t]:e[t]=or[t];var r=[];for(var t in e)r.push(`${t}=${e[t]}`);sr.strings=r}return sr.strings},ar=e=>{g||(i.onExit&&i.onExit(e),D=!0),l(e,new U(e))},ur=(e,t)=>{ar(e)},cr=[31,29,31,30,31,30,31,31,30,31,30,31],lr=[31,28,31,30,31,30,31,31,30,31,30,31],dr=(e,t,r,n)=>{var i=E[n+40>>2],o={tm_sec:_[n>>2],tm_min:_[n+4>>2],tm_hour:_[n+8>>2],tm_mday:_[n+12>>2],tm_mon:_[n+16>>2],tm_year:_[n+20>>2],tm_wday:_[n+24>>2],tm_yday:_[n+28>>2],tm_isdst:_[n+32>>2],tm_gmtoff:_[n+36>>2],tm_zone:i?pe(i):""},s=pe(r),a={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var u in a)s=s.replace(new RegExp(u,"g"),a[u]);var c=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],l=["January","February","March","April","May","June","July","August","September","October","November","December"];function d(e,t,r){for(var n="number"==typeof e?e.toString():e||"";n.length<t;)n=r[0]+n;return n}function h(e,t){return d(e,t,"0")}function m(e,t){function r(e){return e<0?-1:e>0?1:0}var n;return 0===(n=r(e.getFullYear()-t.getFullYear()))&&0===(n=r(e.getMonth()-t.getMonth()))&&(n=r(e.getDate()-t.getDate())),n}function f(e){switch(e.getDay()){case 0:return new Date(e.getFullYear()-1,11,29);case 1:return e;case 2:return new Date(e.getFullYear(),0,3);case 3:return new Date(e.getFullYear(),0,2);case 4:return new Date(e.getFullYear(),0,1);case 5:return new Date(e.getFullYear()-1,11,31);case 6:return new Date(e.getFullYear()-1,11,30)}}function p(e){var t=((e,t)=>{for(var r=new Date(e.getTime());t>0;){var n=Gt(r.getFullYear()),i=r.getMonth(),o=(n?cr:lr)[i];if(!(t>o-r.getDate()))return r.setDate(r.getDate()+t),r;t-=o-r.getDate()+1,r.setDate(1),i<11?r.setMonth(i+1):(r.setMonth(0),r.setFullYear(r.getFullYear()+1))}return r})(new Date(e.tm_year+1900,0,1),e.tm_yday),r=new Date(t.getFullYear(),0,4),n=new Date(t.getFullYear()+1,0,4),i=f(r),o=f(n);return m(i,t)<=0?m(o,t)<=0?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var g={"%a":e=>c[e.tm_wday].substring(0,3),"%A":e=>c[e.tm_wday],"%b":e=>l[e.tm_mon].substring(0,3),"%B":e=>l[e.tm_mon],"%C":e=>h((e.tm_year+1900)/100|0,2),"%d":e=>h(e.tm_mday,2),"%e":e=>d(e.tm_mday,2," "),"%g":e=>p(e).toString().substring(2),"%G":e=>p(e),"%H":e=>h(e.tm_hour,2),"%I":e=>{var t=e.tm_hour;return 0==t?t=12:t>12&&(t-=12),h(t,2)},"%j":e=>h(e.tm_mday+((e,t)=>{for(var r=0,n=0;n<=t;r+=e[n++]);return r})(Gt(e.tm_year+1900)?cr:lr,e.tm_mon-1),3),"%m":e=>h(e.tm_mon+1,2),"%M":e=>h(e.tm_min,2),"%n":()=>"\n","%p":e=>e.tm_hour>=0&&e.tm_hour<12?"AM":"PM","%S":e=>h(e.tm_sec,2),"%t":()=>"\t","%u":e=>e.tm_wday||7,"%U":e=>{var t=e.tm_yday+7-e.tm_wday;return h(Math.floor(t/7),2)},"%V":e=>{var t=Math.floor((e.tm_yday+7-(e.tm_wday+6)%7)/7);if((e.tm_wday+371-e.tm_yday-2)%7<=2&&t++,t){if(53==t){var r=(e.tm_wday+371-e.tm_yday)%7;4==r||3==r&&Gt(e.tm_year)||(t=1)}}else{t=52;var n=(e.tm_wday+7-e.tm_yday-1)%7;(4==n||5==n&&Gt(e.tm_year%400-1))&&t++}return h(t,2)},"%w":e=>e.tm_wday,"%W":e=>{var t=e.tm_yday+7-(e.tm_wday+6)%7;return h(Math.floor(t/7),2)},"%y":e=>(e.tm_year+1900).toString().substring(2),"%Y":e=>e.tm_year+1900,"%z":e=>{var t=e.tm_gmtoff,r=t>=0;return t=(t=Math.abs(t)/60)/60*100+t%60,(r?"+":"-")+String("0000"+t).slice(-4)},"%Z":e=>e.tm_zone,"%%":()=>"%"};for(var u in s=s.replace(/%%/g,"\0\0"),g)s.includes(u)&&(s=s.replace(new RegExp(u,"g"),g[u](o)));var y,w,C=ae(s=s.replace(/\0\0/g,"%"),!1);return C.length>t?0:(y=C,w=e,v.set(y,w),C.length-1)},hr=Kt,mr=function(e,t,r,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=fe.nextInode++,this.name=t,this.mode=r,this.node_ops={},this.stream_ops={},this.rdev=n},fr=365,pr=146;Object.defineProperties(mr.prototype,{read:{get:function(){return(this.mode&fr)===fr},set:function(e){e?this.mode|=fr:this.mode&=-366}},write:{get:function(){return(this.mode&pr)===pr},set:function(e){e?this.mode|=pr:this.mode&=-147}},isFolder:{get:function(){return fe.isDir(this.mode)}},isDevice:{get:function(){return fe.isChrdev(this.mode)}}}),fe.FSNode=mr,fe.createPreloadedFile=(e,t,r,n,i,o,s,a,u,c)=>{var l=t?te.resolve(J.join2(e,t)):e;function d(r){function d(r){c&&c(),a||fe.createDataFile(e,t,r,n,i,u),o&&o(),W()}((e,t,r,n)=>{"undefined"!=typeof Browser&&Browser.init();var i=!1;return he.forEach((o=>{i||o.canHandle(t)&&(o.handle(e,t,r,n),i=!0)})),i})(r,l,d,(()=>{s&&s(),W()}))||d(r)}I(),"string"==typeof r?de(r,(e=>d(e)),s):d(r)},fe.staticInit(),be=i.InternalError=class extends Error{constructor(e){super(e),this.name="InternalError"}},(()=>{for(var e=new Array(256),t=0;t<256;++t)e[t]=String.fromCharCode(t);De=e})(),Se=i.BindingError=class extends Error{constructor(e){super(e),this.name="BindingError"}},et.prototype.isAliasOf=Oe,et.prototype.clone=Ye,et.prototype.delete=Xe,et.prototype.isDeleted=Ke,et.prototype.deleteLater=Je,i.getInheritedInstanceCount=We,i.getLiveInheritedInstances=je,i.flushPendingDeletes=Qe,i.setDelayFunction=He,ft.prototype.getPointee=dt,ft.prototype.destructor=ht,ft.prototype.argPackAdvance=ke,ft.prototype.readValueFromPointer=lt,ft.prototype.deleteObject=mt,ft.prototype.fromWireType=qe,wt=i.UnboundTypeError=(tr=Error,(nr=rt(rr="UnboundTypeError",(function(e){this.name=rr,this.message=e;var t=new Error(e).stack;void 0!==t&&(this.stack=this.toString()+"\n"+t.replace(/^Error(:[^\n]*)?\n/,""))}))).prototype=Object.create(tr.prototype),nr.prototype.constructor=nr,nr.prototype.toString=function(){return void 0===this.message?this.name:`${this.name}: ${this.message}`},nr),Object.assign(Ft.prototype,{get(e){return this.allocated[e]},has(e){return void 0!==this.allocated[e]},allocate(e){var t=this.freelist.pop()||this.allocated.length;return this.allocated[t]=e,t},free(e){this.allocated[e]=void 0,this.freelist.push(e)}}),Tt.allocated.push({value:void 0},{value:null},{value:!0},{value:!1}),Tt.reserved=Tt.allocated.length,i.count_emval_handles=At;var gr,vr={s:e=>{var t=new Y(e);return t.get_caught()||(t.set_caught(!0),q--),t.set_rethrown(!1),V.push(t),Ar(t.excPtr),t.get_exception_ptr()},ob:()=>{if(!V.length)return 0;var e=V[V.length-1];return Ar(e.excPtr),e.excPtr},t:()=>{Fr(0,0);var e=V.pop();Sr(e.excPtr),G=0},a:()=>X([]),f:e=>X([e]),o:(e,t)=>X([e,t]),ra:K,nb:e=>{if(e){var t=new Y(e);V.push(t),t.set_rethrown(!0),K()}},p:(e,t,r)=>{throw new Y(e).init(t,r),q++,G=e},pb:()=>q,b:e=>{throw G||(G=e),G},vb:function(e,t,r,n,i){try{for(var o=0,s=t?_[t>>2]:0,a=t?_[t+4>>2]:0,u=r?_[r>>2]:0,c=r?_[r+4>>2]:0,l=n?_[n>>2]:0,d=n?_[n+4>>2]:0,h=0,m=0,f=0,p=0,g=0,v=0,y=(t?_[t>>2]:0)|(r?_[r>>2]:0)|(n?_[n>>2]:0),w=(t?_[t+4>>2]:0)|(r?_[r+4>>2]:0)|(n?_[n+4>>2]:0),C=function(e,t,r,n){return e<32?t&n:r&n},E=0;E<e;E++){var b=1<<E%32;if(C(E,y,w,b)){var x=ge.getStreamFromFD(E),F=ge.DEFAULT_POLLMASK;if(x.stream_ops.poll){var D=-1;i&&(D=1e3*((t?_[i>>2]:0)+(t?_[i+8>>2]:0)/1e6)),F=x.stream_ops.poll(x,D)}1&F&&C(E,s,a,b)&&(E<32?h|=b:m|=b,o++),4&F&&C(E,u,c,b)&&(E<32?f|=b:p|=b,o++),2&F&&C(E,l,d,b)&&(E<32?g|=b:v|=b,o++)}}return t&&(_[t>>2]=h,_[t+4>>2]=m),r&&(_[r>>2]=f,_[r+4>>2]=p),n&&(_[n>>2]=g,_[n+4>>2]=v),o}catch(e){if("undefined"==typeof fe||"ErrnoError"!==e.name)throw e;return-e.errno}},wa:function(e,t,r){ge.varargs=r;try{var n=ge.getStreamFromFD(e);switch(t){case 0:if((i=ge.get())<0)return-28;for(;fe.streams[i];)i++;return fe.createStream(n,i).fd;case 1:case 2:case 6:case 7:return 0;case 3:return n.flags;case 4:var i=ge.get();return n.flags|=i,0;case 5:return i=ge.getp(),w[i+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return o=28,_[_r()>>2]=o,-1}}catch(e){if("undefined"==typeof fe||"ErrnoError"!==e.name)throw e;return-e.errno}var o},Db:function(e,t){try{var r=ge.getStreamFromFD(e);return ge.doStat(fe.stat,r.path,t)}catch(e){if("undefined"==typeof fe||"ErrnoError"!==e.name)throw e;return-e.errno}},Eb:function(e,t,r){ge.varargs=r;try{var n=ge.getStreamFromFD(e);switch(t){case 21509:case 21510:case 21511:case 21512:case 21524:case 21515:return n.tty?0:-59;case 21505:if(!n.tty)return-59;if(n.tty.ops.ioctl_tcgets){var i=n.tty.ops.ioctl_tcgets(n),o=ge.getp();_[o>>2]=i.c_iflag||0,_[o+4>>2]=i.c_oflag||0,_[o+8>>2]=i.c_cflag||0,_[o+12>>2]=i.c_lflag||0;for(var s=0;s<32;s++)v[o+s+17>>0]=i.c_cc[s]||0;return 0}return 0;case 21506:case 21507:case 21508:if(!n.tty)return-59;if(n.tty.ops.ioctl_tcsets){o=ge.getp();var a=_[o>>2],u=_[o+4>>2],c=_[o+8>>2],l=_[o+12>>2],d=[];for(s=0;s<32;s++)d.push(v[o+s+17>>0]);return n.tty.ops.ioctl_tcsets(n.tty,t,{c_iflag:a,c_oflag:u,c_cflag:c,c_lflag:l,c_cc:d})}return 0;case 21519:return n.tty?(o=ge.getp(),_[o>>2]=0,0):-59;case 21520:return n.tty?-28:-59;case 21531:return o=ge.getp(),fe.ioctl(n,t,o);case 21523:if(!n.tty)return-59;if(n.tty.ops.ioctl_tiocgwinsz){var h=n.tty.ops.ioctl_tiocgwinsz(n.tty);o=ge.getp(),w[o>>1]=h[0],w[o+2>>1]=h[1]}return 0;default:return-28}}catch(e){if("undefined"==typeof fe||"ErrnoError"!==e.name)throw e;return-e.errno}},Bb:function(e,t,r,n){try{t=ge.getStr(t);var i=256&n,o=4096&n;return n&=-6401,t=ge.calculateAt(e,t,o),ge.doStat(i?fe.lstat:fe.stat,t,r)}catch(e){if("undefined"==typeof fe||"ErrnoError"!==e.name)throw e;return-e.errno}},xa:function(e,t,r,n){ge.varargs=n;try{t=ge.getStr(t),t=ge.calculateAt(e,t);var i=n?ge.get():0;return fe.open(t,r,i).fd}catch(e){if("undefined"==typeof fe||"ErrnoError"!==e.name)throw e;return-e.errno}},wb:function(e){try{return e=ge.getStr(e),fe.rmdir(e),0}catch(e){if("undefined"==typeof fe||"ErrnoError"!==e.name)throw e;return-e.errno}},Cb:function(e,t){try{return e=ge.getStr(e),ge.doStat(fe.stat,e,t)}catch(e){if("undefined"==typeof fe||"ErrnoError"!==e.name)throw e;return-e.errno}},xb:function(e,t,r){try{return t=ge.getStr(t),t=ge.calculateAt(e,t),0===r?fe.unlink(t):512===r?fe.rmdir(t):j("Invalid flags passed to unlinkat"),0}catch(e){if("undefined"==typeof fe||"ErrnoError"!==e.name)throw e;return-e.errno}},Wa:e=>{var t=ve[e];delete ve[e];var r=t.rawConstructor,n=t.rawDestructor,i=t.fields,o=i.map((e=>e.getterReturnType)).concat(i.map((e=>e.setterArgumentType)));Fe([e],o,(e=>{var o={};return i.forEach(((t,r)=>{var n=t.fieldName,s=e[r],a=t.getter,u=t.getterContext,c=e[r+i.length],l=t.setter,d=t.setterContext;o[n]={read:e=>s.fromWireType(a(u,e)),write:(e,t)=>{var r=[];l(d,e,c.toWireType(r,t)),ye(r)}}})),[{name:t.name,fromWireType:e=>{var t={};for(var r in o)t[r]=o[r].read(e);return n(e),t},toWireType:(e,t)=>{for(var i in o)if(!(i in t))throw new TypeError(`Missing field: "${i}"`);var s=r();for(i in o)o[i].write(s,t[i]);return null!==e&&e.push(n,s),s},argPackAdvance:ke,readValueFromPointer:we,destructorFunction:n}]}))},gb:(e,t,r,n,i)=>{},za:(e,t,r,n)=>{Pe(e,{name:t=Te(t),fromWireType:function(e){return!!e},toWireType:function(e,t){return t?r:n},argPackAdvance:ke,readValueFromPointer:function(e){return this.fromWireType(y[e])},destructorFunction:null})},ta:(e,t,r,n,i,o,s,a,u,c,l,d,h)=>{l=Te(l),o=yt(i,o),a&&(a=yt(s,a)),c&&(c=yt(u,c)),h=yt(d,h);var m=tt(l);it(m,(function(){_t(`Cannot construct ${l} due to unbound types`,[n])})),Fe([e,t,r],n?[n]:[],(function(t){var r,i;t=t[0],i=n?(r=t.registeredClass).instancePrototype:et.prototype;var s=rt(m,(function(){if(Object.getPrototypeOf(this)!==u)throw new Se("Use 'new' to construct "+l);if(void 0===d.constructor_body)throw new Se(l+" has no accessible constructor");var e=d.constructor_body[arguments.length];if(void 0===e)throw new Se(`Tried to invoke ctor of ${l} with invalid number of parameters (${arguments.length}) - expected (${Object.keys(d.constructor_body).toString()}) parameters instead!`);return e.apply(this,arguments)})),u=Object.create(i,{constructor:{value:s}});s.prototype=u;var d=new ot(l,s,u,h,r,o,a,c);d.baseClass&&(void 0===d.baseClass.__derivedClasses&&(d.baseClass.__derivedClasses=[]),d.baseClass.__derivedClasses.push(d));var f=new ft(l,d,!0,!1,!1),p=new ft(l+"*",d,!1,!1,!1),g=new ft(l+" const*",d,!1,!0,!1);return Ie[e]={pointerType:p,constPointerType:g},pt(m,s),[f,p,g]}))},sa:(e,t,r,n,i,o)=>{var s=Et(t,r);i=yt(n,i),Fe([],[e],(function(e){var r=`constructor ${(e=e[0]).name}`;if(void 0===e.registeredClass.constructor_body&&(e.registeredClass.constructor_body=[]),void 0!==e.registeredClass.constructor_body[t-1])throw new Se(`Cannot register multiple constructors with identical number of parameters (${t-1}) for class '${e.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return e.registeredClass.constructor_body[t-1]=()=>{_t(`Cannot construct ${e.name} due to unbound types`,s)},Fe([],s,(n=>(n.splice(1,0,null),e.registeredClass.constructor_body[t-1]=xt(r,n,null,i,o),[]))),[]}))},ga:(e,t,r,n,i,o,s,a,u)=>{var c=Et(r,n);t=Te(t),o=yt(i,o),Fe([],[e],(function(e){var n=`${(e=e[0]).name}.${t}`;function i(){_t(`Cannot call ${n} due to unbound types`,c)}t.startsWith("@@")&&(t=Symbol[t.substring(2)]),a&&e.registeredClass.pureVirtualFunctions.push(t);var l=e.registeredClass.instancePrototype,d=l[t];return void 0===d||void 0===d.overloadTable&&d.className!==e.name&&d.argCount===r-2?(i.argCount=r-2,i.className=e.name,l[t]=i):(nt(l,t,n),l[t].overloadTable[r-2]=i),Fe([],c,(function(i){var a=xt(n,i,e,o,s,u);return void 0===l[t].overloadTable?(a.argCount=r-2,l[t]=a):l[t].overloadTable[r-2]=a,[]})),[]}))},ya:(e,t)=>{Pe(e,{name:t=Te(t),fromWireType:e=>{var t=Pt.toValue(e);return St(e),t},toWireType:(e,t)=>Pt.toHandle(t),argPackAdvance:ke,readValueFromPointer:we,destructorFunction:null})},la:(e,t,r)=>{Pe(e,{name:t=Te(t),fromWireType:e=>e,toWireType:(e,t)=>t,argPackAdvance:ke,readValueFromPointer:Ot(t,r),destructorFunction:null})},E:(e,t,r,n,i,o,s)=>{var a=Et(t,r);e=Te(e),i=yt(n,i),it(e,(function(){_t(`Cannot call ${e} due to unbound types`,a)}),t-1),Fe([],a,(function(r){var n=[r[0],null].concat(r.slice(1));return pt(e,xt(e,n,null,i,o,s),t-1),[]}))},G:(e,t,r,n,i)=>{t=Te(t),-1===i&&(i=4294967295);var o=e=>e;if(0===n){var s=32-8*r;o=e=>e<<s>>>s}var a=t.includes("unsigned");Pe(e,{name:t,fromWireType:o,toWireType:a?function(e,t){return this.name,t>>>0}:function(e,t){return this.name,t},argPackAdvance:ke,readValueFromPointer:Mt(t,r,0!==n),destructorFunction:null})},z:(e,t,r)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][t];function i(e){var t=E[e>>2],r=E[e+4>>2];return new n(v.buffer,r,t)}Pe(e,{name:r=Te(r),fromWireType:i,argPackAdvance:ke,readValueFromPointer:i},{ignoreDuplicateRegistrations:!0})},ka:(e,t)=>{var r="std::string"===(t=Te(t));Pe(e,{name:t,fromWireType:e=>{var t,n=E[e>>2],i=e+4;if(r)for(var o=i,s=0;s<=n;++s){var a=i+s;if(s==n||0==y[a]){var u=pe(o,a-o);void 0===t?t=u:(t+=String.fromCharCode(0),t+=u),o=a+1}}else{var c=new Array(n);for(s=0;s<n;++s)c[s]=String.fromCharCode(y[i+s]);t=c.join("")}return Cr(e),t},toWireType:(e,t)=>{var n;t instanceof ArrayBuffer&&(t=new Uint8Array(t));var i="string"==typeof t;i||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int8Array||Ae("Cannot pass non-string to std::string"),n=r&&i?oe(t):t.length;var o=wr(4+n+1),s=o+4;if(E[o>>2]=n,r&&i)Rt(t,s,n+1);else if(i)for(var a=0;a<n;++a){var u=t.charCodeAt(a);u>255&&(Cr(s),Ae("String has UTF-16 code units that do not fit in 8 bits")),y[s+a]=u}else for(a=0;a<n;++a)y[s+a]=t[a];return null!==e&&e.push(Cr,o),o},argPackAdvance:ke,readValueFromPointer:lt,destructorFunction:e=>Cr(e)})},aa:(e,t,r)=>{var n,i,o,s,a;r=Te(r),2===t?(n=zt,i=Lt,s=It,o=()=>C,a=1):4===t&&(n=Wt,i=jt,s=Nt,o=()=>E,a=2),Pe(e,{name:r,fromWireType:e=>{for(var r,i=E[e>>2],s=o(),u=e+4,c=0;c<=i;++c){var l=e+4+c*t;if(c==i||0==s[l>>a]){var d=n(u,l-u);void 0===r?r=d:(r+=String.fromCharCode(0),r+=d),u=l+t}}return Cr(e),r},toWireType:(e,n)=>{"string"!=typeof n&&Ae(`Cannot pass non-string to C++ string type ${r}`);var o=s(n),u=wr(4+o+t);return E[u>>2]=o>>a,i(n,u+4,o+t),null!==e&&e.push(Cr,u),u},argPackAdvance:ke,readValueFromPointer:we,destructorFunction:e=>Cr(e)})},Xa:(e,t,r,n,i,o)=>{ve[e]={name:Te(t),rawConstructor:yt(r,n),rawDestructor:yt(i,o),fields:[]}},Va:(e,t,r,n,i,o,s,a,u,c)=>{ve[e].fields.push({fieldName:Te(t),getterReturnType:r,getter:yt(n,i),getterContext:o,setterArgumentType:s,setter:yt(a,u),setterContext:c})},Aa:(e,t)=>{Pe(e,{isVoid:!0,name:t=Te(t),argPackAdvance:0,fromWireType:()=>{},toWireType:(e,t)=>{}})},Fb:()=>!0,qb:()=>{throw 1/0},O:(e,t,r)=>{e=Pt.toValue(e),t=Qt(t,"emval::as");var n=[],i=Pt.toHandle(n);return E[r>>2]=i,t.toWireType(n,e)},ia:(e,t,r,n,i)=>(e=Ut[e])(t=Pt.toValue(t),r=Ht(r),(e=>{var t=[];return E[e>>2]=Pt.toHandle(t),t})(n),i),ha:(e,t,r,n)=>{(e=Ut[e])(t=Pt.toValue(t),r=Ht(r),null,n)},$a:St,Qa:e=>0===e?Pt.toHandle(Zt()):(e=Ht(e),Pt.toHandle(Zt()[e])),N:(e,t)=>{var r=((e,t)=>{for(var r=new Array(e),n=0;n<e;++n)r[n]=Qt(E[t+4*n>>2],"parameter "+n);return r})(e,t),n=r[0],i=n.name+"_$"+r.slice(1).map((function(e){return e.name})).join("_")+"$",o=Vt[i];if(void 0!==o)return o;for(var s=["retType"],a=[n],u="",c=0;c<e-1;++c)u+=(0!==c?", ":"")+"arg"+c,s.push("argType"+c),a.push(r[1+c]);var l="return function "+tt("methodCaller_"+i)+"(handle, name, destructors, args) {\n",d=0;for(c=0;c<e-1;++c)l+=" var arg"+c+" = argType"+c+".readValueFromPointer(args"+(d?"+"+d:"")+");\n",d+=r[c+1].argPackAdvance;for(l+=" var rv = handle[name]("+u+");\n",c=0;c<e-1;++c)r[c+1].deleteObject&&(l+=" argType"+c+".deleteObject(arg"+c+");\n");n.isVoid||(l+=" return retType.toWireType(destructors, rv);\n"),l+="};\n",s.push(l);var h,m,f=bt(Function,s).apply(null,a);return h=f,m=Ut.length,Ut.push(h),o=m,Vt[i]=o,o},Za:(e,t)=>(e=Pt.toValue(e),t=Pt.toValue(t),Pt.toHandle(e[t])),q:e=>{e>4&&(Tt.get(e).refcount+=1)},S:()=>Pt.toHandle([]),J:e=>Pt.toHandle(Ht(e)),A:()=>Pt.toHandle({}),Ya:e=>{var t=Pt.toValue(e);ye(t),St(e)},rb:(e,t,r)=>{e=Pt.toValue(e),t=Pt.toValue(t),r=Pt.toValue(r),e[t]=r},I:(e,t)=>{var r=(e=Qt(e,"_emval_take_value")).readValueFromPointer(t);return Pt.toHandle(r)},db:function(e,t,r){var n=qt(e,t),i=new Date(1e3*n);_[r>>2]=i.getUTCSeconds(),_[r+4>>2]=i.getUTCMinutes(),_[r+8>>2]=i.getUTCHours(),_[r+12>>2]=i.getUTCDate(),_[r+16>>2]=i.getUTCMonth(),_[r+20>>2]=i.getUTCFullYear()-1900,_[r+24>>2]=i.getUTCDay();var o=Date.UTC(i.getUTCFullYear(),0,1,0,0,0,0),s=(i.getTime()-o)/864e5|0;_[r+28>>2]=s},eb:function(e,t,r){var n=qt(e,t),i=new Date(1e3*n);_[r>>2]=i.getSeconds(),_[r+4>>2]=i.getMinutes(),_[r+8>>2]=i.getHours(),_[r+12>>2]=i.getDate(),_[r+16>>2]=i.getMonth(),_[r+20>>2]=i.getFullYear()-1900,_[r+24>>2]=i.getDay();var o=0|(e=>(Gt(e.getFullYear())?Yt:Xt)[e.getMonth()]+e.getDate()-1)(i);_[r+28>>2]=o,_[r+36>>2]=-60*i.getTimezoneOffset();var s=new Date(i.getFullYear(),0,1),a=new Date(i.getFullYear(),6,1).getTimezoneOffset(),u=s.getTimezoneOffset(),c=0|(a!=u&&i.getTimezoneOffset()==Math.min(u,a));_[r+32>>2]=c},cb:function(e,t,r,n,i,o,s){var a=qt(o,s);try{if(isNaN(a))return 61;var u=ge.getStreamFromFD(i);2&r&&ge.doMsync(e,u,t,n,a),fe.munmap(u)}catch(e){if("undefined"==typeof fe||"ErrnoError"!==e.name)throw e;return-e.errno}},tb:(e,t,r)=>{var n=(new Date).getFullYear(),i=new Date(n,0,1),o=new Date(n,6,1),s=i.getTimezoneOffset(),a=o.getTimezoneOffset(),u=Math.max(s,a);function c(e){var t=e.toTimeString().match(/\(([A-Za-z ]+)\)$/);return t?t[1]:"GMT"}E[e>>2]=60*u,_[t>>2]=Number(s!=a);var l=c(i),d=c(o),h=Kt(l),m=Kt(d);a<s?(E[r>>2]=h,E[r+4>>2]=m):(E[r>>2]=m,E[r+4>>2]=h)},v:()=>{j("")},Ra:(e,t,r)=>er(e,t,r),U:()=>Date.now(),ub:()=>2147483648,P:Dt,Gb:(e,t,r)=>y.copyWithin(e,t,t+r),sb:e=>{var t=y.length,r=2147483648;if((e>>>=0)>r)return!1;for(var n,i,o=1;o<=4;o*=2){var s=t*(1+.2/o);s=Math.min(s,e+100663296);var a=Math.min(r,(n=Math.max(e,s))+((i=65536)-n%i)%i);if(ir(a))return!0}return!1},zb:(e,t)=>{var r=0;return sr().forEach(((n,i)=>{var o=t+r;E[e+4*i>>2]=o,((e,t)=>{for(var r=0;r<e.length;++r)v[t++>>0]=e.charCodeAt(r);v[t>>0]=0})(n,o),r+=n.length+1})),0},Ab:(e,t)=>{var r=sr();E[e>>2]=r.length;var n=0;return r.forEach((e=>n+=e.length+1)),E[t>>2]=n,0},Ba:ur,$:function(e){try{var t=ge.getStreamFromFD(e);return fe.close(t),0}catch(e){if("undefined"==typeof fe||"ErrnoError"!==e.name)throw e;return e.errno}},yb:function(e,t){try{var r=ge.getStreamFromFD(e),n=r.tty?2:fe.isDir(r.mode)?3:fe.isLink(r.mode)?7:4;return v[t>>0]=n,w[t+2>>1]=0,k=[0,(P=0,+Math.abs(P)>=1?P>0?+Math.floor(P/4294967296)>>>0:~~+Math.ceil((P-+(~~P>>>0))/4294967296)>>>0:0)],_[t+8>>2]=k[0],_[t+12>>2]=k[1],k=[0,(P=0,+Math.abs(P)>=1?P>0?+Math.floor(P/4294967296)>>>0:~~+Math.ceil((P-+(~~P>>>0))/4294967296)>>>0:0)],_[t+16>>2]=k[0],_[t+20>>2]=k[1],0}catch(e){if("undefined"==typeof fe||"ErrnoError"!==e.name)throw e;return e.errno}},va:function(e,t,r,n){try{var i=((e,t,r,n)=>{for(var i=0,o=0;o<r;o++){var s=E[t>>2],a=E[t+4>>2];t+=8;var u=fe.read(e,v,s,a,n);if(u<0)return-1;if(i+=u,u<a)break;"undefined"!=typeof n&&(n+=u)}return i})(ge.getStreamFromFD(e),t,r);return E[n>>2]=i,0}catch(e){if("undefined"==typeof fe||"ErrnoError"!==e.name)throw e;return e.errno}},fb:function(e,t,r,n,i){var o=qt(t,r);try{if(isNaN(o))return 61;var s=ge.getStreamFromFD(e);return fe.llseek(s,o,n),k=[s.position>>>0,(P=s.position,+Math.abs(P)>=1?P>0?+Math.floor(P/4294967296)>>>0:~~+Math.ceil((P-+(~~P>>>0))/4294967296)>>>0:0)],_[i>>2]=k[0],_[i+4>>2]=k[1],s.getdents&&0===o&&0===n&&(s.getdents=null),0}catch(e){if("undefined"==typeof fe||"ErrnoError"!==e.name)throw e;return e.errno}},ja:function(e,t,r,n){try{var i=((e,t,r,n)=>{for(var i=0,o=0;o<r;o++){var s=E[t>>2],a=E[t+4>>2];t+=8;var u=fe.write(e,v,s,a,n);if(u<0)return-1;i+=u,"undefined"!=typeof n&&(n+=u)}return i})(ge.getStreamFromFD(e),t,r);return E[n>>2]=i,0}catch(e){if("undefined"==typeof fe||"ErrnoError"!==e.name)throw e;return e.errno}},Ta:function(){return hr(location.toString())},kb:(e,t)=>(ee(y.subarray(e,e+t)),0),Sa:function(){return hr((e=jr,self[e(166,"GZWY")][e(169,"7kCi")]()));var e},Ua:function(e,t){var r=Dr();try{return gt(e)(t)}catch(e){if(Tr(r),e!==e+0)throw e;Fr(1,0)}},H:function(e,t,r,n,i,o){var s=Dr();try{return gt(e)(t,r,n,i,o)}catch(e){if(Tr(s),e!==e+0)throw e;Fr(1,0)}},K:function(e,t,r,n){var i=Dr();try{return gt(e)(t,r,n)}catch(e){if(Tr(i),e!==e+0)throw e;Fr(1,0)}},fa:function(e,t,r,n,i,o){var s=Dr();try{return gt(e)(t,r,n,i,o)}catch(e){if(Tr(s),e!==e+0)throw e;Fr(1,0)}},T:function(e,t){var r=Dr();try{return gt(e)(t)}catch(e){if(Tr(r),e!==e+0)throw e;Fr(1,0)}},Na:function(e,t,r){var n=Dr();try{return gt(e)(t,r)}catch(e){if(Tr(n),e!==e+0)throw e;Fr(1,0)}},V:function(e,t,r,n){var i=Dr();try{return gt(e)(t,r,n)}catch(e){if(Tr(i),e!==e+0)throw e;Fr(1,0)}},r:function(e){var t=Dr();try{return gt(e)()}catch(e){if(Tr(t),e!==e+0)throw e;Fr(1,0)}},g:function(e,t){var r=Dr();try{return gt(e)(t)}catch(e){if(Tr(r),e!==e+0)throw e;Fr(1,0)}},Ja:function(e,t,r){var n=Dr();try{return gt(e)(t,r)}catch(e){if(Tr(n),e!==e+0)throw e;Fr(1,0)}},ma:function(e,t,r,n){var i=Dr();try{return gt(e)(t,r,n)}catch(e){if(Tr(i),e!==e+0)throw e;Fr(1,0)}},Ka:function(e,t,r,n){var i=Dr();try{return gt(e)(t,r,n)}catch(e){if(Tr(i),e!==e+0)throw e;Fr(1,0)}},Ma:function(e,t,r,n,i){var o=Dr();try{return gt(e)(t,r,n,i)}catch(e){if(Tr(o),e!==e+0)throw e;Fr(1,0)}},La:function(e,t,r,n,i,o,s,a){var u=Dr();try{return gt(e)(t,r,n,i,o,s,a)}catch(e){if(Tr(u),e!==e+0)throw e;Fr(1,0)}},e:function(e,t,r){var n=Dr();try{return gt(e)(t,r)}catch(e){if(Tr(n),e!==e+0)throw e;Fr(1,0)}},Oa:function(e,t,r,n){var i=Dr();try{return gt(e)(t,r,n)}catch(e){if(Tr(i),e!==e+0)throw e;Fr(1,0)}},j:function(e,t,r,n){var i=Dr();try{return gt(e)(t,r,n)}catch(e){if(Tr(i),e!==e+0)throw e;Fr(1,0)}},L:function(e,t,r,n,i){var o=Dr();try{return gt(e)(t,r,n,i)}catch(e){if(Tr(o),e!==e+0)throw e;Fr(1,0)}},k:function(e,t,r,n,i){var o=Dr();try{return gt(e)(t,r,n,i)}catch(e){if(Tr(o),e!==e+0)throw e;Fr(1,0)}},mb:function(e,t,r,n,i,o){var s=Dr();try{return gt(e)(t,r,n,i,o)}catch(e){if(Tr(s),e!==e+0)throw e;Fr(1,0)}},qa:function(e,t,r,n,i,o,s){var a=Dr();try{return gt(e)(t,r,n,i,o,s)}catch(e){if(Tr(a),e!==e+0)throw e;Fr(1,0)}},n:function(e,t,r,n,i,o){var s=Dr();try{return gt(e)(t,r,n,i,o)}catch(e){if(Tr(s),e!==e+0)throw e;Fr(1,0)}},D:function(e,t,r,n,i,o,s){var a=Dr();try{return gt(e)(t,r,n,i,o,s)}catch(e){if(Tr(a),e!==e+0)throw e;Fr(1,0)}},ua:function(e,t,r,n,i,o,s,a){var u=Dr();try{return gt(e)(t,r,n,i,o,s,a)}catch(e){if(Tr(u),e!==e+0)throw e;Fr(1,0)}},Da:function(e,t,r,n,i,o,s,a,u){var c=Dr();try{return gt(e)(t,r,n,i,o,s,a,u)}catch(e){if(Tr(c),e!==e+0)throw e;Fr(1,0)}},Ca:function(e,t,r,n,i,o,s,a,u,c){var l=Dr();try{return gt(e)(t,r,n,i,o,s,a,u,c)}catch(e){if(Tr(l),e!==e+0)throw e;Fr(1,0)}},_:function(e,t,r,n,i,o,s,a,u,c,l,d){var h=Dr();try{return gt(e)(t,r,n,i,o,s,a,u,c,l,d)}catch(e){if(Tr(h),e!==e+0)throw e;Fr(1,0)}},ib:function(e,t,r,n){var i=Dr();try{return Rr(e,t,r,n)}catch(e){if(Tr(i),e!==e+0)throw e;Fr(1,0)}},bb:function(e){var t=Dr();try{return $r(e)}catch(e){if(Tr(t),e!==e+0)throw e;Fr(1,0)}},jb:function(e,t){var r=Dr();try{return Or(e,t)}catch(e){if(Tr(r),e!==e+0)throw e;Fr(1,0)}},ab:function(e,t,r){var n=Dr();try{return zr(e,t,r)}catch(e){if(Tr(n),e!==e+0)throw e;Fr(1,0)}},_a:function(e,t,r,n,i){var o=Dr();try{return Lr(e,t,r,n,i)}catch(e){if(Tr(o),e!==e+0)throw e;Fr(1,0)}},m:function(e){var t=Dr();try{gt(e)()}catch(e){if(Tr(t),e!==e+0)throw e;Fr(1,0)}},c:function(e,t){var r=Dr();try{gt(e)(t)}catch(e){if(Tr(r),e!==e+0)throw e;Fr(1,0)}},Y:function(e,t,r){var n=Dr();try{gt(e)(t,r)}catch(e){if(Tr(n),e!==e+0)throw e;Fr(1,0)}},da:function(e,t,r,n){var i=Dr();try{gt(e)(t,r,n)}catch(e){if(Tr(i),e!==e+0)throw e;Fr(1,0)}},M:function(e,t,r,n,i,o,s,a){var u=Dr();try{gt(e)(t,r,n,i,o,s,a)}catch(e){if(Tr(u),e!==e+0)throw e;Fr(1,0)}},Ga:function(e,t,r){var n=Dr();try{gt(e)(t,r)}catch(e){if(Tr(n),e!==e+0)throw e;Fr(1,0)}},d:function(e,t,r){var n=Dr();try{gt(e)(t,r)}catch(e){if(Tr(n),e!==e+0)throw e;Fr(1,0)}},y:function(e,t,r,n){var i=Dr();try{gt(e)(t,r,n)}catch(e){if(Tr(i),e!==e+0)throw e;Fr(1,0)}},X:function(e,t,r,n,i){var o=Dr();try{gt(e)(t,r,n,i)}catch(e){if(Tr(o),e!==e+0)throw e;Fr(1,0)}},ba:function(e,t,r,n,i,o){var s=Dr();try{gt(e)(t,r,n,i,o)}catch(e){if(Tr(s),e!==e+0)throw e;Fr(1,0)}},Ha:function(e,t,r,n,i,o,s){var a=Dr();try{gt(e)(t,r,n,i,o,s)}catch(e){if(Tr(a),e!==e+0)throw e;Fr(1,0)}},R:function(e,t,r,n,i,o,s,a){var u=Dr();try{gt(e)(t,r,n,i,o,s,a)}catch(e){if(Tr(u),e!==e+0)throw e;Fr(1,0)}},Ia:function(e,t,r,n,i){var o=Dr();try{gt(e)(t,r,n,i)}catch(e){if(Tr(o),e!==e+0)throw e;Fr(1,0)}},Ea:function(e,t,r,n,i,o,s,a){var u=Dr();try{gt(e)(t,r,n,i,o,s,a)}catch(e){if(Tr(u),e!==e+0)throw e;Fr(1,0)}},Fa:function(e,t,r,n){var i=Dr();try{gt(e)(t,r,n)}catch(e){if(Tr(i),e!==e+0)throw e;Fr(1,0)}},na:function(e,t,r,n,i){var o=Dr();try{gt(e)(t,r,n,i)}catch(e){if(Tr(o),e!==e+0)throw e;Fr(1,0)}},oa:function(e,t,r,n,i,o){var s=Dr();try{gt(e)(t,r,n,i,o)}catch(e){if(Tr(s),e!==e+0)throw e;Fr(1,0)}},h:function(e,t,r,n){var i=Dr();try{gt(e)(t,r,n)}catch(e){if(Tr(i),e!==e+0)throw e;Fr(1,0)}},B:function(e,t,r,n,i,o){var s=Dr();try{gt(e)(t,r,n,i,o)}catch(e){if(Tr(s),e!==e+0)throw e;Fr(1,0)}},u:function(e,t,r,n,i,o,s){var a=Dr();try{gt(e)(t,r,n,i,o,s)}catch(e){if(Tr(a),e!==e+0)throw e;Fr(1,0)}},Q:function(e,t,r,n,i,o){var s=Dr();try{gt(e)(t,r,n,i,o)}catch(e){if(Tr(s),e!==e+0)throw e;Fr(1,0)}},i:function(e,t,r,n,i){var o=Dr();try{gt(e)(t,r,n,i)}catch(e){if(Tr(o),e!==e+0)throw e;Fr(1,0)}},ca:function(e,t,r,n,i,o,s,a){var u=Dr();try{gt(e)(t,r,n,i,o,s,a)}catch(e){if(Tr(u),e!==e+0)throw e;Fr(1,0)}},l:function(e,t,r,n,i,o){var s=Dr();try{gt(e)(t,r,n,i,o)}catch(e){if(Tr(s),e!==e+0)throw e;Fr(1,0)}},x:function(e,t,r,n,i,o,s){var a=Dr();try{gt(e)(t,r,n,i,o,s)}catch(e){if(Tr(a),e!==e+0)throw e;Fr(1,0)}},pa:function(e,t,r,n,i,o,s,a,u,c){var l=Dr();try{gt(e)(t,r,n,i,o,s,a,u,c)}catch(e){if(Tr(l),e!==e+0)throw e;Fr(1,0)}},w:function(e,t,r,n,i,o,s,a){var u=Dr();try{gt(e)(t,r,n,i,o,s,a)}catch(e){if(Tr(u),e!==e+0)throw e;Fr(1,0)}},ea:function(e,t,r,n,i,o,s,a,u){var c=Dr();try{gt(e)(t,r,n,i,o,s,a,u)}catch(e){if(Tr(c),e!==e+0)throw e;Fr(1,0)}},W:function(e,t,r,n,i,o,s,a,u,c){var l=Dr();try{gt(e)(t,r,n,i,o,s,a,u,c)}catch(e){if(Tr(l),e!==e+0)throw e;Fr(1,0)}},C:function(e,t,r,n,i,o,s,a,u,c,l){var d=Dr();try{gt(e)(t,r,n,i,o,s,a,u,c,l)}catch(e){if(Tr(d),e!==e+0)throw e;Fr(1,0)}},Z:function(e,t,r,n,i,o,s,a,u,c,l,d,h,m,f,p){var g=Dr();try{gt(e)(t,r,n,i,o,s,a,u,c,l,d,h,m,f,p)}catch(e){if(Tr(g),e!==e+0)throw e;Fr(1,0)}},hb:function(e,t,r,n){var i=Dr();try{Mr(e,t,r,n)}catch(e){if(Tr(i),e!==e+0)throw e;Fr(1,0)}},F:e=>e,Pa:dr,lb:(e,t,r,n,i)=>dr(e,t,r,n)},yr=function(){var e,t,n,o,s={a:vr};function a(e,t){var r,n=e.exports;return p=(yr=n).Hb,T(),F=yr.Kb,r=yr.Ib,M.unshift(r),W(),n}if(I(),i.instantiateWasm)try{return i.instantiateWasm(s,a)}catch(e){f(`Module.instantiateWasm callback failed with error: ${e}`),r(e)}return(e=h,t=S,n=s,o=function(e){a(e.instance)},e||"function"!=typeof WebAssembly.instantiateStreaming||N(t)||"function"!=typeof fetch?B(t,n,o):fetch(t,{credentials:"same-origin"}).then((e=>WebAssembly.instantiateStreaming(e,n).then(o,(function(e){return f(`wasm streaming compile failed: ${e}`),f("falling back to ArrayBuffer instantiation"),B(t,n,o)}))))).catch(r),{}}(),wr=i._malloc=e=>(wr=i._malloc=yr.Jb)(e),Cr=i._free=e=>(Cr=i._free=yr.Lb)(e),_r=()=>(_r=yr.Mb)(),Er=e=>(Er=yr.Nb)(e),br=e=>(br=yr.Ob)(e),xr=(i.__embind_initialize_bindings=()=>(i.__embind_initialize_bindings=yr.Pb)(),(e,t)=>(xr=yr.Qb)(e,t)),Fr=(e,t)=>(Fr=yr.Rb)(e,t),Dr=()=>(Dr=yr.Sb)(),Tr=e=>(Tr=yr.Tb)(e),Sr=e=>(Sr=yr.Ub)(e),Ar=e=>(Ar=yr.Vb)(e),Pr=(e,t,r)=>(Pr=yr.Wb)(e,t,r),kr=e=>(kr=yr.Xb)(e),Or=i.dynCall_ji=(e,t)=>(Or=i.dynCall_ji=yr.Yb)(e,t),Mr=i.dynCall_vij=(e,t,r,n)=>(Mr=i.dynCall_vij=yr.Zb)(e,t,r,n),Rr=i.dynCall_iij=(e,t,r,n)=>(Rr=i.dynCall_iij=yr._b)(e,t,r,n),$r=(i.dynCall_iiiijj=(e,t,r,n,o,s,a,u)=>(i.dynCall_iiiijj=yr.$b)(e,t,r,n,o,s,a,u),i.dynCall_viijj=(e,t,r,n,o,s,a)=>(i.dynCall_viijj=yr.ac)(e,t,r,n,o,s,a),i.dynCall_viiijjj=(e,t,r,n,o,s,a,u,c,l)=>(i.dynCall_viiijjj=yr.bc)(e,t,r,n,o,s,a,u,c,l),i.dynCall_jiji=(e,t,r,n,o)=>(i.dynCall_jiji=yr.cc)(e,t,r,n,o),i.dynCall_j=e=>($r=i.dynCall_j=yr.dc)(e)),zr=i.dynCall_jii=(e,t,r)=>(zr=i.dynCall_jii=yr.ec)(e,t,r),Lr=(i.dynCall_viijii=(e,t,r,n,o,s,a)=>(i.dynCall_viijii=yr.fc)(e,t,r,n,o,s,a),i.dynCall_jiiii=(e,t,r,n,o)=>(Lr=i.dynCall_jiiii=yr.gc)(e,t,r,n,o));function Ir(){function e(){gr||(gr=!0,i.calledRun=!0,D||(i.noFSInit||fe.init.initialized||fe.init(),fe.ignorePermissions=!1,ue.init(),Z(M),t(i),i.onRuntimeInitialized&&i.onRuntimeInitialized(),function(){if(i.postRun)for("function"==typeof i.postRun&&(i.postRun=[i.postRun]);i.postRun.length;)e=i.postRun.shift(),R.unshift(e);var e;Z(R)}()))}$>0||(function(){if(i.preRun)for("function"==typeof i.preRun&&(i.preRun=[i.preRun]);i.preRun.length;)e=i.preRun.shift(),O.unshift(e);var e;Z(O)}(),$>0||(i.setStatus?(i.setStatus("Running..."),setTimeout((function(){setTimeout((function(){i.setStatus("")}),1),e()}),1)):e()))}if(i.dynCall_iiiiij=(e,t,r,n,o,s,a)=>(i.dynCall_iiiiij=yr.hc)(e,t,r,n,o,s,a),i.dynCall_iiiiijj=(e,t,r,n,o,s,a,u,c)=>(i.dynCall_iiiiijj=yr.ic)(e,t,r,n,o,s,a,u,c),i.dynCall_iiiiiijj=(e,t,r,n,o,s,a,u,c,l)=>(i.dynCall_iiiiiijj=yr.jc)(e,t,r,n,o,s,a,u,c,l),i.___start_em_js=3710276,i.___stop_em_js=3710384,i.UTF8ToString=pe,i.stringToUTF8=Rt,i.lengthBytesUTF8=oe,i.allocateUTF8=hr,L=function e(){gr||Ir(),gr||(L=e)},i.preInit)for("function"==typeof i.preInit&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.pop()();function Wr(){var e=["ECo8WP3dVqddT8kTW7vlW5Ln","WR9aW7ZcNtldKCknngGxWRT1W6W","j8kmFN/dUu8xWRdcPxCqDKu","W4uSW5OIWPxcLSopW64","WORdICksp10CWPa/WRT4qbG","WOG2WQ3cRXmCW6jtW7JcJsCpDq","W57dMLDVW73dICkl","WQhdUCkCF8kfi0FcMXu4W6a","iCojWPbBiConn8kPW5ddQh1cWRS","j8kmExJdVKaBWOlcN3e0Efy","WOSVWOddUbZcMchcLJxdP8kaW6VcOW","W6yzW65uWQhcQby","WOJdICkqpLiyW6eYWQrQBr/cSq","fCoTWPldP8ofWPBcOCkW","W6v3WQPbd8kKgMq","tWrHgxlcUConWOmAW4CyWOO5","dfusWPWZWQFcVKqyWPnHW5m","W53dOLdcNGOVgCk0","WOJdJ8oiwWHNWOm5","WRWgWQHCBZ9/hCosASk7smkI","W4RcK8o3FHzhWRSD","W5BdJmkgWOldOZ7cVCksW5KIWQDBiG"];return(Wr=function(){return e})()}function jr(e,t){var r=Wr();return jr=function(t,n){var i=r[t-=149];if(void 0===jr.yCXnpl){var o=function(e){for(var t,r,n="",i="",o=0,s=0;r=e.charAt(s++);~r&&(t=o%4?64*t+r:r,o++%4)?n+=String.fromCharCode(255&t>>(-2*o&6)):0)r="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=".indexOf(r);for(var a=0,u=n.length;a<u;a++)i+="%"+("00"+n.charCodeAt(a).toString(16)).slice(-2);return decodeURIComponent(i)},s=function(e,t){var r,n,i=[],s=0,a="";for(e=o(e),n=0;n<256;n++)i[n]=n;for(n=0;n<256;n++)s=(s+i[n]+t.charCodeAt(n%t.length))%256,r=i[n],i[n]=i[s],i[s]=r;n=0,s=0;for(var u=0;u<e.length;u++)s=(s+i[n=(n+1)%256])%256,r=i[n],i[n]=i[s],i[s]=r,a+=String.fromCharCode(e.charCodeAt(u)^i[(i[n]+i[s])%256]);return a};jr.spiLXO=s,e=arguments,jr.yCXnpl=!0}var a=r[0],u=t+a,c=e[u];return c?i=c:(void 0===jr.GWdFIY&&(jr.GWdFIY=!0),i=jr.spiLXO(i,n),e[u]=i),i},jr(e,t)}Ir(),function(e,t){for(var r=jr,n=e();;)try{if(470294==-parseInt(r(160,"khSy"))/1*(parseInt(r(153,"7kCi"))/2)+parseInt(r(170,"BkrW"))/3+-parseInt(r(162,"N(Z^"))/4*(parseInt(r(156,"KS]J"))/5)+parseInt(r(150,"QjsU"))/6+parseInt(r(158,"z$!K"))/7+parseInt(r(151,"z$!K"))/8+parseInt(r(163,"$dyt"))/9*(-parseInt(r(159,"puv0"))/10))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(Wr);var ighnua,Nr=(ighnua=!0,function(ovjrup,Euvnak){var Ovjrup=ighnua?function(){if(Euvnak){var Ighnua=Euvnak.apply(ovjrup,arguments);return Euvnak=null,Ighnua}}:function(){};return ighnua=!1,Ovjrup}),Qr=Nr(this,(function(){var e=function(){return!e.constructor('return /" + this + "/')().constructor("^([^ ]+( +[^ ]+)+)+[^ ]}").test(Qr)};return e()}));return Qr(),e.ready});e.exports=i},function(e,t){},function(e,t,r){"use strict";r.r(t),r.d(t,"ObjectId",(function(){return Ee})),r.d(t,"commands",(function(){return Te}));var n,i,o,s,a,u,c,l,d,h=r(0);class m{_marker(){}}class f extends m{constructor(e={}){super(),this.author="Created with ❤️ with Scanbot SDK",this.creator="",this.title="",this.subject="",this.keywords="",void 0!==e.author&&(this.author=e.author),void 0!==e.creator&&(this.creator=e.creator),void 0!==e.title&&(this.title=e.title),void 0!==e.subject&&(this.subject=e.subject),void 0!==e.keywords&&(this.keywords=e.keywords)}}class p extends m{constructor(e={}){super(),this.attributes=new f({}),this.pageSize="A4",this.pageDirection="PORTRAIT",this.pageFit="FIT_IN",this.dpi=72,this.jpegQuality=80,this.resamplingMethod="NONE",void 0!==e.attributes&&(this.attributes=new f(e.attributes)),void 0!==e.pageSize&&(this.pageSize=e.pageSize),void 0!==e.pageDirection&&(this.pageDirection=e.pageDirection),void 0!==e.pageFit&&(this.pageFit=e.pageFit),void 0!==e.dpi&&(this.dpi=e.dpi),void 0!==e.jpegQuality&&(this.jpegQuality=e.jpegQuality),void 0!==e.resamplingMethod&&(this.resamplingMethod=e.resamplingMethod)}}class g extends m{constructor(e={}){super(),this.maximumNumberOfAccumulatedFrames=3,this.minimumNumberOfRequiredFramesWithEqualRecognitionResult=2,void 0!==e.maximumNumberOfAccumulatedFrames&&(this.maximumNumberOfAccumulatedFrames=e.maximumNumberOfAccumulatedFrames),void 0!==e.minimumNumberOfRequiredFramesWithEqualRecognitionResult&&(this.minimumNumberOfRequiredFramesWithEqualRecognitionResult=e.minimumNumberOfRequiredFramesWithEqualRecognitionResult)}}class v extends m{constructor(e={}){super(),this.accumulatedResultsVerifierConfig=new g({}),void 0!==e.accumulatedResultsVerifierConfig&&(this.accumulatedResultsVerifierConfig=new g(e.accumulatedResultsVerifierConfig))}}class y extends m{constructor(e={}){if(super(),void 0===e.symbolQuality)throw new Error("symbolQuality must be present in constructor argument");if(this.symbolQuality=e.symbolQuality,void 0===e.symbolRatio)throw new Error("symbolRatio must be present in constructor argument");this.symbolRatio=e.symbolRatio}}class w extends m{constructor(e={}){super(),this.qualityThresholds=[new y({symbolQuality:.5,symbolRatio:.5}),new y({symbolQuality:.7,symbolRatio:.3}),new y({symbolQuality:.85,symbolRatio:.3}),new y({symbolQuality:.9,symbolRatio:.1})],this.qualityIndices=["VERY_POOR","POOR","REASONABLE","GOOD","EXCELLENT"],this.maxImageSize=2e3,this.minEstimatedNumberOfSymbolsForDocument=20,this.minProcessedFraction=0,this.maxProcessedFraction=.5,this.earlyStopIfNSymbolsFound=100,this.tileSize=300,void 0!==e.qualityThresholds&&(this.qualityThresholds=e.qualityThresholds.map((e=>new y(e)))),void 0!==e.qualityIndices&&(this.qualityIndices=e.qualityIndices.map((e=>e))),void 0!==e.maxImageSize&&(this.maxImageSize=e.maxImageSize),void 0!==e.minEstimatedNumberOfSymbolsForDocument&&(this.minEstimatedNumberOfSymbolsForDocument=e.minEstimatedNumberOfSymbolsForDocument),void 0!==e.minProcessedFraction&&(this.minProcessedFraction=e.minProcessedFraction),void 0!==e.maxProcessedFraction&&(this.maxProcessedFraction=e.maxProcessedFraction),void 0!==e.earlyStopIfNSymbolsFound&&(this.earlyStopIfNSymbolsFound=e.earlyStopIfNSymbolsFound),void 0!==e.tileSize&&(this.tileSize=e.tileSize)}}!function(e){e.From=function(e){const t=e._type;switch(t){case"ScanbotBinarizationFilter":return new C(e);case"CustomBinarizationFilter":return new _(e);case"ColorDocumentFilter":return new E(e);case"BrightnessFilter":return new b(e);case"ContrastFilter":return new x(e);case"GrayscaleFilter":return new F(e);case"LegacyFilter":return new D(e);case"WhiteBlackPointFilter":return new T(e);default:throw`Unknown child class name: ${t}`}}}(n||(n={}));class C extends m{constructor(e={}){super(),this._type="ScanbotBinarizationFilter",this.outputMode="BINARY",void 0!==e.outputMode&&(this.outputMode=e.outputMode)}}class _ extends m{constructor(e={}){super(),this._type="CustomBinarizationFilter",this.outputMode="BINARY",this.denoise=.5,this.radius=32,this.preset="PRESET_4",void 0!==e.outputMode&&(this.outputMode=e.outputMode),void 0!==e.denoise&&(this.denoise=e.denoise),void 0!==e.radius&&(this.radius=e.radius),void 0!==e.preset&&(this.preset=e.preset)}}class E extends m{constructor(e={}){super(),this._type="ColorDocumentFilter"}}class b extends m{constructor(e={}){super(),this._type="BrightnessFilter",this.brightness=0,void 0!==e.brightness&&(this.brightness=e.brightness)}}class x extends m{constructor(e={}){super(),this._type="ContrastFilter",this.contrast=0,void 0!==e.contrast&&(this.contrast=e.contrast)}}class F extends m{constructor(e={}){super(),this._type="GrayscaleFilter",this.borderWidthFraction=.06,this.blackOutliersFraction=0,this.whiteOutliersFraction=.02,void 0!==e.borderWidthFraction&&(this.borderWidthFraction=e.borderWidthFraction),void 0!==e.blackOutliersFraction&&(this.blackOutliersFraction=e.blackOutliersFraction),void 0!==e.whiteOutliersFraction&&(this.whiteOutliersFraction=e.whiteOutliersFraction)}}class D extends m{constructor(e={}){super(),this._type="LegacyFilter",this.filterType=0,void 0!==e.filterType&&(this.filterType=e.filterType)}}class T extends m{constructor(e={}){super(),this._type="WhiteBlackPointFilter",this.blackPoint=0,this.whitePoint=1,void 0!==e.blackPoint&&(this.blackPoint=e.blackPoint),void 0!==e.whitePoint&&(this.whitePoint=e.whitePoint)}}class S extends m{constructor(e={}){super(),this.width=1,this.height=1,void 0!==e.width&&(this.width=e.width),void 0!==e.height&&(this.height=e.height)}}class A extends m{constructor(e={}){super(),this.acceptedAngleScore=75,this.acceptedSizeScore=80,this.acceptedBrightnessThreshold=0,this.requiredAspectRatios=[],this.rectangleOfInterest={x:0,y:0,width:0,height:0},void 0!==e.acceptedAngleScore&&(this.acceptedAngleScore=e.acceptedAngleScore),void 0!==e.acceptedSizeScore&&(this.acceptedSizeScore=e.acceptedSizeScore),void 0!==e.acceptedBrightnessThreshold&&(this.acceptedBrightnessThreshold=e.acceptedBrightnessThreshold),void 0!==e.requiredAspectRatios&&(this.requiredAspectRatios=e.requiredAspectRatios.map((e=>new S(e)))),void 0!==e.rectangleOfInterest&&(this.rectangleOfInterest={x:e.rectangleOfInterest.x,y:e.rectangleOfInterest.y,width:e.rectangleOfInterest.width,height:e.rectangleOfInterest.height})}}!function(e){e.From=function(e){const t=e._type;switch(t){case"DefaultContentValidator":return new P(e);case"PresetContentValidator":return new k(e);case"PatternContentValidator":return new O(e);default:throw`Unknown child class name: ${t}`}}}(i||(i={}));class P extends m{constructor(e={}){super(),this._type="DefaultContentValidator",this.allowedCharacters="",void 0!==e.allowedCharacters&&(this.allowedCharacters=e.allowedCharacters)}}class k extends m{constructor(e={}){if(super(),this._type="PresetContentValidator",void 0===e.preset)throw new Error("preset must be present in constructor argument");this.preset=e.preset}}class O extends m{constructor(e={}){if(super(),this._type="PatternContentValidator",this.allowedCharacters="",this.matchSubstring=!1,void 0!==e.allowedCharacters&&(this.allowedCharacters=e.allowedCharacters),void 0===e.pattern)throw new Error("pattern must be present in constructor argument");this.pattern=e.pattern,void 0!==e.matchSubstring&&(this.matchSubstring=e.matchSubstring)}}class M extends m{constructor(e={}){super(),this.ocrResolutionLimit=0,this.maximumNumberOfAccumulatedFrames=3,this.minimumNumberOfRequiredFramesWithEqualRecognitionResult=2,this.validator=new P({}),void 0!==e.ocrResolutionLimit&&(this.ocrResolutionLimit=e.ocrResolutionLimit),void 0!==e.maximumNumberOfAccumulatedFrames&&(this.maximumNumberOfAccumulatedFrames=e.maximumNumberOfAccumulatedFrames),void 0!==e.minimumNumberOfRequiredFramesWithEqualRecognitionResult&&(this.minimumNumberOfRequiredFramesWithEqualRecognitionResult=e.minimumNumberOfRequiredFramesWithEqualRecognitionResult),void 0!==e.validator&&(this.validator=i.From(e.validator))}}!function(e){e.From=function(e){const t=e._type;switch(t){case"CodabarConfig":return new R(e);case"Code11Config":return new $(e);case"Code39Config":return new z(e);case"Code93Config":return new L(e);case"Code128Config":return new I(e);case"Code2Of5Config":return new W(e);case"DataBarConfig":return new j(e);case"DataBarExpandedConfig":return new N(e);case"DataBarLimitedConfig":return new Q(e);case"ITFConfig":return new B(e);case"MSIPlesseyConfig":return new H(e);case"UpcEanConfig":return new U(e);case"PharmaCodeConfig":return new Z(e);case"AztecConfig":return new V(e);case"QRCodeConfig":return new q(e);case"PDF417Config":return new G(e);case"MicroPDF417Config":return new Y(e);case"DataMatrixConfig":return new X(e);case"MaxiCodeConfig":return new K(e);case"AustraliaPostConfig":return new J(e);case"JapanPostConfig":return new ee(e);case"RoyalMailConfig":return new te(e);case"RoyalTNTPostConfig":return new re(e);case"USPSIntelligentMailConfig":return new ne(e);case"PharmaCodeTwoTrackConfig":return new ie(e);case"GS1CompositeConfig":return new oe(e);case"GroupOneDConfig":return new se(e);case"GroupTwoDConfig":return new ae(e);case"GroupFourStateConfig":return new ue(e);case"GroupCommonConfig":return new ce(e);default:throw`Unknown child class name: ${t}`}}}(o||(o={})),function(e){e.From=function(e){const t=e._type;switch(t){case"CodabarConfig":return new R(e);case"Code11Config":return new $(e);case"Code39Config":return new z(e);case"Code93Config":return new L(e);case"Code128Config":return new I(e);case"Code2Of5Config":return new W(e);case"DataBarConfig":return new j(e);case"DataBarExpandedConfig":return new N(e);case"DataBarLimitedConfig":return new Q(e);case"ITFConfig":return new B(e);case"MSIPlesseyConfig":return new H(e);case"UpcEanConfig":return new U(e);case"PharmaCodeConfig":return new Z(e);default:throw`Unknown child class name: ${t}`}}}(s||(s={}));class R extends m{constructor(e={}){super(),this._type="CodabarConfig",this.minimum1DQuietZoneSize=6,this.regexFilter="",this.minimumTextLength=0,this.maximumTextLength=0,this.returnStartEnd=!1,void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumTextLength&&(this.minimumTextLength=e.minimumTextLength),void 0!==e.maximumTextLength&&(this.maximumTextLength=e.maximumTextLength),void 0!==e.returnStartEnd&&(this.returnStartEnd=e.returnStartEnd)}}class $ extends m{constructor(e={}){super(),this._type="Code11Config",this.minimum1DQuietZoneSize=6,this.regexFilter="",this.stripCheckDigits=!1,this.minimumTextLength=0,this.maximumTextLength=0,this.checksum=!0,void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.stripCheckDigits&&(this.stripCheckDigits=e.stripCheckDigits),void 0!==e.minimumTextLength&&(this.minimumTextLength=e.minimumTextLength),void 0!==e.maximumTextLength&&(this.maximumTextLength=e.maximumTextLength),void 0!==e.checksum&&(this.checksum=e.checksum)}}class z extends m{constructor(e={}){super(),this._type="Code39Config",this.minimum1DQuietZoneSize=6,this.regexFilter="",this.stripCheckDigits=!1,this.minimumTextLength=0,this.maximumTextLength=0,this.code32=!1,this.code39=!0,this.pzn=!0,this.tryCode39ExtendedMode=!1,this.useCode39CheckDigit=!1,void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.stripCheckDigits&&(this.stripCheckDigits=e.stripCheckDigits),void 0!==e.minimumTextLength&&(this.minimumTextLength=e.minimumTextLength),void 0!==e.maximumTextLength&&(this.maximumTextLength=e.maximumTextLength),void 0!==e.code32&&(this.code32=e.code32),void 0!==e.code39&&(this.code39=e.code39),void 0!==e.pzn&&(this.pzn=e.pzn),void 0!==e.tryCode39ExtendedMode&&(this.tryCode39ExtendedMode=e.tryCode39ExtendedMode),void 0!==e.useCode39CheckDigit&&(this.useCode39CheckDigit=e.useCode39CheckDigit)}}class L extends m{constructor(e={}){super(),this._type="Code93Config",this.minimum1DQuietZoneSize=6,this.regexFilter="",this.minimumTextLength=0,this.maximumTextLength=0,void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumTextLength&&(this.minimumTextLength=e.minimumTextLength),void 0!==e.maximumTextLength&&(this.maximumTextLength=e.maximumTextLength)}}class I extends m{constructor(e={}){super(),this._type="Code128Config",this.minimum1DQuietZoneSize=6,this.regexFilter="",this.gs1Handling="PARSE",this.minimumTextLength=0,this.maximumTextLength=0,void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling),void 0!==e.minimumTextLength&&(this.minimumTextLength=e.minimumTextLength),void 0!==e.maximumTextLength&&(this.maximumTextLength=e.maximumTextLength)}}class W extends m{constructor(e={}){super(),this._type="Code2Of5Config",this.minimum1DQuietZoneSize=6,this.regexFilter="",this.stripCheckDigits=!1,this.minimumTextLength=0,this.maximumTextLength=0,this.iata2of5=!0,this.code25=!1,this.industrial2of5=!0,this.useIATA2OF5Checksum=!0,void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.stripCheckDigits&&(this.stripCheckDigits=e.stripCheckDigits),void 0!==e.minimumTextLength&&(this.minimumTextLength=e.minimumTextLength),void 0!==e.maximumTextLength&&(this.maximumTextLength=e.maximumTextLength),void 0!==e.iata2of5&&(this.iata2of5=e.iata2of5),void 0!==e.code25&&(this.code25=e.code25),void 0!==e.industrial2of5&&(this.industrial2of5=e.industrial2of5),void 0!==e.useIATA2OF5Checksum&&(this.useIATA2OF5Checksum=e.useIATA2OF5Checksum)}}class j extends m{constructor(e={}){super(),this._type="DataBarConfig",this.minimum1DQuietZoneSize=6,this.regexFilter="",this.gs1Handling="PARSE",void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling)}}class N extends m{constructor(e={}){super(),this._type="DataBarExpandedConfig",this.minimum1DQuietZoneSize=6,this.regexFilter="",this.gs1Handling="PARSE",void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling)}}class Q extends m{constructor(e={}){super(),this._type="DataBarLimitedConfig",this.minimum1DQuietZoneSize=6,this.regexFilter="",this.gs1Handling="PARSE",void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling)}}class B extends m{constructor(e={}){super(),this._type="ITFConfig",this.minimum1DQuietZoneSize=6,this.regexFilter="",this.minimumTextLength=0,this.maximumTextLength=0,void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumTextLength&&(this.minimumTextLength=e.minimumTextLength),void 0!==e.maximumTextLength&&(this.maximumTextLength=e.maximumTextLength)}}class H extends m{constructor(e={}){super(),this._type="MSIPlesseyConfig",this.minimum1DQuietZoneSize=6,this.regexFilter="",this.stripCheckDigits=!1,this.minimumTextLength=0,this.maximumTextLength=0,this.checksumAlgorithms=["MOD_10"],void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.stripCheckDigits&&(this.stripCheckDigits=e.stripCheckDigits),void 0!==e.minimumTextLength&&(this.minimumTextLength=e.minimumTextLength),void 0!==e.maximumTextLength&&(this.maximumTextLength=e.maximumTextLength),void 0!==e.checksumAlgorithms&&(this.checksumAlgorithms=e.checksumAlgorithms.map((e=>e)))}}class U extends m{constructor(e={}){super(),this._type="UpcEanConfig",this.minimum1DQuietZoneSize=6,this.regexFilter="",this.stripCheckDigits=!1,this.ean8=!0,this.ean13=!0,this.upca=!0,this.upce=!0,this.extensions="AllowAny",void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.stripCheckDigits&&(this.stripCheckDigits=e.stripCheckDigits),void 0!==e.ean8&&(this.ean8=e.ean8),void 0!==e.ean13&&(this.ean13=e.ean13),void 0!==e.upca&&(this.upca=e.upca),void 0!==e.upce&&(this.upce=e.upce),void 0!==e.extensions&&(this.extensions=e.extensions)}}class Z extends m{constructor(e={}){super(),this._type="PharmaCodeConfig",this.minimum1DQuietZoneSize=6,this.regexFilter="",this.minimumValue=16,this.allowNarrowBarsOnly=!1,this.allowWideBarsOnly=!1,void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumValue&&(this.minimumValue=e.minimumValue),void 0!==e.allowNarrowBarsOnly&&(this.allowNarrowBarsOnly=e.allowNarrowBarsOnly),void 0!==e.allowWideBarsOnly&&(this.allowWideBarsOnly=e.allowWideBarsOnly)}}!function(e){e.From=function(e){const t=e._type;switch(t){case"AztecConfig":return new V(e);case"QRCodeConfig":return new q(e);case"PDF417Config":return new G(e);case"MicroPDF417Config":return new Y(e);case"DataMatrixConfig":return new X(e);case"MaxiCodeConfig":return new K(e);default:throw`Unknown child class name: ${t}`}}}(a||(a={}));class V extends m{constructor(e={}){super(),this._type="AztecConfig",this.regexFilter="",this.gs1Handling="PARSE",void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling)}}class q extends m{constructor(e={}){super(),this._type="QRCodeConfig",this.regexFilter="",this.gs1Handling="PARSE",this.strictMode=!0,this.qr=!0,this.microQr=!1,this.rmqr=!1,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling),void 0!==e.strictMode&&(this.strictMode=e.strictMode),void 0!==e.qr&&(this.qr=e.qr),void 0!==e.microQr&&(this.microQr=e.microQr),void 0!==e.rmqr&&(this.rmqr=e.rmqr)}}class G extends m{constructor(e={}){super(),this._type="PDF417Config",this.regexFilter="",this.gs1Handling="PARSE",this.strictMode=!0,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling),void 0!==e.strictMode&&(this.strictMode=e.strictMode)}}class Y extends m{constructor(e={}){super(),this._type="MicroPDF417Config",this.regexFilter="",this.gs1Handling="PARSE",this.strictMode=!0,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling),void 0!==e.strictMode&&(this.strictMode=e.strictMode)}}class X extends m{constructor(e={}){super(),this._type="DataMatrixConfig",this.regexFilter="",this.gs1Handling="PARSE",void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling)}}class K extends m{constructor(e={}){super(),this._type="MaxiCodeConfig",this.regexFilter="",void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter)}}!function(e){e.From=function(e){const t=e._type;switch(t){case"AustraliaPostConfig":return new J(e);case"JapanPostConfig":return new ee(e);case"RoyalMailConfig":return new te(e);case"RoyalTNTPostConfig":return new re(e);case"USPSIntelligentMailConfig":return new ne(e);case"PharmaCodeTwoTrackConfig":return new ie(e);default:throw`Unknown child class name: ${t}`}}}(u||(u={}));class J extends m{constructor(e={}){super(),this._type="AustraliaPostConfig",this.regexFilter="",this.australiaPostCustomerFormat="ALPHA_NUMERIC",void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.australiaPostCustomerFormat&&(this.australiaPostCustomerFormat=e.australiaPostCustomerFormat)}}class ee extends m{constructor(e={}){super(),this._type="JapanPostConfig",this.regexFilter="",void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter)}}class te extends m{constructor(e={}){super(),this._type="RoyalMailConfig",this.regexFilter="",this.stripCheckDigits=!1,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.stripCheckDigits&&(this.stripCheckDigits=e.stripCheckDigits)}}class re extends m{constructor(e={}){super(),this._type="RoyalTNTPostConfig",this.regexFilter="",void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter)}}class ne extends m{constructor(e={}){super(),this._type="USPSIntelligentMailConfig",this.regexFilter="",void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter)}}class ie extends m{constructor(e={}){super(),this._type="PharmaCodeTwoTrackConfig",this.regexFilter="",this.minimumValue=364,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumValue&&(this.minimumValue=e.minimumValue)}}class oe extends m{constructor(e={}){super(),this._type="GS1CompositeConfig",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.gs1Handling="PARSE",this.strictMode=!0,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling),void 0!==e.strictMode&&(this.strictMode=e.strictMode)}}class se extends m{constructor(e={}){super(),this._type="GroupOneDConfig",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.stripCheckDigits=!1,this.minimumTextLength=0,this.maximumTextLength=0,this.gs1Handling="PARSE",this.strictMode=!0,this.formats=["CODABAR","CODE_11","CODE_25","CODE_32","CODE_39","CODE_93","CODE_128","DATABAR","DATABAR_EXPANDED","DATABAR_LIMITED","EAN_8","EAN_13","IATA_2_OF_5","INDUSTRIAL_2_OF_5","ITF","MSI_PLESSEY","PHARMA_CODE","PZN","UPC_A","UPC_E"],void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.stripCheckDigits&&(this.stripCheckDigits=e.stripCheckDigits),void 0!==e.minimumTextLength&&(this.minimumTextLength=e.minimumTextLength),void 0!==e.maximumTextLength&&(this.maximumTextLength=e.maximumTextLength),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling),void 0!==e.strictMode&&(this.strictMode=e.strictMode),void 0!==e.formats&&(this.formats=e.formats.map((e=>e)))}}class ae extends m{constructor(e={}){super(),this._type="GroupTwoDConfig",this.regexFilter="",this.gs1Handling="PARSE",this.strictMode=!0,this.formats=["AZTEC","DATA_MATRIX","MAXICODE","MICRO_QR_CODE","MICRO_PDF_417","PDF_417","QR_CODE","RMQR_CODE"],void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling),void 0!==e.strictMode&&(this.strictMode=e.strictMode),void 0!==e.formats&&(this.formats=e.formats.map((e=>e)))}}class ue extends m{constructor(e={}){super(),this._type="GroupFourStateConfig",this.regexFilter="",this.formats=["AUSTRALIA_POST","JAPAN_POST","ROYAL_MAIL","ROYAL_TNT_POST","USPS_INTELLIGENT_MAIL"],void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.formats&&(this.formats=e.formats.map((e=>e)))}}class ce extends m{constructor(e={}){super(),this._type="GroupCommonConfig",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.stripCheckDigits=!1,this.minimumTextLength=0,this.maximumTextLength=0,this.gs1Handling="PARSE",this.strictMode=!0,this.formats=["AZTEC","CODABAR","CODE_39","CODE_93","CODE_128","DATA_MATRIX","DATABAR","DATABAR_EXPANDED","DATABAR_LIMITED","EAN_13","EAN_8","ITF","MICRO_QR_CODE","PDF_417","QR_CODE","UPC_A","UPC_E"],void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.stripCheckDigits&&(this.stripCheckDigits=e.stripCheckDigits),void 0!==e.minimumTextLength&&(this.minimumTextLength=e.minimumTextLength),void 0!==e.maximumTextLength&&(this.maximumTextLength=e.maximumTextLength),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling),void 0!==e.strictMode&&(this.strictMode=e.strictMode),void 0!==e.formats&&(this.formats=e.formats.map((e=>e)))}}class le extends m{constructor(e={}){super()}}(c=le||(le={})).all=["AAMVA","BOARDING_PASS","DE_MEDICAL_PLAN","MEDICAL_CERTIFICATE","ID_CARD_PDF_417","SEPA","SWISS_QR","VCARD","GS1","HIBC"],c.documentBarcodeFormats={AAMVA:["PDF_417"],ID_CARD_PDF_417:["PDF_417"],SEPA:["QR_CODE"],MEDICAL_CERTIFICATE:["PDF_417"],DE_MEDICAL_PLAN:["DATA_MATRIX"],BOARDING_PASS:["PDF_417","AZTEC"],VCARD:["QR_CODE"],SWISS_QR:["QR_CODE"],GS1:["CODE_128","AZTEC","DATA_MATRIX","DATABAR","DATABAR_EXPANDED","DATABAR_LIMITED","EAN_13","EAN_8","GS1_COMPOSITE","ITF","MICRO_PDF_417","PDF_417","QR_CODE","UPC_A","UPC_E"],HIBC:["CODE_39","CODE_128","AZTEC","DATA_MATRIX","MICRO_PDF_417","PDF_417","QR_CODE"]};class de extends m{constructor(e={}){super(),this.configurators=[new ce({})],this.engineMode="NEXT_GEN",this.live=!0,this.acceptedDocumentFormats=["AAMVA","BOARDING_PASS","DE_MEDICAL_PLAN","MEDICAL_CERTIFICATE","ID_CARD_PDF_417","SEPA","SWISS_QR","VCARD","GS1","HIBC"],this.returnBarcodeImage=!0,void 0!==e.configurators&&(this.configurators=e.configurators.map((e=>o.From(e)))),void 0!==e.engineMode&&(this.engineMode=e.engineMode),void 0!==e.live&&(this.live=e.live),void 0!==e.acceptedDocumentFormats&&(this.acceptedDocumentFormats=e.acceptedDocumentFormats.map((e=>e))),void 0!==e.returnBarcodeImage&&(this.returnBarcodeImage=e.returnBarcodeImage)}}class he extends m{constructor(e={}){super(),this.mode="LIVE",void 0!==e.mode&&(this.mode=e.mode)}}class me extends m{constructor(e={}){super(),this.minConfirmations=3,this.minConfidenceForStableField=.8,this.autoClearThreshold=4,void 0!==e.minConfirmations&&(this.minConfirmations=e.minConfirmations),void 0!==e.minConfidenceForStableField&&(this.minConfidenceForStableField=e.minConfidenceForStableField),void 0!==e.autoClearThreshold&&(this.autoClearThreshold=e.autoClearThreshold)}}class fe extends m{constructor(e={}){super(),this.resultAccumulationConfig=new me({}),this.fieldExcludeList=[],this.acceptedDocumentTypes=[],void 0!==e.resultAccumulationConfig&&(this.resultAccumulationConfig=new me(e.resultAccumulationConfig)),void 0!==e.fieldExcludeList&&(this.fieldExcludeList=e.fieldExcludeList.map((e=>e))),void 0!==e.acceptedDocumentTypes&&(this.acceptedDocumentTypes=e.acceptedDocumentTypes.map((e=>e)))}}!function(e){e.From=function(e){const t=e._type;switch(t){case"UserFieldDoubleValue":return new pe(e);case"UserFieldStringValue":return new ge(e);case"UserFieldIntValue":return new ve(e);default:throw`Unknown child class name: ${t}`}}}(l||(l={}));class pe extends m{constructor(e={}){if(super(),this._type="UserFieldDoubleValue",void 0===e.value)throw new Error("value must be present in constructor argument");this.value=e.value}}class ge extends m{constructor(e={}){if(super(),this._type="UserFieldStringValue",void 0===e.value)throw new Error("value must be present in constructor argument");this.value=e.value}}class ve extends m{constructor(e={}){if(super(),this._type="UserFieldIntValue",void 0===e.value)throw new Error("value must be present in constructor argument");this.value=e.value}}class ye extends m{constructor(e={}){if(super(),void 0===e.tag)throw new Error("tag must be present in constructor argument");if(this.tag=e.tag,void 0===e.name)throw new Error("name must be present in constructor argument");if(this.name=e.name,void 0===e.value)throw new Error("value must be present in constructor argument");this.value=l.From(e.value)}}class we extends m{constructor(e={}){super(),this.compression="LZW",this.jpegQuality=80,this.zipCompressionLevel=6,this.dpi=72,this.userFields=[],this.binarizationFilter=null,void 0!==e.compression&&(this.compression=e.compression),void 0!==e.jpegQuality&&(this.jpegQuality=e.jpegQuality),void 0!==e.zipCompressionLevel&&(this.zipCompressionLevel=e.zipCompressionLevel),void 0!==e.dpi&&(this.dpi=e.dpi),void 0!==e.userFields&&(this.userFields=e.userFields.map((e=>new ye(e)))),void 0!==e.binarizationFilter&&(this.binarizationFilter=null!=e.binarizationFilter?n.From(e.binarizationFilter):null)}}(d=we||(we={})).defaultCompression="LZW",d.binaryDocumentOptimizedCompression="CCITTFAX4";var Ce=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};let _e;class Ee{constructor(e){this.id=e}}const be={};function xe(e){const t=Math.random().toString(36);return be[t]=e,new Ee(t)}function Fe(e){if(!be.hasOwnProperty(e.id))throw new Error(`Object ${e.id} does not exist`);return be[e.id]}function De(e){const t=Fe(e);t.delete&&t.delete(),delete be[e.id]}const Te={initialize:function(e,t,n,i,o){return Ce(this,void 0,void 0,(function*(){try{const{captureConsole:s,jpegQuality:a=80,requestSuffix:u=""}=o||{};s&&(console.log=function(...e){self.postMessage({log:e})},console.error=function(...e){self.postMessage({logError:e})});const c=r(2),l=r(3),d={locateFile:function(e,r){let n;return n=t?Object(h.c)(t)?t:"":i,e.endsWith(".worker.js")&&l?l.default:new URL(n+e+u,location.href).href}},m=Object(h.b)(o),f=m.includes("-threads");d.mainScriptUrlOrBlob=d.locateFile(`ScanbotSDK.Asm${m}.js`);let p;if(!!navigator.userAgentData&&navigator.userAgentData.brands.some((e=>"Chromium"===e.brand))&&f){let e=[2147483648,805306368,536870912],t=134217728;const r=["barcode-scanner"],n=67108864;"undefined"!=typeof SCANBOTSDK_FLAVOR&&r.includes(SCANBOTSDK_FLAVOR)&&(t=n,e.push(4*n));for(let r=0;r<e.length;r++){const n=e[r];try{p=new WebAssembly.Memory({initial:0,maximum:n/65536,shared:!0}),p.grow(t/65536);break}catch(t){if(r===e.length-1)throw t}}}return p&&(d.wasmMemory=p),yield c(d),_e=d,_e.initialize(e||"",n,a)}catch(e){throw console.error(e),e}}))},getLicenseInfo:function(){return Ce(this,void 0,void 0,(function*(){return _e.getLicenseInfo()}))},encodeJpeg:function(e){return Ce(this,void 0,void 0,(function*(){const t=Ae(e);return Se(_e.encodeJpeg(t))}))},detectDocument:function(e,t){return Ce(this,void 0,void 0,(function*(){const r=new _e.DocumentDetector(new A(t)),n=r.detect(Ae(e));return r.delete(),Se(n)}))},detectAndCropDocument:function(e){return Ce(this,void 0,void 0,(function*(){let t=Se(_e.detectAndCropDocument(Ae(e)));return null===t.originalImage&&(t.originalImage=e),t}))},createDocumentDetector:function(e){return Ce(this,void 0,void 0,(function*(){return xe(new _e.DocumentDetector(new A(e)))}))},documentDetectorDetect:function(e,t){return Ce(this,void 0,void 0,(function*(){return Se(Fe(e).detect(Ae(t)))}))},parseBarcodeDocument:function(e,t){return Ce(this,void 0,void 0,(function*(){return Se(_e.parseBarcodeDocument(e,t))}))},createBarcodeRecognizer:function(e){return Ce(this,void 0,void 0,(function*(){return xe(new _e.BarcodeRecognizer(new de(e)))}))},recognizeBarcodes:function(e,t){return Ce(this,void 0,void 0,(function*(){return Se(Fe(e).recognize(Ae(t)))}))},beginPdf:function(e){return Ce(this,void 0,void 0,(function*(){return xe(new _e.PdfGenerationContext(new p(e)))}))},addPageToPdf:function(e,t){return Ce(this,void 0,void 0,(function*(){Se(Fe(e).addPage(Ae(t)))}))},completePdf:function(e){return Ce(this,void 0,void 0,(function*(){try{const t=Fe(e);return Se(t.complete())}finally{De(e)}}))},beginTiff:function(e){return Ce(this,void 0,void 0,(function*(){const t=new _e.TiffGenerationContext(new we(e));return Se(t.begin()),xe(t)}))},addPageToTiff:function(e,t,r){return Ce(this,void 0,void 0,(function*(){return Se(Fe(e).addPage(Ae(t),r))}))},completeTiff:function(e){return Ce(this,void 0,void 0,(function*(){try{const t=Fe(e);return Se(t.complete())}finally{De(e)}}))},createMRZRecognizer:function(e){return Ce(this,void 0,void 0,(function*(){return xe(new _e.MrzRecognizerContext(new v(e)))}))},recognizeMRZ:function(e,t){return Ce(this,void 0,void 0,(function*(){return Se(Fe(e).recognize(Ae(t)))}))},releaseObject:function(e){return Ce(this,void 0,void 0,(function*(){De(e)}))},createOcrEngine:function(){return Ce(this,void 0,void 0,(function*(){return xe(new _e.TLDROcrContext)}))},performOcr:function(e,t){return Ce(this,void 0,void 0,(function*(){return Se(Fe(e).performOcr(Ae(t)))}))},createGenericTextLineScanner:function(e){return Ce(this,void 0,void 0,(function*(){return xe(new _e.GenericTextLineScanner(new M(e)))}))},recognizeTextLine:function(e,t){return Ce(this,void 0,void 0,(function*(){return Se(Fe(e).recognize(Ae(t)))}))},cleanTextLineRecognitionQueue:function(e){return Ce(this,void 0,void 0,(function*(){Fe(e).cleanRecognitionQueue()}))},createDocumentQualityAnalyzer:function(e){return Ce(this,void 0,void 0,(function*(){return xe(new _e.DocumentQualityAnalyzer(new w(e)))}))},documentQualityAnalyzerAnalyze:function(e,t){return Ce(this,void 0,void 0,(function*(){return Se(Fe(e).analyze(Ae(t)))}))},imageApplyFilter:function(e,t){return Ce(this,void 0,void 0,(function*(){return Se(_e.imageApplyFilter(Ae(e),n.From(t)))}))},imageCrop:function(e,t){return Ce(this,void 0,void 0,(function*(){return Se(_e.imageCrop(Ae(e),t))}))},imageResize:function(e,t){return Ce(this,void 0,void 0,(function*(){return Se(_e.imageResize(Ae(e),t))}))},imageRotate:function(e,t){return Ce(this,void 0,void 0,(function*(){return Se(_e.imageRotate(Ae(e),t))}))},genericDocumentRecognizerCreate:function(e){return Ce(this,void 0,void 0,(function*(){return xe(new _e.GenericDocumentRecognizer(new fe(e)))}))},genericDocumentRecognizerRecognize:function(e,t,r){return Ce(this,void 0,void 0,(function*(){return Se(Fe(e).recognize(Ae(t),new he(r)))}))},__hasModuleFunction:function(e){return Ce(this,void 0,void 0,(function*(){return _e.hasOwnProperty(e)}))},__callModuleFunction:function(e,t=[]){return Ce(this,void 0,void 0,(function*(){return _e[e].apply(t)}))}};function Se(e){if(e.errorMessage)throw new Error(e.errorMessage);return e.result}function Ae(e){if(!e)throw new Error("null image data or buffer");if("format"in e&&"string"==typeof e.format)return e;if("width"in e&&"number"==typeof e.width)return{data:e.data,width:e.width,height:e.height,format:"",step:0};return{data:ArrayBuffer.isView(e)?e:new Uint8Array(e),width:-1,height:-1,format:"",step:0}}onmessage=function(e){const{command:t,args:r,ticket:n}=e.data;_e||"initialize"===t?(()=>Ce(this,void 0,void 0,(function*(){return yield Te[t].apply(null,r)})))().then((e=>{const t=Object(h.a)(e);self.postMessage({ticket:n,result:e},t)})).catch((e=>{const t="number"==typeof e?Error(_e.stringFromException(e)):e;console.error(t),self.postMessage({ticket:n,error:t})})):self.postMessage({ticket:n,error:new Error("WASM module not loaded yet.")})}}]);
|
|
1
|
+
!function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=4)}([function(e,t,r){"use strict";(function(e){function n(e,t=!1){const r=[];if(t)return r;return function e(t){if(t)if(t.constructor===ImageData)r.push(t.data.buffer);else if(t.constructor===ArrayBuffer)r.push(t);else if(ArrayBuffer.isView(t))r.push(t.buffer);else if(Array.isArray(t))for(let r=0;r<t.length;++r)e(t[r]);else if(t.constructor===Object)for(const r in t)t.hasOwnProperty(r)&&e(t[r])}(e),r}function i(e){return e.startsWith("http:")||e.startsWith("https:")}function o(t){const{allowSimd:r=!0,allowThreads:n=!0}=t||{};let i="";if(r&&function(){try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11]))}catch(e){return!1}}()){i+="-simd";n&&function(){if("undefined"!=typeof e&&"undefined"!=typeof e.versions&&"undefined"!=typeof e.versions.node)return!1;if(/(iPad|iPhone|iPod)/g.test(navigator.userAgent))return!1;try{return(new MessageChannel).port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11]))}catch(e){return!1}}()&&(i+="-threads")}return i}r.d(t,"a",(function(){return n})),r.d(t,"c",(function(){return i})),r.d(t,"b",(function(){return o}))}).call(this,r(1))},function(e,t){var r,n,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(r===setTimeout)return setTimeout(e,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:o}catch(e){r=o}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(e){n=a}}();var u,c=[],l=!1,d=-1;function h(){l&&u&&(l=!1,u.length?c=u.concat(c):d=-1,c.length&&m())}function m(){if(!l){var e=s(h);l=!0;for(var t=c.length;t;){for(u=c,c=[];++d<t;)u&&u[d].run();d=-1,t=c.length}u=null,l=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function f(e,t){this.fun=e,this.array=t}function p(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];c.push(new f(e,t)),1!==c.length||l||s(m)},f.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=p,i.addListener=p,i.once=p,i.off=p,i.removeListener=p,i.removeAllListeners=p,i.emit=p,i.prependListener=p,i.prependOnceListener=p,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(e,t,r){"use strict";var n,i=(n="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,function(e={}){var t,r,i=e;i.ready=new Promise(((e,n)=>{t=e,r=n}));var o,a,s,u=Object.assign({},i),c="./this.program",l=(e,t)=>{throw t},d="";d=self.location.href,n&&(d=n),d=0!==d.indexOf("blob:")?d.substr(0,d.replace(/[?#].*/,"").lastIndexOf("/")+1):"",o=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},s=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)},a=(e,t,r)=>{var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?t(n.response):r()},n.onerror=r,n.send(null)};var h,m=i.print||console.log.bind(console),f=i.printErr||console.error.bind(console);Object.assign(i,u),u=null,i.arguments&&i.arguments,i.thisProgram&&(c=i.thisProgram),i.quit&&(l=i.quit),i.wasmBinary&&(h=i.wasmBinary);var p,g=i.noExitRuntime||!0;"object"!=typeof WebAssembly&&W("no native wasm support detected");var v,y,w,C,_,E,b,x,F,D=!1;function T(){var e=p.buffer;i.HEAP8=v=new Int8Array(e),i.HEAP16=w=new Int16Array(e),i.HEAPU8=y=new Uint8Array(e),i.HEAPU16=C=new Uint16Array(e),i.HEAP32=_=new Int32Array(e),i.HEAPU32=E=new Uint32Array(e),i.HEAPF32=b=new Float32Array(e),i.HEAPF64=x=new Float64Array(e)}var S,A,k,P,M=[],R=[],O=[],$=0,z=null,L=null;function I(e){$++,i.monitorRunDependencies&&i.monitorRunDependencies($)}function j(e){if($--,i.monitorRunDependencies&&i.monitorRunDependencies($),0==$&&(null!==z&&(clearInterval(z),z=null),L)){var t=L;L=null,t()}}function W(e){i.onAbort&&i.onAbort(e),f(e="Aborted("+e+")"),D=!0,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw r(t),t}function B(e){return e.startsWith("data:application/octet-stream;base64,")}function N(e){if(e==S&&h)return new Uint8Array(h);if(s)return s(e);throw"both async and sync fetching of the wasm failed"}function Q(e,t,r){return function(e){return h||"function"!=typeof fetch?Promise.resolve().then((()=>N(e))):fetch(e,{credentials:"same-origin"}).then((t=>{if(!t.ok)throw"failed to load wasm binary file at '"+e+"'";return t.arrayBuffer()})).catch((()=>N(e)))}(e).then((e=>WebAssembly.instantiate(e,t))).then((e=>e)).then(r,(e=>{f(`failed to asynchronously prepare wasm: ${e}`),W(e)}))}B(S="ScanbotSDK.Asm.wasm")||(A=S,S=i.locateFile?i.locateFile(A,d):d+A);var H={3683120:e=>mr(function(){return this[pe(e)].toString()}.apply((0,eval)("(()=>this)()")))};function U(e){this.name="ExitStatus",this.message=`Program terminated with exit(${e})`,this.status=e}var V=e=>{for(;e.length>0;)e.shift()(i)},Z=[],Y=0,q=0;function G(e){this.excPtr=e,this.ptr=e-24,this.set_type=function(e){E[this.ptr+4>>2]=e},this.get_type=function(){return E[this.ptr+4>>2]},this.set_destructor=function(e){E[this.ptr+8>>2]=e},this.get_destructor=function(){return E[this.ptr+8>>2]},this.set_caught=function(e){e=e?1:0,v[this.ptr+12>>0]=e},this.get_caught=function(){return 0!=v[this.ptr+12>>0]},this.set_rethrown=function(e){e=e?1:0,v[this.ptr+13>>0]=e},this.get_rethrown=function(){return 0!=v[this.ptr+13>>0]},this.init=function(e,t){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(t)},this.set_adjusted_ptr=function(e){E[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return E[this.ptr+16>>2]},this.get_exception_ptr=function(){if(Mr(this.get_type()))return E[this.excPtr>>2];var e=this.get_adjusted_ptr();return 0!==e?e:this.excPtr}}var X=e=>{var t=q;if(!t)return br(0),0;var r=new G(t);r.set_adjusted_ptr(t);var n=r.get_type();if(!n)return br(0),t;for(var i in e){var o=e[i];if(0===o||o===n)break;var a=r.ptr+16;if(Pr(o,n,a))return br(o),t}return br(n),t},K=()=>{var e=Z.pop();e||W("no exception to throw");var t=e.excPtr;throw e.get_rethrown()||(Z.push(e),e.set_rethrown(!0),e.set_caught(!1),Y++),q=t},J={isAbs:e=>"/"===e.charAt(0),splitPath:e=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1),normalizeArray:(e,t)=>{for(var r=0,n=e.length-1;n>=0;n--){var i=e[n];"."===i?e.splice(n,1):".."===i?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r;r--)e.unshift("..");return e},normalize:e=>{var t=J.isAbs(e),r="/"===e.substr(-1);return(e=J.normalizeArray(e.split("/").filter((e=>!!e)),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},dirname:e=>{var t=J.splitPath(e),r=t[0],n=t[1];return r||n?(n&&(n=n.substr(0,n.length-1)),r+n):"."},basename:e=>{if("/"===e)return"/";var t=(e=(e=J.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?e:e.substr(t+1)},join:function(){var e=Array.prototype.slice.call(arguments);return J.normalize(e.join("/"))},join2:(e,t)=>J.normalize(e+"/"+t)},ee=e=>(ee=(()=>{if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues)return e=>crypto.getRandomValues(e);W("initRandomDevice")})())(e),te={resolve:function(){for(var e="",t=!1,r=arguments.length-1;r>=-1&&!t;r--){var n=r>=0?arguments[r]:fe.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,t=J.isAbs(n)}return(t?"/":"")+(e=J.normalizeArray(e.split("/").filter((e=>!!e)),!t).join("/"))||"."},relative:(e,t)=>{function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var r=e.length-1;r>=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=te.resolve(e).substr(1),t=te.resolve(t).substr(1);for(var n=r(e.split("/")),i=r(t.split("/")),o=Math.min(n.length,i.length),a=o,s=0;s<o;s++)if(n[s]!==i[s]){a=s;break}var u=[];for(s=a;s<n.length;s++)u.push("..");return(u=u.concat(i.slice(a))).join("/")}},re="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0,ne=(e,t,r)=>{for(var n=t+r,i=t;e[i]&&!(i>=n);)++i;if(i-t>16&&e.buffer&&re)return re.decode(e.subarray(t,i));for(var o="";t<i;){var a=e[t++];if(128&a){var s=63&e[t++];if(192!=(224&a)){var u=63&e[t++];if((a=224==(240&a)?(15&a)<<12|s<<6|u:(7&a)<<18|s<<12|u<<6|63&e[t++])<65536)o+=String.fromCharCode(a);else{var c=a-65536;o+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else o+=String.fromCharCode((31&a)<<6|s)}else o+=String.fromCharCode(a)}return o},ie=[],oe=e=>{for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n<=127?t++:n<=2047?t+=2:n>=55296&&n<=57343?(t+=4,++r):t+=3}return t},ae=(e,t,r,n)=>{if(!(n>0))return 0;for(var i=r,o=r+n-1,a=0;a<e.length;++a){var s=e.charCodeAt(a);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++a)),s<=127){if(r>=o)break;t[r++]=s}else if(s<=2047){if(r+1>=o)break;t[r++]=192|s>>6,t[r++]=128|63&s}else if(s<=65535){if(r+2>=o)break;t[r++]=224|s>>12,t[r++]=128|s>>6&63,t[r++]=128|63&s}else{if(r+3>=o)break;t[r++]=240|s>>18,t[r++]=128|s>>12&63,t[r++]=128|s>>6&63,t[r++]=128|63&s}}return t[r]=0,r-i};function se(e,t,r){var n=r>0?r:oe(e)+1,i=new Array(n),o=ae(e,i,0,i.length);return t&&(i.length=o),i}var ue={ttys:[],init(){},shutdown(){},register(e,t){ue.ttys[e]={input:[],output:[],ops:t},fe.registerDevice(e,ue.stream_ops)},stream_ops:{open(e){var t=ue.ttys[e.node.rdev];if(!t)throw new fe.ErrnoError(43);e.tty=t,e.seekable=!1},close(e){e.tty.ops.fsync(e.tty)},fsync(e){e.tty.ops.fsync(e.tty)},read(e,t,r,n,i){if(!e.tty||!e.tty.ops.get_char)throw new fe.ErrnoError(60);for(var o=0,a=0;a<n;a++){var s;try{s=e.tty.ops.get_char(e.tty)}catch(e){throw new fe.ErrnoError(29)}if(void 0===s&&0===o)throw new fe.ErrnoError(6);if(null==s)break;o++,t[r+a]=s}return o&&(e.node.timestamp=Date.now()),o},write(e,t,r,n,i){if(!e.tty||!e.tty.ops.put_char)throw new fe.ErrnoError(60);try{for(var o=0;o<n;o++)e.tty.ops.put_char(e.tty,t[r+o])}catch(e){throw new fe.ErrnoError(29)}return n&&(e.node.timestamp=Date.now()),o}},default_tty_ops:{get_char:e=>(()=>{if(!ie.length){var e=null;if("undefined"!=typeof window&&"function"==typeof window.prompt?null!==(e=window.prompt("Input: "))&&(e+="\n"):"function"==typeof readline&&null!==(e=readline())&&(e+="\n"),!e)return null;ie=se(e,!0)}return ie.shift()})(),put_char(e,t){null===t||10===t?(m(ne(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync(e){e.output&&e.output.length>0&&(m(ne(e.output,0)),e.output=[])},ioctl_tcgets:e=>({c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}),ioctl_tcsets:(e,t,r)=>0,ioctl_tiocgwinsz:e=>[24,80]},default_tty1_ops:{put_char(e,t){null===t||10===t?(f(ne(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync(e){e.output&&e.output.length>0&&(f(ne(e.output,0)),e.output=[])}}},ce=e=>{e=((e,t)=>Math.ceil(e/t)*t)(e,65536);var t=Fr(65536,e);return t?((e,t)=>(y.fill(0,e,e+t),e))(t,e):0},le={ops_table:null,mount:e=>le.createNode(null,"/",16895,0),createNode(e,t,r,n){if(fe.isBlkdev(r)||fe.isFIFO(r))throw new fe.ErrnoError(63);le.ops_table||(le.ops_table={dir:{node:{getattr:le.node_ops.getattr,setattr:le.node_ops.setattr,lookup:le.node_ops.lookup,mknod:le.node_ops.mknod,rename:le.node_ops.rename,unlink:le.node_ops.unlink,rmdir:le.node_ops.rmdir,readdir:le.node_ops.readdir,symlink:le.node_ops.symlink},stream:{llseek:le.stream_ops.llseek}},file:{node:{getattr:le.node_ops.getattr,setattr:le.node_ops.setattr},stream:{llseek:le.stream_ops.llseek,read:le.stream_ops.read,write:le.stream_ops.write,allocate:le.stream_ops.allocate,mmap:le.stream_ops.mmap,msync:le.stream_ops.msync}},link:{node:{getattr:le.node_ops.getattr,setattr:le.node_ops.setattr,readlink:le.node_ops.readlink},stream:{}},chrdev:{node:{getattr:le.node_ops.getattr,setattr:le.node_ops.setattr},stream:fe.chrdev_stream_ops}});var i=fe.createNode(e,t,r,n);return fe.isDir(i.mode)?(i.node_ops=le.ops_table.dir.node,i.stream_ops=le.ops_table.dir.stream,i.contents={}):fe.isFile(i.mode)?(i.node_ops=le.ops_table.file.node,i.stream_ops=le.ops_table.file.stream,i.usedBytes=0,i.contents=null):fe.isLink(i.mode)?(i.node_ops=le.ops_table.link.node,i.stream_ops=le.ops_table.link.stream):fe.isChrdev(i.mode)&&(i.node_ops=le.ops_table.chrdev.node,i.stream_ops=le.ops_table.chrdev.stream),i.timestamp=Date.now(),e&&(e.contents[t]=i,e.timestamp=i.timestamp),i},getFileDataAsTypedArray:e=>e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0),expandFileStorage(e,t){var r=e.contents?e.contents.length:0;if(!(r>=t)){t=Math.max(t,r*(r<1048576?2:1.125)>>>0),0!=r&&(t=Math.max(t,256));var n=e.contents;e.contents=new Uint8Array(t),e.usedBytes>0&&e.contents.set(n.subarray(0,e.usedBytes),0)}},resizeFileStorage(e,t){if(e.usedBytes!=t)if(0==t)e.contents=null,e.usedBytes=0;else{var r=e.contents;e.contents=new Uint8Array(t),r&&e.contents.set(r.subarray(0,Math.min(t,e.usedBytes))),e.usedBytes=t}},node_ops:{getattr(e){var t={};return t.dev=fe.isChrdev(e.mode)?e.id:1,t.ino=e.id,t.mode=e.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=e.rdev,fe.isDir(e.mode)?t.size=4096:fe.isFile(e.mode)?t.size=e.usedBytes:fe.isLink(e.mode)?t.size=e.link.length:t.size=0,t.atime=new Date(e.timestamp),t.mtime=new Date(e.timestamp),t.ctime=new Date(e.timestamp),t.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},setattr(e,t){void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp),void 0!==t.size&&le.resizeFileStorage(e,t.size)},lookup(e,t){throw fe.genericErrors[44]},mknod:(e,t,r,n)=>le.createNode(e,t,r,n),rename(e,t,r){if(fe.isDir(e.mode)){var n;try{n=fe.lookupNode(t,r)}catch(e){}if(n)for(var i in n.contents)throw new fe.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=r,t.contents[r]=e,t.timestamp=e.parent.timestamp,e.parent=t},unlink(e,t){delete e.contents[t],e.timestamp=Date.now()},rmdir(e,t){var r=fe.lookupNode(e,t);for(var n in r.contents)throw new fe.ErrnoError(55);delete e.contents[t],e.timestamp=Date.now()},readdir(e){var t=[".",".."];for(var r in e.contents)e.contents.hasOwnProperty(r)&&t.push(r);return t},symlink(e,t,r){var n=le.createNode(e,t,41471,0);return n.link=r,n},readlink(e){if(!fe.isLink(e.mode))throw new fe.ErrnoError(28);return e.link}},stream_ops:{read(e,t,r,n,i){var o=e.node.contents;if(i>=e.node.usedBytes)return 0;var a=Math.min(e.node.usedBytes-i,n);if(a>8&&o.subarray)t.set(o.subarray(i,i+a),r);else for(var s=0;s<a;s++)t[r+s]=o[i+s];return a},write(e,t,r,n,i,o){if(t.buffer===v.buffer&&(o=!1),!n)return 0;var a=e.node;if(a.timestamp=Date.now(),t.subarray&&(!a.contents||a.contents.subarray)){if(o)return a.contents=t.subarray(r,r+n),a.usedBytes=n,n;if(0===a.usedBytes&&0===i)return a.contents=t.slice(r,r+n),a.usedBytes=n,n;if(i+n<=a.usedBytes)return a.contents.set(t.subarray(r,r+n),i),n}if(le.expandFileStorage(a,i+n),a.contents.subarray&&t.subarray)a.contents.set(t.subarray(r,r+n),i);else for(var s=0;s<n;s++)a.contents[i+s]=t[r+s];return a.usedBytes=Math.max(a.usedBytes,i+n),n},llseek(e,t,r){var n=t;if(1===r?n+=e.position:2===r&&fe.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new fe.ErrnoError(28);return n},allocate(e,t,r){le.expandFileStorage(e.node,t+r),e.node.usedBytes=Math.max(e.node.usedBytes,t+r)},mmap(e,t,r,n,i){if(!fe.isFile(e.node.mode))throw new fe.ErrnoError(43);var o,a,s=e.node.contents;if(2&i||s.buffer!==v.buffer){if((r>0||r+t<s.length)&&(s=s.subarray?s.subarray(r,r+t):Array.prototype.slice.call(s,r,r+t)),a=!0,!(o=ce(t)))throw new fe.ErrnoError(48);v.set(s,o)}else a=!1,o=s.byteOffset;return{ptr:o,allocated:a}},msync:(e,t,r,n,i)=>(le.stream_ops.write(e,t,0,n,r,!1),0)}},de=(e,t,r,n)=>{var i=n?"":`al ${e}`;a(e,(r=>{var n;n=`Loading data file "${e}" failed (no arrayBuffer).`,r||W(n),t(new Uint8Array(r)),i&&j()}),(t=>{if(!r)throw`Loading data file "${e}" failed.`;r()})),i&&I()},he=i.preloadPlugins||[],me=(e,t)=>{var r=0;return e&&(r|=365),t&&(r|=146),r},fe={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath(e,t={}){if(!(e=te.resolve(e)))return{path:"",node:null};if((t=Object.assign({follow_mount:!0,recurse_count:0},t)).recurse_count>8)throw new fe.ErrnoError(32);for(var r=e.split("/").filter((e=>!!e)),n=fe.root,i="/",o=0;o<r.length;o++){var a=o===r.length-1;if(a&&t.parent)break;if(n=fe.lookupNode(n,r[o]),i=J.join2(i,r[o]),fe.isMountpoint(n)&&(!a||a&&t.follow_mount)&&(n=n.mounted.root),!a||t.follow)for(var s=0;fe.isLink(n.mode);){var u=fe.readlink(i);if(i=te.resolve(J.dirname(i),u),n=fe.lookupPath(i,{recurse_count:t.recurse_count+1}).node,s++>40)throw new fe.ErrnoError(32)}}return{path:i,node:n}},getPath(e){for(var t;;){if(fe.isRoot(e)){var r=e.mount.mountpoint;return t?"/"!==r[r.length-1]?`${r}/${t}`:r+t:r}t=t?`${e.name}/${t}`:e.name,e=e.parent}},hashName(e,t){for(var r=0,n=0;n<t.length;n++)r=(r<<5)-r+t.charCodeAt(n)|0;return(e+r>>>0)%fe.nameTable.length},hashAddNode(e){var t=fe.hashName(e.parent.id,e.name);e.name_next=fe.nameTable[t],fe.nameTable[t]=e},hashRemoveNode(e){var t=fe.hashName(e.parent.id,e.name);if(fe.nameTable[t]===e)fe.nameTable[t]=e.name_next;else for(var r=fe.nameTable[t];r;){if(r.name_next===e){r.name_next=e.name_next;break}r=r.name_next}},lookupNode(e,t){var r=fe.mayLookup(e);if(r)throw new fe.ErrnoError(r,e);for(var n=fe.hashName(e.id,t),i=fe.nameTable[n];i;i=i.name_next){var o=i.name;if(i.parent.id===e.id&&o===t)return i}return fe.lookup(e,t)},createNode(e,t,r,n){var i=new fe.FSNode(e,t,r,n);return fe.hashAddNode(i),i},destroyNode(e){fe.hashRemoveNode(e)},isRoot:e=>e===e.parent,isMountpoint:e=>!!e.mounted,isFile:e=>32768==(61440&e),isDir:e=>16384==(61440&e),isLink:e=>40960==(61440&e),isChrdev:e=>8192==(61440&e),isBlkdev:e=>24576==(61440&e),isFIFO:e=>4096==(61440&e),isSocket:e=>49152==(49152&e),flagsToPermissionString(e){var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t},nodePermissions:(e,t)=>fe.ignorePermissions||(!t.includes("r")||292&e.mode)&&(!t.includes("w")||146&e.mode)&&(!t.includes("x")||73&e.mode)?0:2,mayLookup(e){var t=fe.nodePermissions(e,"x");return t||(e.node_ops.lookup?0:2)},mayCreate(e,t){try{return fe.lookupNode(e,t),20}catch(e){}return fe.nodePermissions(e,"wx")},mayDelete(e,t,r){var n;try{n=fe.lookupNode(e,t)}catch(e){return e.errno}var i=fe.nodePermissions(e,"wx");if(i)return i;if(r){if(!fe.isDir(n.mode))return 54;if(fe.isRoot(n)||fe.getPath(n)===fe.cwd())return 10}else if(fe.isDir(n.mode))return 31;return 0},mayOpen:(e,t)=>e?fe.isLink(e.mode)?32:fe.isDir(e.mode)&&("r"!==fe.flagsToPermissionString(t)||512&t)?31:fe.nodePermissions(e,fe.flagsToPermissionString(t)):44,MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=fe.MAX_OPEN_FDS;e++)if(!fe.streams[e])return e;throw new fe.ErrnoError(33)},getStreamChecked(e){var t=fe.getStream(e);if(!t)throw new fe.ErrnoError(8);return t},getStream:e=>fe.streams[e],createStream:(e,t=-1)=>(fe.FSStream||(fe.FSStream=function(){this.shared={}},fe.FSStream.prototype={},Object.defineProperties(fe.FSStream.prototype,{object:{get(){return this.node},set(e){this.node=e}},isRead:{get(){return 1!=(2097155&this.flags)}},isWrite:{get(){return 0!=(2097155&this.flags)}},isAppend:{get(){return 1024&this.flags}},flags:{get(){return this.shared.flags},set(e){this.shared.flags=e}},position:{get(){return this.shared.position},set(e){this.shared.position=e}}})),e=Object.assign(new fe.FSStream,e),-1==t&&(t=fe.nextfd()),e.fd=t,fe.streams[t]=e,e),closeStream(e){fe.streams[e]=null},chrdev_stream_ops:{open(e){var t=fe.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek(){throw new fe.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,t)=>e<<8|t,registerDevice(e,t){fe.devices[e]={stream_ops:t}},getDevice:e=>fe.devices[e],getMounts(e){for(var t=[],r=[e];r.length;){var n=r.pop();t.push(n),r.push.apply(r,n.mounts)}return t},syncfs(e,t){"function"==typeof e&&(t=e,e=!1),fe.syncFSRequests++,fe.syncFSRequests>1&&f(`warning: ${fe.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var r=fe.getMounts(fe.root.mount),n=0;function i(e){return fe.syncFSRequests--,t(e)}function o(e){if(e)return o.errored?void 0:(o.errored=!0,i(e));++n>=r.length&&i(null)}r.forEach((t=>{if(!t.type.syncfs)return o(null);t.type.syncfs(t,e,o)}))},mount(e,t,r){var n,i="/"===r,o=!r;if(i&&fe.root)throw new fe.ErrnoError(10);if(!i&&!o){var a=fe.lookupPath(r,{follow_mount:!1});if(r=a.path,n=a.node,fe.isMountpoint(n))throw new fe.ErrnoError(10);if(!fe.isDir(n.mode))throw new fe.ErrnoError(54)}var s={type:e,opts:t,mountpoint:r,mounts:[]},u=e.mount(s);return u.mount=s,s.root=u,i?fe.root=u:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),u},unmount(e){var t=fe.lookupPath(e,{follow_mount:!1});if(!fe.isMountpoint(t.node))throw new fe.ErrnoError(28);var r=t.node,n=r.mounted,i=fe.getMounts(n);Object.keys(fe.nameTable).forEach((e=>{for(var t=fe.nameTable[e];t;){var r=t.name_next;i.includes(t.mount)&&fe.destroyNode(t),t=r}})),r.mounted=null;var o=r.mount.mounts.indexOf(n);r.mount.mounts.splice(o,1)},lookup:(e,t)=>e.node_ops.lookup(e,t),mknod(e,t,r){var n=fe.lookupPath(e,{parent:!0}).node,i=J.basename(e);if(!i||"."===i||".."===i)throw new fe.ErrnoError(28);var o=fe.mayCreate(n,i);if(o)throw new fe.ErrnoError(o);if(!n.node_ops.mknod)throw new fe.ErrnoError(63);return n.node_ops.mknod(n,i,t,r)},create:(e,t)=>(t=void 0!==t?t:438,t&=4095,t|=32768,fe.mknod(e,t,0)),mkdir:(e,t)=>(t=void 0!==t?t:511,t&=1023,t|=16384,fe.mknod(e,t,0)),mkdirTree(e,t){for(var r=e.split("/"),n="",i=0;i<r.length;++i)if(r[i]){n+="/"+r[i];try{fe.mkdir(n,t)}catch(e){if(20!=e.errno)throw e}}},mkdev:(e,t,r)=>("undefined"==typeof r&&(r=t,t=438),t|=8192,fe.mknod(e,t,r)),symlink(e,t){if(!te.resolve(e))throw new fe.ErrnoError(44);var r=fe.lookupPath(t,{parent:!0}).node;if(!r)throw new fe.ErrnoError(44);var n=J.basename(t),i=fe.mayCreate(r,n);if(i)throw new fe.ErrnoError(i);if(!r.node_ops.symlink)throw new fe.ErrnoError(63);return r.node_ops.symlink(r,n,e)},rename(e,t){var r,n,i=J.dirname(e),o=J.dirname(t),a=J.basename(e),s=J.basename(t);if(r=fe.lookupPath(e,{parent:!0}).node,n=fe.lookupPath(t,{parent:!0}).node,!r||!n)throw new fe.ErrnoError(44);if(r.mount!==n.mount)throw new fe.ErrnoError(75);var u,c=fe.lookupNode(r,a),l=te.relative(e,o);if("."!==l.charAt(0))throw new fe.ErrnoError(28);if("."!==(l=te.relative(t,i)).charAt(0))throw new fe.ErrnoError(55);try{u=fe.lookupNode(n,s)}catch(e){}if(c!==u){var d=fe.isDir(c.mode),h=fe.mayDelete(r,a,d);if(h)throw new fe.ErrnoError(h);if(h=u?fe.mayDelete(n,s,d):fe.mayCreate(n,s))throw new fe.ErrnoError(h);if(!r.node_ops.rename)throw new fe.ErrnoError(63);if(fe.isMountpoint(c)||u&&fe.isMountpoint(u))throw new fe.ErrnoError(10);if(n!==r&&(h=fe.nodePermissions(r,"w")))throw new fe.ErrnoError(h);fe.hashRemoveNode(c);try{r.node_ops.rename(c,n,s)}catch(e){throw e}finally{fe.hashAddNode(c)}}},rmdir(e){var t=fe.lookupPath(e,{parent:!0}).node,r=J.basename(e),n=fe.lookupNode(t,r),i=fe.mayDelete(t,r,!0);if(i)throw new fe.ErrnoError(i);if(!t.node_ops.rmdir)throw new fe.ErrnoError(63);if(fe.isMountpoint(n))throw new fe.ErrnoError(10);t.node_ops.rmdir(t,r),fe.destroyNode(n)},readdir(e){var t=fe.lookupPath(e,{follow:!0}).node;if(!t.node_ops.readdir)throw new fe.ErrnoError(54);return t.node_ops.readdir(t)},unlink(e){var t=fe.lookupPath(e,{parent:!0}).node;if(!t)throw new fe.ErrnoError(44);var r=J.basename(e),n=fe.lookupNode(t,r),i=fe.mayDelete(t,r,!1);if(i)throw new fe.ErrnoError(i);if(!t.node_ops.unlink)throw new fe.ErrnoError(63);if(fe.isMountpoint(n))throw new fe.ErrnoError(10);t.node_ops.unlink(t,r),fe.destroyNode(n)},readlink(e){var t=fe.lookupPath(e).node;if(!t)throw new fe.ErrnoError(44);if(!t.node_ops.readlink)throw new fe.ErrnoError(28);return te.resolve(fe.getPath(t.parent),t.node_ops.readlink(t))},stat(e,t){var r=fe.lookupPath(e,{follow:!t}).node;if(!r)throw new fe.ErrnoError(44);if(!r.node_ops.getattr)throw new fe.ErrnoError(63);return r.node_ops.getattr(r)},lstat:e=>fe.stat(e,!0),chmod(e,t,r){var n;if(!(n="string"==typeof e?fe.lookupPath(e,{follow:!r}).node:e).node_ops.setattr)throw new fe.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&t|-4096&n.mode,timestamp:Date.now()})},lchmod(e,t){fe.chmod(e,t,!0)},fchmod(e,t){var r=fe.getStreamChecked(e);fe.chmod(r.node,t)},chown(e,t,r,n){var i;if(!(i="string"==typeof e?fe.lookupPath(e,{follow:!n}).node:e).node_ops.setattr)throw new fe.ErrnoError(63);i.node_ops.setattr(i,{timestamp:Date.now()})},lchown(e,t,r){fe.chown(e,t,r,!0)},fchown(e,t,r){var n=fe.getStreamChecked(e);fe.chown(n.node,t,r)},truncate(e,t){if(t<0)throw new fe.ErrnoError(28);var r;if(!(r="string"==typeof e?fe.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new fe.ErrnoError(63);if(fe.isDir(r.mode))throw new fe.ErrnoError(31);if(!fe.isFile(r.mode))throw new fe.ErrnoError(28);var n=fe.nodePermissions(r,"w");if(n)throw new fe.ErrnoError(n);r.node_ops.setattr(r,{size:t,timestamp:Date.now()})},ftruncate(e,t){var r=fe.getStreamChecked(e);if(0==(2097155&r.flags))throw new fe.ErrnoError(28);fe.truncate(r.node,t)},utime(e,t,r){var n=fe.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(t,r)})},open(e,t,r){if(""===e)throw new fe.ErrnoError(44);var n;if(r="undefined"==typeof r?438:r,r=64&(t="string"==typeof t?(e=>{var t={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[e];if("undefined"==typeof t)throw new Error(`Unknown file open mode: ${e}`);return t})(t):t)?4095&r|32768:0,"object"==typeof e)n=e;else{e=J.normalize(e);try{n=fe.lookupPath(e,{follow:!(131072&t)}).node}catch(e){}}var o=!1;if(64&t)if(n){if(128&t)throw new fe.ErrnoError(20)}else n=fe.mknod(e,r,0),o=!0;if(!n)throw new fe.ErrnoError(44);if(fe.isChrdev(n.mode)&&(t&=-513),65536&t&&!fe.isDir(n.mode))throw new fe.ErrnoError(54);if(!o){var a=fe.mayOpen(n,t);if(a)throw new fe.ErrnoError(a)}512&t&&!o&&fe.truncate(n,0),t&=-131713;var s=fe.createStream({node:n,path:fe.getPath(n),flags:t,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return s.stream_ops.open&&s.stream_ops.open(s),!i.logReadFiles||1&t||(fe.readFiles||(fe.readFiles={}),e in fe.readFiles||(fe.readFiles[e]=1)),s},close(e){if(fe.isClosed(e))throw new fe.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{fe.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek(e,t,r){if(fe.isClosed(e))throw new fe.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new fe.ErrnoError(70);if(0!=r&&1!=r&&2!=r)throw new fe.ErrnoError(28);return e.position=e.stream_ops.llseek(e,t,r),e.ungotten=[],e.position},read(e,t,r,n,i){if(n<0||i<0)throw new fe.ErrnoError(28);if(fe.isClosed(e))throw new fe.ErrnoError(8);if(1==(2097155&e.flags))throw new fe.ErrnoError(8);if(fe.isDir(e.node.mode))throw new fe.ErrnoError(31);if(!e.stream_ops.read)throw new fe.ErrnoError(28);var o="undefined"!=typeof i;if(o){if(!e.seekable)throw new fe.ErrnoError(70)}else i=e.position;var a=e.stream_ops.read(e,t,r,n,i);return o||(e.position+=a),a},write(e,t,r,n,i,o){if(n<0||i<0)throw new fe.ErrnoError(28);if(fe.isClosed(e))throw new fe.ErrnoError(8);if(0==(2097155&e.flags))throw new fe.ErrnoError(8);if(fe.isDir(e.node.mode))throw new fe.ErrnoError(31);if(!e.stream_ops.write)throw new fe.ErrnoError(28);e.seekable&&1024&e.flags&&fe.llseek(e,0,2);var a="undefined"!=typeof i;if(a){if(!e.seekable)throw new fe.ErrnoError(70)}else i=e.position;var s=e.stream_ops.write(e,t,r,n,i,o);return a||(e.position+=s),s},allocate(e,t,r){if(fe.isClosed(e))throw new fe.ErrnoError(8);if(t<0||r<=0)throw new fe.ErrnoError(28);if(0==(2097155&e.flags))throw new fe.ErrnoError(8);if(!fe.isFile(e.node.mode)&&!fe.isDir(e.node.mode))throw new fe.ErrnoError(43);if(!e.stream_ops.allocate)throw new fe.ErrnoError(138);e.stream_ops.allocate(e,t,r)},mmap(e,t,r,n,i){if(0!=(2&n)&&0==(2&i)&&2!=(2097155&e.flags))throw new fe.ErrnoError(2);if(1==(2097155&e.flags))throw new fe.ErrnoError(2);if(!e.stream_ops.mmap)throw new fe.ErrnoError(43);return e.stream_ops.mmap(e,t,r,n,i)},msync:(e,t,r,n,i)=>e.stream_ops.msync?e.stream_ops.msync(e,t,r,n,i):0,munmap:e=>0,ioctl(e,t,r){if(!e.stream_ops.ioctl)throw new fe.ErrnoError(59);return e.stream_ops.ioctl(e,t,r)},readFile(e,t={}){if(t.flags=t.flags||0,t.encoding=t.encoding||"binary","utf8"!==t.encoding&&"binary"!==t.encoding)throw new Error(`Invalid encoding type "${t.encoding}"`);var r,n=fe.open(e,t.flags),i=fe.stat(e).size,o=new Uint8Array(i);return fe.read(n,o,0,i,0),"utf8"===t.encoding?r=ne(o,0):"binary"===t.encoding&&(r=o),fe.close(n),r},writeFile(e,t,r={}){r.flags=r.flags||577;var n=fe.open(e,r.flags,r.mode);if("string"==typeof t){var i=new Uint8Array(oe(t)+1),o=ae(t,i,0,i.length);fe.write(n,i,0,o,void 0,r.canOwn)}else{if(!ArrayBuffer.isView(t))throw new Error("Unsupported data type");fe.write(n,t,0,t.byteLength,void 0,r.canOwn)}fe.close(n)},cwd:()=>fe.currentPath,chdir(e){var t=fe.lookupPath(e,{follow:!0});if(null===t.node)throw new fe.ErrnoError(44);if(!fe.isDir(t.node.mode))throw new fe.ErrnoError(54);var r=fe.nodePermissions(t.node,"x");if(r)throw new fe.ErrnoError(r);fe.currentPath=t.path},createDefaultDirectories(){fe.mkdir("/tmp"),fe.mkdir("/home"),fe.mkdir("/home/web_user")},createDefaultDevices(){fe.mkdir("/dev"),fe.registerDevice(fe.makedev(1,3),{read:()=>0,write:(e,t,r,n,i)=>n}),fe.mkdev("/dev/null",fe.makedev(1,3)),ue.register(fe.makedev(5,0),ue.default_tty_ops),ue.register(fe.makedev(6,0),ue.default_tty1_ops),fe.mkdev("/dev/tty",fe.makedev(5,0)),fe.mkdev("/dev/tty1",fe.makedev(6,0));var e=new Uint8Array(1024),t=0,r=()=>(0===t&&(t=ee(e).byteLength),e[--t]);fe.createDevice("/dev","random",r),fe.createDevice("/dev","urandom",r),fe.mkdir("/dev/shm"),fe.mkdir("/dev/shm/tmp")},createSpecialDirectories(){fe.mkdir("/proc");var e=fe.mkdir("/proc/self");fe.mkdir("/proc/self/fd"),fe.mount({mount(){var t=fe.createNode(e,"fd",16895,73);return t.node_ops={lookup(e,t){var r=+t,n=fe.getStreamChecked(r),i={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path}};return i.parent=i,i}},t}},{},"/proc/self/fd")},createStandardStreams(){i.stdin?fe.createDevice("/dev","stdin",i.stdin):fe.symlink("/dev/tty","/dev/stdin"),i.stdout?fe.createDevice("/dev","stdout",null,i.stdout):fe.symlink("/dev/tty","/dev/stdout"),i.stderr?fe.createDevice("/dev","stderr",null,i.stderr):fe.symlink("/dev/tty1","/dev/stderr"),fe.open("/dev/stdin",0),fe.open("/dev/stdout",1),fe.open("/dev/stderr",1)},ensureErrnoError(){fe.ErrnoError||(fe.ErrnoError=function(e,t){this.name="ErrnoError",this.node=t,this.setErrno=function(e){this.errno=e},this.setErrno(e),this.message="FS error"},fe.ErrnoError.prototype=new Error,fe.ErrnoError.prototype.constructor=fe.ErrnoError,[44].forEach((e=>{fe.genericErrors[e]=new fe.ErrnoError(e),fe.genericErrors[e].stack="<generic error, no stack>"})))},staticInit(){fe.ensureErrnoError(),fe.nameTable=new Array(4096),fe.mount(le,{},"/"),fe.createDefaultDirectories(),fe.createDefaultDevices(),fe.createSpecialDirectories(),fe.filesystems={MEMFS:le}},init(e,t,r){fe.init.initialized=!0,fe.ensureErrnoError(),i.stdin=e||i.stdin,i.stdout=t||i.stdout,i.stderr=r||i.stderr,fe.createStandardStreams()},quit(){fe.init.initialized=!1;for(var e=0;e<fe.streams.length;e++){var t=fe.streams[e];t&&fe.close(t)}},findObject(e,t){var r=fe.analyzePath(e,t);return r.exists?r.object:null},analyzePath(e,t){try{e=(n=fe.lookupPath(e,{follow:!t})).path}catch(e){}var r={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=fe.lookupPath(e,{parent:!0});r.parentExists=!0,r.parentPath=n.path,r.parentObject=n.node,r.name=J.basename(e),n=fe.lookupPath(e,{follow:!t}),r.exists=!0,r.path=n.path,r.object=n.node,r.name=n.node.name,r.isRoot="/"===n.path}catch(e){r.error=e.errno}return r},createPath(e,t,r,n){e="string"==typeof e?e:fe.getPath(e);for(var i=t.split("/").reverse();i.length;){var o=i.pop();if(o){var a=J.join2(e,o);try{fe.mkdir(a)}catch(e){}e=a}}return a},createFile(e,t,r,n,i){var o=J.join2("string"==typeof e?e:fe.getPath(e),t),a=me(n,i);return fe.create(o,a)},createDataFile(e,t,r,n,i,o){var a=t;e&&(e="string"==typeof e?e:fe.getPath(e),a=t?J.join2(e,t):e);var s=me(n,i),u=fe.create(a,s);if(r){if("string"==typeof r){for(var c=new Array(r.length),l=0,d=r.length;l<d;++l)c[l]=r.charCodeAt(l);r=c}fe.chmod(u,146|s);var h=fe.open(u,577);fe.write(h,r,0,r.length,0,o),fe.close(h),fe.chmod(u,s)}return u},createDevice(e,t,r,n){var i=J.join2("string"==typeof e?e:fe.getPath(e),t),o=me(!!r,!!n);fe.createDevice.major||(fe.createDevice.major=64);var a=fe.makedev(fe.createDevice.major++,0);return fe.registerDevice(a,{open(e){e.seekable=!1},close(e){n&&n.buffer&&n.buffer.length&&n(10)},read(e,t,n,i,o){for(var a=0,s=0;s<i;s++){var u;try{u=r()}catch(e){throw new fe.ErrnoError(29)}if(void 0===u&&0===a)throw new fe.ErrnoError(6);if(null==u)break;a++,t[n+s]=u}return a&&(e.node.timestamp=Date.now()),a},write(e,t,r,i,o){for(var a=0;a<i;a++)try{n(t[r+a])}catch(e){throw new fe.ErrnoError(29)}return i&&(e.node.timestamp=Date.now()),a}}),fe.mkdev(i,o,a)},forceLoadFile(e){if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!o)throw new Error("Cannot load without read() or XMLHttpRequest.");try{e.contents=se(o(e.url),!0),e.usedBytes=e.contents.length}catch(e){throw new fe.ErrnoError(29)}},createLazyFile(e,t,r,n,i){function o(){this.lengthKnown=!1,this.chunks=[]}if(o.prototype.get=function(e){if(!(e>this.length-1||e<0)){var t=e%this.chunkSize,r=e/this.chunkSize|0;return this.getter(r)[t]}},o.prototype.setDataGetter=function(e){this.getter=e},o.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",r,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+r+". Status: "+e.status);var t,n=Number(e.getResponseHeader("Content-length")),i=(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t,o=(t=e.getResponseHeader("Content-Encoding"))&&"gzip"===t,a=1048576;i||(a=n);var s=this;s.setDataGetter((e=>{var t=e*a,i=(e+1)*a-1;if(i=Math.min(i,n-1),"undefined"==typeof s.chunks[e]&&(s.chunks[e]=((e,t)=>{if(e>t)throw new Error("invalid range ("+e+", "+t+") or no bytes requested!");if(t>n-1)throw new Error("only "+n+" bytes available! programmer error!");var i=new XMLHttpRequest;if(i.open("GET",r,!1),n!==a&&i.setRequestHeader("Range","bytes="+e+"-"+t),i.responseType="arraybuffer",i.overrideMimeType&&i.overrideMimeType("text/plain; charset=x-user-defined"),i.send(null),!(i.status>=200&&i.status<300||304===i.status))throw new Error("Couldn't load "+r+". Status: "+i.status);return void 0!==i.response?new Uint8Array(i.response||[]):se(i.responseText||"",!0)})(t,i)),"undefined"==typeof s.chunks[e])throw new Error("doXHR failed!");return s.chunks[e]})),!o&&n||(a=n=1,n=this.getter(0).length,a=n,m("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=a,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){var a=new o;Object.defineProperties(a,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var s={isDevice:!1,contents:a}}else s={isDevice:!1,url:r};var u=fe.createFile(e,t,s,n,i);s.contents?u.contents=s.contents:s.url&&(u.contents=null,u.url=s.url),Object.defineProperties(u,{usedBytes:{get:function(){return this.contents.length}}});var c={};function l(e,t,r,n,i){var o=e.node.contents;if(i>=o.length)return 0;var a=Math.min(o.length-i,n);if(o.slice)for(var s=0;s<a;s++)t[r+s]=o[i+s];else for(s=0;s<a;s++)t[r+s]=o.get(i+s);return a}return Object.keys(u.stream_ops).forEach((e=>{var t=u.stream_ops[e];c[e]=function(){return fe.forceLoadFile(u),t.apply(null,arguments)}})),c.read=(e,t,r,n,i)=>(fe.forceLoadFile(u),l(e,t,r,n,i)),c.mmap=(e,t,r,n,i)=>{fe.forceLoadFile(u);var o=ce(t);if(!o)throw new fe.ErrnoError(48);return l(e,v,o,t,r),{ptr:o,allocated:!0}},u.stream_ops=c,u}},pe=(e,t)=>e?ne(y,e,t):"",ge={DEFAULT_POLLMASK:5,calculateAt(e,t,r){if(J.isAbs(t))return t;var n;if(n=-100===e?fe.cwd():ge.getStreamFromFD(e).path,0==t.length){if(!r)throw new fe.ErrnoError(44);return n}return J.join2(n,t)},doStat(e,t,r){try{var n=e(t)}catch(e){if(e&&e.node&&J.normalize(t)!==J.normalize(fe.getPath(e.node)))return-54;throw e}_[r>>2]=n.dev,_[r+4>>2]=n.mode,E[r+8>>2]=n.nlink,_[r+12>>2]=n.uid,_[r+16>>2]=n.gid,_[r+20>>2]=n.rdev,P=[n.size>>>0,(k=n.size,+Math.abs(k)>=1?k>0?+Math.floor(k/4294967296)>>>0:~~+Math.ceil((k-+(~~k>>>0))/4294967296)>>>0:0)],_[r+24>>2]=P[0],_[r+28>>2]=P[1],_[r+32>>2]=4096,_[r+36>>2]=n.blocks;var i=n.atime.getTime(),o=n.mtime.getTime(),a=n.ctime.getTime();return P=[Math.floor(i/1e3)>>>0,(k=Math.floor(i/1e3),+Math.abs(k)>=1?k>0?+Math.floor(k/4294967296)>>>0:~~+Math.ceil((k-+(~~k>>>0))/4294967296)>>>0:0)],_[r+40>>2]=P[0],_[r+44>>2]=P[1],E[r+48>>2]=i%1e3*1e3,P=[Math.floor(o/1e3)>>>0,(k=Math.floor(o/1e3),+Math.abs(k)>=1?k>0?+Math.floor(k/4294967296)>>>0:~~+Math.ceil((k-+(~~k>>>0))/4294967296)>>>0:0)],_[r+56>>2]=P[0],_[r+60>>2]=P[1],E[r+64>>2]=o%1e3*1e3,P=[Math.floor(a/1e3)>>>0,(k=Math.floor(a/1e3),+Math.abs(k)>=1?k>0?+Math.floor(k/4294967296)>>>0:~~+Math.ceil((k-+(~~k>>>0))/4294967296)>>>0:0)],_[r+72>>2]=P[0],_[r+76>>2]=P[1],E[r+80>>2]=a%1e3*1e3,P=[n.ino>>>0,(k=n.ino,+Math.abs(k)>=1?k>0?+Math.floor(k/4294967296)>>>0:~~+Math.ceil((k-+(~~k>>>0))/4294967296)>>>0:0)],_[r+88>>2]=P[0],_[r+92>>2]=P[1],0},doMsync(e,t,r,n,i){if(!fe.isFile(t.node.mode))throw new fe.ErrnoError(43);if(2&n)return 0;var o=y.slice(e,e+r);fe.msync(t,o,i,r,n)},varargs:void 0,get(){var e=_[ge.varargs>>2];return ge.varargs+=4,e},getp:()=>ge.get(),getStr:e=>pe(e),getStreamFromFD:e=>fe.getStreamChecked(e)},ve={},ye=e=>{for(;e.length;){var t=e.pop();e.pop()(t)}};function we(e){return this.fromWireType(_[e>>2])}var Ce={},_e={},Ee={},be=void 0,xe=e=>{throw new be(e)},Fe=(e,t,r)=>{function n(t){var n=r(t);n.length!==e.length&&xe("Mismatched type converter count");for(var i=0;i<e.length;++i)ke(e[i],n[i])}e.forEach((function(e){Ee[e]=t}));var i=new Array(t.length),o=[],a=0;t.forEach(((e,t)=>{_e.hasOwnProperty(e)?i[t]=_e[e]:(o.push(e),Ce.hasOwnProperty(e)||(Ce[e]=[]),Ce[e].push((()=>{i[t]=_e[e],++a===o.length&&n(i)})))})),0===o.length&&n(i)},De=void 0,Te=e=>{for(var t="",r=e;y[r];)t+=De[y[r++]];return t},Se=void 0,Ae=e=>{throw new Se(e)};function ke(e,t,r={}){if(!("argPackAdvance"in t))throw new TypeError("registerType registeredInstance requires argPackAdvance");return function(e,t,r={}){var n=t.name;if(e||Ae(`type "${n}" must have a positive integer typeid pointer`),_e.hasOwnProperty(e)){if(r.ignoreDuplicateRegistrations)return;Ae(`Cannot register type '${n}' twice`)}if(_e[e]=t,delete Ee[e],Ce.hasOwnProperty(e)){var i=Ce[e];delete Ce[e],i.forEach((e=>e()))}}(e,t,r)}var Pe=8;function Me(e){if(!(this instanceof et))return!1;if(!(e instanceof et))return!1;for(var t=this.$$.ptrType.registeredClass,r=this.$$.ptr,n=e.$$.ptrType.registeredClass,i=e.$$.ptr;t.baseClass;)r=t.upcast(r),t=t.baseClass;for(;n.baseClass;)i=n.upcast(i),n=n.baseClass;return t===n&&r===i}var Re=e=>{Ae(e.$$.ptrType.registeredClass.name+" instance already deleted")},Oe=!1,$e=e=>{},ze=e=>{e.count.value-=1,0===e.count.value&&(e=>{e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)})(e)},Le=(e,t,r)=>{if(t===r)return e;if(void 0===r.baseClass)return null;var n=Le(e,t,r.baseClass);return null===n?null:r.downcast(n)},Ie={},je=()=>Object.keys(Ue).length,We=()=>{var e=[];for(var t in Ue)Ue.hasOwnProperty(t)&&e.push(Ue[t]);return e},Be=[],Ne=()=>{for(;Be.length;){var e=Be.pop();e.$$.deleteScheduled=!1,e.delete()}},Qe=void 0,He=e=>{Qe=e,Be.length&&Qe&&Qe(Ne)},Ue={},Ve=(e,t)=>(t=((e,t)=>{for(void 0===t&&Ae("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t})(e,t),Ue[t]),Ze=(e,t)=>(t.ptrType&&t.ptr||xe("makeClassHandle requires ptr and ptrType"),!!t.smartPtrType!=!!t.smartPtr&&xe("Both smartPtrType and smartPtr must be specified"),t.count={value:1},qe(Object.create(e,{$$:{value:t}})));function Ye(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var r=Ve(this.registeredClass,t);if(void 0!==r){if(0===r.$$.count.value)return r.$$.ptr=t,r.$$.smartPtr=e,r.clone();var n=r.clone();return this.destructor(e),n}function i(){return this.isSmartPointer?Ze(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):Ze(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var o,a=this.registeredClass.getActualType(t),s=Ie[a];if(!s)return i.call(this);o=this.isConst?s.constPointerType:s.pointerType;var u=Le(t,this.registeredClass,o.registeredClass);return null===u?i.call(this):this.isSmartPointer?Ze(o.registeredClass.instancePrototype,{ptrType:o,ptr:u,smartPtrType:this,smartPtr:e}):Ze(o.registeredClass.instancePrototype,{ptrType:o,ptr:u})}var qe=e=>"undefined"==typeof FinalizationRegistry?(qe=e=>e,e):(Oe=new FinalizationRegistry((e=>{ze(e.$$)})),qe=e=>{var t=e.$$;if(t.smartPtr){var r={$$:t};Oe.register(e,r,e)}return e},$e=e=>Oe.unregister(e),qe(e));function Ge(){if(this.$$.ptr||Re(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e,t=qe(Object.create(Object.getPrototypeOf(this),{$$:{value:(e=this.$$,{count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType})}}));return t.$$.count.value+=1,t.$$.deleteScheduled=!1,t}function Xe(){this.$$.ptr||Re(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Ae("Object already scheduled for deletion"),$e(this),ze(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)}function Ke(){return!this.$$.ptr}function Je(){return this.$$.ptr||Re(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Ae("Object already scheduled for deletion"),Be.push(this),1===Be.length&&Qe&&Qe(Ne),this.$$.deleteScheduled=!0,this}function et(){}var tt=e=>{if(void 0===e)return"_unknown";var t=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return t>=48&&t<=57?`_${e}`:e};function rt(e,t){return{[e=tt(e)]:function(){return t.apply(this,arguments)}}[e]}var nt=(e,t,r)=>{if(void 0===e[t].overloadTable){var n=e[t];e[t]=function(){return e[t].overloadTable.hasOwnProperty(arguments.length)||Ae(`Function '${r}' called with an invalid number of arguments (${arguments.length}) - expects one of (${e[t].overloadTable})!`),e[t].overloadTable[arguments.length].apply(this,arguments)},e[t].overloadTable=[],e[t].overloadTable[n.argCount]=n}},it=(e,t,r)=>{i.hasOwnProperty(e)?((void 0===r||void 0!==i[e].overloadTable&&void 0!==i[e].overloadTable[r])&&Ae(`Cannot register public name '${e}' twice`),nt(i,e,e),i.hasOwnProperty(r)&&Ae(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`),i[e].overloadTable[r]=t):(i[e]=t,void 0!==r&&(i[e].numArguments=r))};function ot(e,t,r,n,i,o,a,s){this.name=e,this.constructor=t,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=i,this.getActualType=o,this.upcast=a,this.downcast=s,this.pureVirtualFunctions=[]}var at=(e,t,r)=>{for(;t!==r;)t.upcast||Ae(`Expected null or instance of ${r.name}, got an instance of ${t.name}`),e=t.upcast(e),t=t.baseClass;return e};function st(e,t){if(null===t)return this.isReference&&Ae(`null is not a valid ${this.name}`),0;t.$$||Ae(`Cannot pass "${Pt(t)}" as a ${this.name}`),t.$$.ptr||Ae(`Cannot pass deleted object as a pointer of type ${this.name}`);var r=t.$$.ptrType.registeredClass;return at(t.$$.ptr,r,this.registeredClass)}function ut(e,t){var r;if(null===t)return this.isReference&&Ae(`null is not a valid ${this.name}`),this.isSmartPointer?(r=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,r),r):0;t.$$||Ae(`Cannot pass "${Pt(t)}" as a ${this.name}`),t.$$.ptr||Ae(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&t.$$.ptrType.isConst&&Ae(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);var n=t.$$.ptrType.registeredClass;if(r=at(t.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(void 0===t.$$.smartPtr&&Ae("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:t.$$.smartPtrType===this?r=t.$$.smartPtr:Ae(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:r=t.$$.smartPtr;break;case 2:if(t.$$.smartPtrType===this)r=t.$$.smartPtr;else{var i=t.clone();r=this.rawShare(r,kt.toHandle((()=>i.delete()))),null!==e&&e.push(this.rawDestructor,r)}break;default:Ae("Unsupporting sharing policy")}return r}function ct(e,t){if(null===t)return this.isReference&&Ae(`null is not a valid ${this.name}`),0;t.$$||Ae(`Cannot pass "${Pt(t)}" as a ${this.name}`),t.$$.ptr||Ae(`Cannot pass deleted object as a pointer of type ${this.name}`),t.$$.ptrType.isConst&&Ae(`Cannot convert argument of type ${t.$$.ptrType.name} to parameter type ${this.name}`);var r=t.$$.ptrType.registeredClass;return at(t.$$.ptr,r,this.registeredClass)}function lt(e){return this.fromWireType(E[e>>2])}function dt(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e}function ht(e){this.rawDestructor&&this.rawDestructor(e)}var mt=e=>{null!==e&&e.delete()};function ft(e,t,r,n,i,o,a,s,u,c,l){this.name=e,this.registeredClass=t,this.isReference=r,this.isConst=n,this.isSmartPointer=i,this.pointeeType=o,this.sharingPolicy=a,this.rawGetPointee=s,this.rawConstructor=u,this.rawShare=c,this.rawDestructor=l,i||void 0!==t.baseClass?this.toWireType=ut:n?(this.toWireType=st,this.destructorFunction=null):(this.toWireType=ct,this.destructorFunction=null)}var pt=(e,t,r)=>{i.hasOwnProperty(e)||xe("Replacing nonexistant public symbol"),void 0!==i[e].overloadTable&&void 0!==r?i[e].overloadTable[r]=t:(i[e]=t,i[e].argCount=r)},gt=e=>F.get(e),vt=(e,t,r)=>e.includes("j")?((e,t,r)=>{var n=i["dynCall_"+e];return r&&r.length?n.apply(null,[t].concat(r)):n.call(null,t)})(e,t,r):gt(t).apply(null,r),yt=(e,t)=>{var r,n,i,o=(e=Te(e)).includes("j")?(r=e,n=t,i=[],function(){return i.length=0,Object.assign(i,arguments),vt(r,n,i)}):gt(t);return"function"!=typeof o&&Ae(`unknown function pointer with signature ${e}: ${t}`),o},wt=void 0,Ct=e=>{var t=xr(e),r=Te(t);return _r(t),r},_t=(e,t)=>{var r=[],n={};throw t.forEach((function e(t){n[t]||_e[t]||(Ee[t]?Ee[t].forEach(e):(r.push(t),n[t]=!0))})),new wt(`${e}: `+r.map(Ct).join([", "]))},Et=(e,t)=>{for(var r=[],n=0;n<e;n++)r.push(E[t+4*n>>2]);return r};function bt(e,t){if(!(e instanceof Function))throw new TypeError(`new_ called with constructor type ${typeof e} which is not a function`);var r=rt(e.name||"unknownFunctionName",(function(){}));r.prototype=e.prototype;var n=new r,i=e.apply(n,t);return i instanceof Object?i:n}function xt(e,t,r,n,i,o){var a=t.length;a<2&&Ae("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var s=null!==t[1]&&null!==r,u=!1,c=1;c<t.length;++c)if(null!==t[c]&&void 0===t[c].destructorFunction){u=!0;break}var l="void"!==t[0].name,d="",h="";for(c=0;c<a-2;++c)d+=(0!==c?", ":"")+"arg"+c,h+=(0!==c?", ":"")+"arg"+c+"Wired";var m=`\n return function ${tt(e)}(${d}) {\n if (arguments.length !== ${a-2}) {\n throwBindingError('function ${e} called with ' + arguments.length + ' arguments, expected ${a-2}');\n }`;u&&(m+="var destructors = [];\n");var f=u?"destructors":"null",p=["throwBindingError","invoker","fn","runDestructors","retType","classParam"],g=[Ae,n,i,ye,t[0],t[1]];for(s&&(m+="var thisWired = classParam.toWireType("+f+", this);\n"),c=0;c<a-2;++c)m+="var arg"+c+"Wired = argType"+c+".toWireType("+f+", arg"+c+"); // "+t[c+2].name+"\n",p.push("argType"+c),g.push(t[c+2]);if(s&&(h="thisWired"+(h.length>0?", ":"")+h),m+=(l||o?"var rv = ":"")+"invoker(fn"+(h.length>0?", ":"")+h+");\n",u)m+="runDestructors(destructors);\n";else for(c=s?1:2;c<t.length;++c){var v=1===c?"thisWired":"arg"+(c-2)+"Wired";null!==t[c].destructorFunction&&(m+=v+"_dtor("+v+"); // "+t[c].name+"\n",p.push(v+"_dtor"),g.push(t[c].destructorFunction))}return l&&(m+="var ret = retType.fromWireType(rv);\nreturn ret;\n"),m+="}\n",p.push(m),bt(Function,p).apply(null,g)}function Ft(){this.allocated=[void 0],this.freelist=[]}var Dt,Tt=new Ft,St=e=>{e>=Tt.reserved&&0==--Tt.get(e).refcount&&Tt.free(e)},At=()=>{for(var e=0,t=Tt.reserved;t<Tt.allocated.length;++t)void 0!==Tt.allocated[t]&&++e;return e},kt={toValue:e=>(e||Ae("Cannot use deleted val. handle = "+e),Tt.get(e).value),toHandle:e=>{switch(e){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:return Tt.allocate({refcount:1,value:e})}}},Pt=e=>{if(null===e)return"null";var t=typeof e;return"object"===t||"array"===t||"function"===t?e.toString():""+e},Mt=(e,t)=>{switch(t){case 4:return function(e){return this.fromWireType(b[e>>2])};case 8:return function(e){return this.fromWireType(x[e>>3])};default:throw new TypeError(`invalid float width (${t}): ${e}`)}},Rt=(e,t,r)=>{switch(t){case 1:return r?e=>v[e>>0]:e=>y[e>>0];case 2:return r?e=>w[e>>1]:e=>C[e>>1];case 4:return r?e=>_[e>>2]:e=>E[e>>2];default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},Ot=(e,t,r)=>ae(e,y,t,r),$t="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,zt=(e,t)=>{for(var r=e,n=r>>1,i=n+t/2;!(n>=i)&&C[n];)++n;if((r=n<<1)-e>32&&$t)return $t.decode(y.subarray(e,r));for(var o="",a=0;!(a>=t/2);++a){var s=w[e+2*a>>1];if(0==s)break;o+=String.fromCharCode(s)}return o},Lt=(e,t,r)=>{if(void 0===r&&(r=2147483647),r<2)return 0;for(var n=t,i=(r-=2)<2*e.length?r/2:e.length,o=0;o<i;++o){var a=e.charCodeAt(o);w[t>>1]=a,t+=2}return w[t>>1]=0,t-n},It=e=>2*e.length,jt=(e,t)=>{for(var r=0,n="";!(r>=t/4);){var i=_[e+4*r>>2];if(0==i)break;if(++r,i>=65536){var o=i-65536;n+=String.fromCharCode(55296|o>>10,56320|1023&o)}else n+=String.fromCharCode(i)}return n},Wt=(e,t,r)=>{if(void 0===r&&(r=2147483647),r<4)return 0;for(var n=t,i=n+r-4,o=0;o<e.length;++o){var a=e.charCodeAt(o);if(a>=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++o)),_[t>>2]=a,(t+=4)+4>i)break}return _[t>>2]=0,t-n},Bt=e=>{for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n>=55296&&n<=57343&&++r,t+=4}return t},Nt=(e,t)=>{var r=_e[e];return void 0===r&&Ae(t+" has unknown type "+Ct(e)),r},Qt={},Ht=e=>{var t=Qt[e];return void 0===t?Te(e):t},Ut=[],Vt=()=>"object"==typeof globalThis?globalThis:Function("return this")(),Zt=[],Yt=(e,t)=>t+2097152>>>0<4194305-!!e?(e>>>0)+4294967296*t:NaN,qt=e=>e%4==0&&(e%100!=0||e%400==0),Gt=[0,31,60,91,121,152,182,213,244,274,305,335],Xt=[0,31,59,90,120,151,181,212,243,273,304,334],Kt=e=>{var t=oe(e)+1,r=Cr(t);return r&&Ot(e,r,t),r},Jt=[],er=(e,t,r)=>{var n=((e,t)=>{var r;for(Jt.length=0;r=y[e++];)t+=105!=r&&t%8?4:0,Jt.push(105==r?_[t>>2]:x[t>>3]),t+=105==r?4:8;return Jt})(t,r);return H[e].apply(null,n)};Dt=()=>performance.now();var tr,rr,nr,ir=e=>{W("OOM")},or=e=>{var t=(e-p.buffer.byteLength+65535)/65536;try{return p.grow(t),T(),1}catch(e){}},ar={},sr=()=>{if(!sr.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:c||"./this.program"};for(var t in ar)void 0===ar[t]?delete e[t]:e[t]=ar[t];var r=[];for(var t in e)r.push(`${t}=${e[t]}`);sr.strings=r}return sr.strings},ur=e=>{g||(i.onExit&&i.onExit(e),D=!0),l(e,new U(e))},cr=(e,t)=>{ur(e)},lr=[31,29,31,30,31,30,31,31,30,31,30,31],dr=[31,28,31,30,31,30,31,31,30,31,30,31],hr=(e,t,r,n)=>{var i=E[n+40>>2],o={tm_sec:_[n>>2],tm_min:_[n+4>>2],tm_hour:_[n+8>>2],tm_mday:_[n+12>>2],tm_mon:_[n+16>>2],tm_year:_[n+20>>2],tm_wday:_[n+24>>2],tm_yday:_[n+28>>2],tm_isdst:_[n+32>>2],tm_gmtoff:_[n+36>>2],tm_zone:i?pe(i):""},a=pe(r),s={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var u in s)a=a.replace(new RegExp(u,"g"),s[u]);var c=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],l=["January","February","March","April","May","June","July","August","September","October","November","December"];function d(e,t,r){for(var n="number"==typeof e?e.toString():e||"";n.length<t;)n=r[0]+n;return n}function h(e,t){return d(e,t,"0")}function m(e,t){function r(e){return e<0?-1:e>0?1:0}var n;return 0===(n=r(e.getFullYear()-t.getFullYear()))&&0===(n=r(e.getMonth()-t.getMonth()))&&(n=r(e.getDate()-t.getDate())),n}function f(e){switch(e.getDay()){case 0:return new Date(e.getFullYear()-1,11,29);case 1:return e;case 2:return new Date(e.getFullYear(),0,3);case 3:return new Date(e.getFullYear(),0,2);case 4:return new Date(e.getFullYear(),0,1);case 5:return new Date(e.getFullYear()-1,11,31);case 6:return new Date(e.getFullYear()-1,11,30)}}function p(e){var t=((e,t)=>{for(var r=new Date(e.getTime());t>0;){var n=qt(r.getFullYear()),i=r.getMonth(),o=(n?lr:dr)[i];if(!(t>o-r.getDate()))return r.setDate(r.getDate()+t),r;t-=o-r.getDate()+1,r.setDate(1),i<11?r.setMonth(i+1):(r.setMonth(0),r.setFullYear(r.getFullYear()+1))}return r})(new Date(e.tm_year+1900,0,1),e.tm_yday),r=new Date(t.getFullYear(),0,4),n=new Date(t.getFullYear()+1,0,4),i=f(r),o=f(n);return m(i,t)<=0?m(o,t)<=0?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var g={"%a":e=>c[e.tm_wday].substring(0,3),"%A":e=>c[e.tm_wday],"%b":e=>l[e.tm_mon].substring(0,3),"%B":e=>l[e.tm_mon],"%C":e=>h((e.tm_year+1900)/100|0,2),"%d":e=>h(e.tm_mday,2),"%e":e=>d(e.tm_mday,2," "),"%g":e=>p(e).toString().substring(2),"%G":e=>p(e),"%H":e=>h(e.tm_hour,2),"%I":e=>{var t=e.tm_hour;return 0==t?t=12:t>12&&(t-=12),h(t,2)},"%j":e=>h(e.tm_mday+((e,t)=>{for(var r=0,n=0;n<=t;r+=e[n++]);return r})(qt(e.tm_year+1900)?lr:dr,e.tm_mon-1),3),"%m":e=>h(e.tm_mon+1,2),"%M":e=>h(e.tm_min,2),"%n":()=>"\n","%p":e=>e.tm_hour>=0&&e.tm_hour<12?"AM":"PM","%S":e=>h(e.tm_sec,2),"%t":()=>"\t","%u":e=>e.tm_wday||7,"%U":e=>{var t=e.tm_yday+7-e.tm_wday;return h(Math.floor(t/7),2)},"%V":e=>{var t=Math.floor((e.tm_yday+7-(e.tm_wday+6)%7)/7);if((e.tm_wday+371-e.tm_yday-2)%7<=2&&t++,t){if(53==t){var r=(e.tm_wday+371-e.tm_yday)%7;4==r||3==r&&qt(e.tm_year)||(t=1)}}else{t=52;var n=(e.tm_wday+7-e.tm_yday-1)%7;(4==n||5==n&&qt(e.tm_year%400-1))&&t++}return h(t,2)},"%w":e=>e.tm_wday,"%W":e=>{var t=e.tm_yday+7-(e.tm_wday+6)%7;return h(Math.floor(t/7),2)},"%y":e=>(e.tm_year+1900).toString().substring(2),"%Y":e=>e.tm_year+1900,"%z":e=>{var t=e.tm_gmtoff,r=t>=0;return t=(t=Math.abs(t)/60)/60*100+t%60,(r?"+":"-")+String("0000"+t).slice(-4)},"%Z":e=>e.tm_zone,"%%":()=>"%"};for(var u in a=a.replace(/%%/g,"\0\0"),g)a.includes(u)&&(a=a.replace(new RegExp(u,"g"),g[u](o)));var y,w,C=se(a=a.replace(/\0\0/g,"%"),!1);return C.length>t?0:(y=C,w=e,v.set(y,w),C.length-1)},mr=Kt,fr=function(e,t,r,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=fe.nextInode++,this.name=t,this.mode=r,this.node_ops={},this.stream_ops={},this.rdev=n},pr=365,gr=146;Object.defineProperties(fr.prototype,{read:{get:function(){return(this.mode&pr)===pr},set:function(e){e?this.mode|=pr:this.mode&=-366}},write:{get:function(){return(this.mode&gr)===gr},set:function(e){e?this.mode|=gr:this.mode&=-147}},isFolder:{get:function(){return fe.isDir(this.mode)}},isDevice:{get:function(){return fe.isChrdev(this.mode)}}}),fe.FSNode=fr,fe.createPreloadedFile=(e,t,r,n,i,o,a,s,u,c)=>{var l=t?te.resolve(J.join2(e,t)):e;function d(r){function d(r){c&&c(),s||fe.createDataFile(e,t,r,n,i,u),o&&o(),j()}((e,t,r,n)=>{"undefined"!=typeof Browser&&Browser.init();var i=!1;return he.forEach((o=>{i||o.canHandle(t)&&(o.handle(e,t,r,n),i=!0)})),i})(r,l,d,(()=>{a&&a(),j()}))||d(r)}I(),"string"==typeof r?de(r,(e=>d(e)),a):d(r)},fe.staticInit(),be=i.InternalError=class extends Error{constructor(e){super(e),this.name="InternalError"}},(()=>{for(var e=new Array(256),t=0;t<256;++t)e[t]=String.fromCharCode(t);De=e})(),Se=i.BindingError=class extends Error{constructor(e){super(e),this.name="BindingError"}},et.prototype.isAliasOf=Me,et.prototype.clone=Ge,et.prototype.delete=Xe,et.prototype.isDeleted=Ke,et.prototype.deleteLater=Je,i.getInheritedInstanceCount=je,i.getLiveInheritedInstances=We,i.flushPendingDeletes=Ne,i.setDelayFunction=He,ft.prototype.getPointee=dt,ft.prototype.destructor=ht,ft.prototype.argPackAdvance=Pe,ft.prototype.readValueFromPointer=lt,ft.prototype.deleteObject=mt,ft.prototype.fromWireType=Ye,wt=i.UnboundTypeError=(tr=Error,(nr=rt(rr="UnboundTypeError",(function(e){this.name=rr,this.message=e;var t=new Error(e).stack;void 0!==t&&(this.stack=this.toString()+"\n"+t.replace(/^Error(:[^\n]*)?\n/,""))}))).prototype=Object.create(tr.prototype),nr.prototype.constructor=nr,nr.prototype.toString=function(){return void 0===this.message?this.name:`${this.name}: ${this.message}`},nr),Object.assign(Ft.prototype,{get(e){return this.allocated[e]},has(e){return void 0!==this.allocated[e]},allocate(e){var t=this.freelist.pop()||this.allocated.length;return this.allocated[t]=e,t},free(e){this.allocated[e]=void 0,this.freelist.push(e)}}),Tt.allocated.push({value:void 0},{value:null},{value:!0},{value:!1}),Tt.reserved=Tt.allocated.length,i.count_emval_handles=At;var vr,yr={s:e=>{var t=new G(e);return t.get_caught()||(t.set_caught(!0),Y--),t.set_rethrown(!1),Z.push(t),kr(t.excPtr),t.get_exception_ptr()},ob:()=>{if(!Z.length)return 0;var e=Z[Z.length-1];return kr(e.excPtr),e.excPtr},A:()=>{Dr(0,0);var e=Z.pop();Ar(e.excPtr),q=0},a:()=>X([]),f:e=>X([e]),o:(e,t)=>X([e,t]),ra:K,nb:e=>{if(e){var t=new G(e);Z.push(t),t.set_rethrown(!0),K()}},p:(e,t,r)=>{throw new G(e).init(t,r),Y++,q=e},pb:()=>Y,b:e=>{throw q||(q=e),q},vb:function(e,t,r,n,i){try{for(var o=0,a=t?_[t>>2]:0,s=t?_[t+4>>2]:0,u=r?_[r>>2]:0,c=r?_[r+4>>2]:0,l=n?_[n>>2]:0,d=n?_[n+4>>2]:0,h=0,m=0,f=0,p=0,g=0,v=0,y=(t?_[t>>2]:0)|(r?_[r>>2]:0)|(n?_[n>>2]:0),w=(t?_[t+4>>2]:0)|(r?_[r+4>>2]:0)|(n?_[n+4>>2]:0),C=function(e,t,r,n){return e<32?t&n:r&n},E=0;E<e;E++){var b=1<<E%32;if(C(E,y,w,b)){var x=ge.getStreamFromFD(E),F=ge.DEFAULT_POLLMASK;if(x.stream_ops.poll){var D=-1;i&&(D=1e3*((t?_[i>>2]:0)+(t?_[i+8>>2]:0)/1e6)),F=x.stream_ops.poll(x,D)}1&F&&C(E,a,s,b)&&(E<32?h|=b:m|=b,o++),4&F&&C(E,u,c,b)&&(E<32?f|=b:p|=b,o++),2&F&&C(E,l,d,b)&&(E<32?g|=b:v|=b,o++)}}return t&&(_[t>>2]=h,_[t+4>>2]=m),r&&(_[r>>2]=f,_[r+4>>2]=p),n&&(_[n>>2]=g,_[n+4>>2]=v),o}catch(e){if("undefined"==typeof fe||"ErrnoError"!==e.name)throw e;return-e.errno}},wa:function(e,t,r){ge.varargs=r;try{var n=ge.getStreamFromFD(e);switch(t){case 0:if((i=ge.get())<0)return-28;for(;fe.streams[i];)i++;return fe.createStream(n,i).fd;case 1:case 2:case 6:case 7:return 0;case 3:return n.flags;case 4:var i=ge.get();return n.flags|=i,0;case 5:return i=ge.getp(),w[i+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return o=28,_[Er()>>2]=o,-1}}catch(e){if("undefined"==typeof fe||"ErrnoError"!==e.name)throw e;return-e.errno}var o},Db:function(e,t){try{var r=ge.getStreamFromFD(e);return ge.doStat(fe.stat,r.path,t)}catch(e){if("undefined"==typeof fe||"ErrnoError"!==e.name)throw e;return-e.errno}},Eb:function(e,t,r){ge.varargs=r;try{var n=ge.getStreamFromFD(e);switch(t){case 21509:case 21510:case 21511:case 21512:case 21524:case 21515:return n.tty?0:-59;case 21505:if(!n.tty)return-59;if(n.tty.ops.ioctl_tcgets){var i=n.tty.ops.ioctl_tcgets(n),o=ge.getp();_[o>>2]=i.c_iflag||0,_[o+4>>2]=i.c_oflag||0,_[o+8>>2]=i.c_cflag||0,_[o+12>>2]=i.c_lflag||0;for(var a=0;a<32;a++)v[o+a+17>>0]=i.c_cc[a]||0;return 0}return 0;case 21506:case 21507:case 21508:if(!n.tty)return-59;if(n.tty.ops.ioctl_tcsets){o=ge.getp();var s=_[o>>2],u=_[o+4>>2],c=_[o+8>>2],l=_[o+12>>2],d=[];for(a=0;a<32;a++)d.push(v[o+a+17>>0]);return n.tty.ops.ioctl_tcsets(n.tty,t,{c_iflag:s,c_oflag:u,c_cflag:c,c_lflag:l,c_cc:d})}return 0;case 21519:return n.tty?(o=ge.getp(),_[o>>2]=0,0):-59;case 21520:return n.tty?-28:-59;case 21531:return o=ge.getp(),fe.ioctl(n,t,o);case 21523:if(!n.tty)return-59;if(n.tty.ops.ioctl_tiocgwinsz){var h=n.tty.ops.ioctl_tiocgwinsz(n.tty);o=ge.getp(),w[o>>1]=h[0],w[o+2>>1]=h[1]}return 0;default:return-28}}catch(e){if("undefined"==typeof fe||"ErrnoError"!==e.name)throw e;return-e.errno}},Bb:function(e,t,r,n){try{t=ge.getStr(t);var i=256&n,o=4096&n;return n&=-6401,t=ge.calculateAt(e,t,o),ge.doStat(i?fe.lstat:fe.stat,t,r)}catch(e){if("undefined"==typeof fe||"ErrnoError"!==e.name)throw e;return-e.errno}},xa:function(e,t,r,n){ge.varargs=n;try{t=ge.getStr(t),t=ge.calculateAt(e,t);var i=n?ge.get():0;return fe.open(t,r,i).fd}catch(e){if("undefined"==typeof fe||"ErrnoError"!==e.name)throw e;return-e.errno}},wb:function(e){try{return e=ge.getStr(e),fe.rmdir(e),0}catch(e){if("undefined"==typeof fe||"ErrnoError"!==e.name)throw e;return-e.errno}},Cb:function(e,t){try{return e=ge.getStr(e),ge.doStat(fe.stat,e,t)}catch(e){if("undefined"==typeof fe||"ErrnoError"!==e.name)throw e;return-e.errno}},xb:function(e,t,r){try{return t=ge.getStr(t),t=ge.calculateAt(e,t),0===r?fe.unlink(t):512===r?fe.rmdir(t):W("Invalid flags passed to unlinkat"),0}catch(e){if("undefined"==typeof fe||"ErrnoError"!==e.name)throw e;return-e.errno}},Wa:e=>{var t=ve[e];delete ve[e];var r=t.rawConstructor,n=t.rawDestructor,i=t.fields,o=i.map((e=>e.getterReturnType)).concat(i.map((e=>e.setterArgumentType)));Fe([e],o,(e=>{var o={};return i.forEach(((t,r)=>{var n=t.fieldName,a=e[r],s=t.getter,u=t.getterContext,c=e[r+i.length],l=t.setter,d=t.setterContext;o[n]={read:e=>a.fromWireType(s(u,e)),write:(e,t)=>{var r=[];l(d,e,c.toWireType(r,t)),ye(r)}}})),[{name:t.name,fromWireType:e=>{var t={};for(var r in o)t[r]=o[r].read(e);return n(e),t},toWireType:(e,t)=>{for(var i in o)if(!(i in t))throw new TypeError(`Missing field: "${i}"`);var a=r();for(i in o)o[i].write(a,t[i]);return null!==e&&e.push(n,a),a},argPackAdvance:Pe,readValueFromPointer:we,destructorFunction:n}]}))},gb:(e,t,r,n,i)=>{},za:(e,t,r,n)=>{ke(e,{name:t=Te(t),fromWireType:function(e){return!!e},toWireType:function(e,t){return t?r:n},argPackAdvance:Pe,readValueFromPointer:function(e){return this.fromWireType(y[e])},destructorFunction:null})},ta:(e,t,r,n,i,o,a,s,u,c,l,d,h)=>{l=Te(l),o=yt(i,o),s&&(s=yt(a,s)),c&&(c=yt(u,c)),h=yt(d,h);var m=tt(l);it(m,(function(){_t(`Cannot construct ${l} due to unbound types`,[n])})),Fe([e,t,r],n?[n]:[],(function(t){var r,i;t=t[0],i=n?(r=t.registeredClass).instancePrototype:et.prototype;var a=rt(m,(function(){if(Object.getPrototypeOf(this)!==u)throw new Se("Use 'new' to construct "+l);if(void 0===d.constructor_body)throw new Se(l+" has no accessible constructor");var e=d.constructor_body[arguments.length];if(void 0===e)throw new Se(`Tried to invoke ctor of ${l} with invalid number of parameters (${arguments.length}) - expected (${Object.keys(d.constructor_body).toString()}) parameters instead!`);return e.apply(this,arguments)})),u=Object.create(i,{constructor:{value:a}});a.prototype=u;var d=new ot(l,a,u,h,r,o,s,c);d.baseClass&&(void 0===d.baseClass.__derivedClasses&&(d.baseClass.__derivedClasses=[]),d.baseClass.__derivedClasses.push(d));var f=new ft(l,d,!0,!1,!1),p=new ft(l+"*",d,!1,!1,!1),g=new ft(l+" const*",d,!1,!0,!1);return Ie[e]={pointerType:p,constPointerType:g},pt(m,a),[f,p,g]}))},sa:(e,t,r,n,i,o)=>{var a=Et(t,r);i=yt(n,i),Fe([],[e],(function(e){var r=`constructor ${(e=e[0]).name}`;if(void 0===e.registeredClass.constructor_body&&(e.registeredClass.constructor_body=[]),void 0!==e.registeredClass.constructor_body[t-1])throw new Se(`Cannot register multiple constructors with identical number of parameters (${t-1}) for class '${e.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return e.registeredClass.constructor_body[t-1]=()=>{_t(`Cannot construct ${e.name} due to unbound types`,a)},Fe([],a,(n=>(n.splice(1,0,null),e.registeredClass.constructor_body[t-1]=xt(r,n,null,i,o),[]))),[]}))},ga:(e,t,r,n,i,o,a,s,u)=>{var c=Et(r,n);t=Te(t),o=yt(i,o),Fe([],[e],(function(e){var n=`${(e=e[0]).name}.${t}`;function i(){_t(`Cannot call ${n} due to unbound types`,c)}t.startsWith("@@")&&(t=Symbol[t.substring(2)]),s&&e.registeredClass.pureVirtualFunctions.push(t);var l=e.registeredClass.instancePrototype,d=l[t];return void 0===d||void 0===d.overloadTable&&d.className!==e.name&&d.argCount===r-2?(i.argCount=r-2,i.className=e.name,l[t]=i):(nt(l,t,n),l[t].overloadTable[r-2]=i),Fe([],c,(function(i){var s=xt(n,i,e,o,a,u);return void 0===l[t].overloadTable?(s.argCount=r-2,l[t]=s):l[t].overloadTable[r-2]=s,[]})),[]}))},ya:(e,t)=>{ke(e,{name:t=Te(t),fromWireType:e=>{var t=kt.toValue(e);return St(e),t},toWireType:(e,t)=>kt.toHandle(t),argPackAdvance:Pe,readValueFromPointer:we,destructorFunction:null})},la:(e,t,r)=>{ke(e,{name:t=Te(t),fromWireType:e=>e,toWireType:(e,t)=>t,argPackAdvance:Pe,readValueFromPointer:Mt(t,r),destructorFunction:null})},F:(e,t,r,n,i,o,a)=>{var s=Et(t,r);e=Te(e),i=yt(n,i),it(e,(function(){_t(`Cannot call ${e} due to unbound types`,s)}),t-1),Fe([],s,(function(r){var n=[r[0],null].concat(r.slice(1));return pt(e,xt(e,n,null,i,o,a),t-1),[]}))},H:(e,t,r,n,i)=>{t=Te(t),-1===i&&(i=4294967295);var o=e=>e;if(0===n){var a=32-8*r;o=e=>e<<a>>>a}var s=t.includes("unsigned");ke(e,{name:t,fromWireType:o,toWireType:s?function(e,t){return this.name,t>>>0}:function(e,t){return this.name,t},argPackAdvance:Pe,readValueFromPointer:Rt(t,r,0!==n),destructorFunction:null})},y:(e,t,r)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][t];function i(e){var t=E[e>>2],r=E[e+4>>2];return new n(v.buffer,r,t)}ke(e,{name:r=Te(r),fromWireType:i,argPackAdvance:Pe,readValueFromPointer:i},{ignoreDuplicateRegistrations:!0})},ka:(e,t)=>{var r="std::string"===(t=Te(t));ke(e,{name:t,fromWireType:e=>{var t,n=E[e>>2],i=e+4;if(r)for(var o=i,a=0;a<=n;++a){var s=i+a;if(a==n||0==y[s]){var u=pe(o,s-o);void 0===t?t=u:(t+=String.fromCharCode(0),t+=u),o=s+1}}else{var c=new Array(n);for(a=0;a<n;++a)c[a]=String.fromCharCode(y[i+a]);t=c.join("")}return _r(e),t},toWireType:(e,t)=>{var n;t instanceof ArrayBuffer&&(t=new Uint8Array(t));var i="string"==typeof t;i||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int8Array||Ae("Cannot pass non-string to std::string"),n=r&&i?oe(t):t.length;var o=Cr(4+n+1),a=o+4;if(E[o>>2]=n,r&&i)Ot(t,a,n+1);else if(i)for(var s=0;s<n;++s){var u=t.charCodeAt(s);u>255&&(_r(a),Ae("String has UTF-16 code units that do not fit in 8 bits")),y[a+s]=u}else for(s=0;s<n;++s)y[a+s]=t[s];return null!==e&&e.push(_r,o),o},argPackAdvance:Pe,readValueFromPointer:lt,destructorFunction:e=>_r(e)})},ba:(e,t,r)=>{var n,i,o,a,s;r=Te(r),2===t?(n=zt,i=Lt,a=It,o=()=>C,s=1):4===t&&(n=jt,i=Wt,a=Bt,o=()=>E,s=2),ke(e,{name:r,fromWireType:e=>{for(var r,i=E[e>>2],a=o(),u=e+4,c=0;c<=i;++c){var l=e+4+c*t;if(c==i||0==a[l>>s]){var d=n(u,l-u);void 0===r?r=d:(r+=String.fromCharCode(0),r+=d),u=l+t}}return _r(e),r},toWireType:(e,n)=>{"string"!=typeof n&&Ae(`Cannot pass non-string to C++ string type ${r}`);var o=a(n),u=Cr(4+o+t);return E[u>>2]=o>>s,i(n,u+4,o+t),null!==e&&e.push(_r,u),u},argPackAdvance:Pe,readValueFromPointer:we,destructorFunction:e=>_r(e)})},Xa:(e,t,r,n,i,o)=>{ve[e]={name:Te(t),rawConstructor:yt(r,n),rawDestructor:yt(i,o),fields:[]}},Va:(e,t,r,n,i,o,a,s,u,c)=>{ve[e].fields.push({fieldName:Te(t),getterReturnType:r,getter:yt(n,i),getterContext:o,setterArgumentType:a,setter:yt(s,u),setterContext:c})},Aa:(e,t)=>{ke(e,{isVoid:!0,name:t=Te(t),argPackAdvance:0,fromWireType:()=>{},toWireType:(e,t)=>{}})},Fb:()=>!0,qb:()=>{throw 1/0},P:(e,t,r)=>{e=kt.toValue(e),t=Nt(t,"emval::as");var n=[],i=kt.toHandle(n);return E[r>>2]=i,t.toWireType(n,e)},ia:(e,t,r,n,i)=>(e=Ut[e])(t=kt.toValue(t),r=Ht(r),(e=>{var t=[];return E[e>>2]=kt.toHandle(t),t})(n),i),ha:(e,t,r,n)=>{(e=Ut[e])(t=kt.toValue(t),r=Ht(r),null,n)},$a:St,Qa:e=>0===e?kt.toHandle(Vt()):(e=Ht(e),kt.toHandle(Vt()[e])),O:(e,t)=>{var r=((e,t)=>{for(var r=new Array(e),n=0;n<e;++n)r[n]=Nt(E[t+4*n>>2],"parameter "+n);return r})(e,t),n=r[0],i=n.name+"_$"+r.slice(1).map((function(e){return e.name})).join("_")+"$",o=Zt[i];if(void 0!==o)return o;for(var a=["retType"],s=[n],u="",c=0;c<e-1;++c)u+=(0!==c?", ":"")+"arg"+c,a.push("argType"+c),s.push(r[1+c]);var l="return function "+tt("methodCaller_"+i)+"(handle, name, destructors, args) {\n",d=0;for(c=0;c<e-1;++c)l+=" var arg"+c+" = argType"+c+".readValueFromPointer(args"+(d?"+"+d:"")+");\n",d+=r[c+1].argPackAdvance;for(l+=" var rv = handle[name]("+u+");\n",c=0;c<e-1;++c)r[c+1].deleteObject&&(l+=" argType"+c+".deleteObject(arg"+c+");\n");n.isVoid||(l+=" return retType.toWireType(destructors, rv);\n"),l+="};\n",a.push(l);var h,m,f=bt(Function,a).apply(null,s);return h=f,m=Ut.length,Ut.push(h),o=m,Zt[i]=o,o},Za:(e,t)=>(e=kt.toValue(e),t=kt.toValue(t),kt.toHandle(e[t])),q:e=>{e>4&&(Tt.get(e).refcount+=1)},Z:()=>kt.toHandle([]),J:e=>kt.toHandle(Ht(e)),D:()=>kt.toHandle({}),Ya:e=>{var t=kt.toValue(e);ye(t),St(e)},rb:(e,t,r)=>{e=kt.toValue(e),t=kt.toValue(t),r=kt.toValue(r),e[t]=r},I:(e,t)=>{var r=(e=Nt(e,"_emval_take_value")).readValueFromPointer(t);return kt.toHandle(r)},db:function(e,t,r){var n=Yt(e,t),i=new Date(1e3*n);_[r>>2]=i.getUTCSeconds(),_[r+4>>2]=i.getUTCMinutes(),_[r+8>>2]=i.getUTCHours(),_[r+12>>2]=i.getUTCDate(),_[r+16>>2]=i.getUTCMonth(),_[r+20>>2]=i.getUTCFullYear()-1900,_[r+24>>2]=i.getUTCDay();var o=Date.UTC(i.getUTCFullYear(),0,1,0,0,0,0),a=(i.getTime()-o)/864e5|0;_[r+28>>2]=a},eb:function(e,t,r){var n=Yt(e,t),i=new Date(1e3*n);_[r>>2]=i.getSeconds(),_[r+4>>2]=i.getMinutes(),_[r+8>>2]=i.getHours(),_[r+12>>2]=i.getDate(),_[r+16>>2]=i.getMonth(),_[r+20>>2]=i.getFullYear()-1900,_[r+24>>2]=i.getDay();var o=0|(e=>(qt(e.getFullYear())?Gt:Xt)[e.getMonth()]+e.getDate()-1)(i);_[r+28>>2]=o,_[r+36>>2]=-60*i.getTimezoneOffset();var a=new Date(i.getFullYear(),0,1),s=new Date(i.getFullYear(),6,1).getTimezoneOffset(),u=a.getTimezoneOffset(),c=0|(s!=u&&i.getTimezoneOffset()==Math.min(u,s));_[r+32>>2]=c},cb:function(e,t,r,n,i,o,a){var s=Yt(o,a);try{if(isNaN(s))return 61;var u=ge.getStreamFromFD(i);2&r&&ge.doMsync(e,u,t,n,s),fe.munmap(u)}catch(e){if("undefined"==typeof fe||"ErrnoError"!==e.name)throw e;return-e.errno}},tb:(e,t,r)=>{var n=(new Date).getFullYear(),i=new Date(n,0,1),o=new Date(n,6,1),a=i.getTimezoneOffset(),s=o.getTimezoneOffset(),u=Math.max(a,s);function c(e){var t=e.toTimeString().match(/\(([A-Za-z ]+)\)$/);return t?t[1]:"GMT"}E[e>>2]=60*u,_[t>>2]=Number(a!=s);var l=c(i),d=c(o),h=Kt(l),m=Kt(d);s<a?(E[r>>2]=h,E[r+4>>2]=m):(E[r>>2]=m,E[r+4>>2]=h)},v:()=>{W("")},Ra:(e,t,r)=>er(e,t,r),T:()=>Date.now(),ub:()=>2147483648,Q:Dt,Gb:(e,t,r)=>y.copyWithin(e,t,t+r),sb:e=>{var t=y.length,r=2147483648;(e>>>=0)>r&&ir();for(var n,i,o=1;o<=4;o*=2){var a=t*(1+.2/o);a=Math.min(a,e+100663296);var s=Math.min(r,(n=Math.max(e,a))+((i=65536)-n%i)%i);if(or(s))return!0}ir()},zb:(e,t)=>{var r=0;return sr().forEach(((n,i)=>{var o=t+r;E[e+4*i>>2]=o,((e,t)=>{for(var r=0;r<e.length;++r)v[t++>>0]=e.charCodeAt(r);v[t>>0]=0})(n,o),r+=n.length+1})),0},Ab:(e,t)=>{var r=sr();E[e>>2]=r.length;var n=0;return r.forEach((e=>n+=e.length+1)),E[t>>2]=n,0},Ba:cr,aa:function(e){try{var t=ge.getStreamFromFD(e);return fe.close(t),0}catch(e){if("undefined"==typeof fe||"ErrnoError"!==e.name)throw e;return e.errno}},yb:function(e,t){try{var r=ge.getStreamFromFD(e),n=r.tty?2:fe.isDir(r.mode)?3:fe.isLink(r.mode)?7:4;return v[t>>0]=n,w[t+2>>1]=0,P=[0,(k=0,+Math.abs(k)>=1?k>0?+Math.floor(k/4294967296)>>>0:~~+Math.ceil((k-+(~~k>>>0))/4294967296)>>>0:0)],_[t+8>>2]=P[0],_[t+12>>2]=P[1],P=[0,(k=0,+Math.abs(k)>=1?k>0?+Math.floor(k/4294967296)>>>0:~~+Math.ceil((k-+(~~k>>>0))/4294967296)>>>0:0)],_[t+16>>2]=P[0],_[t+20>>2]=P[1],0}catch(e){if("undefined"==typeof fe||"ErrnoError"!==e.name)throw e;return e.errno}},va:function(e,t,r,n){try{var i=((e,t,r,n)=>{for(var i=0,o=0;o<r;o++){var a=E[t>>2],s=E[t+4>>2];t+=8;var u=fe.read(e,v,a,s,n);if(u<0)return-1;if(i+=u,u<s)break;"undefined"!=typeof n&&(n+=u)}return i})(ge.getStreamFromFD(e),t,r);return E[n>>2]=i,0}catch(e){if("undefined"==typeof fe||"ErrnoError"!==e.name)throw e;return e.errno}},fb:function(e,t,r,n,i){var o=Yt(t,r);try{if(isNaN(o))return 61;var a=ge.getStreamFromFD(e);return fe.llseek(a,o,n),P=[a.position>>>0,(k=a.position,+Math.abs(k)>=1?k>0?+Math.floor(k/4294967296)>>>0:~~+Math.ceil((k-+(~~k>>>0))/4294967296)>>>0:0)],_[i>>2]=P[0],_[i+4>>2]=P[1],a.getdents&&0===o&&0===n&&(a.getdents=null),0}catch(e){if("undefined"==typeof fe||"ErrnoError"!==e.name)throw e;return e.errno}},ja:function(e,t,r,n){try{var i=((e,t,r,n)=>{for(var i=0,o=0;o<r;o++){var a=E[t>>2],s=E[t+4>>2];t+=8;var u=fe.write(e,v,a,s,n);if(u<0)return-1;i+=u,"undefined"!=typeof n&&(n+=u)}return i})(ge.getStreamFromFD(e),t,r);return E[n>>2]=i,0}catch(e){if("undefined"==typeof fe||"ErrnoError"!==e.name)throw e;return e.errno}},Ta:function(){return mr(location.toString())},kb:(e,t)=>(ee(y.subarray(e,e+t)),0),Sa:function(){return mr((e=Wr,self[e(234,"5qOj")][e(238,"QCd9")]()));var e},Ua:function(e,t){var r=Tr();try{return gt(e)(t)}catch(e){if(Sr(r),e!==e+0)throw e;Dr(1,0)}},E:function(e,t,r,n,i,o){var a=Tr();try{return gt(e)(t,r,n,i,o)}catch(e){if(Sr(a),e!==e+0)throw e;Dr(1,0)}},L:function(e,t,r,n){var i=Tr();try{return gt(e)(t,r,n)}catch(e){if(Sr(i),e!==e+0)throw e;Dr(1,0)}},fa:function(e,t,r,n,i,o){var a=Tr();try{return gt(e)(t,r,n,i,o)}catch(e){if(Sr(a),e!==e+0)throw e;Dr(1,0)}},S:function(e,t){var r=Tr();try{return gt(e)(t)}catch(e){if(Sr(r),e!==e+0)throw e;Dr(1,0)}},Na:function(e,t,r){var n=Tr();try{return gt(e)(t,r)}catch(e){if(Sr(n),e!==e+0)throw e;Dr(1,0)}},U:function(e,t,r,n){var i=Tr();try{return gt(e)(t,r,n)}catch(e){if(Sr(i),e!==e+0)throw e;Dr(1,0)}},r:function(e){var t=Tr();try{return gt(e)()}catch(e){if(Sr(t),e!==e+0)throw e;Dr(1,0)}},g:function(e,t){var r=Tr();try{return gt(e)(t)}catch(e){if(Sr(r),e!==e+0)throw e;Dr(1,0)}},Ja:function(e,t,r){var n=Tr();try{return gt(e)(t,r)}catch(e){if(Sr(n),e!==e+0)throw e;Dr(1,0)}},ma:function(e,t,r,n){var i=Tr();try{return gt(e)(t,r,n)}catch(e){if(Sr(i),e!==e+0)throw e;Dr(1,0)}},Ka:function(e,t,r,n){var i=Tr();try{return gt(e)(t,r,n)}catch(e){if(Sr(i),e!==e+0)throw e;Dr(1,0)}},Ma:function(e,t,r,n,i){var o=Tr();try{return gt(e)(t,r,n,i)}catch(e){if(Sr(o),e!==e+0)throw e;Dr(1,0)}},La:function(e,t,r,n,i,o,a,s){var u=Tr();try{return gt(e)(t,r,n,i,o,a,s)}catch(e){if(Sr(u),e!==e+0)throw e;Dr(1,0)}},e:function(e,t,r){var n=Tr();try{return gt(e)(t,r)}catch(e){if(Sr(n),e!==e+0)throw e;Dr(1,0)}},Oa:function(e,t,r,n){var i=Tr();try{return gt(e)(t,r,n)}catch(e){if(Sr(i),e!==e+0)throw e;Dr(1,0)}},j:function(e,t,r,n){var i=Tr();try{return gt(e)(t,r,n)}catch(e){if(Sr(i),e!==e+0)throw e;Dr(1,0)}},M:function(e,t,r,n,i){var o=Tr();try{return gt(e)(t,r,n,i)}catch(e){if(Sr(o),e!==e+0)throw e;Dr(1,0)}},k:function(e,t,r,n,i){var o=Tr();try{return gt(e)(t,r,n,i)}catch(e){if(Sr(o),e!==e+0)throw e;Dr(1,0)}},mb:function(e,t,r,n,i,o){var a=Tr();try{return gt(e)(t,r,n,i,o)}catch(e){if(Sr(a),e!==e+0)throw e;Dr(1,0)}},qa:function(e,t,r,n,i,o,a){var s=Tr();try{return gt(e)(t,r,n,i,o,a)}catch(e){if(Sr(s),e!==e+0)throw e;Dr(1,0)}},n:function(e,t,r,n,i,o){var a=Tr();try{return gt(e)(t,r,n,i,o)}catch(e){if(Sr(a),e!==e+0)throw e;Dr(1,0)}},C:function(e,t,r,n,i,o,a){var s=Tr();try{return gt(e)(t,r,n,i,o,a)}catch(e){if(Sr(s),e!==e+0)throw e;Dr(1,0)}},ua:function(e,t,r,n,i,o,a,s){var u=Tr();try{return gt(e)(t,r,n,i,o,a,s)}catch(e){if(Sr(u),e!==e+0)throw e;Dr(1,0)}},Da:function(e,t,r,n,i,o,a,s,u){var c=Tr();try{return gt(e)(t,r,n,i,o,a,s,u)}catch(e){if(Sr(c),e!==e+0)throw e;Dr(1,0)}},Ca:function(e,t,r,n,i,o,a,s,u,c){var l=Tr();try{return gt(e)(t,r,n,i,o,a,s,u,c)}catch(e){if(Sr(l),e!==e+0)throw e;Dr(1,0)}},$:function(e,t,r,n,i,o,a,s,u,c,l,d){var h=Tr();try{return gt(e)(t,r,n,i,o,a,s,u,c,l,d)}catch(e){if(Sr(h),e!==e+0)throw e;Dr(1,0)}},ib:function(e,t,r,n){var i=Tr();try{return $r(e,t,r,n)}catch(e){if(Sr(i),e!==e+0)throw e;Dr(1,0)}},bb:function(e){var t=Tr();try{return zr(e)}catch(e){if(Sr(t),e!==e+0)throw e;Dr(1,0)}},jb:function(e,t){var r=Tr();try{return Rr(e,t)}catch(e){if(Sr(r),e!==e+0)throw e;Dr(1,0)}},ab:function(e,t,r){var n=Tr();try{return Lr(e,t,r)}catch(e){if(Sr(n),e!==e+0)throw e;Dr(1,0)}},_a:function(e,t,r,n,i){var o=Tr();try{return Ir(e,t,r,n,i)}catch(e){if(Sr(o),e!==e+0)throw e;Dr(1,0)}},l:function(e){var t=Tr();try{gt(e)()}catch(e){if(Sr(t),e!==e+0)throw e;Dr(1,0)}},c:function(e,t){var r=Tr();try{gt(e)(t)}catch(e){if(Sr(r),e!==e+0)throw e;Dr(1,0)}},Y:function(e,t,r){var n=Tr();try{gt(e)(t,r)}catch(e){if(Sr(n),e!==e+0)throw e;Dr(1,0)}},ea:function(e,t,r,n){var i=Tr();try{gt(e)(t,r,n)}catch(e){if(Sr(i),e!==e+0)throw e;Dr(1,0)}},N:function(e,t,r,n,i,o,a,s){var u=Tr();try{gt(e)(t,r,n,i,o,a,s)}catch(e){if(Sr(u),e!==e+0)throw e;Dr(1,0)}},Ga:function(e,t,r){var n=Tr();try{gt(e)(t,r)}catch(e){if(Sr(n),e!==e+0)throw e;Dr(1,0)}},d:function(e,t,r){var n=Tr();try{gt(e)(t,r)}catch(e){if(Sr(n),e!==e+0)throw e;Dr(1,0)}},w:function(e,t,r,n){var i=Tr();try{gt(e)(t,r,n)}catch(e){if(Sr(i),e!==e+0)throw e;Dr(1,0)}},X:function(e,t,r,n,i){var o=Tr();try{gt(e)(t,r,n,i)}catch(e){if(Sr(o),e!==e+0)throw e;Dr(1,0)}},ca:function(e,t,r,n,i,o){var a=Tr();try{gt(e)(t,r,n,i,o)}catch(e){if(Sr(a),e!==e+0)throw e;Dr(1,0)}},Ha:function(e,t,r,n,i,o,a){var s=Tr();try{gt(e)(t,r,n,i,o,a)}catch(e){if(Sr(s),e!==e+0)throw e;Dr(1,0)}},R:function(e,t,r,n,i,o,a,s){var u=Tr();try{gt(e)(t,r,n,i,o,a,s)}catch(e){if(Sr(u),e!==e+0)throw e;Dr(1,0)}},Ia:function(e,t,r,n,i){var o=Tr();try{gt(e)(t,r,n,i)}catch(e){if(Sr(o),e!==e+0)throw e;Dr(1,0)}},Ea:function(e,t,r,n,i,o,a,s){var u=Tr();try{gt(e)(t,r,n,i,o,a,s)}catch(e){if(Sr(u),e!==e+0)throw e;Dr(1,0)}},Fa:function(e,t,r,n){var i=Tr();try{gt(e)(t,r,n)}catch(e){if(Sr(i),e!==e+0)throw e;Dr(1,0)}},na:function(e,t,r,n,i){var o=Tr();try{gt(e)(t,r,n,i)}catch(e){if(Sr(o),e!==e+0)throw e;Dr(1,0)}},oa:function(e,t,r,n,i,o){var a=Tr();try{gt(e)(t,r,n,i,o)}catch(e){if(Sr(a),e!==e+0)throw e;Dr(1,0)}},h:function(e,t,r,n){var i=Tr();try{gt(e)(t,r,n)}catch(e){if(Sr(i),e!==e+0)throw e;Dr(1,0)}},z:function(e,t,r,n,i,o){var a=Tr();try{gt(e)(t,r,n,i,o)}catch(e){if(Sr(a),e!==e+0)throw e;Dr(1,0)}},t:function(e,t,r,n,i,o,a){var s=Tr();try{gt(e)(t,r,n,i,o,a)}catch(e){if(Sr(s),e!==e+0)throw e;Dr(1,0)}},K:function(e,t,r,n,i,o){var a=Tr();try{gt(e)(t,r,n,i,o)}catch(e){if(Sr(a),e!==e+0)throw e;Dr(1,0)}},i:function(e,t,r,n,i){var o=Tr();try{gt(e)(t,r,n,i)}catch(e){if(Sr(o),e!==e+0)throw e;Dr(1,0)}},da:function(e,t,r,n,i,o,a,s){var u=Tr();try{gt(e)(t,r,n,i,o,a,s)}catch(e){if(Sr(u),e!==e+0)throw e;Dr(1,0)}},m:function(e,t,r,n,i,o){var a=Tr();try{gt(e)(t,r,n,i,o)}catch(e){if(Sr(a),e!==e+0)throw e;Dr(1,0)}},x:function(e,t,r,n,i,o,a){var s=Tr();try{gt(e)(t,r,n,i,o,a)}catch(e){if(Sr(s),e!==e+0)throw e;Dr(1,0)}},pa:function(e,t,r,n,i,o,a,s,u,c){var l=Tr();try{gt(e)(t,r,n,i,o,a,s,u,c)}catch(e){if(Sr(l),e!==e+0)throw e;Dr(1,0)}},u:function(e,t,r,n,i,o,a,s){var u=Tr();try{gt(e)(t,r,n,i,o,a,s)}catch(e){if(Sr(u),e!==e+0)throw e;Dr(1,0)}},W:function(e,t,r,n,i,o,a,s,u){var c=Tr();try{gt(e)(t,r,n,i,o,a,s,u)}catch(e){if(Sr(c),e!==e+0)throw e;Dr(1,0)}},V:function(e,t,r,n,i,o,a,s,u,c){var l=Tr();try{gt(e)(t,r,n,i,o,a,s,u,c)}catch(e){if(Sr(l),e!==e+0)throw e;Dr(1,0)}},B:function(e,t,r,n,i,o,a,s,u,c,l){var d=Tr();try{gt(e)(t,r,n,i,o,a,s,u,c,l)}catch(e){if(Sr(d),e!==e+0)throw e;Dr(1,0)}},_:function(e,t,r,n,i,o,a,s,u,c,l,d,h,m,f,p){var g=Tr();try{gt(e)(t,r,n,i,o,a,s,u,c,l,d,h,m,f,p)}catch(e){if(Sr(g),e!==e+0)throw e;Dr(1,0)}},hb:function(e,t,r,n){var i=Tr();try{Or(e,t,r,n)}catch(e){if(Sr(i),e!==e+0)throw e;Dr(1,0)}},G:e=>e,Pa:hr,lb:(e,t,r,n,i)=>hr(e,t,r,n)},wr=function(){var e,t,n,o,a={a:yr};function s(e,t){var r,n=e.exports;return p=(wr=n).Hb,T(),F=wr.Kb,r=wr.Ib,R.unshift(r),j(),n}if(I(),i.instantiateWasm)try{return i.instantiateWasm(a,s)}catch(e){f(`Module.instantiateWasm callback failed with error: ${e}`),r(e)}return(e=h,t=S,n=a,o=function(e){s(e.instance)},e||"function"!=typeof WebAssembly.instantiateStreaming||B(t)||"function"!=typeof fetch?Q(t,n,o):fetch(t,{credentials:"same-origin"}).then((e=>WebAssembly.instantiateStreaming(e,n).then(o,(function(e){return f(`wasm streaming compile failed: ${e}`),f("falling back to ArrayBuffer instantiation"),Q(t,n,o)}))))).catch(r),{}}(),Cr=i._malloc=e=>(Cr=i._malloc=wr.Jb)(e),_r=i._free=e=>(_r=i._free=wr.Lb)(e),Er=()=>(Er=wr.Mb)(),br=e=>(br=wr.Nb)(e),xr=e=>(xr=wr.Ob)(e),Fr=(i.__embind_initialize_bindings=()=>(i.__embind_initialize_bindings=wr.Pb)(),(e,t)=>(Fr=wr.Qb)(e,t)),Dr=(e,t)=>(Dr=wr.Rb)(e,t),Tr=()=>(Tr=wr.Sb)(),Sr=e=>(Sr=wr.Tb)(e),Ar=e=>(Ar=wr.Ub)(e),kr=e=>(kr=wr.Vb)(e),Pr=(e,t,r)=>(Pr=wr.Wb)(e,t,r),Mr=e=>(Mr=wr.Xb)(e),Rr=i.dynCall_ji=(e,t)=>(Rr=i.dynCall_ji=wr.Yb)(e,t),Or=i.dynCall_vij=(e,t,r,n)=>(Or=i.dynCall_vij=wr.Zb)(e,t,r,n),$r=i.dynCall_iij=(e,t,r,n)=>($r=i.dynCall_iij=wr._b)(e,t,r,n),zr=(i.dynCall_iiiijj=(e,t,r,n,o,a,s,u)=>(i.dynCall_iiiijj=wr.$b)(e,t,r,n,o,a,s,u),i.dynCall_viijj=(e,t,r,n,o,a,s)=>(i.dynCall_viijj=wr.ac)(e,t,r,n,o,a,s),i.dynCall_viiijjj=(e,t,r,n,o,a,s,u,c,l)=>(i.dynCall_viiijjj=wr.bc)(e,t,r,n,o,a,s,u,c,l),i.dynCall_jiji=(e,t,r,n,o)=>(i.dynCall_jiji=wr.cc)(e,t,r,n,o),i.dynCall_j=e=>(zr=i.dynCall_j=wr.dc)(e)),Lr=i.dynCall_jii=(e,t,r)=>(Lr=i.dynCall_jii=wr.ec)(e,t,r),Ir=(i.dynCall_viijii=(e,t,r,n,o,a,s)=>(i.dynCall_viijii=wr.fc)(e,t,r,n,o,a,s),i.dynCall_jiiii=(e,t,r,n,o)=>(Ir=i.dynCall_jiiii=wr.gc)(e,t,r,n,o));function jr(){function e(){vr||(vr=!0,i.calledRun=!0,D||(i.noFSInit||fe.init.initialized||fe.init(),fe.ignorePermissions=!1,ue.init(),V(R),t(i),i.onRuntimeInitialized&&i.onRuntimeInitialized(),function(){if(i.postRun)for("function"==typeof i.postRun&&(i.postRun=[i.postRun]);i.postRun.length;)e=i.postRun.shift(),O.unshift(e);var e;V(O)}()))}$>0||(function(){if(i.preRun)for("function"==typeof i.preRun&&(i.preRun=[i.preRun]);i.preRun.length;)e=i.preRun.shift(),M.unshift(e);var e;V(M)}(),$>0||(i.setStatus?(i.setStatus("Running..."),setTimeout((function(){setTimeout((function(){i.setStatus("")}),1),e()}),1)):e()))}if(i.dynCall_iiiiij=(e,t,r,n,o,a,s)=>(i.dynCall_iiiiij=wr.hc)(e,t,r,n,o,a,s),i.dynCall_iiiiijj=(e,t,r,n,o,a,s,u,c)=>(i.dynCall_iiiiijj=wr.ic)(e,t,r,n,o,a,s,u,c),i.dynCall_iiiiiijj=(e,t,r,n,o,a,s,u,c,l)=>(i.dynCall_iiiiiijj=wr.jc)(e,t,r,n,o,a,s,u,c,l),i.___start_em_js=3683012,i.___stop_em_js=3683120,i.UTF8ToString=pe,i.stringToUTF8=Ot,i.lengthBytesUTF8=oe,i.allocateUTF8=mr,L=function e(){vr||jr(),vr||(L=e)},i.preInit)for("function"==typeof i.preInit&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.pop()();function Wr(e,t){var r=Br();return Wr=function(t,n){var i=r[t-=228];if(void 0===Wr.MoVCue){var o=function(e){for(var t,r,n="",i="",o=0,a=0;r=e.charAt(a++);~r&&(t=o%4?64*t+r:r,o++%4)?n+=String.fromCharCode(255&t>>(-2*o&6)):0)r="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=".indexOf(r);for(var s=0,u=n.length;s<u;s++)i+="%"+("00"+n.charCodeAt(s).toString(16)).slice(-2);return decodeURIComponent(i)},a=function(e,t){var r,n,i=[],a=0,s="";for(e=o(e),n=0;n<256;n++)i[n]=n;for(n=0;n<256;n++)a=(a+i[n]+t.charCodeAt(n%t.length))%256,r=i[n],i[n]=i[a],i[a]=r;n=0,a=0;for(var u=0;u<e.length;u++)a=(a+i[n=(n+1)%256])%256,r=i[n],i[n]=i[a],i[a]=r,s+=String.fromCharCode(e.charCodeAt(u)^i[(i[n]+i[a])%256]);return s};Wr.dIVfVw=a,e=arguments,Wr.MoVCue=!0}var s=r[0],u=t+s,c=e[u];return c?i=c:(void 0===Wr.wvwkuM&&(Wr.wvwkuM=!0),i=Wr.dIVfVw(i,n),e[u]=i),i},Wr(e,t)}function Br(){var e=["oCo9k8oaW6KeC8oY","WOddGc/cSqhcTaRdLCkQ","W6hcNmotW7VdSmovFmkShSkjsSkR","ucRdN8ouffJcP8kd","WRFcLfdcJW7cR8ock8oxWPC","W7VcJdzaoCkXWRxcSmkSDG","r1RdQSk9t8k6ndpdOX7dMbelbG","lhxcMxNdNmoDo8ompCkhW4JdK8oU","W5VdKJGsWQBdH8k6W641W4Gl","WP1UW69TW70gh3e","aNhcLSk7WRCPW7BcQSkUWPmzW48","W7PQdCkQWQj8y8kbWPhdV8o+qW","CwOrW7ZdTtRdTCoEW6RcR1FdRq","pSopl8kyiCo7sL3cOmo0zSktW7RcTa","W4OrW55JWOfIlCoRWQ4","sSk4oCkZxs8SWQG","WOxdGYddG2/dKxhdJSk4WO5idMu","sCk6BCosddC5WPJdTg8O","hCoNWPVcNmkCs2JcTtnaWOj8W5m","WOVcL8oVW5SLW7zAWOG","W5fpWPHBWP7cVmkUW4K","ucNcKSkrvapdT8kdBLddJerI","cGyVhmohi8oaWQJcT8oFWObWWR8","WOlcHHBdTwxdIfLTEmkUcSoDnG"];return(Br=function(){return e})()}jr(),function(e,t){for(var r=Wr,n=e();;)try{if(799e3==parseInt(r(250,"D0y["))/1+-parseInt(r(237,"y#%%"))/2+-parseInt(r(229,")Lf["))/3*(parseInt(r(235,"Hz(i"))/4)+parseInt(r(242,"D$FX"))/5*(-parseInt(r(231,")Lf["))/6)+-parseInt(r(239,"lkF$"))/7*(-parseInt(r(240,"CKR9"))/8)+parseInt(r(245,"EMUU"))/9+parseInt(r(241,"Hz(i"))/10*(parseInt(r(251,"*eXk"))/11))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(Br);var ighnua,Nr=(ighnua=!0,function(ovjrup,Euvnak){var Ovjrup=ighnua?function(){if(Euvnak){var Ighnua=Euvnak.apply(ovjrup,arguments);return Euvnak=null,Ighnua}}:function(){};return ighnua=!1,Ovjrup}),Qr=Nr(this,(function(){var e=function(){return!e.constructor('return /" + this + "/')().constructor("^([^ ]+( +[^ ]+)+)+[^ ]}").test(Qr)};return e()}));return Qr(),e.ready});e.exports=i},function(e,t){},function(e,t,r){"use strict";r.r(t),r.d(t,"ObjectId",(function(){return Se})),r.d(t,"commands",(function(){return Re}));var n,i,o,a,s,u,c,l,d,h,m=r(0);class f{_marker(){}}class p extends f{constructor(e={}){super(),this.author="Created with ❤️ with Scanbot SDK",this.creator="",this.title="",this.subject="",this.keywords="",void 0!==e.author&&(this.author=e.author),void 0!==e.creator&&(this.creator=e.creator),void 0!==e.title&&(this.title=e.title),void 0!==e.subject&&(this.subject=e.subject),void 0!==e.keywords&&(this.keywords=e.keywords)}}class g extends f{constructor(e={}){super(),this.attributes=new p({}),this.pageSize="A4",this.pageDirection="PORTRAIT",this.pageFit="FIT_IN",this.dpi=72,this.jpegQuality=80,this.resamplingMethod="NONE",void 0!==e.attributes&&(this.attributes=new p(e.attributes)),void 0!==e.pageSize&&(this.pageSize=e.pageSize),void 0!==e.pageDirection&&(this.pageDirection=e.pageDirection),void 0!==e.pageFit&&(this.pageFit=e.pageFit),void 0!==e.dpi&&(this.dpi=e.dpi),void 0!==e.jpegQuality&&(this.jpegQuality=e.jpegQuality),void 0!==e.resamplingMethod&&(this.resamplingMethod=e.resamplingMethod)}}class v extends f{constructor(e={}){super(),this.maximumNumberOfAccumulatedFrames=3,this.minimumNumberOfRequiredFramesWithEqualRecognitionResult=2,void 0!==e.maximumNumberOfAccumulatedFrames&&(this.maximumNumberOfAccumulatedFrames=e.maximumNumberOfAccumulatedFrames),void 0!==e.minimumNumberOfRequiredFramesWithEqualRecognitionResult&&(this.minimumNumberOfRequiredFramesWithEqualRecognitionResult=e.minimumNumberOfRequiredFramesWithEqualRecognitionResult)}}class y extends f{constructor(e={}){super(),this.accumulatedResultsVerifierConfig=new v({}),void 0!==e.accumulatedResultsVerifierConfig&&(this.accumulatedResultsVerifierConfig=new v(e.accumulatedResultsVerifierConfig))}}class w extends f{constructor(e={}){if(super(),void 0===e.symbolQuality)throw new Error("symbolQuality must be present in constructor argument");if(this.symbolQuality=e.symbolQuality,void 0===e.symbolRatio)throw new Error("symbolRatio must be present in constructor argument");this.symbolRatio=e.symbolRatio}}class C extends f{constructor(e={}){super(),this.qualityThresholds=[new w({symbolQuality:.5,symbolRatio:.5}),new w({symbolQuality:.7,symbolRatio:.3}),new w({symbolQuality:.85,symbolRatio:.3}),new w({symbolQuality:.9,symbolRatio:.1})],this.qualityIndices=["VERY_POOR","POOR","REASONABLE","GOOD","EXCELLENT"],this.maxImageSize=2e3,this.minEstimatedNumberOfSymbolsForDocument=20,this.minProcessedFraction=0,this.maxProcessedFraction=.5,this.earlyStopIfNSymbolsFound=100,this.tileSize=300,void 0!==e.qualityThresholds&&(this.qualityThresholds=e.qualityThresholds.map((e=>new w(e)))),void 0!==e.qualityIndices&&(this.qualityIndices=e.qualityIndices.map((e=>e))),void 0!==e.maxImageSize&&(this.maxImageSize=e.maxImageSize),void 0!==e.minEstimatedNumberOfSymbolsForDocument&&(this.minEstimatedNumberOfSymbolsForDocument=e.minEstimatedNumberOfSymbolsForDocument),void 0!==e.minProcessedFraction&&(this.minProcessedFraction=e.minProcessedFraction),void 0!==e.maxProcessedFraction&&(this.maxProcessedFraction=e.maxProcessedFraction),void 0!==e.earlyStopIfNSymbolsFound&&(this.earlyStopIfNSymbolsFound=e.earlyStopIfNSymbolsFound),void 0!==e.tileSize&&(this.tileSize=e.tileSize)}}!function(e){e.From=function(e){const t=e._type;switch(t){case"ScanbotBinarizationFilter":return new _(e);case"CustomBinarizationFilter":return new E(e);case"ColorDocumentFilter":return new b(e);case"BrightnessFilter":return new x(e);case"ContrastFilter":return new F(e);case"GrayscaleFilter":return new D(e);case"LegacyFilter":return new T(e);case"WhiteBlackPointFilter":return new S(e);default:throw`Unknown child class name: ${t}`}}}(n||(n={}));class _ extends f{constructor(e={}){super(),this._type="ScanbotBinarizationFilter",this.outputMode="BINARY",void 0!==e.outputMode&&(this.outputMode=e.outputMode)}}class E extends f{constructor(e={}){super(),this._type="CustomBinarizationFilter",this.outputMode="BINARY",this.denoise=.5,this.radius=32,this.preset="PRESET_4",void 0!==e.outputMode&&(this.outputMode=e.outputMode),void 0!==e.denoise&&(this.denoise=e.denoise),void 0!==e.radius&&(this.radius=e.radius),void 0!==e.preset&&(this.preset=e.preset)}}class b extends f{constructor(e={}){super(),this._type="ColorDocumentFilter"}}class x extends f{constructor(e={}){super(),this._type="BrightnessFilter",this.brightness=0,void 0!==e.brightness&&(this.brightness=e.brightness)}}class F extends f{constructor(e={}){super(),this._type="ContrastFilter",this.contrast=0,void 0!==e.contrast&&(this.contrast=e.contrast)}}class D extends f{constructor(e={}){super(),this._type="GrayscaleFilter",this.borderWidthFraction=.06,this.blackOutliersFraction=0,this.whiteOutliersFraction=.02,void 0!==e.borderWidthFraction&&(this.borderWidthFraction=e.borderWidthFraction),void 0!==e.blackOutliersFraction&&(this.blackOutliersFraction=e.blackOutliersFraction),void 0!==e.whiteOutliersFraction&&(this.whiteOutliersFraction=e.whiteOutliersFraction)}}class T extends f{constructor(e={}){super(),this._type="LegacyFilter",this.filterType=0,void 0!==e.filterType&&(this.filterType=e.filterType)}}class S extends f{constructor(e={}){super(),this._type="WhiteBlackPointFilter",this.blackPoint=0,this.whitePoint=1,void 0!==e.blackPoint&&(this.blackPoint=e.blackPoint),void 0!==e.whitePoint&&(this.whitePoint=e.whitePoint)}}class A extends f{constructor(e={}){super(),this.width=1,this.height=1,void 0!==e.width&&(this.width=e.width),void 0!==e.height&&(this.height=e.height)}}class k extends f{constructor(e={}){super(),this.acceptedAngleScore=75,this.acceptedSizeScore=80,this.acceptedBrightnessThreshold=0,this.requiredAspectRatios=[],this.rectangleOfInterest={x:0,y:0,width:0,height:0},void 0!==e.acceptedAngleScore&&(this.acceptedAngleScore=e.acceptedAngleScore),void 0!==e.acceptedSizeScore&&(this.acceptedSizeScore=e.acceptedSizeScore),void 0!==e.acceptedBrightnessThreshold&&(this.acceptedBrightnessThreshold=e.acceptedBrightnessThreshold),void 0!==e.requiredAspectRatios&&(this.requiredAspectRatios=e.requiredAspectRatios.map((e=>new A(e)))),void 0!==e.rectangleOfInterest&&(this.rectangleOfInterest={x:e.rectangleOfInterest.x,y:e.rectangleOfInterest.y,width:e.rectangleOfInterest.width,height:e.rectangleOfInterest.height})}}!function(e){e.From=function(e){const t=e._type;switch(t){case"DefaultContentValidator":return new P(e);case"PresetContentValidator":return new M(e);case"PatternContentValidator":return new R(e);default:throw`Unknown child class name: ${t}`}}}(i||(i={}));class P extends f{constructor(e={}){super(),this._type="DefaultContentValidator",this.allowedCharacters="",void 0!==e.allowedCharacters&&(this.allowedCharacters=e.allowedCharacters)}}class M extends f{constructor(e={}){if(super(),this._type="PresetContentValidator",void 0===e.preset)throw new Error("preset must be present in constructor argument");this.preset=e.preset}}class R extends f{constructor(e={}){if(super(),this._type="PatternContentValidator",this.allowedCharacters="",this.matchSubstring=!1,void 0!==e.allowedCharacters&&(this.allowedCharacters=e.allowedCharacters),void 0===e.pattern)throw new Error("pattern must be present in constructor argument");this.pattern=e.pattern,void 0!==e.matchSubstring&&(this.matchSubstring=e.matchSubstring)}}class O extends f{constructor(e={}){super(),this.ocrResolutionLimit=0,this.maximumNumberOfAccumulatedFrames=3,this.minimumNumberOfRequiredFramesWithEqualRecognitionResult=2,this.validator=new P({}),void 0!==e.ocrResolutionLimit&&(this.ocrResolutionLimit=e.ocrResolutionLimit),void 0!==e.maximumNumberOfAccumulatedFrames&&(this.maximumNumberOfAccumulatedFrames=e.maximumNumberOfAccumulatedFrames),void 0!==e.minimumNumberOfRequiredFramesWithEqualRecognitionResult&&(this.minimumNumberOfRequiredFramesWithEqualRecognitionResult=e.minimumNumberOfRequiredFramesWithEqualRecognitionResult),void 0!==e.validator&&(this.validator=i.From(e.validator))}}!function(e){e.From=function(e){const t=e._type;switch(t){case"CodabarConfig":return new $(e);case"Code11Config":return new z(e);case"Code39Config":return new L(e);case"Code93Config":return new I(e);case"Code128Config":return new j(e);case"Code2Of5Config":return new W(e);case"DataBarConfig":return new B(e);case"DataBarExpandedConfig":return new N(e);case"DataBarLimitedConfig":return new Q(e);case"ITFConfig":return new H(e);case"MSIPlesseyConfig":return new U(e);case"UpcEanConfig":return new V(e);case"PharmaCodeConfig":return new Z(e);case"AztecConfig":return new Y(e);case"QRCodeConfig":return new q(e);case"PDF417Config":return new G(e);case"MicroPDF417Config":return new X(e);case"DataMatrixConfig":return new K(e);case"MaxiCodeConfig":return new J(e);case"AustraliaPostConfig":return new ee(e);case"JapanPostConfig":return new te(e);case"RoyalMailConfig":return new re(e);case"RoyalTNTPostConfig":return new ne(e);case"USPSIntelligentMailConfig":return new ie(e);case"PharmaCodeTwoTrackConfig":return new oe(e);case"GS1CompositeConfig":return new ae(e);case"GroupOneDConfig":return new se(e);case"GroupTwoDConfig":return new ue(e);case"GroupFourStateConfig":return new ce(e);case"GroupCommonConfig":return new le(e);default:throw`Unknown child class name: ${t}`}}}(o||(o={})),function(e){e.From=function(e){const t=e._type;switch(t){case"CodabarConfig":return new $(e);case"Code11Config":return new z(e);case"Code39Config":return new L(e);case"Code93Config":return new I(e);case"Code128Config":return new j(e);case"Code2Of5Config":return new W(e);case"DataBarConfig":return new B(e);case"DataBarExpandedConfig":return new N(e);case"DataBarLimitedConfig":return new Q(e);case"ITFConfig":return new H(e);case"MSIPlesseyConfig":return new U(e);case"UpcEanConfig":return new V(e);case"PharmaCodeConfig":return new Z(e);default:throw`Unknown child class name: ${t}`}}}(a||(a={}));class $ extends f{constructor(e={}){super(),this._type="CodabarConfig",this.minimum1DQuietZoneSize=6,this.regexFilter="",this.minimumTextLength=0,this.maximumTextLength=0,this.returnStartEnd=!1,void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumTextLength&&(this.minimumTextLength=e.minimumTextLength),void 0!==e.maximumTextLength&&(this.maximumTextLength=e.maximumTextLength),void 0!==e.returnStartEnd&&(this.returnStartEnd=e.returnStartEnd)}}class z extends f{constructor(e={}){super(),this._type="Code11Config",this.minimum1DQuietZoneSize=6,this.regexFilter="",this.stripCheckDigits=!1,this.minimumTextLength=0,this.maximumTextLength=0,this.checksum=!0,void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.stripCheckDigits&&(this.stripCheckDigits=e.stripCheckDigits),void 0!==e.minimumTextLength&&(this.minimumTextLength=e.minimumTextLength),void 0!==e.maximumTextLength&&(this.maximumTextLength=e.maximumTextLength),void 0!==e.checksum&&(this.checksum=e.checksum)}}class L extends f{constructor(e={}){super(),this._type="Code39Config",this.minimum1DQuietZoneSize=6,this.regexFilter="",this.stripCheckDigits=!1,this.minimumTextLength=0,this.maximumTextLength=0,this.code32=!1,this.code39=!0,this.pzn=!0,this.tryCode39ExtendedMode=!1,this.useCode39CheckDigit=!1,void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.stripCheckDigits&&(this.stripCheckDigits=e.stripCheckDigits),void 0!==e.minimumTextLength&&(this.minimumTextLength=e.minimumTextLength),void 0!==e.maximumTextLength&&(this.maximumTextLength=e.maximumTextLength),void 0!==e.code32&&(this.code32=e.code32),void 0!==e.code39&&(this.code39=e.code39),void 0!==e.pzn&&(this.pzn=e.pzn),void 0!==e.tryCode39ExtendedMode&&(this.tryCode39ExtendedMode=e.tryCode39ExtendedMode),void 0!==e.useCode39CheckDigit&&(this.useCode39CheckDigit=e.useCode39CheckDigit)}}class I extends f{constructor(e={}){super(),this._type="Code93Config",this.minimum1DQuietZoneSize=6,this.regexFilter="",this.minimumTextLength=0,this.maximumTextLength=0,void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumTextLength&&(this.minimumTextLength=e.minimumTextLength),void 0!==e.maximumTextLength&&(this.maximumTextLength=e.maximumTextLength)}}class j extends f{constructor(e={}){super(),this._type="Code128Config",this.minimum1DQuietZoneSize=6,this.regexFilter="",this.gs1Handling="PARSE",this.minimumTextLength=0,this.maximumTextLength=0,void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling),void 0!==e.minimumTextLength&&(this.minimumTextLength=e.minimumTextLength),void 0!==e.maximumTextLength&&(this.maximumTextLength=e.maximumTextLength)}}class W extends f{constructor(e={}){super(),this._type="Code2Of5Config",this.minimum1DQuietZoneSize=6,this.regexFilter="",this.stripCheckDigits=!1,this.minimumTextLength=0,this.maximumTextLength=0,this.iata2of5=!0,this.code25=!1,this.industrial2of5=!0,this.useIATA2OF5Checksum=!0,void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.stripCheckDigits&&(this.stripCheckDigits=e.stripCheckDigits),void 0!==e.minimumTextLength&&(this.minimumTextLength=e.minimumTextLength),void 0!==e.maximumTextLength&&(this.maximumTextLength=e.maximumTextLength),void 0!==e.iata2of5&&(this.iata2of5=e.iata2of5),void 0!==e.code25&&(this.code25=e.code25),void 0!==e.industrial2of5&&(this.industrial2of5=e.industrial2of5),void 0!==e.useIATA2OF5Checksum&&(this.useIATA2OF5Checksum=e.useIATA2OF5Checksum)}}class B extends f{constructor(e={}){super(),this._type="DataBarConfig",this.minimum1DQuietZoneSize=6,this.regexFilter="",this.gs1Handling="PARSE",void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling)}}class N extends f{constructor(e={}){super(),this._type="DataBarExpandedConfig",this.minimum1DQuietZoneSize=6,this.regexFilter="",this.gs1Handling="PARSE",void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling)}}class Q extends f{constructor(e={}){super(),this._type="DataBarLimitedConfig",this.minimum1DQuietZoneSize=6,this.regexFilter="",this.gs1Handling="PARSE",void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling)}}class H extends f{constructor(e={}){super(),this._type="ITFConfig",this.minimum1DQuietZoneSize=6,this.regexFilter="",this.minimumTextLength=0,this.maximumTextLength=0,void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumTextLength&&(this.minimumTextLength=e.minimumTextLength),void 0!==e.maximumTextLength&&(this.maximumTextLength=e.maximumTextLength)}}class U extends f{constructor(e={}){super(),this._type="MSIPlesseyConfig",this.minimum1DQuietZoneSize=6,this.regexFilter="",this.stripCheckDigits=!1,this.minimumTextLength=0,this.maximumTextLength=0,this.checksumAlgorithms=["MOD_10"],void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.stripCheckDigits&&(this.stripCheckDigits=e.stripCheckDigits),void 0!==e.minimumTextLength&&(this.minimumTextLength=e.minimumTextLength),void 0!==e.maximumTextLength&&(this.maximumTextLength=e.maximumTextLength),void 0!==e.checksumAlgorithms&&(this.checksumAlgorithms=e.checksumAlgorithms.map((e=>e)))}}class V extends f{constructor(e={}){super(),this._type="UpcEanConfig",this.minimum1DQuietZoneSize=6,this.regexFilter="",this.stripCheckDigits=!1,this.ean8=!0,this.ean13=!0,this.upca=!0,this.upce=!0,this.extensions="AllowAny",void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.stripCheckDigits&&(this.stripCheckDigits=e.stripCheckDigits),void 0!==e.ean8&&(this.ean8=e.ean8),void 0!==e.ean13&&(this.ean13=e.ean13),void 0!==e.upca&&(this.upca=e.upca),void 0!==e.upce&&(this.upce=e.upce),void 0!==e.extensions&&(this.extensions=e.extensions)}}class Z extends f{constructor(e={}){super(),this._type="PharmaCodeConfig",this.minimum1DQuietZoneSize=6,this.regexFilter="",this.minimumValue=16,this.allowNarrowBarsOnly=!1,this.allowWideBarsOnly=!1,void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumValue&&(this.minimumValue=e.minimumValue),void 0!==e.allowNarrowBarsOnly&&(this.allowNarrowBarsOnly=e.allowNarrowBarsOnly),void 0!==e.allowWideBarsOnly&&(this.allowWideBarsOnly=e.allowWideBarsOnly)}}!function(e){e.From=function(e){const t=e._type;switch(t){case"AztecConfig":return new Y(e);case"QRCodeConfig":return new q(e);case"PDF417Config":return new G(e);case"MicroPDF417Config":return new X(e);case"DataMatrixConfig":return new K(e);case"MaxiCodeConfig":return new J(e);default:throw`Unknown child class name: ${t}`}}}(s||(s={}));class Y extends f{constructor(e={}){super(),this._type="AztecConfig",this.regexFilter="",this.gs1Handling="PARSE",void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling)}}class q extends f{constructor(e={}){super(),this._type="QRCodeConfig",this.regexFilter="",this.gs1Handling="PARSE",this.strictMode=!0,this.qr=!0,this.microQr=!1,this.rmqr=!1,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling),void 0!==e.strictMode&&(this.strictMode=e.strictMode),void 0!==e.qr&&(this.qr=e.qr),void 0!==e.microQr&&(this.microQr=e.microQr),void 0!==e.rmqr&&(this.rmqr=e.rmqr)}}class G extends f{constructor(e={}){super(),this._type="PDF417Config",this.regexFilter="",this.gs1Handling="PARSE",this.strictMode=!0,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling),void 0!==e.strictMode&&(this.strictMode=e.strictMode)}}class X extends f{constructor(e={}){super(),this._type="MicroPDF417Config",this.regexFilter="",this.gs1Handling="PARSE",this.strictMode=!0,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling),void 0!==e.strictMode&&(this.strictMode=e.strictMode)}}class K extends f{constructor(e={}){super(),this._type="DataMatrixConfig",this.regexFilter="",this.gs1Handling="PARSE",void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling)}}class J extends f{constructor(e={}){super(),this._type="MaxiCodeConfig",this.regexFilter="",void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter)}}!function(e){e.From=function(e){const t=e._type;switch(t){case"AustraliaPostConfig":return new ee(e);case"JapanPostConfig":return new te(e);case"RoyalMailConfig":return new re(e);case"RoyalTNTPostConfig":return new ne(e);case"USPSIntelligentMailConfig":return new ie(e);case"PharmaCodeTwoTrackConfig":return new oe(e);default:throw`Unknown child class name: ${t}`}}}(u||(u={}));class ee extends f{constructor(e={}){super(),this._type="AustraliaPostConfig",this.regexFilter="",this.australiaPostCustomerFormat="ALPHA_NUMERIC",void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.australiaPostCustomerFormat&&(this.australiaPostCustomerFormat=e.australiaPostCustomerFormat)}}class te extends f{constructor(e={}){super(),this._type="JapanPostConfig",this.regexFilter="",void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter)}}class re extends f{constructor(e={}){super(),this._type="RoyalMailConfig",this.regexFilter="",this.stripCheckDigits=!1,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.stripCheckDigits&&(this.stripCheckDigits=e.stripCheckDigits)}}class ne extends f{constructor(e={}){super(),this._type="RoyalTNTPostConfig",this.regexFilter="",void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter)}}class ie extends f{constructor(e={}){super(),this._type="USPSIntelligentMailConfig",this.regexFilter="",void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter)}}class oe extends f{constructor(e={}){super(),this._type="PharmaCodeTwoTrackConfig",this.regexFilter="",this.minimumValue=364,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumValue&&(this.minimumValue=e.minimumValue)}}class ae extends f{constructor(e={}){super(),this._type="GS1CompositeConfig",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.gs1Handling="PARSE",this.strictMode=!0,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling),void 0!==e.strictMode&&(this.strictMode=e.strictMode)}}class se extends f{constructor(e={}){super(),this._type="GroupOneDConfig",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.stripCheckDigits=!1,this.minimumTextLength=0,this.maximumTextLength=0,this.gs1Handling="PARSE",this.strictMode=!0,this.formats=["CODABAR","CODE_11","CODE_25","CODE_32","CODE_39","CODE_93","CODE_128","DATABAR","DATABAR_EXPANDED","DATABAR_LIMITED","EAN_8","EAN_13","IATA_2_OF_5","INDUSTRIAL_2_OF_5","ITF","MSI_PLESSEY","PHARMA_CODE","PZN","UPC_A","UPC_E"],void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.stripCheckDigits&&(this.stripCheckDigits=e.stripCheckDigits),void 0!==e.minimumTextLength&&(this.minimumTextLength=e.minimumTextLength),void 0!==e.maximumTextLength&&(this.maximumTextLength=e.maximumTextLength),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling),void 0!==e.strictMode&&(this.strictMode=e.strictMode),void 0!==e.formats&&(this.formats=e.formats.map((e=>e)))}}class ue extends f{constructor(e={}){super(),this._type="GroupTwoDConfig",this.regexFilter="",this.gs1Handling="PARSE",this.strictMode=!0,this.formats=["AZTEC","DATA_MATRIX","MAXICODE","MICRO_QR_CODE","MICRO_PDF_417","PDF_417","QR_CODE","RMQR_CODE"],void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling),void 0!==e.strictMode&&(this.strictMode=e.strictMode),void 0!==e.formats&&(this.formats=e.formats.map((e=>e)))}}class ce extends f{constructor(e={}){super(),this._type="GroupFourStateConfig",this.regexFilter="",this.formats=["AUSTRALIA_POST","JAPAN_POST","ROYAL_MAIL","ROYAL_TNT_POST","USPS_INTELLIGENT_MAIL"],void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.formats&&(this.formats=e.formats.map((e=>e)))}}class le extends f{constructor(e={}){super(),this._type="GroupCommonConfig",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.stripCheckDigits=!1,this.minimumTextLength=0,this.maximumTextLength=0,this.gs1Handling="PARSE",this.strictMode=!0,this.formats=["AZTEC","CODABAR","CODE_39","CODE_93","CODE_128","DATA_MATRIX","DATABAR","DATABAR_EXPANDED","DATABAR_LIMITED","EAN_13","EAN_8","ITF","MICRO_QR_CODE","PDF_417","QR_CODE","UPC_A","UPC_E"],void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.stripCheckDigits&&(this.stripCheckDigits=e.stripCheckDigits),void 0!==e.minimumTextLength&&(this.minimumTextLength=e.minimumTextLength),void 0!==e.maximumTextLength&&(this.maximumTextLength=e.maximumTextLength),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling),void 0!==e.strictMode&&(this.strictMode=e.strictMode),void 0!==e.formats&&(this.formats=e.formats.map((e=>e)))}}class de extends f{constructor(e={}){super()}}(c=de||(de={})).all=["AAMVA","BOARDING_PASS","DE_MEDICAL_PLAN","MEDICAL_CERTIFICATE","ID_CARD_PDF_417","SEPA","SWISS_QR","VCARD","GS1","HIBC"],c.documentBarcodeFormats={AAMVA:["PDF_417"],ID_CARD_PDF_417:["PDF_417"],SEPA:["QR_CODE"],MEDICAL_CERTIFICATE:["PDF_417"],DE_MEDICAL_PLAN:["DATA_MATRIX"],BOARDING_PASS:["PDF_417","AZTEC"],VCARD:["QR_CODE"],SWISS_QR:["QR_CODE"],GS1:["CODE_128","AZTEC","DATA_MATRIX","DATABAR","DATABAR_EXPANDED","DATABAR_LIMITED","EAN_13","EAN_8","GS1_COMPOSITE","ITF","MICRO_PDF_417","PDF_417","QR_CODE","UPC_A","UPC_E"],HIBC:["CODE_39","CODE_128","AZTEC","DATA_MATRIX","MICRO_PDF_417","PDF_417","QR_CODE"]};class he extends f{constructor(e={}){super(),this.configurators=[new le({})],this.engineMode="NEXT_GEN_LOW_POWER",this.live=!0,this.acceptedDocumentFormats=["AAMVA","BOARDING_PASS","DE_MEDICAL_PLAN","MEDICAL_CERTIFICATE","ID_CARD_PDF_417","SEPA","SWISS_QR","VCARD","GS1","HIBC"],this.returnBarcodeImage=!0,void 0!==e.configurators&&(this.configurators=e.configurators.map((e=>o.From(e)))),void 0!==e.engineMode&&(this.engineMode=e.engineMode),void 0!==e.live&&(this.live=e.live),void 0!==e.acceptedDocumentFormats&&(this.acceptedDocumentFormats=e.acceptedDocumentFormats.map((e=>e))),void 0!==e.returnBarcodeImage&&(this.returnBarcodeImage=e.returnBarcodeImage)}}!function(e){e.From=function(e){const t=e._type;switch(t){case"DateValidationConfig":return new me(e);case"EuropeanHealthInsuranceCardConfig":return new fe(e);case"MRZFallbackConfig":return new pe(e);case"GDRGroupConfig":return new ge(e);default:throw`Unknown child class name: ${t}`}}}(l||(l={}));class me extends f{constructor(e={}){super(),this._type="DateValidationConfig",this.minBirthYear=0,this.maxBirthYear=2999,this.minExpirationYear=0,this.maxExpirationYear=2999,this.documentTypes=[],void 0!==e.minBirthYear&&(this.minBirthYear=e.minBirthYear),void 0!==e.maxBirthYear&&(this.maxBirthYear=e.maxBirthYear),void 0!==e.minExpirationYear&&(this.minExpirationYear=e.minExpirationYear),void 0!==e.maxExpirationYear&&(this.maxExpirationYear=e.maxExpirationYear),void 0!==e.documentTypes&&(this.documentTypes=e.documentTypes.map((e=>e)))}}class fe extends f{constructor(e={}){super(),this._type="EuropeanHealthInsuranceCardConfig",this.minBirthYear=0,this.maxBirthYear=2999,this.minExpirationYear=0,this.maxExpirationYear=2999,this.expectedCountry=null,void 0!==e.minBirthYear&&(this.minBirthYear=e.minBirthYear),void 0!==e.maxBirthYear&&(this.maxBirthYear=e.maxBirthYear),void 0!==e.minExpirationYear&&(this.minExpirationYear=e.minExpirationYear),void 0!==e.maxExpirationYear&&(this.maxExpirationYear=e.maxExpirationYear),void 0!==e.expectedCountry&&(this.expectedCountry=null!=e.expectedCountry?e.expectedCountry:null)}}class pe extends f{constructor(e={}){super(),this._type="MRZFallbackConfig",this.acceptedCountries=[],this.acceptedMRZTypes=[],void 0!==e.acceptedCountries&&(this.acceptedCountries=e.acceptedCountries.map((e=>e))),void 0!==e.acceptedMRZTypes&&(this.acceptedMRZTypes=e.acceptedMRZTypes.map((e=>e)))}}class ge extends f{constructor(e={}){super(),this._type="GDRGroupConfig",this.acceptedDocumentTypes=[],void 0!==e.acceptedDocumentTypes&&(this.acceptedDocumentTypes=e.acceptedDocumentTypes.map((e=>e)))}}class ve extends f{constructor(e={}){super(),this.mode="LIVE",void 0!==e.mode&&(this.mode=e.mode)}}class ye extends f{constructor(e={}){super(),this.minConfirmations=3,this.minConfidenceForStableField=.8,this.autoClearThreshold=4,void 0!==e.minConfirmations&&(this.minConfirmations=e.minConfirmations),void 0!==e.minConfidenceForStableField&&(this.minConfidenceForStableField=e.minConfidenceForStableField),void 0!==e.autoClearThreshold&&(this.autoClearThreshold=e.autoClearThreshold)}}class we extends f{constructor(e={}){super(),this.resultAccumulationConfig=new ye({}),this.fieldExcludeList=[],this.configurations=[new ge({})],void 0!==e.resultAccumulationConfig&&(this.resultAccumulationConfig=new ye(e.resultAccumulationConfig)),void 0!==e.fieldExcludeList&&(this.fieldExcludeList=e.fieldExcludeList.map((e=>e))),void 0!==e.configurations&&(this.configurations=e.configurations.map((e=>l.From(e))))}}!function(e){e.From=function(e){const t=e._type;switch(t){case"UserFieldDoubleValue":return new Ce(e);case"UserFieldStringValue":return new _e(e);case"UserFieldIntValue":return new Ee(e);default:throw`Unknown child class name: ${t}`}}}(d||(d={}));class Ce extends f{constructor(e={}){if(super(),this._type="UserFieldDoubleValue",void 0===e.value)throw new Error("value must be present in constructor argument");this.value=e.value}}class _e extends f{constructor(e={}){if(super(),this._type="UserFieldStringValue",void 0===e.value)throw new Error("value must be present in constructor argument");this.value=e.value}}class Ee extends f{constructor(e={}){if(super(),this._type="UserFieldIntValue",void 0===e.value)throw new Error("value must be present in constructor argument");this.value=e.value}}class be extends f{constructor(e={}){if(super(),void 0===e.tag)throw new Error("tag must be present in constructor argument");if(this.tag=e.tag,void 0===e.name)throw new Error("name must be present in constructor argument");if(this.name=e.name,void 0===e.value)throw new Error("value must be present in constructor argument");this.value=d.From(e.value)}}class xe extends f{constructor(e={}){super(),this.compression="LZW",this.jpegQuality=80,this.zipCompressionLevel=6,this.dpi=72,this.userFields=[],this.binarizationFilter=null,void 0!==e.compression&&(this.compression=e.compression),void 0!==e.jpegQuality&&(this.jpegQuality=e.jpegQuality),void 0!==e.zipCompressionLevel&&(this.zipCompressionLevel=e.zipCompressionLevel),void 0!==e.dpi&&(this.dpi=e.dpi),void 0!==e.userFields&&(this.userFields=e.userFields.map((e=>new be(e)))),void 0!==e.binarizationFilter&&(this.binarizationFilter=null!=e.binarizationFilter?n.From(e.binarizationFilter):null)}}(h=xe||(xe={})).defaultCompression="LZW",h.binaryDocumentOptimizedCompression="CCITTFAX4";var Fe=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};let De;class Te extends Error{}class Se{constructor(e){this.id=e}}const Ae={};function ke(e){const t=Math.random().toString(36);return Ae[t]=e,new Se(t)}function Pe(e){if(!Ae.hasOwnProperty(e.id))throw new Error(`Object ${e.id} does not exist`);return Ae[e.id]}function Me(e){const t=Pe(e);t.delete&&t.delete(),delete Ae[e.id]}const Re={initialize:function(e,t,n,i,o){return Fe(this,void 0,void 0,(function*(){try{const{captureConsole:a,jpegQuality:s=80,requestSuffix:u=""}=o||{};a&&(console.log=function(...e){self.postMessage({log:e})},console.error=function(...e){self.postMessage({logError:e})});const c=r(2),l=r(3),d={locateFile:function(e,r){let n;return n=t?Object(m.c)(t)?t:"":i,e.endsWith(".worker.js")&&l?l.default:new URL(n+e+u,location.href).href}},h=Object(m.b)(o),f=h.includes("-threads");d.mainScriptUrlOrBlob=d.locateFile(`ScanbotSDK.Asm${h}.js`);let p;if(!!navigator.userAgentData&&navigator.userAgentData.brands.some((e=>"Chromium"===e.brand))&&f){let e=[2147483648,805306368,536870912],t=134217728;const r=["barcode-scanner"],n=67108864;"undefined"!=typeof SCANBOTSDK_FLAVOR&&r.includes(SCANBOTSDK_FLAVOR)&&(t=n,e.push(4*n));for(let r=0;r<e.length;r++){const n=e[r];try{p=new WebAssembly.Memory({initial:0,maximum:n/65536,shared:!0}),p.grow(t/65536);break}catch(t){if(r===e.length-1)throw t}}}return p&&(d.wasmMemory=p),d.onAbort=function(e){const t="\nNo further calls to the SDK are possible until you destroy and reinitialize the SDK.";throw new Te("OOM"===e?"ScanbotSDK ran out of memory. "+t:"ScanbotSDK ran into an unexpected error: "+e+t)},yield c(d),De=d,De.initialize(e||"",n,s)}catch(e){throw console.error(e),e}}))},getLicenseInfo:function(){return Fe(this,void 0,void 0,(function*(){return De.getLicenseInfo()}))},encodeJpeg:function(e){return Fe(this,void 0,void 0,(function*(){const t=ze(e);return Oe(De.encodeJpeg(t))}))},detectDocument:function(e,t){return Fe(this,void 0,void 0,(function*(){const r=new De.DocumentDetector(new k(t)),n=r.detect(ze(e));return r.delete(),Oe(n)}))},detectAndCropDocument:function(e){return Fe(this,void 0,void 0,(function*(){let t=Oe(De.detectAndCropDocument(ze(e)));return null===t.originalImage&&(t.originalImage=e),t}))},createDocumentDetector:function(e){return Fe(this,void 0,void 0,(function*(){return ke(new De.DocumentDetector(new k(e)))}))},documentDetectorDetect:function(e,t){return Fe(this,void 0,void 0,(function*(){return $e(Pe(e).detect(ze(t)),t)}))},parseBarcodeDocument:function(e,t){return Fe(this,void 0,void 0,(function*(){return Oe(De.parseBarcodeDocument(e,t))}))},createBarcodeRecognizer:function(e){return Fe(this,void 0,void 0,(function*(){return ke(new De.BarcodeRecognizer(new he(e)))}))},recognizeBarcodes:function(e,t){return Fe(this,void 0,void 0,(function*(){return $e(Pe(e).recognize(ze(t)),t)}))},beginPdf:function(e){return Fe(this,void 0,void 0,(function*(){return ke(new De.PdfGenerationContext(new g(e)))}))},addPageToPdf:function(e,t){return Fe(this,void 0,void 0,(function*(){Oe(Pe(e).addPage(ze(t)))}))},completePdf:function(e){return Fe(this,void 0,void 0,(function*(){try{const t=Pe(e);return Oe(t.complete())}finally{Me(e)}}))},beginTiff:function(e){return Fe(this,void 0,void 0,(function*(){const t=new De.TiffGenerationContext(new xe(e));return Oe(t.begin()),ke(t)}))},addPageToTiff:function(e,t,r){return Fe(this,void 0,void 0,(function*(){return Oe(Pe(e).addPage(ze(t),r))}))},completeTiff:function(e){return Fe(this,void 0,void 0,(function*(){try{const t=Pe(e);return Oe(t.complete())}finally{Me(e)}}))},createMRZRecognizer:function(e){return Fe(this,void 0,void 0,(function*(){return ke(new De.MrzRecognizerContext(new y(e)))}))},recognizeMRZ:function(e,t){return Fe(this,void 0,void 0,(function*(){return $e(Pe(e).recognize(ze(t)),t)}))},releaseObject:function(e){return Fe(this,void 0,void 0,(function*(){Me(e)}))},createOcrEngine:function(){return Fe(this,void 0,void 0,(function*(){return ke(new De.TLDROcrContext)}))},performOcr:function(e,t){return Fe(this,void 0,void 0,(function*(){return Oe(Pe(e).performOcr(ze(t)))}))},createGenericTextLineScanner:function(e){return Fe(this,void 0,void 0,(function*(){return ke(new De.GenericTextLineScanner(new O(e)))}))},recognizeTextLine:function(e,t){return Fe(this,void 0,void 0,(function*(){return $e(Pe(e).recognize(ze(t)),t)}))},cleanTextLineRecognitionQueue:function(e){return Fe(this,void 0,void 0,(function*(){Pe(e).cleanRecognitionQueue()}))},createDocumentQualityAnalyzer:function(e){return Fe(this,void 0,void 0,(function*(){return ke(new De.DocumentQualityAnalyzer(new C(e)))}))},documentQualityAnalyzerAnalyze:function(e,t){return Fe(this,void 0,void 0,(function*(){return Oe(Pe(e).analyze(ze(t)))}))},imageApplyFilter:function(e,t){return Fe(this,void 0,void 0,(function*(){return Oe(De.imageApplyFilter(ze(e),n.From(t)))}))},imageCrop:function(e,t){return Fe(this,void 0,void 0,(function*(){return Oe(De.imageCrop(ze(e),t))}))},imageResize:function(e,t){return Fe(this,void 0,void 0,(function*(){return Oe(De.imageResize(ze(e),t))}))},imageRotate:function(e,t){return Fe(this,void 0,void 0,(function*(){return Oe(De.imageRotate(ze(e),t))}))},genericDocumentRecognizerCreate:function(e){return Fe(this,void 0,void 0,(function*(){return ke(new De.GenericDocumentRecognizer(new we(e)))}))},genericDocumentRecognizerRecognize:function(e,t,r){return Fe(this,void 0,void 0,(function*(){return $e(Pe(e).recognize(ze(t),new ve(r)),t)}))},version:function(){return Fe(this,void 0,void 0,(function*(){return"6.0.0-dev.3"}))},__hasModuleFunction:function(e){return Fe(this,void 0,void 0,(function*(){return De.hasOwnProperty(e)}))},__callModuleFunction:function(e,t=[]){return Fe(this,void 0,void 0,(function*(){return De[e](...t)}))}};function Oe(e){if(e.errorMessage)throw new Error(e.errorMessage);return e.result}function $e(e,t){return Object.assign(Object.assign({},Oe(e)),{originalImage:t})}function ze(e){if(!e)throw new Error("null image data or buffer");if("format"in e&&"string"==typeof e.format)return e;if("width"in e&&"number"==typeof e.width)return{data:e.data,width:e.width,height:e.height,format:"",step:0};return{data:ArrayBuffer.isView(e)?e:new Uint8Array(e),width:-1,height:-1,format:"",step:0}}onmessage=function(e){const{command:t,args:r,ticket:n}=e.data;De||"initialize"===t?(()=>Fe(this,void 0,void 0,(function*(){return yield Re[t].apply(null,r)})))().then((e=>{const t=Object(m.a)(e);self.postMessage({ticket:n,result:e},t)})).catch((e=>{if(e instanceof Te)self.postMessage({ticket:n,unrecoverableError:e});else{const t="number"==typeof e?Error(De.stringFromException(e)):e;console.error(t),self.postMessage({ticket:n,recoverableError:t})}})):self.postMessage({ticket:n,error:new Error("WASM module not loaded yet.")})}}]);
|