UNPKG

pdfjs-dist

Version:

Generic build of Mozilla's PDF.js library.

22 lines 95.4 kB
/** * @licstart The following is the entire license notice for the * Javascript code in this page * * Copyright 2020 Mozilla Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @licend The above is the entire license notice for the * Javascript code in this page */ !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(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},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 i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},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 i.getVerbosityLevel}}),Object.defineProperty(t,"setVerbosityLevel",{enumerable:!0,get:function(){return i.setVerbosityLevel}}),Object.defineProperty(t,"Jbig2mage",{enumerable:!0,get:function(){return r.Jbig2mage}}),Object.defineProperty(t,"JpegImage",{enumerable:!0,get:function(){return s.JpegImage}}),Object.defineProperty(t,"JpxImage",{enumerable:!0,get:function(){return o.JpxImage}});var i=n(1),r=n(3),s=n(7),o=n(8)},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 i=0;i<t;i++)n+=u(e[i]);let i=0;const r=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;r.set(t,i),i+=s}return r},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 i=0;i<t;i+=8192){const r=Math.min(i+8192,t),s=e.subarray(i,r);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,i){e.resolve=function(e){t=!0,n(e)},e.reject=function(e){t=!0,i(e)}})),e},t.getVerbosityLevel=function(){return r},t.info=function(e){r>=i.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 i=new URL(t,n);return n.origin===i.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)&&(r=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 i=2;i<t;i+=2)n.push(String.fromCharCode(e.charCodeAt(i)<<8|e.charCodeAt(i+1)));else if("ÿ"===e[0]&&"þ"===e[1])for(let i=2;i<t;i+=2)n.push(String.fromCharCode(e.charCodeAt(i+1)<<8|e.charCodeAt(i)));else for(let i=0;i<t;++i){const t=b[e.charCodeAt(i)];n.push(t?String.fromCharCode(t):e.charAt(i))}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.NativeImageDecoding=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.NativeImageDecoding={NONE:"none",DECODE:"decode",DISPLAY:"display"};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 i={ERRORS:0,WARNINGS:1,INFOS:5};t.VerbosityLevel=i;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"};t.PasswordResponses={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let r=i.WARNINGS;function s(e){r>=i.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 i=0;i<t;++i)n[i]=255&e.charCodeAt(i);return n}function u(e){return void 0!==e.length?e.length:(a(void 0!==e.byteLength),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),i=g.applyTransform(e.slice(2,4),t),r=g.applyTransform([e[0],e[3]],t),s=g.applyTransform([e[2],e[1]],t);return[Math.min(n[0],i[0],r[0],s[0]),Math.min(n[1],i[1],r[1],s[1]),Math.max(n[0],i[0],r[0],s[0]),Math.max(n[1],i[1],r[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],i=e[0]*t[1]+e[1]*t[3],r=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-r*i))/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 i=[e[0],e[2],t[0],t[2]].sort(n),r=[e[1],e[3],t[1],t[3]].sort(n),s=[];return e=g.normalizeRect(e),t=g.normalizeRect(t),i[0]===e[0]&&i[1]===t[0]||i[0]===t[0]&&i[1]===e[0]?(s[0]=i[1],s[2]=i[2],r[0]===e[1]&&r[1]===t[1]||r[0]===t[1]&&r[1]===e[1]?(s[1]=r[1],s[3]=r[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,i=!1){if(!i&&URL.createObjectURL){const e=new Blob([t],{type:n});return URL.createObjectURL(e)}let r=`data:${n};base64,`;for(let n=0,i=t.length;n<i;n+=3){const s=255&t[n],o=255&t[n+1],a=255&t[n+2];r+=e[s>>2]+e[(3&s)<<4|o>>4]+e[n+1<i?(15&o)<<2|a>>6:64]+e[n+2<i?63&a:64]}return r}}();t.createObjectURL=v},function(e,t,n){},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Jbig2Image=void 0;var i=n(1),r=n(4),s=n(5),o=n(6);class a extends i.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 i=e.getContexts(t),r=1;function s(e){for(var t=0,s=0;s<e;s++){var o=n.readBit(i,r);r=r<256?r<<1|o:511&(r<<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 i=e.getContexts("IAID"),r=1,s=0;s<n;s++){r=r<<1|t.readBit(i,r)}return n<31?r&(1<<n)-1:2147483647&r}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,i.shadow)(this,"decoder",e)},get contextCache(){var t=new e;return(0,i.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,i,r,s,o,a){if(e){return D(new O(a.data,a.start,a.end),t,n,!1)}if(0===i&&!s&&!r&&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 i,r,s,o,a,c,l,h=n.decoder,f=n.contextCache.getContexts("GB"),u=[];for(r=0;r<t;r++)for(a=u[r]=new Uint8Array(e),c=r<1?a:u[r-1],i=(l=r<2?a:u[r-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,i),i=(31735&i)<<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[i].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[i],_=new Uint8Array(t),F=[],N=a.decoder,z=a.contextCache.getContexts("GB"),H=0,X=0,Y=0;Y<n;Y++){if(r)if(H^=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(X=X<<1&v,d=0;d<C;d++)S=Y+T[d],L=k+P[d],(A=F[S][L])&&(X|=A=I[d]);else for(X=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])&&(X|=A<<E);var q=N.readBit(z,X);_[k]=q}}return F}function m(e,t,n,i,r,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=i[0].length,C=i.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]-r,E<0||E>=C||D<0||D>=w?M<<=1:M=M<<1|i[E][D];var B=I.readBit(k,M);O[A]=B}}return T}function g(e,t,i,r,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<r;P++){if(T=new Uint8Array(i),s)for(var k=0;k<i;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 r=0;l>1&&(r=e?C.readBits(w):n(L,"IAIT",S));var D=l*O+r,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,H,X,Y=D-(1&p?0:_-1),q=E-(2&p?R-1:0);if(u){for(z=0;z<_;z++)if(T=I[q+z]){X=U[z];var j=Math.min(i-Y,R);switch(g){case 0:for(H=0;H<j;H++)T[Y+H]|=X[H];break;case 2:for(H=0;H<j;H++)T[Y+H]^=X[H];break;default:throw new a(`operator ${g} is not supported`)}}E+=_-1}else{for(H=0;H<_;H++)if(T=I[Y+H])switch(X=U[H],g){case 0:for(z=0;z<R;z++)T[q+z]|=X[z];break;case 2:for(z=0;z<R;z++)T[q+z]^=X[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,r.readUint32)(e,t);var i=e[t+4],s=63&i;if(!l[s])throw new a("invalid segment type: "+s);n.type=s,n.typeName=l[s],n.deferredNonRetain=!!(128&i);var o=!!(64&i),c=e[t+5],h=c>>5&7,f=[31&c],u=t+6;if(7===c){h=536870911&(0,r.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,r.readUint16)(e,u):(0,r.readUint32)(e,u),b.push(t),u+=p}if(n.referredTo=b,o?(n.pageAssociation=(0,r.readUint32)(e,u),u+=4):n.pageAssociation=e[u++],n.length=(0,r.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,i){for(var r=[],s=n;s<i;){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),r.push(a),51===o.type)break}if(e.randomAccess)for(var c=0,l=r.length;c<l;c++)r[c].start=s,s+=r[c].header.length,r[c].end=s;return r}function y(e,t){return{width:(0,r.readUint32)(e,t),height:(0,r.readUint32)(e,t+4),x:(0,r.readUint32)(e,t+8),y:(0,r.readUint32)(e,t+12),combinationOperator:7&e[t+16]}}var x=17;function w(e,t){var n,i,s,o,c=e.header,l=e.data,h=e.start,f=e.end;switch(c.type){case 0:var u={},d=(0,r.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,i=[],s=0;s<o;s++)i.push({x:(0,r.readInt8)(l,h),y:(0,r.readInt8)(l,h+1)}),h+=2;u.at=i}if(u.refinement&&!u.refinementTemplate){for(i=[],s=0;s<2;s++)i.push({x:(0,r.readInt8)(l,h),y:(0,r.readInt8)(l,h+1)}),h+=2;u.refinementAt=i}u.numberOfExportedSymbols=(0,r.readUint32)(l,h),h+=4,u.numberOfNewSymbols=(0,r.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,r.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,r.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(i=[],s=0;s<2;s++)i.push({x:(0,r.readInt8)(l,h),y:(0,r.readInt8)(l,h+1)}),h+=2;p.refinementAt=i}p.numberOfSymbolInstances=(0,r.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,r.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,r.readUint32)(l,h),h+=4,P.gridHeight=(0,r.readUint32)(l,h),h+=4,P.gridOffsetX=4294967295&(0,r.readUint32)(l,h),h+=4,P.gridOffsetY=4294967295&(0,r.readUint32)(l,h),h+=4,P.gridVectorX=(0,r.readUint16)(l,h),h+=2,P.gridVectorY=(0,r.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,i=[],s=0;s<o;s++)i.push({x:(0,r.readInt8)(l,h),y:(0,r.readInt8)(l,h+1)}),h+=2;b.at=i}n=[b,l,h,f];break;case 48:var w={width:(0,r.readUint32)(l,h),height:(0,r.readUint32)(l,h+4),resolutionX:(0,r.readUint32)(l,h+8),resolutionY:(0,r.readUint32)(l,h+12)};4294967295===w.height&&delete w.height;var C=l[h+16];(0,r.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,i=e.length;n<i;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 i=0,r=n.length;i<r;i++)n[i]=255;this.buffer=n},drawBitmap:function(e,t){var n,i,r,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(r=d,s=p,i=0;i<c;i++)t[n][i]&&(u[s]|=r),(r>>=1)||(r=128,s++);p+=h}break;case 2:for(n=0;n<l;n++){for(r=d,s=p,i=0;i<c;i++)t[n][i]&&(u[s]^=r),(r>>=1)||(r=128,s++);p+=h}break;default:throw new a(`operator ${f} is not supported`)}},onImmediateGenericRegion:function(e,n,i,r){var s=e.info,o=new t(n,i,r),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,i,s,o,l,h){let f,u;e.huffman&&(f=function(e,t,n){let i,r,s,o,c=0;switch(e.huffmanDHSelector){case 0:case 1:i=L(e.huffmanDHSelector+4);break;case 3:i=A(c,t,n),c++;break;default:throw new a("invalid Huffman DH selector")}switch(e.huffmanDWSelector){case 0:case 1:r=L(e.huffmanDWSelector+2);break;case 3:r=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:i,tableDeltaWidth:r,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[i]=function(e,t,i,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,r.log2)(i.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 r=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(r+=S,s+=r,t){var O=n(P,"IAAI",C);if(O>1)k=g(e,t,r,x,0,O,1,i.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(r,x,u,A<i.length?i[A]:y[A-i.length],M,B,!1,d,b)}y.push(k)}else e?I.push(r):(k=p(!1,r,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,i=v.position+e;v.end=i,t=D(v,s,x,!1),v.end=n,v.position=i}const n=I.length;if(o===n-1)y.push(t);else{let e,i,r,s,a,c=0;for(e=o;e<n;e++){for(s=I[e],r=c+s,a=[],i=0;i<x;i++)a.push(t[i].subarray(c,r));y.push(a),c=r}}}}for(var U=[],R=[],_=!1,F=i.length+s;R.length<F;){for(var N=e?T.decode(v):n(P,"IAEX",C);N--;)R.push(_);_=!_}for(var z=0,H=i.length;z<H;z++)R[z]&&U.push(i[z]);for(var X=0;X<s;z++,X++)R[z]&&U.push(y[X]);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,i,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,r.log2)(u.length);e.huffman&&(h=new O(i,s,o),l=function(e,t,n,i,r){const s=[];for(let e=0;e<=34;e++){const t=r.readBits(4);s.push(new T([e,t,0,0]))}const o=new k(s,!1);s.length=0;for(let e=0;e<i;){const t=o.decode(r);if(t>=32){let n,i,o;switch(t){case 32:if(0===e)throw new a("no previous value in symbol ID table");i=r.readBits(2)+3,n=s[e-1].prefixLength;break;case 33:i=r.readBits(3)+3,n=0;break;case 34:i=r.readBits(7)+11,n=0;break;default:throw new a("invalid code length in symbol ID table")}for(o=0;o<i;o++)s.push(new T([e,n,0,0])),e++}else s.push(new T([e,t,0,0])),e++}r.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(i,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,i,r,s){let o=this.patterns;o||(this.patterns=o={});const a=new t(i,r,s);o[n]=function(e,t,n,i,r,s){const o=[];e||(o.push({x:-t,y:0}),0===r&&(o.push({x:-3,y:-1}),o.push({x:2,y:-2}),o.push({x:-2,y:-2})));const a=p(e,(i+1)*t,n,r,!1,null,o,s),c=[];for(let e=0;e<=i;e++){const i=[],r=t*e,s=r+t;for(let e=0;e<n;e++)i.push(a[e].subarray(r,s));c.push(i)}return c}(e.mmr,e.patternWidth,e.patternHeight,e.maxPatternIndex,e.template,a)},onImmediateHalftoneRegion(e,n,i,s,o){const c=this.patterns[n[0]],l=e.info,h=new t(i,s,o),f=function(e,t,n,i,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(i),o)for(x=0;x<i;x++)w[x]=o;v.push(w)}const C=t.length,P=t[0],T=P[0].length,I=P.length,k=(0,r.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,H;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<=i&&N>=0&&N+I<=s)for(y=0;y<I;y++)for(H=v[N+y],z=_[y],x=0;x<T;x++)H[F+x]|=z[x];else{let e,t;for(y=0;y<I;y++)if(t=N+y,!(t<0||t>=s))for(H=v[t],z=_[y],x=0;x<T;x++)e=F+x,e>=0&&e<i&&(H[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,i){let s=this.customTables;s||(this.customTables=s={}),s[e]=function(e,t,n){const i=e[t],s=4294967295&(0,r.readUint32)(e,t+1),o=4294967295&(0,r.readUint32)(e,t+5),a=new O(e,t+9,n),c=1+(i>>1&7),l=1+(i>>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&i&&(f=a.readBits(c),h.push(new T([f,0])));return new k(h,!1)}(t,n,i)}},I.prototype={buildTree(e,t){const n=e.prefixCode>>t&1;if(t<=0)this.children[n]=new I(e);else{let i=this.children[n];i||(this.children[n]=i=new I(null)),i.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 i=0;i<t;i++)n=Math.max(n,e[i].prefixLength);const i=new Uint32Array(n+1);for(let n=0;n<t;n++)i[e[n].prefixLength]++;let r,s,o,a=1,c=0;for(i[0]=0;a<=n;){for(c=c+i[a-1]<<1,r=c,s=0;s<t;)o=e[s],o.prefixLength===a&&(o.prefixCode=r,r++),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 i=0;for(let r=0,s=t.length;r<s;r++){const s=n[t[r]];if(s){if(e===i)return s;i++}}throw new a("can't find custom Huffman table")}function E(e,t,n){const i=[];for(let r=0;r<n;r++){const n=new Uint8Array(t);i.push(n);for(let i=0;i<t;i++)n[i]=e.readBit();e.byteAlign()}return i}function D(e,t,n,i){const r={K:-1,Columns:t,Rows:n,BlackIs1:!0,EndOfBlock:i},s=new o.CCITTFaxDecoder(e,r),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 i=0;i<t;i++)n<0&&(c=s.readNextChar(),-1===c&&(c=0,l=!0),n=7),e[i]=c>>n&1,n--}if(i&&!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,i=e.length;n<i;n++){var r=e[n];C(v({},r.data,r.start,r.end),t)}return t.buffer}(e),parse(e){const{imgData:t,width:n,height:i}=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 i=Object.create(null);n+=8;const s=e[n++];i.randomAccess=!(1&s),2&s||(i.numberOfPages=(0,r.readUint32)(e,n),n+=4);const o=v(i,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=i,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:r=!0}){let s,o=0;for(;e;){const a=n?e.getArray(t):e.get(t);if(void 0!==a){if(r)return a;s||(s=[]),s.push(a)}if(++o>100){(0,i.warn)(`getInheritableProperty: maximum loop count exceeded for "${t}"`);break}e=e.get("Parent")}return s},t.toRomanNumerals=function(e,t=!1){(0,i.assert)(Number.isInteger(e)&&e>0,"The number should be a positive integer.");const n=[];let r;for(;e>=1e3;)e-=1e3,n.push("M");r=e/100|0,e%=100,n.push(a[r]),r=e/10|0,e%=10,n.push(a[10+r]),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 i=n(1);class r extends i.BaseException{constructor(e,t){super(`Missing data [${e}, ${t})`),this.begin=e,this.end=t}}t.MissingDataException=r;class s extends i.BaseException{}t.XRefEntryException=s;class o extends i.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 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}];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,r=1&e[t];const s=i[n],o=s.qe;let a,c=this.a-o;if(this.chigh<o)c<o?(c=o,a=r,n=s.nmps):(c=o,a=1^r,1===s.switchFlag&&(r=a),n=s.nlps);else{if(this.chigh-=o,0!=(32768&c))return this.a=c,r;c<o?(a=1^r,1===s.switchFlag&&(r=a),n=s.nlps):(a=r,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|r,a}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CCITTFaxDecoder=void 0;var i=n(1);const r=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]],r=[[-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(