pdfjs-dist 2.1.266 → 2.5.207
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.
Potentially problematic release.
This version of pdfjs-dist might be problematic. Click here for more details.
- package/CODE_OF_CONDUCT.md +15 -0
- package/README.md +4 -0
- package/bower.json +1 -1
- package/build/pdf.js +8382 -18492
- package/build/pdf.js.map +1 -1
- package/build/pdf.min.js +22 -1
- package/build/pdf.worker.entry.js +5 -3
- package/build/pdf.worker.js +20417 -29816
- package/build/pdf.worker.js.map +1 -1
- package/build/pdf.worker.min.js +22 -1
- package/es5/build/pdf.js +25688 -0
- package/es5/build/pdf.js.map +1 -0
- package/{lib/shared/global_scope.js → es5/build/pdf.worker.entry.js} +5 -10
- package/es5/build/pdf.worker.js +58239 -0
- package/es5/build/pdf.worker.js.map +1 -0
- package/es5/web/images/annotation-check.svg +11 -0
- package/es5/web/images/annotation-comment.svg +16 -0
- package/es5/web/images/annotation-help.svg +26 -0
- package/es5/web/images/annotation-insert.svg +10 -0
- package/es5/web/images/annotation-key.svg +11 -0
- package/es5/web/images/annotation-newparagraph.svg +11 -0
- package/es5/web/images/annotation-noicon.svg +7 -0
- package/es5/web/images/annotation-note.svg +42 -0
- package/es5/web/images/annotation-paragraph.svg +16 -0
- package/es5/web/images/loading-icon.gif +0 -0
- package/es5/web/images/shadow.png +0 -0
- package/es5/web/images/texture.png +0 -0
- package/es5/web/pdf_viewer.css +403 -0
- package/es5/web/pdf_viewer.js +7742 -0
- package/es5/web/pdf_viewer.js.map +1 -0
- package/image_decoders/pdf.image_decoders.js +1475 -4897
- package/image_decoders/pdf.image_decoders.js.map +1 -1
- package/image_decoders/pdf.image_decoders.min.js +22 -1
- package/lib/README.md +7 -0
- package/lib/core/annotation.js +750 -899
- package/lib/core/arithmetic_decoder.js +81 -97
- package/lib/core/bidi.js +54 -46
- package/lib/core/ccitt.js +88 -81
- package/lib/core/ccitt_stream.js +15 -14
- package/lib/core/cff_parser.js +235 -183
- package/lib/core/charsets.js +4 -4
- package/lib/core/chunked_stream.js +447 -542
- package/lib/core/cmap.js +222 -264
- package/lib/core/colorspace.js +699 -863
- package/lib/core/core_utils.js +152 -0
- package/lib/core/crypto.js +379 -437
- package/lib/core/document.js +573 -660
- package/lib/core/encodings.js +15 -15
- package/lib/core/evaluator.js +1103 -868
- package/lib/core/font_renderer.js +135 -178
- package/lib/core/fonts.js +570 -491
- package/lib/core/function.js +291 -288
- package/lib/core/glyphlist.js +4527 -4526
- package/lib/core/image.js +145 -149
- package/lib/core/image_utils.js +170 -0
- package/lib/core/jbig2.js +325 -316
- package/lib/core/jbig2_stream.js +18 -17
- package/lib/core/jpeg_stream.js +21 -26
- package/lib/core/jpg.js +284 -232
- package/lib/core/jpx.js +161 -143
- package/lib/core/jpx_stream.js +28 -28
- package/lib/core/metrics.js +2929 -2929
- package/lib/core/murmurhash3.js +90 -101
- package/lib/core/obj.js +1183 -1157
- package/lib/core/operator_list.js +99 -67
- package/lib/core/parser.js +972 -911
- package/lib/core/pattern.js +87 -70
- package/lib/core/pdf_manager.js +150 -315
- package/lib/core/primitives.js +83 -56
- package/lib/core/ps_parser.js +175 -214
- package/lib/core/standard_fonts.js +237 -236
- package/lib/core/stream.js +94 -74
- package/lib/core/type1_parser.js +87 -69
- package/lib/core/unicode.js +1654 -1654
- package/lib/core/worker.js +193 -390
- package/lib/core/worker_stream.js +168 -0
- package/lib/display/annotation_layer.js +741 -972
- package/lib/display/api.js +1500 -1791
- package/lib/display/api_compatibility.js +12 -17
- package/lib/display/canvas.js +165 -165
- package/lib/display/content_disposition.js +40 -59
- package/lib/display/display_utils.js +515 -0
- package/lib/display/fetch_stream.js +183 -298
- package/lib/display/font_loader.js +273 -413
- package/lib/display/metadata.js +86 -98
- package/lib/display/network.js +266 -359
- package/lib/display/network_utils.js +25 -18
- package/lib/display/node_stream.js +285 -458
- package/lib/display/pattern_helper.js +113 -65
- package/lib/display/svg.js +1166 -901
- package/lib/display/text_layer.js +156 -132
- package/lib/display/transport_stream.js +262 -278
- package/lib/display/webgl.js +70 -83
- package/lib/display/worker_options.js +3 -3
- package/lib/display/xml_parser.js +303 -392
- package/lib/examples/node/domstubs.js +40 -37
- package/lib/pdf.js +226 -59
- package/lib/pdf.worker.js +14 -6
- package/lib/shared/compatibility.js +3 -246
- package/lib/shared/is_node.js +7 -6
- package/lib/shared/message_handler.js +327 -332
- package/lib/shared/util.js +266 -416
- package/lib/test/unit/annotation_spec.js +1555 -701
- package/lib/test/unit/api_spec.js +802 -604
- package/lib/test/unit/bidi_spec.js +7 -7
- package/lib/test/unit/cff_parser_spec.js +84 -69
- package/lib/test/unit/clitests_helper.js +7 -9
- package/lib/test/unit/cmap_spec.js +74 -76
- package/lib/test/unit/colorspace_spec.js +166 -161
- package/lib/test/unit/core_utils_spec.js +211 -0
- package/lib/test/unit/crypto_spec.js +181 -181
- package/lib/test/unit/custom_spec.js +20 -22
- package/lib/test/unit/display_svg_spec.js +34 -39
- package/lib/test/unit/display_utils_spec.js +263 -0
- package/lib/test/unit/document_spec.js +16 -21
- package/lib/test/unit/encodings_spec.js +12 -34
- package/lib/test/unit/evaluator_spec.js +83 -83
- package/lib/test/unit/fetch_stream_spec.js +111 -0
- package/lib/test/unit/function_spec.js +206 -204
- package/lib/test/unit/jasmine-boot.js +46 -30
- package/lib/test/unit/message_handler_spec.js +173 -159
- package/lib/test/unit/metadata_spec.js +69 -69
- package/lib/test/unit/murmurhash3_spec.js +12 -12
- package/lib/test/unit/network_spec.js +13 -61
- package/lib/test/unit/network_utils_spec.js +183 -119
- package/lib/test/unit/node_stream_spec.js +78 -92
- package/lib/test/unit/parser_spec.js +172 -114
- package/lib/test/unit/pdf_find_controller_spec.js +55 -86
- package/lib/test/unit/pdf_find_utils_spec.js +32 -32
- package/lib/test/unit/pdf_history_spec.js +32 -32
- package/lib/test/unit/primitives_spec.js +140 -125
- package/lib/test/unit/stream_spec.js +16 -14
- package/lib/test/unit/test_utils.js +131 -143
- package/lib/test/unit/testreporter.js +19 -19
- package/lib/test/unit/type1_parser_spec.js +42 -42
- package/lib/test/unit/ui_utils_spec.js +297 -459
- package/lib/test/unit/unicode_spec.js +38 -38
- package/lib/test/unit/util_spec.js +121 -305
- package/lib/web/annotation_layer_builder.js +66 -103
- package/lib/web/app.js +1328 -1214
- package/lib/web/app_options.js +105 -107
- package/lib/web/base_viewer.js +824 -838
- package/lib/web/chromecom.js +165 -252
- package/lib/web/debugger.js +149 -205
- package/lib/web/download_manager.js +39 -55
- package/lib/web/firefox_print_service.js +37 -27
- package/lib/web/firefoxcom.js +212 -363
- package/lib/web/genericcom.js +26 -108
- package/lib/web/genericl10n.js +24 -153
- package/lib/web/grab_to_pan.js +32 -30
- package/lib/web/interfaces.js +80 -254
- package/lib/web/overlay_manager.js +70 -246
- package/lib/web/password_prompt.js +38 -64
- package/lib/web/pdf_attachment_viewer.js +113 -131
- package/lib/web/pdf_cursor_tools.js +75 -102
- package/lib/web/pdf_document_properties.js +221 -306
- package/lib/web/pdf_find_bar.js +136 -170
- package/lib/web/pdf_find_controller.js +491 -548
- package/lib/web/pdf_find_utils.js +13 -13
- package/lib/web/pdf_history.js +397 -406
- package/lib/web/pdf_link_service.js +304 -348
- package/lib/web/pdf_outline_viewer.js +140 -175
- package/lib/web/pdf_page_view.js +452 -523
- package/lib/web/pdf_presentation_mode.js +308 -357
- package/lib/web/pdf_print_service.js +90 -104
- package/lib/web/pdf_rendering_queue.js +84 -108
- package/lib/web/pdf_sidebar.js +276 -306
- package/lib/web/pdf_sidebar_resizer.js +92 -119
- package/lib/web/pdf_single_page_viewer.js +77 -126
- package/lib/web/pdf_thumbnail_view.js +276 -297
- package/lib/web/pdf_thumbnail_viewer.js +186 -206
- package/lib/web/pdf_viewer.component.js +20 -21
- package/lib/web/pdf_viewer.js +55 -115
- package/lib/web/preferences.js +82 -286
- package/lib/web/secondary_toolbar.js +164 -196
- package/lib/web/text_layer_builder.js +282 -339
- package/lib/web/toolbar.js +217 -210
- package/lib/web/ui_utils.js +267 -420
- package/lib/web/view_history.js +52 -226
- package/lib/web/viewer_compatibility.js +21 -6
- package/package.json +2 -9
- package/web/pdf_viewer.css +35 -25
- package/web/pdf_viewer.js +3489 -4855
- package/web/pdf_viewer.js.map +1 -1
- package/webpack.js +14 -5
- package/external/streams/streams-lib.js +0 -3962
- package/external/url/url-lib.js +0 -627
- package/lib/display/dom_utils.js +0 -494
- package/lib/shared/streams_polyfill.js +0 -43
- package/lib/shared/url_polyfill.js +0 -56
- package/lib/test/unit/dom_utils_spec.js +0 -89
@@ -1 +1,22 @@
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("pdfjs-dist/image_decoders/pdf.image_decoders",[],e):"object"==typeof exports?exports["pdfjs-dist/image_decoders/pdf.image_decoders"]=e():t["pdfjs-dist/image_decoders/pdf.image_decoders"]=t.pdfjsImageDecoders=e()}(this,function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"getVerbosityLevel",{enumerable:!0,get:function(){return r.getVerbosityLevel}}),Object.defineProperty(e,"setVerbosityLevel",{enumerable:!0,get:function(){return r.setVerbosityLevel}}),Object.defineProperty(e,"Jbig2mage",{enumerable:!0,get:function(){return i.Jbig2mage}}),Object.defineProperty(e,"JpegImage",{enumerable:!0,get:function(){return o.JpegImage}}),Object.defineProperty(e,"JpxImage",{enumerable:!0,get:function(){return s.JpxImage}});var r=n(1),i=n(132),o=n(135),s=n(136)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toRomanNumerals=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];f(Number.isInteger(t)&&t>0,"The number should be a positive integer.");var n,r=[];for(;t>=1e3;)t-=1e3,r.push("M");n=t/100|0,t%=100,r.push(T[n]),n=t/10|0,t%=10,r.push(T[10+n]),r.push(T[20+t]);var i=r.join("");return e?i.toLowerCase():i},e.arrayByteLength=P,e.arraysToBytes=function(t){if(1===t.length&&t[0]instanceof Uint8Array)return t[0];var e,n,r,i=0,o=t.length;for(e=0;e<o;e++)n=t[e],r=P(n),i+=r;var s=0,a=new Uint8Array(i);for(e=0;e<o;e++)(n=t[e])instanceof Uint8Array||(n="string"==typeof n?S(n):new Uint8Array(n)),r=n.byteLength,a.set(n,s),s+=r;return a},e.assert=f,e.bytesToString=function(t){f(null!==t&&"object"===o(t)&&void 0!==t.length,"Invalid argument for bytesToString");var e=t.length;if(e<8192)return String.fromCharCode.apply(null,t);for(var n=[],r=0;r<e;r+=8192){var i=Math.min(r+8192,e),s=t.subarray(r,i);n.push(String.fromCharCode.apply(null,s))}return n.join("")},e.createPromiseCapability=function(){var t=Object.create(null),e=!1;return Object.defineProperty(t,"settled",{get:function(){return e}}),t.promise=new Promise(function(n,r){t.resolve=function(t){e=!0,n(t)},t.reject=function(t){e=!0,r(t)}}),t},e.deprecated=function(t){console.log("Deprecated API usage: "+t)},e.getInheritableProperty=function(t){var e,n=t.dict,r=t.key,i=t.getArray,o=void 0!==i&&i,s=t.stopWhenFound,a=void 0===s||s,u=0;for(;n;){var f=o?n.getArray(r):n.get(r);if(void 0!==f){if(a)return f;e||(e=[]),e.push(f)}if(++u>100){c('getInheritableProperty: maximum loop count exceeded for "'.concat(r,'"'));break}n=n.get("Parent")}return e},e.getLookupTableFactory=function(t){var e;return function(){return t&&(e=Object.create(null),t(e),t=null),e}},e.getVerbosityLevel=function(){return a},e.info=function(t){a>=s.INFOS&&console.log("Info: "+t)},e.isArrayBuffer=function(t){return"object"===o(t)&&null!==t&&void 0!==t.byteLength},e.isBool=function(t){return"boolean"==typeof t},e.isEmptyObj=function(t){for(var e in t)return!1;return!0},e.isNum=function(t){return"number"==typeof t},e.isString=function(t){return"string"==typeof t},e.isSpace=function(t){return 32===t||9===t||13===t||10===t},e.isSameOrigin=function(t,e){try{var n=new i.URL(t);if(!n.origin||"null"===n.origin)return!1}catch(t){return!1}var r=new i.URL(e,n);return n.origin===r.origin},e.createValidAbsoluteUrl=function(t,e){if(!t)return null;try{var n=e?new i.URL(t,e):new i.URL(t);if(function(t){if(!t)return!1;switch(t.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}(n))return n}catch(t){}return null},e.isLittleEndian=function(){var t=new Uint8Array(4);return t[0]=1,1===new Uint32Array(t.buffer,0,1)[0]},e.isEvalSupported=function(){try{return new Function(""),!0}catch(t){return!1}},e.log2=function(t){if(t<=0)return 0;return Math.ceil(Math.log2(t))},e.readInt8=function(t,e){return t[e]<<24>>24},e.readUint16=function(t,e){return t[e]<<8|t[e+1]},e.readUint32=function(t,e){return(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0},e.removeNullCharacters=function(t){if("string"!=typeof t)return c("The argument for removeNullCharacters must be a string."),t;return t.replace(x,"")},e.setVerbosityLevel=function(t){Number.isInteger(t)&&(a=t)},e.shadow=function(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!1}),n},e.string32=function(t){return String.fromCharCode(t>>24&255,t>>16&255,t>>8&255,255&t)},e.stringToBytes=S,e.stringToPDFString=function(t){var e,n=t.length,r=[];if("þ"===t[0]&&"ÿ"===t[1])for(e=2;e<n;e+=2)r.push(String.fromCharCode(t.charCodeAt(e)<<8|t.charCodeAt(e+1)));else for(e=0;e<n;++e){var i=k[t.charCodeAt(e)];r.push(i?String.fromCharCode(i):t.charAt(e))}return r.join("")},e.stringToUTF8String=function(t){return decodeURIComponent(escape(t))},e.utf8StringToString=function(t){return unescape(encodeURIComponent(t))},e.warn=c,e.unreachable=u,Object.defineProperty(e,"ReadableStream",{enumerable:!0,get:function(){return r.ReadableStream}}),Object.defineProperty(e,"URL",{enumerable:!0,get:function(){return i.URL}}),e.createObjectURL=e.FormatError=e.XRefParseException=e.XRefEntryException=e.Util=e.UnknownErrorException=e.UnexpectedResponseException=e.TextRenderingMode=e.StreamType=e.PermissionFlag=e.PasswordResponses=e.PasswordException=e.NativeImageDecoding=e.MissingPDFException=e.MissingDataException=e.InvalidPDFException=e.AbortException=e.CMapCompressionType=e.ImageKind=e.FontType=e.AnnotationType=e.AnnotationFlag=e.AnnotationFieldFlag=e.AnnotationBorderStyleType=e.UNSUPPORTED_FEATURES=e.VerbosityLevel=e.OPS=e.IDENTITY_MATRIX=e.FONT_IDENTITY_MATRIX=void 0,n(2);var r=n(130),i=n(131);function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}e.IDENTITY_MATRIX=[1,0,0,1,0,0];e.FONT_IDENTITY_MATRIX=[.001,0,0,.001,0,0];e.NativeImageDecoding={NONE:"none",DECODE:"decode",DISPLAY:"display"};e.PermissionFlag={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048};e.TextRenderingMode={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4};e.ImageKind={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3};e.AnnotationType={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26};e.AnnotationFlag={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512};e.AnnotationFieldFlag={READONLY:1,REQUIRED:2,NOEXPORT:4,MULTILINE:4096,PASSWORD:8192,NOTOGGLETOOFF:16384,RADIO:32768,PUSHBUTTON:65536,COMBO:131072,EDIT:262144,SORT:524288,FILESELECT:1048576,MULTISELECT:2097152,DONOTSPELLCHECK:4194304,DONOTSCROLL:8388608,COMB:16777216,RICHTEXT:33554432,RADIOSINUNISON:33554432,COMMITONSELCHANGE:67108864};e.AnnotationBorderStyleType={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5};e.StreamType={UNKNOWN:0,FLATE:1,LZW:2,DCT:3,JPX:4,JBIG:5,A85:6,AHX:7,CCF:8,RL:9};e.FontType={UNKNOWN:0,TYPE1:1,TYPE1C:2,CIDFONTTYPE0:3,CIDFONTTYPE0C:4,TRUETYPE:5,CIDFONTTYPE2:6,TYPE3:7,OPENTYPE:8,TYPE0:9,MMTYPE1:10};var s={ERRORS:0,WARNINGS:1,INFOS:5};e.VerbosityLevel=s;e.CMapCompressionType={NONE:0,BINARY:1,STREAM:2};e.OPS={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotations:78,endAnnotations:79,beginAnnotation:80,endAnnotation:81,paintJpegXObject:82,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91};e.UNSUPPORTED_FEATURES={unknown:"unknown",forms:"forms",javaScript:"javaScript",smask:"smask",shadingPattern:"shadingPattern",font:"font"};e.PasswordResponses={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};var a=s.WARNINGS;function c(t){a>=s.WARNINGS&&console.log("Warning: "+t)}function u(t){throw new Error(t)}function f(t,e){t||u(e)}var l=function(){function t(t,e){this.name="PasswordException",this.message=t,this.code=e}return t.prototype=new Error,t.constructor=t,t}();e.PasswordException=l;var h=function(){function t(t,e){this.name="UnknownErrorException",this.message=t,this.details=e}return t.prototype=new Error,t.constructor=t,t}();e.UnknownErrorException=h;var p=function(){function t(t){this.name="InvalidPDFException",this.message=t}return t.prototype=new Error,t.constructor=t,t}();e.InvalidPDFException=p;var d=function(){function t(t){this.name="MissingPDFException",this.message=t}return t.prototype=new Error,t.constructor=t,t}();e.MissingPDFException=d;var m=function(){function t(t,e){this.name="UnexpectedResponseException",this.message=t,this.status=e}return t.prototype=new Error,t.constructor=t,t}();e.UnexpectedResponseException=m;var g=function(){function t(t,e){this.begin=t,this.end=e,this.message="Missing data ["+t+", "+e+")"}return t.prototype=new Error,t.prototype.name="MissingDataException",t.constructor=t,t}();e.MissingDataException=g;var v=function(){function t(t){this.message=t}return t.prototype=new Error,t.prototype.name="XRefEntryException",t.constructor=t,t}();e.XRefEntryException=v;var y=function(){function t(t){this.message=t}return t.prototype=new Error,t.prototype.name="XRefParseException",t.constructor=t,t}();e.XRefParseException=y;var b=function(){function t(t){this.message=t}return t.prototype=new Error,t.prototype.name="FormatError",t.constructor=t,t}();e.FormatError=b;var w=function(){function t(t){this.name="AbortException",this.message=t}return t.prototype=new Error,t.constructor=t,t}();e.AbortException=w;var x=/\x00/g;function S(t){f("string"==typeof t,"Invalid argument for stringToBytes");for(var e=t.length,n=new Uint8Array(e),r=0;r<e;++r)n[r]=255&t.charCodeAt(r);return n}function P(t){return void 0!==t.length?t.length:(f(void 0!==t.byteLength),t.byteLength)}var C=function(){function t(){}var e=["rgb(",0,",",0,",",0,")"];return t.makeCssRgb=function(t,n,r){return e[1]=t,e[3]=n,e[5]=r,e.join("")},t.transform=function(t,e){return[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],t[0]*e[4]+t[2]*e[5]+t[4],t[1]*e[4]+t[3]*e[5]+t[5]]},t.applyTransform=function(t,e){return[t[0]*e[0]+t[1]*e[2]+e[4],t[0]*e[1]+t[1]*e[3]+e[5]]},t.applyInverseTransform=function(t,e){var n=e[0]*e[3]-e[1]*e[2];return[(t[0]*e[3]-t[1]*e[2]+e[2]*e[5]-e[4]*e[3])/n,(-t[0]*e[1]+t[1]*e[0]+e[4]*e[1]-e[5]*e[0])/n]},t.getAxialAlignedBoundingBox=function(e,n){var r=t.applyTransform(e,n),i=t.applyTransform(e.slice(2,4),n),o=t.applyTransform([e[0],e[3]],n),s=t.applyTransform([e[2],e[1]],n);return[Math.min(r[0],i[0],o[0],s[0]),Math.min(r[1],i[1],o[1],s[1]),Math.max(r[0],i[0],o[0],s[0]),Math.max(r[1],i[1],o[1],s[1])]},t.inverseTransform=function(t){var e=t[0]*t[3]-t[1]*t[2];return[t[3]/e,-t[1]/e,-t[2]/e,t[0]/e,(t[2]*t[5]-t[4]*t[3])/e,(t[4]*t[1]-t[5]*t[0])/e]},t.apply3dTransform=function(t,e){return[t[0]*e[0]+t[1]*e[1]+t[2]*e[2],t[3]*e[0]+t[4]*e[1]+t[5]*e[2],t[6]*e[0]+t[7]*e[1]+t[8]*e[2]]},t.singularValueDecompose2dScale=function(t){var e=[t[0],t[2],t[1],t[3]],n=t[0]*e[0]+t[1]*e[2],r=t[0]*e[1]+t[1]*e[3],i=t[2]*e[0]+t[3]*e[2],o=t[2]*e[1]+t[3]*e[3],s=(n+o)/2,a=Math.sqrt((n+o)*(n+o)-4*(n*o-i*r))/2,c=s+a||1,u=s-a||1;return[Math.sqrt(c),Math.sqrt(u)]},t.normalizeRect=function(t){var e=t.slice(0);return t[0]>t[2]&&(e[0]=t[2],e[2]=t[0]),t[1]>t[3]&&(e[1]=t[3],e[3]=t[1]),e},t.intersect=function(e,n){function r(t,e){return t-e}var i=[e[0],e[2],n[0],n[2]].sort(r),o=[e[1],e[3],n[1],n[3]].sort(r),s=[];return e=t.normalizeRect(e),n=t.normalizeRect(n),(i[0]===e[0]&&i[1]===n[0]||i[0]===n[0]&&i[1]===e[0])&&(s[0]=i[1],s[2]=i[2],(o[0]===e[1]&&o[1]===n[1]||o[0]===n[1]&&o[1]===e[1])&&(s[1]=o[1],s[3]=o[2],s))},t}();e.Util=C;var T=["","C","CC","CCC","CD","D","DC","DCC","DCCC","CM","","X","XX","XXX","XL","L","LX","LXX","LXXX","XC","","I","II","III","IV","V","VI","VII","VIII","IX"];var k=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,728,711,710,729,733,731,730,732,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8226,8224,8225,8230,8212,8211,402,8260,8249,8250,8722,8240,8222,8220,8221,8216,8217,8218,8482,64257,64258,321,338,352,376,381,305,322,339,353,382,0,8364];var O,I=(O="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",function(t,e){if(!(arguments.length>2&&void 0!==arguments[2]&&arguments[2])&&i.URL.createObjectURL){var n=new Blob([t],{type:e});return i.URL.createObjectURL(n)}for(var r="data:"+e+";base64,",o=0,s=t.length;o<s;o+=3){var a=255&t[o],c=255&t[o+1],u=255&t[o+2];r+=O[a>>2]+O[(3&a)<<4|c>>4]+O[o+1<s?(15&c)<<2|u>>6:64]+O[o+2<s?63&u:64]}return r});e.createObjectURL=I},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=n(3);if(!i._pdfjsCompatibilityChecked){i._pdfjsCompatibilityChecked=!0;var o=n(4),s="object"===("undefined"==typeof window?"undefined":r(window))&&"object"===("undefined"==typeof document?"undefined":r(document));!i.btoa&&o()&&(i.btoa=function(t){return Buffer.from(t,"binary").toString("base64")}),!i.atob&&o()&&(i.atob=function(t){return Buffer.from(t,"base64").toString("binary")}),s&&void 0===Element.prototype.remove&&(Element.prototype.remove=function(){this.parentNode&&this.parentNode.removeChild(this)}),function(){if(s&&!o()){var t=document.createElement("div");if(t.classList.add("testOne","testTwo"),!0!==t.classList.contains("testOne")||!0!==t.classList.contains("testTwo")){var e=DOMTokenList.prototype.add,n=DOMTokenList.prototype.remove;DOMTokenList.prototype.add=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];for(var i=0;i<n.length;i++){var o=n[i];e.call(this,o)}},DOMTokenList.prototype.remove=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];for(var i=0;i<e.length;i++){var o=e[i];n.call(this,o)}}}}}(),s&&!o()&&!1!==document.createElement("div").classList.toggle("test",0)&&(DOMTokenList.prototype.toggle=function(t){var e=arguments.length>1?!!arguments[1]:!this.contains(t);return this[e?"add":"remove"](t),e}),String.prototype.startsWith||n(5),String.prototype.endsWith||n(35),String.prototype.includes||n(37),Array.prototype.includes||n(39),Array.from||n(46),Object.assign||n(69),Math.log2||(Math.log2=n(74)),Number.isNaN||(Number.isNaN=n(76)),Number.isInteger||(Number.isInteger=n(78)),i.WeakMap||(i.WeakMap=n(81)),i.WeakSet||(i.WeakSet=n(105)),String.codePointAt||(String.codePointAt=n(109)),String.fromCodePoint||(String.fromCodePoint=n(111)),i.Symbol||n(113),String.prototype.padStart||n(120),String.prototype.padEnd||n(125),Object.values||(Object.values=n(127))}},function(t,e,n){"use strict";t.exports="undefined"!=typeof window&&window.Math===Math?window:"undefined"!=typeof global&&global.Math===Math?global:"undefined"!=typeof self&&self.Math===Math?self:{}},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}t.exports=function(){return"object"===("undefined"==typeof process?"undefined":r(process))&&process+""=="[object process]"&&!process.versions.nw}},function(t,e,n){"use strict";n(6),t.exports=n(9).String.startsWith},function(t,e,n){"use strict";var r=n(7),i=n(25),o=n(27),s="".startsWith;r(r.P+r.F*n(34)("startsWith"),"String",{startsWith:function(t){var e=o(this,t,"startsWith"),n=i(Math.min(arguments.length>1?arguments[1]:void 0,e.length)),r=String(t);return s?s.call(e,r,n):e.slice(n,n+r.length)===r}})},function(t,e,n){"use strict";var r=n(8),i=n(9),o=n(10),s=n(20),a=n(23),c=function t(e,n,c){var u,f,l,h,p=e&t.F,d=e&t.G,m=e&t.P,g=e&t.B,v=d?r:e&t.S?r[n]||(r[n]={}):(r[n]||{}).prototype,y=d?i:i[n]||(i[n]={}),b=y.prototype||(y.prototype={});for(u in d&&(c=n),c)l=((f=!p&&v&&void 0!==v[u])?v:c)[u],h=g&&f?a(l,r):m&&"function"==typeof l?a(Function.call,l):l,v&&s(v,u,l,e&t.U),y[u]!=l&&o(y,u,h),m&&b[u]!=l&&(b[u]=l)};r.core=i,c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,t.exports=c},function(t,e,n){"use strict";var r=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=r)},function(t,e,n){"use strict";var r=t.exports={version:"2.6.2"};"number"==typeof __e&&(__e=r)},function(t,e,n){"use strict";var r=n(11),i=n(19);t.exports=n(15)?function(t,e,n){return r.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){"use strict";var r=n(12),i=n(14),o=n(18),s=Object.defineProperty;e.f=n(15)?Object.defineProperty:function(t,e,n){if(r(t),e=o(e,!0),r(n),i)try{return s(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e,n){"use strict";var r=n(13);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}t.exports=function(t){return"object"===r(t)?null!==t:"function"==typeof t}},function(t,e,n){"use strict";t.exports=!n(15)&&!n(16)(function(){return 7!=Object.defineProperty(n(17)("div"),"a",{get:function(){return 7}}).a})},function(t,e,n){"use strict";t.exports=!n(16)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e,n){"use strict";t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,n){"use strict";var r=n(13),i=n(8).document,o=r(i)&&r(i.createElement);t.exports=function(t){return o?i.createElement(t):{}}},function(t,e,n){"use strict";var r=n(13);t.exports=function(t,e){if(!r(t))return t;var n,i;if(e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;if("function"==typeof(n=t.valueOf)&&!r(i=n.call(t)))return i;if(!e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},function(t,e,n){"use strict";t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,n){"use strict";var r=n(8),i=n(10),o=n(21),s=n(22)("src"),a=Function.toString,c=(""+a).split("toString");n(9).inspectSource=function(t){return a.call(t)},(t.exports=function(t,e,n,a){var u="function"==typeof n;u&&(o(n,"name")||i(n,"name",e)),t[e]!==n&&(u&&(o(n,s)||i(n,s,t[e]?""+t[e]:c.join(String(e)))),t===r?t[e]=n:a?t[e]?t[e]=n:i(t,e,n):(delete t[e],i(t,e,n)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[s]||a.call(this)})},function(t,e,n){"use strict";var r={}.hasOwnProperty;t.exports=function(t,e){return r.call(t,e)}},function(t,e,n){"use strict";var r=0,i=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++r+i).toString(36))}},function(t,e,n){"use strict";var r=n(24);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)}}return function(){return t.apply(e,arguments)}}},function(t,e,n){"use strict";t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,n){"use strict";var r=n(26),i=Math.min;t.exports=function(t){return t>0?i(r(t),9007199254740991):0}},function(t,e,n){"use strict";var r=Math.ceil,i=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?i:r)(t)}},function(t,e,n){"use strict";var r=n(28),i=n(33);t.exports=function(t,e,n){if(r(e))throw TypeError("String#"+n+" doesn't accept regex!");return String(i(t))}},function(t,e,n){"use strict";var r=n(13),i=n(29),o=n(30)("match");t.exports=function(t){var e;return r(t)&&(void 0!==(e=t[o])?!!e:"RegExp"==i(t))}},function(t,e,n){"use strict";var r={}.toString;t.exports=function(t){return r.call(t).slice(8,-1)}},function(t,e,n){"use strict";var r=n(31)("wks"),i=n(22),o=n(8).Symbol,s="function"==typeof o;(t.exports=function(t){return r[t]||(r[t]=s&&o[t]||(s?o:i)("Symbol."+t))}).store=r},function(t,e,n){"use strict";var r=n(9),i=n(8),o=i["__core-js_shared__"]||(i["__core-js_shared__"]={});(t.exports=function(t,e){return o[t]||(o[t]=void 0!==e?e:{})})("versions",[]).push({version:r.version,mode:n(32)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(t,e,n){"use strict";t.exports=!1},function(t,e,n){"use strict";t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,n){"use strict";var r=n(30)("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[r]=!1,!"/./"[t](e)}catch(t){}}return!0}},function(t,e,n){"use strict";n(36),t.exports=n(9).String.endsWith},function(t,e,n){"use strict";var r=n(7),i=n(25),o=n(27),s="".endsWith;r(r.P+r.F*n(34)("endsWith"),"String",{endsWith:function(t){var e=o(this,t,"endsWith"),n=arguments.length>1?arguments[1]:void 0,r=i(e.length),a=void 0===n?r:Math.min(i(n),r),c=String(t);return s?s.call(e,c,a):e.slice(a-c.length,a)===c}})},function(t,e,n){"use strict";n(38),t.exports=n(9).String.includes},function(t,e,n){"use strict";var r=n(7),i=n(27);r(r.P+r.F*n(34)("includes"),"String",{includes:function(t){return!!~i(this,t,"includes").indexOf(t,arguments.length>1?arguments[1]:void 0)}})},function(t,e,n){"use strict";n(40),t.exports=n(9).Array.includes},function(t,e,n){"use strict";var r=n(7),i=n(41)(!0);r(r.P,"Array",{includes:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),n(45)("includes")},function(t,e,n){"use strict";var r=n(42),i=n(25),o=n(44);t.exports=function(t){return function(e,n,s){var a,c=r(e),u=i(c.length),f=o(s,u);if(t&&n!=n){for(;u>f;)if((a=c[f++])!=a)return!0}else for(;u>f;f++)if((t||f in c)&&c[f]===n)return t||f||0;return!t&&-1}}},function(t,e,n){"use strict";var r=n(43),i=n(33);t.exports=function(t){return r(i(t))}},function(t,e,n){"use strict";var r=n(29);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},function(t,e,n){"use strict";var r=n(26),i=Math.max,o=Math.min;t.exports=function(t,e){return(t=r(t))<0?i(t+e,0):o(t,e)}},function(t,e,n){"use strict";var r=n(30)("unscopables"),i=Array.prototype;null==i[r]&&n(10)(i,r,{}),t.exports=function(t){i[r][t]=!0}},function(t,e,n){"use strict";n(47),n(62),t.exports=n(9).Array.from},function(t,e,n){"use strict";var r=n(48)(!0);n(49)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=r(e,n),this._i+=t.length,{value:t,done:!1})})},function(t,e,n){"use strict";var r=n(26),i=n(33);t.exports=function(t){return function(e,n){var o,s,a=String(i(e)),c=r(n),u=a.length;return c<0||c>=u?t?"":void 0:(o=a.charCodeAt(c))<55296||o>56319||c+1===u||(s=a.charCodeAt(c+1))<56320||s>57343?t?a.charAt(c):o:t?a.slice(c,c+2):s-56320+(o-55296<<10)+65536}}},function(t,e,n){"use strict";var r=n(32),i=n(7),o=n(20),s=n(10),a=n(50),c=n(51),u=n(59),f=n(60),l=n(30)("iterator"),h=!([].keys&&"next"in[].keys()),p=function(){return this};t.exports=function(t,e,n,d,m,g,v){c(n,e,d);var y,b,w,x=function(t){if(!h&&t in T)return T[t];switch(t){case"keys":case"values":return function(){return new n(this,t)}}return function(){return new n(this,t)}},S=e+" Iterator",P="values"==m,C=!1,T=t.prototype,k=T[l]||T["@@iterator"]||m&&T[m],O=k||x(m),I=m?P?x("entries"):O:void 0,E="Array"==e&&T.entries||k;if(E&&(w=f(E.call(new t)))!==Object.prototype&&w.next&&(u(w,S,!0),r||"function"==typeof w[l]||s(w,l,p)),P&&k&&"values"!==k.name&&(C=!0,O=function(){return k.call(this)}),r&&!v||!h&&!C&&T[l]||s(T,l,O),a[e]=O,a[S]=p,m)if(y={values:P?O:x("values"),keys:g?O:x("keys"),entries:I},v)for(b in y)b in T||o(T,b,y[b]);else i(i.P+i.F*(h||C),e,y);return y}},function(t,e,n){"use strict";t.exports={}},function(t,e,n){"use strict";var r=n(52),i=n(19),o=n(59),s={};n(10)(s,n(30)("iterator"),function(){return this}),t.exports=function(t,e,n){t.prototype=r(s,{next:i(1,n)}),o(t,e+" Iterator")}},function(t,e,n){"use strict";var r=n(12),i=n(53),o=n(57),s=n(56)("IE_PROTO"),a=function(){},c=function(){var t,e=n(17)("iframe"),r=o.length;for(e.style.display="none",n(58).appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),c=t.F;r--;)delete c.prototype[o[r]];return c()};t.exports=Object.create||function(t,e){var n;return null!==t?(a.prototype=r(t),n=new a,a.prototype=null,n[s]=t):n=c(),void 0===e?n:i(n,e)}},function(t,e,n){"use strict";var r=n(11),i=n(12),o=n(54);t.exports=n(15)?Object.defineProperties:function(t,e){i(t);for(var n,s=o(e),a=s.length,c=0;a>c;)r.f(t,n=s[c++],e[n]);return t}},function(t,e,n){"use strict";var r=n(55),i=n(57);t.exports=Object.keys||function(t){return r(t,i)}},function(t,e,n){"use strict";var r=n(21),i=n(42),o=n(41)(!1),s=n(56)("IE_PROTO");t.exports=function(t,e){var n,a=i(t),c=0,u=[];for(n in a)n!=s&&r(a,n)&&u.push(n);for(;e.length>c;)r(a,n=e[c++])&&(~o(u,n)||u.push(n));return u}},function(t,e,n){"use strict";var r=n(31)("keys"),i=n(22);t.exports=function(t){return r[t]||(r[t]=i(t))}},function(t,e,n){"use strict";t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,n){"use strict";var r=n(8).document;t.exports=r&&r.documentElement},function(t,e,n){"use strict";var r=n(11).f,i=n(21),o=n(30)("toStringTag");t.exports=function(t,e,n){t&&!i(t=n?t:t.prototype,o)&&r(t,o,{configurable:!0,value:e})}},function(t,e,n){"use strict";var r=n(21),i=n(61),o=n(56)("IE_PROTO"),s=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=i(t),r(t,o)?t[o]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?s:null}},function(t,e,n){"use strict";var r=n(33);t.exports=function(t){return Object(r(t))}},function(t,e,n){"use strict";var r=n(23),i=n(7),o=n(61),s=n(63),a=n(64),c=n(25),u=n(65),f=n(66);i(i.S+i.F*!n(68)(function(t){Array.from(t)}),"Array",{from:function(t){var e,n,i,l,h=o(t),p="function"==typeof this?this:Array,d=arguments.length,m=d>1?arguments[1]:void 0,g=void 0!==m,v=0,y=f(h);if(g&&(m=r(m,d>2?arguments[2]:void 0,2)),null==y||p==Array&&a(y))for(n=new p(e=c(h.length));e>v;v++)u(n,v,g?m(h[v],v):h[v]);else for(l=y.call(h),n=new p;!(i=l.next()).done;v++)u(n,v,g?s(l,m,[i.value,v],!0):i.value);return n.length=v,n}})},function(t,e,n){"use strict";var r=n(12);t.exports=function(t,e,n,i){try{return i?e(r(n)[0],n[1]):e(n)}catch(e){var o=t.return;throw void 0!==o&&r(o.call(t)),e}}},function(t,e,n){"use strict";var r=n(50),i=n(30)("iterator"),o=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||o[i]===t)}},function(t,e,n){"use strict";var r=n(11),i=n(19);t.exports=function(t,e,n){e in t?r.f(t,e,i(0,n)):t[e]=n}},function(t,e,n){"use strict";var r=n(67),i=n(30)("iterator"),o=n(50);t.exports=n(9).getIteratorMethod=function(t){if(null!=t)return t[i]||t["@@iterator"]||o[r(t)]}},function(t,e,n){"use strict";var r=n(29),i=n(30)("toStringTag"),o="Arguments"==r(function(){return arguments}());t.exports=function(t){var e,n,s;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),i))?n:o?r(e):"Object"==(s=r(e))&&"function"==typeof e.callee?"Arguments":s}},function(t,e,n){"use strict";var r=n(30)("iterator"),i=!1;try{var o=[7][r]();o.return=function(){i=!0},Array.from(o,function(){throw 2})}catch(t){}t.exports=function(t,e){if(!e&&!i)return!1;var n=!1;try{var o=[7],s=o[r]();s.next=function(){return{done:n=!0}},o[r]=function(){return s},t(o)}catch(t){}return n}},function(t,e,n){"use strict";n(70),t.exports=n(9).Object.assign},function(t,e,n){"use strict";var r=n(7);r(r.S+r.F,"Object",{assign:n(71)})},function(t,e,n){"use strict";var r=n(54),i=n(72),o=n(73),s=n(61),a=n(43),c=Object.assign;t.exports=!c||n(16)(function(){var t={},e={},n=Symbol(),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach(function(t){e[t]=t}),7!=c({},t)[n]||Object.keys(c({},e)).join("")!=r})?function(t,e){for(var n=s(t),c=arguments.length,u=1,f=i.f,l=o.f;c>u;)for(var h,p=a(arguments[u++]),d=f?r(p).concat(f(p)):r(p),m=d.length,g=0;m>g;)l.call(p,h=d[g++])&&(n[h]=p[h]);return n}:c},function(t,e,n){"use strict";e.f=Object.getOwnPropertySymbols},function(t,e,n){"use strict";e.f={}.propertyIsEnumerable},function(t,e,n){"use strict";n(75),t.exports=n(9).Math.log2},function(t,e,n){"use strict";var r=n(7);r(r.S,"Math",{log2:function(t){return Math.log(t)/Math.LN2}})},function(t,e,n){"use strict";n(77),t.exports=n(9).Number.isNaN},function(t,e,n){"use strict";var r=n(7);r(r.S,"Number",{isNaN:function(t){return t!=t}})},function(t,e,n){"use strict";n(79),t.exports=n(9).Number.isInteger},function(t,e,n){"use strict";var r=n(7);r(r.S,"Number",{isInteger:n(80)})},function(t,e,n){"use strict";var r=n(13),i=Math.floor;t.exports=function(t){return!r(t)&&isFinite(t)&&i(t)===t}},function(t,e,n){"use strict";n(82),n(83),n(86),n(101),n(103),t.exports=n(9).WeakMap},function(t,e,n){"use strict";var r=n(67),i={};i[n(30)("toStringTag")]="z",i+""!="[object z]"&&n(20)(Object.prototype,"toString",function(){return"[object "+r(this)+"]"},!0)},function(t,e,n){"use strict";for(var r=n(84),i=n(54),o=n(20),s=n(8),a=n(10),c=n(50),u=n(30),f=u("iterator"),l=u("toStringTag"),h=c.Array,p={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},d=i(p),m=0;m<d.length;m++){var g,v=d[m],y=p[v],b=s[v],w=b&&b.prototype;if(w&&(w[f]||a(w,f,h),w[l]||a(w,l,v),c[v]=h,y))for(g in r)w[g]||o(w,g,r[g],!0)}},function(t,e,n){"use strict";var r=n(45),i=n(85),o=n(50),s=n(42);t.exports=n(49)(Array,"Array",function(t,e){this._t=s(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,i(1)):i(0,"keys"==e?n:"values"==e?t[n]:[n,t[n]])},"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},function(t,e,n){"use strict";t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e,n){"use strict";var r,i=n(87)(0),o=n(20),s=n(91),a=n(71),c=n(92),u=n(13),f=n(16),l=n(96),h=s.getWeak,p=Object.isExtensible,d=c.ufstore,m={},g=function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},v={get:function(t){if(u(t)){var e=h(t);return!0===e?d(l(this,"WeakMap")).get(t):e?e[this._i]:void 0}},set:function(t,e){return c.def(l(this,"WeakMap"),t,e)}},y=t.exports=n(97)("WeakMap",g,v,c,!0,!0);f(function(){return 7!=(new y).set((Object.freeze||Object)(m),7).get(m)})&&(a((r=c.getConstructor(g,"WeakMap")).prototype,v),s.NEED=!0,i(["delete","has","get","set"],function(t){var e=y.prototype,n=e[t];o(e,t,function(e,i){if(u(e)&&!p(e)){this._f||(this._f=new r);var o=this._f[t](e,i);return"set"==t?this:o}return n.call(this,e,i)})}))},function(t,e,n){"use strict";var r=n(23),i=n(43),o=n(61),s=n(25),a=n(88);t.exports=function(t,e){var n=1==t,c=2==t,u=3==t,f=4==t,l=6==t,h=5==t||l,p=e||a;return function(e,a,d){for(var m,g,v=o(e),y=i(v),b=r(a,d,3),w=s(y.length),x=0,S=n?p(e,w):c?p(e,0):void 0;w>x;x++)if((h||x in y)&&(g=b(m=y[x],x,v),t))if(n)S[x]=g;else if(g)switch(t){case 3:return!0;case 5:return m;case 6:return x;case 2:S.push(m)}else if(f)return!1;return l?-1:u||f?f:S}}},function(t,e,n){"use strict";var r=n(89);t.exports=function(t,e){return new(r(t))(e)}},function(t,e,n){"use strict";var r=n(13),i=n(90),o=n(30)("species");t.exports=function(t){var e;return i(t)&&("function"!=typeof(e=t.constructor)||e!==Array&&!i(e.prototype)||(e=void 0),r(e)&&null===(e=e[o])&&(e=void 0)),void 0===e?Array:e}},function(t,e,n){"use strict";var r=n(29);t.exports=Array.isArray||function(t){return"Array"==r(t)}},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=n(22)("meta"),o=n(13),s=n(21),a=n(11).f,c=0,u=Object.isExtensible||function(){return!0},f=!n(16)(function(){return u(Object.preventExtensions({}))}),l=function(t){a(t,i,{value:{i:"O"+ ++c,w:{}}})},h=t.exports={KEY:i,NEED:!1,fastKey:function(t,e){if(!o(t))return"symbol"==r(t)?t:("string"==typeof t?"S":"P")+t;if(!s(t,i)){if(!u(t))return"F";if(!e)return"E";l(t)}return t[i].i},getWeak:function(t,e){if(!s(t,i)){if(!u(t))return!0;if(!e)return!1;l(t)}return t[i].w},onFreeze:function(t){return f&&h.NEED&&u(t)&&!s(t,i)&&l(t),t}}},function(t,e,n){"use strict";var r=n(93),i=n(91).getWeak,o=n(12),s=n(13),a=n(94),c=n(95),u=n(87),f=n(21),l=n(96),h=u(5),p=u(6),d=0,m=function(t){return t._l||(t._l=new g)},g=function(){this.a=[]},v=function(t,e){return h(t.a,function(t){return t[0]===e})};g.prototype={get:function(t){var e=v(this,t);if(e)return e[1]},has:function(t){return!!v(this,t)},set:function(t,e){var n=v(this,t);n?n[1]=e:this.a.push([t,e])},delete:function(t){var e=p(this.a,function(e){return e[0]===t});return~e&&this.a.splice(e,1),!!~e}},t.exports={getConstructor:function(t,e,n,o){var u=t(function(t,r){a(t,u,e,"_i"),t._t=e,t._i=d++,t._l=void 0,null!=r&&c(r,n,t[o],t)});return r(u.prototype,{delete:function(t){if(!s(t))return!1;var n=i(t);return!0===n?m(l(this,e)).delete(t):n&&f(n,this._i)&&delete n[this._i]},has:function(t){if(!s(t))return!1;var n=i(t);return!0===n?m(l(this,e)).has(t):n&&f(n,this._i)}}),u},def:function(t,e,n){var r=i(o(e),!0);return!0===r?m(t).set(e,n):r[t._i]=n,t},ufstore:m}},function(t,e,n){"use strict";var r=n(20);t.exports=function(t,e,n){for(var i in e)r(t,i,e[i],n);return t}},function(t,e,n){"use strict";t.exports=function(t,e,n,r){if(!(t instanceof e)||void 0!==r&&r in t)throw TypeError(n+": incorrect invocation!");return t}},function(t,e,n){"use strict";var r=n(23),i=n(63),o=n(64),s=n(12),a=n(25),c=n(66),u={},f={},l=t.exports=function(t,e,n,l,h){var p,d,m,g,v=h?function(){return t}:c(t),y=r(n,l,e?2:1),b=0;if("function"!=typeof v)throw TypeError(t+" is not iterable!");if(o(v)){for(p=a(t.length);p>b;b++)if((g=e?y(s(d=t[b])[0],d[1]):y(t[b]))===u||g===f)return g}else for(m=v.call(t);!(d=m.next()).done;)if((g=i(m,y,d.value,e))===u||g===f)return g};l.BREAK=u,l.RETURN=f},function(t,e,n){"use strict";var r=n(13);t.exports=function(t,e){if(!r(t)||t._t!==e)throw TypeError("Incompatible receiver, "+e+" required!");return t}},function(t,e,n){"use strict";var r=n(8),i=n(7),o=n(20),s=n(93),a=n(91),c=n(95),u=n(94),f=n(13),l=n(16),h=n(68),p=n(59),d=n(98);t.exports=function(t,e,n,m,g,v){var y=r[t],b=y,w=g?"set":"add",x=b&&b.prototype,S={},P=function(t){var e=x[t];o(x,t,"delete"==t?function(t){return!(v&&!f(t))&&e.call(this,0===t?0:t)}:"has"==t?function(t){return!(v&&!f(t))&&e.call(this,0===t?0:t)}:"get"==t?function(t){return v&&!f(t)?void 0:e.call(this,0===t?0:t)}:"add"==t?function(t){return e.call(this,0===t?0:t),this}:function(t,n){return e.call(this,0===t?0:t,n),this})};if("function"==typeof b&&(v||x.forEach&&!l(function(){(new b).entries().next()}))){var C=new b,T=C[w](v?{}:-0,1)!=C,k=l(function(){C.has(1)}),O=h(function(t){new b(t)}),I=!v&&l(function(){for(var t=new b,e=5;e--;)t[w](e,e);return!t.has(-0)});O||((b=e(function(e,n){u(e,b,t);var r=d(new y,e,b);return null!=n&&c(n,g,r[w],r),r})).prototype=x,x.constructor=b),(k||I)&&(P("delete"),P("has"),g&&P("get")),(I||T)&&P(w),v&&x.clear&&delete x.clear}else b=m.getConstructor(e,t,g,w),s(b.prototype,n),a.NEED=!0;return p(b,t),S[t]=b,i(i.G+i.W+i.F*(b!=y),S),v||m.setStrong(b,t,g),b}},function(t,e,n){"use strict";var r=n(13),i=n(99).set;t.exports=function(t,e,n){var o,s=e.constructor;return s!==n&&"function"==typeof s&&(o=s.prototype)!==n.prototype&&r(o)&&i&&i(t,o),t}},function(t,e,n){"use strict";var r=n(13),i=n(12),o=function(t,e){if(i(t),!r(e)&&null!==e)throw TypeError(e+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,e,r){try{(r=n(23)(Function.call,n(100).f(Object.prototype,"__proto__").set,2))(t,[]),e=!(t instanceof Array)}catch(t){e=!0}return function(t,n){return o(t,n),e?t.__proto__=n:r(t,n),t}}({},!1):void 0),check:o}},function(t,e,n){"use strict";var r=n(73),i=n(19),o=n(42),s=n(18),a=n(21),c=n(14),u=Object.getOwnPropertyDescriptor;e.f=n(15)?u:function(t,e){if(t=o(t),e=s(e,!0),c)try{return u(t,e)}catch(t){}if(a(t,e))return i(!r.f.call(t,e),t[e])}},function(t,e,n){"use strict";n(102)("WeakMap")},function(t,e,n){"use strict";var r=n(7);t.exports=function(t){r(r.S,t,{of:function(){for(var t=arguments.length,e=new Array(t);t--;)e[t]=arguments[t];return new this(e)}})}},function(t,e,n){"use strict";n(104)("WeakMap")},function(t,e,n){"use strict";var r=n(7),i=n(24),o=n(23),s=n(95);t.exports=function(t){r(r.S,t,{from:function(t){var e,n,r,a,c=arguments[1];return i(this),(e=void 0!==c)&&i(c),null==t?new this:(n=[],e?(r=0,a=o(c,arguments[2],2),s(t,!1,function(t){n.push(a(t,r++))})):s(t,!1,n.push,n),new this(n))}})}},function(t,e,n){"use strict";n(82),n(83),n(106),n(107),n(108),t.exports=n(9).WeakSet},function(t,e,n){"use strict";var r=n(92),i=n(96);n(97)("WeakSet",function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},{add:function(t){return r.def(i(this,"WeakSet"),t,!0)}},r,!1,!0)},function(t,e,n){"use strict";n(102)("WeakSet")},function(t,e,n){"use strict";n(104)("WeakSet")},function(t,e,n){"use strict";n(110),t.exports=n(9).String.codePointAt},function(t,e,n){"use strict";var r=n(7),i=n(48)(!1);r(r.P,"String",{codePointAt:function(t){return i(this,t)}})},function(t,e,n){"use strict";n(112),t.exports=n(9).String.fromCodePoint},function(t,e,n){"use strict";var r=n(7),i=n(44),o=String.fromCharCode,s=String.fromCodePoint;r(r.S+r.F*(!!s&&1!=s.length),"String",{fromCodePoint:function(t){for(var e,n=[],r=arguments.length,s=0;r>s;){if(e=+arguments[s++],i(e,1114111)!==e)throw RangeError(e+" is not a valid code point");n.push(e<65536?o(e):o(55296+((e-=65536)>>10),e%1024+56320))}return n.join("")}})},function(t,e,n){"use strict";n(114),n(82),t.exports=n(9).Symbol},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=n(8),o=n(21),s=n(15),a=n(7),c=n(20),u=n(91).KEY,f=n(16),l=n(31),h=n(59),p=n(22),d=n(30),m=n(115),g=n(116),v=n(117),y=n(90),b=n(12),w=n(13),x=n(42),S=n(18),P=n(19),C=n(52),T=n(118),k=n(100),O=n(11),I=n(54),E=k.f,L=O.f,A=T.f,M=i.Symbol,_=i.JSON,D=_&&_.stringify,R=d("_hidden"),B=d("toPrimitive"),U={}.propertyIsEnumerable,N=l("symbol-registry"),F=l("symbols"),j=l("op-symbols"),z=Object.prototype,H="function"==typeof M,W=i.QObject,X=!W||!W.prototype||!W.prototype.findChild,Y=s&&f(function(){return 7!=C(L({},"a",{get:function(){return L(this,"a",{value:7}).a}})).a})?function(t,e,n){var r=E(z,e);r&&delete z[e],L(t,e,n),r&&t!==z&&L(z,e,r)}:L,q=function(t){var e=F[t]=C(M.prototype);return e._k=t,e},G=H&&"symbol"==r(M.iterator)?function(t){return"symbol"==r(t)}:function(t){return t instanceof M},V=function(t,e,n){return t===z&&V(j,e,n),b(t),e=S(e,!0),b(n),o(F,e)?(n.enumerable?(o(t,R)&&t[R][e]&&(t[R][e]=!1),n=C(n,{enumerable:P(0,!1)})):(o(t,R)||L(t,R,P(1,{})),t[R][e]=!0),Y(t,e,n)):L(t,e,n)},J=function(t,e){b(t);for(var n,r=v(e=x(e)),i=0,o=r.length;o>i;)V(t,n=r[i++],e[n]);return t},K=function(t){var e=U.call(this,t=S(t,!0));return!(this===z&&o(F,t)&&!o(j,t))&&(!(e||!o(this,t)||!o(F,t)||o(this,R)&&this[R][t])||e)},Q=function(t,e){if(t=x(t),e=S(e,!0),t!==z||!o(F,e)||o(j,e)){var n=E(t,e);return!n||!o(F,e)||o(t,R)&&t[R][e]||(n.enumerable=!0),n}},Z=function(t){for(var e,n=A(x(t)),r=[],i=0;n.length>i;)o(F,e=n[i++])||e==R||e==u||r.push(e);return r},$=function(t){for(var e,n=t===z,r=A(n?j:x(t)),i=[],s=0;r.length>s;)!o(F,e=r[s++])||n&&!o(z,e)||i.push(F[e]);return i};H||(c((M=function(){if(this instanceof M)throw TypeError("Symbol is not a constructor!");var t=p(arguments.length>0?arguments[0]:void 0);return s&&X&&Y(z,t,{configurable:!0,set:function e(n){this===z&&e.call(j,n),o(this,R)&&o(this[R],t)&&(this[R][t]=!1),Y(this,t,P(1,n))}}),q(t)}).prototype,"toString",function(){return this._k}),k.f=Q,O.f=V,n(119).f=T.f=Z,n(73).f=K,n(72).f=$,s&&!n(32)&&c(z,"propertyIsEnumerable",K,!0),m.f=function(t){return q(d(t))}),a(a.G+a.W+a.F*!H,{Symbol:M});for(var tt="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),et=0;tt.length>et;)d(tt[et++]);for(var nt=I(d.store),rt=0;nt.length>rt;)g(nt[rt++]);a(a.S+a.F*!H,"Symbol",{for:function(t){return o(N,t+="")?N[t]:N[t]=M(t)},keyFor:function(t){if(!G(t))throw TypeError(t+" is not a symbol!");for(var e in N)if(N[e]===t)return e},useSetter:function(){X=!0},useSimple:function(){X=!1}}),a(a.S+a.F*!H,"Object",{create:function(t,e){return void 0===e?C(t):J(C(t),e)},defineProperty:V,defineProperties:J,getOwnPropertyDescriptor:Q,getOwnPropertyNames:Z,getOwnPropertySymbols:$}),_&&a(a.S+a.F*(!H||f(function(){var t=M();return"[null]"!=D([t])||"{}"!=D({a:t})||"{}"!=D(Object(t))})),"JSON",{stringify:function(t){for(var e,n,r=[t],i=1;arguments.length>i;)r.push(arguments[i++]);if(n=e=r[1],(w(e)||void 0!==t)&&!G(t))return y(e)||(e=function(t,e){if("function"==typeof n&&(e=n.call(this,t,e)),!G(e))return e}),r[1]=e,D.apply(_,r)}}),M.prototype[B]||n(10)(M.prototype,B,M.prototype.valueOf),h(M,"Symbol"),h(Math,"Math",!0),h(i.JSON,"JSON",!0)},function(t,e,n){"use strict";e.f=n(30)},function(t,e,n){"use strict";var r=n(8),i=n(9),o=n(32),s=n(115),a=n(11).f;t.exports=function(t){var e=i.Symbol||(i.Symbol=o?{}:r.Symbol||{});"_"==t.charAt(0)||t in e||a(e,t,{value:s.f(t)})}},function(t,e,n){"use strict";var r=n(54),i=n(72),o=n(73);t.exports=function(t){var e=r(t),n=i.f;if(n)for(var s,a=n(t),c=o.f,u=0;a.length>u;)c.call(t,s=a[u++])&&e.push(s);return e}},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=n(42),o=n(119).f,s={}.toString,a="object"==("undefined"==typeof window?"undefined":r(window))&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(t){return a&&"[object Window]"==s.call(t)?function(t){try{return o(t)}catch(t){return a.slice()}}(t):o(i(t))}},function(t,e,n){"use strict";var r=n(55),i=n(57).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,i)}},function(t,e,n){"use strict";n(121),t.exports=n(9).String.padStart},function(t,e,n){"use strict";var r=n(7),i=n(122),o=n(124);r(r.P+r.F*/Version\/10\.\d+(\.\d+)? Safari\//.test(o),"String",{padStart:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0,!0)}})},function(t,e,n){"use strict";var r=n(25),i=n(123),o=n(33);t.exports=function(t,e,n,s){var a=String(o(t)),c=a.length,u=void 0===n?" ":String(n),f=r(e);if(f<=c||""==u)return a;var l=f-c,h=i.call(u,Math.ceil(l/u.length));return h.length>l&&(h=h.slice(0,l)),s?h+a:a+h}},function(t,e,n){"use strict";var r=n(26),i=n(33);t.exports=function(t){var e=String(i(this)),n="",o=r(t);if(o<0||o==1/0)throw RangeError("Count can't be negative");for(;o>0;(o>>>=1)&&(e+=e))1&o&&(n+=e);return n}},function(t,e,n){"use strict";var r=n(8).navigator;t.exports=r&&r.userAgent||""},function(t,e,n){"use strict";n(126),t.exports=n(9).String.padEnd},function(t,e,n){"use strict";var r=n(7),i=n(122),o=n(124);r(r.P+r.F*/Version\/10\.\d+(\.\d+)? Safari\//.test(o),"String",{padEnd:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0,!1)}})},function(t,e,n){"use strict";n(128),t.exports=n(9).Object.values},function(t,e,n){"use strict";var r=n(7),i=n(129)(!1);r(r.S,"Object",{values:function(t){return i(t)}})},function(t,e,n){"use strict";var r=n(54),i=n(42),o=n(73).f;t.exports=function(t){return function(e){for(var n,s=i(e),a=r(s),c=a.length,u=0,f=[];c>u;)o.call(s,n=a[u++])&&f.push(t?[n,s[n]]:s[n]);return f}}},function(t,e,n){"use strict";var r=!1;if("undefined"!=typeof ReadableStream)try{new ReadableStream({start:function(t){t.close()}}),r=!0}catch(t){}if(r)e.ReadableStream=ReadableStream;else{e.ReadableStream=function t(){throw function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),new Error("The current image decoders are synchronous, hence `ReadableStream` shouldn't need to be polyfilled for the IMAGE_DECODERS build target.")}}},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=!1;try{if("function"==typeof URL&&"object"===r(URL.prototype)&&"origin"in URL.prototype){var o=new URL("b","http://a");o.pathname="c%20d",i="http://a/c%20d"===o.href}}catch(t){}if(i)e.URL=URL;else{e.URL=function t(){throw function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),new Error("The current image decoders doesn't utilize the `URL` constructor, hence it shouldn't need to be polyfilled for the IMAGE_DECODERS build target.")}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Jbig2Image=void 0;var r=n(1),i=n(133),o=n(134),s=function(){function t(t){this.message="JBIG2 error: "+t}return t.prototype=new Error,t.prototype.name="Jbig2Error",t.constructor=t,t}(),a=function(){function t(){}function e(t,e,n){this.data=t,this.start=e,this.end=n}function n(t,e,n){var r=t.getContexts(e),i=1;function o(t){for(var e=0,o=0;o<t;o++){var s=n.readBit(r,i);i=i<256?i<<1|s:511&(i<<1|s)|256,e=e<<1|s}return e>>>0}var s=o(1),a=o(1)?o(1)?o(1)?o(1)?o(1)?o(32)+4436:o(12)+340:o(8)+84:o(6)+20:o(4)+4:o(2);return 0===s?a:a>0?-a:null}function a(t,e,n){for(var r=t.getContexts("IAID"),i=1,o=0;o<n;o++){i=i<<1|e.readBit(r,i)}return n<31?i&(1<<n)-1:2147483647&i}t.prototype={getContexts:function(t){return t in this?this[t]:this[t]=new Int8Array(65536)}},e.prototype={get decoder(){var t=new i.ArithmeticDecoder(this.data,this.start,this.end);return(0,r.shadow)(this,"decoder",t)},get contextCache(){var e=new t;return(0,r.shadow)(this,"contextCache",e)}};var c=["SymbolDictionary",null,null,null,"IntermediateTextRegion",null,"ImmediateTextRegion","ImmediateLosslessTextRegion",null,null,null,null,null,null,null,null,"PatternDictionary",null,null,null,"IntermediateHalftoneRegion",null,"ImmediateHalftoneRegion","ImmediateLosslessHalftoneRegion",null,null,null,null,null,null,null,null,null,null,null,null,"IntermediateGenericRegion",null,"ImmediateGenericRegion","ImmediateLosslessGenericRegion","IntermediateGenericRefinementRegion",null,"ImmediateGenericRefinementRegion","ImmediateLosslessGenericRefinementRegion",null,null,null,null,"PageInformation","EndOfPage","EndOfStripe","EndOfFile","Profiles","Tables",null,null,null,null,null,null,null,null,"Extension"],u=[[{x:-1,y:-2},{x:0,y:-2},{x:1,y:-2},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:2,y:-1},{x:-4,y:0},{x:-3,y:0},{x:-2,y:0},{x:-1,y:0}],[{x:-1,y:-2},{x:0,y:-2},{x:1,y:-2},{x:2,y:-2},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:2,y:-1},{x:-3,y:0},{x:-2,y:0},{x:-1,y:0}],[{x:-1,y:-2},{x:0,y:-2},{x:1,y:-2},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:-2,y:0},{x:-1,y:0}],[{x:-3,y:-1},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:-4,y:0},{x:-3,y:0},{x:-2,y:0},{x:-1,y:0}]],f=[{coding:[{x:0,y:-1},{x:1,y:-1},{x:-1,y:0}],reference:[{x:0,y:-1},{x:1,y:-1},{x:-1,y:0},{x:0,y:0},{x:1,y:0},{x:-1,y:1},{x:0,y:1},{x:1,y:1}]},{coding:[{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:-1,y:0}],reference:[{x:0,y:-1},{x:-1,y:0},{x:0,y:0},{x:1,y:0},{x:0,y:1},{x:1,y:1}]}],l=[39717,1941,229,405],h=[32,8];function p(t,e,n,r,i,o,s,a){if(t)return A(new I(a.data,a.start,a.end),e,n,!1);if(0===r&&!o&&!i&&4===s.length&&3===s[0].x&&-1===s[0].y&&-3===s[1].x&&-1===s[1].y&&2===s[2].x&&-2===s[2].y&&-2===s[3].x&&-2===s[3].y)return function(t,e,n){var r,i,o,s,a,c,u,f=n.decoder,l=n.contextCache.getContexts("GB"),h=[];for(i=0;i<e;i++)for(a=h[i]=new Uint8Array(t),c=i<1?a:h[i-1],r=(u=i<2?a:h[i-2])[0]<<13|u[1]<<12|u[2]<<11|c[0]<<7|c[1]<<6|c[2]<<5|c[3]<<4,o=0;o<t;o++)a[o]=s=f.readBit(l,r),r=(31735&r)<<1|(o+3<t?u[o+3]<<11:0)|(o+4<t?c[o+4]<<4:0)|s;return h}(e,n,a);var c=!!o,f=u[r].concat(s);f.sort(function(t,e){return t.y-e.y||t.x-e.x});var h,p,d=f.length,m=new Int8Array(d),g=new Int8Array(d),v=[],y=0,b=0,w=0,x=0;for(p=0;p<d;p++)m[p]=f[p].x,g[p]=f[p].y,b=Math.min(b,f[p].x),w=Math.max(w,f[p].x),x=Math.min(x,f[p].y),p<d-1&&f[p].y===f[p+1].y&&f[p].x===f[p+1].x-1?y|=1<<d-1-p:v.push(p);var S=v.length,P=new Int8Array(S),C=new Int8Array(S),T=new Uint16Array(S);for(h=0;h<S;h++)p=v[h],P[h]=f[p].x,C[h]=f[p].y,T[h]=1<<d-1-p;for(var k,O,E,L,M,_=-b,D=-x,R=e-w,B=l[r],U=new Uint8Array(e),N=[],F=a.decoder,j=a.contextCache.getContexts("GB"),z=0,H=0,W=0;W<n;W++){if(i)if(z^=F.readBit(j,B)){N.push(U);continue}for(U=new Uint8Array(U),N.push(U),k=0;k<e;k++)if(c&&o[W][k])U[k]=0;else{if(k>=_&&k<R&&W>=D)for(H=H<<1&y,p=0;p<S;p++)O=W+C[p],E=k+P[p],(L=N[O][E])&&(H|=L=T[p]);else for(H=0,M=d-1,p=0;p<d;p++,M--)(E=k+m[p])>=0&&E<e&&(O=W+g[p])>=0&&(L=N[O][E])&&(H|=L<<M);var X=F.readBit(j,H);U[k]=X}}return N}function d(t,e,n,r,i,o,a,c,u){var l=f[n].coding;0===n&&(l=l.concat([c[0]]));var p,d=l.length,m=new Int32Array(d),g=new Int32Array(d);for(p=0;p<d;p++)m[p]=l[p].x,g[p]=l[p].y;var v=f[n].reference;0===n&&(v=v.concat([c[1]]));var y=v.length,b=new Int32Array(y),w=new Int32Array(y);for(p=0;p<y;p++)b[p]=v[p].x,w[p]=v[p].y;for(var x=r[0].length,S=r.length,P=h[n],C=[],T=u.decoder,k=u.contextCache.getContexts("GR"),O=0,I=0;I<e;I++){if(a)if(O^=T.readBit(k,P))throw new s("prediction is not supported");var E=new Uint8Array(t);C.push(E);for(var L=0;L<t;L++){var A,M,_=0;for(p=0;p<d;p++)A=I+g[p],M=L+m[p],A<0||M<0||M>=t?_<<=1:_=_<<1|C[A][M];for(p=0;p<y;p++)A=I+w[p]-o,M=L+b[p]-i,A<0||A>=S||M<0||M>=x?_<<=1:_=_<<1|r[A][M];var D=T.readBit(k,_);E[L]=D}}return C}function m(t,e,r,i,o,c,u,f,l,h,p,m,g,v,y,b,w,x,S){if(t&&e)throw new s("refinement with Huffman is not supported");var P,C,T=[];for(P=0;P<i;P++){if(C=new Uint8Array(r),o)for(var k=0;k<r;k++)C[k]=o;T.push(C)}var O=w.decoder,I=w.contextCache,E=t?-v.tableDeltaT.decode(S):-n(I,"IADT",O),L=0;for(P=0;P<c;){E+=t?v.tableDeltaT.decode(S):n(I,"IADT",O);for(var A=L+=t?v.tableFirstS.decode(S):n(I,"IAFS",O);;){var M=0;u>1&&(M=t?S.readBits(x):n(I,"IAIT",O));var _=u*E+M,D=t?v.symbolIDTable.decode(S):a(I,O,l),R=e&&(t?S.readBit():n(I,"IARI",O)),B=f[D],U=B[0].length,N=B.length;if(R){var F=n(I,"IARDW",O),j=n(I,"IARDH",O);B=d(U+=F,N+=j,y,B,(F>>1)+n(I,"IARDX",O),(j>>1)+n(I,"IARDY",O),!1,b,w)}var z,H,W,X=_-(1&m?0:N-1),Y=A-(2&m?U-1:0);if(h){for(z=0;z<N;z++)if(C=T[Y+z]){W=B[z];var q=Math.min(r-X,U);switch(g){case 0:for(H=0;H<q;H++)C[X+H]|=W[H];break;case 2:for(H=0;H<q;H++)C[X+H]^=W[H];break;default:throw new s("operator ".concat(g," is not supported"))}}A+=N-1}else{for(H=0;H<N;H++)if(C=T[X+H])switch(W=B[H],g){case 0:for(z=0;z<U;z++)C[Y+z]|=W[z];break;case 2:for(z=0;z<U;z++)C[Y+z]^=W[z];break;default:throw new s("operator ".concat(g," is not supported"))}A+=U-1}P++;var G=t?v.tableDeltaS.decode(S):n(I,"IADS",O);if(null===G)break;A+=G+p}}return T}function g(t,e){var n={};n.number=(0,r.readUint32)(t,e);var i=t[e+4],o=63&i;if(!c[o])throw new s("invalid segment type: "+o);n.type=o,n.typeName=c[o],n.deferredNonRetain=!!(128&i);var a=!!(64&i),u=t[e+5],f=u>>5&7,l=[31&u],h=e+6;if(7===u){f=536870911&(0,r.readUint32)(t,h-1),h+=3;var p=f+7>>3;for(l[0]=t[h++];--p>0;)l.push(t[h++])}else if(5===u||6===u)throw new s("invalid referred-to flags");n.retainBits=l;var d,m,g=n.number<=256?1:n.number<=65536?2:4,v=[];for(d=0;d<f;d++){var w=1===g?t[h]:2===g?(0,r.readUint16)(t,h):(0,r.readUint32)(t,h);v.push(w),h+=g}if(n.referredTo=v,a?(n.pageAssociation=(0,r.readUint32)(t,h),h+=4):n.pageAssociation=t[h++],n.length=(0,r.readUint32)(t,h),h+=4,4294967295===n.length){if(38!==o)throw new s("invalid unknown segment length");var x=y(t,h),S=!!(1&t[h+b]),P=new Uint8Array(6);for(S||(P[0]=255,P[1]=172),P[2]=x.height>>>24&255,P[3]=x.height>>16&255,P[4]=x.height>>8&255,P[5]=255&x.height,d=h,m=t.length;d<m;d++){for(var C=0;C<6&&P[C]===t[d+C];)C++;if(6===C){n.length=d+6;break}}if(4294967295===n.length)throw new s("segment end was not found")}return n.headerEnd=h,n}function v(t,e,n,r){for(var i=[],o=n;o<r;){var s=g(e,o);o=s.headerEnd;var a={header:s,data:e};if(t.randomAccess||(a.start=o,o+=s.length,a.end=o),i.push(a),51===s.type)break}if(t.randomAccess)for(var c=0,u=i.length;c<u;c++)i[c].start=o,o+=i[c].header.length,i[c].end=o;return i}function y(t,e){return{width:(0,r.readUint32)(t,e),height:(0,r.readUint32)(t,e+4),x:(0,r.readUint32)(t,e+8),y:(0,r.readUint32)(t,e+12),combinationOperator:7&t[e+16]}}var b=17;function w(t,e){var n,i,o,a,c=t.header,u=t.data,f=t.start,l=t.end;switch(c.type){case 0:var h={},p=(0,r.readUint16)(u,f);if(h.huffman=!!(1&p),h.refinement=!!(2&p),h.huffmanDHSelector=p>>2&3,h.huffmanDWSelector=p>>4&3,h.bitmapSizeSelector=p>>6&1,h.aggregationInstancesSelector=p>>7&1,h.bitmapCodingContextUsed=!!(256&p),h.bitmapCodingContextRetained=!!(512&p),h.template=p>>10&3,h.refinementTemplate=p>>12&1,f+=2,!h.huffman){for(a=0===h.template?4:1,i=[],o=0;o<a;o++)i.push({x:(0,r.readInt8)(u,f),y:(0,r.readInt8)(u,f+1)}),f+=2;h.at=i}if(h.refinement&&!h.refinementTemplate){for(i=[],o=0;o<2;o++)i.push({x:(0,r.readInt8)(u,f),y:(0,r.readInt8)(u,f+1)}),f+=2;h.refinementAt=i}h.numberOfExportedSymbols=(0,r.readUint32)(u,f),f+=4,h.numberOfNewSymbols=(0,r.readUint32)(u,f),f+=4,n=[h,c.number,c.referredTo,u,f,l];break;case 6:case 7:var d={};d.info=y(u,f),f+=b;var m=(0,r.readUint16)(u,f);if(f+=2,d.huffman=!!(1&m),d.refinement=!!(2&m),d.logStripSize=m>>2&3,d.stripSize=1<<d.logStripSize,d.referenceCorner=m>>4&3,d.transposed=!!(64&m),d.combinationOperator=m>>7&3,d.defaultPixelValue=m>>9&1,d.dsOffset=m<<17>>27,d.refinementTemplate=m>>15&1,d.huffman){var g=(0,r.readUint16)(u,f);f+=2,d.huffmanFS=3&g,d.huffmanDS=g>>2&3,d.huffmanDT=g>>4&3,d.huffmanRefinementDW=g>>6&3,d.huffmanRefinementDH=g>>8&3,d.huffmanRefinementDX=g>>10&3,d.huffmanRefinementDY=g>>12&3,d.huffmanRefinementSizeSelector=!!(16384&g)}if(d.refinement&&!d.refinementTemplate){for(i=[],o=0;o<2;o++)i.push({x:(0,r.readInt8)(u,f),y:(0,r.readInt8)(u,f+1)}),f+=2;d.refinementAt=i}d.numberOfSymbolInstances=(0,r.readUint32)(u,f),f+=4,n=[d,c.referredTo,u,f,l];break;case 16:var v={},w=u[f++];v.mmr=!!(1&w),v.template=w>>1&3,v.patternWidth=u[f++],v.patternHeight=u[f++],v.maxPatternIndex=(0,r.readUint32)(u,f),f+=4,n=[v,c.number,u,f,l];break;case 22:case 23:var x={};x.info=y(u,f),f+=b;var S=u[f++];x.mmr=!!(1&S),x.template=S>>1&3,x.enableSkip=!!(8&S),x.combinationOperator=S>>4&7,x.defaultPixelValue=S>>7&1,x.gridWidth=(0,r.readUint32)(u,f),f+=4,x.gridHeight=(0,r.readUint32)(u,f),f+=4,x.gridOffsetX=4294967295&(0,r.readUint32)(u,f),f+=4,x.gridOffsetY=4294967295&(0,r.readUint32)(u,f),f+=4,x.gridVectorX=(0,r.readUint16)(u,f),f+=2,x.gridVectorY=(0,r.readUint16)(u,f),f+=2,n=[x,c.referredTo,u,f,l];break;case 38:case 39:var P={};P.info=y(u,f),f+=b;var C=u[f++];if(P.mmr=!!(1&C),P.template=C>>1&3,P.prediction=!!(8&C),!P.mmr){for(a=0===P.template?4:1,i=[],o=0;o<a;o++)i.push({x:(0,r.readInt8)(u,f),y:(0,r.readInt8)(u,f+1)}),f+=2;P.at=i}n=[P,u,f,l];break;case 48:var T={width:(0,r.readUint32)(u,f),height:(0,r.readUint32)(u,f+4),resolutionX:(0,r.readUint32)(u,f+8),resolutionY:(0,r.readUint32)(u,f+12)};4294967295===T.height&&delete T.height;var k=u[f+16];(0,r.readUint16)(u,f+17),T.lossless=!!(1&k),T.refinement=!!(2&k),T.defaultPixelValue=k>>2&1,T.combinationOperator=k>>3&3,T.requiresBuffer=!!(32&k),T.combinationOperatorOverride=!!(64&k),n=[T];break;case 49:case 50:case 51:break;case 53:n=[c.number,u,f,l];break;case 62:break;default:throw new s("segment type ".concat(c.typeName,"(").concat(c.type,")")+" is not implemented")}var O="on"+c.typeName;O in e&&e[O].apply(e,n)}function x(t,e){for(var n=0,r=t.length;n<r;n++)w(t[n],e)}function S(){}function P(t){2===t.length?(this.isOOB=!0,this.rangeLow=0,this.prefixLength=t[0],this.rangeLength=0,this.prefixCode=t[1],this.isLowerRange=!1):(this.isOOB=!1,this.rangeLow=t[0],this.prefixLength=t[1],this.rangeLength=t[2],this.prefixCode=t[3],this.isLowerRange="lower"===t[4])}function C(t){this.children=[],t?(this.isLeaf=!0,this.rangeLength=t.rangeLength,this.rangeLow=t.rangeLow,this.isLowerRange=t.isLowerRange,this.isOOB=t.isOOB):this.isLeaf=!1}function T(t,e){e||this.assignPrefixCodes(t),this.rootNode=new C(null);var n,r,i=t.length;for(n=0;n<i;n++)(r=t[n]).prefixLength>0&&this.rootNode.buildTree(r,r.prefixLength-1)}S.prototype={onPageInformation:function(t){this.currentPageInfo=t;var e=t.width+7>>3,n=new Uint8ClampedArray(e*t.height);if(t.defaultPixelValue)for(var r=0,i=n.length;r<i;r++)n[r]=255;this.buffer=n},drawBitmap:function(t,e){var n,r,i,o,a=this.currentPageInfo,c=t.width,u=t.height,f=a.width+7>>3,l=a.combinationOperatorOverride?t.combinationOperator:a.combinationOperator,h=this.buffer,p=128>>(7&t.x),d=t.y*f+(t.x>>3);switch(l){case 0:for(n=0;n<u;n++){for(i=p,o=d,r=0;r<c;r++)e[n][r]&&(h[o]|=i),(i>>=1)||(i=128,o++);d+=f}break;case 2:for(n=0;n<u;n++){for(i=p,o=d,r=0;r<c;r++)e[n][r]&&(h[o]^=i),(i>>=1)||(i=128,o++);d+=f}break;default:throw new s("operator ".concat(l," is not supported"))}},onImmediateGenericRegion:function(t,n,r,i){var o=t.info,s=new e(n,r,i),a=p(t.mmr,o.width,o.height,t.template,t.prediction,null,t.at,s);this.drawBitmap(o,a)},onImmediateLosslessGenericRegion:function(){this.onImmediateGenericRegion.apply(this,arguments)},onSymbolDictionary:function(t,i,o,c,u,f){var l,h;t.huffman&&(l=function(t,e,n){var r,i,o,a,c=0;switch(t.huffmanDHSelector){case 0:case 1:r=O(t.huffmanDHSelector+4);break;case 3:r=E(c,e,n),c++;break;default:throw new s("invalid Huffman DH selector")}switch(t.huffmanDWSelector){case 0:case 1:i=O(t.huffmanDWSelector+2);break;case 3:i=E(c,e,n),c++;break;default:throw new s("invalid Huffman DW selector")}t.bitmapSizeSelector?(o=E(c,e,n),c++):o=O(1);a=t.aggregationInstancesSelector?E(c,e,n):O(1);return{tableDeltaHeight:r,tableDeltaWidth:i,tableBitmapSize:o,tableAggregateInstances:a}}(t,o,this.customTables),h=new I(c,u,f));var g=this.symbols;g||(this.symbols=g={});for(var v=[],y=0,b=o.length;y<b;y++){var w=g[o[y]];w&&(v=v.concat(w))}var x=new e(c,u,f);g[i]=function(t,e,i,o,c,u,f,l,h,g,v,y){if(t&&e)throw new s("symbol refinement with Huffman is not supported");var b,w,x=[],S=0,P=(0,r.log2)(i.length+o),C=v.decoder,T=v.contextCache;for(t&&(b=O(1),w=[],P=Math.max(P,1));x.length<o;){S+=t?u.tableDeltaHeight.decode(y):n(T,"IADH",C);for(var k=0,I=0,E=t?w.length:0;;){var M,_=t?u.tableDeltaWidth.decode(y):n(T,"IADW",C);if(null===_)break;if(I+=k+=_,e){var D=n(T,"IAAI",C);if(D>1)M=m(t,e,k,S,0,D,1,i.concat(x),P,0,0,1,0,u,h,g,v,0,y);else{var R=a(T,C,P),B=n(T,"IARDX",C),U=n(T,"IARDY",C);M=d(k,S,h,R<i.length?i[R]:x[R-i.length],B,U,!1,g,v)}x.push(M)}else t?w.push(k):(M=p(!1,k,S,f,!1,null,l,v),x.push(M))}if(t&&!e){var N=u.tableBitmapSize.decode(y);y.byteAlign();var F=void 0;if(0===N)F=L(y,I,S);else{var j=y.end,z=y.position+N;y.end=z,F=A(y,I,S,!1),y.end=j,y.position=z}var H=w.length;if(E===H-1)x.push(F);else{var W=void 0,X=void 0,Y=0,q=void 0,G=void 0;for(W=E;W<H;W++){for(q=Y+w[W],G=[],X=0;X<S;X++)G.push(F[X].subarray(Y,q));x.push(G),Y=q}}}}for(var V=[],J=[],K=!1,Q=i.length+o;J.length<Q;){for(var Z=t?b.decode(y):n(T,"IAEX",C);Z--;)J.push(K);K=!K}for(var $=0,tt=i.length;$<tt;$++)J[$]&&V.push(i[$]);for(var et=0;et<o;$++,et++)J[$]&&V.push(x[et]);return V}(t.huffman,t.refinement,v,t.numberOfNewSymbols,t.numberOfExportedSymbols,l,t.template,t.at,t.refinementTemplate,t.refinementAt,x,h)},onImmediateTextRegion:function(t,n,i,o,a){for(var c,u,f=t.info,l=this.symbols,h=[],p=0,d=n.length;p<d;p++){var g=l[n[p]];g&&(h=h.concat(g))}var v=(0,r.log2)(h.length);t.huffman&&(u=new I(i,o,a),c=function(t,e,n,r,i){var o,a,c=[];for(o=0;o<=34;o++)a=i.readBits(4),c.push(new P([o,a,0,0]));var u=new T(c,!1);for(c.length=0,o=0;o<r;)if((a=u.decode(i))>=32){var f=void 0,l=void 0,h=void 0;switch(a){case 32:if(0===o)throw new s("no previous value in symbol ID table");l=i.readBits(2)+3,f=c[o-1].prefixLength;break;case 33:l=i.readBits(3)+3,f=0;break;case 34:l=i.readBits(7)+11,f=0;break;default:throw new s("invalid code length in symbol ID table")}for(h=0;h<l;h++)c.push(new P([o,f,0,0])),o++}else c.push(new P([o,a,0,0])),o++;i.byteAlign();var p,d,m,g=new T(c,!1),v=0;switch(t.huffmanFS){case 0:case 1:p=O(t.huffmanFS+6);break;case 3:p=E(v,e,n),v++;break;default:throw new s("invalid Huffman FS selector")}switch(t.huffmanDS){case 0:case 1:case 2:d=O(t.huffmanDS+8);break;case 3:d=E(v,e,n),v++;break;default:throw new s("invalid Huffman DS selector")}switch(t.huffmanDT){case 0:case 1:case 2:m=O(t.huffmanDT+11);break;case 3:m=E(v,e,n),v++;break;default:throw new s("invalid Huffman DT selector")}if(t.refinement)throw new s("refinement with Huffman is not supported");return{symbolIDTable:g,tableFirstS:p,tableDeltaS:d,tableDeltaT:m}}(t,n,this.customTables,h.length,u));var y=new e(i,o,a),b=m(t.huffman,t.refinement,f.width,f.height,t.defaultPixelValue,t.numberOfSymbolInstances,t.stripSize,h,v,t.transposed,t.dsOffset,t.referenceCorner,t.combinationOperator,c,t.refinementTemplate,t.refinementAt,y,t.logStripSize,u);this.drawBitmap(f,b)},onImmediateLosslessTextRegion:function(){this.onImmediateTextRegion.apply(this,arguments)},onPatternDictionary:function(t,n,r,i,o){var s=this.patterns;s||(this.patterns=s={});var a=new e(r,i,o);s[n]=function(t,e,n,r,i,o){var s=[];t||(s.push({x:-e,y:0}),0===i&&(s.push({x:-3,y:-1}),s.push({x:2,y:-2}),s.push({x:-2,y:-2})));for(var a,c,u,f,l=p(t,(r+1)*e,n,i,!1,null,s,o),h=[],d=0;d<=r;){for(a=[],u=(c=e*d)+e,f=0;f<n;f++)a.push(l[f].subarray(c,u));h.push(a),d++}return h}(t.mmr,t.patternWidth,t.patternHeight,t.maxPatternIndex,t.template,a)},onImmediateHalftoneRegion:function(t,n,i,o,a){var c=this.patterns[n[0]],u=t.info,f=new e(i,o,a),l=function(t,e,n,i,o,a,c,u,f,l,h,d,m,g,v){if(c)throw new s("skip is not supported");if(0!==u)throw new s("operator "+u+" is not supported in halftone region");var y,b,w,x=[];for(y=0;y<o;y++){if(w=new Uint8Array(i),a)for(b=0;b<i;b++)w[b]=a;x.push(w)}var S=e.length,P=e[0],C=P[0].length,T=P.length,k=(0,r.log2)(S),O=[];t||(O.push({x:n<=1?3:2,y:-1}),0===n&&(O.push({x:-3,y:-1}),O.push({x:2,y:-2}),O.push({x:-2,y:-2})));var E,L,M,_,D,R,B,U,N,F,j,z=[];for(t&&(E=new I(v.data,v.start,v.end)),y=k-1;y>=0;y--)L=t?A(E,f,l,!0):p(!1,f,l,n,!1,null,O,v),z[y]=L;for(M=0;M<l;M++)for(_=0;_<f;_++){for(D=0,R=0,b=k-1;b>=0;b--)R|=(D=z[b][M][_]^D)<<b;if(B=e[R],N=d+M*m-_*g>>8,(U=h+M*g+_*m>>8)>=0&&U+C<=i&&N>=0&&N+T<=o)for(y=0;y<T;y++)for(j=x[N+y],F=B[y],b=0;b<C;b++)j[U+b]|=F[b];else{var H=void 0,W=void 0;for(y=0;y<T;y++)if(!((W=N+y)<0||W>=o))for(j=x[W],F=B[y],b=0;b<C;b++)(H=U+b)>=0&&H<i&&(j[H]|=F[b])}}return x}(t.mmr,c,t.template,u.width,u.height,t.defaultPixelValue,t.enableSkip,t.combinationOperator,t.gridWidth,t.gridHeight,t.gridOffsetX,t.gridOffsetY,t.gridVectorX,t.gridVectorY,f);this.drawBitmap(u,l)},onImmediateLosslessHalftoneRegion:function(){this.onImmediateHalftoneRegion.apply(this,arguments)},onTables:function(t,e,n,i){var o=this.customTables;o||(this.customTables=o={}),o[t]=function(t,e,n){var i,o,s=t[e],a=4294967295&(0,r.readUint32)(t,e+1),c=4294967295&(0,r.readUint32)(t,e+5),u=new I(t,e+9,n),f=1+(s>>1&7),l=1+(s>>4&7),h=[],p=a;do{i=u.readBits(f),o=u.readBits(l),h.push(new P([p,i,o,0])),p+=1<<o}while(p<c);i=u.readBits(f),h.push(new P([a-1,i,32,0,"lower"])),i=u.readBits(f),h.push(new P([c,i,32,0])),1&s&&(i=u.readBits(f),h.push(new P([i,0])));return new T(h,!1)}(e,n,i)}},C.prototype={buildTree:function(t,e){var n=t.prefixCode>>e&1;if(e<=0)this.children[n]=new C(t);else{var r=this.children[n];r||(this.children[n]=r=new C(null)),r.buildTree(t,e-1)}},decodeNode:function(t){if(this.isLeaf){if(this.isOOB)return null;var e=t.readBits(this.rangeLength);return this.rangeLow+(this.isLowerRange?-e:e)}var n=this.children[t.readBit()];if(!n)throw new s("invalid Huffman data");return n.decodeNode(t)}},T.prototype={decode:function(t){return this.rootNode.decodeNode(t)},assignPrefixCodes:function(t){var e,n=t.length,r=0;for(e=0;e<n;e++)r=Math.max(r,t[e].prefixLength);var i=new Uint32Array(r+1);for(e=0;e<n;e++)i[t[e].prefixLength]++;var o,s,a,c=1,u=0;for(i[0]=0;c<=r;){for(o=u=u+i[c-1]<<1,s=0;s<n;)(a=t[s]).prefixLength===c&&(a.prefixCode=o,o++),s++;c++}}};var k={};function O(t){var e,n=k[t];if(n)return n;switch(t){case 1:e=[[0,1,4,0],[16,2,8,2],[272,3,16,6],[65808,3,32,7]];break;case 2:e=[[0,1,0,0],[1,2,0,2],[2,3,0,6],[3,4,3,14],[11,5,6,30],[75,6,32,62],[6,63]];break;case 3:e=[[-256,8,8,254],[0,1,0,0],[1,2,0,2],[2,3,0,6],[3,4,3,14],[11,5,6,30],[-257,8,32,255,"lower"],[75,7,32,126],[6,62]];break;case 4:e=[[1,1,0,0],[2,2,0,2],[3,3,0,6],[4,4,3,14],[12,5,6,30],[76,5,32,31]];break;case 5:e=[[-255,7,8,126],[1,1,0,0],[2,2,0,2],[3,3,0,6],[4,4,3,14],[12,5,6,30],[-256,7,32,127,"lower"],[76,6,32,62]];break;case 6:e=[[-2048,5,10,28],[-1024,4,9,8],[-512,4,8,9],[-256,4,7,10],[-128,5,6,29],[-64,5,5,30],[-32,4,5,11],[0,2,7,0],[128,3,7,2],[256,3,8,3],[512,4,9,12],[1024,4,10,13],[-2049,6,32,62,"lower"],[2048,6,32,63]];break;case 7:e=[[-1024,4,9,8],[-512,3,8,0],[-256,4,7,9],[-128,5,6,26],[-64,5,5,27],[-32,4,5,10],[0,4,5,11],[32,5,5,28],[64,5,6,29],[128,4,7,12],[256,3,8,1],[512,3,9,2],[1024,3,10,3],[-1025,5,32,30,"lower"],[2048,5,32,31]];break;case 8:e=[[-15,8,3,252],[-7,9,1,508],[-5,8,1,253],[-3,9,0,509],[-2,7,0,124],[-1,4,0,10],[0,2,1,0],[2,5,0,26],[3,6,0,58],[4,3,4,4],[20,6,1,59],[22,4,4,11],[38,4,5,12],[70,5,6,27],[134,5,7,28],[262,6,7,60],[390,7,8,125],[646,6,10,61],[-16,9,32,510,"lower"],[1670,9,32,511],[2,1]];break;case 9:e=[[-31,8,4,252],[-15,9,2,508],[-11,8,2,253],[-7,9,1,509],[-5,7,1,124],[-3,4,1,10],[-1,3,1,2],[1,3,1,3],[3,5,1,26],[5,6,1,58],[7,3,5,4],[39,6,2,59],[43,4,5,11],[75,4,6,12],[139,5,7,27],[267,5,8,28],[523,6,8,60],[779,7,9,125],[1291,6,11,61],[-32,9,32,510,"lower"],[3339,9,32,511],[2,0]];break;case 10:e=[[-21,7,4,122],[-5,8,0,252],[-4,7,0,123],[-3,5,0,24],[-2,2,2,0],[2,5,0,25],[3,6,0,54],[4,7,0,124],[5,8,0,253],[6,2,6,1],[70,5,5,26],[102,6,5,55],[134,6,6,56],[198,6,7,57],[326,6,8,58],[582,6,9,59],[1094,6,10,60],[2118,7,11,125],[-22,8,32,254,"lower"],[4166,8,32,255],[2,2]];break;case 11:e=[[1,1,0,0],[2,2,1,2],[4,4,0,12],[5,4,1,13],[7,5,1,28],[9,5,2,29],[13,6,2,60],[17,7,2,122],[21,7,3,123],[29,7,4,124],[45,7,5,125],[77,7,6,126],[141,7,32,127]];break;case 12:e=[[1,1,0,0],[2,2,0,2],[3,3,1,6],[5,5,0,28],[6,5,1,29],[8,6,1,60],[10,7,0,122],[11,7,1,123],[13,7,2,124],[17,7,3,125],[25,7,4,126],[41,8,5,254],[73,8,32,255]];break;case 13:e=[[1,1,0,0],[2,3,0,4],[3,4,0,12],[4,5,0,28],[5,4,1,13],[7,3,3,5],[15,6,1,58],[17,6,2,59],[21,6,3,60],[29,6,4,61],[45,6,5,62],[77,7,6,126],[141,7,32,127]];break;case 14:e=[[-2,3,0,4],[-1,3,0,5],[0,1,0,0],[1,3,0,6],[2,3,0,7]];break;case 15:e=[[-24,7,4,124],[-8,6,2,60],[-4,5,1,28],[-2,4,0,12],[-1,3,0,4],[0,1,0,0],[1,3,0,5],[2,4,0,13],[3,5,1,29],[5,6,2,61],[9,7,4,125],[-25,7,32,126,"lower"],[25,7,32,127]];break;default:throw new s("standard table B.".concat(t," does not exist"))}var r,i=e.length;for(r=0;r<i;r++)e[r]=new P(e[r]);return n=new T(e,!0),k[t]=n,n}function I(t,e,n){this.data=t,this.start=e,this.end=n,this.position=e,this.shift=-1,this.currentByte=0}function E(t,e,n){var r,i,o=0,a=e.length;for(r=0;r<a;r++)if(i=n[e[r]]){if(t===o)return i;o++}throw new s("can't find custom Huffman table")}function L(t,e,n){var r,i,o,s=[];for(i=0;i<n;i++){for(o=new Uint8Array(e),s.push(o),r=0;r<e;r++)o[r]=t.readBit();t.byteAlign()}return s}function A(t,e,n,r){var i,s,a,c,u,f={K:-1,Columns:e,Rows:n,BlackIs1:!0,EndOfBlock:r},l=new o.CCITTFaxDecoder(t,f),h=[],p=!1;for(s=0;s<n;s++)for(a=new Uint8Array(e),h.push(a),u=-1,i=0;i<e;i++)u<0&&(-1===(c=l.readNextChar())&&(c=0,p=!0),u=7),a[i]=c>>u&1,u--;if(r&&!p)for(var d=0;d<5&&-1!==l.readNextChar();d++);return h}function M(){}return I.prototype={readBit:function(){if(this.shift<0){if(this.position>=this.end)throw new s("end of data while reading bit");this.currentByte=this.data[this.position++],this.shift=7}var t=this.currentByte>>this.shift&1;return this.shift--,t},readBits:function(t){var e,n=0;for(e=t-1;e>=0;e--)n|=this.readBit()<<e;return n},byteAlign:function(){this.shift=-1},next:function(){return this.position>=this.end?-1:this.data[this.position++]}},M.prototype={parseChunks:function(t){return function(t){for(var e=new S,n=0,r=t.length;n<r;n++){var i=t[n];x(v({},i.data,i.start,i.end),e)}return e.buffer}(t)},parse:function(t){var e=function(t){var e=0,n=t.length;if(151!==t[e]||74!==t[e+1]||66!==t[e+2]||50!==t[e+3]||13!==t[e+4]||10!==t[e+5]||26!==t[e+6]||10!==t[e+7])throw new s("parseJbig2 - invalid header.");var i=Object.create(null);e+=8;var o=t[e++];i.randomAccess=!(1&o),2&o||(i.numberOfPages=(0,r.readUint32)(t,e),e+=4);var a=v(i,t,e,n),c=new S;x(a,c);for(var u=c.currentPageInfo,f=u.width,l=u.height,h=c.buffer,p=new Uint8ClampedArray(f*l),d=0,m=0,g=0;g<l;g++)for(var y=0,b=void 0,w=0;w<f;w++)y||(y=128,b=h[m++]),p[d++]=b&y?0:255,y>>=1;return{imgData:p,width:f,height:l}}(t),n=e.imgData,i=e.width,o=e.height;return this.width=i,this.height=o,n}},M}();e.Jbig2Image=a},function(t,e,n){"use strict";function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}Object.defineProperty(e,"__esModule",{value:!0}),e.ArithmeticDecoder=void 0;var i=[{qe:22017,nmps:1,nlps:1,switchFlag:1},{qe:13313,nmps:2,nlps:6,switchFlag:0},{qe:6145,nmps:3,nlps:9,switchFlag:0},{qe:2753,nmps:4,nlps:12,switchFlag:0},{qe:1313,nmps:5,nlps:29,switchFlag:0},{qe:545,nmps:38,nlps:33,switchFlag:0},{qe:22017,nmps:7,nlps:6,switchFlag:1},{qe:21505,nmps:8,nlps:14,switchFlag:0},{qe:18433,nmps:9,nlps:14,switchFlag:0},{qe:14337,nmps:10,nlps:14,switchFlag:0},{qe:12289,nmps:11,nlps:17,switchFlag:0},{qe:9217,nmps:12,nlps:18,switchFlag:0},{qe:7169,nmps:13,nlps:20,switchFlag:0},{qe:5633,nmps:29,nlps:21,switchFlag:0},{qe:22017,nmps:15,nlps:14,switchFlag:1},{qe:21505,nmps:16,nlps:14,switchFlag:0},{qe:20737,nmps:17,nlps:15,switchFlag:0},{qe:18433,nmps:18,nlps:16,switchFlag:0},{qe:14337,nmps:19,nlps:17,switchFlag:0},{qe:13313,nmps:20,nlps:18,switchFlag:0},{qe:12289,nmps:21,nlps:19,switchFlag:0},{qe:10241,nmps:22,nlps:19,switchFlag:0},{qe:9217,nmps:23,nlps:20,switchFlag:0},{qe:8705,nmps:24,nlps:21,switchFlag:0},{qe:7169,nmps:25,nlps:22,switchFlag:0},{qe:6145,nmps:26,nlps:23,switchFlag:0},{qe:5633,nmps:27,nlps:24,switchFlag:0},{qe:5121,nmps:28,nlps:25,switchFlag:0},{qe:4609,nmps:29,nlps:26,switchFlag:0},{qe:4353,nmps:30,nlps:27,switchFlag:0},{qe:2753,nmps:31,nlps:28,switchFlag:0},{qe:2497,nmps:32,nlps:29,switchFlag:0},{qe:2209,nmps:33,nlps:30,switchFlag:0},{qe:1313,nmps:34,nlps:31,switchFlag:0},{qe:1089,nmps:35,nlps:32,switchFlag:0},{qe:673,nmps:36,nlps:33,switchFlag:0},{qe:545,nmps:37,nlps:34,switchFlag:0},{qe:321,nmps:38,nlps:35,switchFlag:0},{qe:273,nmps:39,nlps:36,switchFlag:0},{qe:133,nmps:40,nlps:37,switchFlag:0},{qe:73,nmps:41,nlps:38,switchFlag:0},{qe:37,nmps:42,nlps:39,switchFlag:0},{qe:21,nmps:43,nlps:40,switchFlag:0},{qe:9,nmps:44,nlps:41,switchFlag:0},{qe:5,nmps:45,nlps:42,switchFlag:0},{qe:1,nmps:45,nlps:43,switchFlag:0},{qe:22017,nmps:46,nlps:46,switchFlag:0}],o=function(){function t(e,n,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.data=e,this.bp=n,this.dataEnd=r,this.chigh=e[n],this.clow=0,this.byteIn(),this.chigh=this.chigh<<7&65535|this.clow>>9&127,this.clow=this.clow<<7&65535,this.ct-=7,this.a=32768}var e,n,o;return e=t,(n=[{key:"byteIn",value:function(){var t=this.data,e=this.bp;255===t[e]?t[e+1]>143?(this.clow+=65280,this.ct=8):(e++,this.clow+=t[e]<<9,this.ct=7,this.bp=e):(e++,this.clow+=e<this.dataEnd?t[e]<<8:65280,this.ct=8,this.bp=e),this.clow>65535&&(this.chigh+=this.clow>>16,this.clow&=65535)}},{key:"readBit",value:function(t,e){var n,r=t[e]>>1,o=1&t[e],s=i[r],a=s.qe,c=this.a-a;if(this.chigh<a)c<a?(c=a,n=o,r=s.nmps):(c=a,n=1^o,1===s.switchFlag&&(o=n),r=s.nlps);else{if(this.chigh-=a,0!=(32768&c))return this.a=c,o;c<a?(n=1^o,1===s.switchFlag&&(o=n),r=s.nlps):(n=o,r=s.nmps)}do{0===this.ct&&this.byteIn(),c<<=1,this.chigh=this.chigh<<1&65535|this.clow>>15&1,this.clow=this.clow<<1&65535,this.ct--}while(0==(32768&c));return this.a=c,t[e]=r<<1|o,n}}])&&r(e.prototype,n),o&&r(e,o),t}();e.ArithmeticDecoder=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CCITTFaxDecoder=void 0;var r=n(1),i=function(){var t=[[-1,-1],[-1,-1],[7,8],[7,7],[6,6],[6,6],[6,5],[6,5],[4,0],[4,0],[4,0],[4,0],[4,0],[4,0],[4,0],[4,0],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2]],e=[[-1,-1],[12,-2],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[11,1792],[11,1792],[12,1984],[12,2048],[12,2112],[12,2176],[12,2240],[12,2304],[11,1856],[11,1856],[11,1920],[11,1920],[12,2368],[12,2432],[12,2496],[12,2560]],n=[[-1,-1],[-1,-1],[-1,-1],[-1,-1],[8,29],[8,29],[8,30],[8,30],[8,45],[8,45],[8,46],[8,46],[7,22],[7,22],[7,22],[7,22],[7,23],[7,23],[7,23],[7,23],[8,47],[8,47],[8,48],[8,48],[6,13],[6,13],[6,13],[6,13],[6,13],[6,13],[6,13],[6,13],[7,20],[7,20],[7,20],[7,20],[8,33],[8,33],[8,34],[8,34],[8,35],[8,35],[8,36],[8,36],[8,37],[8,37],[8,38],[8,38],[7,19],[7,19],[7,19],[7,19],[8,31],[8,31],[8,32],[8,32],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,12],[6,12],[6,12],[6,12],[6,12],[6,12],[6,12],[6,12],[8,53],[8,53],[8,54],[8,54],[7,26],[7,26],[7,26],[7,26],[8,39],[8,39],[8,40],[8,40],[8,41],[8,41],[8,42],[8,42],[8,43],[8,43],[8,44],[8,44],[7,21],[7,21],[7,21],[7,21],[7,28],[7,28],[7,28],[7,28],[8,61],[8,61],[8,62],[8,62],[8,63],[8,63],[8,0],[8,0],[8,320],[8,320],[8,384],[8,384],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[7,27],[7,27],[7,27],[7,27],[8,59],[8,59],[8,60],[8,60],[9,1472],[9,1536],[9,1600],[9,1728],[7,18],[7,18],[7,18],[7,18],[7,24],[7,24],[7,24],[7,24],[8,49],[8,49],[8,50],[8,50],[8,51],[8,51],[8,52],[8,52],[7,25],[7,25],[7,25],[7,25],[8,55],[8,55],[8,56],[8,56],[8,57],[8,57],[8,58],[8,58],[6,192],[6,192],[6,192],[6,192],[6,192],[6,192],[6,192],[6,192],[6,1664],[6,1664],[6,1664],[6,1664],[6,1664],[6,1664],[6,1664],[6,1664],[8,448],[8,448],[8,512],[8,512],[9,704],[9,768],[8,640],[8,640],[8,576],[8,576],[9,832],[9,896],[9,960],[9,1024],[9,1088],[9,1152],[9,1216],[9,1280],[9,1344],[9,1408],[7,256],[7,256],[7,256],[7,256],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[6,16],[6,16],[6,16],[6,16],[6,16],[6,16],[6,16],[6,16],[6,17],[6,17],[6,17],[6,17],[6,17],[6,17],[6,17],[6,17],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[6,14],[6,14],[6,14],[6,14],[6,14],[6,14],[6,14],[6,14],[6,15],[6,15],[6,15],[6,15],[6,15],[6,15],[6,15],[6,15],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7]],i=[[-1,-1],[-1,-1],[12,-2],[12,-2],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[11,1792],[11,1792],[11,1792],[11,1792],[12,1984],[12,1984],[12,2048],[12,2048],[12,2112],[12,2112],[12,2176],[12,2176],[12,2240],[12,2240],[12,2304],[12,2304],[11,1856],[11,1856],[11,1856],[11,1856],[11,1920],[11,1920],[11,1920],[11,1920],[12,2368],[12,2368],[12,2432],[12,2432],[12,2496],[12,2496],[12,2560],[12,2560],[10,18],[10,18],[10,18],[10,18],[10,18],[10,18],[10,18],[10,18],[12,52],[12,52],[13,640],[13,704],[13,768],[13,832],[12,55],[12,55],[12,56],[12,56],[13,1280],[13,1344],[13,1408],[13,1472],[12,59],[12,59],[12,60],[12,60],[13,1536],[13,1600],[11,24],[11,24],[11,24],[11,24],[11,25],[11,25],[11,25],[11,25],[13,1664],[13,1728],[12,320],[12,320],[12,384],[12,384],[12,448],[12,448],[13,512],[13,576],[12,53],[12,53],[12,54],[12,54],[13,896],[13,960],[13,1024],[13,1088],[13,1152],[13,1216],[10,64],[10,64],[10,64],[10,64],[10,64],[10,64],[10,64],[10,64]],o=[[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[11,23],[11,23],[12,50],[12,51],[12,44],[12,45],[12,46],[12,47],[12,57],[12,58],[12,61],[12,256],[10,16],[10,16],[10,16],[10,16],[10,17],[10,17],[10,17],[10,17],[12,48],[12,49],[12,62],[12,63],[12,30],[12,31],[12,32],[12,33],[12,40],[12,41],[11,22],[11,22],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[9,15],[9,15],[9,15],[9,15],[9,15],[9,15],[9,15],[9,15],[12,128],[12,192],[12,26],[12,27],[12,28],[12,29],[11,19],[11,19],[11,20],[11,20],[12,34],[12,35],[12,36],[12,37],[12,38],[12,39],[11,21],[11,21],[12,42],[12,43],[10,0],[10,0],[10,0],[10,0],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12]],s=[[-1,-1],[-1,-1],[-1,-1],[-1,-1],[6,9],[6,8],[5,7],[5,7],[4,6],[4,6],[4,6],[4,6],[4,5],[4,5],[4,5],[4,5],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2]];function a(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!t||"function"!=typeof t.next)throw new Error('CCITTFaxDecoder - invalid "source" parameter.');this.source=t,this.eof=!1,this.encoding=e.K||0,this.eoline=e.EndOfLine||!1,this.byteAlign=e.EncodedByteAlign||!1,this.columns=e.Columns||1728,this.rows=e.Rows||0;var n,r=e.EndOfBlock;for(null==r&&(r=!0),this.eoblock=r,this.black=e.BlackIs1||!1,this.codingLine=new Uint32Array(this.columns+1),this.refLine=new Uint32Array(this.columns+2),this.codingLine[0]=this.columns,this.codingPos=0,this.row=0,this.nextLine2D=this.encoding<0,this.inputBits=0,this.inputBuf=0,this.outputBits=0,this.rowsDone=!1;0===(n=this._lookBits(12));)this._eatBits(1);1===n&&this._eatBits(12),this.encoding>0&&(this.nextLine2D=!this._lookBits(1),this._eatBits(1))}return a.prototype={readNextChar:function(){if(this.eof)return-1;var t,e,n,i,o,s=this.refLine,a=this.codingLine,c=this.columns;if(0===this.outputBits){if(this.rowsDone&&(this.eof=!0),this.eof)return-1;var u,f,l;if(this.err=!1,this.nextLine2D){for(i=0;a[i]<c;++i)s[i]=a[i];for(s[i++]=c,s[i]=c,a[0]=0,this.codingPos=0,t=0,e=0;a[this.codingPos]<c;)switch(u=this._getTwoDimCode()){case 0:this._addPixels(s[t+1],e),s[t+1]<c&&(t+=2);break;case 1:if(u=f=0,e){do{u+=l=this._getBlackCode()}while(l>=64);do{f+=l=this._getWhiteCode()}while(l>=64)}else{do{u+=l=this._getWhiteCode()}while(l>=64);do{f+=l=this._getBlackCode()}while(l>=64)}for(this._addPixels(a[this.codingPos]+u,e),a[this.codingPos]<c&&this._addPixels(a[this.codingPos]+f,1^e);s[t]<=a[this.codingPos]&&s[t]<c;)t+=2;break;case 7:if(this._addPixels(s[t]+3,e),e^=1,a[this.codingPos]<c)for(++t;s[t]<=a[this.codingPos]&&s[t]<c;)t+=2;break;case 5:if(this._addPixels(s[t]+2,e),e^=1,a[this.codingPos]<c)for(++t;s[t]<=a[this.codingPos]&&s[t]<c;)t+=2;break;case 3:if(this._addPixels(s[t]+1,e),e^=1,a[this.codingPos]<c)for(++t;s[t]<=a[this.codingPos]&&s[t]<c;)t+=2;break;case 2:if(this._addPixels(s[t],e),e^=1,a[this.codingPos]<c)for(++t;s[t]<=a[this.codingPos]&&s[t]<c;)t+=2;break;case 8:if(this._addPixelsNeg(s[t]-3,e),e^=1,a[this.codingPos]<c)for(t>0?--t:++t;s[t]<=a[this.codingPos]&&s[t]<c;)t+=2;break;case 6:if(this._addPixelsNeg(s[t]-2,e),e^=1,a[this.codingPos]<c)for(t>0?--t:++t;s[t]<=a[this.codingPos]&&s[t]<c;)t+=2;break;case 4:if(this._addPixelsNeg(s[t]-1,e),e^=1,a[this.codingPos]<c)for(t>0?--t:++t;s[t]<=a[this.codingPos]&&s[t]<c;)t+=2;break;case-1:this._addPixels(c,0),this.eof=!0;break;default:(0,r.info)("bad 2d code"),this._addPixels(c,0),this.err=!0}}else for(a[0]=0,this.codingPos=0,e=0;a[this.codingPos]<c;){if(u=0,e)do{u+=l=this._getBlackCode()}while(l>=64);else do{u+=l=this._getWhiteCode()}while(l>=64);this._addPixels(a[this.codingPos]+u,e),e^=1}var h=!1;if(this.byteAlign&&(this.inputBits&=-8),this.eoblock||this.row!==this.rows-1){if(u=this._lookBits(12),this.eoline)for(;-1!==u&&1!==u;)this._eatBits(1),u=this._lookBits(12);else for(;0===u;)this._eatBits(1),u=this._lookBits(12);1===u?(this._eatBits(12),h=!0):-1===u&&(this.eof=!0)}else this.rowsDone=!0;if(!this.eof&&this.encoding>0&&!this.rowsDone&&(this.nextLine2D=!this._lookBits(1),this._eatBits(1)),this.eoblock&&h&&this.byteAlign){if(1===(u=this._lookBits(12))){if(this._eatBits(12),this.encoding>0&&(this._lookBits(1),this._eatBits(1)),this.encoding>=0)for(i=0;i<4;++i)1!==(u=this._lookBits(12))&&(0,r.info)("bad rtc code: "+u),this._eatBits(12),this.encoding>0&&(this._lookBits(1),this._eatBits(1));this.eof=!0}}else if(this.err&&this.eoline){for(;;){if(-1===(u=this._lookBits(13)))return this.eof=!0,-1;if(u>>1==1)break;this._eatBits(1)}this._eatBits(12),this.encoding>0&&(this._eatBits(1),this.nextLine2D=!(1&u))}a[0]>0?this.outputBits=a[this.codingPos=0]:this.outputBits=a[this.codingPos=1],this.row++}if(this.outputBits>=8)o=1&this.codingPos?0:255,this.outputBits-=8,0===this.outputBits&&a[this.codingPos]<c&&(this.codingPos++,this.outputBits=a[this.codingPos]-a[this.codingPos-1]);else{n=8,o=0;do{this.outputBits>n?(o<<=n,1&this.codingPos||(o|=255>>8-n),this.outputBits-=n,n=0):(o<<=this.outputBits,1&this.codingPos||(o|=255>>8-this.outputBits),n-=this.outputBits,this.outputBits=0,a[this.codingPos]<c?(this.codingPos++,this.outputBits=a[this.codingPos]-a[this.codingPos-1]):n>0&&(o<<=n,n=0))}while(n)}return this.black&&(o^=255),o},_addPixels:function(t,e){var n=this.codingLine,i=this.codingPos;t>n[i]&&(t>this.columns&&((0,r.info)("row is wrong length"),this.err=!0,t=this.columns),1&i^e&&++i,n[i]=t),this.codingPos=i},_addPixelsNeg:function(t,e){var n=this.codingLine,i=this.codingPos;if(t>n[i])t>this.columns&&((0,r.info)("row is wrong length"),this.err=!0,t=this.columns),1&i^e&&++i,n[i]=t;else if(t<n[i]){for(t<0&&((0,r.info)("invalid code"),this.err=!0,t=0);i>0&&t<n[i-1];)--i;n[i]=t}this.codingPos=i},_findTableCode:function(t,e,n,r){for(var i=r||0,o=t;o<=e;++o){var s=this._lookBits(o);if(-1===s)return[!0,1,!1];if(o<e&&(s<<=e-o),!i||s>=i){var a=n[s-i];if(a[0]===o)return this._eatBits(o),[!0,a[1],!0]}}return[!1,0,!1]},_getTwoDimCode:function(){var e,n=0;if(this.eoblock){if(n=this._lookBits(7),(e=t[n])&&e[0]>0)return this._eatBits(e[0]),e[1]}else{var i=this._findTableCode(1,7,t);if(i[0]&&i[2])return i[1]}return(0,r.info)("Bad two dim code"),-1},_getWhiteCode:function(){var t,i=0;if(this.eoblock){if(-1===(i=this._lookBits(12)))return 1;if((t=i>>5==0?e[i]:n[i>>3])[0]>0)return this._eatBits(t[0]),t[1]}else{var o=this._findTableCode(1,9,n);if(o[0])return o[1];if((o=this._findTableCode(11,12,e))[0])return o[1]}return(0,r.info)("bad white code"),this._eatBits(1),1},_getBlackCode:function(){var t,e;if(this.eoblock){if(-1===(t=this._lookBits(13)))return 1;if((e=t>>7==0?i[t]:t>>9==0&&t>>7!=0?o[(t>>1)-64]:s[t>>7])[0]>0)return this._eatBits(e[0]),e[1]}else{var n=this._findTableCode(2,6,s);if(n[0])return n[1];if((n=this._findTableCode(7,12,o,64))[0])return n[1];if((n=this._findTableCode(10,13,i))[0])return n[1]}return(0,r.info)("bad black code"),this._eatBits(1),1},_lookBits:function(t){for(var e;this.inputBits<t;){if(-1===(e=this.source.next()))return 0===this.inputBits?-1:this.inputBuf<<t-this.inputBits&65535>>16-t;this.inputBuf=this.inputBuf<<8|e,this.inputBits+=8}return this.inputBuf>>this.inputBits-t&65535>>16-t},_eatBits:function(t){(this.inputBits-=t)<0&&(this.inputBits=0)}},a}();e.CCITTFaxDecoder=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.JpegImage=void 0;var r=n(1);function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var o=function(){function t(t){this.message="JPEG error: "+t}return t.prototype=new Error,t.prototype.name="JpegError",t.constructor=t,t}(),s=function(){function t(t,e){this.message=t,this.scanLines=e}return t.prototype=new Error,t.prototype.name="DNLMarkerError",t.constructor=t,t}(),a=function(){function t(t){this.message=t}return t.prototype=new Error,t.prototype.name="EOIMarkerError",t.constructor=t,t}(),c=function(){var t=new Uint8Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),e=4017,n=799,c=3406,u=2276,f=1567,l=3784,h=5793,p=2896;function d(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.decodeTransform,n=void 0===e?null:e,r=t.colorTransform,i=void 0===r?-1:r;this._decodeTransform=n,this._colorTransform=i}function m(t,e){for(var n,r,i=0,o=[],s=16;s>0&&!t[s-1];)s--;o.push({children:[],index:0});var a,c=o[0];for(n=0;n<s;n++){for(r=0;r<t[n];r++){for((c=o.pop()).children[c.index]=e[i];c.index>0;)c=o.pop();for(c.index++,o.push(c);o.length<=n;)o.push(a={children:[],index:0}),c.children[c.index]=a.children,c=a;i++}n+1<s&&(o.push(a={children:[],index:0}),c.children[c.index]=a.children,c=a)}return o[0].children}function g(t,e,n){return 64*((t.blocksPerLine+1)*e+n)}function v(e,n,c,u,f,l,h,p,d){var m=arguments.length>9&&void 0!==arguments[9]&&arguments[9],v=c.mcusPerLine,y=c.progressive,b=n,x=0,S=0;function P(){if(S>0)return x>>--S&1;if(255===(x=e[n++])){var t=e[n++];if(t){if(220===t&&m){n+=2;var r=e[n++]<<8|e[n++];if(r>0&&r!==c.scanLines)throw new s("Found DNL marker (0xFFDC) while parsing scan data",r)}else if(217===t)throw new a("Found EOI marker (0xFFD9) while parsing scan data");throw new o("unexpected marker ".concat((x<<8|t).toString(16)))}}return S=7,x>>>7}function C(t){for(var e=t;;){if("number"==typeof(e=e[P()]))return e;if("object"!==i(e))throw new o("invalid huffman sequence")}}function T(t){for(var e=0;t>0;)e=e<<1|P(),t--;return e}function k(t){if(1===t)return 1===P()?1:-1;var e=T(t);return e>=1<<t-1?e:e+(-1<<t)+1}var O=0;var I,E=0;function L(t,e,n,r,i){var o=n%v;e(t,g(t,(n/v|0)*t.v+r,o*t.h+i))}function A(t,e,n){e(t,g(t,n/t.blocksPerLine|0,n%t.blocksPerLine))}var M,_,D,R,B,U,N=u.length;U=y?0===l?0===p?function(t,e){var n=C(t.huffmanTableDC),r=0===n?0:k(n)<<d;t.blockData[e]=t.pred+=r}:function(t,e){t.blockData[e]|=P()<<d}:0===p?function(e,n){if(O>0)O--;else for(var r=l,i=h;r<=i;){var o=C(e.huffmanTableAC),s=15&o,a=o>>4;if(0!==s){var c=t[r+=a];e.blockData[n+c]=k(s)*(1<<d),r++}else{if(a<15){O=T(a)+(1<<a)-1;break}r+=16}}}:function(e,n){for(var r,i,s=l,a=h,c=0;s<=a;){var u=n+t[s],f=e.blockData[u]<0?-1:1;switch(E){case 0:if(c=(i=C(e.huffmanTableAC))>>4,0==(r=15&i))c<15?(O=T(c)+(1<<c),E=4):(c=16,E=1);else{if(1!==r)throw new o("invalid ACn encoding");I=k(r),E=c?2:3}continue;case 1:case 2:e.blockData[u]?e.blockData[u]+=f*(P()<<d):0==--c&&(E=2===E?3:0);break;case 3:e.blockData[u]?e.blockData[u]+=f*(P()<<d):(e.blockData[u]=I<<d,E=0);break;case 4:e.blockData[u]&&(e.blockData[u]+=f*(P()<<d))}s++}4===E&&0==--O&&(E=0)}:function(e,n){var r=C(e.huffmanTableDC),i=0===r?0:k(r);e.blockData[n]=e.pred+=i;for(var o=1;o<64;){var s=C(e.huffmanTableAC),a=15&s,c=s>>4;if(0!==a){var u=t[o+=c];e.blockData[n+u]=k(a),o++}else{if(c<15)break;o+=16}}};var F,j,z,H,W=0;for(j=1===N?u[0].blocksPerLine*u[0].blocksPerColumn:v*c.mcusPerColumn;W<j;){var X=f?Math.min(j-W,f):j;for(_=0;_<N;_++)u[_].pred=0;if(O=0,1===N)for(M=u[0],B=0;B<X;B++)A(M,U,W),W++;else for(B=0;B<X;B++){for(_=0;_<N;_++)for(z=(M=u[_]).h,H=M.v,D=0;D<H;D++)for(R=0;R<z;R++)L(M,U,W,D,R);W++}S=0,(F=w(e,n))&&F.invalid&&((0,r.warn)("decodeScan - unexpected MCU data, current marker is: "+F.invalid),n=F.offset);var Y=F&&F.marker;if(!Y||Y<=65280)throw new o("marker was not found");if(!(Y>=65488&&Y<=65495))break;n+=2}return(F=w(e,n))&&F.invalid&&((0,r.warn)("decodeScan - unexpected Scan data, current marker is: "+F.invalid),n=F.offset),n-b}function y(t,r,i){var s,a,d,m,g,v,y,b,w,x,S,P,C,T,k,O,I,E=t.quantizationTable,L=t.blockData;if(!E)throw new o("missing required Quantization Table.");for(var A=0;A<64;A+=8)w=L[r+A],x=L[r+A+1],S=L[r+A+2],P=L[r+A+3],C=L[r+A+4],T=L[r+A+5],k=L[r+A+6],O=L[r+A+7],w*=E[A],0!=(x|S|P|C|T|k|O)?(x*=E[A+1],S*=E[A+2],P*=E[A+3],C*=E[A+4],T*=E[A+5],k*=E[A+6],O*=E[A+7],a=(s=(s=h*w+128>>8)+(a=h*C+128>>8)+1>>1)-a,I=(d=S)*l+(m=k)*f+128>>8,d=d*f-m*l+128>>8,y=(g=(g=p*(x-O)+128>>8)+(y=T<<4)+1>>1)-y,v=(b=(b=p*(x+O)+128>>8)+(v=P<<4)+1>>1)-v,m=(s=s+(m=I)+1>>1)-m,d=(a=a+d+1>>1)-d,I=g*u+b*c+2048>>12,g=g*c-b*u+2048>>12,b=I,I=v*n+y*e+2048>>12,v=v*e-y*n+2048>>12,y=I,i[A]=s+b,i[A+7]=s-b,i[A+1]=a+y,i[A+6]=a-y,i[A+2]=d+v,i[A+5]=d-v,i[A+3]=m+g,i[A+4]=m-g):(I=h*w+512>>10,i[A]=I,i[A+1]=I,i[A+2]=I,i[A+3]=I,i[A+4]=I,i[A+5]=I,i[A+6]=I,i[A+7]=I);for(var M=0;M<8;++M)w=i[M],0!=((x=i[M+8])|(S=i[M+16])|(P=i[M+24])|(C=i[M+32])|(T=i[M+40])|(k=i[M+48])|(O=i[M+56]))?(a=(s=4112+((s=h*w+2048>>12)+(a=h*C+2048>>12)+1>>1))-a,I=(d=S)*l+(m=k)*f+2048>>12,d=d*f-m*l+2048>>12,m=I,y=(g=(g=p*(x-O)+2048>>12)+(y=T)+1>>1)-y,v=(b=(b=p*(x+O)+2048>>12)+(v=P)+1>>1)-v,I=g*u+b*c+2048>>12,g=g*c-b*u+2048>>12,b=I,I=v*n+y*e+2048>>12,v=v*e-y*n+2048>>12,w=(w=(s=s+m+1>>1)+b)<16?0:w>=4080?255:w>>4,x=(x=(a=a+d+1>>1)+(y=I))<16?0:x>=4080?255:x>>4,S=(S=(d=a-d)+v)<16?0:S>=4080?255:S>>4,P=(P=(m=s-m)+g)<16?0:P>=4080?255:P>>4,C=(C=m-g)<16?0:C>=4080?255:C>>4,T=(T=d-v)<16?0:T>=4080?255:T>>4,k=(k=a-y)<16?0:k>=4080?255:k>>4,O=(O=s-b)<16?0:O>=4080?255:O>>4,L[r+M]=w,L[r+M+8]=x,L[r+M+16]=S,L[r+M+24]=P,L[r+M+32]=C,L[r+M+40]=T,L[r+M+48]=k,L[r+M+56]=O):(I=(I=h*w+8192>>14)<-2040?0:I>=2024?255:I+2056>>4,L[r+M]=I,L[r+M+8]=I,L[r+M+16]=I,L[r+M+24]=I,L[r+M+32]=I,L[r+M+40]=I,L[r+M+48]=I,L[r+M+56]=I)}function b(t,e){for(var n=e.blocksPerLine,r=e.blocksPerColumn,i=new Int16Array(64),o=0;o<r;o++)for(var s=0;s<n;s++){y(e,g(e,o,s),i)}return e.blockData}function w(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e;function r(e){return t[e]<<8|t[e+1]}var i=t.length-1,o=n<e?n:e;if(e>=i)return null;var s=r(e);if(s>=65472&&s<=65534)return{invalid:null,marker:s,offset:e};for(var a=r(o);!(a>=65472&&a<=65534);){if(++o>=i)return null;a=r(o)}return{invalid:s.toString(16),marker:a,offset:o}}return d.prototype={parse:function(e){var n=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).dnlScanLines,i=void 0===n?null:n;function c(){var t=e[p]<<8|e[p+1];return p+=2,t}function u(){var t=c(),n=p+t-2,i=w(e,n,p);i&&i.invalid&&((0,r.warn)("readDataBlock - incorrect length, current marker is: "+i.invalid),n=i.offset);var o=e.subarray(p,n);return p+=o.length,o}function f(t){for(var e=Math.ceil(t.samplesPerLine/8/t.maxH),n=Math.ceil(t.scanLines/8/t.maxV),r=0;r<t.components.length;r++){q=t.components[r];var i=Math.ceil(Math.ceil(t.samplesPerLine/8)*q.h/t.maxH),o=Math.ceil(Math.ceil(t.scanLines/8)*q.v/t.maxV),s=e*q.h,a=64*(n*q.v)*(s+1);q.blockData=new Int16Array(a),q.blocksPerLine=i,q.blocksPerColumn=o}t.mcusPerLine=e,t.mcusPerColumn=n}var l,h,p=0,d=null,g=null,y=0,x=[],S=[],P=[],C=c();if(65496!==C)throw new o("SOI not found");C=c();t:for(;65497!==C;){var T,k,O;switch(C){case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:var I=u();65504===C&&74===I[0]&&70===I[1]&&73===I[2]&&70===I[3]&&0===I[4]&&(d={version:{major:I[5],minor:I[6]},densityUnits:I[7],xDensity:I[8]<<8|I[9],yDensity:I[10]<<8|I[11],thumbWidth:I[12],thumbHeight:I[13],thumbData:I.subarray(14,14+3*I[12]*I[13])}),65518===C&&65===I[0]&&100===I[1]&&111===I[2]&&98===I[3]&&101===I[4]&&(g={version:I[5]<<8|I[6],flags0:I[7]<<8|I[8],flags1:I[9]<<8|I[10],transformCode:I[11]});break;case 65499:for(var E=c()+p-2;p<E;){var L=e[p++],A=new Uint16Array(64);if(L>>4==0)for(k=0;k<64;k++)A[t[k]]=e[p++];else{if(L>>4!=1)throw new o("DQT - invalid table spec");for(k=0;k<64;k++)A[t[k]]=c()}x[15&L]=A}break;case 65472:case 65473:case 65474:if(l)throw new o("Only single frame JPEGs supported");c(),(l={}).extended=65473===C,l.progressive=65474===C,l.precision=e[p++];var M=c();l.scanLines=i||M,l.samplesPerLine=c(),l.components=[],l.componentIds={};var _,D=e[p++],R=0,B=0;for(T=0;T<D;T++){_=e[p];var U=e[p+1]>>4,N=15&e[p+1];R<U&&(R=U),B<N&&(B=N);var F=e[p+2];O=l.components.push({h:U,v:N,quantizationId:F,quantizationTable:null}),l.componentIds[_]=O-1,p+=3}l.maxH=R,l.maxV=B,f(l);break;case 65476:var j=c();for(T=2;T<j;){var z=e[p++],H=new Uint8Array(16),W=0;for(k=0;k<16;k++,p++)W+=H[k]=e[p];var X=new Uint8Array(W);for(k=0;k<W;k++,p++)X[k]=e[p];T+=17+W,(z>>4==0?P:S)[15&z]=m(H,X)}break;case 65501:c(),h=c();break;case 65498:var Y=1==++y&&!i;c();var q,G=e[p++],V=[];for(T=0;T<G;T++){var J=l.componentIds[e[p++]];q=l.components[J];var K=e[p++];q.huffmanTableDC=P[K>>4],q.huffmanTableAC=S[15&K],V.push(q)}var Q=e[p++],Z=e[p++],$=e[p++];try{var tt=v(e,p,l,V,h,Q,Z,$>>4,15&$,Y);p+=tt}catch(t){if(t instanceof s)return(0,r.warn)("".concat(t.message," -- attempting to re-parse the JPEG image.")),this.parse(e,{dnlScanLines:t.scanLines});if(t instanceof a){(0,r.warn)("".concat(t.message," -- ignoring the rest of the image data."));break t}throw t}break;case 65500:p+=4;break;case 65535:255!==e[p]&&p--;break;default:if(255===e[p-3]&&e[p-2]>=192&&e[p-2]<=254){p-=3;break}var et=w(e,p-2);if(et&&et.invalid){(0,r.warn)("JpegImage.parse - unexpected data, current marker is: "+et.invalid),p=et.offset;break}throw new o("unknown marker "+C.toString(16))}C=c()}for(this.width=l.samplesPerLine,this.height=l.scanLines,this.jfif=d,this.adobe=g,this.components=[],T=0;T<l.components.length;T++){var nt=x[(q=l.components[T]).quantizationId];nt&&(q.quantizationTable=nt),this.components.push({output:b(0,q),scaleX:q.h/l.maxH,scaleY:q.v/l.maxV,blocksPerLine:q.blocksPerLine,blocksPerColumn:q.blocksPerColumn})}this.numComponents=this.components.length},_getLinearizedBlockData:function(t,e){var n,r,i,o,s,a,c,u,f,l,h,p=arguments.length>2&&void 0!==arguments[2]&&arguments[2],d=this.width/t,m=this.height/e,g=0,v=this.components.length,y=t*e*v,b=new Uint8ClampedArray(y),w=new Uint32Array(t);for(c=0;c<v;c++){for(r=(n=this.components[c]).scaleX*d,i=n.scaleY*m,g=c,h=n.output,o=n.blocksPerLine+1<<3,s=0;s<t;s++)u=0|s*r,w[s]=(4294967288&u)<<3|7&u;for(a=0;a<e;a++)for(l=o*(4294967288&(u=0|a*i))|(7&u)<<3,s=0;s<t;s++)b[g]=h[l+w[s]],g+=v}var x=this._decodeTransform;if(p||4!==v||x||(x=new Int32Array([-256,255,-256,255,-256,255,-256,255])),x)for(c=0;c<y;)for(u=0,f=0;u<v;u++,c++,f+=2)b[c]=(b[c]*x[f]>>8)+x[f+1];return b},get _isColorConversionNeeded(){return this.adobe?!!this.adobe.transformCode:3===this.numComponents?0!==this._colorTransform:1===this._colorTransform},_convertYccToRgb:function(t){for(var e,n,r,i=0,o=t.length;i<o;i+=3)e=t[i],n=t[i+1],r=t[i+2],t[i]=e-179.456+1.402*r,t[i+1]=e+135.459-.344*n-.714*r,t[i+2]=e-226.816+1.772*n;return t},_convertYcckToRgb:function(t){for(var e,n,r,i,o=0,s=0,a=t.length;s<a;s+=4)e=t[s],n=t[s+1],r=t[s+2],i=t[s+3],t[o++]=n*(-660635669420364e-19*n+.000437130475926232*r-54080610064599e-18*e+.00048449797120281*i-.154362151871126)-122.67195406894+r*(-.000957964378445773*r+.000817076911346625*e-.00477271405408747*i+1.53380253221734)+e*(.000961250184130688*e-.00266257332283933*i+.48357088451265)+i*(-.000336197177618394*i+.484791561490776),t[o++]=107.268039397724+n*(219927104525741e-19*n-.000640992018297945*r+.000659397001245577*e+.000426105652938837*i-.176491792462875)+r*(-.000778269941513683*r+.00130872261408275*e+.000770482631801132*i-.151051492775562)+e*(.00126935368114843*e-.00265090189010898*i+.25802910206845)+i*(-.000318913117588328*i-.213742400323665),t[o++]=n*(-.000570115196973677*n-263409051004589e-19*r+.0020741088115012*e-.00288260236853442*i+.814272968359295)-20.810012546947+r*(-153496057440975e-19*r-.000132689043961446*e+.000560833691242812*i-.195152027534049)+e*(.00174418132927582*e-.00255243321439347*i+.116935020465145)+i*(-.000343531996510555*i+.24165260232407);return t.subarray(0,o)},_convertYcckToCmyk:function(t){for(var e,n,r,i=0,o=t.length;i<o;i+=4)e=t[i],n=t[i+1],r=t[i+2],t[i]=434.456-e-1.402*r,t[i+1]=119.541-e+.344*n+.714*r,t[i+2]=481.816-e-1.772*n;return t},_convertCmykToRgb:function(t){for(var e,n,r,i,o=0,s=0,a=t.length;s<a;s+=4)e=t[s]*(1/255),n=t[s+1]*(1/255),r=t[s+2]*(1/255),i=t[s+3]*(1/255),t[o++]=255+e*(-4.387332384609988*e+54.48615194189176*n+18.82290502165302*r+212.25662451639585*i-285.2331026137004)+n*(1.7149763477362134*n-5.6096736904047315*r-17.873870861415444*i-5.497006427196366)+r*(-2.5217340131683033*r-21.248923337353073*i+17.5119270841813)-i*(21.86122147463605*i+189.48180835922747),t[o++]=255+e*(8.841041422036149*e+60.118027045597366*n+6.871425592049007*r+31.159100130055922*i-79.2970844816548)+n*(-15.310361306967817*n+17.575251261109482*r+131.35250912493976*i-190.9453302588951)+r*(4.444339102852739*r+9.8632861493405*i-24.86741582555878)-i*(20.737325471181034*i+187.80453709719578),t[o++]=255+e*(.8842522430003296*e+8.078677503112928*n+30.89978309703729*r-.23883238689178934*i-14.183576799673286)+n*(10.49593273432072*n+63.02378494754052*r+50.606957656360734*i-112.23884253719248)+r*(.03296041114873217*r+115.60384449646641*i-193.58209356861505)-i*(22.33816807309886*i+180.12613974708367);return t.subarray(0,o)},getData:function(t){var e=t.width,n=t.height,r=t.forceRGB,i=void 0!==r&&r,s=t.isSourcePDF,a=void 0!==s&&s;if(this.numComponents>4)throw new o("Unsupported color mode");var c=this._getLinearizedBlockData(e,n,a);if(1===this.numComponents&&i){for(var u=c.length,f=new Uint8ClampedArray(3*u),l=0,h=0;h<u;h++){var p=c[h];f[l++]=p,f[l++]=p,f[l++]=p}return f}if(3===this.numComponents&&this._isColorConversionNeeded)return this._convertYccToRgb(c);if(4===this.numComponents){if(this._isColorConversionNeeded)return i?this._convertYcckToRgb(c):this._convertYcckToCmyk(c);if(i)return this._convertCmykToRgb(c)}return c}},d}();e.JpegImage=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.JpxImage=void 0;var r=n(1),i=n(133),o=function(){function t(t){this.message="JPX error: "+t}return t.prototype=new Error,t.prototype.name="JpxError",t.constructor=t,t}(),s=function(){var t={LL:0,LH:1,HL:1,HH:2};function e(){this.failOnCorruptedImage=!1}function n(t,e){t.x0=Math.ceil(e.XOsiz/t.XRsiz),t.x1=Math.ceil(e.Xsiz/t.XRsiz),t.y0=Math.ceil(e.YOsiz/t.YRsiz),t.y1=Math.ceil(e.Ysiz/t.YRsiz),t.width=t.x1-t.x0,t.height=t.y1-t.y0}function s(t,e){for(var n,r=t.SIZ,i=[],o=Math.ceil((r.Xsiz-r.XTOsiz)/r.XTsiz),s=Math.ceil((r.Ysiz-r.YTOsiz)/r.YTsiz),a=0;a<s;a++)for(var c=0;c<o;c++)(n={}).tx0=Math.max(r.XTOsiz+c*r.XTsiz,r.XOsiz),n.ty0=Math.max(r.YTOsiz+a*r.YTsiz,r.YOsiz),n.tx1=Math.min(r.XTOsiz+(c+1)*r.XTsiz,r.Xsiz),n.ty1=Math.min(r.YTOsiz+(a+1)*r.YTsiz,r.Ysiz),n.width=n.tx1-n.tx0,n.height=n.ty1-n.ty0,n.components=[],i.push(n);t.tiles=i;for(var u=0,f=r.Csiz;u<f;u++)for(var l=e[u],h=0,p=i.length;h<p;h++){var d={};n=i[h],d.tcx0=Math.ceil(n.tx0/l.XRsiz),d.tcy0=Math.ceil(n.ty0/l.YRsiz),d.tcx1=Math.ceil(n.tx1/l.XRsiz),d.tcy1=Math.ceil(n.ty1/l.YRsiz),d.width=d.tcx1-d.tcx0,d.height=d.tcy1-d.tcy0,n.components[u]=d}}function a(t,e,n){var r=e.codingStyleParameters,i={};return r.entropyCoderWithCustomPrecincts?(i.PPx=r.precinctsSizes[n].PPx,i.PPy=r.precinctsSizes[n].PPy):(i.PPx=15,i.PPy=15),i.xcb_=n>0?Math.min(r.xcb,i.PPx-1):Math.min(r.xcb,i.PPx),i.ycb_=n>0?Math.min(r.ycb,i.PPy-1):Math.min(r.ycb,i.PPy),i}function c(t,e,n){var r=1<<n.PPx,i=1<<n.PPy,o=0===e.resLevel,s=1<<n.PPx+(o?0:-1),a=1<<n.PPy+(o?0:-1),c=e.trx1>e.trx0?Math.ceil(e.trx1/r)-Math.floor(e.trx0/r):0,u=e.try1>e.try0?Math.ceil(e.try1/i)-Math.floor(e.try0/i):0,f=c*u;e.precinctParameters={precinctWidth:r,precinctHeight:i,numprecinctswide:c,numprecinctshigh:u,numprecincts:f,precinctWidthInSubband:s,precinctHeightInSubband:a}}function u(t,e,n){var r,i,o,s,a=n.xcb_,c=n.ycb_,u=1<<a,f=1<<c,l=e.tbx0>>a,h=e.tby0>>c,p=e.tbx1+u-1>>a,d=e.tby1+f-1>>c,m=e.resolution.precinctParameters,g=[],v=[];for(i=h;i<d;i++)for(r=l;r<p;r++){if((o={cbx:r,cby:i,tbx0:u*r,tby0:f*i,tbx1:u*(r+1),tby1:f*(i+1)}).tbx0_=Math.max(e.tbx0,o.tbx0),o.tby0_=Math.max(e.tby0,o.tby0),o.tbx1_=Math.min(e.tbx1,o.tbx1),o.tby1_=Math.min(e.tby1,o.tby1),s=Math.floor((o.tbx0_-e.tbx0)/m.precinctWidthInSubband)+Math.floor((o.tby0_-e.tby0)/m.precinctHeightInSubband)*m.numprecinctswide,o.precinctNumber=s,o.subbandType=e.type,o.Lblock=3,!(o.tbx1_<=o.tbx0_||o.tby1_<=o.tby0_)){g.push(o);var y=v[s];void 0!==y?(r<y.cbxMin?y.cbxMin=r:r>y.cbxMax&&(y.cbxMax=r),i<y.cbyMin?y.cbxMin=i:i>y.cbyMax&&(y.cbyMax=i)):v[s]=y={cbxMin:r,cbyMin:i,cbxMax:r,cbyMax:i},o.precinct=y}}e.codeblockParameters={codeblockWidth:a,codeblockHeight:c,numcodeblockwide:p-l+1,numcodeblockhigh:d-h+1},e.codeblocks=g,e.precincts=v}function f(t,e,n){for(var r=[],i=t.subbands,o=0,s=i.length;o<s;o++)for(var a=i[o].codeblocks,c=0,u=a.length;c<u;c++){var f=a[c];f.precinctNumber===e&&r.push(f)}return{layerNumber:n,codeblocks:r}}function l(t){for(var e=t.SIZ,n=t.currentTile.index,r=t.tiles[n],i=r.codingStyleDefaultParameters.layersCount,s=e.Csiz,a=0,c=0;c<s;c++)a=Math.max(a,r.components[c].codingStyleParameters.decompositionLevelsCount);var u=0,l=0,h=0,p=0;this.nextPacket=function(){for(;u<i;u++){for(;l<=a;l++){for(;h<s;h++){var t=r.components[h];if(!(l>t.codingStyleParameters.decompositionLevelsCount)){for(var e=t.resolutions[l],n=e.precinctParameters.numprecincts;p<n;){var c=f(e,p,u);return p++,c}p=0}}h=0}l=0}throw new o("Out of packets")}}function h(t){for(var e=t.SIZ,n=t.currentTile.index,r=t.tiles[n],i=r.codingStyleDefaultParameters.layersCount,s=e.Csiz,a=0,c=0;c<s;c++)a=Math.max(a,r.components[c].codingStyleParameters.decompositionLevelsCount);var u=0,l=0,h=0,p=0;this.nextPacket=function(){for(;u<=a;u++){for(;l<i;l++){for(;h<s;h++){var t=r.components[h];if(!(u>t.codingStyleParameters.decompositionLevelsCount)){for(var e=t.resolutions[u],n=e.precinctParameters.numprecincts;p<n;){var c=f(e,p,l);return p++,c}p=0}}h=0}l=0}throw new o("Out of packets")}}function p(t){var e,n,r,i,s=t.SIZ,a=t.currentTile.index,c=t.tiles[a],u=c.codingStyleDefaultParameters.layersCount,l=s.Csiz,h=0;for(r=0;r<l;r++){var p=c.components[r];h=Math.max(h,p.codingStyleParameters.decompositionLevelsCount)}var d=new Int32Array(h+1);for(n=0;n<=h;++n){var m=0;for(r=0;r<l;++r){var g=c.components[r].resolutions;n<g.length&&(m=Math.max(m,g[n].precinctParameters.numprecincts))}d[n]=m}e=0,n=0,r=0,i=0,this.nextPacket=function(){for(;n<=h;n++){for(;i<d[n];i++){for(;r<l;r++){var t=c.components[r];if(!(n>t.codingStyleParameters.decompositionLevelsCount)){var s=t.resolutions[n],a=s.precinctParameters.numprecincts;if(!(i>=a)){for(;e<u;){var p=f(s,i,e);return e++,p}e=0}}}r=0}i=0}throw new o("Out of packets")}}function d(t){var e=t.SIZ,n=t.currentTile.index,r=t.tiles[n],i=r.codingStyleDefaultParameters.layersCount,s=e.Csiz,a=v(r),c=a,u=0,l=0,h=0,p=0,d=0;this.nextPacket=function(){for(;d<c.maxNumHigh;d++){for(;p<c.maxNumWide;p++){for(;h<s;h++){for(var t=r.components[h],e=t.codingStyleParameters.decompositionLevelsCount;l<=e;l++){var n=t.resolutions[l],m=a.components[h].resolutions[l],v=g(p,d,m,c,n);if(null!==v){for(;u<i;){var y=f(n,v,u);return u++,y}u=0}}l=0}h=0}p=0}throw new o("Out of packets")}}function m(t){var e=t.SIZ,n=t.currentTile.index,r=t.tiles[n],i=r.codingStyleDefaultParameters.layersCount,s=e.Csiz,a=v(r),c=0,u=0,l=0,h=0,p=0;this.nextPacket=function(){for(;l<s;++l){for(var t=r.components[l],e=a.components[l],n=t.codingStyleParameters.decompositionLevelsCount;p<e.maxNumHigh;p++){for(;h<e.maxNumWide;h++){for(;u<=n;u++){var d=t.resolutions[u],m=e.resolutions[u],v=g(h,p,m,e,d);if(null!==v){for(;c<i;){var y=f(d,v,c);return c++,y}c=0}}u=0}h=0}p=0}throw new o("Out of packets")}}function g(t,e,n,r,i){var o=t*r.minWidth,s=e*r.minHeight;if(o%n.width!=0||s%n.height!=0)return null;var a=s/n.width*i.precinctParameters.numprecinctswide;return o/n.height+a}function v(t){for(var e=t.components.length,n=Number.MAX_VALUE,r=Number.MAX_VALUE,i=0,o=0,s=new Array(e),a=0;a<e;a++){for(var c=t.components[a],u=c.codingStyleParameters.decompositionLevelsCount,f=new Array(u+1),l=Number.MAX_VALUE,h=Number.MAX_VALUE,p=0,d=0,m=1,g=u;g>=0;--g){var v=c.resolutions[g],y=m*v.precinctParameters.precinctWidth,b=m*v.precinctParameters.precinctHeight;l=Math.min(l,y),h=Math.min(h,b),p=Math.max(p,v.precinctParameters.numprecinctswide),d=Math.max(d,v.precinctParameters.numprecinctshigh),f[g]={width:y,height:b},m<<=1}n=Math.min(n,l),r=Math.min(r,h),i=Math.max(i,p),o=Math.max(o,d),s[a]={resolutions:f,minWidth:l,minHeight:h,maxNumWide:p,maxNumHigh:d}}return{components:s,minWidth:n,minHeight:r,maxNumWide:i,maxNumHigh:o}}function y(t){for(var e=t.SIZ,n=t.currentTile.index,r=t.tiles[n],i=e.Csiz,s=0;s<i;s++){for(var f=r.components[s],g=f.codingStyleParameters.decompositionLevelsCount,v=[],y=[],b=0;b<=g;b++){var w,x=a(0,f,b),S={},P=1<<g-b;if(S.trx0=Math.ceil(f.tcx0/P),S.try0=Math.ceil(f.tcy0/P),S.trx1=Math.ceil(f.tcx1/P),S.try1=Math.ceil(f.tcy1/P),S.resLevel=b,c(0,S,x),v.push(S),0===b)(w={}).type="LL",w.tbx0=Math.ceil(f.tcx0/P),w.tby0=Math.ceil(f.tcy0/P),w.tbx1=Math.ceil(f.tcx1/P),w.tby1=Math.ceil(f.tcy1/P),w.resolution=S,u(0,w,x),y.push(w),S.subbands=[w];else{var C=1<<g-b+1,T=[];(w={}).type="HL",w.tbx0=Math.ceil(f.tcx0/C-.5),w.tby0=Math.ceil(f.tcy0/C),w.tbx1=Math.ceil(f.tcx1/C-.5),w.tby1=Math.ceil(f.tcy1/C),w.resolution=S,u(0,w,x),y.push(w),T.push(w),(w={}).type="LH",w.tbx0=Math.ceil(f.tcx0/C),w.tby0=Math.ceil(f.tcy0/C-.5),w.tbx1=Math.ceil(f.tcx1/C),w.tby1=Math.ceil(f.tcy1/C-.5),w.resolution=S,u(0,w,x),y.push(w),T.push(w),(w={}).type="HH",w.tbx0=Math.ceil(f.tcx0/C-.5),w.tby0=Math.ceil(f.tcy0/C-.5),w.tbx1=Math.ceil(f.tcx1/C-.5),w.tby1=Math.ceil(f.tcy1/C-.5),w.resolution=S,u(0,w,x),y.push(w),T.push(w),S.subbands=T}}f.resolutions=v,f.subbands=y}var k=r.codingStyleDefaultParameters.progressionOrder;switch(k){case 0:r.packetsIterator=new l(t);break;case 1:r.packetsIterator=new h(t);break;case 2:r.packetsIterator=new p(t);break;case 3:r.packetsIterator=new d(t);break;case 4:r.packetsIterator=new m(t);break;default:throw new o("Unsupported progression order ".concat(k))}}function b(t,e,n,i){var o,s=0,a=0,c=!1;function u(t){for(;a<t;){var r=e[n+s];s++,c?(o=o<<7|r,a+=7,c=!1):(o=o<<8|r,a+=8),255===r&&(c=!0)}return o>>>(a-=t)&(1<<t)-1}function f(t){return 255===e[n+s-1]&&e[n+s]===t?(l(1),!0):255===e[n+s]&&e[n+s+1]===t&&(l(2),!0)}function l(t){s+=t}function h(){a=0,c&&(s++,c=!1)}function p(){if(0===u(1))return 1;if(0===u(1))return 2;var t=u(2);return t<3?t+3:(t=u(5))<31?t+6:(t=u(7))+37}for(var d=t.currentTile.index,m=t.tiles[d],g=t.COD.sopMarkerUsed,v=t.COD.ephMarkerUsed,y=m.packetsIterator;s<i;){h(),g&&f(145)&&l(4);var b=y.nextPacket();if(u(1)){for(var w,x=b.layerNumber,S=[],T=0,k=b.codeblocks.length;T<k;T++){var O=(w=b.codeblocks[T]).precinct,I=w.cbx-O.cbxMin,E=w.cby-O.cbyMin,L=!1,A=!1;if(void 0!==w.included)L=!!u(1);else{var M,_;if(void 0!==(O=w.precinct).inclusionTree)M=O.inclusionTree;else{var D=O.cbxMax-O.cbxMin+1,R=O.cbyMax-O.cbyMin+1;M=new C(D,R,x),_=new P(D,R),O.inclusionTree=M,O.zeroBitPlanesTree=_}if(M.reset(I,E,x))for(;;){if(!u(1)){M.incrementValue(x);break}if(!M.nextLevel()){w.included=!0,L=A=!0;break}}}if(L){if(A){for((_=O.zeroBitPlanesTree).reset(I,E);;)if(u(1)){if(!_.nextLevel())break}else _.incrementValue();w.zeroBitPlanes=_.value}for(var B=p();u(1);)w.Lblock++;var U=(0,r.log2)(B),N=u((B<1<<U?U-1:U)+w.Lblock);S.push({codeblock:w,codingpasses:B,dataLength:N})}}for(h(),v&&f(146);S.length>0;){var F=S.shift();void 0===(w=F.codeblock).data&&(w.data=[]),w.data.push({data:e,start:n+s,end:n+s+F.dataLength,codingpasses:F.codingpasses}),s+=F.dataLength}}}return s}function w(t,e,n,r,o,s,a,c){for(var u=r.tbx0,f=r.tby0,l=r.tbx1-r.tbx0,h=r.codeblocks,p="H"===r.type.charAt(0)?1:0,d="H"===r.type.charAt(1)?e:0,m=0,g=h.length;m<g;++m){var v=h[m],y=v.tbx1_-v.tbx0_,b=v.tby1_-v.tby0_;if(0!==y&&0!==b&&void 0!==v.data){var w,x;w=new T(y,b,v.subbandType,v.zeroBitPlanes,s),x=2;var S,P,C,k=v.data,O=0,I=0;for(S=0,P=k.length;S<P;S++)O+=(C=k[S]).end-C.start,I+=C.codingpasses;var E=new Uint8Array(O),L=0;for(S=0,P=k.length;S<P;S++){var A=(C=k[S]).data.subarray(C.start,C.end);E.set(A,L),L+=A.length}var M=new i.ArithmeticDecoder(E,0,O);for(w.setDecoder(M),S=0;S<I;S++){switch(x){case 0:w.runSignificancePropagationPass();break;case 1:w.runMagnitudeRefinementPass();break;case 2:w.runCleanupPass(),c&&w.checkSegmentationSymbol()}x=(x+1)%3}var _,D,R,B=v.tbx0_-u+(v.tby0_-f)*l,U=w.coefficentsSign,N=w.coefficentsMagnitude,F=w.bitsDecoded,j=a?0:.5;L=0;var z="LL"!==r.type;for(S=0;S<b;S++){var H=2*(B/l|0)*(e-l)+p+d;for(_=0;_<y;_++){if(0!==(D=N[L])){D=(D+j)*o,0!==U[L]&&(D=-D),R=F[L];var W=z?H+(B<<1):B;t[W]=a&&R>=s?D:D*(1<<s-R)}B++,L++}B+=l-y}}}}function x(e,n,r){for(var i=n.components[r],o=i.codingStyleParameters,s=i.quantizationParameters,a=o.decompositionLevelsCount,c=s.SPqcds,u=s.scalarExpounded,f=s.guardBits,l=o.segmentationSymbolUsed,h=e.components[r].precision,p=o.reversibleTransformation,d=p?new I:new O,m=[],g=0,v=0;v<=a;v++){for(var y=i.resolutions[v],b=y.trx1-y.trx0,x=y.try1-y.try0,S=new Float32Array(b*x),P=0,C=y.subbands.length;P<C;P++){var T,k;u?(T=c[g].mu,k=c[g].epsilon,g++):(T=c[0].mu,k=c[0].epsilon+(v>0?1-v:0));var E=y.subbands[P],L=t[E.type];w(S,b,0,E,p?1:Math.pow(2,h+L-k)*(1+T/2048),f+k-1,p,l)}m.push({width:b,height:x,items:S})}var A=d.calculate(m,i.tcx0,i.tcy0);return{left:i.tcx0,top:i.tcy0,width:A.width,height:A.height,items:A.items}}function S(t,e){for(var n=t.SIZ.Csiz,r=t.tiles[e],i=0;i<n;i++){var o=r.components[i],s=void 0!==t.currentTile.QCC[i]?t.currentTile.QCC[i]:t.currentTile.QCD;o.quantizationParameters=s;var a=void 0!==t.currentTile.COC[i]?t.currentTile.COC[i]:t.currentTile.COD;o.codingStyleParameters=a}r.codingStyleDefaultParameters=t.currentTile.COD}e.prototype={parse:function(t){if(65359!==(0,r.readUint16)(t,0))for(var e=0,n=t.length;e<n;){var i=8,s=(0,r.readUint32)(t,e),a=(0,r.readUint32)(t,e+4);if(e+=i,1===s&&(s=4294967296*(0,r.readUint32)(t,e)+(0,r.readUint32)(t,e+4),e+=8,i+=8),0===s&&(s=n-e+i),s<i)throw new o("Invalid box field size");var c=s-i,u=!0;switch(a){case 1785737832:u=!1;break;case 1668246642:var f=t[e];if(1===f){var l=(0,r.readUint32)(t,e+3);switch(l){case 16:case 17:case 18:break;default:(0,r.warn)("Unknown colorspace "+l)}}else 2===f&&(0,r.info)("ICC profile not supported");break;case 1785737827:this.parseCodestream(t,e,e+c);break;case 1783636e3:218793738!==(0,r.readUint32)(t,e)&&(0,r.warn)("Invalid JP2 signature");break;case 1783634458:case 1718909296:case 1920099697:case 1919251232:case 1768449138:break;default:var h=String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,255&a);(0,r.warn)("Unsupported header type "+a+" ("+h+")")}u&&(e+=c)}else this.parseCodestream(t,0,t.length)},parseImageProperties:function(t){for(var e=t.getByte();e>=0;){if(65361===(e<<8|(e=t.getByte()))){t.skip(4);var n=t.getInt32()>>>0,r=t.getInt32()>>>0,i=t.getInt32()>>>0,s=t.getInt32()>>>0;t.skip(16);var a=t.getUint16();return this.width=n-i,this.height=r-s,this.componentsCount=a,void(this.bitsPerComponent=8)}}throw new o("No size marker found in JPX stream")},parseCodestream:function(t,e,i){var a={},c=!1;try{for(var u=e;u+1<i;){var f=(0,r.readUint16)(t,u);u+=2;var l,h,p,d,m,g,v=0;switch(f){case 65359:a.mainHeader=!0;break;case 65497:break;case 65361:v=(0,r.readUint16)(t,u);var w={};w.Xsiz=(0,r.readUint32)(t,u+4),w.Ysiz=(0,r.readUint32)(t,u+8),w.XOsiz=(0,r.readUint32)(t,u+12),w.YOsiz=(0,r.readUint32)(t,u+16),w.XTsiz=(0,r.readUint32)(t,u+20),w.YTsiz=(0,r.readUint32)(t,u+24),w.XTOsiz=(0,r.readUint32)(t,u+28),w.YTOsiz=(0,r.readUint32)(t,u+32);var P=(0,r.readUint16)(t,u+36);w.Csiz=P;var C=[];l=u+38;for(var T=0;T<P;T++){var k={precision:1+(127&t[l]),isSigned:!!(128&t[l]),XRsiz:t[l+1],YRsiz:t[l+2]};l+=3,n(k,w),C.push(k)}a.SIZ=w,a.components=C,s(a,C),a.QCC=[],a.COC=[];break;case 65372:v=(0,r.readUint16)(t,u);var O={};switch(l=u+2,31&(h=t[l++])){case 0:d=8,m=!0;break;case 1:d=16,m=!1;break;case 2:d=16,m=!0;break;default:throw new Error("Invalid SQcd value "+h)}for(O.noQuantization=8===d,O.scalarExpounded=m,O.guardBits=h>>5,p=[];l<v+u;){var I={};8===d?(I.epsilon=t[l++]>>3,I.mu=0):(I.epsilon=t[l]>>3,I.mu=(7&t[l])<<8|t[l+1],l+=2),p.push(I)}O.SPqcds=p,a.mainHeader?a.QCD=O:(a.currentTile.QCD=O,a.currentTile.QCC=[]);break;case 65373:v=(0,r.readUint16)(t,u);var E,L={};switch(l=u+2,a.SIZ.Csiz<257?E=t[l++]:(E=(0,r.readUint16)(t,l),l+=2),31&(h=t[l++])){case 0:d=8,m=!0;break;case 1:d=16,m=!1;break;case 2:d=16,m=!0;break;default:throw new Error("Invalid SQcd value "+h)}for(L.noQuantization=8===d,L.scalarExpounded=m,L.guardBits=h>>5,p=[];l<v+u;)I={},8===d?(I.epsilon=t[l++]>>3,I.mu=0):(I.epsilon=t[l]>>3,I.mu=(7&t[l])<<8|t[l+1],l+=2),p.push(I);L.SPqcds=p,a.mainHeader?a.QCC[E]=L:a.currentTile.QCC[E]=L;break;case 65362:v=(0,r.readUint16)(t,u);var A={};l=u+2;var M=t[l++];A.entropyCoderWithCustomPrecincts=!!(1&M),A.sopMarkerUsed=!!(2&M),A.ephMarkerUsed=!!(4&M),A.progressionOrder=t[l++],A.layersCount=(0,r.readUint16)(t,l),l+=2,A.multipleComponentTransform=t[l++],A.decompositionLevelsCount=t[l++],A.xcb=2+(15&t[l++]),A.ycb=2+(15&t[l++]);var _=t[l++];if(A.selectiveArithmeticCodingBypass=!!(1&_),A.resetContextProbabilities=!!(2&_),A.terminationOnEachCodingPass=!!(4&_),A.verticallyStripe=!!(8&_),A.predictableTermination=!!(16&_),A.segmentationSymbolUsed=!!(32&_),A.reversibleTransformation=t[l++],A.entropyCoderWithCustomPrecincts){for(var D=[];l<v+u;){var R=t[l++];D.push({PPx:15&R,PPy:R>>4})}A.precinctsSizes=D}var B=[];if(A.selectiveArithmeticCodingBypass&&B.push("selectiveArithmeticCodingBypass"),A.resetContextProbabilities&&B.push("resetContextProbabilities"),A.terminationOnEachCodingPass&&B.push("terminationOnEachCodingPass"),A.verticallyStripe&&B.push("verticallyStripe"),A.predictableTermination&&B.push("predictableTermination"),B.length>0)throw c=!0,new Error("Unsupported COD options ("+B.join(", ")+")");a.mainHeader?a.COD=A:(a.currentTile.COD=A,a.currentTile.COC=[]);break;case 65424:v=(0,r.readUint16)(t,u),(g={}).index=(0,r.readUint16)(t,u+2),g.length=(0,r.readUint32)(t,u+4),g.dataEnd=g.length+u-2,g.partIndex=t[u+8],g.partsCount=t[u+9],a.mainHeader=!1,0===g.partIndex&&(g.COD=a.COD,g.COC=a.COC.slice(0),g.QCD=a.QCD,g.QCC=a.QCC.slice(0)),a.currentTile=g;break;case 65427:0===(g=a.currentTile).partIndex&&(S(a,g.index),y(a)),b(a,t,u,v=g.dataEnd-u);break;case 65365:case 65367:case 65368:case 65380:v=(0,r.readUint16)(t,u);break;case 65363:throw new Error("Codestream code 0xFF53 (COC) is not implemented");default:throw new Error("Unknown codestream code: "+f.toString(16))}u+=v}}catch(t){if(c||this.failOnCorruptedImage)throw new o(t.message);(0,r.warn)("JPX: Trying to recover from: "+t.message)}this.tiles=function(t){for(var e=t.SIZ,n=t.components,r=e.Csiz,i=[],o=0,s=t.tiles.length;o<s;o++){var a,c=t.tiles[o],u=[];for(a=0;a<r;a++)u[a]=x(t,c,a);var f,l,h,p,d,m,g,v=u[0],y=new Uint8ClampedArray(v.items.length*r),b={left:v.left,top:v.top,width:v.width,height:v.height,items:y},w=0;if(c.codingStyleDefaultParameters.multipleComponentTransform){var S=4===r,P=u[0].items,C=u[1].items,T=u[2].items,k=S?u[3].items:null;f=n[0].precision-8,l=.5+(128<<f);var O=c.components[0],I=r-3;if(p=P.length,O.codingStyleParameters.reversibleTransformation)for(h=0;h<p;h++,w+=I){d=P[h]+l,m=C[h],g=T[h];var E=d-(g+m>>2);y[w++]=E+g>>f,y[w++]=E>>f,y[w++]=E+m>>f}else for(h=0;h<p;h++,w+=I)d=P[h]+l,m=C[h],g=T[h],y[w++]=d+1.402*g>>f,y[w++]=d-.34413*m-.71414*g>>f,y[w++]=d+1.772*m>>f;if(S)for(h=0,w=3;h<p;h++,w+=4)y[w]=k[h]+l>>f}else for(a=0;a<r;a++){var L=u[a].items;for(f=n[a].precision-8,l=.5+(128<<f),w=a,h=0,p=L.length;h<p;h++)y[w]=L[h]+l>>f,w+=r}i.push(b)}return i}(a),this.width=a.SIZ.Xsiz-a.SIZ.XOsiz,this.height=a.SIZ.Ysiz-a.SIZ.YOsiz,this.componentsCount=a.SIZ.Csiz}};var P=function(){function t(t,e){var n=(0,r.log2)(Math.max(t,e))+1;this.levels=[];for(var i=0;i<n;i++){var o={width:t,height:e,items:[]};this.levels.push(o),t=Math.ceil(t/2),e=Math.ceil(e/2)}}return t.prototype={reset:function(t,e){for(var n,r=0,i=0;r<this.levels.length;){var o=t+e*(n=this.levels[r]).width;if(void 0!==n.items[o]){i=n.items[o];break}n.index=o,t>>=1,e>>=1,r++}r--,(n=this.levels[r]).items[n.index]=i,this.currentLevel=r,delete this.value},incrementValue:function(){var t=this.levels[this.currentLevel];t.items[t.index]++},nextLevel:function(){var t=this.currentLevel,e=this.levels[t],n=e.items[e.index];return--t<0?(this.value=n,!1):(this.currentLevel=t,(e=this.levels[t]).items[e.index]=n,!0)}},t}(),C=function(){function t(t,e,n){var i=(0,r.log2)(Math.max(t,e))+1;this.levels=[];for(var o=0;o<i;o++){for(var s=new Uint8Array(t*e),a=0,c=s.length;a<c;a++)s[a]=n;var u={width:t,height:e,items:s};this.levels.push(u),t=Math.ceil(t/2),e=Math.ceil(e/2)}}return t.prototype={reset:function(t,e,n){for(var r=0;r<this.levels.length;){var i=this.levels[r],o=t+e*i.width;i.index=o;var s=i.items[o];if(255===s)break;if(s>n)return this.currentLevel=r,this.propagateValues(),!1;t>>=1,e>>=1,r++}return this.currentLevel=r-1,!0},incrementValue:function(t){var e=this.levels[this.currentLevel];e.items[e.index]=t+1,this.propagateValues()},propagateValues:function(){for(var t=this.currentLevel,e=this.levels[t],n=e.items[e.index];--t>=0;)(e=this.levels[t]).items[e.index]=n},nextLevel:function(){var t=this.currentLevel,e=this.levels[t],n=e.items[e.index];return e.items[e.index]=255,!(--t<0)&&(this.currentLevel=t,(e=this.levels[t]).items[e.index]=n,!0)}},t}(),T=function(){var t=new Uint8Array([0,5,8,0,3,7,8,0,4,7,8,0,0,0,0,0,1,6,8,0,3,7,8,0,4,7,8,0,0,0,0,0,2,6,8,0,3,7,8,0,4,7,8,0,0,0,0,0,2,6,8,0,3,7,8,0,4,7,8,0,0,0,0,0,2,6,8,0,3,7,8,0,4,7,8]),e=new Uint8Array([0,3,4,0,5,7,7,0,8,8,8,0,0,0,0,0,1,3,4,0,6,7,7,0,8,8,8,0,0,0,0,0,2,3,4,0,6,7,7,0,8,8,8,0,0,0,0,0,2,3,4,0,6,7,7,0,8,8,8,0,0,0,0,0,2,3,4,0,6,7,7,0,8,8,8]),n=new Uint8Array([0,1,2,0,1,2,2,0,2,2,2,0,0,0,0,0,3,4,5,0,4,5,5,0,5,5,5,0,0,0,0,0,6,7,7,0,7,7,7,0,7,7,7,0,0,0,0,0,8,8,8,0,8,8,8,0,8,8,8,0,0,0,0,0,8,8,8,0,8,8,8,0,8,8,8]);function r(r,i,o,s,a){this.width=r,this.height=i,this.contextLabelTable="HH"===o?n:"HL"===o?e:t;var c=r*i;this.neighborsSignificance=new Uint8Array(c),this.coefficentsSign=new Uint8Array(c),this.coefficentsMagnitude=a>14?new Uint32Array(c):a>6?new Uint16Array(c):new Uint8Array(c),this.processingFlags=new Uint8Array(c);var u=new Uint8Array(c);if(0!==s)for(var f=0;f<c;f++)u[f]=s;this.bitsDecoded=u,this.reset()}return r.prototype={setDecoder:function(t){this.decoder=t},reset:function(){this.contexts=new Int8Array(19),this.contexts[0]=8,this.contexts[17]=92,this.contexts[18]=6},setNeighborsSignificance:function(t,e,n){var r,i=this.neighborsSignificance,o=this.width,s=this.height,a=e>0,c=e+1<o;t>0&&(r=n-o,a&&(i[r-1]+=16),c&&(i[r+1]+=16),i[r]+=4),t+1<s&&(r=n+o,a&&(i[r-1]+=16),c&&(i[r+1]+=16),i[r]+=4),a&&(i[n-1]+=1),c&&(i[n+1]+=1),i[n]|=128},runSignificancePropagationPass:function(){for(var t=this.decoder,e=this.width,n=this.height,r=this.coefficentsMagnitude,i=this.coefficentsSign,o=this.neighborsSignificance,s=this.processingFlags,a=this.contexts,c=this.contextLabelTable,u=this.bitsDecoded,f=0;f<n;f+=4)for(var l=0;l<e;l++)for(var h=f*e+l,p=0;p<4;p++,h+=e){var d=f+p;if(d>=n)break;if(s[h]&=-2,!r[h]&&o[h]){var m=c[o[h]];if(t.readBit(a,m)){var g=this.decodeSignBit(d,l,h);i[h]=g,r[h]=1,this.setNeighborsSignificance(d,l,h),s[h]|=2}u[h]++,s[h]|=1}}},decodeSignBit:function(t,e,n){var r,i,o,s,a,c,u=this.width,f=this.height,l=this.coefficentsMagnitude,h=this.coefficentsSign;s=e>0&&0!==l[n-1],e+1<u&&0!==l[n+1]?(o=h[n+1],r=s?1-o-(i=h[n-1]):1-o-o):r=s?1-(i=h[n-1])-i:0;var p=3*r;return s=t>0&&0!==l[n-u],t+1<f&&0!==l[n+u]?(o=h[n+u],r=s?1-o-(i=h[n-u])+p:1-o-o+p):r=s?1-(i=h[n-u])-i+p:p,r>=0?(a=9+r,c=this.decoder.readBit(this.contexts,a)):(a=9-r,c=1^this.decoder.readBit(this.contexts,a)),c},runMagnitudeRefinementPass:function(){for(var t,e=this.decoder,n=this.width,r=this.height,i=this.coefficentsMagnitude,o=this.neighborsSignificance,s=this.contexts,a=this.bitsDecoded,c=this.processingFlags,u=n*r,f=4*n,l=0;l<u;l=t){t=Math.min(u,l+f);for(var h=0;h<n;h++)for(var p=l+h;p<t;p+=n)if(i[p]&&0==(1&c[p])){var d=16;if(0!=(2&c[p]))c[p]^=2,d=0===(127&o[p])?15:14;var m=e.readBit(s,d);i[p]=i[p]<<1|m,a[p]++,c[p]|=1}}},runCleanupPass:function(){for(var t,e=this.decoder,n=this.width,r=this.height,i=this.neighborsSignificance,o=this.coefficentsMagnitude,s=this.coefficentsSign,a=this.contexts,c=this.contextLabelTable,u=this.bitsDecoded,f=this.processingFlags,l=n,h=2*n,p=3*n,d=0;d<r;d=t){t=Math.min(d+4,r);for(var m=d*n,g=d+3<r,v=0;v<n;v++){var y,b=m+v,w=0,x=b,S=d;if(g&&0===f[b]&&0===f[b+l]&&0===f[b+h]&&0===f[b+p]&&0===i[b]&&0===i[b+l]&&0===i[b+h]&&0===i[b+p]){if(!e.readBit(a,18)){u[b]++,u[b+l]++,u[b+h]++,u[b+p]++;continue}0!==(w=e.readBit(a,17)<<1|e.readBit(a,17))&&(S=d+w,x+=w*n),y=this.decodeSignBit(S,v,x),s[x]=y,o[x]=1,this.setNeighborsSignificance(S,v,x),f[x]|=2,x=b;for(var P=d;P<=S;P++,x+=n)u[x]++;w++}for(S=d+w;S<t;S++,x+=n)if(!o[x]&&0==(1&f[x])){var C=c[i[x]];1===e.readBit(a,C)&&(y=this.decodeSignBit(S,v,x),s[x]=y,o[x]=1,this.setNeighborsSignificance(S,v,x),f[x]|=2),u[x]++}}}},checkSegmentationSymbol:function(){var t=this.decoder,e=this.contexts;if(10!==(t.readBit(e,17)<<3|t.readBit(e,17)<<2|t.readBit(e,17)<<1|t.readBit(e,17)))throw new o("Invalid segmentation symbol")}},r}(),k=function(){function t(){}return t.prototype.calculate=function(t,e,n){for(var r=t[0],i=1,o=t.length;i<o;i++)r=this.iterate(r,t[i],e,n);return r},t.prototype.extend=function(t,e,n){var r=e-1,i=e+1,o=e+n-2,s=e+n;t[r--]=t[i++],t[s++]=t[o--],t[r--]=t[i++],t[s++]=t[o--],t[r--]=t[i++],t[s++]=t[o--],t[r]=t[i],t[s]=t[o]},t.prototype.iterate=function(t,e,n,r){var i,o,s,a,c,u,f=t.width,l=t.height,h=t.items,p=e.width,d=e.height,m=e.items;for(s=0,i=0;i<l;i++)for(a=2*i*p,o=0;o<f;o++,s++,a+=2)m[a]=h[s];h=t.items=null;var g=new Float32Array(p+8);if(1===p){if(0!=(1&n))for(u=0,s=0;u<d;u++,s+=p)m[s]*=.5}else for(u=0,s=0;u<d;u++,s+=p)g.set(m.subarray(s,s+p),4),this.extend(g,4,p),this.filter(g,4,p),m.set(g.subarray(4,4+p),s);var v=16,y=[];for(i=0;i<v;i++)y.push(new Float32Array(d+8));var b,w=0;if(t=4+d,1===d){if(0!=(1&r))for(c=0;c<p;c++)m[c]*=.5}else for(c=0;c<p;c++){if(0===w){for(v=Math.min(p-c,v),s=c,a=4;a<t;s+=p,a++)for(b=0;b<v;b++)y[b][a]=m[s+b];w=v}var x=y[--w];if(this.extend(x,4,d),this.filter(x,4,d),0===w)for(s=c-v+1,a=4;a<t;s+=p,a++)for(b=0;b<v;b++)m[s+b]=y[b][a]}return{width:p,height:d,items:m}},t}(),O=function(){function t(){k.call(this)}return t.prototype=Object.create(k.prototype),t.prototype.filter=function(t,e,n){var r,i,o,s,a=n>>1,c=-1.586134342059924,u=-.052980118572961,f=.882911075530934,l=.443506852043971,h=1.230174104914001;for(r=(e|=0)-3,i=a+4;i--;r+=2)t[r]*=.8128930661159609;for(o=l*t[(r=e-2)-1],i=a+3;i--&&(s=l*t[r+1],t[r]=h*t[r]-o-s,i--);r+=2)o=l*t[(r+=2)+1],t[r]=h*t[r]-o-s;for(o=f*t[(r=e-1)-1],i=a+2;i--&&(s=f*t[r+1],t[r]-=o+s,i--);r+=2)o=f*t[(r+=2)+1],t[r]-=o+s;for(o=u*t[(r=e)-1],i=a+1;i--&&(s=u*t[r+1],t[r]-=o+s,i--);r+=2)o=u*t[(r+=2)+1],t[r]-=o+s;if(0!==a)for(o=c*t[(r=e+1)-1],i=a;i--&&(s=c*t[r+1],t[r]-=o+s,i--);r+=2)o=c*t[(r+=2)+1],t[r]-=o+s},t}(),I=function(){function t(){k.call(this)}return t.prototype=Object.create(k.prototype),t.prototype.filter=function(t,e,n){var r,i,o=n>>1;for(r=e|=0,i=o+1;i--;r+=2)t[r]-=t[r-1]+t[r+1]+2>>2;for(r=e+1,i=o;i--;r+=2)t[r]+=t[r-1]+t[r+1]>>1},t}();return e}();e.JpxImage=s}])});
|
1
|
+
/**
|
2
|
+
* @licstart The following is the entire license notice for the
|
3
|
+
* Javascript code in this page
|
4
|
+
*
|
5
|
+
* Copyright 2020 Mozilla Foundation
|
6
|
+
*
|
7
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
+
* you may not use this file except in compliance with the License.
|
9
|
+
* You may obtain a copy of the License at
|
10
|
+
*
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
*
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
+
* See the License for the specific language governing permissions and
|
17
|
+
* limitations under the License.
|
18
|
+
*
|
19
|
+
* @licend The above is the entire license notice for the
|
20
|
+
* Javascript code in this page
|
21
|
+
*/
|
22
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("pdfjs-dist/image_decoders/pdf.image_decoders",[],t):"object"==typeof exports?exports["pdfjs-dist/image_decoders/pdf.image_decoders"]=t():e["pdfjs-dist/image_decoders/pdf.image_decoders"]=e.pdfjsImageDecoders=t()}(this,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getVerbosityLevel",{enumerable:!0,get:function(){return r.getVerbosityLevel}}),Object.defineProperty(t,"setVerbosityLevel",{enumerable:!0,get:function(){return r.setVerbosityLevel}}),Object.defineProperty(t,"Jbig2mage",{enumerable:!0,get:function(){return i.Jbig2mage}}),Object.defineProperty(t,"JpegImage",{enumerable:!0,get:function(){return s.JpegImage}}),Object.defineProperty(t,"JpxImage",{enumerable:!0,get:function(){return o.JpxImage}});var r=n(1),i=n(4),s=n(8),o=n(9)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.arrayByteLength=u,t.arraysToBytes=function(e){const t=e.length;if(1===t&&e[0]instanceof Uint8Array)return e[0];let n=0;for(let r=0;r<t;r++)n+=u(e[r]);let r=0;const i=new Uint8Array(n);for(let n=0;n<t;n++){let t=e[n];t instanceof Uint8Array||(t="string"==typeof t?f(t):new Uint8Array(t));const s=t.byteLength;i.set(t,r),r+=s}return i},t.assert=a,t.bytesToString=function(e){a(null!==e&&"object"==typeof e&&void 0!==e.length,"Invalid argument for bytesToString");const t=e.length;if(t<8192)return String.fromCharCode.apply(null,e);const n=[];for(let r=0;r<t;r+=8192){const i=Math.min(r+8192,t),s=e.subarray(r,i);n.push(String.fromCharCode.apply(null,s))}return n.join("")},t.createPromiseCapability=function(){const e=Object.create(null);let t=!1;return Object.defineProperty(e,"settled",{get:()=>t}),e.promise=new Promise((function(n,r){e.resolve=function(e){t=!0,n(e)},e.reject=function(e){t=!0,r(e)}})),e},t.getVerbosityLevel=function(){return i},t.info=function(e){i>=r.INFOS&&console.log("Info: "+e)},t.isArrayBuffer=function(e){return"object"==typeof e&&null!==e&&void 0!==e.byteLength},t.isArrayEqual=function(e,t){if(e.length!==t.length)return!1;return e.every((function(e,n){return e===t[n]}))},t.isBool=function(e){return"boolean"==typeof e},t.isEmptyObj=function(e){for(const t in e)return!1;return!0},t.isNum=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isSameOrigin=function(e,t){let n;try{if(n=new URL(e),!n.origin||"null"===n.origin)return!1}catch(e){return!1}const r=new URL(t,n);return n.origin===r.origin},t.createValidAbsoluteUrl=function(e,t){if(!e)return null;try{const n=t?new URL(e,t):new URL(e);if(function(e){if(!e)return!1;switch(e.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}(n))return n}catch(e){}return null},t.removeNullCharacters=function(e){if("string"!=typeof e)return s("The argument for removeNullCharacters must be a string."),e;return e.replace(h,"")},t.setVerbosityLevel=function(e){Number.isInteger(e)&&(i=e)},t.shadow=c,t.string32=function(e){return String.fromCharCode(e>>24&255,e>>16&255,e>>8&255,255&e)},t.stringToBytes=f,t.stringToPDFString=function(e){const t=e.length,n=[];if("þ"===e[0]&&"ÿ"===e[1])for(let r=2;r<t;r+=2)n.push(String.fromCharCode(e.charCodeAt(r)<<8|e.charCodeAt(r+1)));else if("ÿ"===e[0]&&"þ"===e[1])for(let r=2;r<t;r+=2)n.push(String.fromCharCode(e.charCodeAt(r+1)<<8|e.charCodeAt(r)));else for(let r=0;r<t;++r){const t=b[e.charCodeAt(r)];n.push(t?String.fromCharCode(t):e.charAt(r))}return n.join("")},t.stringToUTF8String=function(e){return decodeURIComponent(escape(e))},t.utf8StringToString=function(e){return unescape(encodeURIComponent(e))},t.warn=s,t.unreachable=o,t.IsEvalSupportedCached=t.IsLittleEndianCached=t.createObjectURL=t.FormatError=t.Util=t.UnknownErrorException=t.UnexpectedResponseException=t.TextRenderingMode=t.StreamType=t.PermissionFlag=t.PasswordResponses=t.PasswordException=t.MissingPDFException=t.InvalidPDFException=t.AbortException=t.CMapCompressionType=t.ImageKind=t.FontType=t.AnnotationType=t.AnnotationStateModelType=t.AnnotationReviewState=t.AnnotationReplyType=t.AnnotationMarkedState=t.AnnotationFlag=t.AnnotationFieldFlag=t.AnnotationBorderStyleType=t.UNSUPPORTED_FEATURES=t.VerbosityLevel=t.OPS=t.IDENTITY_MATRIX=t.FONT_IDENTITY_MATRIX=t.BaseException=void 0,n(2);t.IDENTITY_MATRIX=[1,0,0,1,0,0];t.FONT_IDENTITY_MATRIX=[.001,0,0,.001,0,0];t.PermissionFlag={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048};t.TextRenderingMode={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4};t.ImageKind={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3};t.AnnotationType={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26};t.AnnotationStateModelType={MARKED:"Marked",REVIEW:"Review"};t.AnnotationMarkedState={MARKED:"Marked",UNMARKED:"Unmarked"};t.AnnotationReviewState={ACCEPTED:"Accepted",REJECTED:"Rejected",CANCELLED:"Cancelled",COMPLETED:"Completed",NONE:"None"};t.AnnotationReplyType={GROUP:"Group",REPLY:"R"};t.AnnotationFlag={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512};t.AnnotationFieldFlag={READONLY:1,REQUIRED:2,NOEXPORT:4,MULTILINE:4096,PASSWORD:8192,NOTOGGLETOOFF:16384,RADIO:32768,PUSHBUTTON:65536,COMBO:131072,EDIT:262144,SORT:524288,FILESELECT:1048576,MULTISELECT:2097152,DONOTSPELLCHECK:4194304,DONOTSCROLL:8388608,COMB:16777216,RICHTEXT:33554432,RADIOSINUNISON:33554432,COMMITONSELCHANGE:67108864};t.AnnotationBorderStyleType={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5};t.StreamType={UNKNOWN:"UNKNOWN",FLATE:"FLATE",LZW:"LZW",DCT:"DCT",JPX:"JPX",JBIG:"JBIG",A85:"A85",AHX:"AHX",CCF:"CCF",RLX:"RLX"};t.FontType={UNKNOWN:"UNKNOWN",TYPE1:"TYPE1",TYPE1C:"TYPE1C",CIDFONTTYPE0:"CIDFONTTYPE0",CIDFONTTYPE0C:"CIDFONTTYPE0C",TRUETYPE:"TRUETYPE",CIDFONTTYPE2:"CIDFONTTYPE2",TYPE3:"TYPE3",OPENTYPE:"OPENTYPE",TYPE0:"TYPE0",MMTYPE1:"MMTYPE1"};const r={ERRORS:0,WARNINGS:1,INFOS:5};t.VerbosityLevel=r;t.CMapCompressionType={NONE:0,BINARY:1,STREAM:2};t.OPS={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotations:78,endAnnotations:79,beginAnnotation:80,endAnnotation:81,paintJpegXObject:82,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91};t.UNSUPPORTED_FEATURES={unknown:"unknown",forms:"forms",javaScript:"javaScript",smask:"smask",shadingPattern:"shadingPattern",font:"font",errorTilingPattern:"errorTilingPattern",errorExtGState:"errorExtGState",errorXObject:"errorXObject",errorFontLoadType3:"errorFontLoadType3",errorFontState:"errorFontState",errorFontMissing:"errorFontMissing",errorFontTranslate:"errorFontTranslate",errorColorSpace:"errorColorSpace",errorOperatorList:"errorOperatorList",errorFontToUnicode:"errorFontToUnicode",errorFontLoadNative:"errorFontLoadNative",errorFontGetPath:"errorFontGetPath"};t.PasswordResponses={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let i=r.WARNINGS;function s(e){i>=r.WARNINGS&&console.log("Warning: "+e)}function o(e){throw new Error(e)}function a(e,t){e||o(t)}function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!1}),n}const l=function(){function e(t){this.constructor===e&&o("Cannot initialize BaseException."),this.message=t,this.name=this.constructor.name}return e.prototype=new Error,e.constructor=e,e}();t.BaseException=l;t.PasswordException=class extends l{constructor(e,t){super(e),this.code=t}};t.UnknownErrorException=class extends l{constructor(e,t){super(e),this.details=t}};t.InvalidPDFException=class extends l{};t.MissingPDFException=class extends l{};t.UnexpectedResponseException=class extends l{constructor(e,t){super(e),this.status=t}};t.FormatError=class extends l{};t.AbortException=class extends l{};const h=/\x00/g;function f(e){a("string"==typeof e,"Invalid argument for stringToBytes");const t=e.length,n=new Uint8Array(t);for(let r=0;r<t;++r)n[r]=255&e.charCodeAt(r);return n}function u(e){return void 0!==e.length?e.length:(a(void 0!==e.byteLength,"arrayByteLength - invalid argument."),e.byteLength)}const d={get value(){return c(this,"value",function(){const e=new Uint8Array(4);return e[0]=1,1===new Uint32Array(e.buffer,0,1)[0]}())}};t.IsLittleEndianCached=d;const p={get value(){return c(this,"value",function(){try{return new Function(""),!0}catch(e){return!1}}())}};t.IsEvalSupportedCached=p;const m=["rgb(",0,",",0,",",0,")"];class g{static makeCssRgb(e,t,n){return m[1]=e,m[3]=t,m[5]=n,m.join("")}static transform(e,t){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]}static applyTransform(e,t){return[e[0]*t[0]+e[1]*t[2]+t[4],e[0]*t[1]+e[1]*t[3]+t[5]]}static applyInverseTransform(e,t){const n=t[0]*t[3]-t[1]*t[2];return[(e[0]*t[3]-e[1]*t[2]+t[2]*t[5]-t[4]*t[3])/n,(-e[0]*t[1]+e[1]*t[0]+t[4]*t[1]-t[5]*t[0])/n]}static getAxialAlignedBoundingBox(e,t){const n=g.applyTransform(e,t),r=g.applyTransform(e.slice(2,4),t),i=g.applyTransform([e[0],e[3]],t),s=g.applyTransform([e[2],e[1]],t);return[Math.min(n[0],r[0],i[0],s[0]),Math.min(n[1],r[1],i[1],s[1]),Math.max(n[0],r[0],i[0],s[0]),Math.max(n[1],r[1],i[1],s[1])]}static inverseTransform(e){const t=e[0]*e[3]-e[1]*e[2];return[e[3]/t,-e[1]/t,-e[2]/t,e[0]/t,(e[2]*e[5]-e[4]*e[3])/t,(e[4]*e[1]-e[5]*e[0])/t]}static apply3dTransform(e,t){return[e[0]*t[0]+e[1]*t[1]+e[2]*t[2],e[3]*t[0]+e[4]*t[1]+e[5]*t[2],e[6]*t[0]+e[7]*t[1]+e[8]*t[2]]}static singularValueDecompose2dScale(e){const t=[e[0],e[2],e[1],e[3]],n=e[0]*t[0]+e[1]*t[2],r=e[0]*t[1]+e[1]*t[3],i=e[2]*t[0]+e[3]*t[2],s=e[2]*t[1]+e[3]*t[3],o=(n+s)/2,a=Math.sqrt((n+s)*(n+s)-4*(n*s-i*r))/2,c=o+a||1,l=o-a||1;return[Math.sqrt(c),Math.sqrt(l)]}static normalizeRect(e){const t=e.slice(0);return e[0]>e[2]&&(t[0]=e[2],t[2]=e[0]),e[1]>e[3]&&(t[1]=e[3],t[3]=e[1]),t}static intersect(e,t){function n(e,t){return e-t}const r=[e[0],e[2],t[0],t[2]].sort(n),i=[e[1],e[3],t[1],t[3]].sort(n),s=[];return e=g.normalizeRect(e),t=g.normalizeRect(t),r[0]===e[0]&&r[1]===t[0]||r[0]===t[0]&&r[1]===e[0]?(s[0]=r[1],s[2]=r[2],i[0]===e[1]&&i[1]===t[1]||i[0]===t[1]&&i[1]===e[1]?(s[1]=i[1],s[3]=i[2],s):null):null}}t.Util=g;const b=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,728,711,710,729,733,731,730,732,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8226,8224,8225,8230,8212,8211,402,8260,8249,8250,8722,8240,8222,8220,8221,8216,8217,8218,8482,64257,64258,321,338,352,376,381,305,322,339,353,382,0,8364];const v=function(){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";return function(t,n,r=!1){if(!r&&URL.createObjectURL){const e=new Blob([t],{type:n});return URL.createObjectURL(e)}let i=`data:${n};base64,`;for(let n=0,r=t.length;n<r;n+=3){const s=255&t[n],o=255&t[n+1],a=255&t[n+2];i+=e[s>>2]+e[(3&s)<<4|o>>4]+e[n+1<r?(15&o)<<2|a>>6:64]+e[n+2<r?63&a:64]}return i}}();t.createObjectURL=v},function(e,t,n){"use strict";n(3)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNodeJS=void 0;const r="object"==typeof process&&process+""=="[object process]"&&!process.versions.nw&&!process.versions.electron;t.isNodeJS=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Jbig2Image=void 0;var r=n(1),i=n(5),s=n(6),o=n(7);class a extends r.BaseException{constructor(e){super("JBIG2 error: "+e)}}var c=function(){function e(){}function t(e,t,n){this.data=e,this.start=t,this.end=n}function n(e,t,n){var r=e.getContexts(t),i=1;function s(e){for(var t=0,s=0;s<e;s++){var o=n.readBit(r,i);i=i<256?i<<1|o:511&(i<<1|o)|256,t=t<<1|o}return t>>>0}var o=s(1),a=s(1)?s(1)?s(1)?s(1)?s(1)?s(32)+4436:s(12)+340:s(8)+84:s(6)+20:s(4)+4:s(2);return 0===o?a:a>0?-a:null}function c(e,t,n){for(var r=e.getContexts("IAID"),i=1,s=0;s<n;s++){i=i<<1|t.readBit(r,i)}return n<31?i&(1<<n)-1:2147483647&i}e.prototype={getContexts(e){return e in this?this[e]:this[e]=new Int8Array(65536)}},t.prototype={get decoder(){var e=new s.ArithmeticDecoder(this.data,this.start,this.end);return(0,r.shadow)(this,"decoder",e)},get contextCache(){var t=new e;return(0,r.shadow)(this,"contextCache",t)}};var l=["SymbolDictionary",null,null,null,"IntermediateTextRegion",null,"ImmediateTextRegion","ImmediateLosslessTextRegion",null,null,null,null,null,null,null,null,"PatternDictionary",null,null,null,"IntermediateHalftoneRegion",null,"ImmediateHalftoneRegion","ImmediateLosslessHalftoneRegion",null,null,null,null,null,null,null,null,null,null,null,null,"IntermediateGenericRegion",null,"ImmediateGenericRegion","ImmediateLosslessGenericRegion","IntermediateGenericRefinementRegion",null,"ImmediateGenericRefinementRegion","ImmediateLosslessGenericRefinementRegion",null,null,null,null,"PageInformation","EndOfPage","EndOfStripe","EndOfFile","Profiles","Tables",null,null,null,null,null,null,null,null,"Extension"],h=[[{x:-1,y:-2},{x:0,y:-2},{x:1,y:-2},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:2,y:-1},{x:-4,y:0},{x:-3,y:0},{x:-2,y:0},{x:-1,y:0}],[{x:-1,y:-2},{x:0,y:-2},{x:1,y:-2},{x:2,y:-2},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:2,y:-1},{x:-3,y:0},{x:-2,y:0},{x:-1,y:0}],[{x:-1,y:-2},{x:0,y:-2},{x:1,y:-2},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:-2,y:0},{x:-1,y:0}],[{x:-3,y:-1},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:-4,y:0},{x:-3,y:0},{x:-2,y:0},{x:-1,y:0}]],f=[{coding:[{x:0,y:-1},{x:1,y:-1},{x:-1,y:0}],reference:[{x:0,y:-1},{x:1,y:-1},{x:-1,y:0},{x:0,y:0},{x:1,y:0},{x:-1,y:1},{x:0,y:1},{x:1,y:1}]},{coding:[{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:-1,y:0}],reference:[{x:0,y:-1},{x:-1,y:0},{x:0,y:0},{x:1,y:0},{x:0,y:1},{x:1,y:1}]}],u=[39717,1941,229,405],d=[32,8];function p(e,t,n,r,i,s,o,a){if(e){return D(new O(a.data,a.start,a.end),t,n,!1)}if(0===r&&!s&&!i&&4===o.length&&3===o[0].x&&-1===o[0].y&&-3===o[1].x&&-1===o[1].y&&2===o[2].x&&-2===o[2].y&&-2===o[3].x&&-2===o[3].y)return function(e,t,n){var r,i,s,o,a,c,l,h=n.decoder,f=n.contextCache.getContexts("GB"),u=[];for(i=0;i<t;i++)for(a=u[i]=new Uint8Array(e),c=i<1?a:u[i-1],r=(l=i<2?a:u[i-2])[0]<<13|l[1]<<12|l[2]<<11|c[0]<<7|c[1]<<6|c[2]<<5|c[3]<<4,s=0;s<e;s++)a[s]=o=h.readBit(f,r),r=(31735&r)<<1|(s+3<e?l[s+3]<<11:0)|(s+4<e?c[s+4]<<4:0)|o;return u}(t,n,a);var c=!!s,l=h[r].concat(o);l.sort((function(e,t){return e.y-t.y||e.x-t.x}));var f,d,p=l.length,m=new Int8Array(p),g=new Int8Array(p),b=[],v=0,y=0,x=0,w=0;for(d=0;d<p;d++)m[d]=l[d].x,g[d]=l[d].y,y=Math.min(y,l[d].x),x=Math.max(x,l[d].x),w=Math.min(w,l[d].y),d<p-1&&l[d].y===l[d+1].y&&l[d].x===l[d+1].x-1?v|=1<<p-1-d:b.push(d);var C=b.length,P=new Int8Array(C),T=new Int8Array(C),I=new Uint16Array(C);for(f=0;f<C;f++)d=b[f],P[f]=l[d].x,T[f]=l[d].y,I[f]=1<<p-1-d;for(var k,S,L,A,E,M=-y,B=-w,U=t-x,R=u[r],_=new Uint8Array(t),F=[],N=a.decoder,z=a.contextCache.getContexts("GB"),X=0,H=0,Y=0;Y<n;Y++){if(i)if(X^=N.readBit(z,R)){F.push(_);continue}for(_=new Uint8Array(_),F.push(_),k=0;k<t;k++)if(c&&s[Y][k])_[k]=0;else{if(k>=M&&k<U&&Y>=B)for(H=H<<1&v,d=0;d<C;d++)S=Y+T[d],L=k+P[d],(A=F[S][L])&&(H|=A=I[d]);else for(H=0,E=p-1,d=0;d<p;d++,E--)(L=k+m[d])>=0&&L<t&&(S=Y+g[d])>=0&&(A=F[S][L])&&(H|=A<<E);var j=N.readBit(z,H);_[k]=j}}return F}function m(e,t,n,r,i,s,o,c,l){var h=f[n].coding;0===n&&(h=h.concat([c[0]]));var u,p=h.length,m=new Int32Array(p),g=new Int32Array(p);for(u=0;u<p;u++)m[u]=h[u].x,g[u]=h[u].y;var b=f[n].reference;0===n&&(b=b.concat([c[1]]));var v=b.length,y=new Int32Array(v),x=new Int32Array(v);for(u=0;u<v;u++)y[u]=b[u].x,x[u]=b[u].y;for(var w=r[0].length,C=r.length,P=d[n],T=[],I=l.decoder,k=l.contextCache.getContexts("GR"),S=0,L=0;L<t;L++){if(o)if(S^=I.readBit(k,P))throw new a("prediction is not supported");var O=new Uint8Array(e);T.push(O);for(var A=0;A<e;A++){var E,D,M=0;for(u=0;u<p;u++)E=L+g[u],D=A+m[u],E<0||D<0||D>=e?M<<=1:M=M<<1|T[E][D];for(u=0;u<v;u++)E=L+x[u]-s,D=A+y[u]-i,E<0||E>=C||D<0||D>=w?M<<=1:M=M<<1|r[E][D];var B=I.readBit(k,M);O[A]=B}}return T}function g(e,t,r,i,s,o,l,h,f,u,d,p,g,b,v,y,x,w,C){if(e&&t)throw new a("refinement with Huffman is not supported");var P,T,I=[];for(P=0;P<i;P++){if(T=new Uint8Array(r),s)for(var k=0;k<r;k++)T[k]=s;I.push(T)}var S=x.decoder,L=x.contextCache,O=e?-b.tableDeltaT.decode(C):-n(L,"IADT",S),A=0;for(P=0;P<o;){O+=e?b.tableDeltaT.decode(C):n(L,"IADT",S);for(var E=A+=e?b.tableFirstS.decode(C):n(L,"IAFS",S);;){let i=0;l>1&&(i=e?C.readBits(w):n(L,"IAIT",S));var D=l*O+i,M=e?b.symbolIDTable.decode(C):c(L,S,f),B=t&&(e?C.readBit():n(L,"IARI",S)),U=h[M],R=U[0].length,_=U.length;if(B){var F=n(L,"IARDW",S),N=n(L,"IARDH",S);U=m(R+=F,_+=N,v,U,(F>>1)+n(L,"IARDX",S),(N>>1)+n(L,"IARDY",S),!1,y,x)}var z,X,H,Y=D-(1&p?0:_-1),j=E-(2&p?R-1:0);if(u){for(z=0;z<_;z++)if(T=I[j+z]){H=U[z];var q=Math.min(r-Y,R);switch(g){case 0:for(X=0;X<q;X++)T[Y+X]|=H[X];break;case 2:for(X=0;X<q;X++)T[Y+X]^=H[X];break;default:throw new a(`operator ${g} is not supported`)}}E+=_-1}else{for(X=0;X<_;X++)if(T=I[Y+X])switch(H=U[X],g){case 0:for(z=0;z<R;z++)T[j+z]|=H[z];break;case 2:for(z=0;z<R;z++)T[j+z]^=H[z];break;default:throw new a(`operator ${g} is not supported`)}E+=R-1}P++;var W=e?b.tableDeltaS.decode(C):n(L,"IADS",S);if(null===W)break;E+=W+d}}return I}function b(e,t){var n={};n.number=(0,i.readUint32)(e,t);var r=e[t+4],s=63&r;if(!l[s])throw new a("invalid segment type: "+s);n.type=s,n.typeName=l[s],n.deferredNonRetain=!!(128&r);var o=!!(64&r),c=e[t+5],h=c>>5&7,f=[31&c],u=t+6;if(7===c){h=536870911&(0,i.readUint32)(e,u-1),u+=3;var d=h+7>>3;for(f[0]=e[u++];--d>0;)f.push(e[u++])}else if(5===c||6===c)throw new a("invalid referred-to flags");n.retainBits=f;let p=4;n.number<=256?p=1:n.number<=65536&&(p=2);var m,g,b=[];for(m=0;m<h;m++){let t;t=1===p?e[u]:2===p?(0,i.readUint16)(e,u):(0,i.readUint32)(e,u),b.push(t),u+=p}if(n.referredTo=b,o?(n.pageAssociation=(0,i.readUint32)(e,u),u+=4):n.pageAssociation=e[u++],n.length=(0,i.readUint32)(e,u),u+=4,4294967295===n.length){if(38!==s)throw new a("invalid unknown segment length");var v=y(e,u),w=!!(1&e[u+x]),C=new Uint8Array(6);for(w||(C[0]=255,C[1]=172),C[2]=v.height>>>24&255,C[3]=v.height>>16&255,C[4]=v.height>>8&255,C[5]=255&v.height,m=u,g=e.length;m<g;m++){for(var P=0;P<6&&C[P]===e[m+P];)P++;if(6===P){n.length=m+6;break}}if(4294967295===n.length)throw new a("segment end was not found")}return n.headerEnd=u,n}function v(e,t,n,r){for(var i=[],s=n;s<r;){var o=b(t,s);s=o.headerEnd;var a={header:o,data:t};if(e.randomAccess||(a.start=s,s+=o.length,a.end=s),i.push(a),51===o.type)break}if(e.randomAccess)for(var c=0,l=i.length;c<l;c++)i[c].start=s,s+=i[c].header.length,i[c].end=s;return i}function y(e,t){return{width:(0,i.readUint32)(e,t),height:(0,i.readUint32)(e,t+4),x:(0,i.readUint32)(e,t+8),y:(0,i.readUint32)(e,t+12),combinationOperator:7&e[t+16]}}var x=17;function w(e,t){var n,r,s,o,c=e.header,l=e.data,h=e.start,f=e.end;switch(c.type){case 0:var u={},d=(0,i.readUint16)(l,h);if(u.huffman=!!(1&d),u.refinement=!!(2&d),u.huffmanDHSelector=d>>2&3,u.huffmanDWSelector=d>>4&3,u.bitmapSizeSelector=d>>6&1,u.aggregationInstancesSelector=d>>7&1,u.bitmapCodingContextUsed=!!(256&d),u.bitmapCodingContextRetained=!!(512&d),u.template=d>>10&3,u.refinementTemplate=d>>12&1,h+=2,!u.huffman){for(o=0===u.template?4:1,r=[],s=0;s<o;s++)r.push({x:(0,i.readInt8)(l,h),y:(0,i.readInt8)(l,h+1)}),h+=2;u.at=r}if(u.refinement&&!u.refinementTemplate){for(r=[],s=0;s<2;s++)r.push({x:(0,i.readInt8)(l,h),y:(0,i.readInt8)(l,h+1)}),h+=2;u.refinementAt=r}u.numberOfExportedSymbols=(0,i.readUint32)(l,h),h+=4,u.numberOfNewSymbols=(0,i.readUint32)(l,h),h+=4,n=[u,c.number,c.referredTo,l,h,f];break;case 6:case 7:var p={};p.info=y(l,h),h+=x;var m=(0,i.readUint16)(l,h);if(h+=2,p.huffman=!!(1&m),p.refinement=!!(2&m),p.logStripSize=m>>2&3,p.stripSize=1<<p.logStripSize,p.referenceCorner=m>>4&3,p.transposed=!!(64&m),p.combinationOperator=m>>7&3,p.defaultPixelValue=m>>9&1,p.dsOffset=m<<17>>27,p.refinementTemplate=m>>15&1,p.huffman){var g=(0,i.readUint16)(l,h);h+=2,p.huffmanFS=3&g,p.huffmanDS=g>>2&3,p.huffmanDT=g>>4&3,p.huffmanRefinementDW=g>>6&3,p.huffmanRefinementDH=g>>8&3,p.huffmanRefinementDX=g>>10&3,p.huffmanRefinementDY=g>>12&3,p.huffmanRefinementSizeSelector=!!(16384&g)}if(p.refinement&&!p.refinementTemplate){for(r=[],s=0;s<2;s++)r.push({x:(0,i.readInt8)(l,h),y:(0,i.readInt8)(l,h+1)}),h+=2;p.refinementAt=r}p.numberOfSymbolInstances=(0,i.readUint32)(l,h),h+=4,n=[p,c.referredTo,l,h,f];break;case 16:const e={},t=l[h++];e.mmr=!!(1&t),e.template=t>>1&3,e.patternWidth=l[h++],e.patternHeight=l[h++],e.maxPatternIndex=(0,i.readUint32)(l,h),h+=4,n=[e,c.number,l,h,f];break;case 22:case 23:const P={};P.info=y(l,h),h+=x;const T=l[h++];P.mmr=!!(1&T),P.template=T>>1&3,P.enableSkip=!!(8&T),P.combinationOperator=T>>4&7,P.defaultPixelValue=T>>7&1,P.gridWidth=(0,i.readUint32)(l,h),h+=4,P.gridHeight=(0,i.readUint32)(l,h),h+=4,P.gridOffsetX=4294967295&(0,i.readUint32)(l,h),h+=4,P.gridOffsetY=4294967295&(0,i.readUint32)(l,h),h+=4,P.gridVectorX=(0,i.readUint16)(l,h),h+=2,P.gridVectorY=(0,i.readUint16)(l,h),h+=2,n=[P,c.referredTo,l,h,f];break;case 38:case 39:var b={};b.info=y(l,h),h+=x;var v=l[h++];if(b.mmr=!!(1&v),b.template=v>>1&3,b.prediction=!!(8&v),!b.mmr){for(o=0===b.template?4:1,r=[],s=0;s<o;s++)r.push({x:(0,i.readInt8)(l,h),y:(0,i.readInt8)(l,h+1)}),h+=2;b.at=r}n=[b,l,h,f];break;case 48:var w={width:(0,i.readUint32)(l,h),height:(0,i.readUint32)(l,h+4),resolutionX:(0,i.readUint32)(l,h+8),resolutionY:(0,i.readUint32)(l,h+12)};4294967295===w.height&&delete w.height;var C=l[h+16];(0,i.readUint16)(l,h+17),w.lossless=!!(1&C),w.refinement=!!(2&C),w.defaultPixelValue=C>>2&1,w.combinationOperator=C>>3&3,w.requiresBuffer=!!(32&C),w.combinationOperatorOverride=!!(64&C),n=[w];break;case 49:case 50:case 51:break;case 53:n=[c.number,l,h,f];break;case 62:break;default:throw new a(`segment type ${c.typeName}(${c.type}) is not implemented`)}var P="on"+c.typeName;P in t&&t[P].apply(t,n)}function C(e,t){for(var n=0,r=e.length;n<r;n++)w(e[n],t)}function P(){}function T(e){2===e.length?(this.isOOB=!0,this.rangeLow=0,this.prefixLength=e[0],this.rangeLength=0,this.prefixCode=e[1],this.isLowerRange=!1):(this.isOOB=!1,this.rangeLow=e[0],this.prefixLength=e[1],this.rangeLength=e[2],this.prefixCode=e[3],this.isLowerRange="lower"===e[4])}function I(e){this.children=[],e?(this.isLeaf=!0,this.rangeLength=e.rangeLength,this.rangeLow=e.rangeLow,this.isLowerRange=e.isLowerRange,this.isOOB=e.isOOB):this.isLeaf=!1}function k(e,t){t||this.assignPrefixCodes(e),this.rootNode=new I(null);for(let t=0,n=e.length;t<n;t++){const n=e[t];n.prefixLength>0&&this.rootNode.buildTree(n,n.prefixLength-1)}}P.prototype={onPageInformation:function(e){this.currentPageInfo=e;var t=e.width+7>>3,n=new Uint8ClampedArray(t*e.height);if(e.defaultPixelValue)for(var r=0,i=n.length;r<i;r++)n[r]=255;this.buffer=n},drawBitmap:function(e,t){var n,r,i,s,o=this.currentPageInfo,c=e.width,l=e.height,h=o.width+7>>3,f=o.combinationOperatorOverride?e.combinationOperator:o.combinationOperator,u=this.buffer,d=128>>(7&e.x),p=e.y*h+(e.x>>3);switch(f){case 0:for(n=0;n<l;n++){for(i=d,s=p,r=0;r<c;r++)t[n][r]&&(u[s]|=i),(i>>=1)||(i=128,s++);p+=h}break;case 2:for(n=0;n<l;n++){for(i=d,s=p,r=0;r<c;r++)t[n][r]&&(u[s]^=i),(i>>=1)||(i=128,s++);p+=h}break;default:throw new a(`operator ${f} is not supported`)}},onImmediateGenericRegion:function(e,n,r,i){var s=e.info,o=new t(n,r,i),a=p(e.mmr,s.width,s.height,e.template,e.prediction,null,e.at,o);this.drawBitmap(s,a)},onImmediateLosslessGenericRegion:function(){this.onImmediateGenericRegion.apply(this,arguments)},onSymbolDictionary:function(e,r,s,o,l,h){let f,u;e.huffman&&(f=function(e,t,n){let r,i,s,o,c=0;switch(e.huffmanDHSelector){case 0:case 1:r=L(e.huffmanDHSelector+4);break;case 3:r=A(c,t,n),c++;break;default:throw new a("invalid Huffman DH selector")}switch(e.huffmanDWSelector){case 0:case 1:i=L(e.huffmanDWSelector+2);break;case 3:i=A(c,t,n),c++;break;default:throw new a("invalid Huffman DW selector")}e.bitmapSizeSelector?(s=A(c,t,n),c++):s=L(1);o=e.aggregationInstancesSelector?A(c,t,n):L(1);return{tableDeltaHeight:r,tableDeltaWidth:i,tableBitmapSize:s,tableAggregateInstances:o}}(e,s,this.customTables),u=new O(o,l,h));var d=this.symbols;d||(this.symbols=d={});for(var b=[],v=0,y=s.length;v<y;v++){const e=d[s[v]];e&&(b=b.concat(e))}var x=new t(o,l,h);d[r]=function(e,t,r,s,o,l,h,f,u,d,b,v){if(e&&t)throw new a("symbol refinement with Huffman is not supported");var y=[],x=0,w=(0,i.log2)(r.length+s),C=b.decoder,P=b.contextCache;let T,I;for(e&&(T=L(1),I=[],w=Math.max(w,1));y.length<s;){x+=e?l.tableDeltaHeight.decode(v):n(P,"IADH",C);let i=0,s=0;const o=e?I.length:0;for(;;){var k,S=e?l.tableDeltaWidth.decode(v):n(P,"IADW",C);if(null===S)break;if(i+=S,s+=i,t){var O=n(P,"IAAI",C);if(O>1)k=g(e,t,i,x,0,O,1,r.concat(y),w,0,0,1,0,l,u,d,b,0,v);else{var A=c(P,C,w),M=n(P,"IARDX",C),B=n(P,"IARDY",C);k=m(i,x,u,A<r.length?r[A]:y[A-r.length],M,B,!1,d,b)}y.push(k)}else e?I.push(i):(k=p(!1,i,x,h,!1,null,f,b),y.push(k))}if(e&&!t){const e=l.tableBitmapSize.decode(v);let t;if(v.byteAlign(),0===e)t=E(v,s,x);else{const n=v.end,r=v.position+e;v.end=r,t=D(v,s,x,!1),v.end=n,v.position=r}const n=I.length;if(o===n-1)y.push(t);else{let e,r,i,s,a,c=0;for(e=o;e<n;e++){for(s=I[e],i=c+s,a=[],r=0;r<x;r++)a.push(t[r].subarray(c,i));y.push(a),c=i}}}}for(var U=[],R=[],_=!1,F=r.length+s;R.length<F;){for(var N=e?T.decode(v):n(P,"IAEX",C);N--;)R.push(_);_=!_}for(var z=0,X=r.length;z<X;z++)R[z]&&U.push(r[z]);for(var H=0;H<s;z++,H++)R[z]&&U.push(y[H]);return U}(e.huffman,e.refinement,b,e.numberOfNewSymbols,e.numberOfExportedSymbols,f,e.template,e.at,e.refinementTemplate,e.refinementAt,x,u)},onImmediateTextRegion:function(e,n,r,s,o){var c=e.info;let l,h;for(var f=this.symbols,u=[],d=0,p=n.length;d<p;d++){const e=f[n[d]];e&&(u=u.concat(e))}var m=(0,i.log2)(u.length);e.huffman&&(h=new O(r,s,o),l=function(e,t,n,r,i){const s=[];for(let e=0;e<=34;e++){const t=i.readBits(4);s.push(new T([e,t,0,0]))}const o=new k(s,!1);s.length=0;for(let e=0;e<r;){const t=o.decode(i);if(t>=32){let n,r,o;switch(t){case 32:if(0===e)throw new a("no previous value in symbol ID table");r=i.readBits(2)+3,n=s[e-1].prefixLength;break;case 33:r=i.readBits(3)+3,n=0;break;case 34:r=i.readBits(7)+11,n=0;break;default:throw new a("invalid code length in symbol ID table")}for(o=0;o<r;o++)s.push(new T([e,n,0,0])),e++}else s.push(new T([e,t,0,0])),e++}i.byteAlign();const c=new k(s,!1);let l,h,f,u=0;switch(e.huffmanFS){case 0:case 1:l=L(e.huffmanFS+6);break;case 3:l=A(u,t,n),u++;break;default:throw new a("invalid Huffman FS selector")}switch(e.huffmanDS){case 0:case 1:case 2:h=L(e.huffmanDS+8);break;case 3:h=A(u,t,n),u++;break;default:throw new a("invalid Huffman DS selector")}switch(e.huffmanDT){case 0:case 1:case 2:f=L(e.huffmanDT+11);break;case 3:f=A(u,t,n),u++;break;default:throw new a("invalid Huffman DT selector")}if(e.refinement)throw new a("refinement with Huffman is not supported");return{symbolIDTable:c,tableFirstS:l,tableDeltaS:h,tableDeltaT:f}}(e,n,this.customTables,u.length,h));var b=new t(r,s,o),v=g(e.huffman,e.refinement,c.width,c.height,e.defaultPixelValue,e.numberOfSymbolInstances,e.stripSize,u,m,e.transposed,e.dsOffset,e.referenceCorner,e.combinationOperator,l,e.refinementTemplate,e.refinementAt,b,e.logStripSize,h);this.drawBitmap(c,v)},onImmediateLosslessTextRegion:function(){this.onImmediateTextRegion.apply(this,arguments)},onPatternDictionary(e,n,r,i,s){let o=this.patterns;o||(this.patterns=o={});const a=new t(r,i,s);o[n]=function(e,t,n,r,i,s){const o=[];e||(o.push({x:-t,y:0}),0===i&&(o.push({x:-3,y:-1}),o.push({x:2,y:-2}),o.push({x:-2,y:-2})));const a=p(e,(r+1)*t,n,i,!1,null,o,s),c=[];for(let e=0;e<=r;e++){const r=[],i=t*e,s=i+t;for(let e=0;e<n;e++)r.push(a[e].subarray(i,s));c.push(r)}return c}(e.mmr,e.patternWidth,e.patternHeight,e.maxPatternIndex,e.template,a)},onImmediateHalftoneRegion(e,n,r,s,o){const c=this.patterns[n[0]],l=e.info,h=new t(r,s,o),f=function(e,t,n,r,s,o,c,l,h,f,u,d,m,g,b){if(c)throw new a("skip is not supported");if(0!==l)throw new a("operator "+l+" is not supported in halftone region");const v=[];let y,x,w;for(y=0;y<s;y++){if(w=new Uint8Array(r),o)for(x=0;x<r;x++)w[x]=o;v.push(w)}const C=t.length,P=t[0],T=P[0].length,I=P.length,k=(0,i.log2)(C),S=[];e||(S.push({x:n<=1?3:2,y:-1}),0===n&&(S.push({x:-3,y:-1}),S.push({x:2,y:-2}),S.push({x:-2,y:-2})));const L=[];let A,E,M,B,U,R,_,F,N,z,X;for(e&&(A=new O(b.data,b.start,b.end)),y=k-1;y>=0;y--)E=e?D(A,h,f,!0):p(!1,h,f,n,!1,null,S,b),L[y]=E;for(M=0;M<f;M++)for(B=0;B<h;B++){for(U=0,R=0,x=k-1;x>=0;x--)U=L[x][M][B]^U,R|=U<<x;if(_=t[R],F=u+M*g+B*m>>8,N=d+M*m-B*g>>8,F>=0&&F+T<=r&&N>=0&&N+I<=s)for(y=0;y<I;y++)for(X=v[N+y],z=_[y],x=0;x<T;x++)X[F+x]|=z[x];else{let e,t;for(y=0;y<I;y++)if(t=N+y,!(t<0||t>=s))for(X=v[t],z=_[y],x=0;x<T;x++)e=F+x,e>=0&&e<r&&(X[e]|=z[x])}}return v}(e.mmr,c,e.template,l.width,l.height,e.defaultPixelValue,e.enableSkip,e.combinationOperator,e.gridWidth,e.gridHeight,e.gridOffsetX,e.gridOffsetY,e.gridVectorX,e.gridVectorY,h);this.drawBitmap(l,f)},onImmediateLosslessHalftoneRegion(){this.onImmediateHalftoneRegion.apply(this,arguments)},onTables(e,t,n,r){let s=this.customTables;s||(this.customTables=s={}),s[e]=function(e,t,n){const r=e[t],s=4294967295&(0,i.readUint32)(e,t+1),o=4294967295&(0,i.readUint32)(e,t+5),a=new O(e,t+9,n),c=1+(r>>1&7),l=1+(r>>4&7),h=[];let f,u,d=s;do{f=a.readBits(c),u=a.readBits(l),h.push(new T([d,f,u,0])),d+=1<<u}while(d<o);f=a.readBits(c),h.push(new T([s-1,f,32,0,"lower"])),f=a.readBits(c),h.push(new T([o,f,32,0])),1&r&&(f=a.readBits(c),h.push(new T([f,0])));return new k(h,!1)}(t,n,r)}},I.prototype={buildTree(e,t){const n=e.prefixCode>>t&1;if(t<=0)this.children[n]=new I(e);else{let r=this.children[n];r||(this.children[n]=r=new I(null)),r.buildTree(e,t-1)}},decodeNode(e){if(this.isLeaf){if(this.isOOB)return null;const t=e.readBits(this.rangeLength);return this.rangeLow+(this.isLowerRange?-t:t)}const t=this.children[e.readBit()];if(!t)throw new a("invalid Huffman data");return t.decodeNode(e)}},k.prototype={decode(e){return this.rootNode.decodeNode(e)},assignPrefixCodes(e){const t=e.length;let n=0;for(let r=0;r<t;r++)n=Math.max(n,e[r].prefixLength);const r=new Uint32Array(n+1);for(let n=0;n<t;n++)r[e[n].prefixLength]++;let i,s,o,a=1,c=0;for(r[0]=0;a<=n;){for(c=c+r[a-1]<<1,i=c,s=0;s<t;)o=e[s],o.prefixLength===a&&(o.prefixCode=i,i++),s++;a++}}};const S={};function L(e){let t,n=S[e];if(n)return n;switch(e){case 1:t=[[0,1,4,0],[16,2,8,2],[272,3,16,6],[65808,3,32,7]];break;case 2:t=[[0,1,0,0],[1,2,0,2],[2,3,0,6],[3,4,3,14],[11,5,6,30],[75,6,32,62],[6,63]];break;case 3:t=[[-256,8,8,254],[0,1,0,0],[1,2,0,2],[2,3,0,6],[3,4,3,14],[11,5,6,30],[-257,8,32,255,"lower"],[75,7,32,126],[6,62]];break;case 4:t=[[1,1,0,0],[2,2,0,2],[3,3,0,6],[4,4,3,14],[12,5,6,30],[76,5,32,31]];break;case 5:t=[[-255,7,8,126],[1,1,0,0],[2,2,0,2],[3,3,0,6],[4,4,3,14],[12,5,6,30],[-256,7,32,127,"lower"],[76,6,32,62]];break;case 6:t=[[-2048,5,10,28],[-1024,4,9,8],[-512,4,8,9],[-256,4,7,10],[-128,5,6,29],[-64,5,5,30],[-32,4,5,11],[0,2,7,0],[128,3,7,2],[256,3,8,3],[512,4,9,12],[1024,4,10,13],[-2049,6,32,62,"lower"],[2048,6,32,63]];break;case 7:t=[[-1024,4,9,8],[-512,3,8,0],[-256,4,7,9],[-128,5,6,26],[-64,5,5,27],[-32,4,5,10],[0,4,5,11],[32,5,5,28],[64,5,6,29],[128,4,7,12],[256,3,8,1],[512,3,9,2],[1024,3,10,3],[-1025,5,32,30,"lower"],[2048,5,32,31]];break;case 8:t=[[-15,8,3,252],[-7,9,1,508],[-5,8,1,253],[-3,9,0,509],[-2,7,0,124],[-1,4,0,10],[0,2,1,0],[2,5,0,26],[3,6,0,58],[4,3,4,4],[20,6,1,59],[22,4,4,11],[38,4,5,12],[70,5,6,27],[134,5,7,28],[262,6,7,60],[390,7,8,125],[646,6,10,61],[-16,9,32,510,"lower"],[1670,9,32,511],[2,1]];break;case 9:t=[[-31,8,4,252],[-15,9,2,508],[-11,8,2,253],[-7,9,1,509],[-5,7,1,124],[-3,4,1,10],[-1,3,1,2],[1,3,1,3],[3,5,1,26],[5,6,1,58],[7,3,5,4],[39,6,2,59],[43,4,5,11],[75,4,6,12],[139,5,7,27],[267,5,8,28],[523,6,8,60],[779,7,9,125],[1291,6,11,61],[-32,9,32,510,"lower"],[3339,9,32,511],[2,0]];break;case 10:t=[[-21,7,4,122],[-5,8,0,252],[-4,7,0,123],[-3,5,0,24],[-2,2,2,0],[2,5,0,25],[3,6,0,54],[4,7,0,124],[5,8,0,253],[6,2,6,1],[70,5,5,26],[102,6,5,55],[134,6,6,56],[198,6,7,57],[326,6,8,58],[582,6,9,59],[1094,6,10,60],[2118,7,11,125],[-22,8,32,254,"lower"],[4166,8,32,255],[2,2]];break;case 11:t=[[1,1,0,0],[2,2,1,2],[4,4,0,12],[5,4,1,13],[7,5,1,28],[9,5,2,29],[13,6,2,60],[17,7,2,122],[21,7,3,123],[29,7,4,124],[45,7,5,125],[77,7,6,126],[141,7,32,127]];break;case 12:t=[[1,1,0,0],[2,2,0,2],[3,3,1,6],[5,5,0,28],[6,5,1,29],[8,6,1,60],[10,7,0,122],[11,7,1,123],[13,7,2,124],[17,7,3,125],[25,7,4,126],[41,8,5,254],[73,8,32,255]];break;case 13:t=[[1,1,0,0],[2,3,0,4],[3,4,0,12],[4,5,0,28],[5,4,1,13],[7,3,3,5],[15,6,1,58],[17,6,2,59],[21,6,3,60],[29,6,4,61],[45,6,5,62],[77,7,6,126],[141,7,32,127]];break;case 14:t=[[-2,3,0,4],[-1,3,0,5],[0,1,0,0],[1,3,0,6],[2,3,0,7]];break;case 15:t=[[-24,7,4,124],[-8,6,2,60],[-4,5,1,28],[-2,4,0,12],[-1,3,0,4],[0,1,0,0],[1,3,0,5],[2,4,0,13],[3,5,1,29],[5,6,2,61],[9,7,4,125],[-25,7,32,126,"lower"],[25,7,32,127]];break;default:throw new a(`standard table B.${e} does not exist`)}for(let e=0,n=t.length;e<n;e++)t[e]=new T(t[e]);return n=new k(t,!0),S[e]=n,n}function O(e,t,n){this.data=e,this.start=t,this.end=n,this.position=t,this.shift=-1,this.currentByte=0}function A(e,t,n){let r=0;for(let i=0,s=t.length;i<s;i++){const s=n[t[i]];if(s){if(e===r)return s;r++}}throw new a("can't find custom Huffman table")}function E(e,t,n){const r=[];for(let i=0;i<n;i++){const n=new Uint8Array(t);r.push(n);for(let r=0;r<t;r++)n[r]=e.readBit();e.byteAlign()}return r}function D(e,t,n,r){const i={K:-1,Columns:t,Rows:n,BlackIs1:!0,EndOfBlock:r},s=new o.CCITTFaxDecoder(e,i),a=[];let c,l=!1;for(let e=0;e<n;e++){const e=new Uint8Array(t);a.push(e);let n=-1;for(let r=0;r<t;r++)n<0&&(c=s.readNextChar(),-1===c&&(c=0,l=!0),n=7),e[r]=c>>n&1,n--}if(r&&!l){const e=5;for(let t=0;t<e&&-1!==s.readNextChar();t++);}return a}function M(){}return O.prototype={readBit(){if(this.shift<0){if(this.position>=this.end)throw new a("end of data while reading bit");this.currentByte=this.data[this.position++],this.shift=7}const e=this.currentByte>>this.shift&1;return this.shift--,e},readBits(e){let t,n=0;for(t=e-1;t>=0;t--)n|=this.readBit()<<t;return n},byteAlign(){this.shift=-1},next(){return this.position>=this.end?-1:this.data[this.position++]}},M.prototype={parseChunks:e=>function(e){for(var t=new P,n=0,r=e.length;n<r;n++){var i=e[n];C(v({},i.data,i.start,i.end),t)}return t.buffer}(e),parse(e){const{imgData:t,width:n,height:r}=function(e){const t=e.length;let n=0;if(151!==e[n]||74!==e[n+1]||66!==e[n+2]||50!==e[n+3]||13!==e[n+4]||10!==e[n+5]||26!==e[n+6]||10!==e[n+7])throw new a("parseJbig2 - invalid header.");const r=Object.create(null);n+=8;const s=e[n++];r.randomAccess=!(1&s),2&s||(r.numberOfPages=(0,i.readUint32)(e,n),n+=4);const o=v(r,e,n,t),c=new P;C(o,c);const{width:l,height:h}=c.currentPageInfo,f=c.buffer,u=new Uint8ClampedArray(l*h);let d=0,p=0;for(let e=0;e<h;e++){let e,t=0;for(let n=0;n<l;n++)t||(t=128,e=f[p++]),u[d++]=e&t?0:255,t>>=1}return{imgData:u,width:l,height:h}}(e);return this.width=n,this.height=r,t}},M}();t.Jbig2Image=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getLookupTableFactory=function(e){let t;return function(){return e&&(t=Object.create(null),e(t),e=null),t}},t.getInheritableProperty=function({dict:e,key:t,getArray:n=!1,stopWhenFound:i=!0}){let s,o=0;for(;e;){const a=n?e.getArray(t):e.get(t);if(void 0!==a){if(i)return a;s||(s=[]),s.push(a)}if(++o>100){(0,r.warn)(`getInheritableProperty: maximum loop count exceeded for "${t}"`);break}e=e.get("Parent")}return s},t.toRomanNumerals=function(e,t=!1){(0,r.assert)(Number.isInteger(e)&&e>0,"The number should be a positive integer.");const n=[];let i;for(;e>=1e3;)e-=1e3,n.push("M");i=e/100|0,e%=100,n.push(a[i]),i=e/10|0,e%=10,n.push(a[10+i]),n.push(a[20+e]);const s=n.join("");return t?s.toLowerCase():s},t.log2=function(e){if(e<=0)return 0;return Math.ceil(Math.log2(e))},t.readInt8=function(e,t){return e[t]<<24>>24},t.readUint16=function(e,t){return e[t]<<8|e[t+1]},t.readUint32=function(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0},t.isWhiteSpace=function(e){return 32===e||9===e||13===e||10===e},t.XRefParseException=t.XRefEntryException=t.MissingDataException=void 0;var r=n(1);class i extends r.BaseException{constructor(e,t){super(`Missing data [${e}, ${t})`),this.begin=e,this.end=t}}t.MissingDataException=i;class s extends r.BaseException{}t.XRefEntryException=s;class o extends r.BaseException{}t.XRefParseException=o;const a=["","C","CC","CCC","CD","D","DC","DCC","DCCC","CM","","X","XX","XXX","XL","L","LX","LXX","LXXX","XC","","I","II","III","IV","V","VI","VII","VIII","IX"]},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ArithmeticDecoder=void 0;const r=[{qe:22017,nmps:1,nlps:1,switchFlag:1},{qe:13313,nmps:2,nlps:6,switchFlag:0},{qe:6145,nmps:3,nlps:9,switchFlag:0},{qe:2753,nmps:4,nlps:12,switchFlag:0},{qe:1313,nmps:5,nlps:29,switchFlag:0},{qe:545,nmps:38,nlps:33,switchFlag:0},{qe:22017,nmps:7,nlps:6,switchFlag:1},{qe:21505,nmps:8,nlps:14,switchFlag:0},{qe:18433,nmps:9,nlps:14,switchFlag:0},{qe:14337,nmps:10,nlps:14,switchFlag:0},{qe:12289,nmps:11,nlps:17,switchFlag:0},{qe:9217,nmps:12,nlps:18,switchFlag:0},{qe:7169,nmps:13,nlps:20,switchFlag:0},{qe:5633,nmps:29,nlps:21,switchFlag:0},{qe:22017,nmps:15,nlps:14,switchFlag:1},{qe:21505,nmps:16,nlps:14,switchFlag:0},{qe:20737,nmps:17,nlps:15,switchFlag:0},{qe:18433,nmps:18,nlps:16,switchFlag:0},{qe:14337,nmps:19,nlps:17,switchFlag:0},{qe:13313,nmps:20,nlps:18,switchFlag:0},{qe:12289,nmps:21,nlps:19,switchFlag:0},{qe:10241,nmps:22,nlps:19,switchFlag:0},{qe:9217,nmps:23,nlps:20,switchFlag:0},{qe:8705,nmps:24,nlps:21,switchFlag:0},{qe:7169,nmps:25,nlps:22,switchFlag:0},{qe:6145,nmps:26,nlps:23,switchFlag:0},{qe:5633,nmps:27,nlps:24,switchFlag:0},{qe:5121,nmps:28,nlps:25,switchFlag:0},{qe:4609,nmps:29,nlps:26,switchFlag:0},{qe:4353,nmps:30,nlps:27,switchFlag:0},{qe:2753,nmps:31,nlps:28,switchFlag:0},{qe:2497,nmps:32,nlps:29,switchFlag:0},{qe:2209,nmps:33,nlps:30,switchFlag:0},{qe:1313,nmps:34,nlps:31,switchFlag:0},{qe:1089,nmps:35,nlps:32,switchFlag:0},{qe:673,nmps:36,nlps:33,switchFlag:0},{qe:545,nmps:37,nlps:34,switchFlag:0},{qe:321,nmps:38,nlps:35,switchFlag:0},{qe:273,nmps:39,nlps:36,switchFlag:0},{qe:133,nmps:40,nlps:37,switchFlag:0},{qe:73,nmps:41,nlps:38,switchFlag:0},{qe:37,nmps:42,nlps:39,switchFlag:0},{qe:21,nmps:43,nlps:40,switchFlag:0},{qe:9,nmps:44,nlps:41,switchFlag:0},{qe:5,nmps:45,nlps:42,switchFlag:0},{qe:1,nmps:45,nlps:43,switchFlag:0},{qe:22017,nmps:46,nlps:46,switchFlag:0}];t.ArithmeticDecoder=class{constructor(e,t,n){this.data=e,this.bp=t,this.dataEnd=n,this.chigh=e[t],this.clow=0,this.byteIn(),this.chigh=this.chigh<<7&65535|this.clow>>9&127,this.clow=this.clow<<7&65535,this.ct-=7,this.a=32768}byteIn(){const e=this.data;let t=this.bp;255===e[t]?e[t+1]>143?(this.clow+=65280,this.ct=8):(t++,this.clow+=e[t]<<9,this.ct=7,this.bp=t):(t++,this.clow+=t<this.dataEnd?e[t]<<8:65280,this.ct=8,this.bp=t),this.clow>65535&&(this.chigh+=this.clow>>16,this.clow&=65535)}readBit(e,t){let n=e[t]>>1,i=1&e[t];const s=r[n],o=s.qe;let a,c=this.a-o;if(this.chigh<o)c<o?(c=o,a=i,n=s.nmps):(c=o,a=1^i,1===s.switchFlag&&(i=a),n=s.nlps);else{if(this.chigh-=o,0!=(32768&c))return this.a=c,i;c<o?(a=1^i,1===s.switchFlag&&(i=a),n=s.nlps):(a=i,n=s.nmps)}do{0===this.ct&&this.byteIn(),c<<=1,this.chigh=this.chigh<<1&65535|this.clow>>15&1,this.clow=this.clow<<1&65535,this.ct--}while(0==(32768&c));return this.a=c,e[t]=n<<1|i,a}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CCITTFaxDecoder=void 0;var r=n(1);const i=function(){const e=[[-1,-1],[-1,-1],[7,8],[7,7],[6,6],[6,6],[6,5],[6,5],[4,0],[4,0],[4,0],[4,0],[4,0],[4,0],[4,0],[4,0],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2]],t=[[-1,-1],[12,-2],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[11,1792],[11,1792],[12,1984],[12,2048],[12,2112],[12,2176],[12,2240],[12,2304],[11,1856],[11,1856],[11,1920],[11,1920],[12,2368],[12,2432],[12,2496],[12,2560]],n=[[-1,-1],[-1,-1],[-1,-1],[-1,-1],[8,29],[8,29],[8,30],[8,30],[8,45],[8,45],[8,46],[8,46],[7,22],[7,22],[7,22],[7,22],[7,23],[7,23],[7,23],[7,23],[8,47],[8,47],[8,48],[8,48],[6,13],[6,13],[6,13],[6,13],[6,13],[6,13],[6,13],[6,13],[7,20],[7,20],[7,20],[7,20],[8,33],[8,33],[8,34],[8,34],[8,35],[8,35],[8,36],[8,36],[8,37],[8,37],[8,38],[8,38],[7,19],[7,19],[7,19],[7,19],[8,31],[8,31],[8,32],[8,32],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,12],[6,12],[6,12],[6,12],[6,12],[6,12],[6,12],[6,12],[8,53],[8,53],[8,54],[8,54],[7,26],[7,26],[7,26],[7,26],[8,39],[8,39],[8,40],[8,40],[8,41],[8,41],[8,42],[8,42],[8,43],[8,43],[8,44],[8,44],[7,21],[7,21],[7,21],[7,21],[7,28],[7,28],[7,28],[7,28],[8,61],[8,61],[8,62],[8,62],[8,63],[8,63],[8,0],[8,0],[8,320],[8,320],[8,384],[8,384],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[7,27],[7,27],[7,27],[7,27],[8,59],[8,59],[8,60],[8,60],[9,1472],[9,1536],[9,1600],[9,1728],[7,18],[7,18],[7,18],[7,18],[7,24],[7,24],[7,24],[7,24],[8,49],[8,49],[8,50],[8,50],[8,51],[8,51],[8,52],[8,52],[7,25],[7,25],[7,25],[7,25],[8,55],[8,55],[8,56],[8,56],[8,57],[8,57],[8,58],[8,58],[6,192],[6,192],[6,192],[6,192],[6,192],[6,192],[6,192],[6,192],[6,1664],[6,1664],[6,1664],[6,1664],[6,1664],[6,1664],[6,1664],[6,1664],[8,448],[8,448],[8,512],[8,512],[9,704],[9,768],[8,640],[8,640],[8,576],[8,576],[9,832],[9,896],[9,960],[9,1024],[9,1088],[9,1152],[9,1216],[9,1280],[9,1344],[9,1408],[7,256],[7,256],[7,256],[7,256],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[6,16],[6,16],[6,16],[6,16],[6,16],[6,16],[6,16],[6,16],[6,17],[6,17],[6,17],[6,17],[6,17],[6,17],[6,17],[6,17],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[6,14],[6,14],[6,14],[6,14],[6,14],[6,14],[6,14],[6,14],[6,15],[6,15],[6,15],[6,15],[6,15],[6,15],[6,15],[6,15],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7]],i=[[-1,-1],[-1,-1],[12,-2],[12,-2],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[11,1792],[11,1792],[11,1792],[11,1792],[12,1984],[12,1984],[12,2048],[12,2048],[12,2112],[12,2112],[12,2176],[12,2176],[12,2240],[12,2240],[12,2304],[12,2304],[11,1856],[11,1856],[11,1856],[11,1856],[11,1920],[11,1920],[11,1920],[11,1920],[12,2368],[12,2368],[12,2432],[12,2432],[12,2496],[12,2496],[12,2560],[12,2560],[10,18],[10,18],[10,18],[10,18],[10,18],[10,18],[10,18],[10,18],[12,52],[12,52],[13,640],[13,704],[13,768],[13,832],[12,55],[12,55],[12,56],[12,56],[13,1280],[13,1344],[13,1408],[13,1472],[12,59],[12,59],[12,60],[12,60],[13,1536],[13,1600],[11,24],[11,24],[11,24],[11,24],[11,25],[11,25],[11,25],[11,25],[13,1664],[13,1728],[12,320],[12,320],[12,384],[12,384],[12,448],[12,448],[13,512],[13,576],[12,53],[12,53],[12,54],[12,54],[13,896],[13,960],[13,1024],[13,1088],[13,1152],[13,1216],[10,64],[10,64],[10,64],[10,64],[10,64],[10,64],[10,64],[10,64]],s=[[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[11,23],[11,23],[12,50],[12,51],[12,44],[12,45],[12,46],[12,47],[12,57],[12,58],[12,61],[12,256],[10,16],[10,16],[10,16],[10,16],[10,17],[10,17],[10,17],[10,17],[12,48],[12,49],[12,62],[12,63],[12,30],[12,31],[12,32],[12,33],[12,40],[12,41],[11,22],[11,22],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[9,15],[9,15],[9,15],[9,15],[9,15],[9,15],[9,15],[9,15],[12,128],[12,192],[12,26],[12,27],[12,28],[12,29],[11,19],[11,19],[11,20],[11,20],[12,34],[12,35],[12,36],[12,37],[12,38],[12,39],[11,21],[11,21],[12,42],[12,43],[10,0],[10,0],[10,0],[10,0],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12]],o=[[-1,-1],[-1,-1],[-1,-1],[-1,-1],[6,9],[6,8],[5,7],[5,7],[4,6],[4,6],[4,6],[4,6],[4,5],[4,5],[4,5],[4,5],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2]];function a(e,t={}){if(!e||"function"!=typeof e.next)throw new Error('CCITTFaxDecoder - invalid "source" parameter.');this.source=e,this.eof=!1,this.encoding=t.K||0,this.eoline=t.EndOfLine||!1,this.byteAlign=t.EncodedByteAlign||!1,this.columns=t.Columns||1728,this.rows=t.Rows||0;let n,r=t.EndOfBlock;for(null==r&&(r=!0),this.eoblock=r,this.black=t.BlackIs1||!1,this.codingLine=new Uint32Array(this.columns+1),this.refLine=new Uint32Array(this.columns+2),this.codingLine[0]=this.columns,this.codingPos=0,this.row=0,this.nextLine2D=this.encoding<0,this.inputBits=0,this.inputBuf=0,this.outputBits=0,this.rowsDone=!1;0===(n=this._lookBits(12));)this._eatBits(1);1===n&&this._eatBits(12),this.encoding>0&&(this.nextLine2D=!this._lookBits(1),this._eatBits(1))}return a.prototype={readNextChar(){if(this.eof)return-1;const e=this.refLine,t=this.codingLine,n=this.columns;let i,s,o,a,c;if(0===this.outputBits){if(this.rowsDone&&(this.eof=!0),this.eof)return-1;let o,c,l;if(this.err=!1,this.nextLine2D){for(a=0;t[a]<n;++a)e[a]=t[a];for(e[a++]=n,e[a]=n,t[0]=0,this.codingPos=0,i=0,s=0;t[this.codingPos]<n;)switch(o=this._getTwoDimCode(),o){case 0:this._addPixels(e[i+1],s),e[i+1]<n&&(i+=2);break;case 1:if(o=c=0,s){do{o+=l=this._getBlackCode()}while(l>=64);do{c+=l=this._getWhiteCode()}while(l>=64)}else{do{o+=l=this._getWhiteCode()}while(l>=64);do{c+=l=this._getBlackCode()}while(l>=64)}for(this._addPixels(t[this.codingPos]+o,s),t[this.codingPos]<n&&this._addPixels(t[this.codingPos]+c,1^s);e[i]<=t[this.codingPos]&&e[i]<n;)i+=2;break;case 7:if(this._addPixels(e[i]+3,s),s^=1,t[this.codingPos]<n)for(++i;e[i]<=t[this.codingPos]&&e[i]<n;)i+=2;break;case 5:if(this._addPixels(e[i]+2,s),s^=1,t[this.codingPos]<n)for(++i;e[i]<=t[this.codingPos]&&e[i]<n;)i+=2;break;case 3:if(this._addPixels(e[i]+1,s),s^=1,t[this.codingPos]<n)for(++i;e[i]<=t[this.codingPos]&&e[i]<n;)i+=2;break;case 2:if(this._addPixels(e[i],s),s^=1,t[this.codingPos]<n)for(++i;e[i]<=t[this.codingPos]&&e[i]<n;)i+=2;break;case 8:if(this._addPixelsNeg(e[i]-3,s),s^=1,t[this.codingPos]<n)for(i>0?--i:++i;e[i]<=t[this.codingPos]&&e[i]<n;)i+=2;break;case 6:if(this._addPixelsNeg(e[i]-2,s),s^=1,t[this.codingPos]<n)for(i>0?--i:++i;e[i]<=t[this.codingPos]&&e[i]<n;)i+=2;break;case 4:if(this._addPixelsNeg(e[i]-1,s),s^=1,t[this.codingPos]<n)for(i>0?--i:++i;e[i]<=t[this.codingPos]&&e[i]<n;)i+=2;break;case-1:this._addPixels(n,0),this.eof=!0;break;default:(0,r.info)("bad 2d code"),this._addPixels(n,0),this.err=!0}}else for(t[0]=0,this.codingPos=0,s=0;t[this.codingPos]<n;){if(o=0,s)do{o+=l=this._getBlackCode()}while(l>=64);else do{o+=l=this._getWhiteCode()}while(l>=64);this._addPixels(t[this.codingPos]+o,s),s^=1}let h=!1;if(this.byteAlign&&(this.inputBits&=-8),this.eoblock||this.row!==this.rows-1){if(o=this._lookBits(12),this.eoline)for(;-1!==o&&1!==o;)this._eatBits(1),o=this._lookBits(12);else for(;0===o;)this._eatBits(1),o=this._lookBits(12);1===o?(this._eatBits(12),h=!0):-1===o&&(this.eof=!0)}else this.rowsDone=!0;if(!this.eof&&this.encoding>0&&!this.rowsDone&&(this.nextLine2D=!this._lookBits(1),this._eatBits(1)),this.eoblock&&h&&this.byteAlign){if(o=this._lookBits(12),1===o){if(this._eatBits(12),this.encoding>0&&(this._lookBits(1),this._eatBits(1)),this.encoding>=0)for(a=0;a<4;++a)o=this._lookBits(12),1!==o&&(0,r.info)("bad rtc code: "+o),this._eatBits(12),this.encoding>0&&(this._lookBits(1),this._eatBits(1));this.eof=!0}}else if(this.err&&this.eoline){for(;;){if(o=this._lookBits(13),-1===o)return this.eof=!0,-1;if(o>>1==1)break;this._eatBits(1)}this._eatBits(12),this.encoding>0&&(this._eatBits(1),this.nextLine2D=!(1&o))}t[0]>0?this.outputBits=t[this.codingPos=0]:this.outputBits=t[this.codingPos=1],this.row++}if(this.outputBits>=8)c=1&this.codingPos?0:255,this.outputBits-=8,0===this.outputBits&&t[this.codingPos]<n&&(this.codingPos++,this.outputBits=t[this.codingPos]-t[this.codingPos-1]);else{o=8,c=0;do{this.outputBits>o?(c<<=o,1&this.codingPos||(c|=255>>8-o),this.outputBits-=o,o=0):(c<<=this.outputBits,1&this.codingPos||(c|=255>>8-this.outputBits),o-=this.outputBits,this.outputBits=0,t[this.codingPos]<n?(this.codingPos++,this.outputBits=t[this.codingPos]-t[this.codingPos-1]):o>0&&(c<<=o,o=0))}while(o)}return this.black&&(c^=255),c},_addPixels(e,t){const n=this.codingLine;let i=this.codingPos;e>n[i]&&(e>this.columns&&((0,r.info)("row is wrong length"),this.err=!0,e=this.columns),1&i^t&&++i,n[i]=e),this.codingPos=i},_addPixelsNeg(e,t){const n=this.codingLine;let i=this.codingPos;if(e>n[i])e>this.columns&&((0,r.info)("row is wrong length"),this.err=!0,e=this.columns),1&i^t&&++i,n[i]=e;else if(e<n[i]){for(e<0&&((0,r.info)("invalid code"),this.err=!0,e=0);i>0&&e<n[i-1];)--i;n[i]=e}this.codingPos=i},_findTableCode(e,t,n,r){const i=r||0;for(let r=e;r<=t;++r){let e=this._lookBits(r);if(-1===e)return[!0,1,!1];if(r<t&&(e<<=t-r),!i||e>=i){const t=n[e-i];if(t[0]===r)return this._eatBits(r),[!0,t[1],!0]}}return[!1,0,!1]},_getTwoDimCode(){let t,n=0;if(this.eoblock){if(n=this._lookBits(7),t=e[n],t&&t[0]>0)return this._eatBits(t[0]),t[1]}else{const t=this._findTableCode(1,7,e);if(t[0]&&t[2])return t[1]}return(0,r.info)("Bad two dim code"),-1},_getWhiteCode(){let e,i=0;if(this.eoblock){if(i=this._lookBits(12),-1===i)return 1;if(e=i>>5==0?t[i]:n[i>>3],e[0]>0)return this._eatBits(e[0]),e[1]}else{let e=this._findTableCode(1,9,n);if(e[0])return e[1];if(e=this._findTableCode(11,12,t),e[0])return e[1]}return(0,r.info)("bad white code"),this._eatBits(1),1},_getBlackCode(){let e,t;if(this.eoblock){if(e=this._lookBits(13),-1===e)return 1;if(t=e>>7==0?i[e]:e>>9==0&&e>>7!=0?s[(e>>1)-64]:o[e>>7],t[0]>0)return this._eatBits(t[0]),t[1]}else{let e=this._findTableCode(2,6,o);if(e[0])return e[1];if(e=this._findTableCode(7,12,s,64),e[0])return e[1];if(e=this._findTableCode(10,13,i),e[0])return e[1]}return(0,r.info)("bad black code"),this._eatBits(1),1},_lookBits(e){let t;for(;this.inputBits<e;){if(-1===(t=this.source.next()))return 0===this.inputBits?-1:this.inputBuf<<e-this.inputBits&65535>>16-e;this.inputBuf=this.inputBuf<<8|t,this.inputBits+=8}return this.inputBuf>>this.inputBits-e&65535>>16-e},_eatBits(e){(this.inputBits-=e)<0&&(this.inputBits=0)}},a}();t.CCITTFaxDecoder=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JpegImage=void 0;var r=n(1),i=n(5);class s extends r.BaseException{constructor(e){super("JPEG error: "+e)}}class o extends r.BaseException{constructor(e,t){super(e),this.scanLines=t}}class a extends r.BaseException{}var c=function(){var e=new Uint8Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]);function t({decodeTransform:e=null,colorTransform:t=-1}={}){this._decodeTransform=e,this._colorTransform=t}function n(e,t){for(var n,r,i=0,s=[],o=16;o>0&&!e[o-1];)o--;s.push({children:[],index:0});var a,c=s[0];for(n=0;n<o;n++){for(r=0;r<e[n];r++){for((c=s.pop()).children[c.index]=t[i];c.index>0;)c=s.pop();for(c.index++,s.push(c);s.length<=n;)s.push(a={children:[],index:0}),c.children[c.index]=a.children,c=a;i++}n+1<o&&(s.push(a={children:[],index:0}),c.children[c.index]=a.children,c=a)}return s[0].children}function c(e,t,n){return 64*((e.blocksPerLine+1)*t+n)}function l(t,n,l,h,f,d,p,m,g,b=!1){var v=l.mcusPerLine,y=l.progressive;const x=n;let w=0,C=0;function P(){if(C>0)return C--,w>>C&1;if(w=t[n++],255===w){var e=t[n++];if(e){if(220===e&&b){n+=2;const e=(0,i.readUint16)(t,n);if(n+=2,e>0&&e!==l.scanLines)throw new o("Found DNL marker (0xFFDC) while parsing scan data",e)}else if(217===e){if(b){const e=8*A;if(e>0&&e<l.scanLines/10)throw new o("Found EOI marker (0xFFD9) while parsing scan data, possibly caused by incorrect `scanLines` parameter",e)}throw new a("Found EOI marker (0xFFD9) while parsing scan data")}throw new s("unexpected marker "+(w<<8|e).toString(16))}}return C=7,w>>>7}function T(e){for(var t=e;;){switch(typeof(t=t[P()])){case"number":return t;case"object":continue}throw new s("invalid huffman sequence")}}function I(e){for(var t=0;e>0;)t=t<<1|P(),e--;return t}function k(e){if(1===e)return 1===P()?1:-1;var t=I(e);return t>=1<<e-1?t:t+(-1<<e)+1}var S=0;var L,O=0;let A=0;function E(e,t,n,r,i){var s=n%v;A=(n/v|0)*e.v+r;var o=s*e.h+i;t(e,c(e,A,o))}function D(e,t,n){A=n/e.blocksPerLine|0;var r=n%e.blocksPerLine;t(e,c(e,A,r))}var M,B,U,R,_,F,N=h.length;F=y?0===d?0===m?function(e,t){var n=T(e.huffmanTableDC),r=0===n?0:k(n)<<g;e.blockData[t]=e.pred+=r}:function(e,t){e.blockData[t]|=P()<<g}:0===m?function(t,n){if(S>0)S--;else for(var r=d,i=p;r<=i;){var s=T(t.huffmanTableAC),o=15&s,a=s>>4;if(0!==o){var c=e[r+=a];t.blockData[n+c]=k(o)*(1<<g),r++}else{if(a<15){S=I(a)+(1<<a)-1;break}r+=16}}}:function(t,n){for(var r,i,o=d,a=p,c=0;o<=a;){const a=n+e[o],l=t.blockData[a]<0?-1:1;switch(O){case 0:if(c=(i=T(t.huffmanTableAC))>>4,0===(r=15&i))c<15?(S=I(c)+(1<<c),O=4):(c=16,O=1);else{if(1!==r)throw new s("invalid ACn encoding");L=k(r),O=c?2:3}continue;case 1:case 2:t.blockData[a]?t.blockData[a]+=l*(P()<<g):0===--c&&(O=2===O?3:0);break;case 3:t.blockData[a]?t.blockData[a]+=l*(P()<<g):(t.blockData[a]=L<<g,O=0);break;case 4:t.blockData[a]&&(t.blockData[a]+=l*(P()<<g))}o++}4===O&&0===--S&&(O=0)}:function(t,n){var r=T(t.huffmanTableDC),i=0===r?0:k(r);t.blockData[n]=t.pred+=i;for(var s=1;s<64;){var o=T(t.huffmanTableAC),a=15&o,c=o>>4;if(0!==a){var l=e[s+=c];t.blockData[n+l]=k(a),s++}else{if(c<15)break;s+=16}}};var z,X,H,Y,j=0;for(X=1===N?h[0].blocksPerLine*h[0].blocksPerColumn:v*l.mcusPerColumn;j<=X;){var q=f?Math.min(X-j,f):X;if(q>0){for(B=0;B<N;B++)h[B].pred=0;if(S=0,1===N)for(M=h[0],_=0;_<q;_++)D(M,F,j),j++;else for(_=0;_<q;_++){for(B=0;B<N;B++)for(H=(M=h[B]).h,Y=M.v,U=0;U<Y;U++)for(R=0;R<H;R++)E(M,F,j,U,R);j++}}if(C=0,!(z=u(t,n)))break;if(z.invalid){const e=q>0?"unexpected":"excessive";(0,r.warn)(`decodeScan - ${e} MCU data, current marker is: ${z.invalid}`),n=z.offset}if(!(z.marker>=65488&&z.marker<=65495))break;n+=2}return n-x}function h(e,t,n){var r,i,o,a,c,l,h,f,u,d,p,m,g,b,v,y,x,w=e.quantizationTable,C=e.blockData;if(!w)throw new s("missing required Quantization Table.");for(var P=0;P<64;P+=8)u=C[t+P],d=C[t+P+1],p=C[t+P+2],m=C[t+P+3],g=C[t+P+4],b=C[t+P+5],v=C[t+P+6],y=C[t+P+7],u*=w[P],0!=(d|p|m|g|b|v|y)?(d*=w[P+1],p*=w[P+2],m*=w[P+3],g*=w[P+4],b*=w[P+5],i=(r=(r=5793*u+128>>8)+(i=5793*g+128>>8)+1>>1)-i,x=3784*(o=p)+1567*(a=v*=w[P+6])+128>>8,o=1567*o-3784*a+128>>8,h=(c=(c=2896*(d-(y*=w[P+7]))+128>>8)+(h=b<<4)+1>>1)-h,l=(f=(f=2896*(d+y)+128>>8)+(l=m<<4)+1>>1)-l,a=(r=r+(a=x)+1>>1)-a,o=(i=i+o+1>>1)-o,x=2276*c+3406*f+2048>>12,c=3406*c-2276*f+2048>>12,f=x,x=799*l+4017*h+2048>>12,l=4017*l-799*h+2048>>12,h=x,n[P]=r+f,n[P+7]=r-f,n[P+1]=i+h,n[P+6]=i-h,n[P+2]=o+l,n[P+5]=o-l,n[P+3]=a+c,n[P+4]=a-c):(x=5793*u+512>>10,n[P]=x,n[P+1]=x,n[P+2]=x,n[P+3]=x,n[P+4]=x,n[P+5]=x,n[P+6]=x,n[P+7]=x);for(var T=0;T<8;++T)u=n[T],0!=((d=n[T+8])|(p=n[T+16])|(m=n[T+24])|(g=n[T+32])|(b=n[T+40])|(v=n[T+48])|(y=n[T+56]))?(i=(r=4112+((r=5793*u+2048>>12)+(i=5793*g+2048>>12)+1>>1))-i,x=3784*(o=p)+1567*(a=v)+2048>>12,o=1567*o-3784*a+2048>>12,a=x,h=(c=(c=2896*(d-y)+2048>>12)+(h=b)+1>>1)-h,l=(f=(f=2896*(d+y)+2048>>12)+(l=m)+1>>1)-l,x=2276*c+3406*f+2048>>12,c=3406*c-2276*f+2048>>12,f=x,x=799*l+4017*h+2048>>12,l=4017*l-799*h+2048>>12,(u=(r=r+a+1>>1)+f)<16?u=0:u>=4080?u=255:u>>=4,(d=(i=i+o+1>>1)+(h=x))<16?d=0:d>=4080?d=255:d>>=4,(p=(o=i-o)+l)<16?p=0:p>=4080?p=255:p>>=4,(m=(a=r-a)+c)<16?m=0:m>=4080?m=255:m>>=4,(g=a-c)<16?g=0:g>=4080?g=255:g>>=4,(b=o-l)<16?b=0:b>=4080?b=255:b>>=4,(v=i-h)<16?v=0:v>=4080?v=255:v>>=4,(y=r-f)<16?y=0:y>=4080?y=255:y>>=4,C[t+T]=u,C[t+T+8]=d,C[t+T+16]=p,C[t+T+24]=m,C[t+T+32]=g,C[t+T+40]=b,C[t+T+48]=v,C[t+T+56]=y):(x=(x=5793*u+8192>>14)<-2040?0:x>=2024?255:x+2056>>4,C[t+T]=x,C[t+T+8]=x,C[t+T+16]=x,C[t+T+24]=x,C[t+T+32]=x,C[t+T+40]=x,C[t+T+48]=x,C[t+T+56]=x)}function f(e,t){for(var n=t.blocksPerLine,r=t.blocksPerColumn,i=new Int16Array(64),s=0;s<r;s++)for(var o=0;o<n;o++){h(t,c(t,s,o),i)}return t.blockData}function u(e,t,n=t){const r=e.length-1;var s=n<t?n:t;if(t>=r)return null;var o=(0,i.readUint16)(e,t);if(o>=65472&&o<=65534)return{invalid:null,marker:o,offset:t};for(var a=(0,i.readUint16)(e,s);!(a>=65472&&a<=65534);){if(++s>=r)return null;a=(0,i.readUint16)(e,s)}return{invalid:o.toString(16),marker:a,offset:s}}return t.prototype={parse(t,{dnlScanLines:c=null}={}){function h(){const e=(0,i.readUint16)(t,g);let n=(g+=2)+e-2;var s=u(t,n,g);s&&s.invalid&&((0,r.warn)("readDataBlock - incorrect length, current marker is: "+s.invalid),n=s.offset);var o=t.subarray(g,n);return g+=o.length,o}function d(e){for(var t=Math.ceil(e.samplesPerLine/8/e.maxH),n=Math.ceil(e.scanLines/8/e.maxV),r=0;r<e.components.length;r++){H=e.components[r];var i=Math.ceil(Math.ceil(e.samplesPerLine/8)*H.h/e.maxH),s=Math.ceil(Math.ceil(e.scanLines/8)*H.v/e.maxV),o=t*H.h,a=64*(n*H.v)*(o+1);H.blockData=new Int16Array(a),H.blocksPerLine=i,H.blocksPerColumn=s}e.mcusPerLine=t,e.mcusPerColumn=n}var p,m,g=0,b=null,v=null;let y=0;var x=[],w=[],C=[];let P=(0,i.readUint16)(t,g);if(g+=2,65496!==P)throw new s("SOI not found");P=(0,i.readUint16)(t,g),g+=2;e:for(;65497!==P;){var T,I,k;switch(P){case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:var S=h();65504===P&&74===S[0]&&70===S[1]&&73===S[2]&&70===S[3]&&0===S[4]&&(b={version:{major:S[5],minor:S[6]},densityUnits:S[7],xDensity:S[8]<<8|S[9],yDensity:S[10]<<8|S[11],thumbWidth:S[12],thumbHeight:S[13],thumbData:S.subarray(14,14+3*S[12]*S[13])}),65518===P&&65===S[0]&&100===S[1]&&111===S[2]&&98===S[3]&&101===S[4]&&(v={version:S[5]<<8|S[6],flags0:S[7]<<8|S[8],flags1:S[9]<<8|S[10],transformCode:S[11]});break;case 65499:for(var L=(0,i.readUint16)(t,g)+(g+=2)-2;g<L;){var O=t[g++],A=new Uint16Array(64);if(O>>4==0)for(I=0;I<64;I++)A[e[I]]=t[g++];else{if(O>>4!=1)throw new s("DQT - invalid table spec");for(I=0;I<64;I++)A[e[I]]=(0,i.readUint16)(t,g),g+=2}x[15&O]=A}break;case 65472:case 65473:case 65474:if(p)throw new s("Only single frame JPEGs supported");g+=2,(p={}).extended=65473===P,p.progressive=65474===P,p.precision=t[g++];const f=(0,i.readUint16)(t,g);g+=2,p.scanLines=c||f,p.samplesPerLine=(0,i.readUint16)(t,g),g+=2,p.components=[],p.componentIds={};var E,D=t[g++],M=0,B=0;for(T=0;T<D;T++){E=t[g];var U=t[g+1]>>4,R=15&t[g+1];M<U&&(M=U),B<R&&(B=R);var _=t[g+2];k=p.components.push({h:U,v:R,quantizationId:_,quantizationTable:null}),p.componentIds[E]=k-1,g+=3}p.maxH=M,p.maxV=B,d(p);break;case 65476:const Q=(0,i.readUint16)(t,g);for(g+=2,T=2;T<Q;){var F=t[g++],N=new Uint8Array(16),z=0;for(I=0;I<16;I++,g++)z+=N[I]=t[g];var X=new Uint8Array(z);for(I=0;I<z;I++,g++)X[I]=t[g];T+=17+z,(F>>4==0?C:w)[15&F]=n(N,X)}break;case 65501:g+=2,m=(0,i.readUint16)(t,g),g+=2;break;case 65498:const Z=1==++y&&!c;g+=2;var H,Y=t[g++],j=[];for(T=0;T<Y;T++){var q=p.componentIds[t[g++]];H=p.components[q];var W=t[g++];H.huffmanTableDC=C[W>>4],H.huffmanTableAC=w[15&W],j.push(H)}var G=t[g++],V=t[g++],J=t[g++];try{var K=l(t,g,p,j,m,G,V,J>>4,15&J,Z);g+=K}catch(e){if(e instanceof o)return(0,r.warn)(e.message+" -- attempting to re-parse the JPEG image."),this.parse(t,{dnlScanLines:e.scanLines});if(e instanceof a){(0,r.warn)(e.message+" -- ignoring the rest of the image data.");break e}throw e}break;case 65500:g+=4;break;case 65535:255!==t[g]&&g--;break;default:const $=u(t,g-2,g-3);if($&&$.invalid){(0,r.warn)("JpegImage.parse - unexpected data, current marker is: "+$.invalid),g=$.offset;break}if(g>=t.length-1){(0,r.warn)("JpegImage.parse - reached the end of the image data without finding an EOI marker (0xFFD9).");break e}throw new s("JpegImage.parse - unknown marker: "+P.toString(16))}P=(0,i.readUint16)(t,g),g+=2}for(this.width=p.samplesPerLine,this.height=p.scanLines,this.jfif=b,this.adobe=v,this.components=[],T=0;T<p.components.length;T++){var Q=x[(H=p.components[T]).quantizationId];Q&&(H.quantizationTable=Q),this.components.push({output:f(0,H),scaleX:H.h/p.maxH,scaleY:H.v/p.maxV,blocksPerLine:H.blocksPerLine,blocksPerColumn:H.blocksPerColumn})}this.numComponents=this.components.length},_getLinearizedBlockData(e,t,n=!1){var r,i,s,o,a,c,l,h,f,u,d,p=this.width/e,m=this.height/t,g=0,b=this.components.length,v=e*t*b,y=new Uint8ClampedArray(v),x=new Uint32Array(e);let w;for(l=0;l<b;l++){if(i=(r=this.components[l]).scaleX*p,s=r.scaleY*m,g=l,d=r.output,o=r.blocksPerLine+1<<3,i!==w){for(a=0;a<e;a++)h=0|a*i,x[a]=(4294967288&h)<<3|7&h;w=i}for(c=0;c<t;c++)for(u=o*(4294967288&(h=0|c*s))|(7&h)<<3,a=0;a<e;a++)y[g]=d[u+x[a]],g+=b}let C=this._decodeTransform;if(n||4!==b||C||(C=new Int32Array([-256,255,-256,255,-256,255,-256,255])),C)for(l=0;l<v;)for(h=0,f=0;h<b;h++,l++,f+=2)y[l]=(y[l]*C[f]>>8)+C[f+1];return y},get _isColorConversionNeeded(){return this.adobe?!!this.adobe.transformCode:3===this.numComponents?0!==this._colorTransform:1===this._colorTransform},_convertYccToRgb:function(e){for(var t,n,r,i=0,s=e.length;i<s;i+=3)t=e[i],n=e[i+1],r=e[i+2],e[i]=t-179.456+1.402*r,e[i+1]=t+135.459-.344*n-.714*r,e[i+2]=t-226.816+1.772*n;return e},_convertYcckToRgb:function(e){for(var t,n,r,i,s=0,o=0,a=e.length;o<a;o+=4)t=e[o],n=e[o+1],r=e[o+2],i=e[o+3],e[s++]=n*(-660635669420364e-19*n+.000437130475926232*r-54080610064599e-18*t+.00048449797120281*i-.154362151871126)-122.67195406894+r*(-.000957964378445773*r+.000817076911346625*t-.00477271405408747*i+1.53380253221734)+t*(.000961250184130688*t-.00266257332283933*i+.48357088451265)+i*(-.000336197177618394*i+.484791561490776),e[s++]=107.268039397724+n*(219927104525741e-19*n-.000640992018297945*r+.000659397001245577*t+.000426105652938837*i-.176491792462875)+r*(-.000778269941513683*r+.00130872261408275*t+.000770482631801132*i-.151051492775562)+t*(.00126935368114843*t-.00265090189010898*i+.25802910206845)+i*(-.000318913117588328*i-.213742400323665),e[s++]=n*(-.000570115196973677*n-263409051004589e-19*r+.0020741088115012*t-.00288260236853442*i+.814272968359295)-20.810012546947+r*(-153496057440975e-19*r-.000132689043961446*t+.000560833691242812*i-.195152027534049)+t*(.00174418132927582*t-.00255243321439347*i+.116935020465145)+i*(-.000343531996510555*i+.24165260232407);return e.subarray(0,s)},_convertYcckToCmyk:function(e){for(var t,n,r,i=0,s=e.length;i<s;i+=4)t=e[i],n=e[i+1],r=e[i+2],e[i]=434.456-t-1.402*r,e[i+1]=119.541-t+.344*n+.714*r,e[i+2]=481.816-t-1.772*n;return e},_convertCmykToRgb:function(e){for(var t,n,r,i,s=0,o=0,a=e.length;o<a;o+=4)t=e[o],n=e[o+1],r=e[o+2],i=e[o+3],e[s++]=255+t*(-6747147073602441e-20*t+.0008379262121013727*n+.0002894718188643294*r+.003264231057537806*i-1.1185611867203937)+n*(26374107616089405e-21*n-8626949158638572e-20*r-.0002748769067499491*i-.02155688794978967)+r*(-3878099212869363e-20*r-.0003267808279485286*i+.0686742238595345)-i*(.0003361971776183937*i+.7430659151342254),e[s++]=255+t*(.00013596372813588848*t+.000924537132573585*n+.00010567359618683593*r+.0004791864687436512*i-.3109689587515875)+n*(-.00023545346108370344*n+.0002702845253534714*r+.0020200308977307156*i-.7488052167015494)+r*(6834815998235662e-20*r+.00015168452363460973*i-.09751927774728933)-i*(.0003189131175883281*i+.7364883807733168),e[s++]=255+t*(13598650411385307e-21*t+.00012423956175490851*n+.0004751985097583589*r-36729317476630422e-22*i-.05562186980264034)+n*(.00016141380598724676*n+.0009692239130725186*r+.0007782692450036253*i-.44015232367526463)+r*(5.068882914068769e-7*r+.0017778369011375071*i-.7591454649749609)-i*(.0003435319965105553*i+.7063770186160144);return e.subarray(0,s)},getData({width:e,height:t,forceRGB:n=!1,isSourcePDF:r=!1}){if(this.numComponents>4)throw new s("Unsupported color mode");var i=this._getLinearizedBlockData(e,t,r);if(1===this.numComponents&&n){for(var o=i.length,a=new Uint8ClampedArray(3*o),c=0,l=0;l<o;l++){var h=i[l];a[c++]=h,a[c++]=h,a[c++]=h}return a}if(3===this.numComponents&&this._isColorConversionNeeded)return this._convertYccToRgb(i);if(4===this.numComponents){if(this._isColorConversionNeeded)return n?this._convertYcckToRgb(i):this._convertYcckToCmyk(i);if(n)return this._convertCmykToRgb(i)}return i}},t}();t.JpegImage=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JpxImage=void 0;var r=n(1),i=n(5),s=n(6);class o extends r.BaseException{constructor(e){super("JPX error: "+e)}}var a=function(){var e={LL:0,LH:1,HL:1,HH:2};function t(){this.failOnCorruptedImage=!1}function n(e,t){e.x0=Math.ceil(t.XOsiz/e.XRsiz),e.x1=Math.ceil(t.Xsiz/e.XRsiz),e.y0=Math.ceil(t.YOsiz/e.YRsiz),e.y1=Math.ceil(t.Ysiz/e.YRsiz),e.width=e.x1-e.x0,e.height=e.y1-e.y0}function a(e,t){for(var n,r=e.SIZ,i=[],s=Math.ceil((r.Xsiz-r.XTOsiz)/r.XTsiz),o=Math.ceil((r.Ysiz-r.YTOsiz)/r.YTsiz),a=0;a<o;a++)for(var c=0;c<s;c++)(n={}).tx0=Math.max(r.XTOsiz+c*r.XTsiz,r.XOsiz),n.ty0=Math.max(r.YTOsiz+a*r.YTsiz,r.YOsiz),n.tx1=Math.min(r.XTOsiz+(c+1)*r.XTsiz,r.Xsiz),n.ty1=Math.min(r.YTOsiz+(a+1)*r.YTsiz,r.Ysiz),n.width=n.tx1-n.tx0,n.height=n.ty1-n.ty0,n.components=[],i.push(n);e.tiles=i;for(var l=0,h=r.Csiz;l<h;l++)for(var f=t[l],u=0,d=i.length;u<d;u++){var p={};n=i[u],p.tcx0=Math.ceil(n.tx0/f.XRsiz),p.tcy0=Math.ceil(n.ty0/f.YRsiz),p.tcx1=Math.ceil(n.tx1/f.XRsiz),p.tcy1=Math.ceil(n.ty1/f.YRsiz),p.width=p.tcx1-p.tcx0,p.height=p.tcy1-p.tcy0,n.components[l]=p}}function c(e,t,n){var r=t.codingStyleParameters,i={};return r.entropyCoderWithCustomPrecincts?(i.PPx=r.precinctsSizes[n].PPx,i.PPy=r.precinctsSizes[n].PPy):(i.PPx=15,i.PPy=15),i.xcb_=n>0?Math.min(r.xcb,i.PPx-1):Math.min(r.xcb,i.PPx),i.ycb_=n>0?Math.min(r.ycb,i.PPy-1):Math.min(r.ycb,i.PPy),i}function l(e,t,n){var r=1<<n.PPx,i=1<<n.PPy,s=0===t.resLevel,o=1<<n.PPx+(s?0:-1),a=1<<n.PPy+(s?0:-1),c=t.trx1>t.trx0?Math.ceil(t.trx1/r)-Math.floor(t.trx0/r):0,l=t.try1>t.try0?Math.ceil(t.try1/i)-Math.floor(t.try0/i):0,h=c*l;t.precinctParameters={precinctWidth:r,precinctHeight:i,numprecinctswide:c,numprecinctshigh:l,numprecincts:h,precinctWidthInSubband:o,precinctHeightInSubband:a}}function h(e,t,n){var r,i,s,o,a=n.xcb_,c=n.ycb_,l=1<<a,h=1<<c,f=t.tbx0>>a,u=t.tby0>>c,d=t.tbx1+l-1>>a,p=t.tby1+h-1>>c,m=t.resolution.precinctParameters,g=[],b=[];for(i=u;i<p;i++)for(r=f;r<d;r++){if((s={cbx:r,cby:i,tbx0:l*r,tby0:h*i,tbx1:l*(r+1),tby1:h*(i+1)}).tbx0_=Math.max(t.tbx0,s.tbx0),s.tby0_=Math.max(t.tby0,s.tby0),s.tbx1_=Math.min(t.tbx1,s.tbx1),s.tby1_=Math.min(t.tby1,s.tby1),o=Math.floor((s.tbx0_-t.tbx0)/m.precinctWidthInSubband)+Math.floor((s.tby0_-t.tby0)/m.precinctHeightInSubband)*m.numprecinctswide,s.precinctNumber=o,s.subbandType=t.type,s.Lblock=3,!(s.tbx1_<=s.tbx0_||s.tby1_<=s.tby0_)){g.push(s);var v=b[o];void 0!==v?(r<v.cbxMin?v.cbxMin=r:r>v.cbxMax&&(v.cbxMax=r),i<v.cbyMin?v.cbxMin=i:i>v.cbyMax&&(v.cbyMax=i)):b[o]=v={cbxMin:r,cbyMin:i,cbxMax:r,cbyMax:i},s.precinct=v}}t.codeblockParameters={codeblockWidth:a,codeblockHeight:c,numcodeblockwide:d-f+1,numcodeblockhigh:p-u+1},t.codeblocks=g,t.precincts=b}function f(e,t,n){for(var r=[],i=e.subbands,s=0,o=i.length;s<o;s++)for(var a=i[s].codeblocks,c=0,l=a.length;c<l;c++){var h=a[c];h.precinctNumber===t&&r.push(h)}return{layerNumber:n,codeblocks:r}}function u(e){for(var t=e.SIZ,n=e.currentTile.index,r=e.tiles[n],i=r.codingStyleDefaultParameters.layersCount,s=t.Csiz,a=0,c=0;c<s;c++)a=Math.max(a,r.components[c].codingStyleParameters.decompositionLevelsCount);var l=0,h=0,u=0,d=0;this.nextPacket=function(){for(;l<i;l++){for(;h<=a;h++){for(;u<s;u++){var e=r.components[u];if(!(h>e.codingStyleParameters.decompositionLevelsCount)){for(var t=e.resolutions[h],n=t.precinctParameters.numprecincts;d<n;){var c=f(t,d,l);return d++,c}d=0}}u=0}h=0}throw new o("Out of packets")}}function d(e){for(var t=e.SIZ,n=e.currentTile.index,r=e.tiles[n],i=r.codingStyleDefaultParameters.layersCount,s=t.Csiz,a=0,c=0;c<s;c++)a=Math.max(a,r.components[c].codingStyleParameters.decompositionLevelsCount);var l=0,h=0,u=0,d=0;this.nextPacket=function(){for(;l<=a;l++){for(;h<i;h++){for(;u<s;u++){var e=r.components[u];if(!(l>e.codingStyleParameters.decompositionLevelsCount)){for(var t=e.resolutions[l],n=t.precinctParameters.numprecincts;d<n;){var c=f(t,d,h);return d++,c}d=0}}u=0}h=0}throw new o("Out of packets")}}function p(e){var t,n,r,i,s=e.SIZ,a=e.currentTile.index,c=e.tiles[a],l=c.codingStyleDefaultParameters.layersCount,h=s.Csiz,u=0;for(r=0;r<h;r++){const e=c.components[r];u=Math.max(u,e.codingStyleParameters.decompositionLevelsCount)}var d=new Int32Array(u+1);for(n=0;n<=u;++n){var p=0;for(r=0;r<h;++r){var m=c.components[r].resolutions;n<m.length&&(p=Math.max(p,m[n].precinctParameters.numprecincts))}d[n]=p}t=0,n=0,r=0,i=0,this.nextPacket=function(){for(;n<=u;n++){for(;i<d[n];i++){for(;r<h;r++){const o=c.components[r];if(!(n>o.codingStyleParameters.decompositionLevelsCount)){var e=o.resolutions[n],s=e.precinctParameters.numprecincts;if(!(i>=s)){for(;t<l;){var a=f(e,i,t);return t++,a}t=0}}}r=0}i=0}throw new o("Out of packets")}}function m(e){var t=e.SIZ,n=e.currentTile.index,r=e.tiles[n],i=r.codingStyleDefaultParameters.layersCount,s=t.Csiz,a=v(r),c=a,l=0,h=0,u=0,d=0,p=0;this.nextPacket=function(){for(;p<c.maxNumHigh;p++){for(;d<c.maxNumWide;d++){for(;u<s;u++){for(var e=r.components[u],t=e.codingStyleParameters.decompositionLevelsCount;h<=t;h++){var n=e.resolutions[h],m=a.components[u].resolutions[h],g=b(d,p,m,c,n);if(null!==g){for(;l<i;){var v=f(n,g,l);return l++,v}l=0}}h=0}u=0}d=0}throw new o("Out of packets")}}function g(e){var t=e.SIZ,n=e.currentTile.index,r=e.tiles[n],i=r.codingStyleDefaultParameters.layersCount,s=t.Csiz,a=v(r),c=0,l=0,h=0,u=0,d=0;this.nextPacket=function(){for(;h<s;++h){for(var e=r.components[h],t=a.components[h],n=e.codingStyleParameters.decompositionLevelsCount;d<t.maxNumHigh;d++){for(;u<t.maxNumWide;u++){for(;l<=n;l++){var p=e.resolutions[l],m=t.resolutions[l],g=b(u,d,m,t,p);if(null!==g){for(;c<i;){var v=f(p,g,c);return c++,v}c=0}}l=0}u=0}d=0}throw new o("Out of packets")}}function b(e,t,n,r,i){var s=e*r.minWidth,o=t*r.minHeight;if(s%n.width!=0||o%n.height!=0)return null;var a=o/n.width*i.precinctParameters.numprecinctswide;return s/n.height+a}function v(e){for(var t=e.components.length,n=Number.MAX_VALUE,r=Number.MAX_VALUE,i=0,s=0,o=new Array(t),a=0;a<t;a++){for(var c=e.components[a],l=c.codingStyleParameters.decompositionLevelsCount,h=new Array(l+1),f=Number.MAX_VALUE,u=Number.MAX_VALUE,d=0,p=0,m=1,g=l;g>=0;--g){var b=c.resolutions[g],v=m*b.precinctParameters.precinctWidth,y=m*b.precinctParameters.precinctHeight;f=Math.min(f,v),u=Math.min(u,y),d=Math.max(d,b.precinctParameters.numprecinctswide),p=Math.max(p,b.precinctParameters.numprecinctshigh),h[g]={width:v,height:y},m<<=1}n=Math.min(n,f),r=Math.min(r,u),i=Math.max(i,d),s=Math.max(s,p),o[a]={resolutions:h,minWidth:f,minHeight:u,maxNumWide:d,maxNumHigh:p}}return{components:o,minWidth:n,minHeight:r,maxNumWide:i,maxNumHigh:s}}function y(e){for(var t=e.SIZ,n=e.currentTile.index,r=e.tiles[n],i=t.Csiz,s=0;s<i;s++){for(var a=r.components[s],f=a.codingStyleParameters.decompositionLevelsCount,b=[],v=[],y=0;y<=f;y++){var x,w=c(0,a,y),C={},P=1<<f-y;if(C.trx0=Math.ceil(a.tcx0/P),C.try0=Math.ceil(a.tcy0/P),C.trx1=Math.ceil(a.tcx1/P),C.try1=Math.ceil(a.tcy1/P),C.resLevel=y,l(0,C,w),b.push(C),0===y)(x={}).type="LL",x.tbx0=Math.ceil(a.tcx0/P),x.tby0=Math.ceil(a.tcy0/P),x.tbx1=Math.ceil(a.tcx1/P),x.tby1=Math.ceil(a.tcy1/P),x.resolution=C,h(0,x,w),v.push(x),C.subbands=[x];else{var T=1<<f-y+1,I=[];(x={}).type="HL",x.tbx0=Math.ceil(a.tcx0/T-.5),x.tby0=Math.ceil(a.tcy0/T),x.tbx1=Math.ceil(a.tcx1/T-.5),x.tby1=Math.ceil(a.tcy1/T),x.resolution=C,h(0,x,w),v.push(x),I.push(x),(x={}).type="LH",x.tbx0=Math.ceil(a.tcx0/T),x.tby0=Math.ceil(a.tcy0/T-.5),x.tbx1=Math.ceil(a.tcx1/T),x.tby1=Math.ceil(a.tcy1/T-.5),x.resolution=C,h(0,x,w),v.push(x),I.push(x),(x={}).type="HH",x.tbx0=Math.ceil(a.tcx0/T-.5),x.tby0=Math.ceil(a.tcy0/T-.5),x.tbx1=Math.ceil(a.tcx1/T-.5),x.tby1=Math.ceil(a.tcy1/T-.5),x.resolution=C,h(0,x,w),v.push(x),I.push(x),C.subbands=I}}a.resolutions=b,a.subbands=v}var k=r.codingStyleDefaultParameters.progressionOrder;switch(k){case 0:r.packetsIterator=new u(e);break;case 1:r.packetsIterator=new d(e);break;case 2:r.packetsIterator=new p(e);break;case 3:r.packetsIterator=new m(e);break;case 4:r.packetsIterator=new g(e);break;default:throw new o("Unsupported progression order "+k)}}function x(e,t,n,r){var s,o=0,a=0,c=!1;function l(e){for(;a<e;){var r=t[n+o];o++,c?(s=s<<7|r,a+=7,c=!1):(s=s<<8|r,a+=8),255===r&&(c=!0)}return s>>>(a-=e)&(1<<e)-1}function h(e){return 255===t[n+o-1]&&t[n+o]===e?(f(1),!0):255===t[n+o]&&t[n+o+1]===e&&(f(2),!0)}function f(e){o+=e}function u(){a=0,c&&(o++,c=!1)}function d(){if(0===l(1))return 1;if(0===l(1))return 2;var e=l(2);return e<3?e+3:(e=l(5))<31?e+6:(e=l(7))+37}for(var p=e.currentTile.index,m=e.tiles[p],g=e.COD.sopMarkerUsed,b=e.COD.ephMarkerUsed,v=m.packetsIterator;o<r;){u(),g&&h(145)&&f(4);var y=v.nextPacket();if(l(1)){for(var x,w=y.layerNumber,C=[],P=0,k=y.codeblocks.length;P<k;P++){var S=(x=y.codeblocks[P]).precinct,L=x.cbx-S.cbxMin,O=x.cby-S.cbyMin,A=!1,E=!1;if(void 0!==x.included)A=!!l(1);else{var D,M;if(void 0!==(S=x.precinct).inclusionTree)D=S.inclusionTree;else{var B=S.cbxMax-S.cbxMin+1,U=S.cbyMax-S.cbyMin+1;D=new I(B,U,w),M=new T(B,U),S.inclusionTree=D,S.zeroBitPlanesTree=M}if(D.reset(L,O,w))for(;;){if(!l(1)){D.incrementValue(w);break}if(!D.nextLevel()){x.included=!0,A=E=!0;break}}}if(A){if(E){for((M=S.zeroBitPlanesTree).reset(L,O);;)if(l(1)){if(!M.nextLevel())break}else M.incrementValue();x.zeroBitPlanes=M.value}for(var R=d();l(1);)x.Lblock++;var _=(0,i.log2)(R),F=l((R<1<<_?_-1:_)+x.Lblock);C.push({codeblock:x,codingpasses:R,dataLength:F})}}for(u(),b&&h(146);C.length>0;){var N=C.shift();void 0===(x=N.codeblock).data&&(x.data=[]),x.data.push({data:t,start:n+o,end:n+o+N.dataLength,codingpasses:N.codingpasses}),o+=N.dataLength}}}return o}function w(e,t,n,r,i,o,a,c){for(var l=r.tbx0,h=r.tby0,f=r.tbx1-r.tbx0,u=r.codeblocks,d="H"===r.type.charAt(0)?1:0,p="H"===r.type.charAt(1)?t:0,m=0,g=u.length;m<g;++m){var b=u[m],v=b.tbx1_-b.tbx0_,y=b.tby1_-b.tby0_;if(0!==v&&0!==y&&void 0!==b.data){var x,w;x=new k(v,y,b.subbandType,b.zeroBitPlanes,o),w=2;var C,P,T,I=b.data,S=0,L=0;for(C=0,P=I.length;C<P;C++)S+=(T=I[C]).end-T.start,L+=T.codingpasses;var O=new Uint8Array(S),A=0;for(C=0,P=I.length;C<P;C++){var E=(T=I[C]).data.subarray(T.start,T.end);O.set(E,A),A+=E.length}var D=new s.ArithmeticDecoder(O,0,S);for(x.setDecoder(D),C=0;C<L;C++){switch(w){case 0:x.runSignificancePropagationPass();break;case 1:x.runMagnitudeRefinementPass();break;case 2:x.runCleanupPass(),c&&x.checkSegmentationSymbol()}w=(w+1)%3}var M,B,U,R=b.tbx0_-l+(b.tby0_-h)*f,_=x.coefficentsSign,F=x.coefficentsMagnitude,N=x.bitsDecoded,z=a?0:.5;A=0;var X="LL"!==r.type;for(C=0;C<y;C++){var H=2*(R/f|0)*(t-f)+d+p;for(M=0;M<v;M++){if(0!==(B=F[A])){B=(B+z)*i,0!==_[A]&&(B=-B),U=N[A];var Y=X?H+(R<<1):R;e[Y]=a&&U>=o?B:B*(1<<o-U)}R++,A++}R+=f-v}}}}function C(t,n,r){for(var i=n.components[r],s=i.codingStyleParameters,o=i.quantizationParameters,a=s.decompositionLevelsCount,c=o.SPqcds,l=o.scalarExpounded,h=o.guardBits,f=s.segmentationSymbolUsed,u=t.components[r].precision,d=s.reversibleTransformation,p=d?new O:new L,m=[],g=0,b=0;b<=a;b++){for(var v=i.resolutions[b],y=v.trx1-v.trx0,x=v.try1-v.try0,C=new Float32Array(y*x),P=0,T=v.subbands.length;P<T;P++){var I,k;l?(I=c[g].mu,k=c[g].epsilon,g++):(I=c[0].mu,k=c[0].epsilon+(b>0?1-b:0));var S=v.subbands[P],A=e[S.type];w(C,y,0,S,d?1:2**(u+A-k)*(1+I/2048),h+k-1,d,f)}m.push({width:y,height:x,items:C})}var E=p.calculate(m,i.tcx0,i.tcy0);return{left:i.tcx0,top:i.tcy0,width:E.width,height:E.height,items:E.items}}function P(e,t){for(var n=e.SIZ.Csiz,r=e.tiles[t],i=0;i<n;i++){var s=r.components[i],o=void 0!==e.currentTile.QCC[i]?e.currentTile.QCC[i]:e.currentTile.QCD;s.quantizationParameters=o;var a=void 0!==e.currentTile.COC[i]?e.currentTile.COC[i]:e.currentTile.COD;s.codingStyleParameters=a}r.codingStyleDefaultParameters=e.currentTile.COD}t.prototype={parse:function(e){if(65359!==(0,i.readUint16)(e,0))for(var t=0,n=e.length;t<n;){var s=8,a=(0,i.readUint32)(e,t),c=(0,i.readUint32)(e,t+4);if(t+=s,1===a&&(a=4294967296*(0,i.readUint32)(e,t)+(0,i.readUint32)(e,t+4),t+=8,s+=8),0===a&&(a=n-t+s),a<s)throw new o("Invalid box field size");var l=a-s,h=!0;switch(c){case 1785737832:h=!1;break;case 1668246642:var f=e[t];if(1===f){var u=(0,i.readUint32)(e,t+3);switch(u){case 16:case 17:case 18:break;default:(0,r.warn)("Unknown colorspace "+u)}}else 2===f&&(0,r.info)("ICC profile not supported");break;case 1785737827:this.parseCodestream(e,t,t+l);break;case 1783636e3:218793738!==(0,i.readUint32)(e,t)&&(0,r.warn)("Invalid JP2 signature");break;case 1783634458:case 1718909296:case 1920099697:case 1919251232:case 1768449138:break;default:var d=String.fromCharCode(c>>24&255,c>>16&255,c>>8&255,255&c);(0,r.warn)("Unsupported header type "+c+" ("+d+")")}h&&(t+=l)}else this.parseCodestream(e,0,e.length)},parseImageProperties:function(e){for(var t=e.getByte();t>=0;){if(65361===(t<<8|(t=e.getByte()))){e.skip(4);var n=e.getInt32()>>>0,r=e.getInt32()>>>0,i=e.getInt32()>>>0,s=e.getInt32()>>>0;e.skip(16);var a=e.getUint16();return this.width=n-i,this.height=r-s,this.componentsCount=a,void(this.bitsPerComponent=8)}}throw new o("No size marker found in JPX stream")},parseCodestream:function(e,t,s){var c={},l=!1;try{for(var h=t;h+1<s;){var f=(0,i.readUint16)(e,h);h+=2;var u,d,p,m,g,b,v=0;switch(f){case 65359:c.mainHeader=!0;break;case 65497:break;case 65361:v=(0,i.readUint16)(e,h);var w={};w.Xsiz=(0,i.readUint32)(e,h+4),w.Ysiz=(0,i.readUint32)(e,h+8),w.XOsiz=(0,i.readUint32)(e,h+12),w.YOsiz=(0,i.readUint32)(e,h+16),w.XTsiz=(0,i.readUint32)(e,h+20),w.YTsiz=(0,i.readUint32)(e,h+24),w.XTOsiz=(0,i.readUint32)(e,h+28),w.YTOsiz=(0,i.readUint32)(e,h+32);var T=(0,i.readUint16)(e,h+36);w.Csiz=T;var I=[];u=h+38;for(var k=0;k<T;k++){var S={precision:1+(127&e[u]),isSigned:!!(128&e[u]),XRsiz:e[u+1],YRsiz:e[u+2]};u+=3,n(S,w),I.push(S)}c.SIZ=w,c.components=I,a(c,I),c.QCC=[],c.COC=[];break;case 65372:v=(0,i.readUint16)(e,h);var L={};switch(u=h+2,31&(d=e[u++])){case 0:m=8,g=!0;break;case 1:m=16,g=!1;break;case 2:m=16,g=!0;break;default:throw new Error("Invalid SQcd value "+d)}for(L.noQuantization=8===m,L.scalarExpounded=g,L.guardBits=d>>5,p=[];u<v+h;){var O={};8===m?(O.epsilon=e[u++]>>3,O.mu=0):(O.epsilon=e[u]>>3,O.mu=(7&e[u])<<8|e[u+1],u+=2),p.push(O)}L.SPqcds=p,c.mainHeader?c.QCD=L:(c.currentTile.QCD=L,c.currentTile.QCC=[]);break;case 65373:v=(0,i.readUint16)(e,h);var A,E={};switch(u=h+2,c.SIZ.Csiz<257?A=e[u++]:(A=(0,i.readUint16)(e,u),u+=2),31&(d=e[u++])){case 0:m=8,g=!0;break;case 1:m=16,g=!1;break;case 2:m=16,g=!0;break;default:throw new Error("Invalid SQcd value "+d)}for(E.noQuantization=8===m,E.scalarExpounded=g,E.guardBits=d>>5,p=[];u<v+h;)O={},8===m?(O.epsilon=e[u++]>>3,O.mu=0):(O.epsilon=e[u]>>3,O.mu=(7&e[u])<<8|e[u+1],u+=2),p.push(O);E.SPqcds=p,c.mainHeader?c.QCC[A]=E:c.currentTile.QCC[A]=E;break;case 65362:v=(0,i.readUint16)(e,h);var D={};u=h+2;var M=e[u++];D.entropyCoderWithCustomPrecincts=!!(1&M),D.sopMarkerUsed=!!(2&M),D.ephMarkerUsed=!!(4&M),D.progressionOrder=e[u++],D.layersCount=(0,i.readUint16)(e,u),u+=2,D.multipleComponentTransform=e[u++],D.decompositionLevelsCount=e[u++],D.xcb=2+(15&e[u++]),D.ycb=2+(15&e[u++]);var B=e[u++];if(D.selectiveArithmeticCodingBypass=!!(1&B),D.resetContextProbabilities=!!(2&B),D.terminationOnEachCodingPass=!!(4&B),D.verticallyStripe=!!(8&B),D.predictableTermination=!!(16&B),D.segmentationSymbolUsed=!!(32&B),D.reversibleTransformation=e[u++],D.entropyCoderWithCustomPrecincts){for(var U=[];u<v+h;){var R=e[u++];U.push({PPx:15&R,PPy:R>>4})}D.precinctsSizes=U}var _=[];if(D.selectiveArithmeticCodingBypass&&_.push("selectiveArithmeticCodingBypass"),D.resetContextProbabilities&&_.push("resetContextProbabilities"),D.terminationOnEachCodingPass&&_.push("terminationOnEachCodingPass"),D.verticallyStripe&&_.push("verticallyStripe"),D.predictableTermination&&_.push("predictableTermination"),_.length>0)throw l=!0,new Error("Unsupported COD options ("+_.join(", ")+")");c.mainHeader?c.COD=D:(c.currentTile.COD=D,c.currentTile.COC=[]);break;case 65424:v=(0,i.readUint16)(e,h),(b={}).index=(0,i.readUint16)(e,h+2),b.length=(0,i.readUint32)(e,h+4),b.dataEnd=b.length+h-2,b.partIndex=e[h+8],b.partsCount=e[h+9],c.mainHeader=!1,0===b.partIndex&&(b.COD=c.COD,b.COC=c.COC.slice(0),b.QCD=c.QCD,b.QCC=c.QCC.slice(0)),c.currentTile=b;break;case 65427:0===(b=c.currentTile).partIndex&&(P(c,b.index),y(c)),x(c,e,h,v=b.dataEnd-h);break;case 65365:case 65367:case 65368:case 65380:v=(0,i.readUint16)(e,h);break;case 65363:throw new Error("Codestream code 0xFF53 (COC) is not implemented");default:throw new Error("Unknown codestream code: "+f.toString(16))}h+=v}}catch(e){if(l||this.failOnCorruptedImage)throw new o(e.message);(0,r.warn)("JPX: Trying to recover from: "+e.message)}this.tiles=function(e){for(var t=e.SIZ,n=e.components,r=t.Csiz,i=[],s=0,o=e.tiles.length;s<o;s++){var a,c=e.tiles[s],l=[];for(a=0;a<r;a++)l[a]=C(e,c,a);var h,f,u,d,p,m,g,b=l[0],v=new Uint8ClampedArray(b.items.length*r),y={left:b.left,top:b.top,width:b.width,height:b.height,items:v},x=0;if(c.codingStyleDefaultParameters.multipleComponentTransform){var w=4===r,P=l[0].items,T=l[1].items,I=l[2].items,k=w?l[3].items:null;h=n[0].precision-8,f=.5+(128<<h);var S=c.components[0],L=r-3;if(d=P.length,S.codingStyleParameters.reversibleTransformation)for(u=0;u<d;u++,x+=L){p=P[u]+f,m=T[u],g=I[u];const e=p-(g+m>>2);v[x++]=e+g>>h,v[x++]=e>>h,v[x++]=e+m>>h}else for(u=0;u<d;u++,x+=L)p=P[u]+f,m=T[u],g=I[u],v[x++]=p+1.402*g>>h,v[x++]=p-.34413*m-.71414*g>>h,v[x++]=p+1.772*m>>h;if(w)for(u=0,x=3;u<d;u++,x+=4)v[x]=k[u]+f>>h}else for(a=0;a<r;a++){var O=l[a].items;for(h=n[a].precision-8,f=.5+(128<<h),x=a,u=0,d=O.length;u<d;u++)v[x]=O[u]+f>>h,x+=r}i.push(y)}return i}(c),this.width=c.SIZ.Xsiz-c.SIZ.XOsiz,this.height=c.SIZ.Ysiz-c.SIZ.YOsiz,this.componentsCount=c.SIZ.Csiz}};var T=function(){function e(e,t){var n=(0,i.log2)(Math.max(e,t))+1;this.levels=[];for(var r=0;r<n;r++){var s={width:e,height:t,items:[]};this.levels.push(s),e=Math.ceil(e/2),t=Math.ceil(t/2)}}return e.prototype={reset:function(e,t){for(var n,r=0,i=0;r<this.levels.length;){var s=e+t*(n=this.levels[r]).width;if(void 0!==n.items[s]){i=n.items[s];break}n.index=s,e>>=1,t>>=1,r++}r--,(n=this.levels[r]).items[n.index]=i,this.currentLevel=r,delete this.value},incrementValue:function(){var e=this.levels[this.currentLevel];e.items[e.index]++},nextLevel:function(){var e=this.currentLevel,t=this.levels[e],n=t.items[t.index];return--e<0?(this.value=n,!1):(this.currentLevel=e,(t=this.levels[e]).items[t.index]=n,!0)}},e}(),I=function(){function e(e,t,n){var r=(0,i.log2)(Math.max(e,t))+1;this.levels=[];for(var s=0;s<r;s++){for(var o=new Uint8Array(e*t),a=0,c=o.length;a<c;a++)o[a]=n;var l={width:e,height:t,items:o};this.levels.push(l),e=Math.ceil(e/2),t=Math.ceil(t/2)}}return e.prototype={reset:function(e,t,n){for(var r=0;r<this.levels.length;){var i=this.levels[r],s=e+t*i.width;i.index=s;var o=i.items[s];if(255===o)break;if(o>n)return this.currentLevel=r,this.propagateValues(),!1;e>>=1,t>>=1,r++}return this.currentLevel=r-1,!0},incrementValue:function(e){var t=this.levels[this.currentLevel];t.items[t.index]=e+1,this.propagateValues()},propagateValues:function(){for(var e=this.currentLevel,t=this.levels[e],n=t.items[t.index];--e>=0;)(t=this.levels[e]).items[t.index]=n},nextLevel:function(){var e=this.currentLevel,t=this.levels[e],n=t.items[t.index];return t.items[t.index]=255,!(--e<0)&&(this.currentLevel=e,(t=this.levels[e]).items[t.index]=n,!0)}},e}(),k=function(){var e=new Uint8Array([0,5,8,0,3,7,8,0,4,7,8,0,0,0,0,0,1,6,8,0,3,7,8,0,4,7,8,0,0,0,0,0,2,6,8,0,3,7,8,0,4,7,8,0,0,0,0,0,2,6,8,0,3,7,8,0,4,7,8,0,0,0,0,0,2,6,8,0,3,7,8,0,4,7,8]),t=new Uint8Array([0,3,4,0,5,7,7,0,8,8,8,0,0,0,0,0,1,3,4,0,6,7,7,0,8,8,8,0,0,0,0,0,2,3,4,0,6,7,7,0,8,8,8,0,0,0,0,0,2,3,4,0,6,7,7,0,8,8,8,0,0,0,0,0,2,3,4,0,6,7,7,0,8,8,8]),n=new Uint8Array([0,1,2,0,1,2,2,0,2,2,2,0,0,0,0,0,3,4,5,0,4,5,5,0,5,5,5,0,0,0,0,0,6,7,7,0,7,7,7,0,7,7,7,0,0,0,0,0,8,8,8,0,8,8,8,0,8,8,8,0,0,0,0,0,8,8,8,0,8,8,8,0,8,8,8]);function r(r,i,s,o,a){let c;this.width=r,this.height=i,c="HH"===s?n:"HL"===s?t:e,this.contextLabelTable=c;var l=r*i;let h;this.neighborsSignificance=new Uint8Array(l),this.coefficentsSign=new Uint8Array(l),h=a>14?new Uint32Array(l):a>6?new Uint16Array(l):new Uint8Array(l),this.coefficentsMagnitude=h,this.processingFlags=new Uint8Array(l);var f=new Uint8Array(l);if(0!==o)for(var u=0;u<l;u++)f[u]=o;this.bitsDecoded=f,this.reset()}return r.prototype={setDecoder:function(e){this.decoder=e},reset:function(){this.contexts=new Int8Array(19),this.contexts[0]=8,this.contexts[17]=92,this.contexts[18]=6},setNeighborsSignificance:function(e,t,n){var r,i=this.neighborsSignificance,s=this.width,o=this.height,a=t>0,c=t+1<s;e>0&&(r=n-s,a&&(i[r-1]+=16),c&&(i[r+1]+=16),i[r]+=4),e+1<o&&(r=n+s,a&&(i[r-1]+=16),c&&(i[r+1]+=16),i[r]+=4),a&&(i[n-1]+=1),c&&(i[n+1]+=1),i[n]|=128},runSignificancePropagationPass:function(){for(var e=this.decoder,t=this.width,n=this.height,r=this.coefficentsMagnitude,i=this.coefficentsSign,s=this.neighborsSignificance,o=this.processingFlags,a=this.contexts,c=this.contextLabelTable,l=this.bitsDecoded,h=0;h<n;h+=4)for(var f=0;f<t;f++)for(var u=h*t+f,d=0;d<4;d++,u+=t){var p=h+d;if(p>=n)break;if(o[u]&=-2,!r[u]&&s[u]){var m=c[s[u]];if(e.readBit(a,m)){var g=this.decodeSignBit(p,f,u);i[u]=g,r[u]=1,this.setNeighborsSignificance(p,f,u),o[u]|=2}l[u]++,o[u]|=1}}},decodeSignBit:function(e,t,n){var r,i,s,o,a,c,l=this.width,h=this.height,f=this.coefficentsMagnitude,u=this.coefficentsSign;o=t>0&&0!==f[n-1],t+1<l&&0!==f[n+1]?(s=u[n+1],r=o?1-s-(i=u[n-1]):1-s-s):r=o?1-(i=u[n-1])-i:0;var d=3*r;return o=e>0&&0!==f[n-l],e+1<h&&0!==f[n+l]?(s=u[n+l],r=o?1-s-(i=u[n-l])+d:1-s-s+d):r=o?1-(i=u[n-l])-i+d:d,r>=0?(a=9+r,c=this.decoder.readBit(this.contexts,a)):(a=9-r,c=1^this.decoder.readBit(this.contexts,a)),c},runMagnitudeRefinementPass:function(){for(var e,t=this.decoder,n=this.width,r=this.height,i=this.coefficentsMagnitude,s=this.neighborsSignificance,o=this.contexts,a=this.bitsDecoded,c=this.processingFlags,l=n*r,h=4*n,f=0;f<l;f=e){e=Math.min(l,f+h);for(var u=0;u<n;u++)for(var d=f+u;d<e;d+=n)if(i[d]&&0==(1&c[d])){var p=16;if(0!=(2&c[d]))c[d]^=2,p=0===(127&s[d])?15:14;var m=t.readBit(o,p);i[d]=i[d]<<1|m,a[d]++,c[d]|=1}}},runCleanupPass:function(){for(var e,t=this.decoder,n=this.width,r=this.height,i=this.neighborsSignificance,s=this.coefficentsMagnitude,o=this.coefficentsSign,a=this.contexts,c=this.contextLabelTable,l=this.bitsDecoded,h=this.processingFlags,f=n,u=2*n,d=3*n,p=0;p<r;p=e){e=Math.min(p+4,r);for(var m=p*n,g=p+3<r,b=0;b<n;b++){var v,y=m+b,x=0,w=y,C=p;if(g&&0===h[y]&&0===h[y+f]&&0===h[y+u]&&0===h[y+d]&&0===i[y]&&0===i[y+f]&&0===i[y+u]&&0===i[y+d]){if(!t.readBit(a,18)){l[y]++,l[y+f]++,l[y+u]++,l[y+d]++;continue}0!==(x=t.readBit(a,17)<<1|t.readBit(a,17))&&(C=p+x,w+=x*n),v=this.decodeSignBit(C,b,w),o[w]=v,s[w]=1,this.setNeighborsSignificance(C,b,w),h[w]|=2,w=y;for(var P=p;P<=C;P++,w+=n)l[w]++;x++}for(C=p+x;C<e;C++,w+=n)if(!s[w]&&0==(1&h[w])){var T=c[i[w]];1===t.readBit(a,T)&&(v=this.decodeSignBit(C,b,w),o[w]=v,s[w]=1,this.setNeighborsSignificance(C,b,w),h[w]|=2),l[w]++}}}},checkSegmentationSymbol:function(){var e=this.decoder,t=this.contexts;if(10!==(e.readBit(t,17)<<3|e.readBit(t,17)<<2|e.readBit(t,17)<<1|e.readBit(t,17)))throw new o("Invalid segmentation symbol")}},r}(),S=function(){function e(){}return e.prototype.calculate=function(e,t,n){for(var r=e[0],i=1,s=e.length;i<s;i++)r=this.iterate(r,e[i],t,n);return r},e.prototype.extend=function(e,t,n){var r=t-1,i=t+1,s=t+n-2,o=t+n;e[r--]=e[i++],e[o++]=e[s--],e[r--]=e[i++],e[o++]=e[s--],e[r--]=e[i++],e[o++]=e[s--],e[r]=e[i],e[o]=e[s]},e.prototype.iterate=function(e,t,n,r){var i,s,o,a,c,l,h=e.width,f=e.height,u=e.items,d=t.width,p=t.height,m=t.items;for(o=0,i=0;i<f;i++)for(a=2*i*d,s=0;s<h;s++,o++,a+=2)m[a]=u[o];u=e.items=null;var g=new Float32Array(d+8);if(1===d){if(0!=(1&n))for(l=0,o=0;l<p;l++,o+=d)m[o]*=.5}else for(l=0,o=0;l<p;l++,o+=d)g.set(m.subarray(o,o+d),4),this.extend(g,4,d),this.filter(g,4,d),m.set(g.subarray(4,4+d),o);var b=16,v=[];for(i=0;i<b;i++)v.push(new Float32Array(p+8));var y,x=0;if(e=4+p,1===p){if(0!=(1&r))for(c=0;c<d;c++)m[c]*=.5}else for(c=0;c<d;c++){if(0===x){for(b=Math.min(d-c,b),o=c,a=4;a<e;o+=d,a++)for(y=0;y<b;y++)v[y][a]=m[o+y];x=b}var w=v[--x];if(this.extend(w,4,p),this.filter(w,4,p),0===x)for(o=c-b+1,a=4;a<e;o+=d,a++)for(y=0;y<b;y++)m[o+y]=v[y][a]}return{width:d,height:p,items:m}},e}(),L=function(){function e(){S.call(this)}return e.prototype=Object.create(S.prototype),e.prototype.filter=function(e,t,n){var r,i,s,o,a=n>>1,c=-1.586134342059924,l=-.052980118572961,h=.882911075530934,f=.443506852043971,u=1.230174104914001;for(r=(t|=0)-3,i=a+4;i--;r+=2)e[r]*=.8128930661159609;for(s=f*e[(r=t-2)-1],i=a+3;i--&&(o=f*e[r+1],e[r]=u*e[r]-s-o,i--);r+=2)s=f*e[(r+=2)+1],e[r]=u*e[r]-s-o;for(s=h*e[(r=t-1)-1],i=a+2;i--&&(o=h*e[r+1],e[r]-=s+o,i--);r+=2)s=h*e[(r+=2)+1],e[r]-=s+o;for(s=l*e[(r=t)-1],i=a+1;i--&&(o=l*e[r+1],e[r]-=s+o,i--);r+=2)s=l*e[(r+=2)+1],e[r]-=s+o;if(0!==a)for(s=c*e[(r=t+1)-1],i=a;i--&&(o=c*e[r+1],e[r]-=s+o,i--);r+=2)s=c*e[(r+=2)+1],e[r]-=s+o},e}(),O=function(){function e(){S.call(this)}return e.prototype=Object.create(S.prototype),e.prototype.filter=function(e,t,n){var r,i,s=n>>1;for(r=t|=0,i=s+1;i--;r+=2)e[r]-=e[r-1]+e[r+1]+2>>2;for(r=t+1,i=s;i--;r+=2)e[r]+=e[r-1]+e[r+1]>>1},e}();return t}();t.JpxImage=a}])}));
|
package/lib/README.md
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
It's *very highly* recommended to *not* use these files, but rather use the
|
2
|
+
pre-built library as found in e.g. the `/build`, `/web`, and `/image_decoders`
|
3
|
+
folders in the root of this repository.
|
4
|
+
|
5
|
+
Please note that the "lib" build target exists mostly to enable unit-testing in
|
6
|
+
Node.js/Travis, and that you'll need to handle e.g. any necessary polyfills
|
7
|
+
and/or Node.js dependencies yourself if using the files in this folder.
|